1.1 --- a/.hgtags Tue Mar 29 11:29:01 2011 -0700
1.2 +++ b/.hgtags Tue Mar 29 20:19:55 2011 -0700
1.3 @@ -109,3 +109,4 @@
1.4 6bbc7a4734952ae7604578f270e1566639fa8752 jdk7-b132
1.5 5e5f68a01d12a4432172f384d5201f3a05254493 jdk7-b133
1.6 554adcfb615e63e62af530b1c10fcf7813a75b26 jdk7-b134
1.7 +d8ced728159fbb2caa8b6adb477fd8efdbbdf179 jdk7-b135
2.1 --- a/make/com/sun/Makefile Tue Mar 29 11:29:01 2011 -0700
2.2 +++ b/make/com/sun/Makefile Tue Mar 29 20:19:55 2011 -0700
2.3 @@ -1,5 +1,5 @@
2.4 #
2.5 -# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
2.6 +# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
2.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2.8 #
2.9 # This code is free software; you can redistribute it and/or modify it
2.10 @@ -44,7 +44,7 @@
2.11 SUBDIRS_management = jmx
2.12 SUBDIRS_desktop = image
2.13 SUBDIRS_enterprise = crypto/provider jndi \
2.14 - org xml rowset net/httpserver
2.15 + org rowset net/httpserver
2.16 SUBDIRS_misc = $(SCRIPT_SUBDIR) tracing servicetag nio demo
2.17
2.18 # Omit mirror since it's built with the apt tool.
3.1 --- a/make/com/sun/xml/Makefile Tue Mar 29 11:29:01 2011 -0700
3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
3.3 @@ -1,44 +0,0 @@
3.4 -#
3.5 -# Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
3.6 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3.7 -#
3.8 -# This code is free software; you can redistribute it and/or modify it
3.9 -# under the terms of the GNU General Public License version 2 only, as
3.10 -# published by the Free Software Foundation. Oracle designates this
3.11 -# particular file as subject to the "Classpath" exception as provided
3.12 -# by Oracle in the LICENSE file that accompanied this code.
3.13 -#
3.14 -# This code is distributed in the hope that it will be useful, but WITHOUT
3.15 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3.16 -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3.17 -# version 2 for more details (a copy is included in the LICENSE file that
3.18 -# accompanied this code).
3.19 -#
3.20 -# You should have received a copy of the GNU General Public License version
3.21 -# 2 along with this work; if not, write to the Free Software Foundation,
3.22 -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3.23 -#
3.24 -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3.25 -# or visit www.oracle.com if you need additional information or have any
3.26 -# questions.
3.27 -#
3.28 -
3.29 -#
3.30 -# Makefile for building packages under javax.xml
3.31 -#
3.32 -
3.33 -BUILDDIR = ../../..
3.34 -PACKAGE = com.sun.xml
3.35 -PRODUCT = xml
3.36 -include $(BUILDDIR)/common/Defs.gmk
3.37 -
3.38 -#
3.39 -# Files to compile
3.40 -#
3.41 -AUTO_FILES_JAVA_DIRS = com/sun/activation \
3.42 - org/relaxng/datatype
3.43 -
3.44 -#
3.45 -# Rules
3.46 -#
3.47 -include $(BUILDDIR)/common/Classes.gmk
4.1 --- a/make/common/Defs-linux.gmk Tue Mar 29 11:29:01 2011 -0700
4.2 +++ b/make/common/Defs-linux.gmk Tue Mar 29 20:19:55 2011 -0700
4.3 @@ -1,5 +1,5 @@
4.4 #
4.5 -# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
4.6 +# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
4.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4.8 #
4.9 # This code is free software; you can redistribute it and/or modify it
4.10 @@ -107,6 +107,8 @@
4.11 LDFLAGS_COMMON_sparcv9 += -m64 -mcpu=v9
4.12 CFLAGS_REQUIRED_sparc += -m32 -mcpu=v9
4.13 LDFLAGS_COMMON_sparc += -m32 -mcpu=v9
4.14 +CFLAGS_REQUIRED_arm += -fsigned-char -D_LITTLE_ENDIAN
4.15 +CFLAGS_REQUIRED_ppc += -fsigned-char -D_BIG_ENDIAN
4.16 ifeq ($(ZERO_BUILD), true)
4.17 CFLAGS_REQUIRED = $(ZERO_ARCHFLAG)
4.18 ifeq ($(ZERO_ENDIANNESS), little)
4.19 @@ -143,11 +145,9 @@
4.20 #
4.21 # Misc compiler options
4.22 #
4.23 -ifeq ($(ARCH),ppc)
4.24 - CFLAGS_COMMON = -fsigned-char
4.25 -else # ARCH
4.26 +ifneq ($(ARCH),ppc)
4.27 CFLAGS_COMMON = -fno-strict-aliasing
4.28 -endif # ARCH
4.29 +endif
4.30 PIC_CODE_LARGE = -fPIC
4.31 PIC_CODE_SMALL = -fpic
4.32 GLOBAL_KPIC = $(PIC_CODE_LARGE)
4.33 @@ -219,8 +219,19 @@
4.34 # The environment variable LD_LIBRARY_PATH will over-ride these runpaths.
4.35 # Try: 'readelf -d lib*.so' to see these settings in a library.
4.36 #
4.37 - LDFLAGS_COMMON += -Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$ORIGIN
4.38 - LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$ORIGIN/%)
4.39 + Z_ORIGIN_FLAG/sparc = -Xlinker -z -Xlinker origin
4.40 + Z_ORIGIN_FLAG/i586 = -Xlinker -z -Xlinker origin
4.41 + Z_ORIGIN_FLAG/amd64 = -Xlinker -z -Xlinker origin
4.42 + Z_ORIGIN_FLAG/ia64 = -Xlinker -z -Xlinker origin
4.43 + Z_ORIGIN_FLAG/arm =
4.44 + Z_ORIGIN_FLAG/ppc =
4.45 + Z_ORIGIN_FLAG/zero = -Xlinker -z -Xlinker origin
4.46 +
4.47 + LDFLAG_Z_ORIGIN = $(Z_ORIGIN_FLAG/$(ARCH_FAMILY))
4.48 +
4.49 + LDFLAGS_COMMON += $(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN
4.50 + LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=$(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN/%)
4.51 +
4.52 endif
4.53
4.54 EXTRA_LIBS += -lc
4.55 @@ -315,7 +326,6 @@
4.56 override LIBTHREAD =
4.57 override MOOT_PRIORITIES = true
4.58 override NO_INTERRUPTIBLE_IO = true
4.59 -override OPENWIN_HOME = /usr/X11R6
4.60 ifeq ($(ARCH), amd64)
4.61 override OPENWIN_LIB = $(OPENWIN_HOME)/lib64
4.62 else
4.63 @@ -359,3 +369,9 @@
4.64 INCLUDE_SA = true
4.65 endif
4.66
4.67 +ifdef CROSS_COMPILE_ARCH
4.68 + # X11 headers are not under /usr/include
4.69 + OTHER_CFLAGS += -I$(OPENWIN_HOME)/include
4.70 + OTHER_CXXFLAGS += -I$(OPENWIN_HOME)/include
4.71 + OTHER_CPPFLAGS += -I$(OPENWIN_HOME)/include
4.72 +endif
5.1 --- a/make/common/Defs.gmk Tue Mar 29 11:29:01 2011 -0700
5.2 +++ b/make/common/Defs.gmk Tue Mar 29 20:19:55 2011 -0700
5.3 @@ -116,6 +116,36 @@
5.4 include $(JDK_TOPDIR)/make/common/Defs-$(PLATFORM).gmk
5.5
5.6 #
5.7 +# Cross-compilation Settings
5.8 +#
5.9 +ifdef CROSS_COMPILE_ARCH
5.10 + # Can't run the tools we just built
5.11 + USE_ONLY_BOOTDIR_TOOLS = true
5.12 +
5.13 + # When cross-compiling CC generates code for the target, but
5.14 + # some parts of the build generate C code that has to be compiled
5.15 + # and executed on the build host - HOST_CC is the 'local' compiler.
5.16 + # For linux the default is /usr/bin/gcc; other platforms need to
5.17 + # set it explicitly
5.18 + ifeq ($(PLATFORM), linux)
5.19 + ifndef HOST_CC
5.20 + HOST_CC = $(USRBIN_PATH)gcc
5.21 + endif
5.22 + endif
5.23 +else
5.24 + # Must set HOST_CC if not already set
5.25 + ifndef HOST_CC
5.26 + HOST_CC = $(CC)
5.27 + endif
5.28 +endif
5.29 +
5.30 +# Reset the VM name for client-only builds
5.31 +ifdef BUILD_CLIENT_ONLY
5.32 + VM_NAME = client
5.33 +endif
5.34 +
5.35 +
5.36 +#
5.37 # Freetype logic is applicable to OpenJDK only
5.38 #
5.39 ifdef OPENJDK
5.40 @@ -334,8 +364,7 @@
5.41
5.42 INCLUDES = -I. -I$(CLASSHDRDIR) \
5.43 $(patsubst %,-I%,$(subst $(CLASSPATH_SEPARATOR), ,$(VPATH.h))) $(OTHER_INCLUDES)
5.44 -OTHER_CPPFLAGS = $(INCLUDES)
5.45 -
5.46 +OTHER_CPPFLAGS += $(INCLUDES)
5.47
5.48 #
5.49 # vpaths. These are the default locations searched for source files.
5.50 @@ -466,9 +495,11 @@
5.51 #
5.52 # Tool flags
5.53 #
5.54 +# EXTRA_CFLAGS are used to define cross-compilation options
5.55 +#
5.56 ASFLAGS = $(ASFLAGS_$(VARIANT)) $(ASFLAGS_COMMON) $(OTHER_ASFLAGS)
5.57 -CFLAGS = $(CFLAGS_$(VARIANT)/BYFILE) $(CFLAGS_COMMON) $(OTHER_CFLAGS)
5.58 -CXXFLAGS = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS)
5.59 +CFLAGS = $(CFLAGS_$(VARIANT)/BYFILE) $(CFLAGS_COMMON) $(OTHER_CFLAGS) $(EXTRA_CFLAGS)
5.60 +CXXFLAGS = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS) $(EXTRA_CFLAGS)
5.61 CPPFLAGS = $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \
5.62 $(DEFINES) $(OPTIONS:%=-D%)
5.63 LDFLAGS = $(LDFLAGS_$(VARIANT)) $(LDFLAGS_COMMON) $(OTHER_LDFLAGS)
6.1 --- a/make/common/Program.gmk Tue Mar 29 11:29:01 2011 -0700
6.2 +++ b/make/common/Program.gmk Tue Mar 29 20:19:55 2011 -0700
6.3 @@ -83,7 +83,7 @@
6.4 endif
6.5 endif
6.6 ifeq ($(PLATFORM), linux)
6.7 - LDFLAGS += -Wl,-z -Wl,origin
6.8 + LDFLAGS += $(LDFLAG_Z_ORIGIN)
6.9 LDFLAGS += -Wl,--allow-shlib-undefined
6.10 LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)/jli
6.11 LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../jre/lib/$(LIBARCH)/jli
7.1 --- a/make/common/Release.gmk Tue Mar 29 11:29:01 2011 -0700
7.2 +++ b/make/common/Release.gmk Tue Mar 29 20:19:55 2011 -0700
7.3 @@ -54,9 +54,6 @@
7.4 com.sun.java.swing.plaf.motif \
7.5 com.sun.java.swing.plaf.gtk
7.6
7.7 -# This is a stopgap until 6839872 is fixed.
7.8 -EXCLUDE_PROPWARN_PKGS += sun.dyn
7.9 -
7.10 #
7.11 # Include the exported private packages in ct.sym.
7.12 # This is an interim solution until the ct.sym is replaced
8.1 --- a/make/common/internal/Defs-jaxws.gmk Tue Mar 29 11:29:01 2011 -0700
8.2 +++ b/make/common/internal/Defs-jaxws.gmk Tue Mar 29 20:19:55 2011 -0700
8.3 @@ -1,5 +1,5 @@
8.4 #
8.5 -# Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
8.6 +# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
8.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8.8 #
8.9 # This code is free software; you can redistribute it and/or modify it
8.10 @@ -55,6 +55,7 @@
8.11 com/sun/tools/internal/xjc \
8.12 com/sun/tools/internal/ws \
8.13 com/sun/tools/internal/jxc \
8.14 + org/relaxng \
8.15 META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory \
8.16 - META-INF/services/com.sun.tools.xjc.Plugin
8.17 + META-INF/services/com.sun.tools.internal.xjc.Plugin
8.18
9.1 --- a/make/common/shared/Defs-linux.gmk Tue Mar 29 11:29:01 2011 -0700
9.2 +++ b/make/common/shared/Defs-linux.gmk Tue Mar 29 20:19:55 2011 -0700
9.3 @@ -1,5 +1,5 @@
9.4 #
9.5 -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
9.6 +# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
9.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9.8 #
9.9 # This code is free software; you can redistribute it and/or modify it
9.10 @@ -102,6 +102,14 @@
9.11 COMPILER_PATH =/usr/bin/
9.12 endif
9.13
9.14 +# OPENWIN_HOME: path to where the X11 environment is installed.
9.15 +# NOTE: Must end with / so that it could be empty, allowing PATH usage.
9.16 +ifneq ($(ALT_OPENWIN_HOME),)
9.17 + OPENWIN_HOME :=$(call PrefixPath,$(ALT_OPENWIN_HOME))
9.18 +else
9.19 + OPENWIN_HOME =/usr/X11R6/
9.20 +endif
9.21 +
9.22 # DEVTOOLS_PATH: for other tools required for building (such as zip, etc.)
9.23 # NOTE: Must end with / so that it could be empty, allowing PATH usage.
9.24 ifneq "$(origin ALT_DEVTOOLS_PATH)" "undefined"
9.25 @@ -181,6 +189,7 @@
9.26
9.27 # Macro to check it's input file for banned dependencies and verify the
9.28 # binary built properly. Relies on process exit code.
9.29 +ifndef CROSS_COMPILE_ARCH
9.30 define binary_file_verification # binary_file
9.31 ( \
9.32 $(ECHO) "Checking for mapfile use in: $1" && \
9.33 @@ -193,4 +202,10 @@
9.34 ( $(READELF) -d $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \
9.35 )
9.36 endef
9.37 -
9.38 +else
9.39 +define binary_file_verification
9.40 +( \
9.41 + $(ECHO) "Skipping binary file verification for cross-compile build" \
9.42 +)
9.43 +endef
9.44 +endif
9.45 \ No newline at end of file
10.1 --- a/make/common/shared/Defs-solaris.gmk Tue Mar 29 11:29:01 2011 -0700
10.2 +++ b/make/common/shared/Defs-solaris.gmk Tue Mar 29 20:19:55 2011 -0700
10.3 @@ -1,5 +1,5 @@
10.4 #
10.5 -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
10.6 +# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
10.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
10.8 #
10.9 # This code is free software; you can redistribute it and/or modify it
10.10 @@ -190,6 +190,7 @@
10.11
10.12 # Macro to check it's input file for banned dependencies and verify the
10.13 # binary built properly. Relies on process exit code.
10.14 +ifndef CROSS_COMPILE_ARCH
10.15 define binary_file_verification # binary_file
10.16 ( \
10.17 $(ECHO) "Checking for mapfile use in: $1" && \
10.18 @@ -202,4 +203,10 @@
10.19 ( $(DUMP) -L -v $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \
10.20 )
10.21 endef
10.22 -
10.23 +else
10.24 +define binary_file_verification
10.25 +( \
10.26 + $(ECHO) "Skipping binary file verification for cross-compile build" \
10.27 +)
10.28 +endef
10.29 +endif
10.30 \ No newline at end of file
11.1 --- a/make/common/shared/Defs-utils.gmk Tue Mar 29 11:29:01 2011 -0700
11.2 +++ b/make/common/shared/Defs-utils.gmk Tue Mar 29 20:19:55 2011 -0700
11.3 @@ -1,5 +1,5 @@
11.4 #
11.5 -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
11.6 +# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
11.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
11.8 #
11.9 # This code is free software; you can redistribute it and/or modify it
11.10 @@ -68,9 +68,23 @@
11.11 endif
11.12
11.13 # Utilities
11.14 +ifdef CROSS_COMPILE_ARCH
11.15 + AR = $(COMPILER_PATH)ar
11.16 + AS = $(COMPILER_PATH)as
11.17 + LD = $(COMPILER_PATH)ld
11.18 + MCS = $(COMPILER_PATH)mcs
11.19 + NM = $(COMPILER_PATH)nm
11.20 + STRIP = $(COMPILER_PATH)strip
11.21 +else
11.22 + AR = $(UTILS_CCS_BIN_PATH)ar
11.23 + AS = $(UTILS_CCS_BIN_PATH)as
11.24 + LD = $(UTILS_CCS_BIN_PATH)ld
11.25 + MCS = $(UTILS_CCS_BIN_PATH)mcs
11.26 + NM = $(UTILS_CCS_BIN_PATH)nm
11.27 + STRIP = $(UTILS_CCS_BIN_PATH)strip
11.28 +endif
11.29 +
11.30 ADB = $(UTILS_COMMAND_PATH)adb
11.31 -AR = $(UTILS_CCS_BIN_PATH)ar
11.32 -AS = $(UTILS_CCS_BIN_PATH)as
11.33 BASENAME = $(UTILS_COMMAND_PATH)basename
11.34 BZIP2 = $(UTILS_COMMAND_PATH)bzip2
11.35 CAT = $(UTILS_COMMAND_PATH)cat
11.36 @@ -99,19 +113,16 @@
11.37 ID = $(UTILS_COMMAND_PATH)id
11.38 ISAINFO = $(UTILS_COMMAND_PATH)isainfo
11.39 KSH = $(UTILS_COMMAND_PATH)ksh
11.40 -LD = $(UTILS_CCS_BIN_PATH)ld
11.41 LDD = $(UTILS_USR_BIN_PATH)ldd
11.42 LEX = $(UTILS_CCS_BIN_PATH)lex
11.43 LN = $(UTILS_COMMAND_PATH)ln
11.44 LS = $(UTILS_COMMAND_PATH)ls
11.45 -MCS = $(UTILS_CCS_BIN_PATH)mcs
11.46 M4 = $(UTILS_CCS_BIN_PATH)m4
11.47 MKDIR = $(UTILS_COMMAND_PATH)mkdir
11.48 MKSINFO = $(UTILS_COMMAND_PATH)mksinfo
11.49 MSGFMT = $(UTILS_USR_BIN_PATH)msgfmt
11.50 MV = $(UTILS_COMMAND_PATH)mv
11.51 NAWK = $(UTILS_USR_BIN_PATH)nawk
11.52 -NM = $(UTILS_CCS_BIN_PATH)nm
11.53 PKGMK = $(UTILS_COMMAND_PATH)pkgmk
11.54 PRINTF = $(UTILS_USR_BIN_PATH)printf
11.55 PWD = $(UTILS_COMMAND_PATH)pwd
11.56 @@ -123,7 +134,6 @@
11.57 SH = $(UTILS_COMMAND_PATH)sh
11.58 SHOWREV = $(UTILS_USR_BIN_PATH)showrev
11.59 SORT = $(UTILS_COMMAND_PATH)sort
11.60 -STRIP = $(UTILS_CCS_BIN_PATH)strip
11.61 TAIL = $(UTILS_USR_BIN_PATH)tail
11.62 TAR = $(UTILS_COMMAND_PATH)tar
11.63 TEST = $(UTILS_USR_BIN_PATH)test
11.64 @@ -186,14 +196,16 @@
11.65 # Intrinsic unix command, with backslash-escaped character interpretation
11.66 ECHO = /bin/echo -e
11.67 # These are really in UTILS_USR_BIN_PATH on Linux
11.68 - AR = $(UTILS_USR_BIN_PATH)ar
11.69 - AS = $(UTILS_USR_BIN_PATH)as
11.70 - LD = $(UTILS_USR_BIN_PATH)ld
11.71 + ifndef CROSS_COMPILE_ARCH
11.72 + AR = $(UTILS_USR_BIN_PATH)ar
11.73 + AS = $(UTILS_USR_BIN_PATH)as
11.74 + LD = $(UTILS_USR_BIN_PATH)ld
11.75 + MCS = $(UTILS_USR_BIN_PATH)mcs
11.76 + NM = $(UTILS_USR_BIN_PATH)nm
11.77 + STRIP = $(UTILS_USR_BIN_PATH)strip
11.78 + endif
11.79 LEX = $(UTILS_USR_BIN_PATH)lex
11.80 - MCS = $(UTILS_USR_BIN_PATH)mcs
11.81 M4 = $(UTILS_USR_BIN_PATH)m4
11.82 - NM = $(UTILS_USR_BIN_PATH)nm
11.83 - STRIP = $(UTILS_USR_BIN_PATH)strip
11.84 YACC = $(UTILS_USR_BIN_PATH)yacc
11.85 endif
11.86
12.1 --- a/make/common/shared/Defs-versions.gmk Tue Mar 29 11:29:01 2011 -0700
12.2 +++ b/make/common/shared/Defs-versions.gmk Tue Mar 29 20:19:55 2011 -0700
12.3 @@ -1,5 +1,5 @@
12.4 #
12.5 -# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
12.6 +# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
12.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
12.8 #
12.9 # This code is free software; you can redistribute it and/or modify it
12.10 @@ -138,11 +138,15 @@
12.11 endif
12.12 REQUIRED_COMPILER_NAME = Sun Studio 12 Update 1
12.13 REQUIRED_COMPILER_VERSION = SS12u1
12.14 - ifeq ($(CC_VERSION),sun)
12.15 - REQUIRED_CC_VER = 5.10
12.16 - endif
12.17 - ifeq ($(CC_VERSION),gcc)
12.18 - REQUIRED_CC_VER = 3.4.3
12.19 + # Cross-compilation compiler versions are target specific
12.20 + # so don't set a required version if cross-compiling
12.21 + ifndef CROSS_COMPILE_ARCH
12.22 + ifeq ($(CC_VERSION),sun)
12.23 + REQUIRED_CC_VER = 5.10
12.24 + endif
12.25 + ifeq ($(CC_VERSION),gcc)
12.26 + REQUIRED_CC_VER = 3.4.3
12.27 + endif
12.28 endif
12.29 REQUIRED_GCC_VER = 2.95.2
12.30 endif
12.31 @@ -158,11 +162,15 @@
12.32 REQUIRED_COMPILER_NAME = GCC4
12.33 REQUIRED_COMPILER_VERSION = GCC4
12.34 REQUIRED_GCC_VER = 2.95
12.35 - ifeq ($(CC_VERSION),gcc)
12.36 - REQUIRED_CC_VER = 4.3.0
12.37 - endif
12.38 - ifeq ($(CC_VERSION),sun)
12.39 - REQUIRED_CC_VER = 5.10
12.40 + # Cross-compilation compiler versions are target specific
12.41 + # so don't set a required version if cross-compiling
12.42 + ifndef CROSS_COMPILE_ARCH
12.43 + ifeq ($(CC_VERSION),gcc)
12.44 + REQUIRED_CC_VER = 4.3.0
12.45 + endif
12.46 + ifeq ($(CC_VERSION),sun)
12.47 + REQUIRED_CC_VER = 5.10
12.48 + endif
12.49 endif
12.50 endif
12.51
13.1 --- a/make/common/shared/Platform.gmk Tue Mar 29 11:29:01 2011 -0700
13.2 +++ b/make/common/shared/Platform.gmk Tue Mar 29 20:19:55 2011 -0700
13.3 @@ -1,5 +1,5 @@
13.4 #
13.5 -# Copyright (c) 1997, 20010, Oracle and/or its affiliates. All rights reserved.
13.6 +# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
13.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
13.8 #
13.9 # This code is free software; you can redistribute it and/or modify it
13.10 @@ -155,7 +155,11 @@
13.11 ifeq ($(SYSTEM_UNAME), Linux)
13.12 PLATFORM = linux
13.13 # Arch and OS name/version
13.14 - mach := $(shell uname -m)
13.15 + ifdef CROSS_COMPILE_ARCH
13.16 + mach := $(CROSS_COMPILE_ARCH)
13.17 + else
13.18 + mach := $(shell uname -m)
13.19 + endif
13.20 archExpr = case "$(mach)" in \
13.21 i[3-9]86) \
13.22 echo i586 \
13.23 @@ -192,11 +196,13 @@
13.24 ARCH=sparcv9
13.25 endif
13.26 else
13.27 - # i586 is 32-bit, amd64 is 64-bit
13.28 + # Most archs are 32-bit
13.29 ifndef ARCH_DATA_MODEL
13.30 - ifeq ($(ARCH), i586)
13.31 - ARCH_DATA_MODEL=32
13.32 - else
13.33 + ARCH_DATA_MODEL=32
13.34 + ifeq ($(ARCH), amd64)
13.35 + ARCH_DATA_MODEL=64
13.36 + endif
13.37 + ifeq ($(ARCH), ia64)
13.38 ARCH_DATA_MODEL=64
13.39 endif
13.40 endif
14.1 --- a/make/common/shared/Sanity-Settings.gmk Tue Mar 29 11:29:01 2011 -0700
14.2 +++ b/make/common/shared/Sanity-Settings.gmk Tue Mar 29 20:19:55 2011 -0700
14.3 @@ -1,5 +1,5 @@
14.4 #
14.5 -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
14.6 +# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
14.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
14.8 #
14.9 # This code is free software; you can redistribute it and/or modify it
14.10 @@ -104,7 +104,11 @@
14.11 endif
14.12 ALL_SETTINGS+=$(call addOptionalSetting,COMPILER_NAME)
14.13 ALL_SETTINGS+=$(call addOptionalSetting,COMPILER_VERSION)
14.14 -ALL_SETTINGS+=$(call addRequiredVersionSetting,CC_VER)
14.15 +ifdef REQUIRED_CC_VER
14.16 + ALL_SETTINGS+=$(call addRequiredVersionSetting,CC_VER)
14.17 +else
14.18 + ALL_SETTINGS+=$(call addOptionalSetting,CC_VER)
14.19 +endif
14.20 ifeq ($(PLATFORM),solaris)
14.21 ifeq ($(ARCH_DATA_MODEL), 32)
14.22 ifndef OPENJDK
15.1 --- a/make/common/shared/Sanity.gmk Tue Mar 29 11:29:01 2011 -0700
15.2 +++ b/make/common/shared/Sanity.gmk Tue Mar 29 20:19:55 2011 -0700
15.3 @@ -1,5 +1,5 @@
15.4 #
15.5 -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
15.6 +# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
15.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
15.8 #
15.9 # This code is free software; you can redistribute it and/or modify it
15.10 @@ -220,7 +220,7 @@
15.11 sane-ant_version \
15.12 sane-zip_version \
15.13 sane-unzip_version \
15.14 - sane-msvcrt_path \
15.15 + sane-msvcrt_path \
15.16 sane-freetype
15.17
15.18 ######################################################
15.19 @@ -279,6 +279,12 @@
15.20 " $(YOU_ARE_USING) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL). \n" \
15.21 "" >> $(ERROR_FILE) ; \
15.22 fi
15.23 +ifdef BUILD_CLIENT_ONLY
15.24 + @if [ "$(ARCH_DATA_MODEL)" != 32 ]; then \
15.25 + $(ECHO) "WARNING: You have requested BUILD_CLIENT_ONLY in a 64-bit build.\n" \
15.26 + "" >> $(WARNING_FILE) ; \
15.27 + fi
15.28 +endif
15.29
15.30 ######################################################
15.31 # Check the OS version (windows and linux have release name checks)
15.32 @@ -811,23 +817,26 @@
15.33 ######################################################
15.34
15.35 ifdef OPENJDK
15.36 -
15.37 -# The freetypecheck Makefile prints out "Failed" if not good enough
15.38 -$(TEMPDIR)/freetypeinfo: FRC
15.39 + ifndef CROSS_COMPILE_ARCH
15.40 + # The freetypecheck Makefile prints out "Failed" if not good enough
15.41 + $(TEMPDIR)/freetypeinfo: FRC
15.42 @$(prep-target)
15.43 @(($(CD) $(BUILDDIR)/tools/freetypecheck && $(MAKE)) || \
15.44 $(ECHO) "Failed to build freetypecheck." ) > $@
15.45
15.46 -sane-freetype: $(TEMPDIR)/freetypeinfo
15.47 + sane-freetype: $(TEMPDIR)/freetypeinfo
15.48 @if [ "`$(CAT) $< | $(GREP) Fail`" != "" ]; then \
15.49 $(ECHO) "ERROR: FreeType version " $(REQUIRED_FREETYPE_VERSION) \
15.50 " or higher is required. \n" \
15.51 "`$(CAT) $<` \n" >> $(ERROR_FILE) ; \
15.52 fi
15.53 -
15.54 + else
15.55 + #do nothing (cross-compiling)
15.56 + sane-freetype:
15.57 + endif
15.58 else
15.59 -#do nothing (not OpenJDK)
15.60 -sane-freetype:
15.61 + #do nothing (not OpenJDK)
15.62 + sane-freetype:
15.63 endif
15.64
15.65 ######################################################
15.66 @@ -1296,7 +1305,7 @@
15.67 " Microsoft DirectX 9 SDK can be downloaded from the following location:\n" \
15.68 " http://msdn.microsoft.com/library/default.asp?url=/downloads/list/directx.asp\n" \
15.69 " Or http://www.microsoft.com/directx\n" \
15.70 - "" >> $(WARNING_FILE) ; \
15.71 + "" >> $(WARNING_FILE) ; \
15.72 fi \
15.73 fi \
15.74 fi \
15.75 @@ -1327,13 +1336,16 @@
15.76 ######################################################
15.77 # Check the compiler version(s)
15.78 ######################################################
15.79 -CC_CHECK :=$(call CheckVersions,$(CC_VER),$(REQUIRED_CC_VER))
15.80 +ifdef REQUIRED_CC_VER
15.81 + CC_CHECK :=$(call CheckVersions,$(CC_VER),$(REQUIRED_CC_VER))
15.82 +endif
15.83 sane-compiler: sane-link
15.84 +ifdef REQUIRED_CC_VER
15.85 @if [ "$(CC_CHECK)" = "missing" ]; then \
15.86 $(ECHO) "ERROR: The Compiler version is undefined. \n" \
15.87 "" >> $(ERROR_FILE) ; \
15.88 fi
15.89 -ifndef OPENJDK
15.90 + ifndef OPENJDK
15.91 @if [ "$(CC_CHECK)" != "same" ]; then \
15.92 $(ECHO) "WARNING: The $(PLATFORM) compiler is not version $(REQUIRED_COMPILER_VERSION) $(REQUIRED_CC_VER) \n" \
15.93 " Specifically the $(REQUIRED_COMPILER_NAME) compiler. \n " \
15.94 @@ -1342,6 +1354,7 @@
15.95 " $(COMPILER_PATH) \n" \
15.96 "" >> $(WARNING_FILE) ; \
15.97 fi
15.98 + endif
15.99 endif
15.100
15.101 ######################################################
16.1 --- a/make/docs/CORE_PKGS.gmk Tue Mar 29 11:29:01 2011 -0700
16.2 +++ b/make/docs/CORE_PKGS.gmk Tue Mar 29 20:19:55 2011 -0700
16.3 @@ -1,5 +1,5 @@
16.4 #
16.5 -# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
16.6 +# Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
16.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
16.8 #
16.9 # This code is free software; you can redistribute it and/or modify it
16.10 @@ -55,7 +55,7 @@
16.11 # This is a list of regular expressions. So foo.* matches "foo" and "foo.bar".
16.12 #
16.13 ACTIVE_JSR_PKGS= \
16.14 - java.dyn \
16.15 + java.lang.invoke \
16.16 java.sql \
16.17 javax.activation \
16.18 javax.annotation.* \
16.19 @@ -97,11 +97,11 @@
16.20 java.awt.print \
16.21 java.beans \
16.22 java.beans.beancontext \
16.23 - java.dyn \
16.24 java.io \
16.25 java.lang \
16.26 java.lang.annotation \
16.27 java.lang.instrument \
16.28 + java.lang.invoke \
16.29 java.lang.management \
16.30 java.lang.ref \
16.31 java.lang.reflect \
17.1 --- a/make/java/Makefile Tue Mar 29 11:29:01 2011 -0700
17.2 +++ b/make/java/Makefile Tue Mar 29 20:19:55 2011 -0700
17.3 @@ -1,5 +1,5 @@
17.4 #
17.5 -# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
17.6 +# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
17.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
17.8 #
17.9 # This code is free software; you can redistribute it and/or modify it
17.10 @@ -44,7 +44,7 @@
17.11 SUBDIRS_desktop = awt applet beans
17.12 SUBDIRS_management = management
17.13 SUBDIRS_misc = npt java_crw_demo java_hprof_demo \
17.14 - logging instrument dyn sql rmi
17.15 + logging instrument invoke sql rmi
17.16
17.17
17.18 ifeq ($(PLATFORM), solaris)
18.1 --- a/make/java/dyn/Makefile Tue Mar 29 11:29:01 2011 -0700
18.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
18.3 @@ -1,42 +0,0 @@
18.4 -#
18.5 -# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
18.6 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
18.7 -#
18.8 -# This code is free software; you can redistribute it and/or modify it
18.9 -# under the terms of the GNU General Public License version 2 only, as
18.10 -# published by the Free Software Foundation. Oracle designates this
18.11 -# particular file as subject to the "Classpath" exception as provided
18.12 -# by Oracle in the LICENSE file that accompanied this code.
18.13 -#
18.14 -# This code is distributed in the hope that it will be useful, but WITHOUT
18.15 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18.16 -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18.17 -# version 2 for more details (a copy is included in the LICENSE file that
18.18 -# accompanied this code).
18.19 -#
18.20 -# You should have received a copy of the GNU General Public License version
18.21 -# 2 along with this work; if not, write to the Free Software Foundation,
18.22 -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18.23 -#
18.24 -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
18.25 -# or visit www.oracle.com if you need additional information or have any
18.26 -# questions.
18.27 -#
18.28 -
18.29 -BUILDDIR = ../..
18.30 -
18.31 -PACKAGE = java.dyn
18.32 -PRODUCT = java
18.33 -include $(BUILDDIR)/common/Defs.gmk
18.34 -
18.35 -AUTO_FILES_JAVA_DIRS = java/dyn sun/dyn
18.36 -
18.37 -# The sources built here use new language syntax to generate
18.38 -# method handle calls. Let's be sure we are using that format.
18.39 -LANGUAGE_VERSION = -source 7
18.40 -CLASS_VERSION = -target 7
18.41 -
18.42 -# Tell the compiler not to accept transitional forms.
18.43 -OTHER_JAVACFLAGS = -XDallowTransitionalJSR292=no
18.44 -
18.45 -include $(BUILDDIR)/common/Classes.gmk
19.1 --- a/make/java/instrument/Makefile Tue Mar 29 11:29:01 2011 -0700
19.2 +++ b/make/java/instrument/Makefile Tue Mar 29 20:19:55 2011 -0700
19.3 @@ -1,5 +1,5 @@
19.4 #
19.5 -# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
19.6 +# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
19.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
19.8 #
19.9 # This code is free software; you can redistribute it and/or modify it
19.10 @@ -109,7 +109,7 @@
19.11 LDFLAGS += -R \$$ORIGIN/jli
19.12 endif
19.13 ifeq ($(PLATFORM), linux)
19.14 - LDFLAGS += -Wl,-z -Wl,origin
19.15 + LDFLAGS += $(LDFLAG_Z_ORIGIN)
19.16 LDFLAGS += -Wl,--allow-shlib-undefined
19.17 LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/jli
19.18 endif
20.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
20.2 +++ b/make/java/invoke/Makefile Tue Mar 29 20:19:55 2011 -0700
20.3 @@ -0,0 +1,42 @@
20.4 +#
20.5 +# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
20.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
20.7 +#
20.8 +# This code is free software; you can redistribute it and/or modify it
20.9 +# under the terms of the GNU General Public License version 2 only, as
20.10 +# published by the Free Software Foundation. Oracle designates this
20.11 +# particular file as subject to the "Classpath" exception as provided
20.12 +# by Oracle in the LICENSE file that accompanied this code.
20.13 +#
20.14 +# This code is distributed in the hope that it will be useful, but WITHOUT
20.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20.16 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20.17 +# version 2 for more details (a copy is included in the LICENSE file that
20.18 +# accompanied this code).
20.19 +#
20.20 +# You should have received a copy of the GNU General Public License version
20.21 +# 2 along with this work; if not, write to the Free Software Foundation,
20.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20.23 +#
20.24 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20.25 +# or visit www.oracle.com if you need additional information or have any
20.26 +# questions.
20.27 +#
20.28 +
20.29 +BUILDDIR = ../..
20.30 +
20.31 +PACKAGE = java.lang.invoke
20.32 +PRODUCT = java
20.33 +include $(BUILDDIR)/common/Defs.gmk
20.34 +
20.35 +AUTO_FILES_JAVA_DIRS = java/lang/invoke sun/invoke
20.36 +FILES_java = \
20.37 + java/lang/ClassValue.java \
20.38 + java/lang/BootstrapMethodError.java
20.39 +
20.40 +# The sources built here use new language syntax to generate
20.41 +# method handle calls. Let's be sure we are using that format.
20.42 +LANGUAGE_VERSION = -source 7
20.43 +CLASS_VERSION = -target 7
20.44 +
20.45 +include $(BUILDDIR)/common/Classes.gmk
21.1 --- a/make/java/jli/Makefile Tue Mar 29 11:29:01 2011 -0700
21.2 +++ b/make/java/jli/Makefile Tue Mar 29 20:19:55 2011 -0700
21.3 @@ -78,13 +78,17 @@
21.4 zutil.c
21.5
21.6 ifneq ($(PLATFORM), windows)
21.7 -
21.8 -FILES_c += \
21.9 - $(CTARGDIR)ergo.c \
21.10 - $(CTARGDIR)ergo_$(ERGO_FAMILY).c
21.11 + FILES_c += ergo.c
21.12 + ERGO_ARCH_FILE = ergo_$(ERGO_FAMILY).c
21.13 + # if the architecture specific ergo file exists then
21.14 + # use it, else use the generic definitions from ergo.c
21.15 + ifneq ($(wildcard $(LAUNCHER_PLATFORM_SRC)/$(ERGO_ARCH_FILE)),)
21.16 + FILES_c += $(ERGO_ARCH_FILE)
21.17 + else
21.18 + OTHER_CPPFLAGS += -DUSE_GENERIC_ERGO
21.19 + endif
21.20 endif
21.21
21.22 -
21.23 # Names of arch directories
21.24 LIBARCH_DEFINES = -DLIBARCHNAME='"$(LIBARCH)"'
21.25 ifeq ($(PLATFORM), solaris)
22.1 --- a/make/java/jvm/Makefile Tue Mar 29 11:29:01 2011 -0700
22.2 +++ b/make/java/jvm/Makefile Tue Mar 29 20:19:55 2011 -0700
22.3 @@ -1,5 +1,5 @@
22.4 #
22.5 -# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
22.6 +# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
22.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
22.8 #
22.9 # This code is free software; you can redistribute it and/or modify it
22.10 @@ -43,7 +43,8 @@
22.11 $(PLATFORM_INCLUDE)/%.h: $(PLATFORM_SRC)/javavm/export/%.h
22.12 $(install-file)
22.13
22.14 -JVMCFG = $(LIBDIR)/$(LIBARCH)/jvm.cfg
22.15 +JVMCFG_DIR = $(LIBDIR)/$(LIBARCH)
22.16 +JVMCFG = $(JVMCFG_DIR)/jvm.cfg
22.17
22.18 #
22.19 # How to install jvm.cfg.
22.20 @@ -54,8 +55,21 @@
22.21 JVMCFG_ARCH = $(ARCH)
22.22 endif
22.23
22.24 +ifdef BUILD_CLIENT_ONLY
22.25 +$(JVMCFG)::
22.26 + $(MKDIR) -p $(JVMCFG_DIR)
22.27 + @# Update jvm.cfg to use -client by default and alias -server to -client
22.28 + $(RM) -f $(JVMCFG)
22.29 + $(ECHO) "-client KNOWN">$(JVMCFG)
22.30 + $(ECHO) "-server ALIASED_TO -client">>$(JVMCFG)
22.31 + $(ECHO) "-hotspot ALIASED_TO -client">>$(JVMCFG)
22.32 + $(ECHO) "-classic WARN">>$(JVMCFG)
22.33 + $(ECHO) "-native ERROR">>$(JVMCFG)
22.34 + $(ECHO) "-green ERROR">>$(JVMCFG)
22.35 +else
22.36 $(JVMCFG): $(PLATFORM_SRC)/bin/$(JVMCFG_ARCH)/jvm.cfg
22.37 $(install-file)
22.38 +endif
22.39
22.40 all: build
22.41
23.1 --- a/make/java/nio/Makefile Tue Mar 29 11:29:01 2011 -0700
23.2 +++ b/make/java/nio/Makefile Tue Mar 29 20:19:55 2011 -0700
23.3 @@ -1,5 +1,5 @@
23.4 #
23.5 -# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
23.6 +# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
23.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
23.8 #
23.9 # This code is free software; you can redistribute it and/or modify it
23.10 @@ -820,7 +820,7 @@
23.11
23.12 $(GENSOR_EXE) : $(TEMPDIR)/$(GENSOR_SRC)
23.13 $(prep-target)
23.14 - ($(CD) $(TEMPDIR); $(CC) $(CPPFLAGS) $(LDDFLAGS) \
23.15 + ($(CD) $(TEMPDIR); $(HOST_CC) $(CPPFLAGS) $(LDDFLAGS) \
23.16 -o genSocketOptionRegistry$(EXE_SUFFIX) $(GENSOR_SRC))
23.17
23.18 $(SCH_GEN)/SocketOptionRegistry.java: $(GENSOR_EXE)
23.19 @@ -851,7 +851,7 @@
23.20
23.21 $(GENUC_EXE) : $(GENUC_SRC)
23.22 $(prep-target)
23.23 - $(CC) $(CPPFLAGS) -o $@ $(GENUC_SRC)
23.24 + $(HOST_CC) $(CPPFLAGS) -o $@ $(GENUC_SRC)
23.25
23.26 $(SFS_GEN)/UnixConstants.java: $(GENUC_EXE)
23.27 $(prep-target)
23.28 @@ -867,7 +867,7 @@
23.29
23.30 $(GENSC_EXE) : $(GENSC_SRC)
23.31 $(prep-target)
23.32 - $(CC) $(CPPFLAGS) -o $@ $(GENSC_SRC)
23.33 + $(HOST_CC) $(CPPFLAGS) -o $@ $(GENSC_SRC)
23.34
23.35 $(SFS_GEN)/SolarisConstants.java: $(GENSC_EXE)
23.36 $(prep-target)
24.1 --- a/make/java/nio/mapfile-linux Tue Mar 29 11:29:01 2011 -0700
24.2 +++ b/make/java/nio/mapfile-linux Tue Mar 29 20:19:55 2011 -0700
24.3 @@ -95,6 +95,8 @@
24.4 Java_sun_nio_ch_NativeThread_current;
24.5 Java_sun_nio_ch_NativeThread_init;
24.6 Java_sun_nio_ch_NativeThread_signal;
24.7 + Java_sun_nio_ch_Net_canIPv6SocketJoinIPv4Group0;
24.8 + Java_sun_nio_ch_Net_canJoin6WithIPv4Group0;
24.9 Java_sun_nio_ch_Net_socket0;
24.10 Java_sun_nio_ch_Net_bind0;
24.11 Java_sun_nio_ch_Net_connect0;
25.1 --- a/make/java/nio/mapfile-solaris Tue Mar 29 11:29:01 2011 -0700
25.2 +++ b/make/java/nio/mapfile-solaris Tue Mar 29 20:19:55 2011 -0700
25.3 @@ -82,6 +82,8 @@
25.4 Java_sun_nio_ch_NativeThread_current;
25.5 Java_sun_nio_ch_NativeThread_init;
25.6 Java_sun_nio_ch_NativeThread_signal;
25.7 + Java_sun_nio_ch_Net_canIPv6SocketJoinIPv4Group0;
25.8 + Java_sun_nio_ch_Net_canJoin6WithIPv4Group0;
25.9 Java_sun_nio_ch_Net_socket0;
25.10 Java_sun_nio_ch_Net_bind0;
25.11 Java_sun_nio_ch_Net_connect0;
26.1 --- a/make/java/redist/Makefile Tue Mar 29 11:29:01 2011 -0700
26.2 +++ b/make/java/redist/Makefile Tue Mar 29 20:19:55 2011 -0700
26.3 @@ -76,8 +76,12 @@
26.4 INTERNAL_IMPORT_LIST = $(LIBDIR)/classlist
26.5
26.6 # List of files coming from outside this workspace
26.7 -IMPORT_LIST = $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME) \
26.8 - $(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt
26.9 +ifndef BUILD_CLIENT_ONLY
26.10 + IMPORT_LIST = $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME) \
26.11 + $(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt
26.12 +else
26.13 + IMPORT_LIST =
26.14 +endif
26.15
26.16 # Hotspot client is only available on 32-bit non-Zero builds
26.17 ifneq ($(ZERO_BUILD), true)
26.18 @@ -97,10 +101,12 @@
26.19 $(call chmod-file, a+x)
26.20
26.21 # Get the hotspot .map and .pdb files for client and server
26.22 +ifndef BUILD_CLIENT_ONLY
26.23 IMPORT_LIST += \
26.24 $(LIBDIR)/$(JVMLIB_NAME) \
26.25 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME) \
26.26 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME)
26.27 +endif
26.28
26.29 # Add .map and .pdb files to the import path for client and kernel VMs.
26.30 # These are only available on 32-bit windows builds.
26.31 @@ -126,9 +132,11 @@
26.32 @$(prep-target)
26.33 -$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMMAP_NAME) $@
26.34
26.35 +ifndef BUILD_CLIENT_ONLY
26.36 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME):
26.37 @$(prep-target)
26.38 -$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMMAP_NAME) $@
26.39 +endif
26.40
26.41 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME):
26.42 @$(prep-target)
26.43 @@ -138,27 +146,32 @@
26.44 @$(prep-target)
26.45 -$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMPDB_NAME) $@
26.46
26.47 +ifndef BUILD_CLIENT_ONLY
26.48 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME):
26.49 @$(prep-target)
26.50 -$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMPDB_NAME) $@
26.51 +endif
26.52
26.53 # Windows ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Windows
26.54 else # PLATFORM
26.55 # NOT Windows vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv NOT Windows
26.56
26.57 -IMPORT_LIST += \
26.58 - $(LIB_LOCATION)/$(LIBJSIG_NAME) \
26.59 - $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME)
26.60 +IMPORT_LIST += $(LIB_LOCATION)/$(LIBJSIG_NAME)
26.61 +ifndef BUILD_CLIENT_ONLY
26.62 + IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME)
26.63 +endif
26.64
26.65 ifeq ($(PLATFORM), solaris)
26.66 - IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME)
26.67 -# The conditional can be removed when import JDKs contain these files.
26.68 -ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_NAME)),)
26.69 - IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_NAME)
26.70 -else
26.71 - $(warning WARNING: $(HOTSPOT_SERVER_PATH)/$(JVMDB_NAME) not found!)
26.72 -endif
26.73 -endif
26.74 + ifndef BUILD_CLIENT_ONLY
26.75 + IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME)
26.76 + # The conditional can be removed when import JDKs contain these files.
26.77 + ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_NAME)),)
26.78 + IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_NAME)
26.79 + else
26.80 + $(warning WARNING: $(HOTSPOT_SERVER_PATH)/$(JVMDB_NAME) not found!)
26.81 + endif
26.82 + endif
26.83 +endif
26.84
26.85 ifneq ($(ZERO_BUILD), true)
26.86 ifeq ($(ARCH_DATA_MODEL), 32)
26.87 @@ -179,18 +192,20 @@
26.88 $(warning WARNING: $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_NAME) not found!)
26.89 endif
26.90
26.91 -# The conditional can be removed when import JDKs contain these files.
26.92 -ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME)),)
26.93 - IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME)
26.94 -else
26.95 - $(warning WARNING: $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME) not found!)
26.96 -endif
26.97 +ifndef BUILD_CLIENT_ONLY
26.98 + # The conditional can be removed when import JDKs contain these files.
26.99 + ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME)),)
26.100 + IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME)
26.101 + else
26.102 + $(warning WARNING: $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME) not found!)
26.103 + endif
26.104
26.105 -# The conditional can be removed when import JDKs contain these files.
26.106 -ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_NAME)),)
26.107 - IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_NAME)
26.108 -else
26.109 - $(warning WARNING: $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_NAME) not found!)
26.110 + # The conditional can be removed when import JDKs contain these files.
26.111 + ifneq ($(wildcard $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_NAME)),)
26.112 + IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_NAME)
26.113 + else
26.114 + $(warning WARNING: $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_NAME) not found!)
26.115 + endif
26.116 endif
26.117
26.118 # For backwards compatability, make a link of the 32-bit client JVM to $(LIBDIR)
26.119 @@ -222,10 +237,16 @@
26.120 $(install-import-file)
26.121 @$(call binary_file_verification,$@)
26.122
26.123 +ifndef BUILD_CLIENT_ONLY
26.124 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME) \
26.125 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME):
26.126 @$(prep-target)
26.127 $(call install-sym-link, ../$(LIBJSIG_NAME))
26.128 +else
26.129 +$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME):
26.130 + @$(prep-target)
26.131 + $(call install-sym-link, ../$(LIBJSIG_NAME))
26.132 +endif
26.133
26.134 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDB_NAME)
26.135 $(install-import-file)
26.136 @@ -235,6 +256,7 @@
26.137 $(install-import-file)
26.138 @$(call binary_file_verification,$@)
26.139
26.140 +ifndef BUILD_CLIENT_ONLY
26.141 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDB_NAME)
26.142 $(install-import-file)
26.143 @$(call binary_file_verification,$@)
26.144 @@ -242,6 +264,7 @@
26.145 $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME)
26.146 $(install-import-file)
26.147 @$(call binary_file_verification,$@)
26.148 +endif
26.149
26.150 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDTRACE_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_NAME)
26.151 $(install-import-file)
26.152 @@ -251,6 +274,7 @@
26.153 $(install-import-file)
26.154 @$(call binary_file_verification,$@)
26.155
26.156 +ifndef BUILD_CLIENT_ONLY
26.157 $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_NAME)
26.158 $(install-import-file)
26.159 @$(call binary_file_verification,$@)
26.160 @@ -265,6 +289,7 @@
26.161
26.162 $(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt : $(HOTSPOT_SERVER_PATH)/Xusage.txt
26.163 $(install-import-file)
26.164 +endif
26.165
26.166 $(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt : $(HOTSPOT_CLIENT_PATH)/Xusage.txt
26.167 $(install-import-file)
27.1 --- a/make/javax/sound/SoundDefs.gmk Tue Mar 29 11:29:01 2011 -0700
27.2 +++ b/make/javax/sound/SoundDefs.gmk Tue Mar 29 20:19:55 2011 -0700
27.3 @@ -1,5 +1,5 @@
27.4 #
27.5 -# Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
27.6 +# Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
27.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
27.8 #
27.9 # This code is free software; you can redistribute it and/or modify it
27.10 @@ -73,6 +73,15 @@
27.11 ifeq ($(ARCH), amd64)
27.12 CPPFLAGS += -DX_ARCH=X_AMD64
27.13 endif # ARCH amd64
27.14 +
27.15 + ifeq ($(ARCH), arm)
27.16 + CPPFLAGS += -DX_ARCH=X_ARM
27.17 + endif # ARCH arm
27.18 +
27.19 + ifeq ($(ARCH), ppc)
27.20 + CPPFLAGS += -DX_ARCH=X_PPC
27.21 + endif # ARCH ppc
27.22 +
27.23 endif
27.24
27.25
28.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
28.2 +++ b/make/mkdemo/jfc/Laffy/Makefile Tue Mar 29 20:19:55 2011 -0700
28.3 @@ -0,0 +1,43 @@
28.4 +#
28.5 +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
28.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
28.7 +#
28.8 +# This code is free software; you can redistribute it and/or modify it
28.9 +# under the terms of the GNU General Public License version 2 only, as
28.10 +# published by the Free Software Foundation. Oracle designates this
28.11 +# particular file as subject to the "Classpath" exception as provided
28.12 +# by Oracle in the LICENSE file that accompanied this code.
28.13 +#
28.14 +# This code is distributed in the hope that it will be useful, but WITHOUT
28.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
28.16 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
28.17 +# version 2 for more details (a copy is included in the LICENSE file that
28.18 +# accompanied this code).
28.19 +#
28.20 +# You should have received a copy of the GNU General Public License version
28.21 +# 2 along with this work; if not, write to the Free Software Foundation,
28.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
28.23 +#
28.24 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
28.25 +# or visit www.oracle.com if you need additional information or have any
28.26 +# questions.
28.27 +#
28.28 +
28.29 +#
28.30 +# Makefile to build the Laffy demo.
28.31 +#
28.32 +
28.33 +BUILDDIR = ../../..
28.34 +PRODUCT = demo/jfc
28.35 +DEMONAME = Laffy
28.36 +include $(BUILDDIR)/common/Defs.gmk
28.37 +
28.38 +DEMO_ROOT = $(CLOSED_SRC)/share/demo/jfc/$(DEMONAME)
28.39 +DEMO_DESTDIR = $(DEMODIR)/jfc/$(DEMONAME)
28.40 +DEMO_TOPFILES = ./readme.html ./laffy.png
28.41 +DEMO_SKIP_SRCZIP = true
28.42 +
28.43 +#
28.44 +# Demo jar building rules.
28.45 +#
28.46 +include $(BUILDDIR)/common/Demo.gmk
29.1 --- a/make/mkdemo/jfc/Makefile Tue Mar 29 11:29:01 2011 -0700
29.2 +++ b/make/mkdemo/jfc/Makefile Tue Mar 29 20:19:55 2011 -0700
29.3 @@ -43,7 +43,7 @@
29.4
29.5 # Some demos aren't currently included in OpenJDK
29.6 ifndef OPENJDK
29.7 - SUBDIRS += Java2D SwingSet2 SwingSet3 Stylepad
29.8 + SUBDIRS += Java2D Laffy SwingSet2 SwingSet3 Stylepad
29.9 endif
29.10
29.11 include $(BUILDDIR)/common/Subdirs.gmk
30.1 --- a/make/sun/cmm/kcms/Makefile Tue Mar 29 11:29:01 2011 -0700
30.2 +++ b/make/sun/cmm/kcms/Makefile Tue Mar 29 20:19:55 2011 -0700
30.3 @@ -71,7 +71,8 @@
30.4 # Extra rules
30.5 #
30.6 ifeq ($(PLATFORM), linux)
30.7 -LDLIBS += -lpthread
30.8 + LDLIBS += -lpthread
30.9 + OTHER_CFLAGS += -Wno-missing-field-initializers
30.10 endif
30.11
30.12 clean clobber::
30.13 @@ -103,6 +104,5 @@
30.14
30.15 endif # PLATFORM
30.16
30.17 -#CFLAGS += -DJAVACMM -DFUT_CALC_EX -DNO_FUT_GCONST
30.18 -CFLAGS += -DFUT_CALC_EX -DNO_FUT_GCONST
30.19 +CFLAGS += -DJAVACMM -DFUT_CALC_EX -DNO_FUT_GCONST
30.20
31.1 --- a/make/sun/javazic/tzdata/VERSION Tue Mar 29 11:29:01 2011 -0700
31.2 +++ b/make/sun/javazic/tzdata/VERSION Tue Mar 29 20:19:55 2011 -0700
31.3 @@ -21,4 +21,4 @@
31.4 # or visit www.oracle.com if you need additional information or have any
31.5 # questions.
31.6 #
31.7 -tzdata2011b
31.8 +tzdata2011d
32.1 --- a/make/sun/javazic/tzdata/australasia Tue Mar 29 11:29:01 2011 -0700
32.2 +++ b/make/sun/javazic/tzdata/australasia Tue Mar 29 20:19:55 2011 -0700
32.3 @@ -531,11 +531,31 @@
32.4 # to 01:00am and First Sunday April 2011 (03/04/11) - adjust clocks
32.5 # backwards from 1:00am to 12:00am"
32.6
32.7 +# From Raymond Hughes (2011-03-07)
32.8 +# I believe this will be posted shortly on the website
32.9 +# <a href="http://www.mcil.gov.ws">
32.10 +# www.mcil.gov.ws
32.11 +# </a>
32.12 +#
32.13 +# PUBLIC NOTICE ON DAYLIGHT SAVING TIME
32.14 +#
32.15 +# Pursuant to the Daylight Saving Act 2009 and Cabinets decision,
32.16 +# businesses and the general public are hereby advised that daylight
32.17 +# saving time is on the first Saturday of April 2011 (02/04/11).
32.18 +#
32.19 +# The public is therefore advised that when the standard time strikes
32.20 +# the hour of four oclock (4.00am or 0400 Hours) on the 2nd April 2011,
32.21 +# then all instruments used to measure standard time are to be
32.22 +# adjusted/changed to three oclock (3:00am or 0300Hrs).
32.23 +#
32.24 +# Margaret Fruean ACTING CHIEF EXECUTIVE OFFICER MINISTRY OF COMMERCE,
32.25 +# INDUSTRY AND LABOUR 28th February 2011
32.26 +
32.27 Zone Pacific/Apia 12:33:04 - LMT 1879 Jul 5
32.28 -11:26:56 - LMT 1911
32.29 -11:30 - SAMT 1950 # Samoa Time
32.30 -11:00 - WST 2010 Sep 26
32.31 - -11:00 1:00 WSDT 2011 Apr 3 1:00
32.32 + -11:00 1:00 WSDT 2011 Apr 2 4:00
32.33 -11:00 - WST
32.34
32.35 # Solomon Is
33.1 --- a/make/sun/javazic/tzdata/etcetera Tue Mar 29 11:29:01 2011 -0700
33.2 +++ b/make/sun/javazic/tzdata/etcetera Tue Mar 29 20:19:55 2011 -0700
33.3 @@ -58,8 +58,7 @@
33.4 # (i.e. west of Greenwich) even though many people would expect it to
33.5 # mean 4 hours ahead of UTC (i.e. east of Greenwich).
33.6 #
33.7 -# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation
33.8 -# (which is not yet supported by the tz code) allows for
33.9 +# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for
33.10 # TZ='<GMT-4>+4'; if you want time zone abbreviations conforming to
33.11 # ISO 8601 you can use TZ='<-0400>+4'. Thus the commonly-expected
33.12 # offset is kept within the angle bracket (and is used for display)
34.1 --- a/make/sun/javazic/tzdata/europe Tue Mar 29 11:29:01 2011 -0700
34.2 +++ b/make/sun/javazic/tzdata/europe Tue Mar 29 20:19:55 2011 -0700
34.3 @@ -2505,25 +2505,18 @@
34.4 # (on a non-government server though) describing dates between 2002 and 2006:
34.5 # http://www.alomaliye.com/bkk_2002_3769.htm
34.6
34.7 -# From Sue Williams (2008-08-11):
34.8 -# I spotted this news article about a potential change in Turkey.
34.9 -#
34.10 -# <a href="http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1">
34.11 -# http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1
34.12 +# From Gökdeniz Karadağ (2011-03-10):
34.13 +#
34.14 +# According to the articles linked below, Turkey will change into summer
34.15 +# time zone (GMT+3) on March 28, 2011 at 3:00 a.m. instead of March 27.
34.16 +# This change is due to a nationwide exam on 27th.
34.17 +#
34.18 +# <a href="http://www.worldbulletin.net/?aType=haber&ArticleID=70872">
34.19 +# http://www.worldbulletin.net/?aType=haber&ArticleID=70872
34.20 # </a>
34.21 -
34.22 -# From Sue Williams (2008-08-20):
34.23 -# This article says that around the end of March 2011, Turkey wants to
34.24 -# adjust the clocks forward by 1/2 hour and stay that way permanently.
34.25 -# The article indicates that this is a change in timezone offset in addition
34.26 -# to stopping observance of DST.
34.27 -# This proposal has not yet been approved.
34.28 -#
34.29 -# Read more here...
34.30 -#
34.31 -# Turkey to abandon daylight saving time in 2011
34.32 -# <a href="http://www.turkishdailynews.com.tr/article.php?enewsid=112989">
34.33 -# http://www.turkishdailynews.com.tr/article.php?enewsid=112989
34.34 +# Turkish:
34.35 +# <a href="http://www.hurriyet.com.tr/ekonomi/17230464.asp?gid=373">
34.36 +# http://www.hurriyet.com.tr/ekonomi/17230464.asp?gid=373
34.37 # </a>
34.38
34.39 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
34.40 @@ -2591,6 +2584,8 @@
34.41 2:00 Turkey EE%sT 1978 Oct 15
34.42 3:00 Turkey TR%sT 1985 Apr 20 # Turkey Time
34.43 2:00 Turkey EE%sT 2007
34.44 + 2:00 EU EE%sT 2011 Mar 27 1:00u
34.45 + 2:00 - EET 2011 Mar 28 1:00u
34.46 2:00 EU EE%sT
34.47 Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
34.48
35.1 --- a/make/sun/javazic/tzdata/leapseconds Tue Mar 29 11:29:01 2011 -0700
35.2 +++ b/make/sun/javazic/tzdata/leapseconds Tue Mar 29 20:19:55 2011 -0700
35.3 @@ -78,13 +78,13 @@
35.4 # SERVICE DE LA ROTATION TERRESTRE
35.5 # OBSERVATOIRE DE PARIS
35.6 # 61, Av. de l'Observatoire 75014 PARIS (France)
35.7 -# Tel. : 33 (0) 1 40 51 22 26
35.8 +# Tel. : 33 (0) 1 40 51 22 29
35.9 # FAX : 33 (0) 1 40 51 22 91
35.10 # Internet : services.iers@obspm.fr
35.11 #
35.12 -# Paris, 14 July 2010
35.13 +# Paris, 2 February 2011
35.14 #
35.15 -# Bulletin C 40
35.16 +# Bulletin C 41
35.17 #
35.18 # To authorities responsible
35.19 # for the measurement and
35.20 @@ -92,9 +92,9 @@
35.21 #
35.22 # INFORMATION ON UTC - TAI
35.23 #
35.24 -# NO positive leap second will be introduced at the end of December 2010.
35.25 +# NO positive leap second will be introduced at the end of June 2011.
35.26 # The difference between Coordinated Universal Time UTC and the
35.27 -# International Atomic Time TAI is :
35.28 +# International Atomic Time TAI is :
35.29 #
35.30 # from 2009 January 1, 0h UTC, until further notice : UTC-TAI = -34 s
35.31 #
35.32 @@ -104,6 +104,6 @@
35.33 # will be no time step at the next possible date.
35.34 #
35.35 # Daniel GAMBIS
35.36 -# Director
35.37 -# Earth Orientation Center of IERS
35.38 +# Head
35.39 +# Earth Orientation Center of the IERS
35.40 # Observatoire de Paris, France
36.1 --- a/make/sun/javazic/tzdata/northamerica Tue Mar 29 11:29:01 2011 -0700
36.2 +++ b/make/sun/javazic/tzdata/northamerica Tue Mar 29 20:19:55 2011 -0700
36.3 @@ -448,15 +448,74 @@
36.4 # were nearby inhabitants in some cases and for our purposes perhaps
36.5 # it's best to simply use the official transition.
36.6 #
36.7 +
36.8 +# From Steve Ferguson (2011-01-31):
36.9 +# The author lives in Alaska and many of the references listed are only
36.10 +# available to Alaskan residents.
36.11 +#
36.12 +# <a href="http://www.alaskahistoricalsociety.org/index.cfm?section=discover%20alaska&page=Glimpses%20of%20the%20Past&viewpost=2&ContentId=98">
36.13 +# http://www.alaskahistoricalsociety.org/index.cfm?section=discover%20alaska&page=Glimpses%20of%20the%20Past&viewpost=2&ContentId=98
36.14 +# </a>
36.15 +
36.16 +# From Arthur David Olson (2011-02-01):
36.17 +# Here's database-relevant material from the 2001 "Alaska History" article:
36.18 +#
36.19 +# On September 20 [1979]...DOT...officials decreed that on April 27,
36.20 +# 1980, Juneau and other nearby communities would move to Yukon Time.
36.21 +# Sitka, Petersburg, Wrangell, and Ketchikan, however, would remain on
36.22 +# Pacific Time.
36.23 +#
36.24 +# ...on September 22, 1980, DOT Secretary Neil E. Goldschmidt rescinded the
36.25 +# Department's September 1979 decision. Juneau and other communities in
36.26 +# northern Southeast reverted to Pacific Time on October 26.
36.27 +#
36.28 +# On October 28 [1983]...the Metlakatla Indian Community Council voted
36.29 +# unanimously to keep the reservation on Pacific Time.
36.30 +#
36.31 +# According to DOT official Joanne Petrie, Indian reservations are not
36.32 +# bound to follow time zones imposed by neighboring jurisdictions.
36.33 +#
36.34 +# (The last is consistent with how the database now handles the Navajo
36.35 +# Nation.)
36.36 +
36.37 +# From Arthur David Olson (2011-02-09):
36.38 +# I just spoke by phone with a staff member at the Metlakatla Indian
36.39 +# Community office (using contact information available at
36.40 +# <a href="http://www.commerce.state.ak.us/dca/commdb/CIS.cfm?Comm_Boro_name=Metlakatla">
36.41 +# http://www.commerce.state.ak.us/dca/commdb/CIS.cfm?Comm_Boro_name=Metlakatla
36.42 +# </a>).
36.43 +# It's shortly after 1:00 here on the east coast of the United States;
36.44 +# the staffer said it was shortly after 10:00 there. When I asked whether
36.45 +# that meant they were on Pacific time, they said no--they were on their
36.46 +# own time. I asked about daylight saving; they said it wasn't used. I
36.47 +# did not inquire about practices in the past.
36.48 +
36.49 # Zone NAME GMTOFF RULES FORMAT [UNTIL]
36.50 Zone America/Juneau 15:02:19 - LMT 1867 Oct 18
36.51 -8:57:41 - LMT 1900 Aug 20 12:00
36.52 -8:00 - PST 1942
36.53 -8:00 US P%sT 1946
36.54 -8:00 - PST 1969
36.55 + -8:00 US P%sT 1980 Apr 27 2:00
36.56 + -9:00 US Y%sT 1980 Oct 26 2:00
36.57 -8:00 US P%sT 1983 Oct 30 2:00
36.58 -9:00 US Y%sT 1983 Nov 30
36.59 -9:00 US AK%sT
36.60 +Zone America/Sitka -14:58:47 - LMT 1867 Oct 18
36.61 + -9:01:13 - LMT 1900 Aug 20 12:00
36.62 + -8:00 - PST 1942
36.63 + -8:00 US P%sT 1946
36.64 + -8:00 - PST 1969
36.65 + -8:00 US P%sT 1983 Oct 30 2:00
36.66 + -9:00 US Y%sT 1983 Nov 30
36.67 + -9:00 US AK%sT
36.68 +Zone America/Metlakatla 15:13:42 - LMT 1867 Oct 18
36.69 + -8:46:18 - LMT 1900 Aug 20 12:00
36.70 + -8:00 - PST 1942
36.71 + -8:00 US P%sT 1946
36.72 + -8:00 - PST 1969
36.73 + -8:00 US P%sT 1983 Oct 30 2:00
36.74 + -8:00 US MeST
36.75 Zone America/Yakutat 14:41:05 - LMT 1867 Oct 18
36.76 -9:18:55 - LMT 1900 Aug 20 12:00
36.77 -9:00 - YST 1942
36.78 @@ -2569,6 +2628,21 @@
36.79 # the time was announced as "diez cinco"--the same time as here, indicating
36.80 # that has indeed switched to DST. Assume second Sunday from 2009 forward.
36.81
36.82 +# From Steffen Thorsen (2011-03-08):
36.83 +# Granma announced that Cuba is going to start DST on 2011-03-20 00:00:00
36.84 +# this year. Nothing about the end date known so far (if that has
36.85 +# changed at all).
36.86 +#
36.87 +# Source:
36.88 +# <a href="http://granma.co.cu/2011/03/08/nacional/artic01.html">
36.89 +# http://granma.co.cu/2011/03/08/nacional/artic01.html
36.90 +# </a>
36.91 +#
36.92 +# Our info:
36.93 +# <a href="http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html">
36.94 +# http://www.timeanddate.com/news/time/cuba-starts-dst-2011.html
36.95 +# </a>
36.96 +
36.97 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
36.98 Rule Cuba 1928 only - Jun 10 0:00 1:00 D
36.99 Rule Cuba 1928 only - Oct 10 0:00 0 S
36.100 @@ -2602,7 +2676,9 @@
36.101 Rule Cuba 2006 max - Oct lastSun 0:00s 0 S
36.102 Rule Cuba 2007 only - Mar Sun>=8 0:00s 1:00 D
36.103 Rule Cuba 2008 only - Mar Sun>=15 0:00s 1:00 D
36.104 -Rule Cuba 2009 max - Mar Sun>=8 0:00s 1:00 D
36.105 +Rule Cuba 2009 2010 - Mar Sun>=8 0:00s 1:00 D
36.106 +Rule Cuba 2011 only - Mar Sun>=15 0:00s 1:00 D
36.107 +Rule Cuba 2012 max - Mar Sun>=8 0:00s 1:00 D
36.108
36.109 # Zone NAME GMTOFF RULES FORMAT [UNTIL]
36.110 Zone America/Havana -5:29:28 - LMT 1890
37.1 --- a/make/sun/javazic/tzdata/southamerica Tue Mar 29 11:29:01 2011 -0700
37.2 +++ b/make/sun/javazic/tzdata/southamerica Tue Mar 29 20:19:55 2011 -0700
37.3 @@ -1176,6 +1176,23 @@
37.4 # From Arthur Daivd Olson (2010-03-06):
37.5 # Angel Chiang's message confirmed by Julio Pacheco; Julio provided a patch.
37.6
37.7 +# From Glenn Eychaner (2011-03-02): [geychaner@mac.com]
37.8 +# It appears that the Chilean government has decided to postpone the
37.9 +# change from summer time to winter time again, by three weeks to April
37.10 +# 2nd:
37.11 +# <a href="http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651">
37.12 +# http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651
37.13 +# </a>
37.14 +#
37.15 +# This is not yet reflected in the offical "cambio de hora" site, but
37.16 +# probably will be soon:
37.17 +# <a href="http://www.horaoficial.cl/cambio.htm">
37.18 +# http://www.horaoficial.cl/cambio.htm
37.19 +# </a>
37.20 +
37.21 +# From Arthur David Olson (2011-03-02):
37.22 +# The emol.com article mentions a water shortage as the cause of the
37.23 +# postponement, which may mean that it's not a permanent change.
37.24 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
37.25 Rule Chile 1927 1932 - Sep 1 0:00 1:00 S
37.26 Rule Chile 1928 1932 - Apr 1 0:00 0 -
37.27 @@ -1211,8 +1228,8 @@
37.28 # which is used below in specifying the transition.
37.29 Rule Chile 2008 only - Mar 30 3:00u 0 -
37.30 Rule Chile 2009 only - Mar Sun>=9 3:00u 0 -
37.31 -Rule Chile 2010 only - Apr 4 3:00u 0 -
37.32 -Rule Chile 2011 max - Mar Sun>=9 3:00u 0 -
37.33 +Rule Chile 2010 2011 - Apr Sun>=1 3:00u 0 -
37.34 +Rule Chile 2012 max - Mar Sun>=9 3:00u 0 -
37.35 # IATA SSIM anomalies: (1992-02) says 1992-03-14;
37.36 # (1996-09) says 1998-03-08. Ignore these.
37.37 # Zone NAME GMTOFF RULES FORMAT [UNTIL]
38.1 --- a/make/sun/javazic/tzdata/zone.tab Tue Mar 29 11:29:01 2011 -0700
38.2 +++ b/make/sun/javazic/tzdata/zone.tab Tue Mar 29 20:19:55 2011 -0700
38.3 @@ -434,9 +434,11 @@
38.4 US +340308-1181434 America/Los_Angeles Pacific Time
38.5 US +611305-1495401 America/Anchorage Alaska Time
38.6 US +581807-1342511 America/Juneau Alaska Time - Alaska panhandle
38.7 +US +571035-1351807 America/Sitka Alaska Time - southeast Alaska panhandle
38.8 US +593249-1394338 America/Yakutat Alaska Time - Alaska panhandle neck
38.9 US +643004-1652423 America/Nome Alaska Time - west Alaska
38.10 US +515248-1763929 America/Adak Aleutian Islands
38.11 +US +550737-1313435 America/Metlakatla Metlakatla Time - Annette Island
38.12 US +211825-1575130 Pacific/Honolulu Hawaii
38.13 UY -3453-05611 America/Montevideo
38.14 UZ +3940+06648 Asia/Samarkand west Uzbekistan
39.1 --- a/make/sun/jdbc/Makefile Tue Mar 29 11:29:01 2011 -0700
39.2 +++ b/make/sun/jdbc/Makefile Tue Mar 29 20:19:55 2011 -0700
39.3 @@ -61,7 +61,7 @@
39.4 # ODBC_LIBRARY_LOCATION, and delete the variable assignments below.
39.5 #
39.6 # Tell linker to ignore missing externals when building this shared library.
39.7 - LDFLAGS_DEFS_OPTION = -z nodefs
39.8 + LDFLAGS_DEFS_OPTION = -Xlinker -z -Xlinker nodefs
39.9 # Define a place to create the fake libraries and their names.
39.10 ODBC_LIBRARY_LOCATION = $(TEMPDIR)
39.11 ODBC_FAKE_LIBRARIES = $(ODBC_LIBRARY_LOCATION)/libodbcinst.so $(ODBC_LIBRARY_LOCATION)/libodbc.so
40.1 --- a/make/sun/net/FILES_java.gmk Tue Mar 29 11:29:01 2011 -0700
40.2 +++ b/make/sun/net/FILES_java.gmk Tue Mar 29 20:19:55 2011 -0700
40.3 @@ -1,5 +1,5 @@
40.4 #
40.5 -# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
40.6 +# Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
40.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
40.8 #
40.9 # This code is free software; you can redistribute it and/or modify it
40.10 @@ -34,6 +34,7 @@
40.11 sun/net/ProgressListener.java \
40.12 sun/net/ProgressMeteringPolicy.java \
40.13 sun/net/SocksProxy.java \
40.14 + sun/net/ResourceManager.java \
40.15 sun/net/TelnetInputStream.java \
40.16 sun/net/TelnetOutputStream.java \
40.17 sun/net/TelnetProtocolException.java \
40.18 @@ -100,6 +101,7 @@
40.19 sun/net/www/protocol/http/NegotiateAuthentication.java \
40.20 sun/net/www/protocol/http/Negotiator.java \
40.21 sun/net/www/protocol/http/ntlm/NTLMAuthentication.java \
40.22 + sun/net/www/protocol/http/ntlm/NTLMAuthenticationCallback.java \
40.23 sun/net/www/protocol/http/spnego/NegotiatorImpl.java \
40.24 sun/net/www/protocol/http/spnego/NegotiateCallbackHandler.java \
40.25 sun/net/www/protocol/http/logging/HttpLogFormatter.java \
41.1 --- a/make/sun/nio/cs/FILES_java.gmk Tue Mar 29 11:29:01 2011 -0700
41.2 +++ b/make/sun/nio/cs/FILES_java.gmk Tue Mar 29 20:19:55 2011 -0700
41.3 @@ -376,6 +376,7 @@
41.4 sun/nio/cs/ext/HKSCSMapping.java \
41.5 sun/nio/cs/ext/HKSCS2001Mapping.java \
41.6 sun/nio/cs/ext/HKSCS_XPMapping.java \
41.7 + sun/nio/cs/ext/IBM1364.java \
41.8 sun/nio/cs/ext/IBM1381.java \
41.9 sun/nio/cs/ext/IBM1383.java \
41.10 sun/nio/cs/ext/IBM930.java \
42.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
42.2 +++ b/make/tools/CharsetMapping/IBM1364.c2b Tue Mar 29 20:19:55 2011 -0700
42.3 @@ -0,0 +1,22 @@
42.4 +#
42.5 +# Diff of
42.6 +# b2c: cdctables.zip/Package2.zip/IBM-1364A.zip/055444B0.TPMAP110
42.7 +# c2b: cdctables.zip/Package2.zip/IBM-1364A.zip/055444B0.UPMAP110
42.8 +# shows there are 6 additional c->b entries in UPMAP110, they are
42.9 +# listed below (in b->c form)
42.10 +#
42.11 +# UPMAP110 also defines
42.12 +# <subchar> \xFE\xFE
42.13 +# and commend out
42.14 +# #<subchar1> \x3F
42.15 +# with
42.16 +#
42.17 +# <UFFFD> \xFE\xFD # (SUB)
42.18 +# <UFFFD> \xFE\xFE # (SUB)
42.19 +#
42.20 +4148 00AD
42.21 +4143 00B7
42.22 +4149 2015
42.23 +42A1 223C
42.24 +496F 2299
42.25 +4954 FF5E
43.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
43.2 +++ b/make/tools/CharsetMapping/IBM1364.map Tue Mar 29 20:19:55 2011 -0700
43.3 @@ -0,0 +1,19774 @@
43.4 +#
43.5 +# b2c mapping for IBM1364, generated from
43.6 +# cdctables.zip/Package2.zip/IBM-1364A.zip/055444B0.TPMAP110
43.7 +# which is an updated version of IBM-1364 (with EURO)
43.8 +#
43.9 +# Replacement suggestion from the CDC table are
43.10 +# U+001A for SBCS
43.11 +# U+FFFD for DBCS
43.12 +00 0000
43.13 +01 0001
43.14 +02 0002
43.15 +03 0003
43.16 +04 009C
43.17 +05 0009
43.18 +06 0086
43.19 +07 007F
43.20 +08 0097
43.21 +09 008D
43.22 +0A 008E
43.23 +0B 000B
43.24 +0C 000C
43.25 +0D 000D
43.26 +10 0010
43.27 +11 0011
43.28 +12 0012
43.29 +13 0013
43.30 +14 009D
43.31 +15 0085
43.32 +16 0008
43.33 +17 0087
43.34 +18 0018
43.35 +19 0019
43.36 +1A 0092
43.37 +1B 008F
43.38 +1C 001C
43.39 +1D 001D
43.40 +1E 001E
43.41 +1F 001F
43.42 +20 0080
43.43 +21 0081
43.44 +22 0082
43.45 +23 0083
43.46 +24 0084
43.47 +25 000A
43.48 +26 0017
43.49 +27 001B
43.50 +28 0088
43.51 +29 0089
43.52 +2A 008A
43.53 +2B 008B
43.54 +2C 008C
43.55 +2D 0005
43.56 +2E 0006
43.57 +2F 0007
43.58 +30 0090
43.59 +31 0091
43.60 +32 0016
43.61 +33 0093
43.62 +34 0094
43.63 +35 0095
43.64 +36 0096
43.65 +37 0004
43.66 +38 0098
43.67 +39 0099
43.68 +3A 009A
43.69 +3B 009B
43.70 +3C 0014
43.71 +3D 0015
43.72 +3E 009E
43.73 +3F 001A
43.74 +40 0020
43.75 +42 FFA0
43.76 +43 FFA1
43.77 +44 FFA2
43.78 +45 FFA3
43.79 +46 FFA4
43.80 +47 FFA5
43.81 +48 FFA6
43.82 +49 FFA7
43.83 +4A 00A2
43.84 +4B 002E
43.85 +4C 003C
43.86 +4D 0028
43.87 +4E 002B
43.88 +4F 007C
43.89 +50 0026
43.90 +52 FFA8
43.91 +53 FFA9
43.92 +54 FFAA
43.93 +55 FFAB
43.94 +56 FFAC
43.95 +57 FFAD
43.96 +58 FFAE
43.97 +59 FFAF
43.98 +5A 0021
43.99 +5B 0024
43.100 +5C 002A
43.101 +5D 0029
43.102 +5E 003B
43.103 +5F 00AC
43.104 +60 002D
43.105 +61 002F
43.106 +62 FFB0
43.107 +63 FFB1
43.108 +64 FFB2
43.109 +65 FFB3
43.110 +66 FFB4
43.111 +67 FFB5
43.112 +68 FFB6
43.113 +69 FFB7
43.114 +6A 00A6
43.115 +6B 002C
43.116 +6C 0025
43.117 +6D 005F
43.118 +6E 003E
43.119 +6F 003F
43.120 +70 005B
43.121 +72 FFB8
43.122 +73 FFB9
43.123 +74 FFBA
43.124 +75 FFBB
43.125 +76 FFBC
43.126 +77 FFBD
43.127 +78 FFBE
43.128 +79 0060
43.129 +7A 003A
43.130 +7B 0023
43.131 +7C 0040
43.132 +7D 0027
43.133 +7E 003D
43.134 +7F 0022
43.135 +80 005D
43.136 +81 0061
43.137 +82 0062
43.138 +83 0063
43.139 +84 0064
43.140 +85 0065
43.141 +86 0066
43.142 +87 0067
43.143 +88 0068
43.144 +89 0069
43.145 +8A FFC2
43.146 +8B FFC3
43.147 +8C FFC4
43.148 +8D FFC5
43.149 +8E FFC6
43.150 +8F FFC7
43.151 +91 006A
43.152 +92 006B
43.153 +93 006C
43.154 +94 006D
43.155 +95 006E
43.156 +96 006F
43.157 +97 0070
43.158 +98 0071
43.159 +99 0072
43.160 +9A FFCA
43.161 +9B FFCB
43.162 +9C FFCC
43.163 +9D FFCD
43.164 +9E FFCE
43.165 +9F FFCF
43.166 +A0 203E
43.167 +A1 007E
43.168 +A2 0073
43.169 +A3 0074
43.170 +A4 0075
43.171 +A5 0076
43.172 +A6 0077
43.173 +A7 0078
43.174 +A8 0079
43.175 +A9 007A
43.176 +AA FFD2
43.177 +AB FFD3
43.178 +AC FFD4
43.179 +AD FFD5
43.180 +AE FFD6
43.181 +AF FFD7
43.182 +B0 005E
43.183 +B2 005C
43.184 +BA FFDA
43.185 +BB FFDB
43.186 +BC FFDC
43.187 +C0 007B
43.188 +C1 0041
43.189 +C2 0042
43.190 +C3 0043
43.191 +C4 0044
43.192 +C5 0045
43.193 +C6 0046
43.194 +C7 0047
43.195 +C8 0048
43.196 +C9 0049
43.197 +D0 007D
43.198 +D1 004A
43.199 +D2 004B
43.200 +D3 004C
43.201 +D4 004D
43.202 +D5 004E
43.203 +D6 004F
43.204 +D7 0050
43.205 +D8 0051
43.206 +D9 0052
43.207 +E0 20A9
43.208 +E2 0053
43.209 +E3 0054
43.210 +E4 0055
43.211 +E5 0056
43.212 +E6 0057
43.213 +E7 0058
43.214 +E8 0059
43.215 +E9 005A
43.216 +F0 0030
43.217 +F1 0031
43.218 +F2 0032
43.219 +F3 0033
43.220 +F4 0034
43.221 +F5 0035
43.222 +F6 0036
43.223 +F7 0037
43.224 +F8 0038
43.225 +F9 0039
43.226 +FF 009F
43.227 +4040 3000
43.228 +4141 3001
43.229 +4142 3002
43.230 +4143 30FB
43.231 +4144 2025
43.232 +4145 2026
43.233 +4146 00A8
43.234 +4147 3003
43.235 +4148 2010
43.236 +4149 2014
43.237 +414A 2225
43.238 +414B FF3C
43.239 +414C FFE3
43.240 +414D 2018
43.241 +414E 2019
43.242 +414F 201C
43.243 +4150 201D
43.244 +4151 3014
43.245 +4152 3015
43.246 +4153 3008
43.247 +4154 3009
43.248 +4155 300A
43.249 +4156 300B
43.250 +4157 300C
43.251 +4158 300D
43.252 +4159 300E
43.253 +415A 300F
43.254 +415B 3010
43.255 +415C 3011
43.256 +415D 00B1
43.257 +415E 00D7
43.258 +415F 00F7
43.259 +4160 01C2
43.260 +4161 2266
43.261 +4162 2267
43.262 +4163 221E
43.263 +4164 2234
43.264 +4165 00B0
43.265 +4166 2032
43.266 +4167 2033
43.267 +4168 2103
43.268 +4169 212A
43.269 +416A FF3E
43.270 +416B FFE1
43.271 +416C FFE5
43.272 +416D 3396
43.273 +416E 3397
43.274 +416F 2113
43.275 +4170 33C4
43.276 +4171 339C
43.277 +4172 339D
43.278 +4173 339E
43.279 +4174 338E
43.280 +4175 338F
43.281 +4176 00A7
43.282 +4177 203B
43.283 +4178 2606
43.284 +4179 2605
43.285 +417A 25CB
43.286 +417B 25CF
43.287 +417C 25CE
43.288 +417D 25C7
43.289 +417E 25C6
43.290 +417F 25A1
43.291 +4180 25A0
43.292 +4181 25B3
43.293 +4182 25B2
43.294 +4183 25BD
43.295 +4184 25BC
43.296 +4185 2192
43.297 +4186 2190
43.298 +4187 2191
43.299 +4188 2193
43.300 +4189 2194
43.301 +418A 3013
43.302 +418B FF3B
43.303 +418C FF3D
43.304 +418D 2260
43.305 +418E 2264
43.306 +418F 2265
43.307 +4190 212B
43.308 +4191 2642
43.309 +4192 2640
43.310 +4193 2220
43.311 +4194 22A5
43.312 +4195 2312
43.313 +4196 2202
43.314 +4197 2207
43.315 +4198 2261
43.316 +4199 2252
43.317 +419A 226A
43.318 +419B 226B
43.319 +419C 221A
43.320 +419D 223D
43.321 +424A FFE0
43.322 +424B FF0E
43.323 +424C FF1C
43.324 +424D FF08
43.325 +424E FF0B
43.326 +424F FF5C
43.327 +4250 FF06
43.328 +425A FF01
43.329 +425B FF04
43.330 +425C FF0A
43.331 +425D FF09
43.332 +425E FF1B
43.333 +425F FFE2
43.334 +4260 FF0D
43.335 +4261 FF0F
43.336 +426A FFE4
43.337 +426B FF0C
43.338 +426C FF05
43.339 +426D FF3F
43.340 +426E FF1E
43.341 +426F FF1F
43.342 +4279 FF40
43.343 +427A FF1A
43.344 +427B FF03
43.345 +427C FF20
43.346 +427D FF07
43.347 +427E FF1D
43.348 +427F FF02
43.349 +4281 FF41
43.350 +4282 FF42
43.351 +4283 FF43
43.352 +4284 FF44
43.353 +4285 FF45
43.354 +4286 FF46
43.355 +4287 FF47
43.356 +4288 FF48
43.357 +4289 FF49
43.358 +4291 FF4A
43.359 +4292 FF4B
43.360 +4293 FF4C
43.361 +4294 FF4D
43.362 +4295 FF4E
43.363 +4296 FF4F
43.364 +4297 FF50
43.365 +4298 FF51
43.366 +4299 FF52
43.367 +42A1 301C
43.368 +42A2 FF53
43.369 +42A3 FF54
43.370 +42A4 FF55
43.371 +42A5 FF56
43.372 +42A6 FF57
43.373 +42A7 FF58
43.374 +42A8 FF59
43.375 +42A9 FF5A
43.376 +42C0 FF5B
43.377 +42C1 FF21
43.378 +42C2 FF22
43.379 +42C3 FF23
43.380 +42C4 FF24
43.381 +42C5 FF25
43.382 +42C6 FF26
43.383 +42C7 FF27
43.384 +42C8 FF28
43.385 +42C9 FF29
43.386 +42D0 FF5D
43.387 +42D1 FF2A
43.388 +42D2 FF2B
43.389 +42D3 FF2C
43.390 +42D4 FF2D
43.391 +42D5 FF2E
43.392 +42D6 FF2F
43.393 +42D7 FF30
43.394 +42D8 FF31
43.395 +42D9 FF32
43.396 +42E0 FFE6
43.397 +42E2 FF33
43.398 +42E3 FF34
43.399 +42E4 FF35
43.400 +42E5 FF36
43.401 +42E6 FF37
43.402 +42E7 FF38
43.403 +42E8 FF39
43.404 +42E9 FF3A
43.405 +42F0 FF10
43.406 +42F1 FF11
43.407 +42F2 FF12
43.408 +42F3 FF13
43.409 +42F4 FF14
43.410 +42F5 FF15
43.411 +42F6 FF16
43.412 +42F7 FF17
43.413 +42F8 FF18
43.414 +42F9 FF19
43.415 +4341 3165
43.416 +4342 3166
43.417 +4343 3167
43.418 +4344 3168
43.419 +4345 3169
43.420 +4346 316A
43.421 +4347 316B
43.422 +4348 316C
43.423 +4349 316D
43.424 +434A 316E
43.425 +434B 316F
43.426 +434C 3170
43.427 +434D 3171
43.428 +434E 3172
43.429 +434F 3173
43.430 +4350 3174
43.431 +4351 3175
43.432 +4352 3176
43.433 +4353 3177
43.434 +4354 3178
43.435 +4355 3179
43.436 +4356 317A
43.437 +4357 317B
43.438 +4358 317C
43.439 +4359 317D
43.440 +435A 317E
43.441 +435B 317F
43.442 +435C 3180
43.443 +435D 3181
43.444 +435E 3182
43.445 +435F 3183
43.446 +4360 3184
43.447 +4361 3185
43.448 +4362 3186
43.449 +4363 3187
43.450 +4364 3188
43.451 +4365 3189
43.452 +4366 318A
43.453 +4367 318B
43.454 +4368 318C
43.455 +4369 318D
43.456 +436A 318E
43.457 +4441 3041
43.458 +4442 3042
43.459 +4443 3043
43.460 +4444 3044
43.461 +4445 3045
43.462 +4446 3046
43.463 +4447 3047
43.464 +4448 3048
43.465 +4449 3049
43.466 +444A 304A
43.467 +444B 304B
43.468 +444C 304C
43.469 +444D 304D
43.470 +444E 304E
43.471 +444F 304F
43.472 +4450 3050
43.473 +4451 3051
43.474 +4452 3052
43.475 +4453 3053
43.476 +4454 3054
43.477 +4455 3055
43.478 +4456 3056
43.479 +4457 3057
43.480 +4458 3058
43.481 +4459 3059
43.482 +445A 305A
43.483 +445B 305B
43.484 +445C 305C
43.485 +445D 305D
43.486 +445E 305E
43.487 +445F 305F
43.488 +4460 3060
43.489 +4461 3061
43.490 +4462 3062
43.491 +4463 3063
43.492 +4464 3064
43.493 +4465 3065
43.494 +4466 3066
43.495 +4467 3067
43.496 +4468 3068
43.497 +4469 3069
43.498 +446A 306A
43.499 +446B 306B
43.500 +446C 306C
43.501 +446D 306D
43.502 +446E 306E
43.503 +446F 306F
43.504 +4470 3070
43.505 +4471 3071
43.506 +4472 3072
43.507 +4473 3073
43.508 +4474 3074
43.509 +4475 3075
43.510 +4476 3076
43.511 +4477 3077
43.512 +4478 3078
43.513 +4479 3079
43.514 +447A 307A
43.515 +447B 307B
43.516 +447C 307C
43.517 +447D 307D
43.518 +447E 307E
43.519 +447F 307F
43.520 +4480 3080
43.521 +4481 3081
43.522 +4482 3082
43.523 +4483 3083
43.524 +4484 3084
43.525 +4485 3085
43.526 +4486 3086
43.527 +4487 3087
43.528 +4488 3088
43.529 +4489 3089
43.530 +448A 308A
43.531 +448B 308B
43.532 +448C 308C
43.533 +448D 308D
43.534 +448E 308E
43.535 +448F 308F
43.536 +4490 3090
43.537 +4491 3091
43.538 +4492 3092
43.539 +4493 3093
43.540 +4541 30A1
43.541 +4542 30A2
43.542 +4543 30A3
43.543 +4544 30A4
43.544 +4545 30A5
43.545 +4546 30A6
43.546 +4547 30A7
43.547 +4548 30A8
43.548 +4549 30A9
43.549 +454A 30AA
43.550 +454B 30AB
43.551 +454C 30AC
43.552 +454D 30AD
43.553 +454E 30AE
43.554 +454F 30AF
43.555 +4550 30B0
43.556 +4551 30B1
43.557 +4552 30B2
43.558 +4553 30B3
43.559 +4554 30B4
43.560 +4555 30B5
43.561 +4556 30B6
43.562 +4557 30B7
43.563 +4558 30B8
43.564 +4559 30B9
43.565 +455A 30BA
43.566 +455B 30BB
43.567 +455C 30BC
43.568 +455D 30BD
43.569 +455E 30BE
43.570 +455F 30BF
43.571 +4560 30C0
43.572 +4561 30C1
43.573 +4562 30C2
43.574 +4563 30C3
43.575 +4564 30C4
43.576 +4565 30C5
43.577 +4566 30C6
43.578 +4567 30C7
43.579 +4568 30C8
43.580 +4569 30C9
43.581 +456A 30CA
43.582 +456B 30CB
43.583 +456C 30CC
43.584 +456D 30CD
43.585 +456E 30CE
43.586 +456F 30CF
43.587 +4570 30D0
43.588 +4571 30D1
43.589 +4572 30D2
43.590 +4573 30D3
43.591 +4574 30D4
43.592 +4575 30D5
43.593 +4576 30D6
43.594 +4577 30D7
43.595 +4578 30D8
43.596 +4579 30D9
43.597 +457A 30DA
43.598 +457B 30DB
43.599 +457C 30DC
43.600 +457D 30DD
43.601 +457E 30DE
43.602 +457F 30DF
43.603 +4580 30E0
43.604 +4581 30E1
43.605 +4582 30E2
43.606 +4583 30E3
43.607 +4584 30E4
43.608 +4585 30E5
43.609 +4586 30E6
43.610 +4587 30E7
43.611 +4588 30E8
43.612 +4589 30E9
43.613 +458A 30EA
43.614 +458B 30EB
43.615 +458C 30EC
43.616 +458D 30ED
43.617 +458E 30EE
43.618 +458F 30EF
43.619 +4590 30F0
43.620 +4591 30F1
43.621 +4592 30F2
43.622 +4593 30F3
43.623 +4594 30F4
43.624 +4595 30F5
43.625 +4596 30F6
43.626 +4641 2170
43.627 +4642 2171
43.628 +4643 2172
43.629 +4644 2173
43.630 +4645 2174
43.631 +4646 2175
43.632 +4647 2176
43.633 +4648 2177
43.634 +4649 2178
43.635 +464A 2179
43.636 +4650 2160
43.637 +4651 2161
43.638 +4652 2162
43.639 +4653 2163
43.640 +4654 2164
43.641 +4655 2165
43.642 +4656 2166
43.643 +4657 2167
43.644 +4658 2168
43.645 +4659 2169
43.646 +4661 0391
43.647 +4662 0392
43.648 +4663 0393
43.649 +4664 0394
43.650 +4665 0395
43.651 +4666 0396
43.652 +4667 0397
43.653 +4668 0398
43.654 +4669 0399
43.655 +466A 039A
43.656 +466B 039B
43.657 +466C 039C
43.658 +466D 039D
43.659 +466E 039E
43.660 +466F 039F
43.661 +4670 03A0
43.662 +4671 03A1
43.663 +4672 03A3
43.664 +4673 03A4
43.665 +4674 03A5
43.666 +4675 03A6
43.667 +4676 03A7
43.668 +4677 03A8
43.669 +4678 03A9
43.670 +4681 03B1
43.671 +4682 03B2
43.672 +4683 03B3
43.673 +4684 03B4
43.674 +4685 03B5
43.675 +4686 03B6
43.676 +4687 03B7
43.677 +4688 03B8
43.678 +4689 03B9
43.679 +468A 03BA
43.680 +468B 03BB
43.681 +468C 03BC
43.682 +468D 03BD
43.683 +468E 03BE
43.684 +468F 03BF
43.685 +4690 03C0
43.686 +4691 03C1
43.687 +4692 03C3
43.688 +4693 03C4
43.689 +4694 03C5
43.690 +4695 03C6
43.691 +4696 03C7
43.692 +4697 03C8
43.693 +4698 03C9
43.694 +4741 2500
43.695 +4742 2502
43.696 +4743 250C
43.697 +4744 2510
43.698 +4745 2518
43.699 +4746 2514
43.700 +4747 251C
43.701 +4748 252C
43.702 +4749 2524
43.703 +474A 2534
43.704 +474B 253C
43.705 +474C 2501
43.706 +474D 2503
43.707 +474E 250F
43.708 +474F 2513
43.709 +4750 251B
43.710 +4751 2517
43.711 +4752 2523
43.712 +4753 2533
43.713 +4754 252B
43.714 +4755 253B
43.715 +4756 254B
43.716 +4757 2520
43.717 +4758 252F
43.718 +4759 2528
43.719 +475A 2537
43.720 +475B 253F
43.721 +475C 251D
43.722 +475D 2530
43.723 +475E 2525
43.724 +475F 2538
43.725 +4760 2542
43.726 +4761 2512
43.727 +4762 2511
43.728 +4763 251A
43.729 +4764 2519
43.730 +4765 2516
43.731 +4766 2515
43.732 +4767 250E
43.733 +4768 250D
43.734 +4769 251E
43.735 +476A 251F
43.736 +476B 2521
43.737 +476C 2522
43.738 +476D 2526
43.739 +476E 2527
43.740 +476F 2529
43.741 +4770 252A
43.742 +4771 252D
43.743 +4772 252E
43.744 +4773 2531
43.745 +4774 2532
43.746 +4775 2535
43.747 +4776 2536
43.748 +4777 2539
43.749 +4778 253A
43.750 +4779 253D
43.751 +477A 253E
43.752 +477B 2540
43.753 +477C 2541
43.754 +477D 2543
43.755 +477E 2544
43.756 +477F 2545
43.757 +4780 2546
43.758 +4781 2547
43.759 +4782 2548
43.760 +4783 2549
43.761 +4784 254A
43.762 +4841 3395
43.763 +4842 3398
43.764 +4843 33A3
43.765 +4844 33A4
43.766 +4845 33A5
43.767 +4846 33A6
43.768 +4847 3399
43.769 +4848 339A
43.770 +4849 339B
43.771 +484A 339F
43.772 +484B 33A0
43.773 +484C 33A1
43.774 +484D 33A2
43.775 +484E 33CA
43.776 +484F 338D
43.777 +4850 33CF
43.778 +4851 3388
43.779 +4852 3389
43.780 +4853 33C8
43.781 +4854 33A7
43.782 +4855 33A8
43.783 +4856 33B0
43.784 +4857 33B1
43.785 +4858 33B2
43.786 +4859 33B3
43.787 +485A 33B4
43.788 +485B 33B5
43.789 +485C 33B6
43.790 +485D 33B7
43.791 +485E 33B8
43.792 +485F 33B9
43.793 +4860 3380
43.794 +4861 3381
43.795 +4862 3382
43.796 +4863 3383
43.797 +4864 3384
43.798 +4865 33BA
43.799 +4866 33BB
43.800 +4867 33BC
43.801 +4868 33BD
43.802 +4869 33BE
43.803 +486A 33BF
43.804 +486B 3390
43.805 +486C 3391
43.806 +486D 3392
43.807 +486E 3393
43.808 +486F 3394
43.809 +4870 2126
43.810 +4871 33C0
43.811 +4872 33C1
43.812 +4873 338A
43.813 +4874 338B
43.814 +4875 338C
43.815 +4876 33D6
43.816 +4877 33C5
43.817 +4878 33AD
43.818 +4879 33AE
43.819 +487A 33AF
43.820 +487B 33DB
43.821 +487C 33A9
43.822 +487D 33AA
43.823 +487E 33AB
43.824 +487F 33AC
43.825 +4880 33DD
43.826 +4881 33D0
43.827 +4882 33D3
43.828 +4883 33C3
43.829 +4884 33C9
43.830 +4885 33DC
43.831 +4886 33C6
43.832 +4941 221D
43.833 +4942 2235
43.834 +4943 222B
43.835 +4944 222C
43.836 +4945 2208
43.837 +4946 220B
43.838 +4947 2286
43.839 +4948 2287
43.840 +4949 2282
43.841 +494A 2283
43.842 +494B 222A
43.843 +494C 2229
43.844 +494D 2227
43.845 +494E 2228
43.846 +494F 21D2
43.847 +4950 21D4
43.848 +4951 2200
43.849 +4952 2203
43.850 +4953 00B4
43.851 +4954 02DC
43.852 +4955 02C7
43.853 +4956 02D8
43.854 +4957 02DD
43.855 +4958 02DA
43.856 +4959 02D9
43.857 +495A 00B8
43.858 +495B 02DB
43.859 +495C 00A1
43.860 +495D 00BF
43.861 +495E 02D0
43.862 +495F 222E
43.863 +4960 2211
43.864 +4961 220F
43.865 +4962 00A4
43.866 +4963 2109
43.867 +4964 2030
43.868 +4965 25C1
43.869 +4966 25C0
43.870 +4967 25B7
43.871 +4968 25B6
43.872 +4969 2664
43.873 +496A 2660
43.874 +496B 2661
43.875 +496C 2665
43.876 +496D 2667
43.877 +496E 2663
43.878 +496F 25C9
43.879 +4970 25C8
43.880 +4971 25A3
43.881 +4972 25D0
43.882 +4973 25D1
43.883 +4974 2592
43.884 +4975 25A4
43.885 +4976 25A5
43.886 +4977 25A8
43.887 +4978 25A7
43.888 +4979 25A6
43.889 +497A 25A9
43.890 +497B 2668
43.891 +497C 260F
43.892 +497D 260E
43.893 +497E 261C
43.894 +497F 261E
43.895 +4980 00B6
43.896 +4981 2020
43.897 +4982 2021
43.898 +4983 2195
43.899 +4984 2197
43.900 +4985 2199
43.901 +4986 2196
43.902 +4987 2198
43.903 +4988 266D
43.904 +4989 2669
43.905 +498A 266A
43.906 +498B 266C
43.907 +498C 327F
43.908 +498D 321C
43.909 +498E 2116
43.910 +498F 33C7
43.911 +4990 2122
43.912 +4991 33C2
43.913 +4992 33D8
43.914 +4993 2121
43.915 +4994 02BA
43.916 +4995 20AC
43.917 +4996 00AE
43.918 +4A41 0410
43.919 +4A42 0411
43.920 +4A43 0412
43.921 +4A44 0413
43.922 +4A45 0414
43.923 +4A46 0415
43.924 +4A47 0401
43.925 +4A48 0416
43.926 +4A49 0417
43.927 +4A4A 0418
43.928 +4A4B 0419
43.929 +4A4C 041A
43.930 +4A4D 041B
43.931 +4A4E 041C
43.932 +4A4F 041D
43.933 +4A50 041E
43.934 +4A51 041F
43.935 +4A52 0420
43.936 +4A53 0421
43.937 +4A54 0422
43.938 +4A55 0423
43.939 +4A56 0424
43.940 +4A57 0425
43.941 +4A58 0426
43.942 +4A59 0427
43.943 +4A5A 0428
43.944 +4A5B 0429
43.945 +4A5C 042A
43.946 +4A5D 042B
43.947 +4A5E 042C
43.948 +4A5F 042D
43.949 +4A60 042E
43.950 +4A61 042F
43.951 +4A62 0430
43.952 +4A63 0431
43.953 +4A64 0432
43.954 +4A65 0433
43.955 +4A66 0434
43.956 +4A67 0435
43.957 +4A68 0451
43.958 +4A69 0436
43.959 +4A6A 0437
43.960 +4A6B 0438
43.961 +4A6C 0439
43.962 +4A6D 043A
43.963 +4A6E 043B
43.964 +4A6F 043C
43.965 +4A70 043D
43.966 +4A71 043E
43.967 +4A72 043F
43.968 +4A73 0440
43.969 +4A74 0441
43.970 +4A75 0442
43.971 +4A76 0443
43.972 +4A77 0444
43.973 +4A78 0445
43.974 +4A79 0446
43.975 +4A7A 0447
43.976 +4A7B 0448
43.977 +4A7C 0449
43.978 +4A7D 044A
43.979 +4A7E 044B
43.980 +4A7F 044C
43.981 +4A80 044D
43.982 +4A81 044E
43.983 +4A82 044F
43.984 +4B41 00C6
43.985 +4B42 00D0
43.986 +4B43 00AA
43.987 +4B44 0126
43.988 +4B46 0132
43.989 +4B48 013F
43.990 +4B49 0141
43.991 +4B4A 00D8
43.992 +4B4B 0152
43.993 +4B4C 00BA
43.994 +4B4D 00DE
43.995 +4B4E 0166
43.996 +4B4F 014A
43.997 +4B51 3260
43.998 +4B52 3261
43.999 +4B53 3262
43.1000 +4B54 3263
43.1001 +4B55 3264
43.1002 +4B56 3265
43.1003 +4B57 3266
43.1004 +4B58 3267
43.1005 +4B59 3268
43.1006 +4B5A 3269
43.1007 +4B5B 326A
43.1008 +4B5C 326B
43.1009 +4B5D 326C
43.1010 +4B5E 326D
43.1011 +4B5F 326E
43.1012 +4B60 326F
43.1013 +4B61 3270
43.1014 +4B62 3271
43.1015 +4B63 3272
43.1016 +4B64 3273
43.1017 +4B65 3274
43.1018 +4B66 3275
43.1019 +4B67 3276
43.1020 +4B68 3277
43.1021 +4B69 3278
43.1022 +4B6A 3279
43.1023 +4B6B 327A
43.1024 +4B6C 327B
43.1025 +4B6D 24D0
43.1026 +4B6E 24D1
43.1027 +4B6F 24D2
43.1028 +4B70 24D3
43.1029 +4B71 24D4
43.1030 +4B72 24D5
43.1031 +4B73 24D6
43.1032 +4B74 24D7
43.1033 +4B75 24D8
43.1034 +4B76 24D9
43.1035 +4B77 24DA
43.1036 +4B78 24DB
43.1037 +4B79 24DC
43.1038 +4B7A 24DD
43.1039 +4B7B 24DE
43.1040 +4B7C 24DF
43.1041 +4B7D 24E0
43.1042 +4B7E 24E1
43.1043 +4B7F 24E2
43.1044 +4B80 24E3
43.1045 +4B81 24E4
43.1046 +4B82 24E5
43.1047 +4B83 24E6
43.1048 +4B84 24E7
43.1049 +4B85 24E8
43.1050 +4B86 24E9
43.1051 +4B87 2460
43.1052 +4B88 2461
43.1053 +4B89 2462
43.1054 +4B8A 2463
43.1055 +4B8B 2464
43.1056 +4B8C 2465
43.1057 +4B8D 2466
43.1058 +4B8E 2467
43.1059 +4B8F 2468
43.1060 +4B90 2469
43.1061 +4B91 246A
43.1062 +4B92 246B
43.1063 +4B93 246C
43.1064 +4B94 246D
43.1065 +4B95 246E
43.1066 +4B96 00BD
43.1067 +4B97 2153
43.1068 +4B98 2154
43.1069 +4B99 00BC
43.1070 +4B9A 00BE
43.1071 +4B9B 215B
43.1072 +4B9C 215C
43.1073 +4B9D 215D
43.1074 +4B9E 215E
43.1075 +4BA0 00E6
43.1076 +4BA1 0111
43.1077 +4BA2 00F0
43.1078 +4BA3 0127
43.1079 +4BA4 0131
43.1080 +4BA5 0133
43.1081 +4BA6 0138
43.1082 +4BA7 0140
43.1083 +4BA8 0142
43.1084 +4BA9 00F8
43.1085 +4BAA 0153
43.1086 +4BAB 00DF
43.1087 +4BAC 00FE
43.1088 +4BAD 0167
43.1089 +4BAE 014B
43.1090 +4BAF 0149
43.1091 +4BB0 3200
43.1092 +4BB1 3201
43.1093 +4BB2 3202
43.1094 +4BB3 3203
43.1095 +4BB4 3204
43.1096 +4BB5 3205
43.1097 +4BB6 3206
43.1098 +4BB7 3207
43.1099 +4BB8 3208
43.1100 +4BB9 3209
43.1101 +4BBA 320A
43.1102 +4BBB 320B
43.1103 +4BBC 320C
43.1104 +4BBD 320D
43.1105 +4BBE 320E
43.1106 +4BBF 320F
43.1107 +4BC0 3210
43.1108 +4BC1 3211
43.1109 +4BC2 3212
43.1110 +4BC3 3213
43.1111 +4BC4 3214
43.1112 +4BC5 3215
43.1113 +4BC6 3216
43.1114 +4BC7 3217
43.1115 +4BC8 3218
43.1116 +4BC9 3219
43.1117 +4BCA 321A
43.1118 +4BCB 321B
43.1119 +4BCC 249C
43.1120 +4BCD 249D
43.1121 +4BCE 249E
43.1122 +4BCF 249F
43.1123 +4BD0 24A0
43.1124 +4BD1 24A1
43.1125 +4BD2 24A2
43.1126 +4BD3 24A3
43.1127 +4BD4 24A4
43.1128 +4BD5 24A5
43.1129 +4BD6 24A6
43.1130 +4BD7 24A7
43.1131 +4BD8 24A8
43.1132 +4BD9 24A9
43.1133 +4BDA 24AA
43.1134 +4BDB 24AB
43.1135 +4BDC 24AC
43.1136 +4BDD 24AD
43.1137 +4BDE 24AE
43.1138 +4BDF 24AF
43.1139 +4BE0 24B0
43.1140 +4BE1 24B1
43.1141 +4BE2 24B2
43.1142 +4BE3 24B3
43.1143 +4BE4 24B4
43.1144 +4BE5 24B5
43.1145 +4BE6 2474
43.1146 +4BE7 2475
43.1147 +4BE8 2476
43.1148 +4BE9 2477
43.1149 +4BEA 2478
43.1150 +4BEB 2479
43.1151 +4BEC 247A
43.1152 +4BED 247B
43.1153 +4BEE 247C
43.1154 +4BEF 247D
43.1155 +4BF0 247E
43.1156 +4BF1 247F
43.1157 +4BF2 2480
43.1158 +4BF3 2481
43.1159 +4BF4 2482
43.1160 +4BF5 00B9
43.1161 +4BF6 00B2
43.1162 +4BF7 00B3
43.1163 +4BF8 2074
43.1164 +4BF9 207F
43.1165 +4BFA 2081
43.1166 +4BFB 2082
43.1167 +4BFC 2083
43.1168 +4BFD 2084
43.1169 +4C41 1100
43.1170 +4C42 1101
43.1171 +4C43 1102
43.1172 +4C44 1103
43.1173 +4C45 1104
43.1174 +4C46 1105
43.1175 +4C47 1106
43.1176 +4C48 1107
43.1177 +4C49 1108
43.1178 +4C4A 1109
43.1179 +4C4B 110A
43.1180 +4C4C 110B
43.1181 +4C4D 110C
43.1182 +4C4E 110D
43.1183 +4C4F 110E
43.1184 +4C50 110F
43.1185 +4C51 1110
43.1186 +4C52 1111
43.1187 +4C53 1112
43.1188 +4C54 1113
43.1189 +4C55 1114
43.1190 +4C56 1115
43.1191 +4C57 1116
43.1192 +4C58 1117
43.1193 +4C59 1118
43.1194 +4C5A 1119
43.1195 +4C5B 111A
43.1196 +4C5C 111B
43.1197 +4C5D 111C
43.1198 +4C5E 111D
43.1199 +4C5F 111E
43.1200 +4C60 111F
43.1201 +4C61 1120
43.1202 +4C62 1121
43.1203 +4C63 1122
43.1204 +4C64 1123
43.1205 +4C65 1124
43.1206 +4C66 1125
43.1207 +4C67 1126
43.1208 +4C68 1127
43.1209 +4C69 1128
43.1210 +4C6A 1129
43.1211 +4C6B 112A
43.1212 +4C6C 112B
43.1213 +4C6D 112C
43.1214 +4C6E 112D
43.1215 +4C6F 112E
43.1216 +4C70 112F
43.1217 +4C71 1130
43.1218 +4C72 1131
43.1219 +4C73 1132
43.1220 +4C74 1133
43.1221 +4C75 1134
43.1222 +4C76 1135
43.1223 +4C77 1136
43.1224 +4C78 1137
43.1225 +4C79 1138
43.1226 +4C7A 1139
43.1227 +4C7B 113A
43.1228 +4C7C 113B
43.1229 +4C7D 113C
43.1230 +4C7E 113D
43.1231 +4C7F 113E
43.1232 +4C80 113F
43.1233 +4C81 1140
43.1234 +4C82 1141
43.1235 +4C83 1142
43.1236 +4C84 1143
43.1237 +4C85 1144
43.1238 +4C86 1145
43.1239 +4C87 1146
43.1240 +4C88 1147
43.1241 +4C89 1148
43.1242 +4C8A 1149
43.1243 +4C8B 114A
43.1244 +4C8C 114B
43.1245 +4C8D 114C
43.1246 +4C8E 114D
43.1247 +4C8F 114E
43.1248 +4C90 114F
43.1249 +4C91 1150
43.1250 +4C92 1151
43.1251 +4C93 1152
43.1252 +4C94 1153
43.1253 +4C95 1154
43.1254 +4C96 1155
43.1255 +4C97 1156
43.1256 +4C98 1157
43.1257 +4C99 1158
43.1258 +4C9A 1159
43.1259 +4D41 115F
43.1260 +4D42 1160
43.1261 +4D43 1161
43.1262 +4D44 1162
43.1263 +4D45 1163
43.1264 +4D46 1164
43.1265 +4D47 1165
43.1266 +4D48 1166
43.1267 +4D49 1167
43.1268 +4D4A 1168
43.1269 +4D4B 1169
43.1270 +4D4C 116A
43.1271 +4D4D 116B
43.1272 +4D4E 116C
43.1273 +4D4F 116D
43.1274 +4D50 116E
43.1275 +4D51 116F
43.1276 +4D52 1170
43.1277 +4D53 1171
43.1278 +4D54 1172
43.1279 +4D55 1173
43.1280 +4D56 1174
43.1281 +4D57 1175
43.1282 +4D58 1176
43.1283 +4D59 1177
43.1284 +4D5A 1178
43.1285 +4D5B 1179
43.1286 +4D5C 117A
43.1287 +4D5D 117B
43.1288 +4D5E 117C
43.1289 +4D5F 117D
43.1290 +4D60 117E
43.1291 +4D61 117F
43.1292 +4D62 1180
43.1293 +4D63 1181
43.1294 +4D64 1182
43.1295 +4D65 1183
43.1296 +4D66 1184
43.1297 +4D67 1185
43.1298 +4D68 1186
43.1299 +4D69 1187
43.1300 +4D6A 1188
43.1301 +4D6B 1189
43.1302 +4D6C 118A
43.1303 +4D6D 118B
43.1304 +4D6E 118C
43.1305 +4D6F 118D
43.1306 +4D70 118E
43.1307 +4D71 118F
43.1308 +4D72 1190
43.1309 +4D73 1191
43.1310 +4D74 1192
43.1311 +4D75 1193
43.1312 +4D76 1194
43.1313 +4D77 1195
43.1314 +4D78 1196
43.1315 +4D79 1197
43.1316 +4D7A 1198
43.1317 +4D7B 1199
43.1318 +4D7C 119A
43.1319 +4D7D 119B
43.1320 +4D7E 119C
43.1321 +4D7F 119D
43.1322 +4D80 119E
43.1323 +4D81 119F
43.1324 +4D82 11A0
43.1325 +4D83 11A1
43.1326 +4D84 11A2
43.1327 +4E41 11A8
43.1328 +4E42 11A9
43.1329 +4E43 11AA
43.1330 +4E44 11AB
43.1331 +4E45 11AC
43.1332 +4E46 11AD
43.1333 +4E47 11AE
43.1334 +4E48 11AF
43.1335 +4E49 11B0
43.1336 +4E4A 11B1
43.1337 +4E4B 11B2
43.1338 +4E4C 11B3
43.1339 +4E4D 11B4
43.1340 +4E4E 11B5
43.1341 +4E4F 11B6
43.1342 +4E50 11B7
43.1343 +4E51 11B8
43.1344 +4E52 11B9
43.1345 +4E53 11BA
43.1346 +4E54 11BB
43.1347 +4E55 11BC
43.1348 +4E56 11BD
43.1349 +4E57 11BE
43.1350 +4E58 11BF
43.1351 +4E59 11C0
43.1352 +4E5A 11C1
43.1353 +4E5B 11C2
43.1354 +4E5C 11C3
43.1355 +4E5D 11C4
43.1356 +4E5E 11C5
43.1357 +4E5F 11C6
43.1358 +4E60 11C7
43.1359 +4E61 11C8
43.1360 +4E62 11C9
43.1361 +4E63 11CA
43.1362 +4E64 11CB
43.1363 +4E65 11CC
43.1364 +4E66 11CD
43.1365 +4E67 11CE
43.1366 +4E68 11CF
43.1367 +4E69 11D0
43.1368 +4E6A 11D1
43.1369 +4E6B 11D2
43.1370 +4E6C 11D3
43.1371 +4E6D 11D4
43.1372 +4E6E 11D5
43.1373 +4E6F 11D6
43.1374 +4E70 11D7
43.1375 +4E71 11D8
43.1376 +4E72 11D9
43.1377 +4E73 11DA
43.1378 +4E74 11DB
43.1379 +4E75 11DC
43.1380 +4E76 11DD
43.1381 +4E77 11DE
43.1382 +4E78 11DF
43.1383 +4E79 11E0
43.1384 +4E7A 11E1
43.1385 +4E7B 11E2
43.1386 +4E7C 11E3
43.1387 +4E7D 11E4
43.1388 +4E7E 11E5
43.1389 +4E7F 11E6
43.1390 +4E80 11E7
43.1391 +4E81 11E8
43.1392 +4E82 11E9
43.1393 +4E83 11EA
43.1394 +4E84 11EB
43.1395 +4E85 11EC
43.1396 +4E86 11ED
43.1397 +4E87 11EE
43.1398 +4E88 11EF
43.1399 +4E89 11F0
43.1400 +4E8A 11F1
43.1401 +4E8B 11F2
43.1402 +4E8C 11F3
43.1403 +4E8D 11F4
43.1404 +4E8E 11F5
43.1405 +4E8F 11F6
43.1406 +4E90 11F7
43.1407 +4E91 11F8
43.1408 +4E92 11F9
43.1409 +5041 4F3D
43.1410 +5042 4F73
43.1411 +5043 5047
43.1412 +5044 50F9
43.1413 +5045 52A0
43.1414 +5046 53EF
43.1415 +5047 5475
43.1416 +5048 54E5
43.1417 +5049 5609
43.1418 +504A 5AC1
43.1419 +504B 5BB6
43.1420 +504C 6687
43.1421 +504D 67EF
43.1422 +504E 67B6
43.1423 +504F 6B4C
43.1424 +5050 7A3C
43.1425 +5051 82DB
43.1426 +5052 8304
43.1427 +5053 8857
43.1428 +5054 8888
43.1429 +5055 8A36
43.1430 +5056 8CC8
43.1431 +5057 8DCF
43.1432 +5058 8EFB
43.1433 +5059 8FE6
43.1434 +505A 99D5
43.1435 +505B 523B
43.1436 +505C 5374
43.1437 +505D 5404
43.1438 +505E F843
43.1439 +505F 606A
43.1440 +5060 64F1
43.1441 +5061 6BBC
43.1442 +5062 73CF
43.1443 +5063 811A
43.1444 +5064 89BA
43.1445 +5065 89D2
43.1446 +5066 95A3
43.1447 +5067 520A
43.1448 +5068 58BE
43.1449 +5069 5978
43.1450 +506A 59E6
43.1451 +506B 5E72
43.1452 +506C 5E79
43.1453 +506D 61C7
43.1454 +506E 63C0
43.1455 +506F 6746
43.1456 +5070 6F97
43.1457 +5071 764E
43.1458 +5072 770B
43.1459 +5073 7A08
43.1460 +5074 7AFF
43.1461 +5075 7C21
43.1462 +5076 826E
43.1463 +5077 8271
43.1464 +5078 809D
43.1465 +5079 8AEB
43.1466 +507A 9593
43.1467 +507B 4E6B
43.1468 +507C 559D
43.1469 +507D 66F7
43.1470 +507E 6E34
43.1471 +507F 78A3
43.1472 +5080 7AED
43.1473 +5081 8910
43.1474 +5082 7FAF
43.1475 +5083 845B
43.1476 +5084 97A8
43.1477 +5085 52D8
43.1478 +5086 574E
43.1479 +5087 582A
43.1480 +5088 5D4C
43.1481 +5089 611F
43.1482 +508A 61BE
43.1483 +508B 6562
43.1484 +508C 67D1
43.1485 +508D 6A44
43.1486 +508E 6E1B
43.1487 +508F 7518
43.1488 +5090 75B3
43.1489 +5091 76E3
43.1490 +5092 7D3A
43.1491 +5093 9163
43.1492 +5094 9451
43.1493 +5095 9F95
43.1494 +5096 5323
43.1495 +5097 5CAC
43.1496 +5098 7532
43.1497 +5099 80DB
43.1498 +509A 9240
43.1499 +509B 9598
43.1500 +509C 5CA1
43.1501 +509D 525B
43.1502 +509E 59DC
43.1503 +509F 5D17
43.1504 +50A0 5EB7
43.1505 +50A1 5F3A
43.1506 +50A2 5F4A
43.1507 +50A3 6177
43.1508 +50A4 6C5F
43.1509 +50A5 7586
43.1510 +50A6 7DB1
43.1511 +50A7 8941
43.1512 +50A8 7CE0
43.1513 +50A9 8154
43.1514 +50AA 8591
43.1515 +50AB 8B1B
43.1516 +50AC 92FC
43.1517 +50AD 964D
43.1518 +50AE 4ECB
43.1519 +50AF 4EF7
43.1520 +50B0 500B
43.1521 +50B1 51F1
43.1522 +50B2 6137
43.1523 +50B3 613E
43.1524 +50B4 6168
43.1525 +50B5 6539
43.1526 +50B6 69EA
43.1527 +50B7 6F11
43.1528 +50B8 75A5
43.1529 +50B9 7686
43.1530 +50BA 76D6
43.1531 +50BB 7B87
43.1532 +50BC 82A5
43.1533 +50BD 84CB
43.1534 +50BE 958B
43.1535 +50BF 5BA2
43.1536 +50C0 5751
43.1537 +50C1 F901
43.1538 +50C2 7CB3
43.1539 +50C3 7FB9
43.1540 +50C4 91B5
43.1541 +50C5 53BB
43.1542 +50C6 5C45
43.1543 +50C7 5DE8
43.1544 +50C8 62D2
43.1545 +50C9 636E
43.1546 +50CA 64DA
43.1547 +50CB 6E20
43.1548 +50CC 70AC
43.1549 +50CD 64E7
43.1550 +50CE 8DDD
43.1551 +50CF 907D
43.1552 +50D0 F902
43.1553 +50D1 F844
43.1554 +50D2 92F8
43.1555 +50D3 4E7E
43.1556 +50D4 4EF6
43.1557 +50D5 5065
43.1558 +50D6 5DFE
43.1559 +50D7 5EFA
43.1560 +50D8 6106
43.1561 +50D9 8654
43.1562 +50DA 8E47
43.1563 +50DB 9375
43.1564 +50DC 9A2B
43.1565 +50DD 4E5E
43.1566 +50DE 5091
43.1567 +50DF 6770
43.1568 +50E0 5109
43.1569 +50E1 528D
43.1570 +50E2 6AA2
43.1571 +50E3 77BC
43.1572 +50E4 9ED4
43.1573 +50E5 52AB
43.1574 +50E6 602F
43.1575 +50E7 5048
43.1576 +50E8 61A9
43.1577 +50E9 63ED
43.1578 +50EA 64CA
43.1579 +50EB 683C
43.1580 +50EC 6A84
43.1581 +50ED 6FC0
43.1582 +50EE 89A1
43.1583 +50EF 9694
43.1584 +50F0 9ABC
43.1585 +50F1 5805
43.1586 +50F2 80A9
43.1587 +50F3 727D
43.1588 +50F4 72AC
43.1589 +50F5 7504
43.1590 +50F6 7D79
43.1591 +50F7 7E6D
43.1592 +50F8 898B
43.1593 +50F9 8B74
43.1594 +50FA 9063
43.1595 +50FB 9D51
43.1596 +50FC 6F54
43.1597 +50FD 6C7A
43.1598 +50FE 7D50
43.1599 +5141 7F3A
43.1600 +5142 8A23
43.1601 +5143 517C
43.1602 +5144 614A
43.1603 +5145 7B9D
43.1604 +5146 84B9
43.1605 +5147 8B19
43.1606 +5148 938C
43.1607 +5149 4EAC
43.1608 +514A 50BE
43.1609 +514B 52C1
43.1610 +514C 52CD
43.1611 +514D 537F
43.1612 +514E 54FD
43.1613 +514F 5883
43.1614 +5150 5E9A
43.1615 +5151 5F91
43.1616 +5152 6176
43.1617 +5153 66BB
43.1618 +5154 6243
43.1619 +5155 64CE
43.1620 +5156 656C
43.1621 +5157 666F
43.1622 +5158 66F4
43.1623 +5159 6897
43.1624 +515A 6AA0
43.1625 +515B 6D87
43.1626 +515C 7085
43.1627 +515D 71B2
43.1628 +515E 749F
43.1629 +515F 74CA
43.1630 +5160 754A
43.1631 +5161 75D9
43.1632 +5162 786C
43.1633 +5163 78EC
43.1634 +5164 7ADF
43.1635 +5165 7AF6
43.1636 +5166 7D45
43.1637 +5167 7D93
43.1638 +5168 8015
43.1639 +5169 803F
43.1640 +516A 811B
43.1641 +516B 8396
43.1642 +516C 8B66
43.1643 +516D 8F15
43.1644 +516E 9015
43.1645 +516F 93E1
43.1646 +5170 9803
43.1647 +5171 9838
43.1648 +5172 9A5A
43.1649 +5173 9BE8
43.1650 +5174 4FC2
43.1651 +5175 5553
43.1652 +5176 5951
43.1653 +5177 5B63
43.1654 +5178 5C46
43.1655 +5179 60B8
43.1656 +517A 6212
43.1657 +517B 6842
43.1658 +517C 68B0
43.1659 +517D 6EAA
43.1660 +517E 754C
43.1661 +517F 7678
43.1662 +5180 78CE
43.1663 +5181 F845
43.1664 +5182 7A3D
43.1665 +5183 7CFB
43.1666 +5184 7E6B
43.1667 +5185 7E7C
43.1668 +5186 8A08
43.1669 +5187 8AA1
43.1670 +5188 968E
43.1671 +5189 8C3F
43.1672 +518A 96DE
43.1673 +518B 9DC4
43.1674 +518C 53E9
43.1675 +518D 53E4
43.1676 +518E 544A
43.1677 +518F 5471
43.1678 +5190 56FA
43.1679 +5191 59D1
43.1680 +5192 5B64
43.1681 +5193 5EAB
43.1682 +5194 62F7
43.1683 +5195 6537
43.1684 +5196 6545
43.1685 +5197 6572
43.1686 +5198 67AF
43.1687 +5199 6772
43.1688 +519A 6CBD
43.1689 +519B 75FC
43.1690 +519C 7690
43.1691 +519D 8831
43.1692 +519E 77BD
43.1693 +519F 7A3F
43.1694 +51A0 777E
43.1695 +51A1 8003
43.1696 +51A2 80A1
43.1697 +51A3 818F
43.1698 +51A4 82E6
43.1699 +51A5 85C1
43.1700 +51A6 88B4
43.1701 +51A7 8A41
43.1702 +51A8 8AA5
43.1703 +51A9 F903
43.1704 +51AA 8F9C
43.1705 +51AB 932E
43.1706 +51AC 96C7
43.1707 +51AD 9867
43.1708 +51AE 9AD8
43.1709 +51AF 9F13
43.1710 +51B0 54ED
43.1711 +51B1 659B
43.1712 +51B2 66F2
43.1713 +51B3 688F
43.1714 +51B4 7A40
43.1715 +51B5 8C37
43.1716 +51B6 9D60
43.1717 +51B7 56F0
43.1718 +51B8 5764
43.1719 +51B9 5D11
43.1720 +51BA 6606
43.1721 +51BB 68B1
43.1722 +51BC 68CD
43.1723 +51BD 6EFE
43.1724 +51BE 889E
43.1725 +51BF 6C68
43.1726 +51C0 F904
43.1727 +51C1 9AA8
43.1728 +51C2 4F9B
43.1729 +51C3 516C
43.1730 +51C4 5171
43.1731 +51C5 529F
43.1732 +51C6 5B54
43.1733 +51C7 5DE5
43.1734 +51C8 8CA2
43.1735 +51C9 606D
43.1736 +51CA 6050
43.1737 +51CB 62F1
43.1738 +51CC 63A7
43.1739 +51CD 653B
43.1740 +51CE 6831
43.1741 +51CF 69D3
43.1742 +51D0 7A7A
43.1743 +51D1 7B9C
43.1744 +51D2 5BE1
43.1745 +51D3 6208
43.1746 +51D4 679C
43.1747 +51D5 74DC
43.1748 +51D6 79D1
43.1749 +51D7 83D3
43.1750 +51D8 874C
43.1751 +51D9 8A87
43.1752 +51DA 8AB2
43.1753 +51DB 904E
43.1754 +51DC 9846
43.1755 +51DD 5ED3
43.1756 +51DE 69E8
43.1757 +51DF 85FF
43.1758 +51E0 90ED
43.1759 +51E1 970D
43.1760 +51E2 F905
43.1761 +51E3 51A0
43.1762 +51E4 5B98
43.1763 +51E5 5BEC
43.1764 +51E6 6163
43.1765 +51E7 68FA
43.1766 +51E8 74D8
43.1767 +51E9 6B3E
43.1768 +51EA 704C
43.1769 +51EB 76E5
43.1770 +51EC 7BA1
43.1771 +51ED 7F50
43.1772 +51EE 83C5
43.1773 +51EF 89C0
43.1774 +51F0 8CAB
43.1775 +51F1 95DC
43.1776 +51F2 9928
43.1777 +51F3 9E1B
43.1778 +51F4 522E
43.1779 +51F5 605D
43.1780 +51F6 62EC
43.1781 +51F7 9002
43.1782 +51F8 5149
43.1783 +51F9 5321
43.1784 +51FA 58D9
43.1785 +51FB 5EE3
43.1786 +51FC 66E0
43.1787 +51FD 6D38
43.1788 +51FE 72C2
43.1789 +5241 73D6
43.1790 +5242 7B50
43.1791 +5243 80F1
43.1792 +5244 945B
43.1793 +5245 5366
43.1794 +5246 639B
43.1795 +5247 7F6B
43.1796 +5248 4E56
43.1797 +5249 5080
43.1798 +524A 584A
43.1799 +524B 58DE
43.1800 +524C 602A
43.1801 +524D 6127
43.1802 +524E 62D0
43.1803 +524F 69D0
43.1804 +5250 9B41
43.1805 +5251 5B8F
43.1806 +5252 7D18
43.1807 +5253 80B1
43.1808 +5254 8F5F
43.1809 +5255 4EA4
43.1810 +5256 50D1
43.1811 +5257 54AC
43.1812 +5258 55AC
43.1813 +5259 5B0C
43.1814 +525A 5DA0
43.1815 +525B 5DE7
43.1816 +525C 654E
43.1817 +525D 652A
43.1818 +525E 6821
43.1819 +525F 6A4B
43.1820 +5260 72E1
43.1821 +5261 768E
43.1822 +5262 77EF
43.1823 +5263 7D5E
43.1824 +5264 7FF9
43.1825 +5265 81A0
43.1826 +5266 854E
43.1827 +5267 86DF
43.1828 +5268 8F03
43.1829 +5269 8F4E
43.1830 +526A 90CA
43.1831 +526B 9278
43.1832 +526C 9903
43.1833 +526D 9A55
43.1834 +526E 9BAB
43.1835 +526F 4E18
43.1836 +5270 4E45
43.1837 +5271 4E5D
43.1838 +5272 4EC7
43.1839 +5273 4F5D
43.1840 +5274 4FF1
43.1841 +5275 50B4
43.1842 +5276 5177
43.1843 +5277 52FE
43.1844 +5278 5340
43.1845 +5279 53E3
43.1846 +527A 53E5
43.1847 +527B 548E
43.1848 +527C 5614
43.1849 +527D 57A2
43.1850 +527E 5ABE
43.1851 +527F 5AD7
43.1852 +5280 5BC7
43.1853 +5281 5D87
43.1854 +5282 5ED0
43.1855 +5283 61FC
43.1856 +5284 62D8
43.1857 +5285 6551
43.1858 +5286 F846
43.1859 +5287 67B8
43.1860 +5288 67E9
43.1861 +5289 69CB
43.1862 +528A 6B50
43.1863 +528B 6BC6
43.1864 +528C 6BEC
43.1865 +528D 6C42
43.1866 +528E 6E9D
43.1867 +528F 7078
43.1868 +5290 72D7
43.1869 +5291 7396
43.1870 +5292 7403
43.1871 +5293 750C
43.1872 +5294 77BF
43.1873 +5295 77E9
43.1874 +5296 7A76
43.1875 +5297 7D7F
43.1876 +5298 8CFC
43.1877 +5299 81FC
43.1878 +529A 8205
43.1879 +529B 820A
43.1880 +529C 82DF
43.1881 +529D 8862
43.1882 +529E 89AF
43.1883 +529F 8B33
43.1884 +52A0 8EC0
43.1885 +52A1 9011
43.1886 +52A2 90B1
43.1887 +52A3 9264
43.1888 +52A4 98B6
43.1889 +52A5 99D2
43.1890 +52A6 9A45
43.1891 +52A7 9CE9
43.1892 +52A8 9DD7
43.1893 +52A9 9F9C
43.1894 +52AA 570B
43.1895 +52AB 5C40
43.1896 +52AC 63AC
43.1897 +52AD 83CA
43.1898 +52AE 97A0
43.1899 +52AF 9EB4
43.1900 +52B0 7A98
43.1901 +52B1 7FA4
43.1902 +52B2 8ECD
43.1903 +52B3 541B
43.1904 +52B4 90E1
43.1905 +52B5 5800
43.1906 +52B6 5C48
43.1907 +52B7 6398
43.1908 +52B8 7A9F
43.1909 +52B9 5BAE
43.1910 +52BA 5F13
43.1911 +52BB 7A79
43.1912 +52BC 7AAE
43.1913 +52BD 8EAC
43.1914 +52BE 5026
43.1915 +52BF 5238
43.1916 +52C0 52F8
43.1917 +52C1 5377
43.1918 +52C2 5708
43.1919 +52C3 62F3
43.1920 +52C4 6B0A
43.1921 +52C5 7737
43.1922 +52C6 53A5
43.1923 +52C7 8E76
43.1924 +52C8 95D5
43.1925 +52C9 673A
43.1926 +52CA 6AC3
43.1927 +52CB 6F70
43.1928 +52CC 8A6D
43.1929 +52CD 8DEA
43.1930 +52CE 8ECC
43.1931 +52CF 994B
43.1932 +52D0 6B78
43.1933 +52D1 8CB4
43.1934 +52D2 9B3C
43.1935 +52D3 F907
43.1936 +52D4 53EB
43.1937 +52D5 572D
43.1938 +52D6 594E
43.1939 +52D7 63C6
43.1940 +52D8 73EA
43.1941 +52D9 7845
43.1942 +52DA 7ABA
43.1943 +52DB 8475
43.1944 +52DC 7CFE
43.1945 +52DD 898F
43.1946 +52DE 8D73
43.1947 +52DF 9035
43.1948 +52E0 95A8
43.1949 +52E1 5747
43.1950 +52E2 7B60
43.1951 +52E3 83CC
43.1952 +52E4 921E
43.1953 +52E5 F908
43.1954 +52E6 6A58
43.1955 +52E7 514B
43.1956 +52E8 524B
43.1957 +52E9 5287
43.1958 +52EA 621F
43.1959 +52EB 6975
43.1960 +52EC 68D8
43.1961 +52ED 9699
43.1962 +52EE 50C5
43.1963 +52EF 52E4
43.1964 +52F0 5DF9
43.1965 +52F1 61C3
43.1966 +52F2 65A4
43.1967 +52F3 6839
43.1968 +52F4 69FF
43.1969 +52F5 6F0C
43.1970 +52F6 747E
43.1971 +52F7 7B4B
43.1972 +52F8 82B9
43.1973 +52F9 83EB
43.1974 +52FA 89B2
43.1975 +52FB 8B39
43.1976 +52FC 8FD1
43.1977 +52FD 9949
43.1978 +52FE F909
43.1979 +5341 4ECA
43.1980 +5342 64D2
43.1981 +5343 6A8E
43.1982 +5344 7434
43.1983 +5345 7981
43.1984 +5346 79BD
43.1985 +5347 887F
43.1986 +5348 887E
43.1987 +5349 895F
43.1988 +534A F90A
43.1989 +534B 9326
43.1990 +534C 53CA
43.1991 +534D 5C8C
43.1992 +534E 6025
43.1993 +534F 6271
43.1994 +5350 6C72
43.1995 +5351 7B08
43.1996 +5352 7D1A
43.1997 +5353 7D66
43.1998 +5354 4E98
43.1999 +5355 5162
43.2000 +5356 77DC
43.2001 +5357 80AF
43.2002 +5358 4F01
43.2003 +5359 4F0E
43.2004 +535A 5176
43.2005 +535B 5180
43.2006 +535C 55DC
43.2007 +535D 5668
43.2008 +535E 573B
43.2009 +535F 57FA
43.2010 +5360 5914
43.2011 +5361 5947
43.2012 +5362 5993
43.2013 +5363 5BC4
43.2014 +5364 5C90
43.2015 +5365 8C48
43.2016 +5366 5D0E
43.2017 +5367 5E7E
43.2018 +5368 5DF1
43.2019 +5369 5FCC
43.2020 +536A 6280
43.2021 +536B 65D7
43.2022 +536C 65E3
43.2023 +536D 671F
43.2024 +536E 675E
43.2025 +536F 68CB
43.2026 +5370 68C4
43.2027 +5371 6A5F
43.2028 +5372 6B3A
43.2029 +5373 6C23
43.2030 +5374 6C7D
43.2031 +5375 6C82
43.2032 +5376 6DC7
43.2033 +5377 7426
43.2034 +5378 742A
43.2035 +5379 74A3
43.2036 +537A 7578
43.2037 +537B 757F
43.2038 +537C 7881
43.2039 +537D 78EF
43.2040 +537E 7947
43.2041 +537F 7948
43.2042 +5380 797A
43.2043 +5381 7B95
43.2044 +5382 7D00
43.2045 +5383 7DBA
43.2046 +5384 F847
43.2047 +5385 8006
43.2048 +5386 802D
43.2049 +5387 808C
43.2050 +5388 671E
43.2051 +5389 8A18
43.2052 +538A 8B4F
43.2053 +538B 8D77
43.2054 +538C 9321
43.2055 +538D 98E2
43.2056 +538E 9951
43.2057 +538F 9A0E
43.2058 +5390 9A0F
43.2059 +5391 9A65
43.2060 +5392 9C2D
43.2061 +5393 9E92
43.2062 +5394 7DCA
43.2063 +5395 4F76
43.2064 +5396 5409
43.2065 +5397 62EE
43.2066 +5398 6854
43.2067 +5399 91D1
43.2068 +539A F848
43.2069 +539B 55AB
43.2070 +539C 513A
43.2071 +539D 61E6
43.2072 +539E 62CF
43.2073 +539F 62FF
43.2074 +53A0 7CEF
43.2075 +53A1 90A3
43.2076 +53A2 8AFE
43.2077 +53A3 6696
43.2078 +53A4 7156
43.2079 +53A5 96E3
43.2080 +53A6 637A
43.2081 +53A7 634F
43.2082 +53A8 5357
43.2083 +53A9 5583
43.2084 +53AA 7537
43.2085 +53AB 7D0D
43.2086 +53AC 56CA
43.2087 +53AD 5A18
43.2088 +53AE 66E9
43.2089 +53AF 4E43
43.2090 +53B0 5167
43.2091 +53B1 5948
43.2092 +53B2 67F0
43.2093 +53B3 8010
43.2094 +53B4 8FFA
43.2095 +53B5 5973
43.2096 +53B6 5E74
43.2097 +53B7 79CA
43.2098 +53B8 5FF5
43.2099 +53B9 606C
43.2100 +53BA 62C8
43.2101 +53BB 637B
43.2102 +53BC 4F5E
43.2103 +53BD 5BE7
43.2104 +53BE F849
43.2105 +53BF 52AA
43.2106 +53C0 5974
43.2107 +53C1 5B65
43.2108 +53C2 5F29
43.2109 +53C3 6012
43.2110 +53C4 7459
43.2111 +53C5 6FC3
43.2112 +53C6 81BF
43.2113 +53C7 8FB2
43.2114 +53C8 60F1
43.2115 +53C9 8166
43.2116 +53CA 5C3F
43.2117 +53CB F84A
43.2118 +53CC 5AE9
43.2119 +53CD 8A25
43.2120 +53CE 7D10
43.2121 +53CF 80FD
43.2122 +53D0 5C3C
43.2123 +53D1 6CE5
43.2124 +53D2 533F
43.2125 +53D3 6EBA
43.2126 +53D4 591A
43.2127 +53D5 8336
43.2128 +53D6 4E39
43.2129 +53D7 4F46
43.2130 +53D8 55AE
43.2131 +53D9 5718
43.2132 +53DA 58C7
43.2133 +53DB 65B7
43.2134 +53DC 65E6
43.2135 +53DD 6A80
43.2136 +53DE 6BB5
43.2137 +53DF 6E4D
43.2138 +53E0 77ED
43.2139 +53E1 7AEF
43.2140 +53E2 7C1E
43.2141 +53E3 7DDE
43.2142 +53E4 86CB
43.2143 +53E5 8892
43.2144 +53E6 9132
43.2145 +53E7 935B
43.2146 +53E8 977C
43.2147 +53E9 601B
43.2148 +53EA 64BB
43.2149 +53EB 737A
43.2150 +53EC 75B8
43.2151 +53ED 9054
43.2152 +53EE 95E5
43.2153 +53EF 97C3
43.2154 +53F0 5556
43.2155 +53F1 64D4
43.2156 +53F2 66C7
43.2157 +53F3 6DE1
43.2158 +53F4 6F6D
43.2159 +53F5 6FB9
43.2160 +53F6 75F0
43.2161 +53F7 8043
43.2162 +53F8 81BD
43.2163 +53F9 8983
43.2164 +53FA 8AC7
43.2165 +53FB 8B5A
43.2166 +53FC 6C93
43.2167 +53FD 7B54
43.2168 +53FE 8E0F
43.2169 +5441 905D
43.2170 +5442 515A
43.2171 +5443 5802
43.2172 +5444 5858
43.2173 +5445 5E62
43.2174 +5446 5510
43.2175 +5447 649E
43.2176 +5448 68E0
43.2177 +5449 7576
43.2178 +544A 7CD6
43.2179 +544B 87F7
43.2180 +544C 9EE8
43.2181 +544D 4EE3
43.2182 +544E 5788
43.2183 +544F 5927
43.2184 +5450 5C0D
43.2185 +5451 5CB1
43.2186 +5452 5E36
43.2187 +5453 5F85
43.2188 +5454 6234
43.2189 +5455 64E1
43.2190 +5456 73B3
43.2191 +5457 7893
43.2192 +5458 81FA
43.2193 +5459 888B
43.2194 +545A 8CB8
43.2195 +545B 968A
43.2196 +545C 9EDB
43.2197 +545D 5B85
43.2198 +545E 5FB7
43.2199 +545F 60B3
43.2200 +5460 5012
43.2201 +5461 5200
43.2202 +5462 5230
43.2203 +5463 5716
43.2204 +5464 5835
43.2205 +5465 5857
43.2206 +5466 5C0E
43.2207 +5467 5C60
43.2208 +5468 5CF6
43.2209 +5469 5EA6
43.2210 +546A 5F92
43.2211 +546B 60BC
43.2212 +546C 6311
43.2213 +546D 6417
43.2214 +546E 6843
43.2215 +546F 68F9
43.2216 +5470 6DD8
43.2217 +5471 6E21
43.2218 +5472 6ED4
43.2219 +5473 6FE4
43.2220 +5474 71FE
43.2221 +5475 76DC
43.2222 +5476 7779
43.2223 +5477 79B1
43.2224 +5478 7A3B
43.2225 +5479 8404
43.2226 +547A 83DF
43.2227 +547B 8CED
43.2228 +547C 8DF3
43.2229 +547D 8E48
43.2230 +547E 9003
43.2231 +547F 9014
43.2232 +5480 9053
43.2233 +5481 90FD
43.2234 +5482 934D
43.2235 +5483 9676
43.2236 +5484 97DC
43.2237 +5485 6BD2
43.2238 +5486 7006
43.2239 +5487 7258
43.2240 +5488 72A2
43.2241 +5489 7368
43.2242 +548A 7763
43.2243 +548B 79BF
43.2244 +548C 7BE4
43.2245 +548D 7E9B
43.2246 +548E 8B80
43.2247 +548F 58A9
43.2248 +5490 60C7
43.2249 +5491 6566
43.2250 +5492 66BE
43.2251 +5493 6C8C
43.2252 +5494 71C9
43.2253 +5495 8C5A
43.2254 +5496 9813
43.2255 +5497 5484
43.2256 +5498 4E6D
43.2257 +5499 7A81
43.2258 +549A 4EDD
43.2259 +549B 51AC
43.2260 +549C 51CD
43.2261 +549D 52D5
43.2262 +549E 540C
43.2263 +549F 578C
43.2264 +54A0 61A7
43.2265 +54A1 6771
43.2266 +54A2 6850
43.2267 +54A3 68DF
43.2268 +54A4 6D1E
43.2269 +54A5 6F7C
43.2270 +54A6 7AE5
43.2271 +54A7 75BC
43.2272 +54A8 77B3
43.2273 +54A9 8463
43.2274 +54AA 80F4
43.2275 +54AB 9285
43.2276 +54AC 515C
43.2277 +54AD 6597
43.2278 +54AE 675C
43.2279 +54AF 6793
43.2280 +54B0 75D8
43.2281 +54B1 7AC7
43.2282 +54B2 8373
43.2283 +54B3 809A
43.2284 +54B4 86AA
43.2285 +54B5 F95A
43.2286 +54B6 8C46
43.2287 +54B7 982D
43.2288 +54B8 5C6F
43.2289 +54B9 81C0
43.2290 +54BA 9041
43.2291 +54BB 906F
43.2292 +54BC 920D
43.2293 +54BD 5F97
43.2294 +54BE 6A59
43.2295 +54BF 6ED5
43.2296 +54C0 706F
43.2297 +54C1 71C8
43.2298 +54C2 767B
43.2299 +54C3 7B49
43.2300 +54C4 85E4
43.2301 +54C5 8B04
43.2302 +54C6 9127
43.2303 +54C7 9419
43.2304 +54C8 9A30
43.2305 +54C9 5587
43.2306 +54CA 61F6
43.2307 +54CB 7669
43.2308 +54CC 7F85
43.2309 +54CD 863F
43.2310 +54CE 87BA
43.2311 +54CF 88F8
43.2312 +54D0 908F
43.2313 +54D1 F95C
43.2314 +54D2 6D1B
43.2315 +54D3 70D9
43.2316 +54D4 7296
43.2317 +54D5 73DE
43.2318 +54D6 7D61
43.2319 +54D7 843D
43.2320 +54D8 916A
43.2321 +54D9 99F1
43.2322 +54DA 4E82
43.2323 +54DB 5375
43.2324 +54DC 5E71
43.2325 +54DD 6B04
43.2326 +54DE 6B12
43.2327 +54DF 703E
43.2328 +54E0 721B
43.2329 +54E1 862D
43.2330 +54E2 9E1E
43.2331 +54E3 524C
43.2332 +54E4 57D3
43.2333 +54E5 8FA3
43.2334 +54E6 5D50
43.2335 +54E7 64E5
43.2336 +54E8 652C
43.2337 +54E9 6B16
43.2338 +54EA 6FEB
43.2339 +54EB 7C43
43.2340 +54EC 7E9C
43.2341 +54ED 85CD
43.2342 +54EE 8964
43.2343 +54EF 89BD
43.2344 +54F0 62C9
43.2345 +54F1 81D8
43.2346 +54F2 881F
43.2347 +54F3 5ECA
43.2348 +54F4 6717
43.2349 +54F5 6994
43.2350 +54F6 6D6A
43.2351 +54F7 72FC
43.2352 +54F8 7405
43.2353 +54F9 746F
43.2354 +54FA 8782
43.2355 +54FB 90DE
43.2356 +54FC 4F86
43.2357 +54FD 840A
43.2358 +54FE 51B7
43.2359 +5541 63A0
43.2360 +5542 7565
43.2361 +5543 4EAE
43.2362 +5544 5169
43.2363 +5545 5006
43.2364 +5546 51C9
43.2365 +5547 6881
43.2366 +5548 6DBC
43.2367 +5549 6A11
43.2368 +554A 7CAE
43.2369 +554B 7CB1
43.2370 +554C 7CE7
43.2371 +554D 826F
43.2372 +554E 8AD2
43.2373 +554F 8F1B
43.2374 +5550 91CF
43.2375 +5551 9B4E
43.2376 +5552 4FB6
43.2377 +5553 52F5
43.2378 +5554 5442
43.2379 +5555 5EEC
43.2380 +5556 623E
43.2381 +5557 65C5
43.2382 +5558 6ADA
43.2383 +5559 6FFE
43.2384 +555A 7658
43.2385 +555B 792A
43.2386 +555C 8182
43.2387 +555D 85DC
43.2388 +555E 616E
43.2389 +555F 8823
43.2390 +5560 8821
43.2391 +5561 9462
43.2392 +5562 95AD
43.2393 +5563 9A62
43.2394 +5564 9A6A
43.2395 +5565 9E97
43.2396 +5566 9ECE
43.2397 +5567 529B
43.2398 +5568 6B77
43.2399 +5569 66C6
43.2400 +556A 6ADF
43.2401 +556B 701D
43.2402 +556C 792B
43.2403 +556D 8F62
43.2404 +556E 9742
43.2405 +556F 6190
43.2406 +5570 6200
43.2407 +5571 6523
43.2408 +5572 6F23
43.2409 +5573 7149
43.2410 +5574 7DF4
43.2411 +5575 806F
43.2412 +5576 84EE
43.2413 +5577 8F26
43.2414 +5578 9023
43.2415 +5579 934A
43.2416 +557A 51BD
43.2417 +557B 52A3
43.2418 +557C 5217
43.2419 +557D 6D0C
43.2420 +557E 70C8
43.2421 +557F 88C2
43.2422 +5580 5EC9
43.2423 +5581 6582
43.2424 +5582 6BAE
43.2425 +5583 6FC2
43.2426 +5584 7C3E
43.2427 +5585 7375
43.2428 +5586 9B23
43.2429 +5587 4EE4
43.2430 +5588 4F36
43.2431 +5589 56F9
43.2432 +558A 5DBA
43.2433 +558B 601C
43.2434 +558C 6624
43.2435 +558D 6CE0
43.2436 +558E 73B2
43.2437 +558F 7F9A
43.2438 +5590 7FCE
43.2439 +5591 82D3
43.2440 +5592 86C9
43.2441 +5593 901E
43.2442 +5594 96F6
43.2443 +5595 9748
43.2444 +5596 9234
43.2445 +5597 9818
43.2446 +5598 9F61
43.2447 +5599 4F8B
43.2448 +559A 79AE
43.2449 +559B 91B4
43.2450 +559C 96B7
43.2451 +559D 52DE
43.2452 +559E 6488
43.2453 +559F 6AD3
43.2454 +55A0 6F66
43.2455 +55A1 7210
43.2456 +55A2 7018
43.2457 +55A3 76E7
43.2458 +55A4 8001
43.2459 +55A5 826B
43.2460 +55A6 8606
43.2461 +55A7 865C
43.2462 +55A8 8DEF
43.2463 +55A9 8F05
43.2464 +55AA 8F64
43.2465 +55AB 9732
43.2466 +55AC 9B6F
43.2467 +55AD 9DFA
43.2468 +55AE 9E75
43.2469 +55AF 6F09
43.2470 +55B0 788C
43.2471 +55B1 F84B
43.2472 +55B2 7DA0
43.2473 +55B3 8F46
43.2474 +55B4 9304
43.2475 +55B5 9E93
43.2476 +55B6 9E7F
43.2477 +55B7 8AD6
43.2478 +55B8 58DF
43.2479 +55B9 5F04
43.2480 +55BA 6727
43.2481 +55BB 7027
43.2482 +55BC 74CF
43.2483 +55BD 7C60
43.2484 +55BE 807E
43.2485 +55BF 5121
43.2486 +55C0 7262
43.2487 +55C1 78CA
43.2488 +55C2 7C5F
43.2489 +55C3 857E
43.2490 +55C4 8A84
43.2491 +55C5 8CF4
43.2492 +55C6 8CC2
43.2493 +55C7 96F7
43.2494 +55C8 4E86
43.2495 +55C9 50DA
43.2496 +55CA F84C
43.2497 +55CB 5BEE
43.2498 +55CC 5ED6
43.2499 +55CD 71CE
43.2500 +55CE 7642
43.2501 +55CF 77AD
43.2502 +55D0 6599
43.2503 +55D1 804A
43.2504 +55D2 84FC
43.2505 +55D3 907C
43.2506 +55D4 9F8D
43.2507 +55D5 50C2
43.2508 +55D6 58D8
43.2509 +55D7 5C62
43.2510 +55D8 6A13
43.2511 +55D9 6DDA
43.2512 +55DA 6F0F
43.2513 +55DB 7D2F
43.2514 +55DC 7E37
43.2515 +55DD 8938
43.2516 +55DE 964B
43.2517 +55DF 9ACF
43.2518 +55E0 5289
43.2519 +55E1 67F3
43.2520 +55E2 69B4
43.2521 +55E3 6D41
43.2522 +55E4 6E9C
43.2523 +55E5 7409
43.2524 +55E6 7460
43.2525 +55E7 7559
43.2526 +55E8 7624
43.2527 +55E9 786B
43.2528 +55EA 8B2C
43.2529 +55EB 985E
43.2530 +55EC 516D
43.2531 +55ED 622E
43.2532 +55EE 9678
43.2533 +55EF 502B
43.2534 +55F0 5D19
43.2535 +55F1 6DEA
43.2536 +55F2 7DB8
43.2537 +55F3 8F2A
43.2538 +55F4 5F8B
43.2539 +55F5 6144
43.2540 +55F6 6817
43.2541 +55F7 F961
43.2542 +55F8 7ABF
43.2543 +55F9 9686
43.2544 +55FA 808B
43.2545 +55FB 52D2
43.2546 +55FC 51DB
43.2547 +55FD 5EE9
43.2548 +55FE 51CC
43.2549 +5641 695E
43.2550 +5642 7A1C
43.2551 +5643 7DBE
43.2552 +5644 83F1
43.2553 +5645 9675
43.2554 +5646 4FDA
43.2555 +5647 5229
43.2556 +5648 5398
43.2557 +5649 540F
43.2558 +564A 5C65
43.2559 +564B 60A7
43.2560 +564C F84D
43.2561 +564D 674E
43.2562 +564E 68A8
43.2563 +564F 6F13
43.2564 +5650 7281
43.2565 +5651 72F8
43.2566 +5652 7406
43.2567 +5653 7483
43.2568 +5654 75E2
43.2569 +5655 79BB
43.2570 +5656 7F79
43.2571 +5657 7C6C
43.2572 +5658 87AD
43.2573 +5659 88CF
43.2574 +565A 91CC
43.2575 +565B 91D0
43.2576 +565C 96E2
43.2577 +565D 9B51
43.2578 +565E 9BC9
43.2579 +565F 541D
43.2580 +5660 71D0
43.2581 +5661 7498
43.2582 +5662 85FA
43.2583 +5663 8EAA
43.2584 +5664 96A3
43.2585 +5665 9C57
43.2586 +5666 9E9F
43.2587 +5667 6797
43.2588 +5668 6DCB
43.2589 +5669 7433
43.2590 +566A 75F3
43.2591 +566B 81E8
43.2592 +566C 9716
43.2593 +566D 5CA6
43.2594 +566E 782C
43.2595 +566F 7ACB
43.2596 +5670 7B20
43.2597 +5671 7C92
43.2598 +5672 5ABD
43.2599 +5673 6469
43.2600 +5674 746A
43.2601 +5675 75F2
43.2602 +5676 78E8
43.2603 +5677 87C7
43.2604 +5678 99AC
43.2605 +5679 9B54
43.2606 +567A 9EBB
43.2607 +567B 5BDE
43.2608 +567C 5E55
43.2609 +567D 6F20
43.2610 +567E 819C
43.2611 +567F 83AB
43.2612 +5680 5A29
43.2613 +5681 5DD2
43.2614 +5682 5F4E
43.2615 +5683 6162
43.2616 +5684 633D
43.2617 +5685 6669
43.2618 +5686 66FC
43.2619 +5687 6EFF
43.2620 +5688 6F2B
43.2621 +5689 7063
43.2622 +568A 779E
43.2623 +568B 842C
43.2624 +568C 8513
43.2625 +568D 883B
43.2626 +568E 8B3E
43.2627 +568F 8F13
43.2628 +5690 93DD
43.2629 +5691 9945
43.2630 +5692 9B18
43.2631 +5693 9C3B
43.2632 +5694 62B9
43.2633 +5695 672B
43.2634 +5696 6CAB
43.2635 +5697 896A
43.2636 +5698 977A
43.2637 +5699 4EA1
43.2638 +569A 5984
43.2639 +569B 5FD8
43.2640 +569C 5FD9
43.2641 +569D 671B
43.2642 +569E 7DB2
43.2643 +569F 7F54
43.2644 +56A0 8292
43.2645 +56A1 832B
43.2646 +56A2 83BD
43.2647 +56A3 9099
43.2648 +56A4 9B4D
43.2649 +56A5 57CB
43.2650 +56A6 59B9
43.2651 +56A7 5A92
43.2652 +56A8 5BD0
43.2653 +56A9 6627
43.2654 +56AA 679A
43.2655 +56AB 6885
43.2656 +56AC 6BCF
43.2657 +56AD 7164
43.2658 +56AE 771B
43.2659 +56AF 7F75
43.2660 +56B0 82FA
43.2661 +56B1 8CB7
43.2662 +56B2 8CE3
43.2663 +56B3 9081
43.2664 +56B4 9B45
43.2665 +56B5 8108
43.2666 +56B6 8109
43.2667 +56B7 8C8A
43.2668 +56B8 964C
43.2669 +56B9 9A40
43.2670 +56BA 9EA5
43.2671 +56BB 5B5F
43.2672 +56BC 6C13
43.2673 +56BD 731B
43.2674 +56BE 76DF
43.2675 +56BF 76F2
43.2676 +56C0 840C
43.2677 +56C1 51AA
43.2678 +56C2 8993
43.2679 +56C3 4FDB
43.2680 +56C4 514D
43.2681 +56C5 52C9
43.2682 +56C6 5195
43.2683 +56C7 68C9
43.2684 +56C8 7704
43.2685 +56C9 7720
43.2686 +56CA 7DBF
43.2687 +56CB 7DEC
43.2688 +56CC 9762
43.2689 +56CD 9EB5
43.2690 +56CE 6EC5
43.2691 +56CF 8511
43.2692 +56D0 547D
43.2693 +56D1 51A5
43.2694 +56D2 540D
43.2695 +56D3 9CF4
43.2696 +56D4 660E
43.2697 +56D5 669D
43.2698 +56D6 6E9F
43.2699 +56D7 76BF
43.2700 +56D8 8317
43.2701 +56D9 879F
43.2702 +56DA 9169
43.2703 +56DB 9298
43.2704 +56DC 8882
43.2705 +56DD 4FAE
43.2706 +56DE 52DF
43.2707 +56DF 5E3D
43.2708 +56E0 59C6
43.2709 +56E1 6155
43.2710 +56E2 6478
43.2711 +56E3 66AE
43.2712 +56E4 5192
43.2713 +56E5 67D0
43.2714 +56E6 6A21
43.2715 +56E7 6BCD
43.2716 +56E8 6BDB
43.2717 +56E9 725F
43.2718 +56EA 7261
43.2719 +56EB 7738
43.2720 +56EC 77DB
43.2721 +56ED 8004
43.2722 +56EE 8017
43.2723 +56EF 8305
43.2724 +56F0 8B00
43.2725 +56F1 8B28
43.2726 +56F2 8C8C
43.2727 +56F3 927E
43.2728 +56F4 6728
43.2729 +56F5 6C90
43.2730 +56F6 7267
43.2731 +56F7 76EE
43.2732 +56F8 7766
43.2733 +56F9 7A46
43.2734 +56FA 6B7F
43.2735 +56FB 6C92
43.2736 +56FC 5922
43.2737 +56FD 6726
43.2738 +56FE 6FDB
43.2739 +5741 77C7
43.2740 +5742 8499
43.2741 +5743 536F
43.2742 +5744 5893
43.2743 +5745 5999
43.2744 +5746 5EDF
43.2745 +5747 63CF
43.2746 +5748 6634
43.2747 +5749 6773
43.2748 +574A 6E3A
43.2749 +574B 732B
43.2750 +574C 82D7
43.2751 +574D 9328
43.2752 +574E 52D9
43.2753 +574F 5DEB
43.2754 +5750 61CB
43.2755 +5751 620A
43.2756 +5752 62C7
43.2757 +5753 64AB
43.2758 +5754 65E0
43.2759 +5755 6B66
43.2760 +5756 6BCB
43.2761 +5757 7121
43.2762 +5758 755D
43.2763 +5759 7E46
43.2764 +575A 821E
43.2765 +575B 8302
43.2766 +575C 856A
43.2767 +575D 8AA3
43.2768 +575E 8CBF
43.2769 +575F 9727
43.2770 +5760 9D61
43.2771 +5761 58A8
43.2772 +5762 9ED8
43.2773 +5763 520E
43.2774 +5764 543B
43.2775 +5765 6587
43.2776 +5766 6C76
43.2777 +5767 7D0B
43.2778 +5768 7D0A
43.2779 +5769 868A
43.2780 +576A 9580
43.2781 +576B 554F
43.2782 +576C 805E
43.2783 +576D 52FF
43.2784 +576E 7269
43.2785 +576F 5473
43.2786 +5770 5A9A
43.2787 +5771 5C3E
43.2788 +5772 5D4B
43.2789 +5773 9761
43.2790 +5774 5F4C
43.2791 +5775 5FAE
43.2792 +5776 672A
43.2793 +5777 6E3C
43.2794 +5778 7030
43.2795 +5779 7709
43.2796 +577A 7C73
43.2797 +577B 7CDC
43.2798 +577C 7F8E
43.2799 +577D 8587
43.2800 +577E 8B0E
43.2801 +577F 8FF7
43.2802 +5780 60B6
43.2803 +5781 610D
43.2804 +5782 61AB
43.2805 +5783 654F
43.2806 +5784 65FC
43.2807 +5785 65FB
43.2808 +5786 6C11
43.2809 +5787 6CEF
43.2810 +5788 739F
43.2811 +5789 73C9
43.2812 +578A 9594
43.2813 +578B 95A9
43.2814 +578C 5BC6
43.2815 +578D 871C
43.2816 +578E 8B10
43.2817 +578F F84E
43.2818 +5790 525D
43.2819 +5791 535A
43.2820 +5792 62CD
43.2821 +5793 640F
43.2822 +5794 64B2
43.2823 +5795 6734
43.2824 +5796 6A38
43.2825 +5797 6B02
43.2826 +5798 6CCA
43.2827 +5799 7254
43.2828 +579A 73C0
43.2829 +579B 749E
43.2830 +579C 7B94
43.2831 +579D 7E1B
43.2832 +579E 7C95
43.2833 +579F 818A
43.2834 +57A0 8236
43.2835 +57A1 8584
43.2836 +57A2 8FEB
43.2837 +57A3 96F9
43.2838 +57A4 99C1
43.2839 +57A5 4F34
43.2840 +57A6 534A
43.2841 +57A7 53CD
43.2842 +57A8 53DB
43.2843 +57A9 62CC
43.2844 +57AA 642C
43.2845 +57AB 6500
43.2846 +57AC 6591
43.2847 +57AD 69C3
43.2848 +57AE 6F58
43.2849 +57AF 6CEE
43.2850 +57B0 73ED
43.2851 +57B1 7554
43.2852 +57B2 76E4
43.2853 +57B3 78FB
43.2854 +57B4 792C
43.2855 +57B5 7D46
43.2856 +57B6 80D6
43.2857 +57B7 87E0
43.2858 +57B8 822C
43.2859 +57B9 8FD4
43.2860 +57BA 9812
43.2861 +57BB 98EF
43.2862 +57BC 52C3
43.2863 +57BD 62D4
43.2864 +57BE 6F51
43.2865 +57BF 64A5
43.2866 +57C0 767C
43.2867 +57C1 8DCB
43.2868 +57C2 91B1
43.2869 +57C3 9262
43.2870 +57C4 9AEE
43.2871 +57C5 9B43
43.2872 +57C6 5023
43.2873 +57C7 508D
43.2874 +57C8 574A
43.2875 +57C9 59A8
43.2876 +57CA 5C28
43.2877 +57CB 5E47
43.2878 +57CC 5F77
43.2879 +57CD 623F
43.2880 +57CE 653E
43.2881 +57CF 65B9
43.2882 +57D0 65C1
43.2883 +57D1 6609
43.2884 +57D2 699C
43.2885 +57D3 7D21
43.2886 +57D4 80AA
43.2887 +57D5 8180
43.2888 +57D6 822B
43.2889 +57D7 82B3
43.2890 +57D8 84A1
43.2891 +57D9 868C
43.2892 +57DA 8A2A
43.2893 +57DB 8B17
43.2894 +57DC 90A6
43.2895 +57DD 9632
43.2896 +57DE 9AE3
43.2897 +57DF 9B74
43.2898 +57E0 9F90
43.2899 +57E1 4FF3
43.2900 +57E2 500D
43.2901 +57E3 F963
43.2902 +57E4 57F9
43.2903 +57E5 5F98
43.2904 +57E6 62DC
43.2905 +57E7 6392
43.2906 +57E8 676F
43.2907 +57E9 6E43
43.2908 +57EA 76C3
43.2909 +57EB 80DA
43.2910 +57EC 80CC
43.2911 +57ED 88F5
43.2912 +57EE 88F4
43.2913 +57EF 8919
43.2914 +57F0 8CE0
43.2915 +57F1 8F29
43.2916 +57F2 914D
43.2917 +57F3 966A
43.2918 +57F4 4F2F
43.2919 +57F5 4F70
43.2920 +57F6 5E1B
43.2921 +57F7 67CF
43.2922 +57F8 6822
43.2923 +57F9 767D
43.2924 +57FA 767E
43.2925 +57FB 9B44
43.2926 +57FC 6A0A
43.2927 +57FD F84F
43.2928 +57FE 7169
43.2929 +5841 756A
43.2930 +5842 F964
43.2931 +5843 7E41
43.2932 +5844 7FFB
43.2933 +5845 8543
43.2934 +5846 85E9
43.2935 +5847 98DC
43.2936 +5848 4F10
43.2937 +5849 7B4F
43.2938 +584A 7F70
43.2939 +584B 95A5
43.2940 +584C 51E1
43.2941 +584D 5E06
43.2942 +584E 68B5
43.2943 +584F 6C3E
43.2944 +5850 6C4E
43.2945 +5851 6CDB
43.2946 +5852 72AF
43.2947 +5853 7BC4
43.2948 +5854 8303
43.2949 +5855 6CD5
43.2950 +5856 743A
43.2951 +5857 50FB
43.2952 +5858 5288
43.2953 +5859 58C1
43.2954 +585A 64D8
43.2955 +585B 74A7
43.2956 +585C 7656
43.2957 +585D 78A7
43.2958 +585E 8F9F
43.2959 +585F 95E2
43.2960 +5860 9739
43.2961 +5861 F965
43.2962 +5862 535E
43.2963 +5863 5F01
43.2964 +5864 6C74
43.2965 +5865 8FAE
43.2966 +5866 8B8A
43.2967 +5867 8FA8
43.2968 +5868 8FAF
43.2969 +5869 F850
43.2970 +586A 908A
43.2971 +586B 99E2
43.2972 +586C 5225
43.2973 +586D 5F46
43.2974 +586E 77A5
43.2975 +586F 9C49
43.2976 +5870 9F08
43.2977 +5871 4E19
43.2978 +5872 5002
43.2979 +5873 5175
43.2980 +5874 5C5B
43.2981 +5875 5E77
43.2982 +5876 661E
43.2983 +5877 663A
43.2984 +5878 67C4
43.2985 +5879 70B3
43.2986 +587A 7501
43.2987 +587B 75C5
43.2988 +587C 7ADD
43.2989 +587D 79C9
43.2990 +587E 8F27
43.2991 +587F 8FF8
43.2992 +5880 9920
43.2993 +5881 4FDD
43.2994 +5882 5821
43.2995 +5883 5831
43.2996 +5884 5BF6
43.2997 +5885 666E
43.2998 +5886 6B65
43.2999 +5887 6E7A
43.3000 +5888 6D11
43.3001 +5889 6F7D
43.3002 +588A 752B
43.3003 +588B 88DC
43.3004 +588C 8913
43.3005 +588D 8B5C
43.3006 +588E 8F14
43.3007 +588F 9D07
43.3008 +5890 9EFC
43.3009 +5891 4F0F
43.3010 +5892 50D5
43.3011 +5893 5310
43.3012 +5894 535C
43.3013 +5895 5B93
43.3014 +5896 5FA9
43.3015 +5897 798F
43.3016 +5898 670D
43.3017 +5899 8179
43.3018 +589A 832F
43.3019 +589B 8514
43.3020 +589C 8986
43.3021 +589D 8760
43.3022 +589E 8907
43.3023 +589F 8F3B
43.3024 +58A0 99A5
43.3025 +58A1 9C12
43.3026 +58A2 672C
43.3027 +58A3 4E76
43.3028 +58A4 4E30
43.3029 +58A5 4FF8
43.3030 +58A6 5949
43.3031 +58A7 5C01
43.3032 +58A8 5CF0
43.3033 +58A9 5CEF
43.3034 +58AA 6367
43.3035 +58AB 742B
43.3036 +58AC 68D2
43.3037 +58AD 70FD
43.3038 +58AE 7E2B
43.3039 +58AF 8451
43.3040 +58B0 84EC
43.3041 +58B1 8702
43.3042 +58B2 9022
43.3043 +58B3 92D2
43.3044 +58B4 9CF3
43.3045 +58B5 4EC6
43.3046 +58B6 4ED8
43.3047 +58B7 5085
43.3048 +58B8 5256
43.3049 +58B9 526F
43.3050 +58BA 5426
43.3051 +58BB 57E0
43.3052 +58BC 592B
43.3053 +58BD 5A66
43.3054 +58BE 5B75
43.3055 +58BF 5BCC
43.3056 +58C0 5E9C
43.3057 +58C1 F966
43.3058 +58C2 6276
43.3059 +58C3 6577
43.3060 +58C4 65A7
43.3061 +58C5 6D6E
43.3062 +58C6 6EA5
43.3063 +58C7 7236
43.3064 +58C8 7C3F
43.3065 +58C9 7F36
43.3066 +58CA 7B26
43.3067 +58CB 7F58
43.3068 +58CC 8151
43.3069 +58CD 8150
43.3070 +58CE 819A
43.3071 +58CF 8299
43.3072 +58D0 82FB
43.3073 +58D1 8709
43.3074 +58D2 8A03
43.3075 +58D3 8CA0
43.3076 +58D4 8CE6
43.3077 +58D5 8CFB
43.3078 +58D6 8D74
43.3079 +58D7 8DBA
43.3080 +58D8 90E8
43.3081 +58D9 91DC
43.3082 +58DA 961C
43.3083 +58DB 9644
43.3084 +58DC 982B
43.3085 +58DD 99D9
43.3086 +58DE 9B92
43.3087 +58DF 9CE7
43.3088 +58E0 5317
43.3089 +58E1 5206
43.3090 +58E2 5674
43.3091 +58E3 F851
43.3092 +58E4 58B3
43.3093 +58E5 5954
43.3094 +58E6 596E
43.3095 +58E7 5FFF
43.3096 +58E8 61A4
43.3097 +58E9 626E
43.3098 +58EA 6C7E
43.3099 +58EB 711A
43.3100 +58EC 76C6
43.3101 +58ED 7C89
43.3102 +58EE 7CDE
43.3103 +58EF 7D1B
43.3104 +58F0 82AC
43.3105 +58F1 8561
43.3106 +58F2 96F0
43.3107 +58F3 F967
43.3108 +58F4 4F5B
43.3109 +58F5 F852
43.3110 +58F6 5F17
43.3111 +58F7 62C2
43.3112 +58F8 9AF4
43.3113 +58F9 9EFB
43.3114 +58FA 5D29
43.3115 +58FB 670B
43.3116 +58FC 68DA
43.3117 +58FD 787C
43.3118 +58FE 7E43
43.3119 +5941 9D6C
43.3120 +5942 4E15
43.3121 +5943 5099
43.3122 +5944 5315
43.3123 +5945 532A
43.3124 +5946 5351
43.3125 +5947 5983
43.3126 +5948 59A3
43.3127 +5949 5A62
43.3128 +594A 5E87
43.3129 +594B 60B2
43.3130 +594C 618A
43.3131 +594D 6249
43.3132 +594E 6279
43.3133 +594F 6590
43.3134 +5950 F853
43.3135 +5951 69A7
43.3136 +5952 6C98
43.3137 +5953 F968
43.3138 +5954 6CB8
43.3139 +5955 6BD4
43.3140 +5956 6BD8
43.3141 +5957 7435
43.3142 +5958 75FA
43.3143 +5959 7765
43.3144 +595A 7812
43.3145 +595B 7891
43.3146 +595C 79D8
43.3147 +595D 7BE6
43.3148 +595E 7DCB
43.3149 +595F 7FE1
43.3150 +5960 80A5
43.3151 +5961 8153
43.3152 +5962 813E
43.3153 +5963 81C2
43.3154 +5964 83F2
43.3155 +5965 871A
43.3156 +5966 88E8
43.3157 +5967 8AB9
43.3158 +5968 8B6C
43.3159 +5969 8CBB
43.3160 +596A 8F61
43.3161 +596B 9119
43.3162 +596C 975E
43.3163 +596D 98DB
43.3164 +596E 9AC0
43.3165 +596F 9F3B
43.3166 +5970 5B2A
43.3167 +5971 8CD3
43.3168 +5972 5F6C
43.3169 +5973 64EF
43.3170 +5974 658C
43.3171 +5975 6AB3
43.3172 +5976 6BAF
43.3173 +5977 6FF1
43.3174 +5978 7015
43.3175 +5979 725D
43.3176 +597A 860B
43.3177 +597B 8CA7
43.3178 +597C F854
43.3179 +597D 983B
43.3180 +597E 9870
43.3181 +597F 9B22
43.3182 +5980 6191
43.3183 +5981 6C37
43.3184 +5982 8058
43.3185 +5983 9A01
43.3186 +5984 4E4D
43.3187 +5985 4E8B
43.3188 +5986 4E9B
43.3189 +5987 4ED5
43.3190 +5988 4F3C
43.3191 +5989 4F3A
43.3192 +598A 820D
43.3193 +598B 4F7F
43.3194 +598C 50FF
43.3195 +598D 53F2
43.3196 +598E 53F8
43.3197 +598F 56DB
43.3198 +5990 5506
43.3199 +5991 55E3
43.3200 +5992 58EB
43.3201 +5993 5962
43.3202 +5994 59D2
43.3203 +5995 5A11
43.3204 +5996 5BEB
43.3205 +5997 5BFA
43.3206 +5998 5DF3
43.3207 +5999 5E2B
43.3208 +599A F855
43.3209 +599B 5F99
43.3210 +599C 601D
43.3211 +599D 6368
43.3212 +599E 8D66
43.3213 +599F 65AF
43.3214 +59A0 659C
43.3215 +59A1 67FB
43.3216 +59A2 68AD
43.3217 +59A3 6942
43.3218 +59A4 69CE
43.3219 +59A5 6C99
43.3220 +59A6 6CD7
43.3221 +59A7 6E23
43.3222 +59A8 7009
43.3223 +59A9 90AA
43.3224 +59AA 7345
43.3225 +59AB 7940
43.3226 +59AC 793E
43.3227 +59AD 7960
43.3228 +59AE 6B7B
43.3229 +59AF 7802
43.3230 +59B0 79C1
43.3231 +59B1 7B25
43.3232 +59B2 7BE9
43.3233 +59B3 84D1
43.3234 +59B4 7D17
43.3235 +59B5 7D72
43.3236 +59B6 838E
43.3237 +59B7 86C7
43.3238 +59B8 88DF
43.3239 +59B9 8A50
43.3240 +59BA 8A5E
43.3241 +59BB 8B1D
43.3242 +59BC 8CDC
43.3243 +59BD 5C04
43.3244 +59BE 8FAD
43.3245 +59BF 8086
43.3246 +59C0 98FC
43.3247 +59C1 99DF
43.3248 +59C2 524A
43.3249 +59C3 F969
43.3250 +59C4 69CA
43.3251 +59C5 6714
43.3252 +59C6 F96A
43.3253 +59C7 9460
43.3254 +59C8 5098
43.3255 +59C9 522A
43.3256 +59CA 5C71
43.3257 +59CB 6563
43.3258 +59CC 6C55
43.3259 +59CD 73CA
43.3260 +59CE 7523
43.3261 +59CF 759D
43.3262 +59D0 7B97
43.3263 +59D1 849C
43.3264 +59D2 9178
43.3265 +59D3 6492
43.3266 +59D4 6BBA
43.3267 +59D5 4E77
43.3268 +59D6 85A9
43.3269 +59D7 4E09
43.3270 +59D8 F96B
43.3271 +59D9 6749
43.3272 +59DA 68EE
43.3273 +59DB 6E17
43.3274 +59DC 886B
43.3275 +59DD 829F
43.3276 +59DE 8518
43.3277 +59DF 6B43
43.3278 +59E0 63F7
43.3279 +59E1 6F81
43.3280 +59E2 98AF
43.3281 +59E3 9364
43.3282 +59E4 970E
43.3283 +59E5 4E0A
43.3284 +59E6 50B7
43.3285 +59E7 50CF
43.3286 +59E8 511F
43.3287 +59E9 5546
43.3288 +59EA 55AA
43.3289 +59EB 5617
43.3290 +59EC 723D
43.3291 +59ED 5B40
43.3292 +59EE 5C19
43.3293 +59EF 5E8A
43.3294 +59F0 5EA0
43.3295 +59F1 5EC2
43.3296 +59F2 5E38
43.3297 +59F3 60F3
43.3298 +59F4 76F8
43.3299 +59F5 6851
43.3300 +59F6 6A61
43.3301 +59F7 6BA4
43.3302 +59F8 6E58
43.3303 +59F9 72C0
43.3304 +59FA 7240
43.3305 +59FB 7965
43.3306 +59FC 7BB1
43.3307 +59FD 7FD4
43.3308 +59FE 88F3
43.3309 +5A41 89F4
43.3310 +5A42 8C61
43.3311 +5A43 8CDE
43.3312 +5A44 8A73
43.3313 +5A45 971C
43.3314 +5A46 585E
43.3315 +5A47 74BD
43.3316 +5A48 8CFD
43.3317 +5A49 9C13
43.3318 +5A4A F96C
43.3319 +5A4B 7A61
43.3320 +5A4C 7D22
43.3321 +5A4D 8272
43.3322 +5A4E 7272
43.3323 +5A4F 751F
43.3324 +5A50 7525
43.3325 +5A51 F96D
43.3326 +5A52 7B19
43.3327 +5A53 566C
43.3328 +5A54 58FB
43.3329 +5A55 5885
43.3330 +5A56 5A7F
43.3331 +5A57 7280
43.3332 +5A58 5DBC
43.3333 +5A59 5E8F
43.3334 +5A5A 5EB6
43.3335 +5A5B 5F90
43.3336 +5A5C 6055
43.3337 +5A5D 6292
43.3338 +5A5E 654D
43.3339 +5A5F 6691
43.3340 +5A60 66D9
43.3341 +5A61 66F8
43.3342 +5A62 6816
43.3343 +5A63 68F2
43.3344 +5A64 745E
43.3345 +5A65 7D6E
43.3346 +5A66 7DD6
43.3347 +5A67 7F72
43.3348 +5A68 80E5
43.3349 +5A69 8212
43.3350 +5A6A 85AF
43.3351 +5A6B 897F
43.3352 +5A6C 8A93
43.3353 +5A6D 92E4
43.3354 +5A6E 901D
43.3355 +5A6F 9ECD
43.3356 +5A70 F856
43.3357 +5A71 9F20
43.3358 +5A72 5915
43.3359 +5A73 596D
43.3360 +5A74 F857
43.3361 +5A75 5E2D
43.3362 +5A76 60DC
43.3363 +5A77 6614
43.3364 +5A78 6673
43.3365 +5A79 6790
43.3366 +5A7A 6C50
43.3367 +5A7B 6DC5
43.3368 +5A7C 6F5F
43.3369 +5A7D 77F3
43.3370 +5A7E 78A9
43.3371 +5A7F 84C6
43.3372 +5A80 91CB
43.3373 +5A81 932B
43.3374 +5A82 5148
43.3375 +5A83 4ED9
43.3376 +5A84 50CA
43.3377 +5A85 F858
43.3378 +5A86 5584
43.3379 +5A87 5BA3
43.3380 +5A88 5C20
43.3381 +5A89 6103
43.3382 +5A8A 6247
43.3383 +5A8B 65CB
43.3384 +5A8C F859
43.3385 +5A8D 717D
43.3386 +5A8E 71F9
43.3387 +5A8F 79AA
43.3388 +5A90 7444
43.3389 +5A91 7487
43.3390 +5A92 74BF
43.3391 +5A93 766C
43.3392 +5A94 7DDA
43.3393 +5A95 7E55
43.3394 +5A96 7FA8
43.3395 +5A97 817A
43.3396 +5A98 81B3
43.3397 +5A99 8239
43.3398 +5A9A 861A
43.3399 +5A9B 87EC
43.3400 +5A9C 8A75
43.3401 +5A9D 8DE3
43.3402 +5A9E 9078
43.3403 +5A9F 9291
43.3404 +5AA0 F85A
43.3405 +5AA1 9BAE
43.3406 +5AA2 5070
43.3407 +5AA3 5368
43.3408 +5AA4 820C
43.3409 +5AA5 F85B
43.3410 +5AA6 5C51
43.3411 +5AA7 6308
43.3412 +5AA8 6954
43.3413 +5AA9 6D29
43.3414 +5AAA 6E2B
43.3415 +5AAB 859B
43.3416 +5AAC 8A2D
43.3417 +5AAD 8AAA
43.3418 +5AAE 96EA
43.3419 +5AAF 6BB2
43.3420 +5AB0 7E96
43.3421 +5AB1 87FE
43.3422 +5AB2 8D0D
43.3423 +5AB3 66B9
43.3424 +5AB4 9583
43.3425 +5AB5 71EE
43.3426 +5AB6 651D
43.3427 +5AB7 6D89
43.3428 +5AB8 F96E
43.3429 +5AB9 57CE
43.3430 +5ABA 59D3
43.3431 +5ABB 6027
43.3432 +5ABC 60FA
43.3433 +5ABD 6210
43.3434 +5ABE 661F
43.3435 +5ABF 665F
43.3436 +5AC0 7329
43.3437 +5AC1 76DB
43.3438 +5AC2 7701
43.3439 +5AC3 7B6C
43.3440 +5AC4 8056
43.3441 +5AC5 8072
43.3442 +5AC6 8165
43.3443 +5AC7 8AA0
43.3444 +5AC8 9192
43.3445 +5AC9 4E16
43.3446 +5ACA 52E2
43.3447 +5ACB 6B72
43.3448 +5ACC 6D17
43.3449 +5ACD 7A05
43.3450 +5ACE 7B39
43.3451 +5ACF 7D30
43.3452 +5AD0 F96F
43.3453 +5AD1 8CB0
43.3454 +5AD2 53EC
43.3455 +5AD3 562F
43.3456 +5AD4 5851
43.3457 +5AD5 5C0F
43.3458 +5AD6 5C11
43.3459 +5AD7 5BB5
43.3460 +5AD8 5DE2
43.3461 +5AD9 6383
43.3462 +5ADA 6414
43.3463 +5ADB 6240
43.3464 +5ADC 662D
43.3465 +5ADD 68B3
43.3466 +5ADE 6CBC
43.3467 +5ADF 6D88
43.3468 +5AE0 6EAF
43.3469 +5AE1 701F
43.3470 +5AE2 70A4
43.3471 +5AE3 71D2
43.3472 +5AE4 7526
43.3473 +5AE5 758E
43.3474 +5AE6 758F
43.3475 +5AE7 7B11
43.3476 +5AE8 7C2B
43.3477 +5AE9 7D20
43.3478 +5AEA 7D39
43.3479 +5AEB 8258
43.3480 +5AEC 852C
43.3481 +5AED 856D
43.3482 +5AEE 8607
43.3483 +5AEF 8A34
43.3484 +5AF0 900D
43.3485 +5AF1 9061
43.3486 +5AF2 90B5
43.3487 +5AF3 92B7
43.3488 +5AF4 9704
43.3489 +5AF5 97F6
43.3490 +5AF6 9A37
43.3491 +5AF7 4FD7
43.3492 +5AF8 5C6C
43.3493 +5AF9 675F
43.3494 +5AFA 7C9F
43.3495 +5AFB 7E8C
43.3496 +5AFC 901F
43.3497 +5AFD 5B6B
43.3498 +5AFE 640D
43.3499 +5B41 905C
43.3500 +5B42 7387
43.3501 +5B43 87C0
43.3502 +5B44 5B8B
43.3503 +5B45 677E
43.3504 +5B46 8A1F
43.3505 +5B47 8AA6
43.3506 +5B48 9001
43.3507 +5B49 980C
43.3508 +5B4A 5237
43.3509 +5B4B F970
43.3510 +5B4C 7051
43.3511 +5B4D 7463
43.3512 +5B4E 788E
43.3513 +5B4F 9396
43.3514 +5B50 8870
43.3515 +5B51 91D7
43.3516 +5B52 4FEE
43.3517 +5B53 53D7
43.3518 +5B54 53DF
43.3519 +5B55 56DA
43.3520 +5B56 55FD
43.3521 +5B57 5782
43.3522 +5B58 58FD
43.3523 +5B59 5AC2
43.3524 +5B5A 5B88
43.3525 +5B5B F85C
43.3526 +5B5C 5CAB
43.3527 +5B5D 5E25
43.3528 +5B5E 620D
43.3529 +5B5F 6101
43.3530 +5B60 624B
43.3531 +5B61 6388
43.3532 +5B62 641C
43.3533 +5B63 6536
43.3534 +5B64 6578
43.3535 +5B65 666C
43.3536 +5B66 6A39
43.3537 +5B67 6B8A
43.3538 +5B68 71E7
43.3539 +5B69 6C34
43.3540 +5B6A 6D19
43.3541 +5B6B 6EB2
43.3542 +5B6C 6F31
43.3543 +5B6D 72E9
43.3544 +5B6E 7378
43.3545 +5B6F 795F
43.3546 +5B70 7626
43.3547 +5B71 7761
43.3548 +5B72 F85D
43.3549 +5B73 79C0
43.3550 +5B74 7A57
43.3551 +5B75 7AEA
43.3552 +5B76 7CB9
43.3553 +5B77 7D8F
43.3554 +5B78 7DAC
43.3555 +5B79 7E61
43.3556 +5B7A 7F9E
43.3557 +5B7B 8129
43.3558 +5B7C 8331
43.3559 +5B7D 8490
43.3560 +5B7E 84DA
43.3561 +5B7F 85EA
43.3562 +5B80 8896
43.3563 +5B81 8AB0
43.3564 +5B82 8F38
43.3565 +5B83 9042
43.3566 +5B84 9083
43.3567 +5B85 916C
43.3568 +5B86 9296
43.3569 +5B87 92B9
43.3570 +5B88 968B
43.3571 +5B89 96A8
43.3572 +5B8A 96D6
43.3573 +5B8B 9700
43.3574 +5B8C 9808
43.3575 +5B8D 9996
43.3576 +5B8E 9AD3
43.3577 +5B8F 9B1A
43.3578 +5B90 53D4
43.3579 +5B91 587E
43.3580 +5B92 5919
43.3581 +5B93 5B70
43.3582 +5B94 5BBF
43.3583 +5B95 6DD1
43.3584 +5B96 719F
43.3585 +5B97 8085
43.3586 +5B98 83FD
43.3587 +5B99 5FAA
43.3588 +5B9A 6042
43.3589 +5B9B 65EC
43.3590 +5B9C 696F
43.3591 +5B9D 6B89
43.3592 +5B9E 6D35
43.3593 +5B9F 6DF3
43.3594 +5BA0 73E3
43.3595 +5BA1 76FE
43.3596 +5BA2 77AC
43.3597 +5BA3 7B4D
43.3598 +5BA4 7D14
43.3599 +5BA5 8123
43.3600 +5BA6 821C
43.3601 +5BA7 8340
43.3602 +5BA8 8A62
43.3603 +5BA9 5DE1
43.3604 +5BAA 9187
43.3605 +5BAB 931E
43.3606 +5BAC 9806
43.3607 +5BAD 99B4
43.3608 +5BAE 9D89
43.3609 +5BAF 620C
43.3610 +5BB0 8853
43.3611 +5BB1 8FF0
43.3612 +5BB2 5D07
43.3613 +5BB3 5D27
43.3614 +5BB4 5D69
43.3615 +5BB5 745F
43.3616 +5BB6 819D
43.3617 +5BB7 8671
43.3618 +5BB8 8768
43.3619 +5BB9 62FE
43.3620 +5BBA 6FD5
43.3621 +5BBB 7FD2
43.3622 +5BBC 8936
43.3623 +5BBD 8972
43.3624 +5BBE 4E1E
43.3625 +5BBF 4E58
43.3626 +5BC0 50E7
43.3627 +5BC1 5347
43.3628 +5BC2 627F
43.3629 +5BC3 6607
43.3630 +5BC4 52DD
43.3631 +5BC5 7E69
43.3632 +5BC6 8805
43.3633 +5BC7 965E
43.3634 +5BC8 4F8D
43.3635 +5BC9 5319
43.3636 +5BCA 557B
43.3637 +5BCB 5636
43.3638 +5BCC 59CB
43.3639 +5BCD 5AA4
43.3640 +5BCE F85E
43.3641 +5BCF 5C38
43.3642 +5BD0 5C4D
43.3643 +5BD1 5E02
43.3644 +5BD2 5F11
43.3645 +5BD3 6043
43.3646 +5BD4 65BD
43.3647 +5BD5 662F
43.3648 +5BD6 6642
43.3649 +5BD7 67BE
43.3650 +5BD8 67F4
43.3651 +5BD9 731C
43.3652 +5BDA 77E2
43.3653 +5BDB 793A
43.3654 +5BDC 8996
43.3655 +5BDD 7DE6
43.3656 +5BDE 7FC5
43.3657 +5BDF 8494
43.3658 +5BE0 84CD
43.3659 +5BE1 8A69
43.3660 +5BE2 8A66
43.3661 +5BE3 8AE1
43.3662 +5BE4 8C7A
43.3663 +5BE5 57F4
43.3664 +5BE6 5BD4
43.3665 +5BE7 5F0F
43.3666 +5BE8 606F
43.3667 +5BE9 62ED
43.3668 +5BEA 690D
43.3669 +5BEB 6B96
43.3670 +5BEC 6E5C
43.3671 +5BED 7184
43.3672 +5BEE 8B58
43.3673 +5BEF 8EFE
43.3674 +5BF0 98DF
43.3675 +5BF1 98FE
43.3676 +5BF2 4F38
43.3677 +5BF3 4FE1
43.3678 +5BF4 547B
43.3679 +5BF5 5A20
43.3680 +5BF6 5BB8
43.3681 +5BF7 613C
43.3682 +5BF8 65B0
43.3683 +5BF9 6668
43.3684 +5BFA 71FC
43.3685 +5BFB 7533
43.3686 +5BFC 77E7
43.3687 +5BFD 795E
43.3688 +5BFE 7D33
43.3689 +5C41 814E
43.3690 +5C42 81E3
43.3691 +5C43 8398
43.3692 +5C44 85AA
43.3693 +5C45 8703
43.3694 +5C46 8A0A
43.3695 +5C47 8EAB
43.3696 +5C48 8F9B
43.3697 +5C49 F971
43.3698 +5C4A 8FC5
43.3699 +5C4B 5931
43.3700 +5C4C 5BA4
43.3701 +5C4D 5BE6
43.3702 +5C4E 6089
43.3703 +5C4F F85F
43.3704 +5C50 5BE9
43.3705 +5C51 5C0B
43.3706 +5C52 5FC3
43.3707 +5C53 F972
43.3708 +5C54 6C81
43.3709 +5C55 6DF1
43.3710 +5C56 700B
43.3711 +5C57 751A
43.3712 +5C58 82AF
43.3713 +5C59 4EC0
43.3714 +5C5A 5341
43.3715 +5C5B F973
43.3716 +5C5C 96D9
43.3717 +5C5D 6C0F
43.3718 +5C5E 4E9E
43.3719 +5C5F 4FC4
43.3720 +5C60 5152
43.3721 +5C61 5A25
43.3722 +5C62 5CE8
43.3723 +5C63 6211
43.3724 +5C64 7259
43.3725 +5C65 82BD
43.3726 +5C66 86FE
43.3727 +5C67 8859
43.3728 +5C68 8A1D
43.3729 +5C69 963F
43.3730 +5C6A 96C5
43.3731 +5C6B 9913
43.3732 +5C6C 9D09
43.3733 +5C6D 9D5D
43.3734 +5C6E 580A
43.3735 +5C6F 5CB3
43.3736 +5C70 5DBD
43.3737 +5C71 6115
43.3738 +5C72 60E1
43.3739 +5C73 63E1
43.3740 +5C74 6A02
43.3741 +5C75 6E25
43.3742 +5C76 843C
43.3743 +5C77 984E
43.3744 +5C78 9F77
43.3745 +5C79 5B89
43.3746 +5C7A 5CB8
43.3747 +5C7B 6309
43.3748 +5C7C 664F
43.3749 +5C7D 6848
43.3750 +5C7E 773C
43.3751 +5C7F 96C1
43.3752 +5C80 8D0B
43.3753 +5C81 978D
43.3754 +5C82 9854
43.3755 +5C83 9D08
43.3756 +5C84 621E
43.3757 +5C85 65A1
43.3758 +5C86 8B01
43.3759 +5C87 8ECB
43.3760 +5C88 904F
43.3761 +5C89 95BC
43.3762 +5C8A 5D52
43.3763 +5C8B 5DD6
43.3764 +5C8C 5EB5
43.3765 +5C8D 6697
43.3766 +5C8E 764C
43.3767 +5C8F 83F4
43.3768 +5C90 8AF3
43.3769 +5C91 95C7
43.3770 +5C92 9EEF
43.3771 +5C93 58D3
43.3772 +5C94 62BC
43.3773 +5C95 72CE
43.3774 +5C96 9D28
43.3775 +5C97 4EF0
43.3776 +5C98 592E
43.3777 +5C99 600F
43.3778 +5C9A 663B
43.3779 +5C9B 6B83
43.3780 +5C9C 79E7
43.3781 +5C9D 9785
43.3782 +5C9E 9D26
43.3783 +5C9F 5393
43.3784 +5CA0 57C3
43.3785 +5CA1 5D16
43.3786 +5CA2 611B
43.3787 +5CA3 6B38
43.3788 +5CA4 6DAF
43.3789 +5CA5 769A
43.3790 +5CA6 66D6
43.3791 +5CA7 788D
43.3792 +5CA8 7919
43.3793 +5CA9 827E
43.3794 +5CAA 54C0
43.3795 +5CAB 9698
43.3796 +5CAC 9744
43.3797 +5CAD 9749
43.3798 +5CAE 5384
43.3799 +5CAF 6396
43.3800 +5CB0 6DB2
43.3801 +5CB1 814B
43.3802 +5CB2 9628
43.3803 +5CB3 984D
43.3804 +5CB4 6AFB
43.3805 +5CB5 7F4C
43.3806 +5CB6 9DAF
43.3807 +5CB7 9E1A
43.3808 +5CB8 4E5F
43.3809 +5CB9 503B
43.3810 +5CBA 51B6
43.3811 +5CBB 591C
43.3812 +5CBC F860
43.3813 +5CBD 63F6
43.3814 +5CBE 6930
43.3815 +5CBF 723A
43.3816 +5CC0 8036
43.3817 +5CC1 F974
43.3818 +5CC2 60F9
43.3819 +5CC3 91CE
43.3820 +5CC4 5F31
43.3821 +5CC5 7BDB
43.3822 +5CC6 7C65
43.3823 +5CC7 7D04
43.3824 +5CC8 82E5
43.3825 +5CC9 846F
43.3826 +5CCA 85E5
43.3827 +5CCB 8E8D
43.3828 +5CCC 4F6F
43.3829 +5CCD 58E4
43.3830 +5CCE 5B43
43.3831 +5CCF 6059
43.3832 +5CD0 63DA
43.3833 +5CD1 6518
43.3834 +5CD2 656D
43.3835 +5CD3 6698
43.3836 +5CD4 694A
43.3837 +5CD5 6A23
43.3838 +5CD6 6D0B
43.3839 +5CD7 7001
43.3840 +5CD8 716C
43.3841 +5CD9 7A70
43.3842 +5CDA 75D2
43.3843 +5CDB 760D
43.3844 +5CDC 7F8A
43.3845 +5CDD 7F98
43.3846 +5CDE 8944
43.3847 +5CDF 8B93
43.3848 +5CE0 91C0
43.3849 +5CE1 967D
43.3850 +5CE2 990A
43.3851 +5CE3 5704
43.3852 +5CE4 5FA1
43.3853 +5CE5 6554
43.3854 +5CE6 65BC
43.3855 +5CE7 6F01
43.3856 +5CE8 79A6
43.3857 +5CE9 8A9E
43.3858 +5CEA 99AD
43.3859 +5CEB 9B5A
43.3860 +5CEC 9F6C
43.3861 +5CED 5104
43.3862 +5CEE 61B6
43.3863 +5CEF 6291
43.3864 +5CF0 6A8D
43.3865 +5CF1 81C6
43.3866 +5CF2 5043
43.3867 +5CF3 5830
43.3868 +5CF4 5F66
43.3869 +5CF5 7109
43.3870 +5CF6 8A00
43.3871 +5CF7 8AFA
43.3872 +5CF8 5B7C
43.3873 +5CF9 513C
43.3874 +5CFA 56B4
43.3875 +5CFB 5944
43.3876 +5CFC 63A9
43.3877 +5CFD 6DF9
43.3878 +5CFE 5DAA
43.3879 +5D41 696D
43.3880 +5D42 605A
43.3881 +5D43 4E88
43.3882 +5D44 4F59
43.3883 +5D45 5982
43.3884 +5D46 6B5F
43.3885 +5D47 6C5D
43.3886 +5D48 8207
43.3887 +5D49 9918
43.3888 +5D4A 4EA6
43.3889 +5D4B 57DF
43.3890 +5D4C F861
43.3891 +5D4D 5F79
43.3892 +5D4E 6613
43.3893 +5D4F 75AB
43.3894 +5D50 7E79
43.3895 +5D51 8B6F
43.3896 +5D52 9006
43.3897 +5D53 9A5B
43.3898 +5D54 56A5
43.3899 +5D55 5827
43.3900 +5D56 59F8
43.3901 +5D57 5A1F
43.3902 +5D58 5BB4
43.3903 +5D59 5EF6
43.3904 +5D5A 6350
43.3905 +5D5B F991
43.3906 +5D5C 693D
43.3907 +5D5D 6CBF
43.3908 +5D5E 6D93
43.3909 +5D5F 6D8E
43.3910 +5D60 6DF5
43.3911 +5D61 6F14
43.3912 +5D62 70DF
43.3913 +5D63 7136
43.3914 +5D64 7159
43.3915 +5D65 71C3
43.3916 +5D66 71D5
43.3917 +5D67 784F
43.3918 +5D68 786F
43.3919 +5D69 7B75
43.3920 +5D6A 7DE3
43.3921 +5D6B F862
43.3922 +5D6C 81D9
43.3923 +5D6D 8815
43.3924 +5D6E 884D
43.3925 +5D6F 8B8C
43.3926 +5D70 8EDF
43.3927 +5D71 925B
43.3928 +5D72 9CF6
43.3929 +5D73 F99E
43.3930 +5D74 6085
43.3931 +5D75 6D85
43.3932 +5D76 71B1
43.3933 +5D77 F9A1
43.3934 +5D78 95B1
43.3935 +5D79 53AD
43.3936 +5D7A 5869
43.3937 +5D7B 67D3
43.3938 +5D7C 708E
43.3939 +5D7D 7130
43.3940 +5D7E 9E7D
43.3941 +5D7F 82D2
43.3942 +5D80 8276
43.3943 +5D81 95BB
43.3944 +5D82 995C
43.3945 +5D83 9AE5
43.3946 +5D84 66C4
43.3947 +5D85 71C1
43.3948 +5D86 8449
43.3949 +5D87 584B
43.3950 +5D88 5B30
43.3951 +5D89 5F71
43.3952 +5D8A 6620
43.3953 +5D8B 668E
43.3954 +5D8C 6979
43.3955 +5D8D 69AE
43.3956 +5D8E 6C38
43.3957 +5D8F 6CF3
43.3958 +5D90 6F41
43.3959 +5D91 701B
43.3960 +5D92 71DF
43.3961 +5D93 745B
43.3962 +5D94 F9AE
43.3963 +5D95 74D4
43.3964 +5D96 76C8
43.3965 +5D97 7E93
43.3966 +5D98 82F1
43.3967 +5D99 8A60
43.3968 +5D9A 8FCE
43.3969 +5D9B 502A
43.3970 +5D9C 5208
43.3971 +5D9D 53E1
43.3972 +5D9E 66F3
43.3973 +5D9F 6FCA
43.3974 +5DA0 730A
43.3975 +5DA1 7768
43.3976 +5DA2 777F
43.3977 +5DA3 7FF3
43.3978 +5DA4 82AE
43.3979 +5DA5 854B
43.3980 +5DA6 85DD
43.3981 +5DA7 8602
43.3982 +5DA8 88D4
43.3983 +5DA9 8A63
43.3984 +5DAA 8B7D
43.3985 +5DAB 8C6B
43.3986 +5DAC 92B3
43.3987 +5DAD 9713
43.3988 +5DAE 9810
43.3989 +5DAF 4E94
43.3990 +5DB0 4F0D
43.3991 +5DB1 50B2
43.3992 +5DB2 5348
43.3993 +5DB3 5433
43.3994 +5DB4 55DA
43.3995 +5DB5 58BA
43.3996 +5DB6 5967
43.3997 +5DB7 5A1B
43.3998 +5DB8 5BE4
43.3999 +5DB9 609F
43.4000 +5DBA F9B9
43.4001 +5DBB 65FF
43.4002 +5DBC 6664
43.4003 +5DBD 68A7
43.4004 +5DBE 6C5A
43.4005 +5DBF 70CF
43.4006 +5DC0 7352
43.4007 +5DC1 8708
43.4008 +5DC2 8AA4
43.4009 +5DC3 9068
43.4010 +5DC4 543E
43.4011 +5DC5 5C4B
43.4012 +5DC6 6C83
43.4013 +5DC7 7344
43.4014 +5DC8 7389
43.4015 +5DC9 923A
43.4016 +5DCA 5ABC
43.4017 +5DCB 6EAB
43.4018 +5DCC 7465
43.4019 +5DCD 761F
43.4020 +5DCE 7A69
43.4021 +5DCF 8580
43.4022 +5DD0 860A
43.4023 +5DD1 9C2E
43.4024 +5DD2 5140
43.4025 +5DD3 58C5
43.4026 +5DD4 74EE
43.4027 +5DD5 7670
43.4028 +5DD6 64C1
43.4029 +5DD7 7515
43.4030 +5DD8 7FC1
43.4031 +5DD9 9095
43.4032 +5DDA 96CD
43.4033 +5DDB 6E26
43.4034 +5DDC 74E6
43.4035 +5DDD 7AA9
43.4036 +5DDE 86D9
43.4037 +5DDF 8778
43.4038 +5DE0 8A1B
43.4039 +5DE1 81E5
43.4040 +5DE2 5A49
43.4041 +5DE3 5B8C
43.4042 +5DE4 5B9B
43.4043 +5DE5 6D63
43.4044 +5DE6 73A9
43.4045 +5DE7 742C
43.4046 +5DE8 7897
43.4047 +5DE9 7DE9
43.4048 +5DEA 7FEB
43.4049 +5DEB 8155
43.4050 +5DEC 839E
43.4051 +5DED 8C4C
43.4052 +5DEE 962E
43.4053 +5DEF 9811
43.4054 +5DF0 66F0
43.4055 +5DF1 5F80
43.4056 +5DF2 65FA
43.4057 +5DF3 6789
43.4058 +5DF4 6C6A
43.4059 +5DF5 738B
43.4060 +5DF6 502D
43.4061 +5DF7 6B6A
43.4062 +5DF8 77EE
43.4063 +5DF9 5916
43.4064 +5DFA 5DCD
43.4065 +5DFB 7325
43.4066 +5DFC 754F
43.4067 +5DFD 50E5
43.4068 +5DFE 51F9
43.4069 +5E41 582F
43.4070 +5E42 592D
43.4071 +5E43 5996
43.4072 +5E44 59DA
43.4073 +5E45 5DA2
43.4074 +5E46 62D7
43.4075 +5E47 6416
43.4076 +5E48 64FE
43.4077 +5E49 66DC
43.4078 +5E4A 8170
43.4079 +5E4B F9BF
43.4080 +5E4C 6A48
43.4081 +5E4D 7464
43.4082 +5E4E 7A88
43.4083 +5E4F 7AAF
43.4084 +5E50 7E47
43.4085 +5E51 7E5E
43.4086 +5E52 8000
43.4087 +5E53 8558
43.4088 +5E54 87EF
43.4089 +5E55 8981
43.4090 +5E56 8B20
43.4091 +5E57 9059
43.4092 +5E58 9080
43.4093 +5E59 9952
43.4094 +5E5A 8FB1
43.4095 +5E5B 617E
43.4096 +5E5C 6B32
43.4097 +5E5D 6D74
43.4098 +5E5E 8925
43.4099 +5E5F 50AD
43.4100 +5E60 52C7
43.4101 +5E61 5BB9
43.4102 +5E62 5EB8
43.4103 +5E63 5197
43.4104 +5E64 6995
43.4105 +5E65 6E67
43.4106 +5E66 6EB6
43.4107 +5E67 7194
43.4108 +5E68 7462
43.4109 +5E69 7528
43.4110 +5E6A 8073
43.4111 +5E6B 8202
43.4112 +5E6C 8338
43.4113 +5E6D 84C9
43.4114 +5E6E 86F9
43.4115 +5E6F 8E0A
43.4116 +5E70 9394
43.4117 +5E71 93DE
43.4118 +5E72 4F51
43.4119 +5E73 5076
43.4120 +5E74 512A
43.4121 +5E75 53C8
43.4122 +5E76 53CB
43.4123 +5E77 53F3
43.4124 +5E78 5401
43.4125 +5E79 5B87
43.4126 +5E7A 5BD3
43.4127 +5E7B 5C24
43.4128 +5E7C 4E8E
43.4129 +5E7D 611A
43.4130 +5E7E 6182
43.4131 +5E7F 725B
43.4132 +5E80 76C2
43.4133 +5E81 7950
43.4134 +5E82 7991
43.4135 +5E83 79B9
43.4136 +5E84 7FBD
43.4137 +5E85 828B
43.4138 +5E86 865E
43.4139 +5E87 8FC2
43.4140 +5E88 9047
43.4141 +5E89 90F5
43.4142 +5E8A 9685
43.4143 +5E8B 96E8
43.4144 +5E8C 96E9
43.4145 +5E8D 65ED
43.4146 +5E8E 6631
43.4147 +5E8F 715C
43.4148 +5E90 7A36
43.4149 +5E91 90C1
43.4150 +5E92 980A
43.4151 +5E93 4E91
43.4152 +5E94 F9C5
43.4153 +5E95 6B9E
43.4154 +5E96 8018
43.4155 +5E97 82B8
43.4156 +5E98 904B
43.4157 +5E99 9695
43.4158 +5E9A 96F2
43.4159 +5E9B 97FB
43.4160 +5E9C 71A8
43.4161 +5E9D 851A
43.4162 +5E9E 9B31
43.4163 +5E9F 718A
43.4164 +5EA0 96C4
43.4165 +5EA1 5143
43.4166 +5EA2 539F
43.4167 +5EA3 54E1
43.4168 +5EA4 5712
43.4169 +5EA5 5713
43.4170 +5EA6 7230
43.4171 +5EA7 57A3
43.4172 +5EA8 5A9B
43.4173 +5EA9 5BC3
43.4174 +5EAA 6028
43.4175 +5EAB 613F
43.4176 +5EAC 63F4
43.4177 +5EAD 6E90
43.4178 +5EAE 733F
43.4179 +5EAF 7457
43.4180 +5EB0 82D1
43.4181 +5EB1 873F
43.4182 +5EB2 8881
43.4183 +5EB3 8F45
43.4184 +5EB4 9060
43.4185 +5EB5 9662
43.4186 +5EB6 9858
43.4187 +5EB7 9D1B
43.4188 +5EB8 6708
43.4189 +5EB9 8D8A
43.4190 +5EBA 925E
43.4191 +5EBB 4F4D
43.4192 +5EBC 5049
43.4193 +5EBD 50DE
43.4194 +5EBE 5371
43.4195 +5EBF 570D
43.4196 +5EC0 59D4
43.4197 +5EC1 5C09
43.4198 +5EC2 5E43
43.4199 +5EC3 6170
43.4200 +5EC4 5A01
43.4201 +5EC5 6E2D
43.4202 +5EC6 7232
43.4203 +5EC7 744B
43.4204 +5EC8 7DEF
43.4205 +5EC9 80C3
43.4206 +5ECA 840E
43.4207 +5ECB 8466
43.4208 +5ECC 875F
43.4209 +5ECD 885B
43.4210 +5ECE 885E
43.4211 +5ECF 8B02
43.4212 +5ED0 9055
43.4213 +5ED1 97CB
43.4214 +5ED2 9B4F
43.4215 +5ED3 4E73
43.4216 +5ED4 6538
43.4217 +5ED5 4F91
43.4218 +5ED6 5112
43.4219 +5ED7 516A
43.4220 +5ED8 5E7C
43.4221 +5ED9 552F
43.4222 +5EDA 55A9
43.4223 +5EDB 56FF
43.4224 +5EDC 5B7A
43.4225 +5EDD 5BA5
43.4226 +5EDE 5E37
43.4227 +5EDF 5E7D
43.4228 +5EE0 5EBE
43.4229 +5EE1 60A0
43.4230 +5EE2 60DF
43.4231 +5EE3 6109
43.4232 +5EE4 6108
43.4233 +5EE5 63C4
43.4234 +5EE6 6709
43.4235 +5EE7 67D4
43.4236 +5EE8 67DA
43.4237 +5EE9 6961
43.4238 +5EEA 6CB9
43.4239 +5EEB 6E38
43.4240 +5EEC 6FE1
43.4241 +5EED 7336
43.4242 +5EEE 745C
43.4243 +5EEF 7531
43.4244 +5EF0 7652
43.4245 +5EF1 7DAD
43.4246 +5EF2 81FE
43.4247 +5EF3 8438
43.4248 +5EF4 8564
43.4249 +5EF5 88D5
43.4250 +5EF6 8A98
43.4251 +5EF7 8ADB
43.4252 +5EF8 8AED
43.4253 +5EF9 8E42
43.4254 +5EFA 8E30
43.4255 +5EFB 904A
43.4256 +5EFC 903E
43.4257 +5EFD 907A
43.4258 +5EFE 9149
43.4259 +5F41 91C9
43.4260 +5F42 936E
43.4261 +5F43 9EDD
43.4262 +5F44 6BD3
43.4263 +5F45 8089
43.4264 +5F46 80B2
43.4265 +5F47 9B3B
43.4266 +5F48 5141
43.4267 +5F49 596B
43.4268 +5F4A 5C39
43.4269 +5F4B 6F64
43.4270 +5F4C 73A7
43.4271 +5F4D 80E4
43.4272 +5F4E 958F
43.4273 +5F4F 807F
43.4274 +5F50 620E
43.4275 +5F51 7D68
43.4276 +5F52 878D
43.4277 +5F53 57A0
43.4278 +5F54 6069
43.4279 +5F55 6147
43.4280 +5F56 6ABC
43.4281 +5F57 6BB7
43.4282 +5F58 73E2
43.4283 +5F59 9280
43.4284 +5F5A 8ABE
43.4285 +5F5B 96B1
43.4286 +5F5C 9F66
43.4287 +5F5D 4E59
43.4288 +5F5E 541F
43.4289 +5F5F 6DEB
43.4290 +5F60 852D
43.4291 +5F61 9670
43.4292 +5F62 98EE
43.4293 +5F63 97F3
43.4294 +5F64 6339
43.4295 +5F65 63D6
43.4296 +5F66 6CE3
43.4297 +5F67 9091
43.4298 +5F68 51DD
43.4299 +5F69 61C9
43.4300 +5F6A 81BA
43.4301 +5F6B 9DF9
43.4302 +5F6C 4F9D
43.4303 +5F6D 501A
43.4304 +5F6E 5100
43.4305 +5F6F 7591
43.4306 +5F70 77E3
43.4307 +5F71 5B9C
43.4308 +5F72 610F
43.4309 +5F73 61FF
43.4310 +5F74 64EC
43.4311 +5F75 6BC5
43.4312 +5F76 7FA9
43.4313 +5F77 8264
43.4314 +5F78 87FB
43.4315 +5F79 8863
43.4316 +5F7A 8ABC
43.4317 +5F7B 8B70
43.4318 +5F7C 91AB
43.4319 +5F7D 4E8C
43.4320 +5F7E 4EE5
43.4321 +5F7F 4F0A
43.4322 +5F80 5937
43.4323 +5F81 59E8
43.4324 +5F82 5DF2
43.4325 +5F83 8CB3
43.4326 +5F84 5F1B
43.4327 +5F85 5F5B
43.4328 +5F86 6021
43.4329 +5F87 F9E0
43.4330 +5F88 682E
43.4331 +5F89 723E
43.4332 +5F8A 73E5
43.4333 +5F8B 7570
43.4334 +5F8C 75CD
43.4335 +5F8D 79FB
43.4336 +5F8E 800C
43.4337 +5F8F 8033
43.4338 +5F90 8351
43.4339 +5F91 98F4
43.4340 +5F92 990C
43.4341 +5F93 9823
43.4342 +5F94 7037
43.4343 +5F95 7FFC
43.4344 +5F96 76CA
43.4345 +5F97 7FCA
43.4346 +5F98 7FCC
43.4347 +5F99 4EBA
43.4348 +5F9A 4EC1
43.4349 +5F9B 4EDE
43.4350 +5F9C 5203
43.4351 +5F9D 5370
43.4352 +5F9E 54BD
43.4353 +5F9F 56E0
43.4354 +5FA0 59FB
43.4355 +5FA1 5BC5
43.4356 +5FA2 5F15
43.4357 +5FA3 5FCD
43.4358 +5FA4 6E6E
43.4359 +5FA5 8A8D
43.4360 +5FA6 976D
43.4361 +5FA7 9777
43.4362 +5FA8 4E00
43.4363 +5FA9 4F7E
43.4364 +5FAA 58F9
43.4365 +5FAB 65E5
43.4366 +5FAC 6EA2
43.4367 +5FAD 9038
43.4368 +5FAE 93B0
43.4369 +5FAF 99B9
43.4370 +5FB0 4EFB
43.4371 +5FB1 58EC
43.4372 +5FB2 598A
43.4373 +5FB3 59D9
43.4374 +5FB4 7A14
43.4375 +5FB5 834F
43.4376 +5FB6 8CC3
43.4377 +5FB7 5165
43.4378 +5FB8 4ECD
43.4379 +5FB9 5B55
43.4380 +5FBA 5269
43.4381 +5FBB 4ED4
43.4382 +5FBC 523A
43.4383 +5FBD 54A8
43.4384 +5FBE 59C9
43.4385 +5FBF 59FF
43.4386 +5FC0 5B50
43.4387 +5FC1 5B5C
43.4388 +5FC2 5B57
43.4389 +5FC3 6063
43.4390 +5FC4 6148
43.4391 +5FC5 6ECB
43.4392 +5FC6 7099
43.4393 +5FC7 716E
43.4394 +5FC8 7386
43.4395 +5FC9 74F7
43.4396 +5FCA 75B5
43.4397 +5FCB 7725
43.4398 +5FCC 78C1
43.4399 +5FCD 7CA2
43.4400 +5FCE 7D2B
43.4401 +5FCF 8005
43.4402 +5FD0 8014
43.4403 +5FD1 81EA
43.4404 +5FD2 8517
43.4405 +5FD3 85C9
43.4406 +5FD4 89DC
43.4407 +5FD5 8AEE
43.4408 +5FD6 8CC7
43.4409 +5FD7 8D6D
43.4410 +5FD8 96CC
43.4411 +5FD9 4F5C
43.4412 +5FDA 52FA
43.4413 +5FDB 56BC
43.4414 +5FDC 65AB
43.4415 +5FDD 6628
43.4416 +5FDE 67DE
43.4417 +5FDF 707C
43.4418 +5FE0 70B8
43.4419 +5FE1 7235
43.4420 +5FE2 7DBD
43.4421 +5FE3 828D
43.4422 +5FE4 914C
43.4423 +5FE5 96C0
43.4424 +5FE6 9D72
43.4425 +5FE7 68E7
43.4426 +5FE8 6B98
43.4427 +5FE9 6F7A
43.4428 +5FEA 76DE
43.4429 +5FEB 5C91
43.4430 +5FEC 66AB
43.4431 +5FED 6F5B
43.4432 +5FEE 6F5C
43.4433 +5FEF 7BB4
43.4434 +5FF0 7C2A
43.4435 +5FF1 8695
43.4436 +5FF2 8836
43.4437 +5FF3 96DC
43.4438 +5FF4 4E08
43.4439 +5FF5 4ED7
43.4440 +5FF6 5320
43.4441 +5FF7 5834
43.4442 +5FF8 58BB
43.4443 +5FF9 596C
43.4444 +5FFA 5D82
43.4445 +5FFB 5E33
43.4446 +5FFC 5E84
43.4447 +5FFD 5F35
43.4448 +5FFE 638C
43.4449 +6041 66B2
43.4450 +6042 6756
43.4451 +6043 6A1F
43.4452 +6044 6AA3
43.4453 +6045 6B0C
43.4454 +6046 6F3F
43.4455 +6047 58EF
43.4456 +6048 5C07
43.4457 +6049 7246
43.4458 +604A F9FA
43.4459 +604B 7350
43.4460 +604C 748B
43.4461 +604D 7634
43.4462 +604E 7AE0
43.4463 +604F 7CA7
43.4464 +6050 8178
43.4465 +6051 81DF
43.4466 +6052 838A
43.4467 +6053 846C
43.4468 +6054 8523
43.4469 +6055 8594
43.4470 +6056 85CF
43.4471 +6057 88C5
43.4472 +6058 88DD
43.4473 +6059 8D13
43.4474 +605A 91AC
43.4475 +605B 9577
43.4476 +605C 969C
43.4477 +605D 518D
43.4478 +605E 54C9
43.4479 +605F 5728
43.4480 +6060 5BB0
43.4481 +6061 624D
43.4482 +6062 6750
43.4483 +6063 683D
43.4484 +6064 6893
43.4485 +6065 6ED3
43.4486 +6066 707D
43.4487 +6067 7E94
43.4488 +6068 88C1
43.4489 +6069 8CA1
43.4490 +606A 8F09
43.4491 +606B 9F4B
43.4492 +606C 9F4E
43.4493 +606D 722D
43.4494 +606E 7B8F
43.4495 +606F 8ACD
43.4496 +6070 931A
43.4497 +6071 4F4E
43.4498 +6072 4F47
43.4499 +6073 5132
43.4500 +6074 5480
43.4501 +6075 59D0
43.4502 +6076 5E95
43.4503 +6077 62B5
43.4504 +6078 6775
43.4505 +6079 67E2
43.4506 +607A 696E
43.4507 +607B 6A17
43.4508 +607C 6CAE
43.4509 +607D 6E1A
43.4510 +607E 72D9
43.4511 +607F 732A
43.4512 +6080 75BD
43.4513 +6081 7BB8
43.4514 +6082 82E7
43.4515 +6083 8457
43.4516 +6084 85F7
43.4517 +6085 86C6
43.4518 +6086 8A5B
43.4519 +6087 8C6C
43.4520 +6088 8CAF
43.4521 +6089 8E87
43.4522 +608A 9019
43.4523 +608B 90B8
43.4524 +608C 52E3
43.4525 +608D 5AE1
43.4526 +608E 5BC2
43.4527 +608F 6458
43.4528 +6090 6575
43.4529 +6091 6EF4
43.4530 +6092 72C4
43.4531 +6093 7684
43.4532 +6094 7A4D
43.4533 +6095 7B1B
43.4534 +6096 7C4D
43.4535 +6097 7CF4
43.4536 +6098 7E3E
43.4537 +6099 837B
43.4538 +609A 8B2B
43.4539 +609B 8CCA
43.4540 +609C 8D64
43.4541 +609D 8DE1
43.4542 +609E 8E5F
43.4543 +609F 8FEA
43.4544 +60A0 8FF9
43.4545 +60A1 9069
43.4546 +60A2 50B3
43.4547 +60A3 5168
43.4548 +60A4 5178
43.4549 +60A5 524D
43.4550 +60A6 526A
43.4551 +60A7 56C0
43.4552 +60A8 5861
43.4553 +60A9 5960
43.4554 +60AA 5C08
43.4555 +60AB 5C55
43.4556 +60AC 5DD3
43.4557 +60AD 5EDB
43.4558 +60AE 609B
43.4559 +60AF 6230
43.4560 +60B0 6813
43.4561 +60B1 6BBF
43.4562 +60B2 6C08
43.4563 +60B3 6FB1
43.4564 +60B4 714E
43.4565 +60B5 7530
43.4566 +60B6 7538
43.4567 +60B7 7672
43.4568 +60B8 78DA
43.4569 +60B9 7B8B
43.4570 +60BA 7BAD
43.4571 +60BB 7BC6
43.4572 +60BC 7E8F
43.4573 +60BD 7FE6
43.4574 +60BE 8A6E
43.4575 +60BF 8F3E
43.4576 +60C0 8F49
43.4577 +60C1 923F
43.4578 +60C2 9293
43.4579 +60C3 9322
43.4580 +60C4 96FB
43.4581 +60C5 985A
43.4582 +60C6 986B
43.4583 +60C7 991E
43.4584 +60C8 5207
43.4585 +60C9 622A
43.4586 +60CA 6298
43.4587 +60CB 6D59
43.4588 +60CC 7A83
43.4589 +60CD 7ACA
43.4590 +60CE 7BC0
43.4591 +60CF 7D76
43.4592 +60D0 5360
43.4593 +60D1 5CBE
43.4594 +60D2 5E97
43.4595 +60D3 6F38
43.4596 +60D4 70B9
43.4597 +60D5 9EDE
43.4598 +60D6 7C98
43.4599 +60D7 9711
43.4600 +60D8 63A5
43.4601 +60D9 647A
43.4602 +60DA 6904
43.4603 +60DB 8776
43.4604 +60DC 4E01
43.4605 +60DD 4E95
43.4606 +60DE 4EAD
43.4607 +60DF 505C
43.4608 +60E0 5075
43.4609 +60E1 5448
43.4610 +60E2 59C3
43.4611 +60E3 5E40
43.4612 +60E4 5EF7
43.4613 +60E5 5F81
43.4614 +60E6 5B9A
43.4615 +60E7 5EAD
43.4616 +60E8 60C5
43.4617 +60E9 633A
43.4618 +60EA 653F
43.4619 +60EB 6574
43.4620 +60EC 65CC
43.4621 +60ED 6676
43.4622 +60EE 6678
43.4623 +60EF 6883
43.4624 +60F0 6968
43.4625 +60F1 6B63
43.4626 +60F2 6C40
43.4627 +60F3 6DE8
43.4628 +60F4 6E1F
43.4629 +60F5 753A
43.4630 +60F6 775B
43.4631 +60F7 7887
43.4632 +60F8 798E
43.4633 +60F9 7A0B
43.4634 +60FA 7A7D
43.4635 +60FB 9756
43.4636 +60FC 7CBE
43.4637 +60FD 8247
43.4638 +60FE 8A02
43.4639 +6141 8AEA
43.4640 +6142 8C9E
43.4641 +6143 912D
43.4642 +6144 914A
43.4643 +6145 91D8
43.4644 +6146 9266
43.4645 +6147 9320
43.4646 +6148 9706
43.4647 +6149 975C
43.4648 +614A 9802
43.4649 +614B 9F0E
43.4650 +614C 5236
43.4651 +614D 5291
43.4652 +614E 557C
43.4653 +614F 5824
43.4654 +6150 5E1D
43.4655 +6151 5F1F
43.4656 +6152 608C
43.4657 +6153 63D0
43.4658 +6154 6662
43.4659 +6155 68AF
43.4660 +6156 6FDF
43.4661 +6157 7445
43.4662 +6158 81CD
43.4663 +6159 796D
43.4664 +615A 7B2C
43.4665 +615B 85BA
43.4666 +615C 88FD
43.4667 +615D 8AF8
43.4668 +615E 8E36
43.4669 +615F 8E44
43.4670 +6160 918D
43.4671 +6161 9664
43.4672 +6162 969B
43.4673 +6163 973D
43.4674 +6164 984C
43.4675 +6165 9F4A
43.4676 +6166 4FCE
43.4677 +6167 51CB
43.4678 +6168 5146
43.4679 +6169 52A9
43.4680 +616A F863
43.4681 +616B 5632
43.4682 +616C 566A
43.4683 +616D 5F14
43.4684 +616E 5F6B
43.4685 +616F 63AA
43.4686 +6170 64CD
43.4687 +6171 65E9
43.4688 +6172 6641
43.4689 +6173 66FA
43.4690 +6174 66F9
43.4691 +6175 671D
43.4692 +6176 689D
43.4693 +6177 68D7
43.4694 +6178 69FD
43.4695 +6179 6F15
43.4696 +617A 6F6E
43.4697 +617B 7167
43.4698 +617C 71E5
43.4699 +617D 722A
43.4700 +617E 7681
43.4701 +617F 773A
43.4702 +6180 7956
43.4703 +6181 795A
43.4704 +6182 79DF
43.4705 +6183 7A20
43.4706 +6184 7A95
43.4707 +6185 7AC8
43.4708 +6186 7B0A
43.4709 +6187 7C97
43.4710 +6188 7CDF
43.4711 +6189 7CF6
43.4712 +618A 7D44
43.4713 +618B 7D5B
43.4714 +618C 7E70
43.4715 +618D 8087
43.4716 +618E 85FB
43.4717 +618F 86A4
43.4718 +6190 8A54
43.4719 +6191 8ABF
43.4720 +6192 8D99
43.4721 +6193 8E81
43.4722 +6194 9020
43.4723 +6195 906D
43.4724 +6196 91E3
43.4725 +6197 963B
43.4726 +6198 9BDB
43.4727 +6199 9CE5
43.4728 +619A 65CF
43.4729 +619B 7C07
43.4730 +619C 8DB3
43.4731 +619D 93C3
43.4732 +619E 5B58
43.4733 +619F 5C0A
43.4734 +61A0 5352
43.4735 +61A1 62D9
43.4736 +61A2 731D
43.4737 +61A3 5027
43.4738 +61A4 5B97
43.4739 +61A5 5F9E
43.4740 +61A6 616B
43.4741 +61A7 68D5
43.4742 +61A8 6A05
43.4743 +61A9 6DD9
43.4744 +61AA 742E
43.4745 +61AB 7A2E
43.4746 +61AC 7D42
43.4747 +61AD 7D9C
43.4748 +61AE 7E31
43.4749 +61AF 816B
43.4750 +61B0 8E35
43.4751 +61B1 8E64
43.4752 +61B2 937E
43.4753 +61B3 9418
43.4754 +61B4 4F50
43.4755 +61B5 5750
43.4756 +61B6 5DE6
43.4757 +61B7 5EA7
43.4758 +61B8 632B
43.4759 +61B9 7F6A
43.4760 +61BA 4E3B
43.4761 +61BB 4F4F
43.4762 +61BC 4F8F
43.4763 +61BD 505A
43.4764 +61BE 5EDA
43.4765 +61BF 546A
43.4766 +61C0 5468
43.4767 +61C1 55FE
43.4768 +61C2 594F
43.4769 +61C3 5B99
43.4770 +61C4 5DDE
43.4771 +61C5 665D
43.4772 +61C6 6731
43.4773 +61C7 67F1
43.4774 +61C8 682A
43.4775 +61C9 70B7
43.4776 +61CA 6CE8
43.4777 +61CB 6D32
43.4778 +61CC 9152
43.4779 +61CD 73E0
43.4780 +61CE 7587
43.4781 +61CF 851F
43.4782 +61D0 7C4C
43.4783 +61D1 7D02
43.4784 +61D2 7D2C
43.4785 +61D3 7DA2
43.4786 +61D4 8098
43.4787 +61D5 80C4
43.4788 +61D6 821F
43.4789 +61D7 86DB
43.4790 +61D8 8A3B
43.4791 +61D9 8A85
43.4792 +61DA 8D70
43.4793 +61DB 8E8A
43.4794 +61DC 8F33
43.4795 +61DD 914E
43.4796 +61DE 9031
43.4797 +61DF 9444
43.4798 +61E0 99D0
43.4799 +61E1 7AF9
43.4800 +61E2 7CA5
43.4801 +61E3 4FCA
43.4802 +61E4 5101
43.4803 +61E5 51C6
43.4804 +61E6 57C8
43.4805 +61E7 5CFB
43.4806 +61E8 6659
43.4807 +61E9 6A3D
43.4808 +61EA 6D5A
43.4809 +61EB 6E96
43.4810 +61EC 6FEC
43.4811 +61ED 756F
43.4812 +61EE 7AE3
43.4813 +61EF 8822
43.4814 +61F0 9021
43.4815 +61F1 9075
43.4816 +61F2 96BC
43.4817 +61F3 99FF
43.4818 +61F4 8301
43.4819 +61F5 4E2D
43.4820 +61F6 4EF2
43.4821 +61F7 8846
43.4822 +61F8 91CD
43.4823 +61F9 F864
43.4824 +61FA 537D
43.4825 +61FB 6ADB
43.4826 +61FC 696B
43.4827 +61FD 6C41
43.4828 +61FE 847A
43.4829 +6241 589E
43.4830 +6242 618E
43.4831 +6243 62EF
43.4832 +6244 70DD
43.4833 +6245 66FE
43.4834 +6246 7511
43.4835 +6247 75C7
43.4836 +6248 84B8
43.4837 +6249 8A3C
43.4838 +624A 8B49
43.4839 +624B 8D08
43.4840 +624C 4E4B
43.4841 +624D 53EA
43.4842 +624E 54AB
43.4843 +624F 5730
43.4844 +6250 5740
43.4845 +6251 5FD7
43.4846 +6252 6301
43.4847 +6253 6307
43.4848 +6254 646F
43.4849 +6255 652F
43.4850 +6256 65E8
43.4851 +6257 667A
43.4852 +6258 679D
43.4853 +6259 67B3
43.4854 +625A 6B62
43.4855 +625B 6C60
43.4856 +625C 6F2C
43.4857 +625D 75E3
43.4858 +625E 77E5
43.4859 +625F 7825
43.4860 +6260 7957
43.4861 +6261 7949
43.4862 +6262 7D19
43.4863 +6263 80A2
43.4864 +6264 8102
43.4865 +6265 81F3
43.4866 +6266 829D
43.4867 +6267 8718
43.4868 +6268 8A8C
43.4869 +6269 F9FC
43.4870 +626A 8D04
43.4871 +626B 8DBE
43.4872 +626C 9072
43.4873 +626D 76F4
43.4874 +626E 7A19
43.4875 +626F 7A37
43.4876 +6270 7E54
43.4877 +6271 8077
43.4878 +6272 8FB0
43.4879 +6273 55D4
43.4880 +6274 5875
43.4881 +6275 632F
43.4882 +6276 6649
43.4883 +6277 699B
43.4884 +6278 6D25
43.4885 +6279 6EB1
43.4886 +627A 73CD
43.4887 +627B 7468
43.4888 +627C 74A1
43.4889 +627D 75B9
43.4890 +627E 76E1
43.4891 +627F 771E
43.4892 +6280 778B
43.4893 +6281 79E6
43.4894 +6282 7E09
43.4895 +6283 8A3A
43.4896 +6284 8CD1
43.4897 +6285 8EEB
43.4898 +6286 9032
43.4899 +6287 93AD
43.4900 +6288 9663
43.4901 +6289 9673
43.4902 +628A 9707
43.4903 +628B 53F1
43.4904 +628C 7A92
43.4905 +628D 59EA
43.4906 +628E 5AC9
43.4907 +628F 5E19
43.4908 +6290 684E
43.4909 +6291 75BE
43.4910 +6292 79E9
43.4911 +6293 81A3
43.4912 +6294 86ED
43.4913 +6295 8CEA
43.4914 +6296 8DCC
43.4915 +6297 8FED
43.4916 +6298 659F
43.4917 +6299 6715
43.4918 +629A 57F7
43.4919 +629B 96C6
43.4920 +629C 7DDD
43.4921 +629D 8F2F
43.4922 +629E 5FB5
43.4923 +629F 61F2
43.4924 +62A0 6F84
43.4925 +62A1 4E14
43.4926 +62A2 501F
43.4927 +62A3 7B9A
43.4928 +62A4 53C9
43.4929 +62A5 55DF
43.4930 +62A6 5DEE
43.4931 +62A7 5D6F
43.4932 +62A8 6B21
43.4933 +62A9 6B64
43.4934 +62AA 78CB
43.4935 +62AB F9FE
43.4936 +62AC 8E49
43.4937 +62AD 906E
43.4938 +62AE 8ECA
43.4939 +62AF 6349
43.4940 +62B0 643E
43.4941 +62B1 7740
43.4942 +62B2 7A84
43.4943 +62B3 932F
43.4944 +62B4 947F
43.4945 +62B5 9F6A
43.4946 +62B6 64B0
43.4947 +62B7 6FAF
43.4948 +62B8 71E6
43.4949 +62B9 74A8
43.4950 +62BA 74DA
43.4951 +62BB 7AC4
43.4952 +62BC 7E82
43.4953 +62BD 7CB2
43.4954 +62BE 7E98
43.4955 +62BF 8B9A
43.4956 +62C0 8D0A
43.4957 +62C1 947D
43.4958 +62C2 F865
43.4959 +62C3 9910
43.4960 +62C4 994C
43.4961 +62C5 5239
43.4962 +62C6 5BDF
43.4963 +62C7 64E6
43.4964 +62C8 672D
43.4965 +62C9 50ED
43.4966 +62CA 53C3
43.4967 +62CB 5879
43.4968 +62CC 6158
43.4969 +62CD 6159
43.4970 +62CE 615A
43.4971 +62CF 61FA
43.4972 +62D0 65AC
43.4973 +62D1 7AD9
43.4974 +62D2 8B92
43.4975 +62D3 5021
43.4976 +62D4 5009
43.4977 +62D5 5231
43.4978 +62D6 5275
43.4979 +62D7 5531
43.4980 +62D8 5A3C
43.4981 +62D9 5EE0
43.4982 +62DA 5F70
43.4983 +62DB 60B5
43.4984 +62DC 655E
43.4985 +62DD 660C
43.4986 +62DE 6636
43.4987 +62DF 66A2
43.4988 +62E0 69CD
43.4989 +62E1 6C05
43.4990 +62E2 6EC4
43.4991 +62E3 6F32
43.4992 +62E4 7621
43.4993 +62E5 7A93
43.4994 +62E6 8139
43.4995 +62E7 8259
43.4996 +62E8 83D6
43.4997 +62E9 84BC
43.4998 +62EA 50B5
43.4999 +62EB 57F0
43.5000 +62EC 5F69
43.5001 +62ED 63A1
43.5002 +62EE 7826
43.5003 +62EF 7DB5
43.5004 +62F0 83DC
43.5005 +62F1 8521
43.5006 +62F2 91C7
43.5007 +62F3 91F5
43.5008 +62F4 518A
43.5009 +62F5 67F5
43.5010 +62F6 7B56
43.5011 +62F7 7C00
43.5012 +62F8 8CAC
43.5013 +62F9 51C4
43.5014 +62FA 59BB
43.5015 +62FB 60BD
43.5016 +62FC 8655
43.5017 +62FD F9FF
43.5018 +62FE 5254
43.5019 +6341 5C3A
43.5020 +6342 617D
43.5021 +6343 621A
43.5022 +6344 62D3
43.5023 +6345 64F2
43.5024 +6346 65A5
43.5025 +6347 6ECC
43.5026 +6348 7620
43.5027 +6349 810A
43.5028 +634A 8734
43.5029 +634B 8E91
43.5030 +634C 965F
43.5031 +634D 96BB
43.5032 +634E 4EDF
43.5033 +634F 5343
43.5034 +6350 5598
43.5035 +6351 5929
43.5036 +6352 5DDD
43.5037 +6353 64C5
43.5038 +6354 6CC9
43.5039 +6355 6DFA
43.5040 +6356 6FFA
43.5041 +6357 7A7F
43.5042 +6358 821B
43.5043 +6359 85A6
43.5044 +635A 8CE4
43.5045 +635B 8E10
43.5046 +635C 9077
43.5047 +635D 91E7
43.5048 +635E 95E1
43.5049 +635F 9621
43.5050 +6360 97C6
43.5051 +6361 51F8
43.5052 +6362 5FB9
43.5053 +6363 54F2
43.5054 +6364 5586
43.5055 +6365 64A4
43.5056 +6366 6F88
43.5057 +6367 7DB4
43.5058 +6368 8F4D
43.5059 +6369 9435
43.5060 +636A 50C9
43.5061 +636B 5C16
43.5062 +636C 6CBE
43.5063 +636D 6DFB
43.5064 +636E 751B
43.5065 +636F 77BB
43.5066 +6370 7C37
43.5067 +6371 7C64
43.5068 +6372 8AC2
43.5069 +6373 59BE
43.5070 +6374 5E16
43.5071 +6375 6377
43.5072 +6376 7252
43.5073 +6377 758A
43.5074 +6378 776B
43.5075 +6379 8ADC
43.5076 +637A 8CBC
43.5077 +637B 8F12
43.5078 +637C 5EF3
43.5079 +637D 6674
43.5080 +637E 6DF8
43.5081 +637F 807D
43.5082 +6380 83C1
43.5083 +6381 873B
43.5084 +6382 8ACB
43.5085 +6383 9751
43.5086 +6384 9BD6
43.5087 +6385 FA00
43.5088 +6386 5243
43.5089 +6387 66FF
43.5090 +6388 6D95
43.5091 +6389 6EEF
43.5092 +638A 780C
43.5093 +638B 7DE0
43.5094 +638C 8AE6
43.5095 +638D 902E
43.5096 +638E 905E
43.5097 +638F 9746
43.5098 +6390 9AD4
43.5099 +6391 521D
43.5100 +6392 54E8
43.5101 +6393 5CED
43.5102 +6394 6194
43.5103 +6395 6284
43.5104 +6396 62DB
43.5105 +6397 68A2
43.5106 +6398 6912
43.5107 +6399 695A
43.5108 +639A 6A35
43.5109 +639B 7092
43.5110 +639C 7126
43.5111 +639D 785D
43.5112 +639E 7901
43.5113 +639F 790E
43.5114 +63A0 79D2
43.5115 +63A1 7A0D
43.5116 +63A2 7D83
43.5117 +63A3 8096
43.5118 +63A4 8349
43.5119 +63A5 8549
43.5120 +63A6 8C82
43.5121 +63A7 8D85
43.5122 +63A8 9162
43.5123 +63A9 918B
43.5124 +63AA 91AE
43.5125 +63AB 9214
43.5126 +63AC 9798
43.5127 +63AD 4FC3
43.5128 +63AE 56D1
43.5129 +63AF F866
43.5130 +63B0 71ED
43.5131 +63B1 77D7
43.5132 +63B2 8700
43.5133 +63B3 89F8
43.5134 +63B4 8E85
43.5135 +63B5 9AD1
43.5136 +63B6 5BF8
43.5137 +63B7 5FD6
43.5138 +63B8 6751
43.5139 +63B9 53E2
43.5140 +63BA 585A
43.5141 +63BB 5BF5
43.5142 +63BC 6031
43.5143 +63BD 6460
43.5144 +63BE 7E3D
43.5145 +63BF 8070
43.5146 +63C0 8471
43.5147 +63C1 9283
43.5148 +63C2 64AE
43.5149 +63C3 50AC
43.5150 +63C4 5D14
43.5151 +63C5 6467
43.5152 +63C6 6700
43.5153 +63C7 589C
43.5154 +63C8 62BD
43.5155 +63C9 63A8
43.5156 +63CA 690E
43.5157 +63CB 6978
43.5158 +63CC F867
43.5159 +63CD 6A1E
43.5160 +63CE 6E6B
43.5161 +63CF 7503
43.5162 +63D0 76BA
43.5163 +63D1 79CB
43.5164 +63D2 7B92
43.5165 +63D3 82BB
43.5166 +63D4 8429
43.5167 +63D5 8DA8
43.5168 +63D6 8FFD
43.5169 +63D7 9112
43.5170 +63D8 914B
43.5171 +63D9 919C
43.5172 +63DA 9318
43.5173 +63DB 9310
43.5174 +63DC 96DB
43.5175 +63DD 97A6
43.5176 +63DE 9C0D
43.5177 +63DF 9E81
43.5178 +63E0 9EA4
43.5179 +63E1 4E11
43.5180 +63E2 F868
43.5181 +63E3 795D
43.5182 +63E4 755C
43.5183 +63E5 7AFA
43.5184 +63E6 7B51
43.5185 +63E7 7BC9
43.5186 +63E8 7E2E
43.5187 +63E9 8233
43.5188 +63EA 84C4
43.5189 +63EB 8E74
43.5190 +63EC 8EF8
43.5191 +63ED 9010
43.5192 +63EE 6625
43.5193 +63EF 693F
43.5194 +63F0 51FA
43.5195 +63F1 9EDC
43.5196 +63F2 5145
43.5197 +63F3 51B2
43.5198 +63F4 5FE0
43.5199 +63F5 6C96
43.5200 +63F6 87F2
43.5201 +63F7 885D
43.5202 +63F8 8877
43.5203 +63F9 60B4
43.5204 +63FA 81B5
43.5205 +63FB 8403
43.5206 +63FC 53D6
43.5207 +63FD 5439
43.5208 +63FE 5634
43.5209 +6441 5A36
43.5210 +6442 5C31
43.5211 +6443 6A47
43.5212 +6444 708A
43.5213 +6445 7FE0
43.5214 +6446 805A
43.5215 +6447 8106
43.5216 +6448 81ED
43.5217 +6449 F869
43.5218 +644A 8DA3
43.5219 +644B 9189
43.5220 +644C 9A5F
43.5221 +644D 9DF2
43.5222 +644E 4EC4
43.5223 +644F 5074
43.5224 +6450 60FB
43.5225 +6451 6E2C
43.5226 +6452 5C64
43.5227 +6453 4F88
43.5228 +6454 5024
43.5229 +6455 55E4
43.5230 +6456 5CD9
43.5231 +6457 5DF5
43.5232 +6458 5E5F
43.5233 +6459 5FB4
43.5234 +645A 6894
43.5235 +645B 6CBB
43.5236 +645C 6DC4
43.5237 +645D 71BE
43.5238 +645E 75D4
43.5239 +645F 75F4
43.5240 +6460 7661
43.5241 +6461 96C9
43.5242 +6462 7A1A
43.5243 +6463 7DC7
43.5244 +6464 7DFB
43.5245 +6465 7F6E
43.5246 +6466 6065
43.5247 +6467 81F4
43.5248 +6468 8F1C
43.5249 +6469 99B3
43.5250 +646A 9D44
43.5251 +646B 9F52
43.5252 +646C 5247
43.5253 +646D 52C5
43.5254 +646E 98ED
43.5255 +646F 89AA
43.5256 +6470 4E03
43.5257 +6471 67D2
43.5258 +6472 6F06
43.5259 +6473 4FB5
43.5260 +6474 5BE2
43.5261 +6475 5FF1
43.5262 +6476 6795
43.5263 +6477 6C88
43.5264 +6478 6D78
43.5265 +6479 7827
43.5266 +647A 91DD
43.5267 +647B 937C
43.5268 +647C 87C4
43.5269 +647D 79E4
43.5270 +647E 7A31
43.5271 +647F 5FEB
43.5272 +6480 4ED6
43.5273 +6481 553E
43.5274 +6482 58AE
43.5275 +6483 59A5
43.5276 +6484 60F0
43.5277 +6485 6253
43.5278 +6486 6736
43.5279 +6487 6955
43.5280 +6488 8235
43.5281 +6489 9640
43.5282 +648A 99DD
43.5283 +648B 502C
43.5284 +648C 5353
43.5285 +648D 5544
43.5286 +648E FA01
43.5287 +648F 6258
43.5288 +6490 62C6
43.5289 +6491 FA02
43.5290 +6492 64E2
43.5291 +6493 67DD
43.5292 +6494 6A50
43.5293 +6495 6FC1
43.5294 +6496 6FEF
43.5295 +6497 7422
43.5296 +6498 8A17
43.5297 +6499 9438
43.5298 +649A 5451
43.5299 +649B 5606
43.5300 +649C 5766
43.5301 +649D 5F48
43.5302 +649E 619A
43.5303 +649F 6B4E
43.5304 +64A0 7058
43.5305 +64A1 70AD
43.5306 +64A2 7DBB
43.5307 +64A3 8A95
43.5308 +64A4 596A
43.5309 +64A5 812B
43.5310 +64A6 63A2
43.5311 +64A7 803D
43.5312 +64A8 8CAA
43.5313 +64A9 5854
43.5314 +64AA 642D
43.5315 +64AB 69BB
43.5316 +64AC 5B95
43.5317 +64AD 5E11
43.5318 +64AE 6E6F
43.5319 +64AF 8569
43.5320 +64B0 514C
43.5321 +64B1 53F0
43.5322 +64B2 592A
43.5323 +64B3 6020
43.5324 +64B4 614B
43.5325 +64B5 6B86
43.5326 +64B6 6C70
43.5327 +64B7 6CF0
43.5328 +64B8 7B1E
43.5329 +64B9 80CE
43.5330 +64BA 82D4
43.5331 +64BB 8DC6
43.5332 +64BC 90B0
43.5333 +64BD 98B1
43.5334 +64BE 99C4
43.5335 +64BF FA04
43.5336 +64C0 64C7
43.5337 +64C1 6FA4
43.5338 +64C2 F86A
43.5339 +64C3 6491
43.5340 +64C4 6504
43.5341 +64C5 514E
43.5342 +64C6 5410
43.5343 +64C7 571F
43.5344 +64C8 8A0E
43.5345 +64C9 615F
43.5346 +64CA 6876
43.5347 +64CB FA05
43.5348 +64CC 75DB
43.5349 +64CD 7B52
43.5350 +64CE 7D71
43.5351 +64CF 901A
43.5352 +64D0 5806
43.5353 +64D1 817F
43.5354 +64D2 892A
43.5355 +64D3 9000
43.5356 +64D4 9839
43.5357 +64D5 5078
43.5358 +64D6 5957
43.5359 +64D7 59AC
43.5360 +64D8 6295
43.5361 +64D9 900F
43.5362 +64DA 9B2A
43.5363 +64DB 615D
43.5364 +64DC 7279
43.5365 +64DD 5A46
43.5366 +64DE 5761
43.5367 +64DF 5DF4
43.5368 +64E0 628A
43.5369 +64E1 64AD
43.5370 +64E2 6777
43.5371 +64E3 6CE2
43.5372 +64E4 6D3E
43.5373 +64E5 722C
43.5374 +64E6 7436
43.5375 +64E7 7834
43.5376 +64E8 7F77
43.5377 +64E9 82AD
43.5378 +64EA 8DDB
43.5379 +64EB 9817
43.5380 +64EC 5742
43.5381 +64ED 5224
43.5382 +64EE 677F
43.5383 +64EF 7248
43.5384 +64F0 8CA9
43.5385 +64F1 8FA6
43.5386 +64F2 74E3
43.5387 +64F3 962A
43.5388 +64F4 516B
43.5389 +64F5 53ED
43.5390 +64F6 634C
43.5391 +64F7 4F69
43.5392 +64F8 5504
43.5393 +64F9 6096
43.5394 +64FA 6C9B
43.5395 +64FB 6D7F
43.5396 +64FC 724C
43.5397 +64FD 72FD
43.5398 +64FE 7A17
43.5399 +6541 8C9D
43.5400 +6542 6557
43.5401 +6543 8987
43.5402 +6544 5F6D
43.5403 +6545 6F8E
43.5404 +6546 70F9
43.5405 +6547 81A8
43.5406 +6548 610E
43.5407 +6549 4FBF
43.5408 +654A 504F
43.5409 +654B 6241
43.5410 +654C 7247
43.5411 +654D 7BC7
43.5412 +654E 7DE8
43.5413 +654F 7FE9
43.5414 +6550 8759
43.5415 +6551 904D
43.5416 +6552 97AD
43.5417 +6553 8CB6
43.5418 +6554 576A
43.5419 +6555 5E73
43.5420 +6556 840D
43.5421 +6557 8A55
43.5422 +6558 5420
43.5423 +6559 5B16
43.5424 +655A 5E63
43.5425 +655B 5EE2
43.5426 +655C 5F0A
43.5427 +655D 6583
43.5428 +655E 80BA
43.5429 +655F 853D
43.5430 +6560 9589
43.5431 +6561 965B
43.5432 +6562 4F48
43.5433 +6563 5305
43.5434 +6564 530D
43.5435 +6565 530F
43.5436 +6566 5486
43.5437 +6567 54FA
43.5438 +6568 5703
43.5439 +6569 5E96
43.5440 +656A 5E03
43.5441 +656B 6016
43.5442 +656C 62B1
43.5443 +656D 629B
43.5444 +656E 6355
43.5445 +656F 6CE1
43.5446 +6570 6D66
43.5447 +6571 70AE
43.5448 +6572 75B1
43.5449 +6573 7832
43.5450 +6574 80DE
43.5451 +6575 812F
43.5452 +6576 8216
43.5453 +6577 8461
43.5454 +6578 84B2
43.5455 +6579 888D
43.5456 +657A 8912
43.5457 +657B 924B
43.5458 +657C 92EA
43.5459 +657D 9784
43.5460 +657E 98FD
43.5461 +657F 9B91
43.5462 +6580 5E45
43.5463 +6581 66B4
43.5464 +6582 7011
43.5465 +6583 7206
43.5466 +6584 4FF5
43.5467 +6585 527D
43.5468 +6586 5F6A
43.5469 +6587 6153
43.5470 +6588 6753
43.5471 +6589 6A19
43.5472 +658A 6F02
43.5473 +658B 74E2
43.5474 +658C 7968
43.5475 +658D 8868
43.5476 +658E 8C79
43.5477 +658F 98C4
43.5478 +6590 F86B
43.5479 +6591 54C1
43.5480 +6592 7A1F
43.5481 +6593 99AE
43.5482 +6594 6953
43.5483 +6595 8AF7
43.5484 +6596 8C4A
43.5485 +6597 98A8
43.5486 +6598 5F7C
43.5487 +6599 62AB
43.5488 +659A 75B2
43.5489 +659B 76AE
43.5490 +659C 84D6
43.5491 +659D 88AB
43.5492 +659E 907F
43.5493 +659F 5339
43.5494 +65A0 5F3C
43.5495 +65A1 5FC5
43.5496 +65A2 6CCC
43.5497 +65A3 7562
43.5498 +65A4 758B
43.5499 +65A5 7B46
43.5500 +65A6 8E55
43.5501 +65A7 4E4F
43.5502 +65A8 903C
43.5503 +65A9 4E0B
43.5504 +65AA 4F55
43.5505 +65AB 590F
43.5506 +65AC 5EC8
43.5507 +65AD 6630
43.5508 +65AE 6CB3
43.5509 +65AF 7455
43.5510 +65B0 8766
43.5511 +65B1 8377
43.5512 +65B2 8CC0
43.5513 +65B3 9050
43.5514 +65B4 971E
43.5515 +65B5 9C15
43.5516 +65B6 58D1
43.5517 +65B7 5B78
43.5518 +65B8 7627
43.5519 +65B9 8650
43.5520 +65BA 8B14
43.5521 +65BB 9DB4
43.5522 +65BC 5BD2
43.5523 +65BD 6068
43.5524 +65BE 608D
43.5525 +65BF 65F1
43.5526 +65C0 6C57
43.5527 +65C1 6F22
43.5528 +65C2 6FA3
43.5529 +65C3 7F55
43.5530 +65C4 7FF0
43.5531 +65C5 F86C
43.5532 +65C6 9592
43.5533 +65C7 9591
43.5534 +65C8 9650
43.5535 +65C9 97D3
43.5536 +65CA 9DF3
43.5537 +65CB 5272
43.5538 +65CC 8F44
43.5539 +65CD 51FD
43.5540 +65CE 542B
43.5541 +65CF 54B8
43.5542 +65D0 5563
43.5543 +65D1 558A
43.5544 +65D2 6ABB
43.5545 +65D3 6DB5
43.5546 +65D4 7DD8
43.5547 +65D5 8266
43.5548 +65D6 9677
43.5549 +65D7 5408
43.5550 +65D8 54C8
43.5551 +65D9 76D2
43.5552 +65DA 86E4
43.5553 +65DB 95A4
43.5554 +65DC 965C
43.5555 +65DD 4EA2
43.5556 +65DE 4F09
43.5557 +65DF 59EE
43.5558 +65E0 5DF7
43.5559 +65E1 6052
43.5560 +65E2 6297
43.5561 +65E3 676D
43.5562 +65E4 6841
43.5563 +65E5 6C86
43.5564 +65E6 6E2F
43.5565 +65E7 7095
43.5566 +65E8 7F38
43.5567 +65E9 809B
43.5568 +65EA 822A
43.5569 +65EB FA09
43.5570 +65EC 9805
43.5571 +65ED 4EA5
43.5572 +65EE 5055
43.5573 +65EF 54B3
43.5574 +65F0 595A
43.5575 +65F1 5793
43.5576 +65F2 5B69
43.5577 +65F3 5BB3
43.5578 +65F4 5EE8
43.5579 +65F5 61C8
43.5580 +65F6 6977
43.5581 +65F7 6D77
43.5582 +65F8 87F9
43.5583 +65F9 89E3
43.5584 +65FA 8A72
43.5585 +65FB 8AE7
43.5586 +65FC 9082
43.5587 +65FD 99ED
43.5588 +65FE 9AB8
43.5589 +6641 52BE
43.5590 +6642 6838
43.5591 +6643 5016
43.5592 +6644 5E78
43.5593 +6645 674F
43.5594 +6646 884C
43.5595 +6647 4EAB
43.5596 +6648 5411
43.5597 +6649 56AE
43.5598 +664A 9115
43.5599 +664B 73E6
43.5600 +664C 97FF
43.5601 +664D 9909
43.5602 +664E 9957
43.5603 +664F 9999
43.5604 +6650 5653
43.5605 +6651 589F
43.5606 +6652 865B
43.5607 +6653 8A31
43.5608 +6654 61B2
43.5609 +6655 8ED2
43.5610 +6656 737B
43.5611 +6657 6B47
43.5612 +6658 96AA
43.5613 +6659 9A57
43.5614 +665A 5955
43.5615 +665B 7200
43.5616 +665C 8D6B
43.5617 +665D 9769
43.5618 +665E 5CF4
43.5619 +665F 5F26
43.5620 +6660 61F8
43.5621 +6661 70AB
43.5622 +6662 73FE
43.5623 +6663 7384
43.5624 +6664 7729
43.5625 +6665 7D43
43.5626 +6666 7D62
43.5627 +6667 7E23
43.5628 +6668 8237
43.5629 +6669 8852
43.5630 +666A FA0A
43.5631 +666B 8CE2
43.5632 +666C 9249
43.5633 +666D 986F
43.5634 +666E 5B51
43.5635 +666F 7A74
43.5636 +6670 8840
43.5637 +6671 9801
43.5638 +6672 5ACC
43.5639 +6673 F86D
43.5640 +6674 4FE0
43.5641 +6675 5354
43.5642 +6676 593E
43.5643 +6677 5CFD
43.5644 +6678 633E
43.5645 +6679 6D79
43.5646 +667A 72F9
43.5647 +667B 7BCB
43.5648 +667C 8107
43.5649 +667D 8105
43.5650 +667E 83A2
43.5651 +667F F86E
43.5652 +6680 92CF
43.5653 +6681 9830
43.5654 +6682 4EA8
43.5655 +6683 5211
43.5656 +6684 578B
43.5657 +6685 5F62
43.5658 +6686 5144
43.5659 +6687 7005
43.5660 +6688 70AF
43.5661 +6689 73E9
43.5662 +668A 834A
43.5663 +668B 87A2
43.5664 +668C 8861
43.5665 +668D 90A2
43.5666 +668E 93A3
43.5667 +668F 99A8
43.5668 +6690 516E
43.5669 +6691 5F57
43.5670 +6692 60E0
43.5671 +6693 6167
43.5672 +6694 8559
43.5673 +6695 91AF
43.5674 +6696 978B
43.5675 +6697 4E4E
43.5676 +6698 4E92
43.5677 +6699 8C6A
43.5678 +669A 547C
43.5679 +669B 58FA
43.5680 +669C 58D5
43.5681 +669D 597D
43.5682 +669E 5F27
43.5683 +669F 660A
43.5684 +66A0 6236
43.5685 +66A1 6BEB
43.5686 +66A2 6D69
43.5687 +66A3 6DCF
43.5688 +66A4 6E56
43.5689 +66A5 6EF8
43.5690 +66A6 6F94
43.5691 +66A7 6FE9
43.5692 +66A8 6FE0
43.5693 +66A9 705D
43.5694 +66AA 72D0
43.5695 +66AB 745A
43.5696 +66AC 74E0
43.5697 +66AD 7693
43.5698 +66AE 769E
43.5699 +66AF 795C
43.5700 +66B0 7CCA
43.5701 +66B1 7E1E
43.5702 +66B2 80E1
43.5703 +66B3 846B
43.5704 +66B4 864E
43.5705 +66B5 865F
43.5706 +66B6 8774
43.5707 +66B7 8B77
43.5708 +66B8 6248
43.5709 +66B9 9190
43.5710 +66BA 93AC
43.5711 +66BB 9800
43.5712 +66BC 9865
43.5713 +66BD 60D1
43.5714 +66BE 6216
43.5715 +66BF 9177
43.5716 +66C0 5A5A
43.5717 +66C1 660F
43.5718 +66C2 6DF7
43.5719 +66C3 6E3E
43.5720 +66C4 743F
43.5721 +66C5 9B42
43.5722 +66C6 5FFD
43.5723 +66C7 60DA
43.5724 +66C8 7B0F
43.5725 +66C9 9DBB
43.5726 +66CA 5F18
43.5727 +66CB 54C4
43.5728 +66CC 6C5E
43.5729 +66CD 6CD3
43.5730 +66CE 6D2A
43.5731 +66CF 9D3B
43.5732 +66D0 7D05
43.5733 +66D1 8679
43.5734 +66D2 8A0C
43.5735 +66D3 5316
43.5736 +66D4 5B05
43.5737 +66D5 6A3A
43.5738 +66D6 706B
43.5739 +66D7 798D
43.5740 +66D8 7575
43.5741 +66D9 79BE
43.5742 +66DA 548C
43.5743 +66DB 82B1
43.5744 +66DC 83EF
43.5745 +66DD 8A71
43.5746 +66DE 9774
43.5747 +66DF 8CA8
43.5748 +66E0 FA0B
43.5749 +66E1 64F4
43.5750 +66E2 652B
43.5751 +66E3 78BA
43.5752 +66E4 78BB
43.5753 +66E5 7A6B
43.5754 +66E6 944A
43.5755 +66E7 4E38
43.5756 +66E8 559A
43.5757 +66E9 571C
43.5758 +66EA 5BA6
43.5759 +66EB 5E7B
43.5760 +66EC 60A3
43.5761 +66ED 61FD
43.5762 +66EE 63DB
43.5763 +66EF 6853
43.5764 +66F0 6B61
43.5765 +66F1 6E19
43.5766 +66F2 7165
43.5767 +66F3 74B0
43.5768 +66F4 7D08
43.5769 +66F5 9084
43.5770 +66F6 9A69
43.5771 +66F7 9C25
43.5772 +66F8 9B1F
43.5773 +66F9 6D3B
43.5774 +66FA 6ED1
43.5775 +66FB 733E
43.5776 +66FC 8C41
43.5777 +66FD 95CA
43.5778 +66FE 51F0
43.5779 +6741 5A93
43.5780 +6742 5FA8
43.5781 +6743 6033
43.5782 +6744 604D
43.5783 +6745 614C
43.5784 +6746 60F6
43.5785 +6747 6643
43.5786 +6748 6CC1
43.5787 +6749 6EC9
43.5788 +674A 714C
43.5789 +674B 7687
43.5790 +674C 7BC1
43.5791 +674D 8352
43.5792 +674E 8757
43.5793 +674F 9051
43.5794 +6750 968D
43.5795 +6751 9EC3
43.5796 +6752 56DE
43.5797 +6753 5EFB
43.5798 +6754 5F8A
43.5799 +6755 6062
43.5800 +6756 6094
43.5801 +6757 61F7
43.5802 +6758 6666
43.5803 +6759 6703
43.5804 +675A 6A9C
43.5805 +675B 6DEE
43.5806 +675C 6FAE
43.5807 +675D 7070
43.5808 +675E 736A
43.5809 +675F 7E6A
43.5810 +6760 81BE
43.5811 +6761 86D4
43.5812 +6762 8AA8
43.5813 +6763 8CC4
43.5814 +6764 5283
43.5815 +6765 7372
43.5816 +6766 6A6B
43.5817 +6767 54EE
43.5818 +6768 5686
43.5819 +6769 56C2
43.5820 +676A 5B5D
43.5821 +676B 6548
43.5822 +676C 66C9
43.5823 +676D 689F
43.5824 +676E 723B
43.5825 +676F 80B4
43.5826 +6770 9175
43.5827 +6771 4FAF
43.5828 +6772 5019
43.5829 +6773 539A
43.5830 +6774 540E
43.5831 +6775 543C
43.5832 +6776 5589
43.5833 +6777 55C5
43.5834 +6778 5F8C
43.5835 +6779 673D
43.5836 +677A 7334
43.5837 +677B 9005
43.5838 +677C 7BCC
43.5839 +677D 52F3
43.5840 +677E 5864
43.5841 +677F 58CE
43.5842 +6780 6688
43.5843 +6781 7104
43.5844 +6782 718F
43.5845 +6783 71FB
43.5846 +6784 85B0
43.5847 +6785 8A13
43.5848 +6786 85A8
43.5849 +6787 55A7
43.5850 +6788 8431
43.5851 +6789 5349
43.5852 +678A 5599
43.5853 +678B 6BC1
43.5854 +678C 5F59
43.5855 +678D 5FBD
43.5856 +678E 63EE
43.5857 +678F 6689
43.5858 +6790 7147
43.5859 +6791 8AF1
43.5860 +6792 8F1D
43.5861 +6793 9EBE
43.5862 +6794 4F11
43.5863 +6795 643A
43.5864 +6796 70CB
43.5865 +6797 7566
43.5866 +6798 8667
43.5867 +6799 6064
43.5868 +679A 8B4E
43.5869 +679B 9DF8
43.5870 +679C 51F6
43.5871 +679D 5308
43.5872 +679E 5147
43.5873 +679F 6D36
43.5874 +67A0 80F8
43.5875 +67A1 9ED1
43.5876 +67A2 5FFB
43.5877 +67A3 6615
43.5878 +67A4 6B23
43.5879 +67A5 75D5
43.5880 +67A6 5403
43.5881 +67A7 5C79
43.5882 +67A8 7D07
43.5883 +67A9 8FC4
43.5884 +67AA 6B20
43.5885 +67AB 6B46
43.5886 +67AC 6B3D
43.5887 +67AD 5438
43.5888 +67AE 6070
43.5889 +67AF 6D3D
43.5890 +67B0 8208
43.5891 +67B1 50D6
43.5892 +67B2 559C
43.5893 +67B3 566B
43.5894 +67B4 59EC
43.5895 +67B5 5B09
43.5896 +67B6 5E0C
43.5897 +67B7 66E6
43.5898 +67B8 6199
43.5899 +67B9 6231
43.5900 +67BA 72A7
43.5901 +67BB 7199
43.5902 +67BC 51DE
43.5903 +67BD 71B9
43.5904 +67BE 79A7
43.5905 +67BF 7A00
43.5906 +67C0 7FB2
43.5907 +67C1 8A70
43.5908 +67C2 9821
43.5909 +6841 67B7
43.5910 +6842 73C2
43.5911 +6843 75C2
43.5912 +6844 6164
43.5913 +6845 4F83
43.5914 +6846 67EC
43.5915 +6847 687F
43.5916 +6848 78F5
43.5917 +6849 874E
43.5918 +684A 6221
43.5919 +684B 77B0
43.5920 +684C 90AF
43.5921 +684D 9452
43.5922 +684E 5808
43.5923 +684F 757A
43.5924 +6850 7D73
43.5925 +6851 7F8C
43.5926 +6852 8221
43.5927 +6853 9C47
43.5928 +6854 584F
43.5929 +6855 F900
43.5930 +6856 93A7
43.5931 +6857 5580
43.5932 +6858 5028
43.5933 +6859 795B
43.5934 +685A 8E1E
43.5935 +685B 9245
43.5936 +685C 6957
43.5937 +685D 8171
43.5938 +685E 6840
43.5939 +685F 5292
43.5940 +6860 9210
43.5941 +6861 8FF2
43.5942 +6862 8188
43.5943 +6863 6289
43.5944 +6864 9257
43.5945 +6865 4FD3
43.5946 +6866 501E
43.5947 +6867 5106
43.5948 +6868 5770
43.5949 +6869 61AC
43.5950 +686A 70F1
43.5951 +686B 74A5
43.5952 +686C 583A
43.5953 +686D 68E8
43.5954 +686E 5C3B
43.5955 +686F 66A0
43.5956 +6870 69C1
43.5957 +6871 7F94
43.5958 +6872 82FD
43.5959 +6873 83F0
43.5960 +6874 7428
43.5961 +6875 9BE4
43.5962 +6876 73D9
43.5963 +6877 86A3
43.5964 +6878 978F
43.5965 +6879 4E32
43.5966 +687A 8DE8
43.5967 +687B 934B
43.5968 +687C 742F
43.5969 +687D 4F8A
43.5970 +687E 709A
43.5971 +687F 5775
43.5972 +6880 8009
43.5973 +6881 92B6
43.5974 +6882 97AB
43.5975 +6883 88D9
43.5976 +6884 828E
43.5977 +6885 6372
43.5978 +6886 6DC3
43.5979 +6887 7357
43.5980 +6888 8568
43.5981 +6889 F906
43.5982 +688A 6677
43.5983 +688B 69FB
43.5984 +688C 7AC5
43.5985 +688D 52FB
43.5986 +688E 7547
43.5987 +688F 52A4
43.5988 +6890 5997
43.5989 +6891 6611
43.5990 +6892 82A9
43.5991 +6893 4F0B
43.5992 +6894 57FC
43.5993 +6895 7398
43.5994 +6896 7482
43.5995 +6897 7941
43.5996 +6898 7F88
43.5997 +6899 9324
43.5998 +689A F90B
43.5999 +689B F90C
43.6000 +689C 5A1C
43.6001 +689D F90D
43.6002 +689E F90E
43.6003 +689F F90F
43.6004 +68A0 F910
43.6005 +68A1 F911
43.6006 +68A2 F912
43.6007 +68A3 F913
43.6008 +68A4 F914
43.6009 +68A5 F915
43.6010 +68A6 F916
43.6011 +68A7 F917
43.6012 +68A8 F918
43.6013 +68A9 F919
43.6014 +68AA F91A
43.6015 +68AB F91B
43.6016 +68AC F91C
43.6017 +68AD F91D
43.6018 +68AE F91E
43.6019 +68AF F91F
43.6020 +68B0 F920
43.6021 +68B1 F921
43.6022 +68B2 678F
43.6023 +68B3 6960
43.6024 +68B4 6E73
43.6025 +68B5 F922
43.6026 +68B6 F923
43.6027 +68B7 F924
43.6028 +68B8 F925
43.6029 +68B9 F926
43.6030 +68BA F927
43.6031 +68BB 8872
43.6032 +68BC F928
43.6033 +68BD F929
43.6034 +68BE F92A
43.6035 +68BF F92B
43.6036 +68C0 F92C
43.6037 +68C1 F92D
43.6038 +68C2 F92E
43.6039 +68C3 649A
43.6040 +68C4 5BD7
43.6041 +68C5 F92F
43.6042 +68C6 F930
43.6043 +68C7 F931
43.6044 +68C8 F932
43.6045 +68C9 F933
43.6046 +68CA F934
43.6047 +68CB F935
43.6048 +68CC F936
43.6049 +68CD F937
43.6050 +68CE F938
43.6051 +68CF 99D1
43.6052 +68D0 F939
43.6053 +68D1 F93A
43.6054 +68D2 F93B
43.6055 +68D3 F93C
43.6056 +68D4 F93D
43.6057 +68D5 F93E
43.6058 +68D6 F93F
43.6059 +68D7 F940
43.6060 +68D8 F941
43.6061 +68D9 F942
43.6062 +68DA F943
43.6063 +68DB F944
43.6064 +68DC F945
43.6065 +68DD F946
43.6066 +68DE F947
43.6067 +68DF F948
43.6068 +68E0 F949
43.6069 +68E1 F94A
43.6070 +68E2 F94B
43.6071 +68E3 F94C
43.6072 +68E4 F94D
43.6073 +68E5 F94E
43.6074 +68E6 F94F
43.6075 +68E7 F950
43.6076 +68E8 F951
43.6077 +68E9 677B
43.6078 +68EA F952
43.6079 +68EB F953
43.6080 +68EC F954
43.6081 +68ED F955
43.6082 +68EE F956
43.6083 +68EF F957
43.6084 +68F0 F958
43.6085 +68F1 F959
43.6086 +68F2 4EB6
43.6087 +68F3 5F56
43.6088 +68F4 6FBE
43.6089 +68F5 574D
43.6090 +68F6 61BA
43.6091 +68F7 6E5B
43.6092 +68F8 8541
43.6093 +68F9 931F
43.6094 +68FA 7553
43.6095 +68FB 6207
43.6096 +68FC 87B3
43.6097 +68FD 576E
43.6098 +68FE 5D8B
43.6099 +6941 6389
43.6100 +6942 6AC2
43.6101 +6943 89A9
43.6102 +6944 65FD
43.6103 +6945 711E
43.6104 +6946 9017
43.6105 +6947 829A
43.6106 +6948 5D9D
43.6107 +6949 F95B
43.6108 +694A F95D
43.6109 +694B F95E
43.6110 +694C 5D0D
43.6111 +694D 5FA0
43.6112 +694E 5137
43.6113 +694F 7489
43.6114 +6950 F95F
43.6115 +6951 5CBA
43.6116 +6952 7B2D
43.6117 +6953 8046
43.6118 +6954 6FA7
43.6119 +6955 F960
43.6120 +6956 64C4
43.6121 +6957 6F5E
43.6122 +6958 797F
43.6123 +6959 83C9
43.6124 +695A 7028
43.6125 +695B 8CDA
43.6126 +695C 9B27
43.6127 +695D 5A41
43.6128 +695E 763B
43.6129 +695F 851E
43.6130 +6960 93E4
43.6131 +6961 65D2
43.6132 +6962 700F
43.6133 +6963 4F96
43.6134 +6964 51DC
43.6135 +6965 550E
43.6136 +6966 6D6C
43.6137 +6967 F962
43.6138 +6968 7FB8
43.6139 +6969 8389
43.6140 +696A 88E1
43.6141 +696B 6F7E
43.6142 +696C 78BC
43.6143 +696D 9088
43.6144 +696E 4E07
43.6145 +696F 534D
43.6146 +6970 551C
43.6147 +6971 8309
43.6148 +6972 8F1E
43.6149 +6973 6C94
43.6150 +6974 6927
43.6151 +6975 7791
43.6152 +6976 84C2
43.6153 +6977 6479
43.6154 +6978 7441
43.6155 +6979 82BC
43.6156 +697A 9DA9
43.6157 +697B 7AD7
43.6158 +697C 61AE
43.6159 +697D 6959
43.6160 +697E 73F7
43.6161 +697F 5011
43.6162 +6980 96EF
43.6163 +6981 6C95
43.6164 +6982 68B6
43.6165 +6983 6963
43.6166 +6984 6E44
43.6167 +6985 9EF4
43.6168 +6986 5CB7
43.6169 +6987 7DE1
43.6170 +6988 7622
43.6171 +6989 76FC
43.6172 +698A 78D0
43.6173 +698B 6E24
43.6174 +698C 678B
43.6175 +698D 6EC2
43.6176 +698E 78C5
43.6177 +698F 7119
43.6178 +6990 5E61
43.6179 +6991 71D4
43.6180 +6992 6A97
43.6181 +6993 8617
43.6182 +6994 68C5
43.6183 +6995 9A08
43.6184 +6996 73E4
43.6185 +6997 83E9
43.6186 +6998 8F39
43.6187 +6999 71A2
43.6188 +699A 4E0D
43.6189 +699B 4FEF
43.6190 +699C 5490
43.6191 +699D 5B5A
43.6192 +699E 8240
43.6193 +699F 83A9
43.6194 +69A0 5429
43.6195 +69A1 6610
43.6196 +69A2 8CC1
43.6197 +69A3 5F7F
43.6198 +69A4 6787
43.6199 +69A5 6BD6
43.6200 +69A6 6BD7
43.6201 +69A7 79D5
43.6202 +69A8 7C83
43.6203 +69A9 56AC
43.6204 +69AA 6D5C
43.6205 +69AB 73AD
43.6206 +69AC 4FDF
43.6207 +69AD 67F6
43.6208 +69AE 9E9D
43.6209 +69AF 9730
43.6210 +69B0 715E
43.6211 +69B1 9212
43.6212 +69B2 5CE0
43.6213 +69B3 55C7
43.6214 +69B4 637F
43.6215 +69B5 7B6E
43.6216 +69B6 5B0B
43.6217 +69B7 657E
43.6218 +69B8 6E32
43.6219 +69B9 7401
43.6220 +69BA 9425
43.6221 +69BB 994D
43.6222 +69BC 6CC4
43.6223 +69BD 893B
43.6224 +69BE 9F67
43.6225 +69BF 5261
43.6226 +69C0 965D
43.6227 +69C1 5BAC
43.6228 +69C2 73F9
43.6229 +69C3 7619
43.6230 +69C4 7BE0
43.6231 +69C5 6D91
43.6232 +69C6 8B16
43.6233 +69C7 8D16
43.6234 +69C8 5DFD
43.6235 +69C9 84C0
43.6236 +69CA 98E1
43.6237 +69CB 609A
43.6238 +69CC 6DDE
43.6239 +69CD 5CC0
43.6240 +69CE 7407
43.6241 +69CF 74B2
43.6242 +69D0 8B90
43.6243 +69D1 96A7
43.6244 +69D2 6F5A
43.6245 +69D3 7421
43.6246 +69D4 74B9
43.6247 +69D5 5F87
43.6248 +69D6 6812
43.6249 +69D7 6A53
43.6250 +69D8 84F4
43.6251 +69D9 8563
43.6252 +69DA 8AC4
43.6253 +69DB 9265
43.6254 +69DC 5C4E
43.6255 +69DD 8C55
43.6256 +69DE 7BD2
43.6257 +69DF 8755
43.6258 +69E0 4F81
43.6259 +69E1 85CE
43.6260 +69E2 8AF6
43.6261 +69E3 555E
43.6262 +69E4 83AA
43.6263 +69E5 5E44
43.6264 +69E6 9102
43.6265 +69E7 9354
43.6266 +69E8 9C10
43.6267 +69E9 9B9F
43.6268 +69EA 5535
43.6269 +69EB 5CA9
43.6270 +69EC 627C
43.6271 +69ED 7E0A
43.6272 +69EE F975
43.6273 +69EF F976
43.6274 +69F0 84BB
43.6275 +69F1 F977
43.6276 +69F2 F978
43.6277 +69F3 F979
43.6278 +69F4 F97A
43.6279 +69F5 79B3
43.6280 +69F6 F97B
43.6281 +69F7 F97C
43.6282 +69F8 F97D
43.6283 +69F9 F97E
43.6284 +69FA 7600
43.6285 +69FB 8616
43.6286 +69FC 4FFA
43.6287 +69FD 5186
43.6288 +69FE F97F
43.6289 +6A41 F980
43.6290 +6A42 F981
43.6291 +6A43 F982
43.6292 +6A44 F983
43.6293 +6A45 F984
43.6294 +6A46 74B5
43.6295 +6A47 7916
43.6296 +6A48 F985
43.6297 +6A49 8245
43.6298 +6A4A 8339
43.6299 +6A4B 8F3F
43.6300 +6A4C 8F5D
43.6301 +6A4D F986
43.6302 +6A4E F987
43.6303 +6A4F F988
43.6304 +6A50 F989
43.6305 +6A51 F98A
43.6306 +6A52 F98B
43.6307 +6A53 F98C
43.6308 +6A54 F98D
43.6309 +6A55 F98E
43.6310 +6A56 F98F
43.6311 +6A57 F990
43.6312 +6A58 633B
43.6313 +6A59 6C87
43.6314 +6A5A F992
43.6315 +6A5B F993
43.6316 +6A5C F994
43.6317 +6A5D F995
43.6318 +6A5E F996
43.6319 +6A5F 7E2F
43.6320 +6A60 F997
43.6321 +6A61 F998
43.6322 +6A62 F999
43.6323 +6A63 F99A
43.6324 +6A64 F99B
43.6325 +6A65 F99C
43.6326 +6A66 F99D
43.6327 +6A67 F99F
43.6328 +6A68 F9A0
43.6329 +6A69 F9A2
43.6330 +6A6A F9A3
43.6331 +6A6B F9A4
43.6332 +6A6C F9A5
43.6333 +6A6D 7430
43.6334 +6A6E F9A6
43.6335 +6A6F F9A7
43.6336 +6A70 F9A8
43.6337 +6A71 F9A9
43.6338 +6A72 F9AA
43.6339 +6A73 F9AB
43.6340 +6A74 5DB8
43.6341 +6A75 F9AC
43.6342 +6A76 6E36
43.6343 +6A77 6FDA
43.6344 +6A78 702F
43.6345 +6A79 7150
43.6346 +6A7A 7370
43.6347 +6A7B F9AD
43.6348 +6A7C 7A4E
43.6349 +6A7D F9AF
43.6350 +6A7E F9B0
43.6351 +6A7F F9B1
43.6352 +6A80 9348
43.6353 +6A81 F9B2
43.6354 +6A82 9719
43.6355 +6A83 F9B3
43.6356 +6A84 F9B4
43.6357 +6A85 4E42
43.6358 +6A86 F9B5
43.6359 +6A87 6C6D
43.6360 +6A88 7A62
43.6361 +6A89 F9B6
43.6362 +6A8A F9B7
43.6363 +6A8B F9B8
43.6364 +6A8C 4FC9
43.6365 +6A8D 5862
43.6366 +6A8E 61CA
43.6367 +6A8F 6556
43.6368 +6A90 6FB3
43.6369 +6A91 71AC
43.6370 +6A92 7B7D
43.6371 +6A93 9C32
43.6372 +6A94 9F07
43.6373 +6A95 7E15
43.6374 +6A96 9954
43.6375 +6A97 7AAA
43.6376 +6A98 68A1
43.6377 +6A99 6900
43.6378 +6A9A 7413
43.6379 +6A9B 8118
43.6380 +6A9C 5A03
43.6381 +6A9D 5D6C
43.6382 +6A9E F9BA
43.6383 +6A9F F9BB
43.6384 +6AA0 5BE5
43.6385 +6AA1 F9BC
43.6386 +6AA2 F9BD
43.6387 +6AA3 6493
43.6388 +6AA4 F9BE
43.6389 +6AA5 F9C0
43.6390 +6AA6 71FF
43.6391 +6AA7 F9C1
43.6392 +6AA8 F9C2
43.6393 +6AA9 F9C3
43.6394 +6AAA 7E1F
43.6395 +6AAB 4FD1
43.6396 +6AAC 57C7
43.6397 +6AAD 5889
43.6398 +6AAE 6142
43.6399 +6AAF 6D8C
43.6400 +6AB0 752C
43.6401 +6AB1 F9C4
43.6402 +6AB2 65F4
43.6403 +6AB3 7397
43.6404 +6AB4 7440
43.6405 +6AB5 7D06
43.6406 +6AB6 85D5
43.6407 +6AB7 91EA
43.6408 +6AB8 52D6
43.6409 +6AB9 5F67
43.6410 +6ABA 682F
43.6411 +6ABB 6A52
43.6412 +6ABC 6F90
43.6413 +6ABD 7189
43.6414 +6ABE 8553
43.6415 +6ABF 4E90
43.6416 +6AC0 5AC4
43.6417 +6AC1 6C85
43.6418 +6AC2 6D39
43.6419 +6AC3 6E72
43.6420 +6AC4 F9C6
43.6421 +6AC5 6690
43.6422 +6AC6 853F
43.6423 +6AC7 8918
43.6424 +6AC8 F9C7
43.6425 +6AC9 F9C8
43.6426 +6ACA F9C9
43.6427 +6ACB 6962
43.6428 +6ACC 6D27
43.6429 +6ACD F9CA
43.6430 +6ACE F9CB
43.6431 +6ACF 7337
43.6432 +6AD0 F9CC
43.6433 +6AD1 F9CD
43.6434 +6AD2 F9CE
43.6435 +6AD3 F9CF
43.6436 +6AD4 F9D0
43.6437 +6AD5 F9D1
43.6438 +6AD6 5809
43.6439 +6AD7 F9D2
43.6440 +6AD8 F9D3
43.6441 +6AD9 F9D4
43.6442 +6ADA F9D5
43.6443 +6ADB F9D6
43.6444 +6ADC 8D07
43.6445 +6ADD F9D7
43.6446 +6ADE 9217
43.6447 +6ADF F9D8
43.6448 +6AE0 F9D9
43.6449 +6AE1 F9DA
43.6450 +6AE2 F9DB
43.6451 +6AE3 701C
43.6452 +6AE4 F9DC
43.6453 +6AE5 6905
43.6454 +6AE6 858F
43.6455 +6AE7 F9DD
43.6456 +6AE8 F9DE
43.6457 +6AE9 F9DF
43.6458 +6AEA F9E1
43.6459 +6AEB F9E2
43.6460 +6AEC F9E3
43.6461 +6AED F9E4
43.6462 +6AEE F9E5
43.6463 +6AEF F9E6
43.6464 +6AF0 8084
43.6465 +6AF1 82E1
43.6466 +6AF2 F9E7
43.6467 +6AF3 F9E8
43.6468 +6AF4 8CBD
43.6469 +6AF5 9087
43.6470 +6AF6 F9E9
43.6471 +6AF7 F9EA
43.6472 +6AF8 F9EB
43.6473 +6AF9 F9EC
43.6474 +6AFA 8B1A
43.6475 +6AFB F9ED
43.6476 +6AFC F9EE
43.6477 +6AFD F9EF
43.6478 +6AFE 7D6A
43.6479 +6B41 8335
43.6480 +6B42 F9F0
43.6481 +6B43 8693
43.6482 +6B44 F9F1
43.6483 +6B45 F9F2
43.6484 +6B46 F9F3
43.6485 +6B47 4F5A
43.6486 +6B48 6041
43.6487 +6B49 F9F4
43.6488 +6B4A F9F5
43.6489 +6B4B F9F6
43.6490 +6B4C 5344
43.6491 +6B4D F9F7
43.6492 +6B4E F9F8
43.6493 +6B4F F9F9
43.6494 +6B50 82BF
43.6495 +6B51 8328
43.6496 +6B52 5B71
43.6497 +6B53 81E7
43.6498 +6B54 6E3D
43.6499 +6B55 7E21
43.6500 +6B56 7D35
43.6501 +6B57 83F9
43.6502 +6B58 96CE
43.6503 +6B59 9F5F
43.6504 +6B5A 540A
43.6505 +6B5B F9FB
43.6506 +6B5C 7FDF
43.6507 +6B5D 93D1
43.6508 +6B5E 4F43
43.6509 +6B5F 4F7A
43.6510 +6B60 587C
43.6511 +6B61 7420
43.6512 +6B62 7551
43.6513 +6B63 7B4C
43.6514 +6B64 942B
43.6515 +6B65 7664
43.6516 +6B66 9B8E
43.6517 +6B67 67FE
43.6518 +6B68 6A89
43.6519 +6B69 6DC0
43.6520 +6B6A 6E5E
43.6521 +6B6B 701E
43.6522 +6B6C 70A1
43.6523 +6B6D 738E
43.6524 +6B6E 73FD
43.6525 +6B6F 7D8E
43.6526 +6B70 92CC
43.6527 +6B71 74AA
43.6528 +6B72 96D5
43.6529 +6B73 60B0
43.6530 +6B74 8E2A
43.6531 +6B75 59DD
43.6532 +6B76 6E4A
43.6533 +6B77 6F8D
43.6534 +6B78 5BEF
43.6535 +6B79 710C
43.6536 +6B7A 96CB
43.6537 +6B7B 7E52
43.6538 +6B7C 6C9A
43.6539 +6B7D 82B7
43.6540 +6B7E 5507
43.6541 +6B7F 6422
43.6542 +6B80 664B
43.6543 +6B81 686D
43.6544 +6B82 6B84
43.6545 +6B83 755B
43.6546 +6B84 7E1D
43.6547 +6B85 81FB
43.6548 +6B86 852F
43.6549 +6B87 8897
43.6550 +6B88 4F84
43.6551 +6B89 74C6
43.6552 +6B8A F9FD
43.6553 +6B8B 6F57
43.6554 +6B8C 93F6
43.6555 +6B8D 4F98
43.6556 +6B8E 7C12
43.6557 +6B8F 7D2E
43.6558 +6B90 8B96
43.6559 +6B91 6134
43.6560 +6B92 7316
43.6561 +6B93 5BC0
43.6562 +6B94 5BE8
43.6563 +6B95 501C
43.6564 +6B96 8E60
43.6565 +6B97 7394
43.6566 +6B98 8F1F
43.6567 +6B99 7C3D
43.6568 +6B9A 8A79
43.6569 +6B9B 581E
43.6570 +6B9C 527F
43.6571 +6B9D 8278
43.6572 +6B9E 82D5
43.6573 +6B9F 90A8
43.6574 +6BA0 60A4
43.6575 +6BA1 6181
43.6576 +6BA2 8525
43.6577 +6BA3 8ACF
43.6578 +6BA4 939A
43.6579 +6BA5 9A36
43.6580 +6BA6 8E59
43.6581 +6BA7 7443
43.6582 +6BA8 672E
43.6583 +6BA9 8D05
43.6584 +6BAA 53A0
43.6585 +6BAB 7A49
43.6586 +6BAC 86A9
43.6587 +6BAD 741B
43.6588 +6BAE 54A4
43.6589 +6BAF 62D6
43.6590 +6BB0 99B1
43.6591 +6BB1 577C
43.6592 +6BB2 666B
43.6593 +6BB3 7438
43.6594 +6BB4 7708
43.6595 +6BB5 FA03
43.6596 +6BB6 69CC
43.6597 +6BB7 95D6
43.6598 +6BB8 64FA
43.6599 +6BB9 9211
43.6600 +6BBA 9A19
43.6601 +6BBB 67B0
43.6602 +6BBC FA06
43.6603 +6BBD 82DE
43.6604 +6BBE 900B
43.6605 +6BBF 66DD
43.6606 +6BC0 FA07
43.6607 +6BC1 98C7
43.6608 +6BC2 9A43
43.6609 +6BC3 9642
43.6610 +6BC4 73CC
43.6611 +6BC5 82FE
43.6612 +6BC6 999D
43.6613 +6BC7 53A6
43.6614 +6BC8 701A
43.6615 +6BC9 929C
43.6616 +6BCA 9E79
43.6617 +6BCB 95D4
43.6618 +6BCC 5AE6
43.6619 +6BCD FA08
43.6620 +6BCE 7023
43.6621 +6BCF 8347
43.6622 +6BD0 6AF6
43.6623 +6BD1 4FD4
43.6624 +6BD2 774D
43.6625 +6BD3 6CEB
43.6626 +6BD4 73B9
43.6627 +6BD5 665B
43.6628 +6BD6 6CC2
43.6629 +6BD7 6ECE
43.6630 +6BD8 7050
43.6631 +6BD9 7192
43.6632 +6BDA 7469
43.6633 +6BDB 9008
43.6634 +6BDC 66B3
43.6635 +6BDD 8E4A
43.6636 +6BDE 5CB5
43.6637 +6BDF 6667
43.6638 +6BE0 7425
43.6639 +6BE1 82A6
43.6640 +6BE2 84BF
43.6641 +6BE3 70D8
43.6642 +6BE4 8B41
43.6643 +6BE5 5950
43.6644 +6BE6 6665
43.6645 +6BE7 5E4C
43.6646 +6BE8 6130
43.6647 +6BE9 6644
43.6648 +6BEA 69A5
43.6649 +6BEB 6E5F
43.6650 +6BEC 6F62
43.6651 +6BED 749C
43.6652 +6BEE 7C27
43.6653 +6BEF 532F
43.6654 +6BF0 8334
43.6655 +6BF1 5B96
43.6656 +6BF2 9404
43.6657 +6BF3 6585
43.6658 +6BF4 6D8D
43.6659 +6BF5 6DC6
43.6660 +6BF6 9A4D
43.6661 +6BF7 5E3F
43.6662 +6BF8 7166
43.6663 +6BF9 73DD
43.6664 +6BFA 52DB
43.6665 +6BFB 6684
43.6666 +6BFC 714A
43.6667 +6BFD 7098
43.6668 +6BFE 8A16
43.6669 +6C41 7FD5
43.6670 +6C42 56CD
43.6671 +6C43 6198
43.6672 +6C44 665E
43.6673 +6C45 71BA
43.6674 +8441 3164
43.6675 +8444 3133
43.6676 +8446 3135
43.6677 +8447 3136
43.6678 +844A 313A
43.6679 +844B 313B
43.6680 +844C 313C
43.6681 +844D 313D
43.6682 +844E 313E
43.6683 +844F 313F
43.6684 +8450 3140
43.6685 +8454 3144
43.6686 +8461 314F
43.6687 +8481 3150
43.6688 +84A1 3151
43.6689 +84C1 3152
43.6690 +84E1 3153
43.6691 +8541 3154
43.6692 +8561 3155
43.6693 +8581 3156
43.6694 +85A1 3157
43.6695 +85C1 3158
43.6696 +85E1 3159
43.6697 +8641 315A
43.6698 +8661 315B
43.6699 +8681 315C
43.6700 +86A1 315D
43.6701 +86C1 315E
43.6702 +86E1 315F
43.6703 +8741 3160
43.6704 +8761 3161
43.6705 +8781 3162
43.6706 +87A1 3163
43.6707 +8841 3131
43.6708 +8861 AC00
43.6709 +8862 AC01
43.6710 +8863 AC02
43.6711 +8864 AC03
43.6712 +8865 AC04
43.6713 +8866 AC05
43.6714 +8867 AC06
43.6715 +8868 AC07
43.6716 +8869 AC08
43.6717 +886A AC09
43.6718 +886B AC0A
43.6719 +886C AC0B
43.6720 +886D AC0C
43.6721 +886E AC0D
43.6722 +886F AC0E
43.6723 +8870 AC0F
43.6724 +8871 AC10
43.6725 +8873 AC11
43.6726 +8874 AC12
43.6727 +8875 AC13
43.6728 +8876 AC14
43.6729 +8877 AC15
43.6730 +8878 AC16
43.6731 +8879 AC17
43.6732 +887A AC18
43.6733 +887B AC19
43.6734 +887C AC1A
43.6735 +887D AC1B
43.6736 +8881 AC1C
43.6737 +8882 AC1D
43.6738 +8883 AC1E
43.6739 +8884 AC1F
43.6740 +8885 AC20
43.6741 +8886 AC21
43.6742 +8887 AC22
43.6743 +8888 AC23
43.6744 +8889 AC24
43.6745 +888A AC25
43.6746 +888B AC26
43.6747 +888C AC27
43.6748 +888D AC28
43.6749 +888E AC29
43.6750 +888F AC2A
43.6751 +8890 AC2B
43.6752 +8891 AC2C
43.6753 +8893 AC2D
43.6754 +8894 AC2E
43.6755 +8895 AC2F
43.6756 +8896 AC30
43.6757 +8897 AC31
43.6758 +8898 AC32
43.6759 +8899 AC33
43.6760 +889A AC34
43.6761 +889B AC35
43.6762 +889C AC36
43.6763 +889D AC37
43.6764 +88A1 AC38
43.6765 +88A2 AC39
43.6766 +88A3 AC3A
43.6767 +88A4 AC3B
43.6768 +88A5 AC3C
43.6769 +88A6 AC3D
43.6770 +88A7 AC3E
43.6771 +88A8 AC3F
43.6772 +88A9 AC40
43.6773 +88AA AC41
43.6774 +88AB AC42
43.6775 +88AC AC43
43.6776 +88AD AC44
43.6777 +88AE AC45
43.6778 +88AF AC46
43.6779 +88B0 AC47
43.6780 +88B1 AC48
43.6781 +88B3 AC49
43.6782 +88B4 AC4A
43.6783 +88B5 AC4B
43.6784 +88B6 AC4C
43.6785 +88B7 AC4D
43.6786 +88B8 AC4E
43.6787 +88B9 AC4F
43.6788 +88BA AC50
43.6789 +88BB AC51
43.6790 +88BC AC52
43.6791 +88BD AC53
43.6792 +88C1 AC54
43.6793 +88C2 AC55
43.6794 +88C3 AC56
43.6795 +88C4 AC57
43.6796 +88C5 AC58
43.6797 +88C6 AC59
43.6798 +88C7 AC5A
43.6799 +88C8 AC5B
43.6800 +88C9 AC5C
43.6801 +88CA AC5D
43.6802 +88CB AC5E
43.6803 +88CC AC5F
43.6804 +88CD AC60
43.6805 +88CE AC61
43.6806 +88CF AC62
43.6807 +88D0 AC63
43.6808 +88D1 AC64
43.6809 +88D3 AC65
43.6810 +88D4 AC66
43.6811 +88D5 AC67
43.6812 +88D6 AC68
43.6813 +88D7 AC69
43.6814 +88D8 AC6A
43.6815 +88D9 AC6B
43.6816 +88DA AC6C
43.6817 +88DB AC6D
43.6818 +88DC AC6E
43.6819 +88DD AC6F
43.6820 +88E1 AC70
43.6821 +88E2 AC71
43.6822 +88E3 AC72
43.6823 +88E4 AC73
43.6824 +88E5 AC74
43.6825 +88E6 AC75
43.6826 +88E7 AC76
43.6827 +88E8 AC77
43.6828 +88E9 AC78
43.6829 +88EA AC79
43.6830 +88EB AC7A
43.6831 +88EC AC7B
43.6832 +88ED AC7C
43.6833 +88EE AC7D
43.6834 +88EF AC7E
43.6835 +88F0 AC7F
43.6836 +88F1 AC80
43.6837 +88F3 AC81
43.6838 +88F4 AC82
43.6839 +88F5 AC83
43.6840 +88F6 AC84
43.6841 +88F7 AC85
43.6842 +88F8 AC86
43.6843 +88F9 AC87
43.6844 +88FA AC88
43.6845 +88FB AC89
43.6846 +88FC AC8A
43.6847 +88FD AC8B
43.6848 +8941 AC8C
43.6849 +8942 AC8D
43.6850 +8943 AC8E
43.6851 +8944 AC8F
43.6852 +8945 AC90
43.6853 +8946 AC91
43.6854 +8947 AC92
43.6855 +8948 AC93
43.6856 +8949 AC94
43.6857 +894A AC95
43.6858 +894B AC96
43.6859 +894C AC97
43.6860 +894D AC98
43.6861 +894E AC99
43.6862 +894F AC9A
43.6863 +8950 AC9B
43.6864 +8951 AC9C
43.6865 +8953 AC9D
43.6866 +8954 AC9E
43.6867 +8955 AC9F
43.6868 +8956 ACA0
43.6869 +8957 ACA1
43.6870 +8958 ACA2
43.6871 +8959 ACA3
43.6872 +895A ACA4
43.6873 +895B ACA5
43.6874 +895C ACA6
43.6875 +895D ACA7
43.6876 +8961 ACA8
43.6877 +8962 ACA9
43.6878 +8963 ACAA
43.6879 +8964 ACAB
43.6880 +8965 ACAC
43.6881 +8966 ACAD
43.6882 +8967 ACAE
43.6883 +8968 ACAF
43.6884 +8969 ACB0
43.6885 +896A ACB1
43.6886 +896B ACB2
43.6887 +896C ACB3
43.6888 +896D ACB4
43.6889 +896E ACB5
43.6890 +896F ACB6
43.6891 +8970 ACB7
43.6892 +8971 ACB8
43.6893 +8973 ACB9
43.6894 +8974 ACBA
43.6895 +8975 ACBB
43.6896 +8976 ACBC
43.6897 +8977 ACBD
43.6898 +8978 ACBE
43.6899 +8979 ACBF
43.6900 +897A ACC0
43.6901 +897B ACC1
43.6902 +897C ACC2
43.6903 +897D ACC3
43.6904 +8981 ACC4
43.6905 +8982 ACC5
43.6906 +8983 ACC6
43.6907 +8984 ACC7
43.6908 +8985 ACC8
43.6909 +8986 ACC9
43.6910 +8987 ACCA
43.6911 +8988 ACCB
43.6912 +8989 ACCC
43.6913 +898A ACCD
43.6914 +898B ACCE
43.6915 +898C ACCF
43.6916 +898D ACD0
43.6917 +898E ACD1
43.6918 +898F ACD2
43.6919 +8990 ACD3
43.6920 +8991 ACD4
43.6921 +8993 ACD5
43.6922 +8994 ACD6
43.6923 +8995 ACD7
43.6924 +8996 ACD8
43.6925 +8997 ACD9
43.6926 +8998 ACDA
43.6927 +8999 ACDB
43.6928 +899A ACDC
43.6929 +899B ACDD
43.6930 +899C ACDE
43.6931 +899D ACDF
43.6932 +89A1 ACE0
43.6933 +89A2 ACE1
43.6934 +89A3 ACE2
43.6935 +89A4 ACE3
43.6936 +89A5 ACE4
43.6937 +89A6 ACE5
43.6938 +89A7 ACE6
43.6939 +89A8 ACE7
43.6940 +89A9 ACE8
43.6941 +89AA ACE9
43.6942 +89AB ACEA
43.6943 +89AC ACEB
43.6944 +89AD ACEC
43.6945 +89AE ACED
43.6946 +89AF ACEE
43.6947 +89B0 ACEF
43.6948 +89B1 ACF0
43.6949 +89B3 ACF1
43.6950 +89B4 ACF2
43.6951 +89B5 ACF3
43.6952 +89B6 ACF4
43.6953 +89B7 ACF5
43.6954 +89B8 ACF6
43.6955 +89B9 ACF7
43.6956 +89BA ACF8
43.6957 +89BB ACF9
43.6958 +89BC ACFA
43.6959 +89BD ACFB
43.6960 +89C1 ACFC
43.6961 +89C2 ACFD
43.6962 +89C3 ACFE
43.6963 +89C4 ACFF
43.6964 +89C5 AD00
43.6965 +89C6 AD01
43.6966 +89C7 AD02
43.6967 +89C8 AD03
43.6968 +89C9 AD04
43.6969 +89CA AD05
43.6970 +89CB AD06
43.6971 +89CC AD07
43.6972 +89CD AD08
43.6973 +89CE AD09
43.6974 +89CF AD0A
43.6975 +89D0 AD0B
43.6976 +89D1 AD0C
43.6977 +89D3 AD0D
43.6978 +89D4 AD0E
43.6979 +89D5 AD0F
43.6980 +89D6 AD10
43.6981 +89D7 AD11
43.6982 +89D8 AD12
43.6983 +89D9 AD13
43.6984 +89DA AD14
43.6985 +89DB AD15
43.6986 +89DC AD16
43.6987 +89DD AD17
43.6988 +89E1 AD18
43.6989 +89E2 AD19
43.6990 +89E3 AD1A
43.6991 +89E4 AD1B
43.6992 +89E5 AD1C
43.6993 +89E6 AD1D
43.6994 +89E7 AD1E
43.6995 +89E8 AD1F
43.6996 +89E9 AD20
43.6997 +89EA AD21
43.6998 +89EB AD22
43.6999 +89EC AD23
43.7000 +89ED AD24
43.7001 +89EE AD25
43.7002 +89EF AD26
43.7003 +89F0 AD27
43.7004 +89F1 AD28
43.7005 +89F3 AD29
43.7006 +89F4 AD2A
43.7007 +89F5 AD2B
43.7008 +89F6 AD2C
43.7009 +89F7 AD2D
43.7010 +89F8 AD2E
43.7011 +89F9 AD2F
43.7012 +89FA AD30
43.7013 +89FB AD31
43.7014 +89FC AD32
43.7015 +89FD AD33
43.7016 +8A41 AD34
43.7017 +8A42 AD35
43.7018 +8A43 AD36
43.7019 +8A44 AD37
43.7020 +8A45 AD38
43.7021 +8A46 AD39
43.7022 +8A47 AD3A
43.7023 +8A48 AD3B
43.7024 +8A49 AD3C
43.7025 +8A4A AD3D
43.7026 +8A4B AD3E
43.7027 +8A4C AD3F
43.7028 +8A4D AD40
43.7029 +8A4E AD41
43.7030 +8A4F AD42
43.7031 +8A50 AD43
43.7032 +8A51 AD44
43.7033 +8A53 AD45
43.7034 +8A54 AD46
43.7035 +8A55 AD47
43.7036 +8A56 AD48
43.7037 +8A57 AD49
43.7038 +8A58 AD4A
43.7039 +8A59 AD4B
43.7040 +8A5A AD4C
43.7041 +8A5B AD4D
43.7042 +8A5C AD4E
43.7043 +8A5D AD4F
43.7044 +8A61 AD50
43.7045 +8A62 AD51
43.7046 +8A63 AD52
43.7047 +8A64 AD53
43.7048 +8A65 AD54
43.7049 +8A66 AD55
43.7050 +8A67 AD56
43.7051 +8A68 AD57
43.7052 +8A69 AD58
43.7053 +8A6A AD59
43.7054 +8A6B AD5A
43.7055 +8A6C AD5B
43.7056 +8A6D AD5C
43.7057 +8A6E AD5D
43.7058 +8A6F AD5E
43.7059 +8A70 AD5F
43.7060 +8A71 AD60
43.7061 +8A73 AD61
43.7062 +8A74 AD62
43.7063 +8A75 AD63
43.7064 +8A76 AD64
43.7065 +8A77 AD65
43.7066 +8A78 AD66
43.7067 +8A79 AD67
43.7068 +8A7A AD68
43.7069 +8A7B AD69
43.7070 +8A7C AD6A
43.7071 +8A7D AD6B
43.7072 +8A81 AD6C
43.7073 +8A82 AD6D
43.7074 +8A83 AD6E
43.7075 +8A84 AD6F
43.7076 +8A85 AD70
43.7077 +8A86 AD71
43.7078 +8A87 AD72
43.7079 +8A88 AD73
43.7080 +8A89 AD74
43.7081 +8A8A AD75
43.7082 +8A8B AD76
43.7083 +8A8C AD77
43.7084 +8A8D AD78
43.7085 +8A8E AD79
43.7086 +8A8F AD7A
43.7087 +8A90 AD7B
43.7088 +8A91 AD7C
43.7089 +8A93 AD7D
43.7090 +8A94 AD7E
43.7091 +8A95 AD7F
43.7092 +8A96 AD80
43.7093 +8A97 AD81
43.7094 +8A98 AD82
43.7095 +8A99 AD83
43.7096 +8A9A AD84
43.7097 +8A9B AD85
43.7098 +8A9C AD86
43.7099 +8A9D AD87
43.7100 +8AA1 AD88
43.7101 +8AA2 AD89
43.7102 +8AA3 AD8A
43.7103 +8AA4 AD8B
43.7104 +8AA5 AD8C
43.7105 +8AA6 AD8D
43.7106 +8AA7 AD8E
43.7107 +8AA8 AD8F
43.7108 +8AA9 AD90
43.7109 +8AAA AD91
43.7110 +8AAB AD92
43.7111 +8AAC AD93
43.7112 +8AAD AD94
43.7113 +8AAE AD95
43.7114 +8AAF AD96
43.7115 +8AB0 AD97
43.7116 +8AB1 AD98
43.7117 +8AB3 AD99
43.7118 +8AB4 AD9A
43.7119 +8AB5 AD9B
43.7120 +8AB6 AD9C
43.7121 +8AB7 AD9D
43.7122 +8AB8 AD9E
43.7123 +8AB9 AD9F
43.7124 +8ABA ADA0
43.7125 +8ABB ADA1
43.7126 +8ABC ADA2
43.7127 +8ABD ADA3
43.7128 +8AC1 ADA4
43.7129 +8AC2 ADA5
43.7130 +8AC3 ADA6
43.7131 +8AC4 ADA7
43.7132 +8AC5 ADA8
43.7133 +8AC6 ADA9
43.7134 +8AC7 ADAA
43.7135 +8AC8 ADAB
43.7136 +8AC9 ADAC
43.7137 +8ACA ADAD
43.7138 +8ACB ADAE
43.7139 +8ACC ADAF
43.7140 +8ACD ADB0
43.7141 +8ACE ADB1
43.7142 +8ACF ADB2
43.7143 +8AD0 ADB3
43.7144 +8AD1 ADB4
43.7145 +8AD3 ADB5
43.7146 +8AD4 ADB6
43.7147 +8AD5 ADB7
43.7148 +8AD6 ADB8
43.7149 +8AD7 ADB9
43.7150 +8AD8 ADBA
43.7151 +8AD9 ADBB
43.7152 +8ADA ADBC
43.7153 +8ADB ADBD
43.7154 +8ADC ADBE
43.7155 +8ADD ADBF
43.7156 +8AE1 ADC0
43.7157 +8AE2 ADC1
43.7158 +8AE3 ADC2
43.7159 +8AE4 ADC3
43.7160 +8AE5 ADC4
43.7161 +8AE6 ADC5
43.7162 +8AE7 ADC6
43.7163 +8AE8 ADC7
43.7164 +8AE9 ADC8
43.7165 +8AEA ADC9
43.7166 +8AEB ADCA
43.7167 +8AEC ADCB
43.7168 +8AED ADCC
43.7169 +8AEE ADCD
43.7170 +8AEF ADCE
43.7171 +8AF0 ADCF
43.7172 +8AF1 ADD0
43.7173 +8AF3 ADD1
43.7174 +8AF4 ADD2
43.7175 +8AF5 ADD3
43.7176 +8AF6 ADD4
43.7177 +8AF7 ADD5
43.7178 +8AF8 ADD6
43.7179 +8AF9 ADD7
43.7180 +8AFA ADD8
43.7181 +8AFB ADD9
43.7182 +8AFC ADDA
43.7183 +8AFD ADDB
43.7184 +8B41 ADDC
43.7185 +8B42 ADDD
43.7186 +8B43 ADDE
43.7187 +8B44 ADDF
43.7188 +8B45 ADE0
43.7189 +8B46 ADE1
43.7190 +8B47 ADE2
43.7191 +8B48 ADE3
43.7192 +8B49 ADE4
43.7193 +8B4A ADE5
43.7194 +8B4B ADE6
43.7195 +8B4C ADE7
43.7196 +8B4D ADE8
43.7197 +8B4E ADE9
43.7198 +8B4F ADEA
43.7199 +8B50 ADEB
43.7200 +8B51 ADEC
43.7201 +8B53 ADED
43.7202 +8B54 ADEE
43.7203 +8B55 ADEF
43.7204 +8B56 ADF0
43.7205 +8B57 ADF1
43.7206 +8B58 ADF2
43.7207 +8B59 ADF3
43.7208 +8B5A ADF4
43.7209 +8B5B ADF5
43.7210 +8B5C ADF6
43.7211 +8B5D ADF7
43.7212 +8B61 ADF8
43.7213 +8B62 ADF9
43.7214 +8B63 ADFA
43.7215 +8B64 ADFB
43.7216 +8B65 ADFC
43.7217 +8B66 ADFD
43.7218 +8B67 ADFE
43.7219 +8B68 ADFF
43.7220 +8B69 AE00
43.7221 +8B6A AE01
43.7222 +8B6B AE02
43.7223 +8B6C AE03
43.7224 +8B6D AE04
43.7225 +8B6E AE05
43.7226 +8B6F AE06
43.7227 +8B70 AE07
43.7228 +8B71 AE08
43.7229 +8B73 AE09
43.7230 +8B74 AE0A
43.7231 +8B75 AE0B
43.7232 +8B76 AE0C
43.7233 +8B77 AE0D
43.7234 +8B78 AE0E
43.7235 +8B79 AE0F
43.7236 +8B7A AE10
43.7237 +8B7B AE11
43.7238 +8B7C AE12
43.7239 +8B7D AE13
43.7240 +8B81 AE14
43.7241 +8B82 AE15
43.7242 +8B83 AE16
43.7243 +8B84 AE17
43.7244 +8B85 AE18
43.7245 +8B86 AE19
43.7246 +8B87 AE1A
43.7247 +8B88 AE1B
43.7248 +8B89 AE1C
43.7249 +8B8A AE1D
43.7250 +8B8B AE1E
43.7251 +8B8C AE1F
43.7252 +8B8D AE20
43.7253 +8B8E AE21
43.7254 +8B8F AE22
43.7255 +8B90 AE23
43.7256 +8B91 AE24
43.7257 +8B93 AE25
43.7258 +8B94 AE26
43.7259 +8B95 AE27
43.7260 +8B96 AE28
43.7261 +8B97 AE29
43.7262 +8B98 AE2A
43.7263 +8B99 AE2B
43.7264 +8B9A AE2C
43.7265 +8B9B AE2D
43.7266 +8B9C AE2E
43.7267 +8B9D AE2F
43.7268 +8BA1 AE30
43.7269 +8BA2 AE31
43.7270 +8BA3 AE32
43.7271 +8BA4 AE33
43.7272 +8BA5 AE34
43.7273 +8BA6 AE35
43.7274 +8BA7 AE36
43.7275 +8BA8 AE37
43.7276 +8BA9 AE38
43.7277 +8BAA AE39
43.7278 +8BAB AE3A
43.7279 +8BAC AE3B
43.7280 +8BAD AE3C
43.7281 +8BAE AE3D
43.7282 +8BAF AE3E
43.7283 +8BB0 AE3F
43.7284 +8BB1 AE40
43.7285 +8BB3 AE41
43.7286 +8BB4 AE42
43.7287 +8BB5 AE43
43.7288 +8BB6 AE44
43.7289 +8BB7 AE45
43.7290 +8BB8 AE46
43.7291 +8BB9 AE47
43.7292 +8BBA AE48
43.7293 +8BBB AE49
43.7294 +8BBC AE4A
43.7295 +8BBD AE4B
43.7296 +8C41 3132
43.7297 +8C61 AE4C
43.7298 +8C62 AE4D
43.7299 +8C63 AE4E
43.7300 +8C64 AE4F
43.7301 +8C65 AE50
43.7302 +8C66 AE51
43.7303 +8C67 AE52
43.7304 +8C68 AE53
43.7305 +8C69 AE54
43.7306 +8C6A AE55
43.7307 +8C6B AE56
43.7308 +8C6C AE57
43.7309 +8C6D AE58
43.7310 +8C6E AE59
43.7311 +8C6F AE5A
43.7312 +8C70 AE5B
43.7313 +8C71 AE5C
43.7314 +8C73 AE5D
43.7315 +8C74 AE5E
43.7316 +8C75 AE5F
43.7317 +8C76 AE60
43.7318 +8C77 AE61
43.7319 +8C78 AE62
43.7320 +8C79 AE63
43.7321 +8C7A AE64
43.7322 +8C7B AE65
43.7323 +8C7C AE66
43.7324 +8C7D AE67
43.7325 +8C81 AE68
43.7326 +8C82 AE69
43.7327 +8C83 AE6A
43.7328 +8C84 AE6B
43.7329 +8C85 AE6C
43.7330 +8C86 AE6D
43.7331 +8C87 AE6E
43.7332 +8C88 AE6F
43.7333 +8C89 AE70
43.7334 +8C8A AE71
43.7335 +8C8B AE72
43.7336 +8C8C AE73
43.7337 +8C8D AE74
43.7338 +8C8E AE75
43.7339 +8C8F AE76
43.7340 +8C90 AE77
43.7341 +8C91 AE78
43.7342 +8C93 AE79
43.7343 +8C94 AE7A
43.7344 +8C95 AE7B
43.7345 +8C96 AE7C
43.7346 +8C97 AE7D
43.7347 +8C98 AE7E
43.7348 +8C99 AE7F
43.7349 +8C9A AE80
43.7350 +8C9B AE81
43.7351 +8C9C AE82
43.7352 +8C9D AE83
43.7353 +8CA1 AE84
43.7354 +8CA2 AE85
43.7355 +8CA3 AE86
43.7356 +8CA4 AE87
43.7357 +8CA5 AE88
43.7358 +8CA6 AE89
43.7359 +8CA7 AE8A
43.7360 +8CA8 AE8B
43.7361 +8CA9 AE8C
43.7362 +8CAA AE8D
43.7363 +8CAB AE8E
43.7364 +8CAC AE8F
43.7365 +8CAD AE90
43.7366 +8CAE AE91
43.7367 +8CAF AE92
43.7368 +8CB0 AE93
43.7369 +8CB1 AE94
43.7370 +8CB3 AE95
43.7371 +8CB4 AE96
43.7372 +8CB5 AE97
43.7373 +8CB6 AE98
43.7374 +8CB7 AE99
43.7375 +8CB8 AE9A
43.7376 +8CB9 AE9B
43.7377 +8CBA AE9C
43.7378 +8CBB AE9D
43.7379 +8CBC AE9E
43.7380 +8CBD AE9F
43.7381 +8CC1 AEA0
43.7382 +8CC2 AEA1
43.7383 +8CC3 AEA2
43.7384 +8CC4 AEA3
43.7385 +8CC5 AEA4
43.7386 +8CC6 AEA5
43.7387 +8CC7 AEA6
43.7388 +8CC8 AEA7
43.7389 +8CC9 AEA8
43.7390 +8CCA AEA9
43.7391 +8CCB AEAA
43.7392 +8CCC AEAB
43.7393 +8CCD AEAC
43.7394 +8CCE AEAD
43.7395 +8CCF AEAE
43.7396 +8CD0 AEAF
43.7397 +8CD1 AEB0
43.7398 +8CD3 AEB1
43.7399 +8CD4 AEB2
43.7400 +8CD5 AEB3
43.7401 +8CD6 AEB4
43.7402 +8CD7 AEB5
43.7403 +8CD8 AEB6
43.7404 +8CD9 AEB7
43.7405 +8CDA AEB8
43.7406 +8CDB AEB9
43.7407 +8CDC AEBA
43.7408 +8CDD AEBB
43.7409 +8CE1 AEBC
43.7410 +8CE2 AEBD
43.7411 +8CE3 AEBE
43.7412 +8CE4 AEBF
43.7413 +8CE5 AEC0
43.7414 +8CE6 AEC1
43.7415 +8CE7 AEC2
43.7416 +8CE8 AEC3
43.7417 +8CE9 AEC4
43.7418 +8CEA AEC5
43.7419 +8CEB AEC6
43.7420 +8CEC AEC7
43.7421 +8CED AEC8
43.7422 +8CEE AEC9
43.7423 +8CEF AECA
43.7424 +8CF0 AECB
43.7425 +8CF1 AECC
43.7426 +8CF3 AECD
43.7427 +8CF4 AECE
43.7428 +8CF5 AECF
43.7429 +8CF6 AED0
43.7430 +8CF7 AED1
43.7431 +8CF8 AED2
43.7432 +8CF9 AED3
43.7433 +8CFA AED4
43.7434 +8CFB AED5
43.7435 +8CFC AED6
43.7436 +8CFD AED7
43.7437 +8D41 AED8
43.7438 +8D42 AED9
43.7439 +8D43 AEDA
43.7440 +8D44 AEDB
43.7441 +8D45 AEDC
43.7442 +8D46 AEDD
43.7443 +8D47 AEDE
43.7444 +8D48 AEDF
43.7445 +8D49 AEE0
43.7446 +8D4A AEE1
43.7447 +8D4B AEE2
43.7448 +8D4C AEE3
43.7449 +8D4D AEE4
43.7450 +8D4E AEE5
43.7451 +8D4F AEE6
43.7452 +8D50 AEE7
43.7453 +8D51 AEE8
43.7454 +8D53 AEE9
43.7455 +8D54 AEEA
43.7456 +8D55 AEEB
43.7457 +8D56 AEEC
43.7458 +8D57 AEED
43.7459 +8D58 AEEE
43.7460 +8D59 AEEF
43.7461 +8D5A AEF0
43.7462 +8D5B AEF1
43.7463 +8D5C AEF2
43.7464 +8D5D AEF3
43.7465 +8D61 AEF4
43.7466 +8D62 AEF5
43.7467 +8D63 AEF6
43.7468 +8D64 AEF7
43.7469 +8D65 AEF8
43.7470 +8D66 AEF9
43.7471 +8D67 AEFA
43.7472 +8D68 AEFB
43.7473 +8D69 AEFC
43.7474 +8D6A AEFD
43.7475 +8D6B AEFE
43.7476 +8D6C AEFF
43.7477 +8D6D AF00
43.7478 +8D6E AF01
43.7479 +8D6F AF02
43.7480 +8D70 AF03
43.7481 +8D71 AF04
43.7482 +8D73 AF05
43.7483 +8D74 AF06
43.7484 +8D75 AF07
43.7485 +8D76 AF08
43.7486 +8D77 AF09
43.7487 +8D78 AF0A
43.7488 +8D79 AF0B
43.7489 +8D7A AF0C
43.7490 +8D7B AF0D
43.7491 +8D7C AF0E
43.7492 +8D7D AF0F
43.7493 +8D81 AF10
43.7494 +8D82 AF11
43.7495 +8D83 AF12
43.7496 +8D84 AF13
43.7497 +8D85 AF14
43.7498 +8D86 AF15
43.7499 +8D87 AF16
43.7500 +8D88 AF17
43.7501 +8D89 AF18
43.7502 +8D8A AF19
43.7503 +8D8B AF1A
43.7504 +8D8C AF1B
43.7505 +8D8D AF1C
43.7506 +8D8E AF1D
43.7507 +8D8F AF1E
43.7508 +8D90 AF1F
43.7509 +8D91 AF20
43.7510 +8D93 AF21
43.7511 +8D94 AF22
43.7512 +8D95 AF23
43.7513 +8D96 AF24
43.7514 +8D97 AF25
43.7515 +8D98 AF26
43.7516 +8D99 AF27
43.7517 +8D9A AF28
43.7518 +8D9B AF29
43.7519 +8D9C AF2A
43.7520 +8D9D AF2B
43.7521 +8DA1 AF2C
43.7522 +8DA2 AF2D
43.7523 +8DA3 AF2E
43.7524 +8DA4 AF2F
43.7525 +8DA5 AF30
43.7526 +8DA6 AF31
43.7527 +8DA7 AF32
43.7528 +8DA8 AF33
43.7529 +8DA9 AF34
43.7530 +8DAA AF35
43.7531 +8DAB AF36
43.7532 +8DAC AF37
43.7533 +8DAD AF38
43.7534 +8DAE AF39
43.7535 +8DAF AF3A
43.7536 +8DB0 AF3B
43.7537 +8DB1 AF3C
43.7538 +8DB3 AF3D
43.7539 +8DB4 AF3E
43.7540 +8DB5 AF3F
43.7541 +8DB6 AF40
43.7542 +8DB7 AF41
43.7543 +8DB8 AF42
43.7544 +8DB9 AF43
43.7545 +8DBA AF44
43.7546 +8DBB AF45
43.7547 +8DBC AF46
43.7548 +8DBD AF47
43.7549 +8DC1 AF48
43.7550 +8DC2 AF49
43.7551 +8DC3 AF4A
43.7552 +8DC4 AF4B
43.7553 +8DC5 AF4C
43.7554 +8DC6 AF4D
43.7555 +8DC7 AF4E
43.7556 +8DC8 AF4F
43.7557 +8DC9 AF50
43.7558 +8DCA AF51
43.7559 +8DCB AF52
43.7560 +8DCC AF53
43.7561 +8DCD AF54
43.7562 +8DCE AF55
43.7563 +8DCF AF56
43.7564 +8DD0 AF57
43.7565 +8DD1 AF58
43.7566 +8DD3 AF59
43.7567 +8DD4 AF5A
43.7568 +8DD5 AF5B
43.7569 +8DD6 AF5C
43.7570 +8DD7 AF5D
43.7571 +8DD8 AF5E
43.7572 +8DD9 AF5F
43.7573 +8DDA AF60
43.7574 +8DDB AF61
43.7575 +8DDC AF62
43.7576 +8DDD AF63
43.7577 +8DE1 AF64
43.7578 +8DE2 AF65
43.7579 +8DE3 AF66
43.7580 +8DE4 AF67
43.7581 +8DE5 AF68
43.7582 +8DE6 AF69
43.7583 +8DE7 AF6A
43.7584 +8DE8 AF6B
43.7585 +8DE9 AF6C
43.7586 +8DEA AF6D
43.7587 +8DEB AF6E
43.7588 +8DEC AF6F
43.7589 +8DED AF70
43.7590 +8DEE AF71
43.7591 +8DEF AF72
43.7592 +8DF0 AF73
43.7593 +8DF1 AF74
43.7594 +8DF3 AF75
43.7595 +8DF4 AF76
43.7596 +8DF5 AF77
43.7597 +8DF6 AF78
43.7598 +8DF7 AF79
43.7599 +8DF8 AF7A
43.7600 +8DF9 AF7B
43.7601 +8DFA AF7C
43.7602 +8DFB AF7D
43.7603 +8DFC AF7E
43.7604 +8DFD AF7F
43.7605 +8E41 AF80
43.7606 +8E42 AF81
43.7607 +8E43 AF82
43.7608 +8E44 AF83
43.7609 +8E45 AF84
43.7610 +8E46 AF85
43.7611 +8E47 AF86
43.7612 +8E48 AF87
43.7613 +8E49 AF88
43.7614 +8E4A AF89
43.7615 +8E4B AF8A
43.7616 +8E4C AF8B
43.7617 +8E4D AF8C
43.7618 +8E4E AF8D
43.7619 +8E4F AF8E
43.7620 +8E50 AF8F
43.7621 +8E51 AF90
43.7622 +8E53 AF91
43.7623 +8E54 AF92
43.7624 +8E55 AF93
43.7625 +8E56 AF94
43.7626 +8E57 AF95
43.7627 +8E58 AF96
43.7628 +8E59 AF97
43.7629 +8E5A AF98
43.7630 +8E5B AF99
43.7631 +8E5C AF9A
43.7632 +8E5D AF9B
43.7633 +8E61 AF9C
43.7634 +8E62 AF9D
43.7635 +8E63 AF9E
43.7636 +8E64 AF9F
43.7637 +8E65 AFA0
43.7638 +8E66 AFA1
43.7639 +8E67 AFA2
43.7640 +8E68 AFA3
43.7641 +8E69 AFA4
43.7642 +8E6A AFA5
43.7643 +8E6B AFA6
43.7644 +8E6C AFA7
43.7645 +8E6D AFA8
43.7646 +8E6E AFA9
43.7647 +8E6F AFAA
43.7648 +8E70 AFAB
43.7649 +8E71 AFAC
43.7650 +8E73 AFAD
43.7651 +8E74 AFAE
43.7652 +8E75 AFAF
43.7653 +8E76 AFB0
43.7654 +8E77 AFB1
43.7655 +8E78 AFB2
43.7656 +8E79 AFB3
43.7657 +8E7A AFB4
43.7658 +8E7B AFB5
43.7659 +8E7C AFB6
43.7660 +8E7D AFB7
43.7661 +8E81 AFB8
43.7662 +8E82 AFB9
43.7663 +8E83 AFBA
43.7664 +8E84 AFBB
43.7665 +8E85 AFBC
43.7666 +8E86 AFBD
43.7667 +8E87 AFBE
43.7668 +8E88 AFBF
43.7669 +8E89 AFC0
43.7670 +8E8A AFC1
43.7671 +8E8B AFC2
43.7672 +8E8C AFC3
43.7673 +8E8D AFC4
43.7674 +8E8E AFC5
43.7675 +8E8F AFC6
43.7676 +8E90 AFC7
43.7677 +8E91 AFC8
43.7678 +8E93 AFC9
43.7679 +8E94 AFCA
43.7680 +8E95 AFCB
43.7681 +8E96 AFCC
43.7682 +8E97 AFCD
43.7683 +8E98 AFCE
43.7684 +8E99 AFCF
43.7685 +8E9A AFD0
43.7686 +8E9B AFD1
43.7687 +8E9C AFD2
43.7688 +8E9D AFD3
43.7689 +8EA1 AFD4
43.7690 +8EA2 AFD5
43.7691 +8EA3 AFD6
43.7692 +8EA4 AFD7
43.7693 +8EA5 AFD8
43.7694 +8EA6 AFD9
43.7695 +8EA7 AFDA
43.7696 +8EA8 AFDB
43.7697 +8EA9 AFDC
43.7698 +8EAA AFDD
43.7699 +8EAB AFDE
43.7700 +8EAC AFDF
43.7701 +8EAD AFE0
43.7702 +8EAE AFE1
43.7703 +8EAF AFE2
43.7704 +8EB0 AFE3
43.7705 +8EB1 AFE4
43.7706 +8EB3 AFE5
43.7707 +8EB4 AFE6
43.7708 +8EB5 AFE7
43.7709 +8EB6 AFE8
43.7710 +8EB7 AFE9
43.7711 +8EB8 AFEA
43.7712 +8EB9 AFEB
43.7713 +8EBA AFEC
43.7714 +8EBB AFED
43.7715 +8EBC AFEE
43.7716 +8EBD AFEF
43.7717 +8EC1 AFF0
43.7718 +8EC2 AFF1
43.7719 +8EC3 AFF2
43.7720 +8EC4 AFF3
43.7721 +8EC5 AFF4
43.7722 +8EC6 AFF5
43.7723 +8EC7 AFF6
43.7724 +8EC8 AFF7
43.7725 +8EC9 AFF8
43.7726 +8ECA AFF9
43.7727 +8ECB AFFA
43.7728 +8ECC AFFB
43.7729 +8ECD AFFC
43.7730 +8ECE AFFD
43.7731 +8ECF AFFE
43.7732 +8ED0 AFFF
43.7733 +8ED1 B000
43.7734 +8ED3 B001
43.7735 +8ED4 B002
43.7736 +8ED5 B003
43.7737 +8ED6 B004
43.7738 +8ED7 B005
43.7739 +8ED8 B006
43.7740 +8ED9 B007
43.7741 +8EDA B008
43.7742 +8EDB B009
43.7743 +8EDC B00A
43.7744 +8EDD B00B
43.7745 +8EE1 B00C
43.7746 +8EE2 B00D
43.7747 +8EE3 B00E
43.7748 +8EE4 B00F
43.7749 +8EE5 B010
43.7750 +8EE6 B011
43.7751 +8EE7 B012
43.7752 +8EE8 B013
43.7753 +8EE9 B014
43.7754 +8EEA B015
43.7755 +8EEB B016
43.7756 +8EEC B017
43.7757 +8EED B018
43.7758 +8EEE B019
43.7759 +8EEF B01A
43.7760 +8EF0 B01B
43.7761 +8EF1 B01C
43.7762 +8EF3 B01D
43.7763 +8EF4 B01E
43.7764 +8EF5 B01F
43.7765 +8EF6 B020
43.7766 +8EF7 B021
43.7767 +8EF8 B022
43.7768 +8EF9 B023
43.7769 +8EFA B024
43.7770 +8EFB B025
43.7771 +8EFC B026
43.7772 +8EFD B027
43.7773 +8F41 B028
43.7774 +8F42 B029
43.7775 +8F43 B02A
43.7776 +8F44 B02B
43.7777 +8F45 B02C
43.7778 +8F46 B02D
43.7779 +8F47 B02E
43.7780 +8F48 B02F
43.7781 +8F49 B030
43.7782 +8F4A B031
43.7783 +8F4B B032
43.7784 +8F4C B033
43.7785 +8F4D B034
43.7786 +8F4E B035
43.7787 +8F4F B036
43.7788 +8F50 B037
43.7789 +8F51 B038
43.7790 +8F53 B039
43.7791 +8F54 B03A
43.7792 +8F55 B03B
43.7793 +8F56 B03C
43.7794 +8F57 B03D
43.7795 +8F58 B03E
43.7796 +8F59 B03F
43.7797 +8F5A B040
43.7798 +8F5B B041
43.7799 +8F5C B042
43.7800 +8F5D B043
43.7801 +8F61 B044
43.7802 +8F62 B045
43.7803 +8F63 B046
43.7804 +8F64 B047
43.7805 +8F65 B048
43.7806 +8F66 B049
43.7807 +8F67 B04A
43.7808 +8F68 B04B
43.7809 +8F69 B04C
43.7810 +8F6A B04D
43.7811 +8F6B B04E
43.7812 +8F6C B04F
43.7813 +8F6D B050
43.7814 +8F6E B051
43.7815 +8F6F B052
43.7816 +8F70 B053
43.7817 +8F71 B054
43.7818 +8F73 B055
43.7819 +8F74 B056
43.7820 +8F75 B057
43.7821 +8F76 B058
43.7822 +8F77 B059
43.7823 +8F78 B05A
43.7824 +8F79 B05B
43.7825 +8F7A B05C
43.7826 +8F7B B05D
43.7827 +8F7C B05E
43.7828 +8F7D B05F
43.7829 +8F81 B060
43.7830 +8F82 B061
43.7831 +8F83 B062
43.7832 +8F84 B063
43.7833 +8F85 B064
43.7834 +8F86 B065
43.7835 +8F87 B066
43.7836 +8F88 B067
43.7837 +8F89 B068
43.7838 +8F8A B069
43.7839 +8F8B B06A
43.7840 +8F8C B06B
43.7841 +8F8D B06C
43.7842 +8F8E B06D
43.7843 +8F8F B06E
43.7844 +8F90 B06F
43.7845 +8F91 B070
43.7846 +8F93 B071
43.7847 +8F94 B072
43.7848 +8F95 B073
43.7849 +8F96 B074
43.7850 +8F97 B075
43.7851 +8F98 B076
43.7852 +8F99 B077
43.7853 +8F9A B078
43.7854 +8F9B B079
43.7855 +8F9C B07A
43.7856 +8F9D B07B
43.7857 +8FA1 B07C
43.7858 +8FA2 B07D
43.7859 +8FA3 B07E
43.7860 +8FA4 B07F
43.7861 +8FA5 B080
43.7862 +8FA6 B081
43.7863 +8FA7 B082
43.7864 +8FA8 B083
43.7865 +8FA9 B084
43.7866 +8FAA B085
43.7867 +8FAB B086
43.7868 +8FAC B087
43.7869 +8FAD B088
43.7870 +8FAE B089
43.7871 +8FAF B08A
43.7872 +8FB0 B08B
43.7873 +8FB1 B08C
43.7874 +8FB3 B08D
43.7875 +8FB4 B08E
43.7876 +8FB5 B08F
43.7877 +8FB6 B090
43.7878 +8FB7 B091
43.7879 +8FB8 B092
43.7880 +8FB9 B093
43.7881 +8FBA B094
43.7882 +8FBB B095
43.7883 +8FBC B096
43.7884 +8FBD B097
43.7885 +9041 3134
43.7886 +9061 B098
43.7887 +9062 B099
43.7888 +9063 B09A
43.7889 +9064 B09B
43.7890 +9065 B09C
43.7891 +9066 B09D
43.7892 +9067 B09E
43.7893 +9068 B09F
43.7894 +9069 B0A0
43.7895 +906A B0A1
43.7896 +906B B0A2
43.7897 +906C B0A3
43.7898 +906D B0A4
43.7899 +906E B0A5
43.7900 +906F B0A6
43.7901 +9070 B0A7
43.7902 +9071 B0A8
43.7903 +9073 B0A9
43.7904 +9074 B0AA
43.7905 +9075 B0AB
43.7906 +9076 B0AC
43.7907 +9077 B0AD
43.7908 +9078 B0AE
43.7909 +9079 B0AF
43.7910 +907A B0B0
43.7911 +907B B0B1
43.7912 +907C B0B2
43.7913 +907D B0B3
43.7914 +9081 B0B4
43.7915 +9082 B0B5
43.7916 +9083 B0B6
43.7917 +9084 B0B7
43.7918 +9085 B0B8
43.7919 +9086 B0B9
43.7920 +9087 B0BA
43.7921 +9088 B0BB
43.7922 +9089 B0BC
43.7923 +908A B0BD
43.7924 +908B B0BE
43.7925 +908C B0BF
43.7926 +908D B0C0
43.7927 +908E B0C1
43.7928 +908F B0C2
43.7929 +9090 B0C3
43.7930 +9091 B0C4
43.7931 +9093 B0C5
43.7932 +9094 B0C6
43.7933 +9095 B0C7
43.7934 +9096 B0C8
43.7935 +9097 B0C9
43.7936 +9098 B0CA
43.7937 +9099 B0CB
43.7938 +909A B0CC
43.7939 +909B B0CD
43.7940 +909C B0CE
43.7941 +909D B0CF
43.7942 +90A1 B0D0
43.7943 +90A2 B0D1
43.7944 +90A3 B0D2
43.7945 +90A4 B0D3
43.7946 +90A5 B0D4
43.7947 +90A6 B0D5
43.7948 +90A7 B0D6
43.7949 +90A8 B0D7
43.7950 +90A9 B0D8
43.7951 +90AA B0D9
43.7952 +90AB B0DA
43.7953 +90AC B0DB
43.7954 +90AD B0DC
43.7955 +90AE B0DD
43.7956 +90AF B0DE
43.7957 +90B0 B0DF
43.7958 +90B1 B0E0
43.7959 +90B3 B0E1
43.7960 +90B4 B0E2
43.7961 +90B5 B0E3
43.7962 +90B6 B0E4
43.7963 +90B7 B0E5
43.7964 +90B8 B0E6
43.7965 +90B9 B0E7
43.7966 +90BA B0E8
43.7967 +90BB B0E9
43.7968 +90BC B0EA
43.7969 +90BD B0EB
43.7970 +90C1 B0EC
43.7971 +90C2 B0ED
43.7972 +90C3 B0EE
43.7973 +90C4 B0EF
43.7974 +90C5 B0F0
43.7975 +90C6 B0F1
43.7976 +90C7 B0F2
43.7977 +90C8 B0F3
43.7978 +90C9 B0F4
43.7979 +90CA B0F5
43.7980 +90CB B0F6
43.7981 +90CC B0F7
43.7982 +90CD B0F8
43.7983 +90CE B0F9
43.7984 +90CF B0FA
43.7985 +90D0 B0FB
43.7986 +90D1 B0FC
43.7987 +90D3 B0FD
43.7988 +90D4 B0FE
43.7989 +90D5 B0FF
43.7990 +90D6 B100
43.7991 +90D7 B101
43.7992 +90D8 B102
43.7993 +90D9 B103
43.7994 +90DA B104
43.7995 +90DB B105
43.7996 +90DC B106
43.7997 +90DD B107
43.7998 +90E1 B108
43.7999 +90E2 B109
43.8000 +90E3 B10A
43.8001 +90E4 B10B
43.8002 +90E5 B10C
43.8003 +90E6 B10D
43.8004 +90E7 B10E
43.8005 +90E8 B10F
43.8006 +90E9 B110
43.8007 +90EA B111
43.8008 +90EB B112
43.8009 +90EC B113
43.8010 +90ED B114
43.8011 +90EE B115
43.8012 +90EF B116
43.8013 +90F0 B117
43.8014 +90F1 B118
43.8015 +90F3 B119
43.8016 +90F4 B11A
43.8017 +90F5 B11B
43.8018 +90F6 B11C
43.8019 +90F7 B11D
43.8020 +90F8 B11E
43.8021 +90F9 B11F
43.8022 +90FA B120
43.8023 +90FB B121
43.8024 +90FC B122
43.8025 +90FD B123
43.8026 +9141 B124
43.8027 +9142 B125
43.8028 +9143 B126
43.8029 +9144 B127
43.8030 +9145 B128
43.8031 +9146 B129
43.8032 +9147 B12A
43.8033 +9148 B12B
43.8034 +9149 B12C
43.8035 +914A B12D
43.8036 +914B B12E
43.8037 +914C B12F
43.8038 +914D B130
43.8039 +914E B131
43.8040 +914F B132
43.8041 +9150 B133
43.8042 +9151 B134
43.8043 +9153 B135
43.8044 +9154 B136
43.8045 +9155 B137
43.8046 +9156 B138
43.8047 +9157 B139
43.8048 +9158 B13A
43.8049 +9159 B13B
43.8050 +915A B13C
43.8051 +915B B13D
43.8052 +915C B13E
43.8053 +915D B13F
43.8054 +9161 B140
43.8055 +9162 B141
43.8056 +9163 B142
43.8057 +9164 B143
43.8058 +9165 B144
43.8059 +9166 B145
43.8060 +9167 B146
43.8061 +9168 B147
43.8062 +9169 B148
43.8063 +916A B149
43.8064 +916B B14A
43.8065 +916C B14B
43.8066 +916D B14C
43.8067 +916E B14D
43.8068 +916F B14E
43.8069 +9170 B14F
43.8070 +9171 B150
43.8071 +9173 B151
43.8072 +9174 B152
43.8073 +9175 B153
43.8074 +9176 B154
43.8075 +9177 B155
43.8076 +9178 B156
43.8077 +9179 B157
43.8078 +917A B158
43.8079 +917B B159
43.8080 +917C B15A
43.8081 +917D B15B
43.8082 +9181 B15C
43.8083 +9182 B15D
43.8084 +9183 B15E
43.8085 +9184 B15F
43.8086 +9185 B160
43.8087 +9186 B161
43.8088 +9187 B162
43.8089 +9188 B163
43.8090 +9189 B164
43.8091 +918A B165
43.8092 +918B B166
43.8093 +918C B167
43.8094 +918D B168
43.8095 +918E B169
43.8096 +918F B16A
43.8097 +9190 B16B
43.8098 +9191 B16C
43.8099 +9193 B16D
43.8100 +9194 B16E
43.8101 +9195 B16F
43.8102 +9196 B170
43.8103 +9197 B171
43.8104 +9198 B172
43.8105 +9199 B173
43.8106 +919A B174
43.8107 +919B B175
43.8108 +919C B176
43.8109 +919D B177
43.8110 +91A1 B178
43.8111 +91A2 B179
43.8112 +91A3 B17A
43.8113 +91A4 B17B
43.8114 +91A5 B17C
43.8115 +91A6 B17D
43.8116 +91A7 B17E
43.8117 +91A8 B17F
43.8118 +91A9 B180
43.8119 +91AA B181
43.8120 +91AB B182
43.8121 +91AC B183
43.8122 +91AD B184
43.8123 +91AE B185
43.8124 +91AF B186
43.8125 +91B0 B187
43.8126 +91B1 B188
43.8127 +91B3 B189
43.8128 +91B4 B18A
43.8129 +91B5 B18B
43.8130 +91B6 B18C
43.8131 +91B7 B18D
43.8132 +91B8 B18E
43.8133 +91B9 B18F
43.8134 +91BA B190
43.8135 +91BB B191
43.8136 +91BC B192
43.8137 +91BD B193
43.8138 +91C1 B194
43.8139 +91C2 B195
43.8140 +91C3 B196
43.8141 +91C4 B197
43.8142 +91C5 B198
43.8143 +91C6 B199
43.8144 +91C7 B19A
43.8145 +91C8 B19B
43.8146 +91C9 B19C
43.8147 +91CA B19D
43.8148 +91CB B19E
43.8149 +91CC B19F
43.8150 +91CD B1A0
43.8151 +91CE B1A1
43.8152 +91CF B1A2
43.8153 +91D0 B1A3
43.8154 +91D1 B1A4
43.8155 +91D3 B1A5
43.8156 +91D4 B1A6
43.8157 +91D5 B1A7
43.8158 +91D6 B1A8
43.8159 +91D7 B1A9
43.8160 +91D8 B1AA
43.8161 +91D9 B1AB
43.8162 +91DA B1AC
43.8163 +91DB B1AD
43.8164 +91DC B1AE
43.8165 +91DD B1AF
43.8166 +91E1 B1B0
43.8167 +91E2 B1B1
43.8168 +91E3 B1B2
43.8169 +91E4 B1B3
43.8170 +91E5 B1B4
43.8171 +91E6 B1B5
43.8172 +91E7 B1B6
43.8173 +91E8 B1B7
43.8174 +91E9 B1B8
43.8175 +91EA B1B9
43.8176 +91EB B1BA
43.8177 +91EC B1BB
43.8178 +91ED B1BC
43.8179 +91EE B1BD
43.8180 +91EF B1BE
43.8181 +91F0 B1BF
43.8182 +91F1 B1C0
43.8183 +91F3 B1C1
43.8184 +91F4 B1C2
43.8185 +91F5 B1C3
43.8186 +91F6 B1C4
43.8187 +91F7 B1C5
43.8188 +91F8 B1C6
43.8189 +91F9 B1C7
43.8190 +91FA B1C8
43.8191 +91FB B1C9
43.8192 +91FC B1CA
43.8193 +91FD B1CB
43.8194 +9241 B1CC
43.8195 +9242 B1CD
43.8196 +9243 B1CE
43.8197 +9244 B1CF
43.8198 +9245 B1D0
43.8199 +9246 B1D1
43.8200 +9247 B1D2
43.8201 +9248 B1D3
43.8202 +9249 B1D4
43.8203 +924A B1D5
43.8204 +924B B1D6
43.8205 +924C B1D7
43.8206 +924D B1D8
43.8207 +924E B1D9
43.8208 +924F B1DA
43.8209 +9250 B1DB
43.8210 +9251 B1DC
43.8211 +9253 B1DD
43.8212 +9254 B1DE
43.8213 +9255 B1DF
43.8214 +9256 B1E0
43.8215 +9257 B1E1
43.8216 +9258 B1E2
43.8217 +9259 B1E3
43.8218 +925A B1E4
43.8219 +925B B1E5
43.8220 +925C B1E6
43.8221 +925D B1E7
43.8222 +9261 B1E8
43.8223 +9262 B1E9
43.8224 +9263 B1EA
43.8225 +9264 B1EB
43.8226 +9265 B1EC
43.8227 +9266 B1ED
43.8228 +9267 B1EE
43.8229 +9268 B1EF
43.8230 +9269 B1F0
43.8231 +926A B1F1
43.8232 +926B B1F2
43.8233 +926C B1F3
43.8234 +926D B1F4
43.8235 +926E B1F5
43.8236 +926F B1F6
43.8237 +9270 B1F7
43.8238 +9271 B1F8
43.8239 +9273 B1F9
43.8240 +9274 B1FA
43.8241 +9275 B1FB
43.8242 +9276 B1FC
43.8243 +9277 B1FD
43.8244 +9278 B1FE
43.8245 +9279 B1FF
43.8246 +927A B200
43.8247 +927B B201
43.8248 +927C B202
43.8249 +927D B203
43.8250 +9281 B204
43.8251 +9282 B205
43.8252 +9283 B206
43.8253 +9284 B207
43.8254 +9285 B208
43.8255 +9286 B209
43.8256 +9287 B20A
43.8257 +9288 B20B
43.8258 +9289 B20C
43.8259 +928A B20D
43.8260 +928B B20E
43.8261 +928C B20F
43.8262 +928D B210
43.8263 +928E B211
43.8264 +928F B212
43.8265 +9290 B213
43.8266 +9291 B214
43.8267 +9293 B215
43.8268 +9294 B216
43.8269 +9295 B217
43.8270 +9296 B218
43.8271 +9297 B219
43.8272 +9298 B21A
43.8273 +9299 B21B
43.8274 +929A B21C
43.8275 +929B B21D
43.8276 +929C B21E
43.8277 +929D B21F
43.8278 +92A1 B220
43.8279 +92A2 B221
43.8280 +92A3 B222
43.8281 +92A4 B223
43.8282 +92A5 B224
43.8283 +92A6 B225
43.8284 +92A7 B226
43.8285 +92A8 B227
43.8286 +92A9 B228
43.8287 +92AA B229
43.8288 +92AB B22A
43.8289 +92AC B22B
43.8290 +92AD B22C
43.8291 +92AE B22D
43.8292 +92AF B22E
43.8293 +92B0 B22F
43.8294 +92B1 B230
43.8295 +92B3 B231
43.8296 +92B4 B232
43.8297 +92B5 B233
43.8298 +92B6 B234
43.8299 +92B7 B235
43.8300 +92B8 B236
43.8301 +92B9 B237
43.8302 +92BA B238
43.8303 +92BB B239
43.8304 +92BC B23A
43.8305 +92BD B23B
43.8306 +92C1 B23C
43.8307 +92C2 B23D
43.8308 +92C3 B23E
43.8309 +92C4 B23F
43.8310 +92C5 B240
43.8311 +92C6 B241
43.8312 +92C7 B242
43.8313 +92C8 B243
43.8314 +92C9 B244
43.8315 +92CA B245
43.8316 +92CB B246
43.8317 +92CC B247
43.8318 +92CD B248
43.8319 +92CE B249
43.8320 +92CF B24A
43.8321 +92D0 B24B
43.8322 +92D1 B24C
43.8323 +92D3 B24D
43.8324 +92D4 B24E
43.8325 +92D5 B24F
43.8326 +92D6 B250
43.8327 +92D7 B251
43.8328 +92D8 B252
43.8329 +92D9 B253
43.8330 +92DA B254
43.8331 +92DB B255
43.8332 +92DC B256
43.8333 +92DD B257
43.8334 +92E1 B258
43.8335 +92E2 B259
43.8336 +92E3 B25A
43.8337 +92E4 B25B
43.8338 +92E5 B25C
43.8339 +92E6 B25D
43.8340 +92E7 B25E
43.8341 +92E8 B25F
43.8342 +92E9 B260
43.8343 +92EA B261
43.8344 +92EB B262
43.8345 +92EC B263
43.8346 +92ED B264
43.8347 +92EE B265
43.8348 +92EF B266
43.8349 +92F0 B267
43.8350 +92F1 B268
43.8351 +92F3 B269
43.8352 +92F4 B26A
43.8353 +92F5 B26B
43.8354 +92F6 B26C
43.8355 +92F7 B26D
43.8356 +92F8 B26E
43.8357 +92F9 B26F
43.8358 +92FA B270
43.8359 +92FB B271
43.8360 +92FC B272
43.8361 +92FD B273
43.8362 +9341 B274
43.8363 +9342 B275
43.8364 +9343 B276
43.8365 +9344 B277
43.8366 +9345 B278
43.8367 +9346 B279
43.8368 +9347 B27A
43.8369 +9348 B27B
43.8370 +9349 B27C
43.8371 +934A B27D
43.8372 +934B B27E
43.8373 +934C B27F
43.8374 +934D B280
43.8375 +934E B281
43.8376 +934F B282
43.8377 +9350 B283
43.8378 +9351 B284
43.8379 +9353 B285
43.8380 +9354 B286
43.8381 +9355 B287
43.8382 +9356 B288
43.8383 +9357 B289
43.8384 +9358 B28A
43.8385 +9359 B28B
43.8386 +935A B28C
43.8387 +935B B28D
43.8388 +935C B28E
43.8389 +935D B28F
43.8390 +9361 B290
43.8391 +9362 B291
43.8392 +9363 B292
43.8393 +9364 B293
43.8394 +9365 B294
43.8395 +9366 B295
43.8396 +9367 B296
43.8397 +9368 B297
43.8398 +9369 B298
43.8399 +936A B299
43.8400 +936B B29A
43.8401 +936C B29B
43.8402 +936D B29C
43.8403 +936E B29D
43.8404 +936F B29E
43.8405 +9370 B29F
43.8406 +9371 B2A0
43.8407 +9373 B2A1
43.8408 +9374 B2A2
43.8409 +9375 B2A3
43.8410 +9376 B2A4
43.8411 +9377 B2A5
43.8412 +9378 B2A6
43.8413 +9379 B2A7
43.8414 +937A B2A8
43.8415 +937B B2A9
43.8416 +937C B2AA
43.8417 +937D B2AB
43.8418 +9381 B2AC
43.8419 +9382 B2AD
43.8420 +9383 B2AE
43.8421 +9384 B2AF
43.8422 +9385 B2B0
43.8423 +9386 B2B1
43.8424 +9387 B2B2
43.8425 +9388 B2B3
43.8426 +9389 B2B4
43.8427 +938A B2B5
43.8428 +938B B2B6
43.8429 +938C B2B7
43.8430 +938D B2B8
43.8431 +938E B2B9
43.8432 +938F B2BA
43.8433 +9390 B2BB
43.8434 +9391 B2BC
43.8435 +9393 B2BD
43.8436 +9394 B2BE
43.8437 +9395 B2BF
43.8438 +9396 B2C0
43.8439 +9397 B2C1
43.8440 +9398 B2C2
43.8441 +9399 B2C3
43.8442 +939A B2C4
43.8443 +939B B2C5
43.8444 +939C B2C6
43.8445 +939D B2C7
43.8446 +93A1 B2C8
43.8447 +93A2 B2C9
43.8448 +93A3 B2CA
43.8449 +93A4 B2CB
43.8450 +93A5 B2CC
43.8451 +93A6 B2CD
43.8452 +93A7 B2CE
43.8453 +93A8 B2CF
43.8454 +93A9 B2D0
43.8455 +93AA B2D1
43.8456 +93AB B2D2
43.8457 +93AC B2D3
43.8458 +93AD B2D4
43.8459 +93AE B2D5
43.8460 +93AF B2D6
43.8461 +93B0 B2D7
43.8462 +93B1 B2D8
43.8463 +93B3 B2D9
43.8464 +93B4 B2DA
43.8465 +93B5 B2DB
43.8466 +93B6 B2DC
43.8467 +93B7 B2DD
43.8468 +93B8 B2DE
43.8469 +93B9 B2DF
43.8470 +93BA B2E0
43.8471 +93BB B2E1
43.8472 +93BC B2E2
43.8473 +93BD B2E3
43.8474 +9441 3137
43.8475 +9461 B2E4
43.8476 +9462 B2E5
43.8477 +9463 B2E6
43.8478 +9464 B2E7
43.8479 +9465 B2E8
43.8480 +9466 B2E9
43.8481 +9467 B2EA
43.8482 +9468 B2EB
43.8483 +9469 B2EC
43.8484 +946A B2ED
43.8485 +946B B2EE
43.8486 +946C B2EF
43.8487 +946D B2F0
43.8488 +946E B2F1
43.8489 +946F B2F2
43.8490 +9470 B2F3
43.8491 +9471 B2F4
43.8492 +9473 B2F5
43.8493 +9474 B2F6
43.8494 +9475 B2F7
43.8495 +9476 B2F8
43.8496 +9477 B2F9
43.8497 +9478 B2FA
43.8498 +9479 B2FB
43.8499 +947A B2FC
43.8500 +947B B2FD
43.8501 +947C B2FE
43.8502 +947D B2FF
43.8503 +9481 B300
43.8504 +9482 B301
43.8505 +9483 B302
43.8506 +9484 B303
43.8507 +9485 B304
43.8508 +9486 B305
43.8509 +9487 B306
43.8510 +9488 B307
43.8511 +9489 B308
43.8512 +948A B309
43.8513 +948B B30A
43.8514 +948C B30B
43.8515 +948D B30C
43.8516 +948E B30D
43.8517 +948F B30E
43.8518 +9490 B30F
43.8519 +9491 B310
43.8520 +9493 B311
43.8521 +9494 B312
43.8522 +9495 B313
43.8523 +9496 B314
43.8524 +9497 B315
43.8525 +9498 B316
43.8526 +9499 B317
43.8527 +949A B318
43.8528 +949B B319
43.8529 +949C B31A
43.8530 +949D B31B
43.8531 +94A1 B31C
43.8532 +94A2 B31D
43.8533 +94A3 B31E
43.8534 +94A4 B31F
43.8535 +94A5 B320
43.8536 +94A6 B321
43.8537 +94A7 B322
43.8538 +94A8 B323
43.8539 +94A9 B324
43.8540 +94AA B325
43.8541 +94AB B326
43.8542 +94AC B327
43.8543 +94AD B328
43.8544 +94AE B329
43.8545 +94AF B32A
43.8546 +94B0 B32B
43.8547 +94B1 B32C
43.8548 +94B3 B32D
43.8549 +94B4 B32E
43.8550 +94B5 B32F
43.8551 +94B6 B330
43.8552 +94B7 B331
43.8553 +94B8 B332
43.8554 +94B9 B333
43.8555 +94BA B334
43.8556 +94BB B335
43.8557 +94BC B336
43.8558 +94BD B337
43.8559 +94C1 B338
43.8560 +94C2 B339
43.8561 +94C3 B33A
43.8562 +94C4 B33B
43.8563 +94C5 B33C
43.8564 +94C6 B33D
43.8565 +94C7 B33E
43.8566 +94C8 B33F
43.8567 +94C9 B340
43.8568 +94CA B341
43.8569 +94CB B342
43.8570 +94CC B343
43.8571 +94CD B344
43.8572 +94CE B345
43.8573 +94CF B346
43.8574 +94D0 B347
43.8575 +94D1 B348
43.8576 +94D3 B349
43.8577 +94D4 B34A
43.8578 +94D5 B34B
43.8579 +94D6 B34C
43.8580 +94D7 B34D
43.8581 +94D8 B34E
43.8582 +94D9 B34F
43.8583 +94DA B350
43.8584 +94DB B351
43.8585 +94DC B352
43.8586 +94DD B353
43.8587 +94E1 B354
43.8588 +94E2 B355
43.8589 +94E3 B356
43.8590 +94E4 B357
43.8591 +94E5 B358
43.8592 +94E6 B359
43.8593 +94E7 B35A
43.8594 +94E8 B35B
43.8595 +94E9 B35C
43.8596 +94EA B35D
43.8597 +94EB B35E
43.8598 +94EC B35F
43.8599 +94ED B360
43.8600 +94EE B361
43.8601 +94EF B362
43.8602 +94F0 B363
43.8603 +94F1 B364
43.8604 +94F3 B365
43.8605 +94F4 B366
43.8606 +94F5 B367
43.8607 +94F6 B368
43.8608 +94F7 B369
43.8609 +94F8 B36A
43.8610 +94F9 B36B
43.8611 +94FA B36C
43.8612 +94FB B36D
43.8613 +94FC B36E
43.8614 +94FD B36F
43.8615 +9541 B370
43.8616 +9542 B371
43.8617 +9543 B372
43.8618 +9544 B373
43.8619 +9545 B374
43.8620 +9546 B375
43.8621 +9547 B376
43.8622 +9548 B377
43.8623 +9549 B378
43.8624 +954A B379
43.8625 +954B B37A
43.8626 +954C B37B
43.8627 +954D B37C
43.8628 +954E B37D
43.8629 +954F B37E
43.8630 +9550 B37F
43.8631 +9551 B380
43.8632 +9553 B381
43.8633 +9554 B382
43.8634 +9555 B383
43.8635 +9556 B384
43.8636 +9557 B385
43.8637 +9558 B386
43.8638 +9559 B387
43.8639 +955A B388
43.8640 +955B B389
43.8641 +955C B38A
43.8642 +955D B38B
43.8643 +9561 B38C
43.8644 +9562 B38D
43.8645 +9563 B38E
43.8646 +9564 B38F
43.8647 +9565 B390
43.8648 +9566 B391
43.8649 +9567 B392
43.8650 +9568 B393
43.8651 +9569 B394
43.8652 +956A B395
43.8653 +956B B396
43.8654 +956C B397
43.8655 +956D B398
43.8656 +956E B399
43.8657 +956F B39A
43.8658 +9570 B39B
43.8659 +9571 B39C
43.8660 +9573 B39D
43.8661 +9574 B39E
43.8662 +9575 B39F
43.8663 +9576 B3A0
43.8664 +9577 B3A1
43.8665 +9578 B3A2
43.8666 +9579 B3A3
43.8667 +957A B3A4
43.8668 +957B B3A5
43.8669 +957C B3A6
43.8670 +957D B3A7
43.8671 +9581 B3A8
43.8672 +9582 B3A9
43.8673 +9583 B3AA
43.8674 +9584 B3AB
43.8675 +9585 B3AC
43.8676 +9586 B3AD
43.8677 +9587 B3AE
43.8678 +9588 B3AF
43.8679 +9589 B3B0
43.8680 +958A B3B1
43.8681 +958B B3B2
43.8682 +958C B3B3
43.8683 +958D B3B4
43.8684 +958E B3B5
43.8685 +958F B3B6
43.8686 +9590 B3B7
43.8687 +9591 B3B8
43.8688 +9593 B3B9
43.8689 +9594 B3BA
43.8690 +9595 B3BB
43.8691 +9596 B3BC
43.8692 +9597 B3BD
43.8693 +9598 B3BE
43.8694 +9599 B3BF
43.8695 +959A B3C0
43.8696 +959B B3C1
43.8697 +959C B3C2
43.8698 +959D B3C3
43.8699 +95A1 B3C4
43.8700 +95A2 B3C5
43.8701 +95A3 B3C6
43.8702 +95A4 B3C7
43.8703 +95A5 B3C8
43.8704 +95A6 B3C9
43.8705 +95A7 B3CA
43.8706 +95A8 B3CB
43.8707 +95A9 B3CC
43.8708 +95AA B3CD
43.8709 +95AB B3CE
43.8710 +95AC B3CF
43.8711 +95AD B3D0
43.8712 +95AE B3D1
43.8713 +95AF B3D2
43.8714 +95B0 B3D3
43.8715 +95B1 B3D4
43.8716 +95B3 B3D5
43.8717 +95B4 B3D6
43.8718 +95B5 B3D7
43.8719 +95B6 B3D8
43.8720 +95B7 B3D9
43.8721 +95B8 B3DA
43.8722 +95B9 B3DB
43.8723 +95BA B3DC
43.8724 +95BB B3DD
43.8725 +95BC B3DE
43.8726 +95BD B3DF
43.8727 +95C1 B3E0
43.8728 +95C2 B3E1
43.8729 +95C3 B3E2
43.8730 +95C4 B3E3
43.8731 +95C5 B3E4
43.8732 +95C6 B3E5
43.8733 +95C7 B3E6
43.8734 +95C8 B3E7
43.8735 +95C9 B3E8
43.8736 +95CA B3E9
43.8737 +95CB B3EA
43.8738 +95CC B3EB
43.8739 +95CD B3EC
43.8740 +95CE B3ED
43.8741 +95CF B3EE
43.8742 +95D0 B3EF
43.8743 +95D1 B3F0
43.8744 +95D3 B3F1
43.8745 +95D4 B3F2
43.8746 +95D5 B3F3
43.8747 +95D6 B3F4
43.8748 +95D7 B3F5
43.8749 +95D8 B3F6
43.8750 +95D9 B3F7
43.8751 +95DA B3F8
43.8752 +95DB B3F9
43.8753 +95DC B3FA
43.8754 +95DD B3FB
43.8755 +95E1 B3FC
43.8756 +95E2 B3FD
43.8757 +95E3 B3FE
43.8758 +95E4 B3FF
43.8759 +95E5 B400
43.8760 +95E6 B401
43.8761 +95E7 B402
43.8762 +95E8 B403
43.8763 +95E9 B404
43.8764 +95EA B405
43.8765 +95EB B406
43.8766 +95EC B407
43.8767 +95ED B408
43.8768 +95EE B409
43.8769 +95EF B40A
43.8770 +95F0 B40B
43.8771 +95F1 B40C
43.8772 +95F3 B40D
43.8773 +95F4 B40E
43.8774 +95F5 B40F
43.8775 +95F6 B410
43.8776 +95F7 B411
43.8777 +95F8 B412
43.8778 +95F9 B413
43.8779 +95FA B414
43.8780 +95FB B415
43.8781 +95FC B416
43.8782 +95FD B417
43.8783 +9641 B418
43.8784 +9642 B419
43.8785 +9643 B41A
43.8786 +9644 B41B
43.8787 +9645 B41C
43.8788 +9646 B41D
43.8789 +9647 B41E
43.8790 +9648 B41F
43.8791 +9649 B420
43.8792 +964A B421
43.8793 +964B B422
43.8794 +964C B423
43.8795 +964D B424
43.8796 +964E B425
43.8797 +964F B426
43.8798 +9650 B427
43.8799 +9651 B428
43.8800 +9653 B429
43.8801 +9654 B42A
43.8802 +9655 B42B
43.8803 +9656 B42C
43.8804 +9657 B42D
43.8805 +9658 B42E
43.8806 +9659 B42F
43.8807 +965A B430
43.8808 +965B B431
43.8809 +965C B432
43.8810 +965D B433
43.8811 +9661 B434
43.8812 +9662 B435
43.8813 +9663 B436
43.8814 +9664 B437
43.8815 +9665 B438
43.8816 +9666 B439
43.8817 +9667 B43A
43.8818 +9668 B43B
43.8819 +9669 B43C
43.8820 +966A B43D
43.8821 +966B B43E
43.8822 +966C B43F
43.8823 +966D B440
43.8824 +966E B441
43.8825 +966F B442
43.8826 +9670 B443
43.8827 +9671 B444
43.8828 +9673 B445
43.8829 +9674 B446
43.8830 +9675 B447
43.8831 +9676 B448
43.8832 +9677 B449
43.8833 +9678 B44A
43.8834 +9679 B44B
43.8835 +967A B44C
43.8836 +967B B44D
43.8837 +967C B44E
43.8838 +967D B44F
43.8839 +9681 B450
43.8840 +9682 B451
43.8841 +9683 B452
43.8842 +9684 B453
43.8843 +9685 B454
43.8844 +9686 B455
43.8845 +9687 B456
43.8846 +9688 B457
43.8847 +9689 B458
43.8848 +968A B459
43.8849 +968B B45A
43.8850 +968C B45B
43.8851 +968D B45C
43.8852 +968E B45D
43.8853 +968F B45E
43.8854 +9690 B45F
43.8855 +9691 B460
43.8856 +9693 B461
43.8857 +9694 B462
43.8858 +9695 B463
43.8859 +9696 B464
43.8860 +9697 B465
43.8861 +9698 B466
43.8862 +9699 B467
43.8863 +969A B468
43.8864 +969B B469
43.8865 +969C B46A
43.8866 +969D B46B
43.8867 +96A1 B46C
43.8868 +96A2 B46D
43.8869 +96A3 B46E
43.8870 +96A4 B46F
43.8871 +96A5 B470
43.8872 +96A6 B471
43.8873 +96A7 B472
43.8874 +96A8 B473
43.8875 +96A9 B474
43.8876 +96AA B475
43.8877 +96AB B476
43.8878 +96AC B477
43.8879 +96AD B478
43.8880 +96AE B479
43.8881 +96AF B47A
43.8882 +96B0 B47B
43.8883 +96B1 B47C
43.8884 +96B3 B47D
43.8885 +96B4 B47E
43.8886 +96B5 B47F
43.8887 +96B6 B480
43.8888 +96B7 B481
43.8889 +96B8 B482
43.8890 +96B9 B483
43.8891 +96BA B484
43.8892 +96BB B485
43.8893 +96BC B486
43.8894 +96BD B487
43.8895 +96C1 B488
43.8896 +96C2 B489
43.8897 +96C3 B48A
43.8898 +96C4 B48B
43.8899 +96C5 B48C
43.8900 +96C6 B48D
43.8901 +96C7 B48E
43.8902 +96C8 B48F
43.8903 +96C9 B490
43.8904 +96CA B491
43.8905 +96CB B492
43.8906 +96CC B493
43.8907 +96CD B494
43.8908 +96CE B495
43.8909 +96CF B496
43.8910 +96D0 B497
43.8911 +96D1 B498
43.8912 +96D3 B499
43.8913 +96D4 B49A
43.8914 +96D5 B49B
43.8915 +96D6 B49C
43.8916 +96D7 B49D
43.8917 +96D8 B49E
43.8918 +96D9 B49F
43.8919 +96DA B4A0
43.8920 +96DB B4A1
43.8921 +96DC B4A2
43.8922 +96DD B4A3
43.8923 +96E1 B4A4
43.8924 +96E2 B4A5
43.8925 +96E3 B4A6
43.8926 +96E4 B4A7
43.8927 +96E5 B4A8
43.8928 +96E6 B4A9
43.8929 +96E7 B4AA
43.8930 +96E8 B4AB
43.8931 +96E9 B4AC
43.8932 +96EA B4AD
43.8933 +96EB B4AE
43.8934 +96EC B4AF
43.8935 +96ED B4B0
43.8936 +96EE B4B1
43.8937 +96EF B4B2
43.8938 +96F0 B4B3
43.8939 +96F1 B4B4
43.8940 +96F3 B4B5
43.8941 +96F4 B4B6
43.8942 +96F5 B4B7
43.8943 +96F6 B4B8
43.8944 +96F7 B4B9
43.8945 +96F8 B4BA
43.8946 +96F9 B4BB
43.8947 +96FA B4BC
43.8948 +96FB B4BD
43.8949 +96FC B4BE
43.8950 +96FD B4BF
43.8951 +9741 B4C0
43.8952 +9742 B4C1
43.8953 +9743 B4C2
43.8954 +9744 B4C3
43.8955 +9745 B4C4
43.8956 +9746 B4C5
43.8957 +9747 B4C6
43.8958 +9748 B4C7
43.8959 +9749 B4C8
43.8960 +974A B4C9
43.8961 +974B B4CA
43.8962 +974C B4CB
43.8963 +974D B4CC
43.8964 +974E B4CD
43.8965 +974F B4CE
43.8966 +9750 B4CF
43.8967 +9751 B4D0
43.8968 +9753 B4D1
43.8969 +9754 B4D2
43.8970 +9755 B4D3
43.8971 +9756 B4D4
43.8972 +9757 B4D5
43.8973 +9758 B4D6
43.8974 +9759 B4D7
43.8975 +975A B4D8
43.8976 +975B B4D9
43.8977 +975C B4DA
43.8978 +975D B4DB
43.8979 +9761 B4DC
43.8980 +9762 B4DD
43.8981 +9763 B4DE
43.8982 +9764 B4DF
43.8983 +9765 B4E0
43.8984 +9766 B4E1
43.8985 +9767 B4E2
43.8986 +9768 B4E3
43.8987 +9769 B4E4
43.8988 +976A B4E5
43.8989 +976B B4E6
43.8990 +976C B4E7
43.8991 +976D B4E8
43.8992 +976E B4E9
43.8993 +976F B4EA
43.8994 +9770 B4EB
43.8995 +9771 B4EC
43.8996 +9773 B4ED
43.8997 +9774 B4EE
43.8998 +9775 B4EF
43.8999 +9776 B4F0
43.9000 +9777 B4F1
43.9001 +9778 B4F2
43.9002 +9779 B4F3
43.9003 +977A B4F4
43.9004 +977B B4F5
43.9005 +977C B4F6
43.9006 +977D B4F7
43.9007 +9781 B4F8
43.9008 +9782 B4F9
43.9009 +9783 B4FA
43.9010 +9784 B4FB
43.9011 +9785 B4FC
43.9012 +9786 B4FD
43.9013 +9787 B4FE
43.9014 +9788 B4FF
43.9015 +9789 B500
43.9016 +978A B501
43.9017 +978B B502
43.9018 +978C B503
43.9019 +978D B504
43.9020 +978E B505
43.9021 +978F B506
43.9022 +9790 B507
43.9023 +9791 B508
43.9024 +9793 B509
43.9025 +9794 B50A
43.9026 +9795 B50B
43.9027 +9796 B50C
43.9028 +9797 B50D
43.9029 +9798 B50E
43.9030 +9799 B50F
43.9031 +979A B510
43.9032 +979B B511
43.9033 +979C B512
43.9034 +979D B513
43.9035 +97A1 B514
43.9036 +97A2 B515
43.9037 +97A3 B516
43.9038 +97A4 B517
43.9039 +97A5 B518
43.9040 +97A6 B519
43.9041 +97A7 B51A
43.9042 +97A8 B51B
43.9043 +97A9 B51C
43.9044 +97AA B51D
43.9045 +97AB B51E
43.9046 +97AC B51F
43.9047 +97AD B520
43.9048 +97AE B521
43.9049 +97AF B522
43.9050 +97B0 B523
43.9051 +97B1 B524
43.9052 +97B3 B525
43.9053 +97B4 B526
43.9054 +97B5 B527
43.9055 +97B6 B528
43.9056 +97B7 B529
43.9057 +97B8 B52A
43.9058 +97B9 B52B
43.9059 +97BA B52C
43.9060 +97BB B52D
43.9061 +97BC B52E
43.9062 +97BD B52F
43.9063 +9841 3138
43.9064 +9861 B530
43.9065 +9862 B531
43.9066 +9863 B532
43.9067 +9864 B533
43.9068 +9865 B534
43.9069 +9866 B535
43.9070 +9867 B536
43.9071 +9868 B537
43.9072 +9869 B538
43.9073 +986A B539
43.9074 +986B B53A
43.9075 +986C B53B
43.9076 +986D B53C
43.9077 +986E B53D
43.9078 +986F B53E
43.9079 +9870 B53F
43.9080 +9871 B540
43.9081 +9873 B541
43.9082 +9874 B542
43.9083 +9875 B543
43.9084 +9876 B544
43.9085 +9877 B545
43.9086 +9878 B546
43.9087 +9879 B547
43.9088 +987A B548
43.9089 +987B B549
43.9090 +987C B54A
43.9091 +987D B54B
43.9092 +9881 B54C
43.9093 +9882 B54D
43.9094 +9883 B54E
43.9095 +9884 B54F
43.9096 +9885 B550
43.9097 +9886 B551
43.9098 +9887 B552
43.9099 +9888 B553
43.9100 +9889 B554
43.9101 +988A B555
43.9102 +988B B556
43.9103 +988C B557
43.9104 +988D B558
43.9105 +988E B559
43.9106 +988F B55A
43.9107 +9890 B55B
43.9108 +9891 B55C
43.9109 +9893 B55D
43.9110 +9894 B55E
43.9111 +9895 B55F
43.9112 +9896 B560
43.9113 +9897 B561
43.9114 +9898 B562
43.9115 +9899 B563
43.9116 +989A B564
43.9117 +989B B565
43.9118 +989C B566
43.9119 +989D B567
43.9120 +98A1 B568
43.9121 +98A2 B569
43.9122 +98A3 B56A
43.9123 +98A4 B56B
43.9124 +98A5 B56C
43.9125 +98A6 B56D
43.9126 +98A7 B56E
43.9127 +98A8 B56F
43.9128 +98A9 B570
43.9129 +98AA B571
43.9130 +98AB B572
43.9131 +98AC B573
43.9132 +98AD B574
43.9133 +98AE B575
43.9134 +98AF B576
43.9135 +98B0 B577
43.9136 +98B1 B578
43.9137 +98B3 B579
43.9138 +98B4 B57A
43.9139 +98B5 B57B
43.9140 +98B6 B57C
43.9141 +98B7 B57D
43.9142 +98B8 B57E
43.9143 +98B9 B57F
43.9144 +98BA B580
43.9145 +98BB B581
43.9146 +98BC B582
43.9147 +98BD B583
43.9148 +98C1 B584
43.9149 +98C2 B585
43.9150 +98C3 B586
43.9151 +98C4 B587
43.9152 +98C5 B588
43.9153 +98C6 B589
43.9154 +98C7 B58A
43.9155 +98C8 B58B
43.9156 +98C9 B58C
43.9157 +98CA B58D
43.9158 +98CB B58E
43.9159 +98CC B58F
43.9160 +98CD B590
43.9161 +98CE B591
43.9162 +98CF B592
43.9163 +98D0 B593
43.9164 +98D1 B594
43.9165 +98D3 B595
43.9166 +98D4 B596
43.9167 +98D5 B597
43.9168 +98D6 B598
43.9169 +98D7 B599
43.9170 +98D8 B59A
43.9171 +98D9 B59B
43.9172 +98DA B59C
43.9173 +98DB B59D
43.9174 +98DC B59E
43.9175 +98DD B59F
43.9176 +98E1 B5A0
43.9177 +98E2 B5A1
43.9178 +98E3 B5A2
43.9179 +98E4 B5A3
43.9180 +98E5 B5A4
43.9181 +98E6 B5A5
43.9182 +98E7 B5A6
43.9183 +98E8 B5A7
43.9184 +98E9 B5A8
43.9185 +98EA B5A9
43.9186 +98EB B5AA
43.9187 +98EC B5AB
43.9188 +98ED B5AC
43.9189 +98EE B5AD
43.9190 +98EF B5AE
43.9191 +98F0 B5AF
43.9192 +98F1 B5B0
43.9193 +98F3 B5B1
43.9194 +98F4 B5B2
43.9195 +98F5 B5B3
43.9196 +98F6 B5B4
43.9197 +98F7 B5B5
43.9198 +98F8 B5B6
43.9199 +98F9 B5B7
43.9200 +98FA B5B8
43.9201 +98FB B5B9
43.9202 +98FC B5BA
43.9203 +98FD B5BB
43.9204 +9941 B5BC
43.9205 +9942 B5BD
43.9206 +9943 B5BE
43.9207 +9944 B5BF
43.9208 +9945 B5C0
43.9209 +9946 B5C1
43.9210 +9947 B5C2
43.9211 +9948 B5C3
43.9212 +9949 B5C4
43.9213 +994A B5C5
43.9214 +994B B5C6
43.9215 +994C B5C7
43.9216 +994D B5C8
43.9217 +994E B5C9
43.9218 +994F B5CA
43.9219 +9950 B5CB
43.9220 +9951 B5CC
43.9221 +9953 B5CD
43.9222 +9954 B5CE
43.9223 +9955 B5CF
43.9224 +9956 B5D0
43.9225 +9957 B5D1
43.9226 +9958 B5D2
43.9227 +9959 B5D3
43.9228 +995A B5D4
43.9229 +995B B5D5
43.9230 +995C B5D6
43.9231 +995D B5D7
43.9232 +9961 B5D8
43.9233 +9962 B5D9
43.9234 +9963 B5DA
43.9235 +9964 B5DB
43.9236 +9965 B5DC
43.9237 +9966 B5DD
43.9238 +9967 B5DE
43.9239 +9968 B5DF
43.9240 +9969 B5E0
43.9241 +996A B5E1
43.9242 +996B B5E2
43.9243 +996C B5E3
43.9244 +996D B5E4
43.9245 +996E B5E5
43.9246 +996F B5E6
43.9247 +9970 B5E7
43.9248 +9971 B5E8
43.9249 +9973 B5E9
43.9250 +9974 B5EA
43.9251 +9975 B5EB
43.9252 +9976 B5EC
43.9253 +9977 B5ED
43.9254 +9978 B5EE
43.9255 +9979 B5EF
43.9256 +997A B5F0
43.9257 +997B B5F1
43.9258 +997C B5F2
43.9259 +997D B5F3
43.9260 +9981 B5F4
43.9261 +9982 B5F5
43.9262 +9983 B5F6
43.9263 +9984 B5F7
43.9264 +9985 B5F8
43.9265 +9986 B5F9
43.9266 +9987 B5FA
43.9267 +9988 B5FB
43.9268 +9989 B5FC
43.9269 +998A B5FD
43.9270 +998B B5FE
43.9271 +998C B5FF
43.9272 +998D B600
43.9273 +998E B601
43.9274 +998F B602
43.9275 +9990 B603
43.9276 +9991 B604
43.9277 +9993 B605
43.9278 +9994 B606
43.9279 +9995 B607
43.9280 +9996 B608
43.9281 +9997 B609
43.9282 +9998 B60A
43.9283 +9999 B60B
43.9284 +999A B60C
43.9285 +999B B60D
43.9286 +999C B60E
43.9287 +999D B60F
43.9288 +99A1 B610
43.9289 +99A2 B611
43.9290 +99A3 B612
43.9291 +99A4 B613
43.9292 +99A5 B614
43.9293 +99A6 B615
43.9294 +99A7 B616
43.9295 +99A8 B617
43.9296 +99A9 B618
43.9297 +99AA B619
43.9298 +99AB B61A
43.9299 +99AC B61B
43.9300 +99AD B61C
43.9301 +99AE B61D
43.9302 +99AF B61E
43.9303 +99B0 B61F
43.9304 +99B1 B620
43.9305 +99B3 B621
43.9306 +99B4 B622
43.9307 +99B5 B623
43.9308 +99B6 B624
43.9309 +99B7 B625
43.9310 +99B8 B626
43.9311 +99B9 B627
43.9312 +99BA B628
43.9313 +99BB B629
43.9314 +99BC B62A
43.9315 +99BD B62B
43.9316 +99C1 B62C
43.9317 +99C2 B62D
43.9318 +99C3 B62E
43.9319 +99C4 B62F
43.9320 +99C5 B630
43.9321 +99C6 B631
43.9322 +99C7 B632
43.9323 +99C8 B633
43.9324 +99C9 B634
43.9325 +99CA B635
43.9326 +99CB B636
43.9327 +99CC B637
43.9328 +99CD B638
43.9329 +99CE B639
43.9330 +99CF B63A
43.9331 +99D0 B63B
43.9332 +99D1 B63C
43.9333 +99D3 B63D
43.9334 +99D4 B63E
43.9335 +99D5 B63F
43.9336 +99D6 B640
43.9337 +99D7 B641
43.9338 +99D8 B642
43.9339 +99D9 B643
43.9340 +99DA B644
43.9341 +99DB B645
43.9342 +99DC B646
43.9343 +99DD B647
43.9344 +99E1 B648
43.9345 +99E2 B649
43.9346 +99E3 B64A
43.9347 +99E4 B64B
43.9348 +99E5 B64C
43.9349 +99E6 B64D
43.9350 +99E7 B64E
43.9351 +99E8 B64F
43.9352 +99E9 B650
43.9353 +99EA B651
43.9354 +99EB B652
43.9355 +99EC B653
43.9356 +99ED B654
43.9357 +99EE B655
43.9358 +99EF B656
43.9359 +99F0 B657
43.9360 +99F1 B658
43.9361 +99F3 B659
43.9362 +99F4 B65A
43.9363 +99F5 B65B
43.9364 +99F6 B65C
43.9365 +99F7 B65D
43.9366 +99F8 B65E
43.9367 +99F9 B65F
43.9368 +99FA B660
43.9369 +99FB B661
43.9370 +99FC B662
43.9371 +99FD B663
43.9372 +9A41 B664
43.9373 +9A42 B665
43.9374 +9A43 B666
43.9375 +9A44 B667
43.9376 +9A45 B668
43.9377 +9A46 B669
43.9378 +9A47 B66A
43.9379 +9A48 B66B
43.9380 +9A49 B66C
43.9381 +9A4A B66D
43.9382 +9A4B B66E
43.9383 +9A4C B66F
43.9384 +9A4D B670
43.9385 +9A4E B671
43.9386 +9A4F B672
43.9387 +9A50 B673
43.9388 +9A51 B674
43.9389 +9A53 B675
43.9390 +9A54 B676
43.9391 +9A55 B677
43.9392 +9A56 B678
43.9393 +9A57 B679
43.9394 +9A58 B67A
43.9395 +9A59 B67B
43.9396 +9A5A B67C
43.9397 +9A5B B67D
43.9398 +9A5C B67E
43.9399 +9A5D B67F
43.9400 +9A61 B680
43.9401 +9A62 B681
43.9402 +9A63 B682
43.9403 +9A64 B683
43.9404 +9A65 B684
43.9405 +9A66 B685
43.9406 +9A67 B686
43.9407 +9A68 B687
43.9408 +9A69 B688
43.9409 +9A6A B689
43.9410 +9A6B B68A
43.9411 +9A6C B68B
43.9412 +9A6D B68C
43.9413 +9A6E B68D
43.9414 +9A6F B68E
43.9415 +9A70 B68F
43.9416 +9A71 B690
43.9417 +9A73 B691
43.9418 +9A74 B692
43.9419 +9A75 B693
43.9420 +9A76 B694
43.9421 +9A77 B695
43.9422 +9A78 B696
43.9423 +9A79 B697
43.9424 +9A7A B698
43.9425 +9A7B B699
43.9426 +9A7C B69A
43.9427 +9A7D B69B
43.9428 +9A81 B69C
43.9429 +9A82 B69D
43.9430 +9A83 B69E
43.9431 +9A84 B69F
43.9432 +9A85 B6A0
43.9433 +9A86 B6A1
43.9434 +9A87 B6A2
43.9435 +9A88 B6A3
43.9436 +9A89 B6A4
43.9437 +9A8A B6A5
43.9438 +9A8B B6A6
43.9439 +9A8C B6A7
43.9440 +9A8D B6A8
43.9441 +9A8E B6A9
43.9442 +9A8F B6AA
43.9443 +9A90 B6AB
43.9444 +9A91 B6AC
43.9445 +9A93 B6AD
43.9446 +9A94 B6AE
43.9447 +9A95 B6AF
43.9448 +9A96 B6B0
43.9449 +9A97 B6B1
43.9450 +9A98 B6B2
43.9451 +9A99 B6B3
43.9452 +9A9A B6B4
43.9453 +9A9B B6B5
43.9454 +9A9C B6B6
43.9455 +9A9D B6B7
43.9456 +9AA1 B6B8
43.9457 +9AA2 B6B9
43.9458 +9AA3 B6BA
43.9459 +9AA4 B6BB
43.9460 +9AA5 B6BC
43.9461 +9AA6 B6BD
43.9462 +9AA7 B6BE
43.9463 +9AA8 B6BF
43.9464 +9AA9 B6C0
43.9465 +9AAA B6C1
43.9466 +9AAB B6C2
43.9467 +9AAC B6C3
43.9468 +9AAD B6C4
43.9469 +9AAE B6C5
43.9470 +9AAF B6C6
43.9471 +9AB0 B6C7
43.9472 +9AB1 B6C8
43.9473 +9AB3 B6C9
43.9474 +9AB4 B6CA
43.9475 +9AB5 B6CB
43.9476 +9AB6 B6CC
43.9477 +9AB7 B6CD
43.9478 +9AB8 B6CE
43.9479 +9AB9 B6CF
43.9480 +9ABA B6D0
43.9481 +9ABB B6D1
43.9482 +9ABC B6D2
43.9483 +9ABD B6D3
43.9484 +9AC1 B6D4
43.9485 +9AC2 B6D5
43.9486 +9AC3 B6D6
43.9487 +9AC4 B6D7
43.9488 +9AC5 B6D8
43.9489 +9AC6 B6D9
43.9490 +9AC7 B6DA
43.9491 +9AC8 B6DB
43.9492 +9AC9 B6DC
43.9493 +9ACA B6DD
43.9494 +9ACB B6DE
43.9495 +9ACC B6DF
43.9496 +9ACD B6E0
43.9497 +9ACE B6E1
43.9498 +9ACF B6E2
43.9499 +9AD0 B6E3
43.9500 +9AD1 B6E4
43.9501 +9AD3 B6E5
43.9502 +9AD4 B6E6
43.9503 +9AD5 B6E7
43.9504 +9AD6 B6E8
43.9505 +9AD7 B6E9
43.9506 +9AD8 B6EA
43.9507 +9AD9 B6EB
43.9508 +9ADA B6EC
43.9509 +9ADB B6ED
43.9510 +9ADC B6EE
43.9511 +9ADD B6EF
43.9512 +9AE1 B6F0
43.9513 +9AE2 B6F1
43.9514 +9AE3 B6F2
43.9515 +9AE4 B6F3
43.9516 +9AE5 B6F4
43.9517 +9AE6 B6F5
43.9518 +9AE7 B6F6
43.9519 +9AE8 B6F7
43.9520 +9AE9 B6F8
43.9521 +9AEA B6F9
43.9522 +9AEB B6FA
43.9523 +9AEC B6FB
43.9524 +9AED B6FC
43.9525 +9AEE B6FD
43.9526 +9AEF B6FE
43.9527 +9AF0 B6FF
43.9528 +9AF1 B700
43.9529 +9AF3 B701
43.9530 +9AF4 B702
43.9531 +9AF5 B703
43.9532 +9AF6 B704
43.9533 +9AF7 B705
43.9534 +9AF8 B706
43.9535 +9AF9 B707
43.9536 +9AFA B708
43.9537 +9AFB B709
43.9538 +9AFC B70A
43.9539 +9AFD B70B
43.9540 +9B41 B70C
43.9541 +9B42 B70D
43.9542 +9B43 B70E
43.9543 +9B44 B70F
43.9544 +9B45 B710
43.9545 +9B46 B711
43.9546 +9B47 B712
43.9547 +9B48 B713
43.9548 +9B49 B714
43.9549 +9B4A B715
43.9550 +9B4B B716
43.9551 +9B4C B717
43.9552 +9B4D B718
43.9553 +9B4E B719
43.9554 +9B4F B71A
43.9555 +9B50 B71B
43.9556 +9B51 B71C
43.9557 +9B53 B71D
43.9558 +9B54 B71E
43.9559 +9B55 B71F
43.9560 +9B56 B720
43.9561 +9B57 B721
43.9562 +9B58 B722
43.9563 +9B59 B723
43.9564 +9B5A B724
43.9565 +9B5B B725
43.9566 +9B5C B726
43.9567 +9B5D B727
43.9568 +9B61 B728
43.9569 +9B62 B729
43.9570 +9B63 B72A
43.9571 +9B64 B72B
43.9572 +9B65 B72C
43.9573 +9B66 B72D
43.9574 +9B67 B72E
43.9575 +9B68 B72F
43.9576 +9B69 B730
43.9577 +9B6A B731
43.9578 +9B6B B732
43.9579 +9B6C B733
43.9580 +9B6D B734
43.9581 +9B6E B735
43.9582 +9B6F B736
43.9583 +9B70 B737
43.9584 +9B71 B738
43.9585 +9B73 B739
43.9586 +9B74 B73A
43.9587 +9B75 B73B
43.9588 +9B76 B73C
43.9589 +9B77 B73D
43.9590 +9B78 B73E
43.9591 +9B79 B73F
43.9592 +9B7A B740
43.9593 +9B7B B741
43.9594 +9B7C B742
43.9595 +9B7D B743
43.9596 +9B81 B744
43.9597 +9B82 B745
43.9598 +9B83 B746
43.9599 +9B84 B747
43.9600 +9B85 B748
43.9601 +9B86 B749
43.9602 +9B87 B74A
43.9603 +9B88 B74B
43.9604 +9B89 B74C
43.9605 +9B8A B74D
43.9606 +9B8B B74E
43.9607 +9B8C B74F
43.9608 +9B8D B750
43.9609 +9B8E B751
43.9610 +9B8F B752
43.9611 +9B90 B753
43.9612 +9B91 B754
43.9613 +9B93 B755
43.9614 +9B94 B756
43.9615 +9B95 B757
43.9616 +9B96 B758
43.9617 +9B97 B759
43.9618 +9B98 B75A
43.9619 +9B99 B75B
43.9620 +9B9A B75C
43.9621 +9B9B B75D
43.9622 +9B9C B75E
43.9623 +9B9D B75F
43.9624 +9BA1 B760
43.9625 +9BA2 B761
43.9626 +9BA3 B762
43.9627 +9BA4 B763
43.9628 +9BA5 B764
43.9629 +9BA6 B765
43.9630 +9BA7 B766
43.9631 +9BA8 B767
43.9632 +9BA9 B768
43.9633 +9BAA B769
43.9634 +9BAB B76A
43.9635 +9BAC B76B
43.9636 +9BAD B76C
43.9637 +9BAE B76D
43.9638 +9BAF B76E
43.9639 +9BB0 B76F
43.9640 +9BB1 B770
43.9641 +9BB3 B771
43.9642 +9BB4 B772
43.9643 +9BB5 B773
43.9644 +9BB6 B774
43.9645 +9BB7 B775
43.9646 +9BB8 B776
43.9647 +9BB9 B777
43.9648 +9BBA B778
43.9649 +9BBB B779
43.9650 +9BBC B77A
43.9651 +9BBD B77B
43.9652 +9C41 3139
43.9653 +9C61 B77C
43.9654 +9C62 B77D
43.9655 +9C63 B77E
43.9656 +9C64 B77F
43.9657 +9C65 B780
43.9658 +9C66 B781
43.9659 +9C67 B782
43.9660 +9C68 B783
43.9661 +9C69 B784
43.9662 +9C6A B785
43.9663 +9C6B B786
43.9664 +9C6C B787
43.9665 +9C6D B788
43.9666 +9C6E B789
43.9667 +9C6F B78A
43.9668 +9C70 B78B
43.9669 +9C71 B78C
43.9670 +9C73 B78D
43.9671 +9C74 B78E
43.9672 +9C75 B78F
43.9673 +9C76 B790
43.9674 +9C77 B791
43.9675 +9C78 B792
43.9676 +9C79 B793
43.9677 +9C7A B794
43.9678 +9C7B B795
43.9679 +9C7C B796
43.9680 +9C7D B797
43.9681 +9C81 B798
43.9682 +9C82 B799
43.9683 +9C83 B79A
43.9684 +9C84 B79B
43.9685 +9C85 B79C
43.9686 +9C86 B79D
43.9687 +9C87 B79E
43.9688 +9C88 B79F
43.9689 +9C89 B7A0
43.9690 +9C8A B7A1
43.9691 +9C8B B7A2
43.9692 +9C8C B7A3
43.9693 +9C8D B7A4
43.9694 +9C8E B7A5
43.9695 +9C8F B7A6
43.9696 +9C90 B7A7
43.9697 +9C91 B7A8
43.9698 +9C93 B7A9
43.9699 +9C94 B7AA
43.9700 +9C95 B7AB
43.9701 +9C96 B7AC
43.9702 +9C97 B7AD
43.9703 +9C98 B7AE
43.9704 +9C99 B7AF
43.9705 +9C9A B7B0
43.9706 +9C9B B7B1
43.9707 +9C9C B7B2
43.9708 +9C9D B7B3
43.9709 +9CA1 B7B4
43.9710 +9CA2 B7B5
43.9711 +9CA3 B7B6
43.9712 +9CA4 B7B7
43.9713 +9CA5 B7B8
43.9714 +9CA6 B7B9
43.9715 +9CA7 B7BA
43.9716 +9CA8 B7BB
43.9717 +9CA9 B7BC
43.9718 +9CAA B7BD
43.9719 +9CAB B7BE
43.9720 +9CAC B7BF
43.9721 +9CAD B7C0
43.9722 +9CAE B7C1
43.9723 +9CAF B7C2
43.9724 +9CB0 B7C3
43.9725 +9CB1 B7C4
43.9726 +9CB3 B7C5
43.9727 +9CB4 B7C6
43.9728 +9CB5 B7C7
43.9729 +9CB6 B7C8
43.9730 +9CB7 B7C9
43.9731 +9CB8 B7CA
43.9732 +9CB9 B7CB
43.9733 +9CBA B7CC
43.9734 +9CBB B7CD
43.9735 +9CBC B7CE
43.9736 +9CBD B7CF
43.9737 +9CC1 B7D0
43.9738 +9CC2 B7D1
43.9739 +9CC3 B7D2
43.9740 +9CC4 B7D3
43.9741 +9CC5 B7D4
43.9742 +9CC6 B7D5
43.9743 +9CC7 B7D6
43.9744 +9CC8 B7D7
43.9745 +9CC9 B7D8
43.9746 +9CCA B7D9
43.9747 +9CCB B7DA
43.9748 +9CCC B7DB
43.9749 +9CCD B7DC
43.9750 +9CCE B7DD
43.9751 +9CCF B7DE
43.9752 +9CD0 B7DF
43.9753 +9CD1 B7E0
43.9754 +9CD3 B7E1
43.9755 +9CD4 B7E2
43.9756 +9CD5 B7E3
43.9757 +9CD6 B7E4
43.9758 +9CD7 B7E5
43.9759 +9CD8 B7E6
43.9760 +9CD9 B7E7
43.9761 +9CDA B7E8
43.9762 +9CDB B7E9
43.9763 +9CDC B7EA
43.9764 +9CDD B7EB
43.9765 +9CE1 B7EC
43.9766 +9CE2 B7ED
43.9767 +9CE3 B7EE
43.9768 +9CE4 B7EF
43.9769 +9CE5 B7F0
43.9770 +9CE6 B7F1
43.9771 +9CE7 B7F2
43.9772 +9CE8 B7F3
43.9773 +9CE9 B7F4
43.9774 +9CEA B7F5
43.9775 +9CEB B7F6
43.9776 +9CEC B7F7
43.9777 +9CED B7F8
43.9778 +9CEE B7F9
43.9779 +9CEF B7FA
43.9780 +9CF0 B7FB
43.9781 +9CF1 B7FC
43.9782 +9CF3 B7FD
43.9783 +9CF4 B7FE
43.9784 +9CF5 B7FF
43.9785 +9CF6 B800
43.9786 +9CF7 B801
43.9787 +9CF8 B802
43.9788 +9CF9 B803
43.9789 +9CFA B804
43.9790 +9CFB B805
43.9791 +9CFC B806
43.9792 +9CFD B807
43.9793 +9D41 B808
43.9794 +9D42 B809
43.9795 +9D43 B80A
43.9796 +9D44 B80B
43.9797 +9D45 B80C
43.9798 +9D46 B80D
43.9799 +9D47 B80E
43.9800 +9D48 B80F
43.9801 +9D49 B810
43.9802 +9D4A B811
43.9803 +9D4B B812
43.9804 +9D4C B813
43.9805 +9D4D B814
43.9806 +9D4E B815
43.9807 +9D4F B816
43.9808 +9D50 B817
43.9809 +9D51 B818
43.9810 +9D53 B819
43.9811 +9D54 B81A
43.9812 +9D55 B81B
43.9813 +9D56 B81C
43.9814 +9D57 B81D
43.9815 +9D58 B81E
43.9816 +9D59 B81F
43.9817 +9D5A B820
43.9818 +9D5B B821
43.9819 +9D5C B822
43.9820 +9D5D B823
43.9821 +9D61 B824
43.9822 +9D62 B825
43.9823 +9D63 B826
43.9824 +9D64 B827
43.9825 +9D65 B828
43.9826 +9D66 B829
43.9827 +9D67 B82A
43.9828 +9D68 B82B
43.9829 +9D69 B82C
43.9830 +9D6A B82D
43.9831 +9D6B B82E
43.9832 +9D6C B82F
43.9833 +9D6D B830
43.9834 +9D6E B831
43.9835 +9D6F B832
43.9836 +9D70 B833
43.9837 +9D71 B834
43.9838 +9D73 B835
43.9839 +9D74 B836
43.9840 +9D75 B837
43.9841 +9D76 B838
43.9842 +9D77 B839
43.9843 +9D78 B83A
43.9844 +9D79 B83B
43.9845 +9D7A B83C
43.9846 +9D7B B83D
43.9847 +9D7C B83E
43.9848 +9D7D B83F
43.9849 +9D81 B840
43.9850 +9D82 B841
43.9851 +9D83 B842
43.9852 +9D84 B843
43.9853 +9D85 B844
43.9854 +9D86 B845
43.9855 +9D87 B846
43.9856 +9D88 B847
43.9857 +9D89 B848
43.9858 +9D8A B849
43.9859 +9D8B B84A
43.9860 +9D8C B84B
43.9861 +9D8D B84C
43.9862 +9D8E B84D
43.9863 +9D8F B84E
43.9864 +9D90 B84F
43.9865 +9D91 B850
43.9866 +9D93 B851
43.9867 +9D94 B852
43.9868 +9D95 B853
43.9869 +9D96 B854
43.9870 +9D97 B855
43.9871 +9D98 B856
43.9872 +9D99 B857
43.9873 +9D9A B858
43.9874 +9D9B B859
43.9875 +9D9C B85A
43.9876 +9D9D B85B
43.9877 +9DA1 B85C
43.9878 +9DA2 B85D
43.9879 +9DA3 B85E
43.9880 +9DA4 B85F
43.9881 +9DA5 B860
43.9882 +9DA6 B861
43.9883 +9DA7 B862
43.9884 +9DA8 B863
43.9885 +9DA9 B864
43.9886 +9DAA B865
43.9887 +9DAB B866
43.9888 +9DAC B867
43.9889 +9DAD B868
43.9890 +9DAE B869
43.9891 +9DAF B86A
43.9892 +9DB0 B86B
43.9893 +9DB1 B86C
43.9894 +9DB3 B86D
43.9895 +9DB4 B86E
43.9896 +9DB5 B86F
43.9897 +9DB6 B870
43.9898 +9DB7 B871
43.9899 +9DB8 B872
43.9900 +9DB9 B873
43.9901 +9DBA B874
43.9902 +9DBB B875
43.9903 +9DBC B876
43.9904 +9DBD B877
43.9905 +9DC1 B878
43.9906 +9DC2 B879
43.9907 +9DC3 B87A
43.9908 +9DC4 B87B
43.9909 +9DC5 B87C
43.9910 +9DC6 B87D
43.9911 +9DC7 B87E
43.9912 +9DC8 B87F
43.9913 +9DC9 B880
43.9914 +9DCA B881
43.9915 +9DCB B882
43.9916 +9DCC B883
43.9917 +9DCD B884
43.9918 +9DCE B885
43.9919 +9DCF B886
43.9920 +9DD0 B887
43.9921 +9DD1 B888
43.9922 +9DD3 B889
43.9923 +9DD4 B88A
43.9924 +9DD5 B88B
43.9925 +9DD6 B88C
43.9926 +9DD7 B88D
43.9927 +9DD8 B88E
43.9928 +9DD9 B88F
43.9929 +9DDA B890
43.9930 +9DDB B891
43.9931 +9DDC B892
43.9932 +9DDD B893
43.9933 +9DE1 B894
43.9934 +9DE2 B895
43.9935 +9DE3 B896
43.9936 +9DE4 B897
43.9937 +9DE5 B898
43.9938 +9DE6 B899
43.9939 +9DE7 B89A
43.9940 +9DE8 B89B
43.9941 +9DE9 B89C
43.9942 +9DEA B89D
43.9943 +9DEB B89E
43.9944 +9DEC B89F
43.9945 +9DED B8A0
43.9946 +9DEE B8A1
43.9947 +9DEF B8A2
43.9948 +9DF0 B8A3
43.9949 +9DF1 B8A4
43.9950 +9DF3 B8A5
43.9951 +9DF4 B8A6
43.9952 +9DF5 B8A7
43.9953 +9DF6 B8A8
43.9954 +9DF7 B8A9
43.9955 +9DF8 B8AA
43.9956 +9DF9 B8AB
43.9957 +9DFA B8AC
43.9958 +9DFB B8AD
43.9959 +9DFC B8AE
43.9960 +9DFD B8AF
43.9961 +9E41 B8B0
43.9962 +9E42 B8B1
43.9963 +9E43 B8B2
43.9964 +9E44 B8B3
43.9965 +9E45 B8B4
43.9966 +9E46 B8B5
43.9967 +9E47 B8B6
43.9968 +9E48 B8B7
43.9969 +9E49 B8B8
43.9970 +9E4A B8B9
43.9971 +9E4B B8BA
43.9972 +9E4C B8BB
43.9973 +9E4D B8BC
43.9974 +9E4E B8BD
43.9975 +9E4F B8BE
43.9976 +9E50 B8BF
43.9977 +9E51 B8C0
43.9978 +9E53 B8C1
43.9979 +9E54 B8C2
43.9980 +9E55 B8C3
43.9981 +9E56 B8C4
43.9982 +9E57 B8C5
43.9983 +9E58 B8C6
43.9984 +9E59 B8C7
43.9985 +9E5A B8C8
43.9986 +9E5B B8C9
43.9987 +9E5C B8CA
43.9988 +9E5D B8CB
43.9989 +9E61 B8CC
43.9990 +9E62 B8CD
43.9991 +9E63 B8CE
43.9992 +9E64 B8CF
43.9993 +9E65 B8D0
43.9994 +9E66 B8D1
43.9995 +9E67 B8D2
43.9996 +9E68 B8D3
43.9997 +9E69 B8D4
43.9998 +9E6A B8D5
43.9999 +9E6B B8D6
43.10000 +9E6C B8D7
43.10001 +9E6D B8D8
43.10002 +9E6E B8D9
43.10003 +9E6F B8DA
43.10004 +9E70 B8DB
43.10005 +9E71 B8DC
43.10006 +9E73 B8DD
43.10007 +9E74 B8DE
43.10008 +9E75 B8DF
43.10009 +9E76 B8E0
43.10010 +9E77 B8E1
43.10011 +9E78 B8E2
43.10012 +9E79 B8E3
43.10013 +9E7A B8E4
43.10014 +9E7B B8E5
43.10015 +9E7C B8E6
43.10016 +9E7D B8E7
43.10017 +9E81 B8E8
43.10018 +9E82 B8E9
43.10019 +9E83 B8EA
43.10020 +9E84 B8EB
43.10021 +9E85 B8EC
43.10022 +9E86 B8ED
43.10023 +9E87 B8EE
43.10024 +9E88 B8EF
43.10025 +9E89 B8F0
43.10026 +9E8A B8F1
43.10027 +9E8B B8F2
43.10028 +9E8C B8F3
43.10029 +9E8D B8F4
43.10030 +9E8E B8F5
43.10031 +9E8F B8F6
43.10032 +9E90 B8F7
43.10033 +9E91 B8F8
43.10034 +9E93 B8F9
43.10035 +9E94 B8FA
43.10036 +9E95 B8FB
43.10037 +9E96 B8FC
43.10038 +9E97 B8FD
43.10039 +9E98 B8FE
43.10040 +9E99 B8FF
43.10041 +9E9A B900
43.10042 +9E9B B901
43.10043 +9E9C B902
43.10044 +9E9D B903
43.10045 +9EA1 B904
43.10046 +9EA2 B905
43.10047 +9EA3 B906
43.10048 +9EA4 B907
43.10049 +9EA5 B908
43.10050 +9EA6 B909
43.10051 +9EA7 B90A
43.10052 +9EA8 B90B
43.10053 +9EA9 B90C
43.10054 +9EAA B90D
43.10055 +9EAB B90E
43.10056 +9EAC B90F
43.10057 +9EAD B910
43.10058 +9EAE B911
43.10059 +9EAF B912
43.10060 +9EB0 B913
43.10061 +9EB1 B914
43.10062 +9EB3 B915
43.10063 +9EB4 B916
43.10064 +9EB5 B917
43.10065 +9EB6 B918
43.10066 +9EB7 B919
43.10067 +9EB8 B91A
43.10068 +9EB9 B91B
43.10069 +9EBA B91C
43.10070 +9EBB B91D
43.10071 +9EBC B91E
43.10072 +9EBD B91F
43.10073 +9EC1 B920
43.10074 +9EC2 B921
43.10075 +9EC3 B922
43.10076 +9EC4 B923
43.10077 +9EC5 B924
43.10078 +9EC6 B925
43.10079 +9EC7 B926
43.10080 +9EC8 B927
43.10081 +9EC9 B928
43.10082 +9ECA B929
43.10083 +9ECB B92A
43.10084 +9ECC B92B
43.10085 +9ECD B92C
43.10086 +9ECE B92D
43.10087 +9ECF B92E
43.10088 +9ED0 B92F
43.10089 +9ED1 B930
43.10090 +9ED3 B931
43.10091 +9ED4 B932
43.10092 +9ED5 B933
43.10093 +9ED6 B934
43.10094 +9ED7 B935
43.10095 +9ED8 B936
43.10096 +9ED9 B937
43.10097 +9EDA B938
43.10098 +9EDB B939
43.10099 +9EDC B93A
43.10100 +9EDD B93B
43.10101 +9EE1 B93C
43.10102 +9EE2 B93D
43.10103 +9EE3 B93E
43.10104 +9EE4 B93F
43.10105 +9EE5 B940
43.10106 +9EE6 B941
43.10107 +9EE7 B942
43.10108 +9EE8 B943
43.10109 +9EE9 B944
43.10110 +9EEA B945
43.10111 +9EEB B946
43.10112 +9EEC B947
43.10113 +9EED B948
43.10114 +9EEE B949
43.10115 +9EEF B94A
43.10116 +9EF0 B94B
43.10117 +9EF1 B94C
43.10118 +9EF3 B94D
43.10119 +9EF4 B94E
43.10120 +9EF5 B94F
43.10121 +9EF6 B950
43.10122 +9EF7 B951
43.10123 +9EF8 B952
43.10124 +9EF9 B953
43.10125 +9EFA B954
43.10126 +9EFB B955
43.10127 +9EFC B956
43.10128 +9EFD B957
43.10129 +9F41 B958
43.10130 +9F42 B959
43.10131 +9F43 B95A
43.10132 +9F44 B95B
43.10133 +9F45 B95C
43.10134 +9F46 B95D
43.10135 +9F47 B95E
43.10136 +9F48 B95F
43.10137 +9F49 B960
43.10138 +9F4A B961
43.10139 +9F4B B962
43.10140 +9F4C B963
43.10141 +9F4D B964
43.10142 +9F4E B965
43.10143 +9F4F B966
43.10144 +9F50 B967
43.10145 +9F51 B968
43.10146 +9F53 B969
43.10147 +9F54 B96A
43.10148 +9F55 B96B
43.10149 +9F56 B96C
43.10150 +9F57 B96D
43.10151 +9F58 B96E
43.10152 +9F59 B96F
43.10153 +9F5A B970
43.10154 +9F5B B971
43.10155 +9F5C B972
43.10156 +9F5D B973
43.10157 +9F61 B974
43.10158 +9F62 B975
43.10159 +9F63 B976
43.10160 +9F64 B977
43.10161 +9F65 B978
43.10162 +9F66 B979
43.10163 +9F67 B97A
43.10164 +9F68 B97B
43.10165 +9F69 B97C
43.10166 +9F6A B97D
43.10167 +9F6B B97E
43.10168 +9F6C B97F
43.10169 +9F6D B980
43.10170 +9F6E B981
43.10171 +9F6F B982
43.10172 +9F70 B983
43.10173 +9F71 B984
43.10174 +9F73 B985
43.10175 +9F74 B986
43.10176 +9F75 B987
43.10177 +9F76 B988
43.10178 +9F77 B989
43.10179 +9F78 B98A
43.10180 +9F79 B98B
43.10181 +9F7A B98C
43.10182 +9F7B B98D
43.10183 +9F7C B98E
43.10184 +9F7D B98F
43.10185 +9F81 B990
43.10186 +9F82 B991
43.10187 +9F83 B992
43.10188 +9F84 B993
43.10189 +9F85 B994
43.10190 +9F86 B995
43.10191 +9F87 B996
43.10192 +9F88 B997
43.10193 +9F89 B998
43.10194 +9F8A B999
43.10195 +9F8B B99A
43.10196 +9F8C B99B
43.10197 +9F8D B99C
43.10198 +9F8E B99D
43.10199 +9F8F B99E
43.10200 +9F90 B99F
43.10201 +9F91 B9A0
43.10202 +9F93 B9A1
43.10203 +9F94 B9A2
43.10204 +9F95 B9A3
43.10205 +9F96 B9A4
43.10206 +9F97 B9A5
43.10207 +9F98 B9A6
43.10208 +9F99 B9A7
43.10209 +9F9A B9A8
43.10210 +9F9B B9A9
43.10211 +9F9C B9AA
43.10212 +9F9D B9AB
43.10213 +9FA1 B9AC
43.10214 +9FA2 B9AD
43.10215 +9FA3 B9AE
43.10216 +9FA4 B9AF
43.10217 +9FA5 B9B0
43.10218 +9FA6 B9B1
43.10219 +9FA7 B9B2
43.10220 +9FA8 B9B3
43.10221 +9FA9 B9B4
43.10222 +9FAA B9B5
43.10223 +9FAB B9B6
43.10224 +9FAC B9B7
43.10225 +9FAD B9B8
43.10226 +9FAE B9B9
43.10227 +9FAF B9BA
43.10228 +9FB0 B9BB
43.10229 +9FB1 B9BC
43.10230 +9FB3 B9BD
43.10231 +9FB4 B9BE
43.10232 +9FB5 B9BF
43.10233 +9FB6 B9C0
43.10234 +9FB7 B9C1
43.10235 +9FB8 B9C2
43.10236 +9FB9 B9C3
43.10237 +9FBA B9C4
43.10238 +9FBB B9C5
43.10239 +9FBC B9C6
43.10240 +9FBD B9C7
43.10241 +A041 3141
43.10242 +A061 B9C8
43.10243 +A062 B9C9
43.10244 +A063 B9CA
43.10245 +A064 B9CB
43.10246 +A065 B9CC
43.10247 +A066 B9CD
43.10248 +A067 B9CE
43.10249 +A068 B9CF
43.10250 +A069 B9D0
43.10251 +A06A B9D1
43.10252 +A06B B9D2
43.10253 +A06C B9D3
43.10254 +A06D B9D4
43.10255 +A06E B9D5
43.10256 +A06F B9D6
43.10257 +A070 B9D7
43.10258 +A071 B9D8
43.10259 +A073 B9D9
43.10260 +A074 B9DA
43.10261 +A075 B9DB
43.10262 +A076 B9DC
43.10263 +A077 B9DD
43.10264 +A078 B9DE
43.10265 +A079 B9DF
43.10266 +A07A B9E0
43.10267 +A07B B9E1
43.10268 +A07C B9E2
43.10269 +A07D B9E3
43.10270 +A081 B9E4
43.10271 +A082 B9E5
43.10272 +A083 B9E6
43.10273 +A084 B9E7
43.10274 +A085 B9E8
43.10275 +A086 B9E9
43.10276 +A087 B9EA
43.10277 +A088 B9EB
43.10278 +A089 B9EC
43.10279 +A08A B9ED
43.10280 +A08B B9EE
43.10281 +A08C B9EF
43.10282 +A08D B9F0
43.10283 +A08E B9F1
43.10284 +A08F B9F2
43.10285 +A090 B9F3
43.10286 +A091 B9F4
43.10287 +A093 B9F5
43.10288 +A094 B9F6
43.10289 +A095 B9F7
43.10290 +A096 B9F8
43.10291 +A097 B9F9
43.10292 +A098 B9FA
43.10293 +A099 B9FB
43.10294 +A09A B9FC
43.10295 +A09B B9FD
43.10296 +A09C B9FE
43.10297 +A09D B9FF
43.10298 +A0A1 BA00
43.10299 +A0A2 BA01
43.10300 +A0A3 BA02
43.10301 +A0A4 BA03
43.10302 +A0A5 BA04
43.10303 +A0A6 BA05
43.10304 +A0A7 BA06
43.10305 +A0A8 BA07
43.10306 +A0A9 BA08
43.10307 +A0AA BA09
43.10308 +A0AB BA0A
43.10309 +A0AC BA0B
43.10310 +A0AD BA0C
43.10311 +A0AE BA0D
43.10312 +A0AF BA0E
43.10313 +A0B0 BA0F
43.10314 +A0B1 BA10
43.10315 +A0B3 BA11
43.10316 +A0B4 BA12
43.10317 +A0B5 BA13
43.10318 +A0B6 BA14
43.10319 +A0B7 BA15
43.10320 +A0B8 BA16
43.10321 +A0B9 BA17
43.10322 +A0BA BA18
43.10323 +A0BB BA19
43.10324 +A0BC BA1A
43.10325 +A0BD BA1B
43.10326 +A0C1 BA1C
43.10327 +A0C2 BA1D
43.10328 +A0C3 BA1E
43.10329 +A0C4 BA1F
43.10330 +A0C5 BA20
43.10331 +A0C6 BA21
43.10332 +A0C7 BA22
43.10333 +A0C8 BA23
43.10334 +A0C9 BA24
43.10335 +A0CA BA25
43.10336 +A0CB BA26
43.10337 +A0CC BA27
43.10338 +A0CD BA28
43.10339 +A0CE BA29
43.10340 +A0CF BA2A
43.10341 +A0D0 BA2B
43.10342 +A0D1 BA2C
43.10343 +A0D3 BA2D
43.10344 +A0D4 BA2E
43.10345 +A0D5 BA2F
43.10346 +A0D6 BA30
43.10347 +A0D7 BA31
43.10348 +A0D8 BA32
43.10349 +A0D9 BA33
43.10350 +A0DA BA34
43.10351 +A0DB BA35
43.10352 +A0DC BA36
43.10353 +A0DD BA37
43.10354 +A0E1 BA38
43.10355 +A0E2 BA39
43.10356 +A0E3 BA3A
43.10357 +A0E4 BA3B
43.10358 +A0E5 BA3C
43.10359 +A0E6 BA3D
43.10360 +A0E7 BA3E
43.10361 +A0E8 BA3F
43.10362 +A0E9 BA40
43.10363 +A0EA BA41
43.10364 +A0EB BA42
43.10365 +A0EC BA43
43.10366 +A0ED BA44
43.10367 +A0EE BA45
43.10368 +A0EF BA46
43.10369 +A0F0 BA47
43.10370 +A0F1 BA48
43.10371 +A0F3 BA49
43.10372 +A0F4 BA4A
43.10373 +A0F5 BA4B
43.10374 +A0F6 BA4C
43.10375 +A0F7 BA4D
43.10376 +A0F8 BA4E
43.10377 +A0F9 BA4F
43.10378 +A0FA BA50
43.10379 +A0FB BA51
43.10380 +A0FC BA52
43.10381 +A0FD BA53
43.10382 +A141 BA54
43.10383 +A142 BA55
43.10384 +A143 BA56
43.10385 +A144 BA57
43.10386 +A145 BA58
43.10387 +A146 BA59
43.10388 +A147 BA5A
43.10389 +A148 BA5B
43.10390 +A149 BA5C
43.10391 +A14A BA5D
43.10392 +A14B BA5E
43.10393 +A14C BA5F
43.10394 +A14D BA60
43.10395 +A14E BA61
43.10396 +A14F BA62
43.10397 +A150 BA63
43.10398 +A151 BA64
43.10399 +A153 BA65
43.10400 +A154 BA66
43.10401 +A155 BA67
43.10402 +A156 BA68
43.10403 +A157 BA69
43.10404 +A158 BA6A
43.10405 +A159 BA6B
43.10406 +A15A BA6C
43.10407 +A15B BA6D
43.10408 +A15C BA6E
43.10409 +A15D BA6F
43.10410 +A161 BA70
43.10411 +A162 BA71
43.10412 +A163 BA72
43.10413 +A164 BA73
43.10414 +A165 BA74
43.10415 +A166 BA75
43.10416 +A167 BA76
43.10417 +A168 BA77
43.10418 +A169 BA78
43.10419 +A16A BA79
43.10420 +A16B BA7A
43.10421 +A16C BA7B
43.10422 +A16D BA7C
43.10423 +A16E BA7D
43.10424 +A16F BA7E
43.10425 +A170 BA7F
43.10426 +A171 BA80
43.10427 +A173 BA81
43.10428 +A174 BA82
43.10429 +A175 BA83
43.10430 +A176 BA84
43.10431 +A177 BA85
43.10432 +A178 BA86
43.10433 +A179 BA87
43.10434 +A17A BA88
43.10435 +A17B BA89
43.10436 +A17C BA8A
43.10437 +A17D BA8B
43.10438 +A181 BA8C
43.10439 +A182 BA8D
43.10440 +A183 BA8E
43.10441 +A184 BA8F
43.10442 +A185 BA90
43.10443 +A186 BA91
43.10444 +A187 BA92
43.10445 +A188 BA93
43.10446 +A189 BA94
43.10447 +A18A BA95
43.10448 +A18B BA96
43.10449 +A18C BA97
43.10450 +A18D BA98
43.10451 +A18E BA99
43.10452 +A18F BA9A
43.10453 +A190 BA9B
43.10454 +A191 BA9C
43.10455 +A193 BA9D
43.10456 +A194 BA9E
43.10457 +A195 BA9F
43.10458 +A196 BAA0
43.10459 +A197 BAA1
43.10460 +A198 BAA2
43.10461 +A199 BAA3
43.10462 +A19A BAA4
43.10463 +A19B BAA5
43.10464 +A19C BAA6
43.10465 +A19D BAA7
43.10466 +A1A1 BAA8
43.10467 +A1A2 BAA9
43.10468 +A1A3 BAAA
43.10469 +A1A4 BAAB
43.10470 +A1A5 BAAC
43.10471 +A1A6 BAAD
43.10472 +A1A7 BAAE
43.10473 +A1A8 BAAF
43.10474 +A1A9 BAB0
43.10475 +A1AA BAB1
43.10476 +A1AB BAB2
43.10477 +A1AC BAB3
43.10478 +A1AD BAB4
43.10479 +A1AE BAB5
43.10480 +A1AF BAB6
43.10481 +A1B0 BAB7
43.10482 +A1B1 BAB8
43.10483 +A1B3 BAB9
43.10484 +A1B4 BABA
43.10485 +A1B5 BABB
43.10486 +A1B6 BABC
43.10487 +A1B7 BABD
43.10488 +A1B8 BABE
43.10489 +A1B9 BABF
43.10490 +A1BA BAC0
43.10491 +A1BB BAC1
43.10492 +A1BC BAC2
43.10493 +A1BD BAC3
43.10494 +A1C1 BAC4
43.10495 +A1C2 BAC5
43.10496 +A1C3 BAC6
43.10497 +A1C4 BAC7
43.10498 +A1C5 BAC8
43.10499 +A1C6 BAC9
43.10500 +A1C7 BACA
43.10501 +A1C8 BACB
43.10502 +A1C9 BACC
43.10503 +A1CA BACD
43.10504 +A1CB BACE
43.10505 +A1CC BACF
43.10506 +A1CD BAD0
43.10507 +A1CE BAD1
43.10508 +A1CF BAD2
43.10509 +A1D0 BAD3
43.10510 +A1D1 BAD4
43.10511 +A1D3 BAD5
43.10512 +A1D4 BAD6
43.10513 +A1D5 BAD7
43.10514 +A1D6 BAD8
43.10515 +A1D7 BAD9
43.10516 +A1D8 BADA
43.10517 +A1D9 BADB
43.10518 +A1DA BADC
43.10519 +A1DB BADD
43.10520 +A1DC BADE
43.10521 +A1DD BADF
43.10522 +A1E1 BAE0
43.10523 +A1E2 BAE1
43.10524 +A1E3 BAE2
43.10525 +A1E4 BAE3
43.10526 +A1E5 BAE4
43.10527 +A1E6 BAE5
43.10528 +A1E7 BAE6
43.10529 +A1E8 BAE7
43.10530 +A1E9 BAE8
43.10531 +A1EA BAE9
43.10532 +A1EB BAEA
43.10533 +A1EC BAEB
43.10534 +A1ED BAEC
43.10535 +A1EE BAED
43.10536 +A1EF BAEE
43.10537 +A1F0 BAEF
43.10538 +A1F1 BAF0
43.10539 +A1F3 BAF1
43.10540 +A1F4 BAF2
43.10541 +A1F5 BAF3
43.10542 +A1F6 BAF4
43.10543 +A1F7 BAF5
43.10544 +A1F8 BAF6
43.10545 +A1F9 BAF7
43.10546 +A1FA BAF8
43.10547 +A1FB BAF9
43.10548 +A1FC BAFA
43.10549 +A1FD BAFB
43.10550 +A241 BAFC
43.10551 +A242 BAFD
43.10552 +A243 BAFE
43.10553 +A244 BAFF
43.10554 +A245 BB00
43.10555 +A246 BB01
43.10556 +A247 BB02
43.10557 +A248 BB03
43.10558 +A249 BB04
43.10559 +A24A BB05
43.10560 +A24B BB06
43.10561 +A24C BB07
43.10562 +A24D BB08
43.10563 +A24E BB09
43.10564 +A24F BB0A
43.10565 +A250 BB0B
43.10566 +A251 BB0C
43.10567 +A253 BB0D
43.10568 +A254 BB0E
43.10569 +A255 BB0F
43.10570 +A256 BB10
43.10571 +A257 BB11
43.10572 +A258 BB12
43.10573 +A259 BB13
43.10574 +A25A BB14
43.10575 +A25B BB15
43.10576 +A25C BB16
43.10577 +A25D BB17
43.10578 +A261 BB18
43.10579 +A262 BB19
43.10580 +A263 BB1A
43.10581 +A264 BB1B
43.10582 +A265 BB1C
43.10583 +A266 BB1D
43.10584 +A267 BB1E
43.10585 +A268 BB1F
43.10586 +A269 BB20
43.10587 +A26A BB21
43.10588 +A26B BB22
43.10589 +A26C BB23
43.10590 +A26D BB24
43.10591 +A26E BB25
43.10592 +A26F BB26
43.10593 +A270 BB27
43.10594 +A271 BB28
43.10595 +A273 BB29
43.10596 +A274 BB2A
43.10597 +A275 BB2B
43.10598 +A276 BB2C
43.10599 +A277 BB2D
43.10600 +A278 BB2E
43.10601 +A279 BB2F
43.10602 +A27A BB30
43.10603 +A27B BB31
43.10604 +A27C BB32
43.10605 +A27D BB33
43.10606 +A281 BB34
43.10607 +A282 BB35
43.10608 +A283 BB36
43.10609 +A284 BB37
43.10610 +A285 BB38
43.10611 +A286 BB39
43.10612 +A287 BB3A
43.10613 +A288 BB3B
43.10614 +A289 BB3C
43.10615 +A28A BB3D
43.10616 +A28B BB3E
43.10617 +A28C BB3F
43.10618 +A28D BB40
43.10619 +A28E BB41
43.10620 +A28F BB42
43.10621 +A290 BB43
43.10622 +A291 BB44
43.10623 +A293 BB45
43.10624 +A294 BB46
43.10625 +A295 BB47
43.10626 +A296 BB48
43.10627 +A297 BB49
43.10628 +A298 BB4A
43.10629 +A299 BB4B
43.10630 +A29A BB4C
43.10631 +A29B BB4D
43.10632 +A29C BB4E
43.10633 +A29D BB4F
43.10634 +A2A1 BB50
43.10635 +A2A2 BB51
43.10636 +A2A3 BB52
43.10637 +A2A4 BB53
43.10638 +A2A5 BB54
43.10639 +A2A6 BB55
43.10640 +A2A7 BB56
43.10641 +A2A8 BB57
43.10642 +A2A9 BB58
43.10643 +A2AA BB59
43.10644 +A2AB BB5A
43.10645 +A2AC BB5B
43.10646 +A2AD BB5C
43.10647 +A2AE BB5D
43.10648 +A2AF BB5E
43.10649 +A2B0 BB5F
43.10650 +A2B1 BB60
43.10651 +A2B3 BB61
43.10652 +A2B4 BB62
43.10653 +A2B5 BB63
43.10654 +A2B6 BB64
43.10655 +A2B7 BB65
43.10656 +A2B8 BB66
43.10657 +A2B9 BB67
43.10658 +A2BA BB68
43.10659 +A2BB BB69
43.10660 +A2BC BB6A
43.10661 +A2BD BB6B
43.10662 +A2C1 BB6C
43.10663 +A2C2 BB6D
43.10664 +A2C3 BB6E
43.10665 +A2C4 BB6F
43.10666 +A2C5 BB70
43.10667 +A2C6 BB71
43.10668 +A2C7 BB72
43.10669 +A2C8 BB73
43.10670 +A2C9 BB74
43.10671 +A2CA BB75
43.10672 +A2CB BB76
43.10673 +A2CC BB77
43.10674 +A2CD BB78
43.10675 +A2CE BB79
43.10676 +A2CF BB7A
43.10677 +A2D0 BB7B
43.10678 +A2D1 BB7C
43.10679 +A2D3 BB7D
43.10680 +A2D4 BB7E
43.10681 +A2D5 BB7F
43.10682 +A2D6 BB80
43.10683 +A2D7 BB81
43.10684 +A2D8 BB82
43.10685 +A2D9 BB83
43.10686 +A2DA BB84
43.10687 +A2DB BB85
43.10688 +A2DC BB86
43.10689 +A2DD BB87
43.10690 +A2E1 BB88
43.10691 +A2E2 BB89
43.10692 +A2E3 BB8A
43.10693 +A2E4 BB8B
43.10694 +A2E5 BB8C
43.10695 +A2E6 BB8D
43.10696 +A2E7 BB8E
43.10697 +A2E8 BB8F
43.10698 +A2E9 BB90
43.10699 +A2EA BB91
43.10700 +A2EB BB92
43.10701 +A2EC BB93
43.10702 +A2ED BB94
43.10703 +A2EE BB95
43.10704 +A2EF BB96
43.10705 +A2F0 BB97
43.10706 +A2F1 BB98
43.10707 +A2F3 BB99
43.10708 +A2F4 BB9A
43.10709 +A2F5 BB9B
43.10710 +A2F6 BB9C
43.10711 +A2F7 BB9D
43.10712 +A2F8 BB9E
43.10713 +A2F9 BB9F
43.10714 +A2FA BBA0
43.10715 +A2FB BBA1
43.10716 +A2FC BBA2
43.10717 +A2FD BBA3
43.10718 +A341 BBA4
43.10719 +A342 BBA5
43.10720 +A343 BBA6
43.10721 +A344 BBA7
43.10722 +A345 BBA8
43.10723 +A346 BBA9
43.10724 +A347 BBAA
43.10725 +A348 BBAB
43.10726 +A349 BBAC
43.10727 +A34A BBAD
43.10728 +A34B BBAE
43.10729 +A34C BBAF
43.10730 +A34D BBB0
43.10731 +A34E BBB1
43.10732 +A34F BBB2
43.10733 +A350 BBB3
43.10734 +A351 BBB4
43.10735 +A353 BBB5
43.10736 +A354 BBB6
43.10737 +A355 BBB7
43.10738 +A356 BBB8
43.10739 +A357 BBB9
43.10740 +A358 BBBA
43.10741 +A359 BBBB
43.10742 +A35A BBBC
43.10743 +A35B BBBD
43.10744 +A35C BBBE
43.10745 +A35D BBBF
43.10746 +A361 BBC0
43.10747 +A362 BBC1
43.10748 +A363 BBC2
43.10749 +A364 BBC3
43.10750 +A365 BBC4
43.10751 +A366 BBC5
43.10752 +A367 BBC6
43.10753 +A368 BBC7
43.10754 +A369 BBC8
43.10755 +A36A BBC9
43.10756 +A36B BBCA
43.10757 +A36C BBCB
43.10758 +A36D BBCC
43.10759 +A36E BBCD
43.10760 +A36F BBCE
43.10761 +A370 BBCF
43.10762 +A371 BBD0
43.10763 +A373 BBD1
43.10764 +A374 BBD2
43.10765 +A375 BBD3
43.10766 +A376 BBD4
43.10767 +A377 BBD5
43.10768 +A378 BBD6
43.10769 +A379 BBD7
43.10770 +A37A BBD8
43.10771 +A37B BBD9
43.10772 +A37C BBDA
43.10773 +A37D BBDB
43.10774 +A381 BBDC
43.10775 +A382 BBDD
43.10776 +A383 BBDE
43.10777 +A384 BBDF
43.10778 +A385 BBE0
43.10779 +A386 BBE1
43.10780 +A387 BBE2
43.10781 +A388 BBE3
43.10782 +A389 BBE4
43.10783 +A38A BBE5
43.10784 +A38B BBE6
43.10785 +A38C BBE7
43.10786 +A38D BBE8
43.10787 +A38E BBE9
43.10788 +A38F BBEA
43.10789 +A390 BBEB
43.10790 +A391 BBEC
43.10791 +A393 BBED
43.10792 +A394 BBEE
43.10793 +A395 BBEF
43.10794 +A396 BBF0
43.10795 +A397 BBF1
43.10796 +A398 BBF2
43.10797 +A399 BBF3
43.10798 +A39A BBF4
43.10799 +A39B BBF5
43.10800 +A39C BBF6
43.10801 +A39D BBF7
43.10802 +A3A1 BBF8
43.10803 +A3A2 BBF9
43.10804 +A3A3 BBFA
43.10805 +A3A4 BBFB
43.10806 +A3A5 BBFC
43.10807 +A3A6 BBFD
43.10808 +A3A7 BBFE
43.10809 +A3A8 BBFF
43.10810 +A3A9 BC00
43.10811 +A3AA BC01
43.10812 +A3AB BC02
43.10813 +A3AC BC03
43.10814 +A3AD BC04
43.10815 +A3AE BC05
43.10816 +A3AF BC06
43.10817 +A3B0 BC07
43.10818 +A3B1 BC08
43.10819 +A3B3 BC09
43.10820 +A3B4 BC0A
43.10821 +A3B5 BC0B
43.10822 +A3B6 BC0C
43.10823 +A3B7 BC0D
43.10824 +A3B8 BC0E
43.10825 +A3B9 BC0F
43.10826 +A3BA BC10
43.10827 +A3BB BC11
43.10828 +A3BC BC12
43.10829 +A3BD BC13
43.10830 +A441 3142
43.10831 +A461 BC14
43.10832 +A462 BC15
43.10833 +A463 BC16
43.10834 +A464 BC17
43.10835 +A465 BC18
43.10836 +A466 BC19
43.10837 +A467 BC1A
43.10838 +A468 BC1B
43.10839 +A469 BC1C
43.10840 +A46A BC1D
43.10841 +A46B BC1E
43.10842 +A46C BC1F
43.10843 +A46D BC20
43.10844 +A46E BC21
43.10845 +A46F BC22
43.10846 +A470 BC23
43.10847 +A471 BC24
43.10848 +A473 BC25
43.10849 +A474 BC26
43.10850 +A475 BC27
43.10851 +A476 BC28
43.10852 +A477 BC29
43.10853 +A478 BC2A
43.10854 +A479 BC2B
43.10855 +A47A BC2C
43.10856 +A47B BC2D
43.10857 +A47C BC2E
43.10858 +A47D BC2F
43.10859 +A481 BC30
43.10860 +A482 BC31
43.10861 +A483 BC32
43.10862 +A484 BC33
43.10863 +A485 BC34
43.10864 +A486 BC35
43.10865 +A487 BC36
43.10866 +A488 BC37
43.10867 +A489 BC38
43.10868 +A48A BC39
43.10869 +A48B BC3A
43.10870 +A48C BC3B
43.10871 +A48D BC3C
43.10872 +A48E BC3D
43.10873 +A48F BC3E
43.10874 +A490 BC3F
43.10875 +A491 BC40
43.10876 +A493 BC41
43.10877 +A494 BC42
43.10878 +A495 BC43
43.10879 +A496 BC44
43.10880 +A497 BC45
43.10881 +A498 BC46
43.10882 +A499 BC47
43.10883 +A49A BC48
43.10884 +A49B BC49
43.10885 +A49C BC4A
43.10886 +A49D BC4B
43.10887 +A4A1 BC4C
43.10888 +A4A2 BC4D
43.10889 +A4A3 BC4E
43.10890 +A4A4 BC4F
43.10891 +A4A5 BC50
43.10892 +A4A6 BC51
43.10893 +A4A7 BC52
43.10894 +A4A8 BC53
43.10895 +A4A9 BC54
43.10896 +A4AA BC55
43.10897 +A4AB BC56
43.10898 +A4AC BC57
43.10899 +A4AD BC58
43.10900 +A4AE BC59
43.10901 +A4AF BC5A
43.10902 +A4B0 BC5B
43.10903 +A4B1 BC5C
43.10904 +A4B3 BC5D
43.10905 +A4B4 BC5E
43.10906 +A4B5 BC5F
43.10907 +A4B6 BC60
43.10908 +A4B7 BC61
43.10909 +A4B8 BC62
43.10910 +A4B9 BC63
43.10911 +A4BA BC64
43.10912 +A4BB BC65
43.10913 +A4BC BC66
43.10914 +A4BD BC67
43.10915 +A4C1 BC68
43.10916 +A4C2 BC69
43.10917 +A4C3 BC6A
43.10918 +A4C4 BC6B
43.10919 +A4C5 BC6C
43.10920 +A4C6 BC6D
43.10921 +A4C7 BC6E
43.10922 +A4C8 BC6F
43.10923 +A4C9 BC70
43.10924 +A4CA BC71
43.10925 +A4CB BC72
43.10926 +A4CC BC73
43.10927 +A4CD BC74
43.10928 +A4CE BC75
43.10929 +A4CF BC76
43.10930 +A4D0 BC77
43.10931 +A4D1 BC78
43.10932 +A4D3 BC79
43.10933 +A4D4 BC7A
43.10934 +A4D5 BC7B
43.10935 +A4D6 BC7C
43.10936 +A4D7 BC7D
43.10937 +A4D8 BC7E
43.10938 +A4D9 BC7F
43.10939 +A4DA BC80
43.10940 +A4DB BC81
43.10941 +A4DC BC82
43.10942 +A4DD BC83
43.10943 +A4E1 BC84
43.10944 +A4E2 BC85
43.10945 +A4E3 BC86
43.10946 +A4E4 BC87
43.10947 +A4E5 BC88
43.10948 +A4E6 BC89
43.10949 +A4E7 BC8A
43.10950 +A4E8 BC8B
43.10951 +A4E9 BC8C
43.10952 +A4EA BC8D
43.10953 +A4EB BC8E
43.10954 +A4EC BC8F
43.10955 +A4ED BC90
43.10956 +A4EE BC91
43.10957 +A4EF BC92
43.10958 +A4F0 BC93
43.10959 +A4F1 BC94
43.10960 +A4F3 BC95
43.10961 +A4F4 BC96
43.10962 +A4F5 BC97
43.10963 +A4F6 BC98
43.10964 +A4F7 BC99
43.10965 +A4F8 BC9A
43.10966 +A4F9 BC9B
43.10967 +A4FA BC9C
43.10968 +A4FB BC9D
43.10969 +A4FC BC9E
43.10970 +A4FD BC9F
43.10971 +A541 BCA0
43.10972 +A542 BCA1
43.10973 +A543 BCA2
43.10974 +A544 BCA3
43.10975 +A545 BCA4
43.10976 +A546 BCA5
43.10977 +A547 BCA6
43.10978 +A548 BCA7
43.10979 +A549 BCA8
43.10980 +A54A BCA9
43.10981 +A54B BCAA
43.10982 +A54C BCAB
43.10983 +A54D BCAC
43.10984 +A54E BCAD
43.10985 +A54F BCAE
43.10986 +A550 BCAF
43.10987 +A551 BCB0
43.10988 +A553 BCB1
43.10989 +A554 BCB2
43.10990 +A555 BCB3
43.10991 +A556 BCB4
43.10992 +A557 BCB5
43.10993 +A558 BCB6
43.10994 +A559 BCB7
43.10995 +A55A BCB8
43.10996 +A55B BCB9
43.10997 +A55C BCBA
43.10998 +A55D BCBB
43.10999 +A561 BCBC
43.11000 +A562 BCBD
43.11001 +A563 BCBE
43.11002 +A564 BCBF
43.11003 +A565 BCC0
43.11004 +A566 BCC1
43.11005 +A567 BCC2
43.11006 +A568 BCC3
43.11007 +A569 BCC4
43.11008 +A56A BCC5
43.11009 +A56B BCC6
43.11010 +A56C BCC7
43.11011 +A56D BCC8
43.11012 +A56E BCC9
43.11013 +A56F BCCA
43.11014 +A570 BCCB
43.11015 +A571 BCCC
43.11016 +A573 BCCD
43.11017 +A574 BCCE
43.11018 +A575 BCCF
43.11019 +A576 BCD0
43.11020 +A577 BCD1
43.11021 +A578 BCD2
43.11022 +A579 BCD3
43.11023 +A57A BCD4
43.11024 +A57B BCD5
43.11025 +A57C BCD6
43.11026 +A57D BCD7
43.11027 +A581 BCD8
43.11028 +A582 BCD9
43.11029 +A583 BCDA
43.11030 +A584 BCDB
43.11031 +A585 BCDC
43.11032 +A586 BCDD
43.11033 +A587 BCDE
43.11034 +A588 BCDF
43.11035 +A589 BCE0
43.11036 +A58A BCE1
43.11037 +A58B BCE2
43.11038 +A58C BCE3
43.11039 +A58D BCE4
43.11040 +A58E BCE5
43.11041 +A58F BCE6
43.11042 +A590 BCE7
43.11043 +A591 BCE8
43.11044 +A593 BCE9
43.11045 +A594 BCEA
43.11046 +A595 BCEB
43.11047 +A596 BCEC
43.11048 +A597 BCED
43.11049 +A598 BCEE
43.11050 +A599 BCEF
43.11051 +A59A BCF0
43.11052 +A59B BCF1
43.11053 +A59C BCF2
43.11054 +A59D BCF3
43.11055 +A5A1 BCF4
43.11056 +A5A2 BCF5
43.11057 +A5A3 BCF6
43.11058 +A5A4 BCF7
43.11059 +A5A5 BCF8
43.11060 +A5A6 BCF9
43.11061 +A5A7 BCFA
43.11062 +A5A8 BCFB
43.11063 +A5A9 BCFC
43.11064 +A5AA BCFD
43.11065 +A5AB BCFE
43.11066 +A5AC BCFF
43.11067 +A5AD BD00
43.11068 +A5AE BD01
43.11069 +A5AF BD02
43.11070 +A5B0 BD03
43.11071 +A5B1 BD04
43.11072 +A5B3 BD05
43.11073 +A5B4 BD06
43.11074 +A5B5 BD07
43.11075 +A5B6 BD08
43.11076 +A5B7 BD09
43.11077 +A5B8 BD0A
43.11078 +A5B9 BD0B
43.11079 +A5BA BD0C
43.11080 +A5BB BD0D
43.11081 +A5BC BD0E
43.11082 +A5BD BD0F
43.11083 +A5C1 BD10
43.11084 +A5C2 BD11
43.11085 +A5C3 BD12
43.11086 +A5C4 BD13
43.11087 +A5C5 BD14
43.11088 +A5C6 BD15
43.11089 +A5C7 BD16
43.11090 +A5C8 BD17
43.11091 +A5C9 BD18
43.11092 +A5CA BD19
43.11093 +A5CB BD1A
43.11094 +A5CC BD1B
43.11095 +A5CD BD1C
43.11096 +A5CE BD1D
43.11097 +A5CF BD1E
43.11098 +A5D0 BD1F
43.11099 +A5D1 BD20
43.11100 +A5D3 BD21
43.11101 +A5D4 BD22
43.11102 +A5D5 BD23
43.11103 +A5D6 BD24
43.11104 +A5D7 BD25
43.11105 +A5D8 BD26
43.11106 +A5D9 BD27
43.11107 +A5DA BD28
43.11108 +A5DB BD29
43.11109 +A5DC BD2A
43.11110 +A5DD BD2B
43.11111 +A5E1 BD2C
43.11112 +A5E2 BD2D
43.11113 +A5E3 BD2E
43.11114 +A5E4 BD2F
43.11115 +A5E5 BD30
43.11116 +A5E6 BD31
43.11117 +A5E7 BD32
43.11118 +A5E8 BD33
43.11119 +A5E9 BD34
43.11120 +A5EA BD35
43.11121 +A5EB BD36
43.11122 +A5EC BD37
43.11123 +A5ED BD38
43.11124 +A5EE BD39
43.11125 +A5EF BD3A
43.11126 +A5F0 BD3B
43.11127 +A5F1 BD3C
43.11128 +A5F3 BD3D
43.11129 +A5F4 BD3E
43.11130 +A5F5 BD3F
43.11131 +A5F6 BD40
43.11132 +A5F7 BD41
43.11133 +A5F8 BD42
43.11134 +A5F9 BD43
43.11135 +A5FA BD44
43.11136 +A5FB BD45
43.11137 +A5FC BD46
43.11138 +A5FD BD47
43.11139 +A641 BD48
43.11140 +A642 BD49
43.11141 +A643 BD4A
43.11142 +A644 BD4B
43.11143 +A645 BD4C
43.11144 +A646 BD4D
43.11145 +A647 BD4E
43.11146 +A648 BD4F
43.11147 +A649 BD50
43.11148 +A64A BD51
43.11149 +A64B BD52
43.11150 +A64C BD53
43.11151 +A64D BD54
43.11152 +A64E BD55
43.11153 +A64F BD56
43.11154 +A650 BD57
43.11155 +A651 BD58
43.11156 +A653 BD59
43.11157 +A654 BD5A
43.11158 +A655 BD5B
43.11159 +A656 BD5C
43.11160 +A657 BD5D
43.11161 +A658 BD5E
43.11162 +A659 BD5F
43.11163 +A65A BD60
43.11164 +A65B BD61
43.11165 +A65C BD62
43.11166 +A65D BD63
43.11167 +A661 BD64
43.11168 +A662 BD65
43.11169 +A663 BD66
43.11170 +A664 BD67
43.11171 +A665 BD68
43.11172 +A666 BD69
43.11173 +A667 BD6A
43.11174 +A668 BD6B
43.11175 +A669 BD6C
43.11176 +A66A BD6D
43.11177 +A66B BD6E
43.11178 +A66C BD6F
43.11179 +A66D BD70
43.11180 +A66E BD71
43.11181 +A66F BD72
43.11182 +A670 BD73
43.11183 +A671 BD74
43.11184 +A673 BD75
43.11185 +A674 BD76
43.11186 +A675 BD77
43.11187 +A676 BD78
43.11188 +A677 BD79
43.11189 +A678 BD7A
43.11190 +A679 BD7B
43.11191 +A67A BD7C
43.11192 +A67B BD7D
43.11193 +A67C BD7E
43.11194 +A67D BD7F
43.11195 +A681 BD80
43.11196 +A682 BD81
43.11197 +A683 BD82
43.11198 +A684 BD83
43.11199 +A685 BD84
43.11200 +A686 BD85
43.11201 +A687 BD86
43.11202 +A688 BD87
43.11203 +A689 BD88
43.11204 +A68A BD89
43.11205 +A68B BD8A
43.11206 +A68C BD8B
43.11207 +A68D BD8C
43.11208 +A68E BD8D
43.11209 +A68F BD8E
43.11210 +A690 BD8F
43.11211 +A691 BD90
43.11212 +A693 BD91
43.11213 +A694 BD92
43.11214 +A695 BD93
43.11215 +A696 BD94
43.11216 +A697 BD95
43.11217 +A698 BD96
43.11218 +A699 BD97
43.11219 +A69A BD98
43.11220 +A69B BD99
43.11221 +A69C BD9A
43.11222 +A69D BD9B
43.11223 +A6A1 BD9C
43.11224 +A6A2 BD9D
43.11225 +A6A3 BD9E
43.11226 +A6A4 BD9F
43.11227 +A6A5 BDA0
43.11228 +A6A6 BDA1
43.11229 +A6A7 BDA2
43.11230 +A6A8 BDA3
43.11231 +A6A9 BDA4
43.11232 +A6AA BDA5
43.11233 +A6AB BDA6
43.11234 +A6AC BDA7
43.11235 +A6AD BDA8
43.11236 +A6AE BDA9
43.11237 +A6AF BDAA
43.11238 +A6B0 BDAB
43.11239 +A6B1 BDAC
43.11240 +A6B3 BDAD
43.11241 +A6B4 BDAE
43.11242 +A6B5 BDAF
43.11243 +A6B6 BDB0
43.11244 +A6B7 BDB1
43.11245 +A6B8 BDB2
43.11246 +A6B9 BDB3
43.11247 +A6BA BDB4
43.11248 +A6BB BDB5
43.11249 +A6BC BDB6
43.11250 +A6BD BDB7
43.11251 +A6C1 BDB8
43.11252 +A6C2 BDB9
43.11253 +A6C3 BDBA
43.11254 +A6C4 BDBB
43.11255 +A6C5 BDBC
43.11256 +A6C6 BDBD
43.11257 +A6C7 BDBE
43.11258 +A6C8 BDBF
43.11259 +A6C9 BDC0
43.11260 +A6CA BDC1
43.11261 +A6CB BDC2
43.11262 +A6CC BDC3
43.11263 +A6CD BDC4
43.11264 +A6CE BDC5
43.11265 +A6CF BDC6
43.11266 +A6D0 BDC7
43.11267 +A6D1 BDC8
43.11268 +A6D3 BDC9
43.11269 +A6D4 BDCA
43.11270 +A6D5 BDCB
43.11271 +A6D6 BDCC
43.11272 +A6D7 BDCD
43.11273 +A6D8 BDCE
43.11274 +A6D9 BDCF
43.11275 +A6DA BDD0
43.11276 +A6DB BDD1
43.11277 +A6DC BDD2
43.11278 +A6DD BDD3
43.11279 +A6E1 BDD4
43.11280 +A6E2 BDD5
43.11281 +A6E3 BDD6
43.11282 +A6E4 BDD7
43.11283 +A6E5 BDD8
43.11284 +A6E6 BDD9
43.11285 +A6E7 BDDA
43.11286 +A6E8 BDDB
43.11287 +A6E9 BDDC
43.11288 +A6EA BDDD
43.11289 +A6EB BDDE
43.11290 +A6EC BDDF
43.11291 +A6ED BDE0
43.11292 +A6EE BDE1
43.11293 +A6EF BDE2
43.11294 +A6F0 BDE3
43.11295 +A6F1 BDE4
43.11296 +A6F3 BDE5
43.11297 +A6F4 BDE6
43.11298 +A6F5 BDE7
43.11299 +A6F6 BDE8
43.11300 +A6F7 BDE9
43.11301 +A6F8 BDEA
43.11302 +A6F9 BDEB
43.11303 +A6FA BDEC
43.11304 +A6FB BDED
43.11305 +A6FC BDEE
43.11306 +A6FD BDEF
43.11307 +A741 BDF0
43.11308 +A742 BDF1
43.11309 +A743 BDF2
43.11310 +A744 BDF3
43.11311 +A745 BDF4
43.11312 +A746 BDF5
43.11313 +A747 BDF6
43.11314 +A748 BDF7
43.11315 +A749 BDF8
43.11316 +A74A BDF9
43.11317 +A74B BDFA
43.11318 +A74C BDFB
43.11319 +A74D BDFC
43.11320 +A74E BDFD
43.11321 +A74F BDFE
43.11322 +A750 BDFF
43.11323 +A751 BE00
43.11324 +A753 BE01
43.11325 +A754 BE02
43.11326 +A755 BE03
43.11327 +A756 BE04
43.11328 +A757 BE05
43.11329 +A758 BE06
43.11330 +A759 BE07
43.11331 +A75A BE08
43.11332 +A75B BE09
43.11333 +A75C BE0A
43.11334 +A75D BE0B
43.11335 +A761 BE0C
43.11336 +A762 BE0D
43.11337 +A763 BE0E
43.11338 +A764 BE0F
43.11339 +A765 BE10
43.11340 +A766 BE11
43.11341 +A767 BE12
43.11342 +A768 BE13
43.11343 +A769 BE14
43.11344 +A76A BE15
43.11345 +A76B BE16
43.11346 +A76C BE17
43.11347 +A76D BE18
43.11348 +A76E BE19
43.11349 +A76F BE1A
43.11350 +A770 BE1B
43.11351 +A771 BE1C
43.11352 +A773 BE1D
43.11353 +A774 BE1E
43.11354 +A775 BE1F
43.11355 +A776 BE20
43.11356 +A777 BE21
43.11357 +A778 BE22
43.11358 +A779 BE23
43.11359 +A77A BE24
43.11360 +A77B BE25
43.11361 +A77C BE26
43.11362 +A77D BE27
43.11363 +A781 BE28
43.11364 +A782 BE29
43.11365 +A783 BE2A
43.11366 +A784 BE2B
43.11367 +A785 BE2C
43.11368 +A786 BE2D
43.11369 +A787 BE2E
43.11370 +A788 BE2F
43.11371 +A789 BE30
43.11372 +A78A BE31
43.11373 +A78B BE32
43.11374 +A78C BE33
43.11375 +A78D BE34
43.11376 +A78E BE35
43.11377 +A78F BE36
43.11378 +A790 BE37
43.11379 +A791 BE38
43.11380 +A793 BE39
43.11381 +A794 BE3A
43.11382 +A795 BE3B
43.11383 +A796 BE3C
43.11384 +A797 BE3D
43.11385 +A798 BE3E
43.11386 +A799 BE3F
43.11387 +A79A BE40
43.11388 +A79B BE41
43.11389 +A79C BE42
43.11390 +A79D BE43
43.11391 +A7A1 BE44
43.11392 +A7A2 BE45
43.11393 +A7A3 BE46
43.11394 +A7A4 BE47
43.11395 +A7A5 BE48
43.11396 +A7A6 BE49
43.11397 +A7A7 BE4A
43.11398 +A7A8 BE4B
43.11399 +A7A9 BE4C
43.11400 +A7AA BE4D
43.11401 +A7AB BE4E
43.11402 +A7AC BE4F
43.11403 +A7AD BE50
43.11404 +A7AE BE51
43.11405 +A7AF BE52
43.11406 +A7B0 BE53
43.11407 +A7B1 BE54
43.11408 +A7B3 BE55
43.11409 +A7B4 BE56
43.11410 +A7B5 BE57
43.11411 +A7B6 BE58
43.11412 +A7B7 BE59
43.11413 +A7B8 BE5A
43.11414 +A7B9 BE5B
43.11415 +A7BA BE5C
43.11416 +A7BB BE5D
43.11417 +A7BC BE5E
43.11418 +A7BD BE5F
43.11419 +A841 3143
43.11420 +A861 BE60
43.11421 +A862 BE61
43.11422 +A863 BE62
43.11423 +A864 BE63
43.11424 +A865 BE64
43.11425 +A866 BE65
43.11426 +A867 BE66
43.11427 +A868 BE67
43.11428 +A869 BE68
43.11429 +A86A BE69
43.11430 +A86B BE6A
43.11431 +A86C BE6B
43.11432 +A86D BE6C
43.11433 +A86E BE6D
43.11434 +A86F BE6E
43.11435 +A870 BE6F
43.11436 +A871 BE70
43.11437 +A873 BE71
43.11438 +A874 BE72
43.11439 +A875 BE73
43.11440 +A876 BE74
43.11441 +A877 BE75
43.11442 +A878 BE76
43.11443 +A879 BE77
43.11444 +A87A BE78
43.11445 +A87B BE79
43.11446 +A87C BE7A
43.11447 +A87D BE7B
43.11448 +A881 BE7C
43.11449 +A882 BE7D
43.11450 +A883 BE7E
43.11451 +A884 BE7F
43.11452 +A885 BE80
43.11453 +A886 BE81
43.11454 +A887 BE82
43.11455 +A888 BE83
43.11456 +A889 BE84
43.11457 +A88A BE85
43.11458 +A88B BE86
43.11459 +A88C BE87
43.11460 +A88D BE88
43.11461 +A88E BE89
43.11462 +A88F BE8A
43.11463 +A890 BE8B
43.11464 +A891 BE8C
43.11465 +A893 BE8D
43.11466 +A894 BE8E
43.11467 +A895 BE8F
43.11468 +A896 BE90
43.11469 +A897 BE91
43.11470 +A898 BE92
43.11471 +A899 BE93
43.11472 +A89A BE94
43.11473 +A89B BE95
43.11474 +A89C BE96
43.11475 +A89D BE97
43.11476 +A8A1 BE98
43.11477 +A8A2 BE99
43.11478 +A8A3 BE9A
43.11479 +A8A4 BE9B
43.11480 +A8A5 BE9C
43.11481 +A8A6 BE9D
43.11482 +A8A7 BE9E
43.11483 +A8A8 BE9F
43.11484 +A8A9 BEA0
43.11485 +A8AA BEA1
43.11486 +A8AB BEA2
43.11487 +A8AC BEA3
43.11488 +A8AD BEA4
43.11489 +A8AE BEA5
43.11490 +A8AF BEA6
43.11491 +A8B0 BEA7
43.11492 +A8B1 BEA8
43.11493 +A8B3 BEA9
43.11494 +A8B4 BEAA
43.11495 +A8B5 BEAB
43.11496 +A8B6 BEAC
43.11497 +A8B7 BEAD
43.11498 +A8B8 BEAE
43.11499 +A8B9 BEAF
43.11500 +A8BA BEB0
43.11501 +A8BB BEB1
43.11502 +A8BC BEB2
43.11503 +A8BD BEB3
43.11504 +A8C1 BEB4
43.11505 +A8C2 BEB5
43.11506 +A8C3 BEB6
43.11507 +A8C4 BEB7
43.11508 +A8C5 BEB8
43.11509 +A8C6 BEB9
43.11510 +A8C7 BEBA
43.11511 +A8C8 BEBB
43.11512 +A8C9 BEBC
43.11513 +A8CA BEBD
43.11514 +A8CB BEBE
43.11515 +A8CC BEBF
43.11516 +A8CD BEC0
43.11517 +A8CE BEC1
43.11518 +A8CF BEC2
43.11519 +A8D0 BEC3
43.11520 +A8D1 BEC4
43.11521 +A8D3 BEC5
43.11522 +A8D4 BEC6
43.11523 +A8D5 BEC7
43.11524 +A8D6 BEC8
43.11525 +A8D7 BEC9
43.11526 +A8D8 BECA
43.11527 +A8D9 BECB
43.11528 +A8DA BECC
43.11529 +A8DB BECD
43.11530 +A8DC BECE
43.11531 +A8DD BECF
43.11532 +A8E1 BED0
43.11533 +A8E2 BED1
43.11534 +A8E3 BED2
43.11535 +A8E4 BED3
43.11536 +A8E5 BED4
43.11537 +A8E6 BED5
43.11538 +A8E7 BED6
43.11539 +A8E8 BED7
43.11540 +A8E9 BED8
43.11541 +A8EA BED9
43.11542 +A8EB BEDA
43.11543 +A8EC BEDB
43.11544 +A8ED BEDC
43.11545 +A8EE BEDD
43.11546 +A8EF BEDE
43.11547 +A8F0 BEDF
43.11548 +A8F1 BEE0
43.11549 +A8F3 BEE1
43.11550 +A8F4 BEE2
43.11551 +A8F5 BEE3
43.11552 +A8F6 BEE4
43.11553 +A8F7 BEE5
43.11554 +A8F8 BEE6
43.11555 +A8F9 BEE7
43.11556 +A8FA BEE8
43.11557 +A8FB BEE9
43.11558 +A8FC BEEA
43.11559 +A8FD BEEB
43.11560 +A941 BEEC
43.11561 +A942 BEED
43.11562 +A943 BEEE
43.11563 +A944 BEEF
43.11564 +A945 BEF0
43.11565 +A946 BEF1
43.11566 +A947 BEF2
43.11567 +A948 BEF3
43.11568 +A949 BEF4
43.11569 +A94A BEF5
43.11570 +A94B BEF6
43.11571 +A94C BEF7
43.11572 +A94D BEF8
43.11573 +A94E BEF9
43.11574 +A94F BEFA
43.11575 +A950 BEFB
43.11576 +A951 BEFC
43.11577 +A953 BEFD
43.11578 +A954 BEFE
43.11579 +A955 BEFF
43.11580 +A956 BF00
43.11581 +A957 BF01
43.11582 +A958 BF02
43.11583 +A959 BF03
43.11584 +A95A BF04
43.11585 +A95B BF05
43.11586 +A95C BF06
43.11587 +A95D BF07
43.11588 +A961 BF08
43.11589 +A962 BF09
43.11590 +A963 BF0A
43.11591 +A964 BF0B
43.11592 +A965 BF0C
43.11593 +A966 BF0D
43.11594 +A967 BF0E
43.11595 +A968 BF0F
43.11596 +A969 BF10
43.11597 +A96A BF11
43.11598 +A96B BF12
43.11599 +A96C BF13
43.11600 +A96D BF14
43.11601 +A96E BF15
43.11602 +A96F BF16
43.11603 +A970 BF17
43.11604 +A971 BF18
43.11605 +A973 BF19
43.11606 +A974 BF1A
43.11607 +A975 BF1B
43.11608 +A976 BF1C
43.11609 +A977 BF1D
43.11610 +A978 BF1E
43.11611 +A979 BF1F
43.11612 +A97A BF20
43.11613 +A97B BF21
43.11614 +A97C BF22
43.11615 +A97D BF23
43.11616 +A981 BF24
43.11617 +A982 BF25
43.11618 +A983 BF26
43.11619 +A984 BF27
43.11620 +A985 BF28
43.11621 +A986 BF29
43.11622 +A987 BF2A
43.11623 +A988 BF2B
43.11624 +A989 BF2C
43.11625 +A98A BF2D
43.11626 +A98B BF2E
43.11627 +A98C BF2F
43.11628 +A98D BF30
43.11629 +A98E BF31
43.11630 +A98F BF32
43.11631 +A990 BF33
43.11632 +A991 BF34
43.11633 +A993 BF35
43.11634 +A994 BF36
43.11635 +A995 BF37
43.11636 +A996 BF38
43.11637 +A997 BF39
43.11638 +A998 BF3A
43.11639 +A999 BF3B
43.11640 +A99A BF3C
43.11641 +A99B BF3D
43.11642 +A99C BF3E
43.11643 +A99D BF3F
43.11644 +A9A1 BF40
43.11645 +A9A2 BF41
43.11646 +A9A3 BF42
43.11647 +A9A4 BF43
43.11648 +A9A5 BF44
43.11649 +A9A6 BF45
43.11650 +A9A7 BF46
43.11651 +A9A8 BF47
43.11652 +A9A9 BF48
43.11653 +A9AA BF49
43.11654 +A9AB BF4A
43.11655 +A9AC BF4B
43.11656 +A9AD BF4C
43.11657 +A9AE BF4D
43.11658 +A9AF BF4E
43.11659 +A9B0 BF4F
43.11660 +A9B1 BF50
43.11661 +A9B3 BF51
43.11662 +A9B4 BF52
43.11663 +A9B5 BF53
43.11664 +A9B6 BF54
43.11665 +A9B7 BF55
43.11666 +A9B8 BF56
43.11667 +A9B9 BF57
43.11668 +A9BA BF58
43.11669 +A9BB BF59
43.11670 +A9BC BF5A
43.11671 +A9BD BF5B
43.11672 +A9C1 BF5C
43.11673 +A9C2 BF5D
43.11674 +A9C3 BF5E
43.11675 +A9C4 BF5F
43.11676 +A9C5 BF60
43.11677 +A9C6 BF61
43.11678 +A9C7 BF62
43.11679 +A9C8 BF63
43.11680 +A9C9 BF64
43.11681 +A9CA BF65
43.11682 +A9CB BF66
43.11683 +A9CC BF67
43.11684 +A9CD BF68
43.11685 +A9CE BF69
43.11686 +A9CF BF6A
43.11687 +A9D0 BF6B
43.11688 +A9D1 BF6C
43.11689 +A9D3 BF6D
43.11690 +A9D4 BF6E
43.11691 +A9D5 BF6F
43.11692 +A9D6 BF70
43.11693 +A9D7 BF71
43.11694 +A9D8 BF72
43.11695 +A9D9 BF73
43.11696 +A9DA BF74
43.11697 +A9DB BF75
43.11698 +A9DC BF76
43.11699 +A9DD BF77
43.11700 +A9E1 BF78
43.11701 +A9E2 BF79
43.11702 +A9E3 BF7A
43.11703 +A9E4 BF7B
43.11704 +A9E5 BF7C
43.11705 +A9E6 BF7D
43.11706 +A9E7 BF7E
43.11707 +A9E8 BF7F
43.11708 +A9E9 BF80
43.11709 +A9EA BF81
43.11710 +A9EB BF82
43.11711 +A9EC BF83
43.11712 +A9ED BF84
43.11713 +A9EE BF85
43.11714 +A9EF BF86
43.11715 +A9F0 BF87
43.11716 +A9F1 BF88
43.11717 +A9F3 BF89
43.11718 +A9F4 BF8A
43.11719 +A9F5 BF8B
43.11720 +A9F6 BF8C
43.11721 +A9F7 BF8D
43.11722 +A9F8 BF8E
43.11723 +A9F9 BF8F
43.11724 +A9FA BF90
43.11725 +A9FB BF91
43.11726 +A9FC BF92
43.11727 +A9FD BF93
43.11728 +AA41 BF94
43.11729 +AA42 BF95
43.11730 +AA43 BF96
43.11731 +AA44 BF97
43.11732 +AA45 BF98
43.11733 +AA46 BF99
43.11734 +AA47 BF9A
43.11735 +AA48 BF9B
43.11736 +AA49 BF9C
43.11737 +AA4A BF9D
43.11738 +AA4B BF9E
43.11739 +AA4C BF9F
43.11740 +AA4D BFA0
43.11741 +AA4E BFA1
43.11742 +AA4F BFA2
43.11743 +AA50 BFA3
43.11744 +AA51 BFA4
43.11745 +AA53 BFA5
43.11746 +AA54 BFA6
43.11747 +AA55 BFA7
43.11748 +AA56 BFA8
43.11749 +AA57 BFA9
43.11750 +AA58 BFAA
43.11751 +AA59 BFAB
43.11752 +AA5A BFAC
43.11753 +AA5B BFAD
43.11754 +AA5C BFAE
43.11755 +AA5D BFAF
43.11756 +AA61 BFB0
43.11757 +AA62 BFB1
43.11758 +AA63 BFB2
43.11759 +AA64 BFB3
43.11760 +AA65 BFB4
43.11761 +AA66 BFB5
43.11762 +AA67 BFB6
43.11763 +AA68 BFB7
43.11764 +AA69 BFB8
43.11765 +AA6A BFB9
43.11766 +AA6B BFBA
43.11767 +AA6C BFBB
43.11768 +AA6D BFBC
43.11769 +AA6E BFBD
43.11770 +AA6F BFBE
43.11771 +AA70 BFBF
43.11772 +AA71 BFC0
43.11773 +AA73 BFC1
43.11774 +AA74 BFC2
43.11775 +AA75 BFC3
43.11776 +AA76 BFC4
43.11777 +AA77 BFC5
43.11778 +AA78 BFC6
43.11779 +AA79 BFC7
43.11780 +AA7A BFC8
43.11781 +AA7B BFC9
43.11782 +AA7C BFCA
43.11783 +AA7D BFCB
43.11784 +AA81 BFCC
43.11785 +AA82 BFCD
43.11786 +AA83 BFCE
43.11787 +AA84 BFCF
43.11788 +AA85 BFD0
43.11789 +AA86 BFD1
43.11790 +AA87 BFD2
43.11791 +AA88 BFD3
43.11792 +AA89 BFD4
43.11793 +AA8A BFD5
43.11794 +AA8B BFD6
43.11795 +AA8C BFD7
43.11796 +AA8D BFD8
43.11797 +AA8E BFD9
43.11798 +AA8F BFDA
43.11799 +AA90 BFDB
43.11800 +AA91 BFDC
43.11801 +AA93 BFDD
43.11802 +AA94 BFDE
43.11803 +AA95 BFDF
43.11804 +AA96 BFE0
43.11805 +AA97 BFE1
43.11806 +AA98 BFE2
43.11807 +AA99 BFE3
43.11808 +AA9A BFE4
43.11809 +AA9B BFE5
43.11810 +AA9C BFE6
43.11811 +AA9D BFE7
43.11812 +AAA1 BFE8
43.11813 +AAA2 BFE9
43.11814 +AAA3 BFEA
43.11815 +AAA4 BFEB
43.11816 +AAA5 BFEC
43.11817 +AAA6 BFED
43.11818 +AAA7 BFEE
43.11819 +AAA8 BFEF
43.11820 +AAA9 BFF0
43.11821 +AAAA BFF1
43.11822 +AAAB BFF2
43.11823 +AAAC BFF3
43.11824 +AAAD BFF4
43.11825 +AAAE BFF5
43.11826 +AAAF BFF6
43.11827 +AAB0 BFF7
43.11828 +AAB1 BFF8
43.11829 +AAB3 BFF9
43.11830 +AAB4 BFFA
43.11831 +AAB5 BFFB
43.11832 +AAB6 BFFC
43.11833 +AAB7 BFFD
43.11834 +AAB8 BFFE
43.11835 +AAB9 BFFF
43.11836 +AABA C000
43.11837 +AABB C001
43.11838 +AABC C002
43.11839 +AABD C003
43.11840 +AAC1 C004
43.11841 +AAC2 C005
43.11842 +AAC3 C006
43.11843 +AAC4 C007
43.11844 +AAC5 C008
43.11845 +AAC6 C009
43.11846 +AAC7 C00A
43.11847 +AAC8 C00B
43.11848 +AAC9 C00C
43.11849 +AACA C00D
43.11850 +AACB C00E
43.11851 +AACC C00F
43.11852 +AACD C010
43.11853 +AACE C011
43.11854 +AACF C012
43.11855 +AAD0 C013
43.11856 +AAD1 C014
43.11857 +AAD3 C015
43.11858 +AAD4 C016
43.11859 +AAD5 C017
43.11860 +AAD6 C018
43.11861 +AAD7 C019
43.11862 +AAD8 C01A
43.11863 +AAD9 C01B
43.11864 +AADA C01C
43.11865 +AADB C01D
43.11866 +AADC C01E
43.11867 +AADD C01F
43.11868 +AAE1 C020
43.11869 +AAE2 C021
43.11870 +AAE3 C022
43.11871 +AAE4 C023
43.11872 +AAE5 C024
43.11873 +AAE6 C025
43.11874 +AAE7 C026
43.11875 +AAE8 C027
43.11876 +AAE9 C028
43.11877 +AAEA C029
43.11878 +AAEB C02A
43.11879 +AAEC C02B
43.11880 +AAED C02C
43.11881 +AAEE C02D
43.11882 +AAEF C02E
43.11883 +AAF0 C02F
43.11884 +AAF1 C030
43.11885 +AAF3 C031
43.11886 +AAF4 C032
43.11887 +AAF5 C033
43.11888 +AAF6 C034
43.11889 +AAF7 C035
43.11890 +AAF8 C036
43.11891 +AAF9 C037
43.11892 +AAFA C038
43.11893 +AAFB C039
43.11894 +AAFC C03A
43.11895 +AAFD C03B
43.11896 +AB41 C03C
43.11897 +AB42 C03D
43.11898 +AB43 C03E
43.11899 +AB44 C03F
43.11900 +AB45 C040
43.11901 +AB46 C041
43.11902 +AB47 C042
43.11903 +AB48 C043
43.11904 +AB49 C044
43.11905 +AB4A C045
43.11906 +AB4B C046
43.11907 +AB4C C047
43.11908 +AB4D C048
43.11909 +AB4E C049
43.11910 +AB4F C04A
43.11911 +AB50 C04B
43.11912 +AB51 C04C
43.11913 +AB53 C04D
43.11914 +AB54 C04E
43.11915 +AB55 C04F
43.11916 +AB56 C050
43.11917 +AB57 C051
43.11918 +AB58 C052
43.11919 +AB59 C053
43.11920 +AB5A C054
43.11921 +AB5B C055
43.11922 +AB5C C056
43.11923 +AB5D C057
43.11924 +AB61 C058
43.11925 +AB62 C059
43.11926 +AB63 C05A
43.11927 +AB64 C05B
43.11928 +AB65 C05C
43.11929 +AB66 C05D
43.11930 +AB67 C05E
43.11931 +AB68 C05F
43.11932 +AB69 C060
43.11933 +AB6A C061
43.11934 +AB6B C062
43.11935 +AB6C C063
43.11936 +AB6D C064
43.11937 +AB6E C065
43.11938 +AB6F C066
43.11939 +AB70 C067
43.11940 +AB71 C068
43.11941 +AB73 C069
43.11942 +AB74 C06A
43.11943 +AB75 C06B
43.11944 +AB76 C06C
43.11945 +AB77 C06D
43.11946 +AB78 C06E
43.11947 +AB79 C06F
43.11948 +AB7A C070
43.11949 +AB7B C071
43.11950 +AB7C C072
43.11951 +AB7D C073
43.11952 +AB81 C074
43.11953 +AB82 C075
43.11954 +AB83 C076
43.11955 +AB84 C077
43.11956 +AB85 C078
43.11957 +AB86 C079
43.11958 +AB87 C07A
43.11959 +AB88 C07B
43.11960 +AB89 C07C
43.11961 +AB8A C07D
43.11962 +AB8B C07E
43.11963 +AB8C C07F
43.11964 +AB8D C080
43.11965 +AB8E C081
43.11966 +AB8F C082
43.11967 +AB90 C083
43.11968 +AB91 C084
43.11969 +AB93 C085
43.11970 +AB94 C086
43.11971 +AB95 C087
43.11972 +AB96 C088
43.11973 +AB97 C089
43.11974 +AB98 C08A
43.11975 +AB99 C08B
43.11976 +AB9A C08C
43.11977 +AB9B C08D
43.11978 +AB9C C08E
43.11979 +AB9D C08F
43.11980 +ABA1 C090
43.11981 +ABA2 C091
43.11982 +ABA3 C092
43.11983 +ABA4 C093
43.11984 +ABA5 C094
43.11985 +ABA6 C095
43.11986 +ABA7 C096
43.11987 +ABA8 C097
43.11988 +ABA9 C098
43.11989 +ABAA C099
43.11990 +ABAB C09A
43.11991 +ABAC C09B
43.11992 +ABAD C09C
43.11993 +ABAE C09D
43.11994 +ABAF C09E
43.11995 +ABB0 C09F
43.11996 +ABB1 C0A0
43.11997 +ABB3 C0A1
43.11998 +ABB4 C0A2
43.11999 +ABB5 C0A3
43.12000 +ABB6 C0A4
43.12001 +ABB7 C0A5
43.12002 +ABB8 C0A6
43.12003 +ABB9 C0A7
43.12004 +ABBA C0A8
43.12005 +ABBB C0A9
43.12006 +ABBC C0AA
43.12007 +ABBD C0AB
43.12008 +AC41 3145
43.12009 +AC61 C0AC
43.12010 +AC62 C0AD
43.12011 +AC63 C0AE
43.12012 +AC64 C0AF
43.12013 +AC65 C0B0
43.12014 +AC66 C0B1
43.12015 +AC67 C0B2
43.12016 +AC68 C0B3
43.12017 +AC69 C0B4
43.12018 +AC6A C0B5
43.12019 +AC6B C0B6
43.12020 +AC6C C0B7
43.12021 +AC6D C0B8
43.12022 +AC6E C0B9
43.12023 +AC6F C0BA
43.12024 +AC70 C0BB
43.12025 +AC71 C0BC
43.12026 +AC73 C0BD
43.12027 +AC74 C0BE
43.12028 +AC75 C0BF
43.12029 +AC76 C0C0
43.12030 +AC77 C0C1
43.12031 +AC78 C0C2
43.12032 +AC79 C0C3
43.12033 +AC7A C0C4
43.12034 +AC7B C0C5
43.12035 +AC7C C0C6
43.12036 +AC7D C0C7
43.12037 +AC81 C0C8
43.12038 +AC82 C0C9
43.12039 +AC83 C0CA
43.12040 +AC84 C0CB
43.12041 +AC85 C0CC
43.12042 +AC86 C0CD
43.12043 +AC87 C0CE
43.12044 +AC88 C0CF
43.12045 +AC89 C0D0
43.12046 +AC8A C0D1
43.12047 +AC8B C0D2
43.12048 +AC8C C0D3
43.12049 +AC8D C0D4
43.12050 +AC8E C0D5
43.12051 +AC8F C0D6
43.12052 +AC90 C0D7
43.12053 +AC91 C0D8
43.12054 +AC93 C0D9
43.12055 +AC94 C0DA
43.12056 +AC95 C0DB
43.12057 +AC96 C0DC
43.12058 +AC97 C0DD
43.12059 +AC98 C0DE
43.12060 +AC99 C0DF
43.12061 +AC9A C0E0
43.12062 +AC9B C0E1
43.12063 +AC9C C0E2
43.12064 +AC9D C0E3
43.12065 +ACA1 C0E4
43.12066 +ACA2 C0E5
43.12067 +ACA3 C0E6
43.12068 +ACA4 C0E7
43.12069 +ACA5 C0E8
43.12070 +ACA6 C0E9
43.12071 +ACA7 C0EA
43.12072 +ACA8 C0EB
43.12073 +ACA9 C0EC
43.12074 +ACAA C0ED
43.12075 +ACAB C0EE
43.12076 +ACAC C0EF
43.12077 +ACAD C0F0
43.12078 +ACAE C0F1
43.12079 +ACAF C0F2
43.12080 +ACB0 C0F3
43.12081 +ACB1 C0F4
43.12082 +ACB3 C0F5
43.12083 +ACB4 C0F6
43.12084 +ACB5 C0F7
43.12085 +ACB6 C0F8
43.12086 +ACB7 C0F9
43.12087 +ACB8 C0FA
43.12088 +ACB9 C0FB
43.12089 +ACBA C0FC
43.12090 +ACBB C0FD
43.12091 +ACBC C0FE
43.12092 +ACBD C0FF
43.12093 +ACC1 C100
43.12094 +ACC2 C101
43.12095 +ACC3 C102
43.12096 +ACC4 C103
43.12097 +ACC5 C104
43.12098 +ACC6 C105
43.12099 +ACC7 C106
43.12100 +ACC8 C107
43.12101 +ACC9 C108
43.12102 +ACCA C109
43.12103 +ACCB C10A
43.12104 +ACCC C10B
43.12105 +ACCD C10C
43.12106 +ACCE C10D
43.12107 +ACCF C10E
43.12108 +ACD0 C10F
43.12109 +ACD1 C110
43.12110 +ACD3 C111
43.12111 +ACD4 C112
43.12112 +ACD5 C113
43.12113 +ACD6 C114
43.12114 +ACD7 C115
43.12115 +ACD8 C116
43.12116 +ACD9 C117
43.12117 +ACDA C118
43.12118 +ACDB C119
43.12119 +ACDC C11A
43.12120 +ACDD C11B
43.12121 +ACE1 C11C
43.12122 +ACE2 C11D
43.12123 +ACE3 C11E
43.12124 +ACE4 C11F
43.12125 +ACE5 C120
43.12126 +ACE6 C121
43.12127 +ACE7 C122
43.12128 +ACE8 C123
43.12129 +ACE9 C124
43.12130 +ACEA C125
43.12131 +ACEB C126
43.12132 +ACEC C127
43.12133 +ACED C128
43.12134 +ACEE C129
43.12135 +ACEF C12A
43.12136 +ACF0 C12B
43.12137 +ACF1 C12C
43.12138 +ACF3 C12D
43.12139 +ACF4 C12E
43.12140 +ACF5 C12F
43.12141 +ACF6 C130
43.12142 +ACF7 C131
43.12143 +ACF8 C132
43.12144 +ACF9 C133
43.12145 +ACFA C134
43.12146 +ACFB C135
43.12147 +ACFC C136
43.12148 +ACFD C137
43.12149 +AD41 C138
43.12150 +AD42 C139
43.12151 +AD43 C13A
43.12152 +AD44 C13B
43.12153 +AD45 C13C
43.12154 +AD46 C13D
43.12155 +AD47 C13E
43.12156 +AD48 C13F
43.12157 +AD49 C140
43.12158 +AD4A C141
43.12159 +AD4B C142
43.12160 +AD4C C143
43.12161 +AD4D C144
43.12162 +AD4E C145
43.12163 +AD4F C146
43.12164 +AD50 C147
43.12165 +AD51 C148
43.12166 +AD53 C149
43.12167 +AD54 C14A
43.12168 +AD55 C14B
43.12169 +AD56 C14C
43.12170 +AD57 C14D
43.12171 +AD58 C14E
43.12172 +AD59 C14F
43.12173 +AD5A C150
43.12174 +AD5B C151
43.12175 +AD5C C152
43.12176 +AD5D C153
43.12177 +AD61 C154
43.12178 +AD62 C155
43.12179 +AD63 C156
43.12180 +AD64 C157
43.12181 +AD65 C158
43.12182 +AD66 C159
43.12183 +AD67 C15A
43.12184 +AD68 C15B
43.12185 +AD69 C15C
43.12186 +AD6A C15D
43.12187 +AD6B C15E
43.12188 +AD6C C15F
43.12189 +AD6D C160
43.12190 +AD6E C161
43.12191 +AD6F C162
43.12192 +AD70 C163
43.12193 +AD71 C164
43.12194 +AD73 C165
43.12195 +AD74 C166
43.12196 +AD75 C167
43.12197 +AD76 C168
43.12198 +AD77 C169
43.12199 +AD78 C16A
43.12200 +AD79 C16B
43.12201 +AD7A C16C
43.12202 +AD7B C16D
43.12203 +AD7C C16E
43.12204 +AD7D C16F
43.12205 +AD81 C170
43.12206 +AD82 C171
43.12207 +AD83 C172
43.12208 +AD84 C173
43.12209 +AD85 C174
43.12210 +AD86 C175
43.12211 +AD87 C176
43.12212 +AD88 C177
43.12213 +AD89 C178
43.12214 +AD8A C179
43.12215 +AD8B C17A
43.12216 +AD8C C17B
43.12217 +AD8D C17C
43.12218 +AD8E C17D
43.12219 +AD8F C17E
43.12220 +AD90 C17F
43.12221 +AD91 C180
43.12222 +AD93 C181
43.12223 +AD94 C182
43.12224 +AD95 C183
43.12225 +AD96 C184
43.12226 +AD97 C185
43.12227 +AD98 C186
43.12228 +AD99 C187
43.12229 +AD9A C188
43.12230 +AD9B C189
43.12231 +AD9C C18A
43.12232 +AD9D C18B
43.12233 +ADA1 C18C
43.12234 +ADA2 C18D
43.12235 +ADA3 C18E
43.12236 +ADA4 C18F
43.12237 +ADA5 C190
43.12238 +ADA6 C191
43.12239 +ADA7 C192
43.12240 +ADA8 C193
43.12241 +ADA9 C194
43.12242 +ADAA C195
43.12243 +ADAB C196
43.12244 +ADAC C197
43.12245 +ADAD C198
43.12246 +ADAE C199
43.12247 +ADAF C19A
43.12248 +ADB0 C19B
43.12249 +ADB1 C19C
43.12250 +ADB3 C19D
43.12251 +ADB4 C19E
43.12252 +ADB5 C19F
43.12253 +ADB6 C1A0
43.12254 +ADB7 C1A1
43.12255 +ADB8 C1A2
43.12256 +ADB9 C1A3
43.12257 +ADBA C1A4
43.12258 +ADBB C1A5
43.12259 +ADBC C1A6
43.12260 +ADBD C1A7
43.12261 +ADC1 C1A8
43.12262 +ADC2 C1A9
43.12263 +ADC3 C1AA
43.12264 +ADC4 C1AB
43.12265 +ADC5 C1AC
43.12266 +ADC6 C1AD
43.12267 +ADC7 C1AE
43.12268 +ADC8 C1AF
43.12269 +ADC9 C1B0
43.12270 +ADCA C1B1
43.12271 +ADCB C1B2
43.12272 +ADCC C1B3
43.12273 +ADCD C1B4
43.12274 +ADCE C1B5
43.12275 +ADCF C1B6
43.12276 +ADD0 C1B7
43.12277 +ADD1 C1B8
43.12278 +ADD3 C1B9
43.12279 +ADD4 C1BA
43.12280 +ADD5 C1BB
43.12281 +ADD6 C1BC
43.12282 +ADD7 C1BD
43.12283 +ADD8 C1BE
43.12284 +ADD9 C1BF
43.12285 +ADDA C1C0
43.12286 +ADDB C1C1
43.12287 +ADDC C1C2
43.12288 +ADDD C1C3
43.12289 +ADE1 C1C4
43.12290 +ADE2 C1C5
43.12291 +ADE3 C1C6
43.12292 +ADE4 C1C7
43.12293 +ADE5 C1C8
43.12294 +ADE6 C1C9
43.12295 +ADE7 C1CA
43.12296 +ADE8 C1CB
43.12297 +ADE9 C1CC
43.12298 +ADEA C1CD
43.12299 +ADEB C1CE
43.12300 +ADEC C1CF
43.12301 +ADED C1D0
43.12302 +ADEE C1D1
43.12303 +ADEF C1D2
43.12304 +ADF0 C1D3
43.12305 +ADF1 C1D4
43.12306 +ADF3 C1D5
43.12307 +ADF4 C1D6
43.12308 +ADF5 C1D7
43.12309 +ADF6 C1D8
43.12310 +ADF7 C1D9
43.12311 +ADF8 C1DA
43.12312 +ADF9 C1DB
43.12313 +ADFA C1DC
43.12314 +ADFB C1DD
43.12315 +ADFC C1DE
43.12316 +ADFD C1DF
43.12317 +AE41 C1E0
43.12318 +AE42 C1E1
43.12319 +AE43 C1E2
43.12320 +AE44 C1E3
43.12321 +AE45 C1E4
43.12322 +AE46 C1E5
43.12323 +AE47 C1E6
43.12324 +AE48 C1E7
43.12325 +AE49 C1E8
43.12326 +AE4A C1E9
43.12327 +AE4B C1EA
43.12328 +AE4C C1EB
43.12329 +AE4D C1EC
43.12330 +AE4E C1ED
43.12331 +AE4F C1EE
43.12332 +AE50 C1EF
43.12333 +AE51 C1F0
43.12334 +AE53 C1F1
43.12335 +AE54 C1F2
43.12336 +AE55 C1F3
43.12337 +AE56 C1F4
43.12338 +AE57 C1F5
43.12339 +AE58 C1F6
43.12340 +AE59 C1F7
43.12341 +AE5A C1F8
43.12342 +AE5B C1F9
43.12343 +AE5C C1FA
43.12344 +AE5D C1FB
43.12345 +AE61 C1FC
43.12346 +AE62 C1FD
43.12347 +AE63 C1FE
43.12348 +AE64 C1FF
43.12349 +AE65 C200
43.12350 +AE66 C201
43.12351 +AE67 C202
43.12352 +AE68 C203
43.12353 +AE69 C204
43.12354 +AE6A C205
43.12355 +AE6B C206
43.12356 +AE6C C207
43.12357 +AE6D C208
43.12358 +AE6E C209
43.12359 +AE6F C20A
43.12360 +AE70 C20B
43.12361 +AE71 C20C
43.12362 +AE73 C20D
43.12363 +AE74 C20E
43.12364 +AE75 C20F
43.12365 +AE76 C210
43.12366 +AE77 C211
43.12367 +AE78 C212
43.12368 +AE79 C213
43.12369 +AE7A C214
43.12370 +AE7B C215
43.12371 +AE7C C216
43.12372 +AE7D C217
43.12373 +AE81 C218
43.12374 +AE82 C219
43.12375 +AE83 C21A
43.12376 +AE84 C21B
43.12377 +AE85 C21C
43.12378 +AE86 C21D
43.12379 +AE87 C21E
43.12380 +AE88 C21F
43.12381 +AE89 C220
43.12382 +AE8A C221
43.12383 +AE8B C222
43.12384 +AE8C C223
43.12385 +AE8D C224
43.12386 +AE8E C225
43.12387 +AE8F C226
43.12388 +AE90 C227
43.12389 +AE91 C228
43.12390 +AE93 C229
43.12391 +AE94 C22A
43.12392 +AE95 C22B
43.12393 +AE96 C22C
43.12394 +AE97 C22D
43.12395 +AE98 C22E
43.12396 +AE99 C22F
43.12397 +AE9A C230
43.12398 +AE9B C231
43.12399 +AE9C C232
43.12400 +AE9D C233
43.12401 +AEA1 C234
43.12402 +AEA2 C235
43.12403 +AEA3 C236
43.12404 +AEA4 C237
43.12405 +AEA5 C238
43.12406 +AEA6 C239
43.12407 +AEA7 C23A
43.12408 +AEA8 C23B
43.12409 +AEA9 C23C
43.12410 +AEAA C23D
43.12411 +AEAB C23E
43.12412 +AEAC C23F
43.12413 +AEAD C240
43.12414 +AEAE C241
43.12415 +AEAF C242
43.12416 +AEB0 C243
43.12417 +AEB1 C244
43.12418 +AEB3 C245
43.12419 +AEB4 C246
43.12420 +AEB5 C247
43.12421 +AEB6 C248
43.12422 +AEB7 C249
43.12423 +AEB8 C24A
43.12424 +AEB9 C24B
43.12425 +AEBA C24C
43.12426 +AEBB C24D
43.12427 +AEBC C24E
43.12428 +AEBD C24F
43.12429 +AEC1 C250
43.12430 +AEC2 C251
43.12431 +AEC3 C252
43.12432 +AEC4 C253
43.12433 +AEC5 C254
43.12434 +AEC6 C255
43.12435 +AEC7 C256
43.12436 +AEC8 C257
43.12437 +AEC9 C258
43.12438 +AECA C259
43.12439 +AECB C25A
43.12440 +AECC C25B
43.12441 +AECD C25C
43.12442 +AECE C25D
43.12443 +AECF C25E
43.12444 +AED0 C25F
43.12445 +AED1 C260
43.12446 +AED3 C261
43.12447 +AED4 C262
43.12448 +AED5 C263
43.12449 +AED6 C264
43.12450 +AED7 C265
43.12451 +AED8 C266
43.12452 +AED9 C267
43.12453 +AEDA C268
43.12454 +AEDB C269
43.12455 +AEDC C26A
43.12456 +AEDD C26B
43.12457 +AEE1 C26C
43.12458 +AEE2 C26D
43.12459 +AEE3 C26E
43.12460 +AEE4 C26F
43.12461 +AEE5 C270
43.12462 +AEE6 C271
43.12463 +AEE7 C272
43.12464 +AEE8 C273
43.12465 +AEE9 C274
43.12466 +AEEA C275
43.12467 +AEEB C276
43.12468 +AEEC C277
43.12469 +AEED C278
43.12470 +AEEE C279
43.12471 +AEEF C27A
43.12472 +AEF0 C27B
43.12473 +AEF1 C27C
43.12474 +AEF3 C27D
43.12475 +AEF4 C27E
43.12476 +AEF5 C27F
43.12477 +AEF6 C280
43.12478 +AEF7 C281
43.12479 +AEF8 C282
43.12480 +AEF9 C283
43.12481 +AEFA C284
43.12482 +AEFB C285
43.12483 +AEFC C286
43.12484 +AEFD C287
43.12485 +AF41 C288
43.12486 +AF42 C289
43.12487 +AF43 C28A
43.12488 +AF44 C28B
43.12489 +AF45 C28C
43.12490 +AF46 C28D
43.12491 +AF47 C28E
43.12492 +AF48 C28F
43.12493 +AF49 C290
43.12494 +AF4A C291
43.12495 +AF4B C292
43.12496 +AF4C C293
43.12497 +AF4D C294
43.12498 +AF4E C295
43.12499 +AF4F C296
43.12500 +AF50 C297
43.12501 +AF51 C298
43.12502 +AF53 C299
43.12503 +AF54 C29A
43.12504 +AF55 C29B
43.12505 +AF56 C29C
43.12506 +AF57 C29D
43.12507 +AF58 C29E
43.12508 +AF59 C29F
43.12509 +AF5A C2A0
43.12510 +AF5B C2A1
43.12511 +AF5C C2A2
43.12512 +AF5D C2A3
43.12513 +AF61 C2A4
43.12514 +AF62 C2A5
43.12515 +AF63 C2A6
43.12516 +AF64 C2A7
43.12517 +AF65 C2A8
43.12518 +AF66 C2A9
43.12519 +AF67 C2AA
43.12520 +AF68 C2AB
43.12521 +AF69 C2AC
43.12522 +AF6A C2AD
43.12523 +AF6B C2AE
43.12524 +AF6C C2AF
43.12525 +AF6D C2B0
43.12526 +AF6E C2B1
43.12527 +AF6F C2B2
43.12528 +AF70 C2B3
43.12529 +AF71 C2B4
43.12530 +AF73 C2B5
43.12531 +AF74 C2B6
43.12532 +AF75 C2B7
43.12533 +AF76 C2B8
43.12534 +AF77 C2B9
43.12535 +AF78 C2BA
43.12536 +AF79 C2BB
43.12537 +AF7A C2BC
43.12538 +AF7B C2BD
43.12539 +AF7C C2BE
43.12540 +AF7D C2BF
43.12541 +AF81 C2C0
43.12542 +AF82 C2C1
43.12543 +AF83 C2C2
43.12544 +AF84 C2C3
43.12545 +AF85 C2C4
43.12546 +AF86 C2C5
43.12547 +AF87 C2C6
43.12548 +AF88 C2C7
43.12549 +AF89 C2C8
43.12550 +AF8A C2C9
43.12551 +AF8B C2CA
43.12552 +AF8C C2CB
43.12553 +AF8D C2CC
43.12554 +AF8E C2CD
43.12555 +AF8F C2CE
43.12556 +AF90 C2CF
43.12557 +AF91 C2D0
43.12558 +AF93 C2D1
43.12559 +AF94 C2D2
43.12560 +AF95 C2D3
43.12561 +AF96 C2D4
43.12562 +AF97 C2D5
43.12563 +AF98 C2D6
43.12564 +AF99 C2D7
43.12565 +AF9A C2D8
43.12566 +AF9B C2D9
43.12567 +AF9C C2DA
43.12568 +AF9D C2DB
43.12569 +AFA1 C2DC
43.12570 +AFA2 C2DD
43.12571 +AFA3 C2DE
43.12572 +AFA4 C2DF
43.12573 +AFA5 C2E0
43.12574 +AFA6 C2E1
43.12575 +AFA7 C2E2
43.12576 +AFA8 C2E3
43.12577 +AFA9 C2E4
43.12578 +AFAA C2E5
43.12579 +AFAB C2E6
43.12580 +AFAC C2E7
43.12581 +AFAD C2E8
43.12582 +AFAE C2E9
43.12583 +AFAF C2EA
43.12584 +AFB0 C2EB
43.12585 +AFB1 C2EC
43.12586 +AFB3 C2ED
43.12587 +AFB4 C2EE
43.12588 +AFB5 C2EF
43.12589 +AFB6 C2F0
43.12590 +AFB7 C2F1
43.12591 +AFB8 C2F2
43.12592 +AFB9 C2F3
43.12593 +AFBA C2F4
43.12594 +AFBB C2F5
43.12595 +AFBC C2F6
43.12596 +AFBD C2F7
43.12597 +B041 3146
43.12598 +B061 C2F8
43.12599 +B062 C2F9
43.12600 +B063 C2FA
43.12601 +B064 C2FB
43.12602 +B065 C2FC
43.12603 +B066 C2FD
43.12604 +B067 C2FE
43.12605 +B068 C2FF
43.12606 +B069 C300
43.12607 +B06A C301
43.12608 +B06B C302
43.12609 +B06C C303
43.12610 +B06D C304
43.12611 +B06E C305
43.12612 +B06F C306
43.12613 +B070 C307
43.12614 +B071 C308
43.12615 +B073 C309
43.12616 +B074 C30A
43.12617 +B075 C30B
43.12618 +B076 C30C
43.12619 +B077 C30D
43.12620 +B078 C30E
43.12621 +B079 C30F
43.12622 +B07A C310
43.12623 +B07B C311
43.12624 +B07C C312
43.12625 +B07D C313
43.12626 +B081 C314
43.12627 +B082 C315
43.12628 +B083 C316
43.12629 +B084 C317
43.12630 +B085 C318
43.12631 +B086 C319
43.12632 +B087 C31A
43.12633 +B088 C31B
43.12634 +B089 C31C
43.12635 +B08A C31D
43.12636 +B08B C31E
43.12637 +B08C C31F
43.12638 +B08D C320
43.12639 +B08E C321
43.12640 +B08F C322
43.12641 +B090 C323
43.12642 +B091 C324
43.12643 +B093 C325
43.12644 +B094 C326
43.12645 +B095 C327
43.12646 +B096 C328
43.12647 +B097 C329
43.12648 +B098 C32A
43.12649 +B099 C32B
43.12650 +B09A C32C
43.12651 +B09B C32D
43.12652 +B09C C32E
43.12653 +B09D C32F
43.12654 +B0A1 C330
43.12655 +B0A2 C331
43.12656 +B0A3 C332
43.12657 +B0A4 C333
43.12658 +B0A5 C334
43.12659 +B0A6 C335
43.12660 +B0A7 C336
43.12661 +B0A8 C337
43.12662 +B0A9 C338
43.12663 +B0AA C339
43.12664 +B0AB C33A
43.12665 +B0AC C33B
43.12666 +B0AD C33C
43.12667 +B0AE C33D
43.12668 +B0AF C33E
43.12669 +B0B0 C33F
43.12670 +B0B1 C340
43.12671 +B0B3 C341
43.12672 +B0B4 C342
43.12673 +B0B5 C343
43.12674 +B0B6 C344
43.12675 +B0B7 C345
43.12676 +B0B8 C346
43.12677 +B0B9 C347
43.12678 +B0BA C348
43.12679 +B0BB C349
43.12680 +B0BC C34A
43.12681 +B0BD C34B
43.12682 +B0C1 C34C
43.12683 +B0C2 C34D
43.12684 +B0C3 C34E
43.12685 +B0C4 C34F
43.12686 +B0C5 C350
43.12687 +B0C6 C351
43.12688 +B0C7 C352
43.12689 +B0C8 C353
43.12690 +B0C9 C354
43.12691 +B0CA C355
43.12692 +B0CB C356
43.12693 +B0CC C357
43.12694 +B0CD C358
43.12695 +B0CE C359
43.12696 +B0CF C35A
43.12697 +B0D0 C35B
43.12698 +B0D1 C35C
43.12699 +B0D3 C35D
43.12700 +B0D4 C35E
43.12701 +B0D5 C35F
43.12702 +B0D6 C360
43.12703 +B0D7 C361
43.12704 +B0D8 C362
43.12705 +B0D9 C363
43.12706 +B0DA C364
43.12707 +B0DB C365
43.12708 +B0DC C366
43.12709 +B0DD C367
43.12710 +B0E1 C368
43.12711 +B0E2 C369
43.12712 +B0E3 C36A
43.12713 +B0E4 C36B
43.12714 +B0E5 C36C
43.12715 +B0E6 C36D
43.12716 +B0E7 C36E
43.12717 +B0E8 C36F
43.12718 +B0E9 C370
43.12719 +B0EA C371
43.12720 +B0EB C372
43.12721 +B0EC C373
43.12722 +B0ED C374
43.12723 +B0EE C375
43.12724 +B0EF C376
43.12725 +B0F0 C377
43.12726 +B0F1 C378
43.12727 +B0F3 C379
43.12728 +B0F4 C37A
43.12729 +B0F5 C37B
43.12730 +B0F6 C37C
43.12731 +B0F7 C37D
43.12732 +B0F8 C37E
43.12733 +B0F9 C37F
43.12734 +B0FA C380
43.12735 +B0FB C381
43.12736 +B0FC C382
43.12737 +B0FD C383
43.12738 +B141 C384
43.12739 +B142 C385
43.12740 +B143 C386
43.12741 +B144 C387
43.12742 +B145 C388
43.12743 +B146 C389
43.12744 +B147 C38A
43.12745 +B148 C38B
43.12746 +B149 C38C
43.12747 +B14A C38D
43.12748 +B14B C38E
43.12749 +B14C C38F
43.12750 +B14D C390
43.12751 +B14E C391
43.12752 +B14F C392
43.12753 +B150 C393
43.12754 +B151 C394
43.12755 +B153 C395
43.12756 +B154 C396
43.12757 +B155 C397
43.12758 +B156 C398
43.12759 +B157 C399
43.12760 +B158 C39A
43.12761 +B159 C39B
43.12762 +B15A C39C
43.12763 +B15B C39D
43.12764 +B15C C39E
43.12765 +B15D C39F
43.12766 +B161 C3A0
43.12767 +B162 C3A1
43.12768 +B163 C3A2
43.12769 +B164 C3A3
43.12770 +B165 C3A4
43.12771 +B166 C3A5
43.12772 +B167 C3A6
43.12773 +B168 C3A7
43.12774 +B169 C3A8
43.12775 +B16A C3A9
43.12776 +B16B C3AA
43.12777 +B16C C3AB
43.12778 +B16D C3AC
43.12779 +B16E C3AD
43.12780 +B16F C3AE
43.12781 +B170 C3AF
43.12782 +B171 C3B0
43.12783 +B173 C3B1
43.12784 +B174 C3B2
43.12785 +B175 C3B3
43.12786 +B176 C3B4
43.12787 +B177 C3B5
43.12788 +B178 C3B6
43.12789 +B179 C3B7
43.12790 +B17A C3B8
43.12791 +B17B C3B9
43.12792 +B17C C3BA
43.12793 +B17D C3BB
43.12794 +B181 C3BC
43.12795 +B182 C3BD
43.12796 +B183 C3BE
43.12797 +B184 C3BF
43.12798 +B185 C3C0
43.12799 +B186 C3C1
43.12800 +B187 C3C2
43.12801 +B188 C3C3
43.12802 +B189 C3C4
43.12803 +B18A C3C5
43.12804 +B18B C3C6
43.12805 +B18C C3C7
43.12806 +B18D C3C8
43.12807 +B18E C3C9
43.12808 +B18F C3CA
43.12809 +B190 C3CB
43.12810 +B191 C3CC
43.12811 +B193 C3CD
43.12812 +B194 C3CE
43.12813 +B195 C3CF
43.12814 +B196 C3D0
43.12815 +B197 C3D1
43.12816 +B198 C3D2
43.12817 +B199 C3D3
43.12818 +B19A C3D4
43.12819 +B19B C3D5
43.12820 +B19C C3D6
43.12821 +B19D C3D7
43.12822 +B1A1 C3D8
43.12823 +B1A2 C3D9
43.12824 +B1A3 C3DA
43.12825 +B1A4 C3DB
43.12826 +B1A5 C3DC
43.12827 +B1A6 C3DD
43.12828 +B1A7 C3DE
43.12829 +B1A8 C3DF
43.12830 +B1A9 C3E0
43.12831 +B1AA C3E1
43.12832 +B1AB C3E2
43.12833 +B1AC C3E3
43.12834 +B1AD C3E4
43.12835 +B1AE C3E5
43.12836 +B1AF C3E6
43.12837 +B1B0 C3E7
43.12838 +B1B1 C3E8
43.12839 +B1B3 C3E9
43.12840 +B1B4 C3EA
43.12841 +B1B5 C3EB
43.12842 +B1B6 C3EC
43.12843 +B1B7 C3ED
43.12844 +B1B8 C3EE
43.12845 +B1B9 C3EF
43.12846 +B1BA C3F0
43.12847 +B1BB C3F1
43.12848 +B1BC C3F2
43.12849 +B1BD C3F3
43.12850 +B1C1 C3F4
43.12851 +B1C2 C3F5
43.12852 +B1C3 C3F6
43.12853 +B1C4 C3F7
43.12854 +B1C5 C3F8
43.12855 +B1C6 C3F9
43.12856 +B1C7 C3FA
43.12857 +B1C8 C3FB
43.12858 +B1C9 C3FC
43.12859 +B1CA C3FD
43.12860 +B1CB C3FE
43.12861 +B1CC C3FF
43.12862 +B1CD C400
43.12863 +B1CE C401
43.12864 +B1CF C402
43.12865 +B1D0 C403
43.12866 +B1D1 C404
43.12867 +B1D3 C405
43.12868 +B1D4 C406
43.12869 +B1D5 C407
43.12870 +B1D6 C408
43.12871 +B1D7 C409
43.12872 +B1D8 C40A
43.12873 +B1D9 C40B
43.12874 +B1DA C40C
43.12875 +B1DB C40D
43.12876 +B1DC C40E
43.12877 +B1DD C40F
43.12878 +B1E1 C410
43.12879 +B1E2 C411
43.12880 +B1E3 C412
43.12881 +B1E4 C413
43.12882 +B1E5 C414
43.12883 +B1E6 C415
43.12884 +B1E7 C416
43.12885 +B1E8 C417
43.12886 +B1E9 C418
43.12887 +B1EA C419
43.12888 +B1EB C41A
43.12889 +B1EC C41B
43.12890 +B1ED C41C
43.12891 +B1EE C41D
43.12892 +B1EF C41E
43.12893 +B1F0 C41F
43.12894 +B1F1 C420
43.12895 +B1F3 C421
43.12896 +B1F4 C422
43.12897 +B1F5 C423
43.12898 +B1F6 C424
43.12899 +B1F7 C425
43.12900 +B1F8 C426
43.12901 +B1F9 C427
43.12902 +B1FA C428
43.12903 +B1FB C429
43.12904 +B1FC C42A
43.12905 +B1FD C42B
43.12906 +B241 C42C
43.12907 +B242 C42D
43.12908 +B243 C42E
43.12909 +B244 C42F
43.12910 +B245 C430
43.12911 +B246 C431
43.12912 +B247 C432
43.12913 +B248 C433
43.12914 +B249 C434
43.12915 +B24A C435
43.12916 +B24B C436
43.12917 +B24C C437
43.12918 +B24D C438
43.12919 +B24E C439
43.12920 +B24F C43A
43.12921 +B250 C43B
43.12922 +B251 C43C
43.12923 +B253 C43D
43.12924 +B254 C43E
43.12925 +B255 C43F
43.12926 +B256 C440
43.12927 +B257 C441
43.12928 +B258 C442
43.12929 +B259 C443
43.12930 +B25A C444
43.12931 +B25B C445
43.12932 +B25C C446
43.12933 +B25D C447
43.12934 +B261 C448
43.12935 +B262 C449
43.12936 +B263 C44A
43.12937 +B264 C44B
43.12938 +B265 C44C
43.12939 +B266 C44D
43.12940 +B267 C44E
43.12941 +B268 C44F
43.12942 +B269 C450
43.12943 +B26A C451
43.12944 +B26B C452
43.12945 +B26C C453
43.12946 +B26D C454
43.12947 +B26E C455
43.12948 +B26F C456
43.12949 +B270 C457
43.12950 +B271 C458
43.12951 +B273 C459
43.12952 +B274 C45A
43.12953 +B275 C45B
43.12954 +B276 C45C
43.12955 +B277 C45D
43.12956 +B278 C45E
43.12957 +B279 C45F
43.12958 +B27A C460
43.12959 +B27B C461
43.12960 +B27C C462
43.12961 +B27D C463
43.12962 +B281 C464
43.12963 +B282 C465
43.12964 +B283 C466
43.12965 +B284 C467
43.12966 +B285 C468
43.12967 +B286 C469
43.12968 +B287 C46A
43.12969 +B288 C46B
43.12970 +B289 C46C
43.12971 +B28A C46D
43.12972 +B28B C46E
43.12973 +B28C C46F
43.12974 +B28D C470
43.12975 +B28E C471
43.12976 +B28F C472
43.12977 +B290 C473
43.12978 +B291 C474
43.12979 +B293 C475
43.12980 +B294 C476
43.12981 +B295 C477
43.12982 +B296 C478
43.12983 +B297 C479
43.12984 +B298 C47A
43.12985 +B299 C47B
43.12986 +B29A C47C
43.12987 +B29B C47D
43.12988 +B29C C47E
43.12989 +B29D C47F
43.12990 +B2A1 C480
43.12991 +B2A2 C481
43.12992 +B2A3 C482
43.12993 +B2A4 C483
43.12994 +B2A5 C484
43.12995 +B2A6 C485
43.12996 +B2A7 C486
43.12997 +B2A8 C487
43.12998 +B2A9 C488
43.12999 +B2AA C489
43.13000 +B2AB C48A
43.13001 +B2AC C48B
43.13002 +B2AD C48C
43.13003 +B2AE C48D
43.13004 +B2AF C48E
43.13005 +B2B0 C48F
43.13006 +B2B1 C490
43.13007 +B2B3 C491
43.13008 +B2B4 C492
43.13009 +B2B5 C493
43.13010 +B2B6 C494
43.13011 +B2B7 C495
43.13012 +B2B8 C496
43.13013 +B2B9 C497
43.13014 +B2BA C498
43.13015 +B2BB C499
43.13016 +B2BC C49A
43.13017 +B2BD C49B
43.13018 +B2C1 C49C
43.13019 +B2C2 C49D
43.13020 +B2C3 C49E
43.13021 +B2C4 C49F
43.13022 +B2C5 C4A0
43.13023 +B2C6 C4A1
43.13024 +B2C7 C4A2
43.13025 +B2C8 C4A3
43.13026 +B2C9 C4A4
43.13027 +B2CA C4A5
43.13028 +B2CB C4A6
43.13029 +B2CC C4A7
43.13030 +B2CD C4A8
43.13031 +B2CE C4A9
43.13032 +B2CF C4AA
43.13033 +B2D0 C4AB
43.13034 +B2D1 C4AC
43.13035 +B2D3 C4AD
43.13036 +B2D4 C4AE
43.13037 +B2D5 C4AF
43.13038 +B2D6 C4B0
43.13039 +B2D7 C4B1
43.13040 +B2D8 C4B2
43.13041 +B2D9 C4B3
43.13042 +B2DA C4B4
43.13043 +B2DB C4B5
43.13044 +B2DC C4B6
43.13045 +B2DD C4B7
43.13046 +B2E1 C4B8
43.13047 +B2E2 C4B9
43.13048 +B2E3 C4BA
43.13049 +B2E4 C4BB
43.13050 +B2E5 C4BC
43.13051 +B2E6 C4BD
43.13052 +B2E7 C4BE
43.13053 +B2E8 C4BF
43.13054 +B2E9 C4C0
43.13055 +B2EA C4C1
43.13056 +B2EB C4C2
43.13057 +B2EC C4C3
43.13058 +B2ED C4C4
43.13059 +B2EE C4C5
43.13060 +B2EF C4C6
43.13061 +B2F0 C4C7
43.13062 +B2F1 C4C8
43.13063 +B2F3 C4C9
43.13064 +B2F4 C4CA
43.13065 +B2F5 C4CB
43.13066 +B2F6 C4CC
43.13067 +B2F7 C4CD
43.13068 +B2F8 C4CE
43.13069 +B2F9 C4CF
43.13070 +B2FA C4D0
43.13071 +B2FB C4D1
43.13072 +B2FC C4D2
43.13073 +B2FD C4D3
43.13074 +B341 C4D4
43.13075 +B342 C4D5
43.13076 +B343 C4D6
43.13077 +B344 C4D7
43.13078 +B345 C4D8
43.13079 +B346 C4D9
43.13080 +B347 C4DA
43.13081 +B348 C4DB
43.13082 +B349 C4DC
43.13083 +B34A C4DD
43.13084 +B34B C4DE
43.13085 +B34C C4DF
43.13086 +B34D C4E0
43.13087 +B34E C4E1
43.13088 +B34F C4E2
43.13089 +B350 C4E3
43.13090 +B351 C4E4
43.13091 +B353 C4E5
43.13092 +B354 C4E6
43.13093 +B355 C4E7
43.13094 +B356 C4E8
43.13095 +B357 C4E9
43.13096 +B358 C4EA
43.13097 +B359 C4EB
43.13098 +B35A C4EC
43.13099 +B35B C4ED
43.13100 +B35C C4EE
43.13101 +B35D C4EF
43.13102 +B361 C4F0
43.13103 +B362 C4F1
43.13104 +B363 C4F2
43.13105 +B364 C4F3
43.13106 +B365 C4F4
43.13107 +B366 C4F5
43.13108 +B367 C4F6
43.13109 +B368 C4F7
43.13110 +B369 C4F8
43.13111 +B36A C4F9
43.13112 +B36B C4FA
43.13113 +B36C C4FB
43.13114 +B36D C4FC
43.13115 +B36E C4FD
43.13116 +B36F C4FE
43.13117 +B370 C4FF
43.13118 +B371 C500
43.13119 +B373 C501
43.13120 +B374 C502
43.13121 +B375 C503
43.13122 +B376 C504
43.13123 +B377 C505
43.13124 +B378 C506
43.13125 +B379 C507
43.13126 +B37A C508
43.13127 +B37B C509
43.13128 +B37C C50A
43.13129 +B37D C50B
43.13130 +B381 C50C
43.13131 +B382 C50D
43.13132 +B383 C50E
43.13133 +B384 C50F
43.13134 +B385 C510
43.13135 +B386 C511
43.13136 +B387 C512
43.13137 +B388 C513
43.13138 +B389 C514
43.13139 +B38A C515
43.13140 +B38B C516
43.13141 +B38C C517
43.13142 +B38D C518
43.13143 +B38E C519
43.13144 +B38F C51A
43.13145 +B390 C51B
43.13146 +B391 C51C
43.13147 +B393 C51D
43.13148 +B394 C51E
43.13149 +B395 C51F
43.13150 +B396 C520
43.13151 +B397 C521
43.13152 +B398 C522
43.13153 +B399 C523
43.13154 +B39A C524
43.13155 +B39B C525
43.13156 +B39C C526
43.13157 +B39D C527
43.13158 +B3A1 C528
43.13159 +B3A2 C529
43.13160 +B3A3 C52A
43.13161 +B3A4 C52B
43.13162 +B3A5 C52C
43.13163 +B3A6 C52D
43.13164 +B3A7 C52E
43.13165 +B3A8 C52F
43.13166 +B3A9 C530
43.13167 +B3AA C531
43.13168 +B3AB C532
43.13169 +B3AC C533
43.13170 +B3AD C534
43.13171 +B3AE C535
43.13172 +B3AF C536
43.13173 +B3B0 C537
43.13174 +B3B1 C538
43.13175 +B3B3 C539
43.13176 +B3B4 C53A
43.13177 +B3B5 C53B
43.13178 +B3B6 C53C
43.13179 +B3B7 C53D
43.13180 +B3B8 C53E
43.13181 +B3B9 C53F
43.13182 +B3BA C540
43.13183 +B3BB C541
43.13184 +B3BC C542
43.13185 +B3BD C543
43.13186 +B441 3147
43.13187 +B461 C544
43.13188 +B462 C545
43.13189 +B463 C546
43.13190 +B464 C547
43.13191 +B465 C548
43.13192 +B466 C549
43.13193 +B467 C54A
43.13194 +B468 C54B
43.13195 +B469 C54C
43.13196 +B46A C54D
43.13197 +B46B C54E
43.13198 +B46C C54F
43.13199 +B46D C550
43.13200 +B46E C551
43.13201 +B46F C552
43.13202 +B470 C553
43.13203 +B471 C554
43.13204 +B473 C555
43.13205 +B474 C556
43.13206 +B475 C557
43.13207 +B476 C558
43.13208 +B477 C559
43.13209 +B478 C55A
43.13210 +B479 C55B
43.13211 +B47A C55C
43.13212 +B47B C55D
43.13213 +B47C C55E
43.13214 +B47D C55F
43.13215 +B481 C560
43.13216 +B482 C561
43.13217 +B483 C562
43.13218 +B484 C563
43.13219 +B485 C564
43.13220 +B486 C565
43.13221 +B487 C566
43.13222 +B488 C567
43.13223 +B489 C568
43.13224 +B48A C569
43.13225 +B48B C56A
43.13226 +B48C C56B
43.13227 +B48D C56C
43.13228 +B48E C56D
43.13229 +B48F C56E
43.13230 +B490 C56F
43.13231 +B491 C570
43.13232 +B493 C571
43.13233 +B494 C572
43.13234 +B495 C573
43.13235 +B496 C574
43.13236 +B497 C575
43.13237 +B498 C576
43.13238 +B499 C577
43.13239 +B49A C578
43.13240 +B49B C579
43.13241 +B49C C57A
43.13242 +B49D C57B
43.13243 +B4A1 C57C
43.13244 +B4A2 C57D
43.13245 +B4A3 C57E
43.13246 +B4A4 C57F
43.13247 +B4A5 C580
43.13248 +B4A6 C581
43.13249 +B4A7 C582
43.13250 +B4A8 C583
43.13251 +B4A9 C584
43.13252 +B4AA C585
43.13253 +B4AB C586
43.13254 +B4AC C587
43.13255 +B4AD C588
43.13256 +B4AE C589
43.13257 +B4AF C58A
43.13258 +B4B0 C58B
43.13259 +B4B1 C58C
43.13260 +B4B3 C58D
43.13261 +B4B4 C58E
43.13262 +B4B5 C58F
43.13263 +B4B6 C590
43.13264 +B4B7 C591
43.13265 +B4B8 C592
43.13266 +B4B9 C593
43.13267 +B4BA C594
43.13268 +B4BB C595
43.13269 +B4BC C596
43.13270 +B4BD C597
43.13271 +B4C1 C598
43.13272 +B4C2 C599
43.13273 +B4C3 C59A
43.13274 +B4C4 C59B
43.13275 +B4C5 C59C
43.13276 +B4C6 C59D
43.13277 +B4C7 C59E
43.13278 +B4C8 C59F
43.13279 +B4C9 C5A0
43.13280 +B4CA C5A1
43.13281 +B4CB C5A2
43.13282 +B4CC C5A3
43.13283 +B4CD C5A4
43.13284 +B4CE C5A5
43.13285 +B4CF C5A6
43.13286 +B4D0 C5A7
43.13287 +B4D1 C5A8
43.13288 +B4D3 C5A9
43.13289 +B4D4 C5AA
43.13290 +B4D5 C5AB
43.13291 +B4D6 C5AC
43.13292 +B4D7 C5AD
43.13293 +B4D8 C5AE
43.13294 +B4D9 C5AF
43.13295 +B4DA C5B0
43.13296 +B4DB C5B1
43.13297 +B4DC C5B2
43.13298 +B4DD C5B3
43.13299 +B4E1 C5B4
43.13300 +B4E2 C5B5
43.13301 +B4E3 C5B6
43.13302 +B4E4 C5B7
43.13303 +B4E5 C5B8
43.13304 +B4E6 C5B9
43.13305 +B4E7 C5BA
43.13306 +B4E8 C5BB
43.13307 +B4E9 C5BC
43.13308 +B4EA C5BD
43.13309 +B4EB C5BE
43.13310 +B4EC C5BF
43.13311 +B4ED C5C0
43.13312 +B4EE C5C1
43.13313 +B4EF C5C2
43.13314 +B4F0 C5C3
43.13315 +B4F1 C5C4
43.13316 +B4F3 C5C5
43.13317 +B4F4 C5C6
43.13318 +B4F5 C5C7
43.13319 +B4F6 C5C8
43.13320 +B4F7 C5C9
43.13321 +B4F8 C5CA
43.13322 +B4F9 C5CB
43.13323 +B4FA C5CC
43.13324 +B4FB C5CD
43.13325 +B4FC C5CE
43.13326 +B4FD C5CF
43.13327 +B541 C5D0
43.13328 +B542 C5D1
43.13329 +B543 C5D2
43.13330 +B544 C5D3
43.13331 +B545 C5D4
43.13332 +B546 C5D5
43.13333 +B547 C5D6
43.13334 +B548 C5D7
43.13335 +B549 C5D8
43.13336 +B54A C5D9
43.13337 +B54B C5DA
43.13338 +B54C C5DB
43.13339 +B54D C5DC
43.13340 +B54E C5DD
43.13341 +B54F C5DE
43.13342 +B550 C5DF
43.13343 +B551 C5E0
43.13344 +B553 C5E1
43.13345 +B554 C5E2
43.13346 +B555 C5E3
43.13347 +B556 C5E4
43.13348 +B557 C5E5
43.13349 +B558 C5E6
43.13350 +B559 C5E7
43.13351 +B55A C5E8
43.13352 +B55B C5E9
43.13353 +B55C C5EA
43.13354 +B55D C5EB
43.13355 +B561 C5EC
43.13356 +B562 C5ED
43.13357 +B563 C5EE
43.13358 +B564 C5EF
43.13359 +B565 C5F0
43.13360 +B566 C5F1
43.13361 +B567 C5F2
43.13362 +B568 C5F3
43.13363 +B569 C5F4
43.13364 +B56A C5F5
43.13365 +B56B C5F6
43.13366 +B56C C5F7
43.13367 +B56D C5F8
43.13368 +B56E C5F9
43.13369 +B56F C5FA
43.13370 +B570 C5FB
43.13371 +B571 C5FC
43.13372 +B573 C5FD
43.13373 +B574 C5FE
43.13374 +B575 C5FF
43.13375 +B576 C600
43.13376 +B577 C601
43.13377 +B578 C602
43.13378 +B579 C603
43.13379 +B57A C604
43.13380 +B57B C605
43.13381 +B57C C606
43.13382 +B57D C607
43.13383 +B581 C608
43.13384 +B582 C609
43.13385 +B583 C60A
43.13386 +B584 C60B
43.13387 +B585 C60C
43.13388 +B586 C60D
43.13389 +B587 C60E
43.13390 +B588 C60F
43.13391 +B589 C610
43.13392 +B58A C611
43.13393 +B58B C612
43.13394 +B58C C613
43.13395 +B58D C614
43.13396 +B58E C615
43.13397 +B58F C616
43.13398 +B590 C617
43.13399 +B591 C618
43.13400 +B593 C619
43.13401 +B594 C61A
43.13402 +B595 C61B
43.13403 +B596 C61C
43.13404 +B597 C61D
43.13405 +B598 C61E
43.13406 +B599 C61F
43.13407 +B59A C620
43.13408 +B59B C621
43.13409 +B59C C622
43.13410 +B59D C623
43.13411 +B5A1 C624
43.13412 +B5A2 C625
43.13413 +B5A3 C626
43.13414 +B5A4 C627
43.13415 +B5A5 C628
43.13416 +B5A6 C629
43.13417 +B5A7 C62A
43.13418 +B5A8 C62B
43.13419 +B5A9 C62C
43.13420 +B5AA C62D
43.13421 +B5AB C62E
43.13422 +B5AC C62F
43.13423 +B5AD C630
43.13424 +B5AE C631
43.13425 +B5AF C632
43.13426 +B5B0 C633
43.13427 +B5B1 C634
43.13428 +B5B3 C635
43.13429 +B5B4 C636
43.13430 +B5B5 C637
43.13431 +B5B6 C638
43.13432 +B5B7 C639
43.13433 +B5B8 C63A
43.13434 +B5B9 C63B
43.13435 +B5BA C63C
43.13436 +B5BB C63D
43.13437 +B5BC C63E
43.13438 +B5BD C63F
43.13439 +B5C1 C640
43.13440 +B5C2 C641
43.13441 +B5C3 C642
43.13442 +B5C4 C643
43.13443 +B5C5 C644
43.13444 +B5C6 C645
43.13445 +B5C7 C646
43.13446 +B5C8 C647
43.13447 +B5C9 C648
43.13448 +B5CA C649
43.13449 +B5CB C64A
43.13450 +B5CC C64B
43.13451 +B5CD C64C
43.13452 +B5CE C64D
43.13453 +B5CF C64E
43.13454 +B5D0 C64F
43.13455 +B5D1 C650
43.13456 +B5D3 C651
43.13457 +B5D4 C652
43.13458 +B5D5 C653
43.13459 +B5D6 C654
43.13460 +B5D7 C655
43.13461 +B5D8 C656
43.13462 +B5D9 C657
43.13463 +B5DA C658
43.13464 +B5DB C659
43.13465 +B5DC C65A
43.13466 +B5DD C65B
43.13467 +B5E1 C65C
43.13468 +B5E2 C65D
43.13469 +B5E3 C65E
43.13470 +B5E4 C65F
43.13471 +B5E5 C660
43.13472 +B5E6 C661
43.13473 +B5E7 C662
43.13474 +B5E8 C663
43.13475 +B5E9 C664
43.13476 +B5EA C665
43.13477 +B5EB C666
43.13478 +B5EC C667
43.13479 +B5ED C668
43.13480 +B5EE C669
43.13481 +B5EF C66A
43.13482 +B5F0 C66B
43.13483 +B5F1 C66C
43.13484 +B5F3 C66D
43.13485 +B5F4 C66E
43.13486 +B5F5 C66F
43.13487 +B5F6 C670
43.13488 +B5F7 C671
43.13489 +B5F8 C672
43.13490 +B5F9 C673
43.13491 +B5FA C674
43.13492 +B5FB C675
43.13493 +B5FC C676
43.13494 +B5FD C677
43.13495 +B641 C678
43.13496 +B642 C679
43.13497 +B643 C67A
43.13498 +B644 C67B
43.13499 +B645 C67C
43.13500 +B646 C67D
43.13501 +B647 C67E
43.13502 +B648 C67F
43.13503 +B649 C680
43.13504 +B64A C681
43.13505 +B64B C682
43.13506 +B64C C683
43.13507 +B64D C684
43.13508 +B64E C685
43.13509 +B64F C686
43.13510 +B650 C687
43.13511 +B651 C688
43.13512 +B653 C689
43.13513 +B654 C68A
43.13514 +B655 C68B
43.13515 +B656 C68C
43.13516 +B657 C68D
43.13517 +B658 C68E
43.13518 +B659 C68F
43.13519 +B65A C690
43.13520 +B65B C691
43.13521 +B65C C692
43.13522 +B65D C693
43.13523 +B661 C694
43.13524 +B662 C695
43.13525 +B663 C696
43.13526 +B664 C697
43.13527 +B665 C698
43.13528 +B666 C699
43.13529 +B667 C69A
43.13530 +B668 C69B
43.13531 +B669 C69C
43.13532 +B66A C69D
43.13533 +B66B C69E
43.13534 +B66C C69F
43.13535 +B66D C6A0
43.13536 +B66E C6A1
43.13537 +B66F C6A2
43.13538 +B670 C6A3
43.13539 +B671 C6A4
43.13540 +B673 C6A5
43.13541 +B674 C6A6
43.13542 +B675 C6A7
43.13543 +B676 C6A8
43.13544 +B677 C6A9
43.13545 +B678 C6AA
43.13546 +B679 C6AB
43.13547 +B67A C6AC
43.13548 +B67B C6AD
43.13549 +B67C C6AE
43.13550 +B67D C6AF
43.13551 +B681 C6B0
43.13552 +B682 C6B1
43.13553 +B683 C6B2
43.13554 +B684 C6B3
43.13555 +B685 C6B4
43.13556 +B686 C6B5
43.13557 +B687 C6B6
43.13558 +B688 C6B7
43.13559 +B689 C6B8
43.13560 +B68A C6B9
43.13561 +B68B C6BA
43.13562 +B68C C6BB
43.13563 +B68D C6BC
43.13564 +B68E C6BD
43.13565 +B68F C6BE
43.13566 +B690 C6BF
43.13567 +B691 C6C0
43.13568 +B693 C6C1
43.13569 +B694 C6C2
43.13570 +B695 C6C3
43.13571 +B696 C6C4
43.13572 +B697 C6C5
43.13573 +B698 C6C6
43.13574 +B699 C6C7
43.13575 +B69A C6C8
43.13576 +B69B C6C9
43.13577 +B69C C6CA
43.13578 +B69D C6CB
43.13579 +B6A1 C6CC
43.13580 +B6A2 C6CD
43.13581 +B6A3 C6CE
43.13582 +B6A4 C6CF
43.13583 +B6A5 C6D0
43.13584 +B6A6 C6D1
43.13585 +B6A7 C6D2
43.13586 +B6A8 C6D3
43.13587 +B6A9 C6D4
43.13588 +B6AA C6D5
43.13589 +B6AB C6D6
43.13590 +B6AC C6D7
43.13591 +B6AD C6D8
43.13592 +B6AE C6D9
43.13593 +B6AF C6DA
43.13594 +B6B0 C6DB
43.13595 +B6B1 C6DC
43.13596 +B6B3 C6DD
43.13597 +B6B4 C6DE
43.13598 +B6B5 C6DF
43.13599 +B6B6 C6E0
43.13600 +B6B7 C6E1
43.13601 +B6B8 C6E2
43.13602 +B6B9 C6E3
43.13603 +B6BA C6E4
43.13604 +B6BB C6E5
43.13605 +B6BC C6E6
43.13606 +B6BD C6E7
43.13607 +B6C1 C6E8
43.13608 +B6C2 C6E9
43.13609 +B6C3 C6EA
43.13610 +B6C4 C6EB
43.13611 +B6C5 C6EC
43.13612 +B6C6 C6ED
43.13613 +B6C7 C6EE
43.13614 +B6C8 C6EF
43.13615 +B6C9 C6F0
43.13616 +B6CA C6F1
43.13617 +B6CB C6F2
43.13618 +B6CC C6F3
43.13619 +B6CD C6F4
43.13620 +B6CE C6F5
43.13621 +B6CF C6F6
43.13622 +B6D0 C6F7
43.13623 +B6D1 C6F8
43.13624 +B6D3 C6F9
43.13625 +B6D4 C6FA
43.13626 +B6D5 C6FB
43.13627 +B6D6 C6FC
43.13628 +B6D7 C6FD
43.13629 +B6D8 C6FE
43.13630 +B6D9 C6FF
43.13631 +B6DA C700
43.13632 +B6DB C701
43.13633 +B6DC C702
43.13634 +B6DD C703
43.13635 +B6E1 C704
43.13636 +B6E2 C705
43.13637 +B6E3 C706
43.13638 +B6E4 C707
43.13639 +B6E5 C708
43.13640 +B6E6 C709
43.13641 +B6E7 C70A
43.13642 +B6E8 C70B
43.13643 +B6E9 C70C
43.13644 +B6EA C70D
43.13645 +B6EB C70E
43.13646 +B6EC C70F
43.13647 +B6ED C710
43.13648 +B6EE C711
43.13649 +B6EF C712
43.13650 +B6F0 C713
43.13651 +B6F1 C714
43.13652 +B6F3 C715
43.13653 +B6F4 C716
43.13654 +B6F5 C717
43.13655 +B6F6 C718
43.13656 +B6F7 C719
43.13657 +B6F8 C71A
43.13658 +B6F9 C71B
43.13659 +B6FA C71C
43.13660 +B6FB C71D
43.13661 +B6FC C71E
43.13662 +B6FD C71F
43.13663 +B741 C720
43.13664 +B742 C721
43.13665 +B743 C722
43.13666 +B744 C723
43.13667 +B745 C724
43.13668 +B746 C725
43.13669 +B747 C726
43.13670 +B748 C727
43.13671 +B749 C728
43.13672 +B74A C729
43.13673 +B74B C72A
43.13674 +B74C C72B
43.13675 +B74D C72C
43.13676 +B74E C72D
43.13677 +B74F C72E
43.13678 +B750 C72F
43.13679 +B751 C730
43.13680 +B753 C731
43.13681 +B754 C732
43.13682 +B755 C733
43.13683 +B756 C734
43.13684 +B757 C735
43.13685 +B758 C736
43.13686 +B759 C737
43.13687 +B75A C738
43.13688 +B75B C739
43.13689 +B75C C73A
43.13690 +B75D C73B
43.13691 +B761 C73C
43.13692 +B762 C73D
43.13693 +B763 C73E
43.13694 +B764 C73F
43.13695 +B765 C740
43.13696 +B766 C741
43.13697 +B767 C742
43.13698 +B768 C743
43.13699 +B769 C744
43.13700 +B76A C745
43.13701 +B76B C746
43.13702 +B76C C747
43.13703 +B76D C748
43.13704 +B76E C749
43.13705 +B76F C74A
43.13706 +B770 C74B
43.13707 +B771 C74C
43.13708 +B773 C74D
43.13709 +B774 C74E
43.13710 +B775 C74F
43.13711 +B776 C750
43.13712 +B777 C751
43.13713 +B778 C752
43.13714 +B779 C753
43.13715 +B77A C754
43.13716 +B77B C755
43.13717 +B77C C756
43.13718 +B77D C757
43.13719 +B781 C758
43.13720 +B782 C759
43.13721 +B783 C75A
43.13722 +B784 C75B
43.13723 +B785 C75C
43.13724 +B786 C75D
43.13725 +B787 C75E
43.13726 +B788 C75F
43.13727 +B789 C760
43.13728 +B78A C761
43.13729 +B78B C762
43.13730 +B78C C763
43.13731 +B78D C764
43.13732 +B78E C765
43.13733 +B78F C766
43.13734 +B790 C767
43.13735 +B791 C768
43.13736 +B793 C769
43.13737 +B794 C76A
43.13738 +B795 C76B
43.13739 +B796 C76C
43.13740 +B797 C76D
43.13741 +B798 C76E
43.13742 +B799 C76F
43.13743 +B79A C770
43.13744 +B79B C771
43.13745 +B79C C772
43.13746 +B79D C773
43.13747 +B7A1 C774
43.13748 +B7A2 C775
43.13749 +B7A3 C776
43.13750 +B7A4 C777
43.13751 +B7A5 C778
43.13752 +B7A6 C779
43.13753 +B7A7 C77A
43.13754 +B7A8 C77B
43.13755 +B7A9 C77C
43.13756 +B7AA C77D
43.13757 +B7AB C77E
43.13758 +B7AC C77F
43.13759 +B7AD C780
43.13760 +B7AE C781
43.13761 +B7AF C782
43.13762 +B7B0 C783
43.13763 +B7B1 C784
43.13764 +B7B3 C785
43.13765 +B7B4 C786
43.13766 +B7B5 C787
43.13767 +B7B6 C788
43.13768 +B7B7 C789
43.13769 +B7B8 C78A
43.13770 +B7B9 C78B
43.13771 +B7BA C78C
43.13772 +B7BB C78D
43.13773 +B7BC C78E
43.13774 +B7BD C78F
43.13775 +B841 3148
43.13776 +B861 C790
43.13777 +B862 C791
43.13778 +B863 C792
43.13779 +B864 C793
43.13780 +B865 C794
43.13781 +B866 C795
43.13782 +B867 C796
43.13783 +B868 C797
43.13784 +B869 C798
43.13785 +B86A C799
43.13786 +B86B C79A
43.13787 +B86C C79B
43.13788 +B86D C79C
43.13789 +B86E C79D
43.13790 +B86F C79E
43.13791 +B870 C79F
43.13792 +B871 C7A0
43.13793 +B873 C7A1
43.13794 +B874 C7A2
43.13795 +B875 C7A3
43.13796 +B876 C7A4
43.13797 +B877 C7A5
43.13798 +B878 C7A6
43.13799 +B879 C7A7
43.13800 +B87A C7A8
43.13801 +B87B C7A9
43.13802 +B87C C7AA
43.13803 +B87D C7AB
43.13804 +B881 C7AC
43.13805 +B882 C7AD
43.13806 +B883 C7AE
43.13807 +B884 C7AF
43.13808 +B885 C7B0
43.13809 +B886 C7B1
43.13810 +B887 C7B2
43.13811 +B888 C7B3
43.13812 +B889 C7B4
43.13813 +B88A C7B5
43.13814 +B88B C7B6
43.13815 +B88C C7B7
43.13816 +B88D C7B8
43.13817 +B88E C7B9
43.13818 +B88F C7BA
43.13819 +B890 C7BB
43.13820 +B891 C7BC
43.13821 +B893 C7BD
43.13822 +B894 C7BE
43.13823 +B895 C7BF
43.13824 +B896 C7C0
43.13825 +B897 C7C1
43.13826 +B898 C7C2
43.13827 +B899 C7C3
43.13828 +B89A C7C4
43.13829 +B89B C7C5
43.13830 +B89C C7C6
43.13831 +B89D C7C7
43.13832 +B8A1 C7C8
43.13833 +B8A2 C7C9
43.13834 +B8A3 C7CA
43.13835 +B8A4 C7CB
43.13836 +B8A5 C7CC
43.13837 +B8A6 C7CD
43.13838 +B8A7 C7CE
43.13839 +B8A8 C7CF
43.13840 +B8A9 C7D0
43.13841 +B8AA C7D1
43.13842 +B8AB C7D2
43.13843 +B8AC C7D3
43.13844 +B8AD C7D4
43.13845 +B8AE C7D5
43.13846 +B8AF C7D6
43.13847 +B8B0 C7D7
43.13848 +B8B1 C7D8
43.13849 +B8B3 C7D9
43.13850 +B8B4 C7DA
43.13851 +B8B5 C7DB
43.13852 +B8B6 C7DC
43.13853 +B8B7 C7DD
43.13854 +B8B8 C7DE
43.13855 +B8B9 C7DF
43.13856 +B8BA C7E0
43.13857 +B8BB C7E1
43.13858 +B8BC C7E2
43.13859 +B8BD C7E3
43.13860 +B8C1 C7E4
43.13861 +B8C2 C7E5
43.13862 +B8C3 C7E6
43.13863 +B8C4 C7E7
43.13864 +B8C5 C7E8
43.13865 +B8C6 C7E9
43.13866 +B8C7 C7EA
43.13867 +B8C8 C7EB
43.13868 +B8C9 C7EC
43.13869 +B8CA C7ED
43.13870 +B8CB C7EE
43.13871 +B8CC C7EF
43.13872 +B8CD C7F0
43.13873 +B8CE C7F1
43.13874 +B8CF C7F2
43.13875 +B8D0 C7F3
43.13876 +B8D1 C7F4
43.13877 +B8D3 C7F5
43.13878 +B8D4 C7F6
43.13879 +B8D5 C7F7
43.13880 +B8D6 C7F8
43.13881 +B8D7 C7F9
43.13882 +B8D8 C7FA
43.13883 +B8D9 C7FB
43.13884 +B8DA C7FC
43.13885 +B8DB C7FD
43.13886 +B8DC C7FE
43.13887 +B8DD C7FF
43.13888 +B8E1 C800
43.13889 +B8E2 C801
43.13890 +B8E3 C802
43.13891 +B8E4 C803
43.13892 +B8E5 C804
43.13893 +B8E6 C805
43.13894 +B8E7 C806
43.13895 +B8E8 C807
43.13896 +B8E9 C808
43.13897 +B8EA C809
43.13898 +B8EB C80A
43.13899 +B8EC C80B
43.13900 +B8ED C80C
43.13901 +B8EE C80D
43.13902 +B8EF C80E
43.13903 +B8F0 C80F
43.13904 +B8F1 C810
43.13905 +B8F3 C811
43.13906 +B8F4 C812
43.13907 +B8F5 C813
43.13908 +B8F6 C814
43.13909 +B8F7 C815
43.13910 +B8F8 C816
43.13911 +B8F9 C817
43.13912 +B8FA C818
43.13913 +B8FB C819
43.13914 +B8FC C81A
43.13915 +B8FD C81B
43.13916 +B941 C81C
43.13917 +B942 C81D
43.13918 +B943 C81E
43.13919 +B944 C81F
43.13920 +B945 C820
43.13921 +B946 C821
43.13922 +B947 C822
43.13923 +B948 C823
43.13924 +B949 C824
43.13925 +B94A C825
43.13926 +B94B C826
43.13927 +B94C C827
43.13928 +B94D C828
43.13929 +B94E C829
43.13930 +B94F C82A
43.13931 +B950 C82B
43.13932 +B951 C82C
43.13933 +B953 C82D
43.13934 +B954 C82E
43.13935 +B955 C82F
43.13936 +B956 C830
43.13937 +B957 C831
43.13938 +B958 C832
43.13939 +B959 C833
43.13940 +B95A C834
43.13941 +B95B C835
43.13942 +B95C C836
43.13943 +B95D C837
43.13944 +B961 C838
43.13945 +B962 C839
43.13946 +B963 C83A
43.13947 +B964 C83B
43.13948 +B965 C83C
43.13949 +B966 C83D
43.13950 +B967 C83E
43.13951 +B968 C83F
43.13952 +B969 C840
43.13953 +B96A C841
43.13954 +B96B C842
43.13955 +B96C C843
43.13956 +B96D C844
43.13957 +B96E C845
43.13958 +B96F C846
43.13959 +B970 C847
43.13960 +B971 C848
43.13961 +B973 C849
43.13962 +B974 C84A
43.13963 +B975 C84B
43.13964 +B976 C84C
43.13965 +B977 C84D
43.13966 +B978 C84E
43.13967 +B979 C84F
43.13968 +B97A C850
43.13969 +B97B C851
43.13970 +B97C C852
43.13971 +B97D C853
43.13972 +B981 C854
43.13973 +B982 C855
43.13974 +B983 C856
43.13975 +B984 C857
43.13976 +B985 C858
43.13977 +B986 C859
43.13978 +B987 C85A
43.13979 +B988 C85B
43.13980 +B989 C85C
43.13981 +B98A C85D
43.13982 +B98B C85E
43.13983 +B98C C85F
43.13984 +B98D C860
43.13985 +B98E C861
43.13986 +B98F C862
43.13987 +B990 C863
43.13988 +B991 C864
43.13989 +B993 C865
43.13990 +B994 C866
43.13991 +B995 C867
43.13992 +B996 C868
43.13993 +B997 C869
43.13994 +B998 C86A
43.13995 +B999 C86B
43.13996 +B99A C86C
43.13997 +B99B C86D
43.13998 +B99C C86E
43.13999 +B99D C86F
43.14000 +B9A1 C870
43.14001 +B9A2 C871
43.14002 +B9A3 C872
43.14003 +B9A4 C873
43.14004 +B9A5 C874
43.14005 +B9A6 C875
43.14006 +B9A7 C876
43.14007 +B9A8 C877
43.14008 +B9A9 C878
43.14009 +B9AA C879
43.14010 +B9AB C87A
43.14011 +B9AC C87B
43.14012 +B9AD C87C
43.14013 +B9AE C87D
43.14014 +B9AF C87E
43.14015 +B9B0 C87F
43.14016 +B9B1 C880
43.14017 +B9B3 C881
43.14018 +B9B4 C882
43.14019 +B9B5 C883
43.14020 +B9B6 C884
43.14021 +B9B7 C885
43.14022 +B9B8 C886
43.14023 +B9B9 C887
43.14024 +B9BA C888
43.14025 +B9BB C889
43.14026 +B9BC C88A
43.14027 +B9BD C88B
43.14028 +B9C1 C88C
43.14029 +B9C2 C88D
43.14030 +B9C3 C88E
43.14031 +B9C4 C88F
43.14032 +B9C5 C890
43.14033 +B9C6 C891
43.14034 +B9C7 C892
43.14035 +B9C8 C893
43.14036 +B9C9 C894
43.14037 +B9CA C895
43.14038 +B9CB C896
43.14039 +B9CC C897
43.14040 +B9CD C898
43.14041 +B9CE C899
43.14042 +B9CF C89A
43.14043 +B9D0 C89B
43.14044 +B9D1 C89C
43.14045 +B9D3 C89D
43.14046 +B9D4 C89E
43.14047 +B9D5 C89F
43.14048 +B9D6 C8A0
43.14049 +B9D7 C8A1
43.14050 +B9D8 C8A2
43.14051 +B9D9 C8A3
43.14052 +B9DA C8A4
43.14053 +B9DB C8A5
43.14054 +B9DC C8A6
43.14055 +B9DD C8A7
43.14056 +B9E1 C8A8
43.14057 +B9E2 C8A9
43.14058 +B9E3 C8AA
43.14059 +B9E4 C8AB
43.14060 +B9E5 C8AC
43.14061 +B9E6 C8AD
43.14062 +B9E7 C8AE
43.14063 +B9E8 C8AF
43.14064 +B9E9 C8B0
43.14065 +B9EA C8B1
43.14066 +B9EB C8B2
43.14067 +B9EC C8B3
43.14068 +B9ED C8B4
43.14069 +B9EE C8B5
43.14070 +B9EF C8B6
43.14071 +B9F0 C8B7
43.14072 +B9F1 C8B8
43.14073 +B9F3 C8B9
43.14074 +B9F4 C8BA
43.14075 +B9F5 C8BB
43.14076 +B9F6 C8BC
43.14077 +B9F7 C8BD
43.14078 +B9F8 C8BE
43.14079 +B9F9 C8BF
43.14080 +B9FA C8C0
43.14081 +B9FB C8C1
43.14082 +B9FC C8C2
43.14083 +B9FD C8C3
43.14084 +BA41 C8C4
43.14085 +BA42 C8C5
43.14086 +BA43 C8C6
43.14087 +BA44 C8C7
43.14088 +BA45 C8C8
43.14089 +BA46 C8C9
43.14090 +BA47 C8CA
43.14091 +BA48 C8CB
43.14092 +BA49 C8CC
43.14093 +BA4A C8CD
43.14094 +BA4B C8CE
43.14095 +BA4C C8CF
43.14096 +BA4D C8D0
43.14097 +BA4E C8D1
43.14098 +BA4F C8D2
43.14099 +BA50 C8D3
43.14100 +BA51 C8D4
43.14101 +BA53 C8D5
43.14102 +BA54 C8D6
43.14103 +BA55 C8D7
43.14104 +BA56 C8D8
43.14105 +BA57 C8D9
43.14106 +BA58 C8DA
43.14107 +BA59 C8DB
43.14108 +BA5A C8DC
43.14109 +BA5B C8DD
43.14110 +BA5C C8DE
43.14111 +BA5D C8DF
43.14112 +BA61 C8E0
43.14113 +BA62 C8E1
43.14114 +BA63 C8E2
43.14115 +BA64 C8E3
43.14116 +BA65 C8E4
43.14117 +BA66 C8E5
43.14118 +BA67 C8E6
43.14119 +BA68 C8E7
43.14120 +BA69 C8E8
43.14121 +BA6A C8E9
43.14122 +BA6B C8EA
43.14123 +BA6C C8EB
43.14124 +BA6D C8EC
43.14125 +BA6E C8ED
43.14126 +BA6F C8EE
43.14127 +BA70 C8EF
43.14128 +BA71 C8F0
43.14129 +BA73 C8F1
43.14130 +BA74 C8F2
43.14131 +BA75 C8F3
43.14132 +BA76 C8F4
43.14133 +BA77 C8F5
43.14134 +BA78 C8F6
43.14135 +BA79 C8F7
43.14136 +BA7A C8F8
43.14137 +BA7B C8F9
43.14138 +BA7C C8FA
43.14139 +BA7D C8FB
43.14140 +BA81 C8FC
43.14141 +BA82 C8FD
43.14142 +BA83 C8FE
43.14143 +BA84 C8FF
43.14144 +BA85 C900
43.14145 +BA86 C901
43.14146 +BA87 C902
43.14147 +BA88 C903
43.14148 +BA89 C904
43.14149 +BA8A C905
43.14150 +BA8B C906
43.14151 +BA8C C907
43.14152 +BA8D C908
43.14153 +BA8E C909
43.14154 +BA8F C90A
43.14155 +BA90 C90B
43.14156 +BA91 C90C
43.14157 +BA93 C90D
43.14158 +BA94 C90E
43.14159 +BA95 C90F
43.14160 +BA96 C910
43.14161 +BA97 C911
43.14162 +BA98 C912
43.14163 +BA99 C913
43.14164 +BA9A C914
43.14165 +BA9B C915
43.14166 +BA9C C916
43.14167 +BA9D C917
43.14168 +BAA1 C918
43.14169 +BAA2 C919
43.14170 +BAA3 C91A
43.14171 +BAA4 C91B
43.14172 +BAA5 C91C
43.14173 +BAA6 C91D
43.14174 +BAA7 C91E
43.14175 +BAA8 C91F
43.14176 +BAA9 C920
43.14177 +BAAA C921
43.14178 +BAAB C922
43.14179 +BAAC C923
43.14180 +BAAD C924
43.14181 +BAAE C925
43.14182 +BAAF C926
43.14183 +BAB0 C927
43.14184 +BAB1 C928
43.14185 +BAB3 C929
43.14186 +BAB4 C92A
43.14187 +BAB5 C92B
43.14188 +BAB6 C92C
43.14189 +BAB7 C92D
43.14190 +BAB8 C92E
43.14191 +BAB9 C92F
43.14192 +BABA C930
43.14193 +BABB C931
43.14194 +BABC C932
43.14195 +BABD C933
43.14196 +BAC1 C934
43.14197 +BAC2 C935
43.14198 +BAC3 C936
43.14199 +BAC4 C937
43.14200 +BAC5 C938
43.14201 +BAC6 C939
43.14202 +BAC7 C93A
43.14203 +BAC8 C93B
43.14204 +BAC9 C93C
43.14205 +BACA C93D
43.14206 +BACB C93E
43.14207 +BACC C93F
43.14208 +BACD C940
43.14209 +BACE C941
43.14210 +BACF C942
43.14211 +BAD0 C943
43.14212 +BAD1 C944
43.14213 +BAD3 C945
43.14214 +BAD4 C946
43.14215 +BAD5 C947
43.14216 +BAD6 C948
43.14217 +BAD7 C949
43.14218 +BAD8 C94A
43.14219 +BAD9 C94B
43.14220 +BADA C94C
43.14221 +BADB C94D
43.14222 +BADC C94E
43.14223 +BADD C94F
43.14224 +BAE1 C950
43.14225 +BAE2 C951
43.14226 +BAE3 C952
43.14227 +BAE4 C953
43.14228 +BAE5 C954
43.14229 +BAE6 C955
43.14230 +BAE7 C956
43.14231 +BAE8 C957
43.14232 +BAE9 C958
43.14233 +BAEA C959
43.14234 +BAEB C95A
43.14235 +BAEC C95B
43.14236 +BAED C95C
43.14237 +BAEE C95D
43.14238 +BAEF C95E
43.14239 +BAF0 C95F
43.14240 +BAF1 C960
43.14241 +BAF3 C961
43.14242 +BAF4 C962
43.14243 +BAF5 C963
43.14244 +BAF6 C964
43.14245 +BAF7 C965
43.14246 +BAF8 C966
43.14247 +BAF9 C967
43.14248 +BAFA C968
43.14249 +BAFB C969
43.14250 +BAFC C96A
43.14251 +BAFD C96B
43.14252 +BB41 C96C
43.14253 +BB42 C96D
43.14254 +BB43 C96E
43.14255 +BB44 C96F
43.14256 +BB45 C970
43.14257 +BB46 C971
43.14258 +BB47 C972
43.14259 +BB48 C973
43.14260 +BB49 C974
43.14261 +BB4A C975
43.14262 +BB4B C976
43.14263 +BB4C C977
43.14264 +BB4D C978
43.14265 +BB4E C979
43.14266 +BB4F C97A
43.14267 +BB50 C97B
43.14268 +BB51 C97C
43.14269 +BB53 C97D
43.14270 +BB54 C97E
43.14271 +BB55 C97F
43.14272 +BB56 C980
43.14273 +BB57 C981
43.14274 +BB58 C982
43.14275 +BB59 C983
43.14276 +BB5A C984
43.14277 +BB5B C985
43.14278 +BB5C C986
43.14279 +BB5D C987
43.14280 +BB61 C988
43.14281 +BB62 C989
43.14282 +BB63 C98A
43.14283 +BB64 C98B
43.14284 +BB65 C98C
43.14285 +BB66 C98D
43.14286 +BB67 C98E
43.14287 +BB68 C98F
43.14288 +BB69 C990
43.14289 +BB6A C991
43.14290 +BB6B C992
43.14291 +BB6C C993
43.14292 +BB6D C994
43.14293 +BB6E C995
43.14294 +BB6F C996
43.14295 +BB70 C997
43.14296 +BB71 C998
43.14297 +BB73 C999
43.14298 +BB74 C99A
43.14299 +BB75 C99B
43.14300 +BB76 C99C
43.14301 +BB77 C99D
43.14302 +BB78 C99E
43.14303 +BB79 C99F
43.14304 +BB7A C9A0
43.14305 +BB7B C9A1
43.14306 +BB7C C9A2
43.14307 +BB7D C9A3
43.14308 +BB81 C9A4
43.14309 +BB82 C9A5
43.14310 +BB83 C9A6
43.14311 +BB84 C9A7
43.14312 +BB85 C9A8
43.14313 +BB86 C9A9
43.14314 +BB87 C9AA
43.14315 +BB88 C9AB
43.14316 +BB89 C9AC
43.14317 +BB8A C9AD
43.14318 +BB8B C9AE
43.14319 +BB8C C9AF
43.14320 +BB8D C9B0
43.14321 +BB8E C9B1
43.14322 +BB8F C9B2
43.14323 +BB90 C9B3
43.14324 +BB91 C9B4
43.14325 +BB93 C9B5
43.14326 +BB94 C9B6
43.14327 +BB95 C9B7
43.14328 +BB96 C9B8
43.14329 +BB97 C9B9
43.14330 +BB98 C9BA
43.14331 +BB99 C9BB
43.14332 +BB9A C9BC
43.14333 +BB9B C9BD
43.14334 +BB9C C9BE
43.14335 +BB9D C9BF
43.14336 +BBA1 C9C0
43.14337 +BBA2 C9C1
43.14338 +BBA3 C9C2
43.14339 +BBA4 C9C3
43.14340 +BBA5 C9C4
43.14341 +BBA6 C9C5
43.14342 +BBA7 C9C6
43.14343 +BBA8 C9C7
43.14344 +BBA9 C9C8
43.14345 +BBAA C9C9
43.14346 +BBAB C9CA
43.14347 +BBAC C9CB
43.14348 +BBAD C9CC
43.14349 +BBAE C9CD
43.14350 +BBAF C9CE
43.14351 +BBB0 C9CF
43.14352 +BBB1 C9D0
43.14353 +BBB3 C9D1
43.14354 +BBB4 C9D2
43.14355 +BBB5 C9D3
43.14356 +BBB6 C9D4
43.14357 +BBB7 C9D5
43.14358 +BBB8 C9D6
43.14359 +BBB9 C9D7
43.14360 +BBBA C9D8
43.14361 +BBBB C9D9
43.14362 +BBBC C9DA
43.14363 +BBBD C9DB
43.14364 +BC41 3149
43.14365 +BC61 C9DC
43.14366 +BC62 C9DD
43.14367 +BC63 C9DE
43.14368 +BC64 C9DF
43.14369 +BC65 C9E0
43.14370 +BC66 C9E1
43.14371 +BC67 C9E2
43.14372 +BC68 C9E3
43.14373 +BC69 C9E4
43.14374 +BC6A C9E5
43.14375 +BC6B C9E6
43.14376 +BC6C C9E7
43.14377 +BC6D C9E8
43.14378 +BC6E C9E9
43.14379 +BC6F C9EA
43.14380 +BC70 C9EB
43.14381 +BC71 C9EC
43.14382 +BC73 C9ED
43.14383 +BC74 C9EE
43.14384 +BC75 C9EF
43.14385 +BC76 C9F0
43.14386 +BC77 C9F1
43.14387 +BC78 C9F2
43.14388 +BC79 C9F3
43.14389 +BC7A C9F4
43.14390 +BC7B C9F5
43.14391 +BC7C C9F6
43.14392 +BC7D C9F7
43.14393 +BC81 C9F8
43.14394 +BC82 C9F9
43.14395 +BC83 C9FA
43.14396 +BC84 C9FB
43.14397 +BC85 C9FC
43.14398 +BC86 C9FD
43.14399 +BC87 C9FE
43.14400 +BC88 C9FF
43.14401 +BC89 CA00
43.14402 +BC8A CA01
43.14403 +BC8B CA02
43.14404 +BC8C CA03
43.14405 +BC8D CA04
43.14406 +BC8E CA05
43.14407 +BC8F CA06
43.14408 +BC90 CA07
43.14409 +BC91 CA08
43.14410 +BC93 CA09
43.14411 +BC94 CA0A
43.14412 +BC95 CA0B
43.14413 +BC96 CA0C
43.14414 +BC97 CA0D
43.14415 +BC98 CA0E
43.14416 +BC99 CA0F
43.14417 +BC9A CA10
43.14418 +BC9B CA11
43.14419 +BC9C CA12
43.14420 +BC9D CA13
43.14421 +BCA1 CA14
43.14422 +BCA2 CA15
43.14423 +BCA3 CA16
43.14424 +BCA4 CA17
43.14425 +BCA5 CA18
43.14426 +BCA6 CA19
43.14427 +BCA7 CA1A
43.14428 +BCA8 CA1B
43.14429 +BCA9 CA1C
43.14430 +BCAA CA1D
43.14431 +BCAB CA1E
43.14432 +BCAC CA1F
43.14433 +BCAD CA20
43.14434 +BCAE CA21
43.14435 +BCAF CA22
43.14436 +BCB0 CA23
43.14437 +BCB1 CA24
43.14438 +BCB3 CA25
43.14439 +BCB4 CA26
43.14440 +BCB5 CA27
43.14441 +BCB6 CA28
43.14442 +BCB7 CA29
43.14443 +BCB8 CA2A
43.14444 +BCB9 CA2B
43.14445 +BCBA CA2C
43.14446 +BCBB CA2D
43.14447 +BCBC CA2E
43.14448 +BCBD CA2F
43.14449 +BCC1 CA30
43.14450 +BCC2 CA31
43.14451 +BCC3 CA32
43.14452 +BCC4 CA33
43.14453 +BCC5 CA34
43.14454 +BCC6 CA35
43.14455 +BCC7 CA36
43.14456 +BCC8 CA37
43.14457 +BCC9 CA38
43.14458 +BCCA CA39
43.14459 +BCCB CA3A
43.14460 +BCCC CA3B
43.14461 +BCCD CA3C
43.14462 +BCCE CA3D
43.14463 +BCCF CA3E
43.14464 +BCD0 CA3F
43.14465 +BCD1 CA40
43.14466 +BCD3 CA41
43.14467 +BCD4 CA42
43.14468 +BCD5 CA43
43.14469 +BCD6 CA44
43.14470 +BCD7 CA45
43.14471 +BCD8 CA46
43.14472 +BCD9 CA47
43.14473 +BCDA CA48
43.14474 +BCDB CA49
43.14475 +BCDC CA4A
43.14476 +BCDD CA4B
43.14477 +BCE1 CA4C
43.14478 +BCE2 CA4D
43.14479 +BCE3 CA4E
43.14480 +BCE4 CA4F
43.14481 +BCE5 CA50
43.14482 +BCE6 CA51
43.14483 +BCE7 CA52
43.14484 +BCE8 CA53
43.14485 +BCE9 CA54
43.14486 +BCEA CA55
43.14487 +BCEB CA56
43.14488 +BCEC CA57
43.14489 +BCED CA58
43.14490 +BCEE CA59
43.14491 +BCEF CA5A
43.14492 +BCF0 CA5B
43.14493 +BCF1 CA5C
43.14494 +BCF3 CA5D
43.14495 +BCF4 CA5E
43.14496 +BCF5 CA5F
43.14497 +BCF6 CA60
43.14498 +BCF7 CA61
43.14499 +BCF8 CA62
43.14500 +BCF9 CA63
43.14501 +BCFA CA64
43.14502 +BCFB CA65
43.14503 +BCFC CA66
43.14504 +BCFD CA67
43.14505 +BD41 CA68
43.14506 +BD42 CA69
43.14507 +BD43 CA6A
43.14508 +BD44 CA6B
43.14509 +BD45 CA6C
43.14510 +BD46 CA6D
43.14511 +BD47 CA6E
43.14512 +BD48 CA6F
43.14513 +BD49 CA70
43.14514 +BD4A CA71
43.14515 +BD4B CA72
43.14516 +BD4C CA73
43.14517 +BD4D CA74
43.14518 +BD4E CA75
43.14519 +BD4F CA76
43.14520 +BD50 CA77
43.14521 +BD51 CA78
43.14522 +BD53 CA79
43.14523 +BD54 CA7A
43.14524 +BD55 CA7B
43.14525 +BD56 CA7C
43.14526 +BD57 CA7D
43.14527 +BD58 CA7E
43.14528 +BD59 CA7F
43.14529 +BD5A CA80
43.14530 +BD5B CA81
43.14531 +BD5C CA82
43.14532 +BD5D CA83
43.14533 +BD61 CA84
43.14534 +BD62 CA85
43.14535 +BD63 CA86
43.14536 +BD64 CA87
43.14537 +BD65 CA88
43.14538 +BD66 CA89
43.14539 +BD67 CA8A
43.14540 +BD68 CA8B
43.14541 +BD69 CA8C
43.14542 +BD6A CA8D
43.14543 +BD6B CA8E
43.14544 +BD6C CA8F
43.14545 +BD6D CA90
43.14546 +BD6E CA91
43.14547 +BD6F CA92
43.14548 +BD70 CA93
43.14549 +BD71 CA94
43.14550 +BD73 CA95
43.14551 +BD74 CA96
43.14552 +BD75 CA97
43.14553 +BD76 CA98
43.14554 +BD77 CA99
43.14555 +BD78 CA9A
43.14556 +BD79 CA9B
43.14557 +BD7A CA9C
43.14558 +BD7B CA9D
43.14559 +BD7C CA9E
43.14560 +BD7D CA9F
43.14561 +BD81 CAA0
43.14562 +BD82 CAA1
43.14563 +BD83 CAA2
43.14564 +BD84 CAA3
43.14565 +BD85 CAA4
43.14566 +BD86 CAA5
43.14567 +BD87 CAA6
43.14568 +BD88 CAA7
43.14569 +BD89 CAA8
43.14570 +BD8A CAA9
43.14571 +BD8B CAAA
43.14572 +BD8C CAAB
43.14573 +BD8D CAAC
43.14574 +BD8E CAAD
43.14575 +BD8F CAAE
43.14576 +BD90 CAAF
43.14577 +BD91 CAB0
43.14578 +BD93 CAB1
43.14579 +BD94 CAB2
43.14580 +BD95 CAB3
43.14581 +BD96 CAB4
43.14582 +BD97 CAB5
43.14583 +BD98 CAB6
43.14584 +BD99 CAB7
43.14585 +BD9A CAB8
43.14586 +BD9B CAB9
43.14587 +BD9C CABA
43.14588 +BD9D CABB
43.14589 +BDA1 CABC
43.14590 +BDA2 CABD
43.14591 +BDA3 CABE
43.14592 +BDA4 CABF
43.14593 +BDA5 CAC0
43.14594 +BDA6 CAC1
43.14595 +BDA7 CAC2
43.14596 +BDA8 CAC3
43.14597 +BDA9 CAC4
43.14598 +BDAA CAC5
43.14599 +BDAB CAC6
43.14600 +BDAC CAC7
43.14601 +BDAD CAC8
43.14602 +BDAE CAC9
43.14603 +BDAF CACA
43.14604 +BDB0 CACB
43.14605 +BDB1 CACC
43.14606 +BDB3 CACD
43.14607 +BDB4 CACE
43.14608 +BDB5 CACF
43.14609 +BDB6 CAD0
43.14610 +BDB7 CAD1
43.14611 +BDB8 CAD2
43.14612 +BDB9 CAD3
43.14613 +BDBA CAD4
43.14614 +BDBB CAD5
43.14615 +BDBC CAD6
43.14616 +BDBD CAD7
43.14617 +BDC1 CAD8
43.14618 +BDC2 CAD9
43.14619 +BDC3 CADA
43.14620 +BDC4 CADB
43.14621 +BDC5 CADC
43.14622 +BDC6 CADD
43.14623 +BDC7 CADE
43.14624 +BDC8 CADF
43.14625 +BDC9 CAE0
43.14626 +BDCA CAE1
43.14627 +BDCB CAE2
43.14628 +BDCC CAE3
43.14629 +BDCD CAE4
43.14630 +BDCE CAE5
43.14631 +BDCF CAE6
43.14632 +BDD0 CAE7
43.14633 +BDD1 CAE8
43.14634 +BDD3 CAE9
43.14635 +BDD4 CAEA
43.14636 +BDD5 CAEB
43.14637 +BDD6 CAEC
43.14638 +BDD7 CAED
43.14639 +BDD8 CAEE
43.14640 +BDD9 CAEF
43.14641 +BDDA CAF0
43.14642 +BDDB CAF1
43.14643 +BDDC CAF2
43.14644 +BDDD CAF3
43.14645 +BDE1 CAF4
43.14646 +BDE2 CAF5
43.14647 +BDE3 CAF6
43.14648 +BDE4 CAF7
43.14649 +BDE5 CAF8
43.14650 +BDE6 CAF9
43.14651 +BDE7 CAFA
43.14652 +BDE8 CAFB
43.14653 +BDE9 CAFC
43.14654 +BDEA CAFD
43.14655 +BDEB CAFE
43.14656 +BDEC CAFF
43.14657 +BDED CB00
43.14658 +BDEE CB01
43.14659 +BDEF CB02
43.14660 +BDF0 CB03
43.14661 +BDF1 CB04
43.14662 +BDF3 CB05
43.14663 +BDF4 CB06
43.14664 +BDF5 CB07
43.14665 +BDF6 CB08
43.14666 +BDF7 CB09
43.14667 +BDF8 CB0A
43.14668 +BDF9 CB0B
43.14669 +BDFA CB0C
43.14670 +BDFB CB0D
43.14671 +BDFC CB0E
43.14672 +BDFD CB0F
43.14673 +BE41 CB10
43.14674 +BE42 CB11
43.14675 +BE43 CB12
43.14676 +BE44 CB13
43.14677 +BE45 CB14
43.14678 +BE46 CB15
43.14679 +BE47 CB16
43.14680 +BE48 CB17
43.14681 +BE49 CB18
43.14682 +BE4A CB19
43.14683 +BE4B CB1A
43.14684 +BE4C CB1B
43.14685 +BE4D CB1C
43.14686 +BE4E CB1D
43.14687 +BE4F CB1E
43.14688 +BE50 CB1F
43.14689 +BE51 CB20
43.14690 +BE53 CB21
43.14691 +BE54 CB22
43.14692 +BE55 CB23
43.14693 +BE56 CB24
43.14694 +BE57 CB25
43.14695 +BE58 CB26
43.14696 +BE59 CB27
43.14697 +BE5A CB28
43.14698 +BE5B CB29
43.14699 +BE5C CB2A
43.14700 +BE5D CB2B
43.14701 +BE61 CB2C
43.14702 +BE62 CB2D
43.14703 +BE63 CB2E
43.14704 +BE64 CB2F
43.14705 +BE65 CB30
43.14706 +BE66 CB31
43.14707 +BE67 CB32
43.14708 +BE68 CB33
43.14709 +BE69 CB34
43.14710 +BE6A CB35
43.14711 +BE6B CB36
43.14712 +BE6C CB37
43.14713 +BE6D CB38
43.14714 +BE6E CB39
43.14715 +BE6F CB3A
43.14716 +BE70 CB3B
43.14717 +BE71 CB3C
43.14718 +BE73 CB3D
43.14719 +BE74 CB3E
43.14720 +BE75 CB3F
43.14721 +BE76 CB40
43.14722 +BE77 CB41
43.14723 +BE78 CB42
43.14724 +BE79 CB43
43.14725 +BE7A CB44
43.14726 +BE7B CB45
43.14727 +BE7C CB46
43.14728 +BE7D CB47
43.14729 +BE81 CB48
43.14730 +BE82 CB49
43.14731 +BE83 CB4A
43.14732 +BE84 CB4B
43.14733 +BE85 CB4C
43.14734 +BE86 CB4D
43.14735 +BE87 CB4E
43.14736 +BE88 CB4F
43.14737 +BE89 CB50
43.14738 +BE8A CB51
43.14739 +BE8B CB52
43.14740 +BE8C CB53
43.14741 +BE8D CB54
43.14742 +BE8E CB55
43.14743 +BE8F CB56
43.14744 +BE90 CB57
43.14745 +BE91 CB58
43.14746 +BE93 CB59
43.14747 +BE94 CB5A
43.14748 +BE95 CB5B
43.14749 +BE96 CB5C
43.14750 +BE97 CB5D
43.14751 +BE98 CB5E
43.14752 +BE99 CB5F
43.14753 +BE9A CB60
43.14754 +BE9B CB61
43.14755 +BE9C CB62
43.14756 +BE9D CB63
43.14757 +BEA1 CB64
43.14758 +BEA2 CB65
43.14759 +BEA3 CB66
43.14760 +BEA4 CB67
43.14761 +BEA5 CB68
43.14762 +BEA6 CB69
43.14763 +BEA7 CB6A
43.14764 +BEA8 CB6B
43.14765 +BEA9 CB6C
43.14766 +BEAA CB6D
43.14767 +BEAB CB6E
43.14768 +BEAC CB6F
43.14769 +BEAD CB70
43.14770 +BEAE CB71
43.14771 +BEAF CB72
43.14772 +BEB0 CB73
43.14773 +BEB1 CB74
43.14774 +BEB3 CB75
43.14775 +BEB4 CB76
43.14776 +BEB5 CB77
43.14777 +BEB6 CB78
43.14778 +BEB7 CB79
43.14779 +BEB8 CB7A
43.14780 +BEB9 CB7B
43.14781 +BEBA CB7C
43.14782 +BEBB CB7D
43.14783 +BEBC CB7E
43.14784 +BEBD CB7F
43.14785 +BEC1 CB80
43.14786 +BEC2 CB81
43.14787 +BEC3 CB82
43.14788 +BEC4 CB83
43.14789 +BEC5 CB84
43.14790 +BEC6 CB85
43.14791 +BEC7 CB86
43.14792 +BEC8 CB87
43.14793 +BEC9 CB88
43.14794 +BECA CB89
43.14795 +BECB CB8A
43.14796 +BECC CB8B
43.14797 +BECD CB8C
43.14798 +BECE CB8D
43.14799 +BECF CB8E
43.14800 +BED0 CB8F
43.14801 +BED1 CB90
43.14802 +BED3 CB91
43.14803 +BED4 CB92
43.14804 +BED5 CB93
43.14805 +BED6 CB94
43.14806 +BED7 CB95
43.14807 +BED8 CB96
43.14808 +BED9 CB97
43.14809 +BEDA CB98
43.14810 +BEDB CB99
43.14811 +BEDC CB9A
43.14812 +BEDD CB9B
43.14813 +BEE1 CB9C
43.14814 +BEE2 CB9D
43.14815 +BEE3 CB9E
43.14816 +BEE4 CB9F
43.14817 +BEE5 CBA0
43.14818 +BEE6 CBA1
43.14819 +BEE7 CBA2
43.14820 +BEE8 CBA3
43.14821 +BEE9 CBA4
43.14822 +BEEA CBA5
43.14823 +BEEB CBA6
43.14824 +BEEC CBA7
43.14825 +BEED CBA8
43.14826 +BEEE CBA9
43.14827 +BEEF CBAA
43.14828 +BEF0 CBAB
43.14829 +BEF1 CBAC
43.14830 +BEF3 CBAD
43.14831 +BEF4 CBAE
43.14832 +BEF5 CBAF
43.14833 +BEF6 CBB0
43.14834 +BEF7 CBB1
43.14835 +BEF8 CBB2
43.14836 +BEF9 CBB3
43.14837 +BEFA CBB4
43.14838 +BEFB CBB5
43.14839 +BEFC CBB6
43.14840 +BEFD CBB7
43.14841 +BF41 CBB8
43.14842 +BF42 CBB9
43.14843 +BF43 CBBA
43.14844 +BF44 CBBB
43.14845 +BF45 CBBC
43.14846 +BF46 CBBD
43.14847 +BF47 CBBE
43.14848 +BF48 CBBF
43.14849 +BF49 CBC0
43.14850 +BF4A CBC1
43.14851 +BF4B CBC2
43.14852 +BF4C CBC3
43.14853 +BF4D CBC4
43.14854 +BF4E CBC5
43.14855 +BF4F CBC6
43.14856 +BF50 CBC7
43.14857 +BF51 CBC8
43.14858 +BF53 CBC9
43.14859 +BF54 CBCA
43.14860 +BF55 CBCB
43.14861 +BF56 CBCC
43.14862 +BF57 CBCD
43.14863 +BF58 CBCE
43.14864 +BF59 CBCF
43.14865 +BF5A CBD0
43.14866 +BF5B CBD1
43.14867 +BF5C CBD2
43.14868 +BF5D CBD3
43.14869 +BF61 CBD4
43.14870 +BF62 CBD5
43.14871 +BF63 CBD6
43.14872 +BF64 CBD7
43.14873 +BF65 CBD8
43.14874 +BF66 CBD9
43.14875 +BF67 CBDA
43.14876 +BF68 CBDB
43.14877 +BF69 CBDC
43.14878 +BF6A CBDD
43.14879 +BF6B CBDE
43.14880 +BF6C CBDF
43.14881 +BF6D CBE0
43.14882 +BF6E CBE1
43.14883 +BF6F CBE2
43.14884 +BF70 CBE3
43.14885 +BF71 CBE4
43.14886 +BF73 CBE5
43.14887 +BF74 CBE6
43.14888 +BF75 CBE7
43.14889 +BF76 CBE8
43.14890 +BF77 CBE9
43.14891 +BF78 CBEA
43.14892 +BF79 CBEB
43.14893 +BF7A CBEC
43.14894 +BF7B CBED
43.14895 +BF7C CBEE
43.14896 +BF7D CBEF
43.14897 +BF81 CBF0
43.14898 +BF82 CBF1
43.14899 +BF83 CBF2
43.14900 +BF84 CBF3
43.14901 +BF85 CBF4
43.14902 +BF86 CBF5
43.14903 +BF87 CBF6
43.14904 +BF88 CBF7
43.14905 +BF89 CBF8
43.14906 +BF8A CBF9
43.14907 +BF8B CBFA
43.14908 +BF8C CBFB
43.14909 +BF8D CBFC
43.14910 +BF8E CBFD
43.14911 +BF8F CBFE
43.14912 +BF90 CBFF
43.14913 +BF91 CC00
43.14914 +BF93 CC01
43.14915 +BF94 CC02
43.14916 +BF95 CC03
43.14917 +BF96 CC04
43.14918 +BF97 CC05
43.14919 +BF98 CC06
43.14920 +BF99 CC07
43.14921 +BF9A CC08
43.14922 +BF9B CC09
43.14923 +BF9C CC0A
43.14924 +BF9D CC0B
43.14925 +BFA1 CC0C
43.14926 +BFA2 CC0D
43.14927 +BFA3 CC0E
43.14928 +BFA4 CC0F
43.14929 +BFA5 CC10
43.14930 +BFA6 CC11
43.14931 +BFA7 CC12
43.14932 +BFA8 CC13
43.14933 +BFA9 CC14
43.14934 +BFAA CC15
43.14935 +BFAB CC16
43.14936 +BFAC CC17
43.14937 +BFAD CC18
43.14938 +BFAE CC19
43.14939 +BFAF CC1A
43.14940 +BFB0 CC1B
43.14941 +BFB1 CC1C
43.14942 +BFB3 CC1D
43.14943 +BFB4 CC1E
43.14944 +BFB5 CC1F
43.14945 +BFB6 CC20
43.14946 +BFB7 CC21
43.14947 +BFB8 CC22
43.14948 +BFB9 CC23
43.14949 +BFBA CC24
43.14950 +BFBB CC25
43.14951 +BFBC CC26
43.14952 +BFBD CC27
43.14953 +C041 314A
43.14954 +C061 CC28
43.14955 +C062 CC29
43.14956 +C063 CC2A
43.14957 +C064 CC2B
43.14958 +C065 CC2C
43.14959 +C066 CC2D
43.14960 +C067 CC2E
43.14961 +C068 CC2F
43.14962 +C069 CC30
43.14963 +C06A CC31
43.14964 +C06B CC32
43.14965 +C06C CC33
43.14966 +C06D CC34
43.14967 +C06E CC35
43.14968 +C06F CC36
43.14969 +C070 CC37
43.14970 +C071 CC38
43.14971 +C073 CC39
43.14972 +C074 CC3A
43.14973 +C075 CC3B
43.14974 +C076 CC3C
43.14975 +C077 CC3D
43.14976 +C078 CC3E
43.14977 +C079 CC3F
43.14978 +C07A CC40
43.14979 +C07B CC41
43.14980 +C07C CC42
43.14981 +C07D CC43
43.14982 +C081 CC44
43.14983 +C082 CC45
43.14984 +C083 CC46
43.14985 +C084 CC47
43.14986 +C085 CC48
43.14987 +C086 CC49
43.14988 +C087 CC4A
43.14989 +C088 CC4B
43.14990 +C089 CC4C
43.14991 +C08A CC4D
43.14992 +C08B CC4E
43.14993 +C08C CC4F
43.14994 +C08D CC50
43.14995 +C08E CC51
43.14996 +C08F CC52
43.14997 +C090 CC53
43.14998 +C091 CC54
43.14999 +C093 CC55
43.15000 +C094 CC56
43.15001 +C095 CC57
43.15002 +C096 CC58
43.15003 +C097 CC59
43.15004 +C098 CC5A
43.15005 +C099 CC5B
43.15006 +C09A CC5C
43.15007 +C09B CC5D
43.15008 +C09C CC5E
43.15009 +C09D CC5F
43.15010 +C0A1 CC60
43.15011 +C0A2 CC61
43.15012 +C0A3 CC62
43.15013 +C0A4 CC63
43.15014 +C0A5 CC64
43.15015 +C0A6 CC65
43.15016 +C0A7 CC66
43.15017 +C0A8 CC67
43.15018 +C0A9 CC68
43.15019 +C0AA CC69
43.15020 +C0AB CC6A
43.15021 +C0AC CC6B
43.15022 +C0AD CC6C
43.15023 +C0AE CC6D
43.15024 +C0AF CC6E
43.15025 +C0B0 CC6F
43.15026 +C0B1 CC70
43.15027 +C0B3 CC71
43.15028 +C0B4 CC72
43.15029 +C0B5 CC73
43.15030 +C0B6 CC74
43.15031 +C0B7 CC75
43.15032 +C0B8 CC76
43.15033 +C0B9 CC77
43.15034 +C0BA CC78
43.15035 +C0BB CC79
43.15036 +C0BC CC7A
43.15037 +C0BD CC7B
43.15038 +C0C1 CC7C
43.15039 +C0C2 CC7D
43.15040 +C0C3 CC7E
43.15041 +C0C4 CC7F
43.15042 +C0C5 CC80
43.15043 +C0C6 CC81
43.15044 +C0C7 CC82
43.15045 +C0C8 CC83
43.15046 +C0C9 CC84
43.15047 +C0CA CC85
43.15048 +C0CB CC86
43.15049 +C0CC CC87
43.15050 +C0CD CC88
43.15051 +C0CE CC89
43.15052 +C0CF CC8A
43.15053 +C0D0 CC8B
43.15054 +C0D1 CC8C
43.15055 +C0D3 CC8D
43.15056 +C0D4 CC8E
43.15057 +C0D5 CC8F
43.15058 +C0D6 CC90
43.15059 +C0D7 CC91
43.15060 +C0D8 CC92
43.15061 +C0D9 CC93
43.15062 +C0DA CC94
43.15063 +C0DB CC95
43.15064 +C0DC CC96
43.15065 +C0DD CC97
43.15066 +C0E1 CC98
43.15067 +C0E2 CC99
43.15068 +C0E3 CC9A
43.15069 +C0E4 CC9B
43.15070 +C0E5 CC9C
43.15071 +C0E6 CC9D
43.15072 +C0E7 CC9E
43.15073 +C0E8 CC9F
43.15074 +C0E9 CCA0
43.15075 +C0EA CCA1
43.15076 +C0EB CCA2
43.15077 +C0EC CCA3
43.15078 +C0ED CCA4
43.15079 +C0EE CCA5
43.15080 +C0EF CCA6
43.15081 +C0F0 CCA7
43.15082 +C0F1 CCA8
43.15083 +C0F3 CCA9
43.15084 +C0F4 CCAA
43.15085 +C0F5 CCAB
43.15086 +C0F6 CCAC
43.15087 +C0F7 CCAD
43.15088 +C0F8 CCAE
43.15089 +C0F9 CCAF
43.15090 +C0FA CCB0
43.15091 +C0FB CCB1
43.15092 +C0FC CCB2
43.15093 +C0FD CCB3
43.15094 +C141 CCB4
43.15095 +C142 CCB5
43.15096 +C143 CCB6
43.15097 +C144 CCB7
43.15098 +C145 CCB8
43.15099 +C146 CCB9
43.15100 +C147 CCBA
43.15101 +C148 CCBB
43.15102 +C149 CCBC
43.15103 +C14A CCBD
43.15104 +C14B CCBE
43.15105 +C14C CCBF
43.15106 +C14D CCC0
43.15107 +C14E CCC1
43.15108 +C14F CCC2
43.15109 +C150 CCC3
43.15110 +C151 CCC4
43.15111 +C153 CCC5
43.15112 +C154 CCC6
43.15113 +C155 CCC7
43.15114 +C156 CCC8
43.15115 +C157 CCC9
43.15116 +C158 CCCA
43.15117 +C159 CCCB
43.15118 +C15A CCCC
43.15119 +C15B CCCD
43.15120 +C15C CCCE
43.15121 +C15D CCCF
43.15122 +C161 CCD0
43.15123 +C162 CCD1
43.15124 +C163 CCD2
43.15125 +C164 CCD3
43.15126 +C165 CCD4
43.15127 +C166 CCD5
43.15128 +C167 CCD6
43.15129 +C168 CCD7
43.15130 +C169 CCD8
43.15131 +C16A CCD9
43.15132 +C16B CCDA
43.15133 +C16C CCDB
43.15134 +C16D CCDC
43.15135 +C16E CCDD
43.15136 +C16F CCDE
43.15137 +C170 CCDF
43.15138 +C171 CCE0
43.15139 +C173 CCE1
43.15140 +C174 CCE2
43.15141 +C175 CCE3
43.15142 +C176 CCE4
43.15143 +C177 CCE5
43.15144 +C178 CCE6
43.15145 +C179 CCE7
43.15146 +C17A CCE8
43.15147 +C17B CCE9
43.15148 +C17C CCEA
43.15149 +C17D CCEB
43.15150 +C181 CCEC
43.15151 +C182 CCED
43.15152 +C183 CCEE
43.15153 +C184 CCEF
43.15154 +C185 CCF0
43.15155 +C186 CCF1
43.15156 +C187 CCF2
43.15157 +C188 CCF3
43.15158 +C189 CCF4
43.15159 +C18A CCF5
43.15160 +C18B CCF6
43.15161 +C18C CCF7
43.15162 +C18D CCF8
43.15163 +C18E CCF9
43.15164 +C18F CCFA
43.15165 +C190 CCFB
43.15166 +C191 CCFC
43.15167 +C193 CCFD
43.15168 +C194 CCFE
43.15169 +C195 CCFF
43.15170 +C196 CD00
43.15171 +C197 CD01
43.15172 +C198 CD02
43.15173 +C199 CD03
43.15174 +C19A CD04
43.15175 +C19B CD05
43.15176 +C19C CD06
43.15177 +C19D CD07
43.15178 +C1A1 CD08
43.15179 +C1A2 CD09
43.15180 +C1A3 CD0A
43.15181 +C1A4 CD0B
43.15182 +C1A5 CD0C
43.15183 +C1A6 CD0D
43.15184 +C1A7 CD0E
43.15185 +C1A8 CD0F
43.15186 +C1A9 CD10
43.15187 +C1AA CD11
43.15188 +C1AB CD12
43.15189 +C1AC CD13
43.15190 +C1AD CD14
43.15191 +C1AE CD15
43.15192 +C1AF CD16
43.15193 +C1B0 CD17
43.15194 +C1B1 CD18
43.15195 +C1B3 CD19
43.15196 +C1B4 CD1A
43.15197 +C1B5 CD1B
43.15198 +C1B6 CD1C
43.15199 +C1B7 CD1D
43.15200 +C1B8 CD1E
43.15201 +C1B9 CD1F
43.15202 +C1BA CD20
43.15203 +C1BB CD21
43.15204 +C1BC CD22
43.15205 +C1BD CD23
43.15206 +C1C1 CD24
43.15207 +C1C2 CD25
43.15208 +C1C3 CD26
43.15209 +C1C4 CD27
43.15210 +C1C5 CD28
43.15211 +C1C6 CD29
43.15212 +C1C7 CD2A
43.15213 +C1C8 CD2B
43.15214 +C1C9 CD2C
43.15215 +C1CA CD2D
43.15216 +C1CB CD2E
43.15217 +C1CC CD2F
43.15218 +C1CD CD30
43.15219 +C1CE CD31
43.15220 +C1CF CD32
43.15221 +C1D0 CD33
43.15222 +C1D1 CD34
43.15223 +C1D3 CD35
43.15224 +C1D4 CD36
43.15225 +C1D5 CD37
43.15226 +C1D6 CD38
43.15227 +C1D7 CD39
43.15228 +C1D8 CD3A
43.15229 +C1D9 CD3B
43.15230 +C1DA CD3C
43.15231 +C1DB CD3D
43.15232 +C1DC CD3E
43.15233 +C1DD CD3F
43.15234 +C1E1 CD40
43.15235 +C1E2 CD41
43.15236 +C1E3 CD42
43.15237 +C1E4 CD43
43.15238 +C1E5 CD44
43.15239 +C1E6 CD45
43.15240 +C1E7 CD46
43.15241 +C1E8 CD47
43.15242 +C1E9 CD48
43.15243 +C1EA CD49
43.15244 +C1EB CD4A
43.15245 +C1EC CD4B
43.15246 +C1ED CD4C
43.15247 +C1EE CD4D
43.15248 +C1EF CD4E
43.15249 +C1F0 CD4F
43.15250 +C1F1 CD50
43.15251 +C1F3 CD51
43.15252 +C1F4 CD52
43.15253 +C1F5 CD53
43.15254 +C1F6 CD54
43.15255 +C1F7 CD55
43.15256 +C1F8 CD56
43.15257 +C1F9 CD57
43.15258 +C1FA CD58
43.15259 +C1FB CD59
43.15260 +C1FC CD5A
43.15261 +C1FD CD5B
43.15262 +C241 CD5C
43.15263 +C242 CD5D
43.15264 +C243 CD5E
43.15265 +C244 CD5F
43.15266 +C245 CD60
43.15267 +C246 CD61
43.15268 +C247 CD62
43.15269 +C248 CD63
43.15270 +C249 CD64
43.15271 +C24A CD65
43.15272 +C24B CD66
43.15273 +C24C CD67
43.15274 +C24D CD68
43.15275 +C24E CD69
43.15276 +C24F CD6A
43.15277 +C250 CD6B
43.15278 +C251 CD6C
43.15279 +C253 CD6D
43.15280 +C254 CD6E
43.15281 +C255 CD6F
43.15282 +C256 CD70
43.15283 +C257 CD71
43.15284 +C258 CD72
43.15285 +C259 CD73
43.15286 +C25A CD74
43.15287 +C25B CD75
43.15288 +C25C CD76
43.15289 +C25D CD77
43.15290 +C261 CD78
43.15291 +C262 CD79
43.15292 +C263 CD7A
43.15293 +C264 CD7B
43.15294 +C265 CD7C
43.15295 +C266 CD7D
43.15296 +C267 CD7E
43.15297 +C268 CD7F
43.15298 +C269 CD80
43.15299 +C26A CD81
43.15300 +C26B CD82
43.15301 +C26C CD83
43.15302 +C26D CD84
43.15303 +C26E CD85
43.15304 +C26F CD86
43.15305 +C270 CD87
43.15306 +C271 CD88
43.15307 +C273 CD89
43.15308 +C274 CD8A
43.15309 +C275 CD8B
43.15310 +C276 CD8C
43.15311 +C277 CD8D
43.15312 +C278 CD8E
43.15313 +C279 CD8F
43.15314 +C27A CD90
43.15315 +C27B CD91
43.15316 +C27C CD92
43.15317 +C27D CD93
43.15318 +C281 CD94
43.15319 +C282 CD95
43.15320 +C283 CD96
43.15321 +C284 CD97
43.15322 +C285 CD98
43.15323 +C286 CD99
43.15324 +C287 CD9A
43.15325 +C288 CD9B
43.15326 +C289 CD9C
43.15327 +C28A CD9D
43.15328 +C28B CD9E
43.15329 +C28C CD9F
43.15330 +C28D CDA0
43.15331 +C28E CDA1
43.15332 +C28F CDA2
43.15333 +C290 CDA3
43.15334 +C291 CDA4
43.15335 +C293 CDA5
43.15336 +C294 CDA6
43.15337 +C295 CDA7
43.15338 +C296 CDA8
43.15339 +C297 CDA9
43.15340 +C298 CDAA
43.15341 +C299 CDAB
43.15342 +C29A CDAC
43.15343 +C29B CDAD
43.15344 +C29C CDAE
43.15345 +C29D CDAF
43.15346 +C2A1 CDB0
43.15347 +C2A2 CDB1
43.15348 +C2A3 CDB2
43.15349 +C2A4 CDB3
43.15350 +C2A5 CDB4
43.15351 +C2A6 CDB5
43.15352 +C2A7 CDB6
43.15353 +C2A8 CDB7
43.15354 +C2A9 CDB8
43.15355 +C2AA CDB9
43.15356 +C2AB CDBA
43.15357 +C2AC CDBB
43.15358 +C2AD CDBC
43.15359 +C2AE CDBD
43.15360 +C2AF CDBE
43.15361 +C2B0 CDBF
43.15362 +C2B1 CDC0
43.15363 +C2B3 CDC1
43.15364 +C2B4 CDC2
43.15365 +C2B5 CDC3
43.15366 +C2B6 CDC4
43.15367 +C2B7 CDC5
43.15368 +C2B8 CDC6
43.15369 +C2B9 CDC7
43.15370 +C2BA CDC8
43.15371 +C2BB CDC9
43.15372 +C2BC CDCA
43.15373 +C2BD CDCB
43.15374 +C2C1 CDCC
43.15375 +C2C2 CDCD
43.15376 +C2C3 CDCE
43.15377 +C2C4 CDCF
43.15378 +C2C5 CDD0
43.15379 +C2C6 CDD1
43.15380 +C2C7 CDD2
43.15381 +C2C8 CDD3
43.15382 +C2C9 CDD4
43.15383 +C2CA CDD5
43.15384 +C2CB CDD6
43.15385 +C2CC CDD7
43.15386 +C2CD CDD8
43.15387 +C2CE CDD9
43.15388 +C2CF CDDA
43.15389 +C2D0 CDDB
43.15390 +C2D1 CDDC
43.15391 +C2D3 CDDD
43.15392 +C2D4 CDDE
43.15393 +C2D5 CDDF
43.15394 +C2D6 CDE0
43.15395 +C2D7 CDE1
43.15396 +C2D8 CDE2
43.15397 +C2D9 CDE3
43.15398 +C2DA CDE4
43.15399 +C2DB CDE5
43.15400 +C2DC CDE6
43.15401 +C2DD CDE7
43.15402 +C2E1 CDE8
43.15403 +C2E2 CDE9
43.15404 +C2E3 CDEA
43.15405 +C2E4 CDEB
43.15406 +C2E5 CDEC
43.15407 +C2E6 CDED
43.15408 +C2E7 CDEE
43.15409 +C2E8 CDEF
43.15410 +C2E9 CDF0
43.15411 +C2EA CDF1
43.15412 +C2EB CDF2
43.15413 +C2EC CDF3
43.15414 +C2ED CDF4
43.15415 +C2EE CDF5
43.15416 +C2EF CDF6
43.15417 +C2F0 CDF7
43.15418 +C2F1 CDF8
43.15419 +C2F3 CDF9
43.15420 +C2F4 CDFA
43.15421 +C2F5 CDFB
43.15422 +C2F6 CDFC
43.15423 +C2F7 CDFD
43.15424 +C2F8 CDFE
43.15425 +C2F9 CDFF
43.15426 +C2FA CE00
43.15427 +C2FB CE01
43.15428 +C2FC CE02
43.15429 +C2FD CE03
43.15430 +C341 CE04
43.15431 +C342 CE05
43.15432 +C343 CE06
43.15433 +C344 CE07
43.15434 +C345 CE08
43.15435 +C346 CE09
43.15436 +C347 CE0A
43.15437 +C348 CE0B
43.15438 +C349 CE0C
43.15439 +C34A CE0D
43.15440 +C34B CE0E
43.15441 +C34C CE0F
43.15442 +C34D CE10
43.15443 +C34E CE11
43.15444 +C34F CE12
43.15445 +C350 CE13
43.15446 +C351 CE14
43.15447 +C353 CE15
43.15448 +C354 CE16
43.15449 +C355 CE17
43.15450 +C356 CE18
43.15451 +C357 CE19
43.15452 +C358 CE1A
43.15453 +C359 CE1B
43.15454 +C35A CE1C
43.15455 +C35B CE1D
43.15456 +C35C CE1E
43.15457 +C35D CE1F
43.15458 +C361 CE20
43.15459 +C362 CE21
43.15460 +C363 CE22
43.15461 +C364 CE23
43.15462 +C365 CE24
43.15463 +C366 CE25
43.15464 +C367 CE26
43.15465 +C368 CE27
43.15466 +C369 CE28
43.15467 +C36A CE29
43.15468 +C36B CE2A
43.15469 +C36C CE2B
43.15470 +C36D CE2C
43.15471 +C36E CE2D
43.15472 +C36F CE2E
43.15473 +C370 CE2F
43.15474 +C371 CE30
43.15475 +C373 CE31
43.15476 +C374 CE32
43.15477 +C375 CE33
43.15478 +C376 CE34
43.15479 +C377 CE35
43.15480 +C378 CE36
43.15481 +C379 CE37
43.15482 +C37A CE38
43.15483 +C37B CE39
43.15484 +C37C CE3A
43.15485 +C37D CE3B
43.15486 +C381 CE3C
43.15487 +C382 CE3D
43.15488 +C383 CE3E
43.15489 +C384 CE3F
43.15490 +C385 CE40
43.15491 +C386 CE41
43.15492 +C387 CE42
43.15493 +C388 CE43
43.15494 +C389 CE44
43.15495 +C38A CE45
43.15496 +C38B CE46
43.15497 +C38C CE47
43.15498 +C38D CE48
43.15499 +C38E CE49
43.15500 +C38F CE4A
43.15501 +C390 CE4B
43.15502 +C391 CE4C
43.15503 +C393 CE4D
43.15504 +C394 CE4E
43.15505 +C395 CE4F
43.15506 +C396 CE50
43.15507 +C397 CE51
43.15508 +C398 CE52
43.15509 +C399 CE53
43.15510 +C39A CE54
43.15511 +C39B CE55
43.15512 +C39C CE56
43.15513 +C39D CE57
43.15514 +C3A1 CE58
43.15515 +C3A2 CE59
43.15516 +C3A3 CE5A
43.15517 +C3A4 CE5B
43.15518 +C3A5 CE5C
43.15519 +C3A6 CE5D
43.15520 +C3A7 CE5E
43.15521 +C3A8 CE5F
43.15522 +C3A9 CE60
43.15523 +C3AA CE61
43.15524 +C3AB CE62
43.15525 +C3AC CE63
43.15526 +C3AD CE64
43.15527 +C3AE CE65
43.15528 +C3AF CE66
43.15529 +C3B0 CE67
43.15530 +C3B1 CE68
43.15531 +C3B3 CE69
43.15532 +C3B4 CE6A
43.15533 +C3B5 CE6B
43.15534 +C3B6 CE6C
43.15535 +C3B7 CE6D
43.15536 +C3B8 CE6E
43.15537 +C3B9 CE6F
43.15538 +C3BA CE70
43.15539 +C3BB CE71
43.15540 +C3BC CE72
43.15541 +C3BD CE73
43.15542 +C441 314B
43.15543 +C461 CE74
43.15544 +C462 CE75
43.15545 +C463 CE76
43.15546 +C464 CE77
43.15547 +C465 CE78
43.15548 +C466 CE79
43.15549 +C467 CE7A
43.15550 +C468 CE7B
43.15551 +C469 CE7C
43.15552 +C46A CE7D
43.15553 +C46B CE7E
43.15554 +C46C CE7F
43.15555 +C46D CE80
43.15556 +C46E CE81
43.15557 +C46F CE82
43.15558 +C470 CE83
43.15559 +C471 CE84
43.15560 +C473 CE85
43.15561 +C474 CE86
43.15562 +C475 CE87
43.15563 +C476 CE88
43.15564 +C477 CE89
43.15565 +C478 CE8A
43.15566 +C479 CE8B
43.15567 +C47A CE8C
43.15568 +C47B CE8D
43.15569 +C47C CE8E
43.15570 +C47D CE8F
43.15571 +C481 CE90
43.15572 +C482 CE91
43.15573 +C483 CE92
43.15574 +C484 CE93
43.15575 +C485 CE94
43.15576 +C486 CE95
43.15577 +C487 CE96
43.15578 +C488 CE97
43.15579 +C489 CE98
43.15580 +C48A CE99
43.15581 +C48B CE9A
43.15582 +C48C CE9B
43.15583 +C48D CE9C
43.15584 +C48E CE9D
43.15585 +C48F CE9E
43.15586 +C490 CE9F
43.15587 +C491 CEA0
43.15588 +C493 CEA1
43.15589 +C494 CEA2
43.15590 +C495 CEA3
43.15591 +C496 CEA4
43.15592 +C497 CEA5
43.15593 +C498 CEA6
43.15594 +C499 CEA7
43.15595 +C49A CEA8
43.15596 +C49B CEA9
43.15597 +C49C CEAA
43.15598 +C49D CEAB
43.15599 +C4A1 CEAC
43.15600 +C4A2 CEAD
43.15601 +C4A3 CEAE
43.15602 +C4A4 CEAF
43.15603 +C4A5 CEB0
43.15604 +C4A6 CEB1
43.15605 +C4A7 CEB2
43.15606 +C4A8 CEB3
43.15607 +C4A9 CEB4
43.15608 +C4AA CEB5
43.15609 +C4AB CEB6
43.15610 +C4AC CEB7
43.15611 +C4AD CEB8
43.15612 +C4AE CEB9
43.15613 +C4AF CEBA
43.15614 +C4B0 CEBB
43.15615 +C4B1 CEBC
43.15616 +C4B3 CEBD
43.15617 +C4B4 CEBE
43.15618 +C4B5 CEBF
43.15619 +C4B6 CEC0
43.15620 +C4B7 CEC1
43.15621 +C4B8 CEC2
43.15622 +C4B9 CEC3
43.15623 +C4BA CEC4
43.15624 +C4BB CEC5
43.15625 +C4BC CEC6
43.15626 +C4BD CEC7
43.15627 +C4C1 CEC8
43.15628 +C4C2 CEC9
43.15629 +C4C3 CECA
43.15630 +C4C4 CECB
43.15631 +C4C5 CECC
43.15632 +C4C6 CECD
43.15633 +C4C7 CECE
43.15634 +C4C8 CECF
43.15635 +C4C9 CED0
43.15636 +C4CA CED1
43.15637 +C4CB CED2
43.15638 +C4CC CED3
43.15639 +C4CD CED4
43.15640 +C4CE CED5
43.15641 +C4CF CED6
43.15642 +C4D0 CED7
43.15643 +C4D1 CED8
43.15644 +C4D3 CED9
43.15645 +C4D4 CEDA
43.15646 +C4D5 CEDB
43.15647 +C4D6 CEDC
43.15648 +C4D7 CEDD
43.15649 +C4D8 CEDE
43.15650 +C4D9 CEDF
43.15651 +C4DA CEE0
43.15652 +C4DB CEE1
43.15653 +C4DC CEE2
43.15654 +C4DD CEE3
43.15655 +C4E1 CEE4
43.15656 +C4E2 CEE5
43.15657 +C4E3 CEE6
43.15658 +C4E4 CEE7
43.15659 +C4E5 CEE8
43.15660 +C4E6 CEE9
43.15661 +C4E7 CEEA
43.15662 +C4E8 CEEB
43.15663 +C4E9 CEEC
43.15664 +C4EA CEED
43.15665 +C4EB CEEE
43.15666 +C4EC CEEF
43.15667 +C4ED CEF0
43.15668 +C4EE CEF1
43.15669 +C4EF CEF2
43.15670 +C4F0 CEF3
43.15671 +C4F1 CEF4
43.15672 +C4F3 CEF5
43.15673 +C4F4 CEF6
43.15674 +C4F5 CEF7
43.15675 +C4F6 CEF8
43.15676 +C4F7 CEF9
43.15677 +C4F8 CEFA
43.15678 +C4F9 CEFB
43.15679 +C4FA CEFC
43.15680 +C4FB CEFD
43.15681 +C4FC CEFE
43.15682 +C4FD CEFF
43.15683 +C541 CF00
43.15684 +C542 CF01
43.15685 +C543 CF02
43.15686 +C544 CF03
43.15687 +C545 CF04
43.15688 +C546 CF05
43.15689 +C547 CF06
43.15690 +C548 CF07
43.15691 +C549 CF08
43.15692 +C54A CF09
43.15693 +C54B CF0A
43.15694 +C54C CF0B
43.15695 +C54D CF0C
43.15696 +C54E CF0D
43.15697 +C54F CF0E
43.15698 +C550 CF0F
43.15699 +C551 CF10
43.15700 +C553 CF11
43.15701 +C554 CF12
43.15702 +C555 CF13
43.15703 +C556 CF14
43.15704 +C557 CF15
43.15705 +C558 CF16
43.15706 +C559 CF17
43.15707 +C55A CF18
43.15708 +C55B CF19
43.15709 +C55C CF1A
43.15710 +C55D CF1B
43.15711 +C561 CF1C
43.15712 +C562 CF1D
43.15713 +C563 CF1E
43.15714 +C564 CF1F
43.15715 +C565 CF20
43.15716 +C566 CF21
43.15717 +C567 CF22
43.15718 +C568 CF23
43.15719 +C569 CF24
43.15720 +C56A CF25
43.15721 +C56B CF26
43.15722 +C56C CF27
43.15723 +C56D CF28
43.15724 +C56E CF29
43.15725 +C56F CF2A
43.15726 +C570 CF2B
43.15727 +C571 CF2C
43.15728 +C573 CF2D
43.15729 +C574 CF2E
43.15730 +C575 CF2F
43.15731 +C576 CF30
43.15732 +C577 CF31
43.15733 +C578 CF32
43.15734 +C579 CF33
43.15735 +C57A CF34
43.15736 +C57B CF35
43.15737 +C57C CF36
43.15738 +C57D CF37
43.15739 +C581 CF38
43.15740 +C582 CF39
43.15741 +C583 CF3A
43.15742 +C584 CF3B
43.15743 +C585 CF3C
43.15744 +C586 CF3D
43.15745 +C587 CF3E
43.15746 +C588 CF3F
43.15747 +C589 CF40
43.15748 +C58A CF41
43.15749 +C58B CF42
43.15750 +C58C CF43
43.15751 +C58D CF44
43.15752 +C58E CF45
43.15753 +C58F CF46
43.15754 +C590 CF47
43.15755 +C591 CF48
43.15756 +C593 CF49
43.15757 +C594 CF4A
43.15758 +C595 CF4B
43.15759 +C596 CF4C
43.15760 +C597 CF4D
43.15761 +C598 CF4E
43.15762 +C599 CF4F
43.15763 +C59A CF50
43.15764 +C59B CF51
43.15765 +C59C CF52
43.15766 +C59D CF53
43.15767 +C5A1 CF54
43.15768 +C5A2 CF55
43.15769 +C5A3 CF56
43.15770 +C5A4 CF57
43.15771 +C5A5 CF58
43.15772 +C5A6 CF59
43.15773 +C5A7 CF5A
43.15774 +C5A8 CF5B
43.15775 +C5A9 CF5C
43.15776 +C5AA CF5D
43.15777 +C5AB CF5E
43.15778 +C5AC CF5F
43.15779 +C5AD CF60
43.15780 +C5AE CF61
43.15781 +C5AF CF62
43.15782 +C5B0 CF63
43.15783 +C5B1 CF64
43.15784 +C5B3 CF65
43.15785 +C5B4 CF66
43.15786 +C5B5 CF67
43.15787 +C5B6 CF68
43.15788 +C5B7 CF69
43.15789 +C5B8 CF6A
43.15790 +C5B9 CF6B
43.15791 +C5BA CF6C
43.15792 +C5BB CF6D
43.15793 +C5BC CF6E
43.15794 +C5BD CF6F
43.15795 +C5C1 CF70
43.15796 +C5C2 CF71
43.15797 +C5C3 CF72
43.15798 +C5C4 CF73
43.15799 +C5C5 CF74
43.15800 +C5C6 CF75
43.15801 +C5C7 CF76
43.15802 +C5C8 CF77
43.15803 +C5C9 CF78
43.15804 +C5CA CF79
43.15805 +C5CB CF7A
43.15806 +C5CC CF7B
43.15807 +C5CD CF7C
43.15808 +C5CE CF7D
43.15809 +C5CF CF7E
43.15810 +C5D0 CF7F
43.15811 +C5D1 CF80
43.15812 +C5D3 CF81
43.15813 +C5D4 CF82
43.15814 +C5D5 CF83
43.15815 +C5D6 CF84
43.15816 +C5D7 CF85
43.15817 +C5D8 CF86
43.15818 +C5D9 CF87
43.15819 +C5DA CF88
43.15820 +C5DB CF89
43.15821 +C5DC CF8A
43.15822 +C5DD CF8B
43.15823 +C5E1 CF8C
43.15824 +C5E2 CF8D
43.15825 +C5E3 CF8E
43.15826 +C5E4 CF8F
43.15827 +C5E5 CF90
43.15828 +C5E6 CF91
43.15829 +C5E7 CF92
43.15830 +C5E8 CF93
43.15831 +C5E9 CF94
43.15832 +C5EA CF95
43.15833 +C5EB CF96
43.15834 +C5EC CF97
43.15835 +C5ED CF98
43.15836 +C5EE CF99
43.15837 +C5EF CF9A
43.15838 +C5F0 CF9B
43.15839 +C5F1 CF9C
43.15840 +C5F3 CF9D
43.15841 +C5F4 CF9E
43.15842 +C5F5 CF9F
43.15843 +C5F6 CFA0
43.15844 +C5F7 CFA1
43.15845 +C5F8 CFA2
43.15846 +C5F9 CFA3
43.15847 +C5FA CFA4
43.15848 +C5FB CFA5
43.15849 +C5FC CFA6
43.15850 +C5FD CFA7
43.15851 +C641 CFA8
43.15852 +C642 CFA9
43.15853 +C643 CFAA
43.15854 +C644 CFAB
43.15855 +C645 CFAC
43.15856 +C646 CFAD
43.15857 +C647 CFAE
43.15858 +C648 CFAF
43.15859 +C649 CFB0
43.15860 +C64A CFB1
43.15861 +C64B CFB2
43.15862 +C64C CFB3
43.15863 +C64D CFB4
43.15864 +C64E CFB5
43.15865 +C64F CFB6
43.15866 +C650 CFB7
43.15867 +C651 CFB8
43.15868 +C653 CFB9
43.15869 +C654 CFBA
43.15870 +C655 CFBB
43.15871 +C656 CFBC
43.15872 +C657 CFBD
43.15873 +C658 CFBE
43.15874 +C659 CFBF
43.15875 +C65A CFC0
43.15876 +C65B CFC1
43.15877 +C65C CFC2
43.15878 +C65D CFC3
43.15879 +C661 CFC4
43.15880 +C662 CFC5
43.15881 +C663 CFC6
43.15882 +C664 CFC7
43.15883 +C665 CFC8
43.15884 +C666 CFC9
43.15885 +C667 CFCA
43.15886 +C668 CFCB
43.15887 +C669 CFCC
43.15888 +C66A CFCD
43.15889 +C66B CFCE
43.15890 +C66C CFCF
43.15891 +C66D CFD0
43.15892 +C66E CFD1
43.15893 +C66F CFD2
43.15894 +C670 CFD3
43.15895 +C671 CFD4
43.15896 +C673 CFD5
43.15897 +C674 CFD6
43.15898 +C675 CFD7
43.15899 +C676 CFD8
43.15900 +C677 CFD9
43.15901 +C678 CFDA
43.15902 +C679 CFDB
43.15903 +C67A CFDC
43.15904 +C67B CFDD
43.15905 +C67C CFDE
43.15906 +C67D CFDF
43.15907 +C681 CFE0
43.15908 +C682 CFE1
43.15909 +C683 CFE2
43.15910 +C684 CFE3
43.15911 +C685 CFE4
43.15912 +C686 CFE5
43.15913 +C687 CFE6
43.15914 +C688 CFE7
43.15915 +C689 CFE8
43.15916 +C68A CFE9
43.15917 +C68B CFEA
43.15918 +C68C CFEB
43.15919 +C68D CFEC
43.15920 +C68E CFED
43.15921 +C68F CFEE
43.15922 +C690 CFEF
43.15923 +C691 CFF0
43.15924 +C693 CFF1
43.15925 +C694 CFF2
43.15926 +C695 CFF3
43.15927 +C696 CFF4
43.15928 +C697 CFF5
43.15929 +C698 CFF6
43.15930 +C699 CFF7
43.15931 +C69A CFF8
43.15932 +C69B CFF9
43.15933 +C69C CFFA
43.15934 +C69D CFFB
43.15935 +C6A1 CFFC
43.15936 +C6A2 CFFD
43.15937 +C6A3 CFFE
43.15938 +C6A4 CFFF
43.15939 +C6A5 D000
43.15940 +C6A6 D001
43.15941 +C6A7 D002
43.15942 +C6A8 D003
43.15943 +C6A9 D004
43.15944 +C6AA D005
43.15945 +C6AB D006
43.15946 +C6AC D007
43.15947 +C6AD D008
43.15948 +C6AE D009
43.15949 +C6AF D00A
43.15950 +C6B0 D00B
43.15951 +C6B1 D00C
43.15952 +C6B3 D00D
43.15953 +C6B4 D00E
43.15954 +C6B5 D00F
43.15955 +C6B6 D010
43.15956 +C6B7 D011
43.15957 +C6B8 D012
43.15958 +C6B9 D013
43.15959 +C6BA D014
43.15960 +C6BB D015
43.15961 +C6BC D016
43.15962 +C6BD D017
43.15963 +C6C1 D018
43.15964 +C6C2 D019
43.15965 +C6C3 D01A
43.15966 +C6C4 D01B
43.15967 +C6C5 D01C
43.15968 +C6C6 D01D
43.15969 +C6C7 D01E
43.15970 +C6C8 D01F
43.15971 +C6C9 D020
43.15972 +C6CA D021
43.15973 +C6CB D022
43.15974 +C6CC D023
43.15975 +C6CD D024
43.15976 +C6CE D025
43.15977 +C6CF D026
43.15978 +C6D0 D027
43.15979 +C6D1 D028
43.15980 +C6D3 D029
43.15981 +C6D4 D02A
43.15982 +C6D5 D02B
43.15983 +C6D6 D02C
43.15984 +C6D7 D02D
43.15985 +C6D8 D02E
43.15986 +C6D9 D02F
43.15987 +C6DA D030
43.15988 +C6DB D031
43.15989 +C6DC D032
43.15990 +C6DD D033
43.15991 +C6E1 D034
43.15992 +C6E2 D035
43.15993 +C6E3 D036
43.15994 +C6E4 D037
43.15995 +C6E5 D038
43.15996 +C6E6 D039
43.15997 +C6E7 D03A
43.15998 +C6E8 D03B
43.15999 +C6E9 D03C
43.16000 +C6EA D03D
43.16001 +C6EB D03E
43.16002 +C6EC D03F
43.16003 +C6ED D040
43.16004 +C6EE D041
43.16005 +C6EF D042
43.16006 +C6F0 D043
43.16007 +C6F1 D044
43.16008 +C6F3 D045
43.16009 +C6F4 D046
43.16010 +C6F5 D047
43.16011 +C6F6 D048
43.16012 +C6F7 D049
43.16013 +C6F8 D04A
43.16014 +C6F9 D04B
43.16015 +C6FA D04C
43.16016 +C6FB D04D
43.16017 +C6FC D04E
43.16018 +C6FD D04F
43.16019 +C741 D050
43.16020 +C742 D051
43.16021 +C743 D052
43.16022 +C744 D053
43.16023 +C745 D054
43.16024 +C746 D055
43.16025 +C747 D056
43.16026 +C748 D057
43.16027 +C749 D058
43.16028 +C74A D059
43.16029 +C74B D05A
43.16030 +C74C D05B
43.16031 +C74D D05C
43.16032 +C74E D05D
43.16033 +C74F D05E
43.16034 +C750 D05F
43.16035 +C751 D060
43.16036 +C753 D061
43.16037 +C754 D062
43.16038 +C755 D063
43.16039 +C756 D064
43.16040 +C757 D065
43.16041 +C758 D066
43.16042 +C759 D067
43.16043 +C75A D068
43.16044 +C75B D069
43.16045 +C75C D06A
43.16046 +C75D D06B
43.16047 +C761 D06C
43.16048 +C762 D06D
43.16049 +C763 D06E
43.16050 +C764 D06F
43.16051 +C765 D070
43.16052 +C766 D071
43.16053 +C767 D072
43.16054 +C768 D073
43.16055 +C769 D074
43.16056 +C76A D075
43.16057 +C76B D076
43.16058 +C76C D077
43.16059 +C76D D078
43.16060 +C76E D079
43.16061 +C76F D07A
43.16062 +C770 D07B
43.16063 +C771 D07C
43.16064 +C773 D07D
43.16065 +C774 D07E
43.16066 +C775 D07F
43.16067 +C776 D080
43.16068 +C777 D081
43.16069 +C778 D082
43.16070 +C779 D083
43.16071 +C77A D084
43.16072 +C77B D085
43.16073 +C77C D086
43.16074 +C77D D087
43.16075 +C781 D088
43.16076 +C782 D089
43.16077 +C783 D08A
43.16078 +C784 D08B
43.16079 +C785 D08C
43.16080 +C786 D08D
43.16081 +C787 D08E
43.16082 +C788 D08F
43.16083 +C789 D090
43.16084 +C78A D091
43.16085 +C78B D092
43.16086 +C78C D093
43.16087 +C78D D094
43.16088 +C78E D095
43.16089 +C78F D096
43.16090 +C790 D097
43.16091 +C791 D098
43.16092 +C793 D099
43.16093 +C794 D09A
43.16094 +C795 D09B
43.16095 +C796 D09C
43.16096 +C797 D09D
43.16097 +C798 D09E
43.16098 +C799 D09F
43.16099 +C79A D0A0
43.16100 +C79B D0A1
43.16101 +C79C D0A2
43.16102 +C79D D0A3
43.16103 +C7A1 D0A4
43.16104 +C7A2 D0A5
43.16105 +C7A3 D0A6
43.16106 +C7A4 D0A7
43.16107 +C7A5 D0A8
43.16108 +C7A6 D0A9
43.16109 +C7A7 D0AA
43.16110 +C7A8 D0AB
43.16111 +C7A9 D0AC
43.16112 +C7AA D0AD
43.16113 +C7AB D0AE
43.16114 +C7AC D0AF
43.16115 +C7AD D0B0
43.16116 +C7AE D0B1
43.16117 +C7AF D0B2
43.16118 +C7B0 D0B3
43.16119 +C7B1 D0B4
43.16120 +C7B3 D0B5
43.16121 +C7B4 D0B6
43.16122 +C7B5 D0B7
43.16123 +C7B6 D0B8
43.16124 +C7B7 D0B9
43.16125 +C7B8 D0BA
43.16126 +C7B9 D0BB
43.16127 +C7BA D0BC
43.16128 +C7BB D0BD
43.16129 +C7BC D0BE
43.16130 +C7BD D0BF
43.16131 +C841 314C
43.16132 +C861 D0C0
43.16133 +C862 D0C1
43.16134 +C863 D0C2
43.16135 +C864 D0C3
43.16136 +C865 D0C4
43.16137 +C866 D0C5
43.16138 +C867 D0C6
43.16139 +C868 D0C7
43.16140 +C869 D0C8
43.16141 +C86A D0C9
43.16142 +C86B D0CA
43.16143 +C86C D0CB
43.16144 +C86D D0CC
43.16145 +C86E D0CD
43.16146 +C86F D0CE
43.16147 +C870 D0CF
43.16148 +C871 D0D0
43.16149 +C873 D0D1
43.16150 +C874 D0D2
43.16151 +C875 D0D3
43.16152 +C876 D0D4
43.16153 +C877 D0D5
43.16154 +C878 D0D6
43.16155 +C879 D0D7
43.16156 +C87A D0D8
43.16157 +C87B D0D9
43.16158 +C87C D0DA
43.16159 +C87D D0DB
43.16160 +C881 D0DC
43.16161 +C882 D0DD
43.16162 +C883 D0DE
43.16163 +C884 D0DF
43.16164 +C885 D0E0
43.16165 +C886 D0E1
43.16166 +C887 D0E2
43.16167 +C888 D0E3
43.16168 +C889 D0E4
43.16169 +C88A D0E5
43.16170 +C88B D0E6
43.16171 +C88C D0E7
43.16172 +C88D D0E8
43.16173 +C88E D0E9
43.16174 +C88F D0EA
43.16175 +C890 D0EB
43.16176 +C891 D0EC
43.16177 +C893 D0ED
43.16178 +C894 D0EE
43.16179 +C895 D0EF
43.16180 +C896 D0F0
43.16181 +C897 D0F1
43.16182 +C898 D0F2
43.16183 +C899 D0F3
43.16184 +C89A D0F4
43.16185 +C89B D0F5
43.16186 +C89C D0F6
43.16187 +C89D D0F7
43.16188 +C8A1 D0F8
43.16189 +C8A2 D0F9
43.16190 +C8A3 D0FA
43.16191 +C8A4 D0FB
43.16192 +C8A5 D0FC
43.16193 +C8A6 D0FD
43.16194 +C8A7 D0FE
43.16195 +C8A8 D0FF
43.16196 +C8A9 D100
43.16197 +C8AA D101
43.16198 +C8AB D102
43.16199 +C8AC D103
43.16200 +C8AD D104
43.16201 +C8AE D105
43.16202 +C8AF D106
43.16203 +C8B0 D107
43.16204 +C8B1 D108
43.16205 +C8B3 D109
43.16206 +C8B4 D10A
43.16207 +C8B5 D10B
43.16208 +C8B6 D10C
43.16209 +C8B7 D10D
43.16210 +C8B8 D10E
43.16211 +C8B9 D10F
43.16212 +C8BA D110
43.16213 +C8BB D111
43.16214 +C8BC D112
43.16215 +C8BD D113
43.16216 +C8C1 D114
43.16217 +C8C2 D115
43.16218 +C8C3 D116
43.16219 +C8C4 D117
43.16220 +C8C5 D118
43.16221 +C8C6 D119
43.16222 +C8C7 D11A
43.16223 +C8C8 D11B
43.16224 +C8C9 D11C
43.16225 +C8CA D11D
43.16226 +C8CB D11E
43.16227 +C8CC D11F
43.16228 +C8CD D120
43.16229 +C8CE D121
43.16230 +C8CF D122
43.16231 +C8D0 D123
43.16232 +C8D1 D124
43.16233 +C8D3 D125
43.16234 +C8D4 D126
43.16235 +C8D5 D127
43.16236 +C8D6 D128
43.16237 +C8D7 D129
43.16238 +C8D8 D12A
43.16239 +C8D9 D12B
43.16240 +C8DA D12C
43.16241 +C8DB D12D
43.16242 +C8DC D12E
43.16243 +C8DD D12F
43.16244 +C8E1 D130
43.16245 +C8E2 D131
43.16246 +C8E3 D132
43.16247 +C8E4 D133
43.16248 +C8E5 D134
43.16249 +C8E6 D135
43.16250 +C8E7 D136
43.16251 +C8E8 D137
43.16252 +C8E9 D138
43.16253 +C8EA D139
43.16254 +C8EB D13A
43.16255 +C8EC D13B
43.16256 +C8ED D13C
43.16257 +C8EE D13D
43.16258 +C8EF D13E
43.16259 +C8F0 D13F
43.16260 +C8F1 D140
43.16261 +C8F3 D141
43.16262 +C8F4 D142
43.16263 +C8F5 D143
43.16264 +C8F6 D144
43.16265 +C8F7 D145
43.16266 +C8F8 D146
43.16267 +C8F9 D147
43.16268 +C8FA D148
43.16269 +C8FB D149
43.16270 +C8FC D14A
43.16271 +C8FD D14B
43.16272 +C941 D14C
43.16273 +C942 D14D
43.16274 +C943 D14E
43.16275 +C944 D14F
43.16276 +C945 D150
43.16277 +C946 D151
43.16278 +C947 D152
43.16279 +C948 D153
43.16280 +C949 D154
43.16281 +C94A D155
43.16282 +C94B D156
43.16283 +C94C D157
43.16284 +C94D D158
43.16285 +C94E D159
43.16286 +C94F D15A
43.16287 +C950 D15B
43.16288 +C951 D15C
43.16289 +C953 D15D
43.16290 +C954 D15E
43.16291 +C955 D15F
43.16292 +C956 D160
43.16293 +C957 D161
43.16294 +C958 D162
43.16295 +C959 D163
43.16296 +C95A D164
43.16297 +C95B D165
43.16298 +C95C D166
43.16299 +C95D D167
43.16300 +C961 D168
43.16301 +C962 D169
43.16302 +C963 D16A
43.16303 +C964 D16B
43.16304 +C965 D16C
43.16305 +C966 D16D
43.16306 +C967 D16E
43.16307 +C968 D16F
43.16308 +C969 D170
43.16309 +C96A D171
43.16310 +C96B D172
43.16311 +C96C D173
43.16312 +C96D D174
43.16313 +C96E D175
43.16314 +C96F D176
43.16315 +C970 D177
43.16316 +C971 D178
43.16317 +C973 D179
43.16318 +C974 D17A
43.16319 +C975 D17B
43.16320 +C976 D17C
43.16321 +C977 D17D
43.16322 +C978 D17E
43.16323 +C979 D17F
43.16324 +C97A D180
43.16325 +C97B D181
43.16326 +C97C D182
43.16327 +C97D D183
43.16328 +C981 D184
43.16329 +C982 D185
43.16330 +C983 D186
43.16331 +C984 D187
43.16332 +C985 D188
43.16333 +C986 D189
43.16334 +C987 D18A
43.16335 +C988 D18B
43.16336 +C989 D18C
43.16337 +C98A D18D
43.16338 +C98B D18E
43.16339 +C98C D18F
43.16340 +C98D D190
43.16341 +C98E D191
43.16342 +C98F D192
43.16343 +C990 D193
43.16344 +C991 D194
43.16345 +C993 D195
43.16346 +C994 D196
43.16347 +C995 D197
43.16348 +C996 D198
43.16349 +C997 D199
43.16350 +C998 D19A
43.16351 +C999 D19B
43.16352 +C99A D19C
43.16353 +C99B D19D
43.16354 +C99C D19E
43.16355 +C99D D19F
43.16356 +C9A1 D1A0
43.16357 +C9A2 D1A1
43.16358 +C9A3 D1A2
43.16359 +C9A4 D1A3
43.16360 +C9A5 D1A4
43.16361 +C9A6 D1A5
43.16362 +C9A7 D1A6
43.16363 +C9A8 D1A7
43.16364 +C9A9 D1A8
43.16365 +C9AA D1A9
43.16366 +C9AB D1AA
43.16367 +C9AC D1AB
43.16368 +C9AD D1AC
43.16369 +C9AE D1AD
43.16370 +C9AF D1AE
43.16371 +C9B0 D1AF
43.16372 +C9B1 D1B0
43.16373 +C9B3 D1B1
43.16374 +C9B4 D1B2
43.16375 +C9B5 D1B3
43.16376 +C9B6 D1B4
43.16377 +C9B7 D1B5
43.16378 +C9B8 D1B6
43.16379 +C9B9 D1B7
43.16380 +C9BA D1B8
43.16381 +C9BB D1B9
43.16382 +C9BC D1BA
43.16383 +C9BD D1BB
43.16384 +C9C1 D1BC
43.16385 +C9C2 D1BD
43.16386 +C9C3 D1BE
43.16387 +C9C4 D1BF
43.16388 +C9C5 D1C0
43.16389 +C9C6 D1C1
43.16390 +C9C7 D1C2
43.16391 +C9C8 D1C3
43.16392 +C9C9 D1C4
43.16393 +C9CA D1C5
43.16394 +C9CB D1C6
43.16395 +C9CC D1C7
43.16396 +C9CD D1C8
43.16397 +C9CE D1C9
43.16398 +C9CF D1CA
43.16399 +C9D0 D1CB
43.16400 +C9D1 D1CC
43.16401 +C9D3 D1CD
43.16402 +C9D4 D1CE
43.16403 +C9D5 D1CF
43.16404 +C9D6 D1D0
43.16405 +C9D7 D1D1
43.16406 +C9D8 D1D2
43.16407 +C9D9 D1D3
43.16408 +C9DA D1D4
43.16409 +C9DB D1D5
43.16410 +C9DC D1D6
43.16411 +C9DD D1D7
43.16412 +C9E1 D1D8
43.16413 +C9E2 D1D9
43.16414 +C9E3 D1DA
43.16415 +C9E4 D1DB
43.16416 +C9E5 D1DC
43.16417 +C9E6 D1DD
43.16418 +C9E7 D1DE
43.16419 +C9E8 D1DF
43.16420 +C9E9 D1E0
43.16421 +C9EA D1E1
43.16422 +C9EB D1E2
43.16423 +C9EC D1E3
43.16424 +C9ED D1E4
43.16425 +C9EE D1E5
43.16426 +C9EF D1E6
43.16427 +C9F0 D1E7
43.16428 +C9F1 D1E8
43.16429 +C9F3 D1E9
43.16430 +C9F4 D1EA
43.16431 +C9F5 D1EB
43.16432 +C9F6 D1EC
43.16433 +C9F7 D1ED
43.16434 +C9F8 D1EE
43.16435 +C9F9 D1EF
43.16436 +C9FA D1F0
43.16437 +C9FB D1F1
43.16438 +C9FC D1F2
43.16439 +C9FD D1F3
43.16440 +CA41 D1F4
43.16441 +CA42 D1F5
43.16442 +CA43 D1F6
43.16443 +CA44 D1F7
43.16444 +CA45 D1F8
43.16445 +CA46 D1F9
43.16446 +CA47 D1FA
43.16447 +CA48 D1FB
43.16448 +CA49 D1FC
43.16449 +CA4A D1FD
43.16450 +CA4B D1FE
43.16451 +CA4C D1FF
43.16452 +CA4D D200
43.16453 +CA4E D201
43.16454 +CA4F D202
43.16455 +CA50 D203
43.16456 +CA51 D204
43.16457 +CA53 D205
43.16458 +CA54 D206
43.16459 +CA55 D207
43.16460 +CA56 D208
43.16461 +CA57 D209
43.16462 +CA58 D20A
43.16463 +CA59 D20B
43.16464 +CA5A D20C
43.16465 +CA5B D20D
43.16466 +CA5C D20E
43.16467 +CA5D D20F
43.16468 +CA61 D210
43.16469 +CA62 D211
43.16470 +CA63 D212
43.16471 +CA64 D213
43.16472 +CA65 D214
43.16473 +CA66 D215
43.16474 +CA67 D216
43.16475 +CA68 D217
43.16476 +CA69 D218
43.16477 +CA6A D219
43.16478 +CA6B D21A
43.16479 +CA6C D21B
43.16480 +CA6D D21C
43.16481 +CA6E D21D
43.16482 +CA6F D21E
43.16483 +CA70 D21F
43.16484 +CA71 D220
43.16485 +CA73 D221
43.16486 +CA74 D222
43.16487 +CA75 D223
43.16488 +CA76 D224
43.16489 +CA77 D225
43.16490 +CA78 D226
43.16491 +CA79 D227
43.16492 +CA7A D228
43.16493 +CA7B D229
43.16494 +CA7C D22A
43.16495 +CA7D D22B
43.16496 +CA81 D22C
43.16497 +CA82 D22D
43.16498 +CA83 D22E
43.16499 +CA84 D22F
43.16500 +CA85 D230
43.16501 +CA86 D231
43.16502 +CA87 D232
43.16503 +CA88 D233
43.16504 +CA89 D234
43.16505 +CA8A D235
43.16506 +CA8B D236
43.16507 +CA8C D237
43.16508 +CA8D D238
43.16509 +CA8E D239
43.16510 +CA8F D23A
43.16511 +CA90 D23B
43.16512 +CA91 D23C
43.16513 +CA93 D23D
43.16514 +CA94 D23E
43.16515 +CA95 D23F
43.16516 +CA96 D240
43.16517 +CA97 D241
43.16518 +CA98 D242
43.16519 +CA99 D243
43.16520 +CA9A D244
43.16521 +CA9B D245
43.16522 +CA9C D246
43.16523 +CA9D D247
43.16524 +CAA1 D248
43.16525 +CAA2 D249
43.16526 +CAA3 D24A
43.16527 +CAA4 D24B
43.16528 +CAA5 D24C
43.16529 +CAA6 D24D
43.16530 +CAA7 D24E
43.16531 +CAA8 D24F
43.16532 +CAA9 D250
43.16533 +CAAA D251
43.16534 +CAAB D252
43.16535 +CAAC D253
43.16536 +CAAD D254
43.16537 +CAAE D255
43.16538 +CAAF D256
43.16539 +CAB0 D257
43.16540 +CAB1 D258
43.16541 +CAB3 D259
43.16542 +CAB4 D25A
43.16543 +CAB5 D25B
43.16544 +CAB6 D25C
43.16545 +CAB7 D25D
43.16546 +CAB8 D25E
43.16547 +CAB9 D25F
43.16548 +CABA D260
43.16549 +CABB D261
43.16550 +CABC D262
43.16551 +CABD D263
43.16552 +CAC1 D264
43.16553 +CAC2 D265
43.16554 +CAC3 D266
43.16555 +CAC4 D267
43.16556 +CAC5 D268
43.16557 +CAC6 D269
43.16558 +CAC7 D26A
43.16559 +CAC8 D26B
43.16560 +CAC9 D26C
43.16561 +CACA D26D
43.16562 +CACB D26E
43.16563 +CACC D26F
43.16564 +CACD D270
43.16565 +CACE D271
43.16566 +CACF D272
43.16567 +CAD0 D273
43.16568 +CAD1 D274
43.16569 +CAD3 D275
43.16570 +CAD4 D276
43.16571 +CAD5 D277
43.16572 +CAD6 D278
43.16573 +CAD7 D279
43.16574 +CAD8 D27A
43.16575 +CAD9 D27B
43.16576 +CADA D27C
43.16577 +CADB D27D
43.16578 +CADC D27E
43.16579 +CADD D27F
43.16580 +CAE1 D280
43.16581 +CAE2 D281
43.16582 +CAE3 D282
43.16583 +CAE4 D283
43.16584 +CAE5 D284
43.16585 +CAE6 D285
43.16586 +CAE7 D286
43.16587 +CAE8 D287
43.16588 +CAE9 D288
43.16589 +CAEA D289
43.16590 +CAEB D28A
43.16591 +CAEC D28B
43.16592 +CAED D28C
43.16593 +CAEE D28D
43.16594 +CAEF D28E
43.16595 +CAF0 D28F
43.16596 +CAF1 D290
43.16597 +CAF3 D291
43.16598 +CAF4 D292
43.16599 +CAF5 D293
43.16600 +CAF6 D294
43.16601 +CAF7 D295
43.16602 +CAF8 D296
43.16603 +CAF9 D297
43.16604 +CAFA D298
43.16605 +CAFB D299
43.16606 +CAFC D29A
43.16607 +CAFD D29B
43.16608 +CB41 D29C
43.16609 +CB42 D29D
43.16610 +CB43 D29E
43.16611 +CB44 D29F
43.16612 +CB45 D2A0
43.16613 +CB46 D2A1
43.16614 +CB47 D2A2
43.16615 +CB48 D2A3
43.16616 +CB49 D2A4
43.16617 +CB4A D2A5
43.16618 +CB4B D2A6
43.16619 +CB4C D2A7
43.16620 +CB4D D2A8
43.16621 +CB4E D2A9
43.16622 +CB4F D2AA
43.16623 +CB50 D2AB
43.16624 +CB51 D2AC
43.16625 +CB53 D2AD
43.16626 +CB54 D2AE
43.16627 +CB55 D2AF
43.16628 +CB56 D2B0
43.16629 +CB57 D2B1
43.16630 +CB58 D2B2
43.16631 +CB59 D2B3
43.16632 +CB5A D2B4
43.16633 +CB5B D2B5
43.16634 +CB5C D2B6
43.16635 +CB5D D2B7
43.16636 +CB61 D2B8
43.16637 +CB62 D2B9
43.16638 +CB63 D2BA
43.16639 +CB64 D2BB
43.16640 +CB65 D2BC
43.16641 +CB66 D2BD
43.16642 +CB67 D2BE
43.16643 +CB68 D2BF
43.16644 +CB69 D2C0
43.16645 +CB6A D2C1
43.16646 +CB6B D2C2
43.16647 +CB6C D2C3
43.16648 +CB6D D2C4
43.16649 +CB6E D2C5
43.16650 +CB6F D2C6
43.16651 +CB70 D2C7
43.16652 +CB71 D2C8
43.16653 +CB73 D2C9
43.16654 +CB74 D2CA
43.16655 +CB75 D2CB
43.16656 +CB76 D2CC
43.16657 +CB77 D2CD
43.16658 +CB78 D2CE
43.16659 +CB79 D2CF
43.16660 +CB7A D2D0
43.16661 +CB7B D2D1
43.16662 +CB7C D2D2
43.16663 +CB7D D2D3
43.16664 +CB81 D2D4
43.16665 +CB82 D2D5
43.16666 +CB83 D2D6
43.16667 +CB84 D2D7
43.16668 +CB85 D2D8
43.16669 +CB86 D2D9
43.16670 +CB87 D2DA
43.16671 +CB88 D2DB
43.16672 +CB89 D2DC
43.16673 +CB8A D2DD
43.16674 +CB8B D2DE
43.16675 +CB8C D2DF
43.16676 +CB8D D2E0
43.16677 +CB8E D2E1
43.16678 +CB8F D2E2
43.16679 +CB90 D2E3
43.16680 +CB91 D2E4
43.16681 +CB93 D2E5
43.16682 +CB94 D2E6
43.16683 +CB95 D2E7
43.16684 +CB96 D2E8
43.16685 +CB97 D2E9
43.16686 +CB98 D2EA
43.16687 +CB99 D2EB
43.16688 +CB9A D2EC
43.16689 +CB9B D2ED
43.16690 +CB9C D2EE
43.16691 +CB9D D2EF
43.16692 +CBA1 D2F0
43.16693 +CBA2 D2F1
43.16694 +CBA3 D2F2
43.16695 +CBA4 D2F3
43.16696 +CBA5 D2F4
43.16697 +CBA6 D2F5
43.16698 +CBA7 D2F6
43.16699 +CBA8 D2F7
43.16700 +CBA9 D2F8
43.16701 +CBAA D2F9
43.16702 +CBAB D2FA
43.16703 +CBAC D2FB
43.16704 +CBAD D2FC
43.16705 +CBAE D2FD
43.16706 +CBAF D2FE
43.16707 +CBB0 D2FF
43.16708 +CBB1 D300
43.16709 +CBB3 D301
43.16710 +CBB4 D302
43.16711 +CBB5 D303
43.16712 +CBB6 D304
43.16713 +CBB7 D305
43.16714 +CBB8 D306
43.16715 +CBB9 D307
43.16716 +CBBA D308
43.16717 +CBBB D309
43.16718 +CBBC D30A
43.16719 +CBBD D30B
43.16720 +CC41 314D
43.16721 +CC61 D30C
43.16722 +CC62 D30D
43.16723 +CC63 D30E
43.16724 +CC64 D30F
43.16725 +CC65 D310
43.16726 +CC66 D311
43.16727 +CC67 D312
43.16728 +CC68 D313
43.16729 +CC69 D314
43.16730 +CC6A D315
43.16731 +CC6B D316
43.16732 +CC6C D317
43.16733 +CC6D D318
43.16734 +CC6E D319
43.16735 +CC6F D31A
43.16736 +CC70 D31B
43.16737 +CC71 D31C
43.16738 +CC73 D31D
43.16739 +CC74 D31E
43.16740 +CC75 D31F
43.16741 +CC76 D320
43.16742 +CC77 D321
43.16743 +CC78 D322
43.16744 +CC79 D323
43.16745 +CC7A D324
43.16746 +CC7B D325
43.16747 +CC7C D326
43.16748 +CC7D D327
43.16749 +CC81 D328
43.16750 +CC82 D329
43.16751 +CC83 D32A
43.16752 +CC84 D32B
43.16753 +CC85 D32C
43.16754 +CC86 D32D
43.16755 +CC87 D32E
43.16756 +CC88 D32F
43.16757 +CC89 D330
43.16758 +CC8A D331
43.16759 +CC8B D332
43.16760 +CC8C D333
43.16761 +CC8D D334
43.16762 +CC8E D335
43.16763 +CC8F D336
43.16764 +CC90 D337
43.16765 +CC91 D338
43.16766 +CC93 D339
43.16767 +CC94 D33A
43.16768 +CC95 D33B
43.16769 +CC96 D33C
43.16770 +CC97 D33D
43.16771 +CC98 D33E
43.16772 +CC99 D33F
43.16773 +CC9A D340
43.16774 +CC9B D341
43.16775 +CC9C D342
43.16776 +CC9D D343
43.16777 +CCA1 D344
43.16778 +CCA2 D345
43.16779 +CCA3 D346
43.16780 +CCA4 D347
43.16781 +CCA5 D348
43.16782 +CCA6 D349
43.16783 +CCA7 D34A
43.16784 +CCA8 D34B
43.16785 +CCA9 D34C
43.16786 +CCAA D34D
43.16787 +CCAB D34E
43.16788 +CCAC D34F
43.16789 +CCAD D350
43.16790 +CCAE D351
43.16791 +CCAF D352
43.16792 +CCB0 D353
43.16793 +CCB1 D354
43.16794 +CCB3 D355
43.16795 +CCB4 D356
43.16796 +CCB5 D357
43.16797 +CCB6 D358
43.16798 +CCB7 D359
43.16799 +CCB8 D35A
43.16800 +CCB9 D35B
43.16801 +CCBA D35C
43.16802 +CCBB D35D
43.16803 +CCBC D35E
43.16804 +CCBD D35F
43.16805 +CCC1 D360
43.16806 +CCC2 D361
43.16807 +CCC3 D362
43.16808 +CCC4 D363
43.16809 +CCC5 D364
43.16810 +CCC6 D365
43.16811 +CCC7 D366
43.16812 +CCC8 D367
43.16813 +CCC9 D368
43.16814 +CCCA D369
43.16815 +CCCB D36A
43.16816 +CCCC D36B
43.16817 +CCCD D36C
43.16818 +CCCE D36D
43.16819 +CCCF D36E
43.16820 +CCD0 D36F
43.16821 +CCD1 D370
43.16822 +CCD3 D371
43.16823 +CCD4 D372
43.16824 +CCD5 D373
43.16825 +CCD6 D374
43.16826 +CCD7 D375
43.16827 +CCD8 D376
43.16828 +CCD9 D377
43.16829 +CCDA D378
43.16830 +CCDB D379
43.16831 +CCDC D37A
43.16832 +CCDD D37B
43.16833 +CCE1 D37C
43.16834 +CCE2 D37D
43.16835 +CCE3 D37E
43.16836 +CCE4 D37F
43.16837 +CCE5 D380
43.16838 +CCE6 D381
43.16839 +CCE7 D382
43.16840 +CCE8 D383
43.16841 +CCE9 D384
43.16842 +CCEA D385
43.16843 +CCEB D386
43.16844 +CCEC D387
43.16845 +CCED D388
43.16846 +CCEE D389
43.16847 +CCEF D38A
43.16848 +CCF0 D38B
43.16849 +CCF1 D38C
43.16850 +CCF3 D38D
43.16851 +CCF4 D38E
43.16852 +CCF5 D38F
43.16853 +CCF6 D390
43.16854 +CCF7 D391
43.16855 +CCF8 D392
43.16856 +CCF9 D393
43.16857 +CCFA D394
43.16858 +CCFB D395
43.16859 +CCFC D396
43.16860 +CCFD D397
43.16861 +CD41 D398
43.16862 +CD42 D399
43.16863 +CD43 D39A
43.16864 +CD44 D39B
43.16865 +CD45 D39C
43.16866 +CD46 D39D
43.16867 +CD47 D39E
43.16868 +CD48 D39F
43.16869 +CD49 D3A0
43.16870 +CD4A D3A1
43.16871 +CD4B D3A2
43.16872 +CD4C D3A3
43.16873 +CD4D D3A4
43.16874 +CD4E D3A5
43.16875 +CD4F D3A6
43.16876 +CD50 D3A7
43.16877 +CD51 D3A8
43.16878 +CD53 D3A9
43.16879 +CD54 D3AA
43.16880 +CD55 D3AB
43.16881 +CD56 D3AC
43.16882 +CD57 D3AD
43.16883 +CD58 D3AE
43.16884 +CD59 D3AF
43.16885 +CD5A D3B0
43.16886 +CD5B D3B1
43.16887 +CD5C D3B2
43.16888 +CD5D D3B3
43.16889 +CD61 D3B4
43.16890 +CD62 D3B5
43.16891 +CD63 D3B6
43.16892 +CD64 D3B7
43.16893 +CD65 D3B8
43.16894 +CD66 D3B9
43.16895 +CD67 D3BA
43.16896 +CD68 D3BB
43.16897 +CD69 D3BC
43.16898 +CD6A D3BD
43.16899 +CD6B D3BE
43.16900 +CD6C D3BF
43.16901 +CD6D D3C0
43.16902 +CD6E D3C1
43.16903 +CD6F D3C2
43.16904 +CD70 D3C3
43.16905 +CD71 D3C4
43.16906 +CD73 D3C5
43.16907 +CD74 D3C6
43.16908 +CD75 D3C7
43.16909 +CD76 D3C8
43.16910 +CD77 D3C9
43.16911 +CD78 D3CA
43.16912 +CD79 D3CB
43.16913 +CD7A D3CC
43.16914 +CD7B D3CD
43.16915 +CD7C D3CE
43.16916 +CD7D D3CF
43.16917 +CD81 D3D0
43.16918 +CD82 D3D1
43.16919 +CD83 D3D2
43.16920 +CD84 D3D3
43.16921 +CD85 D3D4
43.16922 +CD86 D3D5
43.16923 +CD87 D3D6
43.16924 +CD88 D3D7
43.16925 +CD89 D3D8
43.16926 +CD8A D3D9
43.16927 +CD8B D3DA
43.16928 +CD8C D3DB
43.16929 +CD8D D3DC
43.16930 +CD8E D3DD
43.16931 +CD8F D3DE
43.16932 +CD90 D3DF
43.16933 +CD91 D3E0
43.16934 +CD93 D3E1
43.16935 +CD94 D3E2
43.16936 +CD95 D3E3
43.16937 +CD96 D3E4
43.16938 +CD97 D3E5
43.16939 +CD98 D3E6
43.16940 +CD99 D3E7
43.16941 +CD9A D3E8
43.16942 +CD9B D3E9
43.16943 +CD9C D3EA
43.16944 +CD9D D3EB
43.16945 +CDA1 D3EC
43.16946 +CDA2 D3ED
43.16947 +CDA3 D3EE
43.16948 +CDA4 D3EF
43.16949 +CDA5 D3F0
43.16950 +CDA6 D3F1
43.16951 +CDA7 D3F2
43.16952 +CDA8 D3F3
43.16953 +CDA9 D3F4
43.16954 +CDAA D3F5
43.16955 +CDAB D3F6
43.16956 +CDAC D3F7
43.16957 +CDAD D3F8
43.16958 +CDAE D3F9
43.16959 +CDAF D3FA
43.16960 +CDB0 D3FB
43.16961 +CDB1 D3FC
43.16962 +CDB3 D3FD
43.16963 +CDB4 D3FE
43.16964 +CDB5 D3FF
43.16965 +CDB6 D400
43.16966 +CDB7 D401
43.16967 +CDB8 D402
43.16968 +CDB9 D403
43.16969 +CDBA D404
43.16970 +CDBB D405
43.16971 +CDBC D406
43.16972 +CDBD D407
43.16973 +CDC1 D408
43.16974 +CDC2 D409
43.16975 +CDC3 D40A
43.16976 +CDC4 D40B
43.16977 +CDC5 D40C
43.16978 +CDC6 D40D
43.16979 +CDC7 D40E
43.16980 +CDC8 D40F
43.16981 +CDC9 D410
43.16982 +CDCA D411
43.16983 +CDCB D412
43.16984 +CDCC D413
43.16985 +CDCD D414
43.16986 +CDCE D415
43.16987 +CDCF D416
43.16988 +CDD0 D417
43.16989 +CDD1 D418
43.16990 +CDD3 D419
43.16991 +CDD4 D41A
43.16992 +CDD5 D41B
43.16993 +CDD6 D41C
43.16994 +CDD7 D41D
43.16995 +CDD8 D41E
43.16996 +CDD9 D41F
43.16997 +CDDA D420
43.16998 +CDDB D421
43.16999 +CDDC D422
43.17000 +CDDD D423
43.17001 +CDE1 D424
43.17002 +CDE2 D425
43.17003 +CDE3 D426
43.17004 +CDE4 D427
43.17005 +CDE5 D428
43.17006 +CDE6 D429
43.17007 +CDE7 D42A
43.17008 +CDE8 D42B
43.17009 +CDE9 D42C
43.17010 +CDEA D42D
43.17011 +CDEB D42E
43.17012 +CDEC D42F
43.17013 +CDED D430
43.17014 +CDEE D431
43.17015 +CDEF D432
43.17016 +CDF0 D433
43.17017 +CDF1 D434
43.17018 +CDF3 D435
43.17019 +CDF4 D436
43.17020 +CDF5 D437
43.17021 +CDF6 D438
43.17022 +CDF7 D439
43.17023 +CDF8 D43A
43.17024 +CDF9 D43B
43.17025 +CDFA D43C
43.17026 +CDFB D43D
43.17027 +CDFC D43E
43.17028 +CDFD D43F
43.17029 +CE41 D440
43.17030 +CE42 D441
43.17031 +CE43 D442
43.17032 +CE44 D443
43.17033 +CE45 D444
43.17034 +CE46 D445
43.17035 +CE47 D446
43.17036 +CE48 D447
43.17037 +CE49 D448
43.17038 +CE4A D449
43.17039 +CE4B D44A
43.17040 +CE4C D44B
43.17041 +CE4D D44C
43.17042 +CE4E D44D
43.17043 +CE4F D44E
43.17044 +CE50 D44F
43.17045 +CE51 D450
43.17046 +CE53 D451
43.17047 +CE54 D452
43.17048 +CE55 D453
43.17049 +CE56 D454
43.17050 +CE57 D455
43.17051 +CE58 D456
43.17052 +CE59 D457
43.17053 +CE5A D458
43.17054 +CE5B D459
43.17055 +CE5C D45A
43.17056 +CE5D D45B
43.17057 +CE61 D45C
43.17058 +CE62 D45D
43.17059 +CE63 D45E
43.17060 +CE64 D45F
43.17061 +CE65 D460
43.17062 +CE66 D461
43.17063 +CE67 D462
43.17064 +CE68 D463
43.17065 +CE69 D464
43.17066 +CE6A D465
43.17067 +CE6B D466
43.17068 +CE6C D467
43.17069 +CE6D D468
43.17070 +CE6E D469
43.17071 +CE6F D46A
43.17072 +CE70 D46B
43.17073 +CE71 D46C
43.17074 +CE73 D46D
43.17075 +CE74 D46E
43.17076 +CE75 D46F
43.17077 +CE76 D470
43.17078 +CE77 D471
43.17079 +CE78 D472
43.17080 +CE79 D473
43.17081 +CE7A D474
43.17082 +CE7B D475
43.17083 +CE7C D476
43.17084 +CE7D D477
43.17085 +CE81 D478
43.17086 +CE82 D479
43.17087 +CE83 D47A
43.17088 +CE84 D47B
43.17089 +CE85 D47C
43.17090 +CE86 D47D
43.17091 +CE87 D47E
43.17092 +CE88 D47F
43.17093 +CE89 D480
43.17094 +CE8A D481
43.17095 +CE8B D482
43.17096 +CE8C D483
43.17097 +CE8D D484
43.17098 +CE8E D485
43.17099 +CE8F D486
43.17100 +CE90 D487
43.17101 +CE91 D488
43.17102 +CE93 D489
43.17103 +CE94 D48A
43.17104 +CE95 D48B
43.17105 +CE96 D48C
43.17106 +CE97 D48D
43.17107 +CE98 D48E
43.17108 +CE99 D48F
43.17109 +CE9A D490
43.17110 +CE9B D491
43.17111 +CE9C D492
43.17112 +CE9D D493
43.17113 +CEA1 D494
43.17114 +CEA2 D495
43.17115 +CEA3 D496
43.17116 +CEA4 D497
43.17117 +CEA5 D498
43.17118 +CEA6 D499
43.17119 +CEA7 D49A
43.17120 +CEA8 D49B
43.17121 +CEA9 D49C
43.17122 +CEAA D49D
43.17123 +CEAB D49E
43.17124 +CEAC D49F
43.17125 +CEAD D4A0
43.17126 +CEAE D4A1
43.17127 +CEAF D4A2
43.17128 +CEB0 D4A3
43.17129 +CEB1 D4A4
43.17130 +CEB3 D4A5
43.17131 +CEB4 D4A6
43.17132 +CEB5 D4A7
43.17133 +CEB6 D4A8
43.17134 +CEB7 D4A9
43.17135 +CEB8 D4AA
43.17136 +CEB9 D4AB
43.17137 +CEBA D4AC
43.17138 +CEBB D4AD
43.17139 +CEBC D4AE
43.17140 +CEBD D4AF
43.17141 +CEC1 D4B0
43.17142 +CEC2 D4B1
43.17143 +CEC3 D4B2
43.17144 +CEC4 D4B3
43.17145 +CEC5 D4B4
43.17146 +CEC6 D4B5
43.17147 +CEC7 D4B6
43.17148 +CEC8 D4B7
43.17149 +CEC9 D4B8
43.17150 +CECA D4B9
43.17151 +CECB D4BA
43.17152 +CECC D4BB
43.17153 +CECD D4BC
43.17154 +CECE D4BD
43.17155 +CECF D4BE
43.17156 +CED0 D4BF
43.17157 +CED1 D4C0
43.17158 +CED3 D4C1
43.17159 +CED4 D4C2
43.17160 +CED5 D4C3
43.17161 +CED6 D4C4
43.17162 +CED7 D4C5
43.17163 +CED8 D4C6
43.17164 +CED9 D4C7
43.17165 +CEDA D4C8
43.17166 +CEDB D4C9
43.17167 +CEDC D4CA
43.17168 +CEDD D4CB
43.17169 +CEE1 D4CC
43.17170 +CEE2 D4CD
43.17171 +CEE3 D4CE
43.17172 +CEE4 D4CF
43.17173 +CEE5 D4D0
43.17174 +CEE6 D4D1
43.17175 +CEE7 D4D2
43.17176 +CEE8 D4D3
43.17177 +CEE9 D4D4
43.17178 +CEEA D4D5
43.17179 +CEEB D4D6
43.17180 +CEEC D4D7
43.17181 +CEED D4D8
43.17182 +CEEE D4D9
43.17183 +CEEF D4DA
43.17184 +CEF0 D4DB
43.17185 +CEF1 D4DC
43.17186 +CEF3 D4DD
43.17187 +CEF4 D4DE
43.17188 +CEF5 D4DF
43.17189 +CEF6 D4E0
43.17190 +CEF7 D4E1
43.17191 +CEF8 D4E2
43.17192 +CEF9 D4E3
43.17193 +CEFA D4E4
43.17194 +CEFB D4E5
43.17195 +CEFC D4E6
43.17196 +CEFD D4E7
43.17197 +CF41 D4E8
43.17198 +CF42 D4E9
43.17199 +CF43 D4EA
43.17200 +CF44 D4EB
43.17201 +CF45 D4EC
43.17202 +CF46 D4ED
43.17203 +CF47 D4EE
43.17204 +CF48 D4EF
43.17205 +CF49 D4F0
43.17206 +CF4A D4F1
43.17207 +CF4B D4F2
43.17208 +CF4C D4F3
43.17209 +CF4D D4F4
43.17210 +CF4E D4F5
43.17211 +CF4F D4F6
43.17212 +CF50 D4F7
43.17213 +CF51 D4F8
43.17214 +CF53 D4F9
43.17215 +CF54 D4FA
43.17216 +CF55 D4FB
43.17217 +CF56 D4FC
43.17218 +CF57 D4FD
43.17219 +CF58 D4FE
43.17220 +CF59 D4FF
43.17221 +CF5A D500
43.17222 +CF5B D501
43.17223 +CF5C D502
43.17224 +CF5D D503
43.17225 +CF61 D504
43.17226 +CF62 D505
43.17227 +CF63 D506
43.17228 +CF64 D507
43.17229 +CF65 D508
43.17230 +CF66 D509
43.17231 +CF67 D50A
43.17232 +CF68 D50B
43.17233 +CF69 D50C
43.17234 +CF6A D50D
43.17235 +CF6B D50E
43.17236 +CF6C D50F
43.17237 +CF6D D510
43.17238 +CF6E D511
43.17239 +CF6F D512
43.17240 +CF70 D513
43.17241 +CF71 D514
43.17242 +CF73 D515
43.17243 +CF74 D516
43.17244 +CF75 D517
43.17245 +CF76 D518
43.17246 +CF77 D519
43.17247 +CF78 D51A
43.17248 +CF79 D51B
43.17249 +CF7A D51C
43.17250 +CF7B D51D
43.17251 +CF7C D51E
43.17252 +CF7D D51F
43.17253 +CF81 D520
43.17254 +CF82 D521
43.17255 +CF83 D522
43.17256 +CF84 D523
43.17257 +CF85 D524
43.17258 +CF86 D525
43.17259 +CF87 D526
43.17260 +CF88 D527
43.17261 +CF89 D528
43.17262 +CF8A D529
43.17263 +CF8B D52A
43.17264 +CF8C D52B
43.17265 +CF8D D52C
43.17266 +CF8E D52D
43.17267 +CF8F D52E
43.17268 +CF90 D52F
43.17269 +CF91 D530
43.17270 +CF93 D531
43.17271 +CF94 D532
43.17272 +CF95 D533
43.17273 +CF96 D534
43.17274 +CF97 D535
43.17275 +CF98 D536
43.17276 +CF99 D537
43.17277 +CF9A D538
43.17278 +CF9B D539
43.17279 +CF9C D53A
43.17280 +CF9D D53B
43.17281 +CFA1 D53C
43.17282 +CFA2 D53D
43.17283 +CFA3 D53E
43.17284 +CFA4 D53F
43.17285 +CFA5 D540
43.17286 +CFA6 D541
43.17287 +CFA7 D542
43.17288 +CFA8 D543
43.17289 +CFA9 D544
43.17290 +CFAA D545
43.17291 +CFAB D546
43.17292 +CFAC D547
43.17293 +CFAD D548
43.17294 +CFAE D549
43.17295 +CFAF D54A
43.17296 +CFB0 D54B
43.17297 +CFB1 D54C
43.17298 +CFB3 D54D
43.17299 +CFB4 D54E
43.17300 +CFB5 D54F
43.17301 +CFB6 D550
43.17302 +CFB7 D551
43.17303 +CFB8 D552
43.17304 +CFB9 D553
43.17305 +CFBA D554
43.17306 +CFBB D555
43.17307 +CFBC D556
43.17308 +CFBD D557
43.17309 +D041 314E
43.17310 +D061 D558
43.17311 +D062 D559
43.17312 +D063 D55A
43.17313 +D064 D55B
43.17314 +D065 D55C
43.17315 +D066 D55D
43.17316 +D067 D55E
43.17317 +D068 D55F
43.17318 +D069 D560
43.17319 +D06A D561
43.17320 +D06B D562
43.17321 +D06C D563
43.17322 +D06D D564
43.17323 +D06E D565
43.17324 +D06F D566
43.17325 +D070 D567
43.17326 +D071 D568
43.17327 +D073 D569
43.17328 +D074 D56A
43.17329 +D075 D56B
43.17330 +D076 D56C
43.17331 +D077 D56D
43.17332 +D078 D56E
43.17333 +D079 D56F
43.17334 +D07A D570
43.17335 +D07B D571
43.17336 +D07C D572
43.17337 +D07D D573
43.17338 +D081 D574
43.17339 +D082 D575
43.17340 +D083 D576
43.17341 +D084 D577
43.17342 +D085 D578
43.17343 +D086 D579
43.17344 +D087 D57A
43.17345 +D088 D57B
43.17346 +D089 D57C
43.17347 +D08A D57D
43.17348 +D08B D57E
43.17349 +D08C D57F
43.17350 +D08D D580
43.17351 +D08E D581
43.17352 +D08F D582
43.17353 +D090 D583
43.17354 +D091 D584
43.17355 +D093 D585
43.17356 +D094 D586
43.17357 +D095 D587
43.17358 +D096 D588
43.17359 +D097 D589
43.17360 +D098 D58A
43.17361 +D099 D58B
43.17362 +D09A D58C
43.17363 +D09B D58D
43.17364 +D09C D58E
43.17365 +D09D D58F
43.17366 +D0A1 D590
43.17367 +D0A2 D591
43.17368 +D0A3 D592
43.17369 +D0A4 D593
43.17370 +D0A5 D594
43.17371 +D0A6 D595
43.17372 +D0A7 D596
43.17373 +D0A8 D597
43.17374 +D0A9 D598
43.17375 +D0AA D599
43.17376 +D0AB D59A
43.17377 +D0AC D59B
43.17378 +D0AD D59C
43.17379 +D0AE D59D
43.17380 +D0AF D59E
43.17381 +D0B0 D59F
43.17382 +D0B1 D5A0
43.17383 +D0B3 D5A1
43.17384 +D0B4 D5A2
43.17385 +D0B5 D5A3
43.17386 +D0B6 D5A4
43.17387 +D0B7 D5A5
43.17388 +D0B8 D5A6
43.17389 +D0B9 D5A7
43.17390 +D0BA D5A8
43.17391 +D0BB D5A9
43.17392 +D0BC D5AA
43.17393 +D0BD D5AB
43.17394 +D0C1 D5AC
43.17395 +D0C2 D5AD
43.17396 +D0C3 D5AE
43.17397 +D0C4 D5AF
43.17398 +D0C5 D5B0
43.17399 +D0C6 D5B1
43.17400 +D0C7 D5B2
43.17401 +D0C8 D5B3
43.17402 +D0C9 D5B4
43.17403 +D0CA D5B5
43.17404 +D0CB D5B6
43.17405 +D0CC D5B7
43.17406 +D0CD D5B8
43.17407 +D0CE D5B9
43.17408 +D0CF D5BA
43.17409 +D0D0 D5BB
43.17410 +D0D1 D5BC
43.17411 +D0D3 D5BD
43.17412 +D0D4 D5BE
43.17413 +D0D5 D5BF
43.17414 +D0D6 D5C0
43.17415 +D0D7 D5C1
43.17416 +D0D8 D5C2
43.17417 +D0D9 D5C3
43.17418 +D0DA D5C4
43.17419 +D0DB D5C5
43.17420 +D0DC D5C6
43.17421 +D0DD D5C7
43.17422 +D0E1 D5C8
43.17423 +D0E2 D5C9
43.17424 +D0E3 D5CA
43.17425 +D0E4 D5CB
43.17426 +D0E5 D5CC
43.17427 +D0E6 D5CD
43.17428 +D0E7 D5CE
43.17429 +D0E8 D5CF
43.17430 +D0E9 D5D0
43.17431 +D0EA D5D1
43.17432 +D0EB D5D2
43.17433 +D0EC D5D3
43.17434 +D0ED D5D4
43.17435 +D0EE D5D5
43.17436 +D0EF D5D6
43.17437 +D0F0 D5D7
43.17438 +D0F1 D5D8
43.17439 +D0F3 D5D9
43.17440 +D0F4 D5DA
43.17441 +D0F5 D5DB
43.17442 +D0F6 D5DC
43.17443 +D0F7 D5DD
43.17444 +D0F8 D5DE
43.17445 +D0F9 D5DF
43.17446 +D0FA D5E0
43.17447 +D0FB D5E1
43.17448 +D0FC D5E2
43.17449 +D0FD D5E3
43.17450 +D141 D5E4
43.17451 +D142 D5E5
43.17452 +D143 D5E6
43.17453 +D144 D5E7
43.17454 +D145 D5E8
43.17455 +D146 D5E9
43.17456 +D147 D5EA
43.17457 +D148 D5EB
43.17458 +D149 D5EC
43.17459 +D14A D5ED
43.17460 +D14B D5EE
43.17461 +D14C D5EF
43.17462 +D14D D5F0
43.17463 +D14E D5F1
43.17464 +D14F D5F2
43.17465 +D150 D5F3
43.17466 +D151 D5F4
43.17467 +D153 D5F5
43.17468 +D154 D5F6
43.17469 +D155 D5F7
43.17470 +D156 D5F8
43.17471 +D157 D5F9
43.17472 +D158 D5FA
43.17473 +D159 D5FB
43.17474 +D15A D5FC
43.17475 +D15B D5FD
43.17476 +D15C D5FE
43.17477 +D15D D5FF
43.17478 +D161 D600
43.17479 +D162 D601
43.17480 +D163 D602
43.17481 +D164 D603
43.17482 +D165 D604
43.17483 +D166 D605
43.17484 +D167 D606
43.17485 +D168 D607
43.17486 +D169 D608
43.17487 +D16A D609
43.17488 +D16B D60A
43.17489 +D16C D60B
43.17490 +D16D D60C
43.17491 +D16E D60D
43.17492 +D16F D60E
43.17493 +D170 D60F
43.17494 +D171 D610
43.17495 +D173 D611
43.17496 +D174 D612
43.17497 +D175 D613
43.17498 +D176 D614
43.17499 +D177 D615
43.17500 +D178 D616
43.17501 +D179 D617
43.17502 +D17A D618
43.17503 +D17B D619
43.17504 +D17C D61A
43.17505 +D17D D61B
43.17506 +D181 D61C
43.17507 +D182 D61D
43.17508 +D183 D61E
43.17509 +D184 D61F
43.17510 +D185 D620
43.17511 +D186 D621
43.17512 +D187 D622
43.17513 +D188 D623
43.17514 +D189 D624
43.17515 +D18A D625
43.17516 +D18B D626
43.17517 +D18C D627
43.17518 +D18D D628
43.17519 +D18E D629
43.17520 +D18F D62A
43.17521 +D190 D62B
43.17522 +D191 D62C
43.17523 +D193 D62D
43.17524 +D194 D62E
43.17525 +D195 D62F
43.17526 +D196 D630
43.17527 +D197 D631
43.17528 +D198 D632
43.17529 +D199 D633
43.17530 +D19A D634
43.17531 +D19B D635
43.17532 +D19C D636
43.17533 +D19D D637
43.17534 +D1A1 D638
43.17535 +D1A2 D639
43.17536 +D1A3 D63A
43.17537 +D1A4 D63B
43.17538 +D1A5 D63C
43.17539 +D1A6 D63D
43.17540 +D1A7 D63E
43.17541 +D1A8 D63F
43.17542 +D1A9 D640
43.17543 +D1AA D641
43.17544 +D1AB D642
43.17545 +D1AC D643
43.17546 +D1AD D644
43.17547 +D1AE D645
43.17548 +D1AF D646
43.17549 +D1B0 D647
43.17550 +D1B1 D648
43.17551 +D1B3 D649
43.17552 +D1B4 D64A
43.17553 +D1B5 D64B
43.17554 +D1B6 D64C
43.17555 +D1B7 D64D
43.17556 +D1B8 D64E
43.17557 +D1B9 D64F
43.17558 +D1BA D650
43.17559 +D1BB D651
43.17560 +D1BC D652
43.17561 +D1BD D653
43.17562 +D1C1 D654
43.17563 +D1C2 D655
43.17564 +D1C3 D656
43.17565 +D1C4 D657
43.17566 +D1C5 D658
43.17567 +D1C6 D659
43.17568 +D1C7 D65A
43.17569 +D1C8 D65B
43.17570 +D1C9 D65C
43.17571 +D1CA D65D
43.17572 +D1CB D65E
43.17573 +D1CC D65F
43.17574 +D1CD D660
43.17575 +D1CE D661
43.17576 +D1CF D662
43.17577 +D1D0 D663
43.17578 +D1D1 D664
43.17579 +D1D3 D665
43.17580 +D1D4 D666
43.17581 +D1D5 D667
43.17582 +D1D6 D668
43.17583 +D1D7 D669
43.17584 +D1D8 D66A
43.17585 +D1D9 D66B
43.17586 +D1DA D66C
43.17587 +D1DB D66D
43.17588 +D1DC D66E
43.17589 +D1DD D66F
43.17590 +D1E1 D670
43.17591 +D1E2 D671
43.17592 +D1E3 D672
43.17593 +D1E4 D673
43.17594 +D1E5 D674
43.17595 +D1E6 D675
43.17596 +D1E7 D676
43.17597 +D1E8 D677
43.17598 +D1E9 D678
43.17599 +D1EA D679
43.17600 +D1EB D67A
43.17601 +D1EC D67B
43.17602 +D1ED D67C
43.17603 +D1EE D67D
43.17604 +D1EF D67E
43.17605 +D1F0 D67F
43.17606 +D1F1 D680
43.17607 +D1F3 D681
43.17608 +D1F4 D682
43.17609 +D1F5 D683
43.17610 +D1F6 D684
43.17611 +D1F7 D685
43.17612 +D1F8 D686
43.17613 +D1F9 D687
43.17614 +D1FA D688
43.17615 +D1FB D689
43.17616 +D1FC D68A
43.17617 +D1FD D68B
43.17618 +D241 D68C
43.17619 +D242 D68D
43.17620 +D243 D68E
43.17621 +D244 D68F
43.17622 +D245 D690
43.17623 +D246 D691
43.17624 +D247 D692
43.17625 +D248 D693
43.17626 +D249 D694
43.17627 +D24A D695
43.17628 +D24B D696
43.17629 +D24C D697
43.17630 +D24D D698
43.17631 +D24E D699
43.17632 +D24F D69A
43.17633 +D250 D69B
43.17634 +D251 D69C
43.17635 +D253 D69D
43.17636 +D254 D69E
43.17637 +D255 D69F
43.17638 +D256 D6A0
43.17639 +D257 D6A1
43.17640 +D258 D6A2
43.17641 +D259 D6A3
43.17642 +D25A D6A4
43.17643 +D25B D6A5
43.17644 +D25C D6A6
43.17645 +D25D D6A7
43.17646 +D261 D6A8
43.17647 +D262 D6A9
43.17648 +D263 D6AA
43.17649 +D264 D6AB
43.17650 +D265 D6AC
43.17651 +D266 D6AD
43.17652 +D267 D6AE
43.17653 +D268 D6AF
43.17654 +D269 D6B0
43.17655 +D26A D6B1
43.17656 +D26B D6B2
43.17657 +D26C D6B3
43.17658 +D26D D6B4
43.17659 +D26E D6B5
43.17660 +D26F D6B6
43.17661 +D270 D6B7
43.17662 +D271 D6B8
43.17663 +D273 D6B9
43.17664 +D274 D6BA
43.17665 +D275 D6BB
43.17666 +D276 D6BC
43.17667 +D277 D6BD
43.17668 +D278 D6BE
43.17669 +D279 D6BF
43.17670 +D27A D6C0
43.17671 +D27B D6C1
43.17672 +D27C D6C2
43.17673 +D27D D6C3
43.17674 +D281 D6C4
43.17675 +D282 D6C5
43.17676 +D283 D6C6
43.17677 +D284 D6C7
43.17678 +D285 D6C8
43.17679 +D286 D6C9
43.17680 +D287 D6CA
43.17681 +D288 D6CB
43.17682 +D289 D6CC
43.17683 +D28A D6CD
43.17684 +D28B D6CE
43.17685 +D28C D6CF
43.17686 +D28D D6D0
43.17687 +D28E D6D1
43.17688 +D28F D6D2
43.17689 +D290 D6D3
43.17690 +D291 D6D4
43.17691 +D293 D6D5
43.17692 +D294 D6D6
43.17693 +D295 D6D7
43.17694 +D296 D6D8
43.17695 +D297 D6D9
43.17696 +D298 D6DA
43.17697 +D299 D6DB
43.17698 +D29A D6DC
43.17699 +D29B D6DD
43.17700 +D29C D6DE
43.17701 +D29D D6DF
43.17702 +D2A1 D6E0
43.17703 +D2A2 D6E1
43.17704 +D2A3 D6E2
43.17705 +D2A4 D6E3
43.17706 +D2A5 D6E4
43.17707 +D2A6 D6E5
43.17708 +D2A7 D6E6
43.17709 +D2A8 D6E7
43.17710 +D2A9 D6E8
43.17711 +D2AA D6E9
43.17712 +D2AB D6EA
43.17713 +D2AC D6EB
43.17714 +D2AD D6EC
43.17715 +D2AE D6ED
43.17716 +D2AF D6EE
43.17717 +D2B0 D6EF
43.17718 +D2B1 D6F0
43.17719 +D2B3 D6F1
43.17720 +D2B4 D6F2
43.17721 +D2B5 D6F3
43.17722 +D2B6 D6F4
43.17723 +D2B7 D6F5
43.17724 +D2B8 D6F6
43.17725 +D2B9 D6F7
43.17726 +D2BA D6F8
43.17727 +D2BB D6F9
43.17728 +D2BC D6FA
43.17729 +D2BD D6FB
43.17730 +D2C1 D6FC
43.17731 +D2C2 D6FD
43.17732 +D2C3 D6FE
43.17733 +D2C4 D6FF
43.17734 +D2C5 D700
43.17735 +D2C6 D701
43.17736 +D2C7 D702
43.17737 +D2C8 D703
43.17738 +D2C9 D704
43.17739 +D2CA D705
43.17740 +D2CB D706
43.17741 +D2CC D707
43.17742 +D2CD D708
43.17743 +D2CE D709
43.17744 +D2CF D70A
43.17745 +D2D0 D70B
43.17746 +D2D1 D70C
43.17747 +D2D3 D70D
43.17748 +D2D4 D70E
43.17749 +D2D5 D70F
43.17750 +D2D6 D710
43.17751 +D2D7 D711
43.17752 +D2D8 D712
43.17753 +D2D9 D713
43.17754 +D2DA D714
43.17755 +D2DB D715
43.17756 +D2DC D716
43.17757 +D2DD D717
43.17758 +D2E1 D718
43.17759 +D2E2 D719
43.17760 +D2E3 D71A
43.17761 +D2E4 D71B
43.17762 +D2E5 D71C
43.17763 +D2E6 D71D
43.17764 +D2E7 D71E
43.17765 +D2E8 D71F
43.17766 +D2E9 D720
43.17767 +D2EA D721
43.17768 +D2EB D722
43.17769 +D2EC D723
43.17770 +D2ED D724
43.17771 +D2EE D725
43.17772 +D2EF D726
43.17773 +D2F0 D727
43.17774 +D2F1 D728
43.17775 +D2F3 D729
43.17776 +D2F4 D72A
43.17777 +D2F5 D72B
43.17778 +D2F6 D72C
43.17779 +D2F7 D72D
43.17780 +D2F8 D72E
43.17781 +D2F9 D72F
43.17782 +D2FA D730
43.17783 +D2FB D731
43.17784 +D2FC D732
43.17785 +D2FD D733
43.17786 +D341 D734
43.17787 +D342 D735
43.17788 +D343 D736
43.17789 +D344 D737
43.17790 +D345 D738
43.17791 +D346 D739
43.17792 +D347 D73A
43.17793 +D348 D73B
43.17794 +D349 D73C
43.17795 +D34A D73D
43.17796 +D34B D73E
43.17797 +D34C D73F
43.17798 +D34D D740
43.17799 +D34E D741
43.17800 +D34F D742
43.17801 +D350 D743
43.17802 +D351 D744
43.17803 +D353 D745
43.17804 +D354 D746
43.17805 +D355 D747
43.17806 +D356 D748
43.17807 +D357 D749
43.17808 +D358 D74A
43.17809 +D359 D74B
43.17810 +D35A D74C
43.17811 +D35B D74D
43.17812 +D35C D74E
43.17813 +D35D D74F
43.17814 +D361 D750
43.17815 +D362 D751
43.17816 +D363 D752
43.17817 +D364 D753
43.17818 +D365 D754
43.17819 +D366 D755
43.17820 +D367 D756
43.17821 +D368 D757
43.17822 +D369 D758
43.17823 +D36A D759
43.17824 +D36B D75A
43.17825 +D36C D75B
43.17826 +D36D D75C
43.17827 +D36E D75D
43.17828 +D36F D75E
43.17829 +D370 D75F
43.17830 +D371 D760
43.17831 +D373 D761
43.17832 +D374 D762
43.17833 +D375 D763
43.17834 +D376 D764
43.17835 +D377 D765
43.17836 +D378 D766
43.17837 +D379 D767
43.17838 +D37A D768
43.17839 +D37B D769
43.17840 +D37C D76A
43.17841 +D37D D76B
43.17842 +D381 D76C
43.17843 +D382 D76D
43.17844 +D383 D76E
43.17845 +D384 D76F
43.17846 +D385 D770
43.17847 +D386 D771
43.17848 +D387 D772
43.17849 +D388 D773
43.17850 +D389 D774
43.17851 +D38A D775
43.17852 +D38B D776
43.17853 +D38C D777
43.17854 +D38D D778
43.17855 +D38E D779
43.17856 +D38F D77A
43.17857 +D390 D77B
43.17858 +D391 D77C
43.17859 +D393 D77D
43.17860 +D394 D77E
43.17861 +D395 D77F
43.17862 +D396 D780
43.17863 +D397 D781
43.17864 +D398 D782
43.17865 +D399 D783
43.17866 +D39A D784
43.17867 +D39B D785
43.17868 +D39C D786
43.17869 +D39D D787
43.17870 +D3A1 D788
43.17871 +D3A2 D789
43.17872 +D3A3 D78A
43.17873 +D3A4 D78B
43.17874 +D3A5 D78C
43.17875 +D3A6 D78D
43.17876 +D3A7 D78E
43.17877 +D3A8 D78F
43.17878 +D3A9 D790
43.17879 +D3AA D791
43.17880 +D3AB D792
43.17881 +D3AC D793
43.17882 +D3AD D794
43.17883 +D3AE D795
43.17884 +D3AF D796
43.17885 +D3B0 D797
43.17886 +D3B1 D798
43.17887 +D3B3 D799
43.17888 +D3B4 D79A
43.17889 +D3B5 D79B
43.17890 +D3B6 D79C
43.17891 +D3B7 D79D
43.17892 +D3B8 D79E
43.17893 +D3B9 D79F
43.17894 +D3BA D7A0
43.17895 +D3BB D7A1
43.17896 +D3BC D7A2
43.17897 +D3BD D7A3
43.17898 +D441 E000
43.17899 +D442 E001
43.17900 +D443 E002
43.17901 +D444 E003
43.17902 +D445 E004
43.17903 +D446 E005
43.17904 +D447 E006
43.17905 +D448 E007
43.17906 +D449 E008
43.17907 +D44A E009
43.17908 +D44B E00A
43.17909 +D44C E00B
43.17910 +D44D E00C
43.17911 +D44E E00D
43.17912 +D44F E00E
43.17913 +D450 E00F
43.17914 +D451 E010
43.17915 +D452 E011
43.17916 +D453 E012
43.17917 +D454 E013
43.17918 +D455 E014
43.17919 +D456 E015
43.17920 +D457 E016
43.17921 +D458 E017
43.17922 +D459 E018
43.17923 +D45A E019
43.17924 +D45B E01A
43.17925 +D45C E01B
43.17926 +D45D E01C
43.17927 +D45E E01D
43.17928 +D45F E01E
43.17929 +D460 E01F
43.17930 +D461 E020
43.17931 +D462 E021
43.17932 +D463 E022
43.17933 +D464 E023
43.17934 +D465 E024
43.17935 +D466 E025
43.17936 +D467 E026
43.17937 +D468 E027
43.17938 +D469 E028
43.17939 +D46A E029
43.17940 +D46B E02A
43.17941 +D46C E02B
43.17942 +D46D E02C
43.17943 +D46E E02D
43.17944 +D46F E02E
43.17945 +D470 E02F
43.17946 +D471 E030
43.17947 +D472 E031
43.17948 +D473 E032
43.17949 +D474 E033
43.17950 +D475 E034
43.17951 +D476 E035
43.17952 +D477 E036
43.17953 +D478 E037
43.17954 +D479 E038
43.17955 +D47A E039
43.17956 +D47B E03A
43.17957 +D47C E03B
43.17958 +D47D E03C
43.17959 +D47E E03D
43.17960 +D47F E03E
43.17961 +D481 E03F
43.17962 +D482 E040
43.17963 +D483 E041
43.17964 +D484 E042
43.17965 +D485 E043
43.17966 +D486 E044
43.17967 +D487 E045
43.17968 +D488 E046
43.17969 +D489 E047
43.17970 +D48A E048
43.17971 +D48B E049
43.17972 +D48C E04A
43.17973 +D48D E04B
43.17974 +D48E E04C
43.17975 +D48F E04D
43.17976 +D490 E04E
43.17977 +D491 E04F
43.17978 +D492 E050
43.17979 +D493 E051
43.17980 +D494 E052
43.17981 +D495 E053
43.17982 +D496 E054
43.17983 +D497 E055
43.17984 +D498 E056
43.17985 +D499 E057
43.17986 +D49A E058
43.17987 +D49B E059
43.17988 +D49C E05A
43.17989 +D49D E05B
43.17990 +D49E E05C
43.17991 +D49F E05D
43.17992 +D4A0 E05E
43.17993 +D4A1 E05F
43.17994 +D4A2 E060
43.17995 +D4A3 E061
43.17996 +D4A4 E062
43.17997 +D4A5 E063
43.17998 +D4A6 E064
43.17999 +D4A7 E065
43.18000 +D4A8 E066
43.18001 +D4A9 E067
43.18002 +D4AA E068
43.18003 +D4AB E069
43.18004 +D4AC E06A
43.18005 +D4AD E06B
43.18006 +D4AE E06C
43.18007 +D4AF E06D
43.18008 +D4B0 E06E
43.18009 +D4B1 E06F
43.18010 +D4B2 E070
43.18011 +D4B3 E071
43.18012 +D4B4 E072
43.18013 +D4B5 E073
43.18014 +D4B6 E074
43.18015 +D4B7 E075
43.18016 +D4B8 E076
43.18017 +D4B9 E077
43.18018 +D4BA E078
43.18019 +D4BB E079
43.18020 +D4BC E07A
43.18021 +D4BD E07B
43.18022 +D4BE E07C
43.18023 +D4BF E07D
43.18024 +D4C0 E07E
43.18025 +D4C1 E07F
43.18026 +D4C2 E080
43.18027 +D4C3 E081
43.18028 +D4C4 E082
43.18029 +D4C5 E083
43.18030 +D4C6 E084
43.18031 +D4C7 E085
43.18032 +D4C8 E086
43.18033 +D4C9 E087
43.18034 +D4CA E088
43.18035 +D4CB E089
43.18036 +D4CC E08A
43.18037 +D4CD E08B
43.18038 +D4CE E08C
43.18039 +D4CF E08D
43.18040 +D4D0 E08E
43.18041 +D4D1 E08F
43.18042 +D4D2 E090
43.18043 +D4D3 E091
43.18044 +D4D4 E092
43.18045 +D4D5 E093
43.18046 +D4D6 E094
43.18047 +D4D7 E095
43.18048 +D4D8 E096
43.18049 +D4D9 E097
43.18050 +D4DA E098
43.18051 +D4DB E099
43.18052 +D4DC E09A
43.18053 +D4DD E09B
43.18054 +D4DE E09C
43.18055 +D4DF E09D
43.18056 +D4E0 E09E
43.18057 +D4E1 E09F
43.18058 +D4E2 E0A0
43.18059 +D4E3 E0A1
43.18060 +D4E4 E0A2
43.18061 +D4E5 E0A3
43.18062 +D4E6 E0A4
43.18063 +D4E7 E0A5
43.18064 +D4E8 E0A6
43.18065 +D4E9 E0A7
43.18066 +D4EA E0A8
43.18067 +D4EB E0A9
43.18068 +D4EC E0AA
43.18069 +D4ED E0AB
43.18070 +D4EE E0AC
43.18071 +D4EF E0AD
43.18072 +D4F0 E0AE
43.18073 +D4F1 E0AF
43.18074 +D4F2 E0B0
43.18075 +D4F3 E0B1
43.18076 +D4F4 E0B2
43.18077 +D4F5 E0B3
43.18078 +D4F6 E0B4
43.18079 +D4F7 E0B5
43.18080 +D4F8 E0B6
43.18081 +D4F9 E0B7
43.18082 +D4FA E0B8
43.18083 +D4FB E0B9
43.18084 +D4FC E0BA
43.18085 +D4FD E0BB
43.18086 +D541 E0BC
43.18087 +D542 E0BD
43.18088 +D543 E0BE
43.18089 +D544 E0BF
43.18090 +D545 E0C0
43.18091 +D546 E0C1
43.18092 +D547 E0C2
43.18093 +D548 E0C3
43.18094 +D549 E0C4
43.18095 +D54A E0C5
43.18096 +D54B E0C6
43.18097 +D54C E0C7
43.18098 +D54D E0C8
43.18099 +D54E E0C9
43.18100 +D54F E0CA
43.18101 +D550 E0CB
43.18102 +D551 E0CC
43.18103 +D552 E0CD
43.18104 +D553 E0CE
43.18105 +D554 E0CF
43.18106 +D555 E0D0
43.18107 +D556 E0D1
43.18108 +D557 E0D2
43.18109 +D558 E0D3
43.18110 +D559 E0D4
43.18111 +D55A E0D5
43.18112 +D55B E0D6
43.18113 +D55C E0D7
43.18114 +D55D E0D8
43.18115 +D55E E0D9
43.18116 +D55F E0DA
43.18117 +D560 E0DB
43.18118 +D561 E0DC
43.18119 +D562 E0DD
43.18120 +D563 E0DE
43.18121 +D564 E0DF
43.18122 +D565 E0E0
43.18123 +D566 E0E1
43.18124 +D567 E0E2
43.18125 +D568 E0E3
43.18126 +D569 E0E4
43.18127 +D56A E0E5
43.18128 +D56B E0E6
43.18129 +D56C E0E7
43.18130 +D56D E0E8
43.18131 +D56E E0E9
43.18132 +D56F E0EA
43.18133 +D570 E0EB
43.18134 +D571 E0EC
43.18135 +D572 E0ED
43.18136 +D573 E0EE
43.18137 +D574 E0EF
43.18138 +D575 E0F0
43.18139 +D576 E0F1
43.18140 +D577 E0F2
43.18141 +D578 E0F3
43.18142 +D579 E0F4
43.18143 +D57A E0F5
43.18144 +D57B E0F6
43.18145 +D57C E0F7
43.18146 +D57D E0F8
43.18147 +D57E E0F9
43.18148 +D57F E0FA
43.18149 +D581 E0FB
43.18150 +D582 E0FC
43.18151 +D583 E0FD
43.18152 +D584 E0FE
43.18153 +D585 E0FF
43.18154 +D586 E100
43.18155 +D587 E101
43.18156 +D588 E102
43.18157 +D589 E103
43.18158 +D58A E104
43.18159 +D58B E105
43.18160 +D58C E106
43.18161 +D58D E107
43.18162 +D58E E108
43.18163 +D58F E109
43.18164 +D590 E10A
43.18165 +D591 E10B
43.18166 +D592 E10C
43.18167 +D593 E10D
43.18168 +D594 E10E
43.18169 +D595 E10F
43.18170 +D596 E110
43.18171 +D597 E111
43.18172 +D598 E112
43.18173 +D599 E113
43.18174 +D59A E114
43.18175 +D59B E115
43.18176 +D59C E116
43.18177 +D59D E117
43.18178 +D59E E118
43.18179 +D59F E119
43.18180 +D5A0 E11A
43.18181 +D5A1 E11B
43.18182 +D5A2 E11C
43.18183 +D5A3 E11D
43.18184 +D5A4 E11E
43.18185 +D5A5 E11F
43.18186 +D5A6 E120
43.18187 +D5A7 E121
43.18188 +D5A8 E122
43.18189 +D5A9 E123
43.18190 +D5AA E124
43.18191 +D5AB E125
43.18192 +D5AC E126
43.18193 +D5AD E127
43.18194 +D5AE E128
43.18195 +D5AF E129
43.18196 +D5B0 E12A
43.18197 +D5B1 E12B
43.18198 +D5B2 E12C
43.18199 +D5B3 E12D
43.18200 +D5B4 E12E
43.18201 +D5B5 E12F
43.18202 +D5B6 E130
43.18203 +D5B7 E131
43.18204 +D5B8 E132
43.18205 +D5B9 E133
43.18206 +D5BA E134
43.18207 +D5BB E135
43.18208 +D5BC E136
43.18209 +D5BD E137
43.18210 +D5BE E138
43.18211 +D5BF E139
43.18212 +D5C0 E13A
43.18213 +D5C1 E13B
43.18214 +D5C2 E13C
43.18215 +D5C3 E13D
43.18216 +D5C4 E13E
43.18217 +D5C5 E13F
43.18218 +D5C6 E140
43.18219 +D5C7 E141
43.18220 +D5C8 E142
43.18221 +D5C9 E143
43.18222 +D5CA E144
43.18223 +D5CB E145
43.18224 +D5CC E146
43.18225 +D5CD E147
43.18226 +D5CE E148
43.18227 +D5CF E149
43.18228 +D5D0 E14A
43.18229 +D5D1 E14B
43.18230 +D5D2 E14C
43.18231 +D5D3 E14D
43.18232 +D5D4 E14E
43.18233 +D5D5 E14F
43.18234 +D5D6 E150
43.18235 +D5D7 E151
43.18236 +D5D8 E152
43.18237 +D5D9 E153
43.18238 +D5DA E154
43.18239 +D5DB E155
43.18240 +D5DC E156
43.18241 +D5DD E157
43.18242 +D5DE E158
43.18243 +D5DF E159
43.18244 +D5E0 E15A
43.18245 +D5E1 E15B
43.18246 +D5E2 E15C
43.18247 +D5E3 E15D
43.18248 +D5E4 E15E
43.18249 +D5E5 E15F
43.18250 +D5E6 E160
43.18251 +D5E7 E161
43.18252 +D5E8 E162
43.18253 +D5E9 E163
43.18254 +D5EA E164
43.18255 +D5EB E165
43.18256 +D5EC E166
43.18257 +D5ED E167
43.18258 +D5EE E168
43.18259 +D5EF E169
43.18260 +D5F0 E16A
43.18261 +D5F1 E16B
43.18262 +D5F2 E16C
43.18263 +D5F3 E16D
43.18264 +D5F4 E16E
43.18265 +D5F5 E16F
43.18266 +D5F6 E170
43.18267 +D5F7 E171
43.18268 +D5F8 E172
43.18269 +D5F9 E173
43.18270 +D5FA E174
43.18271 +D5FB E175
43.18272 +D5FC E176
43.18273 +D5FD E177
43.18274 +D641 E178
43.18275 +D642 E179
43.18276 +D643 E17A
43.18277 +D644 E17B
43.18278 +D645 E17C
43.18279 +D646 E17D
43.18280 +D647 E17E
43.18281 +D648 E17F
43.18282 +D649 E180
43.18283 +D64A E181
43.18284 +D64B E182
43.18285 +D64C E183
43.18286 +D64D E184
43.18287 +D64E E185
43.18288 +D64F E186
43.18289 +D650 E187
43.18290 +D651 E188
43.18291 +D652 E189
43.18292 +D653 E18A
43.18293 +D654 E18B
43.18294 +D655 E18C
43.18295 +D656 E18D
43.18296 +D657 E18E
43.18297 +D658 E18F
43.18298 +D659 E190
43.18299 +D65A E191
43.18300 +D65B E192
43.18301 +D65C E193
43.18302 +D65D E194
43.18303 +D65E E195
43.18304 +D65F E196
43.18305 +D660 E197
43.18306 +D661 E198
43.18307 +D662 E199
43.18308 +D663 E19A
43.18309 +D664 E19B
43.18310 +D665 E19C
43.18311 +D666 E19D
43.18312 +D667 E19E
43.18313 +D668 E19F
43.18314 +D669 E1A0
43.18315 +D66A E1A1
43.18316 +D66B E1A2
43.18317 +D66C E1A3
43.18318 +D66D E1A4
43.18319 +D66E E1A5
43.18320 +D66F E1A6
43.18321 +D670 E1A7
43.18322 +D671 E1A8
43.18323 +D672 E1A9
43.18324 +D673 E1AA
43.18325 +D674 E1AB
43.18326 +D675 E1AC
43.18327 +D676 E1AD
43.18328 +D677 E1AE
43.18329 +D678 E1AF
43.18330 +D679 E1B0
43.18331 +D67A E1B1
43.18332 +D67B E1B2
43.18333 +D67C E1B3
43.18334 +D67D E1B4
43.18335 +D67E E1B5
43.18336 +D67F E1B6
43.18337 +D681 E1B7
43.18338 +D682 E1B8
43.18339 +D683 E1B9
43.18340 +D684 E1BA
43.18341 +D685 E1BB
43.18342 +D686 E1BC
43.18343 +D687 E1BD
43.18344 +D688 E1BE
43.18345 +D689 E1BF
43.18346 +D68A E1C0
43.18347 +D68B E1C1
43.18348 +D68C E1C2
43.18349 +D68D E1C3
43.18350 +D68E E1C4
43.18351 +D68F E1C5
43.18352 +D690 E1C6
43.18353 +D691 E1C7
43.18354 +D692 E1C8
43.18355 +D693 E1C9
43.18356 +D694 E1CA
43.18357 +D695 E1CB
43.18358 +D696 E1CC
43.18359 +D697 E1CD
43.18360 +D698 E1CE
43.18361 +D699 E1CF
43.18362 +D69A E1D0
43.18363 +D69B E1D1
43.18364 +D69C E1D2
43.18365 +D69D E1D3
43.18366 +D69E E1D4
43.18367 +D69F E1D5
43.18368 +D6A0 E1D6
43.18369 +D6A1 E1D7
43.18370 +D6A2 E1D8
43.18371 +D6A3 E1D9
43.18372 +D6A4 E1DA
43.18373 +D6A5 E1DB
43.18374 +D6A6 E1DC
43.18375 +D6A7 E1DD
43.18376 +D6A8 E1DE
43.18377 +D6A9 E1DF
43.18378 +D6AA E1E0
43.18379 +D6AB E1E1
43.18380 +D6AC E1E2
43.18381 +D6AD E1E3
43.18382 +D6AE E1E4
43.18383 +D6AF E1E5
43.18384 +D6B0 E1E6
43.18385 +D6B1 E1E7
43.18386 +D6B2 E1E8
43.18387 +D6B3 E1E9
43.18388 +D6B4 E1EA
43.18389 +D6B5 E1EB
43.18390 +D6B6 E1EC
43.18391 +D6B7 E1ED
43.18392 +D6B8 E1EE
43.18393 +D6B9 E1EF
43.18394 +D6BA E1F0
43.18395 +D6BB E1F1
43.18396 +D6BC E1F2
43.18397 +D6BD E1F3
43.18398 +D6BE E1F4
43.18399 +D6BF E1F5
43.18400 +D6C0 E1F6
43.18401 +D6C1 E1F7
43.18402 +D6C2 E1F8
43.18403 +D6C3 E1F9
43.18404 +D6C4 E1FA
43.18405 +D6C5 E1FB
43.18406 +D6C6 E1FC
43.18407 +D6C7 E1FD
43.18408 +D6C8 E1FE
43.18409 +D6C9 E1FF
43.18410 +D6CA E200
43.18411 +D6CB E201
43.18412 +D6CC E202
43.18413 +D6CD E203
43.18414 +D6CE E204
43.18415 +D6CF E205
43.18416 +D6D0 E206
43.18417 +D6D1 E207
43.18418 +D6D2 E208
43.18419 +D6D3 E209
43.18420 +D6D4 E20A
43.18421 +D6D5 E20B
43.18422 +D6D6 E20C
43.18423 +D6D7 E20D
43.18424 +D6D8 E20E
43.18425 +D6D9 E20F
43.18426 +D6DA E210
43.18427 +D6DB E211
43.18428 +D6DC E212
43.18429 +D6DD E213
43.18430 +D6DE E214
43.18431 +D6DF E215
43.18432 +D6E0 E216
43.18433 +D6E1 E217
43.18434 +D6E2 E218
43.18435 +D6E3 E219
43.18436 +D6E4 E21A
43.18437 +D6E5 E21B
43.18438 +D6E6 E21C
43.18439 +D6E7 E21D
43.18440 +D6E8 E21E
43.18441 +D6E9 E21F
43.18442 +D6EA E220
43.18443 +D6EB E221
43.18444 +D6EC E222
43.18445 +D6ED E223
43.18446 +D6EE E224
43.18447 +D6EF E225
43.18448 +D6F0 E226
43.18449 +D6F1 E227
43.18450 +D6F2 E228
43.18451 +D6F3 E229
43.18452 +D6F4 E22A
43.18453 +D6F5 E22B
43.18454 +D6F6 E22C
43.18455 +D6F7 E22D
43.18456 +D6F8 E22E
43.18457 +D6F9 E22F
43.18458 +D6FA E230
43.18459 +D6FB E231
43.18460 +D6FC E232
43.18461 +D6FD E233
43.18462 +D741 E234
43.18463 +D742 E235
43.18464 +D743 E236
43.18465 +D744 E237
43.18466 +D745 E238
43.18467 +D746 E239
43.18468 +D747 E23A
43.18469 +D748 E23B
43.18470 +D749 E23C
43.18471 +D74A E23D
43.18472 +D74B E23E
43.18473 +D74C E23F
43.18474 +D74D E240
43.18475 +D74E E241
43.18476 +D74F E242
43.18477 +D750 E243
43.18478 +D751 E244
43.18479 +D752 E245
43.18480 +D753 E246
43.18481 +D754 E247
43.18482 +D755 E248
43.18483 +D756 E249
43.18484 +D757 E24A
43.18485 +D758 E24B
43.18486 +D759 E24C
43.18487 +D75A E24D
43.18488 +D75B E24E
43.18489 +D75C E24F
43.18490 +D75D E250
43.18491 +D75E E251
43.18492 +D75F E252
43.18493 +D760 E253
43.18494 +D761 E254
43.18495 +D762 E255
43.18496 +D763 E256
43.18497 +D764 E257
43.18498 +D765 E258
43.18499 +D766 E259
43.18500 +D767 E25A
43.18501 +D768 E25B
43.18502 +D769 E25C
43.18503 +D76A E25D
43.18504 +D76B E25E
43.18505 +D76C E25F
43.18506 +D76D E260
43.18507 +D76E E261
43.18508 +D76F E262
43.18509 +D770 E263
43.18510 +D771 E264
43.18511 +D772 E265
43.18512 +D773 E266
43.18513 +D774 E267
43.18514 +D775 E268
43.18515 +D776 E269
43.18516 +D777 E26A
43.18517 +D778 E26B
43.18518 +D779 E26C
43.18519 +D77A E26D
43.18520 +D77B E26E
43.18521 +D77C E26F
43.18522 +D77D E270
43.18523 +D77E E271
43.18524 +D77F E272
43.18525 +D781 E273
43.18526 +D782 E274
43.18527 +D783 E275
43.18528 +D784 E276
43.18529 +D785 E277
43.18530 +D786 E278
43.18531 +D787 E279
43.18532 +D788 E27A
43.18533 +D789 E27B
43.18534 +D78A E27C
43.18535 +D78B E27D
43.18536 +D78C E27E
43.18537 +D78D E27F
43.18538 +D78E E280
43.18539 +D78F E281
43.18540 +D790 E282
43.18541 +D791 E283
43.18542 +D792 E284
43.18543 +D793 E285
43.18544 +D794 E286
43.18545 +D795 E287
43.18546 +D796 E288
43.18547 +D797 E289
43.18548 +D798 E28A
43.18549 +D799 E28B
43.18550 +D79A E28C
43.18551 +D79B E28D
43.18552 +D79C E28E
43.18553 +D79D E28F
43.18554 +D79E E290
43.18555 +D79F E291
43.18556 +D7A0 E292
43.18557 +D7A1 E293
43.18558 +D7A2 E294
43.18559 +D7A3 E295
43.18560 +D7A4 E296
43.18561 +D7A5 E297
43.18562 +D7A6 E298
43.18563 +D7A7 E299
43.18564 +D7A8 E29A
43.18565 +D7A9 E29B
43.18566 +D7AA E29C
43.18567 +D7AB E29D
43.18568 +D7AC E29E
43.18569 +D7AD E29F
43.18570 +D7AE E2A0
43.18571 +D7AF E2A1
43.18572 +D7B0 E2A2
43.18573 +D7B1 E2A3
43.18574 +D7B2 E2A4
43.18575 +D7B3 E2A5
43.18576 +D7B4 E2A6
43.18577 +D7B5 E2A7
43.18578 +D7B6 E2A8
43.18579 +D7B7 E2A9
43.18580 +D7B8 E2AA
43.18581 +D7B9 E2AB
43.18582 +D7BA E2AC
43.18583 +D7BB E2AD
43.18584 +D7BC E2AE
43.18585 +D7BD E2AF
43.18586 +D7BE E2B0
43.18587 +D7BF E2B1
43.18588 +D7C0 E2B2
43.18589 +D7C1 E2B3
43.18590 +D7C2 E2B4
43.18591 +D7C3 E2B5
43.18592 +D7C4 E2B6
43.18593 +D7C5 E2B7
43.18594 +D7C6 E2B8
43.18595 +D7C7 E2B9
43.18596 +D7C8 E2BA
43.18597 +D7C9 E2BB
43.18598 +D7CA E2BC
43.18599 +D7CB E2BD
43.18600 +D7CC E2BE
43.18601 +D7CD E2BF
43.18602 +D7CE E2C0
43.18603 +D7CF E2C1
43.18604 +D7D0 E2C2
43.18605 +D7D1 E2C3
43.18606 +D7D2 E2C4
43.18607 +D7D3 E2C5
43.18608 +D7D4 E2C6
43.18609 +D7D5 E2C7
43.18610 +D7D6 E2C8
43.18611 +D7D7 E2C9
43.18612 +D7D8 E2CA
43.18613 +D7D9 E2CB
43.18614 +D7DA E2CC
43.18615 +D7DB E2CD
43.18616 +D7DC E2CE
43.18617 +D7DD E2CF
43.18618 +D7DE E2D0
43.18619 +D7DF E2D1
43.18620 +D7E0 E2D2
43.18621 +D7E1 E2D3
43.18622 +D7E2 E2D4
43.18623 +D7E3 E2D5
43.18624 +D7E4 E2D6
43.18625 +D7E5 E2D7
43.18626 +D7E6 E2D8
43.18627 +D7E7 E2D9
43.18628 +D7E8 E2DA
43.18629 +D7E9 E2DB
43.18630 +D7EA E2DC
43.18631 +D7EB E2DD
43.18632 +D7EC E2DE
43.18633 +D7ED E2DF
43.18634 +D7EE E2E0
43.18635 +D7EF E2E1
43.18636 +D7F0 E2E2
43.18637 +D7F1 E2E3
43.18638 +D7F2 E2E4
43.18639 +D7F3 E2E5
43.18640 +D7F4 E2E6
43.18641 +D7F5 E2E7
43.18642 +D7F6 E2E8
43.18643 +D7F7 E2E9
43.18644 +D7F8 E2EA
43.18645 +D7F9 E2EB
43.18646 +D7FA E2EC
43.18647 +D7FB E2ED
43.18648 +D7FC E2EE
43.18649 +D7FD E2EF
43.18650 +D841 E2F0
43.18651 +D842 E2F1
43.18652 +D843 E2F2
43.18653 +D844 E2F3
43.18654 +D845 E2F4
43.18655 +D846 E2F5
43.18656 +D847 E2F6
43.18657 +D848 E2F7
43.18658 +D849 E2F8
43.18659 +D84A E2F9
43.18660 +D84B E2FA
43.18661 +D84C E2FB
43.18662 +D84D E2FC
43.18663 +D84E E2FD
43.18664 +D84F E2FE
43.18665 +D850 E2FF
43.18666 +D851 E300
43.18667 +D852 E301
43.18668 +D853 E302
43.18669 +D854 E303
43.18670 +D855 E304
43.18671 +D856 E305
43.18672 +D857 E306
43.18673 +D858 E307
43.18674 +D859 E308
43.18675 +D85A E309
43.18676 +D85B E30A
43.18677 +D85C E30B
43.18678 +D85D E30C
43.18679 +D85E E30D
43.18680 +D85F E30E
43.18681 +D860 E30F
43.18682 +D861 E310
43.18683 +D862 E311
43.18684 +D863 E312
43.18685 +D864 E313
43.18686 +D865 E314
43.18687 +D866 E315
43.18688 +D867 E316
43.18689 +D868 E317
43.18690 +D869 E318
43.18691 +D86A E319
43.18692 +D86B E31A
43.18693 +D86C E31B
43.18694 +D86D E31C
43.18695 +D86E E31D
43.18696 +D86F E31E
43.18697 +D870 E31F
43.18698 +D871 E320
43.18699 +D872 E321
43.18700 +D873 E322
43.18701 +D874 E323
43.18702 +D875 E324
43.18703 +D876 E325
43.18704 +D877 E326
43.18705 +D878 E327
43.18706 +D879 E328
43.18707 +D87A E329
43.18708 +D87B E32A
43.18709 +D87C E32B
43.18710 +D87D E32C
43.18711 +D87E E32D
43.18712 +D87F E32E
43.18713 +D881 E32F
43.18714 +D882 E330
43.18715 +D883 E331
43.18716 +D884 E332
43.18717 +D885 E333
43.18718 +D886 E334
43.18719 +D887 E335
43.18720 +D888 E336
43.18721 +D889 E337
43.18722 +D88A E338
43.18723 +D88B E339
43.18724 +D88C E33A
43.18725 +D88D E33B
43.18726 +D88E E33C
43.18727 +D88F E33D
43.18728 +D890 E33E
43.18729 +D891 E33F
43.18730 +D892 E340
43.18731 +D893 E341
43.18732 +D894 E342
43.18733 +D895 E343
43.18734 +D896 E344
43.18735 +D897 E345
43.18736 +D898 E346
43.18737 +D899 E347
43.18738 +D89A E348
43.18739 +D89B E349
43.18740 +D89C E34A
43.18741 +D89D E34B
43.18742 +D89E E34C
43.18743 +D89F E34D
43.18744 +D8A0 E34E
43.18745 +D8A1 E34F
43.18746 +D8A2 E350
43.18747 +D8A3 E351
43.18748 +D8A4 E352
43.18749 +D8A5 E353
43.18750 +D8A6 E354
43.18751 +D8A7 E355
43.18752 +D8A8 E356
43.18753 +D8A9 E357
43.18754 +D8AA E358
43.18755 +D8AB E359
43.18756 +D8AC E35A
43.18757 +D8AD E35B
43.18758 +D8AE E35C
43.18759 +D8AF E35D
43.18760 +D8B0 E35E
43.18761 +D8B1 E35F
43.18762 +D8B2 E360
43.18763 +D8B3 E361
43.18764 +D8B4 E362
43.18765 +D8B5 E363
43.18766 +D8B6 E364
43.18767 +D8B7 E365
43.18768 +D8B8 E366
43.18769 +D8B9 E367
43.18770 +D8BA E368
43.18771 +D8BB E369
43.18772 +D8BC E36A
43.18773 +D8BD E36B
43.18774 +D8BE E36C
43.18775 +D8BF E36D
43.18776 +D8C0 E36E
43.18777 +D8C1 E36F
43.18778 +D8C2 E370
43.18779 +D8C3 E371
43.18780 +D8C4 E372
43.18781 +D8C5 E373
43.18782 +D8C6 E374
43.18783 +D8C7 E375
43.18784 +D8C8 E376
43.18785 +D8C9 E377
43.18786 +D8CA E378
43.18787 +D8CB E379
43.18788 +D8CC E37A
43.18789 +D8CD E37B
43.18790 +D8CE E37C
43.18791 +D8CF E37D
43.18792 +D8D0 E37E
43.18793 +D8D1 E37F
43.18794 +D8D2 E380
43.18795 +D8D3 E381
43.18796 +D8D4 E382
43.18797 +D8D5 E383
43.18798 +D8D6 E384
43.18799 +D8D7 E385
43.18800 +D8D8 E386
43.18801 +D8D9 E387
43.18802 +D8DA E388
43.18803 +D8DB E389
43.18804 +D8DC E38A
43.18805 +D8DD E38B
43.18806 +D8DE E38C
43.18807 +D8DF E38D
43.18808 +D8E0 E38E
43.18809 +D8E1 E38F
43.18810 +D8E2 E390
43.18811 +D8E3 E391
43.18812 +D8E4 E392
43.18813 +D8E5 E393
43.18814 +D8E6 E394
43.18815 +D8E7 E395
43.18816 +D8E8 E396
43.18817 +D8E9 E397
43.18818 +D8EA E398
43.18819 +D8EB E399
43.18820 +D8EC E39A
43.18821 +D8ED E39B
43.18822 +D8EE E39C
43.18823 +D8EF E39D
43.18824 +D8F0 E39E
43.18825 +D8F1 E39F
43.18826 +D8F2 E3A0
43.18827 +D8F3 E3A1
43.18828 +D8F4 E3A2
43.18829 +D8F5 E3A3
43.18830 +D8F6 E3A4
43.18831 +D8F7 E3A5
43.18832 +D8F8 E3A6
43.18833 +D8F9 E3A7
43.18834 +D8FA E3A8
43.18835 +D8FB E3A9
43.18836 +D8FC E3AA
43.18837 +D8FD E3AB
43.18838 +D941 E3AC
43.18839 +D942 E3AD
43.18840 +D943 E3AE
43.18841 +D944 E3AF
43.18842 +D945 E3B0
43.18843 +D946 E3B1
43.18844 +D947 E3B2
43.18845 +D948 E3B3
43.18846 +D949 E3B4
43.18847 +D94A E3B5
43.18848 +D94B E3B6
43.18849 +D94C E3B7
43.18850 +D94D E3B8
43.18851 +D94E E3B9
43.18852 +D94F E3BA
43.18853 +D950 E3BB
43.18854 +D951 E3BC
43.18855 +D952 E3BD
43.18856 +D953 E3BE
43.18857 +D954 E3BF
43.18858 +D955 E3C0
43.18859 +D956 E3C1
43.18860 +D957 E3C2
43.18861 +D958 E3C3
43.18862 +D959 E3C4
43.18863 +D95A E3C5
43.18864 +D95B E3C6
43.18865 +D95C E3C7
43.18866 +D95D E3C8
43.18867 +D95E E3C9
43.18868 +D95F E3CA
43.18869 +D960 E3CB
43.18870 +D961 E3CC
43.18871 +D962 E3CD
43.18872 +D963 E3CE
43.18873 +D964 E3CF
43.18874 +D965 E3D0
43.18875 +D966 E3D1
43.18876 +D967 E3D2
43.18877 +D968 E3D3
43.18878 +D969 E3D4
43.18879 +D96A E3D5
43.18880 +D96B E3D6
43.18881 +D96C E3D7
43.18882 +D96D E3D8
43.18883 +D96E E3D9
43.18884 +D96F E3DA
43.18885 +D970 E3DB
43.18886 +D971 E3DC
43.18887 +D972 E3DD
43.18888 +D973 E3DE
43.18889 +D974 E3DF
43.18890 +D975 E3E0
43.18891 +D976 E3E1
43.18892 +D977 E3E2
43.18893 +D978 E3E3
43.18894 +D979 E3E4
43.18895 +D97A E3E5
43.18896 +D97B E3E6
43.18897 +D97C E3E7
43.18898 +D97D E3E8
43.18899 +D97E E3E9
43.18900 +D97F E3EA
43.18901 +D981 E3EB
43.18902 +D982 E3EC
43.18903 +D983 E3ED
43.18904 +D984 E3EE
43.18905 +D985 E3EF
43.18906 +D986 E3F0
43.18907 +D987 E3F1
43.18908 +D988 E3F2
43.18909 +D989 E3F3
43.18910 +D98A E3F4
43.18911 +D98B E3F5
43.18912 +D98C E3F6
43.18913 +D98D E3F7
43.18914 +D98E E3F8
43.18915 +D98F E3F9
43.18916 +D990 E3FA
43.18917 +D991 E3FB
43.18918 +D992 E3FC
43.18919 +D993 E3FD
43.18920 +D994 E3FE
43.18921 +D995 E3FF
43.18922 +D996 E400
43.18923 +D997 E401
43.18924 +D998 E402
43.18925 +D999 E403
43.18926 +D99A E404
43.18927 +D99B E405
43.18928 +D99C E406
43.18929 +D99D E407
43.18930 +D99E E408
43.18931 +D99F E409
43.18932 +D9A0 E40A
43.18933 +D9A1 E40B
43.18934 +D9A2 E40C
43.18935 +D9A3 E40D
43.18936 +D9A4 E40E
43.18937 +D9A5 E40F
43.18938 +D9A6 E410
43.18939 +D9A7 E411
43.18940 +D9A8 E412
43.18941 +D9A9 E413
43.18942 +D9AA E414
43.18943 +D9AB E415
43.18944 +D9AC E416
43.18945 +D9AD E417
43.18946 +D9AE E418
43.18947 +D9AF E419
43.18948 +D9B0 E41A
43.18949 +D9B1 E41B
43.18950 +D9B2 E41C
43.18951 +D9B3 E41D
43.18952 +D9B4 E41E
43.18953 +D9B5 E41F
43.18954 +D9B6 E420
43.18955 +D9B7 E421
43.18956 +D9B8 E422
43.18957 +D9B9 E423
43.18958 +D9BA E424
43.18959 +D9BB E425
43.18960 +D9BC E426
43.18961 +D9BD E427
43.18962 +D9BE E428
43.18963 +D9BF E429
43.18964 +D9C0 E42A
43.18965 +D9C1 E42B
43.18966 +D9C2 E42C
43.18967 +D9C3 E42D
43.18968 +D9C4 E42E
43.18969 +D9C5 E42F
43.18970 +D9C6 E430
43.18971 +D9C7 E431
43.18972 +D9C8 E432
43.18973 +D9C9 E433
43.18974 +D9CA E434
43.18975 +D9CB E435
43.18976 +D9CC E436
43.18977 +D9CD E437
43.18978 +D9CE E438
43.18979 +D9CF E439
43.18980 +D9D0 E43A
43.18981 +D9D1 E43B
43.18982 +D9D2 E43C
43.18983 +D9D3 E43D
43.18984 +D9D4 E43E
43.18985 +D9D5 E43F
43.18986 +D9D6 E440
43.18987 +D9D7 E441
43.18988 +D9D8 E442
43.18989 +D9D9 E443
43.18990 +D9DA E444
43.18991 +D9DB E445
43.18992 +D9DC E446
43.18993 +D9DD E447
43.18994 +D9DE E448
43.18995 +D9DF E449
43.18996 +D9E0 E44A
43.18997 +D9E1 E44B
43.18998 +D9E2 E44C
43.18999 +D9E3 E44D
43.19000 +D9E4 E44E
43.19001 +D9E5 E44F
43.19002 +D9E6 E450
43.19003 +D9E7 E451
43.19004 +D9E8 E452
43.19005 +D9E9 E453
43.19006 +D9EA E454
43.19007 +D9EB E455
43.19008 +D9EC E456
43.19009 +D9ED E457
43.19010 +D9EE E458
43.19011 +D9EF E459
43.19012 +D9F0 E45A
43.19013 +D9F1 E45B
43.19014 +D9F2 E45C
43.19015 +D9F3 E45D
43.19016 +D9F4 E45E
43.19017 +D9F5 E45F
43.19018 +D9F6 E460
43.19019 +D9F7 E461
43.19020 +D9F8 E462
43.19021 +D9F9 E463
43.19022 +D9FA E464
43.19023 +D9FB E465
43.19024 +D9FC E466
43.19025 +D9FD E467
43.19026 +DA41 E468
43.19027 +DA42 E469
43.19028 +DA43 E46A
43.19029 +DA44 E46B
43.19030 +DA45 E46C
43.19031 +DA46 E46D
43.19032 +DA47 E46E
43.19033 +DA48 E46F
43.19034 +DA49 E470
43.19035 +DA4A E471
43.19036 +DA4B E472
43.19037 +DA4C E473
43.19038 +DA4D E474
43.19039 +DA4E E475
43.19040 +DA4F E476
43.19041 +DA50 E477
43.19042 +DA51 E478
43.19043 +DA52 E479
43.19044 +DA53 E47A
43.19045 +DA54 E47B
43.19046 +DA55 E47C
43.19047 +DA56 E47D
43.19048 +DA57 E47E
43.19049 +DA58 E47F
43.19050 +DA59 E480
43.19051 +DA5A E481
43.19052 +DA5B E482
43.19053 +DA5C E483
43.19054 +DA5D E484
43.19055 +DA5E E485
43.19056 +DA5F E486
43.19057 +DA60 E487
43.19058 +DA61 E488
43.19059 +DA62 E489
43.19060 +DA63 E48A
43.19061 +DA64 E48B
43.19062 +DA65 E48C
43.19063 +DA66 E48D
43.19064 +DA67 E48E
43.19065 +DA68 E48F
43.19066 +DA69 E490
43.19067 +DA6A E491
43.19068 +DA6B E492
43.19069 +DA6C E493
43.19070 +DA6D E494
43.19071 +DA6E E495
43.19072 +DA6F E496
43.19073 +DA70 E497
43.19074 +DA71 E498
43.19075 +DA72 E499
43.19076 +DA73 E49A
43.19077 +DA74 E49B
43.19078 +DA75 E49C
43.19079 +DA76 E49D
43.19080 +DA77 E49E
43.19081 +DA78 E49F
43.19082 +DA79 E4A0
43.19083 +DA7A E4A1
43.19084 +DA7B E4A2
43.19085 +DA7C E4A3
43.19086 +DA7D E4A4
43.19087 +DA7E E4A5
43.19088 +DA7F E4A6
43.19089 +DA81 E4A7
43.19090 +DA82 E4A8
43.19091 +DA83 E4A9
43.19092 +DA84 E4AA
43.19093 +DA85 E4AB
43.19094 +DA86 E4AC
43.19095 +DA87 E4AD
43.19096 +DA88 E4AE
43.19097 +DA89 E4AF
43.19098 +DA8A E4B0
43.19099 +DA8B E4B1
43.19100 +DA8C E4B2
43.19101 +DA8D E4B3
43.19102 +DA8E E4B4
43.19103 +DA8F E4B5
43.19104 +DA90 E4B6
43.19105 +DA91 E4B7
43.19106 +DA92 E4B8
43.19107 +DA93 E4B9
43.19108 +DA94 E4BA
43.19109 +DA95 E4BB
43.19110 +DA96 E4BC
43.19111 +DA97 E4BD
43.19112 +DA98 E4BE
43.19113 +DA99 E4BF
43.19114 +DA9A E4C0
43.19115 +DA9B E4C1
43.19116 +DA9C E4C2
43.19117 +DA9D E4C3
43.19118 +DA9E E4C4
43.19119 +DA9F E4C5
43.19120 +DAA0 E4C6
43.19121 +DAA1 E4C7
43.19122 +DAA2 E4C8
43.19123 +DAA3 E4C9
43.19124 +DAA4 E4CA
43.19125 +DAA5 E4CB
43.19126 +DAA6 E4CC
43.19127 +DAA7 E4CD
43.19128 +DAA8 E4CE
43.19129 +DAA9 E4CF
43.19130 +DAAA E4D0
43.19131 +DAAB E4D1
43.19132 +DAAC E4D2
43.19133 +DAAD E4D3
43.19134 +DAAE E4D4
43.19135 +DAAF E4D5
43.19136 +DAB0 E4D6
43.19137 +DAB1 E4D7
43.19138 +DAB2 E4D8
43.19139 +DAB3 E4D9
43.19140 +DAB4 E4DA
43.19141 +DAB5 E4DB
43.19142 +DAB6 E4DC
43.19143 +DAB7 E4DD
43.19144 +DAB8 E4DE
43.19145 +DAB9 E4DF
43.19146 +DABA E4E0
43.19147 +DABB E4E1
43.19148 +DABC E4E2
43.19149 +DABD E4E3
43.19150 +DABE E4E4
43.19151 +DABF E4E5
43.19152 +DAC0 E4E6
43.19153 +DAC1 E4E7
43.19154 +DAC2 E4E8
43.19155 +DAC3 E4E9
43.19156 +DAC4 E4EA
43.19157 +DAC5 E4EB
43.19158 +DAC6 E4EC
43.19159 +DAC7 E4ED
43.19160 +DAC8 E4EE
43.19161 +DAC9 E4EF
43.19162 +DACA E4F0
43.19163 +DACB E4F1
43.19164 +DACC E4F2
43.19165 +DACD E4F3
43.19166 +DACE E4F4
43.19167 +DACF E4F5
43.19168 +DAD0 E4F6
43.19169 +DAD1 E4F7
43.19170 +DAD2 E4F8
43.19171 +DAD3 E4F9
43.19172 +DAD4 E4FA
43.19173 +DAD5 E4FB
43.19174 +DAD6 E4FC
43.19175 +DAD7 E4FD
43.19176 +DAD8 E4FE
43.19177 +DAD9 E4FF
43.19178 +DADA E500
43.19179 +DADB E501
43.19180 +DADC E502
43.19181 +DADD E503
43.19182 +DADE E504
43.19183 +DADF E505
43.19184 +DAE0 E506
43.19185 +DAE1 E507
43.19186 +DAE2 E508
43.19187 +DAE3 E509
43.19188 +DAE4 E50A
43.19189 +DAE5 E50B
43.19190 +DAE6 E50C
43.19191 +DAE7 E50D
43.19192 +DAE8 E50E
43.19193 +DAE9 E50F
43.19194 +DAEA E510
43.19195 +DAEB E511
43.19196 +DAEC E512
43.19197 +DAED E513
43.19198 +DAEE E514
43.19199 +DAEF E515
43.19200 +DAF0 E516
43.19201 +DAF1 E517
43.19202 +DAF2 E518
43.19203 +DAF3 E519
43.19204 +DAF4 E51A
43.19205 +DAF5 E51B
43.19206 +DAF6 E51C
43.19207 +DAF7 E51D
43.19208 +DAF8 E51E
43.19209 +DAF9 E51F
43.19210 +DAFA E520
43.19211 +DAFB E521
43.19212 +DAFC E522
43.19213 +DAFD E523
43.19214 +DB41 E524
43.19215 +DB42 E525
43.19216 +DB43 E526
43.19217 +DB44 E527
43.19218 +DB45 E528
43.19219 +DB46 E529
43.19220 +DB47 E52A
43.19221 +DB48 E52B
43.19222 +DB49 E52C
43.19223 +DB4A E52D
43.19224 +DB4B E52E
43.19225 +DB4C E52F
43.19226 +DB4D E530
43.19227 +DB4E E531
43.19228 +DB4F E532
43.19229 +DB50 E533
43.19230 +DB51 E534
43.19231 +DB52 E535
43.19232 +DB53 E536
43.19233 +DB54 E537
43.19234 +DB55 E538
43.19235 +DB56 E539
43.19236 +DB57 E53A
43.19237 +DB58 E53B
43.19238 +DB59 E53C
43.19239 +DB5A E53D
43.19240 +DB5B E53E
43.19241 +DB5C E53F
43.19242 +DB5D E540
43.19243 +DB5E E541
43.19244 +DB5F E542
43.19245 +DB60 E543
43.19246 +DB61 E544
43.19247 +DB62 E545
43.19248 +DB63 E546
43.19249 +DB64 E547
43.19250 +DB65 E548
43.19251 +DB66 E549
43.19252 +DB67 E54A
43.19253 +DB68 E54B
43.19254 +DB69 E54C
43.19255 +DB6A E54D
43.19256 +DB6B E54E
43.19257 +DB6C E54F
43.19258 +DB6D E550
43.19259 +DB6E E551
43.19260 +DB6F E552
43.19261 +DB70 E553
43.19262 +DB71 E554
43.19263 +DB72 E555
43.19264 +DB73 E556
43.19265 +DB74 E557
43.19266 +DB75 E558
43.19267 +DB76 E559
43.19268 +DB77 E55A
43.19269 +DB78 E55B
43.19270 +DB79 E55C
43.19271 +DB7A E55D
43.19272 +DB7B E55E
43.19273 +DB7C E55F
43.19274 +DB7D E560
43.19275 +DB7E E561
43.19276 +DB7F E562
43.19277 +DB81 E563
43.19278 +DB82 E564
43.19279 +DB83 E565
43.19280 +DB84 E566
43.19281 +DB85 E567
43.19282 +DB86 E568
43.19283 +DB87 E569
43.19284 +DB88 E56A
43.19285 +DB89 E56B
43.19286 +DB8A E56C
43.19287 +DB8B E56D
43.19288 +DB8C E56E
43.19289 +DB8D E56F
43.19290 +DB8E E570
43.19291 +DB8F E571
43.19292 +DB90 E572
43.19293 +DB91 E573
43.19294 +DB92 E574
43.19295 +DB93 E575
43.19296 +DB94 E576
43.19297 +DB95 E577
43.19298 +DB96 E578
43.19299 +DB97 E579
43.19300 +DB98 E57A
43.19301 +DB99 E57B
43.19302 +DB9A E57C
43.19303 +DB9B E57D
43.19304 +DB9C E57E
43.19305 +DB9D E57F
43.19306 +DB9E E580
43.19307 +DB9F E581
43.19308 +DBA0 E582
43.19309 +DBA1 E583
43.19310 +DBA2 E584
43.19311 +DBA3 E585
43.19312 +DBA4 E586
43.19313 +DBA5 E587
43.19314 +DBA6 E588
43.19315 +DBA7 E589
43.19316 +DBA8 E58A
43.19317 +DBA9 E58B
43.19318 +DBAA E58C
43.19319 +DBAB E58D
43.19320 +DBAC E58E
43.19321 +DBAD E58F
43.19322 +DBAE E590
43.19323 +DBAF E591
43.19324 +DBB0 E592
43.19325 +DBB1 E593
43.19326 +DBB2 E594
43.19327 +DBB3 E595
43.19328 +DBB4 E596
43.19329 +DBB5 E597
43.19330 +DBB6 E598
43.19331 +DBB7 E599
43.19332 +DBB8 E59A
43.19333 +DBB9 E59B
43.19334 +DBBA E59C
43.19335 +DBBB E59D
43.19336 +DBBC E59E
43.19337 +DBBD E59F
43.19338 +DBBE E5A0
43.19339 +DBBF E5A1
43.19340 +DBC0 E5A2
43.19341 +DBC1 E5A3
43.19342 +DBC2 E5A4
43.19343 +DBC3 E5A5
43.19344 +DBC4 E5A6
43.19345 +DBC5 E5A7
43.19346 +DBC6 E5A8
43.19347 +DBC7 E5A9
43.19348 +DBC8 E5AA
43.19349 +DBC9 E5AB
43.19350 +DBCA E5AC
43.19351 +DBCB E5AD
43.19352 +DBCC E5AE
43.19353 +DBCD E5AF
43.19354 +DBCE E5B0
43.19355 +DBCF E5B1
43.19356 +DBD0 E5B2
43.19357 +DBD1 E5B3
43.19358 +DBD2 E5B4
43.19359 +DBD3 E5B5
43.19360 +DBD4 E5B6
43.19361 +DBD5 E5B7
43.19362 +DBD6 E5B8
43.19363 +DBD7 E5B9
43.19364 +DBD8 E5BA
43.19365 +DBD9 E5BB
43.19366 +DBDA E5BC
43.19367 +DBDB E5BD
43.19368 +DBDC E5BE
43.19369 +DBDD E5BF
43.19370 +DBDE E5C0
43.19371 +DBDF E5C1
43.19372 +DBE0 E5C2
43.19373 +DBE1 E5C3
43.19374 +DBE2 E5C4
43.19375 +DBE3 E5C5
43.19376 +DBE4 E5C6
43.19377 +DBE5 E5C7
43.19378 +DBE6 E5C8
43.19379 +DBE7 E5C9
43.19380 +DBE8 E5CA
43.19381 +DBE9 E5CB
43.19382 +DBEA E5CC
43.19383 +DBEB E5CD
43.19384 +DBEC E5CE
43.19385 +DBED E5CF
43.19386 +DBEE E5D0
43.19387 +DBEF E5D1
43.19388 +DBF0 E5D2
43.19389 +DBF1 E5D3
43.19390 +DBF2 E5D4
43.19391 +DBF3 E5D5
43.19392 +DBF4 E5D6
43.19393 +DBF5 E5D7
43.19394 +DBF6 E5D8
43.19395 +DBF7 E5D9
43.19396 +DBF8 E5DA
43.19397 +DBF9 E5DB
43.19398 +DBFA E5DC
43.19399 +DBFB E5DD
43.19400 +DBFC E5DE
43.19401 +DBFD E5DF
43.19402 +DC41 E5E0
43.19403 +DC42 E5E1
43.19404 +DC43 E5E2
43.19405 +DC44 E5E3
43.19406 +DC45 E5E4
43.19407 +DC46 E5E5
43.19408 +DC47 E5E6
43.19409 +DC48 E5E7
43.19410 +DC49 E5E8
43.19411 +DC4A E5E9
43.19412 +DC4B E5EA
43.19413 +DC4C E5EB
43.19414 +DC4D E5EC
43.19415 +DC4E E5ED
43.19416 +DC4F E5EE
43.19417 +DC50 E5EF
43.19418 +DC51 E5F0
43.19419 +DC52 E5F1
43.19420 +DC53 E5F2
43.19421 +DC54 E5F3
43.19422 +DC55 E5F4
43.19423 +DC56 E5F5
43.19424 +DC57 E5F6
43.19425 +DC58 E5F7
43.19426 +DC59 E5F8
43.19427 +DC5A E5F9
43.19428 +DC5B E5FA
43.19429 +DC5C E5FB
43.19430 +DC5D E5FC
43.19431 +DC5E E5FD
43.19432 +DC5F E5FE
43.19433 +DC60 E5FF
43.19434 +DC61 E600
43.19435 +DC62 E601
43.19436 +DC63 E602
43.19437 +DC64 E603
43.19438 +DC65 E604
43.19439 +DC66 E605
43.19440 +DC67 E606
43.19441 +DC68 E607
43.19442 +DC69 E608
43.19443 +DC6A E609
43.19444 +DC6B E60A
43.19445 +DC6C E60B
43.19446 +DC6D E60C
43.19447 +DC6E E60D
43.19448 +DC6F E60E
43.19449 +DC70 E60F
43.19450 +DC71 E610
43.19451 +DC72 E611
43.19452 +DC73 E612
43.19453 +DC74 E613
43.19454 +DC75 E614
43.19455 +DC76 E615
43.19456 +DC77 E616
43.19457 +DC78 E617
43.19458 +DC79 E618
43.19459 +DC7A E619
43.19460 +DC7B E61A
43.19461 +DC7C E61B
43.19462 +DC7D E61C
43.19463 +DC7E E61D
43.19464 +DC7F E61E
43.19465 +DC81 E61F
43.19466 +DC82 E620
43.19467 +DC83 E621
43.19468 +DC84 E622
43.19469 +DC85 E623
43.19470 +DC86 E624
43.19471 +DC87 E625
43.19472 +DC88 E626
43.19473 +DC89 E627
43.19474 +DC8A E628
43.19475 +DC8B E629
43.19476 +DC8C E62A
43.19477 +DC8D E62B
43.19478 +DC8E E62C
43.19479 +DC8F E62D
43.19480 +DC90 E62E
43.19481 +DC91 E62F
43.19482 +DC92 E630
43.19483 +DC93 E631
43.19484 +DC94 E632
43.19485 +DC95 E633
43.19486 +DC96 E634
43.19487 +DC97 E635
43.19488 +DC98 E636
43.19489 +DC99 E637
43.19490 +DC9A E638
43.19491 +DC9B E639
43.19492 +DC9C E63A
43.19493 +DC9D E63B
43.19494 +DC9E E63C
43.19495 +DC9F E63D
43.19496 +DCA0 E63E
43.19497 +DCA1 E63F
43.19498 +DCA2 E640
43.19499 +DCA3 E641
43.19500 +DCA4 E642
43.19501 +DCA5 E643
43.19502 +DCA6 E644
43.19503 +DCA7 E645
43.19504 +DCA8 E646
43.19505 +DCA9 E647
43.19506 +DCAA E648
43.19507 +DCAB E649
43.19508 +DCAC E64A
43.19509 +DCAD E64B
43.19510 +DCAE E64C
43.19511 +DCAF E64D
43.19512 +DCB0 E64E
43.19513 +DCB1 E64F
43.19514 +DCB2 E650
43.19515 +DCB3 E651
43.19516 +DCB4 E652
43.19517 +DCB5 E653
43.19518 +DCB6 E654
43.19519 +DCB7 E655
43.19520 +DCB8 E656
43.19521 +DCB9 E657
43.19522 +DCBA E658
43.19523 +DCBB E659
43.19524 +DCBC E65A
43.19525 +DCBD E65B
43.19526 +DCBE E65C
43.19527 +DCBF E65D
43.19528 +DCC0 E65E
43.19529 +DCC1 E65F
43.19530 +DCC2 E660
43.19531 +DCC3 E661
43.19532 +DCC4 E662
43.19533 +DCC5 E663
43.19534 +DCC6 E664
43.19535 +DCC7 E665
43.19536 +DCC8 E666
43.19537 +DCC9 E667
43.19538 +DCCA E668
43.19539 +DCCB E669
43.19540 +DCCC E66A
43.19541 +DCCD E66B
43.19542 +DCCE E66C
43.19543 +DCCF E66D
43.19544 +DCD0 E66E
43.19545 +DCD1 E66F
43.19546 +DCD2 E670
43.19547 +DCD3 E671
43.19548 +DCD4 E672
43.19549 +DCD5 E673
43.19550 +DCD6 E674
43.19551 +DCD7 E675
43.19552 +DCD8 E676
43.19553 +DCD9 E677
43.19554 +DCDA E678
43.19555 +DCDB E679
43.19556 +DCDC E67A
43.19557 +DCDD E67B
43.19558 +DCDE E67C
43.19559 +DCDF E67D
43.19560 +DCE0 E67E
43.19561 +DCE1 E67F
43.19562 +DCE2 E680
43.19563 +DCE3 E681
43.19564 +DCE4 E682
43.19565 +DCE5 E683
43.19566 +DCE6 E684
43.19567 +DCE7 E685
43.19568 +DCE8 E686
43.19569 +DCE9 E687
43.19570 +DCEA E688
43.19571 +DCEB E689
43.19572 +DCEC E68A
43.19573 +DCED E68B
43.19574 +DCEE E68C
43.19575 +DCEF E68D
43.19576 +DCF0 E68E
43.19577 +DCF1 E68F
43.19578 +DCF2 E690
43.19579 +DCF3 E691
43.19580 +DCF4 E692
43.19581 +DCF5 E693
43.19582 +DCF6 E694
43.19583 +DCF7 E695
43.19584 +DCF8 E696
43.19585 +DCF9 E697
43.19586 +DCFA E698
43.19587 +DCFB E699
43.19588 +DCFC E69A
43.19589 +DCFD E69B
43.19590 +DD41 E69C
43.19591 +DD42 E69D
43.19592 +DD43 E69E
43.19593 +DD44 E69F
43.19594 +DD45 E6A0
43.19595 +DD46 E6A1
43.19596 +DD47 E6A2
43.19597 +DD48 E6A3
43.19598 +DD49 E6A4
43.19599 +DD4A E6A5
43.19600 +DD4B E6A6
43.19601 +DD4C E6A7
43.19602 +DD4D E6A8
43.19603 +DD4E E6A9
43.19604 +DD4F E6AA
43.19605 +DD50 E6AB
43.19606 +DD51 E6AC
43.19607 +DD52 E6AD
43.19608 +DD53 E6AE
43.19609 +DD54 E6AF
43.19610 +DD55 E6B0
43.19611 +DD56 E6B1
43.19612 +DD57 E6B2
43.19613 +DD58 E6B3
43.19614 +DD59 E6B4
43.19615 +DD5A E6B5
43.19616 +DD5B E6B6
43.19617 +DD5C E6B7
43.19618 +DD5D E6B8
43.19619 +DD5E E6B9
43.19620 +DD5F E6BA
43.19621 +DD60 E6BB
43.19622 +DD61 E6BC
43.19623 +DD62 E6BD
43.19624 +DD63 E6BE
43.19625 +DD64 E6BF
43.19626 +DD65 E6C0
43.19627 +DD66 E6C1
43.19628 +DD67 E6C2
43.19629 +DD68 E6C3
43.19630 +DD69 E6C4
43.19631 +DD6A E6C5
43.19632 +DD6B E6C6
43.19633 +DD6C E6C7
43.19634 +DD6D E6C8
43.19635 +DD6E E6C9
43.19636 +DD6F E6CA
43.19637 +DD70 E6CB
43.19638 +DD71 E6CC
43.19639 +DD72 E6CD
43.19640 +DD73 E6CE
43.19641 +DD74 E6CF
43.19642 +DD75 E6D0
43.19643 +DD76 E6D1
43.19644 +DD77 E6D2
43.19645 +DD78 E6D3
43.19646 +DD79 E6D4
43.19647 +DD7A E6D5
43.19648 +DD7B E6D6
43.19649 +DD7C E6D7
43.19650 +DD7D E6D8
43.19651 +DD7E E6D9
43.19652 +DD7F E6DA
43.19653 +DD81 E6DB
43.19654 +DD82 E6DC
43.19655 +DD83 E6DD
43.19656 +DD84 E6DE
43.19657 +DD85 E6DF
43.19658 +DD86 E6E0
43.19659 +DD87 E6E1
43.19660 +DD88 E6E2
43.19661 +DD89 E6E3
43.19662 +DD8A E6E4
43.19663 +DD8B E6E5
43.19664 +DD8C E6E6
43.19665 +DD8D E6E7
43.19666 +DD8E E6E8
43.19667 +DD8F E6E9
43.19668 +DD90 E6EA
43.19669 +DD91 E6EB
43.19670 +DD92 E6EC
43.19671 +DD93 E6ED
43.19672 +DD94 E6EE
43.19673 +DD95 E6EF
43.19674 +DD96 E6F0
43.19675 +DD97 E6F1
43.19676 +DD98 E6F2
43.19677 +DD99 E6F3
43.19678 +DD9A E6F4
43.19679 +DD9B E6F5
43.19680 +DD9C E6F6
43.19681 +DD9D E6F7
43.19682 +DD9E E6F8
43.19683 +DD9F E6F9
43.19684 +DDA0 E6FA
43.19685 +DDA1 E6FB
43.19686 +DDA2 E6FC
43.19687 +DDA3 E6FD
43.19688 +DDA4 E6FE
43.19689 +DDA5 E6FF
43.19690 +DDA6 E700
43.19691 +DDA7 E701
43.19692 +DDA8 E702
43.19693 +DDA9 E703
43.19694 +DDAA E704
43.19695 +DDAB E705
43.19696 +DDAC E706
43.19697 +DDAD E707
43.19698 +DDAE E708
43.19699 +DDAF E709
43.19700 +DDB0 E70A
43.19701 +DDB1 E70B
43.19702 +DDB2 E70C
43.19703 +DDB3 E70D
43.19704 +DDB4 E70E
43.19705 +DDB5 E70F
43.19706 +DDB6 E710
43.19707 +DDB7 E711
43.19708 +DDB8 E712
43.19709 +DDB9 E713
43.19710 +DDBA E714
43.19711 +DDBB E715
43.19712 +DDBC E716
43.19713 +DDBD E717
43.19714 +DDBE E718
43.19715 +DDBF E719
43.19716 +DDC0 E71A
43.19717 +DDC1 E71B
43.19718 +DDC2 E71C
43.19719 +DDC3 E71D
43.19720 +DDC4 E71E
43.19721 +DDC5 E71F
43.19722 +DDC6 E720
43.19723 +DDC7 E721
43.19724 +DDC8 E722
43.19725 +DDC9 E723
43.19726 +DDCA E724
43.19727 +DDCB E725
43.19728 +DDCC E726
43.19729 +DDCD E727
43.19730 +DDCE E728
43.19731 +DDCF E729
43.19732 +DDD0 E72A
43.19733 +DDD1 E72B
43.19734 +DDD2 E72C
43.19735 +DDD3 E72D
43.19736 +DDD4 E72E
43.19737 +DDD5 E72F
43.19738 +DDD6 E730
43.19739 +DDD7 E731
43.19740 +DDD8 E732
43.19741 +DDD9 E733
43.19742 +DDDA E734
43.19743 +DDDB E735
43.19744 +DDDC E736
43.19745 +DDDD E737
43.19746 +DDDE E738
43.19747 +DDDF E739
43.19748 +DDE0 E73A
43.19749 +DDE1 E73B
43.19750 +DDE2 E73C
43.19751 +DDE3 E73D
43.19752 +DDE4 E73E
43.19753 +DDE5 E73F
43.19754 +DDE6 E740
43.19755 +DDE7 E741
43.19756 +DDE8 E742
43.19757 +DDE9 E743
43.19758 +DDEA E744
43.19759 +DDEB E745
43.19760 +DDEC E746
43.19761 +DDED E747
43.19762 +DDEE E748
43.19763 +DDEF E749
43.19764 +DDF0 E74A
43.19765 +DDF1 E74B
43.19766 +DDF2 E74C
43.19767 +DDF3 E74D
43.19768 +DDF4 E74E
43.19769 +DDF5 E74F
43.19770 +DDF6 E750
43.19771 +DDF7 E751
43.19772 +DDF8 E752
43.19773 +DDF9 E753
43.19774 +DDFA E754
43.19775 +DDFB E755
43.19776 +DDFC E756
43.19777 +DDFD E757
44.1 --- a/make/tools/CharsetMapping/dbcs Tue Mar 29 11:29:01 2011 -0700
44.2 +++ b/make/tools/CharsetMapping/dbcs Tue Mar 29 20:19:55 2011 -0700
44.3 @@ -10,6 +10,7 @@
44.4 MS949 x-windows-949 MS949 basic sun.nio.cs.ext true 0x81 0xfe 0x41 0xfe
44.5 MS950 x-windows-950 MS950 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
44.6 GBK GBK GBK basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
44.7 +IBM1364 x-IBM1364 Cp1364 ebcdic sun.nio.cs.ext false 0x40 0xde 0x40 0xfe
44.8 IBM1381 x-IBM1381 Cp1381 basic sun.nio.cs.ext true 0x8c 0xf7 0xa1 0xfe
44.9 IBM1383 x-IBM1383 Cp1383 euc_sim sun.nio.cs.ext true 0xa1 0xfe 0xa1 0xfe
44.10 IBM930 x-IBM930 Cp930 ebcdic sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
45.1 --- a/make/tools/Makefile Tue Mar 29 11:29:01 2011 -0700
45.2 +++ b/make/tools/Makefile Tue Mar 29 20:19:55 2011 -0700
45.3 @@ -1,5 +1,5 @@
45.4 #
45.5 -# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
45.6 +# Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
45.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
45.8 #
45.9 # This code is free software; you can redistribute it and/or modify it
45.10 @@ -30,6 +30,7 @@
45.11 BUILDDIR = ..
45.12 include $(BUILDDIR)/common/Defs.gmk
45.13
45.14 +# Note: freetypecheck is built by Sanity.gmk if needed
45.15 SUBDIRS = \
45.16 addjsum \
45.17 buildmetaindex \
45.18 @@ -38,7 +39,6 @@
45.19 compile_properties \
45.20 dir_diff \
45.21 dtdbuilder \
45.22 - freetypecheck \
45.23 generate_break_iterator \
45.24 GenerateCharacter \
45.25 generatecurrencydata \
46.1 --- a/src/share/bin/java.c Tue Mar 29 11:29:01 2011 -0700
46.2 +++ b/src/share/bin/java.c Tue Mar 29 20:19:55 2011 -0700
46.3 @@ -61,6 +61,9 @@
46.4 * interfaces.
46.5 */
46.6
46.7 +/* we always print to stderr */
46.8 +#define USE_STDERR JNI_TRUE
46.9 +
46.10 static jboolean printVersion = JNI_FALSE; /* print and exit */
46.11 static jboolean showVersion = JNI_FALSE; /* print but continue */
46.12 static jboolean printUsage = JNI_FALSE; /* print and exit*/
46.13 @@ -1136,36 +1139,18 @@
46.14 return; \
46.15 }
46.16
46.17 -static jstring platformEncoding = NULL;
46.18 -static jstring getPlatformEncoding(JNIEnv *env) {
46.19 - if (platformEncoding == NULL) {
46.20 - jstring propname = (*env)->NewStringUTF(env, "sun.jnu.encoding");
46.21 - if (propname) {
46.22 - jclass cls;
46.23 - jmethodID mid;
46.24 - NULL_CHECK0 (cls = FindBootStrapClass(env, "java/lang/System"));
46.25 - NULL_CHECK0 (mid = (*env)->GetStaticMethodID(
46.26 - env, cls,
46.27 - "getProperty",
46.28 - "(Ljava/lang/String;)Ljava/lang/String;"));
46.29 - platformEncoding = (*env)->CallStaticObjectMethod (
46.30 - env, cls, mid, propname);
46.31 - }
46.32 +static jclass helperClass = NULL;
46.33 +
46.34 +static jclass
46.35 +GetLauncherHelperClass(JNIEnv *env) {
46.36 + if (helperClass == NULL) {
46.37 + NULL_CHECK0(helperClass = FindBootStrapClass(env,
46.38 + "sun/launcher/LauncherHelper"));
46.39 }
46.40 - return platformEncoding;
46.41 + return helperClass;
46.42 }
46.43
46.44 -static jboolean isEncodingSupported(JNIEnv *env, jstring enc) {
46.45 - jclass cls;
46.46 - jmethodID mid;
46.47 - NULL_CHECK0 (cls = FindBootStrapClass(env, "java/nio/charset/Charset"));
46.48 - NULL_CHECK0 (mid = (*env)->GetStaticMethodID(
46.49 - env, cls,
46.50 - "isSupported",
46.51 - "(Ljava/lang/String;)Z"));
46.52 - return (*env)->CallStaticBooleanMethod(env, cls, mid, enc);
46.53 -}
46.54 -
46.55 +static jmethodID makePlatformStringMID = NULL;
46.56 /*
46.57 * Returns a new Java string object for the specified platform string.
46.58 */
46.59 @@ -1173,36 +1158,23 @@
46.60 NewPlatformString(JNIEnv *env, char *s)
46.61 {
46.62 int len = (int)JLI_StrLen(s);
46.63 - jclass cls;
46.64 - jmethodID mid;
46.65 jbyteArray ary;
46.66 - jstring enc;
46.67 -
46.68 + jclass cls = GetLauncherHelperClass(env);
46.69 + NULL_CHECK0(cls);
46.70 if (s == NULL)
46.71 return 0;
46.72 - enc = getPlatformEncoding(env);
46.73
46.74 ary = (*env)->NewByteArray(env, len);
46.75 if (ary != 0) {
46.76 jstring str = 0;
46.77 (*env)->SetByteArrayRegion(env, ary, 0, len, (jbyte *)s);
46.78 if (!(*env)->ExceptionOccurred(env)) {
46.79 - NULL_CHECK0(cls = FindBootStrapClass(env, "java/lang/String"));
46.80 - if (isEncodingSupported(env, enc) == JNI_TRUE) {
46.81 - NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "<init>",
46.82 - "([BLjava/lang/String;)V"));
46.83 - str = (*env)->NewObject(env, cls, mid, ary, enc);
46.84 - } else {
46.85 - /*If the encoding specified in sun.jnu.encoding is not
46.86 - endorsed by "Charset.isSupported" we have to fall back
46.87 - to use String(byte[]) explicitly here without specifying
46.88 - the encoding name, in which the StringCoding class will
46.89 - pickup the iso-8859-1 as the fallback converter for us.
46.90 - */
46.91 - NULL_CHECK0(mid = (*env)->GetMethodID(env, cls, "<init>",
46.92 - "([B)V"));
46.93 - str = (*env)->NewObject(env, cls, mid, ary);
46.94 + if (makePlatformStringMID == NULL) {
46.95 + NULL_CHECK0(makePlatformStringMID = (*env)->GetStaticMethodID(env,
46.96 + cls, "makePlatformString", "(Z[B)Ljava/lang/String;"));
46.97 }
46.98 + str = (*env)->CallStaticObjectMethod(env, cls,
46.99 + makePlatformStringMID, USE_STDERR, ary);
46.100 (*env)->DeleteLocalRef(env, ary);
46.101 return str;
46.102 }
46.103 @@ -1239,20 +1211,28 @@
46.104 static jclass
46.105 LoadMainClass(JNIEnv *env, int mode, char *name)
46.106 {
46.107 - jclass cls;
46.108 jmethodID mid;
46.109 jstring str;
46.110 jobject result;
46.111 jlong start, end;
46.112 -
46.113 + jclass cls = GetLauncherHelperClass(env);
46.114 + NULL_CHECK0(cls);
46.115 if (JLI_IsTraceLauncher()) {
46.116 start = CounterGet();
46.117 }
46.118 - NULL_CHECK0(cls = FindBootStrapClass(env, "sun/launcher/LauncherHelper"));
46.119 - NULL_CHECK0(mid = (*env)->GetStaticMethodID(env, cls, "checkAndLoadMain",
46.120 - "(ZILjava/lang/String;)Ljava/lang/Class;"));
46.121 - str = (*env)->NewStringUTF(env, name);
46.122 - result = (*env)->CallStaticObjectMethod(env, cls, mid, JNI_TRUE, mode, str);
46.123 + NULL_CHECK0(mid = (*env)->GetStaticMethodID(env, cls,
46.124 + "checkAndLoadMain",
46.125 + "(ZILjava/lang/String;)Ljava/lang/Class;"));
46.126 +
46.127 + switch (mode) {
46.128 + case LM_CLASS:
46.129 + str = NewPlatformString(env, name);
46.130 + break;
46.131 + default:
46.132 + str = (*env)->NewStringUTF(env, name);
46.133 + break;
46.134 + }
46.135 + result = (*env)->CallStaticObjectMethod(env, cls, mid, USE_STDERR, mode, str);
46.136
46.137 if (JLI_IsTraceLauncher()) {
46.138 end = CounterGet();
46.139 @@ -1478,15 +1458,15 @@
46.140 static void
46.141 ShowSettings(JNIEnv *env, char *optString)
46.142 {
46.143 - jclass cls;
46.144 jmethodID showSettingsID;
46.145 jstring joptString;
46.146 - NULL_CHECK(cls = FindBootStrapClass(env, "sun/launcher/LauncherHelper"));
46.147 + jclass cls = GetLauncherHelperClass(env);
46.148 + NULL_CHECK(cls);
46.149 NULL_CHECK(showSettingsID = (*env)->GetStaticMethodID(env, cls,
46.150 "showSettings", "(ZLjava/lang/String;JJJZ)V"));
46.151 joptString = (*env)->NewStringUTF(env, optString);
46.152 (*env)->CallStaticVoidMethod(env, cls, showSettingsID,
46.153 - JNI_TRUE,
46.154 + USE_STDERR,
46.155 joptString,
46.156 (jlong)initialHeapSize,
46.157 (jlong)maxHeapSize,
46.158 @@ -1500,18 +1480,15 @@
46.159 static void
46.160 PrintUsage(JNIEnv* env, jboolean doXUsage)
46.161 {
46.162 - jclass cls;
46.163 jmethodID initHelp, vmSelect, vmSynonym, vmErgo, printHelp, printXUsageMessage;
46.164 jstring jprogname, vm1, vm2;
46.165 int i;
46.166 -
46.167 - NULL_CHECK(cls = FindBootStrapClass(env, "sun/launcher/LauncherHelper"));
46.168 -
46.169 -
46.170 + jclass cls = GetLauncherHelperClass(env);
46.171 + NULL_CHECK(cls);
46.172 if (doXUsage) {
46.173 NULL_CHECK(printXUsageMessage = (*env)->GetStaticMethodID(env, cls,
46.174 "printXUsageMessage", "(Z)V"));
46.175 - (*env)->CallStaticVoidMethod(env, cls, printXUsageMessage, JNI_TRUE);
46.176 + (*env)->CallStaticVoidMethod(env, cls, printXUsageMessage, USE_STDERR);
46.177 } else {
46.178 NULL_CHECK(initHelp = (*env)->GetStaticMethodID(env, cls,
46.179 "initHelpMessage", "(Ljava/lang/String;)V"));
46.180 @@ -1570,7 +1547,7 @@
46.181 }
46.182
46.183 /* Complete the usage message and print to stderr*/
46.184 - (*env)->CallStaticVoidMethod(env, cls, printHelp, JNI_TRUE);
46.185 + (*env)->CallStaticVoidMethod(env, cls, printHelp, USE_STDERR);
46.186 }
46.187 return;
46.188 }
47.1 --- a/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java Tue Mar 29 11:29:01 2011 -0700
47.2 +++ b/src/share/classes/com/sun/java/util/jar/pack/BandStructure.java Tue Mar 29 20:19:55 2011 -0700
47.3 @@ -743,24 +743,24 @@
47.4
47.5 private void dumpBand() throws IOException {
47.6 assert(optDumpBands);
47.7 - PrintStream ps = new PrintStream(getDumpStream(this, ".txt"));
47.8 - String irr = (bandCoding == regularCoding) ? "" : " irregular";
47.9 - ps.print("# length="+length+
47.10 - " size="+outputSize()+
47.11 - irr+" coding="+bandCoding);
47.12 - if (metaCoding != noMetaCoding) {
47.13 - StringBuffer sb = new StringBuffer();
47.14 - for (int i = 0; i < metaCoding.length; i++) {
47.15 - if (i == 1) sb.append(" /");
47.16 - sb.append(" ").append(metaCoding[i] & 0xFF);
47.17 + try (PrintStream ps = new PrintStream(getDumpStream(this, ".txt"))) {
47.18 + String irr = (bandCoding == regularCoding) ? "" : " irregular";
47.19 + ps.print("# length="+length+
47.20 + " size="+outputSize()+
47.21 + irr+" coding="+bandCoding);
47.22 + if (metaCoding != noMetaCoding) {
47.23 + StringBuffer sb = new StringBuffer();
47.24 + for (int i = 0; i < metaCoding.length; i++) {
47.25 + if (i == 1) sb.append(" /");
47.26 + sb.append(" ").append(metaCoding[i] & 0xFF);
47.27 + }
47.28 + ps.print(" //header: "+sb);
47.29 }
47.30 - ps.print(" //header: "+sb);
47.31 + printArrayTo(ps, values, 0, length);
47.32 }
47.33 - printArrayTo(ps, values, 0, length);
47.34 - ps.close();
47.35 - OutputStream ds = getDumpStream(this, ".bnd");
47.36 - bandCoding.writeArrayTo(ds, values, 0, length);
47.37 - ds.close();
47.38 + try (OutputStream ds = getDumpStream(this, ".bnd")) {
47.39 + bandCoding.writeArrayTo(ds, values, 0, length);
47.40 + }
47.41 }
47.42
47.43 /** Disburse one value. */
47.44 @@ -829,12 +829,12 @@
47.45
47.46 private void dumpBand() throws IOException {
47.47 assert(optDumpBands);
47.48 - OutputStream ds = getDumpStream(this, ".bnd");
47.49 - if (bytesForDump != null)
47.50 - bytesForDump.writeTo(ds);
47.51 - else
47.52 - bytes.writeTo(ds);
47.53 - ds.close();
47.54 + try (OutputStream ds = getDumpStream(this, ".bnd")) {
47.55 + if (bytesForDump != null)
47.56 + bytesForDump.writeTo(ds);
47.57 + else
47.58 + bytes.writeTo(ds);
47.59 + }
47.60 }
47.61
47.62 public void readDataFrom(InputStream in) throws IOException {
48.1 --- a/src/share/classes/com/sun/java/util/jar/pack/Driver.java Tue Mar 29 11:29:01 2011 -0700
48.2 +++ b/src/share/classes/com/sun/java/util/jar/pack/Driver.java Tue Mar 29 20:19:55 2011 -0700
48.3 @@ -150,12 +150,12 @@
48.4 // See if there is any other action to take.
48.5 if ("--config-file=".equals(state)) {
48.6 String propFile = av.remove(0);
48.7 - InputStream propIn = new FileInputStream(propFile);
48.8 Properties fileProps = new Properties();
48.9 - fileProps.load(new BufferedInputStream(propIn));
48.10 + try (InputStream propIn = new FileInputStream(propFile)) {
48.11 + fileProps.load(propIn);
48.12 + }
48.13 if (engProps.get(verboseProp) != null)
48.14 fileProps.list(System.out);
48.15 - propIn.close();
48.16 for (Map.Entry<Object,Object> me : fileProps.entrySet()) {
48.17 engProps.put((String) me.getKey(), (String) me.getValue());
48.18 }
48.19 @@ -348,10 +348,10 @@
48.20 else
48.21 fileOut = new FileOutputStream(outfile);
48.22 fileOut = new BufferedOutputStream(fileOut);
48.23 - JarOutputStream out = new JarOutputStream(fileOut);
48.24 - junpack.unpack(in, out);
48.25 - //in.close(); // p200 closes in but not out
48.26 - out.close();
48.27 + try (JarOutputStream out = new JarOutputStream(fileOut)) {
48.28 + junpack.unpack(in, out);
48.29 + // p200 closes in but not out
48.30 + }
48.31 // At this point, we have a good jarfile (or newfile, if -r)
48.32 }
48.33
48.34 @@ -411,8 +411,7 @@
48.35 long filelen = new File(jarfile).length();
48.36 if (filelen <= 0) return "";
48.37 long skiplen = Math.max(0, filelen - tail.length);
48.38 - InputStream in = new FileInputStream(new File(jarfile));
48.39 - try {
48.40 + try (InputStream in = new FileInputStream(new File(jarfile))) {
48.41 in.skip(skiplen);
48.42 in.read(tail);
48.43 for (int i = tail.length-4; i >= 0; i--) {
48.44 @@ -426,8 +425,6 @@
48.45 }
48.46 }
48.47 return "";
48.48 - } finally {
48.49 - in.close();
48.50 }
48.51 }
48.52
49.1 --- a/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java Tue Mar 29 11:29:01 2011 -0700
49.2 +++ b/src/share/classes/com/sun/java/util/jar/pack/NativeUnpack.java Tue Mar 29 20:19:55 2011 -0700
49.3 @@ -241,9 +241,9 @@
49.4 void run(File inFile, JarOutputStream jstream) throws IOException {
49.5 // %%% maybe memory-map the file, and pass it straight into unpacker
49.6 ByteBuffer mappedFile = null;
49.7 - FileInputStream fis = new FileInputStream(inFile);
49.8 - run(fis, jstream, mappedFile);
49.9 - fis.close();
49.10 + try (FileInputStream fis = new FileInputStream(inFile)) {
49.11 + run(fis, jstream, mappedFile);
49.12 + }
49.13 // Note: caller is responsible to finish with jstream.
49.14 }
49.15
50.1 --- a/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java Tue Mar 29 11:29:01 2011 -0700
50.2 +++ b/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java Tue Mar 29 20:19:55 2011 -0700
50.3 @@ -540,9 +540,9 @@
50.4 Index index = initCPIndex(tag, cpMap);
50.5
50.6 if (optDumpBands) {
50.7 - PrintStream ps = new PrintStream(getDumpStream(index, ".idx"));
50.8 - printArrayTo(ps, index.cpMap, 0, index.cpMap.length);
50.9 - ps.close();
50.10 + try (PrintStream ps = new PrintStream(getDumpStream(index, ".idx"))) {
50.11 + printArrayTo(ps, index.cpMap, 0, index.cpMap.length);
50.12 + }
50.13 }
50.14 }
50.15
50.16 @@ -828,26 +828,27 @@
50.17 attr_definition_headers.readFrom(in);
50.18 attr_definition_name.readFrom(in);
50.19 attr_definition_layout.readFrom(in);
50.20 - PrintStream dump = !optDumpBands ? null
50.21 - : new PrintStream(getDumpStream(attr_definition_headers, ".def"));
50.22 - for (int i = 0; i < numAttrDefs; i++) {
50.23 - int header = attr_definition_headers.getByte();
50.24 - Utf8Entry name = (Utf8Entry) attr_definition_name.getRef();
50.25 - Utf8Entry layout = (Utf8Entry) attr_definition_layout.getRef();
50.26 - int ctype = (header & ADH_CONTEXT_MASK);
50.27 - int index = (header >> ADH_BIT_SHIFT) - ADH_BIT_IS_LSB;
50.28 - Attribute.Layout def = new Attribute.Layout(ctype,
50.29 - name.stringValue(),
50.30 - layout.stringValue());
50.31 - // Check layout string for Java 6 extensions.
50.32 - String pvLayout = def.layoutForPackageMajver(getPackageMajver());
50.33 - if (!pvLayout.equals(def.layout())) {
50.34 - throw new IOException("Bad attribute layout in version 150 archive: "+def.layout());
50.35 + try (PrintStream dump = !optDumpBands ? null
50.36 + : new PrintStream(getDumpStream(attr_definition_headers, ".def")))
50.37 + {
50.38 + for (int i = 0; i < numAttrDefs; i++) {
50.39 + int header = attr_definition_headers.getByte();
50.40 + Utf8Entry name = (Utf8Entry) attr_definition_name.getRef();
50.41 + Utf8Entry layout = (Utf8Entry) attr_definition_layout.getRef();
50.42 + int ctype = (header & ADH_CONTEXT_MASK);
50.43 + int index = (header >> ADH_BIT_SHIFT) - ADH_BIT_IS_LSB;
50.44 + Attribute.Layout def = new Attribute.Layout(ctype,
50.45 + name.stringValue(),
50.46 + layout.stringValue());
50.47 + // Check layout string for Java 6 extensions.
50.48 + String pvLayout = def.layoutForPackageMajver(getPackageMajver());
50.49 + if (!pvLayout.equals(def.layout())) {
50.50 + throw new IOException("Bad attribute layout in version 150 archive: "+def.layout());
50.51 + }
50.52 + this.setAttributeLayoutIndex(def, index);
50.53 + if (dump != null) dump.println(index+" "+def);
50.54 }
50.55 - this.setAttributeLayoutIndex(def, index);
50.56 - if (dump != null) dump.println(index+" "+def);
50.57 }
50.58 - if (dump != null) dump.close();
50.59 attr_definition_headers.doneDisbursing();
50.60 attr_definition_name.doneDisbursing();
50.61 attr_definition_layout.doneDisbursing();
51.1 --- a/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java Tue Mar 29 11:29:01 2011 -0700
51.2 +++ b/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java Tue Mar 29 20:19:55 2011 -0700
51.3 @@ -458,9 +458,9 @@
51.4 Utils.log.info("Writing "+cpMap.length+" "+ConstantPool.tagName(tag)+" entries...");
51.5
51.6 if (optDumpBands) {
51.7 - PrintStream ps = new PrintStream(getDumpStream(index, ".idx"));
51.8 - printArrayTo(ps, cpMap, 0, cpMap.length);
51.9 - ps.close();
51.10 + try (PrintStream ps = new PrintStream(getDumpStream(index, ".idx"))) {
51.11 + printArrayTo(ps, cpMap, 0, cpMap.length);
51.12 + }
51.13 }
51.14
51.15 switch (tag) {
51.16 @@ -923,33 +923,34 @@
51.17 }
51.18 });
51.19 attrDefsWritten = new Attribute.Layout[numAttrDefs];
51.20 - PrintStream dump = !optDumpBands ? null
51.21 - : new PrintStream(getDumpStream(attr_definition_headers, ".def"));
51.22 - int[] indexForDebug = Arrays.copyOf(attrIndexLimit, ATTR_CONTEXT_LIMIT);
51.23 - for (int i = 0; i < defs.length; i++) {
51.24 - int header = ((Integer)defs[i][0]).intValue();
51.25 - Attribute.Layout def = (Attribute.Layout) defs[i][1];
51.26 - attrDefsWritten[i] = def;
51.27 - assert((header & ADH_CONTEXT_MASK) == def.ctype());
51.28 - attr_definition_headers.putByte(header);
51.29 - attr_definition_name.putRef(ConstantPool.getUtf8Entry(def.name()));
51.30 - String layout = def.layoutForPackageMajver(getPackageMajver());
51.31 - attr_definition_layout.putRef(ConstantPool.getUtf8Entry(layout));
51.32 - // Check that we are transmitting that correct attribute index:
51.33 - boolean debug = false;
51.34 - assert(debug = true);
51.35 - if (debug) {
51.36 - int hdrIndex = (header >> ADH_BIT_SHIFT) - ADH_BIT_IS_LSB;
51.37 - if (hdrIndex < 0) hdrIndex = indexForDebug[def.ctype()]++;
51.38 - int realIndex = (attrIndexTable.get(def)).intValue();
51.39 - assert(hdrIndex == realIndex);
51.40 - }
51.41 - if (dump != null) {
51.42 - int index = (header >> ADH_BIT_SHIFT) - ADH_BIT_IS_LSB;
51.43 - dump.println(index+" "+def);
51.44 + try (PrintStream dump = !optDumpBands ? null
51.45 + : new PrintStream(getDumpStream(attr_definition_headers, ".def")))
51.46 + {
51.47 + int[] indexForDebug = Arrays.copyOf(attrIndexLimit, ATTR_CONTEXT_LIMIT);
51.48 + for (int i = 0; i < defs.length; i++) {
51.49 + int header = ((Integer)defs[i][0]).intValue();
51.50 + Attribute.Layout def = (Attribute.Layout) defs[i][1];
51.51 + attrDefsWritten[i] = def;
51.52 + assert((header & ADH_CONTEXT_MASK) == def.ctype());
51.53 + attr_definition_headers.putByte(header);
51.54 + attr_definition_name.putRef(ConstantPool.getUtf8Entry(def.name()));
51.55 + String layout = def.layoutForPackageMajver(getPackageMajver());
51.56 + attr_definition_layout.putRef(ConstantPool.getUtf8Entry(layout));
51.57 + // Check that we are transmitting that correct attribute index:
51.58 + boolean debug = false;
51.59 + assert(debug = true);
51.60 + if (debug) {
51.61 + int hdrIndex = (header >> ADH_BIT_SHIFT) - ADH_BIT_IS_LSB;
51.62 + if (hdrIndex < 0) hdrIndex = indexForDebug[def.ctype()]++;
51.63 + int realIndex = (attrIndexTable.get(def)).intValue();
51.64 + assert(hdrIndex == realIndex);
51.65 + }
51.66 + if (dump != null) {
51.67 + int index = (header >> ADH_BIT_SHIFT) - ADH_BIT_IS_LSB;
51.68 + dump.println(index+" "+def);
51.69 + }
51.70 }
51.71 }
51.72 - if (dump != null) dump.close();
51.73 }
51.74
51.75 void writeAttrCounts() throws IOException {
52.1 --- a/src/share/classes/com/sun/java/util/jar/pack/PropMap.java Tue Mar 29 11:29:01 2011 -0700
52.2 +++ b/src/share/classes/com/sun/java/util/jar/pack/PropMap.java Tue Mar 29 20:19:55 2011 -0700
52.3 @@ -122,26 +122,23 @@
52.4 // Define certain attribute layouts by default.
52.5 // Do this after the previous props are put in place,
52.6 // to allow override if necessary.
52.7 - InputStream propStr = null;
52.8 - try {
52.9 - String propFile = "intrinsic.properties";
52.10 - propStr = PackerImpl.class.getResourceAsStream(propFile);
52.11 - props.load(new BufferedInputStream(propStr));
52.12 - for (Map.Entry<Object, Object> e : props.entrySet()) {
52.13 - String key = (String) e.getKey();
52.14 - String val = (String) e.getValue();
52.15 - if (key.startsWith("attribute.")) {
52.16 - e.setValue(Attribute.normalizeLayoutString(val));
52.17 - }
52.18 + String propFile = "intrinsic.properties";
52.19 +
52.20 + try (InputStream propStr = PackerImpl.class.getResourceAsStream(propFile)) {
52.21 + if (propStr == null) {
52.22 + throw new RuntimeException(propFile + " cannot be loaded");
52.23 }
52.24 + props.load(propStr);
52.25 } catch (IOException ee) {
52.26 throw new RuntimeException(ee);
52.27 - } finally {
52.28 - try {
52.29 - if (propStr != null) {
52.30 - propStr.close();
52.31 - }
52.32 - } catch (IOException ignore) {}
52.33 + }
52.34 +
52.35 + for (Map.Entry<Object, Object> e : props.entrySet()) {
52.36 + String key = (String) e.getKey();
52.37 + String val = (String) e.getValue();
52.38 + if (key.startsWith("attribute.")) {
52.39 + e.setValue(Attribute.normalizeLayoutString(val));
52.40 + }
52.41 }
52.42
52.43 defaultProps = (new HashMap<>(props)); // shrink to fit
53.1 --- a/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java Tue Mar 29 11:29:01 2011 -0700
53.2 +++ b/src/share/classes/com/sun/java/util/jar/pack/UnpackerImpl.java Tue Mar 29 20:19:55 2011 -0700
53.3 @@ -161,8 +161,9 @@
53.4 }
53.5 // Use the stream-based implementation.
53.6 // %%% Reconsider if native unpacker learns to memory-map the file.
53.7 - FileInputStream instr = new FileInputStream(in);
53.8 - unpack(instr, out);
53.9 + try (FileInputStream instr = new FileInputStream(in)) {
53.10 + unpack(instr, out);
53.11 + }
53.12 if (props.getBoolean(Utils.UNPACK_REMOVE_PACKFILE)) {
53.13 in.delete();
53.14 }
54.1 --- a/src/share/classes/com/sun/java/util/jar/pack/Utils.java Tue Mar 29 11:29:01 2011 -0700
54.2 +++ b/src/share/classes/com/sun/java/util/jar/pack/Utils.java Tue Mar 29 20:19:55 2011 -0700
54.3 @@ -268,18 +268,18 @@
54.4 // 4947205 : Peformance is slow when using pack-effort=0
54.5 out = new BufferedOutputStream(out);
54.6 out = new NonCloser(out); // protect from JarOutputStream.close()
54.7 - JarOutputStream jout = new JarOutputStream(out);
54.8 - copyJarFile(in, jout);
54.9 - jout.close();
54.10 + try (JarOutputStream jout = new JarOutputStream(out)) {
54.11 + copyJarFile(in, jout);
54.12 + }
54.13 }
54.14 static void copyJarFile(JarFile in, OutputStream out) throws IOException {
54.15
54.16 // 4947205 : Peformance is slow when using pack-effort=0
54.17 out = new BufferedOutputStream(out);
54.18 out = new NonCloser(out); // protect from JarOutputStream.close()
54.19 - JarOutputStream jout = new JarOutputStream(out);
54.20 - copyJarFile(in, jout);
54.21 - jout.close();
54.22 + try (JarOutputStream jout = new JarOutputStream(out)) {
54.23 + copyJarFile(in, jout);
54.24 + }
54.25 }
54.26 // Wrapper to prevent closing of client-supplied stream.
54.27 static private
55.1 --- a/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transform.java Tue Mar 29 11:29:01 2011 -0700
55.2 +++ b/src/share/classes/com/sun/org/apache/xml/internal/security/transforms/Transform.java Tue Mar 29 20:19:55 2011 -0700
55.3 @@ -210,6 +210,8 @@
55.4 public static void init() {
55.5 if (!alreadyInitialized) {
55.6 transformClassHash = new HashMap(10);
55.7 + // make sure builtin algorithms are all registered first
55.8 + com.sun.org.apache.xml.internal.security.Init.init();
55.9 alreadyInitialized = true;
55.10 }
55.11 }
55.12 @@ -236,12 +238,7 @@
55.13 "algorithm.alreadyRegistered", exArgs);
55.14 }
55.15
55.16 - ClassLoader cl = (ClassLoader) AccessController.doPrivileged(
55.17 - new PrivilegedAction() {
55.18 - public Object run() {
55.19 - return Thread.currentThread().getContextClassLoader();
55.20 - }
55.21 - });
55.22 + ClassLoader cl = Thread.currentThread().getContextClassLoader();
55.23
55.24 try {
55.25 transformClassHash.put
56.1 --- a/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java Tue Mar 29 11:29:01 2011 -0700
56.2 +++ b/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java Tue Mar 29 20:19:55 2011 -0700
56.3 @@ -115,6 +115,31 @@
56.4
56.5 //construct object used to implement getInterface
56.6 implementor = new InterfaceImplementor(this) {
56.7 + protected boolean isImplemented(Object thiz, Class<?> iface) {
56.8 + Context cx = enterContext();
56.9 + try {
56.10 + if (thiz != null && !(thiz instanceof Scriptable)) {
56.11 + thiz = cx.toObject(thiz, topLevel);
56.12 + }
56.13 + Scriptable engineScope = getRuntimeScope(context);
56.14 + Scriptable localScope = (thiz != null)? (Scriptable) thiz :
56.15 + engineScope;
56.16 + for (Method method : iface.getMethods()) {
56.17 + // ignore methods of java.lang.Object class
56.18 + if (method.getDeclaringClass() == Object.class) {
56.19 + continue;
56.20 + }
56.21 + Object obj = ScriptableObject.getProperty(localScope, method.getName());
56.22 + if (! (obj instanceof Function)) {
56.23 + return false;
56.24 + }
56.25 + }
56.26 + return true;
56.27 + } finally {
56.28 + cx.exit();
56.29 + }
56.30 + }
56.31 +
56.32 protected Object convertResult(Method method, Object res)
56.33 throws ScriptException {
56.34 Class desiredType = method.getReturnType();
57.1 --- a/src/share/classes/com/sun/script/util/InterfaceImplementor.java Tue Mar 29 11:29:01 2011 -0700
57.2 +++ b/src/share/classes/com/sun/script/util/InterfaceImplementor.java Tue Mar 29 20:19:55 2011 -0700
57.3 @@ -82,12 +82,19 @@
57.4 if (iface == null || !iface.isInterface()) {
57.5 throw new IllegalArgumentException("interface Class expected");
57.6 }
57.7 + if (! isImplemented(thiz, iface)) {
57.8 + return null;
57.9 + }
57.10 AccessControlContext accCtxt = AccessController.getContext();
57.11 return iface.cast(Proxy.newProxyInstance(iface.getClassLoader(),
57.12 new Class[]{iface},
57.13 new InterfaceImplementorInvocationHandler(thiz, accCtxt)));
57.14 }
57.15
57.16 + protected boolean isImplemented(Object thiz, Class<?> iface) {
57.17 + return true;
57.18 + }
57.19 +
57.20 // called to convert method result after invoke
57.21 protected Object convertResult(Method method, Object res)
57.22 throws ScriptException {
58.1 --- a/src/share/classes/java/awt/AWTEvent.java Tue Mar 29 11:29:01 2011 -0700
58.2 +++ b/src/share/classes/java/awt/AWTEvent.java Tue Mar 29 20:19:55 2011 -0700
58.3 @@ -33,6 +33,11 @@
58.4 import sun.awt.AWTAccessor;
58.5 import sun.util.logging.PlatformLogger;
58.6
58.7 +import java.security.AccessControlContext;
58.8 +import java.security.AccessController;
58.9 +import java.io.ObjectInputStream;
58.10 +import java.io.IOException;
58.11 +
58.12 /**
58.13 * The root event class for all AWT events.
58.14 * This class and its subclasses supercede the original
58.15 @@ -97,6 +102,22 @@
58.16 */
58.17 protected boolean consumed = false;
58.18
58.19 + /*
58.20 + * The event's AccessControlContext.
58.21 + */
58.22 + private transient volatile AccessControlContext acc =
58.23 + AccessController.getContext();
58.24 +
58.25 + /*
58.26 + * Returns the acc this event was constructed with.
58.27 + */
58.28 + final AccessControlContext getAccessControlContext() {
58.29 + if (acc == null) {
58.30 + throw new SecurityException("AWTEvent is missing AccessControlContext");
58.31 + }
58.32 + return acc;
58.33 + }
58.34 +
58.35 transient boolean focusManagerIsDispatching = false;
58.36 transient boolean isPosted;
58.37
58.38 @@ -247,6 +268,10 @@
58.39 public boolean isSystemGenerated(AWTEvent ev) {
58.40 return ev.isSystemGenerated;
58.41 }
58.42 +
58.43 + public AccessControlContext getAccessControlContext(AWTEvent ev) {
58.44 + return ev.getAccessControlContext();
58.45 + }
58.46 });
58.47 }
58.48
59.1 --- a/src/share/classes/java/awt/Component.java Tue Mar 29 11:29:01 2011 -0700
59.2 +++ b/src/share/classes/java/awt/Component.java Tue Mar 29 20:19:55 2011 -0700
59.3 @@ -59,6 +59,7 @@
59.4 import java.lang.reflect.Method;
59.5 import java.security.AccessController;
59.6 import java.security.PrivilegedAction;
59.7 +import java.security.AccessControlContext;
59.8 import javax.accessibility.*;
59.9 import java.applet.Applet;
59.10
59.11 @@ -471,6 +472,12 @@
59.12 static final Object LOCK = new AWTTreeLock();
59.13 static class AWTTreeLock {}
59.14
59.15 + /*
59.16 + * The component's AccessControlContext.
59.17 + */
59.18 + private transient volatile AccessControlContext acc =
59.19 + AccessController.getContext();
59.20 +
59.21 /**
59.22 * Minimum size.
59.23 * (This field perhaps should have been transient).
59.24 @@ -671,6 +678,16 @@
59.25 return objectLock;
59.26 }
59.27
59.28 + /*
59.29 + * Returns the acc this component was constructed with.
59.30 + */
59.31 + final AccessControlContext getAccessControlContext() {
59.32 + if (acc == null) {
59.33 + throw new SecurityException("Component is missing AccessControlContext");
59.34 + }
59.35 + return acc;
59.36 + }
59.37 +
59.38 boolean isPacked = false;
59.39
59.40 /**
59.41 @@ -950,6 +967,10 @@
59.42 public void processEvent(Component comp, AWTEvent e) {
59.43 comp.processEvent(e);
59.44 }
59.45 +
59.46 + public AccessControlContext getAccessControlContext(Component comp) {
59.47 + return comp.getAccessControlContext();
59.48 + }
59.49 });
59.50 }
59.51
59.52 @@ -3873,6 +3894,11 @@
59.53 * supported or met
59.54 * @exception ClassCastException if the component is not a canvas or
59.55 * window.
59.56 + * @exception IllegalStateException if the component has no peer
59.57 + * @exception IllegalArgumentException if {@code numBuffers} is less than two,
59.58 + * or if {@code BufferCapabilities.isPageFlipping} is not
59.59 + * {@code true}.
59.60 + * @see #createBuffers(int, BufferCapabilities)
59.61 */
59.62 protected FlipBufferStrategy(int numBuffers, BufferCapabilities caps)
59.63 throws AWTException
59.64 @@ -8608,6 +8634,8 @@
59.65 {
59.66 objectLock = new Object();
59.67
59.68 + acc = AccessController.getContext();
59.69 +
59.70 s.defaultReadObject();
59.71
59.72 appContext = AppContext.getAppContext();
60.1 --- a/src/share/classes/java/awt/EventQueue.java Tue Mar 29 11:29:01 2011 -0700
60.2 +++ b/src/share/classes/java/awt/EventQueue.java Tue Mar 29 20:19:55 2011 -0700
60.3 @@ -48,6 +48,12 @@
60.4 import java.util.concurrent.locks.Condition;
60.5 import java.util.concurrent.locks.Lock;
60.6
60.7 +import java.security.AccessControlContext;
60.8 +import java.security.ProtectionDomain;
60.9 +
60.10 +import sun.misc.SharedSecrets;
60.11 +import sun.misc.JavaSecurityAccess;
60.12 +
60.13 /**
60.14 * <code>EventQueue</code> is a platform-independent class
60.15 * that queues events, both from the underlying peer classes
60.16 @@ -612,6 +618,9 @@
60.17 return null;
60.18 }
60.19
60.20 + private static final JavaSecurityAccess javaSecurityAccess =
60.21 + SharedSecrets.getJavaSecurityAccess();
60.22 +
60.23 /**
60.24 * Dispatches an event. The manner in which the event is
60.25 * dispatched depends upon the type of the event and the
60.26 @@ -650,13 +659,49 @@
60.27 * @throws NullPointerException if <code>event</code> is <code>null</code>
60.28 * @since 1.2
60.29 */
60.30 - protected void dispatchEvent(AWTEvent event) {
60.31 + protected void dispatchEvent(final AWTEvent event) {
60.32 + final Object src = event.getSource();
60.33 + final PrivilegedAction<Void> action = new PrivilegedAction<Void>() {
60.34 + public Void run() {
60.35 + dispatchEventImpl(event, src);
60.36 + return null;
60.37 + }
60.38 + };
60.39 +
60.40 + final AccessControlContext stack = AccessController.getContext();
60.41 + final AccessControlContext srcAcc = getAccessControlContextFrom(src);
60.42 + final AccessControlContext eventAcc = event.getAccessControlContext();
60.43 + if (srcAcc == null) {
60.44 + javaSecurityAccess.doIntersectionPrivilege(action, stack, eventAcc);
60.45 + } else {
60.46 + javaSecurityAccess.doIntersectionPrivilege(
60.47 + new PrivilegedAction<Void>() {
60.48 + public Void run() {
60.49 + javaSecurityAccess.doIntersectionPrivilege(action, eventAcc);
60.50 + return null;
60.51 + }
60.52 + }, stack, srcAcc);
60.53 + }
60.54 + }
60.55 +
60.56 + private static AccessControlContext getAccessControlContextFrom(Object src) {
60.57 + return src instanceof Component ?
60.58 + ((Component)src).getAccessControlContext() :
60.59 + src instanceof MenuComponent ?
60.60 + ((MenuComponent)src).getAccessControlContext() :
60.61 + src instanceof TrayIcon ?
60.62 + ((TrayIcon)src).getAccessControlContext() :
60.63 + null;
60.64 + }
60.65 +
60.66 + /**
60.67 + * Called from dispatchEvent() under a correct AccessControlContext
60.68 + */
60.69 + private void dispatchEventImpl(final AWTEvent event, final Object src) {
60.70 event.isPosted = true;
60.71 - Object src = event.getSource();
60.72 if (event instanceof ActiveEvent) {
60.73 // This could become the sole method of dispatching in time.
60.74 setCurrentEventAndMostRecentTimeImpl(event);
60.75 -
60.76 ((ActiveEvent)event).dispatch();
60.77 } else if (src instanceof Component) {
60.78 ((Component)src).dispatchEvent(event);
61.1 --- a/src/share/classes/java/awt/LinearGradientPaint.java Tue Mar 29 11:29:01 2011 -0700
61.2 +++ b/src/share/classes/java/awt/LinearGradientPaint.java Tue Mar 29 20:19:55 2011 -0700
61.3 @@ -57,8 +57,14 @@
61.4 * </pre>
61.5 *
61.6 * <p>
61.7 - * The user may also select what action the {@code LinearGradientPaint}
61.8 - * should take when filling color outside the start and end points.
61.9 + * The user may also select what action the {@code LinearGradientPaint} object
61.10 + * takes when it is filling the space outside the start and end points by
61.11 + * setting {@code CycleMethod} to either {@code REFLECTION} or {@code REPEAT}.
61.12 + * The distances between any two colors in any of the reflected or repeated
61.13 + * copies of the gradient are the same as the distance between those same two
61.14 + * colors between the start and end points.
61.15 + * Note that some minor variations in distances may occur due to sampling at
61.16 + * the granularity of a pixel.
61.17 * If no cycle method is specified, {@code NO_CYCLE} will be chosen by
61.18 * default, which means the endpoint colors will be used to fill the
61.19 * remaining area.
62.1 --- a/src/share/classes/java/awt/MenuComponent.java Tue Mar 29 11:29:01 2011 -0700
62.2 +++ b/src/share/classes/java/awt/MenuComponent.java Tue Mar 29 20:19:55 2011 -0700
62.3 @@ -33,6 +33,9 @@
62.4 import sun.awt.AWTAccessor;
62.5 import javax.accessibility.*;
62.6
62.7 +import java.security.AccessControlContext;
62.8 +import java.security.AccessController;
62.9 +
62.10 /**
62.11 * The abstract class <code>MenuComponent</code> is the superclass
62.12 * of all menu-related components. In this respect, the class
62.13 @@ -100,6 +103,23 @@
62.14 boolean newEventsOnly = false;
62.15
62.16 /*
62.17 + * The menu's AccessControlContext.
62.18 + */
62.19 + private transient volatile AccessControlContext acc =
62.20 + AccessController.getContext();
62.21 +
62.22 + /*
62.23 + * Returns the acc this menu component was constructed with.
62.24 + */
62.25 + final AccessControlContext getAccessControlContext() {
62.26 + if (acc == null) {
62.27 + throw new SecurityException(
62.28 + "MenuComponent is missing AccessControlContext");
62.29 + }
62.30 + return acc;
62.31 + }
62.32 +
62.33 + /*
62.34 * Internal constants for serialization.
62.35 */
62.36 final static String actionListenerK = Component.actionListenerK;
62.37 @@ -402,6 +422,9 @@
62.38 throws ClassNotFoundException, IOException, HeadlessException
62.39 {
62.40 GraphicsEnvironment.checkHeadless();
62.41 +
62.42 + acc = AccessController.getContext();
62.43 +
62.44 s.defaultReadObject();
62.45
62.46 appContext = AppContext.getAppContext();
63.1 --- a/src/share/classes/java/awt/MultipleGradientPaint.java Tue Mar 29 11:29:01 2011 -0700
63.2 +++ b/src/share/classes/java/awt/MultipleGradientPaint.java Tue Mar 29 20:19:55 2011 -0700
63.3 @@ -286,6 +286,10 @@
63.4 /**
63.5 * Returns a copy of the transform applied to the gradient.
63.6 *
63.7 + * <p>
63.8 + * Note that if no transform is applied to the gradient
63.9 + * when it is created, the identity transform is used.
63.10 + *
63.11 * @return a copy of the transform applied to the gradient
63.12 */
63.13 public final AffineTransform getTransform() {
63.14 @@ -293,10 +297,12 @@
63.15 }
63.16
63.17 /**
63.18 - * Returns the transparency mode for this Paint object.
63.19 + * Returns the transparency mode for this {@code Paint} object.
63.20 *
63.21 - * @return an integer value representing the transparency mode for
63.22 - * this Paint object
63.23 + * @return {@code OPAQUE} if all colors used by this
63.24 + * {@code Paint} object are opaque,
63.25 + * {@code TRANSLUCENT} if at least one of the
63.26 + * colors used by this {@code Paint} object is not opaque.
63.27 * @see java.awt.Transparency
63.28 */
63.29 public final int getTransparency() {
64.1 --- a/src/share/classes/java/awt/RadialGradientPaint.java Tue Mar 29 11:29:01 2011 -0700
64.2 +++ b/src/share/classes/java/awt/RadialGradientPaint.java Tue Mar 29 20:19:55 2011 -0700
64.3 @@ -71,8 +71,24 @@
64.4 * </pre>
64.5 *
64.6 * <p>
64.7 - * The user may also select what action the {@code RadialGradientPaint}
64.8 - * should take when filling color outside the bounds of the circle's radius.
64.9 + * The user may also select what action the {@code RadialGradientPaint} object
64.10 + * takes when it is filling the space outside the circle's radius by
64.11 + * setting {@code CycleMethod} to either {@code REFLECTION} or {@code REPEAT}.
64.12 + * The gradient color proportions are equal for any particular line drawn
64.13 + * from the focus point. The following figure shows that the distance AB
64.14 + * is equal to the distance BC, and the distance AD is equal to the distance DE.
64.15 + * <center>
64.16 + * <img src = "doc-files/RadialGradientPaint-3.png">
64.17 + * </center>
64.18 + * If the gradient and graphics rendering transforms are uniformly scaled and
64.19 + * the user sets the focus so that it coincides with the center of the circle,
64.20 + * the gradient color proportions are equal for any line drawn from the center.
64.21 + * The following figure shows the distances AB, BC, AD, and DE. They are all equal.
64.22 + * <center>
64.23 + * <img src = "doc-files/RadialGradientPaint-4.png">
64.24 + * </center>
64.25 + * Note that some minor variations in distances may occur due to sampling at
64.26 + * the granularity of a pixel.
64.27 * If no cycle method is specified, {@code NO_CYCLE} will be chosen by
64.28 * default, which means the the last keyframe color will be used to fill the
64.29 * remaining area.
64.30 @@ -604,7 +620,7 @@
64.31 }
64.32
64.33 /**
64.34 - * Returns a copy of the end point of the gradient axis.
64.35 + * Returns a copy of the focus point of the radial gradient.
64.36 *
64.37 * @return a {@code Point2D} object that is a copy of the focus point
64.38 */
65.1 --- a/src/share/classes/java/awt/TrayIcon.java Tue Mar 29 11:29:01 2011 -0700
65.2 +++ b/src/share/classes/java/awt/TrayIcon.java Tue Mar 29 20:19:55 2011 -0700
65.3 @@ -40,6 +40,8 @@
65.4 import sun.awt.SunToolkit;
65.5 import sun.awt.HeadlessToolkit;
65.6 import java.util.EventObject;
65.7 +import java.security.AccessControlContext;
65.8 +import java.security.AccessController;
65.9
65.10 /**
65.11 * A <code>TrayIcon</code> object represents a tray icon that can be
65.12 @@ -90,6 +92,7 @@
65.13 * @author Anton Tarasov
65.14 */
65.15 public class TrayIcon {
65.16 +
65.17 private Image image;
65.18 private String tooltip;
65.19 private PopupMenu popup;
65.20 @@ -103,6 +106,24 @@
65.21 transient MouseMotionListener mouseMotionListener;
65.22 transient ActionListener actionListener;
65.23
65.24 + /*
65.25 + * The tray icon's AccessControlContext.
65.26 + *
65.27 + * Unlike the acc in Component, this field is made final
65.28 + * because TrayIcon is not serializable.
65.29 + */
65.30 + private final AccessControlContext acc = AccessController.getContext();
65.31 +
65.32 + /*
65.33 + * Returns the acc this tray icon was constructed with.
65.34 + */
65.35 + final AccessControlContext getAccessControlContext() {
65.36 + if (acc == null) {
65.37 + throw new SecurityException("TrayIcon is missing AccessControlContext");
65.38 + }
65.39 + return acc;
65.40 + }
65.41 +
65.42 static {
65.43 Toolkit.loadLibraries();
65.44 if (!GraphicsEnvironment.isHeadless()) {
66.1 Binary file src/share/classes/java/awt/doc-files/RadialGradientPaint-3.png has changed
67.1 Binary file src/share/classes/java/awt/doc-files/RadialGradientPaint-4.png has changed
68.1 --- a/src/share/classes/java/awt/image/PackedColorModel.java Tue Mar 29 11:29:01 2011 -0700
68.2 +++ b/src/share/classes/java/awt/image/PackedColorModel.java Tue Mar 29 20:19:55 2011 -0700
68.3 @@ -343,8 +343,13 @@
68.4 if (bitMasks.length != maskArray.length) {
68.5 return false;
68.6 }
68.7 +
68.8 + /* compare 'effective' masks only, i.e. only part of the mask
68.9 + * which fits the capacity of the transfer type.
68.10 + */
68.11 + int maxMask = (int)((1L << DataBuffer.getDataTypeSize(transferType)) - 1);
68.12 for (int i=0; i < bitMasks.length; i++) {
68.13 - if (bitMasks[i] != maskArray[i]) {
68.14 + if ((maxMask & bitMasks[i]) != (maxMask & maskArray[i])) {
68.15 return false;
68.16 }
68.17 }
69.1 --- a/src/share/classes/java/beans/DefaultPersistenceDelegate.java Tue Mar 29 11:29:01 2011 -0700
69.2 +++ b/src/share/classes/java/beans/DefaultPersistenceDelegate.java Tue Mar 29 20:19:55 2011 -0700
69.3 @@ -35,7 +35,7 @@
69.4 * is the delegate used by default for classes about
69.5 * which no information is available. The <code>DefaultPersistenceDelegate</code>
69.6 * provides, version resilient, public API-based persistence for
69.7 - * classes that follow the JavaBeans conventions without any class specific
69.8 + * classes that follow the JavaBeans™ conventions without any class specific
69.9 * configuration.
69.10 * <p>
69.11 * The key assumptions are that the class has a nullary constructor
70.1 --- a/src/share/classes/java/beans/DesignMode.java Tue Mar 29 11:29:01 2011 -0700
70.2 +++ b/src/share/classes/java/beans/DesignMode.java Tue Mar 29 20:19:55 2011 -0700
70.3 @@ -31,7 +31,7 @@
70.4 * of java.beans.beancontext.BeanContext, in order to propagate to its nested hierarchy
70.5 * of java.beans.beancontext.BeanContextChild instances, the current "designTime" property.
70.6 * <p>
70.7 - * The JavaBeans specification defines the notion of design time as is a
70.8 + * The JavaBeans™ specification defines the notion of design time as is a
70.9 * mode in which JavaBeans instances should function during their composition
70.10 * and customization in a interactive design, composition or construction tool,
70.11 * as opposed to runtime when the JavaBean is part of an applet, application,
71.1 --- a/src/share/classes/java/beans/IndexedPropertyChangeEvent.java Tue Mar 29 11:29:01 2011 -0700
71.2 +++ b/src/share/classes/java/beans/IndexedPropertyChangeEvent.java Tue Mar 29 20:19:55 2011 -0700
71.3 @@ -26,7 +26,7 @@
71.4
71.5 /**
71.6 * An "IndexedPropertyChange" event gets delivered whenever a component that
71.7 - * conforms to the JavaBeans<TM> specification (a "bean") changes a bound
71.8 + * conforms to the JavaBeans™ specification (a "bean") changes a bound
71.9 * indexed property. This class is an extension of <code>PropertyChangeEvent</code>
71.10 * but contains the index of the property that has changed.
71.11 * <P>
72.1 --- a/src/share/classes/java/beans/Introspector.java Tue Mar 29 11:29:01 2011 -0700
72.2 +++ b/src/share/classes/java/beans/Introspector.java Tue Mar 29 20:19:55 2011 -0700
72.3 @@ -87,7 +87,7 @@
72.4 * <p>
72.5 * For more information about introspection and design patterns, please
72.6 * consult the
72.7 - * <a href="http://java.sun.com/products/javabeans/docs/index.html">JavaBeans specification</a>.
72.8 + * <a href="http://java.sun.com/products/javabeans/docs/index.html">JavaBeans™ specification</a>.
72.9 */
72.10
72.11 public class Introspector {
72.12 @@ -1245,7 +1245,7 @@
72.13 try {
72.14 type = ClassFinder.findClass(name, type.getClassLoader());
72.15 // Each customizer should inherit java.awt.Component and implement java.beans.Customizer
72.16 - // according to the section 9.3 of JavaBeans specification
72.17 + // according to the section 9.3 of JavaBeans™ specification
72.18 if (Component.class.isAssignableFrom(type) && Customizer.class.isAssignableFrom(type)) {
72.19 return type;
72.20 }
73.1 --- a/src/share/classes/java/beans/VetoableChangeSupport.java Tue Mar 29 11:29:01 2011 -0700
73.2 +++ b/src/share/classes/java/beans/VetoableChangeSupport.java Tue Mar 29 20:19:55 2011 -0700
73.3 @@ -474,7 +474,7 @@
73.4 /**
73.5 * @serialField children Hashtable
73.6 * @serialField source Object
73.7 - * @serialField propertyChangeSupportSerializedDataVersion int
73.8 + * @serialField vetoableChangeSupportSerializedDataVersion int
73.9 */
73.10 private static final ObjectStreamField[] serialPersistentFields = {
73.11 new ObjectStreamField("children", Hashtable.class),
74.1 --- a/src/share/classes/java/beans/package.html Tue Mar 29 11:29:01 2011 -0700
74.2 +++ b/src/share/classes/java/beans/package.html Tue Mar 29 20:19:55 2011 -0700
74.3 @@ -29,7 +29,7 @@
74.4
74.5 Contains classes related to developing
74.6 <em>beans</em> -- components
74.7 -based on the JavaBeans<sup><font size=-2>TM</font></sup> architecture.
74.8 +based on the JavaBeans™ architecture.
74.9 A few of the
74.10 classes are used by beans while they run in an application.
74.11 For example, the event classes are
75.1 --- a/src/share/classes/java/dyn/CallSite.java Tue Mar 29 11:29:01 2011 -0700
75.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
75.3 @@ -1,266 +0,0 @@
75.4 -/*
75.5 - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
75.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
75.7 - *
75.8 - * This code is free software; you can redistribute it and/or modify it
75.9 - * under the terms of the GNU General Public License version 2 only, as
75.10 - * published by the Free Software Foundation. Oracle designates this
75.11 - * particular file as subject to the "Classpath" exception as provided
75.12 - * by Oracle in the LICENSE file that accompanied this code.
75.13 - *
75.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
75.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
75.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
75.17 - * version 2 for more details (a copy is included in the LICENSE file that
75.18 - * accompanied this code).
75.19 - *
75.20 - * You should have received a copy of the GNU General Public License version
75.21 - * 2 along with this work; if not, write to the Free Software Foundation,
75.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
75.23 - *
75.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
75.25 - * or visit www.oracle.com if you need additional information or have any
75.26 - * questions.
75.27 - */
75.28 -
75.29 -package java.dyn;
75.30 -
75.31 -import sun.dyn.*;
75.32 -import sun.dyn.empty.Empty;
75.33 -import sun.misc.Unsafe;
75.34 -import java.util.Collection;
75.35 -
75.36 -/**
75.37 - * A {@code CallSite} is a holder for a variable {@link MethodHandle},
75.38 - * which is called its {@code target}.
75.39 - * An {@code invokedynamic} instruction linked to a {@code CallSite} delegates
75.40 - * all calls to the site's current target.
75.41 - * A {@code CallSite} may be associated with several {@code invokedynamic}
75.42 - * instructions, or it may be "free floating", associated with none.
75.43 - * In any case, it may be invoked through an associated method handle
75.44 - * called its {@linkplain #dynamicInvoker dynamic invoker}.
75.45 - * <p>
75.46 - * {@code CallSite} is an abstract class which does not allow
75.47 - * direct subclassing by users. It has three immediate,
75.48 - * concrete subclasses that may be either instantiated or subclassed.
75.49 - * <ul>
75.50 - * <li>If a mutable target is not required, an {@code invokedynamic} instruction
75.51 - * may be permanently bound by means of a {@linkplain ConstantCallSite constant call site}.
75.52 - * <li>If a mutable target is required which has volatile variable semantics,
75.53 - * because updates to the target must be immediately and reliably witnessed by other threads,
75.54 - * a {@linkplain VolatileCallSite volatile call site} may be used.
75.55 - * <li>Otherwise, if a mutable target is required,
75.56 - * a {@linkplain MutableCallSite mutable call site} may be used.
75.57 - * </ul>
75.58 - * <p>
75.59 - * A non-constant call site may be <em>relinked</em> by changing its target.
75.60 - * The new target must have the same {@linkplain MethodHandle#type() type}
75.61 - * as the previous target.
75.62 - * Thus, though a call site can be relinked to a series of
75.63 - * successive targets, it cannot change its type.
75.64 - * <p>
75.65 - * Here is a sample use of call sites and bootstrap methods which links every
75.66 - * dynamic call site to print its arguments:
75.67 -<blockquote><pre><!-- see indy-demo/src/PrintArgsDemo.java -->
75.68 -static void test() throws Throwable {
75.69 - // THE FOLLOWING LINE IS PSEUDOCODE FOR A JVM INSTRUCTION
75.70 - InvokeDynamic[#bootstrapDynamic].baz("baz arg", 2, 3.14);
75.71 -}
75.72 -private static void printArgs(Object... args) {
75.73 - System.out.println(java.util.Arrays.deepToString(args));
75.74 -}
75.75 -private static final MethodHandle printArgs;
75.76 -static {
75.77 - MethodHandles.Lookup lookup = MethodHandles.lookup();
75.78 - Class thisClass = lookup.lookupClass(); // (who am I?)
75.79 - printArgs = lookup.findStatic(thisClass,
75.80 - "printArgs", MethodType.methodType(void.class, Object[].class));
75.81 -}
75.82 -private static CallSite bootstrapDynamic(MethodHandles.Lookup caller, String name, MethodType type) {
75.83 - // ignore caller and name, but match the type:
75.84 - return new ConstantCallSite(printArgs.asType(type));
75.85 -}
75.86 -</pre></blockquote>
75.87 - * @author John Rose, JSR 292 EG
75.88 - */
75.89 -abstract
75.90 -public class CallSite {
75.91 - private static final Access IMPL_TOKEN = Access.getToken();
75.92 - static { MethodHandleImpl.initStatics(); }
75.93 -
75.94 - // Fields used only by the JVM. Do not use or change.
75.95 - private MemberName vmmethod; // supplied by the JVM (ref. to calling method)
75.96 - private int vmindex; // supplied by the JVM (BCI within calling method)
75.97 -
75.98 - // The actual payload of this call site:
75.99 - /*package-private*/
75.100 - MethodHandle target;
75.101 -
75.102 - // Remove this field for PFD and delete deprecated methods:
75.103 - private MemberName calleeNameRemoveForPFD;
75.104 -
75.105 - /**
75.106 - * Make a blank call site object with the given method type.
75.107 - * An initial target method is supplied which will throw
75.108 - * an {@link IllegalStateException} if called.
75.109 - * <p>
75.110 - * Before this {@code CallSite} object is returned from a bootstrap method,
75.111 - * it is usually provided with a more useful target method,
75.112 - * via a call to {@link CallSite#setTarget(MethodHandle) setTarget}.
75.113 - * @throws NullPointerException if the proposed type is null
75.114 - */
75.115 - /*package-private*/
75.116 - CallSite(MethodType type) {
75.117 - target = MethodHandles.invokers(type).uninitializedCallSite();
75.118 - }
75.119 -
75.120 - /**
75.121 - * Make a blank call site object, possibly equipped with an initial target method handle.
75.122 - * @param target the method handle which will be the initial target of the call site
75.123 - * @throws NullPointerException if the proposed target is null
75.124 - */
75.125 - /*package-private*/
75.126 - CallSite(MethodHandle target) {
75.127 - target.type(); // null check
75.128 - this.target = target;
75.129 - }
75.130 -
75.131 - /**
75.132 - * Returns the type of this call site's target.
75.133 - * Although targets may change, any call site's type is permanent, and can never change to an unequal type.
75.134 - * The {@code setTarget} method enforces this invariant by refusing any new target that does
75.135 - * not have the previous target's type.
75.136 - * @return the type of the current target, which is also the type of any future target
75.137 - */
75.138 - public MethodType type() {
75.139 - return target.type();
75.140 - }
75.141 -
75.142 - /** Called from JVM (or low-level Java code) after the BSM returns the newly created CallSite.
75.143 - * The parameters are JVM-specific.
75.144 - */
75.145 - void initializeFromJVM(String name,
75.146 - MethodType type,
75.147 - MemberName callerMethod,
75.148 - int callerBCI) {
75.149 - if (this.vmmethod != null) {
75.150 - // FIXME
75.151 - throw new InvokeDynamicBootstrapError("call site has already been linked to an invokedynamic instruction");
75.152 - }
75.153 - if (!this.type().equals(type)) {
75.154 - throw wrongTargetType(target, type);
75.155 - }
75.156 - this.vmindex = callerBCI;
75.157 - this.vmmethod = callerMethod;
75.158 - }
75.159 -
75.160 - /**
75.161 - * Returns the target method of the call site, according to the
75.162 - * behavior defined by this call site's specific class.
75.163 - * The immediate subclasses of {@code CallSite} document the
75.164 - * class-specific behaviors of this method.
75.165 - *
75.166 - * @return the current linkage state of the call site, its target method handle
75.167 - * @see ConstantCallSite
75.168 - * @see VolatileCallSite
75.169 - * @see #setTarget
75.170 - * @see ConstantCallSite#getTarget
75.171 - * @see MutableCallSite#getTarget
75.172 - * @see VolatileCallSite#getTarget
75.173 - */
75.174 - public abstract MethodHandle getTarget();
75.175 -
75.176 - /**
75.177 - * Updates the target method of this call site, according to the
75.178 - * behavior defined by this call site's specific class.
75.179 - * The immediate subclasses of {@code CallSite} document the
75.180 - * class-specific behaviors of this method.
75.181 - * <p>
75.182 - * The type of the new target must be {@linkplain MethodType#equals equal to}
75.183 - * the type of the old target.
75.184 - *
75.185 - * @param newTarget the new target
75.186 - * @throws NullPointerException if the proposed new target is null
75.187 - * @throws WrongMethodTypeException if the proposed new target
75.188 - * has a method type that differs from the previous target
75.189 - * @see CallSite#getTarget
75.190 - * @see ConstantCallSite#setTarget
75.191 - * @see MutableCallSite#setTarget
75.192 - * @see VolatileCallSite#setTarget
75.193 - */
75.194 - public abstract void setTarget(MethodHandle newTarget);
75.195 -
75.196 - void checkTargetChange(MethodHandle oldTarget, MethodHandle newTarget) {
75.197 - MethodType oldType = oldTarget.type();
75.198 - MethodType newType = newTarget.type(); // null check!
75.199 - if (!newType.equals(oldType))
75.200 - throw wrongTargetType(newTarget, oldType);
75.201 - }
75.202 -
75.203 - private static WrongMethodTypeException wrongTargetType(MethodHandle target, MethodType type) {
75.204 - return new WrongMethodTypeException(String.valueOf(target)+" should be of type "+type);
75.205 - }
75.206 -
75.207 - /**
75.208 - * Produce a method handle equivalent to an invokedynamic instruction
75.209 - * which has been linked to this call site.
75.210 - * <p>
75.211 - * This method is equivalent to the following code:
75.212 - * <blockquote><pre>
75.213 - * MethodHandle getTarget, invoker, result;
75.214 - * getTarget = MethodHandles.publicLookup().bind(this, "getTarget", MethodType.methodType(MethodHandle.class));
75.215 - * invoker = MethodHandles.exactInvoker(this.type());
75.216 - * result = MethodHandles.foldArguments(invoker, getTarget)
75.217 - * </pre></blockquote>
75.218 - *
75.219 - * @return a method handle which always invokes this call site's current target
75.220 - */
75.221 - public abstract MethodHandle dynamicInvoker();
75.222 -
75.223 - /*non-public*/ MethodHandle makeDynamicInvoker() {
75.224 - MethodHandle getTarget = MethodHandleImpl.bindReceiver(IMPL_TOKEN, GET_TARGET, this);
75.225 - MethodHandle invoker = MethodHandles.exactInvoker(this.type());
75.226 - return MethodHandles.foldArguments(invoker, getTarget);
75.227 - }
75.228 -
75.229 - private static final MethodHandle GET_TARGET;
75.230 - static {
75.231 - try {
75.232 - GET_TARGET = MethodHandles.Lookup.IMPL_LOOKUP.
75.233 - findVirtual(CallSite.class, "getTarget", MethodType.methodType(MethodHandle.class));
75.234 - } catch (ReflectiveOperationException ignore) {
75.235 - throw new InternalError();
75.236 - }
75.237 - }
75.238 -
75.239 - /** This guy is rolled into the default target if a MethodType is supplied to the constructor. */
75.240 - /*package-private*/
75.241 - static Empty uninitializedCallSite() {
75.242 - throw new IllegalStateException("uninitialized call site");
75.243 - }
75.244 -
75.245 - // unsafe stuff:
75.246 - private static final Unsafe unsafe = Unsafe.getUnsafe();
75.247 - private static final long TARGET_OFFSET;
75.248 -
75.249 - static {
75.250 - try {
75.251 - TARGET_OFFSET = unsafe.objectFieldOffset(CallSite.class.getDeclaredField("target"));
75.252 - } catch (Exception ex) { throw new Error(ex); }
75.253 - }
75.254 -
75.255 - /*package-private*/
75.256 - void setTargetNormal(MethodHandle newTarget) {
75.257 - target = newTarget;
75.258 - //CallSiteImpl.setCallSiteTarget(IMPL_TOKEN, this, newTarget);
75.259 - }
75.260 - /*package-private*/
75.261 - MethodHandle getTargetVolatile() {
75.262 - return (MethodHandle) unsafe.getObjectVolatile(this, TARGET_OFFSET);
75.263 - }
75.264 - /*package-private*/
75.265 - void setTargetVolatile(MethodHandle newTarget) {
75.266 - unsafe.putObjectVolatile(this, TARGET_OFFSET, newTarget);
75.267 - //CallSiteImpl.setCallSiteTarget(IMPL_TOKEN, this, newTarget);
75.268 - }
75.269 -}
76.1 --- a/src/share/classes/java/dyn/ClassValue.java Tue Mar 29 11:29:01 2011 -0700
76.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
76.3 @@ -1,238 +0,0 @@
76.4 -/*
76.5 - * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
76.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
76.7 - *
76.8 - * This code is free software; you can redistribute it and/or modify it
76.9 - * under the terms of the GNU General Public License version 2 only, as
76.10 - * published by the Free Software Foundation. Oracle designates this
76.11 - * particular file as subject to the "Classpath" exception as provided
76.12 - * by Oracle in the LICENSE file that accompanied this code.
76.13 - *
76.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
76.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
76.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
76.17 - * version 2 for more details (a copy is included in the LICENSE file that
76.18 - * accompanied this code).
76.19 - *
76.20 - * You should have received a copy of the GNU General Public License version
76.21 - * 2 along with this work; if not, write to the Free Software Foundation,
76.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
76.23 - *
76.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
76.25 - * or visit www.oracle.com if you need additional information or have any
76.26 - * questions.
76.27 - */
76.28 -
76.29 -package java.dyn;
76.30 -
76.31 -import java.util.WeakHashMap;
76.32 -import java.util.concurrent.atomic.AtomicInteger;
76.33 -import java.util.concurrent.atomic.AtomicReference;
76.34 -import java.lang.reflect.UndeclaredThrowableException;
76.35 -
76.36 -/**
76.37 - * Lazily associate a computed value with (potentially) every type.
76.38 - * For example, if a dynamic language needs to construct a message dispatch
76.39 - * table for each class encountered at a message send call site,
76.40 - * it can use a {@code ClassValue} to cache information needed to
76.41 - * perform the message send quickly, for each class encountered.
76.42 - * @author John Rose, JSR 292 EG
76.43 - */
76.44 -public abstract class ClassValue<T> {
76.45 - /**
76.46 - * Compute the given class's derived value for this {@code ClassValue}.
76.47 - * <p>
76.48 - * This method will be invoked within the first thread that accesses
76.49 - * the value with the {@link #get get} method.
76.50 - * <p>
76.51 - * Normally, this method is invoked at most once per class,
76.52 - * but it may be invoked again if there has been a call to
76.53 - * {@link #remove remove}.
76.54 - * <p>
76.55 - * If this method throws an exception, the corresponding call to {@code get}
76.56 - * will terminate abnormally with that exception, and no class value will be recorded.
76.57 - *
76.58 - * @param type the type whose class value must be computed
76.59 - * @return the newly computed value associated with this {@code ClassValue}, for the given class or interface
76.60 - * @see #get
76.61 - * @see #remove
76.62 - */
76.63 - protected abstract T computeValue(Class<?> type);
76.64 -
76.65 - /**
76.66 - * Returns the value for the given class.
76.67 - * If no value has yet been computed, it is obtained by
76.68 - * an invocation of the {@link #computeValue computeValue} method.
76.69 - * <p>
76.70 - * The actual installation of the value on the class
76.71 - * is performed atomically.
76.72 - * At that point, if several racing threads have
76.73 - * computed values, one is chosen, and returned to
76.74 - * all the racing threads.
76.75 - * <p>
76.76 - * The {@code type} parameter is typically a class, but it may be any type,
76.77 - * such as an interface, a primitive type (like {@code int.class}), or {@code void.class}.
76.78 - * <p>
76.79 - * In the absence of {@code remove} calls, a class value has a simple
76.80 - * state diagram: uninitialized and initialized.
76.81 - * When {@code remove} calls are made,
76.82 - * the rules for value observation are more complex.
76.83 - * See the documentation for {@link #remove remove} for more information.
76.84 - *
76.85 - * @param type the type whose class value must be computed or retrieved
76.86 - * @return the current value associated with this {@code ClassValue}, for the given class or interface
76.87 - * @throws NullPointerException if the argument is null
76.88 - * @see #remove
76.89 - * @see #computeValue
76.90 - */
76.91 - public T get(Class<?> type) {
76.92 - ClassValueMap map = getMap(type);
76.93 - if (map != null) {
76.94 - Object x = map.get(this);
76.95 - if (x != null) {
76.96 - return (T) map.unmaskNull(x);
76.97 - }
76.98 - }
76.99 - return setComputedValue(type);
76.100 - }
76.101 -
76.102 - /**
76.103 - * Removes the associated value for the given class.
76.104 - * If this value is subsequently {@linkplain #get read} for the same class,
76.105 - * its value will be reinitialized by invoking its {@link #computeValue computeValue} method.
76.106 - * This may result in an additional invocation of the
76.107 - * {@code computeValue computeValue} method for the given class.
76.108 - * <p>
76.109 - * In order to explain the interaction between {@code get} and {@code remove} calls,
76.110 - * we must model the state transitions of a class value to take into account
76.111 - * the alternation between uninitialized and initialized states.
76.112 - * To do this, number these states sequentially from zero, and note that
76.113 - * uninitialized (or removed) states are numbered with even numbers,
76.114 - * while initialized (or re-initialized) states have odd numbers.
76.115 - * <p>
76.116 - * When a thread {@code T} removes a class value in state {@code 2N},
76.117 - * nothing happens, since the class value is already uninitialized.
76.118 - * Otherwise, the state is advanced atomically to {@code 2N+1}.
76.119 - * <p>
76.120 - * When a thread {@code T} queries a class value in state {@code 2N},
76.121 - * the thread first attempts to initialize the class value to state {@code 2N+1}
76.122 - * by invoking {@code computeValue} and installing the resulting value.
76.123 - * <p>
76.124 - * When {@code T} attempts to install the newly computed value,
76.125 - * if the state is still at {@code 2N}, the class value will be initialized
76.126 - * with the computed value, advancing it to state {@code 2N+1}.
76.127 - * <p>
76.128 - * Otherwise, whether the new state is even or odd,
76.129 - * {@code T} will discard the newly computed value
76.130 - * and retry the {@code get} operation.
76.131 - * <p>
76.132 - * Discarding and retrying is an important proviso,
76.133 - * since otherwise {@code T} could potentially install
76.134 - * a disastrously stale value. For example:
76.135 - * <ul>
76.136 - * <li>{@code T} calls {@code CV.get(C)} and sees state {@code 2N}
76.137 - * <li>{@code T} quickly computes a time-dependent value {@code V0} and gets ready to install it
76.138 - * <li>{@code T} is hit by an unlucky paging or scheduling event, and goes to sleep for a long time
76.139 - * <li>...meanwhile, {@code T2} also calls {@code CV.get(C)} and sees state {@code 2N}
76.140 - * <li>{@code T2} quickly computes a similar time-dependent value {@code V1} and installs it on {@code CV.get(C)}
76.141 - * <li>{@code T2} (or a third thread) then calls {@code CV.remove(C)}, undoing {@code T2}'s work
76.142 - * <li> the previous actions of {@code T2} are repeated several times
76.143 - * <li> also, the relevant computed values change over time: {@code V1}, {@code V2}, ...
76.144 - * <li>...meanwhile, {@code T} wakes up and attempts to install {@code V0}; <em>this must fail</em>
76.145 - * </ul>
76.146 - * We can assume in the above scenario that {@code CV.computeValue} uses locks to properly
76.147 - * observe the time-dependent states as it computes {@code V1}, etc.
76.148 - * This does not remove the threat of a stale value, since there is a window of time
76.149 - * between the return of {@code computeValue} in {@code T} and the installation
76.150 - * of the the new value. No user synchronization is possible during this time.
76.151 - *
76.152 - * @param type the type whose class value must be removed
76.153 - * @throws NullPointerException if the argument is null
76.154 - */
76.155 - public void remove(Class<?> type) {
76.156 - ClassValueMap map = getMap(type);
76.157 - if (map != null) {
76.158 - synchronized (map) {
76.159 - map.remove(this);
76.160 - }
76.161 - }
76.162 - }
76.163 -
76.164 - /// Implementation...
76.165 -
76.166 - // The hash code for this type is based on the identity of the object,
76.167 - // and is well-dispersed for power-of-two tables.
76.168 - /** @deprecated This override, which is implementation-specific, will be removed for PFD. */
76.169 - public final int hashCode() { return hashCode; }
76.170 - private final int hashCode = HASH_CODES.getAndAdd(0x61c88647);
76.171 - private static final AtomicInteger HASH_CODES = new AtomicInteger();
76.172 -
76.173 - private static final AtomicInteger STORE_BARRIER = new AtomicInteger();
76.174 -
76.175 - /** Slow path for {@link #get}. */
76.176 - private T setComputedValue(Class<?> type) {
76.177 - ClassValueMap map = getMap(type);
76.178 - if (map == null) {
76.179 - map = initializeMap(type);
76.180 - }
76.181 - T value = computeValue(type);
76.182 - STORE_BARRIER.lazySet(0);
76.183 - // All stores pending from computeValue are completed.
76.184 - synchronized (map) {
76.185 - // Warm up the table with a null entry.
76.186 - map.preInitializeEntry(this);
76.187 - }
76.188 - STORE_BARRIER.lazySet(0);
76.189 - // All stores pending from table expansion are completed.
76.190 - synchronized (map) {
76.191 - value = (T) map.initializeEntry(this, value);
76.192 - // One might fear a possible race condition here
76.193 - // if the code for map.put has flushed the write
76.194 - // to map.table[*] before the writes to the Map.Entry
76.195 - // are done. This is not possible, since we have
76.196 - // warmed up the table with an empty entry.
76.197 - }
76.198 - return value;
76.199 - }
76.200 -
76.201 - // Replace this map by a per-class slot.
76.202 - private static final WeakHashMap<Class<?>, ClassValueMap> ROOT
76.203 - = new WeakHashMap<Class<?>, ClassValueMap>();
76.204 -
76.205 - private static ClassValueMap getMap(Class<?> type) {
76.206 - return ROOT.get(type);
76.207 - }
76.208 -
76.209 - private static ClassValueMap initializeMap(Class<?> type) {
76.210 - synchronized (ClassValue.class) {
76.211 - ClassValueMap map = ROOT.get(type);
76.212 - if (map == null)
76.213 - ROOT.put(type, map = new ClassValueMap());
76.214 - return map;
76.215 - }
76.216 - }
76.217 -
76.218 - static class ClassValueMap extends WeakHashMap<ClassValue, Object> {
76.219 - /** Make sure this table contains an Entry for the given key, even if it is empty. */
76.220 - void preInitializeEntry(ClassValue key) {
76.221 - if (!this.containsKey(key))
76.222 - this.put(key, null);
76.223 - }
76.224 - /** Make sure this table contains a non-empty Entry for the given key. */
76.225 - Object initializeEntry(ClassValue key, Object value) {
76.226 - Object prior = this.get(key);
76.227 - if (prior != null) {
76.228 - return unmaskNull(prior);
76.229 - }
76.230 - this.put(key, maskNull(value));
76.231 - return value;
76.232 - }
76.233 -
76.234 - Object maskNull(Object x) {
76.235 - return x == null ? this : x;
76.236 - }
76.237 - Object unmaskNull(Object x) {
76.238 - return x == this ? null : x;
76.239 - }
76.240 - }
76.241 -}
77.1 --- a/src/share/classes/java/dyn/ConstantCallSite.java Tue Mar 29 11:29:01 2011 -0700
77.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
77.3 @@ -1,77 +0,0 @@
77.4 -/*
77.5 - * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
77.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
77.7 - *
77.8 - * This code is free software; you can redistribute it and/or modify it
77.9 - * under the terms of the GNU General Public License version 2 only, as
77.10 - * published by the Free Software Foundation. Oracle designates this
77.11 - * particular file as subject to the "Classpath" exception as provided
77.12 - * by Oracle in the LICENSE file that accompanied this code.
77.13 - *
77.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
77.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
77.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
77.17 - * version 2 for more details (a copy is included in the LICENSE file that
77.18 - * accompanied this code).
77.19 - *
77.20 - * You should have received a copy of the GNU General Public License version
77.21 - * 2 along with this work; if not, write to the Free Software Foundation,
77.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
77.23 - *
77.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
77.25 - * or visit www.oracle.com if you need additional information or have any
77.26 - * questions.
77.27 - */
77.28 -
77.29 -package java.dyn;
77.30 -
77.31 -/**
77.32 - * A {@code ConstantCallSite} is a {@link CallSite} whose target is permanent, and can never be changed.
77.33 - * An {@code invokedynamic} instruction linked to a {@code ConstantCallSite} is permanently
77.34 - * bound to the call site's target.
77.35 - * @author John Rose, JSR 292 EG
77.36 - */
77.37 -public class ConstantCallSite extends CallSite {
77.38 - /**
77.39 - * Creates a call site with a permanent target.
77.40 - * @param target the target to be permanently associated with this call site
77.41 - * @throws NullPointerException if the proposed target is null
77.42 - */
77.43 - public ConstantCallSite(MethodHandle target) {
77.44 - super(target);
77.45 - }
77.46 -
77.47 - /**
77.48 - * Returns the target method of the call site, which behaves
77.49 - * like a {@code final} field of the {@code ConstantCallSite}.
77.50 - * That is, the the target is always the original value passed
77.51 - * to the constructor call which created this instance.
77.52 - *
77.53 - * @return the immutable linkage state of this call site, a constant method handle
77.54 - * @throws UnsupportedOperationException because this kind of call site cannot change its target
77.55 - */
77.56 - @Override public final MethodHandle getTarget() {
77.57 - return target;
77.58 - }
77.59 -
77.60 - /**
77.61 - * Always throws an {@link UnsupportedOperationException}.
77.62 - * This kind of call site cannot change its target.
77.63 - * @param ignore a new target proposed for the call site, which is ignored
77.64 - * @throws UnsupportedOperationException because this kind of call site cannot change its target
77.65 - */
77.66 - @Override public final void setTarget(MethodHandle ignore) {
77.67 - throw new UnsupportedOperationException("ConstantCallSite");
77.68 - }
77.69 -
77.70 - /**
77.71 - * Returns this call site's permanent target.
77.72 - * Since that target will never change, this is a correct implementation
77.73 - * of {@link CallSite#dynamicInvoker CallSite.dynamicInvoker}.
77.74 - * @return the immutable linkage state of this call site, a constant method handle
77.75 - */
77.76 - @Override
77.77 - public final MethodHandle dynamicInvoker() {
77.78 - return getTarget();
77.79 - }
77.80 -}
78.1 --- a/src/share/classes/java/dyn/InvokeDynamic.java Tue Mar 29 11:29:01 2011 -0700
78.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
78.3 @@ -1,33 +0,0 @@
78.4 -/*
78.5 - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
78.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
78.7 - *
78.8 - * This code is free software; you can redistribute it and/or modify it
78.9 - * under the terms of the GNU General Public License version 2 only, as
78.10 - * published by the Free Software Foundation. Oracle designates this
78.11 - * particular file as subject to the "Classpath" exception as provided
78.12 - * by Oracle in the LICENSE file that accompanied this code.
78.13 - *
78.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
78.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
78.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
78.17 - * version 2 for more details (a copy is included in the LICENSE file that
78.18 - * accompanied this code).
78.19 - *
78.20 - * You should have received a copy of the GNU General Public License version
78.21 - * 2 along with this work; if not, write to the Free Software Foundation,
78.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
78.23 - *
78.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
78.25 - * or visit www.oracle.com if you need additional information or have any
78.26 - * questions.
78.27 - */
78.28 -
78.29 -package java.dyn;
78.30 -
78.31 -/**
78.32 - * This is a place-holder class. Some HotSpot implementations need to see it.
78.33 - */
78.34 -final class InvokeDynamic {
78.35 - private InvokeDynamic() { throw new InternalError(); } // do not instantiate
78.36 -}
79.1 --- a/src/share/classes/java/dyn/InvokeDynamicBootstrapError.java Tue Mar 29 11:29:01 2011 -0700
79.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
79.3 @@ -1,82 +0,0 @@
79.4 -/*
79.5 - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
79.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
79.7 - *
79.8 - * This code is free software; you can redistribute it and/or modify it
79.9 - * under the terms of the GNU General Public License version 2 only, as
79.10 - * published by the Free Software Foundation. Oracle designates this
79.11 - * particular file as subject to the "Classpath" exception as provided
79.12 - * by Oracle in the LICENSE file that accompanied this code.
79.13 - *
79.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
79.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
79.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
79.17 - * version 2 for more details (a copy is included in the LICENSE file that
79.18 - * accompanied this code).
79.19 - *
79.20 - * You should have received a copy of the GNU General Public License version
79.21 - * 2 along with this work; if not, write to the Free Software Foundation,
79.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
79.23 - *
79.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
79.25 - * or visit www.oracle.com if you need additional information or have any
79.26 - * questions.
79.27 - */
79.28 -
79.29 -package java.dyn;
79.30 -
79.31 -/**
79.32 - * Thrown to indicate that an {@code invokedynamic} instruction has
79.33 - * failed to find its
79.34 - * {@linkplain BootstrapMethod bootstrap method},
79.35 - * or the bootstrap method has
79.36 - * failed to provide a
79.37 - * {@linkplain CallSite call site} with a {@linkplain CallSite#getTarget target}
79.38 - * of the correct {@linkplain MethodHandle#type method type}.
79.39 - *
79.40 - * @author John Rose, JSR 292 EG
79.41 - * @since 1.7
79.42 - */
79.43 -public class InvokeDynamicBootstrapError extends LinkageError {
79.44 - private static final long serialVersionUID = 292L;
79.45 -
79.46 - /**
79.47 - * Constructs an {@code InvokeDynamicBootstrapError} with no detail message.
79.48 - */
79.49 - public InvokeDynamicBootstrapError() {
79.50 - super();
79.51 - }
79.52 -
79.53 - /**
79.54 - * Constructs an {@code InvokeDynamicBootstrapError} with the specified
79.55 - * detail message.
79.56 - *
79.57 - * @param s the detail message.
79.58 - */
79.59 - public InvokeDynamicBootstrapError(String s) {
79.60 - super(s);
79.61 - }
79.62 -
79.63 - /**
79.64 - * Constructs a {@code InvokeDynamicBootstrapError} with the specified
79.65 - * detail message and cause.
79.66 - *
79.67 - * @param s the detail message.
79.68 - * @param cause the cause, may be {@code null}.
79.69 - */
79.70 - public InvokeDynamicBootstrapError(String s, Throwable cause) {
79.71 - super(s, cause);
79.72 - }
79.73 -
79.74 - /**
79.75 - * Constructs a {@code InvokeDynamicBootstrapError} with the specified
79.76 - * cause.
79.77 - *
79.78 - * @param cause the cause, may be {@code null}.
79.79 - */
79.80 - public InvokeDynamicBootstrapError(Throwable cause) {
79.81 - // cf. Throwable(Throwable cause) constructor.
79.82 - super(cause == null ? null : cause.toString());
79.83 - initCause(cause);
79.84 - }
79.85 -}
80.1 --- a/src/share/classes/java/dyn/Linkage.java Tue Mar 29 11:29:01 2011 -0700
80.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
80.3 @@ -1,125 +0,0 @@
80.4 -/*
80.5 - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
80.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
80.7 - *
80.8 - * This code is free software; you can redistribute it and/or modify it
80.9 - * under the terms of the GNU General Public License version 2 only, as
80.10 - * published by the Free Software Foundation. Oracle designates this
80.11 - * particular file as subject to the "Classpath" exception as provided
80.12 - * by Oracle in the LICENSE file that accompanied this code.
80.13 - *
80.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
80.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
80.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
80.17 - * version 2 for more details (a copy is included in the LICENSE file that
80.18 - * accompanied this code).
80.19 - *
80.20 - * You should have received a copy of the GNU General Public License version
80.21 - * 2 along with this work; if not, write to the Free Software Foundation,
80.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
80.23 - *
80.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
80.25 - * or visit www.oracle.com if you need additional information or have any
80.26 - * questions.
80.27 - */
80.28 -
80.29 -package java.dyn;
80.30 -
80.31 -import java.dyn.MethodHandles.Lookup;
80.32 -import java.util.WeakHashMap;
80.33 -import sun.dyn.Access;
80.34 -import sun.dyn.MethodHandleImpl;
80.35 -import sun.dyn.util.VerifyAccess;
80.36 -import sun.reflect.Reflection;
80.37 -import static sun.dyn.MemberName.newIllegalArgumentException;
80.38 -
80.39 -/**
80.40 - * <em>CLASS WILL BE REMOVED FOR PFD:</em>
80.41 - * Static routines for controlling invokedynamic behavior.
80.42 - * Replaced by non-static APIs.
80.43 - * @author John Rose, JSR 292 EG
80.44 - * @deprecated This class will be removed in the Public Final Draft.
80.45 - */
80.46 -public class Linkage {
80.47 - private static final Access IMPL_TOKEN = Access.getToken();
80.48 -
80.49 - private Linkage() {} // do not instantiate
80.50 -
80.51 - /**
80.52 - * <em>METHOD WILL BE REMOVED FOR PFD:</em>
80.53 - * Register a <em>bootstrap method</em> to use when linking dynamic call sites within
80.54 - * a given caller class.
80.55 - * @deprecated Use @{@link BootstrapMethod} annotations instead.
80.56 - */
80.57 - public static
80.58 - void registerBootstrapMethod(Class callerClass, MethodHandle bootstrapMethod) {
80.59 - Class callc = Reflection.getCallerClass(2);
80.60 - if (callc != null && !VerifyAccess.isSamePackage(callerClass, callc))
80.61 - throw new IllegalArgumentException("cannot set bootstrap method on "+callerClass);
80.62 - MethodHandleImpl.registerBootstrap(IMPL_TOKEN, callerClass, bootstrapMethod);
80.63 - }
80.64 -
80.65 - /**
80.66 - * <em>METHOD WILL BE REMOVED FOR PFD:</em>
80.67 - * Simplified version of {@code registerBootstrapMethod} for self-registration,
80.68 - * to be called from a static initializer.
80.69 - * @deprecated Use @{@link BootstrapMethod} annotations instead.
80.70 - */
80.71 - public static
80.72 - void registerBootstrapMethod(Class<?> runtime, String name) {
80.73 - Class callerClass = Reflection.getCallerClass(2);
80.74 - registerBootstrapMethodLookup(callerClass, runtime, name);
80.75 - }
80.76 -
80.77 - /**
80.78 - * <em>METHOD WILL BE REMOVED FOR PFD:</em>
80.79 - * Simplified version of {@code registerBootstrapMethod} for self-registration,
80.80 - * @deprecated Use @{@link BootstrapMethod} annotations instead.
80.81 - */
80.82 - public static
80.83 - void registerBootstrapMethod(String name) {
80.84 - Class callerClass = Reflection.getCallerClass(2);
80.85 - registerBootstrapMethodLookup(callerClass, callerClass, name);
80.86 - }
80.87 -
80.88 - private static
80.89 - void registerBootstrapMethodLookup(Class<?> callerClass, Class<?> runtime, String name) {
80.90 - Lookup lookup = new Lookup(IMPL_TOKEN, callerClass);
80.91 - MethodHandle bootstrapMethod;
80.92 - try {
80.93 - bootstrapMethod = lookup.findStatic(runtime, name, BOOTSTRAP_METHOD_TYPE);
80.94 - } catch (ReflectiveOperationException ex) {
80.95 - throw new IllegalArgumentException("no such bootstrap method in "+runtime+": "+name, ex);
80.96 - }
80.97 - MethodHandleImpl.registerBootstrap(IMPL_TOKEN, callerClass, bootstrapMethod);
80.98 - }
80.99 -
80.100 - private static final MethodType BOOTSTRAP_METHOD_TYPE
80.101 - = MethodType.methodType(CallSite.class,
80.102 - Class.class, String.class, MethodType.class);
80.103 -
80.104 - /**
80.105 - * <em>METHOD WILL BE REMOVED FOR PFD:</em>
80.106 - * Invalidate all <code>invokedynamic</code> call sites everywhere.
80.107 - * @deprecated Use {@linkplain MutableCallSite#setTarget call site target setting},
80.108 - * {@link MutableCallSite#syncAll call site update pushing},
80.109 - * and {@link SwitchPoint#guardWithTest target switching} instead.
80.110 - */
80.111 - public static
80.112 - Object invalidateAll() {
80.113 - throw new UnsupportedOperationException();
80.114 - }
80.115 -
80.116 - /**
80.117 - * <em>METHOD WILL BE REMOVED FOR PFD:</em>
80.118 - * Invalidate all {@code invokedynamic} call sites in the bytecodes
80.119 - * of any methods of the given class.
80.120 - * @deprecated Use {@linkplain MutableCallSite#setTarget call site target setting},
80.121 - * {@link MutableCallSite#syncAll call site update pushing},
80.122 - * and {@link SwitchPoint#guardWithTest target switching} instead.
80.123 - */
80.124 - public static
80.125 - Object invalidateCallerClass(Class<?> callerClass) {
80.126 - throw new UnsupportedOperationException();
80.127 - }
80.128 -}
81.1 --- a/src/share/classes/java/dyn/MethodHandle.java Tue Mar 29 11:29:01 2011 -0700
81.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
81.3 @@ -1,1009 +0,0 @@
81.4 -/*
81.5 - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
81.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
81.7 - *
81.8 - * This code is free software; you can redistribute it and/or modify it
81.9 - * under the terms of the GNU General Public License version 2 only, as
81.10 - * published by the Free Software Foundation. Oracle designates this
81.11 - * particular file as subject to the "Classpath" exception as provided
81.12 - * by Oracle in the LICENSE file that accompanied this code.
81.13 - *
81.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
81.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
81.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
81.17 - * version 2 for more details (a copy is included in the LICENSE file that
81.18 - * accompanied this code).
81.19 - *
81.20 - * You should have received a copy of the GNU General Public License version
81.21 - * 2 along with this work; if not, write to the Free Software Foundation,
81.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
81.23 - *
81.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
81.25 - * or visit www.oracle.com if you need additional information or have any
81.26 - * questions.
81.27 - */
81.28 -
81.29 -package java.dyn;
81.30 -
81.31 -//import sun.dyn.*;
81.32 -
81.33 -import sun.dyn.Access;
81.34 -import sun.dyn.MethodHandleImpl;
81.35 -
81.36 -import static java.dyn.MethodHandles.invokers; // package-private API
81.37 -import static sun.dyn.MemberName.newIllegalArgumentException; // utility
81.38 -
81.39 -/**
81.40 - * A method handle is a typed, directly executable reference to an underlying method,
81.41 - * constructor, field, or similar low-level operation, with optional
81.42 - * transformations of arguments or return values.
81.43 - * These transformations are quite general, and include such patterns as
81.44 - * {@linkplain #asType conversion},
81.45 - * {@linkplain #bindTo insertion},
81.46 - * {@linkplain java.dyn.MethodHandles#dropArguments deletion},
81.47 - * and {@linkplain java.dyn.MethodHandles#filterArguments substitution}.
81.48 - * <p>
81.49 - * <em>Note: The super-class of MethodHandle is Object.
81.50 - * Any other super-class visible in the Reference Implementation
81.51 - * will be removed before the Proposed Final Draft.
81.52 - * Also, the final version will not include any public or
81.53 - * protected constructors.</em>
81.54 - *
81.55 - * <h3>Method handle contents</h3>
81.56 - * Method handles are dynamically and strongly typed according to type descriptor.
81.57 - * They are not distinguished by the name or defining class of their underlying methods.
81.58 - * A method handle must be invoked using type descriptor which matches
81.59 - * the method handle's own {@linkplain #type method type}.
81.60 - * <p>
81.61 - * Every method handle reports its type via the {@link #type type} accessor.
81.62 - * This type descriptor is a {@link java.dyn.MethodType MethodType} object,
81.63 - * whose structure is a series of classes, one of which is
81.64 - * the return type of the method (or {@code void.class} if none).
81.65 - * <p>
81.66 - * A method handle's type controls the types of invocations it accepts,
81.67 - * and the kinds of transformations that apply to it.
81.68 - * <p>
81.69 - * A method handle contains a pair of special invoker methods
81.70 - * called {@link #invokeExact invokeExact} and {@link #invokeGeneric invokeGeneric}.
81.71 - * Both invoker methods provide direct access to the method handle's
81.72 - * underlying method, constructor, field, or other operation,
81.73 - * as modified by transformations of arguments and return values.
81.74 - * Both invokers accept calls which exactly match the method handle's own type.
81.75 - * The {@code invokeGeneric} invoker also accepts a range of other call types.
81.76 - * <p>
81.77 - * Method handles are immutable and have no visible state.
81.78 - * Of course, they can be bound to underlying methods or data which exhibit state.
81.79 - * With respect to the Java Memory Model, any method handle will behave
81.80 - * as if all of its (internal) fields are final variables. This means that any method
81.81 - * handle made visible to the application will always be fully formed.
81.82 - * This is true even if the method handle is published through a shared
81.83 - * variable in a data race.
81.84 - * <p>
81.85 - * Method handles cannot be subclassed by the user.
81.86 - * Implementations may (or may not) create internal subclasses of {@code MethodHandle}
81.87 - * which may be visible via the {@link java.lang.Object#getClass Object.getClass}
81.88 - * operation. The programmer should not draw conclusions about a method handle
81.89 - * from its specific class, as the method handle class hierarchy (if any)
81.90 - * may change from time to time or across implementations from different vendors.
81.91 - *
81.92 - * <h3>Method handle compilation</h3>
81.93 - * A Java method call expression naming {@code invokeExact} or {@code invokeGeneric}
81.94 - * can invoke a method handle from Java source code.
81.95 - * From the viewpoint of source code, these methods can take any arguments
81.96 - * and their result can be cast to any return type.
81.97 - * Formally this is accomplished by giving the invoker methods
81.98 - * {@code Object} return types and variable-arity {@code Object} arguments,
81.99 - * but they have an additional quality called <em>signature polymorphism</em>
81.100 - * which connects this freedom of invocation directly to the JVM execution stack.
81.101 - * <p>
81.102 - * As is usual with virtual methods, source-level calls to {@code invokeExact}
81.103 - * and {@code invokeGeneric} compile to an {@code invokevirtual} instruction.
81.104 - * More unusually, the compiler must record the actual argument types,
81.105 - * and may not perform method invocation conversions on the arguments.
81.106 - * Instead, it must push them on the stack according to their own unconverted types.
81.107 - * The method handle object itself is pushed on the stack before the arguments.
81.108 - * The compiler then calls the method handle with a type descriptor which
81.109 - * describes the argument and return types.
81.110 - * <p>
81.111 - * To issue a complete type descriptor, the compiler must also determine
81.112 - * the return type. This is based on a cast on the method invocation expression,
81.113 - * if there is one, or else {@code Object} if the invocation is an expression
81.114 - * or else {@code void} if the invocation is a statement.
81.115 - * The cast may be to a primitive type (but not {@code void}).
81.116 - * <p>
81.117 - * As a corner case, an uncasted {@code null} argument is given
81.118 - * a type descriptor of {@code java.lang.Void}.
81.119 - * The ambiguity with the type {@code Void} is harmless, since there are no references of type
81.120 - * {@code Void} except the null reference.
81.121 - *
81.122 - * <h3>Method handle invocation</h3>
81.123 - * The first time a {@code invokevirtual} instruction is executed
81.124 - * it is linked, by symbolically resolving the names in the instruction
81.125 - * and verifying that the method call is statically legal.
81.126 - * This is true of calls to {@code invokeExact} and {@code invokeGeneric}.
81.127 - * In this case, the type descriptor emitted by the compiler is checked for
81.128 - * correct syntax and names it contains are resolved.
81.129 - * Thus, an {@code invokevirtual} instruction which invokes
81.130 - * a method handle will always link, as long
81.131 - * as the type descriptor is syntactically well-formed
81.132 - * and the types exist.
81.133 - * <p>
81.134 - * When the {@code invokevirtual} is executed after linking,
81.135 - * the receiving method handle's type is first checked by the JVM
81.136 - * to ensure that it matches the descriptor.
81.137 - * If the type match fails, it means that the method which the
81.138 - * caller is invoking is not present on the individual
81.139 - * method handle being invoked.
81.140 - * <p>
81.141 - * In the case of {@code invokeExact}, the type descriptor of the invocation
81.142 - * (after resolving symbolic type names) must exactly match the method type
81.143 - * of the receiving method handle.
81.144 - * In the case of {@code invokeGeneric}, the resolved type descriptor
81.145 - * must be a valid argument to the receiver's {@link #asType asType} method.
81.146 - * Thus, {@code invokeGeneric} is more permissive than {@code invokeExact}.
81.147 - * <p>
81.148 - * After type matching, a call to {@code invokeExact} directly
81.149 - * and immediately invoke the method handle's underlying method
81.150 - * (or other behavior, as the case may be).
81.151 - * <p>
81.152 - * A call to {@code invokeGeneric} works the same as a call to
81.153 - * {@code invokeExact}, if the type descriptor specified by the caller
81.154 - * exactly matches the method handle's own type.
81.155 - * If there is a type mismatch, {@code invokeGeneric} attempts
81.156 - * to adjust the type of the receiving method handle,
81.157 - * as if by a call to {@link #asType asType},
81.158 - * to obtain an exactly invokable method handle {@code M2}.
81.159 - * This allows a more powerful negotiation of method type
81.160 - * between caller and callee.
81.161 - * <p>
81.162 - * (Note: The adjusted method handle {@code M2} is not directly observable,
81.163 - * and implementations are therefore not required to materialize it.)
81.164 - *
81.165 - * <h3>Invocation checking</h3>
81.166 - * In typical programs, method handle type matching will usually succeed.
81.167 - * But if a match fails, the JVM will throw a {@link WrongMethodTypeException},
81.168 - * either directly (in the case of {@code invokeExact}) or indirectly as if
81.169 - * by a failed call to {@code asType} (in the case of {@code invokeGeneric}).
81.170 - * <p>
81.171 - * Thus, a method type mismatch which might show up as a linkage error
81.172 - * in a statically typed program can show up as
81.173 - * a dynamic {@code WrongMethodTypeException}
81.174 - * in a program which uses method handles.
81.175 - * <p>
81.176 - * Because method types contain "live" {@code Class} objects,
81.177 - * method type matching takes into account both types names and class loaders.
81.178 - * Thus, even if a method handle {@code M} is created in one
81.179 - * class loader {@code L1} and used in another {@code L2},
81.180 - * method handle calls are type-safe, because the caller's type
81.181 - * descriptor, as resolved in {@code L2},
81.182 - * is matched against the original callee method's type descriptor,
81.183 - * as resolved in {@code L1}.
81.184 - * The resolution in {@code L1} happens when {@code M} is created
81.185 - * and its type is assigned, while the resolution in {@code L2} happens
81.186 - * when the {@code invokevirtual} instruction is linked.
81.187 - * <p>
81.188 - * Apart from the checking of type descriptors,
81.189 - * a method handle's capability to call its underlying method is unrestricted.
81.190 - * If a method handle is formed on a non-public method by a class
81.191 - * that has access to that method, the resulting handle can be used
81.192 - * in any place by any caller who receives a reference to it.
81.193 - * <p>
81.194 - * Unlike with the Core Reflection API, where access is checked every time
81.195 - * a reflective method is invoked,
81.196 - * method handle access checking is performed
81.197 - * <a href="MethodHandles.Lookup.html#access">when the method handle is created</a>.
81.198 - * In the case of {@code ldc} (see below), access checking is performed as part of linking
81.199 - * the constant pool entry underlying the constant method handle.
81.200 - * <p>
81.201 - * Thus, handles to non-public methods, or to methods in non-public classes,
81.202 - * should generally be kept secret.
81.203 - * They should not be passed to untrusted code unless their use from
81.204 - * the untrusted code would be harmless.
81.205 - *
81.206 - * <h3>Method handle creation</h3>
81.207 - * Java code can create a method handle that directly accesses
81.208 - * any method, constructor, or field that is accessible to that code.
81.209 - * This is done via a reflective, capability-based API called
81.210 - * {@link java.dyn.MethodHandles.Lookup MethodHandles.Lookup}
81.211 - * For example, a static method handle can be obtained
81.212 - * from {@link java.dyn.MethodHandles.Lookup#findStatic Lookup.findStatic}.
81.213 - * There are also conversion methods from Core Reflection API objects,
81.214 - * such as {@link java.dyn.MethodHandles.Lookup#unreflect Lookup.unreflect}.
81.215 - * <p>
81.216 - * Like classes and strings, method handles that correspond to accessible
81.217 - * fields, methods, and constructors can also be represented directly
81.218 - * in a class file's constant pool as constants to be loaded by {@code ldc} bytecodes.
81.219 - * A new type of constant pool entry, {@code CONSTANT_MethodHandle},
81.220 - * refers directly to an associated {@code CONSTANT_Methodref},
81.221 - * {@code CONSTANT_InterfaceMethodref}, or {@code CONSTANT_Fieldref}
81.222 - * constant pool entry.
81.223 - * (For more details on method handle constants,
81.224 - * see the <a href="package-summary.html#mhcon">package summary</a>.)
81.225 - * <p>
81.226 - * Method handles produced by lookups or constant loads from methods or
81.227 - * constructors with the variable arity modifier bit ({@code 0x0080})
81.228 - * have a corresponding variable arity, as if they were defined with
81.229 - * the help of {@link #asVarargsCollector asVarargsCollector}.
81.230 - * <p>
81.231 - * A method reference may refer either to a static or non-static method.
81.232 - * In the non-static case, the method handle type includes an explicit
81.233 - * receiver argument, prepended before any other arguments.
81.234 - * In the method handle's type, the initial receiver argument is typed
81.235 - * according to the class under which the method was initially requested.
81.236 - * (E.g., if a non-static method handle is obtained via {@code ldc},
81.237 - * the type of the receiver is the class named in the constant pool entry.)
81.238 - * <p>
81.239 - * When a method handle to a virtual method is invoked, the method is
81.240 - * always looked up in the receiver (that is, the first argument).
81.241 - * <p>
81.242 - * A non-virtual method handle to a specific virtual method implementation
81.243 - * can also be created. These do not perform virtual lookup based on
81.244 - * receiver type. Such a method handle simulates the effect of
81.245 - * an {@code invokespecial} instruction to the same method.
81.246 - *
81.247 - * <h3>Usage examples</h3>
81.248 - * Here are some examples of usage:
81.249 - * <p><blockquote><pre>
81.250 -Object x, y; String s; int i;
81.251 -MethodType mt; MethodHandle mh;
81.252 -MethodHandles.Lookup lookup = MethodHandles.lookup();
81.253 -// mt is (char,char)String
81.254 -mt = MethodType.methodType(String.class, char.class, char.class);
81.255 -mh = lookup.findVirtual(String.class, "replace", mt);
81.256 -s = (String) mh.invokeExact("daddy",'d','n');
81.257 -// invokeExact(Ljava/lang/String;CC)Ljava/lang/String;
81.258 -assert(s.equals("nanny"));
81.259 -// weakly typed invocation (using MHs.invoke)
81.260 -s = (String) mh.invokeWithArguments("sappy", 'p', 'v');
81.261 -assert(s.equals("savvy"));
81.262 -// mt is (Object[])List
81.263 -mt = MethodType.methodType(java.util.List.class, Object[].class);
81.264 -mh = lookup.findStatic(java.util.Arrays.class, "asList", mt);
81.265 -assert(mh.isVarargsCollector());
81.266 -x = mh.invokeGeneric("one", "two");
81.267 -// invokeGeneric(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;
81.268 -assert(x.equals(java.util.Arrays.asList("one","two")));
81.269 -// mt is (Object,Object,Object)Object
81.270 -mt = MethodType.genericMethodType(3);
81.271 -mh = mh.asType(mt);
81.272 -x = mh.invokeExact((Object)1, (Object)2, (Object)3);
81.273 -// invokeExact(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
81.274 -assert(x.equals(java.util.Arrays.asList(1,2,3)));
81.275 -// mt is { => int}
81.276 -mt = MethodType.methodType(int.class);
81.277 -mh = lookup.findVirtual(java.util.List.class, "size", mt);
81.278 -i = (int) mh.invokeExact(java.util.Arrays.asList(1,2,3));
81.279 -// invokeExact(Ljava/util/List;)I
81.280 -assert(i == 3);
81.281 -mt = MethodType.methodType(void.class, String.class);
81.282 -mh = lookup.findVirtual(java.io.PrintStream.class, "println", mt);
81.283 -mh.invokeExact(System.out, "Hello, world.");
81.284 -// invokeExact(Ljava/io/PrintStream;Ljava/lang/String;)V
81.285 - * </pre></blockquote>
81.286 - * Each of the above calls to {@code invokeExact} or {@code invokeGeneric}
81.287 - * generates a single invokevirtual instruction with
81.288 - * the type descriptor indicated in the following comment.
81.289 - *
81.290 - * <h3>Exceptions</h3>
81.291 - * The methods {@code invokeExact} and {@code invokeGeneric} are declared
81.292 - * to throw {@link java.lang.Throwable Throwable},
81.293 - * which is to say that there is no static restriction on what a method handle
81.294 - * can throw. Since the JVM does not distinguish between checked
81.295 - * and unchecked exceptions (other than by their class, of course),
81.296 - * there is no particular effect on bytecode shape from ascribing
81.297 - * checked exceptions to method handle invocations. But in Java source
81.298 - * code, methods which perform method handle calls must either explicitly
81.299 - * throw {@code java.lang.Throwable Throwable}, or else must catch all
81.300 - * throwables locally, rethrowing only those which are legal in the context,
81.301 - * and wrapping ones which are illegal.
81.302 - *
81.303 - * <h3><a name="sigpoly"></a>Signature polymorphism</h3>
81.304 - * The unusual compilation and linkage behavior of
81.305 - * {@code invokeExact} and {@code invokeGeneric}
81.306 - * is referenced by the term <em>signature polymorphism</em>.
81.307 - * A signature polymorphic method is one which can operate with
81.308 - * any of a wide range of call signatures and return types.
81.309 - * In order to make this work, both the Java compiler and the JVM must
81.310 - * give special treatment to signature polymorphic methods.
81.311 - * <p>
81.312 - * In source code, a call to a signature polymorphic method will
81.313 - * compile, regardless of the requested type descriptor.
81.314 - * As usual, the Java compiler emits an {@code invokevirtual}
81.315 - * instruction with the given type descriptor against the named method.
81.316 - * The unusual part is that the type descriptor is derived from
81.317 - * the actual argument and return types, not from the method declaration.
81.318 - * <p>
81.319 - * When the JVM processes bytecode containing signature polymorphic calls,
81.320 - * it will successfully link any such call, regardless of its type descriptor.
81.321 - * (In order to retain type safety, the JVM will guard such calls with suitable
81.322 - * dynamic type checks, as described elsewhere.)
81.323 - * <p>
81.324 - * Bytecode generators, including the compiler back end, are required to emit
81.325 - * untransformed type descriptors for these methods.
81.326 - * Tools which determine symbolic linkage are required to accept such
81.327 - * untransformed descriptors, without reporting linkage errors.
81.328 - * <p>
81.329 - * For the sake of tools (but not as a programming API), the signature polymorphic
81.330 - * methods are marked with a private yet standard annotation,
81.331 - * {@code @java.dyn.MethodHandle.PolymorphicSignature}.
81.332 - * The annotation's retention is {@code RUNTIME}, so that all tools can see it.
81.333 - *
81.334 - * <h3>Formal rules for processing signature polymorphic methods</h3>
81.335 - * <p>
81.336 - * The following methods (and no others) are signature polymorphic:
81.337 - * <ul>
81.338 - * <li>{@link java.dyn.MethodHandle#invokeExact MethodHandle.invokeExact}
81.339 - * <li>{@link java.dyn.MethodHandle#invokeGeneric MethodHandle.invokeGeneric}
81.340 - * </ul>
81.341 - * <p>
81.342 - * A signature polymorphic method will be declared with the following properties:
81.343 - * <ul>
81.344 - * <li>It must be native.
81.345 - * <li>It must take a single varargs parameter of the form {@code Object...}.
81.346 - * <li>It must produce a return value of type {@code Object}.
81.347 - * <li>It must be contained within the {@code java.dyn} package.
81.348 - * </ul>
81.349 - * Because of these requirements, a signature polymorphic method is able to accept
81.350 - * any number and type of actual arguments, and can, with a cast, produce a value of any type.
81.351 - * However, the JVM will treat these declaration features as a documentation convention,
81.352 - * rather than a description of the actual structure of the methods as executed.
81.353 - * <p>
81.354 - * When a call to a signature polymorphic method is compiled, the associated linkage information for
81.355 - * its arguments is not array of {@code Object} (as for other similar varargs methods)
81.356 - * but rather the erasure of the static types of all the arguments.
81.357 - * <p>
81.358 - * In an argument position of a method invocation on a signature polymorphic method,
81.359 - * a null literal has type {@code java.lang.Void}, unless cast to a reference type.
81.360 - * (Note: This typing rule allows the null type to have its own encoding in linkage information
81.361 - * distinct from other types.
81.362 - * <p>
81.363 - * The linkage information for the return type is derived from a context-dependent target typing convention.
81.364 - * The return type for a signature polymorphic method invocation is determined as follows:
81.365 - * <ul>
81.366 - * <li>If the method invocation expression is an expression statement, the method is {@code void}.
81.367 - * <li>Otherwise, if the method invocation expression is the immediate operand of a cast,
81.368 - * the return type is the erasure of the cast type.
81.369 - * <li>Otherwise, the return type is the method's nominal return type, {@code Object}.
81.370 - * </ul>
81.371 - * (Programmers are encouraged to use explicit casts unless it is clear that a signature polymorphic
81.372 - * call will be used as a plain {@code Object} expression.)
81.373 - * <p>
81.374 - * The linkage information for argument and return types is stored in the descriptor for the
81.375 - * compiled (bytecode) call site. As for any invocation instruction, the arguments and return value
81.376 - * will be passed directly on the JVM stack, in accordance with the descriptor,
81.377 - * and without implicit boxing or unboxing.
81.378 - *
81.379 - * <h3>Interoperation between method handles and the Core Reflection API</h3>
81.380 - * Using factory methods in the {@link java.dyn.MethodHandles.Lookup Lookup} API,
81.381 - * any class member represented by a Core Reflection API object
81.382 - * can be converted to a behaviorally equivalent method handle.
81.383 - * For example, a reflective {@link java.lang.reflect.Method Method} can
81.384 - * be converted to a method handle using
81.385 - * {@link java.dyn.MethodHandles.Lookup#unreflect Lookup.unreflect}.
81.386 - * The resulting method handles generally provide more direct and efficient
81.387 - * access to the underlying class members.
81.388 - * <p>
81.389 - * As a special case,
81.390 - * when the Core Reflection API is used to view the signature polymorphic
81.391 - * methods {@code invokeExact} or {@code invokeGeneric} in this class,
81.392 - * they appear as single, non-polymorphic native methods.
81.393 - * Calls to these native methods do not result in method handle invocations.
81.394 - * Since {@code invokevirtual} instructions can natively
81.395 - * invoke method handles under any type descriptor, this reflective view conflicts
81.396 - * with the normal presentation via bytecodes.
81.397 - * Thus, these two native methods, as viewed by
81.398 - * {@link java.lang.Class#getDeclaredMethod Class.getDeclaredMethod},
81.399 - * are placeholders only.
81.400 - * If invoked via {@link java.lang.reflect.Method#invoke Method.invoke},
81.401 - * they will throw {@code UnsupportedOperationException}.
81.402 - * <p>
81.403 - * In order to obtain an invoker method for a particular type descriptor,
81.404 - * use {@link java.dyn.MethodHandles#exactInvoker MethodHandles.exactInvoker},
81.405 - * or {@link java.dyn.MethodHandles#genericInvoker MethodHandles.genericInvoker}.
81.406 - * The {@link java.dyn.MethodHandles.Lookup#findVirtual Lookup.findVirtual}
81.407 - * API is also able to return a method handle
81.408 - * to call {@code invokeExact} or {@code invokeGeneric},
81.409 - * for any specified type descriptor .
81.410 - *
81.411 - * <h3>Interoperation between method handles and Java generics</h3>
81.412 - * A method handle can be obtained on a method, constructor, or field
81.413 - * which is declared with Java generic types.
81.414 - * As with the Core Reflection API, the type of the method handle
81.415 - * will constructed from the erasure of the source-level type.
81.416 - * When a method handle is invoked, the types of its arguments
81.417 - * or the return value cast type may be generic types or type instances.
81.418 - * If this occurs, the compiler will replace those
81.419 - * types by their erasures when when it constructs the type descriptor
81.420 - * for the {@code invokevirtual} instruction.
81.421 - * <p>
81.422 - * Method handles do not represent
81.423 - * their function-like types in terms of Java parameterized (generic) types,
81.424 - * because there are three mismatches between function-like types and parameterized
81.425 - * Java types.
81.426 - * <ul>
81.427 - * <li>Method types range over all possible arities,
81.428 - * from no arguments to up to 255 of arguments (a limit imposed by the JVM).
81.429 - * Generics are not variadic, and so cannot represent this.</li>
81.430 - * <li>Method types can specify arguments of primitive types,
81.431 - * which Java generic types cannot range over.</li>
81.432 - * <li>Higher order functions over method handles (combinators) are
81.433 - * often generic across a wide range of function types, including
81.434 - * those of multiple arities. It is impossible to represent such
81.435 - * genericity with a Java type parameter.</li>
81.436 - * </ul>
81.437 - *
81.438 - * @see MethodType
81.439 - * @see MethodHandles
81.440 - * @author John Rose, JSR 292 EG
81.441 - */
81.442 -public abstract class MethodHandle
81.443 - // Note: This is an implementation inheritance hack, and will be removed
81.444 - // with a JVM change which moves the required hidden state onto this class.
81.445 - extends MethodHandleImpl
81.446 -{
81.447 - private static Access IMPL_TOKEN = Access.getToken();
81.448 - static { MethodHandleImpl.initStatics(); }
81.449 -
81.450 - // interface MethodHandle<R throws X extends Exception,A...>
81.451 - // { MethodType<R throws X,A...> type(); public R invokeExact(A...) throws X; }
81.452 -
81.453 - /**
81.454 - * Internal marker interface which distinguishes (to the Java compiler)
81.455 - * those methods which are <a href="MethodHandle.html#sigpoly">signature polymorphic</a>.
81.456 - */
81.457 - @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD})
81.458 - @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
81.459 - @interface PolymorphicSignature { }
81.460 -
81.461 - private MethodType type;
81.462 -
81.463 - /**
81.464 - * Report the type of this method handle.
81.465 - * Every invocation of this method handle via {@code invokeExact} must exactly match this type.
81.466 - * @return the method handle type
81.467 - */
81.468 - public MethodType type() {
81.469 - return type;
81.470 - }
81.471 -
81.472 - /**
81.473 - * <em>CONSTRUCTOR WILL BE REMOVED FOR PFD:</em>
81.474 - * Temporary constructor in early versions of the Reference Implementation.
81.475 - * Method handle inheritance (if any) will be contained completely within
81.476 - * the {@code java.dyn} package.
81.477 - */
81.478 - // The constructor for MethodHandle may only be called by privileged code.
81.479 - // Subclasses may be in other packages, but must possess
81.480 - // a token which they obtained from MH with a security check.
81.481 - // @param token non-null object which proves access permission
81.482 - // @param type type (permanently assigned) of the new method handle
81.483 - protected MethodHandle(Access token, MethodType type) {
81.484 - super(token);
81.485 - Access.check(token);
81.486 - this.type = type;
81.487 - }
81.488 -
81.489 - private void initType(MethodType type) {
81.490 - type.getClass(); // elicit NPE
81.491 - if (this.type != null) throw new InternalError();
81.492 - this.type = type;
81.493 - }
81.494 -
81.495 - static {
81.496 - // This hack allows the implementation package special access to
81.497 - // the internals of MethodHandle. In particular, the MTImpl has all sorts
81.498 - // of cached information useful to the implementation code.
81.499 - MethodHandleImpl.setMethodHandleFriend(IMPL_TOKEN, new MethodHandleImpl.MethodHandleFriend() {
81.500 - public void initType(MethodHandle mh, MethodType type) { mh.initType(type); }
81.501 - });
81.502 - }
81.503 -
81.504 - /**
81.505 - * Invoke the method handle, allowing any caller type descriptor, but requiring an exact type match.
81.506 - * The type descriptor at the call site of {@code invokeExact} must
81.507 - * exactly match this method handle's {@link #type type}.
81.508 - * No conversions are allowed on arguments or return values.
81.509 - * <p>
81.510 - * When this method is observed via the Core Reflection API,
81.511 - * it will appear as a single native method, taking an object array and returning an object.
81.512 - * If this native method is invoked directly via
81.513 - * {@link java.lang.reflect.Method#invoke Method.invoke}, via JNI,
81.514 - * or indirectly via {@link java.dyn.MethodHandles.Lookup#unreflect Lookup.unreflect},
81.515 - * it will throw an {@code UnsupportedOperationException}.
81.516 - * @throws WrongMethodTypeException if the target's type is not identical with the caller's type descriptor
81.517 - * @throws Throwable anything thrown by the underlying method propagates unchanged through the method handle call
81.518 - */
81.519 - public final native @PolymorphicSignature Object invokeExact(Object... args) throws Throwable;
81.520 -
81.521 - /**
81.522 - * Invoke the method handle, allowing any caller type descriptor,
81.523 - * and optionally performing conversions on arguments and return values.
81.524 - * <p>
81.525 - * If the call site type descriptor exactly matches this method handle's {@link #type type},
81.526 - * the call proceeds as if by {@link #invokeExact invokeExact}.
81.527 - * <p>
81.528 - * Otherwise, the call proceeds as if this method handle were first
81.529 - * adjusted by calling {@link #asType asType} to adjust this method handle
81.530 - * to the required type, and then the call proceeds as if by
81.531 - * {@link #invokeExact invokeExact} on the adjusted method handle.
81.532 - * <p>
81.533 - * There is no guarantee that the {@code asType} call is actually made.
81.534 - * If the JVM can predict the results of making the call, it may perform
81.535 - * adaptations directly on the caller's arguments,
81.536 - * and call the target method handle according to its own exact type.
81.537 - * <p>
81.538 - * The type descriptor at the call site of {@code invokeGeneric} must
81.539 - * be a valid argument to the receivers {@code asType} method.
81.540 - * In particular, the caller must specify the same argument arity
81.541 - * as the callee's type,
81.542 - * if the callee is not a {@linkplain #asVarargsCollector variable arity collector}.
81.543 - * <p>
81.544 - * When this method is observed via the Core Reflection API,
81.545 - * it will appear as a single native method, taking an object array and returning an object.
81.546 - * If this native method is invoked directly via
81.547 - * {@link java.lang.reflect.Method#invoke Method.invoke}, via JNI,
81.548 - * or indirectly via {@link java.dyn.MethodHandles.Lookup#unreflect Lookup.unreflect},
81.549 - * it will throw an {@code UnsupportedOperationException}.
81.550 - * @throws WrongMethodTypeException if the target's type cannot be adjusted to the caller's type descriptor
81.551 - * @throws ClassCastException if the target's type can be adjusted to the caller, but a reference cast fails
81.552 - * @throws Throwable anything thrown by the underlying method propagates unchanged through the method handle call
81.553 - */
81.554 - public final native @PolymorphicSignature Object invokeGeneric(Object... args) throws Throwable;
81.555 -
81.556 - /**
81.557 - * Perform a varargs invocation, passing the arguments in the given array
81.558 - * to the method handle, as if via {@link #invokeGeneric invokeGeneric} from a call site
81.559 - * which mentions only the type {@code Object}, and whose arity is the length
81.560 - * of the argument array.
81.561 - * <p>
81.562 - * Specifically, execution proceeds as if by the following steps,
81.563 - * although the methods are not guaranteed to be called if the JVM
81.564 - * can predict their effects.
81.565 - * <ul>
81.566 - * <li>Determine the length of the argument array as {@code N}.
81.567 - * For a null reference, {@code N=0}. </li>
81.568 - * <li>Determine the generic type {@code TN} of {@code N} arguments as
81.569 - * as {@code TN=MethodType.genericMethodType(N)}.</li>
81.570 - * <li>Force the original target method handle {@code MH0} to the
81.571 - * required type, as {@code MH1 = MH0.asType(TN)}. </li>
81.572 - * <li>Spread the array into {@code N} separate arguments {@code A0, ...}. </li>
81.573 - * <li>Invoke the type-adjusted method handle on the unpacked arguments:
81.574 - * MH1.invokeExact(A0, ...). </li>
81.575 - * <li>Take the return value as an {@code Object} reference. </li>
81.576 - * </ul>
81.577 - * <p>
81.578 - * Because of the action of the {@code asType} step, the following argument
81.579 - * conversions are applied as necessary:
81.580 - * <ul>
81.581 - * <li>reference casting
81.582 - * <li>unboxing
81.583 - * <li>widening primitive conversions
81.584 - * </ul>
81.585 - * <p>
81.586 - * The result returned by the call is boxed if it is a primitive,
81.587 - * or forced to null if the return type is void.
81.588 - * <p>
81.589 - * This call is equivalent to the following code:
81.590 - * <p><blockquote><pre>
81.591 - * MethodHandle invoker = MethodHandles.spreadInvoker(this.type(), 0);
81.592 - * Object result = invoker.invokeExact(this, arguments);
81.593 - * </pre></blockquote>
81.594 - * <p>
81.595 - * Unlike the signature polymorphic methods {@code invokeExact} and {@code invokeGeneric},
81.596 - * {@code invokeWithArguments} can be accessed normally via the Core Reflection API and JNI.
81.597 - * It can therefore be used as a bridge between native or reflective code and method handles.
81.598 - *
81.599 - * @param arguments the arguments to pass to the target
81.600 - * @return the result returned by the target
81.601 - * @throws ClassCastException if an argument cannot be converted by reference casting
81.602 - * @throws WrongMethodTypeException if the target's type cannot be adjusted to take the given number of {@code Object} arguments
81.603 - * @throws Throwable anything thrown by the target method invocation
81.604 - * @see MethodHandles#spreadInvoker
81.605 - */
81.606 - public Object invokeWithArguments(Object... arguments) throws Throwable {
81.607 - int argc = arguments == null ? 0 : arguments.length;
81.608 - MethodType type = type();
81.609 - if (type.parameterCount() != argc) {
81.610 - // simulate invokeGeneric
81.611 - return asType(MethodType.genericMethodType(argc)).invokeWithArguments(arguments);
81.612 - }
81.613 - if (argc <= 10) {
81.614 - MethodHandle invoker = invokers(type).genericInvoker();
81.615 - switch (argc) {
81.616 - case 0: return invoker.invokeExact(this);
81.617 - case 1: return invoker.invokeExact(this,
81.618 - arguments[0]);
81.619 - case 2: return invoker.invokeExact(this,
81.620 - arguments[0], arguments[1]);
81.621 - case 3: return invoker.invokeExact(this,
81.622 - arguments[0], arguments[1], arguments[2]);
81.623 - case 4: return invoker.invokeExact(this,
81.624 - arguments[0], arguments[1], arguments[2],
81.625 - arguments[3]);
81.626 - case 5: return invoker.invokeExact(this,
81.627 - arguments[0], arguments[1], arguments[2],
81.628 - arguments[3], arguments[4]);
81.629 - case 6: return invoker.invokeExact(this,
81.630 - arguments[0], arguments[1], arguments[2],
81.631 - arguments[3], arguments[4], arguments[5]);
81.632 - case 7: return invoker.invokeExact(this,
81.633 - arguments[0], arguments[1], arguments[2],
81.634 - arguments[3], arguments[4], arguments[5],
81.635 - arguments[6]);
81.636 - case 8: return invoker.invokeExact(this,
81.637 - arguments[0], arguments[1], arguments[2],
81.638 - arguments[3], arguments[4], arguments[5],
81.639 - arguments[6], arguments[7]);
81.640 - case 9: return invoker.invokeExact(this,
81.641 - arguments[0], arguments[1], arguments[2],
81.642 - arguments[3], arguments[4], arguments[5],
81.643 - arguments[6], arguments[7], arguments[8]);
81.644 - case 10: return invoker.invokeExact(this,
81.645 - arguments[0], arguments[1], arguments[2],
81.646 - arguments[3], arguments[4], arguments[5],
81.647 - arguments[6], arguments[7], arguments[8],
81.648 - arguments[9]);
81.649 - }
81.650 - }
81.651 -
81.652 - // more than ten arguments get boxed in a varargs list:
81.653 - MethodHandle invoker = invokers(type).spreadInvoker(0);
81.654 - return invoker.invokeExact(this, arguments);
81.655 - }
81.656 - /** Equivalent to {@code invokeWithArguments(arguments.toArray())}. */
81.657 - public Object invokeWithArguments(java.util.List<?> arguments) throws Throwable {
81.658 - return invokeWithArguments(arguments.toArray());
81.659 - }
81.660 -
81.661 - /**
81.662 - * Produce an adapter method handle which adapts the type of the
81.663 - * current method handle to a new type
81.664 - * The resulting method handle is guaranteed to report a type
81.665 - * which is equal to the desired new type.
81.666 - * <p>
81.667 - * If the original type and new type are equal, returns {@code this}.
81.668 - * <p>
81.669 - * This method provides the crucial behavioral difference between
81.670 - * {@link #invokeExact invokeExact} and {@link #invokeGeneric invokeGeneric}. The two methods
81.671 - * perform the same steps when the caller's type descriptor is identical
81.672 - * with the callee's, but when the types differ, {@link #invokeGeneric invokeGeneric}
81.673 - * also calls {@code asType} (or some internal equivalent) in order
81.674 - * to match up the caller's and callee's types.
81.675 - * <p>
81.676 - * This method is equivalent to {@link MethodHandles#convertArguments convertArguments},
81.677 - * except for variable arity method handles produced by {@link #asVarargsCollector asVarargsCollector}.
81.678 - *
81.679 - * @param newType the expected type of the new method handle
81.680 - * @return a method handle which delegates to {@code this} after performing
81.681 - * any necessary argument conversions, and arranges for any
81.682 - * necessary return value conversions
81.683 - * @throws WrongMethodTypeException if the conversion cannot be made
81.684 - * @see MethodHandles#convertArguments
81.685 - */
81.686 - public MethodHandle asType(MethodType newType) {
81.687 - return MethodHandles.convertArguments(this, newType);
81.688 - }
81.689 -
81.690 - /**
81.691 - * Make an adapter which accepts a trailing array argument
81.692 - * and spreads its elements as positional arguments.
81.693 - * The new method handle adapts, as its <i>target</i>,
81.694 - * the current method handle. The type of the adapter will be
81.695 - * the same as the type of the target, except that the final
81.696 - * {@code arrayLength} parameters of the target's type are replaced
81.697 - * by a single array parameter of type {@code arrayType}.
81.698 - * <p>
81.699 - * If the array element type differs from any of the corresponding
81.700 - * argument types on the original target,
81.701 - * the original target is adapted to take the array elements directly,
81.702 - * as if by a call to {@link #asType asType}.
81.703 - * <p>
81.704 - * When called, the adapter replaces a trailing array argument
81.705 - * by the array's elements, each as its own argument to the target.
81.706 - * (The order of the arguments is preserved.)
81.707 - * They are converted pairwise by casting and/or unboxing
81.708 - * to the types of the trailing parameters of the target.
81.709 - * Finally the target is called.
81.710 - * What the target eventually returns is returned unchanged by the adapter.
81.711 - * <p>
81.712 - * Before calling the target, the adapter verifies that the array
81.713 - * contains exactly enough elements to provide a correct argument count
81.714 - * to the target method handle.
81.715 - * (The array may also be null when zero elements are required.)
81.716 - * @param arrayType usually {@code Object[]}, the type of the array argument from which to extract the spread arguments
81.717 - * @param arrayLength the number of arguments to spread from an incoming array argument
81.718 - * @return a new method handle which spreads its final array argument,
81.719 - * before calling the original method handle
81.720 - * @throws IllegalArgumentException if {@code arrayType} is not an array type
81.721 - * @throws IllegalArgumentException if target does not have at least
81.722 - * {@code arrayLength} parameter types
81.723 - * @throws WrongMethodTypeException if the implied {@code asType} call fails
81.724 - * @see #asCollector
81.725 - */
81.726 - public MethodHandle asSpreader(Class<?> arrayType, int arrayLength) {
81.727 - Class<?> arrayElement = arrayType.getComponentType();
81.728 - if (arrayElement == null) throw newIllegalArgumentException("not an array type");
81.729 - MethodType oldType = type();
81.730 - int nargs = oldType.parameterCount();
81.731 - if (nargs < arrayLength) throw newIllegalArgumentException("bad spread array length");
81.732 - int keepPosArgs = nargs - arrayLength;
81.733 - MethodType newType = oldType.dropParameterTypes(keepPosArgs, nargs);
81.734 - newType = newType.insertParameterTypes(keepPosArgs, arrayType);
81.735 - return MethodHandles.spreadArguments(this, newType);
81.736 - }
81.737 -
81.738 - /**
81.739 - * Make an adapter which accepts a given number of trailing
81.740 - * positional arguments and collects them into an array argument.
81.741 - * The new method handle adapts, as its <i>target</i>,
81.742 - * the current method handle. The type of the adapter will be
81.743 - * the same as the type of the target, except that a single trailing
81.744 - * parameter (usually of type {@code arrayType}) is replaced by
81.745 - * {@code arrayLength} parameters whose type is element type of {@code arrayType}.
81.746 - * <p>
81.747 - * If the array type differs from the final argument type on the original target,
81.748 - * the original target is adapted to take the array type directly,
81.749 - * as if by a call to {@link #asType asType}.
81.750 - * <p>
81.751 - * When called, the adapter replaces its trailing {@code arrayLength}
81.752 - * arguments by a single new array of type {@code arrayType}, whose elements
81.753 - * comprise (in order) the replaced arguments.
81.754 - * Finally the target is called.
81.755 - * What the target eventually returns is returned unchanged by the adapter.
81.756 - * <p>
81.757 - * (The array may also be a shared constant when {@code arrayLength} is zero.)
81.758 - * <p>
81.759 - * (<em>Note:</em> The {@code arrayType} is often identical to the last
81.760 - * parameter type of the original target.
81.761 - * It is an explicit argument for symmetry with {@code asSpreader}, and also
81.762 - * to allow the target to use a simple {@code Object} as its last parameter type.)
81.763 - * <p>
81.764 - * In order to create a collecting adapter which is not restricted to a particular
81.765 - * number of collected arguments, use {@link #asVarargsCollector asVarargsCollector} instead.
81.766 - * @param arrayType often {@code Object[]}, the type of the array argument which will collect the arguments
81.767 - * @param arrayLength the number of arguments to collect into a new array argument
81.768 - * @return a new method handle which collects some trailing argument
81.769 - * into an array, before calling the original method handle
81.770 - * @throws IllegalArgumentException if {@code arrayType} is not an array type
81.771 - * or {@code arrayType} is not assignable to this method handle's trailing parameter type,
81.772 - * or {@code arrayLength} is not a legal array size
81.773 - * @throws WrongMethodTypeException if the implied {@code asType} call fails
81.774 - * @see #asSpreader
81.775 - * @see #asVarargsCollector
81.776 - */
81.777 - public MethodHandle asCollector(Class<?> arrayType, int arrayLength) {
81.778 - Class<?> arrayElement = arrayType.getComponentType();
81.779 - if (arrayElement == null) throw newIllegalArgumentException("not an array type");
81.780 - MethodType oldType = type();
81.781 - int nargs = oldType.parameterCount();
81.782 - if (nargs == 0) throw newIllegalArgumentException("no trailing argument");
81.783 - MethodType newType = oldType.dropParameterTypes(nargs-1, nargs);
81.784 - newType = newType.insertParameterTypes(nargs-1,
81.785 - java.util.Collections.<Class<?>>nCopies(arrayLength, arrayElement));
81.786 - return MethodHandles.collectArguments(this, newType);
81.787 - }
81.788 -
81.789 - /**
81.790 - * Make a <em>variable arity</em> adapter which is able to accept
81.791 - * any number of trailing positional arguments and collect them
81.792 - * into an array argument.
81.793 - * <p>
81.794 - * The type and behavior of the adapter will be the same as
81.795 - * the type and behavior of the target, except that certain
81.796 - * {@code invokeGeneric} and {@code asType} requests can lead to
81.797 - * trailing positional arguments being collected into target's
81.798 - * trailing parameter.
81.799 - * Also, the last parameter type of the adapter will be
81.800 - * {@code arrayType}, even if the target has a different
81.801 - * last parameter type.
81.802 - * <p>
81.803 - * When called with {@link #invokeExact invokeExact}, the adapter invokes
81.804 - * the target with no argument changes.
81.805 - * (<em>Note:</em> This behavior is different from a
81.806 - * {@linkplain #asCollector fixed arity collector},
81.807 - * since it accepts a whole array of indeterminate length,
81.808 - * rather than a fixed number of arguments.)
81.809 - * <p>
81.810 - * When called with {@link #invokeGeneric invokeGeneric}, if the caller
81.811 - * type is the same as the adapter, the adapter invokes the target as with
81.812 - * {@code invokeExact}.
81.813 - * (This is the normal behavior for {@code invokeGeneric} when types match.)
81.814 - * <p>
81.815 - * Otherwise, if the caller and adapter arity are the same, and the
81.816 - * trailing parameter type of the caller is a reference type identical to
81.817 - * or assignable to the trailing parameter type of the adapter,
81.818 - * the arguments and return values are converted pairwise,
81.819 - * as if by {@link MethodHandles#convertArguments convertArguments}.
81.820 - * (This is also normal behavior for {@code invokeGeneric} in such a case.)
81.821 - * <p>
81.822 - * Otherwise, the arities differ, or the adapter's trailing parameter
81.823 - * type is not assignable from the corresponding caller type.
81.824 - * In this case, the adapter replaces all trailing arguments from
81.825 - * the original trailing argument position onward, by
81.826 - * a new array of type {@code arrayType}, whose elements
81.827 - * comprise (in order) the replaced arguments.
81.828 - * <p>
81.829 - * The caller type must provides as least enough arguments,
81.830 - * and of the correct type, to satisfy the target's requirement for
81.831 - * positional arguments before the trailing array argument.
81.832 - * Thus, the caller must supply, at a minimum, {@code N-1} arguments,
81.833 - * where {@code N} is the arity of the target.
81.834 - * Also, there must exist conversions from the incoming arguments
81.835 - * to the target's arguments.
81.836 - * As with other uses of {@code invokeGeneric}, if these basic
81.837 - * requirements are not fulfilled, a {@code WrongMethodTypeException}
81.838 - * may be thrown.
81.839 - * <p>
81.840 - * In all cases, what the target eventually returns is returned unchanged by the adapter.
81.841 - * <p>
81.842 - * In the final case, it is exactly as if the target method handle were
81.843 - * temporarily adapted with a {@linkplain #asCollector fixed arity collector}
81.844 - * to the arity required by the caller type.
81.845 - * (As with {@code asCollector}, if the array length is zero,
81.846 - * a shared constant may be used instead of a new array.
81.847 - * If the implied call to {@code asCollector} would throw
81.848 - * an {@code IllegalArgumentException} or {@code WrongMethodTypeException},
81.849 - * the call to the variable arity adapter must throw
81.850 - * {@code WrongMethodTypeException}.)
81.851 - * <p>
81.852 - * The behavior of {@link #asType asType} is also specialized for
81.853 - * variable arity adapters, to maintain the invariant that
81.854 - * {@code invokeGeneric} is always equivalent to an {@code asType}
81.855 - * call to adjust the target type, followed by {@code invokeExact}.
81.856 - * Therefore, a variable arity adapter responds
81.857 - * to an {@code asType} request by building a fixed arity collector,
81.858 - * if and only if the adapter and requested type differ either
81.859 - * in arity or trailing argument type.
81.860 - * The resulting fixed arity collector has its type further adjusted
81.861 - * (if necessary) to the requested type by pairwise conversion,
81.862 - * as if by another application of {@code asType}.
81.863 - * <p>
81.864 - * When a method handle is obtained by executing an {@code ldc} instruction
81.865 - * of a {@code CONSTANT_MethodHandle} constant, and the target method is marked
81.866 - * as a variable arity method (with the modifier bit {@code 0x0080}),
81.867 - * the method handle will accept multiple arities, as if the method handle
81.868 - * constant were created by means of a call to {@code asVarargsCollector}.
81.869 - * <p>
81.870 - * In order to create a collecting adapter which collects a predetermined
81.871 - * number of arguments, and whose type reflects this predetermined number,
81.872 - * use {@link #asCollector asCollector} instead.
81.873 - * <p>
81.874 - * No method handle transformations produce new method handles with
81.875 - * variable arity, unless they are documented as doing so.
81.876 - * Therefore, besides {@code asVarargsCollector},
81.877 - * all methods in {@code MethodHandle} and {@code MethodHandles}
81.878 - * will return a method handle with fixed arity,
81.879 - * except in the cases where they are specified to return their original
81.880 - * operand (e.g., {@code asType} of the method handle's own type).
81.881 - * <p>
81.882 - * Calling {@code asVarargsCollector} on a method handle which is already
81.883 - * of variable arity will produce a method handle with the same type and behavior.
81.884 - * It may (or may not) return the original variable arity method handle.
81.885 - * <p>
81.886 - * Here is an example, of a list-making variable arity method handle:
81.887 - * <blockquote><pre>
81.888 -MethodHandle asList = publicLookup()
81.889 - .findStatic(Arrays.class, "asList", methodType(List.class, Object[].class))
81.890 - .asVarargsCollector(Object[].class);
81.891 -assertEquals("[]", asList.invokeGeneric().toString());
81.892 -assertEquals("[1]", asList.invokeGeneric(1).toString());
81.893 -assertEquals("[two, too]", asList.invokeGeneric("two", "too").toString());
81.894 -Object[] argv = { "three", "thee", "tee" };
81.895 -assertEquals("[three, thee, tee]", asList.invokeGeneric(argv).toString());
81.896 -List ls = (List) asList.invokeGeneric((Object)argv);
81.897 -assertEquals(1, ls.size());
81.898 -assertEquals("[three, thee, tee]", Arrays.toString((Object[])ls.get(0)));
81.899 - * </pre></blockquote>
81.900 - * <p style="font-size:smaller;">
81.901 - * <em>Discussion:</em>
81.902 - * These rules are designed as a dynamically-typed variation
81.903 - * of the Java rules for variable arity methods.
81.904 - * In both cases, callers to a variable arity method or method handle
81.905 - * can either pass zero or more positional arguments, or else pass
81.906 - * pre-collected arrays of any length. Users should be aware of the
81.907 - * special role of the final argument, and of the effect of a
81.908 - * type match on that final argument, which determines whether
81.909 - * or not a single trailing argument is interpreted as a whole
81.910 - * array or a single element of an array to be collected.
81.911 - * Note that the dynamic type of the trailing argument has no
81.912 - * effect on this decision, only a comparison between the static
81.913 - * type descriptor of the call site and the type of the method handle.)
81.914 - * <p style="font-size:smaller;">
81.915 - * As a result of the previously stated rules, the variable arity behavior
81.916 - * of a method handle may be suppressed, by binding it to the exact invoker
81.917 - * of its own type, as follows:
81.918 - * <blockquote><pre>
81.919 -MethodHandle vamh = publicLookup()
81.920 - .findStatic(Arrays.class, "asList", methodType(List.class, Object[].class))
81.921 - .asVarargsCollector(Object[].class);
81.922 -MethodHandle mh = MethodHandles.exactInvoker(vamh.type()).bindTo(vamh);
81.923 -assert(vamh.type().equals(mh.type()));
81.924 -assertEquals("[1, 2, 3]", vamh.invokeGeneric(1,2,3).toString());
81.925 -boolean failed = false;
81.926 -try { mh.invokeGeneric(1,2,3); }
81.927 -catch (WrongMethodTypeException ex) { failed = true; }
81.928 -assert(failed);
81.929 - * </pre></blockquote>
81.930 - * This transformation has no behavioral effect if the method handle is
81.931 - * not of variable arity.
81.932 - *
81.933 - * @param arrayType often {@code Object[]}, the type of the array argument which will collect the arguments
81.934 - * @return a new method handle which can collect any number of trailing arguments
81.935 - * into an array, before calling the original method handle
81.936 - * @throws IllegalArgumentException if {@code arrayType} is not an array type
81.937 - * or {@code arrayType} is not assignable to this method handle's trailing parameter type
81.938 - * @see #asCollector
81.939 - * @see #isVarargsCollector
81.940 - */
81.941 - public MethodHandle asVarargsCollector(Class<?> arrayType) {
81.942 - Class<?> arrayElement = arrayType.getComponentType();
81.943 - if (arrayElement == null) throw newIllegalArgumentException("not an array type");
81.944 - return MethodHandles.asVarargsCollector(this, arrayType);
81.945 - }
81.946 -
81.947 - /**
81.948 - * Determine if this method handle
81.949 - * supports {@linkplain #asVarargsCollector variable arity} calls.
81.950 - * Such method handles arise from the following sources:
81.951 - * <ul>
81.952 - * <li>a call to {@linkplain #asVarargsCollector asVarargsCollector}
81.953 - * <li>a call to a {@linkplain java.dyn.MethodHandles.Lookup lookup method}
81.954 - * which resolves to a variable arity Java method or constructor
81.955 - * <li>an {@code ldc} instruction of a {@code CONSTANT_MethodHandle}
81.956 - * which resolves to a variable arity Java method or constructor
81.957 - * </ul>
81.958 - * @return true if this method handle accepts more than one arity of {@code invokeGeneric} calls
81.959 - * @see #asVarargsCollector
81.960 - */
81.961 - public boolean isVarargsCollector() {
81.962 - return false;
81.963 - }
81.964 -
81.965 - /**
81.966 - * Bind a value {@code x} to the first argument of a method handle, without invoking it.
81.967 - * The new method handle adapts, as its <i>target</i>,
81.968 - * to the current method handle.
81.969 - * The type of the bound handle will be
81.970 - * the same as the type of the target, except that a single leading
81.971 - * reference parameter will be omitted.
81.972 - * <p>
81.973 - * When called, the bound handle inserts the given value {@code x}
81.974 - * as a new leading argument to the target. The other arguments are
81.975 - * also passed unchanged.
81.976 - * What the target eventually returns is returned unchanged by the bound handle.
81.977 - * <p>
81.978 - * The reference {@code x} must be convertible to the first parameter
81.979 - * type of the target.
81.980 - * @param x the value to bind to the first argument of the target
81.981 - * @return a new method handle which collects some trailing argument
81.982 - * into an array, before calling the original method handle
81.983 - * @throws IllegalArgumentException if the target does not have a
81.984 - * leading parameter type that is a reference type
81.985 - * @throws ClassCastException if {@code x} cannot be converted
81.986 - * to the leading parameter type of the target
81.987 - * @see MethodHandles#insertArguments
81.988 - */
81.989 - public MethodHandle bindTo(Object x) {
81.990 - return MethodHandles.insertArguments(this, 0, x);
81.991 - }
81.992 -
81.993 - /**
81.994 - * Returns a string representation of the method handle,
81.995 - * starting with the string {@code "MethodHandle"} and
81.996 - * ending with the string representation of the method handle's type.
81.997 - * In other words, this method returns a string equal to the value of:
81.998 - * <blockquote><pre>
81.999 - * "MethodHandle" + type().toString()
81.1000 - * </pre></blockquote>
81.1001 - * <p>
81.1002 - * Note: Future releases of this API may add further information
81.1003 - * to the string representation.
81.1004 - * Therefore, the present syntax should not be parsed by applications.
81.1005 - *
81.1006 - * @return a string representation of the method handle
81.1007 - */
81.1008 - @Override
81.1009 - public String toString() {
81.1010 - return MethodHandleImpl.getNameString(IMPL_TOKEN, this);
81.1011 - }
81.1012 -}
82.1 --- a/src/share/classes/java/dyn/MethodHandles.java Tue Mar 29 11:29:01 2011 -0700
82.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
82.3 @@ -1,2339 +0,0 @@
82.4 -/*
82.5 - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
82.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
82.7 - *
82.8 - * This code is free software; you can redistribute it and/or modify it
82.9 - * under the terms of the GNU General Public License version 2 only, as
82.10 - * published by the Free Software Foundation. Oracle designates this
82.11 - * particular file as subject to the "Classpath" exception as provided
82.12 - * by Oracle in the LICENSE file that accompanied this code.
82.13 - *
82.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
82.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
82.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
82.17 - * version 2 for more details (a copy is included in the LICENSE file that
82.18 - * accompanied this code).
82.19 - *
82.20 - * You should have received a copy of the GNU General Public License version
82.21 - * 2 along with this work; if not, write to the Free Software Foundation,
82.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
82.23 - *
82.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
82.25 - * or visit www.oracle.com if you need additional information or have any
82.26 - * questions.
82.27 - */
82.28 -
82.29 -package java.dyn;
82.30 -
82.31 -import java.lang.reflect.*;
82.32 -import sun.dyn.Access;
82.33 -import sun.dyn.MemberName;
82.34 -import sun.dyn.MethodHandleImpl;
82.35 -import sun.dyn.WrapperInstance;
82.36 -import sun.dyn.util.ValueConversions;
82.37 -import sun.dyn.util.VerifyAccess;
82.38 -import sun.dyn.util.Wrapper;
82.39 -import java.util.List;
82.40 -import java.util.ArrayList;
82.41 -import java.util.Arrays;
82.42 -import sun.dyn.Invokers;
82.43 -import sun.dyn.MethodTypeImpl;
82.44 -import sun.reflect.Reflection;
82.45 -import static sun.dyn.MemberName.newIllegalArgumentException;
82.46 -import static sun.dyn.MemberName.newNoAccessException;
82.47 -
82.48 -/**
82.49 - * This class consists exclusively of static methods that operate on or return
82.50 - * method handles. They fall into several categories:
82.51 - * <ul>
82.52 - * <li>Lookup methods which help create method handles for methods and fields.
82.53 - * <li>Combinator methods, which combine or transform pre-existing method handles into new ones.
82.54 - * <li>Other factory methods to create method handles that emulate other common JVM operations or control flow patterns.
82.55 - * <li>Wrapper methods which can convert between method handles and other function-like "SAM types".
82.56 - * </ul>
82.57 - * <p>
82.58 - * @author John Rose, JSR 292 EG
82.59 - */
82.60 -public class MethodHandles {
82.61 -
82.62 - private MethodHandles() { } // do not instantiate
82.63 -
82.64 - private static final Access IMPL_TOKEN = Access.getToken();
82.65 - private static final MemberName.Factory IMPL_NAMES = MemberName.getFactory(IMPL_TOKEN);
82.66 - static { MethodHandleImpl.initStatics(); }
82.67 - // See IMPL_LOOKUP below.
82.68 -
82.69 - //// Method handle creation from ordinary methods.
82.70 -
82.71 - /**
82.72 - * Return a {@link Lookup lookup object} on the caller,
82.73 - * which has the capability to access any method handle that the caller has access to,
82.74 - * including direct method handles to private fields and methods.
82.75 - * This lookup object is a <em>capability</em> which may be delegated to trusted agents.
82.76 - * Do not store it in place where untrusted code can access it.
82.77 - */
82.78 - public static Lookup lookup() {
82.79 - return new Lookup();
82.80 - }
82.81 -
82.82 - /**
82.83 - * Return a {@link Lookup lookup object} which is trusted minimally.
82.84 - * It can only be used to create method handles to
82.85 - * publicly accessible fields and methods.
82.86 - * <p>
82.87 - * As a matter of pure convention, the {@linkplain Lookup#lookupClass lookup class}
82.88 - * of this lookup object will be {@link java.lang.Object}.
82.89 - * <p>
82.90 - * The lookup class can be changed to any other class {@code C} using an expression of the form
82.91 - * {@linkplain Lookup#in <code>publicLookup().in(C.class)</code>}.
82.92 - * Since all classes have equal access to public names,
82.93 - * such a change would confer no new access rights.
82.94 - */
82.95 - public static Lookup publicLookup() {
82.96 - return Lookup.PUBLIC_LOOKUP;
82.97 - }
82.98 -
82.99 - /**
82.100 - * A <em>lookup object</em> is a factory for creating method handles,
82.101 - * when the creation requires access checking.
82.102 - * Method handles do not perform
82.103 - * access checks when they are called, but rather when they are created.
82.104 - * Therefore, method handle access
82.105 - * restrictions must be enforced when a method handle is created.
82.106 - * The caller class against which those restrictions are enforced
82.107 - * is known as the {@linkplain #lookupClass lookup class}.
82.108 - * <p>
82.109 - * A lookup class which needs to create method handles will call
82.110 - * {@link MethodHandles#lookup MethodHandles.lookup} to create a factory for itself.
82.111 - * When the {@code Lookup} factory object is created, the identity of the lookup class is
82.112 - * determined, and securely stored in the {@code Lookup} object.
82.113 - * The lookup class (or its delegates) may then use factory methods
82.114 - * on the {@code Lookup} object to create method handles for access-checked members.
82.115 - * This includes all methods, constructors, and fields which are allowed to the lookup class,
82.116 - * even private ones.
82.117 - * <p>
82.118 - * The factory methods on a {@code Lookup} object correspond to all major
82.119 - * use cases for methods, constructors, and fields.
82.120 - * Here is a summary of the correspondence between these factory methods and
82.121 - * the behavior the resulting method handles:
82.122 - * <code>
82.123 - * <table border=1 cellpadding=5 summary="lookup method behaviors">
82.124 - * <tr><th>lookup expression</th><th>member</th><th>behavior</th></tr>
82.125 - * <tr>
82.126 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#findGetter lookup.findGetter(C.class,"f",FT.class)}</td>
82.127 - * <td>FT f;</td><td>(T) this.f;</td>
82.128 - * </tr>
82.129 - * <tr>
82.130 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#findStaticGetter lookup.findStaticGetter(C.class,"f",FT.class)}</td>
82.131 - * <td>static<br>FT f;</td><td>(T) C.f;</td>
82.132 - * </tr>
82.133 - * <tr>
82.134 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#findSetter lookup.findSetter(C.class,"f",FT.class)}</td>
82.135 - * <td>FT f;</td><td>this.f = x;</td>
82.136 - * </tr>
82.137 - * <tr>
82.138 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#findStaticSetter lookup.findStaticSetter(C.class,"f",FT.class)}</td>
82.139 - * <td>static<br>FT f;</td><td>C.f = arg;</td>
82.140 - * </tr>
82.141 - * <tr>
82.142 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#findVirtual lookup.findVirtual(C.class,"m",MT)}</td>
82.143 - * <td>T m(A*);</td><td>(T) this.m(arg*);</td>
82.144 - * </tr>
82.145 - * <tr>
82.146 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#findStatic lookup.findStatic(C.class,"m",MT)}</td>
82.147 - * <td>static<br>T m(A*);</td><td>(T) C.m(arg*);</td>
82.148 - * </tr>
82.149 - * <tr>
82.150 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#findSpecial lookup.findSpecial(C.class,"m",MT,this.class)}</td>
82.151 - * <td>T m(A*);</td><td>(T) super.m(arg*);</td>
82.152 - * </tr>
82.153 - * <tr>
82.154 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#findConstructor lookup.findConstructor(C.class,MT)}</td>
82.155 - * <td>C(A*);</td><td>(T) new C(arg*);</td>
82.156 - * </tr>
82.157 - * <tr>
82.158 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#unreflectGetter lookup.unreflectGetter(aField)}</td>
82.159 - * <td>(static)?<br>FT f;</td><td>(FT) aField.get(thisOrNull);</td>
82.160 - * </tr>
82.161 - * <tr>
82.162 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#unreflectSetter lookup.unreflectSetter(aField)}</td>
82.163 - * <td>(static)?<br>FT f;</td><td>aField.set(thisOrNull, arg);</td>
82.164 - * </tr>
82.165 - * <tr>
82.166 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#unreflect lookup.unreflect(aMethod)}</td>
82.167 - * <td>(static)?<br>T m(A*);</td><td>(T) aMethod.invoke(thisOrNull, arg*);</td>
82.168 - * </tr>
82.169 - * <tr>
82.170 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#unreflectConstructor lookup.unreflectConstructor(aConstructor)}</td>
82.171 - * <td>C(A*);</td><td>(C) aConstructor.newInstance(arg*);</td>
82.172 - * </tr>
82.173 - * <tr>
82.174 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#unreflect lookup.unreflect(aMethod)}</td>
82.175 - * <td>(static)?<br>T m(A*);</td><td>(T) aMethod.invoke(thisOrNull, arg*);</td>
82.176 - * </tr>
82.177 - * </table>
82.178 - * </code>
82.179 - * Here, the type {@code C} is the class or interface being searched for a member,
82.180 - * documented as a parameter named {@code refc} in the lookup methods.
82.181 - * The method or constructor type {@code MT} is composed from the return type {@code T}
82.182 - * and the sequence of argument types {@code A*}.
82.183 - * Both {@code MT} and the field type {@code FT} are documented as a parameter named {@code type}.
82.184 - * The formal parameter {@code this} stands for the self-reference of type {@code C};
82.185 - * if it is present, it is always the leading argument to the method handle invocation.
82.186 - * The name {@code arg} stands for all the other method handle arguments.
82.187 - * In the code examples for the Core Reflection API, the name {@code thisOrNull}
82.188 - * stands for a null reference if the accessed method or field is static,
82.189 - * and {@code this} otherwise.
82.190 - * The names {@code aMethod}, {@code aField}, and {@code aConstructor} stand
82.191 - * for reflective objects corresponding to the given members.
82.192 - * <p>
82.193 - * The equivalence between looked-up method handles and underlying
82.194 - * class members can break down in a few ways:
82.195 - * <ul>
82.196 - * <li>If {@code C} is not symbolically accessible from the lookup class's loader,
82.197 - * the lookup can still succeed, even when there is no equivalent
82.198 - * Java expression or bytecoded constant.
82.199 - * <li>Likewise, if {@code T} or {@code MT}
82.200 - * is not symbolically accessible from the lookup class's loader,
82.201 - * the lookup can still succeed.
82.202 - * For example, lookups for {@code MethodHandle.invokeExact} and
82.203 - * {@code MethodHandle.invokeGeneric} will always succeed, regardless of requested type.
82.204 - * <li>If there is a security manager installed, it can forbid the lookup
82.205 - * on various grounds (<a href="#secmgr">see below</a>).
82.206 - * By contrast, the {@code ldc} instruction is not subject to
82.207 - * security manager checks.
82.208 - * </ul>
82.209 - *
82.210 - * <h3><a name="access"></a>Access checking</h3>
82.211 - * Access checks are applied in the factory methods of {@code Lookup},
82.212 - * when a method handle is created.
82.213 - * This is a key difference from the Core Reflection API, since
82.214 - * {@link java.lang.reflect.Method#invoke Method.invoke}
82.215 - * performs access checking against every caller, on every call.
82.216 - * <p>
82.217 - * All access checks start from a {@code Lookup} object, which
82.218 - * compares its recorded lookup class against all requests to
82.219 - * create method handles.
82.220 - * A single {@code Lookup} object can be used to create any number
82.221 - * of access-checked method handles, all checked against a single
82.222 - * lookup class.
82.223 - * <p>
82.224 - * A {@code Lookup} object can be shared with other trusted code,
82.225 - * such as a metaobject protocol.
82.226 - * A shared {@code Lookup} object delegates the capability
82.227 - * to create method handles on private members of the lookup class.
82.228 - * Even if privileged code uses the {@code Lookup} object,
82.229 - * the access checking is confined to the privileges of the
82.230 - * original lookup class.
82.231 - * <p>
82.232 - * A lookup can fail, because
82.233 - * the containing class is not accessible to the lookup class, or
82.234 - * because the desired class member is missing, or because the
82.235 - * desired class member is not accessible to the lookup class.
82.236 - * In any of these cases, a {@code ReflectiveOperationException} will be
82.237 - * thrown from the attempted lookup. The exact class will be one of
82.238 - * the following:
82.239 - * <ul>
82.240 - * <li>NoSuchMethodException — if a method is requested but does not exist
82.241 - * <li>NoSuchFieldException — if a field is requested but does not exist
82.242 - * <li>IllegalAccessException — if the member exists but an access check fails
82.243 - * </ul>
82.244 - * <p>
82.245 - * In general, the conditions under which a method handle may be
82.246 - * looked up for a method {@code M} are exactly equivalent to the conditions
82.247 - * under which the lookup class could have compiled and resolved a call to {@code M}.
82.248 - * And the effect of invoking the method handle resulting from the lookup
82.249 - * is exactly equivalent to executing the compiled and resolved call to {@code M}.
82.250 - * The same point is true of fields and constructors.
82.251 - * <p>
82.252 - * In some cases, access between nested classes is obtained by the Java compiler by creating
82.253 - * an wrapper method to access a private method of another class
82.254 - * in the same top-level declaration.
82.255 - * For example, a nested class {@code C.D}
82.256 - * can access private members within other related classes such as
82.257 - * {@code C}, {@code C.D.E}, or {@code C.B},
82.258 - * but the Java compiler may need to generate wrapper methods in
82.259 - * those related classes. In such cases, a {@code Lookup} object on
82.260 - * {@code C.E} would be unable to those private members.
82.261 - * A workaround for this limitation is the {@link Lookup#in Lookup.in} method,
82.262 - * which can transform a lookup on {@code C.E} into one on any of those other
82.263 - * classes, without special elevation of privilege.
82.264 - * <p>
82.265 - * Although bytecode instructions can only refer to classes in
82.266 - * a related class loader, this API can search for methods in any
82.267 - * class, as long as a reference to its {@code Class} object is
82.268 - * available. Such cross-loader references are also possible with the
82.269 - * Core Reflection API, and are impossible to bytecode instructions
82.270 - * such as {@code invokestatic} or {@code getfield}.
82.271 - * There is a {@linkplain java.lang.SecurityManager security manager API}
82.272 - * to allow applications to check such cross-loader references.
82.273 - * These checks apply to both the {@code MethodHandles.Lookup} API
82.274 - * and the Core Reflection API
82.275 - * (as found on {@link java.lang.Class Class}).
82.276 - * <p>
82.277 - * Access checks only apply to named and reflected methods,
82.278 - * constructors, and fields.
82.279 - * Other method handle creation methods, such as
82.280 - * {@link #convertArguments MethodHandles.convertArguments},
82.281 - * do not require any access checks, and are done
82.282 - * with static methods of {@link MethodHandles},
82.283 - * independently of any {@code Lookup} object.
82.284 - *
82.285 - * <h3>Security manager interactions</h3>
82.286 - * <a name="secmgr"></a>
82.287 - * If a security manager is present, member lookups are subject to
82.288 - * additional checks.
82.289 - * From one to four calls are made to the security manager.
82.290 - * Any of these calls can refuse access by throwing a
82.291 - * {@link java.lang.SecurityException SecurityException}.
82.292 - * Define {@code smgr} as the security manager,
82.293 - * {@code refc} as the containing class in which the member
82.294 - * is being sought, and {@code defc} as the class in which the
82.295 - * member is actually defined.
82.296 - * The calls are made according to the following rules:
82.297 - * <ul>
82.298 - * <li>In all cases, {@link SecurityManager#checkMemberAccess
82.299 - * smgr.checkMemberAccess(refc, Member.PUBLIC)} is called.
82.300 - * <li>If the class loader of the lookup class is not
82.301 - * the same as or an ancestor of the class loader of {@code refc},
82.302 - * then {@link SecurityManager#checkPackageAccess
82.303 - * smgr.checkPackageAccess(refcPkg)} is called,
82.304 - * where {@code refcPkg} is the package of {@code refc}.
82.305 - * <li>If the retrieved member is not public,
82.306 - * {@link SecurityManager#checkMemberAccess
82.307 - * smgr.checkMemberAccess(defc, Member.DECLARED)} is called.
82.308 - * (Note that {@code defc} might be the same as {@code refc}.)
82.309 - * <li>If the retrieved member is not public,
82.310 - * and if {@code defc} and {@code refc} are in different class loaders,
82.311 - * and if the class loader of the lookup class is not
82.312 - * the same as or an ancestor of the class loader of {@code defc},
82.313 - * then {@link SecurityManager#checkPackageAccess
82.314 - * smgr.checkPackageAccess(defcPkg)} is called,
82.315 - * where {@code defcPkg} is the package of {@code defc}.
82.316 - * </ul>
82.317 - * In all cases, the requesting class presented to the security
82.318 - * manager will be the lookup class from the current {@code Lookup} object.
82.319 - */
82.320 - public static final
82.321 - class Lookup {
82.322 - /** The class on behalf of whom the lookup is being performed. */
82.323 - private final Class<?> lookupClass;
82.324 -
82.325 - /** The allowed sorts of members which may be looked up (PUBLIC, etc.). */
82.326 - private final int allowedModes;
82.327 -
82.328 - /** A single-bit mask representing {@code public} access,
82.329 - * which may contribute to the result of {@link #lookupModes lookupModes}.
82.330 - * The value, {@code 0x01}, happens to be the same as the value of the
82.331 - * {@code public} {@linkplain java.lang.reflect.Modifier#PUBLIC modifier bit}.
82.332 - */
82.333 - public static final int PUBLIC = Modifier.PUBLIC;
82.334 -
82.335 - /** A single-bit mask representing {@code private} access,
82.336 - * which may contribute to the result of {@link #lookupModes lookupModes}.
82.337 - * The value, {@code 0x02}, happens to be the same as the value of the
82.338 - * {@code private} {@linkplain java.lang.reflect.Modifier#PRIVATE modifier bit}.
82.339 - */
82.340 - public static final int PRIVATE = Modifier.PRIVATE;
82.341 -
82.342 - /** A single-bit mask representing {@code protected} access,
82.343 - * which may contribute to the result of {@link #lookupModes lookupModes}.
82.344 - * The value, {@code 0x04}, happens to be the same as the value of the
82.345 - * {@code protected} {@linkplain java.lang.reflect.Modifier#PROTECTED modifier bit}.
82.346 - */
82.347 - public static final int PROTECTED = Modifier.PROTECTED;
82.348 -
82.349 - /** A single-bit mask representing {@code package} access (default access),
82.350 - * which may contribute to the result of {@link #lookupModes lookupModes}.
82.351 - * The value is {@code 0x08}, which does not correspond meaningfully to
82.352 - * any particular {@linkplain java.lang.reflect.Modifier modifier bit}.
82.353 - */
82.354 - public static final int PACKAGE = Modifier.STATIC;
82.355 -
82.356 - private static final int ALL_MODES = (PUBLIC | PRIVATE | PROTECTED | PACKAGE);
82.357 - private static final int TRUSTED = -1;
82.358 -
82.359 - private static int fixmods(int mods) {
82.360 - mods &= (ALL_MODES - PACKAGE);
82.361 - return (mods != 0) ? mods : PACKAGE;
82.362 - }
82.363 -
82.364 - /** Tells which class is performing the lookup. It is this class against
82.365 - * which checks are performed for visibility and access permissions.
82.366 - * <p>
82.367 - * The class implies a maximum level of access permission,
82.368 - * but the permissions may be additionally limited by the bitmask
82.369 - * {@link #lookupModes lookupModes}, which controls whether non-public members
82.370 - * can be accessed.
82.371 - */
82.372 - public Class<?> lookupClass() {
82.373 - return lookupClass;
82.374 - }
82.375 -
82.376 - // This is just for calling out to MethodHandleImpl.
82.377 - private Class<?> lookupClassOrNull() {
82.378 - return (allowedModes == TRUSTED) ? null : lookupClass;
82.379 - }
82.380 -
82.381 - /** Tells which access-protection classes of members this lookup object can produce.
82.382 - * The result is a bit-mask of the bits
82.383 - * {@linkplain #PUBLIC PUBLIC (0x01)},
82.384 - * {@linkplain #PRIVATE PRIVATE (0x02)},
82.385 - * {@linkplain #PROTECTED PROTECTED (0x04)},
82.386 - * and {@linkplain #PACKAGE PACKAGE (0x08)}.
82.387 - * <p>
82.388 - * A freshly-created lookup object
82.389 - * on the {@linkplain java.dyn.MethodHandles#lookup() caller's class}
82.390 - * has all possible bits set, since the caller class can access all its own members.
82.391 - * A lookup object on a new lookup class
82.392 - * {@linkplain java.dyn.MethodHandles.Lookup#in created from a previous lookup object}
82.393 - * may have some mode bits set to zero.
82.394 - * The purpose of this is to restrict access via the new lookup object,
82.395 - * so that it can access only names which can be reached by the original
82.396 - * lookup object, and also by the new lookup class.
82.397 - */
82.398 - public int lookupModes() {
82.399 - return allowedModes & ALL_MODES;
82.400 - }
82.401 -
82.402 - /** Embody the current class (the lookupClass) as a lookup class
82.403 - * for method handle creation.
82.404 - * Must be called by from a method in this package,
82.405 - * which in turn is called by a method not in this package.
82.406 - * <p>
82.407 - * Also, don't make it private, lest javac interpose
82.408 - * an access$N method.
82.409 - */
82.410 - Lookup() {
82.411 - this(getCallerClassAtEntryPoint(), ALL_MODES);
82.412 - // make sure we haven't accidentally picked up a privileged class:
82.413 - checkUnprivilegedlookupClass(lookupClass);
82.414 - }
82.415 -
82.416 - Lookup(Access token, Class<?> lookupClass) {
82.417 - this(lookupClass, ALL_MODES);
82.418 - Access.check(token);
82.419 - }
82.420 -
82.421 - private Lookup(Class<?> lookupClass, int allowedModes) {
82.422 - this.lookupClass = lookupClass;
82.423 - this.allowedModes = allowedModes;
82.424 - }
82.425 -
82.426 - /**
82.427 - * Creates a lookup on the specified new lookup class.
82.428 - * The resulting object will report the specified
82.429 - * class as its own {@link #lookupClass lookupClass}.
82.430 - * <p>
82.431 - * However, the resulting {@code Lookup} object is guaranteed
82.432 - * to have no more access capabilities than the original.
82.433 - * In particular, access capabilities can be lost as follows:<ul>
82.434 - * <li>If the new lookup class differs from the old one,
82.435 - * protected members will not be accessible by virtue of inheritance.
82.436 - * (Protected members may continue to be accessible because of package sharing.)
82.437 - * <li>If the new lookup class is in a different package
82.438 - * than the old one, protected and default (package) members will not be accessible.
82.439 - * <li>If the new lookup class is not within the same package member
82.440 - * as the old one, private members will not be accessible.
82.441 - * <li>If the new lookup class is not accessible to the old lookup class,
82.442 - * then no members, not even public members, will be accessible.
82.443 - * (In all other cases, public members will continue to be accessible.)
82.444 - * </ul>
82.445 - *
82.446 - * @param requestedLookupClass the desired lookup class for the new lookup object
82.447 - * @return a lookup object which reports the desired lookup class
82.448 - * @throws NullPointerException if the argument is null
82.449 - */
82.450 - public Lookup in(Class<?> requestedLookupClass) {
82.451 - requestedLookupClass.getClass(); // null check
82.452 - if (allowedModes == TRUSTED) // IMPL_LOOKUP can make any lookup at all
82.453 - return new Lookup(requestedLookupClass, ALL_MODES);
82.454 - if (requestedLookupClass == this.lookupClass)
82.455 - return this; // keep same capabilities
82.456 - int newModes = (allowedModes & (ALL_MODES & ~PROTECTED));
82.457 - if ((newModes & PACKAGE) != 0
82.458 - && !VerifyAccess.isSamePackage(this.lookupClass, requestedLookupClass)) {
82.459 - newModes &= ~(PACKAGE|PRIVATE);
82.460 - }
82.461 - // Allow nestmate lookups to be created without special privilege:
82.462 - if ((newModes & PRIVATE) != 0
82.463 - && !VerifyAccess.isSamePackageMember(this.lookupClass, requestedLookupClass)) {
82.464 - newModes &= ~PRIVATE;
82.465 - }
82.466 - if (newModes == PUBLIC
82.467 - && !VerifyAccess.isClassAccessible(requestedLookupClass, this.lookupClass)) {
82.468 - // The requested class it not accessible from the lookup class.
82.469 - // No permissions.
82.470 - newModes = 0;
82.471 - }
82.472 - checkUnprivilegedlookupClass(requestedLookupClass);
82.473 - return new Lookup(requestedLookupClass, newModes);
82.474 - }
82.475 -
82.476 - // Make sure outer class is initialized first.
82.477 - static { IMPL_TOKEN.getClass(); }
82.478 -
82.479 - /** Version of lookup which is trusted minimally.
82.480 - * It can only be used to create method handles to
82.481 - * publicly accessible members.
82.482 - */
82.483 - static final Lookup PUBLIC_LOOKUP = new Lookup(Object.class, PUBLIC);
82.484 -
82.485 - /** Package-private version of lookup which is trusted. */
82.486 - static final Lookup IMPL_LOOKUP = new Lookup(Object.class, TRUSTED);
82.487 - static { MethodHandleImpl.initLookup(IMPL_TOKEN, IMPL_LOOKUP); }
82.488 -
82.489 - private static void checkUnprivilegedlookupClass(Class<?> lookupClass) {
82.490 - String name = lookupClass.getName();
82.491 - if (name.startsWith("java.dyn.") || name.startsWith("sun.dyn."))
82.492 - throw newIllegalArgumentException("illegal lookupClass: "+lookupClass);
82.493 - }
82.494 -
82.495 - /**
82.496 - * Displays the name of the class from which lookups are to be made.
82.497 - * (The name is the one reported by {@link java.lang.Class#getName() Class.getName}.)
82.498 - * If there are restrictions on the access permitted to this lookup,
82.499 - * this is indicated by adding a suffix to the class name, consisting
82.500 - * of a slash and a keyword. The keyword represents the strongest
82.501 - * allowed access, and is chosen as follows:
82.502 - * <ul>
82.503 - * <li>If no access is allowed, the suffix is "/noaccess".
82.504 - * <li>If only public access is allowed, the suffix is "/public".
82.505 - * <li>If only public and package access are allowed, the suffix is "/package".
82.506 - * <li>If only public, package, and private access are allowed, the suffix is "/private".
82.507 - * </ul>
82.508 - * If none of the above cases apply, it is the case that full
82.509 - * access (public, package, private, and protected) is allowed.
82.510 - * In this case, no suffix is added.
82.511 - * This is true only of an object obtained originally from
82.512 - * {@link java.dyn.MethodHandles#lookup MethodHandles.lookup}.
82.513 - * Objects created by {@link java.dyn.MethodHandles.Lookup#in Lookup.in}
82.514 - * always have restricted access, and will display a suffix.
82.515 - * <p>
82.516 - * (It may seem strange that protected access should be
82.517 - * stronger than private access. Viewed independently from
82.518 - * package access, protected access is the first to be lost,
82.519 - * because it requires a direct subclass relationship between
82.520 - * caller and callee.)
82.521 - * @see #in
82.522 - */
82.523 - @Override
82.524 - public String toString() {
82.525 - String cname = lookupClass.getName();
82.526 - switch (allowedModes) {
82.527 - case 0: // no privileges
82.528 - return cname + "/noaccess";
82.529 - case PUBLIC:
82.530 - return cname + "/public";
82.531 - case PUBLIC|PACKAGE:
82.532 - return cname + "/package";
82.533 - case ALL_MODES & ~PROTECTED:
82.534 - return cname + "/private";
82.535 - case ALL_MODES:
82.536 - return cname;
82.537 - case TRUSTED:
82.538 - return "/trusted"; // internal only; not exported
82.539 - default: // Should not happen, but it's a bitfield...
82.540 - cname = cname + "/" + Integer.toHexString(allowedModes);
82.541 - assert(false) : cname;
82.542 - return cname;
82.543 - }
82.544 - }
82.545 -
82.546 - // call this from an entry point method in Lookup with extraFrames=0.
82.547 - private static Class<?> getCallerClassAtEntryPoint() {
82.548 - final int CALLER_DEPTH = 4;
82.549 - // 0: Reflection.getCC, 1: getCallerClassAtEntryPoint,
82.550 - // 2: Lookup.<init>, 3: MethodHandles.*, 4: caller
82.551 - // Note: This should be the only use of getCallerClass in this file.
82.552 - assert(Reflection.getCallerClass(CALLER_DEPTH-1) == MethodHandles.class);
82.553 - return Reflection.getCallerClass(CALLER_DEPTH);
82.554 - }
82.555 -
82.556 - /**
82.557 - * Produces a method handle for a static method.
82.558 - * The type of the method handle will be that of the method.
82.559 - * (Since static methods do not take receivers, there is no
82.560 - * additional receiver argument inserted into the method handle type,
82.561 - * as there would be with {@link #findVirtual findVirtual} or {@link #findSpecial findSpecial}.)
82.562 - * The method and all its argument types must be accessible to the lookup class.
82.563 - * If the method's class has not yet been initialized, that is done
82.564 - * immediately, before the method handle is returned.
82.565 - * <p>
82.566 - * The returned method handle will have
82.567 - * {@linkplain MethodHandle#asVarargsCollector variable arity} if and only if
82.568 - * the method's variable arity modifier bit ({@code 0x0080}) is set.
82.569 - * @param refc the class from which the method is accessed
82.570 - * @param name the name of the method
82.571 - * @param type the type of the method
82.572 - * @return the desired method handle
82.573 - * @throws NoSuchMethodException if the method does not exist
82.574 - * @throws IllegalAccessException if access checking fails, or if the method is not {@code static}
82.575 - * @exception SecurityException if a security manager is present and it
82.576 - * <a href="MethodHandles.Lookup.html#secmgr">refuses access</a>
82.577 - * @throws NullPointerException if any argument is null
82.578 - */
82.579 - public
82.580 - MethodHandle findStatic(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
82.581 - MemberName method = resolveOrFail(refc, name, type, true);
82.582 - checkMethod(refc, method, true);
82.583 - return MethodHandleImpl.findMethod(IMPL_TOKEN, method, false, lookupClassOrNull());
82.584 - }
82.585 -
82.586 - /**
82.587 - * Produces a method handle for a virtual method.
82.588 - * The type of the method handle will be that of the method,
82.589 - * with the receiver type (usually {@code refc}) prepended.
82.590 - * The method and all its argument types must be accessible to the lookup class.
82.591 - * <p>
82.592 - * When called, the handle will treat the first argument as a receiver
82.593 - * and dispatch on the receiver's type to determine which method
82.594 - * implementation to enter.
82.595 - * (The dispatching action is identical with that performed by an
82.596 - * {@code invokevirtual} or {@code invokeinterface} instruction.)
82.597 - * <p>
82.598 - * The returned method handle will have
82.599 - * {@linkplain MethodHandle#asVarargsCollector variable arity} if and only if
82.600 - * the method's variable arity modifier bit ({@code 0x0080}) is set.
82.601 - * <p>
82.602 - * Because of the general equivalence between {@code invokevirtual}
82.603 - * instructions and method handles produced by {@code findVirtual},
82.604 - * if the class is {@code MethodHandle} and the name string is
82.605 - * {@code invokeExact} or {@code invokeGeneric}, the resulting
82.606 - * method handle is equivalent to one produced by
82.607 - * {@link java.dyn.MethodHandles#exactInvoker MethodHandles.exactInvoker} or
82.608 - * {@link java.dyn.MethodHandles#genericInvoker MethodHandles.genericInvoker}
82.609 - * with the same {@code type} argument.
82.610 - *
82.611 - * @param refc the class or interface from which the method is accessed
82.612 - * @param name the name of the method
82.613 - * @param type the type of the method, with the receiver argument omitted
82.614 - * @return the desired method handle
82.615 - * @throws NoSuchMethodException if the method does not exist
82.616 - * @throws IllegalAccessException if access checking fails, or if the method is {@code static}
82.617 - * @exception SecurityException if a security manager is present and it
82.618 - * <a href="MethodHandles.Lookup.html#secmgr">refuses access</a>
82.619 - * @throws NullPointerException if any argument is null
82.620 - */
82.621 - public MethodHandle findVirtual(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
82.622 - MemberName method = resolveOrFail(refc, name, type, false);
82.623 - checkMethod(refc, method, false);
82.624 - MethodHandle mh = MethodHandleImpl.findMethod(IMPL_TOKEN, method, true, lookupClassOrNull());
82.625 - return restrictProtectedReceiver(method, mh);
82.626 - }
82.627 -
82.628 - /**
82.629 - * Produces a method handle which creates an object and initializes it, using
82.630 - * the constructor of the specified type.
82.631 - * The parameter types of the method handle will be those of the constructor,
82.632 - * while the return type will be a reference to the constructor's class.
82.633 - * The constructor and all its argument types must be accessible to the lookup class.
82.634 - * If the constructor's class has not yet been initialized, that is done
82.635 - * immediately, before the method handle is returned.
82.636 - * <p>
82.637 - * Note: The requested type must have a return type of {@code void}.
82.638 - * This is consistent with the JVM's treatment of constructor type descriptors.
82.639 - * <p>
82.640 - * The returned method handle will have
82.641 - * {@linkplain MethodHandle#asVarargsCollector variable arity} if and only if
82.642 - * the constructor's variable arity modifier bit ({@code 0x0080}) is set.
82.643 - * @param refc the class or interface from which the method is accessed
82.644 - * @param type the type of the method, with the receiver argument omitted, and a void return type
82.645 - * @return the desired method handle
82.646 - * @throws NoSuchMethodException if the constructor does not exist
82.647 - * @throws IllegalAccessException if access checking fails
82.648 - * @exception SecurityException if a security manager is present and it
82.649 - * <a href="MethodHandles.Lookup.html#secmgr">refuses access</a>
82.650 - * @throws NullPointerException if any argument is null
82.651 - */
82.652 - public MethodHandle findConstructor(Class<?> refc, MethodType type) throws NoSuchMethodException, IllegalAccessException {
82.653 - String name = "<init>";
82.654 - MemberName ctor = resolveOrFail(refc, name, type, false, false, lookupClassOrNull());
82.655 - assert(ctor.isConstructor());
82.656 - checkAccess(refc, ctor);
82.657 - MethodHandle rawMH = MethodHandleImpl.findMethod(IMPL_TOKEN, ctor, false, lookupClassOrNull());
82.658 - MethodHandle allocMH = MethodHandleImpl.makeAllocator(IMPL_TOKEN, rawMH);
82.659 - return fixVarargs(allocMH, rawMH);
82.660 - }
82.661 -
82.662 - /** Return a version of MH which matches matchMH w.r.t. isVarargsCollector. */
82.663 - private static MethodHandle fixVarargs(MethodHandle mh, MethodHandle matchMH) {
82.664 - boolean va1 = mh.isVarargsCollector();
82.665 - boolean va2 = matchMH.isVarargsCollector();
82.666 - if (va1 == va2) {
82.667 - return mh;
82.668 - } else if (va2) {
82.669 - MethodType type = mh.type();
82.670 - int arity = type.parameterCount();
82.671 - return mh.asVarargsCollector(type.parameterType(arity-1));
82.672 - } else {
82.673 - throw new InternalError("already varargs, but template is not: "+mh);
82.674 - }
82.675 - }
82.676 -
82.677 - /**
82.678 - * Produces an early-bound method handle for a virtual method,
82.679 - * as if called from an {@code invokespecial}
82.680 - * instruction from {@code caller}.
82.681 - * The type of the method handle will be that of the method,
82.682 - * with a suitably restricted receiver type (such as {@code caller}) prepended.
82.683 - * The method and all its argument types must be accessible
82.684 - * to the caller.
82.685 - * <p>
82.686 - * When called, the handle will treat the first argument as a receiver,
82.687 - * but will not dispatch on the receiver's type.
82.688 - * (This direct invocation action is identical with that performed by an
82.689 - * {@code invokespecial} instruction.)
82.690 - * <p>
82.691 - * If the explicitly specified caller class is not identical with the
82.692 - * lookup class, or if this lookup object does not have private access
82.693 - * privileges, the access fails.
82.694 - * <p>
82.695 - * The returned method handle will have
82.696 - * {@linkplain MethodHandle#asVarargsCollector variable arity} if and only if
82.697 - * the method's variable arity modifier bit ({@code 0x0080}) is set.
82.698 - * @param refc the class or interface from which the method is accessed
82.699 - * @param name the name of the method (which must not be "<init>")
82.700 - * @param type the type of the method, with the receiver argument omitted
82.701 - * @param specialCaller the proposed calling class to perform the {@code invokespecial}
82.702 - * @return the desired method handle
82.703 - * @throws NoSuchMethodException if the method does not exist
82.704 - * @throws IllegalAccessException if access checking fails
82.705 - * @exception SecurityException if a security manager is present and it
82.706 - * <a href="MethodHandles.Lookup.html#secmgr">refuses access</a>
82.707 - * @throws NullPointerException if any argument is null
82.708 - */
82.709 - public MethodHandle findSpecial(Class<?> refc, String name, MethodType type,
82.710 - Class<?> specialCaller) throws NoSuchMethodException, IllegalAccessException {
82.711 - checkSpecialCaller(specialCaller);
82.712 - MemberName method = resolveOrFail(refc, name, type, false, false, specialCaller);
82.713 - checkMethod(refc, method, false);
82.714 - MethodHandle mh = MethodHandleImpl.findMethod(IMPL_TOKEN, method, false, specialCaller);
82.715 - return restrictReceiver(method, mh, specialCaller);
82.716 - }
82.717 -
82.718 - /**
82.719 - * Produces a method handle giving read access to a non-static field.
82.720 - * The type of the method handle will have a return type of the field's
82.721 - * value type.
82.722 - * The method handle's single argument will be the instance containing
82.723 - * the field.
82.724 - * Access checking is performed immediately on behalf of the lookup class.
82.725 - * @param refc the class or interface from which the method is accessed
82.726 - * @param name the field's name
82.727 - * @param type the field's type
82.728 - * @return a method handle which can load values from the field
82.729 - * @throws NoSuchFieldException if the field does not exist
82.730 - * @throws IllegalAccessException if access checking fails, or if the field is {@code static}
82.731 - * @exception SecurityException if a security manager is present and it
82.732 - * <a href="MethodHandles.Lookup.html#secmgr">refuses access</a>
82.733 - * @throws NullPointerException if any argument is null
82.734 - */
82.735 - public MethodHandle findGetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
82.736 - return makeAccessor(refc, name, type, false, false);
82.737 - }
82.738 -
82.739 - /**
82.740 - * Produces a method handle giving write access to a non-static field.
82.741 - * The type of the method handle will have a void return type.
82.742 - * The method handle will take two arguments, the instance containing
82.743 - * the field, and the value to be stored.
82.744 - * The second argument will be of the field's value type.
82.745 - * Access checking is performed immediately on behalf of the lookup class.
82.746 - * @param refc the class or interface from which the method is accessed
82.747 - * @param name the field's name
82.748 - * @param type the field's type
82.749 - * @return a method handle which can store values into the field
82.750 - * @throws NoSuchFieldException if the field does not exist
82.751 - * @throws IllegalAccessException if access checking fails, or if the field is {@code static}
82.752 - * @exception SecurityException if a security manager is present and it
82.753 - * <a href="MethodHandles.Lookup.html#secmgr">refuses access</a>
82.754 - * @throws NullPointerException if any argument is null
82.755 - */
82.756 - public MethodHandle findSetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
82.757 - return makeAccessor(refc, name, type, false, true);
82.758 - }
82.759 -
82.760 - /**
82.761 - * Produces a method handle giving read access to a static field.
82.762 - * The type of the method handle will have a return type of the field's
82.763 - * value type.
82.764 - * The method handle will take no arguments.
82.765 - * Access checking is performed immediately on behalf of the lookup class.
82.766 - * @param refc the class or interface from which the method is accessed
82.767 - * @param name the field's name
82.768 - * @param type the field's type
82.769 - * @return a method handle which can load values from the field
82.770 - * @throws NoSuchFieldException if the field does not exist
82.771 - * @throws IllegalAccessException if access checking fails, or if the field is not {@code static}
82.772 - * @exception SecurityException if a security manager is present and it
82.773 - * <a href="MethodHandles.Lookup.html#secmgr">refuses access</a>
82.774 - * @throws NullPointerException if any argument is null
82.775 - */
82.776 - public MethodHandle findStaticGetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
82.777 - return makeAccessor(refc, name, type, true, false);
82.778 - }
82.779 -
82.780 - /**
82.781 - * Produces a method handle giving write access to a static field.
82.782 - * The type of the method handle will have a void return type.
82.783 - * The method handle will take a single
82.784 - * argument, of the field's value type, the value to be stored.
82.785 - * Access checking is performed immediately on behalf of the lookup class.
82.786 - * @param refc the class or interface from which the method is accessed
82.787 - * @param name the field's name
82.788 - * @param type the field's type
82.789 - * @return a method handle which can store values into the field
82.790 - * @throws NoSuchFieldException if the field does not exist
82.791 - * @throws IllegalAccessException if access checking fails, or if the field is not {@code static}
82.792 - * @exception SecurityException if a security manager is present and it
82.793 - * <a href="MethodHandles.Lookup.html#secmgr">refuses access</a>
82.794 - * @throws NullPointerException if any argument is null
82.795 - */
82.796 - public MethodHandle findStaticSetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
82.797 - return makeAccessor(refc, name, type, true, true);
82.798 - }
82.799 -
82.800 - /**
82.801 - * Produces an early-bound method handle for a non-static method.
82.802 - * The receiver must have a supertype {@code defc} in which a method
82.803 - * of the given name and type is accessible to the lookup class.
82.804 - * The method and all its argument types must be accessible to the lookup class.
82.805 - * The type of the method handle will be that of the method,
82.806 - * without any insertion of an additional receiver parameter.
82.807 - * The given receiver will be bound into the method handle,
82.808 - * so that every call to the method handle will invoke the
82.809 - * requested method on the given receiver.
82.810 - * <p>
82.811 - * The returned method handle will have
82.812 - * {@linkplain MethodHandle#asVarargsCollector variable arity} if and only if
82.813 - * the method's variable arity modifier bit ({@code 0x0080}) is set
82.814 - * <em>and</em> the trailing array argument is not the only argument.
82.815 - * (If the trailing array argument is the only argument,
82.816 - * the given receiver value will be bound to it.)
82.817 - * <p>
82.818 - * This is equivalent to the following code:
82.819 - * <blockquote><pre>
82.820 -MethodHandle mh0 = {@link #findVirtual findVirtual}(defc, name, type);
82.821 -MethodHandle mh1 = mh0.{@link MethodHandle#bindTo bindTo}(receiver);
82.822 -MethodType mt1 = mh1.type();
82.823 -if (mh0.isVarargsCollector() && mt1.parameterCount() > 0) {
82.824 - mh1 = mh1.asVarargsCollector(mt1.parameterType(mt1.parameterCount()-1));
82.825 -return mh1;
82.826 - * </pre></blockquote>
82.827 - * where {@code defc} is either {@code receiver.getClass()} or a super
82.828 - * type of that class, in which the requested method is accessible
82.829 - * to the lookup class.
82.830 - * (Note that {@code bindTo} does not preserve variable arity.)
82.831 - * @param receiver the object from which the method is accessed
82.832 - * @param name the name of the method
82.833 - * @param type the type of the method, with the receiver argument omitted
82.834 - * @return the desired method handle
82.835 - * @throws NoSuchMethodException if the method does not exist
82.836 - * @throws IllegalAccessException if access checking fails
82.837 - * @exception SecurityException if a security manager is present and it
82.838 - * <a href="MethodHandles.Lookup.html#secmgr">refuses access</a>
82.839 - * @throws NullPointerException if any argument is null
82.840 - */
82.841 - public MethodHandle bind(Object receiver, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
82.842 - Class<? extends Object> refc = receiver.getClass(); // may get NPE
82.843 - MemberName method = resolveOrFail(refc, name, type, false);
82.844 - checkMethod(refc, method, false);
82.845 - MethodHandle dmh = MethodHandleImpl.findMethod(IMPL_TOKEN, method, true, lookupClassOrNull());
82.846 - MethodHandle bmh = MethodHandleImpl.bindReceiver(IMPL_TOKEN, dmh, receiver);
82.847 - if (bmh == null)
82.848 - throw newNoAccessException(method, this);
82.849 - if (dmh.type().parameterCount() == 0)
82.850 - return dmh; // bound the trailing parameter; no varargs possible
82.851 - return fixVarargs(bmh, dmh);
82.852 - }
82.853 -
82.854 - /**
82.855 - * Make a direct method handle to <i>m</i>, if the lookup class has permission.
82.856 - * If <i>m</i> is non-static, the receiver argument is treated as an initial argument.
82.857 - * If <i>m</i> is virtual, overriding is respected on every call.
82.858 - * Unlike the Core Reflection API, exceptions are <em>not</em> wrapped.
82.859 - * The type of the method handle will be that of the method,
82.860 - * with the receiver type prepended (but only if it is non-static).
82.861 - * If the method's {@code accessible} flag is not set,
82.862 - * access checking is performed immediately on behalf of the lookup class.
82.863 - * If <i>m</i> is not public, do not share the resulting handle with untrusted parties.
82.864 - * <p>
82.865 - * The returned method handle will have
82.866 - * {@linkplain MethodHandle#asVarargsCollector variable arity} if and only if
82.867 - * the method's variable arity modifier bit ({@code 0x0080}) is set.
82.868 - * @param m the reflected method
82.869 - * @return a method handle which can invoke the reflected method
82.870 - * @throws IllegalAccessException if access checking fails
82.871 - * @throws NullPointerException if the argument is null
82.872 - */
82.873 - public MethodHandle unreflect(Method m) throws IllegalAccessException {
82.874 - MemberName method = new MemberName(m);
82.875 - assert(method.isMethod());
82.876 - if (!m.isAccessible()) checkMethod(method.getDeclaringClass(), method, method.isStatic());
82.877 - MethodHandle mh = MethodHandleImpl.findMethod(IMPL_TOKEN, method, true, lookupClassOrNull());
82.878 - if (!m.isAccessible()) mh = restrictProtectedReceiver(method, mh);
82.879 - return mh;
82.880 - }
82.881 -
82.882 - /**
82.883 - * Produces a method handle for a reflected method.
82.884 - * It will bypass checks for overriding methods on the receiver,
82.885 - * as if by a {@code invokespecial} instruction from within the {@code specialCaller}.
82.886 - * The type of the method handle will be that of the method,
82.887 - * with the special caller type prepended (and <em>not</em> the receiver of the method).
82.888 - * If the method's {@code accessible} flag is not set,
82.889 - * access checking is performed immediately on behalf of the lookup class,
82.890 - * as if {@code invokespecial} instruction were being linked.
82.891 - * <p>
82.892 - * The returned method handle will have
82.893 - * {@linkplain MethodHandle#asVarargsCollector variable arity} if and only if
82.894 - * the method's variable arity modifier bit ({@code 0x0080}) is set.
82.895 - * @param m the reflected method
82.896 - * @param specialCaller the class nominally calling the method
82.897 - * @return a method handle which can invoke the reflected method
82.898 - * @throws IllegalAccessException if access checking fails
82.899 - * @throws NullPointerException if any argument is null
82.900 - */
82.901 - public MethodHandle unreflectSpecial(Method m, Class<?> specialCaller) throws IllegalAccessException {
82.902 - checkSpecialCaller(specialCaller);
82.903 - MemberName method = new MemberName(m);
82.904 - assert(method.isMethod());
82.905 - // ignore m.isAccessible: this is a new kind of access
82.906 - checkMethod(m.getDeclaringClass(), method, false);
82.907 - MethodHandle mh = MethodHandleImpl.findMethod(IMPL_TOKEN, method, false, lookupClassOrNull());
82.908 - return restrictReceiver(method, mh, specialCaller);
82.909 - }
82.910 -
82.911 - /**
82.912 - * Produces a method handle for a reflected constructor.
82.913 - * The type of the method handle will be that of the constructor,
82.914 - * with the return type changed to the declaring class.
82.915 - * The method handle will perform a {@code newInstance} operation,
82.916 - * creating a new instance of the constructor's class on the
82.917 - * arguments passed to the method handle.
82.918 - * <p>
82.919 - * If the constructor's {@code accessible} flag is not set,
82.920 - * access checking is performed immediately on behalf of the lookup class.
82.921 - * <p>
82.922 - * The returned method handle will have
82.923 - * {@linkplain MethodHandle#asVarargsCollector variable arity} if and only if
82.924 - * the constructor's variable arity modifier bit ({@code 0x0080}) is set.
82.925 - * @param c the reflected constructor
82.926 - * @return a method handle which can invoke the reflected constructor
82.927 - * @throws IllegalAccessException if access checking fails
82.928 - * @throws NullPointerException if the argument is null
82.929 - */
82.930 - public MethodHandle unreflectConstructor(Constructor c) throws IllegalAccessException {
82.931 - MemberName ctor = new MemberName(c);
82.932 - assert(ctor.isConstructor());
82.933 - if (!c.isAccessible()) checkAccess(c.getDeclaringClass(), ctor);
82.934 - MethodHandle rawCtor = MethodHandleImpl.findMethod(IMPL_TOKEN, ctor, false, lookupClassOrNull());
82.935 - MethodHandle allocator = MethodHandleImpl.makeAllocator(IMPL_TOKEN, rawCtor);
82.936 - return fixVarargs(allocator, rawCtor);
82.937 - }
82.938 -
82.939 - /**
82.940 - * Produces a method handle giving read access to a reflected field.
82.941 - * The type of the method handle will have a return type of the field's
82.942 - * value type.
82.943 - * If the field is static, the method handle will take no arguments.
82.944 - * Otherwise, its single argument will be the instance containing
82.945 - * the field.
82.946 - * If the method's {@code accessible} flag is not set,
82.947 - * access checking is performed immediately on behalf of the lookup class.
82.948 - * @param f the reflected field
82.949 - * @return a method handle which can load values from the reflected field
82.950 - * @throws IllegalAccessException if access checking fails
82.951 - * @throws NullPointerException if the argument is null
82.952 - */
82.953 - public MethodHandle unreflectGetter(Field f) throws IllegalAccessException {
82.954 - return makeAccessor(f.getDeclaringClass(), new MemberName(f), f.isAccessible(), false);
82.955 - }
82.956 -
82.957 - /**
82.958 - * Produces a method handle giving write access to a reflected field.
82.959 - * The type of the method handle will have a void return type.
82.960 - * If the field is static, the method handle will take a single
82.961 - * argument, of the field's value type, the value to be stored.
82.962 - * Otherwise, the two arguments will be the instance containing
82.963 - * the field, and the value to be stored.
82.964 - * If the method's {@code accessible} flag is not set,
82.965 - * access checking is performed immediately on behalf of the lookup class.
82.966 - * @param f the reflected field
82.967 - * @return a method handle which can store values into the reflected field
82.968 - * @throws IllegalAccessException if access checking fails
82.969 - * @throws NullPointerException if the argument is null
82.970 - */
82.971 - public MethodHandle unreflectSetter(Field f) throws IllegalAccessException {
82.972 - return makeAccessor(f.getDeclaringClass(), new MemberName(f), f.isAccessible(), true);
82.973 - }
82.974 -
82.975 - /// Helper methods, all package-private.
82.976 -
82.977 - MemberName resolveOrFail(Class<?> refc, String name, Class<?> type, boolean isStatic) throws NoSuchFieldException, IllegalAccessException {
82.978 - checkSymbolicClass(refc); // do this before attempting to resolve
82.979 - name.getClass(); type.getClass(); // NPE
82.980 - int mods = (isStatic ? Modifier.STATIC : 0);
82.981 - return IMPL_NAMES.resolveOrFail(new MemberName(refc, name, type, mods), true, lookupClassOrNull(),
82.982 - NoSuchFieldException.class);
82.983 - }
82.984 -
82.985 - MemberName resolveOrFail(Class<?> refc, String name, MethodType type, boolean isStatic) throws NoSuchMethodException, IllegalAccessException {
82.986 - checkSymbolicClass(refc); // do this before attempting to resolve
82.987 - name.getClass(); type.getClass(); // NPE
82.988 - int mods = (isStatic ? Modifier.STATIC : 0);
82.989 - return IMPL_NAMES.resolveOrFail(new MemberName(refc, name, type, mods), true, lookupClassOrNull(),
82.990 - NoSuchMethodException.class);
82.991 - }
82.992 -
82.993 - MemberName resolveOrFail(Class<?> refc, String name, MethodType type, boolean isStatic,
82.994 - boolean searchSupers, Class<?> specialCaller) throws NoSuchMethodException, IllegalAccessException {
82.995 - checkSymbolicClass(refc); // do this before attempting to resolve
82.996 - name.getClass(); type.getClass(); // NPE
82.997 - int mods = (isStatic ? Modifier.STATIC : 0);
82.998 - return IMPL_NAMES.resolveOrFail(new MemberName(refc, name, type, mods), searchSupers, specialCaller,
82.999 - NoSuchMethodException.class);
82.1000 - }
82.1001 -
82.1002 - void checkSymbolicClass(Class<?> refc) throws IllegalAccessException {
82.1003 - Class<?> caller = lookupClassOrNull();
82.1004 - if (caller != null && !VerifyAccess.isClassAccessible(refc, caller))
82.1005 - throw newNoAccessException("symbolic reference class is not public", new MemberName(refc), this);
82.1006 - }
82.1007 -
82.1008 - void checkMethod(Class<?> refc, MemberName m, boolean wantStatic) throws IllegalAccessException {
82.1009 - String message;
82.1010 - if (m.isConstructor())
82.1011 - message = "expected a method, not a constructor";
82.1012 - else if (!m.isMethod())
82.1013 - message = "expected a method";
82.1014 - else if (wantStatic != m.isStatic())
82.1015 - message = wantStatic ? "expected a static method" : "expected a non-static method";
82.1016 - else
82.1017 - { checkAccess(refc, m); return; }
82.1018 - throw newNoAccessException(message, m, this);
82.1019 - }
82.1020 -
82.1021 - void checkAccess(Class<?> refc, MemberName m) throws IllegalAccessException {
82.1022 - int allowedModes = this.allowedModes;
82.1023 - if (allowedModes == TRUSTED) return;
82.1024 - int mods = m.getModifiers();
82.1025 - if (Modifier.isPublic(mods) && Modifier.isPublic(refc.getModifiers()) && allowedModes != 0)
82.1026 - return; // common case
82.1027 - int requestedModes = fixmods(mods); // adjust 0 => PACKAGE
82.1028 - if ((requestedModes & allowedModes) != 0
82.1029 - && VerifyAccess.isMemberAccessible(refc, m.getDeclaringClass(),
82.1030 - mods, lookupClass()))
82.1031 - return;
82.1032 - if (((requestedModes & ~allowedModes) & PROTECTED) != 0
82.1033 - && VerifyAccess.isSamePackage(m.getDeclaringClass(), lookupClass()))
82.1034 - // Protected members can also be checked as if they were package-private.
82.1035 - return;
82.1036 - throw newNoAccessException(accessFailedMessage(refc, m), m, this);
82.1037 - }
82.1038 -
82.1039 - String accessFailedMessage(Class<?> refc, MemberName m) {
82.1040 - Class<?> defc = m.getDeclaringClass();
82.1041 - int mods = m.getModifiers();
82.1042 - // check the class first:
82.1043 - boolean classOK = (Modifier.isPublic(defc.getModifiers()) &&
82.1044 - (defc == refc ||
82.1045 - Modifier.isPublic(refc.getModifiers())));
82.1046 - if (!classOK && (allowedModes & PACKAGE) != 0) {
82.1047 - classOK = (VerifyAccess.isClassAccessible(defc, lookupClass()) &&
82.1048 - (defc == refc ||
82.1049 - VerifyAccess.isClassAccessible(refc, lookupClass())));
82.1050 - }
82.1051 - if (!classOK)
82.1052 - return "class is not public";
82.1053 - if (Modifier.isPublic(mods))
82.1054 - return "access to public member failed"; // (how?)
82.1055 - if (Modifier.isPrivate(mods))
82.1056 - return "member is private";
82.1057 - if (Modifier.isProtected(mods))
82.1058 - return "member is protected";
82.1059 - return "member is private to package";
82.1060 - }
82.1061 -
82.1062 - private static final boolean ALLOW_NESTMATE_ACCESS = false;
82.1063 -
82.1064 - void checkSpecialCaller(Class<?> specialCaller) throws IllegalAccessException {
82.1065 - if (allowedModes == TRUSTED) return;
82.1066 - if ((allowedModes & PRIVATE) == 0
82.1067 - || (specialCaller != lookupClass()
82.1068 - && !(ALLOW_NESTMATE_ACCESS &&
82.1069 - VerifyAccess.isSamePackageMember(specialCaller, lookupClass()))))
82.1070 - throw newNoAccessException("no private access for invokespecial",
82.1071 - new MemberName(specialCaller), this);
82.1072 - }
82.1073 -
82.1074 - MethodHandle restrictProtectedReceiver(MemberName method, MethodHandle mh) throws IllegalAccessException {
82.1075 - // The accessing class only has the right to use a protected member
82.1076 - // on itself or a subclass. Enforce that restriction, from JVMS 5.4.4, etc.
82.1077 - if (!method.isProtected() || method.isStatic()
82.1078 - || allowedModes == TRUSTED
82.1079 - || method.getDeclaringClass() == lookupClass()
82.1080 - || (ALLOW_NESTMATE_ACCESS &&
82.1081 - VerifyAccess.isSamePackageMember(method.getDeclaringClass(), lookupClass())))
82.1082 - return mh;
82.1083 - else
82.1084 - return restrictReceiver(method, mh, lookupClass());
82.1085 - }
82.1086 - MethodHandle restrictReceiver(MemberName method, MethodHandle mh, Class<?> caller) throws IllegalAccessException {
82.1087 - assert(!method.isStatic());
82.1088 - Class<?> defc = method.getDeclaringClass(); // receiver type of mh is too wide
82.1089 - if (defc.isInterface() || !defc.isAssignableFrom(caller)) {
82.1090 - throw newNoAccessException("caller class must be a subclass below the method", method, caller);
82.1091 - }
82.1092 - MethodType rawType = mh.type();
82.1093 - if (rawType.parameterType(0) == caller) return mh;
82.1094 - MethodType narrowType = rawType.changeParameterType(0, caller);
82.1095 - MethodHandle narrowMH = MethodHandleImpl.convertArguments(IMPL_TOKEN, mh, narrowType, rawType, null);
82.1096 - return fixVarargs(narrowMH, mh);
82.1097 - }
82.1098 -
82.1099 - MethodHandle makeAccessor(Class<?> refc, String name, Class<?> type,
82.1100 - boolean isStatic, boolean isSetter) throws NoSuchFieldException, IllegalAccessException {
82.1101 - MemberName field = resolveOrFail(refc, name, type, isStatic);
82.1102 - if (isStatic != field.isStatic())
82.1103 - throw newNoAccessException(isStatic
82.1104 - ? "expected a static field"
82.1105 - : "expected a non-static field",
82.1106 - field, this);
82.1107 - return makeAccessor(refc, field, false, isSetter);
82.1108 - }
82.1109 -
82.1110 - MethodHandle makeAccessor(Class<?> refc, MemberName field,
82.1111 - boolean trusted, boolean isSetter) throws IllegalAccessException {
82.1112 - assert(field.isField());
82.1113 - if (trusted)
82.1114 - return MethodHandleImpl.accessField(IMPL_TOKEN, field, isSetter, lookupClassOrNull());
82.1115 - checkAccess(refc, field);
82.1116 - MethodHandle mh = MethodHandleImpl.accessField(IMPL_TOKEN, field, isSetter, lookupClassOrNull());
82.1117 - return restrictProtectedReceiver(field, mh);
82.1118 - }
82.1119 - }
82.1120 -
82.1121 - /**
82.1122 - * Produces a method handle giving read access to elements of an array.
82.1123 - * The type of the method handle will have a return type of the array's
82.1124 - * element type. Its first argument will be the array type,
82.1125 - * and the second will be {@code int}.
82.1126 - * @param arrayClass an array type
82.1127 - * @return a method handle which can load values from the given array type
82.1128 - * @throws NullPointerException if the argument is null
82.1129 - * @throws IllegalArgumentException if arrayClass is not an array type
82.1130 - */
82.1131 - public static
82.1132 - MethodHandle arrayElementGetter(Class<?> arrayClass) throws IllegalArgumentException {
82.1133 - return MethodHandleImpl.accessArrayElement(IMPL_TOKEN, arrayClass, false);
82.1134 - }
82.1135 -
82.1136 - /**
82.1137 - * Produces a method handle giving write access to elements of an array.
82.1138 - * The type of the method handle will have a void return type.
82.1139 - * Its last argument will be the array's element type.
82.1140 - * The first and second arguments will be the array type and int.
82.1141 - * @return a method handle which can store values into the array type
82.1142 - * @throws NullPointerException if the argument is null
82.1143 - * @throws IllegalArgumentException if arrayClass is not an array type
82.1144 - */
82.1145 - public static
82.1146 - MethodHandle arrayElementSetter(Class<?> arrayClass) throws IllegalArgumentException {
82.1147 - return MethodHandleImpl.accessArrayElement(IMPL_TOKEN, arrayClass, true);
82.1148 - }
82.1149 -
82.1150 - /// method handle invocation (reflective style)
82.1151 -
82.1152 - /**
82.1153 - * Produces a method handle which will invoke any method handle of the
82.1154 - * given {@code type} on a standard set of {@code Object} type arguments
82.1155 - * and a single trailing {@code Object[]} array.
82.1156 - * The resulting invoker will be a method handle with the following
82.1157 - * arguments:
82.1158 - * <ul>
82.1159 - * <li>a single {@code MethodHandle} target
82.1160 - * <li>zero or more {@code Object} values (counted by {@code objectArgCount})
82.1161 - * <li>an {@code Object[]} array containing more arguments
82.1162 - * </ul>
82.1163 - * <p>
82.1164 - * The invoker will behave like a call to {@link MethodHandle#invokeGeneric invokeGeneric} with
82.1165 - * the indicated {@code type}.
82.1166 - * That is, if the target is exactly of the given {@code type}, it will behave
82.1167 - * like {@code invokeExact}; otherwise it behave as if {@link MethodHandle#asType asType}
82.1168 - * is used to convert the target to the required {@code type}.
82.1169 - * <p>
82.1170 - * The type of the returned invoker will not be the given {@code type}, but rather
82.1171 - * will have all parameter and return types replaced by {@code Object}, except for
82.1172 - * the last parameter type, which will be the array type {@code Object[]}.
82.1173 - * <p>
82.1174 - * Before invoking its target, the invoker will spread the varargs array, apply
82.1175 - * reference casts as necessary, and unbox and widen primitive arguments.
82.1176 - * The return value of the invoker will be an {@code Object} reference,
82.1177 - * boxing a primitive value if the original type returns a primitive,
82.1178 - * and always null if the original type returns void.
82.1179 - * <p>
82.1180 - * This method is equivalent to the following code (though it may be more efficient):
82.1181 - * <p><blockquote><pre>
82.1182 -MethodHandle invoker = MethodHandles.genericInvoker(type);
82.1183 -int spreadArgCount = type.parameterCount - objectArgCount;
82.1184 -invoker = invoker.asSpreader(Object[].class, spreadArgCount);
82.1185 -return invoker;
82.1186 - * </pre></blockquote>
82.1187 - * <p>
82.1188 - * This method throws no reflective or security exceptions.
82.1189 - * @param type the desired target type
82.1190 - * @param objectArgCount number of fixed (non-varargs) {@code Object} arguments
82.1191 - * @return a method handle suitable for invoking any method handle of the given type
82.1192 - */
82.1193 - static public
82.1194 - MethodHandle spreadInvoker(MethodType type, int objectArgCount) {
82.1195 - if (objectArgCount < 0 || objectArgCount > type.parameterCount())
82.1196 - throw new IllegalArgumentException("bad argument count "+objectArgCount);
82.1197 - return invokers(type).spreadInvoker(objectArgCount);
82.1198 - }
82.1199 -
82.1200 - /**
82.1201 - * Produces a special <em>invoker method handle</em> which can be used to
82.1202 - * invoke any method handle of the given type, as if by {@code invokeExact}.
82.1203 - * The resulting invoker will have a type which is
82.1204 - * exactly equal to the desired type, except that it will accept
82.1205 - * an additional leading argument of type {@code MethodHandle}.
82.1206 - * <p>
82.1207 - * This method is equivalent to the following code (though it may be more efficient):
82.1208 - * <p><blockquote><pre>
82.1209 -publicLookup().findVirtual(MethodHandle.class, "invokeExact", type)
82.1210 - * </pre></blockquote>
82.1211 - *
82.1212 - * <p style="font-size:smaller;">
82.1213 - * <em>Discussion:</em>
82.1214 - * Invoker method handles can be useful when working with variable method handles
82.1215 - * of unknown types.
82.1216 - * For example, to emulate an {@code invokeExact} call to a variable method
82.1217 - * handle {@code M}, extract its type {@code T},
82.1218 - * look up the invoker method {@code X} for {@code T},
82.1219 - * and call the invoker method, as {@code X.invokeGeneric(T, A...)}.
82.1220 - * (It would not work to call {@code X.invokeExact}, since the type {@code T}
82.1221 - * is unknown.)
82.1222 - * If spreading, collecting, or other argument transformations are required,
82.1223 - * they can be applied once to the invoker {@code X} and reused on many {@code M}
82.1224 - * method handle values, as long as they are compatible with the type of {@code X}.
82.1225 - * <p>
82.1226 - * <em>(Note: The invoker method is not available via the Core Reflection API.
82.1227 - * An attempt to call {@linkplain java.lang.reflect.Method#invoke Method.invoke}
82.1228 - * on the declared {@code invokeExact} or {@code invokeGeneric} method will raise an
82.1229 - * {@link java.lang.UnsupportedOperationException UnsupportedOperationException}.)</em>
82.1230 - * <p>
82.1231 - * This method throws no reflective or security exceptions.
82.1232 - * @param type the desired target type
82.1233 - * @return a method handle suitable for invoking any method handle of the given type
82.1234 - */
82.1235 - static public
82.1236 - MethodHandle exactInvoker(MethodType type) {
82.1237 - return invokers(type).exactInvoker();
82.1238 - }
82.1239 -
82.1240 - /**
82.1241 - * Produces a special <em>invoker method handle</em> which can be used to
82.1242 - * invoke any method handle of the given type, as if by {@code invokeGeneric}.
82.1243 - * The resulting invoker will have a type which is
82.1244 - * exactly equal to the desired type, except that it will accept
82.1245 - * an additional leading argument of type {@code MethodHandle}.
82.1246 - * <p>
82.1247 - * Before invoking its target, the invoker will apply reference casts as
82.1248 - * necessary and unbox and widen primitive arguments, as if by {@link #convertArguments convertArguments}.
82.1249 - * The return value of the invoker will be an {@code Object} reference,
82.1250 - * boxing a primitive value if the original type returns a primitive,
82.1251 - * and always null if the original type returns void.
82.1252 - * <p>
82.1253 - * This method is equivalent to the following code (though it may be more efficient):
82.1254 - * <p><blockquote><pre>
82.1255 -publicLookup().findVirtual(MethodHandle.class, "invokeGeneric", type)
82.1256 - * </pre></blockquote>
82.1257 - * <p>
82.1258 - * This method throws no reflective or security exceptions.
82.1259 - * @param type the desired target type
82.1260 - * @return a method handle suitable for invoking any method handle convertible to the given type
82.1261 - */
82.1262 - static public
82.1263 - MethodHandle genericInvoker(MethodType type) {
82.1264 - return invokers(type).genericInvoker();
82.1265 - }
82.1266 -
82.1267 - static Invokers invokers(MethodType type) {
82.1268 - return MethodTypeImpl.invokers(IMPL_TOKEN, type);
82.1269 - }
82.1270 -
82.1271 - /**
82.1272 - * Perform value checking, exactly as if for an adapted method handle.
82.1273 - * It is assumed that the given value is either null, of type T0,
82.1274 - * or (if T0 is primitive) of the wrapper type corresponding to T0.
82.1275 - * The following checks and conversions are made:
82.1276 - * <ul>
82.1277 - * <li>If T0 and T1 are references, then a cast to T1 is applied.
82.1278 - * (The types do not need to be related in any particular way.)
82.1279 - * <li>If T0 and T1 are primitives, then a widening or narrowing
82.1280 - * conversion is applied, if one exists.
82.1281 - * <li>If T0 is a primitive and T1 a reference, and
82.1282 - * T0 has a wrapper type TW, a boxing conversion to TW is applied,
82.1283 - * possibly followed by a reference conversion.
82.1284 - * T1 must be TW or a supertype.
82.1285 - * <li>If T0 is a reference and T1 a primitive, and
82.1286 - * T1 has a wrapper type TW, an unboxing conversion is applied,
82.1287 - * possibly preceded by a reference conversion.
82.1288 - * T0 must be TW or a supertype.
82.1289 - * <li>If T1 is void, the return value is discarded
82.1290 - * <li>If T0 is void and T1 a reference, a null value is introduced.
82.1291 - * <li>If T0 is void and T1 a primitive, a zero value is introduced.
82.1292 - * </ul>
82.1293 - * If the value is discarded, null will be returned.
82.1294 - * @param valueType
82.1295 - * @param value
82.1296 - * @return the value, converted if necessary
82.1297 - * @throws java.lang.ClassCastException if a cast fails
82.1298 - */
82.1299 - static
82.1300 - <T0, T1> T1 checkValue(Class<T0> t0, Class<T1> t1, Object value)
82.1301 - throws ClassCastException
82.1302 - {
82.1303 - if (t0 == t1) {
82.1304 - // no conversion needed; just reassert the same type
82.1305 - if (t0.isPrimitive())
82.1306 - return Wrapper.asPrimitiveType(t1).cast(value);
82.1307 - else
82.1308 - return Wrapper.OBJECT.convert(value, t1);
82.1309 - }
82.1310 - boolean prim0 = t0.isPrimitive(), prim1 = t1.isPrimitive();
82.1311 - if (!prim0) {
82.1312 - // check contract with caller
82.1313 - Wrapper.OBJECT.convert(value, t0);
82.1314 - if (!prim1) {
82.1315 - return Wrapper.OBJECT.convert(value, t1);
82.1316 - }
82.1317 - // convert reference to primitive by unboxing
82.1318 - Wrapper w1 = Wrapper.forPrimitiveType(t1);
82.1319 - return w1.convert(value, t1);
82.1320 - }
82.1321 - // check contract with caller:
82.1322 - Wrapper.asWrapperType(t0).cast(value);
82.1323 - Wrapper w1 = Wrapper.forPrimitiveType(t1);
82.1324 - return w1.convert(value, t1);
82.1325 - }
82.1326 -
82.1327 - static
82.1328 - Object checkValue(Class<?> T1, Object value)
82.1329 - throws ClassCastException
82.1330 - {
82.1331 - Class<?> T0;
82.1332 - if (value == null)
82.1333 - T0 = Object.class;
82.1334 - else
82.1335 - T0 = value.getClass();
82.1336 - return checkValue(T0, T1, value);
82.1337 - }
82.1338 -
82.1339 - /// method handle modification (creation from other method handles)
82.1340 -
82.1341 - /**
82.1342 - * Produces a method handle which adapts the type of the
82.1343 - * given method handle to a new type by pairwise argument conversion.
82.1344 - * The original type and new type must have the same number of arguments.
82.1345 - * The resulting method handle is guaranteed to report a type
82.1346 - * which is equal to the desired new type.
82.1347 - * <p>
82.1348 - * If the original type and new type are equal, returns target.
82.1349 - * <p>
82.1350 - * The following conversions are applied as needed both to
82.1351 - * arguments and return types. Let T0 and T1 be the differing
82.1352 - * new and old parameter types (or old and new return types)
82.1353 - * for corresponding values passed by the new and old method types.
82.1354 - * Given those types T0, T1, one of the following conversions is applied
82.1355 - * if possible:
82.1356 - * <ul>
82.1357 - * <li>If T0 and T1 are references, then a cast to T1 is applied.
82.1358 - * (The types do not need to be related in any particular way.)
82.1359 - * <li>If T0 and T1 are primitives, then a Java method invocation
82.1360 - * conversion (JLS 5.3) is applied, if one exists.
82.1361 - * <li>If T0 is a primitive and T1 a reference, a boxing
82.1362 - * conversion is applied if one exists, possibly followed by
82.1363 - * a reference conversion to a superclass.
82.1364 - * T1 must be a wrapper class or a supertype of one.
82.1365 - * <li>If T0 is a reference and T1 a primitive, an unboxing
82.1366 - * conversion will be applied at runtime, possibly followed
82.1367 - * by a Java method invocation conversion (JLS 5.3)
82.1368 - * on the primitive value. (These are the widening conversions.)
82.1369 - * T0 must be a wrapper class or a supertype of one.
82.1370 - * (In the case where T0 is Object, these are the conversions
82.1371 - * allowed by java.lang.reflect.Method.invoke.)
82.1372 - * <li>If the return type T1 is void, any returned value is discarded
82.1373 - * <li>If the return type T0 is void and T1 a reference, a null value is introduced.
82.1374 - * <li>If the return type T0 is void and T1 a primitive, a zero value is introduced.
82.1375 - * </ul>
82.1376 - * @param target the method handle to invoke after arguments are retyped
82.1377 - * @param newType the expected type of the new method handle
82.1378 - * @return a method handle which delegates to {@code target} after performing
82.1379 - * any necessary argument conversions, and arranges for any
82.1380 - * necessary return value conversions
82.1381 - * @throws NullPointerException if either argument is null
82.1382 - * @throws WrongMethodTypeException if the conversion cannot be made
82.1383 - * @see MethodHandle#asType
82.1384 - * @see MethodHandles#explicitCastArguments
82.1385 - */
82.1386 - public static
82.1387 - MethodHandle convertArguments(MethodHandle target, MethodType newType) {
82.1388 - MethodType oldType = target.type();
82.1389 - if (oldType.equals(newType))
82.1390 - return target;
82.1391 - MethodHandle res = null;
82.1392 - try {
82.1393 - res = MethodHandleImpl.convertArguments(IMPL_TOKEN, target,
82.1394 - newType, oldType, null);
82.1395 - } catch (IllegalArgumentException ex) {
82.1396 - }
82.1397 - if (res == null)
82.1398 - throw new WrongMethodTypeException("cannot convert to "+newType+": "+target);
82.1399 - return res;
82.1400 - }
82.1401 -
82.1402 - /**
82.1403 - * Produces a method handle which adapts the type of the
82.1404 - * given method handle to a new type by pairwise argument conversion.
82.1405 - * The original type and new type must have the same number of arguments.
82.1406 - * The resulting method handle is guaranteed to report a type
82.1407 - * which is equal to the desired new type.
82.1408 - * <p>
82.1409 - * If the original type and new type are equal, returns target.
82.1410 - * <p>
82.1411 - * The same conversions are allowed as for {@link #convertArguments convertArguments},
82.1412 - * and some additional conversions are also applied if those conversions fail.
82.1413 - * Given types T0, T1, one of the following conversions is applied
82.1414 - * in addition, if the conversions specified for {@code convertArguments}
82.1415 - * would be insufficient:
82.1416 - * <ul>
82.1417 - * <li>If T0 and T1 are references, and T1 is an interface type,
82.1418 - * then the value of type T0 is passed as a T1 without a cast.
82.1419 - * (This treatment of interfaces follows the usage of the bytecode verifier.)
82.1420 - * <li>If T0 and T1 are primitives and one is boolean,
82.1421 - * the boolean is treated as a one-bit unsigned integer.
82.1422 - * (This treatment follows the usage of the bytecode verifier.)
82.1423 - * A conversion from another primitive type behaves as if
82.1424 - * it first converts to byte, and then masks all but the low bit.
82.1425 - * <li>If a primitive value would be converted by {@code convertArguments}
82.1426 - * using Java method invocation conversion (JLS 5.3),
82.1427 - * Java casting conversion (JLS 5.5) may be used also.
82.1428 - * This allows primitives to be narrowed as well as widened.
82.1429 - * </ul>
82.1430 - * @param target the method handle to invoke after arguments are retyped
82.1431 - * @param newType the expected type of the new method handle
82.1432 - * @return a method handle which delegates to {@code target} after performing
82.1433 - * any necessary argument conversions, and arranges for any
82.1434 - * necessary return value conversions
82.1435 - * @throws NullPointerException if either argument is null
82.1436 - * @throws WrongMethodTypeException if the conversion cannot be made
82.1437 - * @see MethodHandle#asType
82.1438 - * @see MethodHandles#convertArguments
82.1439 - */
82.1440 - public static
82.1441 - MethodHandle explicitCastArguments(MethodHandle target, MethodType newType) {
82.1442 - return convertArguments(target, newType); // FIXME!
82.1443 - }
82.1444 -
82.1445 - /*
82.1446 - FIXME: Reconcile javadoc with 10/22/2010 EG notes on conversion:
82.1447 -
82.1448 - Both converters arrange for their method handles to convert arguments
82.1449 - and return values. The conversion rules are the same for arguments
82.1450 - and return values, and depend only on source and target types, S and
82.1451 - T. The conversions allowed by castConvertArguments are a strict
82.1452 - superset of those performed by convertArguments.
82.1453 -
82.1454 - In all cases, if S and T are references, a simple checkcast is done.
82.1455 - If neither S nor T is a primitive, no attempt is made to unbox and
82.1456 - box. A failed conversion throws ClassCastException.
82.1457 -
82.1458 - If T is void, the value is dropped.
82.1459 -
82.1460 - For compatibility with reflection, if S is void and T is a reference,
82.1461 - a null value is produced.
82.1462 -
82.1463 - For compatibility with reflection, if S is a reference and T is a
82.1464 - primitive, S is first unboxed and then undergoes primitive conversion.
82.1465 - In the case of 'convertArguments', only assignment conversion is
82.1466 - performed (no narrowing primitive conversion).
82.1467 -
82.1468 - If S is a primitive, S is boxed, and then the above rules are applied.
82.1469 - If S and T are both primitives, the boxing will be undetectable; only
82.1470 - the primitive conversions will be apparent to the user. The key point
82.1471 - is that if S is a primitive type, the implementation may box it and
82.1472 - treat is as Object, without loss of information, or it may use a "fast
82.1473 - path" which does not use boxing.
82.1474 -
82.1475 - Notwithstanding the rules above, for compatibility with the verifier,
82.1476 - if T is an interface, it is treated as if it were Object. [KEEP THIS?]
82.1477 -
82.1478 - Also, for compatibility with the verifier, a boolean may be undergo
82.1479 - widening or narrowing conversion to any other primitive type. [KEEP THIS?]
82.1480 - */
82.1481 -
82.1482 - /**
82.1483 - * Produces a method handle which adapts the calling sequence of the
82.1484 - * given method handle to a new type, by reordering the arguments.
82.1485 - * The resulting method handle is guaranteed to report a type
82.1486 - * which is equal to the desired new type.
82.1487 - * <p>
82.1488 - * The given array controls the reordering.
82.1489 - * Call {@code #I} the number of incoming parameters (the value
82.1490 - * {@code newType.parameterCount()}, and call {@code #O} the number
82.1491 - * of outgoing parameters (the value {@code target.type().parameterCount()}).
82.1492 - * Then the length of the reordering array must be {@code #O},
82.1493 - * and each element must be a non-negative number less than {@code #I}.
82.1494 - * For every {@code N} less than {@code #O}, the {@code N}-th
82.1495 - * outgoing argument will be taken from the {@code I}-th incoming
82.1496 - * argument, where {@code I} is {@code reorder[N]}.
82.1497 - * <p>
82.1498 - * No argument or return value conversions are applied.
82.1499 - * The type of each incoming argument, as determined by {@code newType},
82.1500 - * must be identical to the type of the corresponding outgoing argument
82.1501 - * or arguments in the target method handle.
82.1502 - * The return type of {@code newType} must be identical to the return
82.1503 - * type of the original target.
82.1504 - * <p>
82.1505 - * The reordering array need not specify an actual permutation.
82.1506 - * An incoming argument will be duplicated if its index appears
82.1507 - * more than once in the array, and an incoming argument will be dropped
82.1508 - * if its index does not appear in the array.
82.1509 - * As in the case of {@link #dropArguments(MethodHandle,int,List) dropArguments},
82.1510 - * incoming arguments which are not mentioned in the reordering array
82.1511 - * are may be any type, as determined only by {@code newType}.
82.1512 - * <blockquote><pre>
82.1513 -MethodType intfn1 = MethodType.methodType(int.class, int.class);
82.1514 -MethodType intfn2 = MethodType.methodType(int.class, int.class, int.class);
82.1515 -MethodHandle sub = ... {int x, int y => x-y} ...;
82.1516 -assert(sub.type().equals(intfn2));
82.1517 -MethodHandle sub1 = MethodHandles.permuteArguments(sub, intfn2, 0, 1);
82.1518 -MethodHandle rsub = MethodHandles.permuteArguments(sub, intfn2, 1, 0);
82.1519 -assert((int)rsub.invokeExact(1, 100) == 99);
82.1520 -MethodHandle add = ... {int x, int y => x+y} ...;
82.1521 -assert(add.type().equals(intfn2));
82.1522 -MethodHandle twice = MethodHandles.permuteArguments(add, intfn1, 0, 0);
82.1523 -assert(twice.type().equals(intfn1));
82.1524 -assert((int)twice.invokeExact(21) == 42);
82.1525 - * </pre></blockquote>
82.1526 - * @param target the method handle to invoke after arguments are reordered
82.1527 - * @param newType the expected type of the new method handle
82.1528 - * @param reorder a string which controls the reordering
82.1529 - * @return a method handle which delegates to {@code target} after it
82.1530 - * drops unused arguments and moves and/or duplicates the other arguments
82.1531 - * @throws NullPointerException if any argument is null
82.1532 - */
82.1533 - public static
82.1534 - MethodHandle permuteArguments(MethodHandle target, MethodType newType, int... reorder) {
82.1535 - MethodType oldType = target.type();
82.1536 - checkReorder(reorder, newType, oldType);
82.1537 - return MethodHandleImpl.convertArguments(IMPL_TOKEN, target,
82.1538 - newType, oldType,
82.1539 - reorder);
82.1540 - }
82.1541 -
82.1542 - private static void checkReorder(int[] reorder, MethodType newType, MethodType oldType) {
82.1543 - if (reorder.length == oldType.parameterCount()) {
82.1544 - int limit = newType.parameterCount();
82.1545 - boolean bad = false;
82.1546 - for (int i : reorder) {
82.1547 - if (i < 0 || i >= limit) {
82.1548 - bad = true; break;
82.1549 - }
82.1550 - }
82.1551 - if (!bad) return;
82.1552 - }
82.1553 - throw newIllegalArgumentException("bad reorder array");
82.1554 - }
82.1555 -
82.1556 - /**
82.1557 - * Equivalent to the following code:
82.1558 - * <p><blockquote><pre>
82.1559 - * int spreadPos = newType.parameterCount() - 1;
82.1560 - * Class<?> spreadType = newType.parameterType(spreadPos);
82.1561 - * int spreadCount = target.type().parameterCount() - spreadPos;
82.1562 - * MethodHandle adapter = target.asSpreader(spreadType, spreadCount);
82.1563 - * adapter = adapter.asType(newType);
82.1564 - * return adapter;
82.1565 - * </pre></blockquote>
82.1566 - * @param target the method handle to invoke after argument spreading
82.1567 - * @param newType the expected type of the new method handle
82.1568 - * @return a method handle which spreads its final argument,
82.1569 - * before calling the original method handle
82.1570 - */
82.1571 - /*non-public*/ static
82.1572 - MethodHandle spreadArguments(MethodHandle target, MethodType newType) {
82.1573 - MethodType oldType = target.type();
82.1574 - int inargs = newType.parameterCount();
82.1575 - int outargs = oldType.parameterCount();
82.1576 - int spreadPos = inargs - 1;
82.1577 - int numSpread = (outargs - spreadPos);
82.1578 - MethodHandle res = null;
82.1579 - if (spreadPos >= 0 && numSpread >= 0) {
82.1580 - res = MethodHandleImpl.spreadArguments(IMPL_TOKEN, target, newType, spreadPos);
82.1581 - }
82.1582 - if (res == null) {
82.1583 - throw newIllegalArgumentException("cannot spread "+newType+" to " +oldType);
82.1584 - }
82.1585 - return res;
82.1586 - }
82.1587 -
82.1588 - /**
82.1589 - * Equivalent to the following code:
82.1590 - * <p><blockquote><pre>
82.1591 - * int collectPos = target.type().parameterCount() - 1;
82.1592 - * Class<?> collectType = target.type().parameterType(collectPos);
82.1593 - * if (!collectType.isArray()) collectType = Object[].class;
82.1594 - * int collectCount = newType.parameterCount() - collectPos;
82.1595 - * MethodHandle adapter = target.asCollector(collectType, collectCount);
82.1596 - * adapter = adapter.asType(newType);
82.1597 - * return adapter;
82.1598 - * </pre></blockquote>
82.1599 - * @param target the method handle to invoke after argument collection
82.1600 - * @param newType the expected type of the new method handle
82.1601 - * @return a method handle which collects some trailing argument
82.1602 - * into an array, before calling the original method handle
82.1603 - */
82.1604 - /*non-public*/ static
82.1605 - MethodHandle collectArguments(MethodHandle target, MethodType newType) {
82.1606 - MethodType oldType = target.type();
82.1607 - int inargs = newType.parameterCount();
82.1608 - int outargs = oldType.parameterCount();
82.1609 - int collectPos = outargs - 1;
82.1610 - int numCollect = (inargs - collectPos);
82.1611 - if (collectPos < 0 || numCollect < 0)
82.1612 - throw newIllegalArgumentException("wrong number of arguments");
82.1613 - MethodHandle res = MethodHandleImpl.collectArguments(IMPL_TOKEN, target, newType, collectPos, null);
82.1614 - if (res == null) {
82.1615 - throw newIllegalArgumentException("cannot collect from "+newType+" to " +oldType);
82.1616 - }
82.1617 - return res;
82.1618 - }
82.1619 -
82.1620 - /**
82.1621 - * Produces a method handle of the requested return type which returns the given
82.1622 - * constant value every time it is invoked.
82.1623 - * <p>
82.1624 - * Before the method handle is returned, the passed-in value is converted to the requested type.
82.1625 - * If the requested type is primitive, widening primitive conversions are attempted,
82.1626 - * else reference conversions are attempted.
82.1627 - * <p>The returned method handle is equivalent to {@code identity(type).bindTo(value)},
82.1628 - * unless the type is {@code void}, in which case it is {@code identity(type)}.
82.1629 - * @param type the return type of the desired method handle
82.1630 - * @param value the value to return
82.1631 - * @return a method handle of the given return type and no arguments, which always returns the given value
82.1632 - * @throws NullPointerException if the {@code type} argument is null
82.1633 - * @throws ClassCastException if the value cannot be converted to the required return type
82.1634 - * @throws IllegalArgumentException if the given type is {@code void.class}
82.1635 - */
82.1636 - public static
82.1637 - MethodHandle constant(Class<?> type, Object value) {
82.1638 - if (type.isPrimitive()) {
82.1639 - if (type == void.class)
82.1640 - throw newIllegalArgumentException("void type");
82.1641 - Wrapper w = Wrapper.forPrimitiveType(type);
82.1642 - return identity(type).bindTo(w.convert(value, type));
82.1643 - } else {
82.1644 - return identity(type).bindTo(type.cast(value));
82.1645 - }
82.1646 - }
82.1647 -
82.1648 - /**
82.1649 - * Produces a method handle which returns its sole argument when invoked.
82.1650 - * <p>The identity function for {@code void} takes no arguments and returns no values.
82.1651 - * @param type the type of the sole parameter and return value of the desired method handle
82.1652 - * @return a unary method handle which accepts and returns the given type
82.1653 - * @throws NullPointerException if the argument is null
82.1654 - * @throws IllegalArgumentException if the given type is {@code void.class}
82.1655 - */
82.1656 - public static
82.1657 - MethodHandle identity(Class<?> type) {
82.1658 - if (type == void.class)
82.1659 - throw newIllegalArgumentException("void type");
82.1660 - return ValueConversions.identity(type);
82.1661 - }
82.1662 -
82.1663 - /**
82.1664 - * Produces a method handle which calls the original method handle {@code target},
82.1665 - * after inserting the given argument(s) at the given position.
82.1666 - * The formal parameters to {@code target} which will be supplied by those
82.1667 - * arguments are called <em>bound parameters</em>, because the new method
82.1668 - * will contain bindings for those parameters take from {@code values}.
82.1669 - * The type of the new method handle will drop the types for the bound
82.1670 - * parameters from the original target type, since the new method handle
82.1671 - * will no longer require those arguments to be supplied by its callers.
82.1672 - * <p>
82.1673 - * Each given argument object must match the corresponding bound parameter type.
82.1674 - * If a bound parameter type is a primitive, the argument object
82.1675 - * must be a wrapper, and will be unboxed to produce the primitive value.
82.1676 - * <p>
82.1677 - * The <i>pos</i> may range between zero and <i>N</i> (inclusively),
82.1678 - * where <i>N</i> is the number of argument types in resulting method handle
82.1679 - * (after bound parameter types are dropped).
82.1680 - * @param target the method handle to invoke after the argument is inserted
82.1681 - * @param pos where to insert the argument (zero for the first)
82.1682 - * @param values the series of arguments to insert
82.1683 - * @return a method handle which inserts an additional argument,
82.1684 - * before calling the original method handle
82.1685 - * @throws NullPointerException if the {@code target} argument or the {@code values} array is null
82.1686 - * @see MethodHandle#bindTo
82.1687 - */
82.1688 - public static
82.1689 - MethodHandle insertArguments(MethodHandle target, int pos, Object... values) {
82.1690 - int insCount = values.length;
82.1691 - MethodType oldType = target.type();
82.1692 - ArrayList<Class<?>> ptypes =
82.1693 - new ArrayList<Class<?>>(oldType.parameterList());
82.1694 - int outargs = oldType.parameterCount();
82.1695 - int inargs = outargs - insCount;
82.1696 - if (inargs < 0)
82.1697 - throw newIllegalArgumentException("too many values to insert");
82.1698 - if (pos < 0 || pos > inargs)
82.1699 - throw newIllegalArgumentException("no argument type to append");
82.1700 - MethodHandle result = target;
82.1701 - for (int i = 0; i < insCount; i++) {
82.1702 - Object value = values[i];
82.1703 - Class<?> valueType = oldType.parameterType(pos+i);
82.1704 - value = checkValue(valueType, value);
82.1705 - if (pos == 0 && !valueType.isPrimitive()) {
82.1706 - // At least for now, make bound method handles a special case.
82.1707 - MethodHandle bmh = MethodHandleImpl.bindReceiver(IMPL_TOKEN, result, value);
82.1708 - if (bmh != null) {
82.1709 - result = bmh;
82.1710 - continue;
82.1711 - }
82.1712 - // else fall through to general adapter machinery
82.1713 - }
82.1714 - result = MethodHandleImpl.bindArgument(IMPL_TOKEN, result, pos, value);
82.1715 - }
82.1716 - return result;
82.1717 - }
82.1718 -
82.1719 - /**
82.1720 - * Produces a method handle which calls the original method handle,
82.1721 - * after dropping the given argument(s) at the given position.
82.1722 - * The type of the new method handle will insert the given argument
82.1723 - * type(s), at that position, into the original handle's type.
82.1724 - * <p>
82.1725 - * The <i>pos</i> may range between zero and <i>N</i>,
82.1726 - * where <i>N</i> is the number of argument types in <i>target</i>,
82.1727 - * meaning to drop the first or last argument (respectively),
82.1728 - * or an argument somewhere in between.
82.1729 - * <p>
82.1730 - * <b>Example:</b>
82.1731 - * <p><blockquote><pre>
82.1732 -import static java.dyn.MethodHandles.*;
82.1733 -import static java.dyn.MethodType.*;
82.1734 -...
82.1735 -MethodHandle cat = lookup().findVirtual(String.class,
82.1736 - "concat", methodType(String.class, String.class));
82.1737 -assertEquals("xy", (String) cat.invokeExact("x", "y"));
82.1738 -MethodHandle d0 = dropArguments(cat, 0, String.class);
82.1739 -assertEquals("yz", (String) d0.invokeExact("x", "y", "z"));
82.1740 -MethodHandle d1 = dropArguments(cat, 1, String.class);
82.1741 -assertEquals("xz", (String) d1.invokeExact("x", "y", "z"));
82.1742 -MethodHandle d2 = dropArguments(cat, 2, String.class);
82.1743 -assertEquals("xy", (String) d2.invokeExact("x", "y", "z"));
82.1744 -MethodHandle d12 = dropArguments(cat, 1, int.class, boolean.class);
82.1745 -assertEquals("xz", (String) d12.invokeExact("x", 12, true, "z"));
82.1746 - * </pre></blockquote>
82.1747 - * @param target the method handle to invoke after the arguments are dropped
82.1748 - * @param valueTypes the type(s) of the argument(s) to drop
82.1749 - * @param pos position of first argument to drop (zero for the leftmost)
82.1750 - * @return a method handle which drops arguments of the given types,
82.1751 - * before calling the original method handle
82.1752 - * @throws NullPointerException if the {@code target} argument is null,
82.1753 - * or if the {@code valueTypes} list or any of its elements is null
82.1754 - * @throws IllegalArgumentException if any of the {@code valueTypes} is {@code void.class}
82.1755 - */
82.1756 - public static
82.1757 - MethodHandle dropArguments(MethodHandle target, int pos, List<Class<?>> valueTypes) {
82.1758 - if (valueTypes.size() == 0) return target;
82.1759 - MethodType oldType = target.type();
82.1760 - int outargs = oldType.parameterCount();
82.1761 - int inargs = outargs + valueTypes.size();
82.1762 - if (pos < 0 || pos >= inargs)
82.1763 - throw newIllegalArgumentException("no argument type to remove");
82.1764 - ArrayList<Class<?>> ptypes =
82.1765 - new ArrayList<Class<?>>(oldType.parameterList());
82.1766 - ptypes.addAll(pos, valueTypes);
82.1767 - MethodType newType = MethodType.methodType(oldType.returnType(), ptypes);
82.1768 - return MethodHandleImpl.dropArguments(IMPL_TOKEN, target, newType, pos);
82.1769 - }
82.1770 -
82.1771 - /**
82.1772 - * Produces a method handle which calls the original method handle,
82.1773 - * after dropping the given argument(s) at the given position.
82.1774 - * The type of the new method handle will insert the given argument
82.1775 - * type(s), at that position, into the original handle's type.
82.1776 - * This method is equivalent to the following code:
82.1777 - * <code>
82.1778 - * {@link #dropArguments(MethodHandle,int,List) dropArguments}(target, pos, Arrays.asList(valueTypes))
82.1779 - * </code>
82.1780 - * @param target the method handle to invoke after the arguments are dropped
82.1781 - * @param valueTypes the type(s) of the argument(s) to drop
82.1782 - * @param pos position of first argument to drop (zero for the leftmost)
82.1783 - * @return a method handle which drops arguments of the given types,
82.1784 - * before calling the original method handle
82.1785 - * @throws NullPointerException if the {@code target} argument is null,
82.1786 - * or if the {@code valueTypes} array or any of its elements is null
82.1787 - * @throws IllegalArgumentException if any of the {@code valueTypes} is {@code void.class}
82.1788 - */
82.1789 - public static
82.1790 - MethodHandle dropArguments(MethodHandle target, int pos, Class<?>... valueTypes) {
82.1791 - return dropArguments(target, pos, Arrays.asList(valueTypes));
82.1792 - }
82.1793 -
82.1794 - /**
82.1795 - * Adapt a target method handle {@code target} by pre-processing
82.1796 - * one or more of its arguments, each with its own unary filter function,
82.1797 - * and then calling the target with each pre-processed argument
82.1798 - * replaced by the result of its corresponding filter function.
82.1799 - * <p>
82.1800 - * The pre-processing is performed by one or more method handles,
82.1801 - * specified in the elements of the {@code filters} array.
82.1802 - * Null arguments in the array are ignored, and the corresponding arguments left unchanged.
82.1803 - * (If there are no non-null elements in the array, the original target is returned.)
82.1804 - * Each filter is applied to the corresponding argument of the adapter.
82.1805 - * <p>
82.1806 - * If a filter {@code F} applies to the {@code N}th argument of
82.1807 - * the method handle, then {@code F} must be a method handle which
82.1808 - * takes exactly one argument. The type of {@code F}'s sole argument
82.1809 - * replaces the corresponding argument type of the target
82.1810 - * in the resulting adapted method handle.
82.1811 - * The return type of {@code F} must be identical to the corresponding
82.1812 - * parameter type of the target.
82.1813 - * <p>
82.1814 - * It is an error if there are elements of {@code filters}
82.1815 - * which do not correspond to argument positions in the target.
82.1816 - * <b>Example:</b>
82.1817 - * <p><blockquote><pre>
82.1818 -import static java.dyn.MethodHandles.*;
82.1819 -import static java.dyn.MethodType.*;
82.1820 -...
82.1821 -MethodHandle cat = lookup().findVirtual(String.class,
82.1822 - "concat", methodType(String.class, String.class));
82.1823 -MethodHandle upcase = lookup().findVirtual(String.class,
82.1824 - "toUpperCase", methodType(String.class));
82.1825 -assertEquals("xy", (String) cat.invokeExact("x", "y"));
82.1826 -MethodHandle f0 = filterArguments(cat, 0, upcase);
82.1827 -assertEquals("Xy", (String) f0.invokeExact("x", "y")); // Xy
82.1828 -MethodHandle f1 = filterArguments(cat, 1, upcase);
82.1829 -assertEquals("xY", (String) f1.invokeExact("x", "y")); // xY
82.1830 -MethodHandle f2 = filterArguments(cat, 0, upcase, upcase);
82.1831 -assertEquals("XY", (String) f2.invokeExact("x", "y")); // XY
82.1832 - * </pre></blockquote>
82.1833 - *
82.1834 - * @param target the method handle to invoke after arguments are filtered
82.1835 - * @param pos the position of the first argument to filter
82.1836 - * @param filters method handles to call initially on filtered arguments
82.1837 - * @return method handle which incorporates the specified argument filtering logic
82.1838 - * @throws NullPointerException if the {@code target} argument is null
82.1839 - * or if the {@code filters} array is null
82.1840 - * @throws IllegalArgumentException if a non-null element of {@code filters}
82.1841 - * does not match a corresponding argument type of {@code target} as described above,
82.1842 - * or if the {@code pos+filters.length} is greater than {@code target.type().parameterCount()}
82.1843 - */
82.1844 - public static
82.1845 - MethodHandle filterArguments(MethodHandle target, int pos, MethodHandle... filters) {
82.1846 - MethodType targetType = target.type();
82.1847 - MethodHandle adapter = target;
82.1848 - MethodType adapterType = targetType;
82.1849 - int maxPos = targetType.parameterCount();
82.1850 - if (pos + filters.length > maxPos)
82.1851 - throw newIllegalArgumentException("too many filters");
82.1852 - int curPos = pos-1; // pre-incremented
82.1853 - for (MethodHandle filter : filters) {
82.1854 - curPos += 1;
82.1855 - if (filter == null) continue; // ignore null elements of filters
82.1856 - MethodType filterType = filter.type();
82.1857 - if (filterType.parameterCount() != 1
82.1858 - || filterType.returnType() != targetType.parameterType(curPos))
82.1859 - throw newIllegalArgumentException("target and filter types do not match");
82.1860 - adapterType = adapterType.changeParameterType(curPos, filterType.parameterType(0));
82.1861 - adapter = MethodHandleImpl.filterArgument(IMPL_TOKEN, adapter, curPos, filter);
82.1862 - }
82.1863 - MethodType midType = adapter.type();
82.1864 - if (midType != adapterType)
82.1865 - adapter = MethodHandleImpl.convertArguments(IMPL_TOKEN, adapter, adapterType, midType, null);
82.1866 - return adapter;
82.1867 - }
82.1868 -
82.1869 - /**
82.1870 - * Adapt a target method handle {@code target} by post-processing
82.1871 - * its return value with a unary filter function.
82.1872 - * <p>
82.1873 - * If a filter {@code F} applies to the return value of
82.1874 - * the target method handle, then {@code F} must be a method handle which
82.1875 - * takes exactly one argument. The return type of {@code F}
82.1876 - * replaces the return type of the target
82.1877 - * in the resulting adapted method handle.
82.1878 - * The argument type of {@code F} must be identical to the
82.1879 - * return type of the target.
82.1880 - * <b>Example:</b>
82.1881 - * <p><blockquote><pre>
82.1882 -import static java.dyn.MethodHandles.*;
82.1883 -import static java.dyn.MethodType.*;
82.1884 -...
82.1885 -MethodHandle cat = lookup().findVirtual(String.class,
82.1886 - "concat", methodType(String.class, String.class));
82.1887 -MethodHandle length = lookup().findVirtual(String.class,
82.1888 - "length", methodType(int.class));
82.1889 -System.out.println((String) cat.invokeExact("x", "y")); // xy
82.1890 -MethodHandle f0 = filterReturnValue(cat, length);
82.1891 -System.out.println((int) f0.invokeExact("x", "y")); // 2
82.1892 - * </pre></blockquote>
82.1893 - * @param target the method handle to invoke before filtering the return value
82.1894 - * @param filter method handle to call on the return value
82.1895 - * @return method handle which incorporates the specified return value filtering logic
82.1896 - * @throws NullPointerException if either argument is null
82.1897 - * @throws IllegalArgumentException if {@code filter}
82.1898 - * does not match the return type of {@code target} as described above
82.1899 - */
82.1900 - public static
82.1901 - MethodHandle filterReturnValue(MethodHandle target, MethodHandle filter) {
82.1902 - MethodType targetType = target.type();
82.1903 - MethodType filterType = filter.type();
82.1904 - if (filterType.parameterCount() != 1
82.1905 - || filterType.parameterType(0) != targetType.returnType())
82.1906 - throw newIllegalArgumentException("target and filter types do not match");
82.1907 - // result = fold( lambda(retval, arg...) { filter(retval) },
82.1908 - // lambda( arg...) { target(arg...) } )
82.1909 - // FIXME: Too many nodes here.
82.1910 - MethodHandle returner = dropArguments(filter, 1, targetType.parameterList());
82.1911 - return foldArguments(returner, target);
82.1912 - }
82.1913 -
82.1914 - /**
82.1915 - * Adapt a target method handle {@code target} by pre-processing
82.1916 - * some of its arguments, and then calling the target with
82.1917 - * the result of the pre-processing, plus all original arguments.
82.1918 - * <p>
82.1919 - * The pre-processing is performed by a second method handle, the {@code combiner}.
82.1920 - * The first {@code N} arguments passed to the adapter,
82.1921 - * are copied to the combiner, which then produces a result.
82.1922 - * (Here, {@code N} is defined as the parameter count of the adapter.)
82.1923 - * After this, control passes to the {@code target}, with both the result
82.1924 - * of the combiner, and all the original incoming arguments.
82.1925 - * <p>
82.1926 - * The first argument type of the target must be identical with the
82.1927 - * return type of the combiner.
82.1928 - * The resulting adapter is the same type as the target, except that the
82.1929 - * initial argument type of the target is dropped.
82.1930 - * <p>
82.1931 - * (Note that {@link #dropArguments(MethodHandle,int,List) dropArguments} can be used to remove any arguments
82.1932 - * that either the {@code combiner} or {@code target} does not wish to receive.
82.1933 - * If some of the incoming arguments are destined only for the combiner,
82.1934 - * consider using {@link MethodHandle#asCollector asCollector} instead, since those
82.1935 - * arguments will not need to be live on the stack on entry to the
82.1936 - * target.)
82.1937 - * <p>
82.1938 - * The first argument of the target must be identical with the
82.1939 - * return value of the combiner.
82.1940 - * <p> Here is pseudocode for the resulting adapter:
82.1941 - * <blockquote><pre>
82.1942 - * // there are N arguments in the A sequence
82.1943 - * T target(V, A[N]..., B...);
82.1944 - * V combiner(A...);
82.1945 - * T adapter(A... a, B... b) {
82.1946 - * V v = combiner(a...);
82.1947 - * return target(v, a..., b...);
82.1948 - * }
82.1949 - * </pre></blockquote>
82.1950 - * @param target the method handle to invoke after arguments are combined
82.1951 - * @param combiner method handle to call initially on the incoming arguments
82.1952 - * @return method handle which incorporates the specified argument folding logic
82.1953 - * @throws NullPointerException if either argument is null
82.1954 - * @throws IllegalArgumentException if the first argument type of
82.1955 - * {@code target} is not the same as {@code combiner}'s return type,
82.1956 - * or if the following argument types of {@code target}
82.1957 - * are not identical with the argument types of {@code combiner}
82.1958 - */
82.1959 - public static
82.1960 - MethodHandle foldArguments(MethodHandle target, MethodHandle combiner) {
82.1961 - MethodType targetType = target.type();
82.1962 - MethodType combinerType = combiner.type();
82.1963 - int foldArgs = combinerType.parameterCount();
82.1964 - boolean ok = (targetType.parameterCount() >= 1 + foldArgs);
82.1965 - if (ok && !combinerType.parameterList().equals(targetType.parameterList().subList(1, foldArgs+1)))
82.1966 - ok = false;
82.1967 - if (ok && !combinerType.returnType().equals(targetType.parameterType(0)))
82.1968 - ok = false;
82.1969 - if (!ok)
82.1970 - throw misMatchedTypes("target and combiner types", targetType, combinerType);
82.1971 - MethodType newType = targetType.dropParameterTypes(0, 1);
82.1972 - return MethodHandleImpl.foldArguments(IMPL_TOKEN, target, newType, combiner);
82.1973 - }
82.1974 -
82.1975 - /**
82.1976 - * Make a method handle which adapts a target method handle,
82.1977 - * by guarding it with a test, a boolean-valued method handle.
82.1978 - * If the guard fails, a fallback handle is called instead.
82.1979 - * All three method handles must have the same corresponding
82.1980 - * argument and return types, except that the return type
82.1981 - * of the test must be boolean, and the test is allowed
82.1982 - * to have fewer arguments than the other two method handles.
82.1983 - * <p> Here is pseudocode for the resulting adapter:
82.1984 - * <blockquote><pre>
82.1985 - * boolean test(A...);
82.1986 - * T target(A...,B...);
82.1987 - * T fallback(A...,B...);
82.1988 - * T adapter(A... a,B... b) {
82.1989 - * if (test(a...))
82.1990 - * return target(a..., b...);
82.1991 - * else
82.1992 - * return fallback(a..., b...);
82.1993 - * }
82.1994 - * </pre></blockquote>
82.1995 - * Note that the test arguments ({@code a...} in the pseudocode) cannot
82.1996 - * be modified by execution of the test, and so are passed unchanged
82.1997 - * from the caller to the target or fallback as appropriate.
82.1998 - * @param test method handle used for test, must return boolean
82.1999 - * @param target method handle to call if test passes
82.2000 - * @param fallback method handle to call if test fails
82.2001 - * @return method handle which incorporates the specified if/then/else logic
82.2002 - * @throws NullPointerException if any argument is null
82.2003 - * @throws IllegalArgumentException if {@code test} does not return boolean,
82.2004 - * or if all three method types do not match (with the return
82.2005 - * type of {@code test} changed to match that of {@code target}).
82.2006 - */
82.2007 - public static
82.2008 - MethodHandle guardWithTest(MethodHandle test,
82.2009 - MethodHandle target,
82.2010 - MethodHandle fallback) {
82.2011 - MethodType gtype = test.type();
82.2012 - MethodType ttype = target.type();
82.2013 - MethodType ftype = fallback.type();
82.2014 - if (!ttype.equals(ftype))
82.2015 - throw misMatchedTypes("target and fallback types", ttype, ftype);
82.2016 - if (gtype.returnType() != boolean.class)
82.2017 - throw newIllegalArgumentException("guard type is not a predicate "+gtype);
82.2018 - List<Class<?>> targs = ttype.parameterList();
82.2019 - List<Class<?>> gargs = gtype.parameterList();
82.2020 - if (!targs.equals(gargs)) {
82.2021 - int gpc = gargs.size(), tpc = targs.size();
82.2022 - if (gpc >= tpc || !targs.subList(0, gpc).equals(gargs))
82.2023 - throw misMatchedTypes("target and test types", ttype, gtype);
82.2024 - test = dropArguments(test, gpc, targs.subList(gpc, tpc));
82.2025 - gtype = test.type();
82.2026 - }
82.2027 - return MethodHandleImpl.makeGuardWithTest(IMPL_TOKEN, test, target, fallback);
82.2028 - }
82.2029 -
82.2030 - static RuntimeException misMatchedTypes(String what, MethodType t1, MethodType t2) {
82.2031 - return newIllegalArgumentException(what + " must match: " + t1 + " != " + t2);
82.2032 - }
82.2033 -
82.2034 - /**
82.2035 - * Make a method handle which adapts a target method handle,
82.2036 - * by running it inside an exception handler.
82.2037 - * If the target returns normally, the adapter returns that value.
82.2038 - * If an exception matching the specified type is thrown, the fallback
82.2039 - * handle is called instead on the exception, plus the original arguments.
82.2040 - * <p>
82.2041 - * The target and handler must have the same corresponding
82.2042 - * argument and return types, except that handler may omit trailing arguments
82.2043 - * (similarly to the predicate in {@link #guardWithTest guardWithTest}).
82.2044 - * Also, the handler must have an extra leading parameter of {@code exType} or a supertype.
82.2045 - * <p> Here is pseudocode for the resulting adapter:
82.2046 - * <blockquote><pre>
82.2047 - * T target(A..., B...);
82.2048 - * T handler(ExType, A...);
82.2049 - * T adapter(A... a, B... b) {
82.2050 - * try {
82.2051 - * return target(a..., b...);
82.2052 - * } catch (ExType ex) {
82.2053 - * return handler(ex, a...);
82.2054 - * }
82.2055 - * }
82.2056 - * </pre></blockquote>
82.2057 - * Note that the saved arguments ({@code a...} in the pseudocode) cannot
82.2058 - * be modified by execution of the target, and so are passed unchanged
82.2059 - * from the caller to the handler, if the handler is invoked.
82.2060 - * <p>
82.2061 - * The target and handler must return the same type, even if the handler
82.2062 - * always throws. (This might happen, for instance, because the handler
82.2063 - * is simulating a {@code finally} clause).
82.2064 - * To create such a throwing handler, compose the handler creation logic
82.2065 - * with {@link #throwException throwException},
82.2066 - * in order to create a method handle of the correct return type.
82.2067 - * @param target method handle to call
82.2068 - * @param exType the type of exception which the handler will catch
82.2069 - * @param handler method handle to call if a matching exception is thrown
82.2070 - * @return method handle which incorporates the specified try/catch logic
82.2071 - * @throws NullPointerException if any argument is null
82.2072 - * @throws IllegalArgumentException if {@code handler} does not accept
82.2073 - * the given exception type, or if the method handle types do
82.2074 - * not match in their return types and their
82.2075 - * corresponding parameters
82.2076 - */
82.2077 - public static
82.2078 - MethodHandle catchException(MethodHandle target,
82.2079 - Class<? extends Throwable> exType,
82.2080 - MethodHandle handler) {
82.2081 - MethodType ttype = target.type();
82.2082 - MethodType htype = handler.type();
82.2083 - if (htype.parameterCount() < 1 ||
82.2084 - !htype.parameterType(0).isAssignableFrom(exType))
82.2085 - throw newIllegalArgumentException("handler does not accept exception type "+exType);
82.2086 - if (htype.returnType() != ttype.returnType())
82.2087 - throw misMatchedTypes("target and handler return types", ttype, htype);
82.2088 - List<Class<?>> targs = ttype.parameterList();
82.2089 - List<Class<?>> hargs = htype.parameterList();
82.2090 - hargs = hargs.subList(1, hargs.size()); // omit leading parameter from handler
82.2091 - if (!targs.equals(hargs)) {
82.2092 - int hpc = hargs.size(), tpc = targs.size();
82.2093 - if (hpc >= tpc || !targs.subList(0, hpc).equals(hargs))
82.2094 - throw misMatchedTypes("target and handler types", ttype, htype);
82.2095 - handler = dropArguments(handler, hpc, hargs.subList(hpc, tpc));
82.2096 - htype = handler.type();
82.2097 - }
82.2098 - return MethodHandleImpl.makeGuardWithCatch(IMPL_TOKEN, target, exType, handler);
82.2099 - }
82.2100 -
82.2101 - /**
82.2102 - * Produces a method handle which will throw exceptions of the given {@code exType}.
82.2103 - * The method handle will accept a single argument of {@code exType},
82.2104 - * and immediately throw it as an exception.
82.2105 - * The method type will nominally specify a return of {@code returnType}.
82.2106 - * The return type may be anything convenient: It doesn't matter to the
82.2107 - * method handle's behavior, since it will never return normally.
82.2108 - * @return method handle which can throw the given exceptions
82.2109 - * @throws NullPointerException if either argument is null
82.2110 - */
82.2111 - public static
82.2112 - MethodHandle throwException(Class<?> returnType, Class<? extends Throwable> exType) {
82.2113 - return MethodHandleImpl.throwException(IMPL_TOKEN, MethodType.methodType(returnType, exType));
82.2114 - }
82.2115 -
82.2116 - /**
82.2117 - * Produces an instance of the given "SAM" interface which redirects
82.2118 - * its calls to the given method handle.
82.2119 - * <p>
82.2120 - * A SAM interface is an interface which declares a single abstract method.
82.2121 - * When determining the unique abstract method of a SAM interface,
82.2122 - * the public {@code Object} methods ({@code toString}, {@code equals}, {@code hashCode})
82.2123 - * are disregarded. For example, {@link java.util.Comparator} is a SAM interface,
82.2124 - * even though it re-declares the {@code Object.equals} method.
82.2125 - * Also, if the SAM interface has a supertype,
82.2126 - * the SAM interface may override an inherited method.
82.2127 - * Any such overrides are respected, and the method handle will be accessible
82.2128 - * by either the inherited method or the SAM method.
82.2129 - * In particular, a {@linkplain java.lang.reflect.Method#isBridge bridge method}
82.2130 - * may be created if the methods have different return types.
82.2131 - * <p>
82.2132 - * The type must be public. No additional access checks are performed.
82.2133 - * <p>
82.2134 - * The resulting instance of the required SAM type will respond to
82.2135 - * invocation of the SAM type's single abstract method by calling
82.2136 - * the given {@code target} on the incoming arguments,
82.2137 - * and returning or throwing whatever the {@code target}
82.2138 - * returns or throws. The invocation will be as if by
82.2139 - * {@code target.invokeGeneric}.
82.2140 - * The target's type will be checked before the SAM
82.2141 - * instance is created, as if by a call to {@code asType},
82.2142 - * which may result in a {@code WrongMethodTypeException}.
82.2143 - * <p>
82.2144 - * The wrapper instance will implement the requested SAM interface
82.2145 - * and its super-types, but no other SAM types.
82.2146 - * This means that the SAM instance will not unexpectedly
82.2147 - * pass an {@code instanceof} test for any unrequested type.
82.2148 - * <p style="font-size:smaller;">
82.2149 - * <em>Implementation Note:</em>
82.2150 - * Therefore, each SAM instance must implement a unique SAM type.
82.2151 - * Implementations may not bundle together
82.2152 - * multiple SAM types onto single implementation classes
82.2153 - * in the style of {@link java.awt.AWTEventMulticaster}.
82.2154 - * <p>
82.2155 - * The method handle may throw an <em>undeclared exception</em>,
82.2156 - * which means any checked exception (or other checked throwable)
82.2157 - * not declared by the SAM type's single abstract method.
82.2158 - * If this happens, the throwable will be wrapped in an instance of
82.2159 - * {@link java.lang.reflect.UndeclaredThrowableException UndeclaredThrowableException}
82.2160 - * and thrown in that wrapped form.
82.2161 - * <p>
82.2162 - * Like {@link java.lang.Integer#valueOf Integer.valueOf},
82.2163 - * {@code asInstance} is a factory method whose results are defined
82.2164 - * by their behavior.
82.2165 - * It is not guaranteed to return a new instance for every call.
82.2166 - * <p>
82.2167 - * Future versions of this API may accept additional types,
82.2168 - * such as abstract classes with single abstract methods.
82.2169 - * Future versions of this API may also equip wrapper instances
82.2170 - * with one or more additional public "marker" interfaces.
82.2171 - *
82.2172 - * @param target the method handle to invoke from the wrapper
82.2173 - * @param samType the desired type of the wrapper, a SAM type
82.2174 - * @return a correctly-typed wrapper for the given {@code target}
82.2175 - * @throws NullPointerException if either argument is null
82.2176 - * @throws IllegalArgumentException if the {@code samType} is not a
82.2177 - * valid argument to this method
82.2178 - * @throws WrongMethodTypeException if the {@code target} cannot
82.2179 - * be converted to the type required by the SAM type
82.2180 - */
82.2181 - // Other notes to implementors:
82.2182 - // <p>
82.2183 - // No stable mapping is promised between the SAM type and
82.2184 - // the implementation class C. Over time, several implementation
82.2185 - // classes might be used for the same SAM type.
82.2186 - // <p>
82.2187 - // If the implementation is able
82.2188 - // to prove that a wrapper of the required SAM type
82.2189 - // has already been created for a given
82.2190 - // method handle, or for another method handle with the
82.2191 - // same behavior, the implementation may return that wrapper in place of
82.2192 - // a new wrapper.
82.2193 - // <p>
82.2194 - // This method is designed to apply to common use cases
82.2195 - // where a single method handle must interoperate with
82.2196 - // an interface that implements a function-like
82.2197 - // API. Additional variations, such as SAM classes with
82.2198 - // private constructors, or interfaces with multiple but related
82.2199 - // entry points, must be covered by hand-written or automatically
82.2200 - // generated adapter classes.
82.2201 - //
82.2202 - public static
82.2203 - <T> T asInstance(final MethodHandle target, final Class<T> samType) {
82.2204 - // POC implementation only; violates the above contract several ways
82.2205 - final Method sam = getSamMethod(samType);
82.2206 - if (sam == null)
82.2207 - throw new IllegalArgumentException("not a SAM type: "+samType.getName());
82.2208 - MethodType samMT = MethodType.methodType(sam.getReturnType(), sam.getParameterTypes());
82.2209 - MethodHandle checkTarget = target.asType(samMT); // make throw WMT
82.2210 - checkTarget = checkTarget.asType(checkTarget.type().changeReturnType(Object.class));
82.2211 - final MethodHandle vaTarget = checkTarget.asSpreader(Object[].class, samMT.parameterCount());
82.2212 - return samType.cast(Proxy.newProxyInstance(
82.2213 - samType.getClassLoader(),
82.2214 - new Class[]{ samType, WrapperInstance.class },
82.2215 - new InvocationHandler() {
82.2216 - private Object getArg(String name) {
82.2217 - if ((Object)name == "getWrapperInstanceTarget") return target;
82.2218 - if ((Object)name == "getWrapperInstanceType") return samType;
82.2219 - throw new AssertionError();
82.2220 - }
82.2221 - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
82.2222 - if (method.getDeclaringClass() == WrapperInstance.class)
82.2223 - return getArg(method.getName());
82.2224 - if (method.equals(sam))
82.2225 - return vaTarget.invokeExact(args);
82.2226 - if (isObjectMethod(method))
82.2227 - return callObjectMethod(this, method, args);
82.2228 - throw new InternalError();
82.2229 - }
82.2230 - }));
82.2231 - }
82.2232 -
82.2233 - /**
82.2234 - * Determine if the given object was produced by a call to {@link #asInstance asInstance}.
82.2235 - * @param x any reference
82.2236 - * @return true if the reference is not null and points to an object produced by {@code asInstance}
82.2237 - */
82.2238 - public static
82.2239 - boolean isWrapperInstance(Object x) {
82.2240 - return x instanceof WrapperInstance;
82.2241 - }
82.2242 -
82.2243 - private static WrapperInstance asWrapperInstance(Object x) {
82.2244 - try {
82.2245 - if (x != null)
82.2246 - return (WrapperInstance) x;
82.2247 - } catch (ClassCastException ex) {
82.2248 - }
82.2249 - throw new IllegalArgumentException("not a wrapper instance");
82.2250 - }
82.2251 -
82.2252 - /**
82.2253 - * Produces or recovers a target method handle which is behaviorally
82.2254 - * equivalent to the SAM method of this wrapper instance.
82.2255 - * The object {@code x} must have been produced by a call to {@link #asInstance asInstance}.
82.2256 - * This requirement may be tested via {@link #isWrapperInstance isWrapperInstance}.
82.2257 - * @param x any reference
82.2258 - * @return a method handle implementing the SAM method
82.2259 - * @throws IllegalArgumentException if the reference x is not to a wrapper instance
82.2260 - */
82.2261 - public static
82.2262 - MethodHandle wrapperInstanceTarget(Object x) {
82.2263 - return asWrapperInstance(x).getWrapperInstanceTarget();
82.2264 - }
82.2265 -
82.2266 - /**
82.2267 - * Recover the SAM type for which this wrapper instance was created.
82.2268 - * The object {@code x} must have been produced by a call to {@link #asInstance asInstance}.
82.2269 - * This requirement may be tested via {@link #isWrapperInstance isWrapperInstance}.
82.2270 - * @param x any reference
82.2271 - * @return the SAM type for which the wrapper was created
82.2272 - * @throws IllegalArgumentException if the reference x is not to a wrapper instance
82.2273 - */
82.2274 - public static
82.2275 - Class<?> wrapperInstanceType(Object x) {
82.2276 - return asWrapperInstance(x).getWrapperInstanceType();
82.2277 - }
82.2278 -
82.2279 - private static
82.2280 - boolean isObjectMethod(Method m) {
82.2281 - switch (m.getName()) {
82.2282 - case "toString":
82.2283 - return (m.getReturnType() == String.class
82.2284 - && m.getParameterTypes().length == 0);
82.2285 - case "hashCode":
82.2286 - return (m.getReturnType() == int.class
82.2287 - && m.getParameterTypes().length == 0);
82.2288 - case "equals":
82.2289 - return (m.getReturnType() == boolean.class
82.2290 - && m.getParameterTypes().length == 1
82.2291 - && m.getParameterTypes()[0] == Object.class);
82.2292 - }
82.2293 - return false;
82.2294 - }
82.2295 -
82.2296 - private static
82.2297 - Object callObjectMethod(Object self, Method m, Object[] args) {
82.2298 - assert(isObjectMethod(m)) : m;
82.2299 - switch (m.getName()) {
82.2300 - case "toString":
82.2301 - return self.getClass().getName() + "@" + Integer.toHexString(self.hashCode());
82.2302 - case "hashCode":
82.2303 - return System.identityHashCode(self);
82.2304 - case "equals":
82.2305 - return (self == args[0]);
82.2306 - }
82.2307 - return null;
82.2308 - }
82.2309 -
82.2310 - private static
82.2311 - Method getSamMethod(Class<?> samType) {
82.2312 - Method sam = null;
82.2313 - for (Method m : samType.getMethods()) {
82.2314 - int mod = m.getModifiers();
82.2315 - if (Modifier.isAbstract(mod)) {
82.2316 - if (sam != null && !isObjectMethod(sam))
82.2317 - return null; // too many abstract methods
82.2318 - sam = m;
82.2319 - }
82.2320 - }
82.2321 - if (!samType.isInterface() && getSamConstructor(samType) == null)
82.2322 - return null; // wrong kind of constructor
82.2323 - return sam;
82.2324 - }
82.2325 -
82.2326 - private static
82.2327 - Constructor getSamConstructor(Class<?> samType) {
82.2328 - for (Constructor c : samType.getDeclaredConstructors()) {
82.2329 - if (c.getParameterTypes().length == 0) {
82.2330 - int mod = c.getModifiers();
82.2331 - if (Modifier.isPublic(mod) || Modifier.isProtected(mod))
82.2332 - return c;
82.2333 - }
82.2334 - }
82.2335 - return null;
82.2336 - }
82.2337 -
82.2338 - /*non-public*/
82.2339 - static MethodHandle asVarargsCollector(MethodHandle target, Class<?> arrayType) {
82.2340 - return MethodHandleImpl.asVarargsCollector(IMPL_TOKEN, target, arrayType);
82.2341 - }
82.2342 -}
83.1 --- a/src/share/classes/java/dyn/MethodType.java Tue Mar 29 11:29:01 2011 -0700
83.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
83.3 @@ -1,865 +0,0 @@
83.4 -/*
83.5 - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
83.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
83.7 - *
83.8 - * This code is free software; you can redistribute it and/or modify it
83.9 - * under the terms of the GNU General Public License version 2 only, as
83.10 - * published by the Free Software Foundation. Oracle designates this
83.11 - * particular file as subject to the "Classpath" exception as provided
83.12 - * by Oracle in the LICENSE file that accompanied this code.
83.13 - *
83.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
83.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
83.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
83.17 - * version 2 for more details (a copy is included in the LICENSE file that
83.18 - * accompanied this code).
83.19 - *
83.20 - * You should have received a copy of the GNU General Public License version
83.21 - * 2 along with this work; if not, write to the Free Software Foundation,
83.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
83.23 - *
83.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
83.25 - * or visit www.oracle.com if you need additional information or have any
83.26 - * questions.
83.27 - */
83.28 -
83.29 -package java.dyn;
83.30 -
83.31 -import java.util.Arrays;
83.32 -import java.util.Collections;
83.33 -import java.util.HashMap;
83.34 -import java.util.List;
83.35 -import sun.dyn.Access;
83.36 -import sun.dyn.Invokers;
83.37 -import sun.dyn.MethodHandleImpl;
83.38 -import sun.dyn.MethodTypeImpl;
83.39 -import sun.dyn.util.BytecodeDescriptor;
83.40 -import static sun.dyn.MemberName.newIllegalArgumentException;
83.41 -
83.42 -/**
83.43 - * A method type represents the arguments and return type accepted and
83.44 - * returned by a method handle, or the arguments and return type passed
83.45 - * and expected by a method handle caller. Method types must be properly
83.46 - * matched between a method handle and all its callers,
83.47 - * and the JVM's operations enforce this matching at, specifically
83.48 - * during calls to {@link MethodHandle#invokeExact MethodHandle.invokeExact}
83.49 - * and {@link MethodHandle#invokeGeneric MethodHandle.invokeGeneric}, and during execution
83.50 - * of {@code invokedynamic} instructions.
83.51 - * <p>
83.52 - * The structure is a return type accompanied by any number of parameter types.
83.53 - * The types (primitive, {@code void}, and reference) are represented by {@link Class} objects.
83.54 - * (For ease of exposition, we treat {@code void} as if it were a type.
83.55 - * In fact, it denotes the absence of a return type.)
83.56 - * <p>
83.57 - * All instances of {@code MethodType} are immutable.
83.58 - * Two instances are completely interchangeable if they compare equal.
83.59 - * Equality depends on pairwise correspondence of the return and parameter types and on nothing else.
83.60 - * <p>
83.61 - * This type can be created only by factory methods.
83.62 - * All factory methods may cache values, though caching is not guaranteed.
83.63 - * Some factory methods are static, while others are virtual methods which
83.64 - * modify precursor method types, e.g., by changing a selected parameter.
83.65 - * <p>
83.66 - * Factory methods which operate on groups of parameter types
83.67 - * are systematically presented in two versions, so that both Java arrays and
83.68 - * Java lists can be used to work with groups of parameter types.
83.69 - * The query methods {@code parameterArray} and {@code parameterList}
83.70 - * also provide a choice between arrays and lists.
83.71 - * <p>
83.72 - * {@code MethodType} objects are sometimes derived from bytecode instructions
83.73 - * such as {@code invokedynamic}, specifically from the type descriptor strings associated
83.74 - * with the instructions in a class file's constant pool.
83.75 - * <p>
83.76 - * Like classes and strings, method types can also be represented directly
83.77 - * in a class file's constant pool as constants.
83.78 - * A method type may be loaded by an {@code ldc} instruction which refers
83.79 - * to a suitable {@code CONSTANT_MethodType} constant pool entry.
83.80 - * The entry refers to a {@code CONSTANT_Utf8} spelling for the descriptor string.
83.81 - * For more details, see the <a href="package-summary.html#mtcon">package summary</a>.
83.82 - * <p>
83.83 - * When the JVM materializes a {@code MethodType} from a descriptor string,
83.84 - * all classes named in the descriptor must be accessible, and will be loaded.
83.85 - * (But the classes need not be initialized, as is the case with a {@code CONSTANT_Class}.)
83.86 - * This loading may occur at any time before the {@code MethodType} object is first derived.
83.87 - * @author John Rose, JSR 292 EG
83.88 - */
83.89 -public final
83.90 -class MethodType implements java.io.Serializable {
83.91 - private static final long serialVersionUID = 292L; // {rtype, {ptype...}}
83.92 -
83.93 - // The rtype and ptypes fields define the structural identity of the method type:
83.94 - private final Class<?> rtype;
83.95 - private final Class<?>[] ptypes;
83.96 -
83.97 - // The remaining fields are caches of various sorts:
83.98 - private MethodTypeForm form; // erased form, plus cached data about primitives
83.99 - private MethodType wrapAlt; // alternative wrapped/unwrapped version
83.100 - private Invokers invokers; // cache of handy higher-order adapters
83.101 -
83.102 - private static final Access IMPL_TOKEN = Access.getToken();
83.103 -
83.104 - // share a cache with a friend in this package
83.105 - Invokers getInvokers() { return invokers; }
83.106 - void setInvokers(Invokers inv) { invokers = inv; }
83.107 -
83.108 - static {
83.109 - // This hack allows the implementation package special access to
83.110 - // the internals of MethodType. In particular, the MTImpl has all sorts
83.111 - // of cached information useful to the implementation code.
83.112 - MethodTypeImpl.setMethodTypeFriend(IMPL_TOKEN, new MethodTypeImpl.MethodTypeFriend() {
83.113 - public Class<?>[] ptypes(MethodType mt) { return mt.ptypes; }
83.114 - public MethodTypeImpl form(MethodType mt) { return mt.form; }
83.115 - public void setForm(MethodType mt, MethodTypeImpl form) {
83.116 - assert(mt.form == null);
83.117 - mt.form = (MethodTypeForm) form;
83.118 - }
83.119 - public MethodType makeImpl(Class<?> rtype, Class<?>[] ptypes, boolean trusted) {
83.120 - return MethodType.makeImpl(rtype, ptypes, trusted);
83.121 - }
83.122 - public MethodTypeImpl newMethodTypeForm(MethodType mt) {
83.123 - return new MethodTypeForm(mt);
83.124 - }
83.125 - public Invokers getInvokers(MethodType mt) { return mt.invokers; }
83.126 - public void setInvokers(MethodType mt, Invokers inv) { mt.invokers = inv; }
83.127 - });
83.128 - }
83.129 -
83.130 - /**
83.131 - * Check the given parameters for validity and store them into the final fields.
83.132 - */
83.133 - private MethodType(Class<?> rtype, Class<?>[] ptypes) {
83.134 - checkRtype(rtype);
83.135 - checkPtypes(ptypes);
83.136 - this.rtype = rtype;
83.137 - this.ptypes = ptypes;
83.138 - }
83.139 -
83.140 - private static void checkRtype(Class<?> rtype) {
83.141 - rtype.equals(rtype); // null check
83.142 - }
83.143 - private static int checkPtype(Class<?> ptype) {
83.144 - ptype.getClass(); //NPE
83.145 - if (ptype == void.class)
83.146 - throw newIllegalArgumentException("parameter type cannot be void");
83.147 - if (ptype == double.class || ptype == long.class) return 1;
83.148 - return 0;
83.149 - }
83.150 - /** Return number of extra slots (count of long/double args). */
83.151 - private static int checkPtypes(Class<?>[] ptypes) {
83.152 - int slots = 0;
83.153 - for (Class<?> ptype : ptypes) {
83.154 - slots += checkPtype(ptype);
83.155 - }
83.156 - checkSlotCount(ptypes.length + slots);
83.157 - return slots;
83.158 - }
83.159 - private static void checkSlotCount(int count) {
83.160 - if ((count & 0xFF) != count)
83.161 - throw newIllegalArgumentException("bad parameter count "+count);
83.162 - }
83.163 - private static IndexOutOfBoundsException newIndexOutOfBoundsException(Object num) {
83.164 - if (num instanceof Integer) num = "bad index: "+num;
83.165 - return new IndexOutOfBoundsException(num.toString());
83.166 - }
83.167 -
83.168 - static final HashMap<MethodType,MethodType> internTable
83.169 - = new HashMap<MethodType, MethodType>();
83.170 -
83.171 - static final Class<?>[] NO_PTYPES = {};
83.172 -
83.173 - /**
83.174 - * Find or create an instance of the given method type.
83.175 - * @param rtype the return type
83.176 - * @param ptypes the parameter types
83.177 - * @return a method type with the given components
83.178 - * @throws NullPointerException if {@code rtype} or {@code ptypes} or any element of {@code ptypes} is null
83.179 - * @throws IllegalArgumentException if any element of {@code ptypes} is {@code void.class}
83.180 - */
83.181 - public static
83.182 - MethodType methodType(Class<?> rtype, Class<?>[] ptypes) {
83.183 - return makeImpl(rtype, ptypes, false);
83.184 - }
83.185 -
83.186 - /**
83.187 - * Finds or creates a method type with the given components.
83.188 - * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
83.189 - * @return a method type with the given components
83.190 - * @throws NullPointerException if {@code rtype} or {@code ptypes} or any element of {@code ptypes} is null
83.191 - * @throws IllegalArgumentException if any element of {@code ptypes} is {@code void.class}
83.192 - */
83.193 - public static
83.194 - MethodType methodType(Class<?> rtype, List<Class<?>> ptypes) {
83.195 - boolean notrust = false; // random List impl. could return evil ptypes array
83.196 - return makeImpl(rtype, ptypes.toArray(NO_PTYPES), notrust);
83.197 - }
83.198 -
83.199 - /**
83.200 - * Finds or creates a method type with the given components.
83.201 - * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
83.202 - * The leading parameter type is prepended to the remaining array.
83.203 - * @return a method type with the given components
83.204 - * @throws NullPointerException if {@code rtype} or {@code ptype0} or {@code ptypes} or any element of {@code ptypes} is null
83.205 - * @throws IllegalArgumentException if {@code ptype0} or {@code ptypes} or any element of {@code ptypes} is {@code void.class}
83.206 - */
83.207 - public static
83.208 - MethodType methodType(Class<?> rtype, Class<?> ptype0, Class<?>... ptypes) {
83.209 - Class<?>[] ptypes1 = new Class<?>[1+ptypes.length];
83.210 - ptypes1[0] = ptype0;
83.211 - System.arraycopy(ptypes, 0, ptypes1, 1, ptypes.length);
83.212 - return makeImpl(rtype, ptypes1, true);
83.213 - }
83.214 -
83.215 - /**
83.216 - * Finds or creates a method type with the given components.
83.217 - * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
83.218 - * The resulting method has no parameter types.
83.219 - * @return a method type with the given return value
83.220 - * @throws NullPointerException if {@code rtype} is null
83.221 - */
83.222 - public static
83.223 - MethodType methodType(Class<?> rtype) {
83.224 - return makeImpl(rtype, NO_PTYPES, true);
83.225 - }
83.226 -
83.227 - /**
83.228 - * Finds or creates a method type with the given components.
83.229 - * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
83.230 - * The resulting method has the single given parameter type.
83.231 - * @return a method type with the given return value and parameter type
83.232 - * @throws NullPointerException if {@code rtype} or {@code ptype0} is null
83.233 - * @throws IllegalArgumentException if {@code ptype0} is {@code void.class}
83.234 - */
83.235 - public static
83.236 - MethodType methodType(Class<?> rtype, Class<?> ptype0) {
83.237 - return makeImpl(rtype, new Class<?>[]{ ptype0 }, true);
83.238 - }
83.239 -
83.240 - /**
83.241 - * Finds or creates a method type with the given components.
83.242 - * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
83.243 - * The resulting method has the same parameter types as {@code ptypes},
83.244 - * and the specified return type.
83.245 - * @throws NullPointerException if {@code rtype} or {@code ptypes} is null
83.246 - */
83.247 - public static
83.248 - MethodType methodType(Class<?> rtype, MethodType ptypes) {
83.249 - return makeImpl(rtype, ptypes.ptypes, true);
83.250 - }
83.251 -
83.252 - /**
83.253 - * Sole factory method to find or create an interned method type.
83.254 - * @param rtype desired return type
83.255 - * @param ptypes desired parameter types
83.256 - * @param trusted whether the ptypes can be used without cloning
83.257 - * @return the unique method type of the desired structure
83.258 - */
83.259 - private static
83.260 - MethodType makeImpl(Class<?> rtype, Class<?>[] ptypes, boolean trusted) {
83.261 - if (ptypes == null || ptypes.length == 0) {
83.262 - ptypes = NO_PTYPES; trusted = true;
83.263 - }
83.264 - MethodType mt1 = new MethodType(rtype, ptypes);
83.265 - MethodType mt0;
83.266 - synchronized (internTable) {
83.267 - mt0 = internTable.get(mt1);
83.268 - if (mt0 != null)
83.269 - return mt0;
83.270 - }
83.271 - if (!trusted)
83.272 - // defensively copy the array passed in by the user
83.273 - mt1 = new MethodType(rtype, ptypes.clone());
83.274 - // promote the object to the Real Thing, and reprobe
83.275 - MethodTypeImpl.initForm(IMPL_TOKEN, mt1);
83.276 - synchronized (internTable) {
83.277 - mt0 = internTable.get(mt1);
83.278 - if (mt0 != null)
83.279 - return mt0;
83.280 - internTable.put(mt1, mt1);
83.281 - }
83.282 - return mt1;
83.283 - }
83.284 -
83.285 - // Entry point from JVM. TODO: Change the name & signature.
83.286 - private static MethodType makeImpl(Class<?> rtype, Class<?>[] ptypes,
83.287 - boolean ignore1, boolean ignore2) {
83.288 - return makeImpl(rtype, ptypes, true);
83.289 - }
83.290 -
83.291 - private static final MethodType[] objectOnlyTypes = new MethodType[20];
83.292 -
83.293 - /**
83.294 - * Finds or creates a method type whose components are {@code Object} with an optional trailing {@code Object[]} array.
83.295 - * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
83.296 - * All parameters and the return type will be {@code Object},
83.297 - * except the final varargs parameter if any, which will be {@code Object[]}.
83.298 - * @param objectArgCount number of parameters (excluding the varargs parameter if any)
83.299 - * @param varargs whether there will be a varargs parameter, of type {@code Object[]}
83.300 - * @return a totally generic method type, given only its count of parameters and varargs
83.301 - * @throws IllegalArgumentException if {@code objectArgCount} is negative or greater than 255
83.302 - * @see #genericMethodType(int)
83.303 - */
83.304 - public static
83.305 - MethodType genericMethodType(int objectArgCount, boolean varargs) {
83.306 - MethodType mt;
83.307 - checkSlotCount(objectArgCount);
83.308 - int ivarargs = (!varargs ? 0 : 1);
83.309 - int ootIndex = objectArgCount*2 + ivarargs;
83.310 - if (ootIndex < objectOnlyTypes.length) {
83.311 - mt = objectOnlyTypes[ootIndex];
83.312 - if (mt != null) return mt;
83.313 - }
83.314 - Class<?>[] ptypes = new Class<?>[objectArgCount + ivarargs];
83.315 - Arrays.fill(ptypes, Object.class);
83.316 - if (ivarargs != 0) ptypes[objectArgCount] = Object[].class;
83.317 - mt = makeImpl(Object.class, ptypes, true);
83.318 - if (ootIndex < objectOnlyTypes.length) {
83.319 - objectOnlyTypes[ootIndex] = mt; // cache it here also!
83.320 - }
83.321 - return mt;
83.322 - }
83.323 -
83.324 - /**
83.325 - * Finds or creates a method type whose components are all {@code Object}.
83.326 - * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
83.327 - * All parameters and the return type will be Object.
83.328 - * @param objectArgCount number of parameters
83.329 - * @return a totally generic method type, given only its count of parameters
83.330 - * @throws IllegalArgumentException if {@code objectArgCount} is negative or greater than 255
83.331 - * @see #genericMethodType(int, boolean)
83.332 - */
83.333 - public static
83.334 - MethodType genericMethodType(int objectArgCount) {
83.335 - return genericMethodType(objectArgCount, false);
83.336 - }
83.337 -
83.338 - /**
83.339 - * Finds or creates a method type with a single different parameter type.
83.340 - * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
83.341 - * @param num the index (zero-based) of the parameter type to change
83.342 - * @param nptype a new parameter type to replace the old one with
83.343 - * @return the same type, except with the selected parameter changed
83.344 - * @throws IndexOutOfBoundsException if {@code num} is not a valid index into {@code parameterArray()}
83.345 - * @throws IllegalArgumentException if {@code nptype} is {@code void.class}
83.346 - * @throws NullPointerException if {@code nptype} is null
83.347 - */
83.348 - public MethodType changeParameterType(int num, Class<?> nptype) {
83.349 - if (parameterType(num) == nptype) return this;
83.350 - checkPtype(nptype);
83.351 - Class<?>[] nptypes = ptypes.clone();
83.352 - nptypes[num] = nptype;
83.353 - return makeImpl(rtype, nptypes, true);
83.354 - }
83.355 -
83.356 - /**
83.357 - * Finds or creates a method type with additional parameter types.
83.358 - * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
83.359 - * @param num the position (zero-based) of the inserted parameter type(s)
83.360 - * @param ptypesToInsert zero or more new parameter types to insert into the parameter list
83.361 - * @return the same type, except with the selected parameter(s) inserted
83.362 - * @throws IndexOutOfBoundsException if {@code num} is negative or greater than {@code parameterCount()}
83.363 - * @throws IllegalArgumentException if any element of {@code ptypesToInsert} is {@code void.class}
83.364 - * or if the resulting method type would have more than 255 parameter slots
83.365 - * @throws NullPointerException if {@code ptypesToInsert} or any of its elements is null
83.366 - */
83.367 - public MethodType insertParameterTypes(int num, Class<?>... ptypesToInsert) {
83.368 - int len = ptypes.length;
83.369 - if (num < 0 || num > len)
83.370 - throw newIndexOutOfBoundsException(num);
83.371 - int ins = checkPtypes(ptypesToInsert);
83.372 - checkSlotCount(parameterSlotCount() + ptypesToInsert.length + ins);
83.373 - int ilen = ptypesToInsert.length;
83.374 - if (ilen == 0) return this;
83.375 - Class<?>[] nptypes = Arrays.copyOfRange(ptypes, 0, len+ilen);
83.376 - System.arraycopy(nptypes, num, nptypes, num+ilen, len-num);
83.377 - System.arraycopy(ptypesToInsert, 0, nptypes, num, ilen);
83.378 - return makeImpl(rtype, nptypes, true);
83.379 - }
83.380 -
83.381 - /**
83.382 - * Finds or creates a method type with additional parameter types.
83.383 - * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
83.384 - * @param ptypesToInsert zero or more new parameter types to insert after the end of the parameter list
83.385 - * @return the same type, except with the selected parameter(s) appended
83.386 - * @throws IllegalArgumentException if any element of {@code ptypesToInsert} is {@code void.class}
83.387 - * or if the resulting method type would have more than 255 parameter slots
83.388 - * @throws NullPointerException if {@code ptypesToInsert} or any of its elements is null
83.389 - */
83.390 - public MethodType appendParameterTypes(Class<?>... ptypesToInsert) {
83.391 - return insertParameterTypes(parameterCount(), ptypesToInsert);
83.392 - }
83.393 -
83.394 - /**
83.395 - * Finds or creates a method type with additional parameter types.
83.396 - * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
83.397 - * @param num the position (zero-based) of the inserted parameter type(s)
83.398 - * @param ptypesToInsert zero or more new parameter types to insert into the parameter list
83.399 - * @return the same type, except with the selected parameter(s) inserted
83.400 - * @throws IndexOutOfBoundsException if {@code num} is negative or greater than {@code parameterCount()}
83.401 - * @throws IllegalArgumentException if any element of {@code ptypesToInsert} is {@code void.class}
83.402 - * or if the resulting method type would have more than 255 parameter slots
83.403 - * @throws NullPointerException if {@code ptypesToInsert} or any of its elements is null
83.404 - */
83.405 - public MethodType insertParameterTypes(int num, List<Class<?>> ptypesToInsert) {
83.406 - return insertParameterTypes(num, ptypesToInsert.toArray(NO_PTYPES));
83.407 - }
83.408 -
83.409 - /**
83.410 - * Finds or creates a method type with additional parameter types.
83.411 - * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
83.412 - * @param ptypesToInsert zero or more new parameter types to insert after the end of the parameter list
83.413 - * @return the same type, except with the selected parameter(s) appended
83.414 - * @throws IllegalArgumentException if any element of {@code ptypesToInsert} is {@code void.class}
83.415 - * or if the resulting method type would have more than 255 parameter slots
83.416 - * @throws NullPointerException if {@code ptypesToInsert} or any of its elements is null
83.417 - */
83.418 - public MethodType appendParameterTypes(List<Class<?>> ptypesToInsert) {
83.419 - return insertParameterTypes(parameterCount(), ptypesToInsert);
83.420 - }
83.421 -
83.422 - /**
83.423 - * Finds or creates a method type with some parameter types omitted.
83.424 - * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
83.425 - * @param start the index (zero-based) of the first parameter type to remove
83.426 - * @param end the index (greater than {@code start}) of the first parameter type after not to remove
83.427 - * @return the same type, except with the selected parameter(s) removed
83.428 - * @throws IndexOutOfBoundsException if {@code start} is negative or greater than {@code parameterCount()}
83.429 - * or if {@code end} is negative or greater than {@code parameterCount()}
83.430 - * or if {@code start} is greater than {@code end}
83.431 - */
83.432 - public MethodType dropParameterTypes(int start, int end) {
83.433 - int len = ptypes.length;
83.434 - if (!(0 <= start && start <= end && end <= len))
83.435 - throw newIndexOutOfBoundsException("start="+start+" end="+end);
83.436 - if (start == end) return this;
83.437 - Class<?>[] nptypes;
83.438 - if (start == 0) {
83.439 - if (end == len) {
83.440 - // drop all parameters
83.441 - nptypes = NO_PTYPES;
83.442 - } else {
83.443 - // drop initial parameter(s)
83.444 - nptypes = Arrays.copyOfRange(ptypes, end, len);
83.445 - }
83.446 - } else {
83.447 - if (end == len) {
83.448 - // drop trailing parameter(s)
83.449 - nptypes = Arrays.copyOfRange(ptypes, 0, start);
83.450 - } else {
83.451 - int tail = len - end;
83.452 - nptypes = Arrays.copyOfRange(ptypes, 0, start + tail);
83.453 - System.arraycopy(ptypes, end, nptypes, start, tail);
83.454 - }
83.455 - }
83.456 - return makeImpl(rtype, nptypes, true);
83.457 - }
83.458 -
83.459 - /**
83.460 - * Finds or creates a method type with a different return type.
83.461 - * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
83.462 - * @param nrtype a return parameter type to replace the old one with
83.463 - * @return the same type, except with the return type change
83.464 - * @throws NullPointerException if {@code nrtype} is null
83.465 - */
83.466 - public MethodType changeReturnType(Class<?> nrtype) {
83.467 - if (returnType() == nrtype) return this;
83.468 - return makeImpl(nrtype, ptypes, true);
83.469 - }
83.470 -
83.471 - /**
83.472 - * Reports if this type contains a primitive argument or return value.
83.473 - * The return type {@code void} counts as a primitive.
83.474 - * @return true if any of the types are primitives
83.475 - */
83.476 - public boolean hasPrimitives() {
83.477 - return form.hasPrimitives();
83.478 - }
83.479 -
83.480 - /**
83.481 - * Reports if this type contains a wrapper argument or return value.
83.482 - * Wrappers are types which box primitive values, such as {@link Integer}.
83.483 - * The reference type {@code java.lang.Void} counts as a wrapper.
83.484 - * @return true if any of the types are wrappers
83.485 - */
83.486 - public boolean hasWrappers() {
83.487 - return unwrap() != this;
83.488 - }
83.489 -
83.490 - /**
83.491 - * Erases all reference types to {@code Object}.
83.492 - * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
83.493 - * All primitive types (including {@code void}) will remain unchanged.
83.494 - * @return a version of the original type with all reference types replaced
83.495 - */
83.496 - public MethodType erase() {
83.497 - return form.erasedType();
83.498 - }
83.499 -
83.500 - /**
83.501 - * Converts all types, both reference and primitive, to {@code Object}.
83.502 - * Convenience method for {@link #genericMethodType(int) genericMethodType}.
83.503 - * The expression {@code type.wrap().erase()} produces the same value
83.504 - * as {@code type.generic()}.
83.505 - * @return a version of the original type with all types replaced
83.506 - */
83.507 - public MethodType generic() {
83.508 - return genericMethodType(parameterCount());
83.509 - }
83.510 -
83.511 - /**
83.512 - * Converts all primitive types to their corresponding wrapper types.
83.513 - * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
83.514 - * All reference types (including wrapper types) will remain unchanged.
83.515 - * A {@code void} return type is changed to the type {@code java.lang.Void}.
83.516 - * The expression {@code type.wrap().erase()} produces the same value
83.517 - * as {@code type.generic()}.
83.518 - * @return a version of the original type with all primitive types replaced
83.519 - */
83.520 - public MethodType wrap() {
83.521 - return hasPrimitives() ? wrapWithPrims(this) : this;
83.522 - }
83.523 -
83.524 - /**
83.525 - * Convert all wrapper types to their corresponding primitive types.
83.526 - * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
83.527 - * All primitive types (including {@code void}) will remain unchanged.
83.528 - * A return type of {@code java.lang.Void} is changed to {@code void}.
83.529 - * @return a version of the original type with all wrapper types replaced
83.530 - */
83.531 - public MethodType unwrap() {
83.532 - MethodType noprims = !hasPrimitives() ? this : wrapWithPrims(this);
83.533 - return unwrapWithNoPrims(noprims);
83.534 - }
83.535 -
83.536 - private static MethodType wrapWithPrims(MethodType pt) {
83.537 - assert(pt.hasPrimitives());
83.538 - MethodType wt = pt.wrapAlt;
83.539 - if (wt == null) {
83.540 - // fill in lazily
83.541 - wt = MethodTypeImpl.canonicalize(pt, MethodTypeImpl.WRAP, MethodTypeImpl.WRAP);
83.542 - assert(wt != null);
83.543 - pt.wrapAlt = wt;
83.544 - }
83.545 - return wt;
83.546 - }
83.547 -
83.548 - private static MethodType unwrapWithNoPrims(MethodType wt) {
83.549 - assert(!wt.hasPrimitives());
83.550 - MethodType uwt = wt.wrapAlt;
83.551 - if (uwt == null) {
83.552 - // fill in lazily
83.553 - uwt = MethodTypeImpl.canonicalize(wt, MethodTypeImpl.UNWRAP, MethodTypeImpl.UNWRAP);
83.554 - if (uwt == null)
83.555 - uwt = wt; // type has no wrappers or prims at all
83.556 - wt.wrapAlt = uwt;
83.557 - }
83.558 - return uwt;
83.559 - }
83.560 -
83.561 - /**
83.562 - * Returns the parameter type at the specified index, within this method type.
83.563 - * @param num the index (zero-based) of the desired parameter type
83.564 - * @return the selected parameter type
83.565 - * @throws IndexOutOfBoundsException if {@code num} is not a valid index into {@code parameterArray()}
83.566 - */
83.567 - public Class<?> parameterType(int num) {
83.568 - return ptypes[num];
83.569 - }
83.570 - /**
83.571 - * Returns the number of parameter types in this method type.
83.572 - * @return the number of parameter types
83.573 - */
83.574 - public int parameterCount() {
83.575 - return ptypes.length;
83.576 - }
83.577 - /**
83.578 - * Returns the return type of this method type.
83.579 - * @return the return type
83.580 - */
83.581 - public Class<?> returnType() {
83.582 - return rtype;
83.583 - }
83.584 -
83.585 - /**
83.586 - * Presents the parameter types as a list (a convenience method).
83.587 - * The list will be immutable.
83.588 - * @return the parameter types (as an immutable list)
83.589 - */
83.590 - public List<Class<?>> parameterList() {
83.591 - return Collections.unmodifiableList(Arrays.asList(ptypes));
83.592 - }
83.593 -
83.594 - /**
83.595 - * Presents the parameter types as an array (a convenience method).
83.596 - * Changes to the array will not result in changes to the type.
83.597 - * @return the parameter types (as a fresh copy if necessary)
83.598 - */
83.599 - public Class<?>[] parameterArray() {
83.600 - return ptypes.clone();
83.601 - }
83.602 -
83.603 - /**
83.604 - * Compares the specified object with this type for equality.
83.605 - * That is, it returns <tt>true</tt> if and only if the specified object
83.606 - * is also a method type with exactly the same parameters and return type.
83.607 - * @param x object to compare
83.608 - * @see Object#equals(Object)
83.609 - */
83.610 - @Override
83.611 - public boolean equals(Object x) {
83.612 - return this == x || x instanceof MethodType && equals((MethodType)x);
83.613 - }
83.614 -
83.615 - private boolean equals(MethodType that) {
83.616 - return this.rtype == that.rtype
83.617 - && Arrays.equals(this.ptypes, that.ptypes);
83.618 - }
83.619 -
83.620 - /**
83.621 - * Returns the hash code value for this method type.
83.622 - * It is defined to be the same as the hashcode of a List
83.623 - * whose elements are the return type followed by the
83.624 - * parameter types.
83.625 - * @return the hash code value for this method type
83.626 - * @see Object#hashCode()
83.627 - * @see #equals(Object)
83.628 - * @see List#hashCode()
83.629 - */
83.630 - @Override
83.631 - public int hashCode() {
83.632 - int hashCode = 31 + rtype.hashCode();
83.633 - for (Class<?> ptype : ptypes)
83.634 - hashCode = 31*hashCode + ptype.hashCode();
83.635 - return hashCode;
83.636 - }
83.637 -
83.638 - /**
83.639 - * Returns a string representation of the method type,
83.640 - * of the form {@code "(PT0,PT1...)RT"}.
83.641 - * The string representation of a method type is a
83.642 - * parenthesis enclosed, comma separated list of type names,
83.643 - * followed immediately by the return type.
83.644 - * <p>
83.645 - * Each type is represented by its
83.646 - * {@link java.lang.Class#getSimpleName simple name}.
83.647 - */
83.648 - @Override
83.649 - public String toString() {
83.650 - StringBuilder sb = new StringBuilder();
83.651 - sb.append("(");
83.652 - for (int i = 0; i < ptypes.length; i++) {
83.653 - if (i > 0) sb.append(",");
83.654 - sb.append(ptypes[i].getSimpleName());
83.655 - }
83.656 - sb.append(")");
83.657 - sb.append(rtype.getSimpleName());
83.658 - return sb.toString();
83.659 - }
83.660 -
83.661 - /// Queries which have to do with the bytecode architecture
83.662 -
83.663 - /** Reports the number of JVM stack slots required to invoke a method
83.664 - * of this type. Note that (for historic reasons) the JVM requires
83.665 - * a second stack slot to pass long and double arguments.
83.666 - * So this method returns {@link #parameterCount() parameterCount} plus the
83.667 - * number of long and double parameters (if any).
83.668 - * <p>
83.669 - * This method is included for the benfit of applications that must
83.670 - * generate bytecodes that process method handles and invokedynamic.
83.671 - * @return the number of JVM stack slots for this type's parameters
83.672 - * @deprecated Will be removed for PFD.
83.673 - */
83.674 - public int parameterSlotCount() {
83.675 - return form.parameterSlotCount();
83.676 - }
83.677 -
83.678 - /** Reports the number of JVM stack slots which carry all parameters including and after
83.679 - * the given position, which must be in the range of 0 to
83.680 - * {@code parameterCount} inclusive. Successive parameters are
83.681 - * more shallowly stacked, and parameters are indexed in the bytecodes
83.682 - * according to their trailing edge. Thus, to obtain the depth
83.683 - * in the outgoing call stack of parameter {@code N}, obtain
83.684 - * the {@code parameterSlotDepth} of its trailing edge
83.685 - * at position {@code N+1}.
83.686 - * <p>
83.687 - * Parameters of type {@code long} and {@code double} occupy
83.688 - * two stack slots (for historical reasons) and all others occupy one.
83.689 - * Therefore, the number returned is the number of arguments
83.690 - * <em>including</em> and <em>after</em> the given parameter,
83.691 - * <em>plus</em> the number of long or double arguments
83.692 - * at or after after the argument for the given parameter.
83.693 - * <p>
83.694 - * This method is included for the benfit of applications that must
83.695 - * generate bytecodes that process method handles and invokedynamic.
83.696 - * @param num an index (zero-based, inclusive) within the parameter types
83.697 - * @return the index of the (shallowest) JVM stack slot transmitting the
83.698 - * given parameter
83.699 - * @throws IllegalArgumentException if {@code num} is negative or greater than {@code parameterCount()}
83.700 - * @deprecated Will be removed for PFD.
83.701 - */
83.702 - public int parameterSlotDepth(int num) {
83.703 - if (num < 0 || num > ptypes.length)
83.704 - parameterType(num); // force a range check
83.705 - return form.parameterToArgSlot(num-1);
83.706 - }
83.707 -
83.708 - /** Reports the number of JVM stack slots required to receive a return value
83.709 - * from a method of this type.
83.710 - * If the {@link #returnType() return type} is void, it will be zero,
83.711 - * else if the return type is long or double, it will be two, else one.
83.712 - * <p>
83.713 - * This method is included for the benfit of applications that must
83.714 - * generate bytecodes that process method handles and invokedynamic.
83.715 - * @return the number of JVM stack slots (0, 1, or 2) for this type's return value
83.716 - * @deprecated Will be removed for PFD.
83.717 - */
83.718 - public int returnSlotCount() {
83.719 - return form.returnSlotCount();
83.720 - }
83.721 -
83.722 - /**
83.723 - * Find or create an instance of a method type, given the spelling of its bytecode descriptor.
83.724 - * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
83.725 - * Any class or interface name embedded in the descriptor string
83.726 - * will be resolved by calling {@link ClassLoader#loadClass(java.lang.String)}
83.727 - * on the given loader (or if it is null, on the system class loader).
83.728 - * <p>
83.729 - * Note that it is possible to encounter method types which cannot be
83.730 - * constructed by this method, because their component types are
83.731 - * not all reachable from a common class loader.
83.732 - * <p>
83.733 - * This method is included for the benfit of applications that must
83.734 - * generate bytecodes that process method handles and {@code invokedynamic}.
83.735 - * @param descriptor a bytecode-level type descriptor string "(T...)T"
83.736 - * @param loader the class loader in which to look up the types
83.737 - * @return a method type matching the bytecode-level type descriptor
83.738 - * @throws IllegalArgumentException if the string is not well-formed
83.739 - * @throws TypeNotPresentException if a named type cannot be found
83.740 - */
83.741 - public static MethodType fromMethodDescriptorString(String descriptor, ClassLoader loader)
83.742 - throws IllegalArgumentException, TypeNotPresentException
83.743 - {
83.744 - List<Class<?>> types = BytecodeDescriptor.parseMethod(descriptor, loader);
83.745 - Class<?> rtype = types.remove(types.size() - 1);
83.746 - Class<?>[] ptypes = types.toArray(NO_PTYPES);
83.747 - return makeImpl(rtype, ptypes, true);
83.748 - }
83.749 -
83.750 - /**
83.751 - * Produces a bytecode descriptor representation of the method type.
83.752 - * <p>
83.753 - * Note that this is not a strict inverse of {@link #fromMethodDescriptorString fromMethodDescriptorString}.
83.754 - * Two distinct classes which share a common name but have different class loaders
83.755 - * will appear identical when viewed within descriptor strings.
83.756 - * <p>
83.757 - * This method is included for the benfit of applications that must
83.758 - * generate bytecodes that process method handles and {@code invokedynamic}.
83.759 - * {@link #fromMethodDescriptorString(java.lang.String, java.lang.ClassLoader) fromMethodDescriptorString},
83.760 - * because the latter requires a suitable class loader argument.
83.761 - * @return the bytecode type descriptor representation
83.762 - */
83.763 - public String toMethodDescriptorString() {
83.764 - return BytecodeDescriptor.unparse(this);
83.765 - }
83.766 -
83.767 - /// Serialization.
83.768 -
83.769 - /**
83.770 - * There are no serializable fields for {@code MethodType}.
83.771 - */
83.772 - private static final java.io.ObjectStreamField[] serialPersistentFields = { };
83.773 -
83.774 - /**
83.775 - * Save the {@code MethodType} instance to a stream.
83.776 - *
83.777 - * @serialData
83.778 - * For portability, the serialized format does not refer to named fields.
83.779 - * Instead, the return type and parameter type arrays are written directly
83.780 - * from the {@code writeObject} method, using two calls to {@code s.writeObject}
83.781 - * as follows:
83.782 - * <blockquote><pre>
83.783 -s.writeObject(this.returnType());
83.784 -s.writeObject(this.parameterArray());
83.785 - * </pre></blockquote>
83.786 - * <p>
83.787 - * The deserialized field values are checked as if they were
83.788 - * provided to the factory method {@link #methodType(Class,Class[]) methodType}.
83.789 - * For example, null values, or {@code void} parameter types,
83.790 - * will lead to exceptions during deserialization.
83.791 - * @param the stream to write the object to
83.792 - */
83.793 - private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
83.794 - s.defaultWriteObject(); // requires serialPersistentFields to be an empty array
83.795 - s.writeObject(returnType());
83.796 - s.writeObject(parameterArray());
83.797 - }
83.798 -
83.799 - /**
83.800 - * Reconstitute the {@code MethodType} instance from a stream (that is,
83.801 - * deserialize it).
83.802 - * This instance is a scratch object with bogus final fields.
83.803 - * It provides the parameters to the factory method called by
83.804 - * {@link #readResolve readResolve}.
83.805 - * After that call it is discarded.
83.806 - * @param the stream to read the object from
83.807 - * @see #MethodType()
83.808 - * @see #readResolve
83.809 - * @see #writeObject
83.810 - */
83.811 - private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
83.812 - s.defaultReadObject(); // requires serialPersistentFields to be an empty array
83.813 -
83.814 - Class<?> returnType = (Class<?>) s.readObject();
83.815 - Class<?>[] parameterArray = (Class<?>[]) s.readObject();
83.816 -
83.817 - // Probably this object will never escape, but let's check
83.818 - // the field values now, just to be sure.
83.819 - checkRtype(returnType);
83.820 - checkPtypes(parameterArray);
83.821 -
83.822 - parameterArray = parameterArray.clone(); // make sure it is unshared
83.823 - MethodType_init(returnType, parameterArray);
83.824 - }
83.825 -
83.826 - /**
83.827 - * For serialization only.
83.828 - * Sets the final fields to null, pending {@code Unsafe.putObject}.
83.829 - */
83.830 - private MethodType() {
83.831 - this.rtype = null;
83.832 - this.ptypes = null;
83.833 - }
83.834 - private void MethodType_init(Class<?> rtype, Class<?>[] ptypes) {
83.835 - // In order to communicate these values to readResolve, we must
83.836 - // store them into the implementation-specific final fields.
83.837 - checkRtype(rtype);
83.838 - checkPtypes(ptypes);
83.839 - unsafe.putObject(this, rtypeOffset, rtype);
83.840 - unsafe.putObject(this, ptypesOffset, ptypes);
83.841 - }
83.842 -
83.843 - // Support for resetting final fields while deserializing
83.844 - private static final sun.misc.Unsafe unsafe = sun.misc.Unsafe.getUnsafe();
83.845 - private static final long rtypeOffset, ptypesOffset;
83.846 - static {
83.847 - try {
83.848 - rtypeOffset = unsafe.objectFieldOffset
83.849 - (MethodType.class.getDeclaredField("rtype"));
83.850 - ptypesOffset = unsafe.objectFieldOffset
83.851 - (MethodType.class.getDeclaredField("ptypes"));
83.852 - } catch (Exception ex) {
83.853 - throw new Error(ex);
83.854 - }
83.855 - }
83.856 -
83.857 - /**
83.858 - * Resolves and initializes a {@code MethodType} object
83.859 - * after serialization.
83.860 - * @return the fully initialized {@code MethodType} object
83.861 - */
83.862 - private Object readResolve() {
83.863 - // Do not use a trusted path for deserialization:
83.864 - //return makeImpl(rtype, ptypes, true);
83.865 - // Verify all operands, and make sure ptypes is unshared:
83.866 - return methodType(rtype, ptypes);
83.867 - }
83.868 -}
84.1 --- a/src/share/classes/java/dyn/MethodTypeForm.java Tue Mar 29 11:29:01 2011 -0700
84.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
84.3 @@ -1,39 +0,0 @@
84.4 -/*
84.5 - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
84.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
84.7 - *
84.8 - * This code is free software; you can redistribute it and/or modify it
84.9 - * under the terms of the GNU General Public License version 2 only, as
84.10 - * published by the Free Software Foundation. Oracle designates this
84.11 - * particular file as subject to the "Classpath" exception as provided
84.12 - * by Oracle in the LICENSE file that accompanied this code.
84.13 - *
84.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
84.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
84.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
84.17 - * version 2 for more details (a copy is included in the LICENSE file that
84.18 - * accompanied this code).
84.19 - *
84.20 - * You should have received a copy of the GNU General Public License version
84.21 - * 2 along with this work; if not, write to the Free Software Foundation,
84.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
84.23 - *
84.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
84.25 - * or visit www.oracle.com if you need additional information or have any
84.26 - * questions.
84.27 - */
84.28 -
84.29 -package java.dyn;
84.30 -
84.31 -/**
84.32 - * TO DO: Temporary shim; remove after refactoring effects are complete in JVM.
84.33 - * @author John Rose
84.34 - */
84.35 -import sun.dyn.MethodTypeImpl;
84.36 -
84.37 -class MethodTypeForm extends MethodTypeImpl {
84.38 -
84.39 - MethodTypeForm(MethodType erasedType) {
84.40 - super(erasedType);
84.41 - }
84.42 -}
85.1 --- a/src/share/classes/java/dyn/MutableCallSite.java Tue Mar 29 11:29:01 2011 -0700
85.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
85.3 @@ -1,282 +0,0 @@
85.4 -/*
85.5 - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
85.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
85.7 - *
85.8 - * This code is free software; you can redistribute it and/or modify it
85.9 - * under the terms of the GNU General Public License version 2 only, as
85.10 - * published by the Free Software Foundation. Oracle designates this
85.11 - * particular file as subject to the "Classpath" exception as provided
85.12 - * by Oracle in the LICENSE file that accompanied this code.
85.13 - *
85.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
85.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
85.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
85.17 - * version 2 for more details (a copy is included in the LICENSE file that
85.18 - * accompanied this code).
85.19 - *
85.20 - * You should have received a copy of the GNU General Public License version
85.21 - * 2 along with this work; if not, write to the Free Software Foundation,
85.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
85.23 - *
85.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
85.25 - * or visit www.oracle.com if you need additional information or have any
85.26 - * questions.
85.27 - */
85.28 -
85.29 -package java.dyn;
85.30 -
85.31 -import sun.dyn.*;
85.32 -import sun.dyn.empty.Empty;
85.33 -import java.util.concurrent.atomic.AtomicInteger;
85.34 -
85.35 -/**
85.36 - * A {@code MutableCallSite} is a {@link CallSite} whose target variable
85.37 - * behaves like an ordinary field.
85.38 - * An {@code invokedynamic} instruction linked to a {@code MutableCallSite} delegates
85.39 - * all calls to the site's current target.
85.40 - * The {@linkplain CallSite#dynamicInvoker dynamic invoker} of a mutable call site
85.41 - * also delegates each call to the site's current target.
85.42 - * <p>
85.43 - * Here is an example of a mutable call site which introduces a
85.44 - * state variable into a method handle chain.
85.45 - * <blockquote><pre>
85.46 -MutableCallSite name = new MutableCallSite(MethodType.methodType(String.class));
85.47 -MethodHandle MH_name = name.dynamicInvoker();
85.48 -MethodType MT_str2 = MethodType.methodType(String.class, String.class);
85.49 -MethodHandle MH_upcase = MethodHandles.lookup()
85.50 - .findVirtual(String.class, "toUpperCase", MT_str2);
85.51 -MethodHandle worker1 = MethodHandles.filterReturnValue(MH_name, MH_upcase);
85.52 -name.setTarget(MethodHandles.constant(String.class, "Rocky"));
85.53 -assertEquals("ROCKY", (String) worker1.invokeExact());
85.54 -name.setTarget(MethodHandles.constant(String.class, "Fred"));
85.55 -assertEquals("FRED", (String) worker1.invokeExact());
85.56 -// (mutation can be continued indefinitely)
85.57 - * </pre></blockquote>
85.58 - * <p>
85.59 - * The same call site may be used in several places at once.
85.60 - * <blockquote><pre>
85.61 -MethodHandle MH_dear = MethodHandles.lookup()
85.62 - .findVirtual(String.class, "concat", MT_str2).bindTo(", dear?");
85.63 -MethodHandle worker2 = MethodHandles.filterReturnValue(MH_name, MH_dear);
85.64 -assertEquals("Fred, dear?", (String) worker2.invokeExact());
85.65 -name.setTarget(MethodHandles.constant(String.class, "Wilma"));
85.66 -assertEquals("WILMA", (String) worker1.invokeExact());
85.67 -assertEquals("Wilma, dear?", (String) worker2.invokeExact());
85.68 - * </pre></blockquote>
85.69 - * <p>
85.70 - * <em>Non-synchronization of target values:</em>
85.71 - * A write to a mutable call site's target does not force other threads
85.72 - * to become aware of the updated value. Threads which do not perform
85.73 - * suitable synchronization actions relative to the updated call site
85.74 - * may cache the old target value and delay their use of the new target
85.75 - * value indefinitely.
85.76 - * (This is a normal consequence of the Java Memory Model as applied
85.77 - * to object fields.)
85.78 - * <p>
85.79 - * The {@link #syncAll syncAll} operation provides a way to force threads
85.80 - * to accept a new target value, even if there is no other synchronization.
85.81 - * <p>
85.82 - * For target values which will be frequently updated, consider using
85.83 - * a {@linkplain VolatileCallSite volatile call site} instead.
85.84 - * @author John Rose, JSR 292 EG
85.85 - */
85.86 -public class MutableCallSite extends CallSite {
85.87 - /**
85.88 - * Creates a blank call site object with the given method type.
85.89 - * The initial target is set to a method handle of the given type
85.90 - * which will throw an {@link IllegalStateException} if called.
85.91 - * <p>
85.92 - * The type of the call site is permanently set to the given type.
85.93 - * <p>
85.94 - * Before this {@code CallSite} object is returned from a bootstrap method,
85.95 - * or invoked in some other manner,
85.96 - * it is usually provided with a more useful target method,
85.97 - * via a call to {@link CallSite#setTarget(MethodHandle) setTarget}.
85.98 - * @param type the method type that this call site will have
85.99 - * @throws NullPointerException if the proposed type is null
85.100 - */
85.101 - public MutableCallSite(MethodType type) {
85.102 - super(type);
85.103 - }
85.104 -
85.105 - /**
85.106 - * Creates a call site object with an initial target method handle.
85.107 - * The type of the call site is permanently set to the initial target's type.
85.108 - * @param target the method handle that will be the initial target of the call site
85.109 - * @throws NullPointerException if the proposed target is null
85.110 - */
85.111 - public MutableCallSite(MethodHandle target) {
85.112 - super(target);
85.113 - }
85.114 -
85.115 - /**
85.116 - * Returns the target method of the call site, which behaves
85.117 - * like a normal field of the {@code MutableCallSite}.
85.118 - * <p>
85.119 - * The interactions of {@code getTarget} with memory are the same
85.120 - * as of a read from an ordinary variable, such as an array element or a
85.121 - * non-volatile, non-final field.
85.122 - * <p>
85.123 - * In particular, the current thread may choose to reuse the result
85.124 - * of a previous read of the target from memory, and may fail to see
85.125 - * a recent update to the target by another thread.
85.126 - *
85.127 - * @return the linkage state of this call site, a method handle which can change over time
85.128 - * @see #setTarget
85.129 - */
85.130 - @Override public final MethodHandle getTarget() {
85.131 - return target;
85.132 - }
85.133 -
85.134 - /**
85.135 - * Updates the target method of this call site, as a normal variable.
85.136 - * The type of the new target must agree with the type of the old target.
85.137 - * <p>
85.138 - * The interactions with memory are the same
85.139 - * as of a write to an ordinary variable, such as an array element or a
85.140 - * non-volatile, non-final field.
85.141 - * <p>
85.142 - * In particular, unrelated threads may fail to see the updated target
85.143 - * until they perform a read from memory.
85.144 - * Stronger guarantees can be created by putting appropriate operations
85.145 - * into the bootstrap method and/or the target methods used
85.146 - * at any given call site.
85.147 - *
85.148 - * @param newTarget the new target
85.149 - * @throws NullPointerException if the proposed new target is null
85.150 - * @throws WrongMethodTypeException if the proposed new target
85.151 - * has a method type that differs from the previous target
85.152 - * @see #getTarget
85.153 - */
85.154 - @Override public void setTarget(MethodHandle newTarget) {
85.155 - checkTargetChange(this.target, newTarget);
85.156 - setTargetNormal(newTarget);
85.157 - }
85.158 -
85.159 - /**
85.160 - * {@inheritDoc}
85.161 - */
85.162 - @Override
85.163 - public final MethodHandle dynamicInvoker() {
85.164 - return makeDynamicInvoker();
85.165 - }
85.166 -
85.167 - /**
85.168 - * Performs a synchronization operation on each call site in the given array,
85.169 - * forcing all other threads to throw away any cached values previously
85.170 - * loaded from the target of any of the call sites.
85.171 - * <p>
85.172 - * This operation does not reverse any calls that have already started
85.173 - * on an old target value.
85.174 - * (Java supports {@linkplain java.lang.Object#wait() forward time travel} only.)
85.175 - * <p>
85.176 - * The overall effect is to force all future readers of each call site's target
85.177 - * to accept the most recently stored value.
85.178 - * ("Most recently" is reckoned relative to the {@code syncAll} itself.)
85.179 - * Conversely, the {@code syncAll} call may block until all readers have
85.180 - * (somehow) decached all previous versions of each call site's target.
85.181 - * <p>
85.182 - * To avoid race conditions, calls to {@code setTarget} and {@code syncAll}
85.183 - * should generally be performed under some sort of mutual exclusion.
85.184 - * Note that reader threads may observe an updated target as early
85.185 - * as the {@code setTarget} call that install the value
85.186 - * (and before the {@code syncAll} that confirms the value).
85.187 - * On the other hand, reader threads may observe previous versions of
85.188 - * the target until the {@code syncAll} call returns
85.189 - * (and after the {@code setTarget} that attempts to convey the updated version).
85.190 - * <p>
85.191 - * This operation is likely to be expensive and should be used sparingly.
85.192 - * If possible, it should be buffered for batch processing on sets of call sites.
85.193 - * <p>
85.194 - * If {@code sites} contains a null element,
85.195 - * a {@code NullPointerException} will be raised.
85.196 - * In this case, some non-null elements in the array may be
85.197 - * processed before the method returns abnormally.
85.198 - * Which elements these are (if any) is implementation-dependent.
85.199 - *
85.200 - * <h3>Java Memory Model details</h3>
85.201 - * In terms of the Java Memory Model, this operation performs a synchronization
85.202 - * action which is comparable in effect to the writing of a volatile variable
85.203 - * by the current thread, and an eventual volatile read by every other thread
85.204 - * that may access one of the affected call sites.
85.205 - * <p>
85.206 - * The following effects are apparent, for each individual call site {@code S}:
85.207 - * <ul>
85.208 - * <li>A new volatile variable {@code V} is created, and written by the current thread.
85.209 - * As defined by the JMM, this write is a global synchronization event.
85.210 - * <li>As is normal with thread-local ordering of write events,
85.211 - * every action already performed by the current thread is
85.212 - * taken to happen before the volatile write to {@code V}.
85.213 - * (In some implementations, this means that the current thread
85.214 - * performs a global release operation.)
85.215 - * <li>Specifically, the write to the current target of {@code S} is
85.216 - * taken to happen before the volatile write to {@code V}.
85.217 - * <li>The volatile write to {@code V} is placed
85.218 - * (in an implementation specific manner)
85.219 - * in the global synchronization order.
85.220 - * <li>Consider an arbitrary thread {@code T} (other than the current thread).
85.221 - * If {@code T} executes a synchronization action {@code A}
85.222 - * after the volatile write to {@code V} (in the global synchronization order),
85.223 - * it is therefore required to see either the current target
85.224 - * of {@code S}, or a later write to that target,
85.225 - * if it executes a read on the target of {@code S}.
85.226 - * (This constraint is called "synchronization-order consistency".)
85.227 - * <li>The JMM specifically allows optimizing compilers to elide
85.228 - * reads or writes of variables that are known to be useless.
85.229 - * Such elided reads and writes have no effect on the happens-before
85.230 - * relation. Regardless of this fact, the volatile {@code V}
85.231 - * will not be elided, even though its written value is
85.232 - * indeterminate and its read value is not used.
85.233 - * </ul>
85.234 - * Because of the last point, the implementation behaves as if a
85.235 - * volatile read of {@code V} were performed by {@code T}
85.236 - * immediately after its action {@code A}. In the local ordering
85.237 - * of actions in {@code T}, this read happens before any future
85.238 - * read of the target of {@code S}. It is as if the
85.239 - * implementation arbitrarily picked a read of {@code S}'s target
85.240 - * by {@code T}, and forced a read of {@code V} to precede it,
85.241 - * thereby ensuring communication of the new target value.
85.242 - * <p>
85.243 - * As long as the constraints of the Java Memory Model are obeyed,
85.244 - * implementations may delay the completion of a {@code syncAll}
85.245 - * operation while other threads ({@code T} above) continue to
85.246 - * use previous values of {@code S}'s target.
85.247 - * However, implementations are (as always) encouraged to avoid
85.248 - * livelock, and to eventually require all threads to take account
85.249 - * of the updated target.
85.250 - *
85.251 - * <p style="font-size:smaller;">
85.252 - * <em>Discussion:</em>
85.253 - * For performance reasons, {@code syncAll} is not a virtual method
85.254 - * on a single call site, but rather applies to a set of call sites.
85.255 - * Some implementations may incur a large fixed overhead cost
85.256 - * for processing one or more synchronization operations,
85.257 - * but a small incremental cost for each additional call site.
85.258 - * In any case, this operation is likely to be costly, since
85.259 - * other threads may have to be somehow interrupted
85.260 - * in order to make them notice the updated target value.
85.261 - * However, it may be observed that a single call to synchronize
85.262 - * several sites has the same formal effect as many calls,
85.263 - * each on just one of the sites.
85.264 - *
85.265 - * <p style="font-size:smaller;">
85.266 - * <em>Implementation Note:</em>
85.267 - * Simple implementations of {@code MutableCallSite} may use
85.268 - * a volatile variable for the target of a mutable call site.
85.269 - * In such an implementation, the {@code syncAll} method can be a no-op,
85.270 - * and yet it will conform to the JMM behavior documented above.
85.271 - *
85.272 - * @param sites an array of call sites to be synchronized
85.273 - * @throws NullPointerException if the {@code sites} array reference is null
85.274 - * or the array contains a null
85.275 - */
85.276 - public static void syncAll(MutableCallSite[] sites) {
85.277 - if (sites.length == 0) return;
85.278 - STORE_BARRIER.lazySet(0);
85.279 - for (int i = 0; i < sites.length; i++) {
85.280 - sites[i].getClass(); // trigger NPE on first null
85.281 - }
85.282 - // FIXME: NYI
85.283 - }
85.284 - private static final AtomicInteger STORE_BARRIER = new AtomicInteger();
85.285 -}
86.1 --- a/src/share/classes/java/dyn/SwitchPoint.java Tue Mar 29 11:29:01 2011 -0700
86.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
86.3 @@ -1,195 +0,0 @@
86.4 -/*
86.5 - * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
86.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
86.7 - *
86.8 - * This code is free software; you can redistribute it and/or modify it
86.9 - * under the terms of the GNU General Public License version 2 only, as
86.10 - * published by the Free Software Foundation. Oracle designates this
86.11 - * particular file as subject to the "Classpath" exception as provided
86.12 - * by Oracle in the LICENSE file that accompanied this code.
86.13 - *
86.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
86.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
86.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
86.17 - * version 2 for more details (a copy is included in the LICENSE file that
86.18 - * accompanied this code).
86.19 - *
86.20 - * You should have received a copy of the GNU General Public License version
86.21 - * 2 along with this work; if not, write to the Free Software Foundation,
86.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
86.23 - *
86.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86.25 - * or visit www.oracle.com if you need additional information or have any
86.26 - * questions.
86.27 - */
86.28 -
86.29 -package java.dyn;
86.30 -
86.31 -/**
86.32 - * <p>
86.33 - * A {@code SwitchPoint} is an object which can publish state transitions to other threads.
86.34 - * A switch point is initially in the <em>valid</em> state, but may at any time be
86.35 - * changed to the <em>invalid</em> state. Invalidation cannot be reversed.
86.36 - * A switch point can combine a <em>guarded pair</em> of method handles into a
86.37 - * <em>guarded delegator</em>.
86.38 - * The guarded delegator is a method handle which delegates to one of the old method handles.
86.39 - * The state of the switch point determines which of the two gets the delegation.
86.40 - * <p>
86.41 - * A single switch point may be used to control any number of method handles.
86.42 - * (Indirectly, therefore, it can control any number of call sites.)
86.43 - * This is done by using the single switch point as a factory for combining
86.44 - * any number of guarded method handle pairs into guarded delegators.
86.45 - * <p>
86.46 - * When a guarded delegator is created from a guarded pair, the pair
86.47 - * is wrapped in a new method handle {@code M},
86.48 - * which is permanently associated with the switch point that created it.
86.49 - * Each pair consists of a target {@code T} and a fallback {@code F}.
86.50 - * While the switch point is valid, invocations to {@code M} are delegated to {@code T}.
86.51 - * After it is invalidated, invocations are delegated to {@code F}.
86.52 - * <p>
86.53 - * Invalidation is global and immediate, as if the switch point contained a
86.54 - * volatile boolean variable consulted on every call to {@code M}.
86.55 - * The invalidation is also permanent, which means the switch point
86.56 - * can change state only once.
86.57 - * The switch point will always delegate to {@code F} after being invalidated.
86.58 - * At that point {@code guardWithTest} may ignore {@code T} and return {@code F}.
86.59 - * <p>
86.60 - * Here is an example of a switch point in action:
86.61 - * <blockquote><pre>
86.62 -MethodType MT_str2 = MethodType.methodType(String.class, String.class);
86.63 -MethodHandle MH_strcat = MethodHandles.lookup()
86.64 - .findVirtual(String.class, "concat", MT_str2);
86.65 -SwitchPoint spt = new SwitchPoint();
86.66 -// the following steps may be repeated to re-use the same switch point:
86.67 -MethodHandle worker1 = strcat;
86.68 -MethodHandle worker2 = MethodHandles.permuteArguments(strcat, MT_str2, 1, 0);
86.69 -MethodHandle worker = spt.guardWithTest(worker1, worker2);
86.70 -assertEquals("method", (String) worker.invokeExact("met", "hod"));
86.71 -SwitchPoint.invalidateAll(new SwitchPoint[]{ spt });
86.72 -assertEquals("hodmet", (String) worker.invokeExact("met", "hod"));
86.73 - * </pre></blockquote>
86.74 - * <p style="font-size:smaller;">
86.75 - * <em>Discussion:</em>
86.76 - * Switch points are useful without subclassing. They may also be subclassed.
86.77 - * This may be useful in order to associate application-specific invalidation logic
86.78 - * with the switch point.
86.79 - * <p style="font-size:smaller;">
86.80 - * <em>Implementation Note:</em>
86.81 - * A switch point behaves as if implemented on top of {@link MutableCallSite},
86.82 - * approximately as follows:
86.83 - * <blockquote><pre>
86.84 -public class SwitchPoint {
86.85 - private static final MethodHandle
86.86 - K_true = MethodHandles.constant(boolean.class, true),
86.87 - K_false = MethodHandles.constant(boolean.class, false);
86.88 - private final MutableCallSite mcs;
86.89 - private final MethodHandle mcsInvoker;
86.90 - public SwitchPoint() {
86.91 - this.mcs = new MutableCallSite(K_true);
86.92 - this.mcsInvoker = mcs.dynamicInvoker();
86.93 - }
86.94 - public MethodHandle guardWithTest(
86.95 - MethodHandle target, MethodHandle fallback) {
86.96 - // Note: mcsInvoker is of type ()boolean.
86.97 - // Target and fallback may take any arguments, but must have the same type.
86.98 - return MethodHandles.guardWithTest(this.mcsInvoker, target, fallback);
86.99 - }
86.100 - public static void invalidateAll(SwitchPoint[] spts) {
86.101 - List<MutableCallSite> mcss = new ArrayList<>();
86.102 - for (SwitchPoint spt : spts) mcss.add(spt.mcs);
86.103 - for (MutableCallSite mcs : mcss) mcs.setTarget(K_false);
86.104 - MutableCallSite.syncAll(mcss.toArray(new MutableCallSite[0]));
86.105 - }
86.106 -}
86.107 - * </pre></blockquote>
86.108 - * @author Remi Forax, JSR 292 EG
86.109 - */
86.110 -public class SwitchPoint {
86.111 - private static final MethodHandle
86.112 - K_true = MethodHandles.constant(boolean.class, true),
86.113 - K_false = MethodHandles.constant(boolean.class, false);
86.114 -
86.115 - private final MutableCallSite mcs;
86.116 - private final MethodHandle mcsInvoker;
86.117 -
86.118 - /**
86.119 - * Creates a new switch point.
86.120 - */
86.121 - public SwitchPoint() {
86.122 - this.mcs = new MutableCallSite(K_true);
86.123 - this.mcsInvoker = mcs.dynamicInvoker();
86.124 - }
86.125 -
86.126 - /**
86.127 - * Returns a method handle which always delegates either to the target or the fallback.
86.128 - * The method handle will delegate to the target exactly as long as the switch point is valid.
86.129 - * After that, it will permanently delegate to the fallback.
86.130 - * <p>
86.131 - * The target and fallback must be of exactly the same method type,
86.132 - * and the resulting combined method handle will also be of this type.
86.133 - *
86.134 - * @param target the method handle selected by the switch point as long as it is valid
86.135 - * @param fallback the method handle selected by the switch point after it is invalidated
86.136 - * @return a combined method handle which always calls either the target or fallback
86.137 - * @throws NullPointerException if either argument is null
86.138 - * @see MethodHandles#guardWithTest
86.139 - */
86.140 - public MethodHandle guardWithTest(MethodHandle target, MethodHandle fallback) {
86.141 - if (mcs.getTarget() == K_false)
86.142 - return fallback; // already invalid
86.143 - return MethodHandles.guardWithTest(mcsInvoker, target, fallback);
86.144 - }
86.145 -
86.146 - /**
86.147 - * Sets all of the given switch points into the invalid state.
86.148 - * After this call executes, no thread will observe any of the
86.149 - * switch points to be in a valid state.
86.150 - * <p>
86.151 - * This operation is likely to be expensive and should be used sparingly.
86.152 - * If possible, it should be buffered for batch processing on sets of switch points.
86.153 - * <p>
86.154 - * If {@code switchPoints} contains a null element,
86.155 - * a {@code NullPointerException} will be raised.
86.156 - * In this case, some non-null elements in the array may be
86.157 - * processed before the method returns abnormally.
86.158 - * Which elements these are (if any) is implementation-dependent.
86.159 - *
86.160 - * <p style="font-size:smaller;">
86.161 - * <em>Discussion:</em>
86.162 - * For performance reasons, {@code invalidateAll} is not a virtual method
86.163 - * on a single switch point, but rather applies to a set of switch points.
86.164 - * Some implementations may incur a large fixed overhead cost
86.165 - * for processing one or more invalidation operations,
86.166 - * but a small incremental cost for each additional invalidation.
86.167 - * In any case, this operation is likely to be costly, since
86.168 - * other threads may have to be somehow interrupted
86.169 - * in order to make them notice the updated switch point state.
86.170 - * However, it may be observed that a single call to invalidate
86.171 - * several switch points has the same formal effect as many calls,
86.172 - * each on just one of the switch points.
86.173 - *
86.174 - * <p style="font-size:smaller;">
86.175 - * <em>Implementation Note:</em>
86.176 - * Simple implementations of {@code SwitchPoint} may use
86.177 - * a private {@link MutableCallSite} to publish the state of a switch point.
86.178 - * In such an implementation, the {@code invalidateAll} method can
86.179 - * simply change the call site's target, and issue one call to
86.180 - * {@linkplain MutableCallSite#syncAll synchronize} all the
86.181 - * private call sites.
86.182 - *
86.183 - * @param switchPoints an array of call sites to be synchronized
86.184 - * @throws NullPointerException if the {@code switchPoints} array reference is null
86.185 - * or the array contains a null
86.186 - */
86.187 - public static void invalidateAll(SwitchPoint[] switchPoints) {
86.188 - if (switchPoints.length == 0) return;
86.189 - MutableCallSite[] sites = new MutableCallSite[switchPoints.length];
86.190 - for (int i = 0; i < switchPoints.length; i++) {
86.191 - SwitchPoint spt = switchPoints[i];
86.192 - if (spt == null) break; // MSC.syncAll will trigger a NPE
86.193 - sites[i] = spt.mcs;
86.194 - spt.mcs.setTarget(K_false);
86.195 - }
86.196 - MutableCallSite.syncAll(sites);
86.197 - }
86.198 -}
87.1 --- a/src/share/classes/java/dyn/VolatileCallSite.java Tue Mar 29 11:29:01 2011 -0700
87.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
87.3 @@ -1,111 +0,0 @@
87.4 -/*
87.5 - * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
87.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
87.7 - *
87.8 - * This code is free software; you can redistribute it and/or modify it
87.9 - * under the terms of the GNU General Public License version 2 only, as
87.10 - * published by the Free Software Foundation. Oracle designates this
87.11 - * particular file as subject to the "Classpath" exception as provided
87.12 - * by Oracle in the LICENSE file that accompanied this code.
87.13 - *
87.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
87.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
87.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
87.17 - * version 2 for more details (a copy is included in the LICENSE file that
87.18 - * accompanied this code).
87.19 - *
87.20 - * You should have received a copy of the GNU General Public License version
87.21 - * 2 along with this work; if not, write to the Free Software Foundation,
87.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
87.23 - *
87.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
87.25 - * or visit www.oracle.com if you need additional information or have any
87.26 - * questions.
87.27 - */
87.28 -
87.29 -package java.dyn;
87.30 -
87.31 -import java.util.List;
87.32 -
87.33 -/**
87.34 - * A {@code VolatileCallSite} is a {@link CallSite} whose target acts like a volatile variable.
87.35 - * An {@code invokedynamic} instruction linked to a {@code VolatileCallSite} sees updates
87.36 - * to its call site target immediately, even if the update occurs in another thread.
87.37 - * There may be a performance penalty for such tight coupling between threads.
87.38 - * <p>
87.39 - * Unlike {@code MutableCallSite}, there is no
87.40 - * {@linkplain MutableCallSite#syncAll syncAll operation} on volatile
87.41 - * call sites, since every write to a volatile variable is implicitly
87.42 - * synchronized with reader threads.
87.43 - * <p>
87.44 - * In other respects, a {@code VolatileCallSite} is interchangeable
87.45 - * with {@code MutableCallSite}.
87.46 - * @see MutableCallSite
87.47 - * @author John Rose, JSR 292 EG
87.48 - */
87.49 -public class VolatileCallSite extends CallSite {
87.50 - /**
87.51 - * Creates a call site with a volatile binding to its target.
87.52 - * The initial target is set to a method handle
87.53 - * of the given type which will throw an {@code IllegalStateException} if called.
87.54 - * @param type the method type that this call site will have
87.55 - * @throws NullPointerException if the proposed type is null
87.56 - */
87.57 - public VolatileCallSite(MethodType type) {
87.58 - super(type);
87.59 - }
87.60 -
87.61 - /**
87.62 - * Creates a call site with a volatile binding to its target.
87.63 - * The target is set to the given value.
87.64 - * @param target the method handle that will be the initial target of the call site
87.65 - * @throws NullPointerException if the proposed target is null
87.66 - */
87.67 - public VolatileCallSite(MethodHandle target) {
87.68 - super(target);
87.69 - }
87.70 -
87.71 - /**
87.72 - * Returns the target method of the call site, which behaves
87.73 - * like a {@code volatile} field of the {@code VolatileCallSite}.
87.74 - * <p>
87.75 - * The interactions of {@code getTarget} with memory are the same
87.76 - * as of a read from a {@code volatile} field.
87.77 - * <p>
87.78 - * In particular, the current thread is required to issue a fresh
87.79 - * read of the target from memory, and must not fail to see
87.80 - * a recent update to the target by another thread.
87.81 - *
87.82 - * @return the linkage state of this call site, a method handle which can change over time
87.83 - * @see #setTarget
87.84 - */
87.85 - @Override public final MethodHandle getTarget() {
87.86 - return getTargetVolatile();
87.87 - }
87.88 -
87.89 - /**
87.90 - * Updates the target method of this call site, as a volatile variable.
87.91 - * The type of the new target must agree with the type of the old target.
87.92 - * <p>
87.93 - * The interactions with memory are the same as of a write to a volatile field.
87.94 - * In particular, any threads is guaranteed to see the updated target
87.95 - * the next time it calls {@code getTarget}.
87.96 - * @param newTarget the new target
87.97 - * @throws NullPointerException if the proposed new target is null
87.98 - * @throws WrongMethodTypeException if the proposed new target
87.99 - * has a method type that differs from the previous target
87.100 - * @see #getTarget
87.101 - */
87.102 - @Override public void setTarget(MethodHandle newTarget) {
87.103 - checkTargetChange(getTargetVolatile(), newTarget);
87.104 - setTargetVolatile(newTarget);
87.105 - }
87.106 -
87.107 - /**
87.108 - * {@inheritDoc}
87.109 - */
87.110 - @Override
87.111 - public final MethodHandle dynamicInvoker() {
87.112 - return makeDynamicInvoker();
87.113 - }
87.114 -}
88.1 --- a/src/share/classes/java/dyn/WrongMethodTypeException.java Tue Mar 29 11:29:01 2011 -0700
88.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
88.3 @@ -1,62 +0,0 @@
88.4 -/*
88.5 - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
88.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
88.7 - *
88.8 - * This code is free software; you can redistribute it and/or modify it
88.9 - * under the terms of the GNU General Public License version 2 only, as
88.10 - * published by the Free Software Foundation. Oracle designates this
88.11 - * particular file as subject to the "Classpath" exception as provided
88.12 - * by Oracle in the LICENSE file that accompanied this code.
88.13 - *
88.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
88.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
88.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
88.17 - * version 2 for more details (a copy is included in the LICENSE file that
88.18 - * accompanied this code).
88.19 - *
88.20 - * You should have received a copy of the GNU General Public License version
88.21 - * 2 along with this work; if not, write to the Free Software Foundation,
88.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
88.23 - *
88.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
88.25 - * or visit www.oracle.com if you need additional information or have any
88.26 - * questions.
88.27 - */
88.28 -
88.29 -package java.dyn;
88.30 -
88.31 -/**
88.32 - * Thrown to indicate that code has attempted to call a method handle
88.33 - * via the wrong method type. As with the bytecode representation of
88.34 - * normal Java method calls, method handle calls are strongly typed
88.35 - * to a specific type descriptor associated with a call site.
88.36 - * <p>
88.37 - * This exception may also be thrown when two method handles are
88.38 - * composed, and the system detects that their types cannot be
88.39 - * matched up correctly. This amounts to an early evaluation
88.40 - * of the type mismatch, at method handle construction time,
88.41 - * instead of when the mismatched method handle is called.
88.42 - *
88.43 - * @author John Rose, JSR 292 EG
88.44 - * @since 1.7
88.45 - */
88.46 -public class WrongMethodTypeException extends RuntimeException {
88.47 - private static final long serialVersionUID = 292L;
88.48 -
88.49 - /**
88.50 - * Constructs a {@code WrongMethodTypeException} with no detail message.
88.51 - */
88.52 - public WrongMethodTypeException() {
88.53 - super();
88.54 - }
88.55 -
88.56 - /**
88.57 - * Constructs a {@code WrongMethodTypeException} with the specified
88.58 - * detail message.
88.59 - *
88.60 - * @param s the detail message.
88.61 - */
88.62 - public WrongMethodTypeException(String s) {
88.63 - super(s);
88.64 - }
88.65 -}
89.1 --- a/src/share/classes/java/dyn/package-info.java Tue Mar 29 11:29:01 2011 -0700
89.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
89.3 @@ -1,478 +0,0 @@
89.4 -/*
89.5 - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
89.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
89.7 - *
89.8 - * This code is free software; you can redistribute it and/or modify it
89.9 - * under the terms of the GNU General Public License version 2 only, as
89.10 - * published by the Free Software Foundation. Oracle designates this
89.11 - * particular file as subject to the "Classpath" exception as provided
89.12 - * by Oracle in the LICENSE file that accompanied this code.
89.13 - *
89.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
89.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
89.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
89.17 - * version 2 for more details (a copy is included in the LICENSE file that
89.18 - * accompanied this code).
89.19 - *
89.20 - * You should have received a copy of the GNU General Public License version
89.21 - * 2 along with this work; if not, write to the Free Software Foundation,
89.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
89.23 - *
89.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
89.25 - * or visit www.oracle.com if you need additional information or have any
89.26 - * questions.
89.27 - */
89.28 -
89.29 -/**
89.30 - * The {@code java.lang.invoke} package contains dynamic language support provided directly by
89.31 - * the Java core class libraries and virtual machine.
89.32 - *
89.33 - * <p style="font-size:smaller;">
89.34 - * <em>Historic Note:</em> In some early versions of Java SE 7,
89.35 - * the name of this package is {@code java.dyn}.
89.36 - * <p>
89.37 - * Certain types in this package have special relations to dynamic
89.38 - * language support in the virtual machine:
89.39 - * <ul>
89.40 - * <li>The class {@link java.dyn.MethodHandle MethodHandle} contains
89.41 - * <a href="MethodHandle.html#sigpoly">signature polymorphic methods</a>
89.42 - * which can be linked regardless of their type descriptor.
89.43 - * Normally, method linkage requires exact matching of type descriptors.
89.44 - * </li>
89.45 - *
89.46 - * <li>The JVM bytecode format supports immediate constants of
89.47 - * the classes {@link java.dyn.MethodHandle MethodHandle} and {@link java.dyn.MethodType MethodType}.
89.48 - * </li>
89.49 - * </ul>
89.50 - *
89.51 - * <h2><a name="jvm_mods"></a>Corresponding JVM bytecode format changes</h2>
89.52 - * <em>The following low-level information is presented here as a preview of
89.53 - * changes being made to the Java Virtual Machine specification for JSR 292.
89.54 - * This information will be incorporated in a future version of the JVM specification.</em>
89.55 - *
89.56 - * <h3><a name="indyinsn"></a>{@code invokedynamic} instruction format</h3>
89.57 - * In bytecode, an {@code invokedynamic} instruction is formatted as five bytes.
89.58 - * The first byte is the opcode 186 (hexadecimal {@code BA}).
89.59 - * The next two bytes are a constant pool index (in the same format as for the other {@code invoke} instructions).
89.60 - * The final two bytes are reserved for future use and required to be zero.
89.61 - * The constant pool reference of an {@code invokedynamic} instruction is to a entry
89.62 - * with tag {@code CONSTANT_InvokeDynamic} (decimal 18). See below for its format.
89.63 - * The entry specifies the following information:
89.64 - * <ul>
89.65 - * <li>a bootstrap method (a {@link java.dyn.MethodHandle MethodHandle} constant)</li>
89.66 - * <li>the dynamic invocation name (a UTF8 string)</li>
89.67 - * <li>the argument and return types of the call (encoded as a type descriptor in a UTF8 string)</li>
89.68 - * <li>optionally, a sequence of additional <em>static arguments</em> to the bootstrap method ({@code ldc}-type constants)</li>
89.69 - * </ul>
89.70 - * <p>
89.71 - * Each instance of an {@code invokedynamic} instruction is called a <em>dynamic call site</em>.
89.72 - * Multiple instances of an {@code invokedynamic} instruction can share a single
89.73 - * {@code CONSTANT_InvokeDynamic} entry.
89.74 - * In any case, distinct call sites always have distinct linkage state.
89.75 - * <p>
89.76 - * A dynamic call site is originally in an unlinked state. In this state, there is
89.77 - * no target method for the call site to invoke.
89.78 - * A dynamic call site is linked by means of a bootstrap method,
89.79 - * as <a href="#bsm">described below</a>.
89.80 - *
89.81 - * <p style="font-size:smaller;">
89.82 - * <em>Historic Note:</em> Some older JVMs may allow the index of a {@code CONSTANT_NameAndType}
89.83 - * instead of a {@code CONSTANT_InvokeDynamic}. In earlier, obsolete versions of this API, the
89.84 - * bootstrap method was specified dynamically, in a per-class basis, during class initialization.
89.85 - *
89.86 - * <h3><a name="indycon"></a>constant pool entries for {@code invokedynamic} instructions</h3>
89.87 - * If a constant pool entry has the tag {@code CONSTANT_InvokeDynamic} (decimal 18),
89.88 - * it must contain exactly four more bytes after the tag.
89.89 - * These bytes are interpreted as two 16-bit indexes, in the usual {@code u2} format.
89.90 - * The first pair of bytes after the tag must be an index into a side table called the
89.91 - * <em>bootstrap method table</em>, which is stored in the {@code BootstrapMethods}
89.92 - * attribute as <a href="#bsmattr">described below</a>.
89.93 - * The second pair of bytes must be an index to a {@code CONSTANT_NameAndType}.
89.94 - * <p>
89.95 - * The first index specifies a bootstrap method used by the associated dynamic call sites.
89.96 - * The second index specifies the method name, argument types, and return type of the dynamic call site.
89.97 - * The structure of such an entry is therefore analogous to a {@code CONSTANT_Methodref},
89.98 - * except that the bootstrap method specifier reference replaces
89.99 - * the {@code CONSTANT_Class} reference of a {@code CONSTANT_Methodref} entry.
89.100 - *
89.101 - * <h3><a name="mtcon"></a>constant pool entries for {@linkplain java.dyn.MethodType method types}</h3>
89.102 - * If a constant pool entry has the tag {@code CONSTANT_MethodType} (decimal 16),
89.103 - * it must contain exactly two more bytes, which must be an index to a {@code CONSTANT_Utf8}
89.104 - * entry which represents a method type descriptor.
89.105 - * <p>
89.106 - * The JVM will ensure that on first
89.107 - * execution of an {@code ldc} instruction for this entry, a {@link java.dyn.MethodType MethodType}
89.108 - * will be created which represents the type descriptor.
89.109 - * Any classes mentioned in the {@code MethodType} will be loaded if necessary,
89.110 - * but not initialized.
89.111 - * Access checking and error reporting is performed exactly as it is for
89.112 - * references by {@code ldc} instructions to {@code CONSTANT_Class} constants.
89.113 - *
89.114 - * <h3><a name="mhcon"></a>constant pool entries for {@linkplain java.dyn.MethodHandle method handles}</h3>
89.115 - * If a constant pool entry has the tag {@code CONSTANT_MethodHandle} (decimal 15),
89.116 - * it must contain exactly three more bytes. The first byte after the tag is a subtag
89.117 - * value which must be in the range 1 through 9, and the last two must be an index to a
89.118 - * {@code CONSTANT_Fieldref}, {@code CONSTANT_Methodref}, or
89.119 - * {@code CONSTANT_InterfaceMethodref} entry which represents a field or method
89.120 - * for which a method handle is to be created.
89.121 - * Furthermore, the subtag value and the type of the constant index value
89.122 - * must agree according to the table below.
89.123 - * <p>
89.124 - * The JVM will ensure that on first execution of an {@code ldc} instruction
89.125 - * for this entry, a {@link java.dyn.MethodHandle MethodHandle} will be created which represents
89.126 - * the field or method reference, according to the specific mode implied by the subtag.
89.127 - * <p>
89.128 - * As with {@code CONSTANT_Class} and {@code CONSTANT_MethodType} constants,
89.129 - * the {@code Class} or {@code MethodType} object which reifies the field or method's
89.130 - * type is created. Any classes mentioned in this reification will be loaded if necessary,
89.131 - * but not initialized, and access checking and error reporting performed as usual.
89.132 - * <p>
89.133 - * Unlike the reflective {@code Lookup} API, there are no security manager calls made
89.134 - * when these constants are resolved.
89.135 - * <p>
89.136 - * The method handle itself will have a type and behavior determined by the subtag as follows:
89.137 - * <code>
89.138 - * <table border=1 cellpadding=5 summary="CONSTANT_MethodHandle subtypes">
89.139 - * <tr><th>N</th><th>subtag name</th><th>member</th><th>MH type</th><th>bytecode behavior</th><th>lookup expression</th></tr>
89.140 - * <tr><td>1</td><td>REF_getField</td><td>C.f:T</td><td>(C)T</td><td>getfield C.f:T</td>
89.141 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#findGetter findGetter(C.class,"f",T.class)}</td></tr>
89.142 - * <tr><td>2</td><td>REF_getStatic</td><td>C.f:T</td><td>( )T</td><td>getstatic C.f:T</td>
89.143 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#findStaticGetter findStaticGetter(C.class,"f",T.class)}</td></tr>
89.144 - * <tr><td>3</td><td>REF_putField</td><td>C.f:T</td><td>(C,T)void</td><td>putfield C.f:T</td>
89.145 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#findSetter findSetter(C.class,"f",T.class)}</td></tr>
89.146 - * <tr><td>4</td><td>REF_putStatic</td><td>C.f:T</td><td>(T)void</td><td>putstatic C.f:T</td>
89.147 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#findStaticSetter findStaticSetter(C.class,"f",T.class)}</td></tr>
89.148 - * <tr><td>5</td><td>REF_invokeVirtual</td><td>C.m(A*)T</td><td>(C,A*)T</td><td>invokevirtual C.m(A*)T</td>
89.149 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#findVirtual findVirtual(C.class,"m",MT)}</td></tr>
89.150 - * <tr><td>6</td><td>REF_invokeStatic</td><td>C.m(A*)T</td><td>(C,A*)T</td><td>invokestatic C.m(A*)T</td>
89.151 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#findStatic findStatic(C.class,"m",MT)}</td></tr>
89.152 - * <tr><td>7</td><td>REF_invokeSpecial</td><td>C.m(A*)T</td><td>(C,A*)T</td><td>invokespecial C.m(A*)T</td>
89.153 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#findSpecial findSpecial(C.class,"m",MT,this.class)}</td></tr>
89.154 - * <tr><td>8</td><td>REF_newInvokeSpecial</td><td>C.<init>(A*)void</td><td>(A*)C</td><td>new C; dup; invokespecial C.<init>(A*)void</td>
89.155 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#findConstructor findConstructor(C.class,MT)}</td></tr>
89.156 - * <tr><td>9</td><td>REF_invokeInterface</td><td>C.m(A*)T</td><td>(C,A*)T</td><td>invokeinterface C.m(A*)T</td>
89.157 - * <td>{@linkplain java.dyn.MethodHandles.Lookup#findVirtual findVirtual(C.class,"m",MT)}</td></tr>
89.158 - * </table>
89.159 - * </code>
89.160 - * Here, the type {@code C} is taken from the {@code CONSTANT_Class} reference associated
89.161 - * with the {@code CONSTANT_NameAndType} descriptor.
89.162 - * The field name {@code f} or method name {@code m} is taken from the {@code CONSTANT_NameAndType}
89.163 - * as is the result type {@code T} and (in the case of a method or constructor) the argument type sequence
89.164 - * {@code A*}.
89.165 - * <p>
89.166 - * Each method handle constant has an equivalent instruction sequence called its <em>bytecode behavior</em>.
89.167 - * In general, creating a method handle constant can be done in exactly the same circumstances that
89.168 - * the JVM would successfully resolve the symbolic references in the bytecode behavior.
89.169 - * Also, the type of a method handle constant is such that a valid {@code invokeExact} call
89.170 - * on the method handle has exactly the same JVM stack effects as the <em>bytecode behavior</em>.
89.171 - * Finally, calling a method handle constant on a valid set of arguments has exactly the same effect
89.172 - * and returns the same result (if any) as the corresponding <em>bytecode behavior</em>.
89.173 - * <p>
89.174 - * Each method handle constant also has an equivalent reflective <em>lookup expression</em>,
89.175 - * which is a query to a method in {@link java.dyn.MethodHandles.Lookup}.
89.176 - * In the example lookup method expression given in the table above, the name {@code MT}
89.177 - * stands for a {@code MethodType} built from {@code T} and the sequence of argument types {@code A*}.
89.178 - * (Note that the type {@code C} is not prepended to the query type {@code MT} even if the member is non-static.)
89.179 - * In the case of {@code findSpecial}, the name {@code this.class} refers to the class containing
89.180 - * the bytecodes.
89.181 - * <p>
89.182 - * The special name {@code <clinit>} is not allowed.
89.183 - * The special name {@code <init>} is not allowed except for subtag 8 as shown.
89.184 - * <p>
89.185 - * The JVM verifier and linker apply the same access checks and restrictions for these references as for the hypothetical
89.186 - * bytecode instructions specified in the last column of the table.
89.187 - * A method handle constant will successfully resolve to a method handle if the symbolic references
89.188 - * of the corresponding bytecode instruction(s) would also resolve successfully.
89.189 - * Otherwise, an attempt to resolve the constant will throw equivalent linkage errors.
89.190 - * In particular, method handles to
89.191 - * private and protected members can be created in exactly those classes for which the corresponding
89.192 - * normal accesses are legal.
89.193 - * <p>
89.194 - * A constant may refer to a method or constructor with the {@code varargs}
89.195 - * bit (hexadecimal {@code 0x0080}) set in its modifier bitmask.
89.196 - * The method handle constant produced for such a method behaves as if
89.197 - * it were created by {@link java.dyn.MethodHandle#asVarargsCollector asVarargsCollector}.
89.198 - * In other words, the constant method handle will exhibit variable arity,
89.199 - * when invoked via {@code invokeGeneric}.
89.200 - * On the other hand, its behavior with respect to {@code invokeExact} will be the same
89.201 - * as if the {@code varargs} bit were not set.
89.202 - * <p>
89.203 - * Although the {@code CONSTANT_MethodHandle} and {@code CONSTANT_MethodType} constant types
89.204 - * resolve class names, they do not force class initialization.
89.205 - * Method handle constants for subtags {@code REF_getStatic}, {@code REF_putStatic}, and {@code REF_invokeStatic}
89.206 - * may force class initialization on their first invocation, just like the corresponding bytecodes.
89.207 - * <p>
89.208 - * The rules of section 5.4.3 of the
89.209 - * <a href="http://java.sun.com/docs/books/jvms/second_edition/html/ConstantPool.doc.html#73492">JVM Specification</a>
89.210 - * apply to the resolution of {@code CONSTANT_MethodType}, {@code CONSTANT_MethodHandle},
89.211 - * and {@code CONSTANT_InvokeDynamic} constants,
89.212 - * by the execution of {@code invokedynamic} and {@code ldc} instructions.
89.213 - * (Roughly speaking, this means that every use of a constant pool entry
89.214 - * must lead to the same outcome.
89.215 - * If the resolution succeeds, the same object reference is produced
89.216 - * by every subsequent execution of the same instruction.
89.217 - * If the resolution of the constant causes an error to occur,
89.218 - * the same error will be re-thrown on every subsequent attempt
89.219 - * to use this particular constant.)
89.220 - * <p>
89.221 - * Constants created by the resolution of these constant pool types are not necessarily
89.222 - * interned. Except for {@code CONSTANT_Class} and {@code CONSTANT_String} entries,
89.223 - * two distinct constant pool entries might not resolve to the same reference
89.224 - * even if they contain the same symbolic reference.
89.225 - *
89.226 - * <h2><a name="bsm"></a>Bootstrap Methods</h2>
89.227 - * Before the JVM can execute a dynamic call site (an {@code invokedynamic} instruction),
89.228 - * the call site must first be <em>linked</em>.
89.229 - * Linking is accomplished by calling a <em>bootstrap method</em>
89.230 - * which is given the static information content of the call site,
89.231 - * and which must produce a {@link java.dyn.MethodHandle method handle}
89.232 - * that gives the behavior of the call site.
89.233 - * <p>
89.234 - * Each {@code invokedynamic} instruction statically specifies its own
89.235 - * bootstrap method as a constant pool reference.
89.236 - * The constant pool reference also specifies the call site's name and type descriptor,
89.237 - * just like {@code invokevirtual} and the other invoke instructions.
89.238 - * <p>
89.239 - * Linking starts with resolving the constant pool entry for the
89.240 - * bootstrap method, and resolving a {@link java.dyn.MethodType MethodType} object for
89.241 - * the type descriptor of the dynamic call site.
89.242 - * This resolution process may trigger class loading.
89.243 - * It may therefore throw an error if a class fails to load.
89.244 - * This error becomes the abnormal termination of the dynamic
89.245 - * call site execution.
89.246 - * Linkage does not trigger class initialization.
89.247 - * <p>
89.248 - * Next, the bootstrap method call is started, with at least four values being stacked:
89.249 - * <ul>
89.250 - * <li>a {@code MethodHandle}, the resolved bootstrap method itself </li>
89.251 - * <li>a {@code MethodHandles.Lookup}, a lookup object on the <em>caller class</em> in which dynamic call site occurs </li>
89.252 - * <li>a {@code String}, the method name mentioned in the call site </li>
89.253 - * <li>a {@code MethodType}, the resolved type descriptor of the call </li>
89.254 - * <li>optionally, one or more <a href="#args">additional static arguments</a> </li>
89.255 - * </ul>
89.256 - * The method handle is then applied to the other values as if by
89.257 - * {@link java.dyn.MethodHandle#invokeGeneric invokeGeneric}.
89.258 - * The returned result must be a {@link java.dyn.CallSite CallSite} (or a subclass).
89.259 - * The type of the call site's target must be exactly equal to the type
89.260 - * derived from the dynamic call site's type descriptor and passed to
89.261 - * the bootstrap method.
89.262 - * The call site then becomes permanently linked to the dynamic call site.
89.263 - * <p>
89.264 - * As long as each bootstrap method can be correctly invoked
89.265 - * by <code>invokeGeneric</code>, its detailed type is arbitrary.
89.266 - * For example, the first argument could be {@code Object}
89.267 - * instead of {@code MethodHandles.Lookup}, and the return type
89.268 - * could also be {@code Object} instead of {@code CallSite}.
89.269 - * <p>
89.270 - * As with any method handle constant, a {@code varargs} modifier bit
89.271 - * on the bootstrap method is ignored.
89.272 - * <p>
89.273 - * Note that the first argument of the bootstrap method cannot be
89.274 - * a simple {@code Class} reference. (This is a change from earlier
89.275 - * versions of this specification. If the caller class is needed,
89.276 - * it is easy to {@linkplain java.dyn.MethodHandles.Lookup#lookupClass() extract it}
89.277 - * from the {@code Lookup} object.)
89.278 - * <p>
89.279 - * After resolution, the linkage process may fail in a variety of ways.
89.280 - * All failures are reported by an {@link java.dyn.InvokeDynamicBootstrapError InvokeDynamicBootstrapError},
89.281 - * which is thrown as the abnormal termination of the dynamic call
89.282 - * site execution.
89.283 - * The following circumstances will cause this:
89.284 - * <ul>
89.285 - * <li>the index to the bootstrap method specifier is out of range </li>
89.286 - * <li>the bootstrap method cannot be resolved </li>
89.287 - * <li>the {@code MethodType} to pass to the bootstrap method cannot be resolved </li>
89.288 - * <li>a static argument to the bootstrap method cannot be resolved
89.289 - * (i.e., a {@code CONSTANT_Class}, {@code CONSTANT_MethodType},
89.290 - * or {@code CONSTANT_MethodHandle} argument cannot be linked) </li>
89.291 - * <li>the bootstrap method has the wrong arity,
89.292 - * causing {@code invokeGeneric} to throw {@code WrongMethodTypeException} </li>
89.293 - * <li>the bootstrap method has a wrong argument or return type </li>
89.294 - * <li>the bootstrap method invocation completes abnormally </li>
89.295 - * <li>the result from the bootstrap invocation is not a reference to
89.296 - * an object of type {@link java.dyn.CallSite CallSite} </li>
89.297 - * <li>the target of the {@code CallSite} does not have a target of
89.298 - * the expected {@code MethodType} </li>
89.299 - * </ul>
89.300 - *
89.301 - * <h3><a name="linktime"></a>timing of linkage</h3>
89.302 - * A dynamic call site is linked just before its first execution.
89.303 - * The bootstrap method call implementing the linkage occurs within
89.304 - * a thread that is attempting a first execution.
89.305 - * <p>
89.306 - * If there are several such threads, the bootstrap method may be
89.307 - * invoked in several threads concurrently.
89.308 - * Therefore, bootstrap methods which access global application
89.309 - * data must take the usual precautions against race conditions.
89.310 - * In any case, every {@code invokedynamic} instruction is either
89.311 - * unlinked or linked to a unique {@code CallSite} object.
89.312 - * <p>
89.313 - * In an application which requires dynamic call sites with individually
89.314 - * mutable behaviors, their bootstrap methods should produce distinct
89.315 - * {@link java.dyn.CallSite CallSite} objects, one for each linkage request.
89.316 - * Alternatively, an application can link a single {@code CallSite} object
89.317 - * to several {@code invokedynamic} instructions, in which case
89.318 - * a change to the target method will become visible at each of
89.319 - * the instructions.
89.320 - * <p>
89.321 - * If several threads simultaneously execute a bootstrap method for a single dynamic
89.322 - * call site, the JVM must choose one {@code CallSite} object and install it visibly to
89.323 - * all threads. Any other bootstrap method calls are allowed to complete, but their
89.324 - * results are ignored, and their dynamic call site invocations proceed with the originally
89.325 - * chosen target object.
89.326 - *
89.327 - * <p style="font-size:smaller;">
89.328 - * <em>Historic Note:</em> Unlike some previous versions of this specification,
89.329 - * these rules do not enable the JVM to duplicate dynamic call sites,
89.330 - * or to issue “causeless” bootstrap method calls.
89.331 - * Every dynamic call site transitions at most once from unlinked to linked,
89.332 - * just before its first invocation.
89.333 - *
89.334 - * <h3><a name="bsmattr">the {@code BootstrapMethods} attribute </h3>
89.335 - * Each {@code CONSTANT_InvokeDynamic} entry contains an index which references
89.336 - * a bootstrap method specifier; all such specifiers are contained in a separate array.
89.337 - * This array is defined by a class attribute named {@code BootstrapMethods}.
89.338 - * The body of this attribute consists of a sequence of byte pairs, all interpreted as
89.339 - * as 16-bit counts or constant pool indexes, in the {@code u2} format.
89.340 - * The attribute body starts with a count of bootstrap method specifiers,
89.341 - * which is immediately followed by the sequence of specifiers.
89.342 - * <p>
89.343 - * Each bootstrap method specifier contains an index to a
89.344 - * {@code CONSTANT_MethodHandle} constant, which is the bootstrap
89.345 - * method itself.
89.346 - * This is followed by a count, and then a sequence (perhaps empty) of
89.347 - * indexes to <a href="#args">additional static arguments</a>
89.348 - * for the bootstrap method.
89.349 - * <p>
89.350 - * During class loading, the verifier must check the structure of the
89.351 - * {@code BootstrapMethods} attribute. In particular, each constant
89.352 - * pool index must be of the correct type. A bootstrap method index
89.353 - * must refer to a {@code CONSTANT_MethodHandle} (tag 15).
89.354 - * Every other index must refer to a valid operand of an
89.355 - * {@code ldc_w} or {@code ldc2_w} instruction (tag 3..8 or 15..16).
89.356 - *
89.357 - * <h3><a name="args">static arguments to the bootstrap method</h3>
89.358 - * An {@code invokedynamic} instruction specifies at least three arguments
89.359 - * to pass to its bootstrap method:
89.360 - * The caller class (expressed as a {@link java.dyn.MethodHandles.Lookup Lookup object},
89.361 - * the name (extracted from the {@code CONSTANT_NameAndType} entry),
89.362 - * and the type (also extracted from the {@code CONSTANT_NameAndType} entry).
89.363 - * The {@code invokedynamic} instruction may specify additional metadata values
89.364 - * to pass to its bootstrap method.
89.365 - * Collectively, these values are called <em>static arguments</em> to the
89.366 - * {@code invokedynamic} instruction, because they are used once at link
89.367 - * time to determine the instruction's behavior on subsequent sets of
89.368 - * <em>dynamic arguments</em>.
89.369 - * <p>
89.370 - * Static arguments are used to communicate application-specific meta-data
89.371 - * to the bootstrap method.
89.372 - * Drawn from the constant pool, they may include references to classes, method handles,
89.373 - * strings, or numeric data that may be relevant to the task of linking that particular call site.
89.374 - * <p>
89.375 - * Static arguments are specified constant pool indexes stored in the {@code BootstrapMethods} attribute.
89.376 - * Before the bootstrap method is invoked, each index is used to compute an {@code Object}
89.377 - * reference to the indexed value in the constant pool.
89.378 - * The valid constant pool entries are listed in this table:
89.379 - * <code>
89.380 - * <table border=1 cellpadding=5 summary="Static argument types">
89.381 - * <tr><th>entry type</th><th>argument type</th><th>argument value</th></tr>
89.382 - * <tr><td>CONSTANT_String</td><td><code>java.lang.String</code></td><td>the indexed string literal</td></tr>
89.383 - * <tr><td>CONSTANT_Class</td><td><code>java.lang.Class</code></td><td>the indexed class, resolved</td></tr>
89.384 - * <tr><td>CONSTANT_Integer</td><td><code>java.lang.Integer</code></td><td>the indexed int value</td></tr>
89.385 - * <tr><td>CONSTANT_Long</td><td><code>java.lang.Long</code></td><td>the indexed long value</td></tr>
89.386 - * <tr><td>CONSTANT_Float</td><td><code>java.lang.Float</code></td><td>the indexed float value</td></tr>
89.387 - * <tr><td>CONSTANT_Double</td><td><code>java.lang.Double</code></td><td>the indexed double value</td></tr>
89.388 - * <tr><td>CONSTANT_MethodHandle</td><td><code>java.dyn.MethodHandle</code></td><td>the indexed method handle constant</td></tr>
89.389 - * <tr><td>CONSTANT_MethodType</td><td><code>java.dyn.MethodType</code></td><td>the indexed method type constant</td></tr>
89.390 - * </table>
89.391 - * </code>
89.392 - * <p>
89.393 - * If a given {@code invokedynamic} instruction specifies no static arguments,
89.394 - * the instruction's bootstrap method will be invoked on three arguments,
89.395 - * conveying the instruction's caller class, name, and method type.
89.396 - * If the {@code invokedynamic} instruction specifies one or more static arguments,
89.397 - * those values will be passed as additional arguments to the method handle.
89.398 - * (Note that because there is a limit of 255 arguments to any method,
89.399 - * at most 252 extra arguments can be supplied.)
89.400 - * The bootstrap method will be invoked as if by either {@code invokeGeneric}
89.401 - * or {@code invokeWithArguments}. (There is no way to tell the difference.)
89.402 - * <p>
89.403 - * The normal argument conversion rules for {@code invokeGeneric} apply to all stacked arguments.
89.404 - * For example, if a pushed value is a primitive type, it may be converted to a reference by boxing conversion.
89.405 - * If the bootstrap method is a variable arity method (its modifier bit {@code 0x0080} is set),
89.406 - * then some or all of the arguments specified here may be collected into a trailing array parameter.
89.407 - * (This is not a special rule, but rather a useful consequence of the interaction
89.408 - * between {@code CONSTANT_MethodHandle} constants, the modifier bit for variable arity methods,
89.409 - * and the {@code java.dyn.MethodHandle#asVarargsCollector asVarargsCollector} transformation.)
89.410 - * <p>
89.411 - * Given these rules, here are examples of legal bootstrap method declarations,
89.412 - * given various numbers {@code N} of extra arguments.
89.413 - * The first rows (marked {@code *}) will work for any number of extra arguments.
89.414 - * <code>
89.415 - * <table border=1 cellpadding=5 summary="Static argument types">
89.416 - * <tr><th>N</th><th>sample bootstrap method</th></tr>
89.417 - * <tr><td>*</td><td><code>CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args)</code></td></tr>
89.418 - * <tr><td>*</td><td><code>CallSite bootstrap(Object... args)</code></td></tr>
89.419 - * <tr><td>*</td><td><code>CallSite bootstrap(Object caller, Object... nameAndTypeWithArgs)</code></td></tr>
89.420 - * <tr><td>0</td><td><code>CallSite bootstrap(Lookup caller, String name, MethodType type)</code></td></tr>
89.421 - * <tr><td>0</td><td><code>CallSite bootstrap(Lookup caller, Object... nameAndType)</code></td></tr>
89.422 - * <tr><td>1</td><td><code>CallSite bootstrap(Lookup caller, String name, MethodType type, Object arg)</code></td></tr>
89.423 - * <tr><td>2</td><td><code>CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args)</code></td></tr>
89.424 - * <tr><td>2</td><td><code>CallSite bootstrap(Lookup caller, String name, MethodType type, String... args)</code></td></tr>
89.425 - * <tr><td>2</td><td><code>CallSite bootstrap(Lookup caller, String name, MethodType type, String x, int y)</code></td></tr>
89.426 - * </table>
89.427 - * </code>
89.428 - * The last example assumes that the extra arguments are of type
89.429 - * {@code CONSTANT_String} and {@code CONSTANT_Integer}, respectively.
89.430 - * The second-to-last example assumes that all extra arguments are of type
89.431 - * {@code CONSTANT_String}.
89.432 - * The other examples work with all types of extra arguments.
89.433 - * <p>
89.434 - * As noted above, the actual method type of the bootstrap method can vary.
89.435 - * For example, the fourth argument could be {@code MethodHandle},
89.436 - * if that is the type of the corresponding constant in
89.437 - * the {@code CONSTANT_InvokeDynamic} entry.
89.438 - * In that case, the {@code invokeGeneric} call will pass the extra method handle
89.439 - * constant as an {@code Object}, but the type matching machinery of {@code invokeGeneric}
89.440 - * will cast the reference back to {@code MethodHandle} before invoking the bootstrap method.
89.441 - * (If a string constant were passed instead, by badly generated code, that cast would then fail,
89.442 - * resulting in an {@code InvokeDynamicBootstrapError}.)
89.443 - * <p>
89.444 - * Extra bootstrap method arguments are intended to allow language implementors
89.445 - * to safely and compactly encode metadata.
89.446 - * In principle, the name and extra arguments are redundant,
89.447 - * since each call site could be given its own unique bootstrap method.
89.448 - * Such a practice is likely to produce large class files and constant pools.
89.449 - *
89.450 - * <h2><a name="structs"></a>Structure Summary</h2>
89.451 - * <blockquote><pre>// summary of constant and attribute structures
89.452 -struct CONSTANT_MethodHandle_info {
89.453 - u1 tag = 15;
89.454 - u1 reference_kind; // 1..8 (one of REF_invokeVirtual, etc.)
89.455 - u2 reference_index; // index to CONSTANT_Fieldref or *Methodref
89.456 -}
89.457 -struct CONSTANT_MethodType_info {
89.458 - u1 tag = 16;
89.459 - u2 descriptor_index; // index to CONSTANT_Utf8, as in NameAndType
89.460 -}
89.461 -struct CONSTANT_InvokeDynamic_info {
89.462 - u1 tag = 18;
89.463 - u2 bootstrap_method_attr_index; // index into BootstrapMethods_attr
89.464 - u2 name_and_type_index; // index to CONSTANT_NameAndType, as in Methodref
89.465 -}
89.466 -struct BootstrapMethods_attr {
89.467 - u2 name; // CONSTANT_Utf8 = "BootstrapMethods"
89.468 - u4 size;
89.469 - u2 bootstrap_method_count;
89.470 - struct bootstrap_method_specifier {
89.471 - u2 bootstrap_method_ref; // index to CONSTANT_MethodHandle
89.472 - u2 bootstrap_argument_count;
89.473 - u2 bootstrap_arguments[bootstrap_argument_count]; // constant pool indexes
89.474 - } bootstrap_methods[bootstrap_method_count];
89.475 -}
89.476 - * </pre></blockquote>
89.477 - *
89.478 - * @author John Rose, JSR 292 EG
89.479 - */
89.480 -
89.481 -package java.dyn;
90.1 --- a/src/share/classes/java/lang/AutoCloseable.java Tue Mar 29 11:29:01 2011 -0700
90.2 +++ b/src/share/classes/java/lang/AutoCloseable.java Tue Mar 29 20:19:55 2011 -0700
90.3 @@ -34,12 +34,27 @@
90.4 public interface AutoCloseable {
90.5 /**
90.6 * Closes this resource, relinquishing any underlying resources.
90.7 - * This method is invoked automatically by the {@code
90.8 - * try}-with-resources statement.
90.9 + * This method is invoked automatically on objects managed by the
90.10 + * {@code try}-with-resources statement.
90.11 *
90.12 - * <p>Classes implementing this method are strongly encouraged to
90.13 - * be declared to throw more specific exceptions (or no exception
90.14 - * at all, if the close cannot fail).
90.15 + * <p>While this interface method is declared to throw {@code
90.16 + * Exception}, implementers are <em>strongly</em> encouraged to
90.17 + * declare concrete implementations of the {@code close} method to
90.18 + * throw more specific exceptions, or to throw no exception at all
90.19 + * if the close operation cannot fail.
90.20 + *
90.21 + * <p><em>Implementers of this interface are also strongly advised
90.22 + * to not have the {@code close} method throw {@link
90.23 + * InterruptedException}.</em>
90.24 + *
90.25 + * This exception interacts with a thread's interrupted status,
90.26 + * and runtime misbehavior is likely to occur if an {@code
90.27 + * InterruptedException} is {@linkplain Throwable#addSuppressed
90.28 + * suppressed}.
90.29 + *
90.30 + * More generally, if it would cause problems for an
90.31 + * exception to be suppressed, the {@code AutoCloseable.close}
90.32 + * method should not throw it.
90.33 *
90.34 * <p>Note that unlike the {@link java.io.Closeable#close close}
90.35 * method of {@link java.io.Closeable}, this {@code close} method
90.36 @@ -48,9 +63,8 @@
90.37 * visible side effect, unlike {@code Closeable.close} which is
90.38 * required to have no effect if called more than once.
90.39 *
90.40 - * However, while not required to be idempotent, implementers of
90.41 - * this interface are strongly encouraged to make their {@code
90.42 - * close} methods idempotent.
90.43 + * However, implementers of this interface are strongly encouraged
90.44 + * to make their {@code close} methods idempotent.
90.45 *
90.46 * @throws Exception if this resource cannot be closed
90.47 */
91.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
91.2 +++ b/src/share/classes/java/lang/BootstrapMethodError.java Tue Mar 29 20:19:55 2011 -0700
91.3 @@ -0,0 +1,80 @@
91.4 +/*
91.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
91.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
91.7 + *
91.8 + * This code is free software; you can redistribute it and/or modify it
91.9 + * under the terms of the GNU General Public License version 2 only, as
91.10 + * published by the Free Software Foundation. Oracle designates this
91.11 + * particular file as subject to the "Classpath" exception as provided
91.12 + * by Oracle in the LICENSE file that accompanied this code.
91.13 + *
91.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
91.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
91.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
91.17 + * version 2 for more details (a copy is included in the LICENSE file that
91.18 + * accompanied this code).
91.19 + *
91.20 + * You should have received a copy of the GNU General Public License version
91.21 + * 2 along with this work; if not, write to the Free Software Foundation,
91.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
91.23 + *
91.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
91.25 + * or visit www.oracle.com if you need additional information or have any
91.26 + * questions.
91.27 + */
91.28 +
91.29 +package java.lang;
91.30 +
91.31 +/**
91.32 + * Thrown to indicate that an {@code invokedynamic} instruction has
91.33 + * failed to find its bootstrap method,
91.34 + * or the bootstrap method has failed to provide a
91.35 + * {@linkplain java.lang.invoke.CallSite call site} with a {@linkplain java.lang.invoke.CallSite#getTarget target}
91.36 + * of the correct {@linkplain java.lang.invoke.MethodHandle#type method type}.
91.37 + *
91.38 + * @author John Rose, JSR 292 EG
91.39 + * @since 1.7
91.40 + */
91.41 +public class BootstrapMethodError extends LinkageError {
91.42 + private static final long serialVersionUID = 292L;
91.43 +
91.44 + /**
91.45 + * Constructs an {@code BootstrapMethodError} with no detail message.
91.46 + */
91.47 + public BootstrapMethodError() {
91.48 + super();
91.49 + }
91.50 +
91.51 + /**
91.52 + * Constructs an {@code BootstrapMethodError} with the specified
91.53 + * detail message.
91.54 + *
91.55 + * @param s the detail message.
91.56 + */
91.57 + public BootstrapMethodError(String s) {
91.58 + super(s);
91.59 + }
91.60 +
91.61 + /**
91.62 + * Constructs a {@code BootstrapMethodError} with the specified
91.63 + * detail message and cause.
91.64 + *
91.65 + * @param s the detail message.
91.66 + * @param cause the cause, may be {@code null}.
91.67 + */
91.68 + public BootstrapMethodError(String s, Throwable cause) {
91.69 + super(s, cause);
91.70 + }
91.71 +
91.72 + /**
91.73 + * Constructs a {@code BootstrapMethodError} with the specified
91.74 + * cause.
91.75 + *
91.76 + * @param cause the cause, may be {@code null}.
91.77 + */
91.78 + public BootstrapMethodError(Throwable cause) {
91.79 + // cf. Throwable(Throwable cause) constructor.
91.80 + super(cause == null ? null : cause.toString());
91.81 + initCause(cause);
91.82 + }
91.83 +}
92.1 --- a/src/share/classes/java/lang/ClassLoader.java Tue Mar 29 11:29:01 2011 -0700
92.2 +++ b/src/share/classes/java/lang/ClassLoader.java Tue Mar 29 20:19:55 2011 -0700
92.3 @@ -1,5 +1,5 @@
92.4 /*
92.5 - * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
92.6 + * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
92.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
92.8 *
92.9 * This code is free software; you can redistribute it and/or modify it
92.10 @@ -1626,20 +1626,28 @@
92.11 * @since 1.2
92.12 */
92.13 protected Package getPackage(String name) {
92.14 + Package pkg;
92.15 synchronized (packages) {
92.16 - Package pkg = packages.get(name);
92.17 - if (pkg == null) {
92.18 - if (parent != null) {
92.19 - pkg = parent.getPackage(name);
92.20 - } else {
92.21 - pkg = Package.getSystemPackage(name);
92.22 - }
92.23 - if (pkg != null) {
92.24 - packages.put(name, pkg);
92.25 + pkg = packages.get(name);
92.26 + }
92.27 + if (pkg == null) {
92.28 + if (parent != null) {
92.29 + pkg = parent.getPackage(name);
92.30 + } else {
92.31 + pkg = Package.getSystemPackage(name);
92.32 + }
92.33 + if (pkg != null) {
92.34 + synchronized (packages) {
92.35 + Package pkg2 = packages.get(name);
92.36 + if (pkg2 == null) {
92.37 + packages.put(name, pkg);
92.38 + } else {
92.39 + pkg = pkg2;
92.40 + }
92.41 }
92.42 }
92.43 - return pkg;
92.44 }
92.45 + return pkg;
92.46 }
92.47
92.48 /**
93.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
93.2 +++ b/src/share/classes/java/lang/ClassValue.java Tue Mar 29 20:19:55 2011 -0700
93.3 @@ -0,0 +1,231 @@
93.4 +/*
93.5 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
93.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
93.7 + *
93.8 + * This code is free software; you can redistribute it and/or modify it
93.9 + * under the terms of the GNU General Public License version 2 only, as
93.10 + * published by the Free Software Foundation. Oracle designates this
93.11 + * particular file as subject to the "Classpath" exception as provided
93.12 + * by Oracle in the LICENSE file that accompanied this code.
93.13 + *
93.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
93.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
93.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
93.17 + * version 2 for more details (a copy is included in the LICENSE file that
93.18 + * accompanied this code).
93.19 + *
93.20 + * You should have received a copy of the GNU General Public License version
93.21 + * 2 along with this work; if not, write to the Free Software Foundation,
93.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
93.23 + *
93.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
93.25 + * or visit www.oracle.com if you need additional information or have any
93.26 + * questions.
93.27 + */
93.28 +
93.29 +package java.lang;
93.30 +
93.31 +import java.util.WeakHashMap;
93.32 +import java.util.concurrent.atomic.AtomicInteger;
93.33 +
93.34 +/**
93.35 + * Lazily associate a computed value with (potentially) every type.
93.36 + * For example, if a dynamic language needs to construct a message dispatch
93.37 + * table for each class encountered at a message send call site,
93.38 + * it can use a {@code ClassValue} to cache information needed to
93.39 + * perform the message send quickly, for each class encountered.
93.40 + * @author John Rose, JSR 292 EG
93.41 + * @since 1.7
93.42 + */
93.43 +public abstract class ClassValue<T> {
93.44 + /**
93.45 + * Computes the given class's derived value for this {@code ClassValue}.
93.46 + * <p>
93.47 + * This method will be invoked within the first thread that accesses
93.48 + * the value with the {@link #get get} method.
93.49 + * <p>
93.50 + * Normally, this method is invoked at most once per class,
93.51 + * but it may be invoked again if there has been a call to
93.52 + * {@link #remove remove}.
93.53 + * <p>
93.54 + * If this method throws an exception, the corresponding call to {@code get}
93.55 + * will terminate abnormally with that exception, and no class value will be recorded.
93.56 + *
93.57 + * @param type the type whose class value must be computed
93.58 + * @return the newly computed value associated with this {@code ClassValue}, for the given class or interface
93.59 + * @see #get
93.60 + * @see #remove
93.61 + */
93.62 + protected abstract T computeValue(Class<?> type);
93.63 +
93.64 + /**
93.65 + * Returns the value for the given class.
93.66 + * If no value has yet been computed, it is obtained by
93.67 + * an invocation of the {@link #computeValue computeValue} method.
93.68 + * <p>
93.69 + * The actual installation of the value on the class
93.70 + * is performed atomically.
93.71 + * At that point, if several racing threads have
93.72 + * computed values, one is chosen, and returned to
93.73 + * all the racing threads.
93.74 + * <p>
93.75 + * The {@code type} parameter is typically a class, but it may be any type,
93.76 + * such as an interface, a primitive type (like {@code int.class}), or {@code void.class}.
93.77 + * <p>
93.78 + * In the absence of {@code remove} calls, a class value has a simple
93.79 + * state diagram: uninitialized and initialized.
93.80 + * When {@code remove} calls are made,
93.81 + * the rules for value observation are more complex.
93.82 + * See the documentation for {@link #remove remove} for more information.
93.83 + *
93.84 + * @param type the type whose class value must be computed or retrieved
93.85 + * @return the current value associated with this {@code ClassValue}, for the given class or interface
93.86 + * @throws NullPointerException if the argument is null
93.87 + * @see #remove
93.88 + * @see #computeValue
93.89 + */
93.90 + public T get(Class<?> type) {
93.91 + ClassValueMap map = getMap(type);
93.92 + if (map != null) {
93.93 + Object x = map.get(this);
93.94 + if (x != null) {
93.95 + return (T) map.unmaskNull(x);
93.96 + }
93.97 + }
93.98 + return setComputedValue(type);
93.99 + }
93.100 +
93.101 + /**
93.102 + * Removes the associated value for the given class.
93.103 + * If this value is subsequently {@linkplain #get read} for the same class,
93.104 + * its value will be reinitialized by invoking its {@link #computeValue computeValue} method.
93.105 + * This may result in an additional invocation of the
93.106 + * {@code computeValue computeValue} method for the given class.
93.107 + * <p>
93.108 + * In order to explain the interaction between {@code get} and {@code remove} calls,
93.109 + * we must model the state transitions of a class value to take into account
93.110 + * the alternation between uninitialized and initialized states.
93.111 + * To do this, number these states sequentially from zero, and note that
93.112 + * uninitialized (or removed) states are numbered with even numbers,
93.113 + * while initialized (or re-initialized) states have odd numbers.
93.114 + * <p>
93.115 + * When a thread {@code T} removes a class value in state {@code 2N},
93.116 + * nothing happens, since the class value is already uninitialized.
93.117 + * Otherwise, the state is advanced atomically to {@code 2N+1}.
93.118 + * <p>
93.119 + * When a thread {@code T} queries a class value in state {@code 2N},
93.120 + * the thread first attempts to initialize the class value to state {@code 2N+1}
93.121 + * by invoking {@code computeValue} and installing the resulting value.
93.122 + * <p>
93.123 + * When {@code T} attempts to install the newly computed value,
93.124 + * if the state is still at {@code 2N}, the class value will be initialized
93.125 + * with the computed value, advancing it to state {@code 2N+1}.
93.126 + * <p>
93.127 + * Otherwise, whether the new state is even or odd,
93.128 + * {@code T} will discard the newly computed value
93.129 + * and retry the {@code get} operation.
93.130 + * <p>
93.131 + * Discarding and retrying is an important proviso,
93.132 + * since otherwise {@code T} could potentially install
93.133 + * a disastrously stale value. For example:
93.134 + * <ul>
93.135 + * <li>{@code T} calls {@code CV.get(C)} and sees state {@code 2N}
93.136 + * <li>{@code T} quickly computes a time-dependent value {@code V0} and gets ready to install it
93.137 + * <li>{@code T} is hit by an unlucky paging or scheduling event, and goes to sleep for a long time
93.138 + * <li>...meanwhile, {@code T2} also calls {@code CV.get(C)} and sees state {@code 2N}
93.139 + * <li>{@code T2} quickly computes a similar time-dependent value {@code V1} and installs it on {@code CV.get(C)}
93.140 + * <li>{@code T2} (or a third thread) then calls {@code CV.remove(C)}, undoing {@code T2}'s work
93.141 + * <li> the previous actions of {@code T2} are repeated several times
93.142 + * <li> also, the relevant computed values change over time: {@code V1}, {@code V2}, ...
93.143 + * <li>...meanwhile, {@code T} wakes up and attempts to install {@code V0}; <em>this must fail</em>
93.144 + * </ul>
93.145 + * We can assume in the above scenario that {@code CV.computeValue} uses locks to properly
93.146 + * observe the time-dependent states as it computes {@code V1}, etc.
93.147 + * This does not remove the threat of a stale value, since there is a window of time
93.148 + * between the return of {@code computeValue} in {@code T} and the installation
93.149 + * of the the new value. No user synchronization is possible during this time.
93.150 + *
93.151 + * @param type the type whose class value must be removed
93.152 + * @throws NullPointerException if the argument is null
93.153 + */
93.154 + public void remove(Class<?> type) {
93.155 + ClassValueMap map = getMap(type);
93.156 + if (map != null) {
93.157 + synchronized (map) {
93.158 + map.remove(this);
93.159 + }
93.160 + }
93.161 + }
93.162 +
93.163 + /// Implementation...
93.164 + // FIXME: Use a data structure here similar that of ThreadLocal (7030453).
93.165 +
93.166 + private static final AtomicInteger STORE_BARRIER = new AtomicInteger();
93.167 +
93.168 + /** Slow path for {@link #get}. */
93.169 + private T setComputedValue(Class<?> type) {
93.170 + ClassValueMap map = getMap(type);
93.171 + if (map == null) {
93.172 + map = initializeMap(type);
93.173 + }
93.174 + T value = computeValue(type);
93.175 + STORE_BARRIER.lazySet(0);
93.176 + // All stores pending from computeValue are completed.
93.177 + synchronized (map) {
93.178 + // Warm up the table with a null entry.
93.179 + map.preInitializeEntry(this);
93.180 + }
93.181 + STORE_BARRIER.lazySet(0);
93.182 + // All stores pending from table expansion are completed.
93.183 + synchronized (map) {
93.184 + value = (T) map.initializeEntry(this, value);
93.185 + // One might fear a possible race condition here
93.186 + // if the code for map.put has flushed the write
93.187 + // to map.table[*] before the writes to the Map.Entry
93.188 + // are done. This is not possible, since we have
93.189 + // warmed up the table with an empty entry.
93.190 + }
93.191 + return value;
93.192 + }
93.193 +
93.194 + // Replace this map by a per-class slot.
93.195 + private static final WeakHashMap<Class<?>, ClassValueMap> ROOT
93.196 + = new WeakHashMap<Class<?>, ClassValueMap>();
93.197 +
93.198 + private static ClassValueMap getMap(Class<?> type) {
93.199 + return ROOT.get(type);
93.200 + }
93.201 +
93.202 + private static ClassValueMap initializeMap(Class<?> type) {
93.203 + synchronized (ClassValue.class) {
93.204 + ClassValueMap map = ROOT.get(type);
93.205 + if (map == null)
93.206 + ROOT.put(type, map = new ClassValueMap());
93.207 + return map;
93.208 + }
93.209 + }
93.210 +
93.211 + static class ClassValueMap extends WeakHashMap<ClassValue, Object> {
93.212 + /** Make sure this table contains an Entry for the given key, even if it is empty. */
93.213 + void preInitializeEntry(ClassValue key) {
93.214 + if (!this.containsKey(key))
93.215 + this.put(key, null);
93.216 + }
93.217 + /** Make sure this table contains a non-empty Entry for the given key. */
93.218 + Object initializeEntry(ClassValue key, Object value) {
93.219 + Object prior = this.get(key);
93.220 + if (prior != null) {
93.221 + return unmaskNull(prior);
93.222 + }
93.223 + this.put(key, maskNull(value));
93.224 + return value;
93.225 + }
93.226 +
93.227 + Object maskNull(Object x) {
93.228 + return x == null ? this : x;
93.229 + }
93.230 + Object unmaskNull(Object x) {
93.231 + return x == this ? null : x;
93.232 + }
93.233 + }
93.234 +}
94.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
94.2 +++ b/src/share/classes/java/lang/invoke/AdapterMethodHandle.java Tue Mar 29 20:19:55 2011 -0700
94.3 @@ -0,0 +1,943 @@
94.4 +/*
94.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
94.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
94.7 + *
94.8 + * This code is free software; you can redistribute it and/or modify it
94.9 + * under the terms of the GNU General Public License version 2 only, as
94.10 + * published by the Free Software Foundation. Oracle designates this
94.11 + * particular file as subject to the "Classpath" exception as provided
94.12 + * by Oracle in the LICENSE file that accompanied this code.
94.13 + *
94.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
94.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
94.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
94.17 + * version 2 for more details (a copy is included in the LICENSE file that
94.18 + * accompanied this code).
94.19 + *
94.20 + * You should have received a copy of the GNU General Public License version
94.21 + * 2 along with this work; if not, write to the Free Software Foundation,
94.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
94.23 + *
94.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
94.25 + * or visit www.oracle.com if you need additional information or have any
94.26 + * questions.
94.27 + */
94.28 +
94.29 +package java.lang.invoke;
94.30 +
94.31 +import sun.invoke.util.VerifyType;
94.32 +import sun.invoke.util.Wrapper;
94.33 +import java.util.Arrays;
94.34 +import static java.lang.invoke.MethodHandleNatives.Constants.*;
94.35 +import static java.lang.invoke.MethodHandleStatics.*;
94.36 +
94.37 +/**
94.38 + * This method handle performs simple conversion or checking of a single argument.
94.39 + * @author jrose
94.40 + */
94.41 +class AdapterMethodHandle extends BoundMethodHandle {
94.42 +
94.43 + //MethodHandle vmtarget; // next AMH or BMH in chain or final DMH
94.44 + //Object argument; // parameter to the conversion if needed
94.45 + //int vmargslot; // which argument slot is affected
94.46 + private final int conversion; // the type of conversion: RETYPE_ONLY, etc.
94.47 +
94.48 + // Constructors in this class *must* be package scoped or private.
94.49 + private AdapterMethodHandle(MethodHandle target, MethodType newType,
94.50 + long conv, Object convArg) {
94.51 + super(newType, convArg, newType.parameterSlotDepth(1+convArgPos(conv)));
94.52 + this.conversion = convCode(conv);
94.53 + // JVM might update VM-specific bits of conversion (ignore)
94.54 + MethodHandleNatives.init(this, target, convArgPos(conv));
94.55 + }
94.56 + private AdapterMethodHandle(MethodHandle target, MethodType newType,
94.57 + long conv) {
94.58 + this(target, newType, conv, null);
94.59 + }
94.60 +
94.61 + // TO DO: When adapting another MH with a null conversion, clone
94.62 + // the target and change its type, instead of adding another layer.
94.63 +
94.64 + /** Can a JVM-level adapter directly implement the proposed
94.65 + * argument conversions, as if by MethodHandles.convertArguments?
94.66 + */
94.67 + static boolean canPairwiseConvert(MethodType newType, MethodType oldType) {
94.68 + // same number of args, of course
94.69 + int len = newType.parameterCount();
94.70 + if (len != oldType.parameterCount())
94.71 + return false;
94.72 +
94.73 + // Check return type. (Not much can be done with it.)
94.74 + Class<?> exp = newType.returnType();
94.75 + Class<?> ret = oldType.returnType();
94.76 + if (!VerifyType.isNullConversion(ret, exp))
94.77 + return false;
94.78 +
94.79 + // Check args pairwise.
94.80 + for (int i = 0; i < len; i++) {
94.81 + Class<?> src = newType.parameterType(i); // source type
94.82 + Class<?> dst = oldType.parameterType(i); // destination type
94.83 + if (!canConvertArgument(src, dst))
94.84 + return false;
94.85 + }
94.86 +
94.87 + return true;
94.88 + }
94.89 +
94.90 + /** Can a JVM-level adapter directly implement the proposed
94.91 + * argument conversion, as if by MethodHandles.convertArguments?
94.92 + */
94.93 + static boolean canConvertArgument(Class<?> src, Class<?> dst) {
94.94 + // ? Retool this logic to use RETYPE_ONLY, CHECK_CAST, etc., as opcodes,
94.95 + // so we don't need to repeat so much decision making.
94.96 + if (VerifyType.isNullConversion(src, dst)) {
94.97 + return true;
94.98 + } else if (src.isPrimitive()) {
94.99 + if (dst.isPrimitive())
94.100 + return canPrimCast(src, dst);
94.101 + else
94.102 + return canBoxArgument(src, dst);
94.103 + } else {
94.104 + if (dst.isPrimitive())
94.105 + return canUnboxArgument(src, dst);
94.106 + else
94.107 + return true; // any two refs can be interconverted
94.108 + }
94.109 + }
94.110 +
94.111 + /**
94.112 + * Create a JVM-level adapter method handle to conform the given method
94.113 + * handle to the similar newType, using only pairwise argument conversions.
94.114 + * For each argument, convert incoming argument to the exact type needed.
94.115 + * Only null conversions are allowed on the return value (until
94.116 + * the JVM supports ricochet adapters).
94.117 + * The argument conversions allowed are casting, unboxing,
94.118 + * integral widening or narrowing, and floating point widening or narrowing.
94.119 + * @param newType required call type
94.120 + * @param target original method handle
94.121 + * @return an adapter to the original handle with the desired new type,
94.122 + * or the original target if the types are already identical
94.123 + * or null if the adaptation cannot be made
94.124 + */
94.125 + static MethodHandle makePairwiseConvert(MethodType newType, MethodHandle target) {
94.126 + MethodType oldType = target.type();
94.127 + if (newType == oldType) return target;
94.128 +
94.129 + if (!canPairwiseConvert(newType, oldType))
94.130 + return null;
94.131 + // (after this point, it is an assertion error to fail to convert)
94.132 +
94.133 + // Find last non-trivial conversion (if any).
94.134 + int lastConv = newType.parameterCount()-1;
94.135 + while (lastConv >= 0) {
94.136 + Class<?> src = newType.parameterType(lastConv); // source type
94.137 + Class<?> dst = oldType.parameterType(lastConv); // destination type
94.138 + if (VerifyType.isNullConversion(src, dst)) {
94.139 + --lastConv;
94.140 + } else {
94.141 + break;
94.142 + }
94.143 + }
94.144 + // Now build a chain of one or more adapters.
94.145 + MethodHandle adapter = target;
94.146 + MethodType midType = oldType.changeReturnType(newType.returnType());
94.147 + for (int i = 0; i <= lastConv; i++) {
94.148 + Class<?> src = newType.parameterType(i); // source type
94.149 + Class<?> dst = midType.parameterType(i); // destination type
94.150 + if (VerifyType.isNullConversion(src, dst)) {
94.151 + // do nothing: difference is trivial
94.152 + continue;
94.153 + }
94.154 + // Work the current type backward toward the desired caller type:
94.155 + if (i != lastConv) {
94.156 + midType = midType.changeParameterType(i, src);
94.157 + } else {
94.158 + // When doing the last (or only) real conversion,
94.159 + // force all remaining null conversions to happen also.
94.160 + assert(VerifyType.isNullConversion(newType, midType.changeParameterType(i, src)));
94.161 + midType = newType;
94.162 + }
94.163 +
94.164 + // Tricky case analysis follows.
94.165 + // It parallels canConvertArgument() above.
94.166 + if (src.isPrimitive()) {
94.167 + if (dst.isPrimitive()) {
94.168 + adapter = makePrimCast(midType, adapter, i, dst);
94.169 + } else {
94.170 + adapter = makeBoxArgument(midType, adapter, i, dst);
94.171 + }
94.172 + } else {
94.173 + if (dst.isPrimitive()) {
94.174 + // Caller has boxed a primitive. Unbox it for the target.
94.175 + // The box type must correspond exactly to the primitive type.
94.176 + // This is simpler than the powerful set of widening
94.177 + // conversions supported by reflect.Method.invoke.
94.178 + // Those conversions require a big nest of if/then/else logic,
94.179 + // which we prefer to make a user responsibility.
94.180 + adapter = makeUnboxArgument(midType, adapter, i, dst);
94.181 + } else {
94.182 + // Simple reference conversion.
94.183 + // Note: Do not check for a class hierarchy relation
94.184 + // between src and dst. In all cases a 'null' argument
94.185 + // will pass the cast conversion.
94.186 + adapter = makeCheckCast(midType, adapter, i, dst);
94.187 + }
94.188 + }
94.189 + assert(adapter != null);
94.190 + assert(adapter.type() == midType);
94.191 + }
94.192 + if (adapter.type() != newType) {
94.193 + // Only trivial conversions remain.
94.194 + adapter = makeRetypeOnly(newType, adapter);
94.195 + assert(adapter != null);
94.196 + // Actually, that's because there were no non-trivial ones:
94.197 + assert(lastConv == -1);
94.198 + }
94.199 + assert(adapter.type() == newType);
94.200 + return adapter;
94.201 + }
94.202 +
94.203 + /**
94.204 + * Create a JVM-level adapter method handle to permute the arguments
94.205 + * of the given method.
94.206 + * @param newType required call type
94.207 + * @param target original method handle
94.208 + * @param argumentMap for each target argument, position of its source in newType
94.209 + * @return an adapter to the original handle with the desired new type,
94.210 + * or the original target if the types are already identical
94.211 + * and the permutation is null
94.212 + * @throws IllegalArgumentException if the adaptation cannot be made
94.213 + * directly by a JVM-level adapter, without help from Java code
94.214 + */
94.215 + static MethodHandle makePermutation(MethodType newType, MethodHandle target,
94.216 + int[] argumentMap) {
94.217 + MethodType oldType = target.type();
94.218 + boolean nullPermutation = true;
94.219 + for (int i = 0; i < argumentMap.length; i++) {
94.220 + int pos = argumentMap[i];
94.221 + if (pos != i)
94.222 + nullPermutation = false;
94.223 + if (pos < 0 || pos >= newType.parameterCount()) {
94.224 + argumentMap = new int[0]; break;
94.225 + }
94.226 + }
94.227 + if (argumentMap.length != oldType.parameterCount())
94.228 + throw newIllegalArgumentException("bad permutation: "+Arrays.toString(argumentMap));
94.229 + if (nullPermutation) {
94.230 + MethodHandle res = makePairwiseConvert(newType, target);
94.231 + // well, that was easy
94.232 + if (res == null)
94.233 + throw newIllegalArgumentException("cannot convert pairwise: "+newType);
94.234 + return res;
94.235 + }
94.236 +
94.237 + // Check return type. (Not much can be done with it.)
94.238 + Class<?> exp = newType.returnType();
94.239 + Class<?> ret = oldType.returnType();
94.240 + if (!VerifyType.isNullConversion(ret, exp))
94.241 + throw newIllegalArgumentException("bad return conversion for "+newType);
94.242 +
94.243 + // See if the argument types match up.
94.244 + for (int i = 0; i < argumentMap.length; i++) {
94.245 + int j = argumentMap[i];
94.246 + Class<?> src = newType.parameterType(j);
94.247 + Class<?> dst = oldType.parameterType(i);
94.248 + if (!VerifyType.isNullConversion(src, dst))
94.249 + throw newIllegalArgumentException("bad argument #"+j+" conversion for "+newType);
94.250 + }
94.251 +
94.252 + // Now figure out a nice mix of SWAP, ROT, DUP, and DROP adapters.
94.253 + // A workable greedy algorithm is as follows:
94.254 + // Drop unused outgoing arguments (right to left: shallowest first).
94.255 + // Duplicate doubly-used outgoing arguments (left to right: deepest first).
94.256 + // Then the remaining problem is a true argument permutation.
94.257 + // Marshal the outgoing arguments as required from left to right.
94.258 + // That is, find the deepest outgoing stack position that does not yet
94.259 + // have the correct argument value, and correct at least that position
94.260 + // by swapping or rotating in the misplaced value (from a shallower place).
94.261 + // If the misplaced value is followed by one or more consecutive values
94.262 + // (also misplaced) issue a rotation which brings as many as possible
94.263 + // into position. Otherwise make progress with either a swap or a
94.264 + // rotation. Prefer the swap as cheaper, but do not use it if it
94.265 + // breaks a slot pair. Prefer the rotation over the swap if it would
94.266 + // preserve more consecutive values shallower than the target position.
94.267 + // When more than one rotation will work (because the required value
94.268 + // is already adjacent to the target position), then use a rotation
94.269 + // which moves the old value in the target position adjacent to
94.270 + // one of its consecutive values. Also, prefer shorter rotation
94.271 + // spans, since they use fewer memory cycles for shuffling.
94.272 +
94.273 + throw new UnsupportedOperationException("NYI");
94.274 + }
94.275 +
94.276 + private static byte basicType(Class<?> type) {
94.277 + if (type == null) return T_VOID;
94.278 + switch (Wrapper.forBasicType(type)) {
94.279 + case BOOLEAN: return T_BOOLEAN;
94.280 + case CHAR: return T_CHAR;
94.281 + case FLOAT: return T_FLOAT;
94.282 + case DOUBLE: return T_DOUBLE;
94.283 + case BYTE: return T_BYTE;
94.284 + case SHORT: return T_SHORT;
94.285 + case INT: return T_INT;
94.286 + case LONG: return T_LONG;
94.287 + case OBJECT: return T_OBJECT;
94.288 + case VOID: return T_VOID;
94.289 + }
94.290 + return 99; // T_ILLEGAL or some such
94.291 + }
94.292 +
94.293 + /** Number of stack slots for the given type.
94.294 + * Two for T_DOUBLE and T_FLOAT, one for the rest.
94.295 + */
94.296 + private static int type2size(int type) {
94.297 + assert(type >= T_BOOLEAN && type <= T_OBJECT);
94.298 + return (type == T_LONG || type == T_DOUBLE) ? 2 : 1;
94.299 + }
94.300 + private static int type2size(Class<?> type) {
94.301 + return type2size(basicType(type));
94.302 + }
94.303 +
94.304 + /** The given stackMove is the number of slots pushed.
94.305 + * It might be negative. Scale it (multiply) by the
94.306 + * VM's notion of how an address changes with a push,
94.307 + * to get the raw SP change for stackMove.
94.308 + * Then shift and mask it into the correct field.
94.309 + */
94.310 + private static long insertStackMove(int stackMove) {
94.311 + // following variable must be long to avoid sign extension after '<<'
94.312 + long spChange = stackMove * MethodHandleNatives.JVM_STACK_MOVE_UNIT;
94.313 + return (spChange & CONV_STACK_MOVE_MASK) << CONV_STACK_MOVE_SHIFT;
94.314 + }
94.315 +
94.316 + /** Construct an adapter conversion descriptor for a single-argument conversion. */
94.317 + private static long makeConv(int convOp, int argnum, int src, int dest) {
94.318 + assert(src == (src & 0xF));
94.319 + assert(dest == (dest & 0xF));
94.320 + assert(convOp >= OP_CHECK_CAST && convOp <= OP_PRIM_TO_REF);
94.321 + int stackMove = type2size(dest) - type2size(src);
94.322 + return ((long) argnum << 32 |
94.323 + (long) convOp << CONV_OP_SHIFT |
94.324 + (int) src << CONV_SRC_TYPE_SHIFT |
94.325 + (int) dest << CONV_DEST_TYPE_SHIFT |
94.326 + insertStackMove(stackMove)
94.327 + );
94.328 + }
94.329 + private static long makeConv(int convOp, int argnum, int stackMove) {
94.330 + assert(convOp >= OP_DUP_ARGS && convOp <= OP_SPREAD_ARGS);
94.331 + byte src = 0, dest = 0;
94.332 + if (convOp >= OP_COLLECT_ARGS && convOp <= OP_SPREAD_ARGS)
94.333 + src = dest = T_OBJECT;
94.334 + return ((long) argnum << 32 |
94.335 + (long) convOp << CONV_OP_SHIFT |
94.336 + (int) src << CONV_SRC_TYPE_SHIFT |
94.337 + (int) dest << CONV_DEST_TYPE_SHIFT |
94.338 + insertStackMove(stackMove)
94.339 + );
94.340 + }
94.341 + private static long makeSwapConv(int convOp, int srcArg, byte type, int destSlot) {
94.342 + assert(convOp >= OP_SWAP_ARGS && convOp <= OP_ROT_ARGS);
94.343 + return ((long) srcArg << 32 |
94.344 + (long) convOp << CONV_OP_SHIFT |
94.345 + (int) type << CONV_SRC_TYPE_SHIFT |
94.346 + (int) type << CONV_DEST_TYPE_SHIFT |
94.347 + (int) destSlot << CONV_VMINFO_SHIFT
94.348 + );
94.349 + }
94.350 + private static long makeConv(int convOp) {
94.351 + assert(convOp == OP_RETYPE_ONLY || convOp == OP_RETYPE_RAW);
94.352 + return ((long)-1 << 32) | (convOp << CONV_OP_SHIFT); // stackMove, src, dst all zero
94.353 + }
94.354 + private static int convCode(long conv) {
94.355 + return (int)conv;
94.356 + }
94.357 + private static int convArgPos(long conv) {
94.358 + return (int)(conv >>> 32);
94.359 + }
94.360 + private static boolean convOpSupported(int convOp) {
94.361 + assert(convOp >= 0 && convOp <= CONV_OP_LIMIT);
94.362 + return ((1<<convOp) & MethodHandleNatives.CONV_OP_IMPLEMENTED_MASK) != 0;
94.363 + }
94.364 +
94.365 + /** One of OP_RETYPE_ONLY, etc. */
94.366 + int conversionOp() { return (conversion & CONV_OP_MASK) >> CONV_OP_SHIFT; }
94.367 +
94.368 + /* Return one plus the position of the first non-trivial difference
94.369 + * between the given types. This is not a symmetric operation;
94.370 + * we are considering adapting the targetType to adapterType.
94.371 + * Trivial differences are those which could be ignored by the JVM
94.372 + * without subverting the verifier. Otherwise, adaptable differences
94.373 + * are ones for which we could create an adapter to make the type change.
94.374 + * Return zero if there are no differences (other than trivial ones).
94.375 + * Return 1+N if N is the only adaptable argument difference.
94.376 + * Return the -2-N where N is the first of several adaptable
94.377 + * argument differences.
94.378 + * Return -1 if there there are differences which are not adaptable.
94.379 + */
94.380 + private static int diffTypes(MethodType adapterType,
94.381 + MethodType targetType,
94.382 + boolean raw) {
94.383 + int diff;
94.384 + diff = diffReturnTypes(adapterType, targetType, raw);
94.385 + if (diff != 0) return diff;
94.386 + int nargs = adapterType.parameterCount();
94.387 + if (nargs != targetType.parameterCount())
94.388 + return -1;
94.389 + diff = diffParamTypes(adapterType, 0, targetType, 0, nargs, raw);
94.390 + //System.out.println("diff "+adapterType);
94.391 + //System.out.println(" "+diff+" "+targetType);
94.392 + return diff;
94.393 + }
94.394 + private static int diffReturnTypes(MethodType adapterType,
94.395 + MethodType targetType,
94.396 + boolean raw) {
94.397 + Class<?> src = targetType.returnType();
94.398 + Class<?> dst = adapterType.returnType();
94.399 + if ((!raw
94.400 + ? VerifyType.canPassUnchecked(src, dst)
94.401 + : VerifyType.canPassRaw(src, dst)
94.402 + ) > 0)
94.403 + return 0; // no significant difference
94.404 + if (raw && !src.isPrimitive() && !dst.isPrimitive())
94.405 + return 0; // can force a reference return (very carefully!)
94.406 + //if (false) return 1; // never adaptable!
94.407 + return -1; // some significant difference
94.408 + }
94.409 + private static int diffParamTypes(MethodType adapterType, int astart,
94.410 + MethodType targetType, int tstart,
94.411 + int nargs, boolean raw) {
94.412 + assert(nargs >= 0);
94.413 + int res = 0;
94.414 + for (int i = 0; i < nargs; i++) {
94.415 + Class<?> src = adapterType.parameterType(astart+i);
94.416 + Class<?> dest = targetType.parameterType(tstart+i);
94.417 + if ((!raw
94.418 + ? VerifyType.canPassUnchecked(src, dest)
94.419 + : VerifyType.canPassRaw(src, dest)
94.420 + ) <= 0) {
94.421 + // found a difference; is it the only one so far?
94.422 + if (res != 0)
94.423 + return -1-res; // return -2-i for prev. i
94.424 + res = 1+i;
94.425 + }
94.426 + }
94.427 + return res;
94.428 + }
94.429 +
94.430 + /** Can a retyping adapter (alone) validly convert the target to newType? */
94.431 + static boolean canRetypeOnly(MethodType newType, MethodType targetType) {
94.432 + return canRetype(newType, targetType, false);
94.433 + }
94.434 + /** Can a retyping adapter (alone) convert the target to newType?
94.435 + * It is allowed to widen subword types and void to int, to make bitwise
94.436 + * conversions between float/int and double/long, and to perform unchecked
94.437 + * reference conversions on return. This last feature requires that the
94.438 + * caller be trusted, and perform explicit cast conversions on return values.
94.439 + */
94.440 + static boolean canRetypeRaw(MethodType newType, MethodType targetType) {
94.441 + return canRetype(newType, targetType, true);
94.442 + }
94.443 + static boolean canRetype(MethodType newType, MethodType targetType, boolean raw) {
94.444 + if (!convOpSupported(raw ? OP_RETYPE_RAW : OP_RETYPE_ONLY)) return false;
94.445 + int diff = diffTypes(newType, targetType, raw);
94.446 + // %%% This assert is too strong. Factor diff into VerifyType and reconcile.
94.447 + assert(raw || (diff == 0) == VerifyType.isNullConversion(newType, targetType));
94.448 + return diff == 0;
94.449 + }
94.450 +
94.451 + /** Factory method: Performs no conversions; simply retypes the adapter.
94.452 + * Allows unchecked argument conversions pairwise, if they are safe.
94.453 + * Returns null if not possible.
94.454 + */
94.455 + static MethodHandle makeRetypeOnly(MethodType newType, MethodHandle target) {
94.456 + return makeRetype(newType, target, false);
94.457 + }
94.458 + static MethodHandle makeRetypeRaw(MethodType newType, MethodHandle target) {
94.459 + return makeRetype(newType, target, true);
94.460 + }
94.461 + static MethodHandle makeRetype(MethodType newType, MethodHandle target, boolean raw) {
94.462 + MethodType oldType = target.type();
94.463 + if (oldType == newType) return target;
94.464 + if (!canRetype(newType, oldType, raw))
94.465 + return null;
94.466 + // TO DO: clone the target guy, whatever he is, with new type.
94.467 + return new AdapterMethodHandle(target, newType, makeConv(raw ? OP_RETYPE_RAW : OP_RETYPE_ONLY));
94.468 + }
94.469 +
94.470 + static MethodHandle makeVarargsCollector(MethodHandle target, Class<?> arrayType) {
94.471 + return new AsVarargsCollector(target, arrayType);
94.472 + }
94.473 +
94.474 + static class AsVarargsCollector extends AdapterMethodHandle {
94.475 + final MethodHandle target;
94.476 + final Class<?> arrayType;
94.477 + MethodHandle cache;
94.478 +
94.479 + AsVarargsCollector(MethodHandle target, Class<?> arrayType) {
94.480 + super(target, target.type(), makeConv(OP_RETYPE_ONLY));
94.481 + this.target = target;
94.482 + this.arrayType = arrayType;
94.483 + this.cache = target.asCollector(arrayType, 0);
94.484 + }
94.485 +
94.486 + @Override
94.487 + public boolean isVarargsCollector() {
94.488 + return true;
94.489 + }
94.490 +
94.491 + @Override
94.492 + public MethodHandle asType(MethodType newType) {
94.493 + MethodType type = this.type();
94.494 + int collectArg = type.parameterCount() - 1;
94.495 + int newArity = newType.parameterCount();
94.496 + if (newArity == collectArg+1 &&
94.497 + type.parameterType(collectArg).isAssignableFrom(newType.parameterType(collectArg))) {
94.498 + // if arity and trailing parameter are compatible, do normal thing
94.499 + return super.asType(newType);
94.500 + }
94.501 + // check cache
94.502 + if (cache.type().parameterCount() == newArity)
94.503 + return cache.asType(newType);
94.504 + // build and cache a collector
94.505 + int arrayLength = newArity - collectArg;
94.506 + MethodHandle collector;
94.507 + try {
94.508 + collector = target.asCollector(arrayType, arrayLength);
94.509 + } catch (IllegalArgumentException ex) {
94.510 + throw new WrongMethodTypeException("cannot build collector");
94.511 + }
94.512 + cache = collector;
94.513 + return collector.asType(newType);
94.514 + }
94.515 +
94.516 + @Override
94.517 + public MethodHandle asVarargsCollector(Class<?> arrayType) {
94.518 + MethodType type = this.type();
94.519 + if (type.parameterType(type.parameterCount()-1) == arrayType)
94.520 + return this;
94.521 + return super.asVarargsCollector(arrayType);
94.522 + }
94.523 + }
94.524 +
94.525 + /** Can a checkcast adapter validly convert the target to newType?
94.526 + * The JVM supports all kind of reference casts, even silly ones.
94.527 + */
94.528 + static boolean canCheckCast(MethodType newType, MethodType targetType,
94.529 + int arg, Class<?> castType) {
94.530 + if (!convOpSupported(OP_CHECK_CAST)) return false;
94.531 + Class<?> src = newType.parameterType(arg);
94.532 + Class<?> dst = targetType.parameterType(arg);
94.533 + if (!canCheckCast(src, castType)
94.534 + || !VerifyType.isNullConversion(castType, dst))
94.535 + return false;
94.536 + int diff = diffTypes(newType, targetType, false);
94.537 + return (diff == arg+1); // arg is sole non-trivial diff
94.538 + }
94.539 + /** Can an primitive conversion adapter validly convert src to dst? */
94.540 + static boolean canCheckCast(Class<?> src, Class<?> dst) {
94.541 + return (!src.isPrimitive() && !dst.isPrimitive());
94.542 + }
94.543 +
94.544 + /** Factory method: Forces a cast at the given argument.
94.545 + * The castType is the target of the cast, and can be any type
94.546 + * with a null conversion to the corresponding target parameter.
94.547 + * Return null if this cannot be done.
94.548 + */
94.549 + static MethodHandle makeCheckCast(MethodType newType, MethodHandle target,
94.550 + int arg, Class<?> castType) {
94.551 + if (!canCheckCast(newType, target.type(), arg, castType))
94.552 + return null;
94.553 + long conv = makeConv(OP_CHECK_CAST, arg, T_OBJECT, T_OBJECT);
94.554 + return new AdapterMethodHandle(target, newType, conv, castType);
94.555 + }
94.556 +
94.557 + /** Can an primitive conversion adapter validly convert the target to newType?
94.558 + * The JVM currently supports all conversions except those between
94.559 + * floating and integral types.
94.560 + */
94.561 + static boolean canPrimCast(MethodType newType, MethodType targetType,
94.562 + int arg, Class<?> convType) {
94.563 + if (!convOpSupported(OP_PRIM_TO_PRIM)) return false;
94.564 + Class<?> src = newType.parameterType(arg);
94.565 + Class<?> dst = targetType.parameterType(arg);
94.566 + if (!canPrimCast(src, convType)
94.567 + || !VerifyType.isNullConversion(convType, dst))
94.568 + return false;
94.569 + int diff = diffTypes(newType, targetType, false);
94.570 + return (diff == arg+1); // arg is sole non-trivial diff
94.571 + }
94.572 + /** Can an primitive conversion adapter validly convert src to dst? */
94.573 + static boolean canPrimCast(Class<?> src, Class<?> dst) {
94.574 + if (src == dst || !src.isPrimitive() || !dst.isPrimitive()) {
94.575 + return false;
94.576 + } else if (Wrapper.forPrimitiveType(dst).isFloating()) {
94.577 + // both must be floating types
94.578 + return Wrapper.forPrimitiveType(src).isFloating();
94.579 + } else {
94.580 + // both are integral, and all combinations work fine
94.581 + assert(Wrapper.forPrimitiveType(src).isIntegral() &&
94.582 + Wrapper.forPrimitiveType(dst).isIntegral());
94.583 + return true;
94.584 + }
94.585 + }
94.586 +
94.587 + /** Factory method: Truncate the given argument with zero or sign extension,
94.588 + * and/or convert between single and doubleword versions of integer or float.
94.589 + * The convType is the target of the conversion, and can be any type
94.590 + * with a null conversion to the corresponding target parameter.
94.591 + * Return null if this cannot be done.
94.592 + */
94.593 + static MethodHandle makePrimCast(MethodType newType, MethodHandle target,
94.594 + int arg, Class<?> convType) {
94.595 + MethodType oldType = target.type();
94.596 + if (!canPrimCast(newType, oldType, arg, convType))
94.597 + return null;
94.598 + Class<?> src = newType.parameterType(arg);
94.599 + long conv = makeConv(OP_PRIM_TO_PRIM, arg, basicType(src), basicType(convType));
94.600 + return new AdapterMethodHandle(target, newType, conv);
94.601 + }
94.602 +
94.603 + /** Can an unboxing conversion validly convert src to dst?
94.604 + * The JVM currently supports all kinds of casting and unboxing.
94.605 + * The convType is the unboxed type; it can be either a primitive or wrapper.
94.606 + */
94.607 + static boolean canUnboxArgument(MethodType newType, MethodType targetType,
94.608 + int arg, Class<?> convType) {
94.609 + if (!convOpSupported(OP_REF_TO_PRIM)) return false;
94.610 + Class<?> src = newType.parameterType(arg);
94.611 + Class<?> dst = targetType.parameterType(arg);
94.612 + Class<?> boxType = Wrapper.asWrapperType(convType);
94.613 + convType = Wrapper.asPrimitiveType(convType);
94.614 + if (!canCheckCast(src, boxType)
94.615 + || boxType == convType
94.616 + || !VerifyType.isNullConversion(convType, dst))
94.617 + return false;
94.618 + int diff = diffTypes(newType, targetType, false);
94.619 + return (diff == arg+1); // arg is sole non-trivial diff
94.620 + }
94.621 + /** Can an primitive unboxing adapter validly convert src to dst? */
94.622 + static boolean canUnboxArgument(Class<?> src, Class<?> dst) {
94.623 + return (!src.isPrimitive() && Wrapper.asPrimitiveType(dst).isPrimitive());
94.624 + }
94.625 +
94.626 + /** Factory method: Unbox the given argument.
94.627 + * Return null if this cannot be done.
94.628 + */
94.629 + static MethodHandle makeUnboxArgument(MethodType newType, MethodHandle target,
94.630 + int arg, Class<?> convType) {
94.631 + MethodType oldType = target.type();
94.632 + Class<?> src = newType.parameterType(arg);
94.633 + Class<?> dst = oldType.parameterType(arg);
94.634 + Class<?> boxType = Wrapper.asWrapperType(convType);
94.635 + Class<?> primType = Wrapper.asPrimitiveType(convType);
94.636 + if (!canUnboxArgument(newType, oldType, arg, convType))
94.637 + return null;
94.638 + MethodType castDone = newType;
94.639 + if (!VerifyType.isNullConversion(src, boxType))
94.640 + castDone = newType.changeParameterType(arg, boxType);
94.641 + long conv = makeConv(OP_REF_TO_PRIM, arg, T_OBJECT, basicType(primType));
94.642 + MethodHandle adapter = new AdapterMethodHandle(target, castDone, conv, boxType);
94.643 + if (castDone == newType)
94.644 + return adapter;
94.645 + return makeCheckCast(newType, adapter, arg, boxType);
94.646 + }
94.647 +
94.648 + /** Can an primitive boxing adapter validly convert src to dst? */
94.649 + static boolean canBoxArgument(Class<?> src, Class<?> dst) {
94.650 + if (!convOpSupported(OP_PRIM_TO_REF)) return false;
94.651 + throw new UnsupportedOperationException("NYI");
94.652 + }
94.653 +
94.654 + /** Factory method: Unbox the given argument.
94.655 + * Return null if this cannot be done.
94.656 + */
94.657 + static MethodHandle makeBoxArgument(MethodType newType, MethodHandle target,
94.658 + int arg, Class<?> convType) {
94.659 + // this is difficult to do in the JVM because it must GC
94.660 + return null;
94.661 + }
94.662 +
94.663 + /** Can an adapter simply drop arguments to convert the target to newType? */
94.664 + static boolean canDropArguments(MethodType newType, MethodType targetType,
94.665 + int dropArgPos, int dropArgCount) {
94.666 + if (dropArgCount == 0)
94.667 + return canRetypeOnly(newType, targetType);
94.668 + if (!convOpSupported(OP_DROP_ARGS)) return false;
94.669 + if (diffReturnTypes(newType, targetType, false) != 0)
94.670 + return false;
94.671 + int nptypes = newType.parameterCount();
94.672 + // parameter types must be the same up to the drop point
94.673 + if (dropArgPos != 0 && diffParamTypes(newType, 0, targetType, 0, dropArgPos, false) != 0)
94.674 + return false;
94.675 + int afterPos = dropArgPos + dropArgCount;
94.676 + int afterCount = nptypes - afterPos;
94.677 + if (dropArgPos < 0 || dropArgPos >= nptypes ||
94.678 + dropArgCount < 1 || afterPos > nptypes ||
94.679 + targetType.parameterCount() != nptypes - dropArgCount)
94.680 + return false;
94.681 + // parameter types after the drop point must also be the same
94.682 + if (afterCount != 0 && diffParamTypes(newType, afterPos, targetType, dropArgPos, afterCount, false) != 0)
94.683 + return false;
94.684 + return true;
94.685 + }
94.686 +
94.687 + /** Factory method: Drop selected arguments.
94.688 + * Allow unchecked retyping of remaining arguments, pairwise.
94.689 + * Return null if this is not possible.
94.690 + */
94.691 + static MethodHandle makeDropArguments(MethodType newType, MethodHandle target,
94.692 + int dropArgPos, int dropArgCount) {
94.693 + if (dropArgCount == 0)
94.694 + return makeRetypeOnly(newType, target);
94.695 + if (!canDropArguments(newType, target.type(), dropArgPos, dropArgCount))
94.696 + return null;
94.697 + // in arglist: [0: ...keep1 | dpos: drop... | dpos+dcount: keep2... ]
94.698 + // out arglist: [0: ...keep1 | dpos: keep2... ]
94.699 + int keep2InPos = dropArgPos + dropArgCount;
94.700 + int dropSlot = newType.parameterSlotDepth(keep2InPos);
94.701 + int keep1InSlot = newType.parameterSlotDepth(dropArgPos);
94.702 + int slotCount = keep1InSlot - dropSlot;
94.703 + assert(slotCount >= dropArgCount);
94.704 + assert(target.type().parameterSlotCount() + slotCount == newType.parameterSlotCount());
94.705 + long conv = makeConv(OP_DROP_ARGS, dropArgPos + dropArgCount - 1, -slotCount);
94.706 + return new AdapterMethodHandle(target, newType, conv);
94.707 + }
94.708 +
94.709 + /** Can an adapter duplicate an argument to convert the target to newType? */
94.710 + static boolean canDupArguments(MethodType newType, MethodType targetType,
94.711 + int dupArgPos, int dupArgCount) {
94.712 + if (!convOpSupported(OP_DUP_ARGS)) return false;
94.713 + if (diffReturnTypes(newType, targetType, false) != 0)
94.714 + return false;
94.715 + int nptypes = newType.parameterCount();
94.716 + if (dupArgCount < 0 || dupArgPos + dupArgCount > nptypes)
94.717 + return false;
94.718 + if (targetType.parameterCount() != nptypes + dupArgCount)
94.719 + return false;
94.720 + // parameter types must be the same up to the duplicated arguments
94.721 + if (diffParamTypes(newType, 0, targetType, 0, nptypes, false) != 0)
94.722 + return false;
94.723 + // duplicated types must be, well, duplicates
94.724 + if (diffParamTypes(newType, dupArgPos, targetType, nptypes, dupArgCount, false) != 0)
94.725 + return false;
94.726 + return true;
94.727 + }
94.728 +
94.729 + /** Factory method: Duplicate the selected argument.
94.730 + * Return null if this is not possible.
94.731 + */
94.732 + static MethodHandle makeDupArguments(MethodType newType, MethodHandle target,
94.733 + int dupArgPos, int dupArgCount) {
94.734 + if (!canDupArguments(newType, target.type(), dupArgPos, dupArgCount))
94.735 + return null;
94.736 + if (dupArgCount == 0)
94.737 + return target;
94.738 + // in arglist: [0: ...keep1 | dpos: dup... | dpos+dcount: keep2... ]
94.739 + // out arglist: [0: ...keep1 | dpos: dup... | dpos+dcount: keep2... | dup... ]
94.740 + int keep2InPos = dupArgPos + dupArgCount;
94.741 + int dupSlot = newType.parameterSlotDepth(keep2InPos);
94.742 + int keep1InSlot = newType.parameterSlotDepth(dupArgPos);
94.743 + int slotCount = keep1InSlot - dupSlot;
94.744 + assert(target.type().parameterSlotCount() - slotCount == newType.parameterSlotCount());
94.745 + long conv = makeConv(OP_DUP_ARGS, dupArgPos + dupArgCount - 1, slotCount);
94.746 + return new AdapterMethodHandle(target, newType, conv);
94.747 + }
94.748 +
94.749 + /** Can an adapter swap two arguments to convert the target to newType? */
94.750 + static boolean canSwapArguments(MethodType newType, MethodType targetType,
94.751 + int swapArg1, int swapArg2) {
94.752 + if (!convOpSupported(OP_SWAP_ARGS)) return false;
94.753 + if (diffReturnTypes(newType, targetType, false) != 0)
94.754 + return false;
94.755 + if (swapArg1 >= swapArg2) return false; // caller resp
94.756 + int nptypes = newType.parameterCount();
94.757 + if (targetType.parameterCount() != nptypes)
94.758 + return false;
94.759 + if (swapArg1 < 0 || swapArg2 >= nptypes)
94.760 + return false;
94.761 + if (diffParamTypes(newType, 0, targetType, 0, swapArg1, false) != 0)
94.762 + return false;
94.763 + if (diffParamTypes(newType, swapArg1, targetType, swapArg2, 1, false) != 0)
94.764 + return false;
94.765 + if (diffParamTypes(newType, swapArg1+1, targetType, swapArg1+1, swapArg2-swapArg1-1, false) != 0)
94.766 + return false;
94.767 + if (diffParamTypes(newType, swapArg2, targetType, swapArg1, 1, false) != 0)
94.768 + return false;
94.769 + if (diffParamTypes(newType, swapArg2+1, targetType, swapArg2+1, nptypes-swapArg2-1, false) != 0)
94.770 + return false;
94.771 + return true;
94.772 + }
94.773 +
94.774 + /** Factory method: Swap the selected arguments.
94.775 + * Return null if this is not possible.
94.776 + */
94.777 + static MethodHandle makeSwapArguments(MethodType newType, MethodHandle target,
94.778 + int swapArg1, int swapArg2) {
94.779 + if (swapArg1 == swapArg2)
94.780 + return target;
94.781 + if (swapArg1 > swapArg2) { int t = swapArg1; swapArg1 = swapArg2; swapArg2 = t; }
94.782 + if (!canSwapArguments(newType, target.type(), swapArg1, swapArg2))
94.783 + return null;
94.784 + Class<?> swapType = newType.parameterType(swapArg1);
94.785 + // in arglist: [0: ...keep1 | pos1: a1 | pos1+1: keep2... | pos2: a2 | pos2+1: keep3... ]
94.786 + // out arglist: [0: ...keep1 | pos1: a2 | pos1+1: keep2... | pos2: a1 | pos2+1: keep3... ]
94.787 + int swapSlot2 = newType.parameterSlotDepth(swapArg2 + 1);
94.788 + long conv = makeSwapConv(OP_SWAP_ARGS, swapArg1, basicType(swapType), swapSlot2);
94.789 + return new AdapterMethodHandle(target, newType, conv);
94.790 + }
94.791 +
94.792 + static int positiveRotation(int argCount, int rotateBy) {
94.793 + assert(argCount > 0);
94.794 + if (rotateBy >= 0) {
94.795 + if (rotateBy < argCount)
94.796 + return rotateBy;
94.797 + return rotateBy % argCount;
94.798 + } else if (rotateBy >= -argCount) {
94.799 + return rotateBy + argCount;
94.800 + } else {
94.801 + return (-1-((-1-rotateBy) % argCount)) + argCount;
94.802 + }
94.803 + }
94.804 +
94.805 + final static int MAX_ARG_ROTATION = 1;
94.806 +
94.807 + /** Can an adapter rotate arguments to convert the target to newType? */
94.808 + static boolean canRotateArguments(MethodType newType, MethodType targetType,
94.809 + int firstArg, int argCount, int rotateBy) {
94.810 + if (!convOpSupported(OP_ROT_ARGS)) return false;
94.811 + if (argCount <= 2) return false; // must be a swap, not a rotate
94.812 + rotateBy = positiveRotation(argCount, rotateBy);
94.813 + if (rotateBy == 0) return false; // no rotation
94.814 + if (rotateBy > MAX_ARG_ROTATION && rotateBy < argCount - MAX_ARG_ROTATION)
94.815 + return false; // too many argument positions
94.816 + // Rotate incoming args right N to the out args, N in 1..(argCouunt-1).
94.817 + if (diffReturnTypes(newType, targetType, false) != 0)
94.818 + return false;
94.819 + int nptypes = newType.parameterCount();
94.820 + if (targetType.parameterCount() != nptypes)
94.821 + return false;
94.822 + if (firstArg < 0 || firstArg >= nptypes) return false;
94.823 + int argLimit = firstArg + argCount;
94.824 + if (argLimit > nptypes) return false;
94.825 + if (diffParamTypes(newType, 0, targetType, 0, firstArg, false) != 0)
94.826 + return false;
94.827 + int newChunk1 = argCount - rotateBy, newChunk2 = rotateBy;
94.828 + // swap new chunk1 with target chunk2
94.829 + if (diffParamTypes(newType, firstArg, targetType, argLimit-newChunk1, newChunk1, false) != 0)
94.830 + return false;
94.831 + // swap new chunk2 with target chunk1
94.832 + if (diffParamTypes(newType, firstArg+newChunk1, targetType, firstArg, newChunk2, false) != 0)
94.833 + return false;
94.834 + return true;
94.835 + }
94.836 +
94.837 + /** Factory method: Rotate the selected argument range.
94.838 + * Return null if this is not possible.
94.839 + */
94.840 + static MethodHandle makeRotateArguments(MethodType newType, MethodHandle target,
94.841 + int firstArg, int argCount, int rotateBy) {
94.842 + rotateBy = positiveRotation(argCount, rotateBy);
94.843 + if (!canRotateArguments(newType, target.type(), firstArg, argCount, rotateBy))
94.844 + return null;
94.845 + // Decide whether it should be done as a right or left rotation,
94.846 + // on the JVM stack. Return the number of stack slots to rotate by,
94.847 + // positive if right, negative if left.
94.848 + int limit = firstArg + argCount;
94.849 + int depth0 = newType.parameterSlotDepth(firstArg);
94.850 + int depth1 = newType.parameterSlotDepth(limit-rotateBy);
94.851 + int depth2 = newType.parameterSlotDepth(limit);
94.852 + int chunk1Slots = depth0 - depth1; assert(chunk1Slots > 0);
94.853 + int chunk2Slots = depth1 - depth2; assert(chunk2Slots > 0);
94.854 + // From here on out, it assumes a single-argument shift.
94.855 + assert(MAX_ARG_ROTATION == 1);
94.856 + int srcArg, dstArg;
94.857 + byte basicType;
94.858 + if (chunk2Slots <= chunk1Slots) {
94.859 + // Rotate right/down N (rotateBy = +N, N small, c2 small):
94.860 + // in arglist: [0: ...keep1 | arg1: c1... | limit-N: c2 | limit: keep2... ]
94.861 + // out arglist: [0: ...keep1 | arg1: c2 | arg1+N: c1... | limit: keep2... ]
94.862 + srcArg = limit-1;
94.863 + dstArg = firstArg;
94.864 + basicType = basicType(newType.parameterType(srcArg));
94.865 + assert(chunk2Slots == type2size(basicType));
94.866 + } else {
94.867 + // Rotate left/up N (rotateBy = -N, N small, c1 small):
94.868 + // in arglist: [0: ...keep1 | arg1: c1 | arg1+N: c2... | limit: keep2... ]
94.869 + // out arglist: [0: ...keep1 | arg1: c2 ... | limit-N: c1 | limit: keep2... ]
94.870 + srcArg = firstArg;
94.871 + dstArg = limit-1;
94.872 + basicType = basicType(newType.parameterType(srcArg));
94.873 + assert(chunk1Slots == type2size(basicType));
94.874 + }
94.875 + int dstSlot = newType.parameterSlotDepth(dstArg + 1);
94.876 + long conv = makeSwapConv(OP_ROT_ARGS, srcArg, basicType, dstSlot);
94.877 + return new AdapterMethodHandle(target, newType, conv);
94.878 + }
94.879 +
94.880 + /** Can an adapter spread an argument to convert the target to newType? */
94.881 + static boolean canSpreadArguments(MethodType newType, MethodType targetType,
94.882 + Class<?> spreadArgType, int spreadArgPos, int spreadArgCount) {
94.883 + if (!convOpSupported(OP_SPREAD_ARGS)) return false;
94.884 + if (diffReturnTypes(newType, targetType, false) != 0)
94.885 + return false;
94.886 + int nptypes = newType.parameterCount();
94.887 + // parameter types must be the same up to the spread point
94.888 + if (spreadArgPos != 0 && diffParamTypes(newType, 0, targetType, 0, spreadArgPos, false) != 0)
94.889 + return false;
94.890 + int afterPos = spreadArgPos + spreadArgCount;
94.891 + int afterCount = nptypes - (spreadArgPos + 1);
94.892 + if (spreadArgPos < 0 || spreadArgPos >= nptypes ||
94.893 + spreadArgCount < 0 ||
94.894 + targetType.parameterCount() != afterPos + afterCount)
94.895 + return false;
94.896 + // parameter types after the spread point must also be the same
94.897 + if (afterCount != 0 && diffParamTypes(newType, spreadArgPos+1, targetType, afterPos, afterCount, false) != 0)
94.898 + return false;
94.899 + // match the array element type to the spread arg types
94.900 + Class<?> rawSpreadArgType = newType.parameterType(spreadArgPos);
94.901 + if (rawSpreadArgType != spreadArgType && !canCheckCast(rawSpreadArgType, spreadArgType))
94.902 + return false;
94.903 + for (int i = 0; i < spreadArgCount; i++) {
94.904 + Class<?> src = VerifyType.spreadArgElementType(spreadArgType, i);
94.905 + Class<?> dst = targetType.parameterType(spreadArgPos + i);
94.906 + if (src == null || !VerifyType.isNullConversion(src, dst))
94.907 + return false;
94.908 + }
94.909 + return true;
94.910 + }
94.911 +
94.912 +
94.913 + /** Factory method: Spread selected argument. */
94.914 + static MethodHandle makeSpreadArguments(MethodType newType, MethodHandle target,
94.915 + Class<?> spreadArgType, int spreadArgPos, int spreadArgCount) {
94.916 + MethodType targetType = target.type();
94.917 + if (!canSpreadArguments(newType, targetType, spreadArgType, spreadArgPos, spreadArgCount))
94.918 + return null;
94.919 + // in arglist: [0: ...keep1 | spos: spreadArg | spos+1: keep2... ]
94.920 + // out arglist: [0: ...keep1 | spos: spread... | spos+scount: keep2... ]
94.921 + int keep2OutPos = spreadArgPos + spreadArgCount;
94.922 + int spreadSlot = targetType.parameterSlotDepth(keep2OutPos);
94.923 + int keep1OutSlot = targetType.parameterSlotDepth(spreadArgPos);
94.924 + int slotCount = keep1OutSlot - spreadSlot;
94.925 + assert(spreadSlot == newType.parameterSlotDepth(spreadArgPos+1));
94.926 + assert(slotCount >= spreadArgCount);
94.927 + long conv = makeConv(OP_SPREAD_ARGS, spreadArgPos, slotCount-1);
94.928 + MethodHandle res = new AdapterMethodHandle(target, newType, conv, spreadArgType);
94.929 + assert(res.type().parameterType(spreadArgPos) == spreadArgType);
94.930 + return res;
94.931 + }
94.932 +
94.933 + // TO DO: makeCollectArguments, makeFlyby, makeRicochet
94.934 +
94.935 + @Override
94.936 + public String toString() {
94.937 + return getNameString(nonAdapter((MethodHandle)vmtarget), this);
94.938 + }
94.939 +
94.940 + private static MethodHandle nonAdapter(MethodHandle mh) {
94.941 + while (mh instanceof AdapterMethodHandle) {
94.942 + mh = (MethodHandle) mh.vmtarget;
94.943 + }
94.944 + return mh;
94.945 + }
94.946 +}
95.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
95.2 +++ b/src/share/classes/java/lang/invoke/BoundMethodHandle.java Tue Mar 29 20:19:55 2011 -0700
95.3 @@ -0,0 +1,188 @@
95.4 +/*
95.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
95.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
95.7 + *
95.8 + * This code is free software; you can redistribute it and/or modify it
95.9 + * under the terms of the GNU General Public License version 2 only, as
95.10 + * published by the Free Software Foundation. Oracle designates this
95.11 + * particular file as subject to the "Classpath" exception as provided
95.12 + * by Oracle in the LICENSE file that accompanied this code.
95.13 + *
95.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
95.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
95.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
95.17 + * version 2 for more details (a copy is included in the LICENSE file that
95.18 + * accompanied this code).
95.19 + *
95.20 + * You should have received a copy of the GNU General Public License version
95.21 + * 2 along with this work; if not, write to the Free Software Foundation,
95.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
95.23 + *
95.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
95.25 + * or visit www.oracle.com if you need additional information or have any
95.26 + * questions.
95.27 + */
95.28 +
95.29 +package java.lang.invoke;
95.30 +
95.31 +import sun.invoke.util.VerifyType;
95.32 +import sun.invoke.util.Wrapper;
95.33 +import static java.lang.invoke.MethodHandleStatics.*;
95.34 +
95.35 +/**
95.36 + * The flavor of method handle which emulates an invoke instruction
95.37 + * on a predetermined argument. The JVM dispatches to the correct method
95.38 + * when the handle is created, not when it is invoked.
95.39 + * @author jrose
95.40 + */
95.41 +class BoundMethodHandle extends MethodHandle {
95.42 + //MethodHandle vmtarget; // next BMH or final DMH or methodOop
95.43 + private final Object argument; // argument to insert
95.44 + private final int vmargslot; // position at which it is inserted
95.45 +
95.46 + // Constructors in this class *must* be package scoped or private.
95.47 +
95.48 + /** Bind a direct MH to its receiver (or first ref. argument).
95.49 + * The JVM will pre-dispatch the MH if it is not already static.
95.50 + */
95.51 + /*non-public*/ BoundMethodHandle(DirectMethodHandle mh, Object argument) {
95.52 + super(mh.type().dropParameterTypes(0, 1));
95.53 + // check the type now, once for all:
95.54 + this.argument = checkReferenceArgument(argument, mh, 0);
95.55 + this.vmargslot = this.type().parameterSlotCount();
95.56 + initTarget(mh, 0);
95.57 + }
95.58 +
95.59 + /** Insert an argument into an arbitrary method handle.
95.60 + * If argnum is zero, inserts the first argument, etc.
95.61 + * The argument type must be a reference.
95.62 + */
95.63 + /*non-public*/ BoundMethodHandle(MethodHandle mh, Object argument, int argnum) {
95.64 + this(mh.type().dropParameterTypes(argnum, argnum+1),
95.65 + mh, argument, argnum);
95.66 + }
95.67 +
95.68 + /** Insert an argument into an arbitrary method handle.
95.69 + * If argnum is zero, inserts the first argument, etc.
95.70 + */
95.71 + /*non-public*/ BoundMethodHandle(MethodType type, MethodHandle mh, Object argument, int argnum) {
95.72 + super(type);
95.73 + if (mh.type().parameterType(argnum).isPrimitive())
95.74 + this.argument = bindPrimitiveArgument(argument, mh, argnum);
95.75 + else {
95.76 + this.argument = checkReferenceArgument(argument, mh, argnum);
95.77 + }
95.78 + this.vmargslot = type.parameterSlotDepth(argnum);
95.79 + initTarget(mh, argnum);
95.80 + }
95.81 +
95.82 + private void initTarget(MethodHandle mh, int argnum) {
95.83 + //this.vmtarget = mh; // maybe updated by JVM
95.84 + MethodHandleNatives.init(this, mh, argnum);
95.85 + }
95.86 +
95.87 + /** For the AdapterMethodHandle subclass.
95.88 + */
95.89 + /*non-public*/ BoundMethodHandle(MethodType type, Object argument, int vmargslot) {
95.90 + super(type);
95.91 + this.argument = argument;
95.92 + this.vmargslot = vmargslot;
95.93 + assert(this instanceof AdapterMethodHandle);
95.94 + }
95.95 +
95.96 + /** Initialize the current object as a self-bound method handle, binding it
95.97 + * as the first argument of the method handle {@code entryPoint}.
95.98 + * The invocation type of the resulting method handle will be the
95.99 + * same as {@code entryPoint}, except that the first argument
95.100 + * type will be dropped.
95.101 + */
95.102 + /*non-public*/ BoundMethodHandle(MethodHandle entryPoint) {
95.103 + super(entryPoint.type().dropParameterTypes(0, 1));
95.104 + this.argument = this; // kludge; get rid of
95.105 + this.vmargslot = this.type().parameterSlotDepth(0);
95.106 + initTarget(entryPoint, 0);
95.107 + }
95.108 +
95.109 + /** Make sure the given {@code argument} can be used as {@code argnum}-th
95.110 + * parameter of the given method handle {@code mh}, which must be a reference.
95.111 + * <p>
95.112 + * If this fails, throw a suitable {@code WrongMethodTypeException},
95.113 + * which will prevent the creation of an illegally typed bound
95.114 + * method handle.
95.115 + */
95.116 + final static Object checkReferenceArgument(Object argument, MethodHandle mh, int argnum) {
95.117 + Class<?> ptype = mh.type().parameterType(argnum);
95.118 + if (ptype.isPrimitive()) {
95.119 + // fail
95.120 + } else if (argument == null) {
95.121 + return null;
95.122 + } else if (VerifyType.isNullReferenceConversion(argument.getClass(), ptype)) {
95.123 + return argument;
95.124 + }
95.125 + throw badBoundArgumentException(argument, mh, argnum);
95.126 + }
95.127 +
95.128 + /** Make sure the given {@code argument} can be used as {@code argnum}-th
95.129 + * parameter of the given method handle {@code mh}, which must be a primitive.
95.130 + * <p>
95.131 + * If this fails, throw a suitable {@code WrongMethodTypeException},
95.132 + * which will prevent the creation of an illegally typed bound
95.133 + * method handle.
95.134 + */
95.135 + final static Object bindPrimitiveArgument(Object argument, MethodHandle mh, int argnum) {
95.136 + Class<?> ptype = mh.type().parameterType(argnum);
95.137 + Wrapper wrap = Wrapper.forPrimitiveType(ptype);
95.138 + Object zero = wrap.zero();
95.139 + if (zero == null) {
95.140 + // fail
95.141 + } else if (argument == null) {
95.142 + if (ptype != int.class && wrap.isSubwordOrInt())
95.143 + return Integer.valueOf(0);
95.144 + else
95.145 + return zero;
95.146 + } else if (VerifyType.isNullReferenceConversion(argument.getClass(), zero.getClass())) {
95.147 + if (ptype != int.class && wrap.isSubwordOrInt())
95.148 + return Wrapper.INT.wrap(argument);
95.149 + else
95.150 + return argument;
95.151 + }
95.152 + throw badBoundArgumentException(argument, mh, argnum);
95.153 + }
95.154 +
95.155 + final static RuntimeException badBoundArgumentException(Object argument, MethodHandle mh, int argnum) {
95.156 + String atype = (argument == null) ? "null" : argument.getClass().toString();
95.157 + return new WrongMethodTypeException("cannot bind "+atype+" argument to parameter #"+argnum+" of "+mh.type());
95.158 + }
95.159 +
95.160 + @Override
95.161 + public String toString() {
95.162 + return addTypeString(baseName(), this);
95.163 + }
95.164 +
95.165 + /** Component of toString() before the type string. */
95.166 + protected String baseName() {
95.167 + MethodHandle mh = this;
95.168 + while (mh instanceof BoundMethodHandle) {
95.169 + Object info = MethodHandleNatives.getTargetInfo(mh);
95.170 + if (info instanceof MethodHandle) {
95.171 + mh = (MethodHandle) info;
95.172 + } else {
95.173 + String name = null;
95.174 + if (info instanceof MemberName)
95.175 + name = ((MemberName)info).getName();
95.176 + if (name != null)
95.177 + return name;
95.178 + else
95.179 + return noParens(super.toString()); // "invoke", probably
95.180 + }
95.181 + assert(mh != this);
95.182 + }
95.183 + return noParens(mh.toString());
95.184 + }
95.185 +
95.186 + private static String noParens(String str) {
95.187 + int paren = str.indexOf('(');
95.188 + if (paren >= 0) str = str.substring(0, paren);
95.189 + return str;
95.190 + }
95.191 +}
96.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
96.2 +++ b/src/share/classes/java/lang/invoke/CallSite.java Tue Mar 29 20:19:55 2011 -0700
96.3 @@ -0,0 +1,323 @@
96.4 +/*
96.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
96.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
96.7 + *
96.8 + * This code is free software; you can redistribute it and/or modify it
96.9 + * under the terms of the GNU General Public License version 2 only, as
96.10 + * published by the Free Software Foundation. Oracle designates this
96.11 + * particular file as subject to the "Classpath" exception as provided
96.12 + * by Oracle in the LICENSE file that accompanied this code.
96.13 + *
96.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
96.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
96.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
96.17 + * version 2 for more details (a copy is included in the LICENSE file that
96.18 + * accompanied this code).
96.19 + *
96.20 + * You should have received a copy of the GNU General Public License version
96.21 + * 2 along with this work; if not, write to the Free Software Foundation,
96.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
96.23 + *
96.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
96.25 + * or visit www.oracle.com if you need additional information or have any
96.26 + * questions.
96.27 + */
96.28 +
96.29 +package java.lang.invoke;
96.30 +
96.31 +import sun.invoke.empty.Empty;
96.32 +import sun.misc.Unsafe;
96.33 +import static java.lang.invoke.MethodHandleStatics.*;
96.34 +import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
96.35 +
96.36 +/**
96.37 + * A {@code CallSite} is a holder for a variable {@link MethodHandle},
96.38 + * which is called its {@code target}.
96.39 + * An {@code invokedynamic} instruction linked to a {@code CallSite} delegates
96.40 + * all calls to the site's current target.
96.41 + * A {@code CallSite} may be associated with several {@code invokedynamic}
96.42 + * instructions, or it may be "free floating", associated with none.
96.43 + * In any case, it may be invoked through an associated method handle
96.44 + * called its {@linkplain #dynamicInvoker dynamic invoker}.
96.45 + * <p>
96.46 + * {@code CallSite} is an abstract class which does not allow
96.47 + * direct subclassing by users. It has three immediate,
96.48 + * concrete subclasses that may be either instantiated or subclassed.
96.49 + * <ul>
96.50 + * <li>If a mutable target is not required, an {@code invokedynamic} instruction
96.51 + * may be permanently bound by means of a {@linkplain ConstantCallSite constant call site}.
96.52 + * <li>If a mutable target is required which has volatile variable semantics,
96.53 + * because updates to the target must be immediately and reliably witnessed by other threads,
96.54 + * a {@linkplain VolatileCallSite volatile call site} may be used.
96.55 + * <li>Otherwise, if a mutable target is required,
96.56 + * a {@linkplain MutableCallSite mutable call site} may be used.
96.57 + * </ul>
96.58 + * <p>
96.59 + * A non-constant call site may be <em>relinked</em> by changing its target.
96.60 + * The new target must have the same {@linkplain MethodHandle#type() type}
96.61 + * as the previous target.
96.62 + * Thus, though a call site can be relinked to a series of
96.63 + * successive targets, it cannot change its type.
96.64 + * <p>
96.65 + * Here is a sample use of call sites and bootstrap methods which links every
96.66 + * dynamic call site to print its arguments:
96.67 +<blockquote><pre><!-- see indy-demo/src/PrintArgsDemo.java -->
96.68 +static void test() throws Throwable {
96.69 + // THE FOLLOWING LINE IS PSEUDOCODE FOR A JVM INSTRUCTION
96.70 + InvokeDynamic[#bootstrapDynamic].baz("baz arg", 2, 3.14);
96.71 +}
96.72 +private static void printArgs(Object... args) {
96.73 + System.out.println(java.util.Arrays.deepToString(args));
96.74 +}
96.75 +private static final MethodHandle printArgs;
96.76 +static {
96.77 + MethodHandles.Lookup lookup = MethodHandles.lookup();
96.78 + Class thisClass = lookup.lookupClass(); // (who am I?)
96.79 + printArgs = lookup.findStatic(thisClass,
96.80 + "printArgs", MethodType.methodType(void.class, Object[].class));
96.81 +}
96.82 +private static CallSite bootstrapDynamic(MethodHandles.Lookup caller, String name, MethodType type) {
96.83 + // ignore caller and name, but match the type:
96.84 + return new ConstantCallSite(printArgs.asType(type));
96.85 +}
96.86 +</pre></blockquote>
96.87 + * @author John Rose, JSR 292 EG
96.88 + */
96.89 +abstract
96.90 +public class CallSite {
96.91 + static { MethodHandleImpl.initStatics(); }
96.92 +
96.93 + // Fields used only by the JVM. Do not use or change.
96.94 + private MemberName vmmethod; // supplied by the JVM (ref. to calling method)
96.95 + private int vmindex; // supplied by the JVM (BCI within calling method)
96.96 +
96.97 + // The actual payload of this call site:
96.98 + /*package-private*/
96.99 + MethodHandle target;
96.100 +
96.101 + /**
96.102 + * Make a blank call site object with the given method type.
96.103 + * An initial target method is supplied which will throw
96.104 + * an {@link IllegalStateException} if called.
96.105 + * <p>
96.106 + * Before this {@code CallSite} object is returned from a bootstrap method,
96.107 + * it is usually provided with a more useful target method,
96.108 + * via a call to {@link CallSite#setTarget(MethodHandle) setTarget}.
96.109 + * @throws NullPointerException if the proposed type is null
96.110 + */
96.111 + /*package-private*/
96.112 + CallSite(MethodType type) {
96.113 + target = type.invokers().uninitializedCallSite();
96.114 + }
96.115 +
96.116 + /**
96.117 + * Make a blank call site object, possibly equipped with an initial target method handle.
96.118 + * @param target the method handle which will be the initial target of the call site
96.119 + * @throws NullPointerException if the proposed target is null
96.120 + */
96.121 + /*package-private*/
96.122 + CallSite(MethodHandle target) {
96.123 + target.type(); // null check
96.124 + this.target = target;
96.125 + }
96.126 +
96.127 + /**
96.128 + * Returns the type of this call site's target.
96.129 + * Although targets may change, any call site's type is permanent, and can never change to an unequal type.
96.130 + * The {@code setTarget} method enforces this invariant by refusing any new target that does
96.131 + * not have the previous target's type.
96.132 + * @return the type of the current target, which is also the type of any future target
96.133 + */
96.134 + public MethodType type() {
96.135 + return target.type();
96.136 + }
96.137 +
96.138 + /** Called from JVM (or low-level Java code) after the BSM returns the newly created CallSite.
96.139 + * The parameters are JVM-specific.
96.140 + */
96.141 + void initializeFromJVM(String name,
96.142 + MethodType type,
96.143 + MemberName callerMethod,
96.144 + int callerBCI) {
96.145 + if (this.vmmethod != null) {
96.146 + // FIXME
96.147 + throw new BootstrapMethodError("call site has already been linked to an invokedynamic instruction");
96.148 + }
96.149 + if (!this.type().equals(type)) {
96.150 + throw wrongTargetType(target, type);
96.151 + }
96.152 + this.vmindex = callerBCI;
96.153 + this.vmmethod = callerMethod;
96.154 + }
96.155 +
96.156 + /**
96.157 + * Returns the target method of the call site, according to the
96.158 + * behavior defined by this call site's specific class.
96.159 + * The immediate subclasses of {@code CallSite} document the
96.160 + * class-specific behaviors of this method.
96.161 + *
96.162 + * @return the current linkage state of the call site, its target method handle
96.163 + * @see ConstantCallSite
96.164 + * @see VolatileCallSite
96.165 + * @see #setTarget
96.166 + * @see ConstantCallSite#getTarget
96.167 + * @see MutableCallSite#getTarget
96.168 + * @see VolatileCallSite#getTarget
96.169 + */
96.170 + public abstract MethodHandle getTarget();
96.171 +
96.172 + /**
96.173 + * Updates the target method of this call site, according to the
96.174 + * behavior defined by this call site's specific class.
96.175 + * The immediate subclasses of {@code CallSite} document the
96.176 + * class-specific behaviors of this method.
96.177 + * <p>
96.178 + * The type of the new target must be {@linkplain MethodType#equals equal to}
96.179 + * the type of the old target.
96.180 + *
96.181 + * @param newTarget the new target
96.182 + * @throws NullPointerException if the proposed new target is null
96.183 + * @throws WrongMethodTypeException if the proposed new target
96.184 + * has a method type that differs from the previous target
96.185 + * @see CallSite#getTarget
96.186 + * @see ConstantCallSite#setTarget
96.187 + * @see MutableCallSite#setTarget
96.188 + * @see VolatileCallSite#setTarget
96.189 + */
96.190 + public abstract void setTarget(MethodHandle newTarget);
96.191 +
96.192 + void checkTargetChange(MethodHandle oldTarget, MethodHandle newTarget) {
96.193 + MethodType oldType = oldTarget.type();
96.194 + MethodType newType = newTarget.type(); // null check!
96.195 + if (!newType.equals(oldType))
96.196 + throw wrongTargetType(newTarget, oldType);
96.197 + }
96.198 +
96.199 + private static WrongMethodTypeException wrongTargetType(MethodHandle target, MethodType type) {
96.200 + return new WrongMethodTypeException(String.valueOf(target)+" should be of type "+type);
96.201 + }
96.202 +
96.203 + /**
96.204 + * Produces a method handle equivalent to an invokedynamic instruction
96.205 + * which has been linked to this call site.
96.206 + * <p>
96.207 + * This method is equivalent to the following code:
96.208 + * <blockquote><pre>
96.209 + * MethodHandle getTarget, invoker, result;
96.210 + * getTarget = MethodHandles.publicLookup().bind(this, "getTarget", MethodType.methodType(MethodHandle.class));
96.211 + * invoker = MethodHandles.exactInvoker(this.type());
96.212 + * result = MethodHandles.foldArguments(invoker, getTarget)
96.213 + * </pre></blockquote>
96.214 + *
96.215 + * @return a method handle which always invokes this call site's current target
96.216 + */
96.217 + public abstract MethodHandle dynamicInvoker();
96.218 +
96.219 + /*non-public*/ MethodHandle makeDynamicInvoker() {
96.220 + MethodHandle getTarget = MethodHandleImpl.bindReceiver(GET_TARGET, this);
96.221 + MethodHandle invoker = MethodHandles.exactInvoker(this.type());
96.222 + return MethodHandles.foldArguments(invoker, getTarget);
96.223 + }
96.224 +
96.225 + private static final MethodHandle GET_TARGET;
96.226 + static {
96.227 + try {
96.228 + GET_TARGET = IMPL_LOOKUP.
96.229 + findVirtual(CallSite.class, "getTarget", MethodType.methodType(MethodHandle.class));
96.230 + } catch (ReflectiveOperationException ignore) {
96.231 + throw new InternalError();
96.232 + }
96.233 + }
96.234 +
96.235 + /** This guy is rolled into the default target if a MethodType is supplied to the constructor. */
96.236 + /*package-private*/
96.237 + static Empty uninitializedCallSite() {
96.238 + throw new IllegalStateException("uninitialized call site");
96.239 + }
96.240 +
96.241 + // unsafe stuff:
96.242 + private static final Unsafe unsafe = Unsafe.getUnsafe();
96.243 + private static final long TARGET_OFFSET;
96.244 +
96.245 + static {
96.246 + try {
96.247 + TARGET_OFFSET = unsafe.objectFieldOffset(CallSite.class.getDeclaredField("target"));
96.248 + } catch (Exception ex) { throw new Error(ex); }
96.249 + }
96.250 +
96.251 + /*package-private*/
96.252 + void setTargetNormal(MethodHandle newTarget) {
96.253 + target = newTarget;
96.254 + }
96.255 + /*package-private*/
96.256 + MethodHandle getTargetVolatile() {
96.257 + return (MethodHandle) unsafe.getObjectVolatile(this, TARGET_OFFSET);
96.258 + }
96.259 + /*package-private*/
96.260 + void setTargetVolatile(MethodHandle newTarget) {
96.261 + unsafe.putObjectVolatile(this, TARGET_OFFSET, newTarget);
96.262 + }
96.263 +
96.264 + // this implements the upcall from the JVM, MethodHandleNatives.makeDynamicCallSite:
96.265 + static CallSite makeSite(MethodHandle bootstrapMethod,
96.266 + // Callee information:
96.267 + String name, MethodType type,
96.268 + // Extra arguments for BSM, if any:
96.269 + Object info,
96.270 + // Caller information:
96.271 + MemberName callerMethod, int callerBCI) {
96.272 + Class<?> callerClass = callerMethod.getDeclaringClass();
96.273 + Object caller = IMPL_LOOKUP.in(callerClass);
96.274 + CallSite site;
96.275 + try {
96.276 + Object binding;
96.277 + info = maybeReBox(info);
96.278 + if (info == null) {
96.279 + binding = bootstrapMethod.invokeGeneric(caller, name, type);
96.280 + } else if (!info.getClass().isArray()) {
96.281 + binding = bootstrapMethod.invokeGeneric(caller, name, type, info);
96.282 + } else {
96.283 + Object[] argv = (Object[]) info;
96.284 + maybeReBoxElements(argv);
96.285 + if (3 + argv.length > 255)
96.286 + throw new BootstrapMethodError("too many bootstrap method arguments");
96.287 + MethodType bsmType = bootstrapMethod.type();
96.288 + if (bsmType.parameterCount() == 4 && bsmType.parameterType(3) == Object[].class)
96.289 + binding = bootstrapMethod.invokeGeneric(caller, name, type, argv);
96.290 + else
96.291 + binding = MethodHandles.spreadInvoker(bsmType, 3)
96.292 + .invokeGeneric(bootstrapMethod, caller, name, type, argv);
96.293 + }
96.294 + //System.out.println("BSM for "+name+type+" => "+binding);
96.295 + if (binding instanceof CallSite) {
96.296 + site = (CallSite) binding;
96.297 + } else {
96.298 + throw new ClassCastException("bootstrap method failed to produce a CallSite");
96.299 + }
96.300 + assert(site.getTarget() != null);
96.301 + assert(site.getTarget().type().equals(type));
96.302 + } catch (Throwable ex) {
96.303 + BootstrapMethodError bex;
96.304 + if (ex instanceof BootstrapMethodError)
96.305 + bex = (BootstrapMethodError) ex;
96.306 + else
96.307 + bex = new BootstrapMethodError("call site initialization exception", ex);
96.308 + throw bex;
96.309 + }
96.310 + return site;
96.311 + }
96.312 +
96.313 + private static Object maybeReBox(Object x) {
96.314 + if (x instanceof Integer) {
96.315 + int xi = (int) x;
96.316 + if (xi == (byte) xi)
96.317 + x = xi; // must rebox; see JLS 5.1.7
96.318 + }
96.319 + return x;
96.320 + }
96.321 + private static void maybeReBoxElements(Object[] xa) {
96.322 + for (int i = 0; i < xa.length; i++) {
96.323 + xa[i] = maybeReBox(xa[i]);
96.324 + }
96.325 + }
96.326 +}
97.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
97.2 +++ b/src/share/classes/java/lang/invoke/ConstantCallSite.java Tue Mar 29 20:19:55 2011 -0700
97.3 @@ -0,0 +1,77 @@
97.4 +/*
97.5 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
97.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
97.7 + *
97.8 + * This code is free software; you can redistribute it and/or modify it
97.9 + * under the terms of the GNU General Public License version 2 only, as
97.10 + * published by the Free Software Foundation. Oracle designates this
97.11 + * particular file as subject to the "Classpath" exception as provided
97.12 + * by Oracle in the LICENSE file that accompanied this code.
97.13 + *
97.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
97.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
97.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
97.17 + * version 2 for more details (a copy is included in the LICENSE file that
97.18 + * accompanied this code).
97.19 + *
97.20 + * You should have received a copy of the GNU General Public License version
97.21 + * 2 along with this work; if not, write to the Free Software Foundation,
97.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
97.23 + *
97.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
97.25 + * or visit www.oracle.com if you need additional information or have any
97.26 + * questions.
97.27 + */
97.28 +
97.29 +package java.lang.invoke;
97.30 +
97.31 +/**
97.32 + * A {@code ConstantCallSite} is a {@link CallSite} whose target is permanent, and can never be changed.
97.33 + * An {@code invokedynamic} instruction linked to a {@code ConstantCallSite} is permanently
97.34 + * bound to the call site's target.
97.35 + * @author John Rose, JSR 292 EG
97.36 + */
97.37 +public class ConstantCallSite extends CallSite {
97.38 + /**
97.39 + * Creates a call site with a permanent target.
97.40 + * @param target the target to be permanently associated with this call site
97.41 + * @throws NullPointerException if the proposed target is null
97.42 + */
97.43 + public ConstantCallSite(MethodHandle target) {
97.44 + super(target);
97.45 + }
97.46 +
97.47 + /**
97.48 + * Returns the target method of the call site, which behaves
97.49 + * like a {@code final} field of the {@code ConstantCallSite}.
97.50 + * That is, the the target is always the original value passed
97.51 + * to the constructor call which created this instance.
97.52 + *
97.53 + * @return the immutable linkage state of this call site, a constant method handle
97.54 + * @throws UnsupportedOperationException because this kind of call site cannot change its target
97.55 + */
97.56 + @Override public final MethodHandle getTarget() {
97.57 + return target;
97.58 + }
97.59 +
97.60 + /**
97.61 + * Always throws an {@link UnsupportedOperationException}.
97.62 + * This kind of call site cannot change its target.
97.63 + * @param ignore a new target proposed for the call site, which is ignored
97.64 + * @throws UnsupportedOperationException because this kind of call site cannot change its target
97.65 + */
97.66 + @Override public final void setTarget(MethodHandle ignore) {
97.67 + throw new UnsupportedOperationException("ConstantCallSite");
97.68 + }
97.69 +
97.70 + /**
97.71 + * Returns this call site's permanent target.
97.72 + * Since that target will never change, this is a correct implementation
97.73 + * of {@link CallSite#dynamicInvoker CallSite.dynamicInvoker}.
97.74 + * @return the immutable linkage state of this call site, a constant method handle
97.75 + */
97.76 + @Override
97.77 + public final MethodHandle dynamicInvoker() {
97.78 + return getTarget();
97.79 + }
97.80 +}
98.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
98.2 +++ b/src/share/classes/java/lang/invoke/DirectMethodHandle.java Tue Mar 29 20:19:55 2011 -0700
98.3 @@ -0,0 +1,53 @@
98.4 +/*
98.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
98.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
98.7 + *
98.8 + * This code is free software; you can redistribute it and/or modify it
98.9 + * under the terms of the GNU General Public License version 2 only, as
98.10 + * published by the Free Software Foundation. Oracle designates this
98.11 + * particular file as subject to the "Classpath" exception as provided
98.12 + * by Oracle in the LICENSE file that accompanied this code.
98.13 + *
98.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
98.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
98.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
98.17 + * version 2 for more details (a copy is included in the LICENSE file that
98.18 + * accompanied this code).
98.19 + *
98.20 + * You should have received a copy of the GNU General Public License version
98.21 + * 2 along with this work; if not, write to the Free Software Foundation,
98.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
98.23 + *
98.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
98.25 + * or visit www.oracle.com if you need additional information or have any
98.26 + * questions.
98.27 + */
98.28 +
98.29 +package java.lang.invoke;
98.30 +
98.31 +import static java.lang.invoke.MethodHandleNatives.Constants.*;
98.32 +
98.33 +/**
98.34 + * The flavor of method handle which emulates invokespecial or invokestatic.
98.35 + * @author jrose
98.36 + */
98.37 +class DirectMethodHandle extends MethodHandle {
98.38 + //inherited oop vmtarget; // methodOop or virtual class/interface oop
98.39 + private final int vmindex; // method index within class or interface
98.40 + { vmindex = VM_INDEX_UNINITIALIZED; } // JVM may change this
98.41 +
98.42 + // Constructors in this class *must* be package scoped or private.
98.43 + DirectMethodHandle(MethodType mtype, MemberName m, boolean doDispatch, Class<?> lookupClass) {
98.44 + super(mtype);
98.45 +
98.46 + assert(m.isMethod() || !doDispatch && m.isConstructor());
98.47 + if (!m.isResolved())
98.48 + throw new InternalError();
98.49 +
98.50 + MethodHandleNatives.init(this, (Object) m, doDispatch, lookupClass);
98.51 + }
98.52 +
98.53 + boolean isValid() {
98.54 + return (vmindex != VM_INDEX_UNINITIALIZED);
98.55 + }
98.56 +}
99.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
99.2 +++ b/src/share/classes/java/lang/invoke/FilterGeneric.java Tue Mar 29 20:19:55 2011 -0700
99.3 @@ -0,0 +1,4496 @@
99.4 +/*
99.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
99.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
99.7 + *
99.8 + * This code is free software; you can redistribute it and/or modify it
99.9 + * under the terms of the GNU General Public License version 2 only, as
99.10 + * published by the Free Software Foundation. Oracle designates this
99.11 + * particular file as subject to the "Classpath" exception as provided
99.12 + * by Oracle in the LICENSE file that accompanied this code.
99.13 + *
99.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
99.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
99.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
99.17 + * version 2 for more details (a copy is included in the LICENSE file that
99.18 + * accompanied this code).
99.19 + *
99.20 + * You should have received a copy of the GNU General Public License version
99.21 + * 2 along with this work; if not, write to the Free Software Foundation,
99.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
99.23 + *
99.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
99.25 + * or visit www.oracle.com if you need additional information or have any
99.26 + * questions.
99.27 + */
99.28 +
99.29 +package java.lang.invoke;
99.30 +
99.31 +import java.lang.reflect.*;
99.32 +import static java.lang.invoke.MethodHandleStatics.*;
99.33 +import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
99.34 +
99.35 +/**
99.36 + * These adapters apply arbitrary conversions to arguments
99.37 + * on the way to a ultimate target.
99.38 + * For simplicity, these are all generically typed.
99.39 + * @author jrose
99.40 + */
99.41 +class FilterGeneric {
99.42 + // type for the incoming call (will be generic)
99.43 + private final MethodType entryType;
99.44 + // prototype adapters (clone and customize for each new target & conversion!)
99.45 + private final Adapter[] adapters;
99.46 +
99.47 + /** Compute and cache information common to all filtering adapters
99.48 + * with the given generic type
99.49 + */
99.50 + FilterGeneric(MethodType entryType) {
99.51 + this.entryType = entryType;
99.52 + int tableSize = Kind.LIMIT.invokerIndex(1 + entryType.parameterCount());
99.53 + this.adapters = new Adapter[tableSize];
99.54 + }
99.55 +
99.56 + Adapter getAdapter(Kind kind, int pos) {
99.57 + int index = kind.invokerIndex(pos);
99.58 + Adapter ad = adapters[index];
99.59 + if (ad != null) return ad;
99.60 + ad = findAdapter(entryType, kind, pos);
99.61 + if (ad == null)
99.62 + ad = buildAdapterFromBytecodes(entryType, kind, pos);
99.63 + adapters[index] = ad;
99.64 + return ad;
99.65 + }
99.66 +
99.67 + Adapter makeInstance(Kind kind, int pos, MethodHandle filter, MethodHandle target) {
99.68 + Adapter ad = getAdapter(kind, pos);
99.69 + return ad.makeInstance(ad.prototypeEntryPoint(), filter, target);
99.70 + }
99.71 +
99.72 + /** Build an adapter of the given generic type, which invokes filter
99.73 + * on the selected incoming argument before passing it to the target.
99.74 + * @param pos the argument to filter
99.75 + * @param filter the function to call on the argument
99.76 + * @param target the target to call with the modified argument list
99.77 + * @return an adapter method handle
99.78 + */
99.79 + public static MethodHandle makeArgumentFilter(int pos, MethodHandle filter, MethodHandle target) {
99.80 + return make(Kind.value, pos, filter, target);
99.81 + }
99.82 +
99.83 + /** Build an adapter of the given generic type, which invokes a combiner
99.84 + * on a selected group of leading arguments.
99.85 + * The result of the combiner is prepended before all those arguments.
99.86 + * @param combiner the function to call on the selected leading arguments
99.87 + * @param target the target to call with the modified argument list
99.88 + * @return an adapter method handle
99.89 + */
99.90 + public static MethodHandle makeArgumentFolder(MethodHandle combiner, MethodHandle target) {
99.91 + int num = combiner.type().parameterCount();
99.92 + return make(Kind.fold, num, combiner, target);
99.93 + }
99.94 +
99.95 + /** Build an adapter of the given generic type, which invokes a filter
99.96 + * on the incoming arguments, reified as a group.
99.97 + * The argument may be modified (by side effects in the filter).
99.98 + * The arguments, possibly modified, are passed on to the target.
99.99 + * @param filter the function to call on the arguments
99.100 + * @param target the target to call with the possibly-modified argument list
99.101 + * @return an adapter method handle
99.102 + */
99.103 + public static MethodHandle makeFlyby(MethodHandle filter, MethodHandle target) {
99.104 + return make(Kind.flyby, 0, filter, target);
99.105 + }
99.106 +
99.107 + /** Build an adapter of the given generic type, which invokes a collector
99.108 + * on the selected incoming argument and all following arguments.
99.109 + * The result of the collector replaces all those arguments.
99.110 + * @param collector the function to call on the selected trailing arguments
99.111 + * @param target the target to call with the modified argument list
99.112 + * @return an adapter method handle
99.113 + */
99.114 + public static MethodHandle makeArgumentCollector(MethodHandle collector, MethodHandle target) {
99.115 + int pos = target.type().parameterCount() - 1;
99.116 + return make(Kind.collect, pos, collector, target);
99.117 + }
99.118 +
99.119 + static MethodHandle make(Kind kind, int pos, MethodHandle filter, MethodHandle target) {
99.120 + FilterGeneric fgen = of(kind, pos, filter.type(), target.type());
99.121 + return fgen.makeInstance(kind, pos, filter, target);
99.122 + }
99.123 +
99.124 + /** Return the adapter information for this target and filter type. */
99.125 + static FilterGeneric of(Kind kind, int pos, MethodType filterType, MethodType targetType) {
99.126 + MethodType entryType = entryType(kind, pos, filterType, targetType);
99.127 + if (entryType.generic() != entryType)
99.128 + throw newIllegalArgumentException("must be generic: "+entryType);
99.129 + MethodTypeForm form = entryType.form();
99.130 + FilterGeneric filterGen = form.filterGeneric;
99.131 + if (filterGen == null)
99.132 + form.filterGeneric = filterGen = new FilterGeneric(entryType);
99.133 + return filterGen;
99.134 + }
99.135 +
99.136 + public String toString() {
99.137 + return "FilterGeneric/"+entryType;
99.138 + }
99.139 +
99.140 + static MethodType targetType(MethodType entryType, Kind kind, int pos, MethodType filterType) {
99.141 + MethodType type = entryType;
99.142 + switch (kind) {
99.143 + case value:
99.144 + case flyby:
99.145 + break; // no change
99.146 + case fold:
99.147 + type = type.insertParameterTypes(0, filterType.returnType());
99.148 + break;
99.149 + case collect:
99.150 + type = type.dropParameterTypes(pos, type.parameterCount());
99.151 + type = type.insertParameterTypes(pos, filterType.returnType());
99.152 + break;
99.153 + default:
99.154 + throw new InternalError();
99.155 + }
99.156 + return type;
99.157 + }
99.158 +
99.159 + static MethodType entryType(Kind kind, int pos, MethodType filterType, MethodType targetType) {
99.160 + MethodType type = targetType;
99.161 + switch (kind) {
99.162 + case value:
99.163 + case flyby:
99.164 + break; // no change
99.165 + case fold:
99.166 + type = type.dropParameterTypes(0, 1);
99.167 + break;
99.168 + case collect:
99.169 + type = type.dropParameterTypes(pos, pos+1);
99.170 + type = type.insertParameterTypes(pos, filterType.parameterList());
99.171 + break;
99.172 + default:
99.173 + throw new InternalError();
99.174 + }
99.175 + return type;
99.176 + }
99.177 +
99.178 + /* Create an adapter that handles spreading calls for the given type. */
99.179 + static Adapter findAdapter(MethodType entryType, Kind kind, int pos) {
99.180 + int argc = entryType.parameterCount();
99.181 + String cname0 = "F"+argc;
99.182 + String cname1 = "F"+argc+kind.key;
99.183 + String[] cnames = { cname0, cname1 };
99.184 + String iname = kind.invokerName(pos);
99.185 + // e.g., F5; invoke_C3
99.186 + for (String cname : cnames) {
99.187 + Class<? extends Adapter> acls = Adapter.findSubClass(cname);
99.188 + if (acls == null) continue;
99.189 + // see if it has the required invoke method
99.190 + MethodHandle entryPoint = null;
99.191 + try {
99.192 + entryPoint = IMPL_LOOKUP.findSpecial(acls, iname, entryType, acls);
99.193 + } catch (ReflectiveOperationException ex) {
99.194 + }
99.195 + if (entryPoint == null) continue;
99.196 + Constructor<? extends Adapter> ctor = null;
99.197 + try {
99.198 + ctor = acls.getDeclaredConstructor(MethodHandle.class);
99.199 + } catch (NoSuchMethodException ex) {
99.200 + } catch (SecurityException ex) {
99.201 + }
99.202 + if (ctor == null) continue;
99.203 + try {
99.204 + // Produce an instance configured as a prototype.
99.205 + return ctor.newInstance(entryPoint);
99.206 + } catch (IllegalArgumentException ex) {
99.207 + } catch (InvocationTargetException wex) {
99.208 + Throwable ex = wex.getTargetException();
99.209 + if (ex instanceof Error) throw (Error)ex;
99.210 + if (ex instanceof RuntimeException) throw (RuntimeException)ex;
99.211 + } catch (InstantiationException ex) {
99.212 + } catch (IllegalAccessException ex) {
99.213 + }
99.214 + }
99.215 + return null;
99.216 + }
99.217 +
99.218 + static Adapter buildAdapterFromBytecodes(MethodType entryType, Kind kind, int pos) {
99.219 + throw new UnsupportedOperationException("NYI");
99.220 + }
99.221 +
99.222 + /**
99.223 + * This adapter takes some untyped arguments, and returns an untyped result.
99.224 + * Internally, it applies the invoker to the target, which causes the
99.225 + * objects to be unboxed; the result is a raw type in L/I/J/F/D.
99.226 + * This result is passed to convert, which is responsible for
99.227 + * converting the raw result into a boxed object.
99.228 + * The invoker is kept separate from the target because it can be
99.229 + * generated once per type erasure family, and reused across adapters.
99.230 + */
99.231 + static abstract class Adapter extends BoundMethodHandle {
99.232 + protected final MethodHandle filter; // transforms one or more arguments
99.233 + protected final MethodHandle target; // ultimate target
99.234 +
99.235 + @Override
99.236 + public String toString() {
99.237 + return addTypeString(target, this);
99.238 + }
99.239 +
99.240 + protected boolean isPrototype() { return target == null; }
99.241 + protected Adapter(MethodHandle entryPoint) {
99.242 + this(entryPoint, entryPoint, null);
99.243 + assert(isPrototype());
99.244 + }
99.245 + protected MethodHandle prototypeEntryPoint() {
99.246 + if (!isPrototype()) throw new InternalError();
99.247 + return filter;
99.248 + }
99.249 +
99.250 + protected Adapter(MethodHandle entryPoint,
99.251 + MethodHandle filter, MethodHandle target) {
99.252 + super(entryPoint);
99.253 + this.filter = filter;
99.254 + this.target = target;
99.255 + }
99.256 +
99.257 + /** Make a copy of self, with new fields. */
99.258 + protected abstract Adapter makeInstance(MethodHandle entryPoint,
99.259 + MethodHandle filter, MethodHandle target);
99.260 + // { return new ThisType(entryPoint, filter, target); }
99.261 +
99.262 + static private final String CLASS_PREFIX; // "java.lang.invoke.FilterGeneric$"
99.263 + static {
99.264 + String aname = Adapter.class.getName();
99.265 + String sname = Adapter.class.getSimpleName();
99.266 + if (!aname.endsWith(sname)) throw new InternalError();
99.267 + CLASS_PREFIX = aname.substring(0, aname.length() - sname.length());
99.268 + }
99.269 + /** Find a sibing class of Adapter. */
99.270 + static Class<? extends Adapter> findSubClass(String name) {
99.271 + String cname = Adapter.CLASS_PREFIX + name;
99.272 + try {
99.273 + return Class.forName(cname).asSubclass(Adapter.class);
99.274 + } catch (ClassNotFoundException ex) {
99.275 + return null;
99.276 + } catch (ClassCastException ex) {
99.277 + return null;
99.278 + }
99.279 + }
99.280 + }
99.281 +
99.282 + static enum Kind {
99.283 + value('V'), // filter and replace Nth argument value
99.284 + fold('F'), // fold first N arguments, prepend result
99.285 + collect('C'), // collect last N arguments, replace with result
99.286 + flyby('Y'), // reify entire argument list, filter, pass to target
99.287 + LIMIT('?');
99.288 + static final int COUNT = LIMIT.ordinal();
99.289 +
99.290 + final char key;
99.291 + Kind(char key) { this.key = key; }
99.292 + String invokerName(int pos) { return "invoke_"+key+""+pos; }
99.293 + int invokerIndex(int pos) { return pos * COUNT + ordinal(); }
99.294 + }
99.295 +
99.296 + /* generated classes follow this pattern:
99.297 + static class F1X extends Adapter {
99.298 + protected F1X(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.299 + protected F1X(MethodHandle e, MethodHandle f, MethodHandle t)
99.300 + { super(e, f, t); }
99.301 + protected F1X makeInstance(MethodHandle e, MethodHandle f, MethodHandle t)
99.302 + { return new F1X(e, f, t); }
99.303 + protected Object invoke_V0(Object a0) { return target.invokeExact(filter.invokeExact(a0)); }
99.304 + protected Object invoke_F0(Object a0) { return target.invokeExact(filter.invokeExact(), a0); }
99.305 + protected Object invoke_F1(Object a0) { return target.invokeExact(filter.invokeExact(a0), a0); }
99.306 + protected Object invoke_C0(Object a0) { return target.invokeExact(filter.invokeExact(a0)); }
99.307 + protected Object invoke_C1(Object a0) { return target.invokeExact(a0, filter.invokeExact()); }
99.308 + protected Object invoke_Y0(Object a0) { Object[] av = { a0 };
99.309 + filter.invokeExact(av); return target.invokeExact(av[0]); }
99.310 + }
99.311 + static class F2X extends Adapter {
99.312 + protected F2X(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.313 + protected F2X(MethodHandle e, MethodHandle f, MethodHandle t)
99.314 + { super(e, f, t); }
99.315 + protected F2X makeInstance(MethodHandle e, MethodHandle f, MethodHandle t)
99.316 + { return new F2X(e, f, t); }
99.317 + protected Object invoke_V0(Object a0, Object a1) { return target.invokeExact(filter.invokeExact(a0), a1); }
99.318 + protected Object invoke_V1(Object a0, Object a1) { return target.invokeExact(a0, filter.invokeExact(a1)); }
99.319 + protected Object invoke_F0(Object a0, Object a1) { return target.invokeExact(filter.invokeExact(), a0, a1); }
99.320 + protected Object invoke_F1(Object a0, Object a1) { return target.invokeExact(filter.invokeExact(a0), a0, a1); }
99.321 + protected Object invoke_F2(Object a0, Object a1) { return target.invokeExact(filter.invokeExact(a0, a1), a0, a1); }
99.322 + protected Object invoke_C0(Object a0, Object a1) { return target.invokeExact(filter.invokeExact(a0, a1)); }
99.323 + protected Object invoke_C1(Object a0, Object a1) { return target.invokeExact(a0, filter.invokeExact(a1)); }
99.324 + protected Object invoke_C2(Object a0, Object a1) { return target.invokeExact(a0, a1, filter.invokeExact()); }
99.325 + protected Object invoke_Y0(Object a0, Object a1) { Object[] av = { a0, a1 };
99.326 + filter.invokeExact(av); return target.invokeExact(av[0], av[1]); }
99.327 + }
99.328 + // */
99.329 +
99.330 + // This one is written by hand:
99.331 + static class F0 extends Adapter {
99.332 + protected F0(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.333 + protected F0(MethodHandle e, MethodHandle f, MethodHandle t) {
99.334 + super(e, f, t); }
99.335 + protected F0 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.336 + return new F0(e, f, t); }
99.337 + protected Object invoke_F0() throws Throwable {
99.338 + return target.invokeExact(filter.invokeExact()); }
99.339 + protected Object invoke_C0() throws Throwable {
99.340 + return target.invokeExact(filter.invokeExact()); }
99.341 + static final Object[] NO_ARGS = { };
99.342 + protected Object invoke_Y0() throws Throwable {
99.343 + filter.invokeExact(NO_ARGS); // make the flyby
99.344 + return target.invokeExact(); }
99.345 + }
99.346 +
99.347 +/*
99.348 + : SHELL; n=FilterGeneric; cp -p $n.java $n.java-; sed < $n.java- > $n.java+ -e '/{{*{{/,/}}*}}/w /tmp/genclasses.java' -e '/}}*}}/q'; (cd /tmp; javac -d . genclasses.java; java -ea -cp . genclasses | sed 's| *[/]/ *$||') >> $n.java+; echo '}' >> $n.java+; mv $n.java+ $n.java; mv $n.java- $n.java~
99.349 +//{{{
99.350 +import java.util.*;
99.351 +class genclasses {
99.352 + static String[][] TEMPLATES = { {
99.353 + "@for@ N=1..20",
99.354 + " //@each-cat@",
99.355 + " static class @cat@ extends Adapter {",
99.356 + " protected @cat@(MethodHandle entryPoint) { super(entryPoint); } // to build prototype",
99.357 + " protected @cat@(MethodHandle e, MethodHandle f, MethodHandle t) {",
99.358 + " super(e, f, t); }",
99.359 + " protected @cat@ makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {",
99.360 + " return new @cat@(e, f, t); }",
99.361 + " //@each-P@",
99.362 + " protected Object invoke_V@P@(@Tvav@) throws Throwable {",
99.363 + " return target.invokeExact(@a0_@@Psp@filter.invokeExact(a@P@)@_aN@); }",
99.364 + " //@end-P@",
99.365 + " //@each-P@",
99.366 + " protected Object invoke_F@P@(@Tvav@) throws Throwable {",
99.367 + " return target.invokeExact(filter.invokeExact(@a0@),",
99.368 + " @av@); }",
99.369 + " //@end-P@",
99.370 + " protected Object invoke_F@N@(@Tvav@) throws Throwable {",
99.371 + " return target.invokeExact(filter.invokeExact(@av@),",
99.372 + " @av@); }",
99.373 + " //@each-P@",
99.374 + " protected Object invoke_C@P@(@Tvav@) throws Throwable {",
99.375 + " return target.invokeExact(@a0_@filter.invokeExact(a@P@@_aN@)); }",
99.376 + " //@end-P@",
99.377 + " protected Object invoke_C@N@(@Tvav@) throws Throwable {",
99.378 + " return target.invokeExact(@av@, filter.invokeExact()); }",
99.379 + " protected Object invoke_Y0(@Tvav@) throws Throwable {",
99.380 + " Object[] av = { @av@ };",
99.381 + " filter.invokeExact(av); // make the flyby",
99.382 + " return target.invokeExact(@av[i]@); }",
99.383 + " }",
99.384 + } };
99.385 + static final String NEWLINE_INDENT = " //\n ";
99.386 + enum VAR {
99.387 + cat, N, P, Tvav, av, a0, a0_, _aN, Psp, av_i_;
99.388 + public final String pattern = "@"+toString().replace('_','.')+"@";
99.389 + public String binding = toString();
99.390 + static void makeBindings(boolean topLevel, int inargs, int pos) {
99.391 + assert(-1 <= pos && pos < inargs);
99.392 + VAR.cat.binding = "F"+inargs;
99.393 + VAR.N.binding = String.valueOf(inargs); // incoming arg count
99.394 + VAR.P.binding = String.valueOf(pos); // selected arg position
99.395 + String[] av = new String[inargs];
99.396 + String[] Tvav = new String[inargs];
99.397 + String[] av_i_ = new String[inargs];
99.398 + for (int i = 0; i < inargs; i++) {
99.399 + av[i] = arg(i);
99.400 + av_i_[i] = "av["+i+"]";
99.401 + String spc = "";
99.402 + if (i > 0 && i % 4 == 0) spc = NEWLINE_INDENT+(pos>9?" ":"")+" ";
99.403 + Tvav[i] = spc+param("Object", av[i]);
99.404 + }
99.405 + VAR.av.binding = comma(av);
99.406 + VAR.av_i_.binding = comma(av_i_);
99.407 + VAR.Tvav.binding = comma(Tvav);
99.408 + if (pos >= 0) {
99.409 + VAR.Psp.binding = (pos > 0 && pos % 10 == 0) ? NEWLINE_INDENT : "";
99.410 + String[] a0 = new String[pos];
99.411 + String[] aN = new String[inargs - (pos+1)];
99.412 + for (int i = 0; i < pos; i++) {
99.413 + String spc = "";
99.414 + if (i > 0 && i % 10 == 0) spc = NEWLINE_INDENT;
99.415 + a0[i] = spc+av[i];
99.416 + }
99.417 + VAR.a0.binding = comma(a0);
99.418 + VAR.a0_.binding = comma(a0, ", ");
99.419 + for (int i = pos+1; i < inargs; i++) {
99.420 + String spc = "";
99.421 + if (i > 0 && i % 10 == 0) spc = NEWLINE_INDENT;
99.422 + aN[i - (pos+1)] = spc+av[i];
99.423 + }
99.424 + VAR._aN.binding = comma(", ", aN);
99.425 + }
99.426 + }
99.427 + static String arg(int i) { return "a"+i; }
99.428 + static String param(String t, String a) { return t+" "+a; }
99.429 + static String comma(String[] v) { return comma(v, ""); }
99.430 + static String comma(String[] v, String sep) { return comma("", v, sep); }
99.431 + static String comma(String sep, String[] v) { return comma(sep, v, ""); }
99.432 + static String comma(String sep1, String[] v, String sep2) {
99.433 + if (v.length == 0) return "";
99.434 + String res = v[0];
99.435 + for (int i = 1; i < v.length; i++) res += ", "+v[i];
99.436 + return sep1 + res + sep2;
99.437 + }
99.438 + static String transform(String string) {
99.439 + for (VAR var : values())
99.440 + string = string.replaceAll(var.pattern, var.binding);
99.441 + return string;
99.442 + }
99.443 + }
99.444 + static String[] stringsIn(String[] strings, int beg, int end) {
99.445 + return Arrays.copyOfRange(strings, beg, Math.min(end, strings.length));
99.446 + }
99.447 + static String[] stringsBefore(String[] strings, int pos) {
99.448 + return stringsIn(strings, 0, pos);
99.449 + }
99.450 + static String[] stringsAfter(String[] strings, int pos) {
99.451 + return stringsIn(strings, pos, strings.length);
99.452 + }
99.453 + static int indexAfter(String[] strings, int pos, String tag) {
99.454 + return Math.min(indexBefore(strings, pos, tag) + 1, strings.length);
99.455 + }
99.456 + static int indexBefore(String[] strings, int pos, String tag) {
99.457 + for (int i = pos, end = strings.length; ; i++) {
99.458 + if (i == end || strings[i].endsWith(tag)) return i;
99.459 + }
99.460 + }
99.461 + static int MIN_ARITY, MAX_ARITY;
99.462 + public static void main(String... av) {
99.463 + for (String[] template : TEMPLATES) {
99.464 + int forLinesLimit = indexBefore(template, 0, "@each-cat@");
99.465 + String[] forLines = stringsBefore(template, forLinesLimit);
99.466 + template = stringsAfter(template, forLinesLimit);
99.467 + for (String forLine : forLines)
99.468 + expandTemplate(forLine, template);
99.469 + }
99.470 + }
99.471 + static void expandTemplate(String forLine, String[] template) {
99.472 + String[] params = forLine.split("[^0-9]+");
99.473 + if (params[0].length() == 0) params = stringsAfter(params, 1);
99.474 + System.out.println("//params="+Arrays.asList(params));
99.475 + int pcur = 0;
99.476 + MIN_ARITY = Integer.valueOf(params[pcur++]);
99.477 + MAX_ARITY = Integer.valueOf(params[pcur++]);
99.478 + if (pcur != params.length) throw new RuntimeException("bad extra param: "+forLine);
99.479 + for (int inargs = MIN_ARITY; inargs <= MAX_ARITY; inargs++) {
99.480 + expandTemplate(template, true, inargs, -1);
99.481 + }
99.482 + }
99.483 + static void expandTemplate(String[] template, boolean topLevel, int inargs, int pos) {
99.484 + VAR.makeBindings(topLevel, inargs, pos);
99.485 + for (int i = 0; i < template.length; i++) {
99.486 + String line = template[i];
99.487 + if (line.endsWith("@each-cat@")) {
99.488 + // ignore
99.489 + } else if (line.endsWith("@each-P@")) {
99.490 + int blockEnd = indexAfter(template, i, "@end-P@");
99.491 + String[] block = stringsIn(template, i+1, blockEnd-1);
99.492 + for (int pos1 = Math.max(0,pos); pos1 < inargs; pos1++)
99.493 + expandTemplate(block, false, inargs, pos1);
99.494 + VAR.makeBindings(topLevel, inargs, pos);
99.495 + i = blockEnd-1; continue;
99.496 + } else {
99.497 + System.out.println(VAR.transform(line));
99.498 + }
99.499 + }
99.500 + }
99.501 +}
99.502 +//}}} */
99.503 +//params=[1, 20]
99.504 + static class F1 extends Adapter {
99.505 + protected F1(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.506 + protected F1(MethodHandle e, MethodHandle f, MethodHandle t) {
99.507 + super(e, f, t); }
99.508 + protected F1 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.509 + return new F1(e, f, t); }
99.510 + protected Object invoke_V0(Object a0) throws Throwable {
99.511 + return target.invokeExact(filter.invokeExact(a0)); }
99.512 + protected Object invoke_F0(Object a0) throws Throwable {
99.513 + return target.invokeExact(filter.invokeExact(),
99.514 + a0); }
99.515 + protected Object invoke_F1(Object a0) throws Throwable {
99.516 + return target.invokeExact(filter.invokeExact(a0),
99.517 + a0); }
99.518 + protected Object invoke_C0(Object a0) throws Throwable {
99.519 + return target.invokeExact(filter.invokeExact(a0)); }
99.520 + protected Object invoke_C1(Object a0) throws Throwable {
99.521 + return target.invokeExact(a0, filter.invokeExact()); }
99.522 + protected Object invoke_Y0(Object a0) throws Throwable {
99.523 + Object[] av = { a0 };
99.524 + filter.invokeExact(av); // make the flyby
99.525 + return target.invokeExact(av[0]); }
99.526 + }
99.527 + static class F2 extends Adapter {
99.528 + protected F2(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.529 + protected F2(MethodHandle e, MethodHandle f, MethodHandle t) {
99.530 + super(e, f, t); }
99.531 + protected F2 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.532 + return new F2(e, f, t); }
99.533 + protected Object invoke_V0(Object a0, Object a1) throws Throwable {
99.534 + return target.invokeExact(filter.invokeExact(a0), a1); }
99.535 + protected Object invoke_V1(Object a0, Object a1) throws Throwable {
99.536 + return target.invokeExact(a0, filter.invokeExact(a1)); }
99.537 + protected Object invoke_F0(Object a0, Object a1) throws Throwable {
99.538 + return target.invokeExact(filter.invokeExact(),
99.539 + a0, a1); }
99.540 + protected Object invoke_F1(Object a0, Object a1) throws Throwable {
99.541 + return target.invokeExact(filter.invokeExact(a0),
99.542 + a0, a1); }
99.543 + protected Object invoke_F2(Object a0, Object a1) throws Throwable {
99.544 + return target.invokeExact(filter.invokeExact(a0, a1),
99.545 + a0, a1); }
99.546 + protected Object invoke_C0(Object a0, Object a1) throws Throwable {
99.547 + return target.invokeExact(filter.invokeExact(a0, a1)); }
99.548 + protected Object invoke_C1(Object a0, Object a1) throws Throwable {
99.549 + return target.invokeExact(a0, filter.invokeExact(a1)); }
99.550 + protected Object invoke_C2(Object a0, Object a1) throws Throwable {
99.551 + return target.invokeExact(a0, a1, filter.invokeExact()); }
99.552 + protected Object invoke_Y0(Object a0, Object a1) throws Throwable {
99.553 + Object[] av = { a0, a1 };
99.554 + filter.invokeExact(av); // make the flyby
99.555 + return target.invokeExact(av[0], av[1]); }
99.556 + }
99.557 + static class F3 extends Adapter {
99.558 + protected F3(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.559 + protected F3(MethodHandle e, MethodHandle f, MethodHandle t) {
99.560 + super(e, f, t); }
99.561 + protected F3 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.562 + return new F3(e, f, t); }
99.563 + protected Object invoke_V0(Object a0, Object a1, Object a2) throws Throwable {
99.564 + return target.invokeExact(filter.invokeExact(a0), a1, a2); }
99.565 + protected Object invoke_V1(Object a0, Object a1, Object a2) throws Throwable {
99.566 + return target.invokeExact(a0, filter.invokeExact(a1), a2); }
99.567 + protected Object invoke_V2(Object a0, Object a1, Object a2) throws Throwable {
99.568 + return target.invokeExact(a0, a1, filter.invokeExact(a2)); }
99.569 + protected Object invoke_F0(Object a0, Object a1, Object a2) throws Throwable {
99.570 + return target.invokeExact(filter.invokeExact(),
99.571 + a0, a1, a2); }
99.572 + protected Object invoke_F1(Object a0, Object a1, Object a2) throws Throwable {
99.573 + return target.invokeExact(filter.invokeExact(a0),
99.574 + a0, a1, a2); }
99.575 + protected Object invoke_F2(Object a0, Object a1, Object a2) throws Throwable {
99.576 + return target.invokeExact(filter.invokeExact(a0, a1),
99.577 + a0, a1, a2); }
99.578 + protected Object invoke_F3(Object a0, Object a1, Object a2) throws Throwable {
99.579 + return target.invokeExact(filter.invokeExact(a0, a1, a2),
99.580 + a0, a1, a2); }
99.581 + protected Object invoke_C0(Object a0, Object a1, Object a2) throws Throwable {
99.582 + return target.invokeExact(filter.invokeExact(a0, a1, a2)); }
99.583 + protected Object invoke_C1(Object a0, Object a1, Object a2) throws Throwable {
99.584 + return target.invokeExact(a0, filter.invokeExact(a1, a2)); }
99.585 + protected Object invoke_C2(Object a0, Object a1, Object a2) throws Throwable {
99.586 + return target.invokeExact(a0, a1, filter.invokeExact(a2)); }
99.587 + protected Object invoke_C3(Object a0, Object a1, Object a2) throws Throwable {
99.588 + return target.invokeExact(a0, a1, a2, filter.invokeExact()); }
99.589 + protected Object invoke_Y0(Object a0, Object a1, Object a2) throws Throwable {
99.590 + Object[] av = { a0, a1, a2 };
99.591 + filter.invokeExact(av); // make the flyby
99.592 + return target.invokeExact(av[0], av[1], av[2]); }
99.593 + }
99.594 + static class F4 extends Adapter {
99.595 + protected F4(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.596 + protected F4(MethodHandle e, MethodHandle f, MethodHandle t) {
99.597 + super(e, f, t); }
99.598 + protected F4 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.599 + return new F4(e, f, t); }
99.600 + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3) throws Throwable {
99.601 + return target.invokeExact(filter.invokeExact(a0), a1, a2, a3); }
99.602 + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3) throws Throwable {
99.603 + return target.invokeExact(a0, filter.invokeExact(a1), a2, a3); }
99.604 + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3) throws Throwable {
99.605 + return target.invokeExact(a0, a1, filter.invokeExact(a2), a3); }
99.606 + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3) throws Throwable {
99.607 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3)); }
99.608 + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3) throws Throwable {
99.609 + return target.invokeExact(filter.invokeExact(),
99.610 + a0, a1, a2, a3); }
99.611 + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3) throws Throwable {
99.612 + return target.invokeExact(filter.invokeExact(a0),
99.613 + a0, a1, a2, a3); }
99.614 + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3) throws Throwable {
99.615 + return target.invokeExact(filter.invokeExact(a0, a1),
99.616 + a0, a1, a2, a3); }
99.617 + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3) throws Throwable {
99.618 + return target.invokeExact(filter.invokeExact(a0, a1, a2),
99.619 + a0, a1, a2, a3); }
99.620 + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3) throws Throwable {
99.621 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
99.622 + a0, a1, a2, a3); }
99.623 + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3) throws Throwable {
99.624 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3)); }
99.625 + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3) throws Throwable {
99.626 + return target.invokeExact(a0, filter.invokeExact(a1, a2, a3)); }
99.627 + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3) throws Throwable {
99.628 + return target.invokeExact(a0, a1, filter.invokeExact(a2, a3)); }
99.629 + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3) throws Throwable {
99.630 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3)); }
99.631 + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3) throws Throwable {
99.632 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact()); }
99.633 + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3) throws Throwable {
99.634 + Object[] av = { a0, a1, a2, a3 };
99.635 + filter.invokeExact(av); // make the flyby
99.636 + return target.invokeExact(av[0], av[1], av[2], av[3]); }
99.637 + }
99.638 + static class F5 extends Adapter {
99.639 + protected F5(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.640 + protected F5(MethodHandle e, MethodHandle f, MethodHandle t) {
99.641 + super(e, f, t); }
99.642 + protected F5 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.643 + return new F5(e, f, t); }
99.644 + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
99.645 + Object a4) throws Throwable {
99.646 + return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4); }
99.647 + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
99.648 + Object a4) throws Throwable {
99.649 + return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4); }
99.650 + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
99.651 + Object a4) throws Throwable {
99.652 + return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4); }
99.653 + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
99.654 + Object a4) throws Throwable {
99.655 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4); }
99.656 + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
99.657 + Object a4) throws Throwable {
99.658 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4)); }
99.659 + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
99.660 + Object a4) throws Throwable {
99.661 + return target.invokeExact(filter.invokeExact(),
99.662 + a0, a1, a2, a3, a4); }
99.663 + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
99.664 + Object a4) throws Throwable {
99.665 + return target.invokeExact(filter.invokeExact(a0),
99.666 + a0, a1, a2, a3, a4); }
99.667 + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
99.668 + Object a4) throws Throwable {
99.669 + return target.invokeExact(filter.invokeExact(a0, a1),
99.670 + a0, a1, a2, a3, a4); }
99.671 + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
99.672 + Object a4) throws Throwable {
99.673 + return target.invokeExact(filter.invokeExact(a0, a1, a2),
99.674 + a0, a1, a2, a3, a4); }
99.675 + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
99.676 + Object a4) throws Throwable {
99.677 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
99.678 + a0, a1, a2, a3, a4); }
99.679 + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
99.680 + Object a4) throws Throwable {
99.681 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
99.682 + a0, a1, a2, a3, a4); }
99.683 + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
99.684 + Object a4) throws Throwable {
99.685 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4)); }
99.686 + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
99.687 + Object a4) throws Throwable {
99.688 + return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4)); }
99.689 + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
99.690 + Object a4) throws Throwable {
99.691 + return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4)); }
99.692 + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
99.693 + Object a4) throws Throwable {
99.694 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4)); }
99.695 + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
99.696 + Object a4) throws Throwable {
99.697 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4)); }
99.698 + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
99.699 + Object a4) throws Throwable {
99.700 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact()); }
99.701 + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
99.702 + Object a4) throws Throwable {
99.703 + Object[] av = { a0, a1, a2, a3, a4 };
99.704 + filter.invokeExact(av); // make the flyby
99.705 + return target.invokeExact(av[0], av[1], av[2], av[3], av[4]); }
99.706 + }
99.707 + static class F6 extends Adapter {
99.708 + protected F6(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.709 + protected F6(MethodHandle e, MethodHandle f, MethodHandle t) {
99.710 + super(e, f, t); }
99.711 + protected F6 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.712 + return new F6(e, f, t); }
99.713 + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
99.714 + Object a4, Object a5) throws Throwable {
99.715 + return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5); }
99.716 + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
99.717 + Object a4, Object a5) throws Throwable {
99.718 + return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5); }
99.719 + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
99.720 + Object a4, Object a5) throws Throwable {
99.721 + return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5); }
99.722 + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
99.723 + Object a4, Object a5) throws Throwable {
99.724 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5); }
99.725 + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
99.726 + Object a4, Object a5) throws Throwable {
99.727 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5); }
99.728 + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
99.729 + Object a4, Object a5) throws Throwable {
99.730 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5)); }
99.731 + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
99.732 + Object a4, Object a5) throws Throwable {
99.733 + return target.invokeExact(filter.invokeExact(),
99.734 + a0, a1, a2, a3, a4, a5); }
99.735 + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
99.736 + Object a4, Object a5) throws Throwable {
99.737 + return target.invokeExact(filter.invokeExact(a0),
99.738 + a0, a1, a2, a3, a4, a5); }
99.739 + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
99.740 + Object a4, Object a5) throws Throwable {
99.741 + return target.invokeExact(filter.invokeExact(a0, a1),
99.742 + a0, a1, a2, a3, a4, a5); }
99.743 + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
99.744 + Object a4, Object a5) throws Throwable {
99.745 + return target.invokeExact(filter.invokeExact(a0, a1, a2),
99.746 + a0, a1, a2, a3, a4, a5); }
99.747 + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
99.748 + Object a4, Object a5) throws Throwable {
99.749 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
99.750 + a0, a1, a2, a3, a4, a5); }
99.751 + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
99.752 + Object a4, Object a5) throws Throwable {
99.753 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
99.754 + a0, a1, a2, a3, a4, a5); }
99.755 + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
99.756 + Object a4, Object a5) throws Throwable {
99.757 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
99.758 + a0, a1, a2, a3, a4, a5); }
99.759 + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
99.760 + Object a4, Object a5) throws Throwable {
99.761 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5)); }
99.762 + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
99.763 + Object a4, Object a5) throws Throwable {
99.764 + return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5)); }
99.765 + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
99.766 + Object a4, Object a5) throws Throwable {
99.767 + return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5)); }
99.768 + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
99.769 + Object a4, Object a5) throws Throwable {
99.770 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5)); }
99.771 + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
99.772 + Object a4, Object a5) throws Throwable {
99.773 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5)); }
99.774 + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
99.775 + Object a4, Object a5) throws Throwable {
99.776 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5)); }
99.777 + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
99.778 + Object a4, Object a5) throws Throwable {
99.779 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact()); }
99.780 + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
99.781 + Object a4, Object a5) throws Throwable {
99.782 + Object[] av = { a0, a1, a2, a3, a4, a5 };
99.783 + filter.invokeExact(av); // make the flyby
99.784 + return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5]); }
99.785 + }
99.786 + static class F7 extends Adapter {
99.787 + protected F7(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.788 + protected F7(MethodHandle e, MethodHandle f, MethodHandle t) {
99.789 + super(e, f, t); }
99.790 + protected F7 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.791 + return new F7(e, f, t); }
99.792 + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
99.793 + Object a4, Object a5, Object a6) throws Throwable {
99.794 + return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6); }
99.795 + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
99.796 + Object a4, Object a5, Object a6) throws Throwable {
99.797 + return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6); }
99.798 + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
99.799 + Object a4, Object a5, Object a6) throws Throwable {
99.800 + return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6); }
99.801 + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
99.802 + Object a4, Object a5, Object a6) throws Throwable {
99.803 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6); }
99.804 + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
99.805 + Object a4, Object a5, Object a6) throws Throwable {
99.806 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6); }
99.807 + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
99.808 + Object a4, Object a5, Object a6) throws Throwable {
99.809 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6); }
99.810 + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
99.811 + Object a4, Object a5, Object a6) throws Throwable {
99.812 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6)); }
99.813 + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
99.814 + Object a4, Object a5, Object a6) throws Throwable {
99.815 + return target.invokeExact(filter.invokeExact(),
99.816 + a0, a1, a2, a3, a4, a5, a6); }
99.817 + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
99.818 + Object a4, Object a5, Object a6) throws Throwable {
99.819 + return target.invokeExact(filter.invokeExact(a0),
99.820 + a0, a1, a2, a3, a4, a5, a6); }
99.821 + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
99.822 + Object a4, Object a5, Object a6) throws Throwable {
99.823 + return target.invokeExact(filter.invokeExact(a0, a1),
99.824 + a0, a1, a2, a3, a4, a5, a6); }
99.825 + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
99.826 + Object a4, Object a5, Object a6) throws Throwable {
99.827 + return target.invokeExact(filter.invokeExact(a0, a1, a2),
99.828 + a0, a1, a2, a3, a4, a5, a6); }
99.829 + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
99.830 + Object a4, Object a5, Object a6) throws Throwable {
99.831 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
99.832 + a0, a1, a2, a3, a4, a5, a6); }
99.833 + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
99.834 + Object a4, Object a5, Object a6) throws Throwable {
99.835 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
99.836 + a0, a1, a2, a3, a4, a5, a6); }
99.837 + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
99.838 + Object a4, Object a5, Object a6) throws Throwable {
99.839 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
99.840 + a0, a1, a2, a3, a4, a5, a6); }
99.841 + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
99.842 + Object a4, Object a5, Object a6) throws Throwable {
99.843 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
99.844 + a0, a1, a2, a3, a4, a5, a6); }
99.845 + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
99.846 + Object a4, Object a5, Object a6) throws Throwable {
99.847 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6)); }
99.848 + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
99.849 + Object a4, Object a5, Object a6) throws Throwable {
99.850 + return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6)); }
99.851 + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
99.852 + Object a4, Object a5, Object a6) throws Throwable {
99.853 + return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6)); }
99.854 + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
99.855 + Object a4, Object a5, Object a6) throws Throwable {
99.856 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6)); }
99.857 + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
99.858 + Object a4, Object a5, Object a6) throws Throwable {
99.859 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6)); }
99.860 + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
99.861 + Object a4, Object a5, Object a6) throws Throwable {
99.862 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6)); }
99.863 + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
99.864 + Object a4, Object a5, Object a6) throws Throwable {
99.865 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6)); }
99.866 + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
99.867 + Object a4, Object a5, Object a6) throws Throwable {
99.868 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact()); }
99.869 + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
99.870 + Object a4, Object a5, Object a6) throws Throwable {
99.871 + Object[] av = { a0, a1, a2, a3, a4, a5, a6 };
99.872 + filter.invokeExact(av); // make the flyby
99.873 + return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6]); }
99.874 + }
99.875 + static class F8 extends Adapter {
99.876 + protected F8(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.877 + protected F8(MethodHandle e, MethodHandle f, MethodHandle t) {
99.878 + super(e, f, t); }
99.879 + protected F8 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.880 + return new F8(e, f, t); }
99.881 + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
99.882 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.883 + return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7); }
99.884 + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
99.885 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.886 + return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7); }
99.887 + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
99.888 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.889 + return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7); }
99.890 + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
99.891 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.892 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7); }
99.893 + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
99.894 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.895 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7); }
99.896 + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
99.897 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.898 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7); }
99.899 + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
99.900 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.901 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7); }
99.902 + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
99.903 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.904 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7)); }
99.905 + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
99.906 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.907 + return target.invokeExact(filter.invokeExact(),
99.908 + a0, a1, a2, a3, a4, a5, a6, a7); }
99.909 + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
99.910 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.911 + return target.invokeExact(filter.invokeExact(a0),
99.912 + a0, a1, a2, a3, a4, a5, a6, a7); }
99.913 + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
99.914 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.915 + return target.invokeExact(filter.invokeExact(a0, a1),
99.916 + a0, a1, a2, a3, a4, a5, a6, a7); }
99.917 + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
99.918 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.919 + return target.invokeExact(filter.invokeExact(a0, a1, a2),
99.920 + a0, a1, a2, a3, a4, a5, a6, a7); }
99.921 + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
99.922 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.923 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
99.924 + a0, a1, a2, a3, a4, a5, a6, a7); }
99.925 + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
99.926 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.927 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
99.928 + a0, a1, a2, a3, a4, a5, a6, a7); }
99.929 + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
99.930 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.931 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
99.932 + a0, a1, a2, a3, a4, a5, a6, a7); }
99.933 + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
99.934 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.935 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
99.936 + a0, a1, a2, a3, a4, a5, a6, a7); }
99.937 + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
99.938 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.939 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
99.940 + a0, a1, a2, a3, a4, a5, a6, a7); }
99.941 + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
99.942 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.943 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7)); }
99.944 + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
99.945 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.946 + return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7)); }
99.947 + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
99.948 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.949 + return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7)); }
99.950 + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
99.951 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.952 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7)); }
99.953 + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
99.954 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.955 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7)); }
99.956 + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
99.957 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.958 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7)); }
99.959 + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
99.960 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.961 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7)); }
99.962 + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
99.963 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.964 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7)); }
99.965 + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
99.966 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.967 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact()); }
99.968 + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
99.969 + Object a4, Object a5, Object a6, Object a7) throws Throwable {
99.970 + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7 };
99.971 + filter.invokeExact(av); // make the flyby
99.972 + return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7]); }
99.973 + }
99.974 + static class F9 extends Adapter {
99.975 + protected F9(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.976 + protected F9(MethodHandle e, MethodHandle f, MethodHandle t) {
99.977 + super(e, f, t); }
99.978 + protected F9 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.979 + return new F9(e, f, t); }
99.980 + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
99.981 + Object a4, Object a5, Object a6, Object a7,
99.982 + Object a8) throws Throwable {
99.983 + return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8); }
99.984 + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
99.985 + Object a4, Object a5, Object a6, Object a7,
99.986 + Object a8) throws Throwable {
99.987 + return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8); }
99.988 + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
99.989 + Object a4, Object a5, Object a6, Object a7,
99.990 + Object a8) throws Throwable {
99.991 + return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8); }
99.992 + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
99.993 + Object a4, Object a5, Object a6, Object a7,
99.994 + Object a8) throws Throwable {
99.995 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8); }
99.996 + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
99.997 + Object a4, Object a5, Object a6, Object a7,
99.998 + Object a8) throws Throwable {
99.999 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8); }
99.1000 + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
99.1001 + Object a4, Object a5, Object a6, Object a7,
99.1002 + Object a8) throws Throwable {
99.1003 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8); }
99.1004 + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
99.1005 + Object a4, Object a5, Object a6, Object a7,
99.1006 + Object a8) throws Throwable {
99.1007 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8); }
99.1008 + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
99.1009 + Object a4, Object a5, Object a6, Object a7,
99.1010 + Object a8) throws Throwable {
99.1011 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8); }
99.1012 + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
99.1013 + Object a4, Object a5, Object a6, Object a7,
99.1014 + Object a8) throws Throwable {
99.1015 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8)); }
99.1016 + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
99.1017 + Object a4, Object a5, Object a6, Object a7,
99.1018 + Object a8) throws Throwable {
99.1019 + return target.invokeExact(filter.invokeExact(),
99.1020 + a0, a1, a2, a3, a4, a5, a6, a7, a8); }
99.1021 + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
99.1022 + Object a4, Object a5, Object a6, Object a7,
99.1023 + Object a8) throws Throwable {
99.1024 + return target.invokeExact(filter.invokeExact(a0),
99.1025 + a0, a1, a2, a3, a4, a5, a6, a7, a8); }
99.1026 + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
99.1027 + Object a4, Object a5, Object a6, Object a7,
99.1028 + Object a8) throws Throwable {
99.1029 + return target.invokeExact(filter.invokeExact(a0, a1),
99.1030 + a0, a1, a2, a3, a4, a5, a6, a7, a8); }
99.1031 + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
99.1032 + Object a4, Object a5, Object a6, Object a7,
99.1033 + Object a8) throws Throwable {
99.1034 + return target.invokeExact(filter.invokeExact(a0, a1, a2),
99.1035 + a0, a1, a2, a3, a4, a5, a6, a7, a8); }
99.1036 + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
99.1037 + Object a4, Object a5, Object a6, Object a7,
99.1038 + Object a8) throws Throwable {
99.1039 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
99.1040 + a0, a1, a2, a3, a4, a5, a6, a7, a8); }
99.1041 + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
99.1042 + Object a4, Object a5, Object a6, Object a7,
99.1043 + Object a8) throws Throwable {
99.1044 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
99.1045 + a0, a1, a2, a3, a4, a5, a6, a7, a8); }
99.1046 + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
99.1047 + Object a4, Object a5, Object a6, Object a7,
99.1048 + Object a8) throws Throwable {
99.1049 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
99.1050 + a0, a1, a2, a3, a4, a5, a6, a7, a8); }
99.1051 + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
99.1052 + Object a4, Object a5, Object a6, Object a7,
99.1053 + Object a8) throws Throwable {
99.1054 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
99.1055 + a0, a1, a2, a3, a4, a5, a6, a7, a8); }
99.1056 + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
99.1057 + Object a4, Object a5, Object a6, Object a7,
99.1058 + Object a8) throws Throwable {
99.1059 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
99.1060 + a0, a1, a2, a3, a4, a5, a6, a7, a8); }
99.1061 + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
99.1062 + Object a4, Object a5, Object a6, Object a7,
99.1063 + Object a8) throws Throwable {
99.1064 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
99.1065 + a0, a1, a2, a3, a4, a5, a6, a7, a8); }
99.1066 + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
99.1067 + Object a4, Object a5, Object a6, Object a7,
99.1068 + Object a8) throws Throwable {
99.1069 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
99.1070 + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
99.1071 + Object a4, Object a5, Object a6, Object a7,
99.1072 + Object a8) throws Throwable {
99.1073 + return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8)); }
99.1074 + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
99.1075 + Object a4, Object a5, Object a6, Object a7,
99.1076 + Object a8) throws Throwable {
99.1077 + return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8)); }
99.1078 + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
99.1079 + Object a4, Object a5, Object a6, Object a7,
99.1080 + Object a8) throws Throwable {
99.1081 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8)); }
99.1082 + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
99.1083 + Object a4, Object a5, Object a6, Object a7,
99.1084 + Object a8) throws Throwable {
99.1085 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8)); }
99.1086 + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
99.1087 + Object a4, Object a5, Object a6, Object a7,
99.1088 + Object a8) throws Throwable {
99.1089 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8)); }
99.1090 + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
99.1091 + Object a4, Object a5, Object a6, Object a7,
99.1092 + Object a8) throws Throwable {
99.1093 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8)); }
99.1094 + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
99.1095 + Object a4, Object a5, Object a6, Object a7,
99.1096 + Object a8) throws Throwable {
99.1097 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8)); }
99.1098 + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
99.1099 + Object a4, Object a5, Object a6, Object a7,
99.1100 + Object a8) throws Throwable {
99.1101 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8)); }
99.1102 + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
99.1103 + Object a4, Object a5, Object a6, Object a7,
99.1104 + Object a8) throws Throwable {
99.1105 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact()); }
99.1106 + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
99.1107 + Object a4, Object a5, Object a6, Object a7,
99.1108 + Object a8) throws Throwable {
99.1109 + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8 };
99.1110 + filter.invokeExact(av); // make the flyby
99.1111 + return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8]); }
99.1112 + }
99.1113 + static class F10 extends Adapter {
99.1114 + protected F10(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.1115 + protected F10(MethodHandle e, MethodHandle f, MethodHandle t) {
99.1116 + super(e, f, t); }
99.1117 + protected F10 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.1118 + return new F10(e, f, t); }
99.1119 + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
99.1120 + Object a4, Object a5, Object a6, Object a7,
99.1121 + Object a8, Object a9) throws Throwable {
99.1122 + return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9); }
99.1123 + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
99.1124 + Object a4, Object a5, Object a6, Object a7,
99.1125 + Object a8, Object a9) throws Throwable {
99.1126 + return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9); }
99.1127 + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
99.1128 + Object a4, Object a5, Object a6, Object a7,
99.1129 + Object a8, Object a9) throws Throwable {
99.1130 + return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9); }
99.1131 + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
99.1132 + Object a4, Object a5, Object a6, Object a7,
99.1133 + Object a8, Object a9) throws Throwable {
99.1134 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9); }
99.1135 + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
99.1136 + Object a4, Object a5, Object a6, Object a7,
99.1137 + Object a8, Object a9) throws Throwable {
99.1138 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9); }
99.1139 + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
99.1140 + Object a4, Object a5, Object a6, Object a7,
99.1141 + Object a8, Object a9) throws Throwable {
99.1142 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9); }
99.1143 + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
99.1144 + Object a4, Object a5, Object a6, Object a7,
99.1145 + Object a8, Object a9) throws Throwable {
99.1146 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9); }
99.1147 + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
99.1148 + Object a4, Object a5, Object a6, Object a7,
99.1149 + Object a8, Object a9) throws Throwable {
99.1150 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9); }
99.1151 + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
99.1152 + Object a4, Object a5, Object a6, Object a7,
99.1153 + Object a8, Object a9) throws Throwable {
99.1154 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9); }
99.1155 + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
99.1156 + Object a4, Object a5, Object a6, Object a7,
99.1157 + Object a8, Object a9) throws Throwable {
99.1158 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9)); }
99.1159 + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
99.1160 + Object a4, Object a5, Object a6, Object a7,
99.1161 + Object a8, Object a9) throws Throwable {
99.1162 + return target.invokeExact(filter.invokeExact(),
99.1163 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
99.1164 + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
99.1165 + Object a4, Object a5, Object a6, Object a7,
99.1166 + Object a8, Object a9) throws Throwable {
99.1167 + return target.invokeExact(filter.invokeExact(a0),
99.1168 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
99.1169 + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
99.1170 + Object a4, Object a5, Object a6, Object a7,
99.1171 + Object a8, Object a9) throws Throwable {
99.1172 + return target.invokeExact(filter.invokeExact(a0, a1),
99.1173 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
99.1174 + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
99.1175 + Object a4, Object a5, Object a6, Object a7,
99.1176 + Object a8, Object a9) throws Throwable {
99.1177 + return target.invokeExact(filter.invokeExact(a0, a1, a2),
99.1178 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
99.1179 + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
99.1180 + Object a4, Object a5, Object a6, Object a7,
99.1181 + Object a8, Object a9) throws Throwable {
99.1182 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
99.1183 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
99.1184 + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
99.1185 + Object a4, Object a5, Object a6, Object a7,
99.1186 + Object a8, Object a9) throws Throwable {
99.1187 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
99.1188 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
99.1189 + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
99.1190 + Object a4, Object a5, Object a6, Object a7,
99.1191 + Object a8, Object a9) throws Throwable {
99.1192 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
99.1193 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
99.1194 + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
99.1195 + Object a4, Object a5, Object a6, Object a7,
99.1196 + Object a8, Object a9) throws Throwable {
99.1197 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
99.1198 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
99.1199 + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
99.1200 + Object a4, Object a5, Object a6, Object a7,
99.1201 + Object a8, Object a9) throws Throwable {
99.1202 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
99.1203 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
99.1204 + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
99.1205 + Object a4, Object a5, Object a6, Object a7,
99.1206 + Object a8, Object a9) throws Throwable {
99.1207 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
99.1208 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
99.1209 + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
99.1210 + Object a4, Object a5, Object a6, Object a7,
99.1211 + Object a8, Object a9) throws Throwable {
99.1212 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
99.1213 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
99.1214 + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
99.1215 + Object a4, Object a5, Object a6, Object a7,
99.1216 + Object a8, Object a9) throws Throwable {
99.1217 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
99.1218 + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
99.1219 + Object a4, Object a5, Object a6, Object a7,
99.1220 + Object a8, Object a9) throws Throwable {
99.1221 + return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
99.1222 + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
99.1223 + Object a4, Object a5, Object a6, Object a7,
99.1224 + Object a8, Object a9) throws Throwable {
99.1225 + return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9)); }
99.1226 + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
99.1227 + Object a4, Object a5, Object a6, Object a7,
99.1228 + Object a8, Object a9) throws Throwable {
99.1229 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9)); }
99.1230 + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
99.1231 + Object a4, Object a5, Object a6, Object a7,
99.1232 + Object a8, Object a9) throws Throwable {
99.1233 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9)); }
99.1234 + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
99.1235 + Object a4, Object a5, Object a6, Object a7,
99.1236 + Object a8, Object a9) throws Throwable {
99.1237 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9)); }
99.1238 + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
99.1239 + Object a4, Object a5, Object a6, Object a7,
99.1240 + Object a8, Object a9) throws Throwable {
99.1241 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9)); }
99.1242 + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
99.1243 + Object a4, Object a5, Object a6, Object a7,
99.1244 + Object a8, Object a9) throws Throwable {
99.1245 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9)); }
99.1246 + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
99.1247 + Object a4, Object a5, Object a6, Object a7,
99.1248 + Object a8, Object a9) throws Throwable {
99.1249 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9)); }
99.1250 + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
99.1251 + Object a4, Object a5, Object a6, Object a7,
99.1252 + Object a8, Object a9) throws Throwable {
99.1253 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9)); }
99.1254 + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
99.1255 + Object a4, Object a5, Object a6, Object a7,
99.1256 + Object a8, Object a9) throws Throwable {
99.1257 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact()); }
99.1258 + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
99.1259 + Object a4, Object a5, Object a6, Object a7,
99.1260 + Object a8, Object a9) throws Throwable {
99.1261 + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9 };
99.1262 + filter.invokeExact(av); // make the flyby
99.1263 + return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9]); }
99.1264 + }
99.1265 + static class F11 extends Adapter {
99.1266 + protected F11(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.1267 + protected F11(MethodHandle e, MethodHandle f, MethodHandle t) {
99.1268 + super(e, f, t); }
99.1269 + protected F11 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.1270 + return new F11(e, f, t); }
99.1271 + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
99.1272 + Object a4, Object a5, Object a6, Object a7,
99.1273 + Object a8, Object a9, Object a10) throws Throwable {
99.1274 + return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1275 + a10); }
99.1276 + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
99.1277 + Object a4, Object a5, Object a6, Object a7,
99.1278 + Object a8, Object a9, Object a10) throws Throwable {
99.1279 + return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
99.1280 + a10); }
99.1281 + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
99.1282 + Object a4, Object a5, Object a6, Object a7,
99.1283 + Object a8, Object a9, Object a10) throws Throwable {
99.1284 + return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
99.1285 + a10); }
99.1286 + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
99.1287 + Object a4, Object a5, Object a6, Object a7,
99.1288 + Object a8, Object a9, Object a10) throws Throwable {
99.1289 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
99.1290 + a10); }
99.1291 + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
99.1292 + Object a4, Object a5, Object a6, Object a7,
99.1293 + Object a8, Object a9, Object a10) throws Throwable {
99.1294 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
99.1295 + a10); }
99.1296 + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
99.1297 + Object a4, Object a5, Object a6, Object a7,
99.1298 + Object a8, Object a9, Object a10) throws Throwable {
99.1299 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
99.1300 + a10); }
99.1301 + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
99.1302 + Object a4, Object a5, Object a6, Object a7,
99.1303 + Object a8, Object a9, Object a10) throws Throwable {
99.1304 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
99.1305 + a10); }
99.1306 + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
99.1307 + Object a4, Object a5, Object a6, Object a7,
99.1308 + Object a8, Object a9, Object a10) throws Throwable {
99.1309 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
99.1310 + a10); }
99.1311 + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
99.1312 + Object a4, Object a5, Object a6, Object a7,
99.1313 + Object a8, Object a9, Object a10) throws Throwable {
99.1314 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
99.1315 + a10); }
99.1316 + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
99.1317 + Object a4, Object a5, Object a6, Object a7,
99.1318 + Object a8, Object a9, Object a10) throws Throwable {
99.1319 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
99.1320 + a10); }
99.1321 + protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
99.1322 + Object a4, Object a5, Object a6, Object a7,
99.1323 + Object a8, Object a9, Object a10) throws Throwable {
99.1324 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1325 + filter.invokeExact(a10)); }
99.1326 + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
99.1327 + Object a4, Object a5, Object a6, Object a7,
99.1328 + Object a8, Object a9, Object a10) throws Throwable {
99.1329 + return target.invokeExact(filter.invokeExact(),
99.1330 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
99.1331 + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
99.1332 + Object a4, Object a5, Object a6, Object a7,
99.1333 + Object a8, Object a9, Object a10) throws Throwable {
99.1334 + return target.invokeExact(filter.invokeExact(a0),
99.1335 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
99.1336 + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
99.1337 + Object a4, Object a5, Object a6, Object a7,
99.1338 + Object a8, Object a9, Object a10) throws Throwable {
99.1339 + return target.invokeExact(filter.invokeExact(a0, a1),
99.1340 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
99.1341 + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
99.1342 + Object a4, Object a5, Object a6, Object a7,
99.1343 + Object a8, Object a9, Object a10) throws Throwable {
99.1344 + return target.invokeExact(filter.invokeExact(a0, a1, a2),
99.1345 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
99.1346 + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
99.1347 + Object a4, Object a5, Object a6, Object a7,
99.1348 + Object a8, Object a9, Object a10) throws Throwable {
99.1349 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
99.1350 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
99.1351 + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
99.1352 + Object a4, Object a5, Object a6, Object a7,
99.1353 + Object a8, Object a9, Object a10) throws Throwable {
99.1354 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
99.1355 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
99.1356 + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
99.1357 + Object a4, Object a5, Object a6, Object a7,
99.1358 + Object a8, Object a9, Object a10) throws Throwable {
99.1359 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
99.1360 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
99.1361 + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
99.1362 + Object a4, Object a5, Object a6, Object a7,
99.1363 + Object a8, Object a9, Object a10) throws Throwable {
99.1364 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
99.1365 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
99.1366 + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
99.1367 + Object a4, Object a5, Object a6, Object a7,
99.1368 + Object a8, Object a9, Object a10) throws Throwable {
99.1369 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
99.1370 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
99.1371 + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
99.1372 + Object a4, Object a5, Object a6, Object a7,
99.1373 + Object a8, Object a9, Object a10) throws Throwable {
99.1374 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
99.1375 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
99.1376 + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
99.1377 + Object a4, Object a5, Object a6, Object a7,
99.1378 + Object a8, Object a9, Object a10) throws Throwable {
99.1379 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
99.1380 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
99.1381 + protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
99.1382 + Object a4, Object a5, Object a6, Object a7,
99.1383 + Object a8, Object a9, Object a10) throws Throwable {
99.1384 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10),
99.1385 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
99.1386 + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
99.1387 + Object a4, Object a5, Object a6, Object a7,
99.1388 + Object a8, Object a9, Object a10) throws Throwable {
99.1389 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1390 + a10)); }
99.1391 + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
99.1392 + Object a4, Object a5, Object a6, Object a7,
99.1393 + Object a8, Object a9, Object a10) throws Throwable {
99.1394 + return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1395 + a10)); }
99.1396 + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
99.1397 + Object a4, Object a5, Object a6, Object a7,
99.1398 + Object a8, Object a9, Object a10) throws Throwable {
99.1399 + return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
99.1400 + a10)); }
99.1401 + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
99.1402 + Object a4, Object a5, Object a6, Object a7,
99.1403 + Object a8, Object a9, Object a10) throws Throwable {
99.1404 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
99.1405 + a10)); }
99.1406 + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
99.1407 + Object a4, Object a5, Object a6, Object a7,
99.1408 + Object a8, Object a9, Object a10) throws Throwable {
99.1409 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
99.1410 + a10)); }
99.1411 + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
99.1412 + Object a4, Object a5, Object a6, Object a7,
99.1413 + Object a8, Object a9, Object a10) throws Throwable {
99.1414 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
99.1415 + a10)); }
99.1416 + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
99.1417 + Object a4, Object a5, Object a6, Object a7,
99.1418 + Object a8, Object a9, Object a10) throws Throwable {
99.1419 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
99.1420 + a10)); }
99.1421 + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
99.1422 + Object a4, Object a5, Object a6, Object a7,
99.1423 + Object a8, Object a9, Object a10) throws Throwable {
99.1424 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
99.1425 + a10)); }
99.1426 + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
99.1427 + Object a4, Object a5, Object a6, Object a7,
99.1428 + Object a8, Object a9, Object a10) throws Throwable {
99.1429 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
99.1430 + a10)); }
99.1431 + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
99.1432 + Object a4, Object a5, Object a6, Object a7,
99.1433 + Object a8, Object a9, Object a10) throws Throwable {
99.1434 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
99.1435 + a10)); }
99.1436 + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
99.1437 + Object a4, Object a5, Object a6, Object a7,
99.1438 + Object a8, Object a9, Object a10) throws Throwable {
99.1439 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10)); }
99.1440 + protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
99.1441 + Object a4, Object a5, Object a6, Object a7,
99.1442 + Object a8, Object a9, Object a10) throws Throwable {
99.1443 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, filter.invokeExact()); }
99.1444 + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
99.1445 + Object a4, Object a5, Object a6, Object a7,
99.1446 + Object a8, Object a9, Object a10) throws Throwable {
99.1447 + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 };
99.1448 + filter.invokeExact(av); // make the flyby
99.1449 + return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10]); }
99.1450 + }
99.1451 + static class F12 extends Adapter {
99.1452 + protected F12(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.1453 + protected F12(MethodHandle e, MethodHandle f, MethodHandle t) {
99.1454 + super(e, f, t); }
99.1455 + protected F12 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.1456 + return new F12(e, f, t); }
99.1457 + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
99.1458 + Object a4, Object a5, Object a6, Object a7,
99.1459 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1460 + return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1461 + a10, a11); }
99.1462 + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
99.1463 + Object a4, Object a5, Object a6, Object a7,
99.1464 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1465 + return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
99.1466 + a10, a11); }
99.1467 + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
99.1468 + Object a4, Object a5, Object a6, Object a7,
99.1469 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1470 + return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
99.1471 + a10, a11); }
99.1472 + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
99.1473 + Object a4, Object a5, Object a6, Object a7,
99.1474 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1475 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
99.1476 + a10, a11); }
99.1477 + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
99.1478 + Object a4, Object a5, Object a6, Object a7,
99.1479 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1480 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
99.1481 + a10, a11); }
99.1482 + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
99.1483 + Object a4, Object a5, Object a6, Object a7,
99.1484 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1485 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
99.1486 + a10, a11); }
99.1487 + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
99.1488 + Object a4, Object a5, Object a6, Object a7,
99.1489 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1490 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
99.1491 + a10, a11); }
99.1492 + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
99.1493 + Object a4, Object a5, Object a6, Object a7,
99.1494 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1495 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
99.1496 + a10, a11); }
99.1497 + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
99.1498 + Object a4, Object a5, Object a6, Object a7,
99.1499 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1500 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
99.1501 + a10, a11); }
99.1502 + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
99.1503 + Object a4, Object a5, Object a6, Object a7,
99.1504 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1505 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
99.1506 + a10, a11); }
99.1507 + protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
99.1508 + Object a4, Object a5, Object a6, Object a7,
99.1509 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1510 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1511 + filter.invokeExact(a10), a11); }
99.1512 + protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
99.1513 + Object a4, Object a5, Object a6, Object a7,
99.1514 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1515 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1516 + a10, filter.invokeExact(a11)); }
99.1517 + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
99.1518 + Object a4, Object a5, Object a6, Object a7,
99.1519 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1520 + return target.invokeExact(filter.invokeExact(),
99.1521 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
99.1522 + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
99.1523 + Object a4, Object a5, Object a6, Object a7,
99.1524 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1525 + return target.invokeExact(filter.invokeExact(a0),
99.1526 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
99.1527 + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
99.1528 + Object a4, Object a5, Object a6, Object a7,
99.1529 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1530 + return target.invokeExact(filter.invokeExact(a0, a1),
99.1531 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
99.1532 + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
99.1533 + Object a4, Object a5, Object a6, Object a7,
99.1534 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1535 + return target.invokeExact(filter.invokeExact(a0, a1, a2),
99.1536 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
99.1537 + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
99.1538 + Object a4, Object a5, Object a6, Object a7,
99.1539 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1540 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
99.1541 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
99.1542 + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
99.1543 + Object a4, Object a5, Object a6, Object a7,
99.1544 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1545 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
99.1546 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
99.1547 + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
99.1548 + Object a4, Object a5, Object a6, Object a7,
99.1549 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1550 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
99.1551 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
99.1552 + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
99.1553 + Object a4, Object a5, Object a6, Object a7,
99.1554 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1555 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
99.1556 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
99.1557 + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
99.1558 + Object a4, Object a5, Object a6, Object a7,
99.1559 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1560 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
99.1561 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
99.1562 + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
99.1563 + Object a4, Object a5, Object a6, Object a7,
99.1564 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1565 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
99.1566 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
99.1567 + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
99.1568 + Object a4, Object a5, Object a6, Object a7,
99.1569 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1570 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
99.1571 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
99.1572 + protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
99.1573 + Object a4, Object a5, Object a6, Object a7,
99.1574 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1575 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1576 + a10),
99.1577 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
99.1578 + protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
99.1579 + Object a4, Object a5, Object a6, Object a7,
99.1580 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1581 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11),
99.1582 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
99.1583 + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
99.1584 + Object a4, Object a5, Object a6, Object a7,
99.1585 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1586 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1587 + a10, a11)); }
99.1588 + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
99.1589 + Object a4, Object a5, Object a6, Object a7,
99.1590 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1591 + return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1592 + a10, a11)); }
99.1593 + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
99.1594 + Object a4, Object a5, Object a6, Object a7,
99.1595 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1596 + return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
99.1597 + a10, a11)); }
99.1598 + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
99.1599 + Object a4, Object a5, Object a6, Object a7,
99.1600 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1601 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
99.1602 + a10, a11)); }
99.1603 + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
99.1604 + Object a4, Object a5, Object a6, Object a7,
99.1605 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1606 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
99.1607 + a10, a11)); }
99.1608 + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
99.1609 + Object a4, Object a5, Object a6, Object a7,
99.1610 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1611 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
99.1612 + a10, a11)); }
99.1613 + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
99.1614 + Object a4, Object a5, Object a6, Object a7,
99.1615 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1616 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
99.1617 + a10, a11)); }
99.1618 + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
99.1619 + Object a4, Object a5, Object a6, Object a7,
99.1620 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1621 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
99.1622 + a10, a11)); }
99.1623 + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
99.1624 + Object a4, Object a5, Object a6, Object a7,
99.1625 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1626 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
99.1627 + a10, a11)); }
99.1628 + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
99.1629 + Object a4, Object a5, Object a6, Object a7,
99.1630 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1631 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
99.1632 + a10, a11)); }
99.1633 + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
99.1634 + Object a4, Object a5, Object a6, Object a7,
99.1635 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1636 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11)); }
99.1637 + protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
99.1638 + Object a4, Object a5, Object a6, Object a7,
99.1639 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1640 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1641 + a10, filter.invokeExact(a11)); }
99.1642 + protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
99.1643 + Object a4, Object a5, Object a6, Object a7,
99.1644 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1645 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, filter.invokeExact()); }
99.1646 + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
99.1647 + Object a4, Object a5, Object a6, Object a7,
99.1648 + Object a8, Object a9, Object a10, Object a11) throws Throwable {
99.1649 + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11 };
99.1650 + filter.invokeExact(av); // make the flyby
99.1651 + return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11]); }
99.1652 + }
99.1653 + static class F13 extends Adapter {
99.1654 + protected F13(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.1655 + protected F13(MethodHandle e, MethodHandle f, MethodHandle t) {
99.1656 + super(e, f, t); }
99.1657 + protected F13 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.1658 + return new F13(e, f, t); }
99.1659 + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
99.1660 + Object a4, Object a5, Object a6, Object a7,
99.1661 + Object a8, Object a9, Object a10, Object a11,
99.1662 + Object a12) throws Throwable {
99.1663 + return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1664 + a10, a11, a12); }
99.1665 + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
99.1666 + Object a4, Object a5, Object a6, Object a7,
99.1667 + Object a8, Object a9, Object a10, Object a11,
99.1668 + Object a12) throws Throwable {
99.1669 + return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
99.1670 + a10, a11, a12); }
99.1671 + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
99.1672 + Object a4, Object a5, Object a6, Object a7,
99.1673 + Object a8, Object a9, Object a10, Object a11,
99.1674 + Object a12) throws Throwable {
99.1675 + return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
99.1676 + a10, a11, a12); }
99.1677 + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
99.1678 + Object a4, Object a5, Object a6, Object a7,
99.1679 + Object a8, Object a9, Object a10, Object a11,
99.1680 + Object a12) throws Throwable {
99.1681 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
99.1682 + a10, a11, a12); }
99.1683 + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
99.1684 + Object a4, Object a5, Object a6, Object a7,
99.1685 + Object a8, Object a9, Object a10, Object a11,
99.1686 + Object a12) throws Throwable {
99.1687 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
99.1688 + a10, a11, a12); }
99.1689 + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
99.1690 + Object a4, Object a5, Object a6, Object a7,
99.1691 + Object a8, Object a9, Object a10, Object a11,
99.1692 + Object a12) throws Throwable {
99.1693 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
99.1694 + a10, a11, a12); }
99.1695 + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
99.1696 + Object a4, Object a5, Object a6, Object a7,
99.1697 + Object a8, Object a9, Object a10, Object a11,
99.1698 + Object a12) throws Throwable {
99.1699 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
99.1700 + a10, a11, a12); }
99.1701 + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
99.1702 + Object a4, Object a5, Object a6, Object a7,
99.1703 + Object a8, Object a9, Object a10, Object a11,
99.1704 + Object a12) throws Throwable {
99.1705 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
99.1706 + a10, a11, a12); }
99.1707 + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
99.1708 + Object a4, Object a5, Object a6, Object a7,
99.1709 + Object a8, Object a9, Object a10, Object a11,
99.1710 + Object a12) throws Throwable {
99.1711 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
99.1712 + a10, a11, a12); }
99.1713 + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
99.1714 + Object a4, Object a5, Object a6, Object a7,
99.1715 + Object a8, Object a9, Object a10, Object a11,
99.1716 + Object a12) throws Throwable {
99.1717 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
99.1718 + a10, a11, a12); }
99.1719 + protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
99.1720 + Object a4, Object a5, Object a6, Object a7,
99.1721 + Object a8, Object a9, Object a10, Object a11,
99.1722 + Object a12) throws Throwable {
99.1723 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1724 + filter.invokeExact(a10), a11, a12); }
99.1725 + protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
99.1726 + Object a4, Object a5, Object a6, Object a7,
99.1727 + Object a8, Object a9, Object a10, Object a11,
99.1728 + Object a12) throws Throwable {
99.1729 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1730 + a10, filter.invokeExact(a11), a12); }
99.1731 + protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
99.1732 + Object a4, Object a5, Object a6, Object a7,
99.1733 + Object a8, Object a9, Object a10, Object a11,
99.1734 + Object a12) throws Throwable {
99.1735 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1736 + a10, a11, filter.invokeExact(a12)); }
99.1737 + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
99.1738 + Object a4, Object a5, Object a6, Object a7,
99.1739 + Object a8, Object a9, Object a10, Object a11,
99.1740 + Object a12) throws Throwable {
99.1741 + return target.invokeExact(filter.invokeExact(),
99.1742 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
99.1743 + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
99.1744 + Object a4, Object a5, Object a6, Object a7,
99.1745 + Object a8, Object a9, Object a10, Object a11,
99.1746 + Object a12) throws Throwable {
99.1747 + return target.invokeExact(filter.invokeExact(a0),
99.1748 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
99.1749 + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
99.1750 + Object a4, Object a5, Object a6, Object a7,
99.1751 + Object a8, Object a9, Object a10, Object a11,
99.1752 + Object a12) throws Throwable {
99.1753 + return target.invokeExact(filter.invokeExact(a0, a1),
99.1754 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
99.1755 + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
99.1756 + Object a4, Object a5, Object a6, Object a7,
99.1757 + Object a8, Object a9, Object a10, Object a11,
99.1758 + Object a12) throws Throwable {
99.1759 + return target.invokeExact(filter.invokeExact(a0, a1, a2),
99.1760 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
99.1761 + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
99.1762 + Object a4, Object a5, Object a6, Object a7,
99.1763 + Object a8, Object a9, Object a10, Object a11,
99.1764 + Object a12) throws Throwable {
99.1765 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
99.1766 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
99.1767 + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
99.1768 + Object a4, Object a5, Object a6, Object a7,
99.1769 + Object a8, Object a9, Object a10, Object a11,
99.1770 + Object a12) throws Throwable {
99.1771 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
99.1772 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
99.1773 + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
99.1774 + Object a4, Object a5, Object a6, Object a7,
99.1775 + Object a8, Object a9, Object a10, Object a11,
99.1776 + Object a12) throws Throwable {
99.1777 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
99.1778 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
99.1779 + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
99.1780 + Object a4, Object a5, Object a6, Object a7,
99.1781 + Object a8, Object a9, Object a10, Object a11,
99.1782 + Object a12) throws Throwable {
99.1783 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
99.1784 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
99.1785 + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
99.1786 + Object a4, Object a5, Object a6, Object a7,
99.1787 + Object a8, Object a9, Object a10, Object a11,
99.1788 + Object a12) throws Throwable {
99.1789 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
99.1790 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
99.1791 + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
99.1792 + Object a4, Object a5, Object a6, Object a7,
99.1793 + Object a8, Object a9, Object a10, Object a11,
99.1794 + Object a12) throws Throwable {
99.1795 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
99.1796 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
99.1797 + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
99.1798 + Object a4, Object a5, Object a6, Object a7,
99.1799 + Object a8, Object a9, Object a10, Object a11,
99.1800 + Object a12) throws Throwable {
99.1801 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
99.1802 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
99.1803 + protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
99.1804 + Object a4, Object a5, Object a6, Object a7,
99.1805 + Object a8, Object a9, Object a10, Object a11,
99.1806 + Object a12) throws Throwable {
99.1807 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1808 + a10),
99.1809 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
99.1810 + protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
99.1811 + Object a4, Object a5, Object a6, Object a7,
99.1812 + Object a8, Object a9, Object a10, Object a11,
99.1813 + Object a12) throws Throwable {
99.1814 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1815 + a10, a11),
99.1816 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
99.1817 + protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
99.1818 + Object a4, Object a5, Object a6, Object a7,
99.1819 + Object a8, Object a9, Object a10, Object a11,
99.1820 + Object a12) throws Throwable {
99.1821 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12),
99.1822 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
99.1823 + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
99.1824 + Object a4, Object a5, Object a6, Object a7,
99.1825 + Object a8, Object a9, Object a10, Object a11,
99.1826 + Object a12) throws Throwable {
99.1827 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1828 + a10, a11, a12)); }
99.1829 + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
99.1830 + Object a4, Object a5, Object a6, Object a7,
99.1831 + Object a8, Object a9, Object a10, Object a11,
99.1832 + Object a12) throws Throwable {
99.1833 + return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1834 + a10, a11, a12)); }
99.1835 + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
99.1836 + Object a4, Object a5, Object a6, Object a7,
99.1837 + Object a8, Object a9, Object a10, Object a11,
99.1838 + Object a12) throws Throwable {
99.1839 + return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
99.1840 + a10, a11, a12)); }
99.1841 + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
99.1842 + Object a4, Object a5, Object a6, Object a7,
99.1843 + Object a8, Object a9, Object a10, Object a11,
99.1844 + Object a12) throws Throwable {
99.1845 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
99.1846 + a10, a11, a12)); }
99.1847 + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
99.1848 + Object a4, Object a5, Object a6, Object a7,
99.1849 + Object a8, Object a9, Object a10, Object a11,
99.1850 + Object a12) throws Throwable {
99.1851 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
99.1852 + a10, a11, a12)); }
99.1853 + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
99.1854 + Object a4, Object a5, Object a6, Object a7,
99.1855 + Object a8, Object a9, Object a10, Object a11,
99.1856 + Object a12) throws Throwable {
99.1857 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
99.1858 + a10, a11, a12)); }
99.1859 + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
99.1860 + Object a4, Object a5, Object a6, Object a7,
99.1861 + Object a8, Object a9, Object a10, Object a11,
99.1862 + Object a12) throws Throwable {
99.1863 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
99.1864 + a10, a11, a12)); }
99.1865 + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
99.1866 + Object a4, Object a5, Object a6, Object a7,
99.1867 + Object a8, Object a9, Object a10, Object a11,
99.1868 + Object a12) throws Throwable {
99.1869 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
99.1870 + a10, a11, a12)); }
99.1871 + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
99.1872 + Object a4, Object a5, Object a6, Object a7,
99.1873 + Object a8, Object a9, Object a10, Object a11,
99.1874 + Object a12) throws Throwable {
99.1875 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
99.1876 + a10, a11, a12)); }
99.1877 + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
99.1878 + Object a4, Object a5, Object a6, Object a7,
99.1879 + Object a8, Object a9, Object a10, Object a11,
99.1880 + Object a12) throws Throwable {
99.1881 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
99.1882 + a10, a11, a12)); }
99.1883 + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
99.1884 + Object a4, Object a5, Object a6, Object a7,
99.1885 + Object a8, Object a9, Object a10, Object a11,
99.1886 + Object a12) throws Throwable {
99.1887 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12)); }
99.1888 + protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
99.1889 + Object a4, Object a5, Object a6, Object a7,
99.1890 + Object a8, Object a9, Object a10, Object a11,
99.1891 + Object a12) throws Throwable {
99.1892 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1893 + a10, filter.invokeExact(a11, a12)); }
99.1894 + protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
99.1895 + Object a4, Object a5, Object a6, Object a7,
99.1896 + Object a8, Object a9, Object a10, Object a11,
99.1897 + Object a12) throws Throwable {
99.1898 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1899 + a10, a11, filter.invokeExact(a12)); }
99.1900 + protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
99.1901 + Object a4, Object a5, Object a6, Object a7,
99.1902 + Object a8, Object a9, Object a10, Object a11,
99.1903 + Object a12) throws Throwable {
99.1904 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, filter.invokeExact()); }
99.1905 + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
99.1906 + Object a4, Object a5, Object a6, Object a7,
99.1907 + Object a8, Object a9, Object a10, Object a11,
99.1908 + Object a12) throws Throwable {
99.1909 + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12 };
99.1910 + filter.invokeExact(av); // make the flyby
99.1911 + return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12]); }
99.1912 + }
99.1913 + static class F14 extends Adapter {
99.1914 + protected F14(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.1915 + protected F14(MethodHandle e, MethodHandle f, MethodHandle t) {
99.1916 + super(e, f, t); }
99.1917 + protected F14 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.1918 + return new F14(e, f, t); }
99.1919 + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
99.1920 + Object a4, Object a5, Object a6, Object a7,
99.1921 + Object a8, Object a9, Object a10, Object a11,
99.1922 + Object a12, Object a13) throws Throwable {
99.1923 + return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1924 + a10, a11, a12, a13); }
99.1925 + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
99.1926 + Object a4, Object a5, Object a6, Object a7,
99.1927 + Object a8, Object a9, Object a10, Object a11,
99.1928 + Object a12, Object a13) throws Throwable {
99.1929 + return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
99.1930 + a10, a11, a12, a13); }
99.1931 + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
99.1932 + Object a4, Object a5, Object a6, Object a7,
99.1933 + Object a8, Object a9, Object a10, Object a11,
99.1934 + Object a12, Object a13) throws Throwable {
99.1935 + return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
99.1936 + a10, a11, a12, a13); }
99.1937 + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
99.1938 + Object a4, Object a5, Object a6, Object a7,
99.1939 + Object a8, Object a9, Object a10, Object a11,
99.1940 + Object a12, Object a13) throws Throwable {
99.1941 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
99.1942 + a10, a11, a12, a13); }
99.1943 + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
99.1944 + Object a4, Object a5, Object a6, Object a7,
99.1945 + Object a8, Object a9, Object a10, Object a11,
99.1946 + Object a12, Object a13) throws Throwable {
99.1947 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
99.1948 + a10, a11, a12, a13); }
99.1949 + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
99.1950 + Object a4, Object a5, Object a6, Object a7,
99.1951 + Object a8, Object a9, Object a10, Object a11,
99.1952 + Object a12, Object a13) throws Throwable {
99.1953 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
99.1954 + a10, a11, a12, a13); }
99.1955 + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
99.1956 + Object a4, Object a5, Object a6, Object a7,
99.1957 + Object a8, Object a9, Object a10, Object a11,
99.1958 + Object a12, Object a13) throws Throwable {
99.1959 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
99.1960 + a10, a11, a12, a13); }
99.1961 + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
99.1962 + Object a4, Object a5, Object a6, Object a7,
99.1963 + Object a8, Object a9, Object a10, Object a11,
99.1964 + Object a12, Object a13) throws Throwable {
99.1965 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
99.1966 + a10, a11, a12, a13); }
99.1967 + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
99.1968 + Object a4, Object a5, Object a6, Object a7,
99.1969 + Object a8, Object a9, Object a10, Object a11,
99.1970 + Object a12, Object a13) throws Throwable {
99.1971 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
99.1972 + a10, a11, a12, a13); }
99.1973 + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
99.1974 + Object a4, Object a5, Object a6, Object a7,
99.1975 + Object a8, Object a9, Object a10, Object a11,
99.1976 + Object a12, Object a13) throws Throwable {
99.1977 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
99.1978 + a10, a11, a12, a13); }
99.1979 + protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
99.1980 + Object a4, Object a5, Object a6, Object a7,
99.1981 + Object a8, Object a9, Object a10, Object a11,
99.1982 + Object a12, Object a13) throws Throwable {
99.1983 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1984 + filter.invokeExact(a10), a11, a12, a13); }
99.1985 + protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
99.1986 + Object a4, Object a5, Object a6, Object a7,
99.1987 + Object a8, Object a9, Object a10, Object a11,
99.1988 + Object a12, Object a13) throws Throwable {
99.1989 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1990 + a10, filter.invokeExact(a11), a12, a13); }
99.1991 + protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
99.1992 + Object a4, Object a5, Object a6, Object a7,
99.1993 + Object a8, Object a9, Object a10, Object a11,
99.1994 + Object a12, Object a13) throws Throwable {
99.1995 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.1996 + a10, a11, filter.invokeExact(a12), a13); }
99.1997 + protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
99.1998 + Object a4, Object a5, Object a6, Object a7,
99.1999 + Object a8, Object a9, Object a10, Object a11,
99.2000 + Object a12, Object a13) throws Throwable {
99.2001 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2002 + a10, a11, a12, filter.invokeExact(a13)); }
99.2003 + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
99.2004 + Object a4, Object a5, Object a6, Object a7,
99.2005 + Object a8, Object a9, Object a10, Object a11,
99.2006 + Object a12, Object a13) throws Throwable {
99.2007 + return target.invokeExact(filter.invokeExact(),
99.2008 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
99.2009 + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
99.2010 + Object a4, Object a5, Object a6, Object a7,
99.2011 + Object a8, Object a9, Object a10, Object a11,
99.2012 + Object a12, Object a13) throws Throwable {
99.2013 + return target.invokeExact(filter.invokeExact(a0),
99.2014 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
99.2015 + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
99.2016 + Object a4, Object a5, Object a6, Object a7,
99.2017 + Object a8, Object a9, Object a10, Object a11,
99.2018 + Object a12, Object a13) throws Throwable {
99.2019 + return target.invokeExact(filter.invokeExact(a0, a1),
99.2020 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
99.2021 + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
99.2022 + Object a4, Object a5, Object a6, Object a7,
99.2023 + Object a8, Object a9, Object a10, Object a11,
99.2024 + Object a12, Object a13) throws Throwable {
99.2025 + return target.invokeExact(filter.invokeExact(a0, a1, a2),
99.2026 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
99.2027 + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
99.2028 + Object a4, Object a5, Object a6, Object a7,
99.2029 + Object a8, Object a9, Object a10, Object a11,
99.2030 + Object a12, Object a13) throws Throwable {
99.2031 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
99.2032 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
99.2033 + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
99.2034 + Object a4, Object a5, Object a6, Object a7,
99.2035 + Object a8, Object a9, Object a10, Object a11,
99.2036 + Object a12, Object a13) throws Throwable {
99.2037 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
99.2038 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
99.2039 + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
99.2040 + Object a4, Object a5, Object a6, Object a7,
99.2041 + Object a8, Object a9, Object a10, Object a11,
99.2042 + Object a12, Object a13) throws Throwable {
99.2043 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
99.2044 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
99.2045 + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
99.2046 + Object a4, Object a5, Object a6, Object a7,
99.2047 + Object a8, Object a9, Object a10, Object a11,
99.2048 + Object a12, Object a13) throws Throwable {
99.2049 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
99.2050 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
99.2051 + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
99.2052 + Object a4, Object a5, Object a6, Object a7,
99.2053 + Object a8, Object a9, Object a10, Object a11,
99.2054 + Object a12, Object a13) throws Throwable {
99.2055 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
99.2056 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
99.2057 + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
99.2058 + Object a4, Object a5, Object a6, Object a7,
99.2059 + Object a8, Object a9, Object a10, Object a11,
99.2060 + Object a12, Object a13) throws Throwable {
99.2061 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
99.2062 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
99.2063 + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
99.2064 + Object a4, Object a5, Object a6, Object a7,
99.2065 + Object a8, Object a9, Object a10, Object a11,
99.2066 + Object a12, Object a13) throws Throwable {
99.2067 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
99.2068 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
99.2069 + protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
99.2070 + Object a4, Object a5, Object a6, Object a7,
99.2071 + Object a8, Object a9, Object a10, Object a11,
99.2072 + Object a12, Object a13) throws Throwable {
99.2073 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2074 + a10),
99.2075 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
99.2076 + protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
99.2077 + Object a4, Object a5, Object a6, Object a7,
99.2078 + Object a8, Object a9, Object a10, Object a11,
99.2079 + Object a12, Object a13) throws Throwable {
99.2080 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2081 + a10, a11),
99.2082 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
99.2083 + protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
99.2084 + Object a4, Object a5, Object a6, Object a7,
99.2085 + Object a8, Object a9, Object a10, Object a11,
99.2086 + Object a12, Object a13) throws Throwable {
99.2087 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2088 + a10, a11, a12),
99.2089 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
99.2090 + protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
99.2091 + Object a4, Object a5, Object a6, Object a7,
99.2092 + Object a8, Object a9, Object a10, Object a11,
99.2093 + Object a12, Object a13) throws Throwable {
99.2094 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13),
99.2095 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
99.2096 + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
99.2097 + Object a4, Object a5, Object a6, Object a7,
99.2098 + Object a8, Object a9, Object a10, Object a11,
99.2099 + Object a12, Object a13) throws Throwable {
99.2100 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2101 + a10, a11, a12, a13)); }
99.2102 + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
99.2103 + Object a4, Object a5, Object a6, Object a7,
99.2104 + Object a8, Object a9, Object a10, Object a11,
99.2105 + Object a12, Object a13) throws Throwable {
99.2106 + return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2107 + a10, a11, a12, a13)); }
99.2108 + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
99.2109 + Object a4, Object a5, Object a6, Object a7,
99.2110 + Object a8, Object a9, Object a10, Object a11,
99.2111 + Object a12, Object a13) throws Throwable {
99.2112 + return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
99.2113 + a10, a11, a12, a13)); }
99.2114 + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
99.2115 + Object a4, Object a5, Object a6, Object a7,
99.2116 + Object a8, Object a9, Object a10, Object a11,
99.2117 + Object a12, Object a13) throws Throwable {
99.2118 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
99.2119 + a10, a11, a12, a13)); }
99.2120 + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
99.2121 + Object a4, Object a5, Object a6, Object a7,
99.2122 + Object a8, Object a9, Object a10, Object a11,
99.2123 + Object a12, Object a13) throws Throwable {
99.2124 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
99.2125 + a10, a11, a12, a13)); }
99.2126 + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
99.2127 + Object a4, Object a5, Object a6, Object a7,
99.2128 + Object a8, Object a9, Object a10, Object a11,
99.2129 + Object a12, Object a13) throws Throwable {
99.2130 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
99.2131 + a10, a11, a12, a13)); }
99.2132 + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
99.2133 + Object a4, Object a5, Object a6, Object a7,
99.2134 + Object a8, Object a9, Object a10, Object a11,
99.2135 + Object a12, Object a13) throws Throwable {
99.2136 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
99.2137 + a10, a11, a12, a13)); }
99.2138 + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
99.2139 + Object a4, Object a5, Object a6, Object a7,
99.2140 + Object a8, Object a9, Object a10, Object a11,
99.2141 + Object a12, Object a13) throws Throwable {
99.2142 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
99.2143 + a10, a11, a12, a13)); }
99.2144 + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
99.2145 + Object a4, Object a5, Object a6, Object a7,
99.2146 + Object a8, Object a9, Object a10, Object a11,
99.2147 + Object a12, Object a13) throws Throwable {
99.2148 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
99.2149 + a10, a11, a12, a13)); }
99.2150 + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
99.2151 + Object a4, Object a5, Object a6, Object a7,
99.2152 + Object a8, Object a9, Object a10, Object a11,
99.2153 + Object a12, Object a13) throws Throwable {
99.2154 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
99.2155 + a10, a11, a12, a13)); }
99.2156 + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
99.2157 + Object a4, Object a5, Object a6, Object a7,
99.2158 + Object a8, Object a9, Object a10, Object a11,
99.2159 + Object a12, Object a13) throws Throwable {
99.2160 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13)); }
99.2161 + protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
99.2162 + Object a4, Object a5, Object a6, Object a7,
99.2163 + Object a8, Object a9, Object a10, Object a11,
99.2164 + Object a12, Object a13) throws Throwable {
99.2165 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2166 + a10, filter.invokeExact(a11, a12, a13)); }
99.2167 + protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
99.2168 + Object a4, Object a5, Object a6, Object a7,
99.2169 + Object a8, Object a9, Object a10, Object a11,
99.2170 + Object a12, Object a13) throws Throwable {
99.2171 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2172 + a10, a11, filter.invokeExact(a12, a13)); }
99.2173 + protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
99.2174 + Object a4, Object a5, Object a6, Object a7,
99.2175 + Object a8, Object a9, Object a10, Object a11,
99.2176 + Object a12, Object a13) throws Throwable {
99.2177 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2178 + a10, a11, a12, filter.invokeExact(a13)); }
99.2179 + protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
99.2180 + Object a4, Object a5, Object a6, Object a7,
99.2181 + Object a8, Object a9, Object a10, Object a11,
99.2182 + Object a12, Object a13) throws Throwable {
99.2183 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, filter.invokeExact()); }
99.2184 + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
99.2185 + Object a4, Object a5, Object a6, Object a7,
99.2186 + Object a8, Object a9, Object a10, Object a11,
99.2187 + Object a12, Object a13) throws Throwable {
99.2188 + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13 };
99.2189 + filter.invokeExact(av); // make the flyby
99.2190 + return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13]); }
99.2191 + }
99.2192 + static class F15 extends Adapter {
99.2193 + protected F15(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.2194 + protected F15(MethodHandle e, MethodHandle f, MethodHandle t) {
99.2195 + super(e, f, t); }
99.2196 + protected F15 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.2197 + return new F15(e, f, t); }
99.2198 + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
99.2199 + Object a4, Object a5, Object a6, Object a7,
99.2200 + Object a8, Object a9, Object a10, Object a11,
99.2201 + Object a12, Object a13, Object a14) throws Throwable {
99.2202 + return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2203 + a10, a11, a12, a13, a14); }
99.2204 + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
99.2205 + Object a4, Object a5, Object a6, Object a7,
99.2206 + Object a8, Object a9, Object a10, Object a11,
99.2207 + Object a12, Object a13, Object a14) throws Throwable {
99.2208 + return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
99.2209 + a10, a11, a12, a13, a14); }
99.2210 + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
99.2211 + Object a4, Object a5, Object a6, Object a7,
99.2212 + Object a8, Object a9, Object a10, Object a11,
99.2213 + Object a12, Object a13, Object a14) throws Throwable {
99.2214 + return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
99.2215 + a10, a11, a12, a13, a14); }
99.2216 + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
99.2217 + Object a4, Object a5, Object a6, Object a7,
99.2218 + Object a8, Object a9, Object a10, Object a11,
99.2219 + Object a12, Object a13, Object a14) throws Throwable {
99.2220 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
99.2221 + a10, a11, a12, a13, a14); }
99.2222 + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
99.2223 + Object a4, Object a5, Object a6, Object a7,
99.2224 + Object a8, Object a9, Object a10, Object a11,
99.2225 + Object a12, Object a13, Object a14) throws Throwable {
99.2226 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
99.2227 + a10, a11, a12, a13, a14); }
99.2228 + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
99.2229 + Object a4, Object a5, Object a6, Object a7,
99.2230 + Object a8, Object a9, Object a10, Object a11,
99.2231 + Object a12, Object a13, Object a14) throws Throwable {
99.2232 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
99.2233 + a10, a11, a12, a13, a14); }
99.2234 + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
99.2235 + Object a4, Object a5, Object a6, Object a7,
99.2236 + Object a8, Object a9, Object a10, Object a11,
99.2237 + Object a12, Object a13, Object a14) throws Throwable {
99.2238 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
99.2239 + a10, a11, a12, a13, a14); }
99.2240 + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
99.2241 + Object a4, Object a5, Object a6, Object a7,
99.2242 + Object a8, Object a9, Object a10, Object a11,
99.2243 + Object a12, Object a13, Object a14) throws Throwable {
99.2244 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
99.2245 + a10, a11, a12, a13, a14); }
99.2246 + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
99.2247 + Object a4, Object a5, Object a6, Object a7,
99.2248 + Object a8, Object a9, Object a10, Object a11,
99.2249 + Object a12, Object a13, Object a14) throws Throwable {
99.2250 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
99.2251 + a10, a11, a12, a13, a14); }
99.2252 + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
99.2253 + Object a4, Object a5, Object a6, Object a7,
99.2254 + Object a8, Object a9, Object a10, Object a11,
99.2255 + Object a12, Object a13, Object a14) throws Throwable {
99.2256 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
99.2257 + a10, a11, a12, a13, a14); }
99.2258 + protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
99.2259 + Object a4, Object a5, Object a6, Object a7,
99.2260 + Object a8, Object a9, Object a10, Object a11,
99.2261 + Object a12, Object a13, Object a14) throws Throwable {
99.2262 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2263 + filter.invokeExact(a10), a11, a12, a13, a14); }
99.2264 + protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
99.2265 + Object a4, Object a5, Object a6, Object a7,
99.2266 + Object a8, Object a9, Object a10, Object a11,
99.2267 + Object a12, Object a13, Object a14) throws Throwable {
99.2268 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2269 + a10, filter.invokeExact(a11), a12, a13, a14); }
99.2270 + protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
99.2271 + Object a4, Object a5, Object a6, Object a7,
99.2272 + Object a8, Object a9, Object a10, Object a11,
99.2273 + Object a12, Object a13, Object a14) throws Throwable {
99.2274 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2275 + a10, a11, filter.invokeExact(a12), a13, a14); }
99.2276 + protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
99.2277 + Object a4, Object a5, Object a6, Object a7,
99.2278 + Object a8, Object a9, Object a10, Object a11,
99.2279 + Object a12, Object a13, Object a14) throws Throwable {
99.2280 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2281 + a10, a11, a12, filter.invokeExact(a13), a14); }
99.2282 + protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3,
99.2283 + Object a4, Object a5, Object a6, Object a7,
99.2284 + Object a8, Object a9, Object a10, Object a11,
99.2285 + Object a12, Object a13, Object a14) throws Throwable {
99.2286 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2287 + a10, a11, a12, a13, filter.invokeExact(a14)); }
99.2288 + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
99.2289 + Object a4, Object a5, Object a6, Object a7,
99.2290 + Object a8, Object a9, Object a10, Object a11,
99.2291 + Object a12, Object a13, Object a14) throws Throwable {
99.2292 + return target.invokeExact(filter.invokeExact(),
99.2293 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
99.2294 + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
99.2295 + Object a4, Object a5, Object a6, Object a7,
99.2296 + Object a8, Object a9, Object a10, Object a11,
99.2297 + Object a12, Object a13, Object a14) throws Throwable {
99.2298 + return target.invokeExact(filter.invokeExact(a0),
99.2299 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
99.2300 + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
99.2301 + Object a4, Object a5, Object a6, Object a7,
99.2302 + Object a8, Object a9, Object a10, Object a11,
99.2303 + Object a12, Object a13, Object a14) throws Throwable {
99.2304 + return target.invokeExact(filter.invokeExact(a0, a1),
99.2305 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
99.2306 + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
99.2307 + Object a4, Object a5, Object a6, Object a7,
99.2308 + Object a8, Object a9, Object a10, Object a11,
99.2309 + Object a12, Object a13, Object a14) throws Throwable {
99.2310 + return target.invokeExact(filter.invokeExact(a0, a1, a2),
99.2311 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
99.2312 + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
99.2313 + Object a4, Object a5, Object a6, Object a7,
99.2314 + Object a8, Object a9, Object a10, Object a11,
99.2315 + Object a12, Object a13, Object a14) throws Throwable {
99.2316 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
99.2317 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
99.2318 + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
99.2319 + Object a4, Object a5, Object a6, Object a7,
99.2320 + Object a8, Object a9, Object a10, Object a11,
99.2321 + Object a12, Object a13, Object a14) throws Throwable {
99.2322 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
99.2323 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
99.2324 + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
99.2325 + Object a4, Object a5, Object a6, Object a7,
99.2326 + Object a8, Object a9, Object a10, Object a11,
99.2327 + Object a12, Object a13, Object a14) throws Throwable {
99.2328 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
99.2329 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
99.2330 + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
99.2331 + Object a4, Object a5, Object a6, Object a7,
99.2332 + Object a8, Object a9, Object a10, Object a11,
99.2333 + Object a12, Object a13, Object a14) throws Throwable {
99.2334 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
99.2335 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
99.2336 + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
99.2337 + Object a4, Object a5, Object a6, Object a7,
99.2338 + Object a8, Object a9, Object a10, Object a11,
99.2339 + Object a12, Object a13, Object a14) throws Throwable {
99.2340 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
99.2341 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
99.2342 + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
99.2343 + Object a4, Object a5, Object a6, Object a7,
99.2344 + Object a8, Object a9, Object a10, Object a11,
99.2345 + Object a12, Object a13, Object a14) throws Throwable {
99.2346 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
99.2347 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
99.2348 + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
99.2349 + Object a4, Object a5, Object a6, Object a7,
99.2350 + Object a8, Object a9, Object a10, Object a11,
99.2351 + Object a12, Object a13, Object a14) throws Throwable {
99.2352 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
99.2353 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
99.2354 + protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
99.2355 + Object a4, Object a5, Object a6, Object a7,
99.2356 + Object a8, Object a9, Object a10, Object a11,
99.2357 + Object a12, Object a13, Object a14) throws Throwable {
99.2358 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2359 + a10),
99.2360 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
99.2361 + protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
99.2362 + Object a4, Object a5, Object a6, Object a7,
99.2363 + Object a8, Object a9, Object a10, Object a11,
99.2364 + Object a12, Object a13, Object a14) throws Throwable {
99.2365 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2366 + a10, a11),
99.2367 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
99.2368 + protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
99.2369 + Object a4, Object a5, Object a6, Object a7,
99.2370 + Object a8, Object a9, Object a10, Object a11,
99.2371 + Object a12, Object a13, Object a14) throws Throwable {
99.2372 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2373 + a10, a11, a12),
99.2374 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
99.2375 + protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
99.2376 + Object a4, Object a5, Object a6, Object a7,
99.2377 + Object a8, Object a9, Object a10, Object a11,
99.2378 + Object a12, Object a13, Object a14) throws Throwable {
99.2379 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2380 + a10, a11, a12, a13),
99.2381 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
99.2382 + protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3,
99.2383 + Object a4, Object a5, Object a6, Object a7,
99.2384 + Object a8, Object a9, Object a10, Object a11,
99.2385 + Object a12, Object a13, Object a14) throws Throwable {
99.2386 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14),
99.2387 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
99.2388 + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
99.2389 + Object a4, Object a5, Object a6, Object a7,
99.2390 + Object a8, Object a9, Object a10, Object a11,
99.2391 + Object a12, Object a13, Object a14) throws Throwable {
99.2392 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2393 + a10, a11, a12, a13, a14)); }
99.2394 + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
99.2395 + Object a4, Object a5, Object a6, Object a7,
99.2396 + Object a8, Object a9, Object a10, Object a11,
99.2397 + Object a12, Object a13, Object a14) throws Throwable {
99.2398 + return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2399 + a10, a11, a12, a13, a14)); }
99.2400 + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
99.2401 + Object a4, Object a5, Object a6, Object a7,
99.2402 + Object a8, Object a9, Object a10, Object a11,
99.2403 + Object a12, Object a13, Object a14) throws Throwable {
99.2404 + return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
99.2405 + a10, a11, a12, a13, a14)); }
99.2406 + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
99.2407 + Object a4, Object a5, Object a6, Object a7,
99.2408 + Object a8, Object a9, Object a10, Object a11,
99.2409 + Object a12, Object a13, Object a14) throws Throwable {
99.2410 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
99.2411 + a10, a11, a12, a13, a14)); }
99.2412 + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
99.2413 + Object a4, Object a5, Object a6, Object a7,
99.2414 + Object a8, Object a9, Object a10, Object a11,
99.2415 + Object a12, Object a13, Object a14) throws Throwable {
99.2416 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
99.2417 + a10, a11, a12, a13, a14)); }
99.2418 + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
99.2419 + Object a4, Object a5, Object a6, Object a7,
99.2420 + Object a8, Object a9, Object a10, Object a11,
99.2421 + Object a12, Object a13, Object a14) throws Throwable {
99.2422 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
99.2423 + a10, a11, a12, a13, a14)); }
99.2424 + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
99.2425 + Object a4, Object a5, Object a6, Object a7,
99.2426 + Object a8, Object a9, Object a10, Object a11,
99.2427 + Object a12, Object a13, Object a14) throws Throwable {
99.2428 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
99.2429 + a10, a11, a12, a13, a14)); }
99.2430 + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
99.2431 + Object a4, Object a5, Object a6, Object a7,
99.2432 + Object a8, Object a9, Object a10, Object a11,
99.2433 + Object a12, Object a13, Object a14) throws Throwable {
99.2434 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
99.2435 + a10, a11, a12, a13, a14)); }
99.2436 + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
99.2437 + Object a4, Object a5, Object a6, Object a7,
99.2438 + Object a8, Object a9, Object a10, Object a11,
99.2439 + Object a12, Object a13, Object a14) throws Throwable {
99.2440 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
99.2441 + a10, a11, a12, a13, a14)); }
99.2442 + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
99.2443 + Object a4, Object a5, Object a6, Object a7,
99.2444 + Object a8, Object a9, Object a10, Object a11,
99.2445 + Object a12, Object a13, Object a14) throws Throwable {
99.2446 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
99.2447 + a10, a11, a12, a13, a14)); }
99.2448 + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
99.2449 + Object a4, Object a5, Object a6, Object a7,
99.2450 + Object a8, Object a9, Object a10, Object a11,
99.2451 + Object a12, Object a13, Object a14) throws Throwable {
99.2452 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13, a14)); }
99.2453 + protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
99.2454 + Object a4, Object a5, Object a6, Object a7,
99.2455 + Object a8, Object a9, Object a10, Object a11,
99.2456 + Object a12, Object a13, Object a14) throws Throwable {
99.2457 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2458 + a10, filter.invokeExact(a11, a12, a13, a14)); }
99.2459 + protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
99.2460 + Object a4, Object a5, Object a6, Object a7,
99.2461 + Object a8, Object a9, Object a10, Object a11,
99.2462 + Object a12, Object a13, Object a14) throws Throwable {
99.2463 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2464 + a10, a11, filter.invokeExact(a12, a13, a14)); }
99.2465 + protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
99.2466 + Object a4, Object a5, Object a6, Object a7,
99.2467 + Object a8, Object a9, Object a10, Object a11,
99.2468 + Object a12, Object a13, Object a14) throws Throwable {
99.2469 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2470 + a10, a11, a12, filter.invokeExact(a13, a14)); }
99.2471 + protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
99.2472 + Object a4, Object a5, Object a6, Object a7,
99.2473 + Object a8, Object a9, Object a10, Object a11,
99.2474 + Object a12, Object a13, Object a14) throws Throwable {
99.2475 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2476 + a10, a11, a12, a13, filter.invokeExact(a14)); }
99.2477 + protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3,
99.2478 + Object a4, Object a5, Object a6, Object a7,
99.2479 + Object a8, Object a9, Object a10, Object a11,
99.2480 + Object a12, Object a13, Object a14) throws Throwable {
99.2481 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, filter.invokeExact()); }
99.2482 + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
99.2483 + Object a4, Object a5, Object a6, Object a7,
99.2484 + Object a8, Object a9, Object a10, Object a11,
99.2485 + Object a12, Object a13, Object a14) throws Throwable {
99.2486 + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14 };
99.2487 + filter.invokeExact(av); // make the flyby
99.2488 + return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14]); }
99.2489 + }
99.2490 + static class F16 extends Adapter {
99.2491 + protected F16(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.2492 + protected F16(MethodHandle e, MethodHandle f, MethodHandle t) {
99.2493 + super(e, f, t); }
99.2494 + protected F16 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.2495 + return new F16(e, f, t); }
99.2496 + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
99.2497 + Object a4, Object a5, Object a6, Object a7,
99.2498 + Object a8, Object a9, Object a10, Object a11,
99.2499 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2500 + return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2501 + a10, a11, a12, a13, a14, a15); }
99.2502 + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
99.2503 + Object a4, Object a5, Object a6, Object a7,
99.2504 + Object a8, Object a9, Object a10, Object a11,
99.2505 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2506 + return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
99.2507 + a10, a11, a12, a13, a14, a15); }
99.2508 + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
99.2509 + Object a4, Object a5, Object a6, Object a7,
99.2510 + Object a8, Object a9, Object a10, Object a11,
99.2511 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2512 + return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
99.2513 + a10, a11, a12, a13, a14, a15); }
99.2514 + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
99.2515 + Object a4, Object a5, Object a6, Object a7,
99.2516 + Object a8, Object a9, Object a10, Object a11,
99.2517 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2518 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
99.2519 + a10, a11, a12, a13, a14, a15); }
99.2520 + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
99.2521 + Object a4, Object a5, Object a6, Object a7,
99.2522 + Object a8, Object a9, Object a10, Object a11,
99.2523 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2524 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
99.2525 + a10, a11, a12, a13, a14, a15); }
99.2526 + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
99.2527 + Object a4, Object a5, Object a6, Object a7,
99.2528 + Object a8, Object a9, Object a10, Object a11,
99.2529 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2530 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
99.2531 + a10, a11, a12, a13, a14, a15); }
99.2532 + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
99.2533 + Object a4, Object a5, Object a6, Object a7,
99.2534 + Object a8, Object a9, Object a10, Object a11,
99.2535 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2536 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
99.2537 + a10, a11, a12, a13, a14, a15); }
99.2538 + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
99.2539 + Object a4, Object a5, Object a6, Object a7,
99.2540 + Object a8, Object a9, Object a10, Object a11,
99.2541 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2542 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
99.2543 + a10, a11, a12, a13, a14, a15); }
99.2544 + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
99.2545 + Object a4, Object a5, Object a6, Object a7,
99.2546 + Object a8, Object a9, Object a10, Object a11,
99.2547 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2548 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
99.2549 + a10, a11, a12, a13, a14, a15); }
99.2550 + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
99.2551 + Object a4, Object a5, Object a6, Object a7,
99.2552 + Object a8, Object a9, Object a10, Object a11,
99.2553 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2554 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
99.2555 + a10, a11, a12, a13, a14, a15); }
99.2556 + protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
99.2557 + Object a4, Object a5, Object a6, Object a7,
99.2558 + Object a8, Object a9, Object a10, Object a11,
99.2559 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2560 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2561 + filter.invokeExact(a10), a11, a12, a13, a14, a15); }
99.2562 + protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
99.2563 + Object a4, Object a5, Object a6, Object a7,
99.2564 + Object a8, Object a9, Object a10, Object a11,
99.2565 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2566 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2567 + a10, filter.invokeExact(a11), a12, a13, a14, a15); }
99.2568 + protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
99.2569 + Object a4, Object a5, Object a6, Object a7,
99.2570 + Object a8, Object a9, Object a10, Object a11,
99.2571 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2572 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2573 + a10, a11, filter.invokeExact(a12), a13, a14, a15); }
99.2574 + protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
99.2575 + Object a4, Object a5, Object a6, Object a7,
99.2576 + Object a8, Object a9, Object a10, Object a11,
99.2577 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2578 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2579 + a10, a11, a12, filter.invokeExact(a13), a14, a15); }
99.2580 + protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3,
99.2581 + Object a4, Object a5, Object a6, Object a7,
99.2582 + Object a8, Object a9, Object a10, Object a11,
99.2583 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2584 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2585 + a10, a11, a12, a13, filter.invokeExact(a14), a15); }
99.2586 + protected Object invoke_V15(Object a0, Object a1, Object a2, Object a3,
99.2587 + Object a4, Object a5, Object a6, Object a7,
99.2588 + Object a8, Object a9, Object a10, Object a11,
99.2589 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2590 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2591 + a10, a11, a12, a13, a14, filter.invokeExact(a15)); }
99.2592 + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
99.2593 + Object a4, Object a5, Object a6, Object a7,
99.2594 + Object a8, Object a9, Object a10, Object a11,
99.2595 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2596 + return target.invokeExact(filter.invokeExact(),
99.2597 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
99.2598 + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
99.2599 + Object a4, Object a5, Object a6, Object a7,
99.2600 + Object a8, Object a9, Object a10, Object a11,
99.2601 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2602 + return target.invokeExact(filter.invokeExact(a0),
99.2603 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
99.2604 + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
99.2605 + Object a4, Object a5, Object a6, Object a7,
99.2606 + Object a8, Object a9, Object a10, Object a11,
99.2607 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2608 + return target.invokeExact(filter.invokeExact(a0, a1),
99.2609 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
99.2610 + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
99.2611 + Object a4, Object a5, Object a6, Object a7,
99.2612 + Object a8, Object a9, Object a10, Object a11,
99.2613 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2614 + return target.invokeExact(filter.invokeExact(a0, a1, a2),
99.2615 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
99.2616 + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
99.2617 + Object a4, Object a5, Object a6, Object a7,
99.2618 + Object a8, Object a9, Object a10, Object a11,
99.2619 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2620 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
99.2621 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
99.2622 + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
99.2623 + Object a4, Object a5, Object a6, Object a7,
99.2624 + Object a8, Object a9, Object a10, Object a11,
99.2625 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2626 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
99.2627 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
99.2628 + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
99.2629 + Object a4, Object a5, Object a6, Object a7,
99.2630 + Object a8, Object a9, Object a10, Object a11,
99.2631 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2632 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
99.2633 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
99.2634 + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
99.2635 + Object a4, Object a5, Object a6, Object a7,
99.2636 + Object a8, Object a9, Object a10, Object a11,
99.2637 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2638 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
99.2639 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
99.2640 + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
99.2641 + Object a4, Object a5, Object a6, Object a7,
99.2642 + Object a8, Object a9, Object a10, Object a11,
99.2643 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2644 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
99.2645 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
99.2646 + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
99.2647 + Object a4, Object a5, Object a6, Object a7,
99.2648 + Object a8, Object a9, Object a10, Object a11,
99.2649 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2650 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
99.2651 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
99.2652 + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
99.2653 + Object a4, Object a5, Object a6, Object a7,
99.2654 + Object a8, Object a9, Object a10, Object a11,
99.2655 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2656 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
99.2657 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
99.2658 + protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
99.2659 + Object a4, Object a5, Object a6, Object a7,
99.2660 + Object a8, Object a9, Object a10, Object a11,
99.2661 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2662 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2663 + a10),
99.2664 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
99.2665 + protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
99.2666 + Object a4, Object a5, Object a6, Object a7,
99.2667 + Object a8, Object a9, Object a10, Object a11,
99.2668 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2669 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2670 + a10, a11),
99.2671 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
99.2672 + protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
99.2673 + Object a4, Object a5, Object a6, Object a7,
99.2674 + Object a8, Object a9, Object a10, Object a11,
99.2675 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2676 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2677 + a10, a11, a12),
99.2678 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
99.2679 + protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
99.2680 + Object a4, Object a5, Object a6, Object a7,
99.2681 + Object a8, Object a9, Object a10, Object a11,
99.2682 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2683 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2684 + a10, a11, a12, a13),
99.2685 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
99.2686 + protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3,
99.2687 + Object a4, Object a5, Object a6, Object a7,
99.2688 + Object a8, Object a9, Object a10, Object a11,
99.2689 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2690 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2691 + a10, a11, a12, a13, a14),
99.2692 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
99.2693 + protected Object invoke_F16(Object a0, Object a1, Object a2, Object a3,
99.2694 + Object a4, Object a5, Object a6, Object a7,
99.2695 + Object a8, Object a9, Object a10, Object a11,
99.2696 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2697 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15),
99.2698 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
99.2699 + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
99.2700 + Object a4, Object a5, Object a6, Object a7,
99.2701 + Object a8, Object a9, Object a10, Object a11,
99.2702 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2703 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2704 + a10, a11, a12, a13, a14, a15)); }
99.2705 + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
99.2706 + Object a4, Object a5, Object a6, Object a7,
99.2707 + Object a8, Object a9, Object a10, Object a11,
99.2708 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2709 + return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2710 + a10, a11, a12, a13, a14, a15)); }
99.2711 + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
99.2712 + Object a4, Object a5, Object a6, Object a7,
99.2713 + Object a8, Object a9, Object a10, Object a11,
99.2714 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2715 + return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
99.2716 + a10, a11, a12, a13, a14, a15)); }
99.2717 + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
99.2718 + Object a4, Object a5, Object a6, Object a7,
99.2719 + Object a8, Object a9, Object a10, Object a11,
99.2720 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2721 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
99.2722 + a10, a11, a12, a13, a14, a15)); }
99.2723 + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
99.2724 + Object a4, Object a5, Object a6, Object a7,
99.2725 + Object a8, Object a9, Object a10, Object a11,
99.2726 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2727 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
99.2728 + a10, a11, a12, a13, a14, a15)); }
99.2729 + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
99.2730 + Object a4, Object a5, Object a6, Object a7,
99.2731 + Object a8, Object a9, Object a10, Object a11,
99.2732 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2733 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
99.2734 + a10, a11, a12, a13, a14, a15)); }
99.2735 + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
99.2736 + Object a4, Object a5, Object a6, Object a7,
99.2737 + Object a8, Object a9, Object a10, Object a11,
99.2738 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2739 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
99.2740 + a10, a11, a12, a13, a14, a15)); }
99.2741 + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
99.2742 + Object a4, Object a5, Object a6, Object a7,
99.2743 + Object a8, Object a9, Object a10, Object a11,
99.2744 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2745 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
99.2746 + a10, a11, a12, a13, a14, a15)); }
99.2747 + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
99.2748 + Object a4, Object a5, Object a6, Object a7,
99.2749 + Object a8, Object a9, Object a10, Object a11,
99.2750 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2751 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
99.2752 + a10, a11, a12, a13, a14, a15)); }
99.2753 + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
99.2754 + Object a4, Object a5, Object a6, Object a7,
99.2755 + Object a8, Object a9, Object a10, Object a11,
99.2756 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2757 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
99.2758 + a10, a11, a12, a13, a14, a15)); }
99.2759 + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
99.2760 + Object a4, Object a5, Object a6, Object a7,
99.2761 + Object a8, Object a9, Object a10, Object a11,
99.2762 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2763 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13, a14, a15)); }
99.2764 + protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
99.2765 + Object a4, Object a5, Object a6, Object a7,
99.2766 + Object a8, Object a9, Object a10, Object a11,
99.2767 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2768 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2769 + a10, filter.invokeExact(a11, a12, a13, a14, a15)); }
99.2770 + protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
99.2771 + Object a4, Object a5, Object a6, Object a7,
99.2772 + Object a8, Object a9, Object a10, Object a11,
99.2773 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2774 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2775 + a10, a11, filter.invokeExact(a12, a13, a14, a15)); }
99.2776 + protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
99.2777 + Object a4, Object a5, Object a6, Object a7,
99.2778 + Object a8, Object a9, Object a10, Object a11,
99.2779 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2780 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2781 + a10, a11, a12, filter.invokeExact(a13, a14, a15)); }
99.2782 + protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
99.2783 + Object a4, Object a5, Object a6, Object a7,
99.2784 + Object a8, Object a9, Object a10, Object a11,
99.2785 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2786 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2787 + a10, a11, a12, a13, filter.invokeExact(a14, a15)); }
99.2788 + protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3,
99.2789 + Object a4, Object a5, Object a6, Object a7,
99.2790 + Object a8, Object a9, Object a10, Object a11,
99.2791 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2792 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2793 + a10, a11, a12, a13, a14, filter.invokeExact(a15)); }
99.2794 + protected Object invoke_C16(Object a0, Object a1, Object a2, Object a3,
99.2795 + Object a4, Object a5, Object a6, Object a7,
99.2796 + Object a8, Object a9, Object a10, Object a11,
99.2797 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2798 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, filter.invokeExact()); }
99.2799 + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
99.2800 + Object a4, Object a5, Object a6, Object a7,
99.2801 + Object a8, Object a9, Object a10, Object a11,
99.2802 + Object a12, Object a13, Object a14, Object a15) throws Throwable {
99.2803 + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 };
99.2804 + filter.invokeExact(av); // make the flyby
99.2805 + return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14], av[15]); }
99.2806 + }
99.2807 + static class F17 extends Adapter {
99.2808 + protected F17(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.2809 + protected F17(MethodHandle e, MethodHandle f, MethodHandle t) {
99.2810 + super(e, f, t); }
99.2811 + protected F17 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.2812 + return new F17(e, f, t); }
99.2813 + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
99.2814 + Object a4, Object a5, Object a6, Object a7,
99.2815 + Object a8, Object a9, Object a10, Object a11,
99.2816 + Object a12, Object a13, Object a14, Object a15,
99.2817 + Object a16) throws Throwable {
99.2818 + return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2819 + a10, a11, a12, a13, a14, a15, a16); }
99.2820 + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
99.2821 + Object a4, Object a5, Object a6, Object a7,
99.2822 + Object a8, Object a9, Object a10, Object a11,
99.2823 + Object a12, Object a13, Object a14, Object a15,
99.2824 + Object a16) throws Throwable {
99.2825 + return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
99.2826 + a10, a11, a12, a13, a14, a15, a16); }
99.2827 + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
99.2828 + Object a4, Object a5, Object a6, Object a7,
99.2829 + Object a8, Object a9, Object a10, Object a11,
99.2830 + Object a12, Object a13, Object a14, Object a15,
99.2831 + Object a16) throws Throwable {
99.2832 + return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
99.2833 + a10, a11, a12, a13, a14, a15, a16); }
99.2834 + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
99.2835 + Object a4, Object a5, Object a6, Object a7,
99.2836 + Object a8, Object a9, Object a10, Object a11,
99.2837 + Object a12, Object a13, Object a14, Object a15,
99.2838 + Object a16) throws Throwable {
99.2839 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
99.2840 + a10, a11, a12, a13, a14, a15, a16); }
99.2841 + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
99.2842 + Object a4, Object a5, Object a6, Object a7,
99.2843 + Object a8, Object a9, Object a10, Object a11,
99.2844 + Object a12, Object a13, Object a14, Object a15,
99.2845 + Object a16) throws Throwable {
99.2846 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
99.2847 + a10, a11, a12, a13, a14, a15, a16); }
99.2848 + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
99.2849 + Object a4, Object a5, Object a6, Object a7,
99.2850 + Object a8, Object a9, Object a10, Object a11,
99.2851 + Object a12, Object a13, Object a14, Object a15,
99.2852 + Object a16) throws Throwable {
99.2853 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
99.2854 + a10, a11, a12, a13, a14, a15, a16); }
99.2855 + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
99.2856 + Object a4, Object a5, Object a6, Object a7,
99.2857 + Object a8, Object a9, Object a10, Object a11,
99.2858 + Object a12, Object a13, Object a14, Object a15,
99.2859 + Object a16) throws Throwable {
99.2860 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
99.2861 + a10, a11, a12, a13, a14, a15, a16); }
99.2862 + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
99.2863 + Object a4, Object a5, Object a6, Object a7,
99.2864 + Object a8, Object a9, Object a10, Object a11,
99.2865 + Object a12, Object a13, Object a14, Object a15,
99.2866 + Object a16) throws Throwable {
99.2867 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
99.2868 + a10, a11, a12, a13, a14, a15, a16); }
99.2869 + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
99.2870 + Object a4, Object a5, Object a6, Object a7,
99.2871 + Object a8, Object a9, Object a10, Object a11,
99.2872 + Object a12, Object a13, Object a14, Object a15,
99.2873 + Object a16) throws Throwable {
99.2874 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
99.2875 + a10, a11, a12, a13, a14, a15, a16); }
99.2876 + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
99.2877 + Object a4, Object a5, Object a6, Object a7,
99.2878 + Object a8, Object a9, Object a10, Object a11,
99.2879 + Object a12, Object a13, Object a14, Object a15,
99.2880 + Object a16) throws Throwable {
99.2881 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
99.2882 + a10, a11, a12, a13, a14, a15, a16); }
99.2883 + protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
99.2884 + Object a4, Object a5, Object a6, Object a7,
99.2885 + Object a8, Object a9, Object a10, Object a11,
99.2886 + Object a12, Object a13, Object a14, Object a15,
99.2887 + Object a16) throws Throwable {
99.2888 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2889 + filter.invokeExact(a10), a11, a12, a13, a14, a15, a16); }
99.2890 + protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
99.2891 + Object a4, Object a5, Object a6, Object a7,
99.2892 + Object a8, Object a9, Object a10, Object a11,
99.2893 + Object a12, Object a13, Object a14, Object a15,
99.2894 + Object a16) throws Throwable {
99.2895 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2896 + a10, filter.invokeExact(a11), a12, a13, a14, a15, a16); }
99.2897 + protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
99.2898 + Object a4, Object a5, Object a6, Object a7,
99.2899 + Object a8, Object a9, Object a10, Object a11,
99.2900 + Object a12, Object a13, Object a14, Object a15,
99.2901 + Object a16) throws Throwable {
99.2902 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2903 + a10, a11, filter.invokeExact(a12), a13, a14, a15, a16); }
99.2904 + protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
99.2905 + Object a4, Object a5, Object a6, Object a7,
99.2906 + Object a8, Object a9, Object a10, Object a11,
99.2907 + Object a12, Object a13, Object a14, Object a15,
99.2908 + Object a16) throws Throwable {
99.2909 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2910 + a10, a11, a12, filter.invokeExact(a13), a14, a15, a16); }
99.2911 + protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3,
99.2912 + Object a4, Object a5, Object a6, Object a7,
99.2913 + Object a8, Object a9, Object a10, Object a11,
99.2914 + Object a12, Object a13, Object a14, Object a15,
99.2915 + Object a16) throws Throwable {
99.2916 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2917 + a10, a11, a12, a13, filter.invokeExact(a14), a15, a16); }
99.2918 + protected Object invoke_V15(Object a0, Object a1, Object a2, Object a3,
99.2919 + Object a4, Object a5, Object a6, Object a7,
99.2920 + Object a8, Object a9, Object a10, Object a11,
99.2921 + Object a12, Object a13, Object a14, Object a15,
99.2922 + Object a16) throws Throwable {
99.2923 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2924 + a10, a11, a12, a13, a14, filter.invokeExact(a15), a16); }
99.2925 + protected Object invoke_V16(Object a0, Object a1, Object a2, Object a3,
99.2926 + Object a4, Object a5, Object a6, Object a7,
99.2927 + Object a8, Object a9, Object a10, Object a11,
99.2928 + Object a12, Object a13, Object a14, Object a15,
99.2929 + Object a16) throws Throwable {
99.2930 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.2931 + a10, a11, a12, a13, a14, a15, filter.invokeExact(a16)); }
99.2932 + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
99.2933 + Object a4, Object a5, Object a6, Object a7,
99.2934 + Object a8, Object a9, Object a10, Object a11,
99.2935 + Object a12, Object a13, Object a14, Object a15,
99.2936 + Object a16) throws Throwable {
99.2937 + return target.invokeExact(filter.invokeExact(),
99.2938 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
99.2939 + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
99.2940 + Object a4, Object a5, Object a6, Object a7,
99.2941 + Object a8, Object a9, Object a10, Object a11,
99.2942 + Object a12, Object a13, Object a14, Object a15,
99.2943 + Object a16) throws Throwable {
99.2944 + return target.invokeExact(filter.invokeExact(a0),
99.2945 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
99.2946 + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
99.2947 + Object a4, Object a5, Object a6, Object a7,
99.2948 + Object a8, Object a9, Object a10, Object a11,
99.2949 + Object a12, Object a13, Object a14, Object a15,
99.2950 + Object a16) throws Throwable {
99.2951 + return target.invokeExact(filter.invokeExact(a0, a1),
99.2952 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
99.2953 + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
99.2954 + Object a4, Object a5, Object a6, Object a7,
99.2955 + Object a8, Object a9, Object a10, Object a11,
99.2956 + Object a12, Object a13, Object a14, Object a15,
99.2957 + Object a16) throws Throwable {
99.2958 + return target.invokeExact(filter.invokeExact(a0, a1, a2),
99.2959 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
99.2960 + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
99.2961 + Object a4, Object a5, Object a6, Object a7,
99.2962 + Object a8, Object a9, Object a10, Object a11,
99.2963 + Object a12, Object a13, Object a14, Object a15,
99.2964 + Object a16) throws Throwable {
99.2965 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
99.2966 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
99.2967 + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
99.2968 + Object a4, Object a5, Object a6, Object a7,
99.2969 + Object a8, Object a9, Object a10, Object a11,
99.2970 + Object a12, Object a13, Object a14, Object a15,
99.2971 + Object a16) throws Throwable {
99.2972 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
99.2973 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
99.2974 + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
99.2975 + Object a4, Object a5, Object a6, Object a7,
99.2976 + Object a8, Object a9, Object a10, Object a11,
99.2977 + Object a12, Object a13, Object a14, Object a15,
99.2978 + Object a16) throws Throwable {
99.2979 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
99.2980 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
99.2981 + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
99.2982 + Object a4, Object a5, Object a6, Object a7,
99.2983 + Object a8, Object a9, Object a10, Object a11,
99.2984 + Object a12, Object a13, Object a14, Object a15,
99.2985 + Object a16) throws Throwable {
99.2986 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
99.2987 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
99.2988 + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
99.2989 + Object a4, Object a5, Object a6, Object a7,
99.2990 + Object a8, Object a9, Object a10, Object a11,
99.2991 + Object a12, Object a13, Object a14, Object a15,
99.2992 + Object a16) throws Throwable {
99.2993 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
99.2994 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
99.2995 + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
99.2996 + Object a4, Object a5, Object a6, Object a7,
99.2997 + Object a8, Object a9, Object a10, Object a11,
99.2998 + Object a12, Object a13, Object a14, Object a15,
99.2999 + Object a16) throws Throwable {
99.3000 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
99.3001 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
99.3002 + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
99.3003 + Object a4, Object a5, Object a6, Object a7,
99.3004 + Object a8, Object a9, Object a10, Object a11,
99.3005 + Object a12, Object a13, Object a14, Object a15,
99.3006 + Object a16) throws Throwable {
99.3007 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
99.3008 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
99.3009 + protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
99.3010 + Object a4, Object a5, Object a6, Object a7,
99.3011 + Object a8, Object a9, Object a10, Object a11,
99.3012 + Object a12, Object a13, Object a14, Object a15,
99.3013 + Object a16) throws Throwable {
99.3014 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3015 + a10),
99.3016 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
99.3017 + protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
99.3018 + Object a4, Object a5, Object a6, Object a7,
99.3019 + Object a8, Object a9, Object a10, Object a11,
99.3020 + Object a12, Object a13, Object a14, Object a15,
99.3021 + Object a16) throws Throwable {
99.3022 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3023 + a10, a11),
99.3024 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
99.3025 + protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
99.3026 + Object a4, Object a5, Object a6, Object a7,
99.3027 + Object a8, Object a9, Object a10, Object a11,
99.3028 + Object a12, Object a13, Object a14, Object a15,
99.3029 + Object a16) throws Throwable {
99.3030 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3031 + a10, a11, a12),
99.3032 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
99.3033 + protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
99.3034 + Object a4, Object a5, Object a6, Object a7,
99.3035 + Object a8, Object a9, Object a10, Object a11,
99.3036 + Object a12, Object a13, Object a14, Object a15,
99.3037 + Object a16) throws Throwable {
99.3038 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3039 + a10, a11, a12, a13),
99.3040 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
99.3041 + protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3,
99.3042 + Object a4, Object a5, Object a6, Object a7,
99.3043 + Object a8, Object a9, Object a10, Object a11,
99.3044 + Object a12, Object a13, Object a14, Object a15,
99.3045 + Object a16) throws Throwable {
99.3046 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3047 + a10, a11, a12, a13, a14),
99.3048 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
99.3049 + protected Object invoke_F16(Object a0, Object a1, Object a2, Object a3,
99.3050 + Object a4, Object a5, Object a6, Object a7,
99.3051 + Object a8, Object a9, Object a10, Object a11,
99.3052 + Object a12, Object a13, Object a14, Object a15,
99.3053 + Object a16) throws Throwable {
99.3054 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3055 + a10, a11, a12, a13, a14, a15),
99.3056 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
99.3057 + protected Object invoke_F17(Object a0, Object a1, Object a2, Object a3,
99.3058 + Object a4, Object a5, Object a6, Object a7,
99.3059 + Object a8, Object a9, Object a10, Object a11,
99.3060 + Object a12, Object a13, Object a14, Object a15,
99.3061 + Object a16) throws Throwable {
99.3062 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16),
99.3063 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
99.3064 + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
99.3065 + Object a4, Object a5, Object a6, Object a7,
99.3066 + Object a8, Object a9, Object a10, Object a11,
99.3067 + Object a12, Object a13, Object a14, Object a15,
99.3068 + Object a16) throws Throwable {
99.3069 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3070 + a10, a11, a12, a13, a14, a15, a16)); }
99.3071 + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
99.3072 + Object a4, Object a5, Object a6, Object a7,
99.3073 + Object a8, Object a9, Object a10, Object a11,
99.3074 + Object a12, Object a13, Object a14, Object a15,
99.3075 + Object a16) throws Throwable {
99.3076 + return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3077 + a10, a11, a12, a13, a14, a15, a16)); }
99.3078 + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
99.3079 + Object a4, Object a5, Object a6, Object a7,
99.3080 + Object a8, Object a9, Object a10, Object a11,
99.3081 + Object a12, Object a13, Object a14, Object a15,
99.3082 + Object a16) throws Throwable {
99.3083 + return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
99.3084 + a10, a11, a12, a13, a14, a15, a16)); }
99.3085 + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
99.3086 + Object a4, Object a5, Object a6, Object a7,
99.3087 + Object a8, Object a9, Object a10, Object a11,
99.3088 + Object a12, Object a13, Object a14, Object a15,
99.3089 + Object a16) throws Throwable {
99.3090 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
99.3091 + a10, a11, a12, a13, a14, a15, a16)); }
99.3092 + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
99.3093 + Object a4, Object a5, Object a6, Object a7,
99.3094 + Object a8, Object a9, Object a10, Object a11,
99.3095 + Object a12, Object a13, Object a14, Object a15,
99.3096 + Object a16) throws Throwable {
99.3097 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
99.3098 + a10, a11, a12, a13, a14, a15, a16)); }
99.3099 + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
99.3100 + Object a4, Object a5, Object a6, Object a7,
99.3101 + Object a8, Object a9, Object a10, Object a11,
99.3102 + Object a12, Object a13, Object a14, Object a15,
99.3103 + Object a16) throws Throwable {
99.3104 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
99.3105 + a10, a11, a12, a13, a14, a15, a16)); }
99.3106 + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
99.3107 + Object a4, Object a5, Object a6, Object a7,
99.3108 + Object a8, Object a9, Object a10, Object a11,
99.3109 + Object a12, Object a13, Object a14, Object a15,
99.3110 + Object a16) throws Throwable {
99.3111 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
99.3112 + a10, a11, a12, a13, a14, a15, a16)); }
99.3113 + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
99.3114 + Object a4, Object a5, Object a6, Object a7,
99.3115 + Object a8, Object a9, Object a10, Object a11,
99.3116 + Object a12, Object a13, Object a14, Object a15,
99.3117 + Object a16) throws Throwable {
99.3118 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
99.3119 + a10, a11, a12, a13, a14, a15, a16)); }
99.3120 + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
99.3121 + Object a4, Object a5, Object a6, Object a7,
99.3122 + Object a8, Object a9, Object a10, Object a11,
99.3123 + Object a12, Object a13, Object a14, Object a15,
99.3124 + Object a16) throws Throwable {
99.3125 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
99.3126 + a10, a11, a12, a13, a14, a15, a16)); }
99.3127 + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
99.3128 + Object a4, Object a5, Object a6, Object a7,
99.3129 + Object a8, Object a9, Object a10, Object a11,
99.3130 + Object a12, Object a13, Object a14, Object a15,
99.3131 + Object a16) throws Throwable {
99.3132 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
99.3133 + a10, a11, a12, a13, a14, a15, a16)); }
99.3134 + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
99.3135 + Object a4, Object a5, Object a6, Object a7,
99.3136 + Object a8, Object a9, Object a10, Object a11,
99.3137 + Object a12, Object a13, Object a14, Object a15,
99.3138 + Object a16) throws Throwable {
99.3139 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13, a14, a15, a16)); }
99.3140 + protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
99.3141 + Object a4, Object a5, Object a6, Object a7,
99.3142 + Object a8, Object a9, Object a10, Object a11,
99.3143 + Object a12, Object a13, Object a14, Object a15,
99.3144 + Object a16) throws Throwable {
99.3145 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3146 + a10, filter.invokeExact(a11, a12, a13, a14, a15, a16)); }
99.3147 + protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
99.3148 + Object a4, Object a5, Object a6, Object a7,
99.3149 + Object a8, Object a9, Object a10, Object a11,
99.3150 + Object a12, Object a13, Object a14, Object a15,
99.3151 + Object a16) throws Throwable {
99.3152 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3153 + a10, a11, filter.invokeExact(a12, a13, a14, a15, a16)); }
99.3154 + protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
99.3155 + Object a4, Object a5, Object a6, Object a7,
99.3156 + Object a8, Object a9, Object a10, Object a11,
99.3157 + Object a12, Object a13, Object a14, Object a15,
99.3158 + Object a16) throws Throwable {
99.3159 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3160 + a10, a11, a12, filter.invokeExact(a13, a14, a15, a16)); }
99.3161 + protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
99.3162 + Object a4, Object a5, Object a6, Object a7,
99.3163 + Object a8, Object a9, Object a10, Object a11,
99.3164 + Object a12, Object a13, Object a14, Object a15,
99.3165 + Object a16) throws Throwable {
99.3166 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3167 + a10, a11, a12, a13, filter.invokeExact(a14, a15, a16)); }
99.3168 + protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3,
99.3169 + Object a4, Object a5, Object a6, Object a7,
99.3170 + Object a8, Object a9, Object a10, Object a11,
99.3171 + Object a12, Object a13, Object a14, Object a15,
99.3172 + Object a16) throws Throwable {
99.3173 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3174 + a10, a11, a12, a13, a14, filter.invokeExact(a15, a16)); }
99.3175 + protected Object invoke_C16(Object a0, Object a1, Object a2, Object a3,
99.3176 + Object a4, Object a5, Object a6, Object a7,
99.3177 + Object a8, Object a9, Object a10, Object a11,
99.3178 + Object a12, Object a13, Object a14, Object a15,
99.3179 + Object a16) throws Throwable {
99.3180 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3181 + a10, a11, a12, a13, a14, a15, filter.invokeExact(a16)); }
99.3182 + protected Object invoke_C17(Object a0, Object a1, Object a2, Object a3,
99.3183 + Object a4, Object a5, Object a6, Object a7,
99.3184 + Object a8, Object a9, Object a10, Object a11,
99.3185 + Object a12, Object a13, Object a14, Object a15,
99.3186 + Object a16) throws Throwable {
99.3187 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, filter.invokeExact()); }
99.3188 + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
99.3189 + Object a4, Object a5, Object a6, Object a7,
99.3190 + Object a8, Object a9, Object a10, Object a11,
99.3191 + Object a12, Object a13, Object a14, Object a15,
99.3192 + Object a16) throws Throwable {
99.3193 + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16 };
99.3194 + filter.invokeExact(av); // make the flyby
99.3195 + return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14], av[15], av[16]); }
99.3196 + }
99.3197 + static class F18 extends Adapter {
99.3198 + protected F18(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.3199 + protected F18(MethodHandle e, MethodHandle f, MethodHandle t) {
99.3200 + super(e, f, t); }
99.3201 + protected F18 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.3202 + return new F18(e, f, t); }
99.3203 + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
99.3204 + Object a4, Object a5, Object a6, Object a7,
99.3205 + Object a8, Object a9, Object a10, Object a11,
99.3206 + Object a12, Object a13, Object a14, Object a15,
99.3207 + Object a16, Object a17) throws Throwable {
99.3208 + return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3209 + a10, a11, a12, a13, a14, a15, a16, a17); }
99.3210 + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
99.3211 + Object a4, Object a5, Object a6, Object a7,
99.3212 + Object a8, Object a9, Object a10, Object a11,
99.3213 + Object a12, Object a13, Object a14, Object a15,
99.3214 + Object a16, Object a17) throws Throwable {
99.3215 + return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
99.3216 + a10, a11, a12, a13, a14, a15, a16, a17); }
99.3217 + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
99.3218 + Object a4, Object a5, Object a6, Object a7,
99.3219 + Object a8, Object a9, Object a10, Object a11,
99.3220 + Object a12, Object a13, Object a14, Object a15,
99.3221 + Object a16, Object a17) throws Throwable {
99.3222 + return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
99.3223 + a10, a11, a12, a13, a14, a15, a16, a17); }
99.3224 + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
99.3225 + Object a4, Object a5, Object a6, Object a7,
99.3226 + Object a8, Object a9, Object a10, Object a11,
99.3227 + Object a12, Object a13, Object a14, Object a15,
99.3228 + Object a16, Object a17) throws Throwable {
99.3229 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
99.3230 + a10, a11, a12, a13, a14, a15, a16, a17); }
99.3231 + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
99.3232 + Object a4, Object a5, Object a6, Object a7,
99.3233 + Object a8, Object a9, Object a10, Object a11,
99.3234 + Object a12, Object a13, Object a14, Object a15,
99.3235 + Object a16, Object a17) throws Throwable {
99.3236 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
99.3237 + a10, a11, a12, a13, a14, a15, a16, a17); }
99.3238 + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
99.3239 + Object a4, Object a5, Object a6, Object a7,
99.3240 + Object a8, Object a9, Object a10, Object a11,
99.3241 + Object a12, Object a13, Object a14, Object a15,
99.3242 + Object a16, Object a17) throws Throwable {
99.3243 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
99.3244 + a10, a11, a12, a13, a14, a15, a16, a17); }
99.3245 + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
99.3246 + Object a4, Object a5, Object a6, Object a7,
99.3247 + Object a8, Object a9, Object a10, Object a11,
99.3248 + Object a12, Object a13, Object a14, Object a15,
99.3249 + Object a16, Object a17) throws Throwable {
99.3250 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
99.3251 + a10, a11, a12, a13, a14, a15, a16, a17); }
99.3252 + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
99.3253 + Object a4, Object a5, Object a6, Object a7,
99.3254 + Object a8, Object a9, Object a10, Object a11,
99.3255 + Object a12, Object a13, Object a14, Object a15,
99.3256 + Object a16, Object a17) throws Throwable {
99.3257 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
99.3258 + a10, a11, a12, a13, a14, a15, a16, a17); }
99.3259 + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
99.3260 + Object a4, Object a5, Object a6, Object a7,
99.3261 + Object a8, Object a9, Object a10, Object a11,
99.3262 + Object a12, Object a13, Object a14, Object a15,
99.3263 + Object a16, Object a17) throws Throwable {
99.3264 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
99.3265 + a10, a11, a12, a13, a14, a15, a16, a17); }
99.3266 + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
99.3267 + Object a4, Object a5, Object a6, Object a7,
99.3268 + Object a8, Object a9, Object a10, Object a11,
99.3269 + Object a12, Object a13, Object a14, Object a15,
99.3270 + Object a16, Object a17) throws Throwable {
99.3271 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
99.3272 + a10, a11, a12, a13, a14, a15, a16, a17); }
99.3273 + protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
99.3274 + Object a4, Object a5, Object a6, Object a7,
99.3275 + Object a8, Object a9, Object a10, Object a11,
99.3276 + Object a12, Object a13, Object a14, Object a15,
99.3277 + Object a16, Object a17) throws Throwable {
99.3278 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3279 + filter.invokeExact(a10), a11, a12, a13, a14, a15, a16, a17); }
99.3280 + protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
99.3281 + Object a4, Object a5, Object a6, Object a7,
99.3282 + Object a8, Object a9, Object a10, Object a11,
99.3283 + Object a12, Object a13, Object a14, Object a15,
99.3284 + Object a16, Object a17) throws Throwable {
99.3285 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3286 + a10, filter.invokeExact(a11), a12, a13, a14, a15, a16, a17); }
99.3287 + protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
99.3288 + Object a4, Object a5, Object a6, Object a7,
99.3289 + Object a8, Object a9, Object a10, Object a11,
99.3290 + Object a12, Object a13, Object a14, Object a15,
99.3291 + Object a16, Object a17) throws Throwable {
99.3292 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3293 + a10, a11, filter.invokeExact(a12), a13, a14, a15, a16, a17); }
99.3294 + protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
99.3295 + Object a4, Object a5, Object a6, Object a7,
99.3296 + Object a8, Object a9, Object a10, Object a11,
99.3297 + Object a12, Object a13, Object a14, Object a15,
99.3298 + Object a16, Object a17) throws Throwable {
99.3299 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3300 + a10, a11, a12, filter.invokeExact(a13), a14, a15, a16, a17); }
99.3301 + protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3,
99.3302 + Object a4, Object a5, Object a6, Object a7,
99.3303 + Object a8, Object a9, Object a10, Object a11,
99.3304 + Object a12, Object a13, Object a14, Object a15,
99.3305 + Object a16, Object a17) throws Throwable {
99.3306 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3307 + a10, a11, a12, a13, filter.invokeExact(a14), a15, a16, a17); }
99.3308 + protected Object invoke_V15(Object a0, Object a1, Object a2, Object a3,
99.3309 + Object a4, Object a5, Object a6, Object a7,
99.3310 + Object a8, Object a9, Object a10, Object a11,
99.3311 + Object a12, Object a13, Object a14, Object a15,
99.3312 + Object a16, Object a17) throws Throwable {
99.3313 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3314 + a10, a11, a12, a13, a14, filter.invokeExact(a15), a16, a17); }
99.3315 + protected Object invoke_V16(Object a0, Object a1, Object a2, Object a3,
99.3316 + Object a4, Object a5, Object a6, Object a7,
99.3317 + Object a8, Object a9, Object a10, Object a11,
99.3318 + Object a12, Object a13, Object a14, Object a15,
99.3319 + Object a16, Object a17) throws Throwable {
99.3320 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3321 + a10, a11, a12, a13, a14, a15, filter.invokeExact(a16), a17); }
99.3322 + protected Object invoke_V17(Object a0, Object a1, Object a2, Object a3,
99.3323 + Object a4, Object a5, Object a6, Object a7,
99.3324 + Object a8, Object a9, Object a10, Object a11,
99.3325 + Object a12, Object a13, Object a14, Object a15,
99.3326 + Object a16, Object a17) throws Throwable {
99.3327 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3328 + a10, a11, a12, a13, a14, a15, a16, filter.invokeExact(a17)); }
99.3329 + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
99.3330 + Object a4, Object a5, Object a6, Object a7,
99.3331 + Object a8, Object a9, Object a10, Object a11,
99.3332 + Object a12, Object a13, Object a14, Object a15,
99.3333 + Object a16, Object a17) throws Throwable {
99.3334 + return target.invokeExact(filter.invokeExact(),
99.3335 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
99.3336 + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
99.3337 + Object a4, Object a5, Object a6, Object a7,
99.3338 + Object a8, Object a9, Object a10, Object a11,
99.3339 + Object a12, Object a13, Object a14, Object a15,
99.3340 + Object a16, Object a17) throws Throwable {
99.3341 + return target.invokeExact(filter.invokeExact(a0),
99.3342 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
99.3343 + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
99.3344 + Object a4, Object a5, Object a6, Object a7,
99.3345 + Object a8, Object a9, Object a10, Object a11,
99.3346 + Object a12, Object a13, Object a14, Object a15,
99.3347 + Object a16, Object a17) throws Throwable {
99.3348 + return target.invokeExact(filter.invokeExact(a0, a1),
99.3349 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
99.3350 + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
99.3351 + Object a4, Object a5, Object a6, Object a7,
99.3352 + Object a8, Object a9, Object a10, Object a11,
99.3353 + Object a12, Object a13, Object a14, Object a15,
99.3354 + Object a16, Object a17) throws Throwable {
99.3355 + return target.invokeExact(filter.invokeExact(a0, a1, a2),
99.3356 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
99.3357 + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
99.3358 + Object a4, Object a5, Object a6, Object a7,
99.3359 + Object a8, Object a9, Object a10, Object a11,
99.3360 + Object a12, Object a13, Object a14, Object a15,
99.3361 + Object a16, Object a17) throws Throwable {
99.3362 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
99.3363 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
99.3364 + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
99.3365 + Object a4, Object a5, Object a6, Object a7,
99.3366 + Object a8, Object a9, Object a10, Object a11,
99.3367 + Object a12, Object a13, Object a14, Object a15,
99.3368 + Object a16, Object a17) throws Throwable {
99.3369 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
99.3370 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
99.3371 + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
99.3372 + Object a4, Object a5, Object a6, Object a7,
99.3373 + Object a8, Object a9, Object a10, Object a11,
99.3374 + Object a12, Object a13, Object a14, Object a15,
99.3375 + Object a16, Object a17) throws Throwable {
99.3376 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
99.3377 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
99.3378 + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
99.3379 + Object a4, Object a5, Object a6, Object a7,
99.3380 + Object a8, Object a9, Object a10, Object a11,
99.3381 + Object a12, Object a13, Object a14, Object a15,
99.3382 + Object a16, Object a17) throws Throwable {
99.3383 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
99.3384 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
99.3385 + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
99.3386 + Object a4, Object a5, Object a6, Object a7,
99.3387 + Object a8, Object a9, Object a10, Object a11,
99.3388 + Object a12, Object a13, Object a14, Object a15,
99.3389 + Object a16, Object a17) throws Throwable {
99.3390 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
99.3391 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
99.3392 + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
99.3393 + Object a4, Object a5, Object a6, Object a7,
99.3394 + Object a8, Object a9, Object a10, Object a11,
99.3395 + Object a12, Object a13, Object a14, Object a15,
99.3396 + Object a16, Object a17) throws Throwable {
99.3397 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
99.3398 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
99.3399 + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
99.3400 + Object a4, Object a5, Object a6, Object a7,
99.3401 + Object a8, Object a9, Object a10, Object a11,
99.3402 + Object a12, Object a13, Object a14, Object a15,
99.3403 + Object a16, Object a17) throws Throwable {
99.3404 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
99.3405 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
99.3406 + protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
99.3407 + Object a4, Object a5, Object a6, Object a7,
99.3408 + Object a8, Object a9, Object a10, Object a11,
99.3409 + Object a12, Object a13, Object a14, Object a15,
99.3410 + Object a16, Object a17) throws Throwable {
99.3411 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3412 + a10),
99.3413 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
99.3414 + protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
99.3415 + Object a4, Object a5, Object a6, Object a7,
99.3416 + Object a8, Object a9, Object a10, Object a11,
99.3417 + Object a12, Object a13, Object a14, Object a15,
99.3418 + Object a16, Object a17) throws Throwable {
99.3419 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3420 + a10, a11),
99.3421 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
99.3422 + protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
99.3423 + Object a4, Object a5, Object a6, Object a7,
99.3424 + Object a8, Object a9, Object a10, Object a11,
99.3425 + Object a12, Object a13, Object a14, Object a15,
99.3426 + Object a16, Object a17) throws Throwable {
99.3427 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3428 + a10, a11, a12),
99.3429 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
99.3430 + protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
99.3431 + Object a4, Object a5, Object a6, Object a7,
99.3432 + Object a8, Object a9, Object a10, Object a11,
99.3433 + Object a12, Object a13, Object a14, Object a15,
99.3434 + Object a16, Object a17) throws Throwable {
99.3435 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3436 + a10, a11, a12, a13),
99.3437 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
99.3438 + protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3,
99.3439 + Object a4, Object a5, Object a6, Object a7,
99.3440 + Object a8, Object a9, Object a10, Object a11,
99.3441 + Object a12, Object a13, Object a14, Object a15,
99.3442 + Object a16, Object a17) throws Throwable {
99.3443 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3444 + a10, a11, a12, a13, a14),
99.3445 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
99.3446 + protected Object invoke_F16(Object a0, Object a1, Object a2, Object a3,
99.3447 + Object a4, Object a5, Object a6, Object a7,
99.3448 + Object a8, Object a9, Object a10, Object a11,
99.3449 + Object a12, Object a13, Object a14, Object a15,
99.3450 + Object a16, Object a17) throws Throwable {
99.3451 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3452 + a10, a11, a12, a13, a14, a15),
99.3453 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
99.3454 + protected Object invoke_F17(Object a0, Object a1, Object a2, Object a3,
99.3455 + Object a4, Object a5, Object a6, Object a7,
99.3456 + Object a8, Object a9, Object a10, Object a11,
99.3457 + Object a12, Object a13, Object a14, Object a15,
99.3458 + Object a16, Object a17) throws Throwable {
99.3459 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3460 + a10, a11, a12, a13, a14, a15, a16),
99.3461 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
99.3462 + protected Object invoke_F18(Object a0, Object a1, Object a2, Object a3,
99.3463 + Object a4, Object a5, Object a6, Object a7,
99.3464 + Object a8, Object a9, Object a10, Object a11,
99.3465 + Object a12, Object a13, Object a14, Object a15,
99.3466 + Object a16, Object a17) throws Throwable {
99.3467 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17),
99.3468 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
99.3469 + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
99.3470 + Object a4, Object a5, Object a6, Object a7,
99.3471 + Object a8, Object a9, Object a10, Object a11,
99.3472 + Object a12, Object a13, Object a14, Object a15,
99.3473 + Object a16, Object a17) throws Throwable {
99.3474 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3475 + a10, a11, a12, a13, a14, a15, a16, a17)); }
99.3476 + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
99.3477 + Object a4, Object a5, Object a6, Object a7,
99.3478 + Object a8, Object a9, Object a10, Object a11,
99.3479 + Object a12, Object a13, Object a14, Object a15,
99.3480 + Object a16, Object a17) throws Throwable {
99.3481 + return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3482 + a10, a11, a12, a13, a14, a15, a16, a17)); }
99.3483 + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
99.3484 + Object a4, Object a5, Object a6, Object a7,
99.3485 + Object a8, Object a9, Object a10, Object a11,
99.3486 + Object a12, Object a13, Object a14, Object a15,
99.3487 + Object a16, Object a17) throws Throwable {
99.3488 + return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
99.3489 + a10, a11, a12, a13, a14, a15, a16, a17)); }
99.3490 + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
99.3491 + Object a4, Object a5, Object a6, Object a7,
99.3492 + Object a8, Object a9, Object a10, Object a11,
99.3493 + Object a12, Object a13, Object a14, Object a15,
99.3494 + Object a16, Object a17) throws Throwable {
99.3495 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
99.3496 + a10, a11, a12, a13, a14, a15, a16, a17)); }
99.3497 + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
99.3498 + Object a4, Object a5, Object a6, Object a7,
99.3499 + Object a8, Object a9, Object a10, Object a11,
99.3500 + Object a12, Object a13, Object a14, Object a15,
99.3501 + Object a16, Object a17) throws Throwable {
99.3502 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
99.3503 + a10, a11, a12, a13, a14, a15, a16, a17)); }
99.3504 + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
99.3505 + Object a4, Object a5, Object a6, Object a7,
99.3506 + Object a8, Object a9, Object a10, Object a11,
99.3507 + Object a12, Object a13, Object a14, Object a15,
99.3508 + Object a16, Object a17) throws Throwable {
99.3509 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
99.3510 + a10, a11, a12, a13, a14, a15, a16, a17)); }
99.3511 + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
99.3512 + Object a4, Object a5, Object a6, Object a7,
99.3513 + Object a8, Object a9, Object a10, Object a11,
99.3514 + Object a12, Object a13, Object a14, Object a15,
99.3515 + Object a16, Object a17) throws Throwable {
99.3516 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
99.3517 + a10, a11, a12, a13, a14, a15, a16, a17)); }
99.3518 + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
99.3519 + Object a4, Object a5, Object a6, Object a7,
99.3520 + Object a8, Object a9, Object a10, Object a11,
99.3521 + Object a12, Object a13, Object a14, Object a15,
99.3522 + Object a16, Object a17) throws Throwable {
99.3523 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
99.3524 + a10, a11, a12, a13, a14, a15, a16, a17)); }
99.3525 + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
99.3526 + Object a4, Object a5, Object a6, Object a7,
99.3527 + Object a8, Object a9, Object a10, Object a11,
99.3528 + Object a12, Object a13, Object a14, Object a15,
99.3529 + Object a16, Object a17) throws Throwable {
99.3530 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
99.3531 + a10, a11, a12, a13, a14, a15, a16, a17)); }
99.3532 + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
99.3533 + Object a4, Object a5, Object a6, Object a7,
99.3534 + Object a8, Object a9, Object a10, Object a11,
99.3535 + Object a12, Object a13, Object a14, Object a15,
99.3536 + Object a16, Object a17) throws Throwable {
99.3537 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
99.3538 + a10, a11, a12, a13, a14, a15, a16, a17)); }
99.3539 + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
99.3540 + Object a4, Object a5, Object a6, Object a7,
99.3541 + Object a8, Object a9, Object a10, Object a11,
99.3542 + Object a12, Object a13, Object a14, Object a15,
99.3543 + Object a16, Object a17) throws Throwable {
99.3544 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13, a14, a15, a16, a17)); }
99.3545 + protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
99.3546 + Object a4, Object a5, Object a6, Object a7,
99.3547 + Object a8, Object a9, Object a10, Object a11,
99.3548 + Object a12, Object a13, Object a14, Object a15,
99.3549 + Object a16, Object a17) throws Throwable {
99.3550 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3551 + a10, filter.invokeExact(a11, a12, a13, a14, a15, a16, a17)); }
99.3552 + protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
99.3553 + Object a4, Object a5, Object a6, Object a7,
99.3554 + Object a8, Object a9, Object a10, Object a11,
99.3555 + Object a12, Object a13, Object a14, Object a15,
99.3556 + Object a16, Object a17) throws Throwable {
99.3557 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3558 + a10, a11, filter.invokeExact(a12, a13, a14, a15, a16, a17)); }
99.3559 + protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
99.3560 + Object a4, Object a5, Object a6, Object a7,
99.3561 + Object a8, Object a9, Object a10, Object a11,
99.3562 + Object a12, Object a13, Object a14, Object a15,
99.3563 + Object a16, Object a17) throws Throwable {
99.3564 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3565 + a10, a11, a12, filter.invokeExact(a13, a14, a15, a16, a17)); }
99.3566 + protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
99.3567 + Object a4, Object a5, Object a6, Object a7,
99.3568 + Object a8, Object a9, Object a10, Object a11,
99.3569 + Object a12, Object a13, Object a14, Object a15,
99.3570 + Object a16, Object a17) throws Throwable {
99.3571 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3572 + a10, a11, a12, a13, filter.invokeExact(a14, a15, a16, a17)); }
99.3573 + protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3,
99.3574 + Object a4, Object a5, Object a6, Object a7,
99.3575 + Object a8, Object a9, Object a10, Object a11,
99.3576 + Object a12, Object a13, Object a14, Object a15,
99.3577 + Object a16, Object a17) throws Throwable {
99.3578 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3579 + a10, a11, a12, a13, a14, filter.invokeExact(a15, a16, a17)); }
99.3580 + protected Object invoke_C16(Object a0, Object a1, Object a2, Object a3,
99.3581 + Object a4, Object a5, Object a6, Object a7,
99.3582 + Object a8, Object a9, Object a10, Object a11,
99.3583 + Object a12, Object a13, Object a14, Object a15,
99.3584 + Object a16, Object a17) throws Throwable {
99.3585 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3586 + a10, a11, a12, a13, a14, a15, filter.invokeExact(a16, a17)); }
99.3587 + protected Object invoke_C17(Object a0, Object a1, Object a2, Object a3,
99.3588 + Object a4, Object a5, Object a6, Object a7,
99.3589 + Object a8, Object a9, Object a10, Object a11,
99.3590 + Object a12, Object a13, Object a14, Object a15,
99.3591 + Object a16, Object a17) throws Throwable {
99.3592 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3593 + a10, a11, a12, a13, a14, a15, a16, filter.invokeExact(a17)); }
99.3594 + protected Object invoke_C18(Object a0, Object a1, Object a2, Object a3,
99.3595 + Object a4, Object a5, Object a6, Object a7,
99.3596 + Object a8, Object a9, Object a10, Object a11,
99.3597 + Object a12, Object a13, Object a14, Object a15,
99.3598 + Object a16, Object a17) throws Throwable {
99.3599 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, filter.invokeExact()); }
99.3600 + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
99.3601 + Object a4, Object a5, Object a6, Object a7,
99.3602 + Object a8, Object a9, Object a10, Object a11,
99.3603 + Object a12, Object a13, Object a14, Object a15,
99.3604 + Object a16, Object a17) throws Throwable {
99.3605 + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17 };
99.3606 + filter.invokeExact(av); // make the flyby
99.3607 + return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14], av[15], av[16], av[17]); }
99.3608 + }
99.3609 + static class F19 extends Adapter {
99.3610 + protected F19(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.3611 + protected F19(MethodHandle e, MethodHandle f, MethodHandle t) {
99.3612 + super(e, f, t); }
99.3613 + protected F19 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.3614 + return new F19(e, f, t); }
99.3615 + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
99.3616 + Object a4, Object a5, Object a6, Object a7,
99.3617 + Object a8, Object a9, Object a10, Object a11,
99.3618 + Object a12, Object a13, Object a14, Object a15,
99.3619 + Object a16, Object a17, Object a18) throws Throwable {
99.3620 + return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3621 + a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3622 + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
99.3623 + Object a4, Object a5, Object a6, Object a7,
99.3624 + Object a8, Object a9, Object a10, Object a11,
99.3625 + Object a12, Object a13, Object a14, Object a15,
99.3626 + Object a16, Object a17, Object a18) throws Throwable {
99.3627 + return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
99.3628 + a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3629 + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
99.3630 + Object a4, Object a5, Object a6, Object a7,
99.3631 + Object a8, Object a9, Object a10, Object a11,
99.3632 + Object a12, Object a13, Object a14, Object a15,
99.3633 + Object a16, Object a17, Object a18) throws Throwable {
99.3634 + return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
99.3635 + a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3636 + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
99.3637 + Object a4, Object a5, Object a6, Object a7,
99.3638 + Object a8, Object a9, Object a10, Object a11,
99.3639 + Object a12, Object a13, Object a14, Object a15,
99.3640 + Object a16, Object a17, Object a18) throws Throwable {
99.3641 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
99.3642 + a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3643 + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
99.3644 + Object a4, Object a5, Object a6, Object a7,
99.3645 + Object a8, Object a9, Object a10, Object a11,
99.3646 + Object a12, Object a13, Object a14, Object a15,
99.3647 + Object a16, Object a17, Object a18) throws Throwable {
99.3648 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
99.3649 + a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3650 + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
99.3651 + Object a4, Object a5, Object a6, Object a7,
99.3652 + Object a8, Object a9, Object a10, Object a11,
99.3653 + Object a12, Object a13, Object a14, Object a15,
99.3654 + Object a16, Object a17, Object a18) throws Throwable {
99.3655 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
99.3656 + a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3657 + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
99.3658 + Object a4, Object a5, Object a6, Object a7,
99.3659 + Object a8, Object a9, Object a10, Object a11,
99.3660 + Object a12, Object a13, Object a14, Object a15,
99.3661 + Object a16, Object a17, Object a18) throws Throwable {
99.3662 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
99.3663 + a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3664 + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
99.3665 + Object a4, Object a5, Object a6, Object a7,
99.3666 + Object a8, Object a9, Object a10, Object a11,
99.3667 + Object a12, Object a13, Object a14, Object a15,
99.3668 + Object a16, Object a17, Object a18) throws Throwable {
99.3669 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
99.3670 + a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3671 + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
99.3672 + Object a4, Object a5, Object a6, Object a7,
99.3673 + Object a8, Object a9, Object a10, Object a11,
99.3674 + Object a12, Object a13, Object a14, Object a15,
99.3675 + Object a16, Object a17, Object a18) throws Throwable {
99.3676 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
99.3677 + a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3678 + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
99.3679 + Object a4, Object a5, Object a6, Object a7,
99.3680 + Object a8, Object a9, Object a10, Object a11,
99.3681 + Object a12, Object a13, Object a14, Object a15,
99.3682 + Object a16, Object a17, Object a18) throws Throwable {
99.3683 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
99.3684 + a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3685 + protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
99.3686 + Object a4, Object a5, Object a6, Object a7,
99.3687 + Object a8, Object a9, Object a10, Object a11,
99.3688 + Object a12, Object a13, Object a14, Object a15,
99.3689 + Object a16, Object a17, Object a18) throws Throwable {
99.3690 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3691 + filter.invokeExact(a10), a11, a12, a13, a14, a15, a16, a17, a18); }
99.3692 + protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
99.3693 + Object a4, Object a5, Object a6, Object a7,
99.3694 + Object a8, Object a9, Object a10, Object a11,
99.3695 + Object a12, Object a13, Object a14, Object a15,
99.3696 + Object a16, Object a17, Object a18) throws Throwable {
99.3697 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3698 + a10, filter.invokeExact(a11), a12, a13, a14, a15, a16, a17, a18); }
99.3699 + protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
99.3700 + Object a4, Object a5, Object a6, Object a7,
99.3701 + Object a8, Object a9, Object a10, Object a11,
99.3702 + Object a12, Object a13, Object a14, Object a15,
99.3703 + Object a16, Object a17, Object a18) throws Throwable {
99.3704 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3705 + a10, a11, filter.invokeExact(a12), a13, a14, a15, a16, a17, a18); }
99.3706 + protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
99.3707 + Object a4, Object a5, Object a6, Object a7,
99.3708 + Object a8, Object a9, Object a10, Object a11,
99.3709 + Object a12, Object a13, Object a14, Object a15,
99.3710 + Object a16, Object a17, Object a18) throws Throwable {
99.3711 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3712 + a10, a11, a12, filter.invokeExact(a13), a14, a15, a16, a17, a18); }
99.3713 + protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3,
99.3714 + Object a4, Object a5, Object a6, Object a7,
99.3715 + Object a8, Object a9, Object a10, Object a11,
99.3716 + Object a12, Object a13, Object a14, Object a15,
99.3717 + Object a16, Object a17, Object a18) throws Throwable {
99.3718 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3719 + a10, a11, a12, a13, filter.invokeExact(a14), a15, a16, a17, a18); }
99.3720 + protected Object invoke_V15(Object a0, Object a1, Object a2, Object a3,
99.3721 + Object a4, Object a5, Object a6, Object a7,
99.3722 + Object a8, Object a9, Object a10, Object a11,
99.3723 + Object a12, Object a13, Object a14, Object a15,
99.3724 + Object a16, Object a17, Object a18) throws Throwable {
99.3725 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3726 + a10, a11, a12, a13, a14, filter.invokeExact(a15), a16, a17, a18); }
99.3727 + protected Object invoke_V16(Object a0, Object a1, Object a2, Object a3,
99.3728 + Object a4, Object a5, Object a6, Object a7,
99.3729 + Object a8, Object a9, Object a10, Object a11,
99.3730 + Object a12, Object a13, Object a14, Object a15,
99.3731 + Object a16, Object a17, Object a18) throws Throwable {
99.3732 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3733 + a10, a11, a12, a13, a14, a15, filter.invokeExact(a16), a17, a18); }
99.3734 + protected Object invoke_V17(Object a0, Object a1, Object a2, Object a3,
99.3735 + Object a4, Object a5, Object a6, Object a7,
99.3736 + Object a8, Object a9, Object a10, Object a11,
99.3737 + Object a12, Object a13, Object a14, Object a15,
99.3738 + Object a16, Object a17, Object a18) throws Throwable {
99.3739 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3740 + a10, a11, a12, a13, a14, a15, a16, filter.invokeExact(a17), a18); }
99.3741 + protected Object invoke_V18(Object a0, Object a1, Object a2, Object a3,
99.3742 + Object a4, Object a5, Object a6, Object a7,
99.3743 + Object a8, Object a9, Object a10, Object a11,
99.3744 + Object a12, Object a13, Object a14, Object a15,
99.3745 + Object a16, Object a17, Object a18) throws Throwable {
99.3746 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3747 + a10, a11, a12, a13, a14, a15, a16, a17, filter.invokeExact(a18)); }
99.3748 + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
99.3749 + Object a4, Object a5, Object a6, Object a7,
99.3750 + Object a8, Object a9, Object a10, Object a11,
99.3751 + Object a12, Object a13, Object a14, Object a15,
99.3752 + Object a16, Object a17, Object a18) throws Throwable {
99.3753 + return target.invokeExact(filter.invokeExact(),
99.3754 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3755 + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
99.3756 + Object a4, Object a5, Object a6, Object a7,
99.3757 + Object a8, Object a9, Object a10, Object a11,
99.3758 + Object a12, Object a13, Object a14, Object a15,
99.3759 + Object a16, Object a17, Object a18) throws Throwable {
99.3760 + return target.invokeExact(filter.invokeExact(a0),
99.3761 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3762 + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
99.3763 + Object a4, Object a5, Object a6, Object a7,
99.3764 + Object a8, Object a9, Object a10, Object a11,
99.3765 + Object a12, Object a13, Object a14, Object a15,
99.3766 + Object a16, Object a17, Object a18) throws Throwable {
99.3767 + return target.invokeExact(filter.invokeExact(a0, a1),
99.3768 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3769 + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
99.3770 + Object a4, Object a5, Object a6, Object a7,
99.3771 + Object a8, Object a9, Object a10, Object a11,
99.3772 + Object a12, Object a13, Object a14, Object a15,
99.3773 + Object a16, Object a17, Object a18) throws Throwable {
99.3774 + return target.invokeExact(filter.invokeExact(a0, a1, a2),
99.3775 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3776 + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
99.3777 + Object a4, Object a5, Object a6, Object a7,
99.3778 + Object a8, Object a9, Object a10, Object a11,
99.3779 + Object a12, Object a13, Object a14, Object a15,
99.3780 + Object a16, Object a17, Object a18) throws Throwable {
99.3781 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
99.3782 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3783 + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
99.3784 + Object a4, Object a5, Object a6, Object a7,
99.3785 + Object a8, Object a9, Object a10, Object a11,
99.3786 + Object a12, Object a13, Object a14, Object a15,
99.3787 + Object a16, Object a17, Object a18) throws Throwable {
99.3788 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
99.3789 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3790 + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
99.3791 + Object a4, Object a5, Object a6, Object a7,
99.3792 + Object a8, Object a9, Object a10, Object a11,
99.3793 + Object a12, Object a13, Object a14, Object a15,
99.3794 + Object a16, Object a17, Object a18) throws Throwable {
99.3795 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
99.3796 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3797 + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
99.3798 + Object a4, Object a5, Object a6, Object a7,
99.3799 + Object a8, Object a9, Object a10, Object a11,
99.3800 + Object a12, Object a13, Object a14, Object a15,
99.3801 + Object a16, Object a17, Object a18) throws Throwable {
99.3802 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
99.3803 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3804 + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
99.3805 + Object a4, Object a5, Object a6, Object a7,
99.3806 + Object a8, Object a9, Object a10, Object a11,
99.3807 + Object a12, Object a13, Object a14, Object a15,
99.3808 + Object a16, Object a17, Object a18) throws Throwable {
99.3809 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
99.3810 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3811 + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
99.3812 + Object a4, Object a5, Object a6, Object a7,
99.3813 + Object a8, Object a9, Object a10, Object a11,
99.3814 + Object a12, Object a13, Object a14, Object a15,
99.3815 + Object a16, Object a17, Object a18) throws Throwable {
99.3816 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
99.3817 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3818 + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
99.3819 + Object a4, Object a5, Object a6, Object a7,
99.3820 + Object a8, Object a9, Object a10, Object a11,
99.3821 + Object a12, Object a13, Object a14, Object a15,
99.3822 + Object a16, Object a17, Object a18) throws Throwable {
99.3823 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
99.3824 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3825 + protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
99.3826 + Object a4, Object a5, Object a6, Object a7,
99.3827 + Object a8, Object a9, Object a10, Object a11,
99.3828 + Object a12, Object a13, Object a14, Object a15,
99.3829 + Object a16, Object a17, Object a18) throws Throwable {
99.3830 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3831 + a10),
99.3832 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3833 + protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
99.3834 + Object a4, Object a5, Object a6, Object a7,
99.3835 + Object a8, Object a9, Object a10, Object a11,
99.3836 + Object a12, Object a13, Object a14, Object a15,
99.3837 + Object a16, Object a17, Object a18) throws Throwable {
99.3838 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3839 + a10, a11),
99.3840 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3841 + protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
99.3842 + Object a4, Object a5, Object a6, Object a7,
99.3843 + Object a8, Object a9, Object a10, Object a11,
99.3844 + Object a12, Object a13, Object a14, Object a15,
99.3845 + Object a16, Object a17, Object a18) throws Throwable {
99.3846 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3847 + a10, a11, a12),
99.3848 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3849 + protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
99.3850 + Object a4, Object a5, Object a6, Object a7,
99.3851 + Object a8, Object a9, Object a10, Object a11,
99.3852 + Object a12, Object a13, Object a14, Object a15,
99.3853 + Object a16, Object a17, Object a18) throws Throwable {
99.3854 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3855 + a10, a11, a12, a13),
99.3856 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3857 + protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3,
99.3858 + Object a4, Object a5, Object a6, Object a7,
99.3859 + Object a8, Object a9, Object a10, Object a11,
99.3860 + Object a12, Object a13, Object a14, Object a15,
99.3861 + Object a16, Object a17, Object a18) throws Throwable {
99.3862 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3863 + a10, a11, a12, a13, a14),
99.3864 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3865 + protected Object invoke_F16(Object a0, Object a1, Object a2, Object a3,
99.3866 + Object a4, Object a5, Object a6, Object a7,
99.3867 + Object a8, Object a9, Object a10, Object a11,
99.3868 + Object a12, Object a13, Object a14, Object a15,
99.3869 + Object a16, Object a17, Object a18) throws Throwable {
99.3870 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3871 + a10, a11, a12, a13, a14, a15),
99.3872 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3873 + protected Object invoke_F17(Object a0, Object a1, Object a2, Object a3,
99.3874 + Object a4, Object a5, Object a6, Object a7,
99.3875 + Object a8, Object a9, Object a10, Object a11,
99.3876 + Object a12, Object a13, Object a14, Object a15,
99.3877 + Object a16, Object a17, Object a18) throws Throwable {
99.3878 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3879 + a10, a11, a12, a13, a14, a15, a16),
99.3880 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3881 + protected Object invoke_F18(Object a0, Object a1, Object a2, Object a3,
99.3882 + Object a4, Object a5, Object a6, Object a7,
99.3883 + Object a8, Object a9, Object a10, Object a11,
99.3884 + Object a12, Object a13, Object a14, Object a15,
99.3885 + Object a16, Object a17, Object a18) throws Throwable {
99.3886 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3887 + a10, a11, a12, a13, a14, a15, a16, a17),
99.3888 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3889 + protected Object invoke_F19(Object a0, Object a1, Object a2, Object a3,
99.3890 + Object a4, Object a5, Object a6, Object a7,
99.3891 + Object a8, Object a9, Object a10, Object a11,
99.3892 + Object a12, Object a13, Object a14, Object a15,
99.3893 + Object a16, Object a17, Object a18) throws Throwable {
99.3894 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18),
99.3895 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
99.3896 + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
99.3897 + Object a4, Object a5, Object a6, Object a7,
99.3898 + Object a8, Object a9, Object a10, Object a11,
99.3899 + Object a12, Object a13, Object a14, Object a15,
99.3900 + Object a16, Object a17, Object a18) throws Throwable {
99.3901 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3902 + a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
99.3903 + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
99.3904 + Object a4, Object a5, Object a6, Object a7,
99.3905 + Object a8, Object a9, Object a10, Object a11,
99.3906 + Object a12, Object a13, Object a14, Object a15,
99.3907 + Object a16, Object a17, Object a18) throws Throwable {
99.3908 + return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3909 + a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
99.3910 + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
99.3911 + Object a4, Object a5, Object a6, Object a7,
99.3912 + Object a8, Object a9, Object a10, Object a11,
99.3913 + Object a12, Object a13, Object a14, Object a15,
99.3914 + Object a16, Object a17, Object a18) throws Throwable {
99.3915 + return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
99.3916 + a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
99.3917 + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
99.3918 + Object a4, Object a5, Object a6, Object a7,
99.3919 + Object a8, Object a9, Object a10, Object a11,
99.3920 + Object a12, Object a13, Object a14, Object a15,
99.3921 + Object a16, Object a17, Object a18) throws Throwable {
99.3922 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
99.3923 + a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
99.3924 + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
99.3925 + Object a4, Object a5, Object a6, Object a7,
99.3926 + Object a8, Object a9, Object a10, Object a11,
99.3927 + Object a12, Object a13, Object a14, Object a15,
99.3928 + Object a16, Object a17, Object a18) throws Throwable {
99.3929 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
99.3930 + a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
99.3931 + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
99.3932 + Object a4, Object a5, Object a6, Object a7,
99.3933 + Object a8, Object a9, Object a10, Object a11,
99.3934 + Object a12, Object a13, Object a14, Object a15,
99.3935 + Object a16, Object a17, Object a18) throws Throwable {
99.3936 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
99.3937 + a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
99.3938 + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
99.3939 + Object a4, Object a5, Object a6, Object a7,
99.3940 + Object a8, Object a9, Object a10, Object a11,
99.3941 + Object a12, Object a13, Object a14, Object a15,
99.3942 + Object a16, Object a17, Object a18) throws Throwable {
99.3943 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
99.3944 + a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
99.3945 + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
99.3946 + Object a4, Object a5, Object a6, Object a7,
99.3947 + Object a8, Object a9, Object a10, Object a11,
99.3948 + Object a12, Object a13, Object a14, Object a15,
99.3949 + Object a16, Object a17, Object a18) throws Throwable {
99.3950 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
99.3951 + a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
99.3952 + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
99.3953 + Object a4, Object a5, Object a6, Object a7,
99.3954 + Object a8, Object a9, Object a10, Object a11,
99.3955 + Object a12, Object a13, Object a14, Object a15,
99.3956 + Object a16, Object a17, Object a18) throws Throwable {
99.3957 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
99.3958 + a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
99.3959 + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
99.3960 + Object a4, Object a5, Object a6, Object a7,
99.3961 + Object a8, Object a9, Object a10, Object a11,
99.3962 + Object a12, Object a13, Object a14, Object a15,
99.3963 + Object a16, Object a17, Object a18) throws Throwable {
99.3964 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
99.3965 + a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
99.3966 + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
99.3967 + Object a4, Object a5, Object a6, Object a7,
99.3968 + Object a8, Object a9, Object a10, Object a11,
99.3969 + Object a12, Object a13, Object a14, Object a15,
99.3970 + Object a16, Object a17, Object a18) throws Throwable {
99.3971 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
99.3972 + protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
99.3973 + Object a4, Object a5, Object a6, Object a7,
99.3974 + Object a8, Object a9, Object a10, Object a11,
99.3975 + Object a12, Object a13, Object a14, Object a15,
99.3976 + Object a16, Object a17, Object a18) throws Throwable {
99.3977 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3978 + a10, filter.invokeExact(a11, a12, a13, a14, a15, a16, a17, a18)); }
99.3979 + protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
99.3980 + Object a4, Object a5, Object a6, Object a7,
99.3981 + Object a8, Object a9, Object a10, Object a11,
99.3982 + Object a12, Object a13, Object a14, Object a15,
99.3983 + Object a16, Object a17, Object a18) throws Throwable {
99.3984 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3985 + a10, a11, filter.invokeExact(a12, a13, a14, a15, a16, a17, a18)); }
99.3986 + protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
99.3987 + Object a4, Object a5, Object a6, Object a7,
99.3988 + Object a8, Object a9, Object a10, Object a11,
99.3989 + Object a12, Object a13, Object a14, Object a15,
99.3990 + Object a16, Object a17, Object a18) throws Throwable {
99.3991 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3992 + a10, a11, a12, filter.invokeExact(a13, a14, a15, a16, a17, a18)); }
99.3993 + protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
99.3994 + Object a4, Object a5, Object a6, Object a7,
99.3995 + Object a8, Object a9, Object a10, Object a11,
99.3996 + Object a12, Object a13, Object a14, Object a15,
99.3997 + Object a16, Object a17, Object a18) throws Throwable {
99.3998 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.3999 + a10, a11, a12, a13, filter.invokeExact(a14, a15, a16, a17, a18)); }
99.4000 + protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3,
99.4001 + Object a4, Object a5, Object a6, Object a7,
99.4002 + Object a8, Object a9, Object a10, Object a11,
99.4003 + Object a12, Object a13, Object a14, Object a15,
99.4004 + Object a16, Object a17, Object a18) throws Throwable {
99.4005 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4006 + a10, a11, a12, a13, a14, filter.invokeExact(a15, a16, a17, a18)); }
99.4007 + protected Object invoke_C16(Object a0, Object a1, Object a2, Object a3,
99.4008 + Object a4, Object a5, Object a6, Object a7,
99.4009 + Object a8, Object a9, Object a10, Object a11,
99.4010 + Object a12, Object a13, Object a14, Object a15,
99.4011 + Object a16, Object a17, Object a18) throws Throwable {
99.4012 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4013 + a10, a11, a12, a13, a14, a15, filter.invokeExact(a16, a17, a18)); }
99.4014 + protected Object invoke_C17(Object a0, Object a1, Object a2, Object a3,
99.4015 + Object a4, Object a5, Object a6, Object a7,
99.4016 + Object a8, Object a9, Object a10, Object a11,
99.4017 + Object a12, Object a13, Object a14, Object a15,
99.4018 + Object a16, Object a17, Object a18) throws Throwable {
99.4019 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4020 + a10, a11, a12, a13, a14, a15, a16, filter.invokeExact(a17, a18)); }
99.4021 + protected Object invoke_C18(Object a0, Object a1, Object a2, Object a3,
99.4022 + Object a4, Object a5, Object a6, Object a7,
99.4023 + Object a8, Object a9, Object a10, Object a11,
99.4024 + Object a12, Object a13, Object a14, Object a15,
99.4025 + Object a16, Object a17, Object a18) throws Throwable {
99.4026 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4027 + a10, a11, a12, a13, a14, a15, a16, a17, filter.invokeExact(a18)); }
99.4028 + protected Object invoke_C19(Object a0, Object a1, Object a2, Object a3,
99.4029 + Object a4, Object a5, Object a6, Object a7,
99.4030 + Object a8, Object a9, Object a10, Object a11,
99.4031 + Object a12, Object a13, Object a14, Object a15,
99.4032 + Object a16, Object a17, Object a18) throws Throwable {
99.4033 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, filter.invokeExact()); }
99.4034 + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
99.4035 + Object a4, Object a5, Object a6, Object a7,
99.4036 + Object a8, Object a9, Object a10, Object a11,
99.4037 + Object a12, Object a13, Object a14, Object a15,
99.4038 + Object a16, Object a17, Object a18) throws Throwable {
99.4039 + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18 };
99.4040 + filter.invokeExact(av); // make the flyby
99.4041 + return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14], av[15], av[16], av[17], av[18]); }
99.4042 + }
99.4043 + static class F20 extends Adapter {
99.4044 + protected F20(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
99.4045 + protected F20(MethodHandle e, MethodHandle f, MethodHandle t) {
99.4046 + super(e, f, t); }
99.4047 + protected F20 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
99.4048 + return new F20(e, f, t); }
99.4049 + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
99.4050 + Object a4, Object a5, Object a6, Object a7,
99.4051 + Object a8, Object a9, Object a10, Object a11,
99.4052 + Object a12, Object a13, Object a14, Object a15,
99.4053 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4054 + return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4055 + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4056 + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
99.4057 + Object a4, Object a5, Object a6, Object a7,
99.4058 + Object a8, Object a9, Object a10, Object a11,
99.4059 + Object a12, Object a13, Object a14, Object a15,
99.4060 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4061 + return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
99.4062 + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4063 + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
99.4064 + Object a4, Object a5, Object a6, Object a7,
99.4065 + Object a8, Object a9, Object a10, Object a11,
99.4066 + Object a12, Object a13, Object a14, Object a15,
99.4067 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4068 + return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
99.4069 + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4070 + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
99.4071 + Object a4, Object a5, Object a6, Object a7,
99.4072 + Object a8, Object a9, Object a10, Object a11,
99.4073 + Object a12, Object a13, Object a14, Object a15,
99.4074 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4075 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
99.4076 + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4077 + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
99.4078 + Object a4, Object a5, Object a6, Object a7,
99.4079 + Object a8, Object a9, Object a10, Object a11,
99.4080 + Object a12, Object a13, Object a14, Object a15,
99.4081 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4082 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
99.4083 + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4084 + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
99.4085 + Object a4, Object a5, Object a6, Object a7,
99.4086 + Object a8, Object a9, Object a10, Object a11,
99.4087 + Object a12, Object a13, Object a14, Object a15,
99.4088 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4089 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
99.4090 + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4091 + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
99.4092 + Object a4, Object a5, Object a6, Object a7,
99.4093 + Object a8, Object a9, Object a10, Object a11,
99.4094 + Object a12, Object a13, Object a14, Object a15,
99.4095 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4096 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
99.4097 + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4098 + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
99.4099 + Object a4, Object a5, Object a6, Object a7,
99.4100 + Object a8, Object a9, Object a10, Object a11,
99.4101 + Object a12, Object a13, Object a14, Object a15,
99.4102 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4103 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
99.4104 + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4105 + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
99.4106 + Object a4, Object a5, Object a6, Object a7,
99.4107 + Object a8, Object a9, Object a10, Object a11,
99.4108 + Object a12, Object a13, Object a14, Object a15,
99.4109 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4110 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
99.4111 + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4112 + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
99.4113 + Object a4, Object a5, Object a6, Object a7,
99.4114 + Object a8, Object a9, Object a10, Object a11,
99.4115 + Object a12, Object a13, Object a14, Object a15,
99.4116 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4117 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
99.4118 + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4119 + protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
99.4120 + Object a4, Object a5, Object a6, Object a7,
99.4121 + Object a8, Object a9, Object a10, Object a11,
99.4122 + Object a12, Object a13, Object a14, Object a15,
99.4123 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4124 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4125 + filter.invokeExact(a10), a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4126 + protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
99.4127 + Object a4, Object a5, Object a6, Object a7,
99.4128 + Object a8, Object a9, Object a10, Object a11,
99.4129 + Object a12, Object a13, Object a14, Object a15,
99.4130 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4131 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4132 + a10, filter.invokeExact(a11), a12, a13, a14, a15, a16, a17, a18, a19); }
99.4133 + protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
99.4134 + Object a4, Object a5, Object a6, Object a7,
99.4135 + Object a8, Object a9, Object a10, Object a11,
99.4136 + Object a12, Object a13, Object a14, Object a15,
99.4137 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4138 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4139 + a10, a11, filter.invokeExact(a12), a13, a14, a15, a16, a17, a18, a19); }
99.4140 + protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
99.4141 + Object a4, Object a5, Object a6, Object a7,
99.4142 + Object a8, Object a9, Object a10, Object a11,
99.4143 + Object a12, Object a13, Object a14, Object a15,
99.4144 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4145 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4146 + a10, a11, a12, filter.invokeExact(a13), a14, a15, a16, a17, a18, a19); }
99.4147 + protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3,
99.4148 + Object a4, Object a5, Object a6, Object a7,
99.4149 + Object a8, Object a9, Object a10, Object a11,
99.4150 + Object a12, Object a13, Object a14, Object a15,
99.4151 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4152 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4153 + a10, a11, a12, a13, filter.invokeExact(a14), a15, a16, a17, a18, a19); }
99.4154 + protected Object invoke_V15(Object a0, Object a1, Object a2, Object a3,
99.4155 + Object a4, Object a5, Object a6, Object a7,
99.4156 + Object a8, Object a9, Object a10, Object a11,
99.4157 + Object a12, Object a13, Object a14, Object a15,
99.4158 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4159 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4160 + a10, a11, a12, a13, a14, filter.invokeExact(a15), a16, a17, a18, a19); }
99.4161 + protected Object invoke_V16(Object a0, Object a1, Object a2, Object a3,
99.4162 + Object a4, Object a5, Object a6, Object a7,
99.4163 + Object a8, Object a9, Object a10, Object a11,
99.4164 + Object a12, Object a13, Object a14, Object a15,
99.4165 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4166 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4167 + a10, a11, a12, a13, a14, a15, filter.invokeExact(a16), a17, a18, a19); }
99.4168 + protected Object invoke_V17(Object a0, Object a1, Object a2, Object a3,
99.4169 + Object a4, Object a5, Object a6, Object a7,
99.4170 + Object a8, Object a9, Object a10, Object a11,
99.4171 + Object a12, Object a13, Object a14, Object a15,
99.4172 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4173 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4174 + a10, a11, a12, a13, a14, a15, a16, filter.invokeExact(a17), a18, a19); }
99.4175 + protected Object invoke_V18(Object a0, Object a1, Object a2, Object a3,
99.4176 + Object a4, Object a5, Object a6, Object a7,
99.4177 + Object a8, Object a9, Object a10, Object a11,
99.4178 + Object a12, Object a13, Object a14, Object a15,
99.4179 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4180 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4181 + a10, a11, a12, a13, a14, a15, a16, a17, filter.invokeExact(a18), a19); }
99.4182 + protected Object invoke_V19(Object a0, Object a1, Object a2, Object a3,
99.4183 + Object a4, Object a5, Object a6, Object a7,
99.4184 + Object a8, Object a9, Object a10, Object a11,
99.4185 + Object a12, Object a13, Object a14, Object a15,
99.4186 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4187 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4188 + a10, a11, a12, a13, a14, a15, a16, a17, a18, filter.invokeExact(a19)); }
99.4189 + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
99.4190 + Object a4, Object a5, Object a6, Object a7,
99.4191 + Object a8, Object a9, Object a10, Object a11,
99.4192 + Object a12, Object a13, Object a14, Object a15,
99.4193 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4194 + return target.invokeExact(filter.invokeExact(),
99.4195 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4196 + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
99.4197 + Object a4, Object a5, Object a6, Object a7,
99.4198 + Object a8, Object a9, Object a10, Object a11,
99.4199 + Object a12, Object a13, Object a14, Object a15,
99.4200 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4201 + return target.invokeExact(filter.invokeExact(a0),
99.4202 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4203 + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
99.4204 + Object a4, Object a5, Object a6, Object a7,
99.4205 + Object a8, Object a9, Object a10, Object a11,
99.4206 + Object a12, Object a13, Object a14, Object a15,
99.4207 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4208 + return target.invokeExact(filter.invokeExact(a0, a1),
99.4209 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4210 + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
99.4211 + Object a4, Object a5, Object a6, Object a7,
99.4212 + Object a8, Object a9, Object a10, Object a11,
99.4213 + Object a12, Object a13, Object a14, Object a15,
99.4214 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4215 + return target.invokeExact(filter.invokeExact(a0, a1, a2),
99.4216 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4217 + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
99.4218 + Object a4, Object a5, Object a6, Object a7,
99.4219 + Object a8, Object a9, Object a10, Object a11,
99.4220 + Object a12, Object a13, Object a14, Object a15,
99.4221 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4222 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
99.4223 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4224 + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
99.4225 + Object a4, Object a5, Object a6, Object a7,
99.4226 + Object a8, Object a9, Object a10, Object a11,
99.4227 + Object a12, Object a13, Object a14, Object a15,
99.4228 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4229 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
99.4230 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4231 + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
99.4232 + Object a4, Object a5, Object a6, Object a7,
99.4233 + Object a8, Object a9, Object a10, Object a11,
99.4234 + Object a12, Object a13, Object a14, Object a15,
99.4235 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4236 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
99.4237 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4238 + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
99.4239 + Object a4, Object a5, Object a6, Object a7,
99.4240 + Object a8, Object a9, Object a10, Object a11,
99.4241 + Object a12, Object a13, Object a14, Object a15,
99.4242 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4243 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
99.4244 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4245 + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
99.4246 + Object a4, Object a5, Object a6, Object a7,
99.4247 + Object a8, Object a9, Object a10, Object a11,
99.4248 + Object a12, Object a13, Object a14, Object a15,
99.4249 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4250 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
99.4251 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4252 + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
99.4253 + Object a4, Object a5, Object a6, Object a7,
99.4254 + Object a8, Object a9, Object a10, Object a11,
99.4255 + Object a12, Object a13, Object a14, Object a15,
99.4256 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4257 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
99.4258 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4259 + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
99.4260 + Object a4, Object a5, Object a6, Object a7,
99.4261 + Object a8, Object a9, Object a10, Object a11,
99.4262 + Object a12, Object a13, Object a14, Object a15,
99.4263 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4264 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
99.4265 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4266 + protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
99.4267 + Object a4, Object a5, Object a6, Object a7,
99.4268 + Object a8, Object a9, Object a10, Object a11,
99.4269 + Object a12, Object a13, Object a14, Object a15,
99.4270 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4271 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4272 + a10),
99.4273 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4274 + protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
99.4275 + Object a4, Object a5, Object a6, Object a7,
99.4276 + Object a8, Object a9, Object a10, Object a11,
99.4277 + Object a12, Object a13, Object a14, Object a15,
99.4278 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4279 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4280 + a10, a11),
99.4281 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4282 + protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
99.4283 + Object a4, Object a5, Object a6, Object a7,
99.4284 + Object a8, Object a9, Object a10, Object a11,
99.4285 + Object a12, Object a13, Object a14, Object a15,
99.4286 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4287 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4288 + a10, a11, a12),
99.4289 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4290 + protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
99.4291 + Object a4, Object a5, Object a6, Object a7,
99.4292 + Object a8, Object a9, Object a10, Object a11,
99.4293 + Object a12, Object a13, Object a14, Object a15,
99.4294 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4295 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4296 + a10, a11, a12, a13),
99.4297 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4298 + protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3,
99.4299 + Object a4, Object a5, Object a6, Object a7,
99.4300 + Object a8, Object a9, Object a10, Object a11,
99.4301 + Object a12, Object a13, Object a14, Object a15,
99.4302 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4303 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4304 + a10, a11, a12, a13, a14),
99.4305 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4306 + protected Object invoke_F16(Object a0, Object a1, Object a2, Object a3,
99.4307 + Object a4, Object a5, Object a6, Object a7,
99.4308 + Object a8, Object a9, Object a10, Object a11,
99.4309 + Object a12, Object a13, Object a14, Object a15,
99.4310 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4311 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4312 + a10, a11, a12, a13, a14, a15),
99.4313 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4314 + protected Object invoke_F17(Object a0, Object a1, Object a2, Object a3,
99.4315 + Object a4, Object a5, Object a6, Object a7,
99.4316 + Object a8, Object a9, Object a10, Object a11,
99.4317 + Object a12, Object a13, Object a14, Object a15,
99.4318 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4319 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4320 + a10, a11, a12, a13, a14, a15, a16),
99.4321 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4322 + protected Object invoke_F18(Object a0, Object a1, Object a2, Object a3,
99.4323 + Object a4, Object a5, Object a6, Object a7,
99.4324 + Object a8, Object a9, Object a10, Object a11,
99.4325 + Object a12, Object a13, Object a14, Object a15,
99.4326 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4327 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4328 + a10, a11, a12, a13, a14, a15, a16, a17),
99.4329 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4330 + protected Object invoke_F19(Object a0, Object a1, Object a2, Object a3,
99.4331 + Object a4, Object a5, Object a6, Object a7,
99.4332 + Object a8, Object a9, Object a10, Object a11,
99.4333 + Object a12, Object a13, Object a14, Object a15,
99.4334 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4335 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4336 + a10, a11, a12, a13, a14, a15, a16, a17, a18),
99.4337 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4338 + protected Object invoke_F20(Object a0, Object a1, Object a2, Object a3,
99.4339 + Object a4, Object a5, Object a6, Object a7,
99.4340 + Object a8, Object a9, Object a10, Object a11,
99.4341 + Object a12, Object a13, Object a14, Object a15,
99.4342 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4343 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19),
99.4344 + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
99.4345 + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
99.4346 + Object a4, Object a5, Object a6, Object a7,
99.4347 + Object a8, Object a9, Object a10, Object a11,
99.4348 + Object a12, Object a13, Object a14, Object a15,
99.4349 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4350 + return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4351 + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
99.4352 + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
99.4353 + Object a4, Object a5, Object a6, Object a7,
99.4354 + Object a8, Object a9, Object a10, Object a11,
99.4355 + Object a12, Object a13, Object a14, Object a15,
99.4356 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4357 + return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4358 + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
99.4359 + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
99.4360 + Object a4, Object a5, Object a6, Object a7,
99.4361 + Object a8, Object a9, Object a10, Object a11,
99.4362 + Object a12, Object a13, Object a14, Object a15,
99.4363 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4364 + return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
99.4365 + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
99.4366 + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
99.4367 + Object a4, Object a5, Object a6, Object a7,
99.4368 + Object a8, Object a9, Object a10, Object a11,
99.4369 + Object a12, Object a13, Object a14, Object a15,
99.4370 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4371 + return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
99.4372 + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
99.4373 + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
99.4374 + Object a4, Object a5, Object a6, Object a7,
99.4375 + Object a8, Object a9, Object a10, Object a11,
99.4376 + Object a12, Object a13, Object a14, Object a15,
99.4377 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4378 + return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
99.4379 + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
99.4380 + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
99.4381 + Object a4, Object a5, Object a6, Object a7,
99.4382 + Object a8, Object a9, Object a10, Object a11,
99.4383 + Object a12, Object a13, Object a14, Object a15,
99.4384 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4385 + return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
99.4386 + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
99.4387 + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
99.4388 + Object a4, Object a5, Object a6, Object a7,
99.4389 + Object a8, Object a9, Object a10, Object a11,
99.4390 + Object a12, Object a13, Object a14, Object a15,
99.4391 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4392 + return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
99.4393 + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
99.4394 + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
99.4395 + Object a4, Object a5, Object a6, Object a7,
99.4396 + Object a8, Object a9, Object a10, Object a11,
99.4397 + Object a12, Object a13, Object a14, Object a15,
99.4398 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4399 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
99.4400 + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
99.4401 + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
99.4402 + Object a4, Object a5, Object a6, Object a7,
99.4403 + Object a8, Object a9, Object a10, Object a11,
99.4404 + Object a12, Object a13, Object a14, Object a15,
99.4405 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4406 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
99.4407 + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
99.4408 + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
99.4409 + Object a4, Object a5, Object a6, Object a7,
99.4410 + Object a8, Object a9, Object a10, Object a11,
99.4411 + Object a12, Object a13, Object a14, Object a15,
99.4412 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4413 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
99.4414 + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
99.4415 + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
99.4416 + Object a4, Object a5, Object a6, Object a7,
99.4417 + Object a8, Object a9, Object a10, Object a11,
99.4418 + Object a12, Object a13, Object a14, Object a15,
99.4419 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4420 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
99.4421 + protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
99.4422 + Object a4, Object a5, Object a6, Object a7,
99.4423 + Object a8, Object a9, Object a10, Object a11,
99.4424 + Object a12, Object a13, Object a14, Object a15,
99.4425 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4426 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4427 + a10, filter.invokeExact(a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
99.4428 + protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
99.4429 + Object a4, Object a5, Object a6, Object a7,
99.4430 + Object a8, Object a9, Object a10, Object a11,
99.4431 + Object a12, Object a13, Object a14, Object a15,
99.4432 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4433 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4434 + a10, a11, filter.invokeExact(a12, a13, a14, a15, a16, a17, a18, a19)); }
99.4435 + protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
99.4436 + Object a4, Object a5, Object a6, Object a7,
99.4437 + Object a8, Object a9, Object a10, Object a11,
99.4438 + Object a12, Object a13, Object a14, Object a15,
99.4439 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4440 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4441 + a10, a11, a12, filter.invokeExact(a13, a14, a15, a16, a17, a18, a19)); }
99.4442 + protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
99.4443 + Object a4, Object a5, Object a6, Object a7,
99.4444 + Object a8, Object a9, Object a10, Object a11,
99.4445 + Object a12, Object a13, Object a14, Object a15,
99.4446 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4447 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4448 + a10, a11, a12, a13, filter.invokeExact(a14, a15, a16, a17, a18, a19)); }
99.4449 + protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3,
99.4450 + Object a4, Object a5, Object a6, Object a7,
99.4451 + Object a8, Object a9, Object a10, Object a11,
99.4452 + Object a12, Object a13, Object a14, Object a15,
99.4453 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4454 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4455 + a10, a11, a12, a13, a14, filter.invokeExact(a15, a16, a17, a18, a19)); }
99.4456 + protected Object invoke_C16(Object a0, Object a1, Object a2, Object a3,
99.4457 + Object a4, Object a5, Object a6, Object a7,
99.4458 + Object a8, Object a9, Object a10, Object a11,
99.4459 + Object a12, Object a13, Object a14, Object a15,
99.4460 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4461 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4462 + a10, a11, a12, a13, a14, a15, filter.invokeExact(a16, a17, a18, a19)); }
99.4463 + protected Object invoke_C17(Object a0, Object a1, Object a2, Object a3,
99.4464 + Object a4, Object a5, Object a6, Object a7,
99.4465 + Object a8, Object a9, Object a10, Object a11,
99.4466 + Object a12, Object a13, Object a14, Object a15,
99.4467 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4468 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4469 + a10, a11, a12, a13, a14, a15, a16, filter.invokeExact(a17, a18, a19)); }
99.4470 + protected Object invoke_C18(Object a0, Object a1, Object a2, Object a3,
99.4471 + Object a4, Object a5, Object a6, Object a7,
99.4472 + Object a8, Object a9, Object a10, Object a11,
99.4473 + Object a12, Object a13, Object a14, Object a15,
99.4474 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4475 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4476 + a10, a11, a12, a13, a14, a15, a16, a17, filter.invokeExact(a18, a19)); }
99.4477 + protected Object invoke_C19(Object a0, Object a1, Object a2, Object a3,
99.4478 + Object a4, Object a5, Object a6, Object a7,
99.4479 + Object a8, Object a9, Object a10, Object a11,
99.4480 + Object a12, Object a13, Object a14, Object a15,
99.4481 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4482 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
99.4483 + a10, a11, a12, a13, a14, a15, a16, a17, a18, filter.invokeExact(a19)); }
99.4484 + protected Object invoke_C20(Object a0, Object a1, Object a2, Object a3,
99.4485 + Object a4, Object a5, Object a6, Object a7,
99.4486 + Object a8, Object a9, Object a10, Object a11,
99.4487 + Object a12, Object a13, Object a14, Object a15,
99.4488 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4489 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, filter.invokeExact()); }
99.4490 + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
99.4491 + Object a4, Object a5, Object a6, Object a7,
99.4492 + Object a8, Object a9, Object a10, Object a11,
99.4493 + Object a12, Object a13, Object a14, Object a15,
99.4494 + Object a16, Object a17, Object a18, Object a19) throws Throwable {
99.4495 + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19 };
99.4496 + filter.invokeExact(av); // make the flyby
99.4497 + return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14], av[15], av[16], av[17], av[18], av[19]); }
99.4498 + }
99.4499 +}
100.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
100.2 +++ b/src/share/classes/java/lang/invoke/FilterOneArgument.java Tue Mar 29 20:19:55 2011 -0700
100.3 @@ -0,0 +1,80 @@
100.4 +/*
100.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
100.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
100.7 + *
100.8 + * This code is free software; you can redistribute it and/or modify it
100.9 + * under the terms of the GNU General Public License version 2 only, as
100.10 + * published by the Free Software Foundation. Oracle designates this
100.11 + * particular file as subject to the "Classpath" exception as provided
100.12 + * by Oracle in the LICENSE file that accompanied this code.
100.13 + *
100.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
100.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
100.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
100.17 + * version 2 for more details (a copy is included in the LICENSE file that
100.18 + * accompanied this code).
100.19 + *
100.20 + * You should have received a copy of the GNU General Public License version
100.21 + * 2 along with this work; if not, write to the Free Software Foundation,
100.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
100.23 + *
100.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
100.25 + * or visit www.oracle.com if you need additional information or have any
100.26 + * questions.
100.27 + */
100.28 +
100.29 +package java.lang.invoke;
100.30 +
100.31 +import static java.lang.invoke.MethodHandleStatics.*;
100.32 +import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
100.33 +
100.34 +/**
100.35 + * Unary function composition, useful for many small plumbing jobs.
100.36 + * The invoke method takes a single reference argument, and returns a reference
100.37 + * Internally, it first calls the {@code filter} method on the argument,
100.38 + * Making up the difference between the raw method type and the
100.39 + * final method type is the responsibility of a JVM-level adapter.
100.40 + * @author jrose
100.41 + */
100.42 +class FilterOneArgument extends BoundMethodHandle {
100.43 + protected final MethodHandle filter; // Object -> Object
100.44 + protected final MethodHandle target; // Object -> Object
100.45 +
100.46 + @Override
100.47 + public String toString() {
100.48 + return target.toString();
100.49 + }
100.50 +
100.51 + protected Object invoke(Object argument) throws Throwable {
100.52 + Object filteredArgument = filter.invokeExact(argument);
100.53 + return target.invokeExact(filteredArgument);
100.54 + }
100.55 +
100.56 + private static final MethodHandle INVOKE;
100.57 + static {
100.58 + try {
100.59 + INVOKE =
100.60 + IMPL_LOOKUP.findVirtual(FilterOneArgument.class, "invoke",
100.61 + MethodType.genericMethodType(1));
100.62 + } catch (ReflectiveOperationException ex) {
100.63 + throw uncaughtException(ex);
100.64 + }
100.65 + }
100.66 +
100.67 + protected FilterOneArgument(MethodHandle filter, MethodHandle target) {
100.68 + super(INVOKE);
100.69 + this.filter = filter;
100.70 + this.target = target;
100.71 + }
100.72 +
100.73 + public static MethodHandle make(MethodHandle filter, MethodHandle target) {
100.74 + if (filter == null) return target;
100.75 + if (target == null) return filter;
100.76 + return new FilterOneArgument(filter, target);
100.77 + }
100.78 +
100.79 +// MethodHandle make(MethodHandle filter1, MethodHandle filter2, MethodHandle target) {
100.80 +// MethodHandle filter = make(filter1, filter2);
100.81 +// return make(filter, target);
100.82 +// }
100.83 +}
101.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
101.2 +++ b/src/share/classes/java/lang/invoke/FromGeneric.java Tue Mar 29 20:19:55 2011 -0700
101.3 @@ -0,0 +1,630 @@
101.4 +/*
101.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
101.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
101.7 + *
101.8 + * This code is free software; you can redistribute it and/or modify it
101.9 + * under the terms of the GNU General Public License version 2 only, as
101.10 + * published by the Free Software Foundation. Oracle designates this
101.11 + * particular file as subject to the "Classpath" exception as provided
101.12 + * by Oracle in the LICENSE file that accompanied this code.
101.13 + *
101.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
101.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
101.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
101.17 + * version 2 for more details (a copy is included in the LICENSE file that
101.18 + * accompanied this code).
101.19 + *
101.20 + * You should have received a copy of the GNU General Public License version
101.21 + * 2 along with this work; if not, write to the Free Software Foundation,
101.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
101.23 + *
101.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
101.25 + * or visit www.oracle.com if you need additional information or have any
101.26 + * questions.
101.27 + */
101.28 +
101.29 +package java.lang.invoke;
101.30 +
101.31 +import sun.invoke.util.ValueConversions;
101.32 +import sun.invoke.util.Wrapper;
101.33 +import java.lang.reflect.*;
101.34 +import static java.lang.invoke.MethodHandleStatics.*;
101.35 +import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
101.36 +
101.37 +/**
101.38 + * Adapters which mediate between incoming calls which are generic
101.39 + * and outgoing calls which are not. Any call can be represented generically
101.40 + * boxing up its arguments, and (on return) unboxing the return value.
101.41 + * <p>
101.42 + * A call is "generic" (in MethodHandle terms) if its MethodType features
101.43 + * only Object arguments. A non-generic call therefore features
101.44 + * primitives and/or reference types other than Object.
101.45 + * An adapter has types for its incoming and outgoing calls.
101.46 + * The incoming call type is simply determined by the adapter's type
101.47 + * (the MethodType it presents to callers). The outgoing call type
101.48 + * is determined by the adapter's target (a MethodHandle that the adapter
101.49 + * either binds internally or else takes as a leading argument).
101.50 + * (To stretch the term, adapter-like method handles may have multiple
101.51 + * targets or be polymorphic across multiple call types.)
101.52 + * @author jrose
101.53 + */
101.54 +class FromGeneric {
101.55 + // type for the outgoing call (may have primitives, etc.)
101.56 + private final MethodType targetType;
101.57 + // type of the outgoing call internal to the adapter
101.58 + private final MethodType internalType;
101.59 + // prototype adapter (clone and customize for each new target!)
101.60 + private final Adapter adapter;
101.61 + // entry point for adapter (Adapter mh, a...) => ...
101.62 + private final MethodHandle entryPoint;
101.63 + // unboxing invoker of type (MH, Object**N) => raw return value
101.64 + // it makes up the difference of internalType => targetType
101.65 + private final MethodHandle unboxingInvoker;
101.66 + // conversion which boxes a the target's raw return value
101.67 + private final MethodHandle returnConversion;
101.68 +
101.69 + /** Compute and cache information common to all unboxing adapters
101.70 + * that can call out to targets of the erasure-family of the given erased type.
101.71 + */
101.72 + private FromGeneric(MethodType targetType) {
101.73 + this.targetType = targetType;
101.74 + MethodType internalType0;
101.75 + // the target invoker will generally need casts on reference arguments
101.76 + Adapter ad = findAdapter(internalType0 = targetType.erase());
101.77 + if (ad != null) {
101.78 + // Immediate hit to exactly the adapter we want,
101.79 + // with no monkeying around with primitive types.
101.80 + this.internalType = internalType0;
101.81 + this.adapter = ad;
101.82 + this.entryPoint = ad.prototypeEntryPoint();
101.83 + this.returnConversion = computeReturnConversion(targetType, internalType0);
101.84 + this.unboxingInvoker = computeUnboxingInvoker(targetType, internalType0);
101.85 + return;
101.86 + }
101.87 +
101.88 + // outgoing primitive arguments will be wrapped; unwrap them
101.89 + MethodType primsAsObj = targetType.form().primArgsAsBoxes();
101.90 + MethodType objArgsRawRet = primsAsObj.form().primsAsInts();
101.91 + if (objArgsRawRet != targetType)
101.92 + ad = findAdapter(internalType0 = objArgsRawRet);
101.93 + if (ad == null) {
101.94 + ad = buildAdapterFromBytecodes(internalType0 = targetType);
101.95 + }
101.96 + this.internalType = internalType0;
101.97 + this.adapter = ad;
101.98 + MethodType tepType = targetType.insertParameterTypes(0, adapter.getClass());
101.99 + this.entryPoint = ad.prototypeEntryPoint();
101.100 + this.returnConversion = computeReturnConversion(targetType, internalType0);
101.101 + this.unboxingInvoker = computeUnboxingInvoker(targetType, internalType0);
101.102 + }
101.103 +
101.104 + /**
101.105 + * The typed target will be called according to targetType.
101.106 + * The adapter code will in fact see the raw result from internalType,
101.107 + * and must box it into an object. Produce a converter for this.
101.108 + */
101.109 + private static MethodHandle computeReturnConversion(
101.110 + MethodType targetType, MethodType internalType) {
101.111 + Class<?> tret = targetType.returnType();
101.112 + Class<?> iret = internalType.returnType();
101.113 + Wrapper wrap = Wrapper.forBasicType(tret);
101.114 + if (!iret.isPrimitive()) {
101.115 + assert(iret == Object.class);
101.116 + return ValueConversions.identity();
101.117 + } else if (wrap.primitiveType() == iret) {
101.118 + return ValueConversions.box(wrap, false);
101.119 + } else {
101.120 + assert(tret == double.class ? iret == long.class : iret == int.class);
101.121 + return ValueConversions.boxRaw(wrap, false);
101.122 + }
101.123 + }
101.124 +
101.125 + /**
101.126 + * The typed target will need an exact invocation point; provide it here.
101.127 + * The adapter will possibly need to make a slightly different call,
101.128 + * so adapt the invoker. This way, the logic for making up the
101.129 + * difference between what the adapter can call and what the target
101.130 + * needs can be cached once per type.
101.131 + */
101.132 + private static MethodHandle computeUnboxingInvoker(
101.133 + MethodType targetType, MethodType internalType) {
101.134 + // All the adapters we have here have reference-untyped internal calls.
101.135 + assert(internalType == internalType.erase());
101.136 + MethodHandle invoker = targetType.invokers().exactInvoker();
101.137 + // cast all narrow reference types, unbox all primitive arguments:
101.138 + MethodType fixArgsType = internalType.changeReturnType(targetType.returnType());
101.139 + MethodHandle fixArgs = MethodHandleImpl.convertArguments(
101.140 + invoker, Invokers.invokerType(fixArgsType),
101.141 + invoker.type(), null);
101.142 + if (fixArgs == null)
101.143 + throw new InternalError("bad fixArgs");
101.144 + // reinterpret the calling sequence as raw:
101.145 + MethodHandle retyper = AdapterMethodHandle.makeRetypeRaw(
101.146 + Invokers.invokerType(internalType), fixArgs);
101.147 + if (retyper == null)
101.148 + throw new InternalError("bad retyper");
101.149 + return retyper;
101.150 + }
101.151 +
101.152 + Adapter makeInstance(MethodHandle typedTarget) {
101.153 + MethodType type = typedTarget.type();
101.154 + if (type == targetType) {
101.155 + return adapter.makeInstance(entryPoint, unboxingInvoker, returnConversion, typedTarget);
101.156 + }
101.157 + // my erased-type is not exactly the same as the desired type
101.158 + assert(type.erase() == targetType); // else we are busted
101.159 + MethodHandle invoker = computeUnboxingInvoker(type, internalType);
101.160 + return adapter.makeInstance(entryPoint, invoker, returnConversion, typedTarget);
101.161 + }
101.162 +
101.163 + /** Build an adapter of the given generic type, which invokes typedTarget
101.164 + * on the incoming arguments, after unboxing as necessary.
101.165 + * The return value is boxed if necessary.
101.166 + * @param genericType the required type of the result
101.167 + * @param typedTarget the target
101.168 + * @return an adapter method handle
101.169 + */
101.170 + public static MethodHandle make(MethodHandle typedTarget) {
101.171 + MethodType type = typedTarget.type();
101.172 + if (type == type.generic()) return typedTarget;
101.173 + return FromGeneric.of(type).makeInstance(typedTarget);
101.174 + }
101.175 +
101.176 + /** Return the adapter information for this type's erasure. */
101.177 + static FromGeneric of(MethodType type) {
101.178 + MethodTypeForm form = type.form();
101.179 + FromGeneric fromGen = form.fromGeneric;
101.180 + if (fromGen == null)
101.181 + form.fromGeneric = fromGen = new FromGeneric(form.erasedType());
101.182 + return fromGen;
101.183 + }
101.184 +
101.185 + public String toString() {
101.186 + return "FromGeneric"+targetType;
101.187 + }
101.188 +
101.189 + /* Create an adapter that handles spreading calls for the given type. */
101.190 + static Adapter findAdapter(MethodType internalType) {
101.191 + MethodType entryType = internalType.generic();
101.192 + MethodTypeForm form = internalType.form();
101.193 + Class<?> rtype = internalType.returnType();
101.194 + int argc = form.parameterCount();
101.195 + int lac = form.longPrimitiveParameterCount();
101.196 + int iac = form.primitiveParameterCount() - lac;
101.197 + String intsAndLongs = (iac > 0 ? "I"+iac : "")+(lac > 0 ? "J"+lac : "");
101.198 + String rawReturn = String.valueOf(Wrapper.forPrimitiveType(rtype).basicTypeChar());
101.199 + String cname0 = rawReturn + argc;
101.200 + String cname1 = "A" + argc;
101.201 + String[] cnames = { cname0+intsAndLongs, cname0, cname1+intsAndLongs, cname1 };
101.202 + String iname = "invoke_"+cname0+intsAndLongs;
101.203 + // e.g., D5I2, D5, L5I2, L5; invoke_D5
101.204 + for (String cname : cnames) {
101.205 + Class<? extends Adapter> acls = Adapter.findSubClass(cname);
101.206 + if (acls == null) continue;
101.207 + // see if it has the required invoke method
101.208 + MethodHandle entryPoint = null;
101.209 + try {
101.210 + entryPoint = IMPL_LOOKUP.findSpecial(acls, iname, entryType, acls);
101.211 + } catch (ReflectiveOperationException ex) {
101.212 + }
101.213 + if (entryPoint == null) continue;
101.214 + Constructor<? extends Adapter> ctor = null;
101.215 + try {
101.216 + ctor = acls.getDeclaredConstructor(MethodHandle.class);
101.217 + } catch (NoSuchMethodException ex) {
101.218 + } catch (SecurityException ex) {
101.219 + }
101.220 + if (ctor == null) continue;
101.221 + try {
101.222 + // Produce an instance configured as a prototype.
101.223 + return ctor.newInstance(entryPoint);
101.224 + } catch (IllegalArgumentException ex) {
101.225 + } catch (InvocationTargetException wex) {
101.226 + Throwable ex = wex.getTargetException();
101.227 + if (ex instanceof Error) throw (Error)ex;
101.228 + if (ex instanceof RuntimeException) throw (RuntimeException)ex;
101.229 + } catch (InstantiationException ex) {
101.230 + } catch (IllegalAccessException ex) {
101.231 + }
101.232 + }
101.233 + return null;
101.234 + }
101.235 +
101.236 + static Adapter buildAdapterFromBytecodes(MethodType internalType) {
101.237 + throw new UnsupportedOperationException("NYI");
101.238 + }
101.239 +
101.240 + /**
101.241 + * This adapter takes some untyped arguments, and returns an untyped result.
101.242 + * Internally, it applies the invoker to the target, which causes the
101.243 + * objects to be unboxed; the result is a raw type in L/I/J/F/D.
101.244 + * This result is passed to convert, which is responsible for
101.245 + * converting the raw result into a boxed object.
101.246 + * The invoker is kept separate from the target because it can be
101.247 + * generated once per type erasure family, and reused across adapters.
101.248 + */
101.249 + static abstract class Adapter extends BoundMethodHandle {
101.250 + /*
101.251 + * class X<<R,int N>> extends Adapter {
101.252 + * (MH, Object**N)=>raw(R) invoker;
101.253 + * (any**N)=>R target;
101.254 + * raw(R)=>Object convert;
101.255 + * Object invoke(Object**N a) = convert(invoker(target, a...))
101.256 + * }
101.257 + */
101.258 + protected final MethodHandle invoker; // (MH, Object**N) => raw(R)
101.259 + protected final MethodHandle convert; // raw(R) => Object
101.260 + protected final MethodHandle target; // (any**N) => R
101.261 +
101.262 + @Override
101.263 + public String toString() {
101.264 + return addTypeString(target, this);
101.265 + }
101.266 +
101.267 + protected boolean isPrototype() { return target == null; }
101.268 + protected Adapter(MethodHandle entryPoint) {
101.269 + this(entryPoint, null, entryPoint, null);
101.270 + assert(isPrototype());
101.271 + }
101.272 + protected MethodHandle prototypeEntryPoint() {
101.273 + if (!isPrototype()) throw new InternalError();
101.274 + return convert;
101.275 + }
101.276 +
101.277 + protected Adapter(MethodHandle entryPoint,
101.278 + MethodHandle invoker, MethodHandle convert, MethodHandle target) {
101.279 + super(entryPoint);
101.280 + this.invoker = invoker;
101.281 + this.convert = convert;
101.282 + this.target = target;
101.283 + }
101.284 +
101.285 + /** Make a copy of self, with new fields. */
101.286 + protected abstract Adapter makeInstance(MethodHandle entryPoint,
101.287 + MethodHandle invoker, MethodHandle convert, MethodHandle target);
101.288 + // { return new ThisType(entryPoint, convert, target); }
101.289 +
101.290 + /// Conversions on the value returned from the target.
101.291 + protected Object convert_L(Object result) throws Throwable { return convert.invokeExact(result); }
101.292 + protected Object convert_I(int result) throws Throwable { return convert.invokeExact(result); }
101.293 + protected Object convert_J(long result) throws Throwable { return convert.invokeExact(result); }
101.294 + protected Object convert_F(float result) throws Throwable { return convert.invokeExact(result); }
101.295 + protected Object convert_D(double result) throws Throwable { return convert.invokeExact(result); }
101.296 +
101.297 + static private final String CLASS_PREFIX; // "java.lang.invoke.FromGeneric$"
101.298 + static {
101.299 + String aname = Adapter.class.getName();
101.300 + String sname = Adapter.class.getSimpleName();
101.301 + if (!aname.endsWith(sname)) throw new InternalError();
101.302 + CLASS_PREFIX = aname.substring(0, aname.length() - sname.length());
101.303 + }
101.304 + /** Find a sibing class of Adapter. */
101.305 + static Class<? extends Adapter> findSubClass(String name) {
101.306 + String cname = Adapter.CLASS_PREFIX + name;
101.307 + try {
101.308 + return Class.forName(cname).asSubclass(Adapter.class);
101.309 + } catch (ClassNotFoundException ex) {
101.310 + return null;
101.311 + } catch (ClassCastException ex) {
101.312 + return null;
101.313 + }
101.314 + }
101.315 + }
101.316 +
101.317 + /* generated classes follow this pattern:
101.318 + static class xA2 extends Adapter {
101.319 + protected xA2(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
101.320 + protected xA2(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.321 + { super(e, i, c, t); }
101.322 + protected xA2 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.323 + { return new xA2(e, i, c, t); }
101.324 + protected Object invoke_L2(Object a0, Object a1) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1)); }
101.325 + protected Object invoke_I2(Object a0, Object a1) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1)); }
101.326 + protected Object invoke_J2(Object a0, Object a1) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1)); }
101.327 + protected Object invoke_F2(Object a0, Object a1) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1)); }
101.328 + protected Object invoke_D2(Object a0, Object a1) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1)); }
101.329 + }
101.330 + // */
101.331 +
101.332 +/*
101.333 +: SHELL; n=FromGeneric; cp -p $n.java $n.java-; sed < $n.java- > $n.java+ -e '/{{*{{/,/}}*}}/w /tmp/genclasses.java' -e '/}}*}}/q'; (cd /tmp; javac -d . genclasses.java; java -cp . genclasses) >> $n.java+; echo '}' >> $n.java+; mv $n.java+ $n.java; mv $n.java- $n.java~
101.334 +//{{{
101.335 +import java.util.*;
101.336 +class genclasses {
101.337 + static String[] TYPES = { "Object", "int ", "long ", "float ", "double" };
101.338 + static String[] WRAPS = { " ", "(Integer)", "(Long) ", "(Float) ", "(Double) " };
101.339 + static String[] TCHARS = { "L", "I", "J", "F", "D", "A" };
101.340 + static String[][] TEMPLATES = { {
101.341 + "@for@ arity=0..10 rcat<=4 nrefs<=99 nints=0 nlongs=0",
101.342 + " //@each-cat@",
101.343 + " static class @cat@ extends Adapter {",
101.344 + " protected @cat@(MethodHandle entryPoint) { super(entryPoint); } // to build prototype",
101.345 + " protected @cat@(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)",
101.346 + " { super(e, i, c, t); }",
101.347 + " protected @cat@ makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)",
101.348 + " { return new @cat@(e, i, c, t); }",
101.349 + " //@each-R@",
101.350 + " protected Object invoke_@catN@(@Tvav@) throws Throwable { return convert_@Rc@((@R@)@W@invoker.invokeExact(target@av@)); }",
101.351 + " //@end-R@",
101.352 + " }",
101.353 + } };
101.354 + static final String NEWLINE_INDENT = "\n ";
101.355 + enum VAR {
101.356 + cat, catN, R, Rc, W, av, Tvav, Ovav;
101.357 + public final String pattern = "@"+toString().replace('_','.')+"@";
101.358 + public String binding;
101.359 + static void makeBindings(boolean topLevel, int rcat, int nrefs, int nints, int nlongs) {
101.360 + int nargs = nrefs + nints + nlongs;
101.361 + if (topLevel)
101.362 + VAR.cat.binding = catstr(ALL_RETURN_TYPES ? TYPES.length : rcat, nrefs, nints, nlongs);
101.363 + VAR.catN.binding = catstr(rcat, nrefs, nints, nlongs);
101.364 + VAR.R.binding = TYPES[rcat];
101.365 + VAR.Rc.binding = TCHARS[rcat];
101.366 + VAR.W.binding = WRAPS[rcat];
101.367 + String[] Tv = new String[nargs];
101.368 + String[] av = new String[nargs];
101.369 + String[] Tvav = new String[nargs];
101.370 + String[] Ovav = new String[nargs];
101.371 + for (int i = 0; i < nargs; i++) {
101.372 + int tcat = (i < nrefs) ? 0 : (i < nrefs + nints) ? 1 : 2;
101.373 + Tv[i] = TYPES[tcat];
101.374 + av[i] = arg(i);
101.375 + Tvav[i] = param(Tv[i], av[i]);
101.376 + Ovav[i] = param("Object", av[i]);
101.377 + }
101.378 + VAR.av.binding = comma(", ", av);
101.379 + VAR.Tvav.binding = comma(Tvav);
101.380 + VAR.Ovav.binding = comma(Ovav);
101.381 + }
101.382 + static String arg(int i) { return "a"+i; }
101.383 + static String param(String t, String a) { return t+" "+a; }
101.384 + static String comma(String[] v) { return comma("", v); }
101.385 + static String comma(String sep, String[] v) {
101.386 + if (v.length == 0) return "";
101.387 + String res = sep+v[0];
101.388 + for (int i = 1; i < v.length; i++) res += ", "+v[i];
101.389 + return res;
101.390 + }
101.391 + static String transform(String string) {
101.392 + for (VAR var : values())
101.393 + string = string.replaceAll(var.pattern, var.binding);
101.394 + return string;
101.395 + }
101.396 + }
101.397 + static String[] stringsIn(String[] strings, int beg, int end) {
101.398 + return Arrays.copyOfRange(strings, beg, Math.min(end, strings.length));
101.399 + }
101.400 + static String[] stringsBefore(String[] strings, int pos) {
101.401 + return stringsIn(strings, 0, pos);
101.402 + }
101.403 + static String[] stringsAfter(String[] strings, int pos) {
101.404 + return stringsIn(strings, pos, strings.length);
101.405 + }
101.406 + static int indexAfter(String[] strings, int pos, String tag) {
101.407 + return Math.min(indexBefore(strings, pos, tag) + 1, strings.length);
101.408 + }
101.409 + static int indexBefore(String[] strings, int pos, String tag) {
101.410 + for (int i = pos, end = strings.length; ; i++) {
101.411 + if (i == end || strings[i].endsWith(tag)) return i;
101.412 + }
101.413 + }
101.414 + static int MIN_ARITY, MAX_ARITY, MAX_RCAT, MAX_REFS, MAX_INTS, MAX_LONGS;
101.415 + static boolean ALL_ARG_TYPES, ALL_RETURN_TYPES;
101.416 + static HashSet<String> done = new HashSet<String>();
101.417 + public static void main(String... av) {
101.418 + for (String[] template : TEMPLATES) {
101.419 + int forLinesLimit = indexBefore(template, 0, "@each-cat@");
101.420 + String[] forLines = stringsBefore(template, forLinesLimit);
101.421 + template = stringsAfter(template, forLinesLimit);
101.422 + for (String forLine : forLines)
101.423 + expandTemplate(forLine, template);
101.424 + }
101.425 + }
101.426 + static void expandTemplate(String forLine, String[] template) {
101.427 + String[] params = forLine.split("[^0-9]+");
101.428 + if (params[0].length() == 0) params = stringsAfter(params, 1);
101.429 + System.out.println("//params="+Arrays.asList(params));
101.430 + int pcur = 0;
101.431 + MIN_ARITY = Integer.valueOf(params[pcur++]);
101.432 + MAX_ARITY = Integer.valueOf(params[pcur++]);
101.433 + MAX_RCAT = Integer.valueOf(params[pcur++]);
101.434 + MAX_REFS = Integer.valueOf(params[pcur++]);
101.435 + MAX_INTS = Integer.valueOf(params[pcur++]);
101.436 + MAX_LONGS = Integer.valueOf(params[pcur++]);
101.437 + if (pcur != params.length) throw new RuntimeException("bad extra param: "+forLine);
101.438 + if (MAX_RCAT >= TYPES.length) MAX_RCAT = TYPES.length - 1;
101.439 + ALL_ARG_TYPES = (indexBefore(template, 0, "@each-Tv@") < template.length);
101.440 + ALL_RETURN_TYPES = (indexBefore(template, 0, "@each-R@") < template.length);
101.441 + for (int nargs = MIN_ARITY; nargs <= MAX_ARITY; nargs++) {
101.442 + for (int rcat = 0; rcat <= MAX_RCAT; rcat++) {
101.443 + expandTemplate(template, true, rcat, nargs, 0, 0);
101.444 + if (ALL_ARG_TYPES) break;
101.445 + expandTemplateForPrims(template, true, rcat, nargs, 1, 1);
101.446 + if (ALL_RETURN_TYPES) break;
101.447 + }
101.448 + }
101.449 + }
101.450 + static String catstr(int rcat, int nrefs, int nints, int nlongs) {
101.451 + int nargs = nrefs + nints + nlongs;
101.452 + String cat = TCHARS[rcat] + nargs;
101.453 + if (!ALL_ARG_TYPES) cat += (nints==0?"":"I"+nints)+(nlongs==0?"":"J"+nlongs);
101.454 + return cat;
101.455 + }
101.456 + static void expandTemplateForPrims(String[] template, boolean topLevel, int rcat, int nargs, int minints, int minlongs) {
101.457 + for (int isLong = 0; isLong <= 1; isLong++) {
101.458 + for (int nprims = 1; nprims <= nargs; nprims++) {
101.459 + int nrefs = nargs - nprims;
101.460 + int nints = ((1-isLong) * nprims);
101.461 + int nlongs = (isLong * nprims);
101.462 + expandTemplate(template, topLevel, rcat, nrefs, nints, nlongs);
101.463 + }
101.464 + }
101.465 + }
101.466 + static void expandTemplate(String[] template, boolean topLevel,
101.467 + int rcat, int nrefs, int nints, int nlongs) {
101.468 + int nargs = nrefs + nints + nlongs;
101.469 + if (nrefs > MAX_REFS || nints > MAX_INTS || nlongs > MAX_LONGS) return;
101.470 + VAR.makeBindings(topLevel, rcat, nrefs, nints, nlongs);
101.471 + if (topLevel && !done.add(VAR.cat.binding)) {
101.472 + System.out.println(" //repeat "+VAR.cat.binding);
101.473 + return;
101.474 + }
101.475 + for (int i = 0; i < template.length; i++) {
101.476 + String line = template[i];
101.477 + if (line.endsWith("@each-cat@")) {
101.478 + // ignore
101.479 + } else if (line.endsWith("@each-R@")) {
101.480 + int blockEnd = indexAfter(template, i, "@end-R@");
101.481 + String[] block = stringsIn(template, i+1, blockEnd-1);
101.482 + for (int rcat1 = rcat; rcat1 <= MAX_RCAT; rcat1++)
101.483 + expandTemplate(block, false, rcat1, nrefs, nints, nlongs);
101.484 + VAR.makeBindings(topLevel, rcat, nrefs, nints, nlongs);
101.485 + i = blockEnd-1; continue;
101.486 + } else if (line.endsWith("@each-Tv@")) {
101.487 + int blockEnd = indexAfter(template, i, "@end-Tv@");
101.488 + String[] block = stringsIn(template, i+1, blockEnd-1);
101.489 + expandTemplate(block, false, rcat, nrefs, nints, nlongs);
101.490 + expandTemplateForPrims(block, false, rcat, nargs, nints+1, nlongs+1);
101.491 + VAR.makeBindings(topLevel, rcat, nrefs, nints, nlongs);
101.492 + i = blockEnd-1; continue;
101.493 + } else {
101.494 + System.out.println(VAR.transform(line));
101.495 + }
101.496 + }
101.497 + }
101.498 +}
101.499 +//}}} */
101.500 +//params=[0, 10, 4, 99, 0, 0]
101.501 + static class A0 extends Adapter {
101.502 + protected A0(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
101.503 + protected A0(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.504 + { super(e, i, c, t); }
101.505 + protected A0 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.506 + { return new A0(e, i, c, t); }
101.507 + protected Object invoke_L0() throws Throwable { return convert_L((Object)invoker.invokeExact(target)); }
101.508 + protected Object invoke_I0() throws Throwable { return convert_I((int) invoker.invokeExact(target)); }
101.509 + protected Object invoke_J0() throws Throwable { return convert_J((long) invoker.invokeExact(target)); }
101.510 + protected Object invoke_F0() throws Throwable { return convert_F((float) invoker.invokeExact(target)); }
101.511 + protected Object invoke_D0() throws Throwable { return convert_D((double)invoker.invokeExact(target)); }
101.512 + }
101.513 + static class A1 extends Adapter {
101.514 + protected A1(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
101.515 + protected A1(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.516 + { super(e, i, c, t); }
101.517 + protected A1 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.518 + { return new A1(e, i, c, t); }
101.519 + protected Object invoke_L1(Object a0) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0)); }
101.520 + protected Object invoke_I1(Object a0) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0)); }
101.521 + protected Object invoke_J1(Object a0) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0)); }
101.522 + protected Object invoke_F1(Object a0) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0)); }
101.523 + protected Object invoke_D1(Object a0) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0)); }
101.524 + }
101.525 + static class A2 extends Adapter {
101.526 + protected A2(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
101.527 + protected A2(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.528 + { super(e, i, c, t); }
101.529 + protected A2 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.530 + { return new A2(e, i, c, t); }
101.531 + protected Object invoke_L2(Object a0, Object a1) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1)); }
101.532 + protected Object invoke_I2(Object a0, Object a1) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1)); }
101.533 + protected Object invoke_J2(Object a0, Object a1) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1)); }
101.534 + protected Object invoke_F2(Object a0, Object a1) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1)); }
101.535 + protected Object invoke_D2(Object a0, Object a1) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1)); }
101.536 + }
101.537 + static class A3 extends Adapter {
101.538 + protected A3(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
101.539 + protected A3(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.540 + { super(e, i, c, t); }
101.541 + protected A3 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.542 + { return new A3(e, i, c, t); }
101.543 + protected Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2)); }
101.544 + protected Object invoke_I3(Object a0, Object a1, Object a2) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2)); }
101.545 + protected Object invoke_J3(Object a0, Object a1, Object a2) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2)); }
101.546 + protected Object invoke_F3(Object a0, Object a1, Object a2) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2)); }
101.547 + protected Object invoke_D3(Object a0, Object a1, Object a2) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2)); }
101.548 + }
101.549 + static class A4 extends Adapter {
101.550 + protected A4(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
101.551 + protected A4(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.552 + { super(e, i, c, t); }
101.553 + protected A4 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.554 + { return new A4(e, i, c, t); }
101.555 + protected Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3)); }
101.556 + protected Object invoke_I4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3)); }
101.557 + protected Object invoke_J4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3)); }
101.558 + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3)); }
101.559 + protected Object invoke_D4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3)); }
101.560 + }
101.561 + static class A5 extends Adapter {
101.562 + protected A5(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
101.563 + protected A5(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.564 + { super(e, i, c, t); }
101.565 + protected A5 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.566 + { return new A5(e, i, c, t); }
101.567 + protected Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4)); }
101.568 + protected Object invoke_I5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4)); }
101.569 + protected Object invoke_J5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4)); }
101.570 + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4)); }
101.571 + protected Object invoke_D5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4)); }
101.572 + }
101.573 + static class A6 extends Adapter {
101.574 + protected A6(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
101.575 + protected A6(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.576 + { super(e, i, c, t); }
101.577 + protected A6 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.578 + { return new A6(e, i, c, t); }
101.579 + protected Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); }
101.580 + protected Object invoke_I6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); }
101.581 + protected Object invoke_J6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); }
101.582 + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); }
101.583 + protected Object invoke_D6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); }
101.584 + }
101.585 + static class A7 extends Adapter {
101.586 + protected A7(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
101.587 + protected A7(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.588 + { super(e, i, c, t); }
101.589 + protected A7 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.590 + { return new A7(e, i, c, t); }
101.591 + protected Object invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); }
101.592 + protected Object invoke_I7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); }
101.593 + protected Object invoke_J7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); }
101.594 + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); }
101.595 + protected Object invoke_D7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); }
101.596 + }
101.597 + static class A8 extends Adapter {
101.598 + protected A8(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
101.599 + protected A8(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.600 + { super(e, i, c, t); }
101.601 + protected A8 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.602 + { return new A8(e, i, c, t); }
101.603 + protected Object invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); }
101.604 + protected Object invoke_I8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); }
101.605 + protected Object invoke_J8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); }
101.606 + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); }
101.607 + protected Object invoke_D8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); }
101.608 + }
101.609 + static class A9 extends Adapter {
101.610 + protected A9(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
101.611 + protected A9(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.612 + { super(e, i, c, t); }
101.613 + protected A9 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.614 + { return new A9(e, i, c, t); }
101.615 + protected Object invoke_L9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
101.616 + protected Object invoke_I9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
101.617 + protected Object invoke_J9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
101.618 + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
101.619 + protected Object invoke_D9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
101.620 + }
101.621 + static class A10 extends Adapter {
101.622 + protected A10(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
101.623 + protected A10(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.624 + { super(e, i, c, t); }
101.625 + protected A10 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
101.626 + { return new A10(e, i, c, t); }
101.627 + protected Object invoke_L10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
101.628 + protected Object invoke_I10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
101.629 + protected Object invoke_J10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
101.630 + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
101.631 + protected Object invoke_D10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
101.632 + }
101.633 +}
102.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
102.2 +++ b/src/share/classes/java/lang/invoke/InvokeDynamic.java Tue Mar 29 20:19:55 2011 -0700
102.3 @@ -0,0 +1,33 @@
102.4 +/*
102.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
102.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
102.7 + *
102.8 + * This code is free software; you can redistribute it and/or modify it
102.9 + * under the terms of the GNU General Public License version 2 only, as
102.10 + * published by the Free Software Foundation. Oracle designates this
102.11 + * particular file as subject to the "Classpath" exception as provided
102.12 + * by Oracle in the LICENSE file that accompanied this code.
102.13 + *
102.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
102.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
102.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
102.17 + * version 2 for more details (a copy is included in the LICENSE file that
102.18 + * accompanied this code).
102.19 + *
102.20 + * You should have received a copy of the GNU General Public License version
102.21 + * 2 along with this work; if not, write to the Free Software Foundation,
102.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
102.23 + *
102.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
102.25 + * or visit www.oracle.com if you need additional information or have any
102.26 + * questions.
102.27 + */
102.28 +
102.29 +package java.lang.invoke;
102.30 +
102.31 +/**
102.32 + * This is a place-holder class. Some HotSpot implementations need to see it.
102.33 + */
102.34 +final class InvokeDynamic {
102.35 + private InvokeDynamic() { throw new InternalError(); } // do not instantiate
102.36 +}
103.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
103.2 +++ b/src/share/classes/java/lang/invoke/InvokeGeneric.java Tue Mar 29 20:19:55 2011 -0700
103.3 @@ -0,0 +1,151 @@
103.4 +/*
103.5 + * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
103.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
103.7 + *
103.8 + * This code is free software; you can redistribute it and/or modify it
103.9 + * under the terms of the GNU General Public License version 2 only, as
103.10 + * published by the Free Software Foundation. Oracle designates this
103.11 + * particular file as subject to the "Classpath" exception as provided
103.12 + * by Oracle in the LICENSE file that accompanied this code.
103.13 + *
103.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
103.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
103.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
103.17 + * version 2 for more details (a copy is included in the LICENSE file that
103.18 + * accompanied this code).
103.19 + *
103.20 + * You should have received a copy of the GNU General Public License version
103.21 + * 2 along with this work; if not, write to the Free Software Foundation,
103.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
103.23 + *
103.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
103.25 + * or visit www.oracle.com if you need additional information or have any
103.26 + * questions.
103.27 + */
103.28 +
103.29 +package java.lang.invoke;
103.30 +
103.31 +import sun.invoke.util.*;
103.32 +import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
103.33 +
103.34 +/**
103.35 + * Adapters which manage MethodHandle.invokeGeneric calls.
103.36 + * The JVM calls one of these when the exact type match fails.
103.37 + * @author jrose
103.38 + */
103.39 +class InvokeGeneric {
103.40 + // erased type for the call, which originates from an invokeGeneric site
103.41 + private final MethodType erasedCallerType;
103.42 + // an invoker of type (MT, MH; A...) -> R
103.43 + private final MethodHandle initialInvoker;
103.44 +
103.45 + /** Compute and cache information for this adapter, so that it can
103.46 + * call out to targets of the erasure-family of the given erased type.
103.47 + */
103.48 + /*non-public*/ InvokeGeneric(MethodType erasedCallerType) throws ReflectiveOperationException {
103.49 + assert(erasedCallerType.equals(erasedCallerType.erase()));
103.50 + this.erasedCallerType = erasedCallerType;
103.51 + this.initialInvoker = makeInitialInvoker();
103.52 + assert initialInvoker.type().equals(erasedCallerType
103.53 + .insertParameterTypes(0, MethodType.class, MethodHandle.class))
103.54 + : initialInvoker.type();
103.55 + }
103.56 +
103.57 + private static MethodHandles.Lookup lookup() {
103.58 + return IMPL_LOOKUP;
103.59 + }
103.60 +
103.61 + /** Return the adapter information for this type's erasure. */
103.62 + /*non-public*/ static MethodHandle genericInvokerOf(MethodType erasedCallerType) throws ReflectiveOperationException {
103.63 + InvokeGeneric gen = new InvokeGeneric(erasedCallerType);
103.64 + return gen.initialInvoker;
103.65 + }
103.66 +
103.67 + private MethodHandle makeInitialInvoker() throws ReflectiveOperationException {
103.68 + // postDispatch = #(MH'; MT, MH; A...){MH'(MT, MH; A)}
103.69 + MethodHandle postDispatch = makePostDispatchInvoker();
103.70 + MethodHandle invoker;
103.71 + if (returnConversionPossible()) {
103.72 + invoker = MethodHandles.foldArguments(postDispatch,
103.73 + dispatcher("dispatchWithConversion"));
103.74 + } else {
103.75 + invoker = MethodHandles.foldArguments(postDispatch, dispatcher("dispatch"));
103.76 + }
103.77 + return invoker;
103.78 + }
103.79 +
103.80 + private static final Class<?>[] EXTRA_ARGS = { MethodType.class, MethodHandle.class };
103.81 + private MethodHandle makePostDispatchInvoker() {
103.82 + // Take (MH'; MT, MH; A...) and run MH'(MT, MH; A...).
103.83 + MethodType invokerType = erasedCallerType.insertParameterTypes(0, EXTRA_ARGS);
103.84 + return invokerType.invokers().exactInvoker();
103.85 + }
103.86 + private MethodHandle dropDispatchArguments(MethodHandle targetInvoker) {
103.87 + assert(targetInvoker.type().parameterType(0) == MethodHandle.class);
103.88 + return MethodHandles.dropArguments(targetInvoker, 1, EXTRA_ARGS);
103.89 + }
103.90 +
103.91 + private MethodHandle dispatcher(String dispatchName) throws ReflectiveOperationException {
103.92 + return lookup().bind(this, dispatchName,
103.93 + MethodType.methodType(MethodHandle.class,
103.94 + MethodType.class, MethodHandle.class));
103.95 + }
103.96 +
103.97 + static final boolean USE_AS_TYPE_PATH = true;
103.98 +
103.99 + /** Return a method handle to invoke on the callerType, target, and remaining arguments.
103.100 + * The method handle must finish the call.
103.101 + * This is the first look at the caller type and target.
103.102 + */
103.103 + private MethodHandle dispatch(MethodType callerType, MethodHandle target) {
103.104 + MethodType targetType = target.type();
103.105 + if (USE_AS_TYPE_PATH || target.isVarargsCollector()) {
103.106 + MethodHandle newTarget = target.asType(callerType);
103.107 + targetType = callerType;
103.108 + Invokers invokers = targetType.invokers();
103.109 + MethodHandle invoker = invokers.erasedInvokerWithDrops;
103.110 + if (invoker == null) {
103.111 + invokers.erasedInvokerWithDrops = invoker =
103.112 + dropDispatchArguments(invokers.erasedInvoker());
103.113 + }
103.114 + return invoker.bindTo(newTarget);
103.115 + }
103.116 + throw new RuntimeException("NYI");
103.117 + }
103.118 +
103.119 + private MethodHandle dispatchWithConversion(MethodType callerType, MethodHandle target) {
103.120 + MethodHandle finisher = dispatch(callerType, target);
103.121 + if (returnConversionNeeded(callerType, target))
103.122 + finisher = addReturnConversion(finisher, callerType.returnType()); //FIXME: slow
103.123 + return finisher;
103.124 + }
103.125 +
103.126 + private boolean returnConversionPossible() {
103.127 + Class<?> needType = erasedCallerType.returnType();
103.128 + return !needType.isPrimitive();
103.129 + }
103.130 + private boolean returnConversionNeeded(MethodType callerType, MethodHandle target) {
103.131 + Class<?> needType = callerType.returnType();
103.132 + if (needType == erasedCallerType.returnType())
103.133 + return false; // no conversions possible, since must be primitive or Object
103.134 + Class<?> haveType = target.type().returnType();
103.135 + if (VerifyType.isNullConversion(haveType, needType))
103.136 + return false;
103.137 + return true;
103.138 + }
103.139 + private MethodHandle addReturnConversion(MethodHandle target, Class<?> type) {
103.140 + if (true) throw new RuntimeException("NYI");
103.141 + // FIXME: This is slow because it creates a closure node on every call that requires a return cast.
103.142 + MethodType targetType = target.type();
103.143 + MethodHandle caster = ValueConversions.identity(type);
103.144 + caster = caster.asType(MethodType.methodType(type, targetType.returnType()));
103.145 + // Drop irrelevant arguments, because we only care about the return value:
103.146 + caster = MethodHandles.dropArguments(caster, 1, targetType.parameterList());
103.147 + MethodHandle result = MethodHandles.foldArguments(caster, target);
103.148 + return result.asType(target.type());
103.149 + }
103.150 +
103.151 + public String toString() {
103.152 + return "InvokeGeneric"+erasedCallerType;
103.153 + }
103.154 +}
104.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
104.2 +++ b/src/share/classes/java/lang/invoke/Invokers.java Tue Mar 29 20:19:55 2011 -0700
104.3 @@ -0,0 +1,144 @@
104.4 +/*
104.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
104.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
104.7 + *
104.8 + * This code is free software; you can redistribute it and/or modify it
104.9 + * under the terms of the GNU General Public License version 2 only, as
104.10 + * published by the Free Software Foundation. Oracle designates this
104.11 + * particular file as subject to the "Classpath" exception as provided
104.12 + * by Oracle in the LICENSE file that accompanied this code.
104.13 + *
104.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
104.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
104.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
104.17 + * version 2 for more details (a copy is included in the LICENSE file that
104.18 + * accompanied this code).
104.19 + *
104.20 + * You should have received a copy of the GNU General Public License version
104.21 + * 2 along with this work; if not, write to the Free Software Foundation,
104.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
104.23 + *
104.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
104.25 + * or visit www.oracle.com if you need additional information or have any
104.26 + * questions.
104.27 + */
104.28 +
104.29 +package java.lang.invoke;
104.30 +
104.31 +import sun.invoke.empty.Empty;
104.32 +import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
104.33 +
104.34 +/**
104.35 + * Construction and caching of often-used invokers.
104.36 + * @author jrose
104.37 + */
104.38 +class Invokers {
104.39 + // exact type (sans leading taget MH) for the outgoing call
104.40 + private final MethodType targetType;
104.41 +
104.42 + // exact invoker for the outgoing call
104.43 + private /*lazy*/ MethodHandle exactInvoker;
104.44 +
104.45 + // erased (partially untyped but with primitives) invoker for the outgoing call
104.46 + private /*lazy*/ MethodHandle erasedInvoker;
104.47 + /*lazy*/ MethodHandle erasedInvokerWithDrops; // for InvokeGeneric
104.48 +
104.49 + // generic (untyped) invoker for the outgoing call
104.50 + private /*lazy*/ MethodHandle genericInvoker;
104.51 +
104.52 + // generic (untyped) invoker for the outgoing call; accepts a single Object[]
104.53 + private final /*lazy*/ MethodHandle[] spreadInvokers;
104.54 +
104.55 + // invoker for an unbound callsite
104.56 + private /*lazy*/ MethodHandle uninitializedCallSite;
104.57 +
104.58 + /** Compute and cache information common to all collecting adapters
104.59 + * that implement members of the erasure-family of the given erased type.
104.60 + */
104.61 + /*non-public*/ Invokers(MethodType targetType) {
104.62 + this.targetType = targetType;
104.63 + this.spreadInvokers = new MethodHandle[targetType.parameterCount()+1];
104.64 + }
104.65 +
104.66 + /*non-public*/ static MethodType invokerType(MethodType targetType) {
104.67 + return targetType.insertParameterTypes(0, MethodHandle.class);
104.68 + }
104.69 +
104.70 + /*non-public*/ MethodHandle exactInvoker() {
104.71 + MethodHandle invoker = exactInvoker;
104.72 + if (invoker != null) return invoker;
104.73 + try {
104.74 + invoker = IMPL_LOOKUP.findVirtual(MethodHandle.class, "invokeExact", targetType);
104.75 + } catch (ReflectiveOperationException ex) {
104.76 + throw new InternalError("JVM cannot find invoker for "+targetType);
104.77 + }
104.78 + assert(invokerType(targetType) == invoker.type());
104.79 + exactInvoker = invoker;
104.80 + return invoker;
104.81 + }
104.82 +
104.83 + /*non-public*/ MethodHandle genericInvoker() {
104.84 + MethodHandle invoker1 = exactInvoker();
104.85 + MethodHandle invoker = genericInvoker;
104.86 + if (invoker != null) return invoker;
104.87 + MethodType genericType = targetType.generic();
104.88 + invoker = MethodHandles.convertArguments(invoker1, invokerType(genericType));
104.89 + genericInvoker = invoker;
104.90 + return invoker;
104.91 + }
104.92 +
104.93 + /*non-public*/ MethodHandle erasedInvoker() {
104.94 + MethodHandle invoker1 = exactInvoker();
104.95 + MethodHandle invoker = erasedInvoker;
104.96 + if (invoker != null) return invoker;
104.97 + MethodType erasedType = targetType.erase();
104.98 + if (erasedType == targetType.generic())
104.99 + invoker = genericInvoker();
104.100 + else
104.101 + invoker = MethodHandles.convertArguments(invoker1, invokerType(erasedType));
104.102 + erasedInvoker = invoker;
104.103 + return invoker;
104.104 + }
104.105 +
104.106 + /*non-public*/ MethodHandle spreadInvoker(int objectArgCount) {
104.107 + MethodHandle vaInvoker = spreadInvokers[objectArgCount];
104.108 + if (vaInvoker != null) return vaInvoker;
104.109 + MethodHandle gInvoker = genericInvoker();
104.110 + vaInvoker = gInvoker.asSpreader(Object[].class, targetType.parameterCount() - objectArgCount);
104.111 + spreadInvokers[objectArgCount] = vaInvoker;
104.112 + return vaInvoker;
104.113 + }
104.114 +
104.115 + private static MethodHandle THROW_UCS = null;
104.116 +
104.117 + /*non-public*/ MethodHandle uninitializedCallSite() {
104.118 + MethodHandle invoker = uninitializedCallSite;
104.119 + if (invoker != null) return invoker;
104.120 + if (targetType.parameterCount() > 0) {
104.121 + MethodType type0 = targetType.dropParameterTypes(0, targetType.parameterCount());
104.122 + Invokers invokers0 = type0.invokers();
104.123 + invoker = MethodHandles.dropArguments(invokers0.uninitializedCallSite(),
104.124 + 0, targetType.parameterList());
104.125 + assert(invoker.type().equals(targetType));
104.126 + uninitializedCallSite = invoker;
104.127 + return invoker;
104.128 + }
104.129 + if (THROW_UCS == null) {
104.130 + try {
104.131 + THROW_UCS = IMPL_LOOKUP
104.132 + .findStatic(CallSite.class, "uninitializedCallSite",
104.133 + MethodType.methodType(Empty.class));
104.134 + } catch (ReflectiveOperationException ex) {
104.135 + throw new RuntimeException(ex);
104.136 + }
104.137 + }
104.138 + invoker = AdapterMethodHandle.makeRetypeRaw(targetType, THROW_UCS);
104.139 + assert(invoker.type().equals(targetType));
104.140 + uninitializedCallSite = invoker;
104.141 + return invoker;
104.142 + }
104.143 +
104.144 + public String toString() {
104.145 + return "Invokers"+targetType;
104.146 + }
104.147 +}
105.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
105.2 +++ b/src/share/classes/java/lang/invoke/MemberName.java Tue Mar 29 20:19:55 2011 -0700
105.3 @@ -0,0 +1,718 @@
105.4 +/*
105.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
105.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
105.7 + *
105.8 + * This code is free software; you can redistribute it and/or modify it
105.9 + * under the terms of the GNU General Public License version 2 only, as
105.10 + * published by the Free Software Foundation. Oracle designates this
105.11 + * particular file as subject to the "Classpath" exception as provided
105.12 + * by Oracle in the LICENSE file that accompanied this code.
105.13 + *
105.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
105.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
105.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
105.17 + * version 2 for more details (a copy is included in the LICENSE file that
105.18 + * accompanied this code).
105.19 + *
105.20 + * You should have received a copy of the GNU General Public License version
105.21 + * 2 along with this work; if not, write to the Free Software Foundation,
105.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
105.23 + *
105.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
105.25 + * or visit www.oracle.com if you need additional information or have any
105.26 + * questions.
105.27 + */
105.28 +
105.29 +package java.lang.invoke;
105.30 +
105.31 +import sun.invoke.util.BytecodeDescriptor;
105.32 +import java.lang.reflect.Constructor;
105.33 +import java.lang.reflect.Field;
105.34 +import java.lang.reflect.Method;
105.35 +import java.lang.reflect.Member;
105.36 +import java.lang.reflect.Modifier;
105.37 +import java.util.ArrayList;
105.38 +import java.util.Arrays;
105.39 +import java.util.Collections;
105.40 +import java.util.Iterator;
105.41 +import java.util.List;
105.42 +import static java.lang.invoke.MethodHandleNatives.Constants.*;
105.43 +import static java.lang.invoke.MethodHandleStatics.*;
105.44 +
105.45 +/**
105.46 + * A {@code MemberName} is a compact symbolic datum which fully characterizes
105.47 + * a method or field reference.
105.48 + * A member name refers to a field, method, constructor, or member type.
105.49 + * Every member name has a simple name (a string) and a type (either a Class or MethodType).
105.50 + * A member name may also have a non-null declaring class, or it may be simply
105.51 + * a naked name/type pair.
105.52 + * A member name may also have non-zero modifier flags.
105.53 + * Finally, a member name may be either resolved or unresolved.
105.54 + * If it is resolved, the existence of the named
105.55 + * <p>
105.56 + * Whether resolved or not, a member name provides no access rights or
105.57 + * invocation capability to its possessor. It is merely a compact
105.58 + * representation of all symbolic information necessary to link to
105.59 + * and properly use the named member.
105.60 + * <p>
105.61 + * When resolved, a member name's internal implementation may include references to JVM metadata.
105.62 + * This representation is stateless and only decriptive.
105.63 + * It provides no private information and no capability to use the member.
105.64 + * <p>
105.65 + * By contrast, a {@linkplain java.lang.reflect.Method} contains fuller information
105.66 + * about the internals of a method (except its bytecodes) and also
105.67 + * allows invocation. A MemberName is much lighter than a Method,
105.68 + * since it contains about 7 fields to the 16 of Method (plus its sub-arrays),
105.69 + * and those seven fields omit much of the information in Method.
105.70 + * @author jrose
105.71 + */
105.72 +/*non-public*/ final class MemberName implements Member, Cloneable {
105.73 + private Class<?> clazz; // class in which the method is defined
105.74 + private String name; // may be null if not yet materialized
105.75 + private Object type; // may be null if not yet materialized
105.76 + private int flags; // modifier bits; see reflect.Modifier
105.77 +
105.78 + private Object vmtarget; // VM-specific target value
105.79 + private int vmindex; // method index within class or interface
105.80 +
105.81 + { vmindex = VM_INDEX_UNINITIALIZED; }
105.82 +
105.83 + /** Return the declaring class of this member.
105.84 + * In the case of a bare name and type, the declaring class will be null.
105.85 + */
105.86 + public Class<?> getDeclaringClass() {
105.87 + if (clazz == null && isResolved()) {
105.88 + expandFromVM();
105.89 + }
105.90 + return clazz;
105.91 + }
105.92 +
105.93 + /** Utility method producing the class loader of the declaring class. */
105.94 + public ClassLoader getClassLoader() {
105.95 + return clazz.getClassLoader();
105.96 + }
105.97 +
105.98 + /** Return the simple name of this member.
105.99 + * For a type, it is the same as {@link Class#getSimpleName}.
105.100 + * For a method or field, it is the simple name of the member.
105.101 + * For a constructor, it is always {@code "<init>"}.
105.102 + */
105.103 + public String getName() {
105.104 + if (name == null) {
105.105 + expandFromVM();
105.106 + if (name == null) return null;
105.107 + }
105.108 + return name;
105.109 + }
105.110 +
105.111 + /** Return the declared type of this member, which
105.112 + * must be a method or constructor.
105.113 + */
105.114 + public MethodType getMethodType() {
105.115 + if (type == null) {
105.116 + expandFromVM();
105.117 + if (type == null) return null;
105.118 + }
105.119 + if (!isInvocable())
105.120 + throw newIllegalArgumentException("not invocable, no method type");
105.121 + if (type instanceof MethodType) {
105.122 + return (MethodType) type;
105.123 + }
105.124 + if (type instanceof String) {
105.125 + String sig = (String) type;
105.126 + MethodType res = MethodType.fromMethodDescriptorString(sig, getClassLoader());
105.127 + this.type = res;
105.128 + return res;
105.129 + }
105.130 + if (type instanceof Object[]) {
105.131 + Object[] typeInfo = (Object[]) type;
105.132 + Class<?>[] ptypes = (Class<?>[]) typeInfo[1];
105.133 + Class<?> rtype = (Class<?>) typeInfo[0];
105.134 + MethodType res = MethodType.methodType(rtype, ptypes);
105.135 + this.type = res;
105.136 + return res;
105.137 + }
105.138 + throw new InternalError("bad method type "+type);
105.139 + }
105.140 +
105.141 + /** Return the actual type under which this method or constructor must be invoked.
105.142 + * For non-static methods or constructors, this is the type with a leading parameter,
105.143 + * a reference to declaring class. For static methods, it is the same as the declared type.
105.144 + */
105.145 + public MethodType getInvocationType() {
105.146 + MethodType itype = getMethodType();
105.147 + if (!isStatic())
105.148 + itype = itype.insertParameterTypes(0, clazz);
105.149 + return itype;
105.150 + }
105.151 +
105.152 + /** Utility method producing the parameter types of the method type. */
105.153 + public Class<?>[] getParameterTypes() {
105.154 + return getMethodType().parameterArray();
105.155 + }
105.156 +
105.157 + /** Utility method producing the return type of the method type. */
105.158 + public Class<?> getReturnType() {
105.159 + return getMethodType().returnType();
105.160 + }
105.161 +
105.162 + /** Return the declared type of this member, which
105.163 + * must be a field or type.
105.164 + * If it is a type member, that type itself is returned.
105.165 + */
105.166 + public Class<?> getFieldType() {
105.167 + if (type == null) {
105.168 + expandFromVM();
105.169 + if (type == null) return null;
105.170 + }
105.171 + if (isInvocable())
105.172 + throw newIllegalArgumentException("not a field or nested class, no simple type");
105.173 + if (type instanceof Class<?>) {
105.174 + return (Class<?>) type;
105.175 + }
105.176 + if (type instanceof String) {
105.177 + String sig = (String) type;
105.178 + MethodType mtype = MethodType.fromMethodDescriptorString("()"+sig, getClassLoader());
105.179 + Class<?> res = mtype.returnType();
105.180 + this.type = res;
105.181 + return res;
105.182 + }
105.183 + throw new InternalError("bad field type "+type);
105.184 + }
105.185 +
105.186 + /** Utility method to produce either the method type or field type of this member. */
105.187 + public Object getType() {
105.188 + return (isInvocable() ? getMethodType() : getFieldType());
105.189 + }
105.190 +
105.191 + /** Utility method to produce the signature of this member,
105.192 + * used within the class file format to describe its type.
105.193 + */
105.194 + public String getSignature() {
105.195 + if (type == null) {
105.196 + expandFromVM();
105.197 + if (type == null) return null;
105.198 + }
105.199 + if (type instanceof String)
105.200 + return (String) type;
105.201 + if (isInvocable())
105.202 + return BytecodeDescriptor.unparse(getMethodType());
105.203 + else
105.204 + return BytecodeDescriptor.unparse(getFieldType());
105.205 + }
105.206 +
105.207 + /** Return the modifier flags of this member.
105.208 + * @see java.lang.reflect.Modifier
105.209 + */
105.210 + public int getModifiers() {
105.211 + return (flags & RECOGNIZED_MODIFIERS);
105.212 + }
105.213 +
105.214 + private void setFlags(int flags) {
105.215 + this.flags = flags;
105.216 + assert(testAnyFlags(ALL_KINDS));
105.217 + }
105.218 +
105.219 + private boolean testFlags(int mask, int value) {
105.220 + return (flags & mask) == value;
105.221 + }
105.222 + private boolean testAllFlags(int mask) {
105.223 + return testFlags(mask, mask);
105.224 + }
105.225 + private boolean testAnyFlags(int mask) {
105.226 + return !testFlags(mask, 0);
105.227 + }
105.228 +
105.229 + /** Utility method to query the modifier flags of this member. */
105.230 + public boolean isStatic() {
105.231 + return Modifier.isStatic(flags);
105.232 + }
105.233 + /** Utility method to query the modifier flags of this member. */
105.234 + public boolean isPublic() {
105.235 + return Modifier.isPublic(flags);
105.236 + }
105.237 + /** Utility method to query the modifier flags of this member. */
105.238 + public boolean isPrivate() {
105.239 + return Modifier.isPrivate(flags);
105.240 + }
105.241 + /** Utility method to query the modifier flags of this member. */
105.242 + public boolean isProtected() {
105.243 + return Modifier.isProtected(flags);
105.244 + }
105.245 + /** Utility method to query the modifier flags of this member. */
105.246 + public boolean isFinal() {
105.247 + return Modifier.isFinal(flags);
105.248 + }
105.249 + /** Utility method to query the modifier flags of this member. */
105.250 + public boolean isAbstract() {
105.251 + return Modifier.isAbstract(flags);
105.252 + }
105.253 + // let the rest (native, volatile, transient, etc.) be tested via Modifier.isFoo
105.254 +
105.255 + // unofficial modifier flags, used by HotSpot:
105.256 + static final int BRIDGE = 0x00000040;
105.257 + static final int VARARGS = 0x00000080;
105.258 + static final int SYNTHETIC = 0x00001000;
105.259 + static final int ANNOTATION= 0x00002000;
105.260 + static final int ENUM = 0x00004000;
105.261 + /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
105.262 + public boolean isBridge() {
105.263 + return testAllFlags(IS_METHOD | BRIDGE);
105.264 + }
105.265 + /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
105.266 + public boolean isVarargs() {
105.267 + return testAllFlags(VARARGS) && isInvocable();
105.268 + }
105.269 + /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
105.270 + public boolean isSynthetic() {
105.271 + return testAllFlags(SYNTHETIC);
105.272 + }
105.273 +
105.274 + static final String CONSTRUCTOR_NAME = "<init>"; // the ever-popular
105.275 +
105.276 + // modifiers exported by the JVM:
105.277 + static final int RECOGNIZED_MODIFIERS = 0xFFFF;
105.278 +
105.279 + // private flags, not part of RECOGNIZED_MODIFIERS:
105.280 + static final int
105.281 + IS_METHOD = MN_IS_METHOD, // method (not constructor)
105.282 + IS_CONSTRUCTOR = MN_IS_CONSTRUCTOR, // constructor
105.283 + IS_FIELD = MN_IS_FIELD, // field
105.284 + IS_TYPE = MN_IS_TYPE; // nested type
105.285 + static final int // for MethodHandleNatives.getMembers
105.286 + SEARCH_SUPERCLASSES = MN_SEARCH_SUPERCLASSES,
105.287 + SEARCH_INTERFACES = MN_SEARCH_INTERFACES;
105.288 +
105.289 + static final int ALL_ACCESS = Modifier.PUBLIC | Modifier.PRIVATE | Modifier.PROTECTED;
105.290 + static final int ALL_KINDS = IS_METHOD | IS_CONSTRUCTOR | IS_FIELD | IS_TYPE;
105.291 + static final int IS_INVOCABLE = IS_METHOD | IS_CONSTRUCTOR;
105.292 + static final int IS_FIELD_OR_METHOD = IS_METHOD | IS_FIELD;
105.293 + static final int SEARCH_ALL_SUPERS = SEARCH_SUPERCLASSES | SEARCH_INTERFACES;
105.294 +
105.295 + /** Utility method to query whether this member is a method or constructor. */
105.296 + public boolean isInvocable() {
105.297 + return testAnyFlags(IS_INVOCABLE);
105.298 + }
105.299 + /** Utility method to query whether this member is a method, constructor, or field. */
105.300 + public boolean isFieldOrMethod() {
105.301 + return testAnyFlags(IS_FIELD_OR_METHOD);
105.302 + }
105.303 + /** Query whether this member is a method. */
105.304 + public boolean isMethod() {
105.305 + return testAllFlags(IS_METHOD);
105.306 + }
105.307 + /** Query whether this member is a constructor. */
105.308 + public boolean isConstructor() {
105.309 + return testAllFlags(IS_CONSTRUCTOR);
105.310 + }
105.311 + /** Query whether this member is a field. */
105.312 + public boolean isField() {
105.313 + return testAllFlags(IS_FIELD);
105.314 + }
105.315 + /** Query whether this member is a type. */
105.316 + public boolean isType() {
105.317 + return testAllFlags(IS_TYPE);
105.318 + }
105.319 + /** Utility method to query whether this member is neither public, private, nor protected. */
105.320 + public boolean isPackage() {
105.321 + return !testAnyFlags(ALL_ACCESS);
105.322 + }
105.323 +
105.324 + /** Initialize a query. It is not resolved. */
105.325 + private void init(Class<?> defClass, String name, Object type, int flags) {
105.326 + // defining class is allowed to be null (for a naked name/type pair)
105.327 + //name.toString(); // null check
105.328 + //type.equals(type); // null check
105.329 + // fill in fields:
105.330 + this.clazz = defClass;
105.331 + this.name = name;
105.332 + this.type = type;
105.333 + setFlags(flags);
105.334 + assert(!isResolved());
105.335 + }
105.336 +
105.337 + private void expandFromVM() {
105.338 + if (!isResolved()) return;
105.339 + if (type instanceof Object[])
105.340 + type = null; // don't saddle JVM w/ typeInfo
105.341 + MethodHandleNatives.expand(this);
105.342 + }
105.343 +
105.344 + // Capturing information from the Core Reflection API:
105.345 + private static int flagsMods(int flags, int mods) {
105.346 + assert((flags & RECOGNIZED_MODIFIERS) == 0);
105.347 + assert((mods & ~RECOGNIZED_MODIFIERS) == 0);
105.348 + return flags | mods;
105.349 + }
105.350 + /** Create a name for the given reflected method. The resulting name will be in a resolved state. */
105.351 + public MemberName(Method m) {
105.352 + Object[] typeInfo = { m.getReturnType(), m.getParameterTypes() };
105.353 + init(m.getDeclaringClass(), m.getName(), typeInfo, flagsMods(IS_METHOD, m.getModifiers()));
105.354 + // fill in vmtarget, vmindex while we have m in hand:
105.355 + MethodHandleNatives.init(this, m);
105.356 + assert(isResolved());
105.357 + }
105.358 + /** Create a name for the given reflected constructor. The resulting name will be in a resolved state. */
105.359 + public MemberName(Constructor ctor) {
105.360 + Object[] typeInfo = { void.class, ctor.getParameterTypes() };
105.361 + init(ctor.getDeclaringClass(), CONSTRUCTOR_NAME, typeInfo, flagsMods(IS_CONSTRUCTOR, ctor.getModifiers()));
105.362 + // fill in vmtarget, vmindex while we have ctor in hand:
105.363 + MethodHandleNatives.init(this, ctor);
105.364 + assert(isResolved());
105.365 + }
105.366 + /** Create a name for the given reflected field. The resulting name will be in a resolved state. */
105.367 + public MemberName(Field fld) {
105.368 + init(fld.getDeclaringClass(), fld.getName(), fld.getType(), flagsMods(IS_FIELD, fld.getModifiers()));
105.369 + // fill in vmtarget, vmindex while we have fld in hand:
105.370 + MethodHandleNatives.init(this, fld);
105.371 + assert(isResolved());
105.372 + }
105.373 + /** Create a name for the given class. The resulting name will be in a resolved state. */
105.374 + public MemberName(Class<?> type) {
105.375 + init(type.getDeclaringClass(), type.getSimpleName(), type, flagsMods(IS_TYPE, type.getModifiers()));
105.376 + vmindex = 0; // isResolved
105.377 + assert(isResolved());
105.378 + }
105.379 +
105.380 + // bare-bones constructor; the JVM will fill it in
105.381 + MemberName() { }
105.382 +
105.383 + // locally useful cloner
105.384 + @Override protected MemberName clone() {
105.385 + try {
105.386 + return (MemberName) super.clone();
105.387 + } catch (CloneNotSupportedException ex) {
105.388 + throw new InternalError();
105.389 + }
105.390 + }
105.391 +
105.392 + // %%% define equals/hashcode?
105.393 +
105.394 + // Construction from symbolic parts, for queries:
105.395 + /** Create a field or type name from the given components: Declaring class, name, type, modifiers.
105.396 + * The declaring class may be supplied as null if this is to be a bare name and type.
105.397 + * The resulting name will in an unresolved state.
105.398 + */
105.399 + public MemberName(Class<?> defClass, String name, Class<?> type, int modifiers) {
105.400 + init(defClass, name, type, IS_FIELD | (modifiers & RECOGNIZED_MODIFIERS));
105.401 + }
105.402 + /** Create a field or type name from the given components: Declaring class, name, type.
105.403 + * The declaring class may be supplied as null if this is to be a bare name and type.
105.404 + * The modifier flags default to zero.
105.405 + * The resulting name will in an unresolved state.
105.406 + */
105.407 + public MemberName(Class<?> defClass, String name, Class<?> type) {
105.408 + this(defClass, name, type, 0);
105.409 + }
105.410 + /** Create a method or constructor name from the given components: Declaring class, name, type, modifiers.
105.411 + * It will be a constructor if and only if the name is {@code "<init>"}.
105.412 + * The declaring class may be supplied as null if this is to be a bare name and type.
105.413 + * The resulting name will in an unresolved state.
105.414 + */
105.415 + public MemberName(Class<?> defClass, String name, MethodType type, int modifiers) {
105.416 + int flagBit = (name.equals(CONSTRUCTOR_NAME) ? IS_CONSTRUCTOR : IS_METHOD);
105.417 + init(defClass, name, type, flagBit | (modifiers & RECOGNIZED_MODIFIERS));
105.418 + }
105.419 + /** Create a method or constructor name from the given components: Declaring class, name, type, modifiers.
105.420 + * It will be a constructor if and only if the name is {@code "<init>"}.
105.421 + * The declaring class may be supplied as null if this is to be a bare name and type.
105.422 + * The modifier flags default to zero.
105.423 + * The resulting name will in an unresolved state.
105.424 + */
105.425 + public MemberName(Class<?> defClass, String name, MethodType type) {
105.426 + this(defClass, name, type, 0);
105.427 + }
105.428 +
105.429 + /** Query whether this member name is resolved.
105.430 + * A resolved member name is one for which the JVM has found
105.431 + * a method, constructor, field, or type binding corresponding exactly to the name.
105.432 + * (Document?)
105.433 + */
105.434 + public boolean isResolved() {
105.435 + return (vmindex != VM_INDEX_UNINITIALIZED);
105.436 + }
105.437 +
105.438 + /** Query whether this member name is resolved to a non-static, non-final method.
105.439 + */
105.440 + public boolean hasReceiverTypeDispatch() {
105.441 + return (isMethod() && getVMIndex() >= 0);
105.442 + }
105.443 +
105.444 + /** Produce a string form of this member name.
105.445 + * For types, it is simply the type's own string (as reported by {@code toString}).
105.446 + * For fields, it is {@code "DeclaringClass.name/type"}.
105.447 + * For methods and constructors, it is {@code "DeclaringClass.name(ptype...)rtype"}.
105.448 + * If the declaring class is null, the prefix {@code "DeclaringClass."} is omitted.
105.449 + * If the member is unresolved, a prefix {@code "*."} is prepended.
105.450 + */
105.451 + @Override
105.452 + public String toString() {
105.453 + if (isType())
105.454 + return type.toString(); // class java.lang.String
105.455 + // else it is a field, method, or constructor
105.456 + StringBuilder buf = new StringBuilder();
105.457 + if (getDeclaringClass() != null) {
105.458 + buf.append(getName(clazz));
105.459 + buf.append('.');
105.460 + }
105.461 + String name = getName();
105.462 + buf.append(name == null ? "*" : name);
105.463 + Object type = getType();
105.464 + if (!isInvocable()) {
105.465 + buf.append('/');
105.466 + buf.append(type == null ? "*" : getName(type));
105.467 + } else {
105.468 + buf.append(type == null ? "(*)*" : getName(type));
105.469 + }
105.470 + /*
105.471 + buf.append('/');
105.472 + // key: Public, private, pRotected, sTatic, Final, sYnchronized,
105.473 + // transient/Varargs, native, (interface), abstract, sTrict, sYnthetic,
105.474 + // (annotation), Enum, (unused)
105.475 + final String FIELD_MOD_CHARS = "PprTF?vt????Y?E?";
105.476 + final String METHOD_MOD_CHARS = "PprTFybVn?atY???";
105.477 + String modChars = (isInvocable() ? METHOD_MOD_CHARS : FIELD_MOD_CHARS);
105.478 + for (int i = 0; i < modChars.length(); i++) {
105.479 + if ((flags & (1 << i)) != 0) {
105.480 + char mc = modChars.charAt(i);
105.481 + if (mc != '?')
105.482 + buf.append(mc);
105.483 + }
105.484 + }
105.485 + */
105.486 + return buf.toString();
105.487 + }
105.488 + private static String getName(Object obj) {
105.489 + if (obj instanceof Class<?>)
105.490 + return ((Class<?>)obj).getName();
105.491 + return String.valueOf(obj);
105.492 + }
105.493 +
105.494 + // Queries to the JVM:
105.495 + /** Document? */
105.496 + /*non-public*/ int getVMIndex() {
105.497 + if (!isResolved())
105.498 + throw newIllegalStateException("not resolved", this);
105.499 + return vmindex;
105.500 + }
105.501 +// /*non-public*/ Object getVMTarget() {
105.502 +// if (!isResolved())
105.503 +// throw newIllegalStateException("not resolved", this);
105.504 +// return vmtarget;
105.505 +// }
105.506 +
105.507 + public IllegalAccessException makeAccessException(String message, Object from) {
105.508 + message = message + ": "+ toString();
105.509 + if (from != null) message += ", from " + from;
105.510 + return new IllegalAccessException(message);
105.511 + }
105.512 + public ReflectiveOperationException makeAccessException(String message) {
105.513 + message = message + ": "+ toString();
105.514 + if (isResolved())
105.515 + return new IllegalAccessException(message);
105.516 + else if (isConstructor())
105.517 + return new NoSuchMethodException(message);
105.518 + else if (isMethod())
105.519 + return new NoSuchMethodException(message);
105.520 + else
105.521 + return new NoSuchFieldException(message);
105.522 + }
105.523 +
105.524 + /** Actually making a query requires an access check. */
105.525 + /*non-public*/ static Factory getFactory() {
105.526 + return Factory.INSTANCE;
105.527 + }
105.528 + /** A factory type for resolving member names with the help of the VM.
105.529 + * TBD: Define access-safe public constructors for this factory.
105.530 + */
105.531 + public static class Factory {
105.532 + private Factory() { } // singleton pattern
105.533 + static Factory INSTANCE = new Factory();
105.534 +
105.535 + private static int ALLOWED_FLAGS = SEARCH_ALL_SUPERS | ALL_KINDS;
105.536 +
105.537 + /// Queries
105.538 + List<MemberName> getMembers(Class<?> defc,
105.539 + String matchName, Object matchType,
105.540 + int matchFlags, Class<?> lookupClass) {
105.541 + matchFlags &= ALLOWED_FLAGS;
105.542 + String matchSig = null;
105.543 + if (matchType != null) {
105.544 + matchSig = BytecodeDescriptor.unparse(matchType);
105.545 + if (matchSig.startsWith("("))
105.546 + matchFlags &= ~(ALL_KINDS & ~IS_INVOCABLE);
105.547 + else
105.548 + matchFlags &= ~(ALL_KINDS & ~IS_FIELD);
105.549 + }
105.550 + final int BUF_MAX = 0x2000;
105.551 + int len1 = matchName == null ? 10 : matchType == null ? 4 : 1;
105.552 + MemberName[] buf = newMemberBuffer(len1);
105.553 + int totalCount = 0;
105.554 + ArrayList<MemberName[]> bufs = null;
105.555 + int bufCount = 0;
105.556 + for (;;) {
105.557 + bufCount = MethodHandleNatives.getMembers(defc,
105.558 + matchName, matchSig, matchFlags,
105.559 + lookupClass,
105.560 + totalCount, buf);
105.561 + if (bufCount <= buf.length) {
105.562 + if (bufCount < 0) bufCount = 0;
105.563 + totalCount += bufCount;
105.564 + break;
105.565 + }
105.566 + // JVM returned to us with an intentional overflow!
105.567 + totalCount += buf.length;
105.568 + int excess = bufCount - buf.length;
105.569 + if (bufs == null) bufs = new ArrayList<MemberName[]>(1);
105.570 + bufs.add(buf);
105.571 + int len2 = buf.length;
105.572 + len2 = Math.max(len2, excess);
105.573 + len2 = Math.max(len2, totalCount / 4);
105.574 + buf = newMemberBuffer(Math.min(BUF_MAX, len2));
105.575 + }
105.576 + ArrayList<MemberName> result = new ArrayList<MemberName>(totalCount);
105.577 + if (bufs != null) {
105.578 + for (MemberName[] buf0 : bufs) {
105.579 + Collections.addAll(result, buf0);
105.580 + }
105.581 + }
105.582 + result.addAll(Arrays.asList(buf).subList(0, bufCount));
105.583 + // Signature matching is not the same as type matching, since
105.584 + // one signature might correspond to several types.
105.585 + // So if matchType is a Class or MethodType, refilter the results.
105.586 + if (matchType != null && matchType != matchSig) {
105.587 + for (Iterator<MemberName> it = result.iterator(); it.hasNext();) {
105.588 + MemberName m = it.next();
105.589 + if (!matchType.equals(m.getType()))
105.590 + it.remove();
105.591 + }
105.592 + }
105.593 + return result;
105.594 + }
105.595 + boolean resolveInPlace(MemberName m, boolean searchSupers, Class<?> lookupClass) {
105.596 + if (m.name == null || m.type == null) { // find unique non-overloaded name
105.597 + Class<?> defc = m.getDeclaringClass();
105.598 + List<MemberName> choices = null;
105.599 + if (m.isMethod())
105.600 + choices = getMethods(defc, searchSupers, m.name, (MethodType) m.type, lookupClass);
105.601 + else if (m.isConstructor())
105.602 + choices = getConstructors(defc, lookupClass);
105.603 + else if (m.isField())
105.604 + choices = getFields(defc, searchSupers, m.name, (Class<?>) m.type, lookupClass);
105.605 + //System.out.println("resolving "+m+" to "+choices);
105.606 + if (choices == null || choices.size() != 1)
105.607 + return false;
105.608 + if (m.name == null) m.name = choices.get(0).name;
105.609 + if (m.type == null) m.type = choices.get(0).type;
105.610 + }
105.611 + MethodHandleNatives.resolve(m, lookupClass);
105.612 + if (m.isResolved()) return true;
105.613 + int matchFlags = m.flags | (searchSupers ? SEARCH_ALL_SUPERS : 0);
105.614 + String matchSig = m.getSignature();
105.615 + MemberName[] buf = { m };
105.616 + int n = MethodHandleNatives.getMembers(m.getDeclaringClass(),
105.617 + m.getName(), matchSig, matchFlags, lookupClass, 0, buf);
105.618 + if (n != 1) return false;
105.619 + return m.isResolved();
105.620 + }
105.621 + /** Produce a resolved version of the given member.
105.622 + * Super types are searched (for inherited members) if {@code searchSupers} is true.
105.623 + * Access checking is performed on behalf of the given {@code lookupClass}.
105.624 + * If lookup fails or access is not permitted, null is returned.
105.625 + * Otherwise a fresh copy of the given member is returned, with modifier bits filled in.
105.626 + */
105.627 + public MemberName resolveOrNull(MemberName m, boolean searchSupers, Class<?> lookupClass) {
105.628 + MemberName result = m.clone();
105.629 + if (resolveInPlace(result, searchSupers, lookupClass))
105.630 + return result;
105.631 + return null;
105.632 + }
105.633 + /** Produce a resolved version of the given member.
105.634 + * Super types are searched (for inherited members) if {@code searchSupers} is true.
105.635 + * Access checking is performed on behalf of the given {@code lookupClass}.
105.636 + * If lookup fails or access is not permitted, a {@linkplain ReflectiveOperationException} is thrown.
105.637 + * Otherwise a fresh copy of the given member is returned, with modifier bits filled in.
105.638 + */
105.639 + public
105.640 + <NoSuchMemberException extends ReflectiveOperationException>
105.641 + MemberName resolveOrFail(MemberName m, boolean searchSupers, Class<?> lookupClass,
105.642 + Class<NoSuchMemberException> nsmClass)
105.643 + throws IllegalAccessException, NoSuchMemberException {
105.644 + MemberName result = resolveOrNull(m, searchSupers, lookupClass);
105.645 + if (result != null)
105.646 + return result;
105.647 + ReflectiveOperationException ex = m.makeAccessException("no access");
105.648 + if (ex instanceof IllegalAccessException) throw (IllegalAccessException) ex;
105.649 + throw nsmClass.cast(ex);
105.650 + }
105.651 + /** Return a list of all methods defined by the given class.
105.652 + * Super types are searched (for inherited members) if {@code searchSupers} is true.
105.653 + * Access checking is performed on behalf of the given {@code lookupClass}.
105.654 + * Inaccessible members are not added to the last.
105.655 + */
105.656 + public List<MemberName> getMethods(Class<?> defc, boolean searchSupers,
105.657 + Class<?> lookupClass) {
105.658 + return getMethods(defc, searchSupers, null, null, lookupClass);
105.659 + }
105.660 + /** Return a list of matching methods defined by the given class.
105.661 + * Super types are searched (for inherited members) if {@code searchSupers} is true.
105.662 + * Returned methods will match the name (if not null) and the type (if not null).
105.663 + * Access checking is performed on behalf of the given {@code lookupClass}.
105.664 + * Inaccessible members are not added to the last.
105.665 + */
105.666 + public List<MemberName> getMethods(Class<?> defc, boolean searchSupers,
105.667 + String name, MethodType type, Class<?> lookupClass) {
105.668 + int matchFlags = IS_METHOD | (searchSupers ? SEARCH_ALL_SUPERS : 0);
105.669 + return getMembers(defc, name, type, matchFlags, lookupClass);
105.670 + }
105.671 + /** Return a list of all constructors defined by the given class.
105.672 + * Access checking is performed on behalf of the given {@code lookupClass}.
105.673 + * Inaccessible members are not added to the last.
105.674 + */
105.675 + public List<MemberName> getConstructors(Class<?> defc, Class<?> lookupClass) {
105.676 + return getMembers(defc, null, null, IS_CONSTRUCTOR, lookupClass);
105.677 + }
105.678 + /** Return a list of all fields defined by the given class.
105.679 + * Super types are searched (for inherited members) if {@code searchSupers} is true.
105.680 + * Access checking is performed on behalf of the given {@code lookupClass}.
105.681 + * Inaccessible members are not added to the last.
105.682 + */
105.683 + public List<MemberName> getFields(Class<?> defc, boolean searchSupers,
105.684 + Class<?> lookupClass) {
105.685 + return getFields(defc, searchSupers, null, null, lookupClass);
105.686 + }
105.687 + /** Return a list of all fields defined by the given class.
105.688 + * Super types are searched (for inherited members) if {@code searchSupers} is true.
105.689 + * Returned fields will match the name (if not null) and the type (if not null).
105.690 + * Access checking is performed on behalf of the given {@code lookupClass}.
105.691 + * Inaccessible members are not added to the last.
105.692 + */
105.693 + public List<MemberName> getFields(Class<?> defc, boolean searchSupers,
105.694 + String name, Class<?> type, Class<?> lookupClass) {
105.695 + int matchFlags = IS_FIELD | (searchSupers ? SEARCH_ALL_SUPERS : 0);
105.696 + return getMembers(defc, name, type, matchFlags, lookupClass);
105.697 + }
105.698 + /** Return a list of all nested types defined by the given class.
105.699 + * Super types are searched (for inherited members) if {@code searchSupers} is true.
105.700 + * Access checking is performed on behalf of the given {@code lookupClass}.
105.701 + * Inaccessible members are not added to the last.
105.702 + */
105.703 + public List<MemberName> getNestedTypes(Class<?> defc, boolean searchSupers,
105.704 + Class<?> lookupClass) {
105.705 + int matchFlags = IS_TYPE | (searchSupers ? SEARCH_ALL_SUPERS : 0);
105.706 + return getMembers(defc, null, null, matchFlags, lookupClass);
105.707 + }
105.708 + private static MemberName[] newMemberBuffer(int length) {
105.709 + MemberName[] buf = new MemberName[length];
105.710 + // fill the buffer with dummy structs for the JVM to fill in
105.711 + for (int i = 0; i < length; i++)
105.712 + buf[i] = new MemberName();
105.713 + return buf;
105.714 + }
105.715 + }
105.716 +
105.717 +// static {
105.718 +// System.out.println("Hello world! My methods are:");
105.719 +// System.out.println(Factory.INSTANCE.getMethods(MemberName.class, true, null));
105.720 +// }
105.721 +}
106.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
106.2 +++ b/src/share/classes/java/lang/invoke/MethodHandle.java Tue Mar 29 20:19:55 2011 -0700
106.3 @@ -0,0 +1,1028 @@
106.4 +/*
106.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
106.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
106.7 + *
106.8 + * This code is free software; you can redistribute it and/or modify it
106.9 + * under the terms of the GNU General Public License version 2 only, as
106.10 + * published by the Free Software Foundation. Oracle designates this
106.11 + * particular file as subject to the "Classpath" exception as provided
106.12 + * by Oracle in the LICENSE file that accompanied this code.
106.13 + *
106.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
106.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
106.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
106.17 + * version 2 for more details (a copy is included in the LICENSE file that
106.18 + * accompanied this code).
106.19 + *
106.20 + * You should have received a copy of the GNU General Public License version
106.21 + * 2 along with this work; if not, write to the Free Software Foundation,
106.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
106.23 + *
106.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
106.25 + * or visit www.oracle.com if you need additional information or have any
106.26 + * questions.
106.27 + */
106.28 +
106.29 +package java.lang.invoke;
106.30 +
106.31 +
106.32 +import static java.lang.invoke.MethodHandleStatics.*;
106.33 +
106.34 +/**
106.35 + * A method handle is a typed, directly executable reference to an underlying method,
106.36 + * constructor, field, or similar low-level operation, with optional
106.37 + * transformations of arguments or return values.
106.38 + * These transformations are quite general, and include such patterns as
106.39 + * {@linkplain #asType conversion},
106.40 + * {@linkplain #bindTo insertion},
106.41 + * {@linkplain java.lang.invoke.MethodHandles#dropArguments deletion},
106.42 + * and {@linkplain java.lang.invoke.MethodHandles#filterArguments substitution}.
106.43 + *
106.44 + * <h3>Method handle contents</h3>
106.45 + * Method handles are dynamically and strongly typed according to type descriptor.
106.46 + * They are not distinguished by the name or defining class of their underlying methods.
106.47 + * A method handle must be invoked using type descriptor which matches
106.48 + * the method handle's own {@linkplain #type method type}.
106.49 + * <p>
106.50 + * Every method handle reports its type via the {@link #type type} accessor.
106.51 + * This type descriptor is a {@link java.lang.invoke.MethodType MethodType} object,
106.52 + * whose structure is a series of classes, one of which is
106.53 + * the return type of the method (or {@code void.class} if none).
106.54 + * <p>
106.55 + * A method handle's type controls the types of invocations it accepts,
106.56 + * and the kinds of transformations that apply to it.
106.57 + * <p>
106.58 + * A method handle contains a pair of special invoker methods
106.59 + * called {@link #invokeExact invokeExact} and {@link #invokeGeneric invokeGeneric}.
106.60 + * Both invoker methods provide direct access to the method handle's
106.61 + * underlying method, constructor, field, or other operation,
106.62 + * as modified by transformations of arguments and return values.
106.63 + * Both invokers accept calls which exactly match the method handle's own type.
106.64 + * The {@code invokeGeneric} invoker also accepts a range of other call types.
106.65 + * <p>
106.66 + * Method handles are immutable and have no visible state.
106.67 + * Of course, they can be bound to underlying methods or data which exhibit state.
106.68 + * With respect to the Java Memory Model, any method handle will behave
106.69 + * as if all of its (internal) fields are final variables. This means that any method
106.70 + * handle made visible to the application will always be fully formed.
106.71 + * This is true even if the method handle is published through a shared
106.72 + * variable in a data race.
106.73 + * <p>
106.74 + * Method handles cannot be subclassed by the user.
106.75 + * Implementations may (or may not) create internal subclasses of {@code MethodHandle}
106.76 + * which may be visible via the {@link java.lang.Object#getClass Object.getClass}
106.77 + * operation. The programmer should not draw conclusions about a method handle
106.78 + * from its specific class, as the method handle class hierarchy (if any)
106.79 + * may change from time to time or across implementations from different vendors.
106.80 + *
106.81 + * <h3>Method handle compilation</h3>
106.82 + * A Java method call expression naming {@code invokeExact} or {@code invokeGeneric}
106.83 + * can invoke a method handle from Java source code.
106.84 + * From the viewpoint of source code, these methods can take any arguments
106.85 + * and their result can be cast to any return type.
106.86 + * Formally this is accomplished by giving the invoker methods
106.87 + * {@code Object} return types and variable-arity {@code Object} arguments,
106.88 + * but they have an additional quality called <em>signature polymorphism</em>
106.89 + * which connects this freedom of invocation directly to the JVM execution stack.
106.90 + * <p>
106.91 + * As is usual with virtual methods, source-level calls to {@code invokeExact}
106.92 + * and {@code invokeGeneric} compile to an {@code invokevirtual} instruction.
106.93 + * More unusually, the compiler must record the actual argument types,
106.94 + * and may not perform method invocation conversions on the arguments.
106.95 + * Instead, it must push them on the stack according to their own unconverted types.
106.96 + * The method handle object itself is pushed on the stack before the arguments.
106.97 + * The compiler then calls the method handle with a type descriptor which
106.98 + * describes the argument and return types.
106.99 + * <p>
106.100 + * To issue a complete type descriptor, the compiler must also determine
106.101 + * the return type. This is based on a cast on the method invocation expression,
106.102 + * if there is one, or else {@code Object} if the invocation is an expression
106.103 + * or else {@code void} if the invocation is a statement.
106.104 + * The cast may be to a primitive type (but not {@code void}).
106.105 + * <p>
106.106 + * As a corner case, an uncasted {@code null} argument is given
106.107 + * a type descriptor of {@code java.lang.Void}.
106.108 + * The ambiguity with the type {@code Void} is harmless, since there are no references of type
106.109 + * {@code Void} except the null reference.
106.110 + *
106.111 + * <h3>Method handle invocation</h3>
106.112 + * The first time a {@code invokevirtual} instruction is executed
106.113 + * it is linked, by symbolically resolving the names in the instruction
106.114 + * and verifying that the method call is statically legal.
106.115 + * This is true of calls to {@code invokeExact} and {@code invokeGeneric}.
106.116 + * In this case, the type descriptor emitted by the compiler is checked for
106.117 + * correct syntax and names it contains are resolved.
106.118 + * Thus, an {@code invokevirtual} instruction which invokes
106.119 + * a method handle will always link, as long
106.120 + * as the type descriptor is syntactically well-formed
106.121 + * and the types exist.
106.122 + * <p>
106.123 + * When the {@code invokevirtual} is executed after linking,
106.124 + * the receiving method handle's type is first checked by the JVM
106.125 + * to ensure that it matches the descriptor.
106.126 + * If the type match fails, it means that the method which the
106.127 + * caller is invoking is not present on the individual
106.128 + * method handle being invoked.
106.129 + * <p>
106.130 + * In the case of {@code invokeExact}, the type descriptor of the invocation
106.131 + * (after resolving symbolic type names) must exactly match the method type
106.132 + * of the receiving method handle.
106.133 + * In the case of {@code invokeGeneric}, the resolved type descriptor
106.134 + * must be a valid argument to the receiver's {@link #asType asType} method.
106.135 + * Thus, {@code invokeGeneric} is more permissive than {@code invokeExact}.
106.136 + * <p>
106.137 + * After type matching, a call to {@code invokeExact} directly
106.138 + * and immediately invoke the method handle's underlying method
106.139 + * (or other behavior, as the case may be).
106.140 + * <p>
106.141 + * A call to {@code invokeGeneric} works the same as a call to
106.142 + * {@code invokeExact}, if the type descriptor specified by the caller
106.143 + * exactly matches the method handle's own type.
106.144 + * If there is a type mismatch, {@code invokeGeneric} attempts
106.145 + * to adjust the type of the receiving method handle,
106.146 + * as if by a call to {@link #asType asType},
106.147 + * to obtain an exactly invokable method handle {@code M2}.
106.148 + * This allows a more powerful negotiation of method type
106.149 + * between caller and callee.
106.150 + * <p>
106.151 + * (<em>Note:</em> The adjusted method handle {@code M2} is not directly observable,
106.152 + * and implementations are therefore not required to materialize it.)
106.153 + *
106.154 + * <h3>Invocation checking</h3>
106.155 + * In typical programs, method handle type matching will usually succeed.
106.156 + * But if a match fails, the JVM will throw a {@link WrongMethodTypeException},
106.157 + * either directly (in the case of {@code invokeExact}) or indirectly as if
106.158 + * by a failed call to {@code asType} (in the case of {@code invokeGeneric}).
106.159 + * <p>
106.160 + * Thus, a method type mismatch which might show up as a linkage error
106.161 + * in a statically typed program can show up as
106.162 + * a dynamic {@code WrongMethodTypeException}
106.163 + * in a program which uses method handles.
106.164 + * <p>
106.165 + * Because method types contain "live" {@code Class} objects,
106.166 + * method type matching takes into account both types names and class loaders.
106.167 + * Thus, even if a method handle {@code M} is created in one
106.168 + * class loader {@code L1} and used in another {@code L2},
106.169 + * method handle calls are type-safe, because the caller's type
106.170 + * descriptor, as resolved in {@code L2},
106.171 + * is matched against the original callee method's type descriptor,
106.172 + * as resolved in {@code L1}.
106.173 + * The resolution in {@code L1} happens when {@code M} is created
106.174 + * and its type is assigned, while the resolution in {@code L2} happens
106.175 + * when the {@code invokevirtual} instruction is linked.
106.176 + * <p>
106.177 + * Apart from the checking of type descriptors,
106.178 + * a method handle's capability to call its underlying method is unrestricted.
106.179 + * If a method handle is formed on a non-public method by a class
106.180 + * that has access to that method, the resulting handle can be used
106.181 + * in any place by any caller who receives a reference to it.
106.182 + * <p>
106.183 + * Unlike with the Core Reflection API, where access is checked every time
106.184 + * a reflective method is invoked,
106.185 + * method handle access checking is performed
106.186 + * <a href="MethodHandles.Lookup.html#access">when the method handle is created</a>.
106.187 + * In the case of {@code ldc} (see below), access checking is performed as part of linking
106.188 + * the constant pool entry underlying the constant method handle.
106.189 + * <p>
106.190 + * Thus, handles to non-public methods, or to methods in non-public classes,
106.191 + * should generally be kept secret.
106.192 + * They should not be passed to untrusted code unless their use from
106.193 + * the untrusted code would be harmless.
106.194 + *
106.195 + * <h3>Method handle creation</h3>
106.196 + * Java code can create a method handle that directly accesses
106.197 + * any method, constructor, or field that is accessible to that code.
106.198 + * This is done via a reflective, capability-based API called
106.199 + * {@link java.lang.invoke.MethodHandles.Lookup MethodHandles.Lookup}
106.200 + * For example, a static method handle can be obtained
106.201 + * from {@link java.lang.invoke.MethodHandles.Lookup#findStatic Lookup.findStatic}.
106.202 + * There are also conversion methods from Core Reflection API objects,
106.203 + * such as {@link java.lang.invoke.MethodHandles.Lookup#unreflect Lookup.unreflect}.
106.204 + * <p>
106.205 + * Like classes and strings, method handles that correspond to accessible
106.206 + * fields, methods, and constructors can also be represented directly
106.207 + * in a class file's constant pool as constants to be loaded by {@code ldc} bytecodes.
106.208 + * A new type of constant pool entry, {@code CONSTANT_MethodHandle},
106.209 + * refers directly to an associated {@code CONSTANT_Methodref},
106.210 + * {@code CONSTANT_InterfaceMethodref}, or {@code CONSTANT_Fieldref}
106.211 + * constant pool entry.
106.212 + * (For more details on method handle constants,
106.213 + * see the <a href="package-summary.html#mhcon">package summary</a>.)
106.214 + * <p>
106.215 + * Method handles produced by lookups or constant loads from methods or
106.216 + * constructors with the variable arity modifier bit ({@code 0x0080})
106.217 + * have a corresponding variable arity, as if they were defined with
106.218 + * the help of {@link #asVarargsCollector asVarargsCollector}.
106.219 + * <p>
106.220 + * A method reference may refer either to a static or non-static method.
106.221 + * In the non-static case, the method handle type includes an explicit
106.222 + * receiver argument, prepended before any other arguments.
106.223 + * In the method handle's type, the initial receiver argument is typed
106.224 + * according to the class under which the method was initially requested.
106.225 + * (E.g., if a non-static method handle is obtained via {@code ldc},
106.226 + * the type of the receiver is the class named in the constant pool entry.)
106.227 + * <p>
106.228 + * When a method handle to a virtual method is invoked, the method is
106.229 + * always looked up in the receiver (that is, the first argument).
106.230 + * <p>
106.231 + * A non-virtual method handle to a specific virtual method implementation
106.232 + * can also be created. These do not perform virtual lookup based on
106.233 + * receiver type. Such a method handle simulates the effect of
106.234 + * an {@code invokespecial} instruction to the same method.
106.235 + *
106.236 + * <h3>Usage examples</h3>
106.237 + * Here are some examples of usage:
106.238 + * <p><blockquote><pre>
106.239 +Object x, y; String s; int i;
106.240 +MethodType mt; MethodHandle mh;
106.241 +MethodHandles.Lookup lookup = MethodHandles.lookup();
106.242 +// mt is (char,char)String
106.243 +mt = MethodType.methodType(String.class, char.class, char.class);
106.244 +mh = lookup.findVirtual(String.class, "replace", mt);
106.245 +s = (String) mh.invokeExact("daddy",'d','n');
106.246 +// invokeExact(Ljava/lang/String;CC)Ljava/lang/String;
106.247 +assert(s.equals("nanny"));
106.248 +// weakly typed invocation (using MHs.invoke)
106.249 +s = (String) mh.invokeWithArguments("sappy", 'p', 'v');
106.250 +assert(s.equals("savvy"));
106.251 +// mt is (Object[])List
106.252 +mt = MethodType.methodType(java.util.List.class, Object[].class);
106.253 +mh = lookup.findStatic(java.util.Arrays.class, "asList", mt);
106.254 +assert(mh.isVarargsCollector());
106.255 +x = mh.invokeGeneric("one", "two");
106.256 +// invokeGeneric(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;
106.257 +assert(x.equals(java.util.Arrays.asList("one","two")));
106.258 +// mt is (Object,Object,Object)Object
106.259 +mt = MethodType.genericMethodType(3);
106.260 +mh = mh.asType(mt);
106.261 +x = mh.invokeExact((Object)1, (Object)2, (Object)3);
106.262 +// invokeExact(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
106.263 +assert(x.equals(java.util.Arrays.asList(1,2,3)));
106.264 +// mt is int()
106.265 +mt = MethodType.methodType(int.class);
106.266 +mh = lookup.findVirtual(java.util.List.class, "size", mt);
106.267 +i = (int) mh.invokeExact(java.util.Arrays.asList(1,2,3));
106.268 +// invokeExact(Ljava/util/List;)I
106.269 +assert(i == 3);
106.270 +mt = MethodType.methodType(void.class, String.class);
106.271 +mh = lookup.findVirtual(java.io.PrintStream.class, "println", mt);
106.272 +mh.invokeExact(System.out, "Hello, world.");
106.273 +// invokeExact(Ljava/io/PrintStream;Ljava/lang/String;)V
106.274 + * </pre></blockquote>
106.275 + * Each of the above calls to {@code invokeExact} or {@code invokeGeneric}
106.276 + * generates a single invokevirtual instruction with
106.277 + * the type descriptor indicated in the following comment.
106.278 + *
106.279 + * <h3>Exceptions</h3>
106.280 + * The methods {@code invokeExact} and {@code invokeGeneric} are declared
106.281 + * to throw {@link java.lang.Throwable Throwable},
106.282 + * which is to say that there is no static restriction on what a method handle
106.283 + * can throw. Since the JVM does not distinguish between checked
106.284 + * and unchecked exceptions (other than by their class, of course),
106.285 + * there is no particular effect on bytecode shape from ascribing
106.286 + * checked exceptions to method handle invocations. But in Java source
106.287 + * code, methods which perform method handle calls must either explicitly
106.288 + * throw {@code java.lang.Throwable Throwable}, or else must catch all
106.289 + * throwables locally, rethrowing only those which are legal in the context,
106.290 + * and wrapping ones which are illegal.
106.291 + *
106.292 + * <h3><a name="sigpoly"></a>Signature polymorphism</h3>
106.293 + * The unusual compilation and linkage behavior of
106.294 + * {@code invokeExact} and {@code invokeGeneric}
106.295 + * is referenced by the term <em>signature polymorphism</em>.
106.296 + * A signature polymorphic method is one which can operate with
106.297 + * any of a wide range of call signatures and return types.
106.298 + * In order to make this work, both the Java compiler and the JVM must
106.299 + * give special treatment to signature polymorphic methods.
106.300 + * <p>
106.301 + * In source code, a call to a signature polymorphic method will
106.302 + * compile, regardless of the requested type descriptor.
106.303 + * As usual, the Java compiler emits an {@code invokevirtual}
106.304 + * instruction with the given type descriptor against the named method.
106.305 + * The unusual part is that the type descriptor is derived from
106.306 + * the actual argument and return types, not from the method declaration.
106.307 + * <p>
106.308 + * When the JVM processes bytecode containing signature polymorphic calls,
106.309 + * it will successfully link any such call, regardless of its type descriptor.
106.310 + * (In order to retain type safety, the JVM will guard such calls with suitable
106.311 + * dynamic type checks, as described elsewhere.)
106.312 + * <p>
106.313 + * Bytecode generators, including the compiler back end, are required to emit
106.314 + * untransformed type descriptors for these methods.
106.315 + * Tools which determine symbolic linkage are required to accept such
106.316 + * untransformed descriptors, without reporting linkage errors.
106.317 + * <p>
106.318 + * For the sake of tools (but not as a programming API), the signature polymorphic
106.319 + * methods are marked with a private yet standard annotation,
106.320 + * {@code @java.lang.invoke.MethodHandle.PolymorphicSignature}.
106.321 + * The annotation's retention is {@code RUNTIME}, so that all tools can see it.
106.322 + *
106.323 + * <h3>Formal rules for processing signature polymorphic methods</h3>
106.324 + * <p>
106.325 + * The following methods (and no others) are signature polymorphic:
106.326 + * <ul>
106.327 + * <li>{@link java.lang.invoke.MethodHandle#invokeExact MethodHandle.invokeExact}
106.328 + * <li>{@link java.lang.invoke.MethodHandle#invokeGeneric MethodHandle.invokeGeneric}
106.329 + * </ul>
106.330 + * <p>
106.331 + * A signature polymorphic method will be declared with the following properties:
106.332 + * <ul>
106.333 + * <li>It must be native.
106.334 + * <li>It must take a single varargs parameter of the form {@code Object...}.
106.335 + * <li>It must produce a return value of type {@code Object}.
106.336 + * <li>It must be contained within the {@code java.lang.invoke} package.
106.337 + * </ul>
106.338 + * Because of these requirements, a signature polymorphic method is able to accept
106.339 + * any number and type of actual arguments, and can, with a cast, produce a value of any type.
106.340 + * However, the JVM will treat these declaration features as a documentation convention,
106.341 + * rather than a description of the actual structure of the methods as executed.
106.342 + * <p>
106.343 + * When a call to a signature polymorphic method is compiled, the associated linkage information for
106.344 + * its arguments is not array of {@code Object} (as for other similar varargs methods)
106.345 + * but rather the erasure of the static types of all the arguments.
106.346 + * <p>
106.347 + * In an argument position of a method invocation on a signature polymorphic method,
106.348 + * a null literal has type {@code java.lang.Void}, unless cast to a reference type.
106.349 + * (<em>Note:</em> This typing rule allows the null type to have its own encoding in linkage information
106.350 + * distinct from other types.
106.351 + * <p>
106.352 + * The linkage information for the return type is derived from a context-dependent target typing convention.
106.353 + * The return type for a signature polymorphic method invocation is determined as follows:
106.354 + * <ul>
106.355 + * <li>If the method invocation expression is an expression statement, the method is {@code void}.
106.356 + * <li>Otherwise, if the method invocation expression is the immediate operand of a cast,
106.357 + * the return type is the erasure of the cast type.
106.358 + * <li>Otherwise, the return type is the method's nominal return type, {@code Object}.
106.359 + * </ul>
106.360 + * (Programmers are encouraged to use explicit casts unless it is clear that a signature polymorphic
106.361 + * call will be used as a plain {@code Object} expression.)
106.362 + * <p>
106.363 + * The linkage information for argument and return types is stored in the descriptor for the
106.364 + * compiled (bytecode) call site. As for any invocation instruction, the arguments and return value
106.365 + * will be passed directly on the JVM stack, in accordance with the descriptor,
106.366 + * and without implicit boxing or unboxing.
106.367 + *
106.368 + * <h3>Interoperation between method handles and the Core Reflection API</h3>
106.369 + * Using factory methods in the {@link java.lang.invoke.MethodHandles.Lookup Lookup} API,
106.370 + * any class member represented by a Core Reflection API object
106.371 + * can be converted to a behaviorally equivalent method handle.
106.372 + * For example, a reflective {@link java.lang.reflect.Method Method} can
106.373 + * be converted to a method handle using
106.374 + * {@link java.lang.invoke.MethodHandles.Lookup#unreflect Lookup.unreflect}.
106.375 + * The resulting method handles generally provide more direct and efficient
106.376 + * access to the underlying class members.
106.377 + * <p>
106.378 + * As a special case,
106.379 + * when the Core Reflection API is used to view the signature polymorphic
106.380 + * methods {@code invokeExact} or {@code invokeGeneric} in this class,
106.381 + * they appear as single, non-polymorphic native methods.
106.382 + * Calls to these native methods do not result in method handle invocations.
106.383 + * Since {@code invokevirtual} instructions can natively
106.384 + * invoke method handles under any type descriptor, this reflective view conflicts
106.385 + * with the normal presentation via bytecodes.
106.386 + * Thus, these two native methods, as viewed by
106.387 + * {@link java.lang.Class#getDeclaredMethod Class.getDeclaredMethod},
106.388 + * are placeholders only.
106.389 + * If invoked via {@link java.lang.reflect.Method#invoke Method.invoke},
106.390 + * they will throw {@code UnsupportedOperationException}.
106.391 + * <p>
106.392 + * In order to obtain an invoker method for a particular type descriptor,
106.393 + * use {@link java.lang.invoke.MethodHandles#exactInvoker MethodHandles.exactInvoker},
106.394 + * or {@link java.lang.invoke.MethodHandles#genericInvoker MethodHandles.genericInvoker}.
106.395 + * The {@link java.lang.invoke.MethodHandles.Lookup#findVirtual Lookup.findVirtual}
106.396 + * API is also able to return a method handle
106.397 + * to call {@code invokeExact} or {@code invokeGeneric},
106.398 + * for any specified type descriptor .
106.399 + *
106.400 + * <h3>Interoperation between method handles and Java generics</h3>
106.401 + * A method handle can be obtained on a method, constructor, or field
106.402 + * which is declared with Java generic types.
106.403 + * As with the Core Reflection API, the type of the method handle
106.404 + * will constructed from the erasure of the source-level type.
106.405 + * When a method handle is invoked, the types of its arguments
106.406 + * or the return value cast type may be generic types or type instances.
106.407 + * If this occurs, the compiler will replace those
106.408 + * types by their erasures when when it constructs the type descriptor
106.409 + * for the {@code invokevirtual} instruction.
106.410 + * <p>
106.411 + * Method handles do not represent
106.412 + * their function-like types in terms of Java parameterized (generic) types,
106.413 + * because there are three mismatches between function-like types and parameterized
106.414 + * Java types.
106.415 + * <ul>
106.416 + * <li>Method types range over all possible arities,
106.417 + * from no arguments to up to 255 of arguments (a limit imposed by the JVM).
106.418 + * Generics are not variadic, and so cannot represent this.</li>
106.419 + * <li>Method types can specify arguments of primitive types,
106.420 + * which Java generic types cannot range over.</li>
106.421 + * <li>Higher order functions over method handles (combinators) are
106.422 + * often generic across a wide range of function types, including
106.423 + * those of multiple arities. It is impossible to represent such
106.424 + * genericity with a Java type parameter.</li>
106.425 + * </ul>
106.426 + *
106.427 + * @see MethodType
106.428 + * @see MethodHandles
106.429 + * @author John Rose, JSR 292 EG
106.430 + */
106.431 +public abstract class MethodHandle {
106.432 + // { JVM internals:
106.433 +
106.434 + private byte vmentry; // adapter stub or method entry point
106.435 + //private int vmslots; // optionally, hoist type.form.vmslots
106.436 + /*non-public*/ Object vmtarget; // VM-specific, class-specific target value
106.437 +
106.438 + // TO DO: vmtarget should be invisible to Java, since the JVM puts internal
106.439 + // managed pointers into it. Making it visible exposes it to debuggers,
106.440 + // which can cause errors when they treat the pointer as an Object.
106.441 +
106.442 + // These two dummy fields are present to force 'I' and 'J' signatures
106.443 + // into this class's constant pool, so they can be transferred
106.444 + // to vmentry when this class is loaded.
106.445 + static final int INT_FIELD = 0;
106.446 + static final long LONG_FIELD = 0;
106.447 +
106.448 + // vmentry (a void* field) is used *only* by the JVM.
106.449 + // The JVM adjusts its type to int or long depending on system wordsize.
106.450 + // Since it is statically typed as neither int nor long, it is impossible
106.451 + // to use this field from Java bytecode. (Please don't try to, either.)
106.452 +
106.453 + // The vmentry is an assembly-language stub which is jumped to
106.454 + // immediately after the method type is verified.
106.455 + // For a direct MH, this stub loads the vmtarget's entry point
106.456 + // and jumps to it.
106.457 +
106.458 + // } End of JVM internals.
106.459 +
106.460 + static { MethodHandleImpl.initStatics(); }
106.461 +
106.462 + // interface MethodHandle<R throws X extends Exception,A...>
106.463 + // { MethodType<R throws X,A...> type(); public R invokeExact(A...) throws X; }
106.464 +
106.465 + /**
106.466 + * Internal marker interface which distinguishes (to the Java compiler)
106.467 + * those methods which are <a href="MethodHandle.html#sigpoly">signature polymorphic</a>.
106.468 + */
106.469 + @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD})
106.470 + @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
106.471 + @interface PolymorphicSignature { }
106.472 +
106.473 + private MethodType type;
106.474 +
106.475 + /**
106.476 + * Reports the type of this method handle.
106.477 + * Every invocation of this method handle via {@code invokeExact} must exactly match this type.
106.478 + * @return the method handle type
106.479 + */
106.480 + public MethodType type() {
106.481 + return type;
106.482 + }
106.483 +
106.484 + /**
106.485 + * Package-private constructor for the method handle implementation hierarchy.
106.486 + * Method handle inheritance will be contained completely within
106.487 + * the {@code java.lang.invoke} package.
106.488 + */
106.489 + // @param type type (permanently assigned) of the new method handle
106.490 + /*non-public*/ MethodHandle(MethodType type) {
106.491 + type.getClass(); // elicit NPE
106.492 + this.type = type;
106.493 + }
106.494 +
106.495 + /**
106.496 + * Invokes the method handle, allowing any caller type descriptor, but requiring an exact type match.
106.497 + * The type descriptor at the call site of {@code invokeExact} must
106.498 + * exactly match this method handle's {@link #type type}.
106.499 + * No conversions are allowed on arguments or return values.
106.500 + * <p>
106.501 + * When this method is observed via the Core Reflection API,
106.502 + * it will appear as a single native method, taking an object array and returning an object.
106.503 + * If this native method is invoked directly via
106.504 + * {@link java.lang.reflect.Method#invoke Method.invoke}, via JNI,
106.505 + * or indirectly via {@link java.lang.invoke.MethodHandles.Lookup#unreflect Lookup.unreflect},
106.506 + * it will throw an {@code UnsupportedOperationException}.
106.507 + * @throws WrongMethodTypeException if the target's type is not identical with the caller's type descriptor
106.508 + * @throws Throwable anything thrown by the underlying method propagates unchanged through the method handle call
106.509 + */
106.510 + public final native @PolymorphicSignature Object invokeExact(Object... args) throws Throwable;
106.511 +
106.512 + /**
106.513 + * Invokes the method handle, allowing any caller type descriptor,
106.514 + * and optionally performing conversions on arguments and return values.
106.515 + * <p>
106.516 + * If the call site type descriptor exactly matches this method handle's {@link #type type},
106.517 + * the call proceeds as if by {@link #invokeExact invokeExact}.
106.518 + * <p>
106.519 + * Otherwise, the call proceeds as if this method handle were first
106.520 + * adjusted by calling {@link #asType asType} to adjust this method handle
106.521 + * to the required type, and then the call proceeds as if by
106.522 + * {@link #invokeExact invokeExact} on the adjusted method handle.
106.523 + * <p>
106.524 + * There is no guarantee that the {@code asType} call is actually made.
106.525 + * If the JVM can predict the results of making the call, it may perform
106.526 + * adaptations directly on the caller's arguments,
106.527 + * and call the target method handle according to its own exact type.
106.528 + * <p>
106.529 + * The type descriptor at the call site of {@code invokeGeneric} must
106.530 + * be a valid argument to the receivers {@code asType} method.
106.531 + * In particular, the caller must specify the same argument arity
106.532 + * as the callee's type,
106.533 + * if the callee is not a {@linkplain #asVarargsCollector variable arity collector}.
106.534 + * <p>
106.535 + * When this method is observed via the Core Reflection API,
106.536 + * it will appear as a single native method, taking an object array and returning an object.
106.537 + * If this native method is invoked directly via
106.538 + * {@link java.lang.reflect.Method#invoke Method.invoke}, via JNI,
106.539 + * or indirectly via {@link java.lang.invoke.MethodHandles.Lookup#unreflect Lookup.unreflect},
106.540 + * it will throw an {@code UnsupportedOperationException}.
106.541 + * @throws WrongMethodTypeException if the target's type cannot be adjusted to the caller's type descriptor
106.542 + * @throws ClassCastException if the target's type can be adjusted to the caller, but a reference cast fails
106.543 + * @throws Throwable anything thrown by the underlying method propagates unchanged through the method handle call
106.544 + */
106.545 + public final native @PolymorphicSignature Object invokeGeneric(Object... args) throws Throwable;
106.546 +
106.547 + /**
106.548 + * Performs a varargs invocation, passing the arguments in the given array
106.549 + * to the method handle, as if via {@link #invokeGeneric invokeGeneric} from a call site
106.550 + * which mentions only the type {@code Object}, and whose arity is the length
106.551 + * of the argument array.
106.552 + * <p>
106.553 + * Specifically, execution proceeds as if by the following steps,
106.554 + * although the methods are not guaranteed to be called if the JVM
106.555 + * can predict their effects.
106.556 + * <ul>
106.557 + * <li>Determine the length of the argument array as {@code N}.
106.558 + * For a null reference, {@code N=0}. </li>
106.559 + * <li>Determine the generic type {@code TN} of {@code N} arguments as
106.560 + * as {@code TN=MethodType.genericMethodType(N)}.</li>
106.561 + * <li>Force the original target method handle {@code MH0} to the
106.562 + * required type, as {@code MH1 = MH0.asType(TN)}. </li>
106.563 + * <li>Spread the array into {@code N} separate arguments {@code A0, ...}. </li>
106.564 + * <li>Invoke the type-adjusted method handle on the unpacked arguments:
106.565 + * MH1.invokeExact(A0, ...). </li>
106.566 + * <li>Take the return value as an {@code Object} reference. </li>
106.567 + * </ul>
106.568 + * <p>
106.569 + * Because of the action of the {@code asType} step, the following argument
106.570 + * conversions are applied as necessary:
106.571 + * <ul>
106.572 + * <li>reference casting
106.573 + * <li>unboxing
106.574 + * <li>widening primitive conversions
106.575 + * </ul>
106.576 + * <p>
106.577 + * The result returned by the call is boxed if it is a primitive,
106.578 + * or forced to null if the return type is void.
106.579 + * <p>
106.580 + * This call is equivalent to the following code:
106.581 + * <p><blockquote><pre>
106.582 + * MethodHandle invoker = MethodHandles.spreadInvoker(this.type(), 0);
106.583 + * Object result = invoker.invokeExact(this, arguments);
106.584 + * </pre></blockquote>
106.585 + * <p>
106.586 + * Unlike the signature polymorphic methods {@code invokeExact} and {@code invokeGeneric},
106.587 + * {@code invokeWithArguments} can be accessed normally via the Core Reflection API and JNI.
106.588 + * It can therefore be used as a bridge between native or reflective code and method handles.
106.589 + *
106.590 + * @param arguments the arguments to pass to the target
106.591 + * @return the result returned by the target
106.592 + * @throws ClassCastException if an argument cannot be converted by reference casting
106.593 + * @throws WrongMethodTypeException if the target's type cannot be adjusted to take the given number of {@code Object} arguments
106.594 + * @throws Throwable anything thrown by the target method invocation
106.595 + * @see MethodHandles#spreadInvoker
106.596 + */
106.597 + public Object invokeWithArguments(Object... arguments) throws Throwable {
106.598 + int argc = arguments == null ? 0 : arguments.length;
106.599 + MethodType type = type();
106.600 + if (type.parameterCount() != argc) {
106.601 + // simulate invokeGeneric
106.602 + return asType(MethodType.genericMethodType(argc)).invokeWithArguments(arguments);
106.603 + }
106.604 + if (argc <= 10) {
106.605 + MethodHandle invoker = type.invokers().genericInvoker();
106.606 + switch (argc) {
106.607 + case 0: return invoker.invokeExact(this);
106.608 + case 1: return invoker.invokeExact(this,
106.609 + arguments[0]);
106.610 + case 2: return invoker.invokeExact(this,
106.611 + arguments[0], arguments[1]);
106.612 + case 3: return invoker.invokeExact(this,
106.613 + arguments[0], arguments[1], arguments[2]);
106.614 + case 4: return invoker.invokeExact(this,
106.615 + arguments[0], arguments[1], arguments[2],
106.616 + arguments[3]);
106.617 + case 5: return invoker.invokeExact(this,
106.618 + arguments[0], arguments[1], arguments[2],
106.619 + arguments[3], arguments[4]);
106.620 + case 6: return invoker.invokeExact(this,
106.621 + arguments[0], arguments[1], arguments[2],
106.622 + arguments[3], arguments[4], arguments[5]);
106.623 + case 7: return invoker.invokeExact(this,
106.624 + arguments[0], arguments[1], arguments[2],
106.625 + arguments[3], arguments[4], arguments[5],
106.626 + arguments[6]);
106.627 + case 8: return invoker.invokeExact(this,
106.628 + arguments[0], arguments[1], arguments[2],
106.629 + arguments[3], arguments[4], arguments[5],
106.630 + arguments[6], arguments[7]);
106.631 + case 9: return invoker.invokeExact(this,
106.632 + arguments[0], arguments[1], arguments[2],
106.633 + arguments[3], arguments[4], arguments[5],
106.634 + arguments[6], arguments[7], arguments[8]);
106.635 + case 10: return invoker.invokeExact(this,
106.636 + arguments[0], arguments[1], arguments[2],
106.637 + arguments[3], arguments[4], arguments[5],
106.638 + arguments[6], arguments[7], arguments[8],
106.639 + arguments[9]);
106.640 + }
106.641 + }
106.642 +
106.643 + // more than ten arguments get boxed in a varargs list:
106.644 + MethodHandle invoker = type.invokers().spreadInvoker(0);
106.645 + return invoker.invokeExact(this, arguments);
106.646 + }
106.647 +
106.648 + /**
106.649 + * Performs a varargs invocation, passing the arguments in the given array
106.650 + * to the method handle, as if via {@link #invokeGeneric invokeGeneric} from a call site
106.651 + * which mentions only the type {@code Object}, and whose arity is the length
106.652 + * of the argument array.
106.653 + * <p>
106.654 + * This method is also equivalent to the following code:
106.655 + * <p><blockquote><pre>
106.656 + * {@link #invokeWithArguments(Object...) invokeWithArguments}(arguments.toArray())
106.657 + * </pre></blockquote>
106.658 + *
106.659 + * @param arguments the arguments to pass to the target
106.660 + * @return the result returned by the target
106.661 + * @throws ClassCastException if an argument cannot be converted by reference casting
106.662 + * @throws WrongMethodTypeException if the target's type cannot be adjusted to take the given number of {@code Object} arguments
106.663 + * @throws Throwable anything thrown by the target method invocation
106.664 + */
106.665 + public Object invokeWithArguments(java.util.List<?> arguments) throws Throwable {
106.666 + return invokeWithArguments(arguments.toArray());
106.667 + }
106.668 +
106.669 + /**
106.670 + * Produces an adapter method handle which adapts the type of the
106.671 + * current method handle to a new type.
106.672 + * The resulting method handle is guaranteed to report a type
106.673 + * which is equal to the desired new type.
106.674 + * <p>
106.675 + * If the original type and new type are equal, returns {@code this}.
106.676 + * <p>
106.677 + * This method provides the crucial behavioral difference between
106.678 + * {@link #invokeExact invokeExact} and {@link #invokeGeneric invokeGeneric}. The two methods
106.679 + * perform the same steps when the caller's type descriptor is identical
106.680 + * with the callee's, but when the types differ, {@link #invokeGeneric invokeGeneric}
106.681 + * also calls {@code asType} (or some internal equivalent) in order
106.682 + * to match up the caller's and callee's types.
106.683 + * <p>
106.684 + * This method is equivalent to {@link MethodHandles#convertArguments convertArguments},
106.685 + * except for variable arity method handles produced by {@link #asVarargsCollector asVarargsCollector}.
106.686 + *
106.687 + * @param newType the expected type of the new method handle
106.688 + * @return a method handle which delegates to {@code this} after performing
106.689 + * any necessary argument conversions, and arranges for any
106.690 + * necessary return value conversions
106.691 + * @throws WrongMethodTypeException if the conversion cannot be made
106.692 + * @see MethodHandles#convertArguments
106.693 + */
106.694 + public MethodHandle asType(MethodType newType) {
106.695 + return MethodHandles.convertArguments(this, newType);
106.696 + }
106.697 +
106.698 + /**
106.699 + * Makes an adapter which accepts a trailing array argument
106.700 + * and spreads its elements as positional arguments.
106.701 + * The new method handle adapts, as its <i>target</i>,
106.702 + * the current method handle. The type of the adapter will be
106.703 + * the same as the type of the target, except that the final
106.704 + * {@code arrayLength} parameters of the target's type are replaced
106.705 + * by a single array parameter of type {@code arrayType}.
106.706 + * <p>
106.707 + * If the array element type differs from any of the corresponding
106.708 + * argument types on the original target,
106.709 + * the original target is adapted to take the array elements directly,
106.710 + * as if by a call to {@link #asType asType}.
106.711 + * <p>
106.712 + * When called, the adapter replaces a trailing array argument
106.713 + * by the array's elements, each as its own argument to the target.
106.714 + * (The order of the arguments is preserved.)
106.715 + * They are converted pairwise by casting and/or unboxing
106.716 + * to the types of the trailing parameters of the target.
106.717 + * Finally the target is called.
106.718 + * What the target eventually returns is returned unchanged by the adapter.
106.719 + * <p>
106.720 + * Before calling the target, the adapter verifies that the array
106.721 + * contains exactly enough elements to provide a correct argument count
106.722 + * to the target method handle.
106.723 + * (The array may also be null when zero elements are required.)
106.724 + * @param arrayType usually {@code Object[]}, the type of the array argument from which to extract the spread arguments
106.725 + * @param arrayLength the number of arguments to spread from an incoming array argument
106.726 + * @return a new method handle which spreads its final array argument,
106.727 + * before calling the original method handle
106.728 + * @throws IllegalArgumentException if {@code arrayType} is not an array type
106.729 + * @throws IllegalArgumentException if target does not have at least
106.730 + * {@code arrayLength} parameter types
106.731 + * @throws WrongMethodTypeException if the implied {@code asType} call fails
106.732 + * @see #asCollector
106.733 + */
106.734 + public MethodHandle asSpreader(Class<?> arrayType, int arrayLength) {
106.735 + Class<?> arrayElement = arrayType.getComponentType();
106.736 + if (arrayElement == null) throw newIllegalArgumentException("not an array type");
106.737 + MethodType oldType = type();
106.738 + int nargs = oldType.parameterCount();
106.739 + if (nargs < arrayLength) throw newIllegalArgumentException("bad spread array length");
106.740 + int keepPosArgs = nargs - arrayLength;
106.741 + MethodType newType = oldType.dropParameterTypes(keepPosArgs, nargs);
106.742 + newType = newType.insertParameterTypes(keepPosArgs, arrayType);
106.743 + return MethodHandles.spreadArguments(this, newType);
106.744 + }
106.745 +
106.746 + /**
106.747 + * Makes an adapter which accepts a given number of trailing
106.748 + * positional arguments and collects them into an array argument.
106.749 + * The new method handle adapts, as its <i>target</i>,
106.750 + * the current method handle. The type of the adapter will be
106.751 + * the same as the type of the target, except that a single trailing
106.752 + * parameter (usually of type {@code arrayType}) is replaced by
106.753 + * {@code arrayLength} parameters whose type is element type of {@code arrayType}.
106.754 + * <p>
106.755 + * If the array type differs from the final argument type on the original target,
106.756 + * the original target is adapted to take the array type directly,
106.757 + * as if by a call to {@link #asType asType}.
106.758 + * <p>
106.759 + * When called, the adapter replaces its trailing {@code arrayLength}
106.760 + * arguments by a single new array of type {@code arrayType}, whose elements
106.761 + * comprise (in order) the replaced arguments.
106.762 + * Finally the target is called.
106.763 + * What the target eventually returns is returned unchanged by the adapter.
106.764 + * <p>
106.765 + * (The array may also be a shared constant when {@code arrayLength} is zero.)
106.766 + * <p>
106.767 + * (<em>Note:</em> The {@code arrayType} is often identical to the last
106.768 + * parameter type of the original target.
106.769 + * It is an explicit argument for symmetry with {@code asSpreader}, and also
106.770 + * to allow the target to use a simple {@code Object} as its last parameter type.)
106.771 + * <p>
106.772 + * In order to create a collecting adapter which is not restricted to a particular
106.773 + * number of collected arguments, use {@link #asVarargsCollector asVarargsCollector} instead.
106.774 + * @param arrayType often {@code Object[]}, the type of the array argument which will collect the arguments
106.775 + * @param arrayLength the number of arguments to collect into a new array argument
106.776 + * @return a new method handle which collects some trailing argument
106.777 + * into an array, before calling the original method handle
106.778 + * @throws IllegalArgumentException if {@code arrayType} is not an array type
106.779 + * or {@code arrayType} is not assignable to this method handle's trailing parameter type,
106.780 + * or {@code arrayLength} is not a legal array size
106.781 + * @throws WrongMethodTypeException if the implied {@code asType} call fails
106.782 + * @see #asSpreader
106.783 + * @see #asVarargsCollector
106.784 + */
106.785 + public MethodHandle asCollector(Class<?> arrayType, int arrayLength) {
106.786 + Class<?> arrayElement = arrayType.getComponentType();
106.787 + if (arrayElement == null) throw newIllegalArgumentException("not an array type");
106.788 + MethodType oldType = type();
106.789 + int nargs = oldType.parameterCount();
106.790 + if (nargs == 0) throw newIllegalArgumentException("no trailing argument");
106.791 + MethodType newType = oldType.dropParameterTypes(nargs-1, nargs);
106.792 + newType = newType.insertParameterTypes(nargs-1,
106.793 + java.util.Collections.<Class<?>>nCopies(arrayLength, arrayElement));
106.794 + return MethodHandles.collectArguments(this, newType);
106.795 + }
106.796 +
106.797 + /**
106.798 + * Makes a <em>variable arity</em> adapter which is able to accept
106.799 + * any number of trailing positional arguments and collect them
106.800 + * into an array argument.
106.801 + * <p>
106.802 + * The type and behavior of the adapter will be the same as
106.803 + * the type and behavior of the target, except that certain
106.804 + * {@code invokeGeneric} and {@code asType} requests can lead to
106.805 + * trailing positional arguments being collected into target's
106.806 + * trailing parameter.
106.807 + * Also, the last parameter type of the adapter will be
106.808 + * {@code arrayType}, even if the target has a different
106.809 + * last parameter type.
106.810 + * <p>
106.811 + * When called with {@link #invokeExact invokeExact}, the adapter invokes
106.812 + * the target with no argument changes.
106.813 + * (<em>Note:</em> This behavior is different from a
106.814 + * {@linkplain #asCollector fixed arity collector},
106.815 + * since it accepts a whole array of indeterminate length,
106.816 + * rather than a fixed number of arguments.)
106.817 + * <p>
106.818 + * When called with {@link #invokeGeneric invokeGeneric}, if the caller
106.819 + * type is the same as the adapter, the adapter invokes the target as with
106.820 + * {@code invokeExact}.
106.821 + * (This is the normal behavior for {@code invokeGeneric} when types match.)
106.822 + * <p>
106.823 + * Otherwise, if the caller and adapter arity are the same, and the
106.824 + * trailing parameter type of the caller is a reference type identical to
106.825 + * or assignable to the trailing parameter type of the adapter,
106.826 + * the arguments and return values are converted pairwise,
106.827 + * as if by {@link MethodHandles#convertArguments convertArguments}.
106.828 + * (This is also normal behavior for {@code invokeGeneric} in such a case.)
106.829 + * <p>
106.830 + * Otherwise, the arities differ, or the adapter's trailing parameter
106.831 + * type is not assignable from the corresponding caller type.
106.832 + * In this case, the adapter replaces all trailing arguments from
106.833 + * the original trailing argument position onward, by
106.834 + * a new array of type {@code arrayType}, whose elements
106.835 + * comprise (in order) the replaced arguments.
106.836 + * <p>
106.837 + * The caller type must provides as least enough arguments,
106.838 + * and of the correct type, to satisfy the target's requirement for
106.839 + * positional arguments before the trailing array argument.
106.840 + * Thus, the caller must supply, at a minimum, {@code N-1} arguments,
106.841 + * where {@code N} is the arity of the target.
106.842 + * Also, there must exist conversions from the incoming arguments
106.843 + * to the target's arguments.
106.844 + * As with other uses of {@code invokeGeneric}, if these basic
106.845 + * requirements are not fulfilled, a {@code WrongMethodTypeException}
106.846 + * may be thrown.
106.847 + * <p>
106.848 + * In all cases, what the target eventually returns is returned unchanged by the adapter.
106.849 + * <p>
106.850 + * In the final case, it is exactly as if the target method handle were
106.851 + * temporarily adapted with a {@linkplain #asCollector fixed arity collector}
106.852 + * to the arity required by the caller type.
106.853 + * (As with {@code asCollector}, if the array length is zero,
106.854 + * a shared constant may be used instead of a new array.
106.855 + * If the implied call to {@code asCollector} would throw
106.856 + * an {@code IllegalArgumentException} or {@code WrongMethodTypeException},
106.857 + * the call to the variable arity adapter must throw
106.858 + * {@code WrongMethodTypeException}.)
106.859 + * <p>
106.860 + * The behavior of {@link #asType asType} is also specialized for
106.861 + * variable arity adapters, to maintain the invariant that
106.862 + * {@code invokeGeneric} is always equivalent to an {@code asType}
106.863 + * call to adjust the target type, followed by {@code invokeExact}.
106.864 + * Therefore, a variable arity adapter responds
106.865 + * to an {@code asType} request by building a fixed arity collector,
106.866 + * if and only if the adapter and requested type differ either
106.867 + * in arity or trailing argument type.
106.868 + * The resulting fixed arity collector has its type further adjusted
106.869 + * (if necessary) to the requested type by pairwise conversion,
106.870 + * as if by another application of {@code asType}.
106.871 + * <p>
106.872 + * When a method handle is obtained by executing an {@code ldc} instruction
106.873 + * of a {@code CONSTANT_MethodHandle} constant, and the target method is marked
106.874 + * as a variable arity method (with the modifier bit {@code 0x0080}),
106.875 + * the method handle will accept multiple arities, as if the method handle
106.876 + * constant were created by means of a call to {@code asVarargsCollector}.
106.877 + * <p>
106.878 + * In order to create a collecting adapter which collects a predetermined
106.879 + * number of arguments, and whose type reflects this predetermined number,
106.880 + * use {@link #asCollector asCollector} instead.
106.881 + * <p>
106.882 + * No method handle transformations produce new method handles with
106.883 + * variable arity, unless they are documented as doing so.
106.884 + * Therefore, besides {@code asVarargsCollector},
106.885 + * all methods in {@code MethodHandle} and {@code MethodHandles}
106.886 + * will return a method handle with fixed arity,
106.887 + * except in the cases where they are specified to return their original
106.888 + * operand (e.g., {@code asType} of the method handle's own type).
106.889 + * <p>
106.890 + * Calling {@code asVarargsCollector} on a method handle which is already
106.891 + * of variable arity will produce a method handle with the same type and behavior.
106.892 + * It may (or may not) return the original variable arity method handle.
106.893 + * <p>
106.894 + * Here is an example, of a list-making variable arity method handle:
106.895 + * <blockquote><pre>
106.896 +MethodHandle asList = publicLookup()
106.897 + .findStatic(Arrays.class, "asList", methodType(List.class, Object[].class))
106.898 + .asVarargsCollector(Object[].class);
106.899 +assertEquals("[]", asList.invokeGeneric().toString());
106.900 +assertEquals("[1]", asList.invokeGeneric(1).toString());
106.901 +assertEquals("[two, too]", asList.invokeGeneric("two", "too").toString());
106.902 +Object[] argv = { "three", "thee", "tee" };
106.903 +assertEquals("[three, thee, tee]", asList.invokeGeneric(argv).toString());
106.904 +List ls = (List) asList.invokeGeneric((Object)argv);
106.905 +assertEquals(1, ls.size());
106.906 +assertEquals("[three, thee, tee]", Arrays.toString((Object[])ls.get(0)));
106.907 + * </pre></blockquote>
106.908 + * <p style="font-size:smaller;">
106.909 + * <em>Discussion:</em>
106.910 + * These rules are designed as a dynamically-typed variation
106.911 + * of the Java rules for variable arity methods.
106.912 + * In both cases, callers to a variable arity method or method handle
106.913 + * can either pass zero or more positional arguments, or else pass
106.914 + * pre-collected arrays of any length. Users should be aware of the
106.915 + * special role of the final argument, and of the effect of a
106.916 + * type match on that final argument, which determines whether
106.917 + * or not a single trailing argument is interpreted as a whole
106.918 + * array or a single element of an array to be collected.
106.919 + * Note that the dynamic type of the trailing argument has no
106.920 + * effect on this decision, only a comparison between the static
106.921 + * type descriptor of the call site and the type of the method handle.)
106.922 + * <p style="font-size:smaller;">
106.923 + * As a result of the previously stated rules, the variable arity behavior
106.924 + * of a method handle may be suppressed, by binding it to the exact invoker
106.925 + * of its own type, as follows:
106.926 + * <blockquote><pre>
106.927 +MethodHandle vamh = publicLookup()
106.928 + .findStatic(Arrays.class, "asList", methodType(List.class, Object[].class))
106.929 + .asVarargsCollector(Object[].class);
106.930 +MethodHandle mh = MethodHandles.exactInvoker(vamh.type()).bindTo(vamh);
106.931 +assert(vamh.type().equals(mh.type()));
106.932 +assertEquals("[1, 2, 3]", vamh.invokeGeneric(1,2,3).toString());
106.933 +boolean failed = false;
106.934 +try { mh.invokeGeneric(1,2,3); }
106.935 +catch (WrongMethodTypeException ex) { failed = true; }
106.936 +assert(failed);
106.937 + * </pre></blockquote>
106.938 + * This transformation has no behavioral effect if the method handle is
106.939 + * not of variable arity.
106.940 + *
106.941 + * @param arrayType often {@code Object[]}, the type of the array argument which will collect the arguments
106.942 + * @return a new method handle which can collect any number of trailing arguments
106.943 + * into an array, before calling the original method handle
106.944 + * @throws IllegalArgumentException if {@code arrayType} is not an array type
106.945 + * or {@code arrayType} is not assignable to this method handle's trailing parameter type
106.946 + * @see #asCollector
106.947 + * @see #isVarargsCollector
106.948 + */
106.949 + public MethodHandle asVarargsCollector(Class<?> arrayType) {
106.950 + Class<?> arrayElement = arrayType.getComponentType();
106.951 + if (arrayElement == null) throw newIllegalArgumentException("not an array type");
106.952 + return MethodHandles.asVarargsCollector(this, arrayType);
106.953 + }
106.954 +
106.955 + /**
106.956 + * Determines if this method handle
106.957 + * supports {@linkplain #asVarargsCollector variable arity} calls.
106.958 + * Such method handles arise from the following sources:
106.959 + * <ul>
106.960 + * <li>a call to {@linkplain #asVarargsCollector asVarargsCollector}
106.961 + * <li>a call to a {@linkplain java.lang.invoke.MethodHandles.Lookup lookup method}
106.962 + * which resolves to a variable arity Java method or constructor
106.963 + * <li>an {@code ldc} instruction of a {@code CONSTANT_MethodHandle}
106.964 + * which resolves to a variable arity Java method or constructor
106.965 + * </ul>
106.966 + * @return true if this method handle accepts more than one arity of {@code invokeGeneric} calls
106.967 + * @see #asVarargsCollector
106.968 + */
106.969 + public boolean isVarargsCollector() {
106.970 + return false;
106.971 + }
106.972 +
106.973 + /**
106.974 + * Binds a value {@code x} to the first argument of a method handle, without invoking it.
106.975 + * The new method handle adapts, as its <i>target</i>,
106.976 + * the current method handle by binding it to the given argument.
106.977 + * The type of the bound handle will be
106.978 + * the same as the type of the target, except that a single leading
106.979 + * reference parameter will be omitted.
106.980 + * <p>
106.981 + * When called, the bound handle inserts the given value {@code x}
106.982 + * as a new leading argument to the target. The other arguments are
106.983 + * also passed unchanged.
106.984 + * What the target eventually returns is returned unchanged by the bound handle.
106.985 + * <p>
106.986 + * The reference {@code x} must be convertible to the first parameter
106.987 + * type of the target.
106.988 + * <p>
106.989 + * (<em>Note:</em> Because method handles are immutable, the target method handle
106.990 + * retains its original type and behavior.)
106.991 + * @param x the value to bind to the first argument of the target
106.992 + * @return a new method handle which prepends the given value to the incoming
106.993 + * argument list, before calling the original method handle
106.994 + * @throws IllegalArgumentException if the target does not have a
106.995 + * leading parameter type that is a reference type
106.996 + * @throws ClassCastException if {@code x} cannot be converted
106.997 + * to the leading parameter type of the target
106.998 + * @see MethodHandles#insertArguments
106.999 + */
106.1000 + public MethodHandle bindTo(Object x) {
106.1001 + Class<?> ptype;
106.1002 + if (type().parameterCount() == 0 ||
106.1003 + (ptype = type().parameterType(0)).isPrimitive())
106.1004 + throw newIllegalArgumentException("no leading reference parameter", x);
106.1005 + x = MethodHandles.checkValue(ptype, x);
106.1006 + // Cf. MethodHandles.insertArguments for the following logic:
106.1007 + MethodHandle bmh = MethodHandleImpl.bindReceiver(this, x);
106.1008 + if (bmh != null) return bmh;
106.1009 + return MethodHandleImpl.bindArgument(this, 0, x);
106.1010 + }
106.1011 +
106.1012 + /**
106.1013 + * Returns a string representation of the method handle,
106.1014 + * starting with the string {@code "MethodHandle"} and
106.1015 + * ending with the string representation of the method handle's type.
106.1016 + * In other words, this method returns a string equal to the value of:
106.1017 + * <blockquote><pre>
106.1018 + * "MethodHandle" + type().toString()
106.1019 + * </pre></blockquote>
106.1020 + * <p>
106.1021 + * (<em>Note:</em> Future releases of this API may add further information
106.1022 + * to the string representation.
106.1023 + * Therefore, the present syntax should not be parsed by applications.)
106.1024 + *
106.1025 + * @return a string representation of the method handle
106.1026 + */
106.1027 + @Override
106.1028 + public String toString() {
106.1029 + return getNameString(this);
106.1030 + }
106.1031 +}
107.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
107.2 +++ b/src/share/classes/java/lang/invoke/MethodHandleImpl.java Tue Mar 29 20:19:55 2011 -0700
107.3 @@ -0,0 +1,1106 @@
107.4 +/*
107.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
107.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
107.7 + *
107.8 + * This code is free software; you can redistribute it and/or modify it
107.9 + * under the terms of the GNU General Public License version 2 only, as
107.10 + * published by the Free Software Foundation. Oracle designates this
107.11 + * particular file as subject to the "Classpath" exception as provided
107.12 + * by Oracle in the LICENSE file that accompanied this code.
107.13 + *
107.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
107.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
107.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
107.17 + * version 2 for more details (a copy is included in the LICENSE file that
107.18 + * accompanied this code).
107.19 + *
107.20 + * You should have received a copy of the GNU General Public License version
107.21 + * 2 along with this work; if not, write to the Free Software Foundation,
107.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
107.23 + *
107.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
107.25 + * or visit www.oracle.com if you need additional information or have any
107.26 + * questions.
107.27 + */
107.28 +
107.29 +package java.lang.invoke;
107.30 +
107.31 +import sun.invoke.util.VerifyType;
107.32 +import java.util.ArrayList;
107.33 +import java.util.Arrays;
107.34 +import java.util.Collections;
107.35 +import java.util.HashMap;
107.36 +import java.util.List;
107.37 +import sun.invoke.empty.Empty;
107.38 +import sun.invoke.util.ValueConversions;
107.39 +import sun.invoke.util.Wrapper;
107.40 +import sun.misc.Unsafe;
107.41 +import static java.lang.invoke.MethodHandleStatics.*;
107.42 +import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
107.43 +
107.44 +/**
107.45 + * Trusted implementation code for MethodHandle.
107.46 + * @author jrose
107.47 + */
107.48 +/*non-public*/ abstract class MethodHandleImpl {
107.49 + /// Factory methods to create method handles:
107.50 +
107.51 + private static final MemberName.Factory LOOKUP = MemberName.Factory.INSTANCE;
107.52 +
107.53 + static void initStatics() {
107.54 + // Trigger preceding sequence.
107.55 + }
107.56 +
107.57 + /** Look up a given method.
107.58 + * Callable only from sun.invoke and related packages.
107.59 + * <p>
107.60 + * The resulting method handle type will be of the given type,
107.61 + * with a receiver type {@code rcvc} prepended if the member is not static.
107.62 + * <p>
107.63 + * Access checks are made as of the given lookup class.
107.64 + * In particular, if the method is protected and {@code defc} is in a
107.65 + * different package from the lookup class, then {@code rcvc} must be
107.66 + * the lookup class or a subclass.
107.67 + * @param token Proof that the lookup class has access to this package.
107.68 + * @param member Resolved method or constructor to call.
107.69 + * @param name Name of the desired method.
107.70 + * @param rcvc Receiver type of desired non-static method (else null)
107.71 + * @param doDispatch whether the method handle will test the receiver type
107.72 + * @param lookupClass access-check relative to this class
107.73 + * @return a direct handle to the matching method
107.74 + * @throws IllegalAccessException if the given method cannot be accessed by the lookup class
107.75 + */
107.76 + static
107.77 + MethodHandle findMethod(MemberName method,
107.78 + boolean doDispatch, Class<?> lookupClass) throws IllegalAccessException {
107.79 + MethodType mtype = method.getMethodType();
107.80 + if (!method.isStatic()) {
107.81 + // adjust the advertised receiver type to be exactly the one requested
107.82 + // (in the case of invokespecial, this will be the calling class)
107.83 + Class<?> recvType = method.getDeclaringClass();
107.84 + mtype = mtype.insertParameterTypes(0, recvType);
107.85 + }
107.86 + DirectMethodHandle mh = new DirectMethodHandle(mtype, method, doDispatch, lookupClass);
107.87 + if (!mh.isValid())
107.88 + throw method.makeAccessException("no access", lookupClass);
107.89 + assert(mh.type() == mtype);
107.90 + if (!method.isVarargs())
107.91 + return mh;
107.92 + else
107.93 + return mh.asVarargsCollector(mtype.parameterType(mtype.parameterCount()-1));
107.94 + }
107.95 +
107.96 + static
107.97 + MethodHandle makeAllocator(MethodHandle rawConstructor) {
107.98 + MethodType rawConType = rawConstructor.type();
107.99 + // Wrap the raw (unsafe) constructor with the allocation of a suitable object.
107.100 + MethodHandle allocator
107.101 + = AllocateObject.make(rawConType.parameterType(0), rawConstructor);
107.102 + assert(allocator.type()
107.103 + .equals(rawConType.dropParameterTypes(0, 1).changeReturnType(rawConType.parameterType(0))));
107.104 + return allocator;
107.105 + }
107.106 +
107.107 + static final class AllocateObject<C> extends BoundMethodHandle {
107.108 + private static final Unsafe unsafe = Unsafe.getUnsafe();
107.109 +
107.110 + private final Class<C> allocateClass;
107.111 + private final MethodHandle rawConstructor;
107.112 +
107.113 + private AllocateObject(MethodHandle invoker,
107.114 + Class<C> allocateClass, MethodHandle rawConstructor) {
107.115 + super(invoker);
107.116 + this.allocateClass = allocateClass;
107.117 + this.rawConstructor = rawConstructor;
107.118 + }
107.119 + static MethodHandle make(Class<?> allocateClass, MethodHandle rawConstructor) {
107.120 + MethodType rawConType = rawConstructor.type();
107.121 + assert(rawConType.parameterType(0) == allocateClass);
107.122 + MethodType newType = rawConType.dropParameterTypes(0, 1).changeReturnType(allocateClass);
107.123 + int nargs = rawConType.parameterCount() - 1;
107.124 + if (nargs < INVOKES.length) {
107.125 + MethodHandle invoke = INVOKES[nargs];
107.126 + MethodType conType = CON_TYPES[nargs];
107.127 + MethodHandle gcon = convertArguments(rawConstructor, conType, rawConType, null);
107.128 + if (gcon == null) return null;
107.129 + MethodHandle galloc = new AllocateObject(invoke, allocateClass, gcon);
107.130 + assert(galloc.type() == newType.generic());
107.131 + return convertArguments(galloc, newType, galloc.type(), null);
107.132 + } else {
107.133 + MethodHandle invoke = VARARGS_INVOKE;
107.134 + MethodType conType = CON_TYPES[nargs];
107.135 + MethodHandle gcon = spreadArguments(rawConstructor, conType, 1);
107.136 + if (gcon == null) return null;
107.137 + MethodHandle galloc = new AllocateObject(invoke, allocateClass, gcon);
107.138 + return collectArguments(galloc, newType, 1, null);
107.139 + }
107.140 + }
107.141 + @Override
107.142 + public String toString() {
107.143 + return addTypeString(allocateClass.getSimpleName(), this);
107.144 + }
107.145 + @SuppressWarnings("unchecked")
107.146 + private C allocate() throws InstantiationException {
107.147 + return (C) unsafe.allocateInstance(allocateClass);
107.148 + }
107.149 + private C invoke_V(Object... av) throws Throwable {
107.150 + C obj = allocate();
107.151 + rawConstructor.invokeExact((Object)obj, av);
107.152 + return obj;
107.153 + }
107.154 + private C invoke_L0() throws Throwable {
107.155 + C obj = allocate();
107.156 + rawConstructor.invokeExact((Object)obj);
107.157 + return obj;
107.158 + }
107.159 + private C invoke_L1(Object a0) throws Throwable {
107.160 + C obj = allocate();
107.161 + rawConstructor.invokeExact((Object)obj, a0);
107.162 + return obj;
107.163 + }
107.164 + private C invoke_L2(Object a0, Object a1) throws Throwable {
107.165 + C obj = allocate();
107.166 + rawConstructor.invokeExact((Object)obj, a0, a1);
107.167 + return obj;
107.168 + }
107.169 + private C invoke_L3(Object a0, Object a1, Object a2) throws Throwable {
107.170 + C obj = allocate();
107.171 + rawConstructor.invokeExact((Object)obj, a0, a1, a2);
107.172 + return obj;
107.173 + }
107.174 + private C invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable {
107.175 + C obj = allocate();
107.176 + rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3);
107.177 + return obj;
107.178 + }
107.179 + private C invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable {
107.180 + C obj = allocate();
107.181 + rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3, a4);
107.182 + return obj;
107.183 + }
107.184 + private C invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable {
107.185 + C obj = allocate();
107.186 + rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3, a4, a5);
107.187 + return obj;
107.188 + }
107.189 + private C invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable {
107.190 + C obj = allocate();
107.191 + rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3, a4, a5, a6);
107.192 + return obj;
107.193 + }
107.194 + private C invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable {
107.195 + C obj = allocate();
107.196 + rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3, a4, a5, a6, a7);
107.197 + return obj;
107.198 + }
107.199 + static MethodHandle[] makeInvokes() {
107.200 + ArrayList<MethodHandle> invokes = new ArrayList<MethodHandle>();
107.201 + MethodHandles.Lookup lookup = IMPL_LOOKUP;
107.202 + for (;;) {
107.203 + int nargs = invokes.size();
107.204 + String name = "invoke_L"+nargs;
107.205 + MethodHandle invoke = null;
107.206 + try {
107.207 + invoke = lookup.findVirtual(AllocateObject.class, name, MethodType.genericMethodType(nargs));
107.208 + } catch (ReflectiveOperationException ex) {
107.209 + }
107.210 + if (invoke == null) break;
107.211 + invokes.add(invoke);
107.212 + }
107.213 + assert(invokes.size() == 9); // current number of methods
107.214 + return invokes.toArray(new MethodHandle[0]);
107.215 + };
107.216 + static final MethodHandle[] INVOKES = makeInvokes();
107.217 + // For testing use this:
107.218 + //static final MethodHandle[] INVOKES = Arrays.copyOf(makeInvokes(), 2);
107.219 + static final MethodHandle VARARGS_INVOKE;
107.220 + static {
107.221 + try {
107.222 + VARARGS_INVOKE = IMPL_LOOKUP.findVirtual(AllocateObject.class, "invoke_V", MethodType.genericMethodType(0, true));
107.223 + } catch (ReflectiveOperationException ex) {
107.224 + throw uncaughtException(ex);
107.225 + }
107.226 + }
107.227 + // Corresponding generic constructor types:
107.228 + static final MethodType[] CON_TYPES = new MethodType[INVOKES.length];
107.229 + static {
107.230 + for (int i = 0; i < INVOKES.length; i++)
107.231 + CON_TYPES[i] = makeConType(INVOKES[i]);
107.232 + }
107.233 + static final MethodType VARARGS_CON_TYPE = makeConType(VARARGS_INVOKE);
107.234 + static MethodType makeConType(MethodHandle invoke) {
107.235 + MethodType invType = invoke.type();
107.236 + return invType.changeParameterType(0, Object.class).changeReturnType(void.class);
107.237 + }
107.238 + }
107.239 +
107.240 + static
107.241 + MethodHandle accessField(MemberName member, boolean isSetter,
107.242 + Class<?> lookupClass) {
107.243 + // Use sun. misc.Unsafe to dig up the dirt on the field.
107.244 + MethodHandle mh = new FieldAccessor(member, isSetter);
107.245 + return mh;
107.246 + }
107.247 +
107.248 + static
107.249 + MethodHandle accessArrayElement(Class<?> arrayClass, boolean isSetter) {
107.250 + if (!arrayClass.isArray())
107.251 + throw newIllegalArgumentException("not an array: "+arrayClass);
107.252 + Class<?> elemClass = arrayClass.getComponentType();
107.253 + MethodHandle[] mhs = FieldAccessor.ARRAY_CACHE.get(elemClass);
107.254 + if (mhs == null) {
107.255 + if (!FieldAccessor.doCache(elemClass))
107.256 + return FieldAccessor.ahandle(arrayClass, isSetter);
107.257 + mhs = new MethodHandle[] {
107.258 + FieldAccessor.ahandle(arrayClass, false),
107.259 + FieldAccessor.ahandle(arrayClass, true)
107.260 + };
107.261 + if (mhs[0].type().parameterType(0) == Class.class) {
107.262 + mhs[0] = MethodHandles.insertArguments(mhs[0], 0, elemClass);
107.263 + mhs[1] = MethodHandles.insertArguments(mhs[1], 0, elemClass);
107.264 + }
107.265 + synchronized (FieldAccessor.ARRAY_CACHE) {} // memory barrier
107.266 + FieldAccessor.ARRAY_CACHE.put(elemClass, mhs);
107.267 + }
107.268 + return mhs[isSetter ? 1 : 0];
107.269 + }
107.270 +
107.271 + static final class FieldAccessor<C,V> extends BoundMethodHandle {
107.272 + private static final Unsafe unsafe = Unsafe.getUnsafe();
107.273 + final Object base; // for static refs only
107.274 + final long offset;
107.275 + final String name;
107.276 +
107.277 + FieldAccessor(MemberName field, boolean isSetter) {
107.278 + super(fhandle(field.getDeclaringClass(), field.getFieldType(), isSetter, field.isStatic()));
107.279 + this.offset = (long) field.getVMIndex();
107.280 + this.name = field.getName();
107.281 + this.base = staticBase(field);
107.282 + }
107.283 + @Override
107.284 + public String toString() { return addTypeString(name, this); }
107.285 +
107.286 + int getFieldI(C obj) { return unsafe.getInt(obj, offset); }
107.287 + void setFieldI(C obj, int x) { unsafe.putInt(obj, offset, x); }
107.288 + long getFieldJ(C obj) { return unsafe.getLong(obj, offset); }
107.289 + void setFieldJ(C obj, long x) { unsafe.putLong(obj, offset, x); }
107.290 + float getFieldF(C obj) { return unsafe.getFloat(obj, offset); }
107.291 + void setFieldF(C obj, float x) { unsafe.putFloat(obj, offset, x); }
107.292 + double getFieldD(C obj) { return unsafe.getDouble(obj, offset); }
107.293 + void setFieldD(C obj, double x) { unsafe.putDouble(obj, offset, x); }
107.294 + boolean getFieldZ(C obj) { return unsafe.getBoolean(obj, offset); }
107.295 + void setFieldZ(C obj, boolean x) { unsafe.putBoolean(obj, offset, x); }
107.296 + byte getFieldB(C obj) { return unsafe.getByte(obj, offset); }
107.297 + void setFieldB(C obj, byte x) { unsafe.putByte(obj, offset, x); }
107.298 + short getFieldS(C obj) { return unsafe.getShort(obj, offset); }
107.299 + void setFieldS(C obj, short x) { unsafe.putShort(obj, offset, x); }
107.300 + char getFieldC(C obj) { return unsafe.getChar(obj, offset); }
107.301 + void setFieldC(C obj, char x) { unsafe.putChar(obj, offset, x); }
107.302 + @SuppressWarnings("unchecked")
107.303 + V getFieldL(C obj) { return (V) unsafe.getObject(obj, offset); }
107.304 + @SuppressWarnings("unchecked")
107.305 + void setFieldL(C obj, V x) { unsafe.putObject(obj, offset, x); }
107.306 + // cast (V) is OK here, since we wrap convertArguments around the MH.
107.307 +
107.308 + static Object staticBase(MemberName field) {
107.309 + if (!field.isStatic()) return null;
107.310 + Class c = field.getDeclaringClass();
107.311 + java.lang.reflect.Field f;
107.312 + try {
107.313 + // FIXME: Should not have to create 'f' to get this value.
107.314 + f = c.getDeclaredField(field.getName());
107.315 + return unsafe.staticFieldBase(f);
107.316 + } catch (Exception ee) {
107.317 + throw uncaughtException(ee);
107.318 + }
107.319 + }
107.320 +
107.321 + int getStaticI() { return unsafe.getInt(base, offset); }
107.322 + void setStaticI(int x) { unsafe.putInt(base, offset, x); }
107.323 + long getStaticJ() { return unsafe.getLong(base, offset); }
107.324 + void setStaticJ(long x) { unsafe.putLong(base, offset, x); }
107.325 + float getStaticF() { return unsafe.getFloat(base, offset); }
107.326 + void setStaticF(float x) { unsafe.putFloat(base, offset, x); }
107.327 + double getStaticD() { return unsafe.getDouble(base, offset); }
107.328 + void setStaticD(double x) { unsafe.putDouble(base, offset, x); }
107.329 + boolean getStaticZ() { return unsafe.getBoolean(base, offset); }
107.330 + void setStaticZ(boolean x) { unsafe.putBoolean(base, offset, x); }
107.331 + byte getStaticB() { return unsafe.getByte(base, offset); }
107.332 + void setStaticB(byte x) { unsafe.putByte(base, offset, x); }
107.333 + short getStaticS() { return unsafe.getShort(base, offset); }
107.334 + void setStaticS(short x) { unsafe.putShort(base, offset, x); }
107.335 + char getStaticC() { return unsafe.getChar(base, offset); }
107.336 + void setStaticC(char x) { unsafe.putChar(base, offset, x); }
107.337 + V getStaticL() { return (V) unsafe.getObject(base, offset); }
107.338 + void setStaticL(V x) { unsafe.putObject(base, offset, x); }
107.339 +
107.340 + static String fname(Class<?> vclass, boolean isSetter, boolean isStatic) {
107.341 + String stem;
107.342 + if (!isStatic)
107.343 + stem = (!isSetter ? "getField" : "setField");
107.344 + else
107.345 + stem = (!isSetter ? "getStatic" : "setStatic");
107.346 + return stem + Wrapper.basicTypeChar(vclass);
107.347 + }
107.348 + static MethodType ftype(Class<?> cclass, Class<?> vclass, boolean isSetter, boolean isStatic) {
107.349 + MethodType type;
107.350 + if (!isStatic) {
107.351 + if (!isSetter)
107.352 + return MethodType.methodType(vclass, cclass);
107.353 + else
107.354 + return MethodType.methodType(void.class, cclass, vclass);
107.355 + } else {
107.356 + if (!isSetter)
107.357 + return MethodType.methodType(vclass);
107.358 + else
107.359 + return MethodType.methodType(void.class, vclass);
107.360 + }
107.361 + }
107.362 + static MethodHandle fhandle(Class<?> cclass, Class<?> vclass, boolean isSetter, boolean isStatic) {
107.363 + String name = FieldAccessor.fname(vclass, isSetter, isStatic);
107.364 + if (cclass.isPrimitive()) throw newIllegalArgumentException("primitive "+cclass);
107.365 + Class<?> ecclass = Object.class; //erase this type
107.366 + Class<?> evclass = vclass;
107.367 + if (!evclass.isPrimitive()) evclass = Object.class;
107.368 + MethodType type = FieldAccessor.ftype(ecclass, evclass, isSetter, isStatic);
107.369 + MethodHandle mh;
107.370 + try {
107.371 + mh = IMPL_LOOKUP.findVirtual(FieldAccessor.class, name, type);
107.372 + } catch (ReflectiveOperationException ex) {
107.373 + throw uncaughtException(ex);
107.374 + }
107.375 + if (evclass != vclass || (!isStatic && ecclass != cclass)) {
107.376 + MethodType strongType = FieldAccessor.ftype(cclass, vclass, isSetter, isStatic);
107.377 + strongType = strongType.insertParameterTypes(0, FieldAccessor.class);
107.378 + mh = MethodHandles.convertArguments(mh, strongType);
107.379 + }
107.380 + return mh;
107.381 + }
107.382 +
107.383 + /// Support for array element access
107.384 + static final HashMap<Class<?>, MethodHandle[]> ARRAY_CACHE =
107.385 + new HashMap<Class<?>, MethodHandle[]>();
107.386 + // FIXME: Cache on the classes themselves, not here.
107.387 + static boolean doCache(Class<?> elemClass) {
107.388 + if (elemClass.isPrimitive()) return true;
107.389 + ClassLoader cl = elemClass.getClassLoader();
107.390 + return cl == null || cl == ClassLoader.getSystemClassLoader();
107.391 + }
107.392 + static int getElementI(int[] a, int i) { return a[i]; }
107.393 + static void setElementI(int[] a, int i, int x) { a[i] = x; }
107.394 + static long getElementJ(long[] a, int i) { return a[i]; }
107.395 + static void setElementJ(long[] a, int i, long x) { a[i] = x; }
107.396 + static float getElementF(float[] a, int i) { return a[i]; }
107.397 + static void setElementF(float[] a, int i, float x) { a[i] = x; }
107.398 + static double getElementD(double[] a, int i) { return a[i]; }
107.399 + static void setElementD(double[] a, int i, double x) { a[i] = x; }
107.400 + static boolean getElementZ(boolean[] a, int i) { return a[i]; }
107.401 + static void setElementZ(boolean[] a, int i, boolean x) { a[i] = x; }
107.402 + static byte getElementB(byte[] a, int i) { return a[i]; }
107.403 + static void setElementB(byte[] a, int i, byte x) { a[i] = x; }
107.404 + static short getElementS(short[] a, int i) { return a[i]; }
107.405 + static void setElementS(short[] a, int i, short x) { a[i] = x; }
107.406 + static char getElementC(char[] a, int i) { return a[i]; }
107.407 + static void setElementC(char[] a, int i, char x) { a[i] = x; }
107.408 + static Object getElementL(Object[] a, int i) { return a[i]; }
107.409 + static void setElementL(Object[] a, int i, Object x) { a[i] = x; }
107.410 + static <V> V getElementL(Class<V[]> aclass, V[] a, int i) { return aclass.cast(a)[i]; }
107.411 + static <V> void setElementL(Class<V[]> aclass, V[] a, int i, V x) { aclass.cast(a)[i] = x; }
107.412 +
107.413 + static String aname(Class<?> aclass, boolean isSetter) {
107.414 + Class<?> vclass = aclass.getComponentType();
107.415 + if (vclass == null) throw new IllegalArgumentException();
107.416 + return (!isSetter ? "getElement" : "setElement") + Wrapper.basicTypeChar(vclass);
107.417 + }
107.418 + static MethodType atype(Class<?> aclass, boolean isSetter) {
107.419 + Class<?> vclass = aclass.getComponentType();
107.420 + if (!isSetter)
107.421 + return MethodType.methodType(vclass, aclass, int.class);
107.422 + else
107.423 + return MethodType.methodType(void.class, aclass, int.class, vclass);
107.424 + }
107.425 + static MethodHandle ahandle(Class<?> aclass, boolean isSetter) {
107.426 + Class<?> vclass = aclass.getComponentType();
107.427 + String name = FieldAccessor.aname(aclass, isSetter);
107.428 + Class<?> caclass = null;
107.429 + if (!vclass.isPrimitive() && vclass != Object.class) {
107.430 + caclass = aclass;
107.431 + aclass = Object[].class;
107.432 + vclass = Object.class;
107.433 + }
107.434 + MethodType type = FieldAccessor.atype(aclass, isSetter);
107.435 + if (caclass != null)
107.436 + type = type.insertParameterTypes(0, Class.class);
107.437 + MethodHandle mh;
107.438 + try {
107.439 + mh = IMPL_LOOKUP.findStatic(FieldAccessor.class, name, type);
107.440 + } catch (ReflectiveOperationException ex) {
107.441 + throw uncaughtException(ex);
107.442 + }
107.443 + if (caclass != null) {
107.444 + MethodType strongType = FieldAccessor.atype(caclass, isSetter);
107.445 + mh = MethodHandles.insertArguments(mh, 0, caclass);
107.446 + mh = MethodHandles.convertArguments(mh, strongType);
107.447 + }
107.448 + return mh;
107.449 + }
107.450 + }
107.451 +
107.452 + /** Bind a predetermined first argument to the given direct method handle.
107.453 + * Callable only from MethodHandles.
107.454 + * @param token Proof that the caller has access to this package.
107.455 + * @param target Any direct method handle.
107.456 + * @param receiver Receiver (or first static method argument) to pre-bind.
107.457 + * @return a BoundMethodHandle for the given DirectMethodHandle, or null if it does not exist
107.458 + */
107.459 + static
107.460 + MethodHandle bindReceiver(MethodHandle target, Object receiver) {
107.461 + if (target instanceof AdapterMethodHandle &&
107.462 + ((AdapterMethodHandle)target).conversionOp() == MethodHandleNatives.Constants.OP_RETYPE_ONLY
107.463 + ) {
107.464 + Object info = MethodHandleNatives.getTargetInfo(target);
107.465 + if (info instanceof DirectMethodHandle) {
107.466 + DirectMethodHandle dmh = (DirectMethodHandle) info;
107.467 + if (receiver == null ||
107.468 + dmh.type().parameterType(0).isAssignableFrom(receiver.getClass())) {
107.469 + MethodHandle bmh = new BoundMethodHandle(dmh, receiver, 0);
107.470 + MethodType newType = target.type().dropParameterTypes(0, 1);
107.471 + return convertArguments(bmh, newType, bmh.type(), null);
107.472 + }
107.473 + }
107.474 + }
107.475 + if (target instanceof DirectMethodHandle)
107.476 + return new BoundMethodHandle((DirectMethodHandle)target, receiver, 0);
107.477 + return null; // let caller try something else
107.478 + }
107.479 +
107.480 + /** Bind a predetermined argument to the given arbitrary method handle.
107.481 + * Callable only from MethodHandles.
107.482 + * @param token Proof that the caller has access to this package.
107.483 + * @param target Any method handle.
107.484 + * @param receiver Argument (which can be a boxed primitive) to pre-bind.
107.485 + * @return a suitable BoundMethodHandle
107.486 + */
107.487 + static
107.488 + MethodHandle bindArgument(MethodHandle target, int argnum, Object receiver) {
107.489 + return new BoundMethodHandle(target, receiver, argnum);
107.490 + }
107.491 +
107.492 + static MethodHandle convertArguments(MethodHandle target,
107.493 + MethodType newType,
107.494 + MethodType oldType,
107.495 + int[] permutationOrNull) {
107.496 + assert(oldType.parameterCount() == target.type().parameterCount());
107.497 + if (permutationOrNull != null) {
107.498 + int outargs = oldType.parameterCount(), inargs = newType.parameterCount();
107.499 + if (permutationOrNull.length != outargs)
107.500 + throw newIllegalArgumentException("wrong number of arguments in permutation");
107.501 + // Make the individual outgoing argument types match up first.
107.502 + Class<?>[] callTypeArgs = new Class<?>[outargs];
107.503 + for (int i = 0; i < outargs; i++)
107.504 + callTypeArgs[i] = newType.parameterType(permutationOrNull[i]);
107.505 + MethodType callType = MethodType.methodType(oldType.returnType(), callTypeArgs);
107.506 + target = convertArguments(target, callType, oldType, null);
107.507 + assert(target != null);
107.508 + oldType = target.type();
107.509 + List<Integer> goal = new ArrayList<Integer>(); // i*TOKEN
107.510 + List<Integer> state = new ArrayList<Integer>(); // i*TOKEN
107.511 + List<Integer> drops = new ArrayList<Integer>(); // not tokens
107.512 + List<Integer> dups = new ArrayList<Integer>(); // not tokens
107.513 + final int TOKEN = 10; // to mark items which are symbolic only
107.514 + // state represents the argument values coming into target
107.515 + for (int i = 0; i < outargs; i++) {
107.516 + state.add(permutationOrNull[i] * TOKEN);
107.517 + }
107.518 + // goal represents the desired state
107.519 + for (int i = 0; i < inargs; i++) {
107.520 + if (state.contains(i * TOKEN)) {
107.521 + goal.add(i * TOKEN);
107.522 + } else {
107.523 + // adapter must initially drop all unused arguments
107.524 + drops.add(i);
107.525 + }
107.526 + }
107.527 + // detect duplications
107.528 + while (state.size() > goal.size()) {
107.529 + for (int i2 = 0; i2 < state.size(); i2++) {
107.530 + int arg1 = state.get(i2);
107.531 + int i1 = state.indexOf(arg1);
107.532 + if (i1 != i2) {
107.533 + // found duplicate occurrence at i2
107.534 + int arg2 = (inargs++) * TOKEN;
107.535 + state.set(i2, arg2);
107.536 + dups.add(goal.indexOf(arg1));
107.537 + goal.add(arg2);
107.538 + }
107.539 + }
107.540 + }
107.541 + assert(state.size() == goal.size());
107.542 + int size = goal.size();
107.543 + while (!state.equals(goal)) {
107.544 + // Look for a maximal sequence of adjacent misplaced arguments,
107.545 + // and try to rotate them into place.
107.546 + int bestRotArg = -10 * TOKEN, bestRotLen = 0;
107.547 + int thisRotArg = -10 * TOKEN, thisRotLen = 0;
107.548 + for (int i = 0; i < size; i++) {
107.549 + int arg = state.get(i);
107.550 + // Does this argument match the current run?
107.551 + if (arg == thisRotArg + TOKEN) {
107.552 + thisRotArg = arg;
107.553 + thisRotLen += 1;
107.554 + if (bestRotLen < thisRotLen) {
107.555 + bestRotLen = thisRotLen;
107.556 + bestRotArg = thisRotArg;
107.557 + }
107.558 + } else {
107.559 + // The old sequence (if any) stops here.
107.560 + thisRotLen = 0;
107.561 + thisRotArg = -10 * TOKEN;
107.562 + // But maybe a new one starts here also.
107.563 + int wantArg = goal.get(i);
107.564 + final int MAX_ARG_ROTATION = AdapterMethodHandle.MAX_ARG_ROTATION;
107.565 + if (arg != wantArg &&
107.566 + arg >= wantArg - TOKEN * MAX_ARG_ROTATION &&
107.567 + arg <= wantArg + TOKEN * MAX_ARG_ROTATION) {
107.568 + thisRotArg = arg;
107.569 + thisRotLen = 1;
107.570 + }
107.571 + }
107.572 + }
107.573 + if (bestRotLen >= 2) {
107.574 + // Do a rotation if it can improve argument positioning
107.575 + // by at least 2 arguments. This is not always optimal,
107.576 + // but it seems to catch common cases.
107.577 + int dstEnd = state.indexOf(bestRotArg);
107.578 + int srcEnd = goal.indexOf(bestRotArg);
107.579 + int rotBy = dstEnd - srcEnd;
107.580 + int dstBeg = dstEnd - (bestRotLen - 1);
107.581 + int srcBeg = srcEnd - (bestRotLen - 1);
107.582 + assert((dstEnd | dstBeg | srcEnd | srcBeg) >= 0); // no negs
107.583 + // Make a span which covers both source and destination.
107.584 + int rotBeg = Math.min(dstBeg, srcBeg);
107.585 + int rotEnd = Math.max(dstEnd, srcEnd);
107.586 + int score = 0;
107.587 + for (int i = rotBeg; i <= rotEnd; i++) {
107.588 + if ((int)state.get(i) != (int)goal.get(i))
107.589 + score += 1;
107.590 + }
107.591 + List<Integer> rotSpan = state.subList(rotBeg, rotEnd+1);
107.592 + Collections.rotate(rotSpan, -rotBy); // reverse direction
107.593 + for (int i = rotBeg; i <= rotEnd; i++) {
107.594 + if ((int)state.get(i) != (int)goal.get(i))
107.595 + score -= 1;
107.596 + }
107.597 + if (score >= 2) {
107.598 + // Improved at least two argument positions. Do it.
107.599 + List<Class<?>> ptypes = Arrays.asList(oldType.parameterArray());
107.600 + Collections.rotate(ptypes.subList(rotBeg, rotEnd+1), -rotBy);
107.601 + MethodType rotType = MethodType.methodType(oldType.returnType(), ptypes);
107.602 + MethodHandle nextTarget
107.603 + = AdapterMethodHandle.makeRotateArguments(rotType, target,
107.604 + rotBeg, rotSpan.size(), rotBy);
107.605 + if (nextTarget != null) {
107.606 + //System.out.println("Rot: "+rotSpan+" by "+rotBy);
107.607 + target = nextTarget;
107.608 + oldType = rotType;
107.609 + continue;
107.610 + }
107.611 + }
107.612 + // Else de-rotate, and drop through to the swap-fest.
107.613 + Collections.rotate(rotSpan, rotBy);
107.614 + }
107.615 +
107.616 + // Now swap like the wind!
107.617 + List<Class<?>> ptypes = Arrays.asList(oldType.parameterArray());
107.618 + for (int i = 0; i < size; i++) {
107.619 + // What argument do I want here?
107.620 + int arg = goal.get(i);
107.621 + if (arg != state.get(i)) {
107.622 + // Where is it now?
107.623 + int j = state.indexOf(arg);
107.624 + Collections.swap(ptypes, i, j);
107.625 + MethodType swapType = MethodType.methodType(oldType.returnType(), ptypes);
107.626 + target = AdapterMethodHandle.makeSwapArguments(swapType, target, i, j);
107.627 + if (target == null) throw newIllegalArgumentException("cannot swap");
107.628 + assert(target.type() == swapType);
107.629 + oldType = swapType;
107.630 + Collections.swap(state, i, j);
107.631 + }
107.632 + }
107.633 + // One pass of swapping must finish the job.
107.634 + assert(state.equals(goal));
107.635 + }
107.636 + while (!dups.isEmpty()) {
107.637 + // Grab a contiguous trailing sequence of dups.
107.638 + int grab = dups.size() - 1;
107.639 + int dupArgPos = dups.get(grab), dupArgCount = 1;
107.640 + while (grab - 1 >= 0) {
107.641 + int dup0 = dups.get(grab - 1);
107.642 + if (dup0 != dupArgPos - 1) break;
107.643 + dupArgPos -= 1;
107.644 + dupArgCount += 1;
107.645 + grab -= 1;
107.646 + }
107.647 + //if (dupArgCount > 1) System.out.println("Dup: "+dups.subList(grab, dups.size()));
107.648 + dups.subList(grab, dups.size()).clear();
107.649 + // In the new target type drop that many args from the tail:
107.650 + List<Class<?>> ptypes = oldType.parameterList();
107.651 + ptypes = ptypes.subList(0, ptypes.size() - dupArgCount);
107.652 + MethodType dupType = MethodType.methodType(oldType.returnType(), ptypes);
107.653 + target = AdapterMethodHandle.makeDupArguments(dupType, target, dupArgPos, dupArgCount);
107.654 + if (target == null)
107.655 + throw newIllegalArgumentException("cannot dup");
107.656 + oldType = target.type();
107.657 + }
107.658 + while (!drops.isEmpty()) {
107.659 + // Grab a contiguous initial sequence of drops.
107.660 + int dropArgPos = drops.get(0), dropArgCount = 1;
107.661 + while (dropArgCount < drops.size()) {
107.662 + int drop1 = drops.get(dropArgCount);
107.663 + if (drop1 != dropArgPos + dropArgCount) break;
107.664 + dropArgCount += 1;
107.665 + }
107.666 + //if (dropArgCount > 1) System.out.println("Drop: "+drops.subList(0, dropArgCount));
107.667 + drops.subList(0, dropArgCount).clear();
107.668 + List<Class<?>> dropTypes = newType.parameterList()
107.669 + .subList(dropArgPos, dropArgPos + dropArgCount);
107.670 + MethodType dropType = oldType.insertParameterTypes(dropArgPos, dropTypes);
107.671 + target = AdapterMethodHandle.makeDropArguments(dropType, target, dropArgPos, dropArgCount);
107.672 + if (target == null) throw newIllegalArgumentException("cannot drop");
107.673 + oldType = target.type();
107.674 + }
107.675 + }
107.676 + if (newType == oldType)
107.677 + return target;
107.678 + if (oldType.parameterCount() != newType.parameterCount())
107.679 + throw newIllegalArgumentException("mismatched parameter count");
107.680 + MethodHandle res = AdapterMethodHandle.makePairwiseConvert(newType, target);
107.681 + if (res != null)
107.682 + return res;
107.683 + int argc = oldType.parameterCount();
107.684 + // The JVM can't do it directly, so fill in the gap with a Java adapter.
107.685 + // TO DO: figure out what to put here from case-by-case experience
107.686 + // Use a heavier method: Convert all the arguments to Object,
107.687 + // then back to the desired types. We might have to use Java-based
107.688 + // method handles to do this.
107.689 + MethodType objType = MethodType.genericMethodType(argc);
107.690 + MethodHandle objTarget = AdapterMethodHandle.makePairwiseConvert(objType, target);
107.691 + if (objTarget == null)
107.692 + objTarget = FromGeneric.make(target);
107.693 + res = AdapterMethodHandle.makePairwiseConvert(newType, objTarget);
107.694 + if (res != null)
107.695 + return res;
107.696 + return ToGeneric.make(newType, objTarget);
107.697 + }
107.698 +
107.699 + static MethodHandle spreadArguments(MethodHandle target,
107.700 + MethodType newType,
107.701 + int spreadArg) {
107.702 + // TO DO: maybe allow the restarg to be Object and implicitly cast to Object[]
107.703 + MethodType oldType = target.type();
107.704 + // spread the last argument of newType to oldType
107.705 + int spreadCount = oldType.parameterCount() - spreadArg;
107.706 + Class<Object[]> spreadArgType = Object[].class;
107.707 + MethodHandle res = AdapterMethodHandle.makeSpreadArguments(newType, target, spreadArgType, spreadArg, spreadCount);
107.708 + if (res != null)
107.709 + return res;
107.710 + // try an intermediate adapter
107.711 + Class<?> spreadType = null;
107.712 + if (spreadArg < 0 || spreadArg >= newType.parameterCount()
107.713 + || !VerifyType.isSpreadArgType(spreadType = newType.parameterType(spreadArg)))
107.714 + throw newIllegalArgumentException("no restarg in "+newType);
107.715 + Class<?>[] ptypes = oldType.parameterArray();
107.716 + for (int i = 0; i < spreadCount; i++)
107.717 + ptypes[spreadArg + i] = VerifyType.spreadArgElementType(spreadType, i);
107.718 + MethodType midType = MethodType.methodType(newType.returnType(), ptypes);
107.719 + // after spreading, some arguments may need further conversion
107.720 + MethodHandle target2 = convertArguments(target, midType, oldType, null);
107.721 + if (target2 == null)
107.722 + throw new UnsupportedOperationException("NYI: convert "+midType+" =calls=> "+oldType);
107.723 + res = AdapterMethodHandle.makeSpreadArguments(newType, target2, spreadArgType, spreadArg, spreadCount);
107.724 + if (res != null)
107.725 + return res;
107.726 + res = SpreadGeneric.make(target2, spreadCount);
107.727 + if (res != null)
107.728 + res = convertArguments(res, newType, res.type(), null);
107.729 + return res;
107.730 + }
107.731 +
107.732 + static MethodHandle collectArguments(MethodHandle target,
107.733 + MethodType newType,
107.734 + int collectArg,
107.735 + MethodHandle collector) {
107.736 + MethodType oldType = target.type(); // (a...,c)=>r
107.737 + if (collector == null) {
107.738 + int numCollect = newType.parameterCount() - oldType.parameterCount() + 1;
107.739 + collector = ValueConversions.varargsArray(numCollect);
107.740 + }
107.741 + // newType // (a..., b...)=>r
107.742 + MethodType colType = collector.type(); // (b...)=>c
107.743 + // oldType // (a..., b...)=>r
107.744 + assert(newType.parameterCount() == collectArg + colType.parameterCount());
107.745 + assert(oldType.parameterCount() == collectArg + 1);
107.746 + MethodHandle gtarget = convertArguments(target, oldType.generic(), oldType, null);
107.747 + MethodHandle gcollector = convertArguments(collector, colType.generic(), colType, null);
107.748 + if (gtarget == null || gcollector == null) return null;
107.749 + MethodHandle gresult = FilterGeneric.makeArgumentCollector(gcollector, gtarget);
107.750 + MethodHandle result = convertArguments(gresult, newType, gresult.type(), null);
107.751 + return result;
107.752 + }
107.753 +
107.754 + static MethodHandle filterArgument(MethodHandle target,
107.755 + int pos,
107.756 + MethodHandle filter) {
107.757 + MethodType ttype = target.type(), gttype = ttype.generic();
107.758 + if (ttype != gttype) {
107.759 + target = convertArguments(target, gttype, ttype, null);
107.760 + ttype = gttype;
107.761 + }
107.762 + MethodType ftype = filter.type(), gftype = ftype.generic();
107.763 + if (ftype.parameterCount() != 1)
107.764 + throw new InternalError();
107.765 + if (ftype != gftype) {
107.766 + filter = convertArguments(filter, gftype, ftype, null);
107.767 + ftype = gftype;
107.768 + }
107.769 + if (ftype == ttype) {
107.770 + // simple unary case
107.771 + return FilterOneArgument.make(filter, target);
107.772 + }
107.773 + return FilterGeneric.makeArgumentFilter(pos, filter, target);
107.774 + }
107.775 +
107.776 + static MethodHandle foldArguments(MethodHandle target,
107.777 + MethodType newType,
107.778 + MethodHandle combiner) {
107.779 + MethodType oldType = target.type();
107.780 + MethodType ctype = combiner.type();
107.781 + MethodHandle gtarget = convertArguments(target, oldType.generic(), oldType, null);
107.782 + MethodHandle gcombiner = convertArguments(combiner, ctype.generic(), ctype, null);
107.783 + if (gtarget == null || gcombiner == null) return null;
107.784 + MethodHandle gresult = FilterGeneric.makeArgumentFolder(gcombiner, gtarget);
107.785 + MethodHandle result = convertArguments(gresult, newType, gresult.type(), null);
107.786 + return result;
107.787 + }
107.788 +
107.789 + static
107.790 + MethodHandle dropArguments(MethodHandle target,
107.791 + MethodType newType, int argnum) {
107.792 + int drops = newType.parameterCount() - target.type().parameterCount();
107.793 + MethodHandle res = AdapterMethodHandle.makeDropArguments(newType, target, argnum, drops);
107.794 + if (res != null)
107.795 + return res;
107.796 + throw new UnsupportedOperationException("NYI");
107.797 + }
107.798 +
107.799 + private static class GuardWithTest extends BoundMethodHandle {
107.800 + private final MethodHandle test, target, fallback;
107.801 + private GuardWithTest(MethodHandle invoker,
107.802 + MethodHandle test, MethodHandle target, MethodHandle fallback) {
107.803 + super(invoker);
107.804 + this.test = test;
107.805 + this.target = target;
107.806 + this.fallback = fallback;
107.807 + }
107.808 + static MethodHandle make(MethodHandle test, MethodHandle target, MethodHandle fallback) {
107.809 + MethodType type = target.type();
107.810 + int nargs = type.parameterCount();
107.811 + if (nargs < INVOKES.length) {
107.812 + MethodHandle invoke = INVOKES[nargs];
107.813 + MethodType gtype = type.generic();
107.814 + assert(invoke.type().dropParameterTypes(0,1) == gtype);
107.815 + MethodHandle gtest = convertArguments(test, gtype.changeReturnType(boolean.class), test.type(), null);
107.816 + MethodHandle gtarget = convertArguments(target, gtype, type, null);
107.817 + MethodHandle gfallback = convertArguments(fallback, gtype, type, null);
107.818 + if (gtest == null || gtarget == null || gfallback == null) return null;
107.819 + MethodHandle gguard = new GuardWithTest(invoke, gtest, gtarget, gfallback);
107.820 + return convertArguments(gguard, type, gtype, null);
107.821 + } else {
107.822 + MethodHandle invoke = VARARGS_INVOKE;
107.823 + MethodType gtype = MethodType.genericMethodType(1);
107.824 + assert(invoke.type().dropParameterTypes(0,1) == gtype);
107.825 + MethodHandle gtest = spreadArguments(test, gtype.changeReturnType(boolean.class), 0);
107.826 + MethodHandle gtarget = spreadArguments(target, gtype, 0);
107.827 + MethodHandle gfallback = spreadArguments(fallback, gtype, 0);
107.828 + MethodHandle gguard = new GuardWithTest(invoke, gtest, gtarget, gfallback);
107.829 + if (gtest == null || gtarget == null || gfallback == null) return null;
107.830 + return collectArguments(gguard, type, 0, null);
107.831 + }
107.832 + }
107.833 + @Override
107.834 + public String toString() {
107.835 + return addTypeString(target, this);
107.836 + }
107.837 + private Object invoke_V(Object... av) throws Throwable {
107.838 + if ((boolean) test.invokeExact(av))
107.839 + return target.invokeExact(av);
107.840 + return fallback.invokeExact(av);
107.841 + }
107.842 + private Object invoke_L0() throws Throwable {
107.843 + if ((boolean) test.invokeExact())
107.844 + return target.invokeExact();
107.845 + return fallback.invokeExact();
107.846 + }
107.847 + private Object invoke_L1(Object a0) throws Throwable {
107.848 + if ((boolean) test.invokeExact(a0))
107.849 + return target.invokeExact(a0);
107.850 + return fallback.invokeExact(a0);
107.851 + }
107.852 + private Object invoke_L2(Object a0, Object a1) throws Throwable {
107.853 + if ((boolean) test.invokeExact(a0, a1))
107.854 + return target.invokeExact(a0, a1);
107.855 + return fallback.invokeExact(a0, a1);
107.856 + }
107.857 + private Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable {
107.858 + if ((boolean) test.invokeExact(a0, a1, a2))
107.859 + return target.invokeExact(a0, a1, a2);
107.860 + return fallback.invokeExact(a0, a1, a2);
107.861 + }
107.862 + private Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable {
107.863 + if ((boolean) test.invokeExact(a0, a1, a2, a3))
107.864 + return target.invokeExact(a0, a1, a2, a3);
107.865 + return fallback.invokeExact(a0, a1, a2, a3);
107.866 + }
107.867 + private Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable {
107.868 + if ((boolean) test.invokeExact(a0, a1, a2, a3, a4))
107.869 + return target.invokeExact(a0, a1, a2, a3, a4);
107.870 + return fallback.invokeExact(a0, a1, a2, a3, a4);
107.871 + }
107.872 + private Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable {
107.873 + if ((boolean) test.invokeExact(a0, a1, a2, a3, a4, a5))
107.874 + return target.invokeExact(a0, a1, a2, a3, a4, a5);
107.875 + return fallback.invokeExact(a0, a1, a2, a3, a4, a5);
107.876 + }
107.877 + private Object invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable {
107.878 + if ((boolean) test.invokeExact(a0, a1, a2, a3, a4, a5, a6))
107.879 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6);
107.880 + return fallback.invokeExact(a0, a1, a2, a3, a4, a5, a6);
107.881 + }
107.882 + private Object invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable {
107.883 + if ((boolean) test.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7))
107.884 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7);
107.885 + return fallback.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7);
107.886 + }
107.887 + static MethodHandle[] makeInvokes() {
107.888 + ArrayList<MethodHandle> invokes = new ArrayList<MethodHandle>();
107.889 + MethodHandles.Lookup lookup = IMPL_LOOKUP;
107.890 + for (;;) {
107.891 + int nargs = invokes.size();
107.892 + String name = "invoke_L"+nargs;
107.893 + MethodHandle invoke = null;
107.894 + try {
107.895 + invoke = lookup.findVirtual(GuardWithTest.class, name, MethodType.genericMethodType(nargs));
107.896 + } catch (ReflectiveOperationException ex) {
107.897 + }
107.898 + if (invoke == null) break;
107.899 + invokes.add(invoke);
107.900 + }
107.901 + assert(invokes.size() == 9); // current number of methods
107.902 + return invokes.toArray(new MethodHandle[0]);
107.903 + };
107.904 + static final MethodHandle[] INVOKES = makeInvokes();
107.905 + // For testing use this:
107.906 + //static final MethodHandle[] INVOKES = Arrays.copyOf(makeInvokes(), 2);
107.907 + static final MethodHandle VARARGS_INVOKE;
107.908 + static {
107.909 + try {
107.910 + VARARGS_INVOKE = IMPL_LOOKUP.findVirtual(GuardWithTest.class, "invoke_V", MethodType.genericMethodType(0, true));
107.911 + } catch (ReflectiveOperationException ex) {
107.912 + throw uncaughtException(ex);
107.913 + }
107.914 + }
107.915 + }
107.916 +
107.917 + static
107.918 + MethodHandle makeGuardWithTest(MethodHandle test,
107.919 + MethodHandle target,
107.920 + MethodHandle fallback) {
107.921 + return GuardWithTest.make(test, target, fallback);
107.922 + }
107.923 +
107.924 + private static class GuardWithCatch extends BoundMethodHandle {
107.925 + private final MethodHandle target;
107.926 + private final Class<? extends Throwable> exType;
107.927 + private final MethodHandle catcher;
107.928 + GuardWithCatch(MethodHandle target, Class<? extends Throwable> exType, MethodHandle catcher) {
107.929 + this(INVOKES[target.type().parameterCount()], target, exType, catcher);
107.930 + }
107.931 + GuardWithCatch(MethodHandle invoker,
107.932 + MethodHandle target, Class<? extends Throwable> exType, MethodHandle catcher) {
107.933 + super(invoker);
107.934 + this.target = target;
107.935 + this.exType = exType;
107.936 + this.catcher = catcher;
107.937 + }
107.938 + @Override
107.939 + public String toString() {
107.940 + return addTypeString(target, this);
107.941 + }
107.942 + private Object invoke_V(Object... av) throws Throwable {
107.943 + try {
107.944 + return target.invokeExact(av);
107.945 + } catch (Throwable t) {
107.946 + if (!exType.isInstance(t)) throw t;
107.947 + return catcher.invokeExact(t, av);
107.948 + }
107.949 + }
107.950 + private Object invoke_L0() throws Throwable {
107.951 + try {
107.952 + return target.invokeExact();
107.953 + } catch (Throwable t) {
107.954 + if (!exType.isInstance(t)) throw t;
107.955 + return catcher.invokeExact(t);
107.956 + }
107.957 + }
107.958 + private Object invoke_L1(Object a0) throws Throwable {
107.959 + try {
107.960 + return target.invokeExact(a0);
107.961 + } catch (Throwable t) {
107.962 + if (!exType.isInstance(t)) throw t;
107.963 + return catcher.invokeExact(t, a0);
107.964 + }
107.965 + }
107.966 + private Object invoke_L2(Object a0, Object a1) throws Throwable {
107.967 + try {
107.968 + return target.invokeExact(a0, a1);
107.969 + } catch (Throwable t) {
107.970 + if (!exType.isInstance(t)) throw t;
107.971 + return catcher.invokeExact(t, a0, a1);
107.972 + }
107.973 + }
107.974 + private Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable {
107.975 + try {
107.976 + return target.invokeExact(a0, a1, a2);
107.977 + } catch (Throwable t) {
107.978 + if (!exType.isInstance(t)) throw t;
107.979 + return catcher.invokeExact(t, a0, a1, a2);
107.980 + }
107.981 + }
107.982 + private Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable {
107.983 + try {
107.984 + return target.invokeExact(a0, a1, a2, a3);
107.985 + } catch (Throwable t) {
107.986 + if (!exType.isInstance(t)) throw t;
107.987 + return catcher.invokeExact(t, a0, a1, a2, a3);
107.988 + }
107.989 + }
107.990 + private Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable {
107.991 + try {
107.992 + return target.invokeExact(a0, a1, a2, a3, a4);
107.993 + } catch (Throwable t) {
107.994 + if (!exType.isInstance(t)) throw t;
107.995 + return catcher.invokeExact(t, a0, a1, a2, a3, a4);
107.996 + }
107.997 + }
107.998 + private Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable {
107.999 + try {
107.1000 + return target.invokeExact(a0, a1, a2, a3, a4, a5);
107.1001 + } catch (Throwable t) {
107.1002 + if (!exType.isInstance(t)) throw t;
107.1003 + return catcher.invokeExact(t, a0, a1, a2, a3, a4, a5);
107.1004 + }
107.1005 + }
107.1006 + private Object invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable {
107.1007 + try {
107.1008 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6);
107.1009 + } catch (Throwable t) {
107.1010 + if (!exType.isInstance(t)) throw t;
107.1011 + return catcher.invokeExact(t, a0, a1, a2, a3, a4, a5, a6);
107.1012 + }
107.1013 + }
107.1014 + private Object invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable {
107.1015 + try {
107.1016 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7);
107.1017 + } catch (Throwable t) {
107.1018 + if (!exType.isInstance(t)) throw t;
107.1019 + return catcher.invokeExact(t, a0, a1, a2, a3, a4, a5, a6, a7);
107.1020 + }
107.1021 + }
107.1022 + static MethodHandle[] makeInvokes() {
107.1023 + ArrayList<MethodHandle> invokes = new ArrayList<MethodHandle>();
107.1024 + MethodHandles.Lookup lookup = IMPL_LOOKUP;
107.1025 + for (;;) {
107.1026 + int nargs = invokes.size();
107.1027 + String name = "invoke_L"+nargs;
107.1028 + MethodHandle invoke = null;
107.1029 + try {
107.1030 + invoke = lookup.findVirtual(GuardWithCatch.class, name, MethodType.genericMethodType(nargs));
107.1031 + } catch (ReflectiveOperationException ex) {
107.1032 + }
107.1033 + if (invoke == null) break;
107.1034 + invokes.add(invoke);
107.1035 + }
107.1036 + assert(invokes.size() == 9); // current number of methods
107.1037 + return invokes.toArray(new MethodHandle[0]);
107.1038 + };
107.1039 + static final MethodHandle[] INVOKES = makeInvokes();
107.1040 + // For testing use this:
107.1041 + //static final MethodHandle[] INVOKES = Arrays.copyOf(makeInvokes(), 2);
107.1042 + static final MethodHandle VARARGS_INVOKE;
107.1043 + static {
107.1044 + try {
107.1045 + VARARGS_INVOKE = IMPL_LOOKUP.findVirtual(GuardWithCatch.class, "invoke_V", MethodType.genericMethodType(0, true));
107.1046 + } catch (ReflectiveOperationException ex) {
107.1047 + throw uncaughtException(ex);
107.1048 + }
107.1049 + }
107.1050 + }
107.1051 +
107.1052 +
107.1053 + static
107.1054 + MethodHandle makeGuardWithCatch(MethodHandle target,
107.1055 + Class<? extends Throwable> exType,
107.1056 + MethodHandle catcher) {
107.1057 + MethodType type = target.type();
107.1058 + MethodType ctype = catcher.type();
107.1059 + int nargs = type.parameterCount();
107.1060 + if (nargs < GuardWithCatch.INVOKES.length) {
107.1061 + MethodType gtype = type.generic();
107.1062 + MethodType gcatchType = gtype.insertParameterTypes(0, Throwable.class);
107.1063 + MethodHandle gtarget = convertArguments(target, gtype, type, null);
107.1064 + MethodHandle gcatcher = convertArguments(catcher, gcatchType, ctype, null);
107.1065 + MethodHandle gguard = new GuardWithCatch(gtarget, exType, gcatcher);
107.1066 + if (gtarget == null || gcatcher == null || gguard == null) return null;
107.1067 + return convertArguments(gguard, type, gtype, null);
107.1068 + } else {
107.1069 + MethodType gtype = MethodType.genericMethodType(0, true);
107.1070 + MethodType gcatchType = gtype.insertParameterTypes(0, Throwable.class);
107.1071 + MethodHandle gtarget = spreadArguments(target, gtype, 0);
107.1072 + MethodHandle gcatcher = spreadArguments(catcher, gcatchType, 1);
107.1073 + MethodHandle gguard = new GuardWithCatch(GuardWithCatch.VARARGS_INVOKE, gtarget, exType, gcatcher);
107.1074 + if (gtarget == null || gcatcher == null || gguard == null) return null;
107.1075 + return collectArguments(gguard, type, 0, null);
107.1076 + }
107.1077 + }
107.1078 +
107.1079 + static
107.1080 + MethodHandle throwException(MethodType type) {
107.1081 + return AdapterMethodHandle.makeRetypeRaw(type, throwException());
107.1082 + }
107.1083 +
107.1084 + static MethodHandle THROW_EXCEPTION;
107.1085 + static MethodHandle throwException() {
107.1086 + if (THROW_EXCEPTION != null) return THROW_EXCEPTION;
107.1087 + try {
107.1088 + THROW_EXCEPTION
107.1089 + = IMPL_LOOKUP.findStatic(MethodHandleImpl.class, "throwException",
107.1090 + MethodType.methodType(Empty.class, Throwable.class));
107.1091 + } catch (ReflectiveOperationException ex) {
107.1092 + throw new RuntimeException(ex);
107.1093 + }
107.1094 + return THROW_EXCEPTION;
107.1095 + }
107.1096 + static <T extends Throwable> Empty throwException(T t) throws T { throw t; }
107.1097 +
107.1098 + // Linkage support:
107.1099 + static void registerBootstrap(Class<?> callerClass, MethodHandle bootstrapMethod) {
107.1100 + MethodHandleNatives.registerBootstrap(callerClass, bootstrapMethod);
107.1101 + }
107.1102 + static MethodHandle getBootstrap(Class<?> callerClass) {
107.1103 + return MethodHandleNatives.getBootstrap(callerClass);
107.1104 + }
107.1105 +
107.1106 + static MethodHandle asVarargsCollector(MethodHandle target, Class<?> arrayType) {
107.1107 + return AdapterMethodHandle.makeVarargsCollector(target, arrayType);
107.1108 + }
107.1109 +}
108.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
108.2 +++ b/src/share/classes/java/lang/invoke/MethodHandleNatives.java Tue Mar 29 20:19:55 2011 -0700
108.3 @@ -0,0 +1,368 @@
108.4 +/*
108.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
108.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
108.7 + *
108.8 + * This code is free software; you can redistribute it and/or modify it
108.9 + * under the terms of the GNU General Public License version 2 only, as
108.10 + * published by the Free Software Foundation. Oracle designates this
108.11 + * particular file as subject to the "Classpath" exception as provided
108.12 + * by Oracle in the LICENSE file that accompanied this code.
108.13 + *
108.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
108.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
108.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
108.17 + * version 2 for more details (a copy is included in the LICENSE file that
108.18 + * accompanied this code).
108.19 + *
108.20 + * You should have received a copy of the GNU General Public License version
108.21 + * 2 along with this work; if not, write to the Free Software Foundation,
108.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
108.23 + *
108.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
108.25 + * or visit www.oracle.com if you need additional information or have any
108.26 + * questions.
108.27 + */
108.28 +
108.29 +package java.lang.invoke;
108.30 +
108.31 +import java.lang.invoke.MethodHandles.Lookup;
108.32 +import java.lang.reflect.AccessibleObject;
108.33 +import java.lang.reflect.Field;
108.34 +import static java.lang.invoke.MethodHandleNatives.Constants.*;
108.35 +import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
108.36 +
108.37 +/**
108.38 + * The JVM interface for the method handles package is all here.
108.39 + * This is an interface internal and private to an implemetantion of JSR 292.
108.40 + * <em>This class is not part of the JSR 292 standard.</em>
108.41 + * @author jrose
108.42 + */
108.43 +class MethodHandleNatives {
108.44 +
108.45 + private MethodHandleNatives() { } // static only
108.46 +
108.47 + /// MethodName support
108.48 +
108.49 + static native void init(MemberName self, Object ref);
108.50 + static native void expand(MemberName self);
108.51 + static native void resolve(MemberName self, Class<?> caller);
108.52 + static native int getMembers(Class<?> defc, String matchName, String matchSig,
108.53 + int matchFlags, Class<?> caller, int skip, MemberName[] results);
108.54 +
108.55 + /// MethodHandle support
108.56 +
108.57 + /** Initialize the method handle to adapt the call. */
108.58 + static native void init(AdapterMethodHandle self, MethodHandle target, int argnum);
108.59 + /** Initialize the method handle to call the correct method, directly. */
108.60 + static native void init(BoundMethodHandle self, Object target, int argnum);
108.61 + /** Initialize the method handle to call as if by an invoke* instruction. */
108.62 + static native void init(DirectMethodHandle self, Object ref, boolean doDispatch, Class<?> caller);
108.63 +
108.64 + /** Initialize a method type, once per form. */
108.65 + static native void init(MethodType self);
108.66 +
108.67 + /** Tell the JVM about a class's bootstrap method. */
108.68 + static native void registerBootstrap(Class<?> caller, MethodHandle bootstrapMethod);
108.69 +
108.70 + /** Ask the JVM about a class's bootstrap method. */
108.71 + static native MethodHandle getBootstrap(Class<?> caller);
108.72 +
108.73 + /** Tell the JVM that we need to change the target of an invokedynamic. */
108.74 + static native void setCallSiteTarget(CallSite site, MethodHandle target);
108.75 +
108.76 + /** Fetch the vmtarget field.
108.77 + * It will be sanitized as necessary to avoid exposing non-Java references.
108.78 + * This routine is for debugging and reflection.
108.79 + */
108.80 + static native Object getTarget(MethodHandle self, int format);
108.81 +
108.82 + /** Fetch the name of the handled method, if available.
108.83 + * This routine is for debugging and reflection.
108.84 + */
108.85 + static MemberName getMethodName(MethodHandle self) {
108.86 + return (MemberName) getTarget(self, ETF_METHOD_NAME);
108.87 + }
108.88 +
108.89 + /** Fetch the reflective version of the handled method, if available.
108.90 + */
108.91 + static AccessibleObject getTargetMethod(MethodHandle self) {
108.92 + return (AccessibleObject) getTarget(self, ETF_REFLECT_METHOD);
108.93 + }
108.94 +
108.95 + /** Fetch the target of this method handle.
108.96 + * If it directly targets a method, return a MemberName for the method.
108.97 + * If it is chained to another method handle, return that handle.
108.98 + */
108.99 + static Object getTargetInfo(MethodHandle self) {
108.100 + return getTarget(self, ETF_HANDLE_OR_METHOD_NAME);
108.101 + }
108.102 +
108.103 + static Object[] makeTarget(Class<?> defc, String name, String sig, int mods, Class<?> refc) {
108.104 + return new Object[] { defc, name, sig, mods, refc };
108.105 + }
108.106 +
108.107 + /** Fetch MH-related JVM parameter.
108.108 + * which=0 retrieves MethodHandlePushLimit
108.109 + * which=1 retrieves stack slot push size (in address units)
108.110 + */
108.111 + static native int getConstant(int which);
108.112 +
108.113 + /** Java copy of MethodHandlePushLimit in range 2..255. */
108.114 + static final int JVM_PUSH_LIMIT;
108.115 + /** JVM stack motion (in words) after one slot is pushed, usually -1.
108.116 + */
108.117 + static final int JVM_STACK_MOVE_UNIT;
108.118 +
108.119 + /** Which conv-ops are implemented by the JVM? */
108.120 + static final int CONV_OP_IMPLEMENTED_MASK;
108.121 +
108.122 + private static native void registerNatives();
108.123 + static {
108.124 + int JVM_PUSH_LIMIT_;
108.125 + int JVM_STACK_MOVE_UNIT_;
108.126 + int CONV_OP_IMPLEMENTED_MASK_;
108.127 + try {
108.128 + registerNatives();
108.129 + JVM_PUSH_LIMIT_ = getConstant(Constants.GC_JVM_PUSH_LIMIT);
108.130 + JVM_STACK_MOVE_UNIT_ = getConstant(Constants.GC_JVM_STACK_MOVE_UNIT);
108.131 + CONV_OP_IMPLEMENTED_MASK_ = getConstant(Constants.GC_CONV_OP_IMPLEMENTED_MASK);
108.132 + //sun.reflect.Reflection.registerMethodsToFilter(MethodHandleImpl.class, "init");
108.133 + } catch (UnsatisfiedLinkError ee) {
108.134 + // ignore; if we use init() methods later we'll see linkage errors
108.135 + JVM_PUSH_LIMIT_ = 3; // arbitrary
108.136 + JVM_STACK_MOVE_UNIT_ = -1; // arbitrary
108.137 + CONV_OP_IMPLEMENTED_MASK_ = 0;
108.138 + JVM_PUSH_LIMIT = JVM_PUSH_LIMIT_;
108.139 + JVM_STACK_MOVE_UNIT = JVM_STACK_MOVE_UNIT_;
108.140 + throw ee; // just die; hopeless to try to run with an older JVM
108.141 + }
108.142 + JVM_PUSH_LIMIT = JVM_PUSH_LIMIT_;
108.143 + JVM_STACK_MOVE_UNIT = JVM_STACK_MOVE_UNIT_;
108.144 + if (CONV_OP_IMPLEMENTED_MASK_ == 0)
108.145 + CONV_OP_IMPLEMENTED_MASK_ = DEFAULT_CONV_OP_IMPLEMENTED_MASK;
108.146 + CONV_OP_IMPLEMENTED_MASK = CONV_OP_IMPLEMENTED_MASK_;
108.147 + }
108.148 +
108.149 + // All compile-time constants go here.
108.150 + // There is an opportunity to check them against the JVM's idea of them.
108.151 + static class Constants {
108.152 + Constants() { } // static only
108.153 + // MethodHandleImpl
108.154 + static final int // for getConstant
108.155 + GC_JVM_PUSH_LIMIT = 0,
108.156 + GC_JVM_STACK_MOVE_UNIT = 1,
108.157 + GC_CONV_OP_IMPLEMENTED_MASK = 2;
108.158 + static final int
108.159 + ETF_HANDLE_OR_METHOD_NAME = 0, // all available data (immediate MH or method)
108.160 + ETF_DIRECT_HANDLE = 1, // ultimate method handle (will be a DMH, may be self)
108.161 + ETF_METHOD_NAME = 2, // ultimate method as MemberName
108.162 + ETF_REFLECT_METHOD = 3; // ultimate method as java.lang.reflect object (sans refClass)
108.163 +
108.164 + // MemberName
108.165 + // The JVM uses values of -2 and above for vtable indexes.
108.166 + // Field values are simple positive offsets.
108.167 + // Ref: src/share/vm/oops/methodOop.hpp
108.168 + // This value is negative enough to avoid such numbers,
108.169 + // but not too negative.
108.170 + static final int
108.171 + MN_IS_METHOD = 0x00010000, // method (not constructor)
108.172 + MN_IS_CONSTRUCTOR = 0x00020000, // constructor
108.173 + MN_IS_FIELD = 0x00040000, // field
108.174 + MN_IS_TYPE = 0x00080000, // nested type
108.175 + MN_SEARCH_SUPERCLASSES = 0x00100000, // for MHN.getMembers
108.176 + MN_SEARCH_INTERFACES = 0x00200000, // for MHN.getMembers
108.177 + VM_INDEX_UNINITIALIZED = -99;
108.178 +
108.179 + // BoundMethodHandle
108.180 + /** Constants for decoding the vmargslot field, which contains 2 values. */
108.181 + static final int
108.182 + ARG_SLOT_PUSH_SHIFT = 16,
108.183 + ARG_SLOT_MASK = (1<<ARG_SLOT_PUSH_SHIFT)-1;
108.184 +
108.185 + // AdapterMethodHandle
108.186 + /** Conversions recognized by the JVM.
108.187 + * They must align with the constants in java.lang.invoke.AdapterMethodHandle,
108.188 + * in the JVM file hotspot/src/share/vm/classfile/javaClasses.hpp.
108.189 + */
108.190 + static final int
108.191 + OP_RETYPE_ONLY = 0x0, // no argument changes; straight retype
108.192 + OP_RETYPE_RAW = 0x1, // no argument changes; straight retype
108.193 + OP_CHECK_CAST = 0x2, // ref-to-ref conversion; requires a Class argument
108.194 + OP_PRIM_TO_PRIM = 0x3, // converts from one primitive to another
108.195 + OP_REF_TO_PRIM = 0x4, // unboxes a wrapper to produce a primitive
108.196 + OP_PRIM_TO_REF = 0x5, // boxes a primitive into a wrapper (NYI)
108.197 + OP_SWAP_ARGS = 0x6, // swap arguments (vminfo is 2nd arg)
108.198 + OP_ROT_ARGS = 0x7, // rotate arguments (vminfo is displaced arg)
108.199 + OP_DUP_ARGS = 0x8, // duplicates one or more arguments (at TOS)
108.200 + OP_DROP_ARGS = 0x9, // remove one or more argument slots
108.201 + OP_COLLECT_ARGS = 0xA, // combine one or more arguments into a varargs (NYI)
108.202 + OP_SPREAD_ARGS = 0xB, // expand in place a varargs array (of known size)
108.203 + OP_FLYBY = 0xC, // operate first on reified argument list (NYI)
108.204 + OP_RICOCHET = 0xD, // run an adapter chain on the return value (NYI)
108.205 + CONV_OP_LIMIT = 0xE; // limit of CONV_OP enumeration
108.206 + /** Shift and mask values for decoding the AMH.conversion field.
108.207 + * These numbers are shared with the JVM for creating AMHs.
108.208 + */
108.209 + static final int
108.210 + CONV_OP_MASK = 0xF00, // this nybble contains the conversion op field
108.211 + CONV_VMINFO_MASK = 0x0FF, // LSB is reserved for JVM use
108.212 + CONV_VMINFO_SHIFT = 0, // position of bits in CONV_VMINFO_MASK
108.213 + CONV_OP_SHIFT = 8, // position of bits in CONV_OP_MASK
108.214 + CONV_DEST_TYPE_SHIFT = 12, // byte 2 has the adapter BasicType (if needed)
108.215 + CONV_SRC_TYPE_SHIFT = 16, // byte 2 has the source BasicType (if needed)
108.216 + CONV_STACK_MOVE_SHIFT = 20, // high 12 bits give signed SP change
108.217 + CONV_STACK_MOVE_MASK = (1 << (32 - CONV_STACK_MOVE_SHIFT)) - 1;
108.218 +
108.219 + /** Which conv-ops are implemented by the JVM? */
108.220 + static final int DEFAULT_CONV_OP_IMPLEMENTED_MASK =
108.221 + // Value to use if the corresponding JVM query fails.
108.222 + ((1<<OP_RETYPE_ONLY)
108.223 + |(1<<OP_RETYPE_RAW)
108.224 + |(1<<OP_CHECK_CAST)
108.225 + |(1<<OP_PRIM_TO_PRIM)
108.226 + |(1<<OP_REF_TO_PRIM)
108.227 + |(1<<OP_SWAP_ARGS)
108.228 + |(1<<OP_ROT_ARGS)
108.229 + |(1<<OP_DUP_ARGS)
108.230 + |(1<<OP_DROP_ARGS)
108.231 + //|(1<<OP_SPREAD_ARGS)
108.232 + );
108.233 +
108.234 + /**
108.235 + * Basic types as encoded in the JVM. These code values are not
108.236 + * intended for use outside this class. They are used as part of
108.237 + * a private interface between the JVM and this class.
108.238 + */
108.239 + static final int
108.240 + T_BOOLEAN = 4,
108.241 + T_CHAR = 5,
108.242 + T_FLOAT = 6,
108.243 + T_DOUBLE = 7,
108.244 + T_BYTE = 8,
108.245 + T_SHORT = 9,
108.246 + T_INT = 10,
108.247 + T_LONG = 11,
108.248 + T_OBJECT = 12,
108.249 + //T_ARRAY = 13
108.250 + T_VOID = 14;
108.251 + //T_ADDRESS = 15
108.252 +
108.253 + /**
108.254 + * Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries.
108.255 + */
108.256 + static final int
108.257 + REF_getField = 1,
108.258 + REF_getStatic = 2,
108.259 + REF_putField = 3,
108.260 + REF_putStatic = 4,
108.261 + REF_invokeVirtual = 5,
108.262 + REF_invokeStatic = 6,
108.263 + REF_invokeSpecial = 7,
108.264 + REF_newInvokeSpecial = 8,
108.265 + REF_invokeInterface = 9;
108.266 + }
108.267 +
108.268 + private static native int getNamedCon(int which, Object[] name);
108.269 + static boolean verifyConstants() {
108.270 + Object[] box = { null };
108.271 + for (int i = 0; ; i++) {
108.272 + box[0] = null;
108.273 + int vmval = getNamedCon(i, box);
108.274 + if (box[0] == null) break;
108.275 + String name = (String) box[0];
108.276 + try {
108.277 + Field con = Constants.class.getDeclaredField(name);
108.278 + int jval = con.getInt(null);
108.279 + if (jval != vmval)
108.280 + throw new InternalError(name+": JVM has "+vmval+" while Java has "+jval);
108.281 + } catch (Exception ex) {
108.282 + throw new InternalError(name+": access failed, got "+ex);
108.283 + }
108.284 + }
108.285 + return true;
108.286 + }
108.287 + static {
108.288 + verifyConstants();
108.289 + }
108.290 +
108.291 + // Up-calls from the JVM.
108.292 + // These must NOT be public.
108.293 +
108.294 + /**
108.295 + * The JVM is linking an invokedynamic instruction. Create a reified call site for it.
108.296 + */
108.297 + static CallSite makeDynamicCallSite(MethodHandle bootstrapMethod,
108.298 + String name, MethodType type,
108.299 + Object info,
108.300 + MemberName callerMethod, int callerBCI) {
108.301 + return CallSite.makeSite(bootstrapMethod, name, type, info, callerMethod, callerBCI);
108.302 + }
108.303 +
108.304 + /**
108.305 + * Called by the JVM to check the length of a spread array.
108.306 + */
108.307 + static void checkSpreadArgument(Object av, int n) {
108.308 + MethodHandleStatics.checkSpreadArgument(av, n);
108.309 + }
108.310 +
108.311 + /**
108.312 + * The JVM wants a pointer to a MethodType. Oblige it by finding or creating one.
108.313 + */
108.314 + static MethodType findMethodHandleType(Class<?> rtype, Class<?>[] ptypes) {
108.315 + return MethodType.makeImpl(rtype, ptypes, true);
108.316 + }
108.317 +
108.318 + /**
108.319 + * The JVM wants to use a MethodType with invokeGeneric. Give the runtime fair warning.
108.320 + */
108.321 + static void notifyGenericMethodType(MethodType type) {
108.322 + type.form().notifyGenericMethodType();
108.323 + }
108.324 +
108.325 + /**
108.326 + * The JVM wants to raise an exception. Here's the path.
108.327 + */
108.328 + static void raiseException(int code, Object actual, Object required) {
108.329 + String message;
108.330 + // disregard the identity of the actual object, if it is not a class:
108.331 + if (!(actual instanceof Class) && !(actual instanceof MethodType))
108.332 + actual = actual.getClass();
108.333 + if (actual != null)
108.334 + message = "required "+required+" but encountered "+actual;
108.335 + else
108.336 + message = "required "+required;
108.337 + switch (code) {
108.338 + case 192: // checkcast
108.339 + throw new ClassCastException(message);
108.340 + default:
108.341 + throw new InternalError("unexpected code "+code+": "+message);
108.342 + }
108.343 + }
108.344 +
108.345 + /**
108.346 + * The JVM is resolving a CONSTANT_MethodHandle CP entry. And it wants our help.
108.347 + * It will make an up-call to this method. (Do not change the name or signature.)
108.348 + */
108.349 + static MethodHandle linkMethodHandleConstant(Class<?> callerClass, int refKind,
108.350 + Class<?> defc, String name, Object type) {
108.351 + try {
108.352 + Lookup lookup = IMPL_LOOKUP.in(callerClass);
108.353 + switch (refKind) {
108.354 + case REF_getField: return lookup.findGetter( defc, name, (Class<?>) type );
108.355 + case REF_getStatic: return lookup.findStaticGetter( defc, name, (Class<?>) type );
108.356 + case REF_putField: return lookup.findSetter( defc, name, (Class<?>) type );
108.357 + case REF_putStatic: return lookup.findStaticSetter( defc, name, (Class<?>) type );
108.358 + case REF_invokeVirtual: return lookup.findVirtual( defc, name, (MethodType) type );
108.359 + case REF_invokeStatic: return lookup.findStatic( defc, name, (MethodType) type );
108.360 + case REF_invokeSpecial: return lookup.findSpecial( defc, name, (MethodType) type, callerClass );
108.361 + case REF_newInvokeSpecial: return lookup.findConstructor( defc, (MethodType) type );
108.362 + case REF_invokeInterface: return lookup.findVirtual( defc, name, (MethodType) type );
108.363 + }
108.364 + throw new IllegalArgumentException("bad MethodHandle constant "+name+" : "+type);
108.365 + } catch (ReflectiveOperationException ex) {
108.366 + Error err = new IncompatibleClassChangeError();
108.367 + err.initCause(ex);
108.368 + throw err;
108.369 + }
108.370 + }
108.371 +}
109.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
109.2 +++ b/src/share/classes/java/lang/invoke/MethodHandleStatics.java Tue Mar 29 20:19:55 2011 -0700
109.3 @@ -0,0 +1,92 @@
109.4 +/*
109.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
109.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
109.7 + *
109.8 + * This code is free software; you can redistribute it and/or modify it
109.9 + * under the terms of the GNU General Public License version 2 only, as
109.10 + * published by the Free Software Foundation. Oracle designates this
109.11 + * particular file as subject to the "Classpath" exception as provided
109.12 + * by Oracle in the LICENSE file that accompanied this code.
109.13 + *
109.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
109.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
109.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
109.17 + * version 2 for more details (a copy is included in the LICENSE file that
109.18 + * accompanied this code).
109.19 + *
109.20 + * You should have received a copy of the GNU General Public License version
109.21 + * 2 along with this work; if not, write to the Free Software Foundation,
109.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
109.23 + *
109.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
109.25 + * or visit www.oracle.com if you need additional information or have any
109.26 + * questions.
109.27 + */
109.28 +
109.29 +package java.lang.invoke;
109.30 +
109.31 +/**
109.32 + * This class consists exclusively of static names internal to the
109.33 + * method handle implementation.
109.34 + * Usage: {@code import static java.lang.invoke.MethodHandleStatics.*}
109.35 + * @author John Rose, JSR 292 EG
109.36 + */
109.37 +/*non-public*/ class MethodHandleStatics {
109.38 +
109.39 + private MethodHandleStatics() { } // do not instantiate
109.40 +
109.41 + /*non-public*/ static String getNameString(MethodHandle target, MethodType type) {
109.42 + if (type == null)
109.43 + type = target.type();
109.44 + MemberName name = null;
109.45 + if (target != null)
109.46 + name = MethodHandleNatives.getMethodName(target);
109.47 + if (name == null)
109.48 + return "invoke" + type;
109.49 + return name.getName() + type;
109.50 + }
109.51 +
109.52 + /*non-public*/ static String getNameString(MethodHandle target, MethodHandle typeHolder) {
109.53 + return getNameString(target, typeHolder == null ? (MethodType) null : typeHolder.type());
109.54 + }
109.55 +
109.56 + /*non-public*/ static String getNameString(MethodHandle target) {
109.57 + return getNameString(target, (MethodType) null);
109.58 + }
109.59 +
109.60 + /*non-public*/ static String addTypeString(Object obj, MethodHandle target) {
109.61 + String str = String.valueOf(obj);
109.62 + if (target == null) return str;
109.63 + int paren = str.indexOf('(');
109.64 + if (paren >= 0) str = str.substring(0, paren);
109.65 + return str + target.type();
109.66 + }
109.67 +
109.68 + static void checkSpreadArgument(Object av, int n) {
109.69 + if (av == null ? n != 0 : ((Object[])av).length != n)
109.70 + throw newIllegalArgumentException("Array is not of length "+n);
109.71 + }
109.72 +
109.73 + // handy shared exception makers (they simplify the common case code)
109.74 + /*non-public*/ static RuntimeException newIllegalStateException(String message) {
109.75 + return new IllegalStateException(message);
109.76 + }
109.77 + /*non-public*/ static RuntimeException newIllegalStateException(String message, Object obj) {
109.78 + return new IllegalStateException(message(message, obj));
109.79 + }
109.80 + /*non-public*/ static RuntimeException newIllegalArgumentException(String message) {
109.81 + return new IllegalArgumentException(message);
109.82 + }
109.83 + /*non-public*/ static RuntimeException newIllegalArgumentException(String message, Object obj) {
109.84 + return new IllegalArgumentException(message(message, obj));
109.85 + }
109.86 + /*non-public*/ static Error uncaughtException(Exception ex) {
109.87 + Error err = new InternalError("uncaught exception");
109.88 + err.initCause(ex);
109.89 + return err;
109.90 + }
109.91 + private static String message(String message, Object obj) {
109.92 + if (obj != null) message = message + ": " + obj;
109.93 + return message;
109.94 + }
109.95 +}
110.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
110.2 +++ b/src/share/classes/java/lang/invoke/MethodHandles.java Tue Mar 29 20:19:55 2011 -0700
110.3 @@ -0,0 +1,2357 @@
110.4 +/*
110.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
110.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
110.7 + *
110.8 + * This code is free software; you can redistribute it and/or modify it
110.9 + * under the terms of the GNU General Public License version 2 only, as
110.10 + * published by the Free Software Foundation. Oracle designates this
110.11 + * particular file as subject to the "Classpath" exception as provided
110.12 + * by Oracle in the LICENSE file that accompanied this code.
110.13 + *
110.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
110.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
110.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
110.17 + * version 2 for more details (a copy is included in the LICENSE file that
110.18 + * accompanied this code).
110.19 + *
110.20 + * You should have received a copy of the GNU General Public License version
110.21 + * 2 along with this work; if not, write to the Free Software Foundation,
110.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
110.23 + *
110.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
110.25 + * or visit www.oracle.com if you need additional information or have any
110.26 + * questions.
110.27 + */
110.28 +
110.29 +package java.lang.invoke;
110.30 +
110.31 +import java.lang.reflect.*;
110.32 +import sun.invoke.WrapperInstance;
110.33 +import sun.invoke.util.ValueConversions;
110.34 +import sun.invoke.util.VerifyAccess;
110.35 +import sun.invoke.util.Wrapper;
110.36 +import java.util.List;
110.37 +import java.util.ArrayList;
110.38 +import java.util.Arrays;
110.39 +import sun.reflect.Reflection;
110.40 +import static java.lang.invoke.MethodHandleStatics.*;
110.41 +
110.42 +/**
110.43 + * This class consists exclusively of static methods that operate on or return
110.44 + * method handles. They fall into several categories:
110.45 + * <ul>
110.46 + * <li>Lookup methods which help create method handles for methods and fields.
110.47 + * <li>Combinator methods, which combine or transform pre-existing method handles into new ones.
110.48 + * <li>Other factory methods to create method handles that emulate other common JVM operations or control flow patterns.
110.49 + * <li>Wrapper methods which can convert between method handles and interface types.
110.50 + * </ul>
110.51 + * <p>
110.52 + * @author John Rose, JSR 292 EG
110.53 + */
110.54 +public class MethodHandles {
110.55 +
110.56 + private MethodHandles() { } // do not instantiate
110.57 +
110.58 + private static final MemberName.Factory IMPL_NAMES = MemberName.getFactory();
110.59 + static { MethodHandleImpl.initStatics(); }
110.60 + // See IMPL_LOOKUP below.
110.61 +
110.62 + //// Method handle creation from ordinary methods.
110.63 +
110.64 + /**
110.65 + * Returns a {@link Lookup lookup object} on the caller,
110.66 + * which has the capability to access any method handle that the caller has access to,
110.67 + * including direct method handles to private fields and methods.
110.68 + * This lookup object is a <em>capability</em> which may be delegated to trusted agents.
110.69 + * Do not store it in place where untrusted code can access it.
110.70 + */
110.71 + public static Lookup lookup() {
110.72 + return new Lookup();
110.73 + }
110.74 +
110.75 + /**
110.76 + * Returns a {@link Lookup lookup object} which is trusted minimally.
110.77 + * It can only be used to create method handles to
110.78 + * publicly accessible fields and methods.
110.79 + * <p>
110.80 + * As a matter of pure convention, the {@linkplain Lookup#lookupClass lookup class}
110.81 + * of this lookup object will be {@link java.lang.Object}.
110.82 + * <p>
110.83 + * The lookup class can be changed to any other class {@code C} using an expression of the form
110.84 + * {@linkplain Lookup#in <code>publicLookup().in(C.class)</code>}.
110.85 + * Since all classes have equal access to public names,
110.86 + * such a change would confer no new access rights.
110.87 + */
110.88 + public static Lookup publicLookup() {
110.89 + return Lookup.PUBLIC_LOOKUP;
110.90 + }
110.91 +
110.92 + /**
110.93 + * A <em>lookup object</em> is a factory for creating method handles,
110.94 + * when the creation requires access checking.
110.95 + * Method handles do not perform
110.96 + * access checks when they are called, but rather when they are created.
110.97 + * Therefore, method handle access
110.98 + * restrictions must be enforced when a method handle is created.
110.99 + * The caller class against which those restrictions are enforced
110.100 + * is known as the {@linkplain #lookupClass lookup class}.
110.101 + * <p>
110.102 + * A lookup class which needs to create method handles will call
110.103 + * {@link MethodHandles#lookup MethodHandles.lookup} to create a factory for itself.
110.104 + * When the {@code Lookup} factory object is created, the identity of the lookup class is
110.105 + * determined, and securely stored in the {@code Lookup} object.
110.106 + * The lookup class (or its delegates) may then use factory methods
110.107 + * on the {@code Lookup} object to create method handles for access-checked members.
110.108 + * This includes all methods, constructors, and fields which are allowed to the lookup class,
110.109 + * even private ones.
110.110 + * <p>
110.111 + * The factory methods on a {@code Lookup} object correspond to all major
110.112 + * use cases for methods, constructors, and fields.
110.113 + * Here is a summary of the correspondence between these factory methods and
110.114 + * the behavior the resulting method handles:
110.115 + * <code>
110.116 + * <table border=1 cellpadding=5 summary="lookup method behaviors">
110.117 + * <tr><th>lookup expression</th><th>member</th><th>behavior</th></tr>
110.118 + * <tr>
110.119 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findGetter lookup.findGetter(C.class,"f",FT.class)}</td>
110.120 + * <td>FT f;</td><td>(T) this.f;</td>
110.121 + * </tr>
110.122 + * <tr>
110.123 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findStaticGetter lookup.findStaticGetter(C.class,"f",FT.class)}</td>
110.124 + * <td>static<br>FT f;</td><td>(T) C.f;</td>
110.125 + * </tr>
110.126 + * <tr>
110.127 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findSetter lookup.findSetter(C.class,"f",FT.class)}</td>
110.128 + * <td>FT f;</td><td>this.f = x;</td>
110.129 + * </tr>
110.130 + * <tr>
110.131 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findStaticSetter lookup.findStaticSetter(C.class,"f",FT.class)}</td>
110.132 + * <td>static<br>FT f;</td><td>C.f = arg;</td>
110.133 + * </tr>
110.134 + * <tr>
110.135 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findVirtual lookup.findVirtual(C.class,"m",MT)}</td>
110.136 + * <td>T m(A*);</td><td>(T) this.m(arg*);</td>
110.137 + * </tr>
110.138 + * <tr>
110.139 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findStatic lookup.findStatic(C.class,"m",MT)}</td>
110.140 + * <td>static<br>T m(A*);</td><td>(T) C.m(arg*);</td>
110.141 + * </tr>
110.142 + * <tr>
110.143 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findSpecial lookup.findSpecial(C.class,"m",MT,this.class)}</td>
110.144 + * <td>T m(A*);</td><td>(T) super.m(arg*);</td>
110.145 + * </tr>
110.146 + * <tr>
110.147 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findConstructor lookup.findConstructor(C.class,MT)}</td>
110.148 + * <td>C(A*);</td><td>(T) new C(arg*);</td>
110.149 + * </tr>
110.150 + * <tr>
110.151 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#unreflectGetter lookup.unreflectGetter(aField)}</td>
110.152 + * <td>(static)?<br>FT f;</td><td>(FT) aField.get(thisOrNull);</td>
110.153 + * </tr>
110.154 + * <tr>
110.155 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#unreflectSetter lookup.unreflectSetter(aField)}</td>
110.156 + * <td>(static)?<br>FT f;</td><td>aField.set(thisOrNull, arg);</td>
110.157 + * </tr>
110.158 + * <tr>
110.159 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#unreflect lookup.unreflect(aMethod)}</td>
110.160 + * <td>(static)?<br>T m(A*);</td><td>(T) aMethod.invoke(thisOrNull, arg*);</td>
110.161 + * </tr>
110.162 + * <tr>
110.163 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#unreflectConstructor lookup.unreflectConstructor(aConstructor)}</td>
110.164 + * <td>C(A*);</td><td>(C) aConstructor.newInstance(arg*);</td>
110.165 + * </tr>
110.166 + * <tr>
110.167 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#unreflect lookup.unreflect(aMethod)}</td>
110.168 + * <td>(static)?<br>T m(A*);</td><td>(T) aMethod.invoke(thisOrNull, arg*);</td>
110.169 + * </tr>
110.170 + * </table>
110.171 + * </code>
110.172 + * Here, the type {@code C} is the class or interface being searched for a member,
110.173 + * documented as a parameter named {@code refc} in the lookup methods.
110.174 + * The method or constructor type {@code MT} is composed from the return type {@code T}
110.175 + * and the sequence of argument types {@code A*}.
110.176 + * Both {@code MT} and the field type {@code FT} are documented as a parameter named {@code type}.
110.177 + * The formal parameter {@code this} stands for the self-reference of type {@code C};
110.178 + * if it is present, it is always the leading argument to the method handle invocation.
110.179 + * The name {@code arg} stands for all the other method handle arguments.
110.180 + * In the code examples for the Core Reflection API, the name {@code thisOrNull}
110.181 + * stands for a null reference if the accessed method or field is static,
110.182 + * and {@code this} otherwise.
110.183 + * The names {@code aMethod}, {@code aField}, and {@code aConstructor} stand
110.184 + * for reflective objects corresponding to the given members.
110.185 + * <p>
110.186 + * The equivalence between looked-up method handles and underlying
110.187 + * class members can break down in a few ways:
110.188 + * <ul>
110.189 + * <li>If {@code C} is not symbolically accessible from the lookup class's loader,
110.190 + * the lookup can still succeed, even when there is no equivalent
110.191 + * Java expression or bytecoded constant.
110.192 + * <li>Likewise, if {@code T} or {@code MT}
110.193 + * is not symbolically accessible from the lookup class's loader,
110.194 + * the lookup can still succeed.
110.195 + * For example, lookups for {@code MethodHandle.invokeExact} and
110.196 + * {@code MethodHandle.invokeGeneric} will always succeed, regardless of requested type.
110.197 + * <li>If there is a security manager installed, it can forbid the lookup
110.198 + * on various grounds (<a href="#secmgr">see below</a>).
110.199 + * By contrast, the {@code ldc} instruction is not subject to
110.200 + * security manager checks.
110.201 + * </ul>
110.202 + *
110.203 + * <h3><a name="access"></a>Access checking</h3>
110.204 + * Access checks are applied in the factory methods of {@code Lookup},
110.205 + * when a method handle is created.
110.206 + * This is a key difference from the Core Reflection API, since
110.207 + * {@link java.lang.reflect.Method#invoke Method.invoke}
110.208 + * performs access checking against every caller, on every call.
110.209 + * <p>
110.210 + * All access checks start from a {@code Lookup} object, which
110.211 + * compares its recorded lookup class against all requests to
110.212 + * create method handles.
110.213 + * A single {@code Lookup} object can be used to create any number
110.214 + * of access-checked method handles, all checked against a single
110.215 + * lookup class.
110.216 + * <p>
110.217 + * A {@code Lookup} object can be shared with other trusted code,
110.218 + * such as a metaobject protocol.
110.219 + * A shared {@code Lookup} object delegates the capability
110.220 + * to create method handles on private members of the lookup class.
110.221 + * Even if privileged code uses the {@code Lookup} object,
110.222 + * the access checking is confined to the privileges of the
110.223 + * original lookup class.
110.224 + * <p>
110.225 + * A lookup can fail, because
110.226 + * the containing class is not accessible to the lookup class, or
110.227 + * because the desired class member is missing, or because the
110.228 + * desired class member is not accessible to the lookup class.
110.229 + * In any of these cases, a {@code ReflectiveOperationException} will be
110.230 + * thrown from the attempted lookup. The exact class will be one of
110.231 + * the following:
110.232 + * <ul>
110.233 + * <li>NoSuchMethodException — if a method is requested but does not exist
110.234 + * <li>NoSuchFieldException — if a field is requested but does not exist
110.235 + * <li>IllegalAccessException — if the member exists but an access check fails
110.236 + * </ul>
110.237 + * <p>
110.238 + * In general, the conditions under which a method handle may be
110.239 + * looked up for a method {@code M} are exactly equivalent to the conditions
110.240 + * under which the lookup class could have compiled and resolved a call to {@code M}.
110.241 + * And the effect of invoking the method handle resulting from the lookup
110.242 + * is exactly equivalent to executing the compiled and resolved call to {@code M}.
110.243 + * The same point is true of fields and constructors.
110.244 + * <p>
110.245 + * In some cases, access between nested classes is obtained by the Java compiler by creating
110.246 + * an wrapper method to access a private method of another class
110.247 + * in the same top-level declaration.
110.248 + * For example, a nested class {@code C.D}
110.249 + * can access private members within other related classes such as
110.250 + * {@code C}, {@code C.D.E}, or {@code C.B},
110.251 + * but the Java compiler may need to generate wrapper methods in
110.252 + * those related classes. In such cases, a {@code Lookup} object on
110.253 + * {@code C.E} would be unable to those private members.
110.254 + * A workaround for this limitation is the {@link Lookup#in Lookup.in} method,
110.255 + * which can transform a lookup on {@code C.E} into one on any of those other
110.256 + * classes, without special elevation of privilege.
110.257 + * <p>
110.258 + * Although bytecode instructions can only refer to classes in
110.259 + * a related class loader, this API can search for methods in any
110.260 + * class, as long as a reference to its {@code Class} object is
110.261 + * available. Such cross-loader references are also possible with the
110.262 + * Core Reflection API, and are impossible to bytecode instructions
110.263 + * such as {@code invokestatic} or {@code getfield}.
110.264 + * There is a {@linkplain java.lang.SecurityManager security manager API}
110.265 + * to allow applications to check such cross-loader references.
110.266 + * These checks apply to both the {@code MethodHandles.Lookup} API
110.267 + * and the Core Reflection API
110.268 + * (as found on {@link java.lang.Class Class}).
110.269 + * <p>
110.270 + * Access checks only apply to named and reflected methods,
110.271 + * constructors, and fields.
110.272 + * Other method handle creation methods, such as
110.273 + * {@link #convertArguments MethodHandles.convertArguments},
110.274 + * do not require any access checks, and are done
110.275 + * with static methods of {@link MethodHandles},
110.276 + * independently of any {@code Lookup} object.
110.277 + *
110.278 + * <h3>Security manager interactions</h3>
110.279 + * <a name="secmgr"></a>
110.280 + * If a security manager is present, member lookups are subject to
110.281 + * additional checks.
110.282 + * From one to four calls are made to the security manager.
110.283 + * Any of these calls can refuse access by throwing a
110.284 + * {@link java.lang.SecurityException SecurityException}.
110.285 + * Define {@code smgr} as the security manager,
110.286 + * {@code refc} as the containing class in which the member
110.287 + * is being sought, and {@code defc} as the class in which the
110.288 + * member is actually defined.
110.289 + * The calls are made according to the following rules:
110.290 + * <ul>
110.291 + * <li>In all cases, {@link SecurityManager#checkMemberAccess
110.292 + * smgr.checkMemberAccess(refc, Member.PUBLIC)} is called.
110.293 + * <li>If the class loader of the lookup class is not
110.294 + * the same as or an ancestor of the class loader of {@code refc},
110.295 + * then {@link SecurityManager#checkPackageAccess
110.296 + * smgr.checkPackageAccess(refcPkg)} is called,
110.297 + * where {@code refcPkg} is the package of {@code refc}.
110.298 + * <li>If the retrieved member is not public,
110.299 + * {@link SecurityManager#checkMemberAccess
110.300 + * smgr.checkMemberAccess(defc, Member.DECLARED)} is called.
110.301 + * (Note that {@code defc} might be the same as {@code refc}.)
110.302 + * <li>If the retrieved member is not public,
110.303 + * and if {@code defc} and {@code refc} are in different class loaders,
110.304 + * and if the class loader of the lookup class is not
110.305 + * the same as or an ancestor of the class loader of {@code defc},
110.306 + * then {@link SecurityManager#checkPackageAccess
110.307 + * smgr.checkPackageAccess(defcPkg)} is called,
110.308 + * where {@code defcPkg} is the package of {@code defc}.
110.309 + * </ul>
110.310 + * In all cases, the requesting class presented to the security
110.311 + * manager will be the lookup class from the current {@code Lookup} object.
110.312 + */
110.313 + public static final
110.314 + class Lookup {
110.315 + /** The class on behalf of whom the lookup is being performed. */
110.316 + private final Class<?> lookupClass;
110.317 +
110.318 + /** The allowed sorts of members which may be looked up (PUBLIC, etc.). */
110.319 + private final int allowedModes;
110.320 +
110.321 + /** A single-bit mask representing {@code public} access,
110.322 + * which may contribute to the result of {@link #lookupModes lookupModes}.
110.323 + * The value, {@code 0x01}, happens to be the same as the value of the
110.324 + * {@code public} {@linkplain java.lang.reflect.Modifier#PUBLIC modifier bit}.
110.325 + */
110.326 + public static final int PUBLIC = Modifier.PUBLIC;
110.327 +
110.328 + /** A single-bit mask representing {@code private} access,
110.329 + * which may contribute to the result of {@link #lookupModes lookupModes}.
110.330 + * The value, {@code 0x02}, happens to be the same as the value of the
110.331 + * {@code private} {@linkplain java.lang.reflect.Modifier#PRIVATE modifier bit}.
110.332 + */
110.333 + public static final int PRIVATE = Modifier.PRIVATE;
110.334 +
110.335 + /** A single-bit mask representing {@code protected} access,
110.336 + * which may contribute to the result of {@link #lookupModes lookupModes}.
110.337 + * The value, {@code 0x04}, happens to be the same as the value of the
110.338 + * {@code protected} {@linkplain java.lang.reflect.Modifier#PROTECTED modifier bit}.
110.339 + */
110.340 + public static final int PROTECTED = Modifier.PROTECTED;
110.341 +
110.342 + /** A single-bit mask representing {@code package} access (default access),
110.343 + * which may contribute to the result of {@link #lookupModes lookupModes}.
110.344 + * The value is {@code 0x08}, which does not correspond meaningfully to
110.345 + * any particular {@linkplain java.lang.reflect.Modifier modifier bit}.
110.346 + */
110.347 + public static final int PACKAGE = Modifier.STATIC;
110.348 +
110.349 + private static final int ALL_MODES = (PUBLIC | PRIVATE | PROTECTED | PACKAGE);
110.350 + private static final int TRUSTED = -1;
110.351 +
110.352 + private static int fixmods(int mods) {
110.353 + mods &= (ALL_MODES - PACKAGE);
110.354 + return (mods != 0) ? mods : PACKAGE;
110.355 + }
110.356 +
110.357 + /** Tells which class is performing the lookup. It is this class against
110.358 + * which checks are performed for visibility and access permissions.
110.359 + * <p>
110.360 + * The class implies a maximum level of access permission,
110.361 + * but the permissions may be additionally limited by the bitmask
110.362 + * {@link #lookupModes lookupModes}, which controls whether non-public members
110.363 + * can be accessed.
110.364 + */
110.365 + public Class<?> lookupClass() {
110.366 + return lookupClass;
110.367 + }
110.368 +
110.369 + // This is just for calling out to MethodHandleImpl.
110.370 + private Class<?> lookupClassOrNull() {
110.371 + return (allowedModes == TRUSTED) ? null : lookupClass;
110.372 + }
110.373 +
110.374 + /** Tells which access-protection classes of members this lookup object can produce.
110.375 + * The result is a bit-mask of the bits
110.376 + * {@linkplain #PUBLIC PUBLIC (0x01)},
110.377 + * {@linkplain #PRIVATE PRIVATE (0x02)},
110.378 + * {@linkplain #PROTECTED PROTECTED (0x04)},
110.379 + * and {@linkplain #PACKAGE PACKAGE (0x08)}.
110.380 + * <p>
110.381 + * A freshly-created lookup object
110.382 + * on the {@linkplain java.lang.invoke.MethodHandles#lookup() caller's class}
110.383 + * has all possible bits set, since the caller class can access all its own members.
110.384 + * A lookup object on a new lookup class
110.385 + * {@linkplain java.lang.invoke.MethodHandles.Lookup#in created from a previous lookup object}
110.386 + * may have some mode bits set to zero.
110.387 + * The purpose of this is to restrict access via the new lookup object,
110.388 + * so that it can access only names which can be reached by the original
110.389 + * lookup object, and also by the new lookup class.
110.390 + */
110.391 + public int lookupModes() {
110.392 + return allowedModes & ALL_MODES;
110.393 + }
110.394 +
110.395 + /** Embody the current class (the lookupClass) as a lookup class
110.396 + * for method handle creation.
110.397 + * Must be called by from a method in this package,
110.398 + * which in turn is called by a method not in this package.
110.399 + * <p>
110.400 + * Also, don't make it private, lest javac interpose
110.401 + * an access$N method.
110.402 + */
110.403 + Lookup() {
110.404 + this(getCallerClassAtEntryPoint(), ALL_MODES);
110.405 + // make sure we haven't accidentally picked up a privileged class:
110.406 + checkUnprivilegedlookupClass(lookupClass);
110.407 + }
110.408 +
110.409 + Lookup(Class<?> lookupClass) {
110.410 + this(lookupClass, ALL_MODES);
110.411 + }
110.412 +
110.413 + private Lookup(Class<?> lookupClass, int allowedModes) {
110.414 + this.lookupClass = lookupClass;
110.415 + this.allowedModes = allowedModes;
110.416 + }
110.417 +
110.418 + /**
110.419 + * Creates a lookup on the specified new lookup class.
110.420 + * The resulting object will report the specified
110.421 + * class as its own {@link #lookupClass lookupClass}.
110.422 + * <p>
110.423 + * However, the resulting {@code Lookup} object is guaranteed
110.424 + * to have no more access capabilities than the original.
110.425 + * In particular, access capabilities can be lost as follows:<ul>
110.426 + * <li>If the new lookup class differs from the old one,
110.427 + * protected members will not be accessible by virtue of inheritance.
110.428 + * (Protected members may continue to be accessible because of package sharing.)
110.429 + * <li>If the new lookup class is in a different package
110.430 + * than the old one, protected and default (package) members will not be accessible.
110.431 + * <li>If the new lookup class is not within the same package member
110.432 + * as the old one, private members will not be accessible.
110.433 + * <li>If the new lookup class is not accessible to the old lookup class,
110.434 + * then no members, not even public members, will be accessible.
110.435 + * (In all other cases, public members will continue to be accessible.)
110.436 + * </ul>
110.437 + *
110.438 + * @param requestedLookupClass the desired lookup class for the new lookup object
110.439 + * @return a lookup object which reports the desired lookup class
110.440 + * @throws NullPointerException if the argument is null
110.441 + */
110.442 + public Lookup in(Class<?> requestedLookupClass) {
110.443 + requestedLookupClass.getClass(); // null check
110.444 + if (allowedModes == TRUSTED) // IMPL_LOOKUP can make any lookup at all
110.445 + return new Lookup(requestedLookupClass, ALL_MODES);
110.446 + if (requestedLookupClass == this.lookupClass)
110.447 + return this; // keep same capabilities
110.448 + int newModes = (allowedModes & (ALL_MODES & ~PROTECTED));
110.449 + if ((newModes & PACKAGE) != 0
110.450 + && !VerifyAccess.isSamePackage(this.lookupClass, requestedLookupClass)) {
110.451 + newModes &= ~(PACKAGE|PRIVATE);
110.452 + }
110.453 + // Allow nestmate lookups to be created without special privilege:
110.454 + if ((newModes & PRIVATE) != 0
110.455 + && !VerifyAccess.isSamePackageMember(this.lookupClass, requestedLookupClass)) {
110.456 + newModes &= ~PRIVATE;
110.457 + }
110.458 + if (newModes == PUBLIC
110.459 + && !VerifyAccess.isClassAccessible(requestedLookupClass, this.lookupClass)) {
110.460 + // The requested class it not accessible from the lookup class.
110.461 + // No permissions.
110.462 + newModes = 0;
110.463 + }
110.464 + checkUnprivilegedlookupClass(requestedLookupClass);
110.465 + return new Lookup(requestedLookupClass, newModes);
110.466 + }
110.467 +
110.468 + // Make sure outer class is initialized first.
110.469 + static { IMPL_NAMES.getClass(); }
110.470 +
110.471 + /** Version of lookup which is trusted minimally.
110.472 + * It can only be used to create method handles to
110.473 + * publicly accessible members.
110.474 + */
110.475 + static final Lookup PUBLIC_LOOKUP = new Lookup(Object.class, PUBLIC);
110.476 +
110.477 + /** Package-private version of lookup which is trusted. */
110.478 + static final Lookup IMPL_LOOKUP = new Lookup(Object.class, TRUSTED);
110.479 +
110.480 + private static void checkUnprivilegedlookupClass(Class<?> lookupClass) {
110.481 + String name = lookupClass.getName();
110.482 + if (name.startsWith("java.lang.invoke."))
110.483 + throw newIllegalArgumentException("illegal lookupClass: "+lookupClass);
110.484 + }
110.485 +
110.486 + /**
110.487 + * Displays the name of the class from which lookups are to be made.
110.488 + * (The name is the one reported by {@link java.lang.Class#getName() Class.getName}.)
110.489 + * If there are restrictions on the access permitted to this lookup,
110.490 + * this is indicated by adding a suffix to the class name, consisting
110.491 + * of a slash and a keyword. The keyword represents the strongest
110.492 + * allowed access, and is chosen as follows:
110.493 + * <ul>
110.494 + * <li>If no access is allowed, the suffix is "/noaccess".
110.495 + * <li>If only public access is allowed, the suffix is "/public".
110.496 + * <li>If only public and package access are allowed, the suffix is "/package".
110.497 + * <li>If only public, package, and private access are allowed, the suffix is "/private".
110.498 + * </ul>
110.499 + * If none of the above cases apply, it is the case that full
110.500 + * access (public, package, private, and protected) is allowed.
110.501 + * In this case, no suffix is added.
110.502 + * This is true only of an object obtained originally from
110.503 + * {@link java.lang.invoke.MethodHandles#lookup MethodHandles.lookup}.
110.504 + * Objects created by {@link java.lang.invoke.MethodHandles.Lookup#in Lookup.in}
110.505 + * always have restricted access, and will display a suffix.
110.506 + * <p>
110.507 + * (It may seem strange that protected access should be
110.508 + * stronger than private access. Viewed independently from
110.509 + * package access, protected access is the first to be lost,
110.510 + * because it requires a direct subclass relationship between
110.511 + * caller and callee.)
110.512 + * @see #in
110.513 + */
110.514 + @Override
110.515 + public String toString() {
110.516 + String cname = lookupClass.getName();
110.517 + switch (allowedModes) {
110.518 + case 0: // no privileges
110.519 + return cname + "/noaccess";
110.520 + case PUBLIC:
110.521 + return cname + "/public";
110.522 + case PUBLIC|PACKAGE:
110.523 + return cname + "/package";
110.524 + case ALL_MODES & ~PROTECTED:
110.525 + return cname + "/private";
110.526 + case ALL_MODES:
110.527 + return cname;
110.528 + case TRUSTED:
110.529 + return "/trusted"; // internal only; not exported
110.530 + default: // Should not happen, but it's a bitfield...
110.531 + cname = cname + "/" + Integer.toHexString(allowedModes);
110.532 + assert(false) : cname;
110.533 + return cname;
110.534 + }
110.535 + }
110.536 +
110.537 + // call this from an entry point method in Lookup with extraFrames=0.
110.538 + private static Class<?> getCallerClassAtEntryPoint() {
110.539 + final int CALLER_DEPTH = 4;
110.540 + // 0: Reflection.getCC, 1: getCallerClassAtEntryPoint,
110.541 + // 2: Lookup.<init>, 3: MethodHandles.*, 4: caller
110.542 + // Note: This should be the only use of getCallerClass in this file.
110.543 + assert(Reflection.getCallerClass(CALLER_DEPTH-1) == MethodHandles.class);
110.544 + return Reflection.getCallerClass(CALLER_DEPTH);
110.545 + }
110.546 +
110.547 + /**
110.548 + * Produces a method handle for a static method.
110.549 + * The type of the method handle will be that of the method.
110.550 + * (Since static methods do not take receivers, there is no
110.551 + * additional receiver argument inserted into the method handle type,
110.552 + * as there would be with {@link #findVirtual findVirtual} or {@link #findSpecial findSpecial}.)
110.553 + * The method and all its argument types must be accessible to the lookup class.
110.554 + * If the method's class has not yet been initialized, that is done
110.555 + * immediately, before the method handle is returned.
110.556 + * <p>
110.557 + * The returned method handle will have
110.558 + * {@linkplain MethodHandle#asVarargsCollector variable arity} if and only if
110.559 + * the method's variable arity modifier bit ({@code 0x0080}) is set.
110.560 + * @param refc the class from which the method is accessed
110.561 + * @param name the name of the method
110.562 + * @param type the type of the method
110.563 + * @return the desired method handle
110.564 + * @throws NoSuchMethodException if the method does not exist
110.565 + * @throws IllegalAccessException if access checking fails, or if the method is not {@code static}
110.566 + * @exception SecurityException if a security manager is present and it
110.567 + * <a href="MethodHandles.Lookup.html#secmgr">refuses access</a>
110.568 + * @throws NullPointerException if any argument is null
110.569 + */
110.570 + public
110.571 + MethodHandle findStatic(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
110.572 + MemberName method = resolveOrFail(refc, name, type, true);
110.573 + checkMethod(refc, method, true);
110.574 + return MethodHandleImpl.findMethod(method, false, lookupClassOrNull());
110.575 + }
110.576 +
110.577 + /**
110.578 + * Produces a method handle for a virtual method.
110.579 + * The type of the method handle will be that of the method,
110.580 + * with the receiver type (usually {@code refc}) prepended.
110.581 + * The method and all its argument types must be accessible to the lookup class.
110.582 + * <p>
110.583 + * When called, the handle will treat the first argument as a receiver
110.584 + * and dispatch on the receiver's type to determine which method
110.585 + * implementation to enter.
110.586 + * (The dispatching action is identical with that performed by an
110.587 + * {@code invokevirtual} or {@code invokeinterface} instruction.)
110.588 + * <p>
110.589 + * The returned method handle will have
110.590 + * {@linkplain MethodHandle#asVarargsCollector variable arity} if and only if
110.591 + * the method's variable arity modifier bit ({@code 0x0080}) is set.
110.592 + * <p>
110.593 + * Because of the general equivalence between {@code invokevirtual}
110.594 + * instructions and method handles produced by {@code findVirtual},
110.595 + * if the class is {@code MethodHandle} and the name string is
110.596 + * {@code invokeExact} or {@code invokeGeneric}, the resulting
110.597 + * method handle is equivalent to one produced by
110.598 + * {@link java.lang.invoke.MethodHandles#exactInvoker MethodHandles.exactInvoker} or
110.599 + * {@link java.lang.invoke.MethodHandles#genericInvoker MethodHandles.genericInvoker}
110.600 + * with the same {@code type} argument.
110.601 + *
110.602 + * @param refc the class or interface from which the method is accessed
110.603 + * @param name the name of the method
110.604 + * @param type the type of the method, with the receiver argument omitted
110.605 + * @return the desired method handle
110.606 + * @throws NoSuchMethodException if the method does not exist
110.607 + * @throws IllegalAccessException if access checking fails, or if the method is {@code static}
110.608 + * @exception SecurityException if a security manager is present and it
110.609 + * <a href="MethodHandles.Lookup.html#secmgr">refuses access</a>
110.610 + * @throws NullPointerException if any argument is null
110.611 + */
110.612 + public MethodHandle findVirtual(Class<?> refc, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
110.613 + MemberName method = resolveOrFail(refc, name, type, false);
110.614 + checkMethod(refc, method, false);
110.615 + MethodHandle mh = MethodHandleImpl.findMethod(method, true, lookupClassOrNull());
110.616 + return restrictProtectedReceiver(method, mh);
110.617 + }
110.618 +
110.619 + /**
110.620 + * Produces a method handle which creates an object and initializes it, using
110.621 + * the constructor of the specified type.
110.622 + * The parameter types of the method handle will be those of the constructor,
110.623 + * while the return type will be a reference to the constructor's class.
110.624 + * The constructor and all its argument types must be accessible to the lookup class.
110.625 + * If the constructor's class has not yet been initialized, that is done
110.626 + * immediately, before the method handle is returned.
110.627 + * <p>
110.628 + * Note: The requested type must have a return type of {@code void}.
110.629 + * This is consistent with the JVM's treatment of constructor type descriptors.
110.630 + * <p>
110.631 + * The returned method handle will have
110.632 + * {@linkplain MethodHandle#asVarargsCollector variable arity} if and only if
110.633 + * the constructor's variable arity modifier bit ({@code 0x0080}) is set.
110.634 + * @param refc the class or interface from which the method is accessed
110.635 + * @param type the type of the method, with the receiver argument omitted, and a void return type
110.636 + * @return the desired method handle
110.637 + * @throws NoSuchMethodException if the constructor does not exist
110.638 + * @throws IllegalAccessException if access checking fails
110.639 + * @exception SecurityException if a security manager is present and it
110.640 + * <a href="MethodHandles.Lookup.html#secmgr">refuses access</a>
110.641 + * @throws NullPointerException if any argument is null
110.642 + */
110.643 + public MethodHandle findConstructor(Class<?> refc, MethodType type) throws NoSuchMethodException, IllegalAccessException {
110.644 + String name = "<init>";
110.645 + MemberName ctor = resolveOrFail(refc, name, type, false, false, lookupClassOrNull());
110.646 + assert(ctor.isConstructor());
110.647 + checkAccess(refc, ctor);
110.648 + MethodHandle rawMH = MethodHandleImpl.findMethod(ctor, false, lookupClassOrNull());
110.649 + MethodHandle allocMH = MethodHandleImpl.makeAllocator(rawMH);
110.650 + return fixVarargs(allocMH, rawMH);
110.651 + }
110.652 +
110.653 + /** Return a version of MH which matches matchMH w.r.t. isVarargsCollector. */
110.654 + private static MethodHandle fixVarargs(MethodHandle mh, MethodHandle matchMH) {
110.655 + boolean va1 = mh.isVarargsCollector();
110.656 + boolean va2 = matchMH.isVarargsCollector();
110.657 + if (va1 == va2) {
110.658 + return mh;
110.659 + } else if (va2) {
110.660 + MethodType type = mh.type();
110.661 + int arity = type.parameterCount();
110.662 + return mh.asVarargsCollector(type.parameterType(arity-1));
110.663 + } else {
110.664 + throw new InternalError("already varargs, but template is not: "+mh);
110.665 + }
110.666 + }
110.667 +
110.668 + /**
110.669 + * Produces an early-bound method handle for a virtual method,
110.670 + * as if called from an {@code invokespecial}
110.671 + * instruction from {@code caller}.
110.672 + * The type of the method handle will be that of the method,
110.673 + * with a suitably restricted receiver type (such as {@code caller}) prepended.
110.674 + * The method and all its argument types must be accessible
110.675 + * to the caller.
110.676 + * <p>
110.677 + * When called, the handle will treat the first argument as a receiver,
110.678 + * but will not dispatch on the receiver's type.
110.679 + * (This direct invocation action is identical with that performed by an
110.680 + * {@code invokespecial} instruction.)
110.681 + * <p>
110.682 + * If the explicitly specified caller class is not identical with the
110.683 + * lookup class, or if this lookup object does not have private access
110.684 + * privileges, the access fails.
110.685 + * <p>
110.686 + * The returned method handle will have
110.687 + * {@linkplain MethodHandle#asVarargsCollector variable arity} if and only if
110.688 + * the method's variable arity modifier bit ({@code 0x0080}) is set.
110.689 + * @param refc the class or interface from which the method is accessed
110.690 + * @param name the name of the method (which must not be "<init>")
110.691 + * @param type the type of the method, with the receiver argument omitted
110.692 + * @param specialCaller the proposed calling class to perform the {@code invokespecial}
110.693 + * @return the desired method handle
110.694 + * @throws NoSuchMethodException if the method does not exist
110.695 + * @throws IllegalAccessException if access checking fails
110.696 + * @exception SecurityException if a security manager is present and it
110.697 + * <a href="MethodHandles.Lookup.html#secmgr">refuses access</a>
110.698 + * @throws NullPointerException if any argument is null
110.699 + */
110.700 + public MethodHandle findSpecial(Class<?> refc, String name, MethodType type,
110.701 + Class<?> specialCaller) throws NoSuchMethodException, IllegalAccessException {
110.702 + checkSpecialCaller(specialCaller);
110.703 + MemberName method = resolveOrFail(refc, name, type, false, false, specialCaller);
110.704 + checkMethod(refc, method, false);
110.705 + MethodHandle mh = MethodHandleImpl.findMethod(method, false, specialCaller);
110.706 + return restrictReceiver(method, mh, specialCaller);
110.707 + }
110.708 +
110.709 + /**
110.710 + * Produces a method handle giving read access to a non-static field.
110.711 + * The type of the method handle will have a return type of the field's
110.712 + * value type.
110.713 + * The method handle's single argument will be the instance containing
110.714 + * the field.
110.715 + * Access checking is performed immediately on behalf of the lookup class.
110.716 + * @param refc the class or interface from which the method is accessed
110.717 + * @param name the field's name
110.718 + * @param type the field's type
110.719 + * @return a method handle which can load values from the field
110.720 + * @throws NoSuchFieldException if the field does not exist
110.721 + * @throws IllegalAccessException if access checking fails, or if the field is {@code static}
110.722 + * @exception SecurityException if a security manager is present and it
110.723 + * <a href="MethodHandles.Lookup.html#secmgr">refuses access</a>
110.724 + * @throws NullPointerException if any argument is null
110.725 + */
110.726 + public MethodHandle findGetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
110.727 + return makeAccessor(refc, name, type, false, false);
110.728 + }
110.729 +
110.730 + /**
110.731 + * Produces a method handle giving write access to a non-static field.
110.732 + * The type of the method handle will have a void return type.
110.733 + * The method handle will take two arguments, the instance containing
110.734 + * the field, and the value to be stored.
110.735 + * The second argument will be of the field's value type.
110.736 + * Access checking is performed immediately on behalf of the lookup class.
110.737 + * @param refc the class or interface from which the method is accessed
110.738 + * @param name the field's name
110.739 + * @param type the field's type
110.740 + * @return a method handle which can store values into the field
110.741 + * @throws NoSuchFieldException if the field does not exist
110.742 + * @throws IllegalAccessException if access checking fails, or if the field is {@code static}
110.743 + * @exception SecurityException if a security manager is present and it
110.744 + * <a href="MethodHandles.Lookup.html#secmgr">refuses access</a>
110.745 + * @throws NullPointerException if any argument is null
110.746 + */
110.747 + public MethodHandle findSetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
110.748 + return makeAccessor(refc, name, type, false, true);
110.749 + }
110.750 +
110.751 + /**
110.752 + * Produces a method handle giving read access to a static field.
110.753 + * The type of the method handle will have a return type of the field's
110.754 + * value type.
110.755 + * The method handle will take no arguments.
110.756 + * Access checking is performed immediately on behalf of the lookup class.
110.757 + * @param refc the class or interface from which the method is accessed
110.758 + * @param name the field's name
110.759 + * @param type the field's type
110.760 + * @return a method handle which can load values from the field
110.761 + * @throws NoSuchFieldException if the field does not exist
110.762 + * @throws IllegalAccessException if access checking fails, or if the field is not {@code static}
110.763 + * @exception SecurityException if a security manager is present and it
110.764 + * <a href="MethodHandles.Lookup.html#secmgr">refuses access</a>
110.765 + * @throws NullPointerException if any argument is null
110.766 + */
110.767 + public MethodHandle findStaticGetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
110.768 + return makeAccessor(refc, name, type, true, false);
110.769 + }
110.770 +
110.771 + /**
110.772 + * Produces a method handle giving write access to a static field.
110.773 + * The type of the method handle will have a void return type.
110.774 + * The method handle will take a single
110.775 + * argument, of the field's value type, the value to be stored.
110.776 + * Access checking is performed immediately on behalf of the lookup class.
110.777 + * @param refc the class or interface from which the method is accessed
110.778 + * @param name the field's name
110.779 + * @param type the field's type
110.780 + * @return a method handle which can store values into the field
110.781 + * @throws NoSuchFieldException if the field does not exist
110.782 + * @throws IllegalAccessException if access checking fails, or if the field is not {@code static}
110.783 + * @exception SecurityException if a security manager is present and it
110.784 + * <a href="MethodHandles.Lookup.html#secmgr">refuses access</a>
110.785 + * @throws NullPointerException if any argument is null
110.786 + */
110.787 + public MethodHandle findStaticSetter(Class<?> refc, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
110.788 + return makeAccessor(refc, name, type, true, true);
110.789 + }
110.790 +
110.791 + /**
110.792 + * Produces an early-bound method handle for a non-static method.
110.793 + * The receiver must have a supertype {@code defc} in which a method
110.794 + * of the given name and type is accessible to the lookup class.
110.795 + * The method and all its argument types must be accessible to the lookup class.
110.796 + * The type of the method handle will be that of the method,
110.797 + * without any insertion of an additional receiver parameter.
110.798 + * The given receiver will be bound into the method handle,
110.799 + * so that every call to the method handle will invoke the
110.800 + * requested method on the given receiver.
110.801 + * <p>
110.802 + * The returned method handle will have
110.803 + * {@linkplain MethodHandle#asVarargsCollector variable arity} if and only if
110.804 + * the method's variable arity modifier bit ({@code 0x0080}) is set
110.805 + * <em>and</em> the trailing array argument is not the only argument.
110.806 + * (If the trailing array argument is the only argument,
110.807 + * the given receiver value will be bound to it.)
110.808 + * <p>
110.809 + * This is equivalent to the following code:
110.810 + * <blockquote><pre>
110.811 +MethodHandle mh0 = {@link #findVirtual findVirtual}(defc, name, type);
110.812 +MethodHandle mh1 = mh0.{@link MethodHandle#bindTo bindTo}(receiver);
110.813 +MethodType mt1 = mh1.type();
110.814 +if (mh0.isVarargsCollector() && mt1.parameterCount() > 0) {
110.815 + mh1 = mh1.asVarargsCollector(mt1.parameterType(mt1.parameterCount()-1));
110.816 +return mh1;
110.817 + * </pre></blockquote>
110.818 + * where {@code defc} is either {@code receiver.getClass()} or a super
110.819 + * type of that class, in which the requested method is accessible
110.820 + * to the lookup class.
110.821 + * (Note that {@code bindTo} does not preserve variable arity.)
110.822 + * @param receiver the object from which the method is accessed
110.823 + * @param name the name of the method
110.824 + * @param type the type of the method, with the receiver argument omitted
110.825 + * @return the desired method handle
110.826 + * @throws NoSuchMethodException if the method does not exist
110.827 + * @throws IllegalAccessException if access checking fails
110.828 + * @exception SecurityException if a security manager is present and it
110.829 + * <a href="MethodHandles.Lookup.html#secmgr">refuses access</a>
110.830 + * @throws NullPointerException if any argument is null
110.831 + */
110.832 + public MethodHandle bind(Object receiver, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException {
110.833 + Class<? extends Object> refc = receiver.getClass(); // may get NPE
110.834 + MemberName method = resolveOrFail(refc, name, type, false);
110.835 + checkMethod(refc, method, false);
110.836 + MethodHandle dmh = MethodHandleImpl.findMethod(method, true, lookupClassOrNull());
110.837 + MethodHandle bmh = MethodHandleImpl.bindReceiver(dmh, receiver);
110.838 + if (bmh == null)
110.839 + throw method.makeAccessException("no access", this);
110.840 + if (dmh.type().parameterCount() == 0)
110.841 + return dmh; // bound the trailing parameter; no varargs possible
110.842 + return fixVarargs(bmh, dmh);
110.843 + }
110.844 +
110.845 + /**
110.846 + * Makes a direct method handle to <i>m</i>, if the lookup class has permission.
110.847 + * If <i>m</i> is non-static, the receiver argument is treated as an initial argument.
110.848 + * If <i>m</i> is virtual, overriding is respected on every call.
110.849 + * Unlike the Core Reflection API, exceptions are <em>not</em> wrapped.
110.850 + * The type of the method handle will be that of the method,
110.851 + * with the receiver type prepended (but only if it is non-static).
110.852 + * If the method's {@code accessible} flag is not set,
110.853 + * access checking is performed immediately on behalf of the lookup class.
110.854 + * If <i>m</i> is not public, do not share the resulting handle with untrusted parties.
110.855 + * <p>
110.856 + * The returned method handle will have
110.857 + * {@linkplain MethodHandle#asVarargsCollector variable arity} if and only if
110.858 + * the method's variable arity modifier bit ({@code 0x0080}) is set.
110.859 + * @param m the reflected method
110.860 + * @return a method handle which can invoke the reflected method
110.861 + * @throws IllegalAccessException if access checking fails
110.862 + * @throws NullPointerException if the argument is null
110.863 + */
110.864 + public MethodHandle unreflect(Method m) throws IllegalAccessException {
110.865 + MemberName method = new MemberName(m);
110.866 + assert(method.isMethod());
110.867 + if (!m.isAccessible()) checkMethod(method.getDeclaringClass(), method, method.isStatic());
110.868 + MethodHandle mh = MethodHandleImpl.findMethod(method, true, lookupClassOrNull());
110.869 + if (!m.isAccessible()) mh = restrictProtectedReceiver(method, mh);
110.870 + return mh;
110.871 + }
110.872 +
110.873 + /**
110.874 + * Produces a method handle for a reflected method.
110.875 + * It will bypass checks for overriding methods on the receiver,
110.876 + * as if by a {@code invokespecial} instruction from within the {@code specialCaller}.
110.877 + * The type of the method handle will be that of the method,
110.878 + * with the special caller type prepended (and <em>not</em> the receiver of the method).
110.879 + * If the method's {@code accessible} flag is not set,
110.880 + * access checking is performed immediately on behalf of the lookup class,
110.881 + * as if {@code invokespecial} instruction were being linked.
110.882 + * <p>
110.883 + * The returned method handle will have
110.884 + * {@linkplain MethodHandle#asVarargsCollector variable arity} if and only if
110.885 + * the method's variable arity modifier bit ({@code 0x0080}) is set.
110.886 + * @param m the reflected method
110.887 + * @param specialCaller the class nominally calling the method
110.888 + * @return a method handle which can invoke the reflected method
110.889 + * @throws IllegalAccessException if access checking fails
110.890 + * @throws NullPointerException if any argument is null
110.891 + */
110.892 + public MethodHandle unreflectSpecial(Method m, Class<?> specialCaller) throws IllegalAccessException {
110.893 + checkSpecialCaller(specialCaller);
110.894 + MemberName method = new MemberName(m);
110.895 + assert(method.isMethod());
110.896 + // ignore m.isAccessible: this is a new kind of access
110.897 + checkMethod(m.getDeclaringClass(), method, false);
110.898 + MethodHandle mh = MethodHandleImpl.findMethod(method, false, lookupClassOrNull());
110.899 + return restrictReceiver(method, mh, specialCaller);
110.900 + }
110.901 +
110.902 + /**
110.903 + * Produces a method handle for a reflected constructor.
110.904 + * The type of the method handle will be that of the constructor,
110.905 + * with the return type changed to the declaring class.
110.906 + * The method handle will perform a {@code newInstance} operation,
110.907 + * creating a new instance of the constructor's class on the
110.908 + * arguments passed to the method handle.
110.909 + * <p>
110.910 + * If the constructor's {@code accessible} flag is not set,
110.911 + * access checking is performed immediately on behalf of the lookup class.
110.912 + * <p>
110.913 + * The returned method handle will have
110.914 + * {@linkplain MethodHandle#asVarargsCollector variable arity} if and only if
110.915 + * the constructor's variable arity modifier bit ({@code 0x0080}) is set.
110.916 + * @param c the reflected constructor
110.917 + * @return a method handle which can invoke the reflected constructor
110.918 + * @throws IllegalAccessException if access checking fails
110.919 + * @throws NullPointerException if the argument is null
110.920 + */
110.921 + public MethodHandle unreflectConstructor(Constructor c) throws IllegalAccessException {
110.922 + MemberName ctor = new MemberName(c);
110.923 + assert(ctor.isConstructor());
110.924 + if (!c.isAccessible()) checkAccess(c.getDeclaringClass(), ctor);
110.925 + MethodHandle rawCtor = MethodHandleImpl.findMethod(ctor, false, lookupClassOrNull());
110.926 + MethodHandle allocator = MethodHandleImpl.makeAllocator(rawCtor);
110.927 + return fixVarargs(allocator, rawCtor);
110.928 + }
110.929 +
110.930 + /**
110.931 + * Produces a method handle giving read access to a reflected field.
110.932 + * The type of the method handle will have a return type of the field's
110.933 + * value type.
110.934 + * If the field is static, the method handle will take no arguments.
110.935 + * Otherwise, its single argument will be the instance containing
110.936 + * the field.
110.937 + * If the field's {@code accessible} flag is not set,
110.938 + * access checking is performed immediately on behalf of the lookup class.
110.939 + * @param f the reflected field
110.940 + * @return a method handle which can load values from the reflected field
110.941 + * @throws IllegalAccessException if access checking fails
110.942 + * @throws NullPointerException if the argument is null
110.943 + */
110.944 + public MethodHandle unreflectGetter(Field f) throws IllegalAccessException {
110.945 + return makeAccessor(f.getDeclaringClass(), new MemberName(f), f.isAccessible(), false);
110.946 + }
110.947 +
110.948 + /**
110.949 + * Produces a method handle giving write access to a reflected field.
110.950 + * The type of the method handle will have a void return type.
110.951 + * If the field is static, the method handle will take a single
110.952 + * argument, of the field's value type, the value to be stored.
110.953 + * Otherwise, the two arguments will be the instance containing
110.954 + * the field, and the value to be stored.
110.955 + * If the field's {@code accessible} flag is not set,
110.956 + * access checking is performed immediately on behalf of the lookup class.
110.957 + * @param f the reflected field
110.958 + * @return a method handle which can store values into the reflected field
110.959 + * @throws IllegalAccessException if access checking fails
110.960 + * @throws NullPointerException if the argument is null
110.961 + */
110.962 + public MethodHandle unreflectSetter(Field f) throws IllegalAccessException {
110.963 + return makeAccessor(f.getDeclaringClass(), new MemberName(f), f.isAccessible(), true);
110.964 + }
110.965 +
110.966 + /// Helper methods, all package-private.
110.967 +
110.968 + MemberName resolveOrFail(Class<?> refc, String name, Class<?> type, boolean isStatic) throws NoSuchFieldException, IllegalAccessException {
110.969 + checkSymbolicClass(refc); // do this before attempting to resolve
110.970 + name.getClass(); type.getClass(); // NPE
110.971 + int mods = (isStatic ? Modifier.STATIC : 0);
110.972 + return IMPL_NAMES.resolveOrFail(new MemberName(refc, name, type, mods), true, lookupClassOrNull(),
110.973 + NoSuchFieldException.class);
110.974 + }
110.975 +
110.976 + MemberName resolveOrFail(Class<?> refc, String name, MethodType type, boolean isStatic) throws NoSuchMethodException, IllegalAccessException {
110.977 + checkSymbolicClass(refc); // do this before attempting to resolve
110.978 + name.getClass(); type.getClass(); // NPE
110.979 + int mods = (isStatic ? Modifier.STATIC : 0);
110.980 + return IMPL_NAMES.resolveOrFail(new MemberName(refc, name, type, mods), true, lookupClassOrNull(),
110.981 + NoSuchMethodException.class);
110.982 + }
110.983 +
110.984 + MemberName resolveOrFail(Class<?> refc, String name, MethodType type, boolean isStatic,
110.985 + boolean searchSupers, Class<?> specialCaller) throws NoSuchMethodException, IllegalAccessException {
110.986 + checkSymbolicClass(refc); // do this before attempting to resolve
110.987 + name.getClass(); type.getClass(); // NPE
110.988 + int mods = (isStatic ? Modifier.STATIC : 0);
110.989 + return IMPL_NAMES.resolveOrFail(new MemberName(refc, name, type, mods), searchSupers, specialCaller,
110.990 + NoSuchMethodException.class);
110.991 + }
110.992 +
110.993 + void checkSymbolicClass(Class<?> refc) throws IllegalAccessException {
110.994 + Class<?> caller = lookupClassOrNull();
110.995 + if (caller != null && !VerifyAccess.isClassAccessible(refc, caller))
110.996 + throw new MemberName(refc).makeAccessException("symbolic reference class is not public", this);
110.997 + }
110.998 +
110.999 + void checkMethod(Class<?> refc, MemberName m, boolean wantStatic) throws IllegalAccessException {
110.1000 + String message;
110.1001 + if (m.isConstructor())
110.1002 + message = "expected a method, not a constructor";
110.1003 + else if (!m.isMethod())
110.1004 + message = "expected a method";
110.1005 + else if (wantStatic != m.isStatic())
110.1006 + message = wantStatic ? "expected a static method" : "expected a non-static method";
110.1007 + else
110.1008 + { checkAccess(refc, m); return; }
110.1009 + throw m.makeAccessException(message, this);
110.1010 + }
110.1011 +
110.1012 + void checkAccess(Class<?> refc, MemberName m) throws IllegalAccessException {
110.1013 + int allowedModes = this.allowedModes;
110.1014 + if (allowedModes == TRUSTED) return;
110.1015 + int mods = m.getModifiers();
110.1016 + if (Modifier.isPublic(mods) && Modifier.isPublic(refc.getModifiers()) && allowedModes != 0)
110.1017 + return; // common case
110.1018 + int requestedModes = fixmods(mods); // adjust 0 => PACKAGE
110.1019 + if ((requestedModes & allowedModes) != 0
110.1020 + && VerifyAccess.isMemberAccessible(refc, m.getDeclaringClass(),
110.1021 + mods, lookupClass()))
110.1022 + return;
110.1023 + if (((requestedModes & ~allowedModes) & PROTECTED) != 0
110.1024 + && VerifyAccess.isSamePackage(m.getDeclaringClass(), lookupClass()))
110.1025 + // Protected members can also be checked as if they were package-private.
110.1026 + return;
110.1027 + throw m.makeAccessException(accessFailedMessage(refc, m), this);
110.1028 + }
110.1029 +
110.1030 + String accessFailedMessage(Class<?> refc, MemberName m) {
110.1031 + Class<?> defc = m.getDeclaringClass();
110.1032 + int mods = m.getModifiers();
110.1033 + // check the class first:
110.1034 + boolean classOK = (Modifier.isPublic(defc.getModifiers()) &&
110.1035 + (defc == refc ||
110.1036 + Modifier.isPublic(refc.getModifiers())));
110.1037 + if (!classOK && (allowedModes & PACKAGE) != 0) {
110.1038 + classOK = (VerifyAccess.isClassAccessible(defc, lookupClass()) &&
110.1039 + (defc == refc ||
110.1040 + VerifyAccess.isClassAccessible(refc, lookupClass())));
110.1041 + }
110.1042 + if (!classOK)
110.1043 + return "class is not public";
110.1044 + if (Modifier.isPublic(mods))
110.1045 + return "access to public member failed"; // (how?)
110.1046 + if (Modifier.isPrivate(mods))
110.1047 + return "member is private";
110.1048 + if (Modifier.isProtected(mods))
110.1049 + return "member is protected";
110.1050 + return "member is private to package";
110.1051 + }
110.1052 +
110.1053 + private static final boolean ALLOW_NESTMATE_ACCESS = false;
110.1054 +
110.1055 + void checkSpecialCaller(Class<?> specialCaller) throws IllegalAccessException {
110.1056 + if (allowedModes == TRUSTED) return;
110.1057 + if ((allowedModes & PRIVATE) == 0
110.1058 + || (specialCaller != lookupClass()
110.1059 + && !(ALLOW_NESTMATE_ACCESS &&
110.1060 + VerifyAccess.isSamePackageMember(specialCaller, lookupClass()))))
110.1061 + throw new MemberName(specialCaller).
110.1062 + makeAccessException("no private access for invokespecial", this);
110.1063 + }
110.1064 +
110.1065 + MethodHandle restrictProtectedReceiver(MemberName method, MethodHandle mh) throws IllegalAccessException {
110.1066 + // The accessing class only has the right to use a protected member
110.1067 + // on itself or a subclass. Enforce that restriction, from JVMS 5.4.4, etc.
110.1068 + if (!method.isProtected() || method.isStatic()
110.1069 + || allowedModes == TRUSTED
110.1070 + || method.getDeclaringClass() == lookupClass()
110.1071 + || (ALLOW_NESTMATE_ACCESS &&
110.1072 + VerifyAccess.isSamePackageMember(method.getDeclaringClass(), lookupClass())))
110.1073 + return mh;
110.1074 + else
110.1075 + return restrictReceiver(method, mh, lookupClass());
110.1076 + }
110.1077 + MethodHandle restrictReceiver(MemberName method, MethodHandle mh, Class<?> caller) throws IllegalAccessException {
110.1078 + assert(!method.isStatic());
110.1079 + Class<?> defc = method.getDeclaringClass(); // receiver type of mh is too wide
110.1080 + if (defc.isInterface() || !defc.isAssignableFrom(caller)) {
110.1081 + throw method.makeAccessException("caller class must be a subclass below the method", caller);
110.1082 + }
110.1083 + MethodType rawType = mh.type();
110.1084 + if (rawType.parameterType(0) == caller) return mh;
110.1085 + MethodType narrowType = rawType.changeParameterType(0, caller);
110.1086 + MethodHandle narrowMH = MethodHandleImpl.convertArguments(mh, narrowType, rawType, null);
110.1087 + return fixVarargs(narrowMH, mh);
110.1088 + }
110.1089 +
110.1090 + MethodHandle makeAccessor(Class<?> refc, String name, Class<?> type,
110.1091 + boolean isStatic, boolean isSetter) throws NoSuchFieldException, IllegalAccessException {
110.1092 + MemberName field = resolveOrFail(refc, name, type, isStatic);
110.1093 + if (isStatic != field.isStatic())
110.1094 + throw field.makeAccessException(isStatic
110.1095 + ? "expected a static field"
110.1096 + : "expected a non-static field", this);
110.1097 + return makeAccessor(refc, field, false, isSetter);
110.1098 + }
110.1099 +
110.1100 + MethodHandle makeAccessor(Class<?> refc, MemberName field,
110.1101 + boolean trusted, boolean isSetter) throws IllegalAccessException {
110.1102 + assert(field.isField());
110.1103 + if (trusted)
110.1104 + return MethodHandleImpl.accessField(field, isSetter, lookupClassOrNull());
110.1105 + checkAccess(refc, field);
110.1106 + MethodHandle mh = MethodHandleImpl.accessField(field, isSetter, lookupClassOrNull());
110.1107 + return restrictProtectedReceiver(field, mh);
110.1108 + }
110.1109 + }
110.1110 +
110.1111 + /**
110.1112 + * Produces a method handle giving read access to elements of an array.
110.1113 + * The type of the method handle will have a return type of the array's
110.1114 + * element type. Its first argument will be the array type,
110.1115 + * and the second will be {@code int}.
110.1116 + * @param arrayClass an array type
110.1117 + * @return a method handle which can load values from the given array type
110.1118 + * @throws NullPointerException if the argument is null
110.1119 + * @throws IllegalArgumentException if arrayClass is not an array type
110.1120 + */
110.1121 + public static
110.1122 + MethodHandle arrayElementGetter(Class<?> arrayClass) throws IllegalArgumentException {
110.1123 + return MethodHandleImpl.accessArrayElement(arrayClass, false);
110.1124 + }
110.1125 +
110.1126 + /**
110.1127 + * Produces a method handle giving write access to elements of an array.
110.1128 + * The type of the method handle will have a void return type.
110.1129 + * Its last argument will be the array's element type.
110.1130 + * The first and second arguments will be the array type and int.
110.1131 + * @return a method handle which can store values into the array type
110.1132 + * @throws NullPointerException if the argument is null
110.1133 + * @throws IllegalArgumentException if arrayClass is not an array type
110.1134 + */
110.1135 + public static
110.1136 + MethodHandle arrayElementSetter(Class<?> arrayClass) throws IllegalArgumentException {
110.1137 + return MethodHandleImpl.accessArrayElement(arrayClass, true);
110.1138 + }
110.1139 +
110.1140 + /// method handle invocation (reflective style)
110.1141 +
110.1142 + /**
110.1143 + * Produces a method handle which will invoke any method handle of the
110.1144 + * given {@code type} on a standard set of {@code Object} type arguments
110.1145 + * and a single trailing {@code Object[]} array.
110.1146 + * The resulting invoker will be a method handle with the following
110.1147 + * arguments:
110.1148 + * <ul>
110.1149 + * <li>a single {@code MethodHandle} target
110.1150 + * <li>zero or more {@code Object} values (counted by {@code objectArgCount})
110.1151 + * <li>an {@code Object[]} array containing more arguments
110.1152 + * </ul>
110.1153 + * <p>
110.1154 + * The invoker will behave like a call to {@link MethodHandle#invokeGeneric invokeGeneric} with
110.1155 + * the indicated {@code type}.
110.1156 + * That is, if the target is exactly of the given {@code type}, it will behave
110.1157 + * like {@code invokeExact}; otherwise it behave as if {@link MethodHandle#asType asType}
110.1158 + * is used to convert the target to the required {@code type}.
110.1159 + * <p>
110.1160 + * The type of the returned invoker will not be the given {@code type}, but rather
110.1161 + * will have all parameter and return types replaced by {@code Object}, except for
110.1162 + * the last parameter type, which will be the array type {@code Object[]}.
110.1163 + * <p>
110.1164 + * Before invoking its target, the invoker will spread the varargs array, apply
110.1165 + * reference casts as necessary, and unbox and widen primitive arguments.
110.1166 + * The return value of the invoker will be an {@code Object} reference,
110.1167 + * boxing a primitive value if the original type returns a primitive,
110.1168 + * and always null if the original type returns void.
110.1169 + * <p>
110.1170 + * This method is equivalent to the following code (though it may be more efficient):
110.1171 + * <p><blockquote><pre>
110.1172 +MethodHandle invoker = MethodHandles.genericInvoker(type);
110.1173 +int spreadArgCount = type.parameterCount - objectArgCount;
110.1174 +invoker = invoker.asSpreader(Object[].class, spreadArgCount);
110.1175 +return invoker;
110.1176 + * </pre></blockquote>
110.1177 + * <p>
110.1178 + * This method throws no reflective or security exceptions.
110.1179 + * @param type the desired target type
110.1180 + * @param objectArgCount number of fixed (non-varargs) {@code Object} arguments
110.1181 + * @return a method handle suitable for invoking any method handle of the given type
110.1182 + */
110.1183 + static public
110.1184 + MethodHandle spreadInvoker(MethodType type, int objectArgCount) {
110.1185 + if (objectArgCount < 0 || objectArgCount > type.parameterCount())
110.1186 + throw new IllegalArgumentException("bad argument count "+objectArgCount);
110.1187 + return type.invokers().spreadInvoker(objectArgCount);
110.1188 + }
110.1189 +
110.1190 + /**
110.1191 + * Produces a special <em>invoker method handle</em> which can be used to
110.1192 + * invoke any method handle of the given type, as if by {@code invokeExact}.
110.1193 + * The resulting invoker will have a type which is
110.1194 + * exactly equal to the desired type, except that it will accept
110.1195 + * an additional leading argument of type {@code MethodHandle}.
110.1196 + * <p>
110.1197 + * This method is equivalent to the following code (though it may be more efficient):
110.1198 + * <p><blockquote><pre>
110.1199 +publicLookup().findVirtual(MethodHandle.class, "invokeExact", type)
110.1200 + * </pre></blockquote>
110.1201 + *
110.1202 + * <p style="font-size:smaller;">
110.1203 + * <em>Discussion:</em>
110.1204 + * Invoker method handles can be useful when working with variable method handles
110.1205 + * of unknown types.
110.1206 + * For example, to emulate an {@code invokeExact} call to a variable method
110.1207 + * handle {@code M}, extract its type {@code T},
110.1208 + * look up the invoker method {@code X} for {@code T},
110.1209 + * and call the invoker method, as {@code X.invokeGeneric(T, A...)}.
110.1210 + * (It would not work to call {@code X.invokeExact}, since the type {@code T}
110.1211 + * is unknown.)
110.1212 + * If spreading, collecting, or other argument transformations are required,
110.1213 + * they can be applied once to the invoker {@code X} and reused on many {@code M}
110.1214 + * method handle values, as long as they are compatible with the type of {@code X}.
110.1215 + * <p>
110.1216 + * <em>(Note: The invoker method is not available via the Core Reflection API.
110.1217 + * An attempt to call {@linkplain java.lang.reflect.Method#invoke Method.invoke}
110.1218 + * on the declared {@code invokeExact} or {@code invokeGeneric} method will raise an
110.1219 + * {@link java.lang.UnsupportedOperationException UnsupportedOperationException}.)</em>
110.1220 + * <p>
110.1221 + * This method throws no reflective or security exceptions.
110.1222 + * @param type the desired target type
110.1223 + * @return a method handle suitable for invoking any method handle of the given type
110.1224 + */
110.1225 + static public
110.1226 + MethodHandle exactInvoker(MethodType type) {
110.1227 + return type.invokers().exactInvoker();
110.1228 + }
110.1229 +
110.1230 + /**
110.1231 + * Produces a special <em>invoker method handle</em> which can be used to
110.1232 + * invoke any method handle of the given type, as if by {@code invokeGeneric}.
110.1233 + * The resulting invoker will have a type which is
110.1234 + * exactly equal to the desired type, except that it will accept
110.1235 + * an additional leading argument of type {@code MethodHandle}.
110.1236 + * <p>
110.1237 + * Before invoking its target, the invoker will apply reference casts as
110.1238 + * necessary and unbox and widen primitive arguments, as if by {@link #convertArguments convertArguments}.
110.1239 + * The return value of the invoker will be an {@code Object} reference,
110.1240 + * boxing a primitive value if the original type returns a primitive,
110.1241 + * and always null if the original type returns void.
110.1242 + * <p>
110.1243 + * This method is equivalent to the following code (though it may be more efficient):
110.1244 + * <p><blockquote><pre>
110.1245 +publicLookup().findVirtual(MethodHandle.class, "invokeGeneric", type)
110.1246 + * </pre></blockquote>
110.1247 + * <p>
110.1248 + * This method throws no reflective or security exceptions.
110.1249 + * @param type the desired target type
110.1250 + * @return a method handle suitable for invoking any method handle convertible to the given type
110.1251 + */
110.1252 + static public
110.1253 + MethodHandle genericInvoker(MethodType type) {
110.1254 + return type.invokers().genericInvoker();
110.1255 + }
110.1256 +
110.1257 + /**
110.1258 + * Perform value checking, exactly as if for an adapted method handle.
110.1259 + * It is assumed that the given value is either null, of type T0,
110.1260 + * or (if T0 is primitive) of the wrapper type corresponding to T0.
110.1261 + * The following checks and conversions are made:
110.1262 + * <ul>
110.1263 + * <li>If T0 and T1 are references, then a cast to T1 is applied.
110.1264 + * (The types do not need to be related in any particular way.)
110.1265 + * <li>If T0 and T1 are primitives, then a widening or narrowing
110.1266 + * conversion is applied, if one exists.
110.1267 + * <li>If T0 is a primitive and T1 a reference, and
110.1268 + * T0 has a wrapper type TW, a boxing conversion to TW is applied,
110.1269 + * possibly followed by a reference conversion.
110.1270 + * T1 must be TW or a supertype.
110.1271 + * <li>If T0 is a reference and T1 a primitive, and
110.1272 + * T1 has a wrapper type TW, an unboxing conversion is applied,
110.1273 + * possibly preceded by a reference conversion.
110.1274 + * T0 must be TW or a supertype.
110.1275 + * <li>If T1 is void, the return value is discarded
110.1276 + * <li>If T0 is void and T1 a reference, a null value is introduced.
110.1277 + * <li>If T0 is void and T1 a primitive, a zero value is introduced.
110.1278 + * </ul>
110.1279 + * If the value is discarded, null will be returned.
110.1280 + * @param valueType
110.1281 + * @param value
110.1282 + * @return the value, converted if necessary
110.1283 + * @throws java.lang.ClassCastException if a cast fails
110.1284 + */
110.1285 + static
110.1286 + <T0, T1> T1 checkValue(Class<T0> t0, Class<T1> t1, Object value)
110.1287 + throws ClassCastException
110.1288 + {
110.1289 + if (t0 == t1) {
110.1290 + // no conversion needed; just reassert the same type
110.1291 + if (t0.isPrimitive())
110.1292 + return Wrapper.asPrimitiveType(t1).cast(value);
110.1293 + else
110.1294 + return Wrapper.OBJECT.convert(value, t1);
110.1295 + }
110.1296 + boolean prim0 = t0.isPrimitive(), prim1 = t1.isPrimitive();
110.1297 + if (!prim0) {
110.1298 + // check contract with caller
110.1299 + Wrapper.OBJECT.convert(value, t0);
110.1300 + if (!prim1) {
110.1301 + return Wrapper.OBJECT.convert(value, t1);
110.1302 + }
110.1303 + // convert reference to primitive by unboxing
110.1304 + Wrapper w1 = Wrapper.forPrimitiveType(t1);
110.1305 + return w1.convert(value, t1);
110.1306 + }
110.1307 + // check contract with caller:
110.1308 + Wrapper.asWrapperType(t0).cast(value);
110.1309 + Wrapper w1 = Wrapper.forPrimitiveType(t1);
110.1310 + return w1.convert(value, t1);
110.1311 + }
110.1312 +
110.1313 + static
110.1314 + Object checkValue(Class<?> T1, Object value)
110.1315 + throws ClassCastException
110.1316 + {
110.1317 + Class<?> T0;
110.1318 + if (value == null)
110.1319 + T0 = Object.class;
110.1320 + else
110.1321 + T0 = value.getClass();
110.1322 + return checkValue(T0, T1, value);
110.1323 + }
110.1324 +
110.1325 + /// method handle modification (creation from other method handles)
110.1326 +
110.1327 + /**
110.1328 + * Produces a method handle which adapts the type of the
110.1329 + * given method handle to a new type by pairwise argument conversion.
110.1330 + * The original type and new type must have the same number of arguments.
110.1331 + * The resulting method handle is guaranteed to report a type
110.1332 + * which is equal to the desired new type.
110.1333 + * <p>
110.1334 + * If the original type and new type are equal, returns target.
110.1335 + * <p>
110.1336 + * The following conversions are applied as needed both to
110.1337 + * arguments and return types. Let T0 and T1 be the differing
110.1338 + * new and old parameter types (or old and new return types)
110.1339 + * for corresponding values passed by the new and old method types.
110.1340 + * Given those types T0, T1, one of the following conversions is applied
110.1341 + * if possible:
110.1342 + * <ul>
110.1343 + * <li>If T0 and T1 are references, then a cast to T1 is applied.
110.1344 + * (The types do not need to be related in any particular way.)
110.1345 + * <li>If T0 and T1 are primitives, then a Java method invocation
110.1346 + * conversion (JLS 5.3) is applied, if one exists.
110.1347 + * <li>If T0 is a primitive and T1 a reference, a boxing
110.1348 + * conversion is applied if one exists, possibly followed by
110.1349 + * a reference conversion to a superclass.
110.1350 + * T1 must be a wrapper class or a supertype of one.
110.1351 + * <li>If T0 is a reference and T1 a primitive, an unboxing
110.1352 + * conversion will be applied at runtime, possibly followed
110.1353 + * by a Java method invocation conversion (JLS 5.3)
110.1354 + * on the primitive value. (These are the widening conversions.)
110.1355 + * T0 must be a wrapper class or a supertype of one.
110.1356 + * (In the case where T0 is Object, these are the conversions
110.1357 + * allowed by java.lang.reflect.Method.invoke.)
110.1358 + * <li>If the return type T1 is void, any returned value is discarded
110.1359 + * <li>If the return type T0 is void and T1 a reference, a null value is introduced.
110.1360 + * <li>If the return type T0 is void and T1 a primitive, a zero value is introduced.
110.1361 + * </ul>
110.1362 + * @param target the method handle to invoke after arguments are retyped
110.1363 + * @param newType the expected type of the new method handle
110.1364 + * @return a method handle which delegates to {@code target} after performing
110.1365 + * any necessary argument conversions, and arranges for any
110.1366 + * necessary return value conversions
110.1367 + * @throws NullPointerException if either argument is null
110.1368 + * @throws WrongMethodTypeException if the conversion cannot be made
110.1369 + * @see MethodHandle#asType
110.1370 + * @see MethodHandles#explicitCastArguments
110.1371 + */
110.1372 + public static
110.1373 + MethodHandle convertArguments(MethodHandle target, MethodType newType) {
110.1374 + MethodType oldType = target.type();
110.1375 + if (oldType.equals(newType))
110.1376 + return target;
110.1377 + MethodHandle res = null;
110.1378 + try {
110.1379 + res = MethodHandleImpl.convertArguments(target,
110.1380 + newType, oldType, null);
110.1381 + } catch (IllegalArgumentException ex) {
110.1382 + }
110.1383 + if (res == null)
110.1384 + throw new WrongMethodTypeException("cannot convert to "+newType+": "+target);
110.1385 + return res;
110.1386 + }
110.1387 +
110.1388 + /**
110.1389 + * Produces a method handle which adapts the type of the
110.1390 + * given method handle to a new type by pairwise argument conversion.
110.1391 + * The original type and new type must have the same number of arguments.
110.1392 + * The resulting method handle is guaranteed to report a type
110.1393 + * which is equal to the desired new type.
110.1394 + * <p>
110.1395 + * If the original type and new type are equal, returns target.
110.1396 + * <p>
110.1397 + * The same conversions are allowed as for {@link #convertArguments convertArguments},
110.1398 + * and some additional conversions are also applied if those conversions fail.
110.1399 + * Given types T0, T1, one of the following conversions is applied
110.1400 + * in addition, if the conversions specified for {@code convertArguments}
110.1401 + * would be insufficient:
110.1402 + * <ul>
110.1403 + * <li>If T0 and T1 are references, and T1 is an interface type,
110.1404 + * then the value of type T0 is passed as a T1 without a cast.
110.1405 + * (This treatment of interfaces follows the usage of the bytecode verifier.)
110.1406 + * <li>If T0 and T1 are primitives and one is boolean,
110.1407 + * the boolean is treated as a one-bit unsigned integer.
110.1408 + * (This treatment follows the usage of the bytecode verifier.)
110.1409 + * A conversion from another primitive type behaves as if
110.1410 + * it first converts to byte, and then masks all but the low bit.
110.1411 + * <li>If a primitive value would be converted by {@code convertArguments}
110.1412 + * using Java method invocation conversion (JLS 5.3),
110.1413 + * Java casting conversion (JLS 5.5) may be used also.
110.1414 + * This allows primitives to be narrowed as well as widened.
110.1415 + * </ul>
110.1416 + * @param target the method handle to invoke after arguments are retyped
110.1417 + * @param newType the expected type of the new method handle
110.1418 + * @return a method handle which delegates to {@code target} after performing
110.1419 + * any necessary argument conversions, and arranges for any
110.1420 + * necessary return value conversions
110.1421 + * @throws NullPointerException if either argument is null
110.1422 + * @throws WrongMethodTypeException if the conversion cannot be made
110.1423 + * @see MethodHandle#asType
110.1424 + * @see MethodHandles#convertArguments
110.1425 + */
110.1426 + public static
110.1427 + MethodHandle explicitCastArguments(MethodHandle target, MethodType newType) {
110.1428 + return convertArguments(target, newType); // FIXME!
110.1429 + }
110.1430 +
110.1431 + /*
110.1432 + FIXME: Reconcile javadoc with 10/22/2010 EG notes on conversion:
110.1433 +
110.1434 + Both converters arrange for their method handles to convert arguments
110.1435 + and return values. The conversion rules are the same for arguments
110.1436 + and return values, and depend only on source and target types, S and
110.1437 + T. The conversions allowed by castConvertArguments are a strict
110.1438 + superset of those performed by convertArguments.
110.1439 +
110.1440 + In all cases, if S and T are references, a simple checkcast is done.
110.1441 + If neither S nor T is a primitive, no attempt is made to unbox and
110.1442 + box. A failed conversion throws ClassCastException.
110.1443 +
110.1444 + If T is void, the value is dropped.
110.1445 +
110.1446 + For compatibility with reflection, if S is void and T is a reference,
110.1447 + a null value is produced.
110.1448 +
110.1449 + For compatibility with reflection, if S is a reference and T is a
110.1450 + primitive, S is first unboxed and then undergoes primitive conversion.
110.1451 + In the case of 'convertArguments', only assignment conversion is
110.1452 + performed (no narrowing primitive conversion).
110.1453 +
110.1454 + If S is a primitive, S is boxed, and then the above rules are applied.
110.1455 + If S and T are both primitives, the boxing will be undetectable; only
110.1456 + the primitive conversions will be apparent to the user. The key point
110.1457 + is that if S is a primitive type, the implementation may box it and
110.1458 + treat is as Object, without loss of information, or it may use a "fast
110.1459 + path" which does not use boxing.
110.1460 +
110.1461 + Notwithstanding the rules above, for compatibility with the verifier,
110.1462 + if T is an interface, it is treated as if it were Object. [KEEP THIS?]
110.1463 +
110.1464 + Also, for compatibility with the verifier, a boolean may be undergo
110.1465 + widening or narrowing conversion to any other primitive type. [KEEP THIS?]
110.1466 + */
110.1467 +
110.1468 + /**
110.1469 + * Produces a method handle which adapts the calling sequence of the
110.1470 + * given method handle to a new type, by reordering the arguments.
110.1471 + * The resulting method handle is guaranteed to report a type
110.1472 + * which is equal to the desired new type.
110.1473 + * <p>
110.1474 + * The given array controls the reordering.
110.1475 + * Call {@code #I} the number of incoming parameters (the value
110.1476 + * {@code newType.parameterCount()}, and call {@code #O} the number
110.1477 + * of outgoing parameters (the value {@code target.type().parameterCount()}).
110.1478 + * Then the length of the reordering array must be {@code #O},
110.1479 + * and each element must be a non-negative number less than {@code #I}.
110.1480 + * For every {@code N} less than {@code #O}, the {@code N}-th
110.1481 + * outgoing argument will be taken from the {@code I}-th incoming
110.1482 + * argument, where {@code I} is {@code reorder[N]}.
110.1483 + * <p>
110.1484 + * No argument or return value conversions are applied.
110.1485 + * The type of each incoming argument, as determined by {@code newType},
110.1486 + * must be identical to the type of the corresponding outgoing argument
110.1487 + * or arguments in the target method handle.
110.1488 + * The return type of {@code newType} must be identical to the return
110.1489 + * type of the original target.
110.1490 + * <p>
110.1491 + * The reordering array need not specify an actual permutation.
110.1492 + * An incoming argument will be duplicated if its index appears
110.1493 + * more than once in the array, and an incoming argument will be dropped
110.1494 + * if its index does not appear in the array.
110.1495 + * As in the case of {@link #dropArguments(MethodHandle,int,List) dropArguments},
110.1496 + * incoming arguments which are not mentioned in the reordering array
110.1497 + * are may be any type, as determined only by {@code newType}.
110.1498 + * <blockquote><pre>
110.1499 +MethodType intfn1 = MethodType.methodType(int.class, int.class);
110.1500 +MethodType intfn2 = MethodType.methodType(int.class, int.class, int.class);
110.1501 +MethodHandle sub = ... {int x, int y => x-y} ...;
110.1502 +assert(sub.type().equals(intfn2));
110.1503 +MethodHandle sub1 = MethodHandles.permuteArguments(sub, intfn2, 0, 1);
110.1504 +MethodHandle rsub = MethodHandles.permuteArguments(sub, intfn2, 1, 0);
110.1505 +assert((int)rsub.invokeExact(1, 100) == 99);
110.1506 +MethodHandle add = ... {int x, int y => x+y} ...;
110.1507 +assert(add.type().equals(intfn2));
110.1508 +MethodHandle twice = MethodHandles.permuteArguments(add, intfn1, 0, 0);
110.1509 +assert(twice.type().equals(intfn1));
110.1510 +assert((int)twice.invokeExact(21) == 42);
110.1511 + * </pre></blockquote>
110.1512 + * @param target the method handle to invoke after arguments are reordered
110.1513 + * @param newType the expected type of the new method handle
110.1514 + * @param reorder a string which controls the reordering
110.1515 + * @return a method handle which delegates to {@code target} after it
110.1516 + * drops unused arguments and moves and/or duplicates the other arguments
110.1517 + * @throws NullPointerException if any argument is null
110.1518 + */
110.1519 + public static
110.1520 + MethodHandle permuteArguments(MethodHandle target, MethodType newType, int... reorder) {
110.1521 + MethodType oldType = target.type();
110.1522 + checkReorder(reorder, newType, oldType);
110.1523 + return MethodHandleImpl.convertArguments(target,
110.1524 + newType, oldType,
110.1525 + reorder);
110.1526 + }
110.1527 +
110.1528 + private static void checkReorder(int[] reorder, MethodType newType, MethodType oldType) {
110.1529 + if (reorder.length == oldType.parameterCount()) {
110.1530 + int limit = newType.parameterCount();
110.1531 + boolean bad = false;
110.1532 + for (int i : reorder) {
110.1533 + if (i < 0 || i >= limit) {
110.1534 + bad = true; break;
110.1535 + }
110.1536 + }
110.1537 + if (!bad) return;
110.1538 + }
110.1539 + throw newIllegalArgumentException("bad reorder array");
110.1540 + }
110.1541 +
110.1542 + /**
110.1543 + * Equivalent to the following code:
110.1544 + * <p><blockquote><pre>
110.1545 + * int spreadPos = newType.parameterCount() - 1;
110.1546 + * Class<?> spreadType = newType.parameterType(spreadPos);
110.1547 + * int spreadCount = target.type().parameterCount() - spreadPos;
110.1548 + * MethodHandle adapter = target.asSpreader(spreadType, spreadCount);
110.1549 + * adapter = adapter.asType(newType);
110.1550 + * return adapter;
110.1551 + * </pre></blockquote>
110.1552 + * @param target the method handle to invoke after argument spreading
110.1553 + * @param newType the expected type of the new method handle
110.1554 + * @return a method handle which spreads its final argument,
110.1555 + * before calling the original method handle
110.1556 + */
110.1557 + /*non-public*/ static
110.1558 + MethodHandle spreadArguments(MethodHandle target, MethodType newType) {
110.1559 + MethodType oldType = target.type();
110.1560 + int inargs = newType.parameterCount();
110.1561 + int outargs = oldType.parameterCount();
110.1562 + int spreadPos = inargs - 1;
110.1563 + int numSpread = (outargs - spreadPos);
110.1564 + MethodHandle res = null;
110.1565 + if (spreadPos >= 0 && numSpread >= 0) {
110.1566 + res = MethodHandleImpl.spreadArguments(target, newType, spreadPos);
110.1567 + }
110.1568 + if (res == null) {
110.1569 + throw newIllegalArgumentException("cannot spread "+newType+" to " +oldType);
110.1570 + }
110.1571 + return res;
110.1572 + }
110.1573 +
110.1574 + /**
110.1575 + * Equivalent to the following code:
110.1576 + * <p><blockquote><pre>
110.1577 + * int collectPos = target.type().parameterCount() - 1;
110.1578 + * Class<?> collectType = target.type().parameterType(collectPos);
110.1579 + * if (!collectType.isArray()) collectType = Object[].class;
110.1580 + * int collectCount = newType.parameterCount() - collectPos;
110.1581 + * MethodHandle adapter = target.asCollector(collectType, collectCount);
110.1582 + * adapter = adapter.asType(newType);
110.1583 + * return adapter;
110.1584 + * </pre></blockquote>
110.1585 + * @param target the method handle to invoke after argument collection
110.1586 + * @param newType the expected type of the new method handle
110.1587 + * @return a method handle which collects some trailing argument
110.1588 + * into an array, before calling the original method handle
110.1589 + */
110.1590 + /*non-public*/ static
110.1591 + MethodHandle collectArguments(MethodHandle target, MethodType newType) {
110.1592 + MethodType oldType = target.type();
110.1593 + int inargs = newType.parameterCount();
110.1594 + int outargs = oldType.parameterCount();
110.1595 + int collectPos = outargs - 1;
110.1596 + int numCollect = (inargs - collectPos);
110.1597 + if (collectPos < 0 || numCollect < 0)
110.1598 + throw newIllegalArgumentException("wrong number of arguments");
110.1599 + MethodHandle res = MethodHandleImpl.collectArguments(target, newType, collectPos, null);
110.1600 + if (res == null) {
110.1601 + throw newIllegalArgumentException("cannot collect from "+newType+" to " +oldType);
110.1602 + }
110.1603 + return res;
110.1604 + }
110.1605 +
110.1606 + /**
110.1607 + * Produces a method handle of the requested return type which returns the given
110.1608 + * constant value every time it is invoked.
110.1609 + * <p>
110.1610 + * Before the method handle is returned, the passed-in value is converted to the requested type.
110.1611 + * If the requested type is primitive, widening primitive conversions are attempted,
110.1612 + * else reference conversions are attempted.
110.1613 + * <p>The returned method handle is equivalent to {@code identity(type).bindTo(value)},
110.1614 + * unless the type is {@code void}, in which case it is {@code identity(type)}.
110.1615 + * @param type the return type of the desired method handle
110.1616 + * @param value the value to return
110.1617 + * @return a method handle of the given return type and no arguments, which always returns the given value
110.1618 + * @throws NullPointerException if the {@code type} argument is null
110.1619 + * @throws ClassCastException if the value cannot be converted to the required return type
110.1620 + * @throws IllegalArgumentException if the given type is {@code void.class}
110.1621 + */
110.1622 + public static
110.1623 + MethodHandle constant(Class<?> type, Object value) {
110.1624 + if (type.isPrimitive()) {
110.1625 + if (type == void.class)
110.1626 + throw newIllegalArgumentException("void type");
110.1627 + Wrapper w = Wrapper.forPrimitiveType(type);
110.1628 + return identity(type).bindTo(w.convert(value, type));
110.1629 + } else {
110.1630 + return identity(type).bindTo(type.cast(value));
110.1631 + }
110.1632 + }
110.1633 +
110.1634 + /**
110.1635 + * Produces a method handle which returns its sole argument when invoked.
110.1636 + * <p>The identity function for {@code void} takes no arguments and returns no values.
110.1637 + * @param type the type of the sole parameter and return value of the desired method handle
110.1638 + * @return a unary method handle which accepts and returns the given type
110.1639 + * @throws NullPointerException if the argument is null
110.1640 + * @throws IllegalArgumentException if the given type is {@code void.class}
110.1641 + */
110.1642 + public static
110.1643 + MethodHandle identity(Class<?> type) {
110.1644 + if (type == void.class)
110.1645 + throw newIllegalArgumentException("void type");
110.1646 + else if (type == Object.class)
110.1647 + return ValueConversions.identity();
110.1648 + else if (type.isPrimitive())
110.1649 + return ValueConversions.identity(Wrapper.forPrimitiveType(type));
110.1650 + else
110.1651 + return AdapterMethodHandle.makeRetypeRaw(
110.1652 + MethodType.methodType(type, type), ValueConversions.identity());
110.1653 + }
110.1654 +
110.1655 + /**
110.1656 + * Produces a method handle which calls the original method handle {@code target},
110.1657 + * after inserting the given argument(s) at the given position.
110.1658 + * The formal parameters to {@code target} which will be supplied by those
110.1659 + * arguments are called <em>bound parameters</em>, because the new method
110.1660 + * will contain bindings for those parameters take from {@code values}.
110.1661 + * The type of the new method handle will drop the types for the bound
110.1662 + * parameters from the original target type, since the new method handle
110.1663 + * will no longer require those arguments to be supplied by its callers.
110.1664 + * <p>
110.1665 + * Each given argument object must match the corresponding bound parameter type.
110.1666 + * If a bound parameter type is a primitive, the argument object
110.1667 + * must be a wrapper, and will be unboxed to produce the primitive value.
110.1668 + * <p>
110.1669 + * The <i>pos</i> may range between zero and <i>N</i> (inclusively),
110.1670 + * where <i>N</i> is the number of argument types in resulting method handle
110.1671 + * (after bound parameter types are dropped).
110.1672 + * @param target the method handle to invoke after the argument is inserted
110.1673 + * @param pos where to insert the argument (zero for the first)
110.1674 + * @param values the series of arguments to insert
110.1675 + * @return a method handle which inserts an additional argument,
110.1676 + * before calling the original method handle
110.1677 + * @throws NullPointerException if the {@code target} argument or the {@code values} array is null
110.1678 + * @see MethodHandle#bindTo
110.1679 + */
110.1680 + public static
110.1681 + MethodHandle insertArguments(MethodHandle target, int pos, Object... values) {
110.1682 + int insCount = values.length;
110.1683 + MethodType oldType = target.type();
110.1684 + int outargs = oldType.parameterCount();
110.1685 + int inargs = outargs - insCount;
110.1686 + if (inargs < 0)
110.1687 + throw newIllegalArgumentException("too many values to insert");
110.1688 + if (pos < 0 || pos > inargs)
110.1689 + throw newIllegalArgumentException("no argument type to append");
110.1690 + MethodHandle result = target;
110.1691 + for (int i = 0; i < insCount; i++) {
110.1692 + Object value = values[i];
110.1693 + Class<?> valueType = oldType.parameterType(pos+i);
110.1694 + value = checkValue(valueType, value);
110.1695 + if (pos == 0 && !valueType.isPrimitive()) {
110.1696 + // At least for now, make bound method handles a special case.
110.1697 + MethodHandle bmh = MethodHandleImpl.bindReceiver(result, value);
110.1698 + if (bmh != null) {
110.1699 + result = bmh;
110.1700 + continue;
110.1701 + }
110.1702 + // else fall through to general adapter machinery
110.1703 + }
110.1704 + result = MethodHandleImpl.bindArgument(result, pos, value);
110.1705 + }
110.1706 + return result;
110.1707 + }
110.1708 +
110.1709 + /**
110.1710 + * Produces a method handle which calls the original method handle,
110.1711 + * after dropping the given argument(s) at the given position.
110.1712 + * The type of the new method handle will insert the given argument
110.1713 + * type(s), at that position, into the original handle's type.
110.1714 + * <p>
110.1715 + * The <i>pos</i> may range between zero and <i>N</i>,
110.1716 + * where <i>N</i> is the number of argument types in <i>target</i>,
110.1717 + * meaning to drop the first or last argument (respectively),
110.1718 + * or an argument somewhere in between.
110.1719 + * <p>
110.1720 + * <b>Example:</b>
110.1721 + * <p><blockquote><pre>
110.1722 +import static java.lang.invoke.MethodHandles.*;
110.1723 +import static java.lang.invoke.MethodType.*;
110.1724 +...
110.1725 +MethodHandle cat = lookup().findVirtual(String.class,
110.1726 + "concat", methodType(String.class, String.class));
110.1727 +assertEquals("xy", (String) cat.invokeExact("x", "y"));
110.1728 +MethodType bigType = cat.type().insertParameterTypes(0, int.class, String.class);
110.1729 +MethodHandle d0 = dropArguments(cat, 0, bigType.parameterList().subList(0,2));
110.1730 +assertEquals(bigType, d0.type());
110.1731 +assertEquals("yz", (String) d0.invokeExact(123, "x", "y", "z"));
110.1732 + * </pre></blockquote>
110.1733 + * <p>
110.1734 + * This method is also equivalent to the following code:
110.1735 + * <p><blockquote><pre>
110.1736 + * {@link #dropArguments(MethodHandle,int,Class...) dropArguments}(target, pos, valueTypes.toArray(new Class[0]))
110.1737 + * </pre></blockquote>
110.1738 + * @param target the method handle to invoke after the arguments are dropped
110.1739 + * @param valueTypes the type(s) of the argument(s) to drop
110.1740 + * @param pos position of first argument to drop (zero for the leftmost)
110.1741 + * @return a method handle which drops arguments of the given types,
110.1742 + * before calling the original method handle
110.1743 + * @throws NullPointerException if the {@code target} argument is null,
110.1744 + * or if the {@code valueTypes} list or any of its elements is null
110.1745 + * @throws IllegalArgumentException if any of the {@code valueTypes} is {@code void.class}
110.1746 + */
110.1747 + public static
110.1748 + MethodHandle dropArguments(MethodHandle target, int pos, List<Class<?>> valueTypes) {
110.1749 + if (valueTypes.size() == 0) return target;
110.1750 + MethodType oldType = target.type();
110.1751 + int outargs = oldType.parameterCount();
110.1752 + int inargs = outargs + valueTypes.size();
110.1753 + if (pos < 0 || pos >= inargs)
110.1754 + throw newIllegalArgumentException("no argument type to remove");
110.1755 + ArrayList<Class<?>> ptypes =
110.1756 + new ArrayList<Class<?>>(oldType.parameterList());
110.1757 + ptypes.addAll(pos, valueTypes);
110.1758 + MethodType newType = MethodType.methodType(oldType.returnType(), ptypes);
110.1759 + return MethodHandleImpl.dropArguments(target, newType, pos);
110.1760 + }
110.1761 +
110.1762 + /**
110.1763 + * Produces a method handle which calls the original method handle,
110.1764 + * after dropping the given argument(s) at the given position.
110.1765 + * The type of the new method handle will insert the given argument
110.1766 + * type(s), at that position, into the original handle's type.
110.1767 + * <p>
110.1768 + * The <i>pos</i> may range between zero and <i>N</i>,
110.1769 + * where <i>N</i> is the number of argument types in <i>target</i>,
110.1770 + * meaning to drop the first or last argument (respectively),
110.1771 + * or an argument somewhere in between.
110.1772 + * <p>
110.1773 + * <b>Example:</b>
110.1774 + * <p><blockquote><pre>
110.1775 +import static java.lang.invoke.MethodHandles.*;
110.1776 +import static java.lang.invoke.MethodType.*;
110.1777 +...
110.1778 +MethodHandle cat = lookup().findVirtual(String.class,
110.1779 + "concat", methodType(String.class, String.class));
110.1780 +assertEquals("xy", (String) cat.invokeExact("x", "y"));
110.1781 +MethodHandle d0 = dropArguments(cat, 0, String.class);
110.1782 +assertEquals("yz", (String) d0.invokeExact("x", "y", "z"));
110.1783 +MethodHandle d1 = dropArguments(cat, 1, String.class);
110.1784 +assertEquals("xz", (String) d1.invokeExact("x", "y", "z"));
110.1785 +MethodHandle d2 = dropArguments(cat, 2, String.class);
110.1786 +assertEquals("xy", (String) d2.invokeExact("x", "y", "z"));
110.1787 +MethodHandle d12 = dropArguments(cat, 1, int.class, boolean.class);
110.1788 +assertEquals("xz", (String) d12.invokeExact("x", 12, true, "z"));
110.1789 + * </pre></blockquote>
110.1790 + * <p>
110.1791 + * This method is also equivalent to the following code:
110.1792 + * <p><blockquote><pre>
110.1793 + * {@link #dropArguments(MethodHandle,int,List) dropArguments}(target, pos, Arrays.asList(valueTypes))
110.1794 + * </pre></blockquote>
110.1795 + * @param target the method handle to invoke after the arguments are dropped
110.1796 + * @param valueTypes the type(s) of the argument(s) to drop
110.1797 + * @param pos position of first argument to drop (zero for the leftmost)
110.1798 + * @return a method handle which drops arguments of the given types,
110.1799 + * before calling the original method handle
110.1800 + * @throws NullPointerException if the {@code target} argument is null,
110.1801 + * or if the {@code valueTypes} array or any of its elements is null
110.1802 + * @throws IllegalArgumentException if any of the {@code valueTypes} is {@code void.class}
110.1803 + */
110.1804 + public static
110.1805 + MethodHandle dropArguments(MethodHandle target, int pos, Class<?>... valueTypes) {
110.1806 + return dropArguments(target, pos, Arrays.asList(valueTypes));
110.1807 + }
110.1808 +
110.1809 + /**
110.1810 + * Adapts a target method handle {@code target} by pre-processing
110.1811 + * one or more of its arguments, each with its own unary filter function,
110.1812 + * and then calling the target with each pre-processed argument
110.1813 + * replaced by the result of its corresponding filter function.
110.1814 + * <p>
110.1815 + * The pre-processing is performed by one or more method handles,
110.1816 + * specified in the elements of the {@code filters} array.
110.1817 + * Null arguments in the array are ignored, and the corresponding arguments left unchanged.
110.1818 + * (If there are no non-null elements in the array, the original target is returned.)
110.1819 + * Each filter is applied to the corresponding argument of the adapter.
110.1820 + * <p>
110.1821 + * If a filter {@code F} applies to the {@code N}th argument of
110.1822 + * the method handle, then {@code F} must be a method handle which
110.1823 + * takes exactly one argument. The type of {@code F}'s sole argument
110.1824 + * replaces the corresponding argument type of the target
110.1825 + * in the resulting adapted method handle.
110.1826 + * The return type of {@code F} must be identical to the corresponding
110.1827 + * parameter type of the target.
110.1828 + * <p>
110.1829 + * It is an error if there are elements of {@code filters}
110.1830 + * which do not correspond to argument positions in the target.
110.1831 + * <b>Example:</b>
110.1832 + * <p><blockquote><pre>
110.1833 +import static java.lang.invoke.MethodHandles.*;
110.1834 +import static java.lang.invoke.MethodType.*;
110.1835 +...
110.1836 +MethodHandle cat = lookup().findVirtual(String.class,
110.1837 + "concat", methodType(String.class, String.class));
110.1838 +MethodHandle upcase = lookup().findVirtual(String.class,
110.1839 + "toUpperCase", methodType(String.class));
110.1840 +assertEquals("xy", (String) cat.invokeExact("x", "y"));
110.1841 +MethodHandle f0 = filterArguments(cat, 0, upcase);
110.1842 +assertEquals("Xy", (String) f0.invokeExact("x", "y")); // Xy
110.1843 +MethodHandle f1 = filterArguments(cat, 1, upcase);
110.1844 +assertEquals("xY", (String) f1.invokeExact("x", "y")); // xY
110.1845 +MethodHandle f2 = filterArguments(cat, 0, upcase, upcase);
110.1846 +assertEquals("XY", (String) f2.invokeExact("x", "y")); // XY
110.1847 + * </pre></blockquote>
110.1848 + *
110.1849 + * @param target the method handle to invoke after arguments are filtered
110.1850 + * @param pos the position of the first argument to filter
110.1851 + * @param filters method handles to call initially on filtered arguments
110.1852 + * @return method handle which incorporates the specified argument filtering logic
110.1853 + * @throws NullPointerException if the {@code target} argument is null
110.1854 + * or if the {@code filters} array is null
110.1855 + * @throws IllegalArgumentException if a non-null element of {@code filters}
110.1856 + * does not match a corresponding argument type of {@code target} as described above,
110.1857 + * or if the {@code pos+filters.length} is greater than {@code target.type().parameterCount()}
110.1858 + */
110.1859 + public static
110.1860 + MethodHandle filterArguments(MethodHandle target, int pos, MethodHandle... filters) {
110.1861 + MethodType targetType = target.type();
110.1862 + MethodHandle adapter = target;
110.1863 + MethodType adapterType = targetType;
110.1864 + int maxPos = targetType.parameterCount();
110.1865 + if (pos + filters.length > maxPos)
110.1866 + throw newIllegalArgumentException("too many filters");
110.1867 + int curPos = pos-1; // pre-incremented
110.1868 + for (MethodHandle filter : filters) {
110.1869 + curPos += 1;
110.1870 + if (filter == null) continue; // ignore null elements of filters
110.1871 + MethodType filterType = filter.type();
110.1872 + if (filterType.parameterCount() != 1
110.1873 + || filterType.returnType() != targetType.parameterType(curPos))
110.1874 + throw newIllegalArgumentException("target and filter types do not match");
110.1875 + adapterType = adapterType.changeParameterType(curPos, filterType.parameterType(0));
110.1876 + adapter = MethodHandleImpl.filterArgument(adapter, curPos, filter);
110.1877 + }
110.1878 + MethodType midType = adapter.type();
110.1879 + if (midType != adapterType)
110.1880 + adapter = MethodHandleImpl.convertArguments(adapter, adapterType, midType, null);
110.1881 + return adapter;
110.1882 + }
110.1883 +
110.1884 + /**
110.1885 + * Adapts a target method handle {@code target} by post-processing
110.1886 + * its return value with a unary filter function.
110.1887 + * <p>
110.1888 + * If a filter {@code F} applies to the return value of
110.1889 + * the target method handle, then {@code F} must be a method handle which
110.1890 + * takes exactly one argument. The return type of {@code F}
110.1891 + * replaces the return type of the target
110.1892 + * in the resulting adapted method handle.
110.1893 + * The argument type of {@code F} must be identical to the
110.1894 + * return type of the target.
110.1895 + * <b>Example:</b>
110.1896 + * <p><blockquote><pre>
110.1897 +import static java.lang.invoke.MethodHandles.*;
110.1898 +import static java.lang.invoke.MethodType.*;
110.1899 +...
110.1900 +MethodHandle cat = lookup().findVirtual(String.class,
110.1901 + "concat", methodType(String.class, String.class));
110.1902 +MethodHandle length = lookup().findVirtual(String.class,
110.1903 + "length", methodType(int.class));
110.1904 +System.out.println((String) cat.invokeExact("x", "y")); // xy
110.1905 +MethodHandle f0 = filterReturnValue(cat, length);
110.1906 +System.out.println((int) f0.invokeExact("x", "y")); // 2
110.1907 + * </pre></blockquote>
110.1908 + * @param target the method handle to invoke before filtering the return value
110.1909 + * @param filter method handle to call on the return value
110.1910 + * @return method handle which incorporates the specified return value filtering logic
110.1911 + * @throws NullPointerException if either argument is null
110.1912 + * @throws IllegalArgumentException if {@code filter}
110.1913 + * does not match the return type of {@code target} as described above
110.1914 + */
110.1915 + public static
110.1916 + MethodHandle filterReturnValue(MethodHandle target, MethodHandle filter) {
110.1917 + MethodType targetType = target.type();
110.1918 + MethodType filterType = filter.type();
110.1919 + if (filterType.parameterCount() != 1
110.1920 + || filterType.parameterType(0) != targetType.returnType())
110.1921 + throw newIllegalArgumentException("target and filter types do not match");
110.1922 + // result = fold( lambda(retval, arg...) { filter(retval) },
110.1923 + // lambda( arg...) { target(arg...) } )
110.1924 + // FIXME: Too many nodes here.
110.1925 + MethodHandle returner = dropArguments(filter, 1, targetType.parameterList());
110.1926 + return foldArguments(returner, target);
110.1927 + }
110.1928 +
110.1929 + /**
110.1930 + * Adapts a target method handle {@code target} by pre-processing
110.1931 + * some of its arguments, and then calling the target with
110.1932 + * the result of the pre-processing, plus all original arguments.
110.1933 + * <p>
110.1934 + * The pre-processing is performed by a second method handle, the {@code combiner}.
110.1935 + * The first {@code N} arguments passed to the adapter,
110.1936 + * are copied to the combiner, which then produces a result.
110.1937 + * (Here, {@code N} is defined as the parameter count of the adapter.)
110.1938 + * After this, control passes to the {@code target}, with both the result
110.1939 + * of the combiner, and all the original incoming arguments.
110.1940 + * <p>
110.1941 + * The first argument type of the target must be identical with the
110.1942 + * return type of the combiner.
110.1943 + * The resulting adapter is the same type as the target, except that the
110.1944 + * initial argument type of the target is dropped.
110.1945 + * <p>
110.1946 + * (Note that {@link #dropArguments(MethodHandle,int,List) dropArguments} can be used to remove any arguments
110.1947 + * that either the {@code combiner} or {@code target} does not wish to receive.
110.1948 + * If some of the incoming arguments are destined only for the combiner,
110.1949 + * consider using {@link MethodHandle#asCollector asCollector} instead, since those
110.1950 + * arguments will not need to be live on the stack on entry to the
110.1951 + * target.)
110.1952 + * <p>
110.1953 + * The first argument of the target must be identical with the
110.1954 + * return value of the combiner.
110.1955 + * <p> Here is pseudocode for the resulting adapter:
110.1956 + * <blockquote><pre>
110.1957 + * // there are N arguments in the A sequence
110.1958 + * T target(V, A[N]..., B...);
110.1959 + * V combiner(A...);
110.1960 + * T adapter(A... a, B... b) {
110.1961 + * V v = combiner(a...);
110.1962 + * return target(v, a..., b...);
110.1963 + * }
110.1964 + * </pre></blockquote>
110.1965 + * @param target the method handle to invoke after arguments are combined
110.1966 + * @param combiner method handle to call initially on the incoming arguments
110.1967 + * @return method handle which incorporates the specified argument folding logic
110.1968 + * @throws NullPointerException if either argument is null
110.1969 + * @throws IllegalArgumentException if the first argument type of
110.1970 + * {@code target} is not the same as {@code combiner}'s return type,
110.1971 + * or if the following argument types of {@code target}
110.1972 + * are not identical with the argument types of {@code combiner}
110.1973 + */
110.1974 + public static
110.1975 + MethodHandle foldArguments(MethodHandle target, MethodHandle combiner) {
110.1976 + MethodType targetType = target.type();
110.1977 + MethodType combinerType = combiner.type();
110.1978 + int foldArgs = combinerType.parameterCount();
110.1979 + boolean ok = (targetType.parameterCount() >= 1 + foldArgs);
110.1980 + if (ok && !combinerType.parameterList().equals(targetType.parameterList().subList(1, foldArgs+1)))
110.1981 + ok = false;
110.1982 + if (ok && !combinerType.returnType().equals(targetType.parameterType(0)))
110.1983 + ok = false;
110.1984 + if (!ok)
110.1985 + throw misMatchedTypes("target and combiner types", targetType, combinerType);
110.1986 + MethodType newType = targetType.dropParameterTypes(0, 1);
110.1987 + return MethodHandleImpl.foldArguments(target, newType, combiner);
110.1988 + }
110.1989 +
110.1990 + /**
110.1991 + * Makes a method handle which adapts a target method handle,
110.1992 + * by guarding it with a test, a boolean-valued method handle.
110.1993 + * If the guard fails, a fallback handle is called instead.
110.1994 + * All three method handles must have the same corresponding
110.1995 + * argument and return types, except that the return type
110.1996 + * of the test must be boolean, and the test is allowed
110.1997 + * to have fewer arguments than the other two method handles.
110.1998 + * <p> Here is pseudocode for the resulting adapter:
110.1999 + * <blockquote><pre>
110.2000 + * boolean test(A...);
110.2001 + * T target(A...,B...);
110.2002 + * T fallback(A...,B...);
110.2003 + * T adapter(A... a,B... b) {
110.2004 + * if (test(a...))
110.2005 + * return target(a..., b...);
110.2006 + * else
110.2007 + * return fallback(a..., b...);
110.2008 + * }
110.2009 + * </pre></blockquote>
110.2010 + * Note that the test arguments ({@code a...} in the pseudocode) cannot
110.2011 + * be modified by execution of the test, and so are passed unchanged
110.2012 + * from the caller to the target or fallback as appropriate.
110.2013 + * @param test method handle used for test, must return boolean
110.2014 + * @param target method handle to call if test passes
110.2015 + * @param fallback method handle to call if test fails
110.2016 + * @return method handle which incorporates the specified if/then/else logic
110.2017 + * @throws NullPointerException if any argument is null
110.2018 + * @throws IllegalArgumentException if {@code test} does not return boolean,
110.2019 + * or if all three method types do not match (with the return
110.2020 + * type of {@code test} changed to match that of {@code target}).
110.2021 + */
110.2022 + public static
110.2023 + MethodHandle guardWithTest(MethodHandle test,
110.2024 + MethodHandle target,
110.2025 + MethodHandle fallback) {
110.2026 + MethodType gtype = test.type();
110.2027 + MethodType ttype = target.type();
110.2028 + MethodType ftype = fallback.type();
110.2029 + if (!ttype.equals(ftype))
110.2030 + throw misMatchedTypes("target and fallback types", ttype, ftype);
110.2031 + if (gtype.returnType() != boolean.class)
110.2032 + throw newIllegalArgumentException("guard type is not a predicate "+gtype);
110.2033 + List<Class<?>> targs = ttype.parameterList();
110.2034 + List<Class<?>> gargs = gtype.parameterList();
110.2035 + if (!targs.equals(gargs)) {
110.2036 + int gpc = gargs.size(), tpc = targs.size();
110.2037 + if (gpc >= tpc || !targs.subList(0, gpc).equals(gargs))
110.2038 + throw misMatchedTypes("target and test types", ttype, gtype);
110.2039 + test = dropArguments(test, gpc, targs.subList(gpc, tpc));
110.2040 + gtype = test.type();
110.2041 + }
110.2042 + return MethodHandleImpl.makeGuardWithTest(test, target, fallback);
110.2043 + }
110.2044 +
110.2045 + static RuntimeException misMatchedTypes(String what, MethodType t1, MethodType t2) {
110.2046 + return newIllegalArgumentException(what + " must match: " + t1 + " != " + t2);
110.2047 + }
110.2048 +
110.2049 + /**
110.2050 + * Makes a method handle which adapts a target method handle,
110.2051 + * by running it inside an exception handler.
110.2052 + * If the target returns normally, the adapter returns that value.
110.2053 + * If an exception matching the specified type is thrown, the fallback
110.2054 + * handle is called instead on the exception, plus the original arguments.
110.2055 + * <p>
110.2056 + * The target and handler must have the same corresponding
110.2057 + * argument and return types, except that handler may omit trailing arguments
110.2058 + * (similarly to the predicate in {@link #guardWithTest guardWithTest}).
110.2059 + * Also, the handler must have an extra leading parameter of {@code exType} or a supertype.
110.2060 + * <p> Here is pseudocode for the resulting adapter:
110.2061 + * <blockquote><pre>
110.2062 + * T target(A..., B...);
110.2063 + * T handler(ExType, A...);
110.2064 + * T adapter(A... a, B... b) {
110.2065 + * try {
110.2066 + * return target(a..., b...);
110.2067 + * } catch (ExType ex) {
110.2068 + * return handler(ex, a...);
110.2069 + * }
110.2070 + * }
110.2071 + * </pre></blockquote>
110.2072 + * Note that the saved arguments ({@code a...} in the pseudocode) cannot
110.2073 + * be modified by execution of the target, and so are passed unchanged
110.2074 + * from the caller to the handler, if the handler is invoked.
110.2075 + * <p>
110.2076 + * The target and handler must return the same type, even if the handler
110.2077 + * always throws. (This might happen, for instance, because the handler
110.2078 + * is simulating a {@code finally} clause).
110.2079 + * To create such a throwing handler, compose the handler creation logic
110.2080 + * with {@link #throwException throwException},
110.2081 + * in order to create a method handle of the correct return type.
110.2082 + * @param target method handle to call
110.2083 + * @param exType the type of exception which the handler will catch
110.2084 + * @param handler method handle to call if a matching exception is thrown
110.2085 + * @return method handle which incorporates the specified try/catch logic
110.2086 + * @throws NullPointerException if any argument is null
110.2087 + * @throws IllegalArgumentException if {@code handler} does not accept
110.2088 + * the given exception type, or if the method handle types do
110.2089 + * not match in their return types and their
110.2090 + * corresponding parameters
110.2091 + */
110.2092 + public static
110.2093 + MethodHandle catchException(MethodHandle target,
110.2094 + Class<? extends Throwable> exType,
110.2095 + MethodHandle handler) {
110.2096 + MethodType ttype = target.type();
110.2097 + MethodType htype = handler.type();
110.2098 + if (htype.parameterCount() < 1 ||
110.2099 + !htype.parameterType(0).isAssignableFrom(exType))
110.2100 + throw newIllegalArgumentException("handler does not accept exception type "+exType);
110.2101 + if (htype.returnType() != ttype.returnType())
110.2102 + throw misMatchedTypes("target and handler return types", ttype, htype);
110.2103 + List<Class<?>> targs = ttype.parameterList();
110.2104 + List<Class<?>> hargs = htype.parameterList();
110.2105 + hargs = hargs.subList(1, hargs.size()); // omit leading parameter from handler
110.2106 + if (!targs.equals(hargs)) {
110.2107 + int hpc = hargs.size(), tpc = targs.size();
110.2108 + if (hpc >= tpc || !targs.subList(0, hpc).equals(hargs))
110.2109 + throw misMatchedTypes("target and handler types", ttype, htype);
110.2110 + handler = dropArguments(handler, hpc, hargs.subList(hpc, tpc));
110.2111 + htype = handler.type();
110.2112 + }
110.2113 + return MethodHandleImpl.makeGuardWithCatch(target, exType, handler);
110.2114 + }
110.2115 +
110.2116 + /**
110.2117 + * Produces a method handle which will throw exceptions of the given {@code exType}.
110.2118 + * The method handle will accept a single argument of {@code exType},
110.2119 + * and immediately throw it as an exception.
110.2120 + * The method type will nominally specify a return of {@code returnType}.
110.2121 + * The return type may be anything convenient: It doesn't matter to the
110.2122 + * method handle's behavior, since it will never return normally.
110.2123 + * @return method handle which can throw the given exceptions
110.2124 + * @throws NullPointerException if either argument is null
110.2125 + */
110.2126 + public static
110.2127 + MethodHandle throwException(Class<?> returnType, Class<? extends Throwable> exType) {
110.2128 + return MethodHandleImpl.throwException(MethodType.methodType(returnType, exType));
110.2129 + }
110.2130 +
110.2131 + /**
110.2132 + * Produces an instance of the given single-method interface which redirects
110.2133 + * its calls to the given method handle.
110.2134 + * <p>
110.2135 + * A single-method interface is an interface which declares a unique method.
110.2136 + * When determining the unique method of a single-method interface,
110.2137 + * the public {@code Object} methods ({@code toString}, {@code equals}, {@code hashCode})
110.2138 + * are disregarded. For example, {@link java.util.Comparator} is a single-method interface,
110.2139 + * even though it re-declares the {@code Object.equals} method.
110.2140 + * <p>
110.2141 + * The type must be public. No additional access checks are performed.
110.2142 + * <p>
110.2143 + * The resulting instance of the required type will respond to
110.2144 + * invocation of the type's single abstract method by calling
110.2145 + * the given {@code target} on the incoming arguments,
110.2146 + * and returning or throwing whatever the {@code target}
110.2147 + * returns or throws. The invocation will be as if by
110.2148 + * {@code target.invokeGeneric}.
110.2149 + * The target's type will be checked before the
110.2150 + * instance is created, as if by a call to {@code asType},
110.2151 + * which may result in a {@code WrongMethodTypeException}.
110.2152 + * <p>
110.2153 + * The wrapper instance will implement the requested interface
110.2154 + * and its super-types, but no other single-method interfaces.
110.2155 + * This means that the instance will not unexpectedly
110.2156 + * pass an {@code instanceof} test for any unrequested type.
110.2157 + * <p style="font-size:smaller;">
110.2158 + * <em>Implementation Note:</em>
110.2159 + * Therefore, each instance must implement a unique single-method interface.
110.2160 + * Implementations may not bundle together
110.2161 + * multiple single-method interfaces onto single implementation classes
110.2162 + * in the style of {@link java.awt.AWTEventMulticaster}.
110.2163 + * <p>
110.2164 + * The method handle may throw an <em>undeclared exception</em>,
110.2165 + * which means any checked exception (or other checked throwable)
110.2166 + * not declared by the requested type's single abstract method.
110.2167 + * If this happens, the throwable will be wrapped in an instance of
110.2168 + * {@link java.lang.reflect.UndeclaredThrowableException UndeclaredThrowableException}
110.2169 + * and thrown in that wrapped form.
110.2170 + * <p>
110.2171 + * Like {@link java.lang.Integer#valueOf Integer.valueOf},
110.2172 + * {@code asInstance} is a factory method whose results are defined
110.2173 + * by their behavior.
110.2174 + * It is not guaranteed to return a new instance for every call.
110.2175 + * <p>
110.2176 + * Because of the possibility of {@linkplain java.lang.reflect.Method#isBridge bridge methods}
110.2177 + * and other corner cases, the interface may also have several abstract methods
110.2178 + * with the same name but having distinct descriptors (types of returns and parameters).
110.2179 + * In this case, all the methods are bound in common to the one given {@code target}.
110.2180 + * The type check and effective {@code asType} conversion is applied to each
110.2181 + * method type descriptor, and all abstract methods are bound to the {@code target} in common.
110.2182 + * Beyond this type check, no further checks are made to determine that the
110.2183 + * abstract methods are related in any way.
110.2184 + * <p>
110.2185 + * Future versions of this API may accept additional types,
110.2186 + * such as abstract classes with single abstract methods.
110.2187 + * Future versions of this API may also equip wrapper instances
110.2188 + * with one or more additional public "marker" interfaces.
110.2189 + *
110.2190 + * @param target the method handle to invoke from the wrapper
110.2191 + * @param smType the desired type of the wrapper, a single-method interface
110.2192 + * @return a correctly-typed wrapper for the given {@code target}
110.2193 + * @throws NullPointerException if either argument is null
110.2194 + * @throws IllegalArgumentException if the {@code smType} is not a
110.2195 + * valid argument to this method
110.2196 + * @throws WrongMethodTypeException if the {@code target} cannot
110.2197 + * be converted to the type required by the requested interface
110.2198 + */
110.2199 + // Other notes to implementors:
110.2200 + // <p>
110.2201 + // No stable mapping is promised between the single-method interface and
110.2202 + // the implementation class C. Over time, several implementation
110.2203 + // classes might be used for the same type.
110.2204 + // <p>
110.2205 + // If the implementation is able
110.2206 + // to prove that a wrapper of the required type
110.2207 + // has already been created for a given
110.2208 + // method handle, or for another method handle with the
110.2209 + // same behavior, the implementation may return that wrapper in place of
110.2210 + // a new wrapper.
110.2211 + // <p>
110.2212 + // This method is designed to apply to common use cases
110.2213 + // where a single method handle must interoperate with
110.2214 + // an interface that implements a function-like
110.2215 + // API. Additional variations, such as single-abstract-method classes with
110.2216 + // private constructors, or interfaces with multiple but related
110.2217 + // entry points, must be covered by hand-written or automatically
110.2218 + // generated adapter classes.
110.2219 + //
110.2220 + public static
110.2221 + <T> T asInstance(final MethodHandle target, final Class<T> smType) {
110.2222 + // POC implementation only; violates the above contract several ways
110.2223 + final Method sm = getSingleMethod(smType);
110.2224 + if (sm == null)
110.2225 + throw new IllegalArgumentException("not a single-method interface: "+smType.getName());
110.2226 + MethodType smMT = MethodType.methodType(sm.getReturnType(), sm.getParameterTypes());
110.2227 + MethodHandle checkTarget = target.asType(smMT); // make throw WMT
110.2228 + checkTarget = checkTarget.asType(checkTarget.type().changeReturnType(Object.class));
110.2229 + final MethodHandle vaTarget = checkTarget.asSpreader(Object[].class, smMT.parameterCount());
110.2230 + return smType.cast(Proxy.newProxyInstance(
110.2231 + smType.getClassLoader(),
110.2232 + new Class[]{ smType, WrapperInstance.class },
110.2233 + new InvocationHandler() {
110.2234 + private Object getArg(String name) {
110.2235 + if ((Object)name == "getWrapperInstanceTarget") return target;
110.2236 + if ((Object)name == "getWrapperInstanceType") return smType;
110.2237 + throw new AssertionError();
110.2238 + }
110.2239 + public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
110.2240 + if (method.getDeclaringClass() == WrapperInstance.class)
110.2241 + return getArg(method.getName());
110.2242 + if (method.equals(sm))
110.2243 + return vaTarget.invokeExact(args);
110.2244 + if (isObjectMethod(method))
110.2245 + return callObjectMethod(this, method, args);
110.2246 + throw new InternalError();
110.2247 + }
110.2248 + }));
110.2249 + }
110.2250 +
110.2251 + /**
110.2252 + * Determines if the given object was produced by a call to {@link #asInstance asInstance}.
110.2253 + * @param x any reference
110.2254 + * @return true if the reference is not null and points to an object produced by {@code asInstance}
110.2255 + */
110.2256 + public static
110.2257 + boolean isWrapperInstance(Object x) {
110.2258 + return x instanceof WrapperInstance;
110.2259 + }
110.2260 +
110.2261 + private static WrapperInstance asWrapperInstance(Object x) {
110.2262 + try {
110.2263 + if (x != null)
110.2264 + return (WrapperInstance) x;
110.2265 + } catch (ClassCastException ex) {
110.2266 + }
110.2267 + throw new IllegalArgumentException("not a wrapper instance");
110.2268 + }
110.2269 +
110.2270 + /**
110.2271 + * Produces or recovers a target method handle which is behaviorally
110.2272 + * equivalent to the unique method of this wrapper instance.
110.2273 + * The object {@code x} must have been produced by a call to {@link #asInstance asInstance}.
110.2274 + * This requirement may be tested via {@link #isWrapperInstance isWrapperInstance}.
110.2275 + * @param x any reference
110.2276 + * @return a method handle implementing the unique method
110.2277 + * @throws IllegalArgumentException if the reference x is not to a wrapper instance
110.2278 + */
110.2279 + public static
110.2280 + MethodHandle wrapperInstanceTarget(Object x) {
110.2281 + return asWrapperInstance(x).getWrapperInstanceTarget();
110.2282 + }
110.2283 +
110.2284 + /**
110.2285 + * Recovers the unique single-method interface type for which this wrapper instance was created.
110.2286 + * The object {@code x} must have been produced by a call to {@link #asInstance asInstance}.
110.2287 + * This requirement may be tested via {@link #isWrapperInstance isWrapperInstance}.
110.2288 + * @param x any reference
110.2289 + * @return the single-method interface type for which the wrapper was created
110.2290 + * @throws IllegalArgumentException if the reference x is not to a wrapper instance
110.2291 + */
110.2292 + public static
110.2293 + Class<?> wrapperInstanceType(Object x) {
110.2294 + return asWrapperInstance(x).getWrapperInstanceType();
110.2295 + }
110.2296 +
110.2297 + private static
110.2298 + boolean isObjectMethod(Method m) {
110.2299 + switch (m.getName()) {
110.2300 + case "toString":
110.2301 + return (m.getReturnType() == String.class
110.2302 + && m.getParameterTypes().length == 0);
110.2303 + case "hashCode":
110.2304 + return (m.getReturnType() == int.class
110.2305 + && m.getParameterTypes().length == 0);
110.2306 + case "equals":
110.2307 + return (m.getReturnType() == boolean.class
110.2308 + && m.getParameterTypes().length == 1
110.2309 + && m.getParameterTypes()[0] == Object.class);
110.2310 + }
110.2311 + return false;
110.2312 + }
110.2313 +
110.2314 + private static
110.2315 + Object callObjectMethod(Object self, Method m, Object[] args) {
110.2316 + assert(isObjectMethod(m)) : m;
110.2317 + switch (m.getName()) {
110.2318 + case "toString":
110.2319 + return self.getClass().getName() + "@" + Integer.toHexString(self.hashCode());
110.2320 + case "hashCode":
110.2321 + return System.identityHashCode(self);
110.2322 + case "equals":
110.2323 + return (self == args[0]);
110.2324 + }
110.2325 + return null;
110.2326 + }
110.2327 +
110.2328 + private static
110.2329 + Method getSingleMethod(Class<?> smType) {
110.2330 + Method sm = null;
110.2331 + for (Method m : smType.getMethods()) {
110.2332 + int mod = m.getModifiers();
110.2333 + if (Modifier.isAbstract(mod)) {
110.2334 + if (sm != null && !isObjectMethod(sm))
110.2335 + return null; // too many abstract methods
110.2336 + sm = m;
110.2337 + }
110.2338 + }
110.2339 + if (!smType.isInterface() && getSingleConstructor(smType) == null)
110.2340 + return null; // wrong kind of constructor
110.2341 + return sm;
110.2342 + }
110.2343 +
110.2344 + private static
110.2345 + Constructor getSingleConstructor(Class<?> smType) {
110.2346 + for (Constructor c : smType.getDeclaredConstructors()) {
110.2347 + if (c.getParameterTypes().length == 0) {
110.2348 + int mod = c.getModifiers();
110.2349 + if (Modifier.isPublic(mod) || Modifier.isProtected(mod))
110.2350 + return c;
110.2351 + }
110.2352 + }
110.2353 + return null;
110.2354 + }
110.2355 +
110.2356 + /*non-public*/
110.2357 + static MethodHandle asVarargsCollector(MethodHandle target, Class<?> arrayType) {
110.2358 + return MethodHandleImpl.asVarargsCollector(target, arrayType);
110.2359 + }
110.2360 +}
111.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
111.2 +++ b/src/share/classes/java/lang/invoke/MethodType.java Tue Mar 29 20:19:55 2011 -0700
111.3 @@ -0,0 +1,841 @@
111.4 +/*
111.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
111.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
111.7 + *
111.8 + * This code is free software; you can redistribute it and/or modify it
111.9 + * under the terms of the GNU General Public License version 2 only, as
111.10 + * published by the Free Software Foundation. Oracle designates this
111.11 + * particular file as subject to the "Classpath" exception as provided
111.12 + * by Oracle in the LICENSE file that accompanied this code.
111.13 + *
111.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
111.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
111.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
111.17 + * version 2 for more details (a copy is included in the LICENSE file that
111.18 + * accompanied this code).
111.19 + *
111.20 + * You should have received a copy of the GNU General Public License version
111.21 + * 2 along with this work; if not, write to the Free Software Foundation,
111.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
111.23 + *
111.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
111.25 + * or visit www.oracle.com if you need additional information or have any
111.26 + * questions.
111.27 + */
111.28 +
111.29 +package java.lang.invoke;
111.30 +
111.31 +import java.util.Arrays;
111.32 +import java.util.Collections;
111.33 +import java.util.HashMap;
111.34 +import java.util.List;
111.35 +import sun.invoke.util.BytecodeDescriptor;
111.36 +import static java.lang.invoke.MethodHandleStatics.*;
111.37 +
111.38 +/**
111.39 + * A method type represents the arguments and return type accepted and
111.40 + * returned by a method handle, or the arguments and return type passed
111.41 + * and expected by a method handle caller. Method types must be properly
111.42 + * matched between a method handle and all its callers,
111.43 + * and the JVM's operations enforce this matching at, specifically
111.44 + * during calls to {@link MethodHandle#invokeExact MethodHandle.invokeExact}
111.45 + * and {@link MethodHandle#invokeGeneric MethodHandle.invokeGeneric}, and during execution
111.46 + * of {@code invokedynamic} instructions.
111.47 + * <p>
111.48 + * The structure is a return type accompanied by any number of parameter types.
111.49 + * The types (primitive, {@code void}, and reference) are represented by {@link Class} objects.
111.50 + * (For ease of exposition, we treat {@code void} as if it were a type.
111.51 + * In fact, it denotes the absence of a return type.)
111.52 + * <p>
111.53 + * All instances of {@code MethodType} are immutable.
111.54 + * Two instances are completely interchangeable if they compare equal.
111.55 + * Equality depends on pairwise correspondence of the return and parameter types and on nothing else.
111.56 + * <p>
111.57 + * This type can be created only by factory methods.
111.58 + * All factory methods may cache values, though caching is not guaranteed.
111.59 + * Some factory methods are static, while others are virtual methods which
111.60 + * modify precursor method types, e.g., by changing a selected parameter.
111.61 + * <p>
111.62 + * Factory methods which operate on groups of parameter types
111.63 + * are systematically presented in two versions, so that both Java arrays and
111.64 + * Java lists can be used to work with groups of parameter types.
111.65 + * The query methods {@code parameterArray} and {@code parameterList}
111.66 + * also provide a choice between arrays and lists.
111.67 + * <p>
111.68 + * {@code MethodType} objects are sometimes derived from bytecode instructions
111.69 + * such as {@code invokedynamic}, specifically from the type descriptor strings associated
111.70 + * with the instructions in a class file's constant pool.
111.71 + * <p>
111.72 + * Like classes and strings, method types can also be represented directly
111.73 + * in a class file's constant pool as constants.
111.74 + * A method type may be loaded by an {@code ldc} instruction which refers
111.75 + * to a suitable {@code CONSTANT_MethodType} constant pool entry.
111.76 + * The entry refers to a {@code CONSTANT_Utf8} spelling for the descriptor string.
111.77 + * For more details, see the <a href="package-summary.html#mtcon">package summary</a>.
111.78 + * <p>
111.79 + * When the JVM materializes a {@code MethodType} from a descriptor string,
111.80 + * all classes named in the descriptor must be accessible, and will be loaded.
111.81 + * (But the classes need not be initialized, as is the case with a {@code CONSTANT_Class}.)
111.82 + * This loading may occur at any time before the {@code MethodType} object is first derived.
111.83 + * @author John Rose, JSR 292 EG
111.84 + */
111.85 +public final
111.86 +class MethodType implements java.io.Serializable {
111.87 + private static final long serialVersionUID = 292L; // {rtype, {ptype...}}
111.88 +
111.89 + // The rtype and ptypes fields define the structural identity of the method type:
111.90 + private final Class<?> rtype;
111.91 + private final Class<?>[] ptypes;
111.92 +
111.93 + // The remaining fields are caches of various sorts:
111.94 + private MethodTypeForm form; // erased form, plus cached data about primitives
111.95 + private MethodType wrapAlt; // alternative wrapped/unwrapped version
111.96 + private Invokers invokers; // cache of handy higher-order adapters
111.97 +
111.98 + /**
111.99 + * Check the given parameters for validity and store them into the final fields.
111.100 + */
111.101 + private MethodType(Class<?> rtype, Class<?>[] ptypes) {
111.102 + checkRtype(rtype);
111.103 + checkPtypes(ptypes);
111.104 + this.rtype = rtype;
111.105 + this.ptypes = ptypes;
111.106 + }
111.107 +
111.108 + /*trusted*/ MethodTypeForm form() { return form; }
111.109 + /*trusted*/ Class<?> rtype() { return rtype; }
111.110 + /*trusted*/ Class<?>[] ptypes() { return ptypes; }
111.111 +
111.112 + private static void checkRtype(Class<?> rtype) {
111.113 + rtype.equals(rtype); // null check
111.114 + }
111.115 + private static int checkPtype(Class<?> ptype) {
111.116 + ptype.getClass(); //NPE
111.117 + if (ptype == void.class)
111.118 + throw newIllegalArgumentException("parameter type cannot be void");
111.119 + if (ptype == double.class || ptype == long.class) return 1;
111.120 + return 0;
111.121 + }
111.122 + /** Return number of extra slots (count of long/double args). */
111.123 + private static int checkPtypes(Class<?>[] ptypes) {
111.124 + int slots = 0;
111.125 + for (Class<?> ptype : ptypes) {
111.126 + slots += checkPtype(ptype);
111.127 + }
111.128 + checkSlotCount(ptypes.length + slots);
111.129 + return slots;
111.130 + }
111.131 + private static void checkSlotCount(int count) {
111.132 + if ((count & 0xFF) != count)
111.133 + throw newIllegalArgumentException("bad parameter count "+count);
111.134 + }
111.135 + private static IndexOutOfBoundsException newIndexOutOfBoundsException(Object num) {
111.136 + if (num instanceof Integer) num = "bad index: "+num;
111.137 + return new IndexOutOfBoundsException(num.toString());
111.138 + }
111.139 +
111.140 + static final HashMap<MethodType,MethodType> internTable
111.141 + = new HashMap<MethodType, MethodType>();
111.142 +
111.143 + static final Class<?>[] NO_PTYPES = {};
111.144 +
111.145 + /**
111.146 + * Finds or creates an instance of the given method type.
111.147 + * @param rtype the return type
111.148 + * @param ptypes the parameter types
111.149 + * @return a method type with the given components
111.150 + * @throws NullPointerException if {@code rtype} or {@code ptypes} or any element of {@code ptypes} is null
111.151 + * @throws IllegalArgumentException if any element of {@code ptypes} is {@code void.class}
111.152 + */
111.153 + public static
111.154 + MethodType methodType(Class<?> rtype, Class<?>[] ptypes) {
111.155 + return makeImpl(rtype, ptypes, false);
111.156 + }
111.157 +
111.158 + /**
111.159 + * Finds or creates a method type with the given components.
111.160 + * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
111.161 + * @return a method type with the given components
111.162 + * @throws NullPointerException if {@code rtype} or {@code ptypes} or any element of {@code ptypes} is null
111.163 + * @throws IllegalArgumentException if any element of {@code ptypes} is {@code void.class}
111.164 + */
111.165 + public static
111.166 + MethodType methodType(Class<?> rtype, List<Class<?>> ptypes) {
111.167 + boolean notrust = false; // random List impl. could return evil ptypes array
111.168 + return makeImpl(rtype, ptypes.toArray(NO_PTYPES), notrust);
111.169 + }
111.170 +
111.171 + /**
111.172 + * Finds or creates a method type with the given components.
111.173 + * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
111.174 + * The leading parameter type is prepended to the remaining array.
111.175 + * @return a method type with the given components
111.176 + * @throws NullPointerException if {@code rtype} or {@code ptype0} or {@code ptypes} or any element of {@code ptypes} is null
111.177 + * @throws IllegalArgumentException if {@code ptype0} or {@code ptypes} or any element of {@code ptypes} is {@code void.class}
111.178 + */
111.179 + public static
111.180 + MethodType methodType(Class<?> rtype, Class<?> ptype0, Class<?>... ptypes) {
111.181 + Class<?>[] ptypes1 = new Class<?>[1+ptypes.length];
111.182 + ptypes1[0] = ptype0;
111.183 + System.arraycopy(ptypes, 0, ptypes1, 1, ptypes.length);
111.184 + return makeImpl(rtype, ptypes1, true);
111.185 + }
111.186 +
111.187 + /**
111.188 + * Finds or creates a method type with the given components.
111.189 + * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
111.190 + * The resulting method has no parameter types.
111.191 + * @return a method type with the given return value
111.192 + * @throws NullPointerException if {@code rtype} is null
111.193 + */
111.194 + public static
111.195 + MethodType methodType(Class<?> rtype) {
111.196 + return makeImpl(rtype, NO_PTYPES, true);
111.197 + }
111.198 +
111.199 + /**
111.200 + * Finds or creates a method type with the given components.
111.201 + * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
111.202 + * The resulting method has the single given parameter type.
111.203 + * @return a method type with the given return value and parameter type
111.204 + * @throws NullPointerException if {@code rtype} or {@code ptype0} is null
111.205 + * @throws IllegalArgumentException if {@code ptype0} is {@code void.class}
111.206 + */
111.207 + public static
111.208 + MethodType methodType(Class<?> rtype, Class<?> ptype0) {
111.209 + return makeImpl(rtype, new Class<?>[]{ ptype0 }, true);
111.210 + }
111.211 +
111.212 + /**
111.213 + * Finds or creates a method type with the given components.
111.214 + * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
111.215 + * The resulting method has the same parameter types as {@code ptypes},
111.216 + * and the specified return type.
111.217 + * @throws NullPointerException if {@code rtype} or {@code ptypes} is null
111.218 + */
111.219 + public static
111.220 + MethodType methodType(Class<?> rtype, MethodType ptypes) {
111.221 + return makeImpl(rtype, ptypes.ptypes, true);
111.222 + }
111.223 +
111.224 + /**
111.225 + * Sole factory method to find or create an interned method type.
111.226 + * @param rtype desired return type
111.227 + * @param ptypes desired parameter types
111.228 + * @param trusted whether the ptypes can be used without cloning
111.229 + * @return the unique method type of the desired structure
111.230 + */
111.231 + /*trusted*/ static
111.232 + MethodType makeImpl(Class<?> rtype, Class<?>[] ptypes, boolean trusted) {
111.233 + if (ptypes == null || ptypes.length == 0) {
111.234 + ptypes = NO_PTYPES; trusted = true;
111.235 + }
111.236 + MethodType mt1 = new MethodType(rtype, ptypes);
111.237 + MethodType mt0;
111.238 + synchronized (internTable) {
111.239 + mt0 = internTable.get(mt1);
111.240 + if (mt0 != null)
111.241 + return mt0;
111.242 + }
111.243 + if (!trusted)
111.244 + // defensively copy the array passed in by the user
111.245 + mt1 = new MethodType(rtype, ptypes.clone());
111.246 + // promote the object to the Real Thing, and reprobe
111.247 + MethodTypeForm form = MethodTypeForm.findForm(mt1);
111.248 + mt1.form = form;
111.249 + if (form.erasedType == mt1) {
111.250 + // This is a principal (erased) type; show it to the JVM.
111.251 + MethodHandleNatives.init(mt1);
111.252 + }
111.253 + synchronized (internTable) {
111.254 + mt0 = internTable.get(mt1);
111.255 + if (mt0 != null)
111.256 + return mt0;
111.257 + internTable.put(mt1, mt1);
111.258 + }
111.259 + return mt1;
111.260 + }
111.261 +
111.262 + private static final MethodType[] objectOnlyTypes = new MethodType[20];
111.263 +
111.264 + /**
111.265 + * Finds or creates a method type whose components are {@code Object} with an optional trailing {@code Object[]} array.
111.266 + * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
111.267 + * All parameters and the return type will be {@code Object},
111.268 + * except the final varargs parameter if any, which will be {@code Object[]}.
111.269 + * @param objectArgCount number of parameters (excluding the varargs parameter if any)
111.270 + * @param varargs whether there will be a varargs parameter, of type {@code Object[]}
111.271 + * @return a totally generic method type, given only its count of parameters and varargs
111.272 + * @throws IllegalArgumentException if {@code objectArgCount} is negative or greater than 255
111.273 + * @see #genericMethodType(int)
111.274 + */
111.275 + public static
111.276 + MethodType genericMethodType(int objectArgCount, boolean varargs) {
111.277 + MethodType mt;
111.278 + checkSlotCount(objectArgCount);
111.279 + int ivarargs = (!varargs ? 0 : 1);
111.280 + int ootIndex = objectArgCount*2 + ivarargs;
111.281 + if (ootIndex < objectOnlyTypes.length) {
111.282 + mt = objectOnlyTypes[ootIndex];
111.283 + if (mt != null) return mt;
111.284 + }
111.285 + Class<?>[] ptypes = new Class<?>[objectArgCount + ivarargs];
111.286 + Arrays.fill(ptypes, Object.class);
111.287 + if (ivarargs != 0) ptypes[objectArgCount] = Object[].class;
111.288 + mt = makeImpl(Object.class, ptypes, true);
111.289 + if (ootIndex < objectOnlyTypes.length) {
111.290 + objectOnlyTypes[ootIndex] = mt; // cache it here also!
111.291 + }
111.292 + return mt;
111.293 + }
111.294 +
111.295 + /**
111.296 + * Finds or creates a method type whose components are all {@code Object}.
111.297 + * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
111.298 + * All parameters and the return type will be Object.
111.299 + * @param objectArgCount number of parameters
111.300 + * @return a totally generic method type, given only its count of parameters
111.301 + * @throws IllegalArgumentException if {@code objectArgCount} is negative or greater than 255
111.302 + * @see #genericMethodType(int, boolean)
111.303 + */
111.304 + public static
111.305 + MethodType genericMethodType(int objectArgCount) {
111.306 + return genericMethodType(objectArgCount, false);
111.307 + }
111.308 +
111.309 + /**
111.310 + * Finds or creates a method type with a single different parameter type.
111.311 + * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
111.312 + * @param num the index (zero-based) of the parameter type to change
111.313 + * @param nptype a new parameter type to replace the old one with
111.314 + * @return the same type, except with the selected parameter changed
111.315 + * @throws IndexOutOfBoundsException if {@code num} is not a valid index into {@code parameterArray()}
111.316 + * @throws IllegalArgumentException if {@code nptype} is {@code void.class}
111.317 + * @throws NullPointerException if {@code nptype} is null
111.318 + */
111.319 + public MethodType changeParameterType(int num, Class<?> nptype) {
111.320 + if (parameterType(num) == nptype) return this;
111.321 + checkPtype(nptype);
111.322 + Class<?>[] nptypes = ptypes.clone();
111.323 + nptypes[num] = nptype;
111.324 + return makeImpl(rtype, nptypes, true);
111.325 + }
111.326 +
111.327 + /**
111.328 + * Finds or creates a method type with additional parameter types.
111.329 + * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
111.330 + * @param num the position (zero-based) of the inserted parameter type(s)
111.331 + * @param ptypesToInsert zero or more new parameter types to insert into the parameter list
111.332 + * @return the same type, except with the selected parameter(s) inserted
111.333 + * @throws IndexOutOfBoundsException if {@code num} is negative or greater than {@code parameterCount()}
111.334 + * @throws IllegalArgumentException if any element of {@code ptypesToInsert} is {@code void.class}
111.335 + * or if the resulting method type would have more than 255 parameter slots
111.336 + * @throws NullPointerException if {@code ptypesToInsert} or any of its elements is null
111.337 + */
111.338 + public MethodType insertParameterTypes(int num, Class<?>... ptypesToInsert) {
111.339 + int len = ptypes.length;
111.340 + if (num < 0 || num > len)
111.341 + throw newIndexOutOfBoundsException(num);
111.342 + int ins = checkPtypes(ptypesToInsert);
111.343 + checkSlotCount(parameterSlotCount() + ptypesToInsert.length + ins);
111.344 + int ilen = ptypesToInsert.length;
111.345 + if (ilen == 0) return this;
111.346 + Class<?>[] nptypes = Arrays.copyOfRange(ptypes, 0, len+ilen);
111.347 + System.arraycopy(nptypes, num, nptypes, num+ilen, len-num);
111.348 + System.arraycopy(ptypesToInsert, 0, nptypes, num, ilen);
111.349 + return makeImpl(rtype, nptypes, true);
111.350 + }
111.351 +
111.352 + /**
111.353 + * Finds or creates a method type with additional parameter types.
111.354 + * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
111.355 + * @param ptypesToInsert zero or more new parameter types to insert after the end of the parameter list
111.356 + * @return the same type, except with the selected parameter(s) appended
111.357 + * @throws IllegalArgumentException if any element of {@code ptypesToInsert} is {@code void.class}
111.358 + * or if the resulting method type would have more than 255 parameter slots
111.359 + * @throws NullPointerException if {@code ptypesToInsert} or any of its elements is null
111.360 + */
111.361 + public MethodType appendParameterTypes(Class<?>... ptypesToInsert) {
111.362 + return insertParameterTypes(parameterCount(), ptypesToInsert);
111.363 + }
111.364 +
111.365 + /**
111.366 + * Finds or creates a method type with additional parameter types.
111.367 + * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
111.368 + * @param num the position (zero-based) of the inserted parameter type(s)
111.369 + * @param ptypesToInsert zero or more new parameter types to insert into the parameter list
111.370 + * @return the same type, except with the selected parameter(s) inserted
111.371 + * @throws IndexOutOfBoundsException if {@code num} is negative or greater than {@code parameterCount()}
111.372 + * @throws IllegalArgumentException if any element of {@code ptypesToInsert} is {@code void.class}
111.373 + * or if the resulting method type would have more than 255 parameter slots
111.374 + * @throws NullPointerException if {@code ptypesToInsert} or any of its elements is null
111.375 + */
111.376 + public MethodType insertParameterTypes(int num, List<Class<?>> ptypesToInsert) {
111.377 + return insertParameterTypes(num, ptypesToInsert.toArray(NO_PTYPES));
111.378 + }
111.379 +
111.380 + /**
111.381 + * Finds or creates a method type with additional parameter types.
111.382 + * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
111.383 + * @param ptypesToInsert zero or more new parameter types to insert after the end of the parameter list
111.384 + * @return the same type, except with the selected parameter(s) appended
111.385 + * @throws IllegalArgumentException if any element of {@code ptypesToInsert} is {@code void.class}
111.386 + * or if the resulting method type would have more than 255 parameter slots
111.387 + * @throws NullPointerException if {@code ptypesToInsert} or any of its elements is null
111.388 + */
111.389 + public MethodType appendParameterTypes(List<Class<?>> ptypesToInsert) {
111.390 + return insertParameterTypes(parameterCount(), ptypesToInsert);
111.391 + }
111.392 +
111.393 + /**
111.394 + * Finds or creates a method type with some parameter types omitted.
111.395 + * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
111.396 + * @param start the index (zero-based) of the first parameter type to remove
111.397 + * @param end the index (greater than {@code start}) of the first parameter type after not to remove
111.398 + * @return the same type, except with the selected parameter(s) removed
111.399 + * @throws IndexOutOfBoundsException if {@code start} is negative or greater than {@code parameterCount()}
111.400 + * or if {@code end} is negative or greater than {@code parameterCount()}
111.401 + * or if {@code start} is greater than {@code end}
111.402 + */
111.403 + public MethodType dropParameterTypes(int start, int end) {
111.404 + int len = ptypes.length;
111.405 + if (!(0 <= start && start <= end && end <= len))
111.406 + throw newIndexOutOfBoundsException("start="+start+" end="+end);
111.407 + if (start == end) return this;
111.408 + Class<?>[] nptypes;
111.409 + if (start == 0) {
111.410 + if (end == len) {
111.411 + // drop all parameters
111.412 + nptypes = NO_PTYPES;
111.413 + } else {
111.414 + // drop initial parameter(s)
111.415 + nptypes = Arrays.copyOfRange(ptypes, end, len);
111.416 + }
111.417 + } else {
111.418 + if (end == len) {
111.419 + // drop trailing parameter(s)
111.420 + nptypes = Arrays.copyOfRange(ptypes, 0, start);
111.421 + } else {
111.422 + int tail = len - end;
111.423 + nptypes = Arrays.copyOfRange(ptypes, 0, start + tail);
111.424 + System.arraycopy(ptypes, end, nptypes, start, tail);
111.425 + }
111.426 + }
111.427 + return makeImpl(rtype, nptypes, true);
111.428 + }
111.429 +
111.430 + /**
111.431 + * Finds or creates a method type with a different return type.
111.432 + * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
111.433 + * @param nrtype a return parameter type to replace the old one with
111.434 + * @return the same type, except with the return type change
111.435 + * @throws NullPointerException if {@code nrtype} is null
111.436 + */
111.437 + public MethodType changeReturnType(Class<?> nrtype) {
111.438 + if (returnType() == nrtype) return this;
111.439 + return makeImpl(nrtype, ptypes, true);
111.440 + }
111.441 +
111.442 + /**
111.443 + * Reports if this type contains a primitive argument or return value.
111.444 + * The return type {@code void} counts as a primitive.
111.445 + * @return true if any of the types are primitives
111.446 + */
111.447 + public boolean hasPrimitives() {
111.448 + return form.hasPrimitives();
111.449 + }
111.450 +
111.451 + /**
111.452 + * Reports if this type contains a wrapper argument or return value.
111.453 + * Wrappers are types which box primitive values, such as {@link Integer}.
111.454 + * The reference type {@code java.lang.Void} counts as a wrapper.
111.455 + * @return true if any of the types are wrappers
111.456 + */
111.457 + public boolean hasWrappers() {
111.458 + return unwrap() != this;
111.459 + }
111.460 +
111.461 + /**
111.462 + * Erases all reference types to {@code Object}.
111.463 + * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
111.464 + * All primitive types (including {@code void}) will remain unchanged.
111.465 + * @return a version of the original type with all reference types replaced
111.466 + */
111.467 + public MethodType erase() {
111.468 + return form.erasedType();
111.469 + }
111.470 +
111.471 + /**
111.472 + * Converts all types, both reference and primitive, to {@code Object}.
111.473 + * Convenience method for {@link #genericMethodType(int) genericMethodType}.
111.474 + * The expression {@code type.wrap().erase()} produces the same value
111.475 + * as {@code type.generic()}.
111.476 + * @return a version of the original type with all types replaced
111.477 + */
111.478 + public MethodType generic() {
111.479 + return genericMethodType(parameterCount());
111.480 + }
111.481 +
111.482 + /**
111.483 + * Converts all primitive types to their corresponding wrapper types.
111.484 + * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
111.485 + * All reference types (including wrapper types) will remain unchanged.
111.486 + * A {@code void} return type is changed to the type {@code java.lang.Void}.
111.487 + * The expression {@code type.wrap().erase()} produces the same value
111.488 + * as {@code type.generic()}.
111.489 + * @return a version of the original type with all primitive types replaced
111.490 + */
111.491 + public MethodType wrap() {
111.492 + return hasPrimitives() ? wrapWithPrims(this) : this;
111.493 + }
111.494 +
111.495 + /**
111.496 + * Converts all wrapper types to their corresponding primitive types.
111.497 + * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
111.498 + * All primitive types (including {@code void}) will remain unchanged.
111.499 + * A return type of {@code java.lang.Void} is changed to {@code void}.
111.500 + * @return a version of the original type with all wrapper types replaced
111.501 + */
111.502 + public MethodType unwrap() {
111.503 + MethodType noprims = !hasPrimitives() ? this : wrapWithPrims(this);
111.504 + return unwrapWithNoPrims(noprims);
111.505 + }
111.506 +
111.507 + private static MethodType wrapWithPrims(MethodType pt) {
111.508 + assert(pt.hasPrimitives());
111.509 + MethodType wt = pt.wrapAlt;
111.510 + if (wt == null) {
111.511 + // fill in lazily
111.512 + wt = MethodTypeForm.canonicalize(pt, MethodTypeForm.WRAP, MethodTypeForm.WRAP);
111.513 + assert(wt != null);
111.514 + pt.wrapAlt = wt;
111.515 + }
111.516 + return wt;
111.517 + }
111.518 +
111.519 + private static MethodType unwrapWithNoPrims(MethodType wt) {
111.520 + assert(!wt.hasPrimitives());
111.521 + MethodType uwt = wt.wrapAlt;
111.522 + if (uwt == null) {
111.523 + // fill in lazily
111.524 + uwt = MethodTypeForm.canonicalize(wt, MethodTypeForm.UNWRAP, MethodTypeForm.UNWRAP);
111.525 + if (uwt == null)
111.526 + uwt = wt; // type has no wrappers or prims at all
111.527 + wt.wrapAlt = uwt;
111.528 + }
111.529 + return uwt;
111.530 + }
111.531 +
111.532 + /**
111.533 + * Returns the parameter type at the specified index, within this method type.
111.534 + * @param num the index (zero-based) of the desired parameter type
111.535 + * @return the selected parameter type
111.536 + * @throws IndexOutOfBoundsException if {@code num} is not a valid index into {@code parameterArray()}
111.537 + */
111.538 + public Class<?> parameterType(int num) {
111.539 + return ptypes[num];
111.540 + }
111.541 + /**
111.542 + * Returns the number of parameter types in this method type.
111.543 + * @return the number of parameter types
111.544 + */
111.545 + public int parameterCount() {
111.546 + return ptypes.length;
111.547 + }
111.548 + /**
111.549 + * Returns the return type of this method type.
111.550 + * @return the return type
111.551 + */
111.552 + public Class<?> returnType() {
111.553 + return rtype;
111.554 + }
111.555 +
111.556 + /**
111.557 + * Presents the parameter types as a list (a convenience method).
111.558 + * The list will be immutable.
111.559 + * @return the parameter types (as an immutable list)
111.560 + */
111.561 + public List<Class<?>> parameterList() {
111.562 + return Collections.unmodifiableList(Arrays.asList(ptypes));
111.563 + }
111.564 +
111.565 + /**
111.566 + * Presents the parameter types as an array (a convenience method).
111.567 + * Changes to the array will not result in changes to the type.
111.568 + * @return the parameter types (as a fresh copy if necessary)
111.569 + */
111.570 + public Class<?>[] parameterArray() {
111.571 + return ptypes.clone();
111.572 + }
111.573 +
111.574 + /**
111.575 + * Compares the specified object with this type for equality.
111.576 + * That is, it returns <tt>true</tt> if and only if the specified object
111.577 + * is also a method type with exactly the same parameters and return type.
111.578 + * @param x object to compare
111.579 + * @see Object#equals(Object)
111.580 + */
111.581 + @Override
111.582 + public boolean equals(Object x) {
111.583 + return this == x || x instanceof MethodType && equals((MethodType)x);
111.584 + }
111.585 +
111.586 + private boolean equals(MethodType that) {
111.587 + return this.rtype == that.rtype
111.588 + && Arrays.equals(this.ptypes, that.ptypes);
111.589 + }
111.590 +
111.591 + /**
111.592 + * Returns the hash code value for this method type.
111.593 + * It is defined to be the same as the hashcode of a List
111.594 + * whose elements are the return type followed by the
111.595 + * parameter types.
111.596 + * @return the hash code value for this method type
111.597 + * @see Object#hashCode()
111.598 + * @see #equals(Object)
111.599 + * @see List#hashCode()
111.600 + */
111.601 + @Override
111.602 + public int hashCode() {
111.603 + int hashCode = 31 + rtype.hashCode();
111.604 + for (Class<?> ptype : ptypes)
111.605 + hashCode = 31*hashCode + ptype.hashCode();
111.606 + return hashCode;
111.607 + }
111.608 +
111.609 + /**
111.610 + * Returns a string representation of the method type,
111.611 + * of the form {@code "(PT0,PT1...)RT"}.
111.612 + * The string representation of a method type is a
111.613 + * parenthesis enclosed, comma separated list of type names,
111.614 + * followed immediately by the return type.
111.615 + * <p>
111.616 + * Each type is represented by its
111.617 + * {@link java.lang.Class#getSimpleName simple name}.
111.618 + */
111.619 + @Override
111.620 + public String toString() {
111.621 + StringBuilder sb = new StringBuilder();
111.622 + sb.append("(");
111.623 + for (int i = 0; i < ptypes.length; i++) {
111.624 + if (i > 0) sb.append(",");
111.625 + sb.append(ptypes[i].getSimpleName());
111.626 + }
111.627 + sb.append(")");
111.628 + sb.append(rtype.getSimpleName());
111.629 + return sb.toString();
111.630 + }
111.631 +
111.632 + /// Queries which have to do with the bytecode architecture
111.633 +
111.634 + /** Reports the number of JVM stack slots required to invoke a method
111.635 + * of this type. Note that (for historical reasons) the JVM requires
111.636 + * a second stack slot to pass long and double arguments.
111.637 + * So this method returns {@link #parameterCount() parameterCount} plus the
111.638 + * number of long and double parameters (if any).
111.639 + * <p>
111.640 + * This method is included for the benfit of applications that must
111.641 + * generate bytecodes that process method handles and invokedynamic.
111.642 + * @return the number of JVM stack slots for this type's parameters
111.643 + */
111.644 + /*non-public*/ int parameterSlotCount() {
111.645 + return form.parameterSlotCount();
111.646 + }
111.647 +
111.648 + /*non-public*/ Invokers invokers() {
111.649 + Invokers inv = invokers;
111.650 + if (inv != null) return inv;
111.651 + invokers = inv = new Invokers(this);
111.652 + return inv;
111.653 + }
111.654 +
111.655 + /** Reports the number of JVM stack slots which carry all parameters including and after
111.656 + * the given position, which must be in the range of 0 to
111.657 + * {@code parameterCount} inclusive. Successive parameters are
111.658 + * more shallowly stacked, and parameters are indexed in the bytecodes
111.659 + * according to their trailing edge. Thus, to obtain the depth
111.660 + * in the outgoing call stack of parameter {@code N}, obtain
111.661 + * the {@code parameterSlotDepth} of its trailing edge
111.662 + * at position {@code N+1}.
111.663 + * <p>
111.664 + * Parameters of type {@code long} and {@code double} occupy
111.665 + * two stack slots (for historical reasons) and all others occupy one.
111.666 + * Therefore, the number returned is the number of arguments
111.667 + * <em>including</em> and <em>after</em> the given parameter,
111.668 + * <em>plus</em> the number of long or double arguments
111.669 + * at or after after the argument for the given parameter.
111.670 + * <p>
111.671 + * This method is included for the benfit of applications that must
111.672 + * generate bytecodes that process method handles and invokedynamic.
111.673 + * @param num an index (zero-based, inclusive) within the parameter types
111.674 + * @return the index of the (shallowest) JVM stack slot transmitting the
111.675 + * given parameter
111.676 + * @throws IllegalArgumentException if {@code num} is negative or greater than {@code parameterCount()}
111.677 + */
111.678 + /*non-public*/ int parameterSlotDepth(int num) {
111.679 + if (num < 0 || num > ptypes.length)
111.680 + parameterType(num); // force a range check
111.681 + return form.parameterToArgSlot(num-1);
111.682 + }
111.683 +
111.684 + /** Reports the number of JVM stack slots required to receive a return value
111.685 + * from a method of this type.
111.686 + * If the {@link #returnType() return type} is void, it will be zero,
111.687 + * else if the return type is long or double, it will be two, else one.
111.688 + * <p>
111.689 + * This method is included for the benfit of applications that must
111.690 + * generate bytecodes that process method handles and invokedynamic.
111.691 + * @return the number of JVM stack slots (0, 1, or 2) for this type's return value
111.692 + * Will be removed for PFD.
111.693 + */
111.694 + /*non-public*/ int returnSlotCount() {
111.695 + return form.returnSlotCount();
111.696 + }
111.697 +
111.698 + /**
111.699 + * Finds or creates an instance of a method type, given the spelling of its bytecode descriptor.
111.700 + * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[]) methodType}.
111.701 + * Any class or interface name embedded in the descriptor string
111.702 + * will be resolved by calling {@link ClassLoader#loadClass(java.lang.String)}
111.703 + * on the given loader (or if it is null, on the system class loader).
111.704 + * <p>
111.705 + * Note that it is possible to encounter method types which cannot be
111.706 + * constructed by this method, because their component types are
111.707 + * not all reachable from a common class loader.
111.708 + * <p>
111.709 + * This method is included for the benfit of applications that must
111.710 + * generate bytecodes that process method handles and {@code invokedynamic}.
111.711 + * @param descriptor a bytecode-level type descriptor string "(T...)T"
111.712 + * @param loader the class loader in which to look up the types
111.713 + * @return a method type matching the bytecode-level type descriptor
111.714 + * @throws IllegalArgumentException if the string is not well-formed
111.715 + * @throws TypeNotPresentException if a named type cannot be found
111.716 + */
111.717 + public static MethodType fromMethodDescriptorString(String descriptor, ClassLoader loader)
111.718 + throws IllegalArgumentException, TypeNotPresentException
111.719 + {
111.720 + List<Class<?>> types = BytecodeDescriptor.parseMethod(descriptor, loader);
111.721 + Class<?> rtype = types.remove(types.size() - 1);
111.722 + Class<?>[] ptypes = types.toArray(NO_PTYPES);
111.723 + return makeImpl(rtype, ptypes, true);
111.724 + }
111.725 +
111.726 + /**
111.727 + * Produces a bytecode descriptor representation of the method type.
111.728 + * <p>
111.729 + * Note that this is not a strict inverse of {@link #fromMethodDescriptorString fromMethodDescriptorString}.
111.730 + * Two distinct classes which share a common name but have different class loaders
111.731 + * will appear identical when viewed within descriptor strings.
111.732 + * <p>
111.733 + * This method is included for the benfit of applications that must
111.734 + * generate bytecodes that process method handles and {@code invokedynamic}.
111.735 + * {@link #fromMethodDescriptorString(java.lang.String, java.lang.ClassLoader) fromMethodDescriptorString},
111.736 + * because the latter requires a suitable class loader argument.
111.737 + * @return the bytecode type descriptor representation
111.738 + */
111.739 + public String toMethodDescriptorString() {
111.740 + return BytecodeDescriptor.unparse(this);
111.741 + }
111.742 +
111.743 + /// Serialization.
111.744 +
111.745 + /**
111.746 + * There are no serializable fields for {@code MethodType}.
111.747 + */
111.748 + private static final java.io.ObjectStreamField[] serialPersistentFields = { };
111.749 +
111.750 + /**
111.751 + * Save the {@code MethodType} instance to a stream.
111.752 + *
111.753 + * @serialData
111.754 + * For portability, the serialized format does not refer to named fields.
111.755 + * Instead, the return type and parameter type arrays are written directly
111.756 + * from the {@code writeObject} method, using two calls to {@code s.writeObject}
111.757 + * as follows:
111.758 + * <blockquote><pre>
111.759 +s.writeObject(this.returnType());
111.760 +s.writeObject(this.parameterArray());
111.761 + * </pre></blockquote>
111.762 + * <p>
111.763 + * The deserialized field values are checked as if they were
111.764 + * provided to the factory method {@link #methodType(Class,Class[]) methodType}.
111.765 + * For example, null values, or {@code void} parameter types,
111.766 + * will lead to exceptions during deserialization.
111.767 + * @param the stream to write the object to
111.768 + */
111.769 + private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
111.770 + s.defaultWriteObject(); // requires serialPersistentFields to be an empty array
111.771 + s.writeObject(returnType());
111.772 + s.writeObject(parameterArray());
111.773 + }
111.774 +
111.775 + /**
111.776 + * Reconstitute the {@code MethodType} instance from a stream (that is,
111.777 + * deserialize it).
111.778 + * This instance is a scratch object with bogus final fields.
111.779 + * It provides the parameters to the factory method called by
111.780 + * {@link #readResolve readResolve}.
111.781 + * After that call it is discarded.
111.782 + * @param the stream to read the object from
111.783 + * @see #MethodType()
111.784 + * @see #readResolve
111.785 + * @see #writeObject
111.786 + */
111.787 + private void readObject(java.io.ObjectInputStream s) throws java.io.IOException, ClassNotFoundException {
111.788 + s.defaultReadObject(); // requires serialPersistentFields to be an empty array
111.789 +
111.790 + Class<?> returnType = (Class<?>) s.readObject();
111.791 + Class<?>[] parameterArray = (Class<?>[]) s.readObject();
111.792 +
111.793 + // Probably this object will never escape, but let's check
111.794 + // the field values now, just to be sure.
111.795 + checkRtype(returnType);
111.796 + checkPtypes(parameterArray);
111.797 +
111.798 + parameterArray = parameterArray.clone(); // make sure it is unshared
111.799 + MethodType_init(returnType, parameterArray);
111.800 + }
111.801 +
111.802 + /**
111.803 + * For serialization only.
111.804 + * Sets the final fields to null, pending {@code Unsafe.putObject}.
111.805 + */
111.806 + private MethodType() {
111.807 + this.rtype = null;
111.808 + this.ptypes = null;
111.809 + }
111.810 + private void MethodType_init(Class<?> rtype, Class<?>[] ptypes) {
111.811 + // In order to communicate these values to readResolve, we must
111.812 + // store them into the implementation-specific final fields.
111.813 + checkRtype(rtype);
111.814 + checkPtypes(ptypes);
111.815 + unsafe.putObject(this, rtypeOffset, rtype);
111.816 + unsafe.putObject(this, ptypesOffset, ptypes);
111.817 + }
111.818 +
111.819 + // Support for resetting final fields while deserializing
111.820 + private static final sun.misc.Unsafe unsafe = sun.misc.Unsafe.getUnsafe();
111.821 + private static final long rtypeOffset, ptypesOffset;
111.822 + static {
111.823 + try {
111.824 + rtypeOffset = unsafe.objectFieldOffset
111.825 + (MethodType.class.getDeclaredField("rtype"));
111.826 + ptypesOffset = unsafe.objectFieldOffset
111.827 + (MethodType.class.getDeclaredField("ptypes"));
111.828 + } catch (Exception ex) {
111.829 + throw new Error(ex);
111.830 + }
111.831 + }
111.832 +
111.833 + /**
111.834 + * Resolves and initializes a {@code MethodType} object
111.835 + * after serialization.
111.836 + * @return the fully initialized {@code MethodType} object
111.837 + */
111.838 + private Object readResolve() {
111.839 + // Do not use a trusted path for deserialization:
111.840 + //return makeImpl(rtype, ptypes, true);
111.841 + // Verify all operands, and make sure ptypes is unshared:
111.842 + return methodType(rtype, ptypes);
111.843 + }
111.844 +}
112.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
112.2 +++ b/src/share/classes/java/lang/invoke/MethodTypeForm.java Tue Mar 29 20:19:55 2011 -0700
112.3 @@ -0,0 +1,476 @@
112.4 +/*
112.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
112.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
112.7 + *
112.8 + * This code is free software; you can redistribute it and/or modify it
112.9 + * under the terms of the GNU General Public License version 2 only, as
112.10 + * published by the Free Software Foundation. Oracle designates this
112.11 + * particular file as subject to the "Classpath" exception as provided
112.12 + * by Oracle in the LICENSE file that accompanied this code.
112.13 + *
112.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
112.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
112.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
112.17 + * version 2 for more details (a copy is included in the LICENSE file that
112.18 + * accompanied this code).
112.19 + *
112.20 + * You should have received a copy of the GNU General Public License version
112.21 + * 2 along with this work; if not, write to the Free Software Foundation,
112.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
112.23 + *
112.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
112.25 + * or visit www.oracle.com if you need additional information or have any
112.26 + * questions.
112.27 + */
112.28 +
112.29 +package java.lang.invoke;
112.30 +
112.31 +import sun.invoke.util.Wrapper;
112.32 +import static java.lang.invoke.MethodHandleStatics.*;
112.33 +
112.34 +/**
112.35 + * Shared information for a group of method types, which differ
112.36 + * only by reference types, and therefore share a common erasure
112.37 + * and wrapping.
112.38 + * <p>
112.39 + * For an empirical discussion of the structure of method types,
112.40 + * see <a href="http://groups.google.com/group/jvm-languages/browse_thread/thread/ac9308ae74da9b7e/">
112.41 + * the thread "Avoiding Boxing" on jvm-languages</a>.
112.42 + * There are approximately 2000 distinct erased method types in the JDK.
112.43 + * There are a little over 10 times that number of unerased types.
112.44 + * No more than half of these are likely to be loaded at once.
112.45 + * @author John Rose
112.46 + */
112.47 +class MethodTypeForm {
112.48 + final int[] argToSlotTable, slotToArgTable;
112.49 + final long argCounts; // packed slot & value counts
112.50 + final long primCounts; // packed prim & double counts
112.51 + final int vmslots; // total number of parameter slots
112.52 + final MethodType erasedType; // the canonical erasure
112.53 +
112.54 + /*lazy*/ MethodType primsAsBoxes; // replace prims by wrappers
112.55 + /*lazy*/ MethodType primArgsAsBoxes; // wrap args only; make raw return
112.56 + /*lazy*/ MethodType primsAsInts; // replace prims by int/long
112.57 + /*lazy*/ MethodType primsAsLongs; // replace prims by long
112.58 + /*lazy*/ MethodType primsAtEnd; // reorder primitives to the end
112.59 +
112.60 + // Cached adapter information:
112.61 + /*lazy*/ ToGeneric toGeneric; // convert cs. with prims to w/o
112.62 + /*lazy*/ FromGeneric fromGeneric; // convert cs. w/o prims to with
112.63 + /*lazy*/ SpreadGeneric[] spreadGeneric; // expand one argument to many
112.64 + /*lazy*/ FilterGeneric filterGeneric; // convert argument(s) on the fly
112.65 + /*lazy*/ MethodHandle genericInvoker; // hook for invokeGeneric
112.66 +
112.67 + public MethodType erasedType() {
112.68 + return erasedType;
112.69 + }
112.70 +
112.71 + protected MethodTypeForm(MethodType erasedType) {
112.72 + this.erasedType = erasedType;
112.73 +
112.74 + Class<?>[] ptypes = erasedType.ptypes();
112.75 + int ptypeCount = ptypes.length;
112.76 + int pslotCount = ptypeCount; // temp. estimate
112.77 + int rtypeCount = 1; // temp. estimate
112.78 + int rslotCount = 1; // temp. estimate
112.79 +
112.80 + int[] argToSlotTab = null, slotToArgTab = null;
112.81 +
112.82 + // Walk the argument types, looking for primitives.
112.83 + int pac = 0, lac = 0, prc = 0, lrc = 0;
112.84 + Class<?> epts[] = ptypes;
112.85 + for (int i = 0; i < epts.length; i++) {
112.86 + Class<?> pt = epts[i];
112.87 + if (pt != Object.class) {
112.88 + assert(pt.isPrimitive());
112.89 + ++pac;
112.90 + if (hasTwoArgSlots(pt)) ++lac;
112.91 + }
112.92 + }
112.93 + pslotCount += lac; // #slots = #args + #longs
112.94 + Class<?> rt = erasedType.returnType();
112.95 + if (rt != Object.class) {
112.96 + ++prc; // even void.class counts as a prim here
112.97 + if (hasTwoArgSlots(rt)) ++lrc;
112.98 + // adjust #slots, #args
112.99 + if (rt == void.class)
112.100 + rtypeCount = rslotCount = 0;
112.101 + else
112.102 + rslotCount += lrc;
112.103 + }
112.104 + if (lac != 0) {
112.105 + int slot = ptypeCount + lac;
112.106 + slotToArgTab = new int[slot+1];
112.107 + argToSlotTab = new int[1+ptypeCount];
112.108 + argToSlotTab[0] = slot; // argument "-1" is past end of slots
112.109 + for (int i = 0; i < epts.length; i++) {
112.110 + Class<?> pt = epts[i];
112.111 + if (hasTwoArgSlots(pt)) --slot;
112.112 + --slot;
112.113 + slotToArgTab[slot] = i+1; // "+1" see argSlotToParameter note
112.114 + argToSlotTab[1+i] = slot;
112.115 + }
112.116 + assert(slot == 0); // filled the table
112.117 + }
112.118 + this.primCounts = pack(lrc, prc, lac, pac);
112.119 + this.argCounts = pack(rslotCount, rtypeCount, pslotCount, ptypeCount);
112.120 + if (slotToArgTab == null) {
112.121 + int slot = ptypeCount; // first arg is deepest in stack
112.122 + slotToArgTab = new int[slot+1];
112.123 + argToSlotTab = new int[1+ptypeCount];
112.124 + argToSlotTab[0] = slot; // argument "-1" is past end of slots
112.125 + for (int i = 0; i < ptypeCount; i++) {
112.126 + --slot;
112.127 + slotToArgTab[slot] = i+1; // "+1" see argSlotToParameter note
112.128 + argToSlotTab[1+i] = slot;
112.129 + }
112.130 + }
112.131 + this.argToSlotTable = argToSlotTab;
112.132 + this.slotToArgTable = slotToArgTab;
112.133 +
112.134 + if (pslotCount >= 256) throw newIllegalArgumentException("too many arguments");
112.135 +
112.136 + // send a few bits down to the JVM:
112.137 + this.vmslots = parameterSlotCount();
112.138 +
112.139 + // short circuit some no-op canonicalizations:
112.140 + if (!hasPrimitives()) {
112.141 + primsAsBoxes = erasedType;
112.142 + primArgsAsBoxes = erasedType;
112.143 + primsAsInts = erasedType;
112.144 + primsAsLongs = erasedType;
112.145 + primsAtEnd = erasedType;
112.146 + }
112.147 + }
112.148 +
112.149 + /** Turn all primitive types to corresponding wrapper types.
112.150 + */
112.151 + public MethodType primsAsBoxes() {
112.152 + MethodType ct = primsAsBoxes;
112.153 + if (ct != null) return ct;
112.154 + MethodType t = erasedType;
112.155 + ct = canonicalize(erasedType, WRAP, WRAP);
112.156 + if (ct == null) ct = t; // no prims to box
112.157 + return primsAsBoxes = ct;
112.158 + }
112.159 +
112.160 + /** Turn all primitive argument types to corresponding wrapper types.
112.161 + * Subword and void return types are promoted to int.
112.162 + */
112.163 + public MethodType primArgsAsBoxes() {
112.164 + MethodType ct = primArgsAsBoxes;
112.165 + if (ct != null) return ct;
112.166 + MethodType t = erasedType;
112.167 + ct = canonicalize(erasedType, RAW_RETURN, WRAP);
112.168 + if (ct == null) ct = t; // no prims to box
112.169 + return primArgsAsBoxes = ct;
112.170 + }
112.171 +
112.172 + /** Turn all primitive types to either int or long.
112.173 + * Floating point return types are not changed, because
112.174 + * they may require special calling sequences.
112.175 + * A void return value is turned to int.
112.176 + */
112.177 + public MethodType primsAsInts() {
112.178 + MethodType ct = primsAsInts;
112.179 + if (ct != null) return ct;
112.180 + MethodType t = erasedType;
112.181 + ct = canonicalize(t, RAW_RETURN, INTS);
112.182 + if (ct == null) ct = t; // no prims to int-ify
112.183 + return primsAsInts = ct;
112.184 + }
112.185 +
112.186 + /** Turn all primitive types to either int or long.
112.187 + * Floating point return types are not changed, because
112.188 + * they may require special calling sequences.
112.189 + * A void return value is turned to int.
112.190 + */
112.191 + public MethodType primsAsLongs() {
112.192 + MethodType ct = primsAsLongs;
112.193 + if (ct != null) return ct;
112.194 + MethodType t = erasedType;
112.195 + ct = canonicalize(t, RAW_RETURN, LONGS);
112.196 + if (ct == null) ct = t; // no prims to int-ify
112.197 + return primsAsLongs = ct;
112.198 + }
112.199 +
112.200 + /** Stably sort parameters into 3 buckets: ref, int, long. */
112.201 + public MethodType primsAtEnd() {
112.202 + MethodType ct = primsAtEnd;
112.203 + if (ct != null) return ct;
112.204 + MethodType t = erasedType;
112.205 +
112.206 + int pac = primitiveParameterCount();
112.207 + if (pac == 0)
112.208 + return primsAtEnd = t;
112.209 +
112.210 + int argc = parameterCount();
112.211 + int lac = longPrimitiveParameterCount();
112.212 + if (pac == argc && (lac == 0 || lac == argc))
112.213 + return primsAtEnd = t;
112.214 +
112.215 + // known to have a mix of 2 or 3 of ref, int, long
112.216 + int[] reorder = primsAtEndOrder(t);
112.217 + ct = reorderParameters(t, reorder, null);
112.218 + //System.out.println("t="+t+" / reorder="+java.util.Arrays.toString(reorder)+" => "+ct);
112.219 + return primsAtEnd = ct;
112.220 + }
112.221 +
112.222 + /** Compute a new ordering of parameters so that all references
112.223 + * are before all ints or longs, and all ints are before all longs.
112.224 + * For this ordering, doubles count as longs, and all other primitive
112.225 + * values count as ints.
112.226 + * As a special case, if the parameters are already in the specified
112.227 + * order, this method returns a null reference, rather than an array
112.228 + * specifying a null permutation.
112.229 + * <p>
112.230 + * For example, the type {@code (int,boolean,int,Object,String)void}
112.231 + * produces the order {@code {3,4,0,1,2}}, the type
112.232 + * {@code (long,int,String)void} produces {@code {2,1,2}}, and
112.233 + * the type {@code (Object,int)Object} produces {@code null}.
112.234 + */
112.235 + public static int[] primsAtEndOrder(MethodType mt) {
112.236 + MethodTypeForm form = mt.form();
112.237 + if (form.primsAtEnd == form.erasedType)
112.238 + // quick check shows no reordering is necessary
112.239 + return null;
112.240 +
112.241 + int argc = form.parameterCount();
112.242 + int[] paramOrder = new int[argc];
112.243 +
112.244 + // 3-way bucket sort:
112.245 + int pac = form.primitiveParameterCount();
112.246 + int lac = form.longPrimitiveParameterCount();
112.247 + int rfill = 0, ifill = argc - pac, lfill = argc - lac;
112.248 +
112.249 + Class<?>[] ptypes = mt.ptypes();
112.250 + boolean changed = false;
112.251 + for (int i = 0; i < ptypes.length; i++) {
112.252 + Class<?> pt = ptypes[i];
112.253 + int ord;
112.254 + if (!pt.isPrimitive()) ord = rfill++;
112.255 + else if (!hasTwoArgSlots(pt)) ord = ifill++;
112.256 + else ord = lfill++;
112.257 + if (ord != i) changed = true;
112.258 + assert(paramOrder[ord] == 0);
112.259 + paramOrder[ord] = i;
112.260 + }
112.261 + assert(rfill == argc - pac && ifill == argc - lac && lfill == argc);
112.262 + if (!changed) {
112.263 + form.primsAtEnd = form.erasedType;
112.264 + return null;
112.265 + }
112.266 + return paramOrder;
112.267 + }
112.268 +
112.269 + /** Put the existing parameters of mt into a new order, given by newParamOrder.
112.270 + * The third argument is logically appended to mt.parameterArray,
112.271 + * so that elements of newParamOrder can index either pre-existing or
112.272 + * new parameter types.
112.273 + */
112.274 + public static MethodType reorderParameters(MethodType mt, int[] newParamOrder, Class<?>[] moreParams) {
112.275 + if (newParamOrder == null) return mt; // no-op reordering
112.276 + Class<?>[] ptypes = mt.ptypes();
112.277 + Class<?>[] ntypes = new Class<?>[newParamOrder.length];
112.278 + int maxParam = ptypes.length + (moreParams == null ? 0 : moreParams.length);
112.279 + boolean changed = (ntypes.length != ptypes.length);
112.280 + for (int i = 0; i < newParamOrder.length; i++) {
112.281 + int param = newParamOrder[i];
112.282 + if (param != i) changed = true;
112.283 + Class<?> nt;
112.284 + if (param < ptypes.length) nt = ptypes[param];
112.285 + else if (param == maxParam) nt = mt.returnType();
112.286 + else nt = moreParams[param - ptypes.length];
112.287 + ntypes[i] = nt;
112.288 + }
112.289 + if (!changed) return mt;
112.290 + return MethodType.makeImpl(mt.returnType(), ntypes, true);
112.291 + }
112.292 +
112.293 + private static boolean hasTwoArgSlots(Class<?> type) {
112.294 + return type == long.class || type == double.class;
112.295 + }
112.296 +
112.297 + private static long pack(int a, int b, int c, int d) {
112.298 + assert(((a|b|c|d) & ~0xFFFF) == 0);
112.299 + long hw = ((a << 16) | b), lw = ((c << 16) | d);
112.300 + return (hw << 32) | lw;
112.301 + }
112.302 + private static char unpack(long packed, int word) { // word==0 => return a, ==3 => return d
112.303 + assert(word <= 3);
112.304 + return (char)(packed >> ((3-word) * 16));
112.305 + }
112.306 +
112.307 + public int parameterCount() { // # outgoing values
112.308 + return unpack(argCounts, 3);
112.309 + }
112.310 + public int parameterSlotCount() { // # outgoing interpreter slots
112.311 + return unpack(argCounts, 2);
112.312 + }
112.313 + public int returnCount() { // = 0 (V), or 1
112.314 + return unpack(argCounts, 1);
112.315 + }
112.316 + public int returnSlotCount() { // = 0 (V), 2 (J/D), or 1
112.317 + return unpack(argCounts, 0);
112.318 + }
112.319 + public int primitiveParameterCount() {
112.320 + return unpack(primCounts, 3);
112.321 + }
112.322 + public int longPrimitiveParameterCount() {
112.323 + return unpack(primCounts, 2);
112.324 + }
112.325 + public int primitiveReturnCount() { // = 0 (obj), or 1
112.326 + return unpack(primCounts, 1);
112.327 + }
112.328 + public int longPrimitiveReturnCount() { // = 1 (J/D), or 0
112.329 + return unpack(primCounts, 0);
112.330 + }
112.331 + public boolean hasPrimitives() {
112.332 + return primCounts != 0;
112.333 + }
112.334 +// public boolean hasNonVoidPrimitives() {
112.335 +// if (primCounts == 0) return false;
112.336 +// if (primitiveParameterCount() != 0) return true;
112.337 +// return (primitiveReturnCount() != 0 && returnCount() != 0);
112.338 +// }
112.339 + public boolean hasLongPrimitives() {
112.340 + return (longPrimitiveParameterCount() | longPrimitiveReturnCount()) != 0;
112.341 + }
112.342 + public int parameterToArgSlot(int i) {
112.343 + return argToSlotTable[1+i];
112.344 + }
112.345 + public int argSlotToParameter(int argSlot) {
112.346 + // Note: Empty slots are represented by zero in this table.
112.347 + // Valid arguments slots contain incremented entries, so as to be non-zero.
112.348 + // We return -1 the caller to mean an empty slot.
112.349 + return slotToArgTable[argSlot] - 1;
112.350 + }
112.351 +
112.352 + static MethodTypeForm findForm(MethodType mt) {
112.353 + MethodType erased = canonicalize(mt, ERASE, ERASE);
112.354 + if (erased == null) {
112.355 + // It is already erased. Make a new MethodTypeForm.
112.356 + return new MethodTypeForm(mt);
112.357 + } else {
112.358 + // Share the MethodTypeForm with the erased version.
112.359 + return erased.form();
112.360 + }
112.361 + }
112.362 +
112.363 + /** Codes for {@link #canonicalize(java.lang.Class, int)}.
112.364 + * ERASE means change every reference to {@code Object}.
112.365 + * WRAP means convert primitives (including {@code void} to their
112.366 + * corresponding wrapper types. UNWRAP means the reverse of WRAP.
112.367 + * INTS means convert all non-void primitive types to int or long,
112.368 + * according to size. LONGS means convert all non-void primitives
112.369 + * to long, regardless of size. RAW_RETURN means convert a type
112.370 + * (assumed to be a return type) to int if it is smaller than an int,
112.371 + * or if it is void.
112.372 + */
112.373 + public static final int NO_CHANGE = 0, ERASE = 1, WRAP = 2, UNWRAP = 3, INTS = 4, LONGS = 5, RAW_RETURN = 6;
112.374 +
112.375 + /** Canonicalize the types in the given method type.
112.376 + * If any types change, intern the new type, and return it.
112.377 + * Otherwise return null.
112.378 + */
112.379 + public static MethodType canonicalize(MethodType mt, int howRet, int howArgs) {
112.380 + Class<?>[] ptypes = mt.ptypes();
112.381 + Class<?>[] ptc = MethodTypeForm.canonicalizes(ptypes, howArgs);
112.382 + Class<?> rtype = mt.returnType();
112.383 + Class<?> rtc = MethodTypeForm.canonicalize(rtype, howRet);
112.384 + if (ptc == null && rtc == null) {
112.385 + // It is already canonical.
112.386 + return null;
112.387 + }
112.388 + // Find the erased version of the method type:
112.389 + if (rtc == null) rtc = rtype;
112.390 + if (ptc == null) ptc = ptypes;
112.391 + return MethodType.makeImpl(rtc, ptc, true);
112.392 + }
112.393 +
112.394 + /** Canonicalize the given return or param type.
112.395 + * Return null if the type is already canonicalized.
112.396 + */
112.397 + static Class<?> canonicalize(Class<?> t, int how) {
112.398 + Class<?> ct;
112.399 + if (t == Object.class) {
112.400 + // no change, ever
112.401 + } else if (!t.isPrimitive()) {
112.402 + switch (how) {
112.403 + case UNWRAP:
112.404 + ct = Wrapper.asPrimitiveType(t);
112.405 + if (ct != t) return ct;
112.406 + break;
112.407 + case RAW_RETURN:
112.408 + case ERASE:
112.409 + return Object.class;
112.410 + }
112.411 + } else if (t == void.class) {
112.412 + // no change, usually
112.413 + switch (how) {
112.414 + case RAW_RETURN:
112.415 + return int.class;
112.416 + case WRAP:
112.417 + return Void.class;
112.418 + }
112.419 + } else {
112.420 + // non-void primitive
112.421 + switch (how) {
112.422 + case WRAP:
112.423 + return Wrapper.asWrapperType(t);
112.424 + case INTS:
112.425 + if (t == int.class || t == long.class)
112.426 + return null; // no change
112.427 + if (t == double.class)
112.428 + return long.class;
112.429 + return int.class;
112.430 + case LONGS:
112.431 + if (t == long.class)
112.432 + return null; // no change
112.433 + return long.class;
112.434 + case RAW_RETURN:
112.435 + if (t == int.class || t == long.class ||
112.436 + t == float.class || t == double.class)
112.437 + return null; // no change
112.438 + // everything else returns as an int
112.439 + return int.class;
112.440 + }
112.441 + }
112.442 + // no change; return null to signify
112.443 + return null;
112.444 + }
112.445 +
112.446 + /** Canonicalize each param type in the given array.
112.447 + * Return null if all types are already canonicalized.
112.448 + */
112.449 + static Class<?>[] canonicalizes(Class<?>[] ts, int how) {
112.450 + Class<?>[] cs = null;
112.451 + for (int imax = ts.length, i = 0; i < imax; i++) {
112.452 + Class<?> c = canonicalize(ts[i], how);
112.453 + if (c != null) {
112.454 + if (cs == null)
112.455 + cs = ts.clone();
112.456 + cs[i] = c;
112.457 + }
112.458 + }
112.459 + return cs;
112.460 + }
112.461 +
112.462 + /*non-public*/ void notifyGenericMethodType() {
112.463 + if (genericInvoker != null) return;
112.464 + try {
112.465 + // Trigger adapter creation.
112.466 + genericInvoker = InvokeGeneric.genericInvokerOf(erasedType);
112.467 + } catch (Exception ex) {
112.468 + Error err = new InternalError("Exception while resolving invokeGeneric");
112.469 + err.initCause(ex);
112.470 + throw err;
112.471 + }
112.472 + }
112.473 +
112.474 + @Override
112.475 + public String toString() {
112.476 + return "Form"+erasedType;
112.477 + }
112.478 +
112.479 +}
113.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
113.2 +++ b/src/share/classes/java/lang/invoke/MutableCallSite.java Tue Mar 29 20:19:55 2011 -0700
113.3 @@ -0,0 +1,280 @@
113.4 +/*
113.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
113.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
113.7 + *
113.8 + * This code is free software; you can redistribute it and/or modify it
113.9 + * under the terms of the GNU General Public License version 2 only, as
113.10 + * published by the Free Software Foundation. Oracle designates this
113.11 + * particular file as subject to the "Classpath" exception as provided
113.12 + * by Oracle in the LICENSE file that accompanied this code.
113.13 + *
113.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
113.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
113.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
113.17 + * version 2 for more details (a copy is included in the LICENSE file that
113.18 + * accompanied this code).
113.19 + *
113.20 + * You should have received a copy of the GNU General Public License version
113.21 + * 2 along with this work; if not, write to the Free Software Foundation,
113.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
113.23 + *
113.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
113.25 + * or visit www.oracle.com if you need additional information or have any
113.26 + * questions.
113.27 + */
113.28 +
113.29 +package java.lang.invoke;
113.30 +
113.31 +import java.util.concurrent.atomic.AtomicInteger;
113.32 +
113.33 +/**
113.34 + * A {@code MutableCallSite} is a {@link CallSite} whose target variable
113.35 + * behaves like an ordinary field.
113.36 + * An {@code invokedynamic} instruction linked to a {@code MutableCallSite} delegates
113.37 + * all calls to the site's current target.
113.38 + * The {@linkplain CallSite#dynamicInvoker dynamic invoker} of a mutable call site
113.39 + * also delegates each call to the site's current target.
113.40 + * <p>
113.41 + * Here is an example of a mutable call site which introduces a
113.42 + * state variable into a method handle chain.
113.43 + * <blockquote><pre>
113.44 +MutableCallSite name = new MutableCallSite(MethodType.methodType(String.class));
113.45 +MethodHandle MH_name = name.dynamicInvoker();
113.46 +MethodType MT_str2 = MethodType.methodType(String.class, String.class);
113.47 +MethodHandle MH_upcase = MethodHandles.lookup()
113.48 + .findVirtual(String.class, "toUpperCase", MT_str2);
113.49 +MethodHandle worker1 = MethodHandles.filterReturnValue(MH_name, MH_upcase);
113.50 +name.setTarget(MethodHandles.constant(String.class, "Rocky"));
113.51 +assertEquals("ROCKY", (String) worker1.invokeExact());
113.52 +name.setTarget(MethodHandles.constant(String.class, "Fred"));
113.53 +assertEquals("FRED", (String) worker1.invokeExact());
113.54 +// (mutation can be continued indefinitely)
113.55 + * </pre></blockquote>
113.56 + * <p>
113.57 + * The same call site may be used in several places at once.
113.58 + * <blockquote><pre>
113.59 +MethodHandle MH_dear = MethodHandles.lookup()
113.60 + .findVirtual(String.class, "concat", MT_str2).bindTo(", dear?");
113.61 +MethodHandle worker2 = MethodHandles.filterReturnValue(MH_name, MH_dear);
113.62 +assertEquals("Fred, dear?", (String) worker2.invokeExact());
113.63 +name.setTarget(MethodHandles.constant(String.class, "Wilma"));
113.64 +assertEquals("WILMA", (String) worker1.invokeExact());
113.65 +assertEquals("Wilma, dear?", (String) worker2.invokeExact());
113.66 + * </pre></blockquote>
113.67 + * <p>
113.68 + * <em>Non-synchronization of target values:</em>
113.69 + * A write to a mutable call site's target does not force other threads
113.70 + * to become aware of the updated value. Threads which do not perform
113.71 + * suitable synchronization actions relative to the updated call site
113.72 + * may cache the old target value and delay their use of the new target
113.73 + * value indefinitely.
113.74 + * (This is a normal consequence of the Java Memory Model as applied
113.75 + * to object fields.)
113.76 + * <p>
113.77 + * The {@link #syncAll syncAll} operation provides a way to force threads
113.78 + * to accept a new target value, even if there is no other synchronization.
113.79 + * <p>
113.80 + * For target values which will be frequently updated, consider using
113.81 + * a {@linkplain VolatileCallSite volatile call site} instead.
113.82 + * @author John Rose, JSR 292 EG
113.83 + */
113.84 +public class MutableCallSite extends CallSite {
113.85 + /**
113.86 + * Creates a blank call site object with the given method type.
113.87 + * The initial target is set to a method handle of the given type
113.88 + * which will throw an {@link IllegalStateException} if called.
113.89 + * <p>
113.90 + * The type of the call site is permanently set to the given type.
113.91 + * <p>
113.92 + * Before this {@code CallSite} object is returned from a bootstrap method,
113.93 + * or invoked in some other manner,
113.94 + * it is usually provided with a more useful target method,
113.95 + * via a call to {@link CallSite#setTarget(MethodHandle) setTarget}.
113.96 + * @param type the method type that this call site will have
113.97 + * @throws NullPointerException if the proposed type is null
113.98 + */
113.99 + public MutableCallSite(MethodType type) {
113.100 + super(type);
113.101 + }
113.102 +
113.103 + /**
113.104 + * Creates a call site object with an initial target method handle.
113.105 + * The type of the call site is permanently set to the initial target's type.
113.106 + * @param target the method handle that will be the initial target of the call site
113.107 + * @throws NullPointerException if the proposed target is null
113.108 + */
113.109 + public MutableCallSite(MethodHandle target) {
113.110 + super(target);
113.111 + }
113.112 +
113.113 + /**
113.114 + * Returns the target method of the call site, which behaves
113.115 + * like a normal field of the {@code MutableCallSite}.
113.116 + * <p>
113.117 + * The interactions of {@code getTarget} with memory are the same
113.118 + * as of a read from an ordinary variable, such as an array element or a
113.119 + * non-volatile, non-final field.
113.120 + * <p>
113.121 + * In particular, the current thread may choose to reuse the result
113.122 + * of a previous read of the target from memory, and may fail to see
113.123 + * a recent update to the target by another thread.
113.124 + *
113.125 + * @return the linkage state of this call site, a method handle which can change over time
113.126 + * @see #setTarget
113.127 + */
113.128 + @Override public final MethodHandle getTarget() {
113.129 + return target;
113.130 + }
113.131 +
113.132 + /**
113.133 + * Updates the target method of this call site, as a normal variable.
113.134 + * The type of the new target must agree with the type of the old target.
113.135 + * <p>
113.136 + * The interactions with memory are the same
113.137 + * as of a write to an ordinary variable, such as an array element or a
113.138 + * non-volatile, non-final field.
113.139 + * <p>
113.140 + * In particular, unrelated threads may fail to see the updated target
113.141 + * until they perform a read from memory.
113.142 + * Stronger guarantees can be created by putting appropriate operations
113.143 + * into the bootstrap method and/or the target methods used
113.144 + * at any given call site.
113.145 + *
113.146 + * @param newTarget the new target
113.147 + * @throws NullPointerException if the proposed new target is null
113.148 + * @throws WrongMethodTypeException if the proposed new target
113.149 + * has a method type that differs from the previous target
113.150 + * @see #getTarget
113.151 + */
113.152 + @Override public void setTarget(MethodHandle newTarget) {
113.153 + checkTargetChange(this.target, newTarget);
113.154 + setTargetNormal(newTarget);
113.155 + }
113.156 +
113.157 + /**
113.158 + * {@inheritDoc}
113.159 + */
113.160 + @Override
113.161 + public final MethodHandle dynamicInvoker() {
113.162 + return makeDynamicInvoker();
113.163 + }
113.164 +
113.165 + /**
113.166 + * Performs a synchronization operation on each call site in the given array,
113.167 + * forcing all other threads to throw away any cached values previously
113.168 + * loaded from the target of any of the call sites.
113.169 + * <p>
113.170 + * This operation does not reverse any calls that have already started
113.171 + * on an old target value.
113.172 + * (Java supports {@linkplain java.lang.Object#wait() forward time travel} only.)
113.173 + * <p>
113.174 + * The overall effect is to force all future readers of each call site's target
113.175 + * to accept the most recently stored value.
113.176 + * ("Most recently" is reckoned relative to the {@code syncAll} itself.)
113.177 + * Conversely, the {@code syncAll} call may block until all readers have
113.178 + * (somehow) decached all previous versions of each call site's target.
113.179 + * <p>
113.180 + * To avoid race conditions, calls to {@code setTarget} and {@code syncAll}
113.181 + * should generally be performed under some sort of mutual exclusion.
113.182 + * Note that reader threads may observe an updated target as early
113.183 + * as the {@code setTarget} call that install the value
113.184 + * (and before the {@code syncAll} that confirms the value).
113.185 + * On the other hand, reader threads may observe previous versions of
113.186 + * the target until the {@code syncAll} call returns
113.187 + * (and after the {@code setTarget} that attempts to convey the updated version).
113.188 + * <p>
113.189 + * This operation is likely to be expensive and should be used sparingly.
113.190 + * If possible, it should be buffered for batch processing on sets of call sites.
113.191 + * <p>
113.192 + * If {@code sites} contains a null element,
113.193 + * a {@code NullPointerException} will be raised.
113.194 + * In this case, some non-null elements in the array may be
113.195 + * processed before the method returns abnormally.
113.196 + * Which elements these are (if any) is implementation-dependent.
113.197 + *
113.198 + * <h3>Java Memory Model details</h3>
113.199 + * In terms of the Java Memory Model, this operation performs a synchronization
113.200 + * action which is comparable in effect to the writing of a volatile variable
113.201 + * by the current thread, and an eventual volatile read by every other thread
113.202 + * that may access one of the affected call sites.
113.203 + * <p>
113.204 + * The following effects are apparent, for each individual call site {@code S}:
113.205 + * <ul>
113.206 + * <li>A new volatile variable {@code V} is created, and written by the current thread.
113.207 + * As defined by the JMM, this write is a global synchronization event.
113.208 + * <li>As is normal with thread-local ordering of write events,
113.209 + * every action already performed by the current thread is
113.210 + * taken to happen before the volatile write to {@code V}.
113.211 + * (In some implementations, this means that the current thread
113.212 + * performs a global release operation.)
113.213 + * <li>Specifically, the write to the current target of {@code S} is
113.214 + * taken to happen before the volatile write to {@code V}.
113.215 + * <li>The volatile write to {@code V} is placed
113.216 + * (in an implementation specific manner)
113.217 + * in the global synchronization order.
113.218 + * <li>Consider an arbitrary thread {@code T} (other than the current thread).
113.219 + * If {@code T} executes a synchronization action {@code A}
113.220 + * after the volatile write to {@code V} (in the global synchronization order),
113.221 + * it is therefore required to see either the current target
113.222 + * of {@code S}, or a later write to that target,
113.223 + * if it executes a read on the target of {@code S}.
113.224 + * (This constraint is called "synchronization-order consistency".)
113.225 + * <li>The JMM specifically allows optimizing compilers to elide
113.226 + * reads or writes of variables that are known to be useless.
113.227 + * Such elided reads and writes have no effect on the happens-before
113.228 + * relation. Regardless of this fact, the volatile {@code V}
113.229 + * will not be elided, even though its written value is
113.230 + * indeterminate and its read value is not used.
113.231 + * </ul>
113.232 + * Because of the last point, the implementation behaves as if a
113.233 + * volatile read of {@code V} were performed by {@code T}
113.234 + * immediately after its action {@code A}. In the local ordering
113.235 + * of actions in {@code T}, this read happens before any future
113.236 + * read of the target of {@code S}. It is as if the
113.237 + * implementation arbitrarily picked a read of {@code S}'s target
113.238 + * by {@code T}, and forced a read of {@code V} to precede it,
113.239 + * thereby ensuring communication of the new target value.
113.240 + * <p>
113.241 + * As long as the constraints of the Java Memory Model are obeyed,
113.242 + * implementations may delay the completion of a {@code syncAll}
113.243 + * operation while other threads ({@code T} above) continue to
113.244 + * use previous values of {@code S}'s target.
113.245 + * However, implementations are (as always) encouraged to avoid
113.246 + * livelock, and to eventually require all threads to take account
113.247 + * of the updated target.
113.248 + *
113.249 + * <p style="font-size:smaller;">
113.250 + * <em>Discussion:</em>
113.251 + * For performance reasons, {@code syncAll} is not a virtual method
113.252 + * on a single call site, but rather applies to a set of call sites.
113.253 + * Some implementations may incur a large fixed overhead cost
113.254 + * for processing one or more synchronization operations,
113.255 + * but a small incremental cost for each additional call site.
113.256 + * In any case, this operation is likely to be costly, since
113.257 + * other threads may have to be somehow interrupted
113.258 + * in order to make them notice the updated target value.
113.259 + * However, it may be observed that a single call to synchronize
113.260 + * several sites has the same formal effect as many calls,
113.261 + * each on just one of the sites.
113.262 + *
113.263 + * <p style="font-size:smaller;">
113.264 + * <em>Implementation Note:</em>
113.265 + * Simple implementations of {@code MutableCallSite} may use
113.266 + * a volatile variable for the target of a mutable call site.
113.267 + * In such an implementation, the {@code syncAll} method can be a no-op,
113.268 + * and yet it will conform to the JMM behavior documented above.
113.269 + *
113.270 + * @param sites an array of call sites to be synchronized
113.271 + * @throws NullPointerException if the {@code sites} array reference is null
113.272 + * or the array contains a null
113.273 + */
113.274 + public static void syncAll(MutableCallSite[] sites) {
113.275 + if (sites.length == 0) return;
113.276 + STORE_BARRIER.lazySet(0);
113.277 + for (int i = 0; i < sites.length; i++) {
113.278 + sites[i].getClass(); // trigger NPE on first null
113.279 + }
113.280 + // FIXME: NYI
113.281 + }
113.282 + private static final AtomicInteger STORE_BARRIER = new AtomicInteger();
113.283 +}
114.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
114.2 +++ b/src/share/classes/java/lang/invoke/SpreadGeneric.java Tue Mar 29 20:19:55 2011 -0700
114.3 @@ -0,0 +1,678 @@
114.4 +/*
114.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
114.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
114.7 + *
114.8 + * This code is free software; you can redistribute it and/or modify it
114.9 + * under the terms of the GNU General Public License version 2 only, as
114.10 + * published by the Free Software Foundation. Oracle designates this
114.11 + * particular file as subject to the "Classpath" exception as provided
114.12 + * by Oracle in the LICENSE file that accompanied this code.
114.13 + *
114.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
114.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
114.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
114.17 + * version 2 for more details (a copy is included in the LICENSE file that
114.18 + * accompanied this code).
114.19 + *
114.20 + * You should have received a copy of the GNU General Public License version
114.21 + * 2 along with this work; if not, write to the Free Software Foundation,
114.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
114.23 + *
114.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
114.25 + * or visit www.oracle.com if you need additional information or have any
114.26 + * questions.
114.27 + */
114.28 +
114.29 +package java.lang.invoke;
114.30 +
114.31 +import sun.invoke.util.ValueConversions;
114.32 +import java.lang.reflect.Constructor;
114.33 +import java.lang.reflect.InvocationTargetException;
114.34 +import java.util.ArrayList;
114.35 +import static java.lang.invoke.MethodHandleStatics.*;
114.36 +import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
114.37 +
114.38 +/**
114.39 + * Generic spread adapter.
114.40 + * Expands a final argument into multiple (zero or more) arguments, keeping the others the same.
114.41 + * @author jrose
114.42 + */
114.43 +class SpreadGeneric {
114.44 + // type for the outgoing call
114.45 + private final MethodType targetType;
114.46 + // number of arguments to spread
114.47 + private final int spreadCount;
114.48 + // prototype adapter (clone and customize for each new target!)
114.49 + private final Adapter adapter;
114.50 + // entry point for adapter (Adapter mh, a...) => ...
114.51 + private final MethodHandle entryPoint;
114.52 +
114.53 + /** Compute and cache information common to all spreading adapters
114.54 + * that accept calls of the given (generic) type.
114.55 + */
114.56 + private SpreadGeneric(MethodType targetType, int spreadCount) {
114.57 + assert(targetType == targetType.generic());
114.58 + this.targetType = targetType;
114.59 + this.spreadCount = spreadCount;
114.60 + // the target invoker will generally need casts on reference arguments
114.61 + MethodHandle[] ep = { null };
114.62 + Adapter ad = findAdapter(this, ep);
114.63 + if (ad != null) {
114.64 + this.adapter = ad;
114.65 + this.entryPoint = ep[0];
114.66 + return;
114.67 + }
114.68 + this.adapter = buildAdapterFromBytecodes(targetType, spreadCount, ep);
114.69 + this.entryPoint = ep[0];
114.70 + }
114.71 +
114.72 + /** From targetType remove the last spreadCount arguments, and instead
114.73 + * append a simple Object argument.
114.74 + */
114.75 + static MethodType preSpreadType(MethodType targetType, int spreadCount) {
114.76 + @SuppressWarnings("unchecked")
114.77 + ArrayList<Class<?>> params = new ArrayList(targetType.parameterList());
114.78 + int outargs = params.size();
114.79 + params.subList(outargs - spreadCount, outargs).clear();
114.80 + params.add(Object.class);
114.81 + return MethodType.methodType(targetType.returnType(), params);
114.82 + }
114.83 +
114.84 + MethodHandle makeInstance(MethodHandle target) {
114.85 + MethodType type = target.type();
114.86 + if (type != targetType) {
114.87 + throw new UnsupportedOperationException("NYI type="+type);
114.88 + }
114.89 + return adapter.makeInstance(this, target);
114.90 + }
114.91 +
114.92 + /** Build an adapter of the given generic type, which invokes typedTarget
114.93 + * on the incoming arguments, after unboxing as necessary.
114.94 + * The return value is boxed if necessary.
114.95 + * @param genericType the required type of the result
114.96 + * @param typedTarget the target
114.97 + * @return an adapter method handle
114.98 + */
114.99 + public static MethodHandle make(MethodHandle target, int spreadCount) {
114.100 + MethodType type = target.type();
114.101 + MethodType gtype = type.generic();
114.102 + if (type == gtype) {
114.103 + return SpreadGeneric.of(type, spreadCount).makeInstance(target);
114.104 + } else {
114.105 + MethodHandle gtarget = FromGeneric.make(target);
114.106 + assert(gtarget.type() == gtype);
114.107 + MethodHandle gspread = SpreadGeneric.of(gtype, spreadCount).makeInstance(gtarget);
114.108 + return ToGeneric.make(preSpreadType(type, spreadCount), gspread);
114.109 + }
114.110 + }
114.111 +
114.112 + /** Return the adapter information for this type's erasure. */
114.113 + static SpreadGeneric of(MethodType targetType, int spreadCount) {
114.114 + if (targetType != targetType.generic())
114.115 + throw new UnsupportedOperationException("NYI type="+targetType);
114.116 + MethodTypeForm form = targetType.form();
114.117 + int outcount = form.parameterCount();
114.118 + assert(spreadCount <= outcount);
114.119 + SpreadGeneric[] spreadGens = form.spreadGeneric;
114.120 + if (spreadGens == null)
114.121 + form.spreadGeneric = spreadGens = new SpreadGeneric[outcount+1];
114.122 + SpreadGeneric spreadGen = spreadGens[spreadCount];
114.123 + if (spreadGen == null)
114.124 + spreadGens[spreadCount] = spreadGen = new SpreadGeneric(form.erasedType(), spreadCount);
114.125 + return spreadGen;
114.126 + }
114.127 +
114.128 + public String toString() {
114.129 + return getClass().getSimpleName()+targetType+"["+spreadCount+"]";
114.130 + }
114.131 +
114.132 + // This mini-api is called from an Adapter to manage the spread.
114.133 + /** A check/coercion that happens once before any selections. */
114.134 + protected Object check(Object av, int n) {
114.135 + checkSpreadArgument(av, n);
114.136 + return av;
114.137 + }
114.138 +
114.139 + /** The selection operator for spreading; note that it takes Object not Object[]. */
114.140 + protected Object select(Object av, int n) {
114.141 + return ((Object[])av)[n];
114.142 + }
114.143 + /*
114.144 + protected int select_I(Object av, int n) {
114.145 + // maybe return ((int[])select)[n]
114.146 + throw new UnsupportedOperationException("subclass resp.");
114.147 + }
114.148 + protected int select_J(Object av, int n) {
114.149 + // maybe return ((long[])select)[n]
114.150 + throw new UnsupportedOperationException("subclass resp.");
114.151 + }
114.152 + // */
114.153 +
114.154 + /* Create an adapter that handles spreading calls for the given type. */
114.155 + static Adapter findAdapter(SpreadGeneric outer, MethodHandle[] ep) {
114.156 + MethodType targetType = outer.targetType;
114.157 + int spreadCount = outer.spreadCount;
114.158 + int outargs = targetType.parameterCount();
114.159 + int inargs = outargs - spreadCount;
114.160 + if (inargs < 0) return null;
114.161 + MethodType entryType = MethodType.genericMethodType(inargs + 1); // 1 for av
114.162 + String cname1 = "S" + outargs;
114.163 + String[] cnames = { cname1 };
114.164 + String iname = "invoke_S"+spreadCount;
114.165 + // e.g., D5I2, D5, L5I2, L5; invoke_D5
114.166 + for (String cname : cnames) {
114.167 + Class<? extends Adapter> acls = Adapter.findSubClass(cname);
114.168 + if (acls == null) continue;
114.169 + // see if it has the required invoke method
114.170 + MethodHandle entryPoint = null;
114.171 + try {
114.172 + entryPoint = IMPL_LOOKUP.findSpecial(acls, iname, entryType, acls);
114.173 + } catch (ReflectiveOperationException ex) {
114.174 + }
114.175 + if (entryPoint == null) continue;
114.176 + Constructor<? extends Adapter> ctor = null;
114.177 + try {
114.178 + ctor = acls.getDeclaredConstructor(SpreadGeneric.class);
114.179 + } catch (NoSuchMethodException ex) {
114.180 + } catch (SecurityException ex) {
114.181 + }
114.182 + if (ctor == null) continue;
114.183 + try {
114.184 + // Produce an instance configured as a prototype.
114.185 + Adapter ad = ctor.newInstance(outer);
114.186 + ep[0] = entryPoint;
114.187 + return ad;
114.188 + } catch (IllegalArgumentException ex) {
114.189 + } catch (InvocationTargetException wex) {
114.190 + Throwable ex = wex.getTargetException();
114.191 + if (ex instanceof Error) throw (Error)ex;
114.192 + if (ex instanceof RuntimeException) throw (RuntimeException)ex;
114.193 + } catch (InstantiationException ex) {
114.194 + } catch (IllegalAccessException ex) {
114.195 + }
114.196 + }
114.197 + return null;
114.198 + }
114.199 +
114.200 + static Adapter buildAdapterFromBytecodes(MethodType targetType,
114.201 + int spreadCount, MethodHandle[] ep) {
114.202 + throw new UnsupportedOperationException("NYI");
114.203 + }
114.204 +
114.205 + /**
114.206 + * This adapter takes some untyped arguments, and returns an untyped result.
114.207 + * Internally, it applies the invoker to the target, which causes the
114.208 + * objects to be unboxed; the result is a raw type in L/I/J/F/D.
114.209 + * This result is passed to convert, which is responsible for
114.210 + * converting the raw result into a boxed object.
114.211 + * The invoker is kept separate from the target because it can be
114.212 + * generated once per type erasure family, and reused across adapters.
114.213 + */
114.214 + static abstract class Adapter extends BoundMethodHandle {
114.215 + /*
114.216 + * class X<<R,int M,int N>> extends Adapter {
114.217 + * (Object**N)=>R target;
114.218 + * static int S = N-M;
114.219 + * Object invoke(Object**M a, Object v) = target(a..., v[0]...v[S-1]);
114.220 + * }
114.221 + */
114.222 + protected final SpreadGeneric outer;
114.223 + protected final MethodHandle target; // (any**N) => R
114.224 +
114.225 + @Override
114.226 + public String toString() {
114.227 + return addTypeString(target, this);
114.228 + }
114.229 +
114.230 + static final MethodHandle NO_ENTRY = ValueConversions.identity();
114.231 +
114.232 + protected boolean isPrototype() { return target == null; }
114.233 + protected Adapter(SpreadGeneric outer) {
114.234 + super(NO_ENTRY);
114.235 + this.outer = outer;
114.236 + this.target = null;
114.237 + assert(isPrototype());
114.238 + }
114.239 +
114.240 + protected Adapter(SpreadGeneric outer, MethodHandle target) {
114.241 + super(outer.entryPoint);
114.242 + this.outer = outer;
114.243 + this.target = target;
114.244 + }
114.245 +
114.246 + /** Make a copy of self, with new fields. */
114.247 + protected abstract Adapter makeInstance(SpreadGeneric outer, MethodHandle target);
114.248 + // { return new ThisType(outer, target); }
114.249 +
114.250 + protected Object check(Object av, int n) {
114.251 + return outer.check(av, n);
114.252 + }
114.253 + protected Object select(Object av, int n) {
114.254 + return outer.select(av, n);
114.255 + }
114.256 +
114.257 + static private final String CLASS_PREFIX; // "java.lang.invoke.SpreadGeneric$"
114.258 + static {
114.259 + String aname = Adapter.class.getName();
114.260 + String sname = Adapter.class.getSimpleName();
114.261 + if (!aname.endsWith(sname)) throw new InternalError();
114.262 + CLASS_PREFIX = aname.substring(0, aname.length() - sname.length());
114.263 + }
114.264 + /** Find a sibing class of Adapter. */
114.265 + static Class<? extends Adapter> findSubClass(String name) {
114.266 + String cname = Adapter.CLASS_PREFIX + name;
114.267 + try {
114.268 + return Class.forName(cname).asSubclass(Adapter.class);
114.269 + } catch (ClassNotFoundException ex) {
114.270 + return null;
114.271 + } catch (ClassCastException ex) {
114.272 + return null;
114.273 + }
114.274 + }
114.275 + }
114.276 +
114.277 + /* generated classes follow this pattern:
114.278 + static class xS2 extends Adapter {
114.279 + protected xS2(SpreadGeneric outer) { super(outer); } // to build prototype
114.280 + protected xS2(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
114.281 + protected xS2 makeInstance(SpreadGeneric outer, MethodHandle t) { return new xS2(outer, t); }
114.282 + protected Object invoke_S0(Object a0, Object a1, Object av) throws Throwable { av = super.check(av,0);
114.283 + return target.invokeExact(a0, a1)); }
114.284 + protected Object invoke_S1(Object a0, Object av) throws Throwable { av = super.check(av,1);
114.285 + return target.invokeExact(a0,
114.286 + super.select(av,0)); }
114.287 + protected Object invoke_S2(Object a0, Object av) throws Throwable { av = super.check(av,1);
114.288 + return target.invokeExact(
114.289 + super.select(av,0), super.select(av,1)); }
114.290 + }
114.291 + // */
114.292 +
114.293 +/*
114.294 +: SHELL; n=SpreadGeneric; cp -p $n.java $n.java-; sed < $n.java- > $n.java+ -e '/{{*{{/,/}}*}}/w /tmp/genclasses.java' -e '/}}*}}/q'; (cd /tmp; javac -d . genclasses.java; java -cp . genclasses) >> $n.java+; echo '}' >> $n.java+; mv $n.java+ $n.java; mv $n.java- $n.java~
114.295 +//{{{
114.296 +import java.util.*;
114.297 +class genclasses {
114.298 + static String[][] TEMPLATES = { {
114.299 + "@for@ N=0..10",
114.300 + " //@each-cat@",
114.301 + " static class @cat@ extends Adapter {",
114.302 + " protected @cat@(SpreadGeneric outer) { super(outer); } // to build prototype",
114.303 + " protected @cat@(SpreadGeneric outer, MethodHandle t) { super(outer, t); }",
114.304 + " protected @cat@ makeInstance(SpreadGeneric outer, MethodHandle t) { return new @cat@(outer, t); }",
114.305 + " protected Object invoke_S0(@Tvav,@Object av) throws Throwable { av = super.check(av, 0);",
114.306 + " return target.invokeExact(@av@); }",
114.307 + " //@each-S@",
114.308 + " protected Object invoke_S@S@(@Tvav,@Object av) throws Throwable { av = super.check(av, @S@);",
114.309 + " return target.invokeExact(@av,@@sv@); }",
114.310 + " //@end-S@",
114.311 + " }",
114.312 + } };
114.313 + static final String NEWLINE_INDENT = "\n ";
114.314 + enum VAR {
114.315 + cat, N, S, av, av_, Tvav_, sv;
114.316 + public final String pattern = "@"+toString().replace('_','.')+"@";
114.317 + public String binding = toString();
114.318 + static void makeBindings(boolean topLevel, int outargs, int spread) {
114.319 + int inargs = outargs - spread;
114.320 + VAR.cat.binding = "S"+outargs;
114.321 + VAR.N.binding = String.valueOf(outargs); // outgoing arg count
114.322 + VAR.S.binding = String.valueOf(spread); // spread count
114.323 + String[] av = new String[inargs];
114.324 + String[] Tvav = new String[inargs];
114.325 + for (int i = 0; i < inargs; i++) {
114.326 + av[i] = arg(i);
114.327 + Tvav[i] = param("Object", av[i]);
114.328 + }
114.329 + VAR.av.binding = comma(av);
114.330 + VAR.av_.binding = comma(av, ", ");
114.331 + VAR.Tvav_.binding = comma(Tvav, ", ");
114.332 + String[] sv = new String[spread];
114.333 + for (int i = 0; i < spread; i++) {
114.334 + String spc = "";
114.335 + if (i % 4 == 0) spc = NEWLINE_INDENT;
114.336 + sv[i] = spc+"super.select(av,"+i+")";
114.337 + }
114.338 + VAR.sv.binding = comma(sv);
114.339 + }
114.340 + static String arg(int i) { return "a"+i; }
114.341 + static String param(String t, String a) { return t+" "+a; }
114.342 + static String comma(String[] v) { return comma(v, ""); }
114.343 + static String comma(String[] v, String sep) {
114.344 + if (v.length == 0) return "";
114.345 + String res = v[0];
114.346 + for (int i = 1; i < v.length; i++) res += ", "+v[i];
114.347 + return res + sep;
114.348 + }
114.349 + static String transform(String string) {
114.350 + for (VAR var : values())
114.351 + string = string.replaceAll(var.pattern, var.binding);
114.352 + return string;
114.353 + }
114.354 + }
114.355 + static String[] stringsIn(String[] strings, int beg, int end) {
114.356 + return Arrays.copyOfRange(strings, beg, Math.min(end, strings.length));
114.357 + }
114.358 + static String[] stringsBefore(String[] strings, int pos) {
114.359 + return stringsIn(strings, 0, pos);
114.360 + }
114.361 + static String[] stringsAfter(String[] strings, int pos) {
114.362 + return stringsIn(strings, pos, strings.length);
114.363 + }
114.364 + static int indexAfter(String[] strings, int pos, String tag) {
114.365 + return Math.min(indexBefore(strings, pos, tag) + 1, strings.length);
114.366 + }
114.367 + static int indexBefore(String[] strings, int pos, String tag) {
114.368 + for (int i = pos, end = strings.length; ; i++) {
114.369 + if (i == end || strings[i].endsWith(tag)) return i;
114.370 + }
114.371 + }
114.372 + static int MIN_ARITY, MAX_ARITY;
114.373 + public static void main(String... av) {
114.374 + for (String[] template : TEMPLATES) {
114.375 + int forLinesLimit = indexBefore(template, 0, "@each-cat@");
114.376 + String[] forLines = stringsBefore(template, forLinesLimit);
114.377 + template = stringsAfter(template, forLinesLimit);
114.378 + for (String forLine : forLines)
114.379 + expandTemplate(forLine, template);
114.380 + }
114.381 + }
114.382 + static void expandTemplate(String forLine, String[] template) {
114.383 + String[] params = forLine.split("[^0-9]+");
114.384 + if (params[0].length() == 0) params = stringsAfter(params, 1);
114.385 + System.out.println("//params="+Arrays.asList(params));
114.386 + int pcur = 0;
114.387 + MIN_ARITY = Integer.valueOf(params[pcur++]);
114.388 + MAX_ARITY = Integer.valueOf(params[pcur++]);
114.389 + if (pcur != params.length) throw new RuntimeException("bad extra param: "+forLine);
114.390 + for (int outargs = MIN_ARITY; outargs <= MAX_ARITY; outargs++) {
114.391 + expandTemplate(template, true, outargs, 0);
114.392 + }
114.393 + }
114.394 + static void expandTemplate(String[] template, boolean topLevel, int outargs, int spread) {
114.395 + VAR.makeBindings(topLevel, outargs, spread);
114.396 + for (int i = 0; i < template.length; i++) {
114.397 + String line = template[i];
114.398 + if (line.endsWith("@each-cat@")) {
114.399 + // ignore
114.400 + } else if (line.endsWith("@each-S@")) {
114.401 + int blockEnd = indexAfter(template, i, "@end-S@");
114.402 + String[] block = stringsIn(template, i+1, blockEnd-1);
114.403 + for (int spread1 = spread+1; spread1 <= outargs; spread1++)
114.404 + expandTemplate(block, false, outargs, spread1);
114.405 + VAR.makeBindings(topLevel, outargs, spread);
114.406 + i = blockEnd-1; continue;
114.407 + } else {
114.408 + System.out.println(VAR.transform(line));
114.409 + }
114.410 + }
114.411 + }
114.412 +}
114.413 +//}}} */
114.414 +//params=[0, 10]
114.415 + static class S0 extends Adapter {
114.416 + protected S0(SpreadGeneric outer) { super(outer); } // to build prototype
114.417 + protected S0(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
114.418 + protected S0 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S0(outer, t); }
114.419 + protected Object invoke_S0(Object av) throws Throwable { av = super.check(av, 0);
114.420 + return target.invokeExact(); }
114.421 + }
114.422 + static class S1 extends Adapter {
114.423 + protected S1(SpreadGeneric outer) { super(outer); } // to build prototype
114.424 + protected S1(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
114.425 + protected S1 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S1(outer, t); }
114.426 + protected Object invoke_S0(Object a0, Object av) throws Throwable { av = super.check(av, 0);
114.427 + return target.invokeExact(a0); }
114.428 + protected Object invoke_S1(Object av) throws Throwable { av = super.check(av, 1);
114.429 + return target.invokeExact(
114.430 + super.select(av,0)); }
114.431 + }
114.432 + static class S2 extends Adapter {
114.433 + protected S2(SpreadGeneric outer) { super(outer); } // to build prototype
114.434 + protected S2(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
114.435 + protected S2 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S2(outer, t); }
114.436 + protected Object invoke_S0(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 0);
114.437 + return target.invokeExact(a0, a1); }
114.438 + protected Object invoke_S1(Object a0, Object av) throws Throwable { av = super.check(av, 1);
114.439 + return target.invokeExact(a0,
114.440 + super.select(av,0)); }
114.441 + protected Object invoke_S2(Object av) throws Throwable { av = super.check(av, 2);
114.442 + return target.invokeExact(
114.443 + super.select(av,0), super.select(av,1)); }
114.444 + }
114.445 + static class S3 extends Adapter {
114.446 + protected S3(SpreadGeneric outer) { super(outer); } // to build prototype
114.447 + protected S3(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
114.448 + protected S3 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S3(outer, t); }
114.449 + protected Object invoke_S0(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 0);
114.450 + return target.invokeExact(a0, a1, a2); }
114.451 + protected Object invoke_S1(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 1);
114.452 + return target.invokeExact(a0, a1,
114.453 + super.select(av,0)); }
114.454 + protected Object invoke_S2(Object a0, Object av) throws Throwable { av = super.check(av, 2);
114.455 + return target.invokeExact(a0,
114.456 + super.select(av,0), super.select(av,1)); }
114.457 + protected Object invoke_S3(Object av) throws Throwable { av = super.check(av, 3);
114.458 + return target.invokeExact(
114.459 + super.select(av,0), super.select(av,1), super.select(av,2)); }
114.460 + }
114.461 + static class S4 extends Adapter {
114.462 + protected S4(SpreadGeneric outer) { super(outer); } // to build prototype
114.463 + protected S4(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
114.464 + protected S4 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S4(outer, t); }
114.465 + protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 0);
114.466 + return target.invokeExact(a0, a1, a2, a3); }
114.467 + protected Object invoke_S1(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 1);
114.468 + return target.invokeExact(a0, a1, a2,
114.469 + super.select(av,0)); }
114.470 + protected Object invoke_S2(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 2);
114.471 + return target.invokeExact(a0, a1,
114.472 + super.select(av,0), super.select(av,1)); }
114.473 + protected Object invoke_S3(Object a0, Object av) throws Throwable { av = super.check(av, 3);
114.474 + return target.invokeExact(a0,
114.475 + super.select(av,0), super.select(av,1), super.select(av,2)); }
114.476 + protected Object invoke_S4(Object av) throws Throwable { av = super.check(av, 4);
114.477 + return target.invokeExact(
114.478 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
114.479 + }
114.480 + static class S5 extends Adapter {
114.481 + protected S5(SpreadGeneric outer) { super(outer); } // to build prototype
114.482 + protected S5(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
114.483 + protected S5 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S5(outer, t); }
114.484 + protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 0);
114.485 + return target.invokeExact(a0, a1, a2, a3, a4); }
114.486 + protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 1);
114.487 + return target.invokeExact(a0, a1, a2, a3,
114.488 + super.select(av,0)); }
114.489 + protected Object invoke_S2(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 2);
114.490 + return target.invokeExact(a0, a1, a2,
114.491 + super.select(av,0), super.select(av,1)); }
114.492 + protected Object invoke_S3(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 3);
114.493 + return target.invokeExact(a0, a1,
114.494 + super.select(av,0), super.select(av,1), super.select(av,2)); }
114.495 + protected Object invoke_S4(Object a0, Object av) throws Throwable { av = super.check(av, 4);
114.496 + return target.invokeExact(a0,
114.497 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
114.498 + protected Object invoke_S5(Object av) throws Throwable { av = super.check(av, 5);
114.499 + return target.invokeExact(
114.500 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.501 + super.select(av,4)); }
114.502 + }
114.503 + static class S6 extends Adapter {
114.504 + protected S6(SpreadGeneric outer) { super(outer); } // to build prototype
114.505 + protected S6(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
114.506 + protected S6 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S6(outer, t); }
114.507 + protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object av) throws Throwable { av = super.check(av, 0);
114.508 + return target.invokeExact(a0, a1, a2, a3, a4, a5); }
114.509 + protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 1);
114.510 + return target.invokeExact(a0, a1, a2, a3, a4,
114.511 + super.select(av,0)); }
114.512 + protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 2);
114.513 + return target.invokeExact(a0, a1, a2, a3,
114.514 + super.select(av,0), super.select(av,1)); }
114.515 + protected Object invoke_S3(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 3);
114.516 + return target.invokeExact(a0, a1, a2,
114.517 + super.select(av,0), super.select(av,1), super.select(av,2)); }
114.518 + protected Object invoke_S4(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 4);
114.519 + return target.invokeExact(a0, a1,
114.520 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
114.521 + protected Object invoke_S5(Object a0, Object av) throws Throwable { av = super.check(av, 5);
114.522 + return target.invokeExact(a0,
114.523 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.524 + super.select(av,4)); }
114.525 + protected Object invoke_S6(Object av) throws Throwable { av = super.check(av, 6);
114.526 + return target.invokeExact(
114.527 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.528 + super.select(av,4), super.select(av,5)); }
114.529 + }
114.530 + static class S7 extends Adapter {
114.531 + protected S7(SpreadGeneric outer) { super(outer); } // to build prototype
114.532 + protected S7(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
114.533 + protected S7 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S7(outer, t); }
114.534 + protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object av) throws Throwable { av = super.check(av, 0);
114.535 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6); }
114.536 + protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object av) throws Throwable { av = super.check(av, 1);
114.537 + return target.invokeExact(a0, a1, a2, a3, a4, a5,
114.538 + super.select(av,0)); }
114.539 + protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 2);
114.540 + return target.invokeExact(a0, a1, a2, a3, a4,
114.541 + super.select(av,0), super.select(av,1)); }
114.542 + protected Object invoke_S3(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 3);
114.543 + return target.invokeExact(a0, a1, a2, a3,
114.544 + super.select(av,0), super.select(av,1), super.select(av,2)); }
114.545 + protected Object invoke_S4(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 4);
114.546 + return target.invokeExact(a0, a1, a2,
114.547 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
114.548 + protected Object invoke_S5(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 5);
114.549 + return target.invokeExact(a0, a1,
114.550 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.551 + super.select(av,4)); }
114.552 + protected Object invoke_S6(Object a0, Object av) throws Throwable { av = super.check(av, 6);
114.553 + return target.invokeExact(a0,
114.554 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.555 + super.select(av,4), super.select(av,5)); }
114.556 + protected Object invoke_S7(Object av) throws Throwable { av = super.check(av, 7);
114.557 + return target.invokeExact(
114.558 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.559 + super.select(av,4), super.select(av,5), super.select(av,6)); }
114.560 + }
114.561 + static class S8 extends Adapter {
114.562 + protected S8(SpreadGeneric outer) { super(outer); } // to build prototype
114.563 + protected S8(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
114.564 + protected S8 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S8(outer, t); }
114.565 + protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object av) throws Throwable { av = super.check(av, 0);
114.566 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7); }
114.567 + protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object av) throws Throwable { av = super.check(av, 1);
114.568 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6,
114.569 + super.select(av,0)); }
114.570 + protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object av) throws Throwable { av = super.check(av, 2);
114.571 + return target.invokeExact(a0, a1, a2, a3, a4, a5,
114.572 + super.select(av,0), super.select(av,1)); }
114.573 + protected Object invoke_S3(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 3);
114.574 + return target.invokeExact(a0, a1, a2, a3, a4,
114.575 + super.select(av,0), super.select(av,1), super.select(av,2)); }
114.576 + protected Object invoke_S4(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 4);
114.577 + return target.invokeExact(a0, a1, a2, a3,
114.578 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
114.579 + protected Object invoke_S5(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 5);
114.580 + return target.invokeExact(a0, a1, a2,
114.581 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.582 + super.select(av,4)); }
114.583 + protected Object invoke_S6(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 6);
114.584 + return target.invokeExact(a0, a1,
114.585 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.586 + super.select(av,4), super.select(av,5)); }
114.587 + protected Object invoke_S7(Object a0, Object av) throws Throwable { av = super.check(av, 7);
114.588 + return target.invokeExact(a0,
114.589 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.590 + super.select(av,4), super.select(av,5), super.select(av,6)); }
114.591 + protected Object invoke_S8(Object av) throws Throwable { av = super.check(av, 8);
114.592 + return target.invokeExact(
114.593 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.594 + super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7)); }
114.595 + }
114.596 + static class S9 extends Adapter {
114.597 + protected S9(SpreadGeneric outer) { super(outer); } // to build prototype
114.598 + protected S9(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
114.599 + protected S9 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S9(outer, t); }
114.600 + protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object av) throws Throwable { av = super.check(av, 0);
114.601 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
114.602 + protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object av) throws Throwable { av = super.check(av, 1);
114.603 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7,
114.604 + super.select(av,0)); }
114.605 + protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object av) throws Throwable { av = super.check(av, 2);
114.606 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6,
114.607 + super.select(av,0), super.select(av,1)); }
114.608 + protected Object invoke_S3(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object av) throws Throwable { av = super.check(av, 3);
114.609 + return target.invokeExact(a0, a1, a2, a3, a4, a5,
114.610 + super.select(av,0), super.select(av,1), super.select(av,2)); }
114.611 + protected Object invoke_S4(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 4);
114.612 + return target.invokeExact(a0, a1, a2, a3, a4,
114.613 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
114.614 + protected Object invoke_S5(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 5);
114.615 + return target.invokeExact(a0, a1, a2, a3,
114.616 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.617 + super.select(av,4)); }
114.618 + protected Object invoke_S6(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 6);
114.619 + return target.invokeExact(a0, a1, a2,
114.620 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.621 + super.select(av,4), super.select(av,5)); }
114.622 + protected Object invoke_S7(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 7);
114.623 + return target.invokeExact(a0, a1,
114.624 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.625 + super.select(av,4), super.select(av,5), super.select(av,6)); }
114.626 + protected Object invoke_S8(Object a0, Object av) throws Throwable { av = super.check(av, 8);
114.627 + return target.invokeExact(a0,
114.628 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.629 + super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7)); }
114.630 + protected Object invoke_S9(Object av) throws Throwable { av = super.check(av, 9);
114.631 + return target.invokeExact(
114.632 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.633 + super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7),
114.634 + super.select(av,8)); }
114.635 + }
114.636 + static class S10 extends Adapter {
114.637 + protected S10(SpreadGeneric outer) { super(outer); } // to build prototype
114.638 + protected S10(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
114.639 + protected S10 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S10(outer, t); }
114.640 + protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9, Object av) throws Throwable { av = super.check(av, 0);
114.641 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
114.642 + protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object av) throws Throwable { av = super.check(av, 1);
114.643 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8,
114.644 + super.select(av,0)); }
114.645 + protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object av) throws Throwable { av = super.check(av, 2);
114.646 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7,
114.647 + super.select(av,0), super.select(av,1)); }
114.648 + protected Object invoke_S3(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object av) throws Throwable { av = super.check(av, 3);
114.649 + return target.invokeExact(a0, a1, a2, a3, a4, a5, a6,
114.650 + super.select(av,0), super.select(av,1), super.select(av,2)); }
114.651 + protected Object invoke_S4(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object av) throws Throwable { av = super.check(av, 4);
114.652 + return target.invokeExact(a0, a1, a2, a3, a4, a5,
114.653 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
114.654 + protected Object invoke_S5(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 5);
114.655 + return target.invokeExact(a0, a1, a2, a3, a4,
114.656 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.657 + super.select(av,4)); }
114.658 + protected Object invoke_S6(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 6);
114.659 + return target.invokeExact(a0, a1, a2, a3,
114.660 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.661 + super.select(av,4), super.select(av,5)); }
114.662 + protected Object invoke_S7(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 7);
114.663 + return target.invokeExact(a0, a1, a2,
114.664 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.665 + super.select(av,4), super.select(av,5), super.select(av,6)); }
114.666 + protected Object invoke_S8(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 8);
114.667 + return target.invokeExact(a0, a1,
114.668 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.669 + super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7)); }
114.670 + protected Object invoke_S9(Object a0, Object av) throws Throwable { av = super.check(av, 9);
114.671 + return target.invokeExact(a0,
114.672 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.673 + super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7),
114.674 + super.select(av,8)); }
114.675 + protected Object invoke_S10(Object av) throws Throwable { av = super.check(av, 10);
114.676 + return target.invokeExact(
114.677 + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
114.678 + super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7),
114.679 + super.select(av,8), super.select(av,9)); }
114.680 + }
114.681 +}
115.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
115.2 +++ b/src/share/classes/java/lang/invoke/SwitchPoint.java Tue Mar 29 20:19:55 2011 -0700
115.3 @@ -0,0 +1,199 @@
115.4 +/*
115.5 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
115.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
115.7 + *
115.8 + * This code is free software; you can redistribute it and/or modify it
115.9 + * under the terms of the GNU General Public License version 2 only, as
115.10 + * published by the Free Software Foundation. Oracle designates this
115.11 + * particular file as subject to the "Classpath" exception as provided
115.12 + * by Oracle in the LICENSE file that accompanied this code.
115.13 + *
115.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
115.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
115.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
115.17 + * version 2 for more details (a copy is included in the LICENSE file that
115.18 + * accompanied this code).
115.19 + *
115.20 + * You should have received a copy of the GNU General Public License version
115.21 + * 2 along with this work; if not, write to the Free Software Foundation,
115.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
115.23 + *
115.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
115.25 + * or visit www.oracle.com if you need additional information or have any
115.26 + * questions.
115.27 + */
115.28 +
115.29 +package java.lang.invoke;
115.30 +
115.31 +/**
115.32 + * <p>
115.33 + * A {@code SwitchPoint} is an object which can publish state transitions to other threads.
115.34 + * A switch point is initially in the <em>valid</em> state, but may at any time be
115.35 + * changed to the <em>invalid</em> state. Invalidation cannot be reversed.
115.36 + * A switch point can combine a <em>guarded pair</em> of method handles into a
115.37 + * <em>guarded delegator</em>.
115.38 + * The guarded delegator is a method handle which delegates to one of the old method handles.
115.39 + * The state of the switch point determines which of the two gets the delegation.
115.40 + * <p>
115.41 + * A single switch point may be used to control any number of method handles.
115.42 + * (Indirectly, therefore, it can control any number of call sites.)
115.43 + * This is done by using the single switch point as a factory for combining
115.44 + * any number of guarded method handle pairs into guarded delegators.
115.45 + * <p>
115.46 + * When a guarded delegator is created from a guarded pair, the pair
115.47 + * is wrapped in a new method handle {@code M},
115.48 + * which is permanently associated with the switch point that created it.
115.49 + * Each pair consists of a target {@code T} and a fallback {@code F}.
115.50 + * While the switch point is valid, invocations to {@code M} are delegated to {@code T}.
115.51 + * After it is invalidated, invocations are delegated to {@code F}.
115.52 + * <p>
115.53 + * Invalidation is global and immediate, as if the switch point contained a
115.54 + * volatile boolean variable consulted on every call to {@code M}.
115.55 + * The invalidation is also permanent, which means the switch point
115.56 + * can change state only once.
115.57 + * The switch point will always delegate to {@code F} after being invalidated.
115.58 + * At that point {@code guardWithTest} may ignore {@code T} and return {@code F}.
115.59 + * <p>
115.60 + * Here is an example of a switch point in action:
115.61 + * <blockquote><pre>
115.62 +MethodType MT_str2 = MethodType.methodType(String.class, String.class);
115.63 +MethodHandle MH_strcat = MethodHandles.lookup()
115.64 + .findVirtual(String.class, "concat", MT_str2);
115.65 +SwitchPoint spt = new SwitchPoint();
115.66 +// the following steps may be repeated to re-use the same switch point:
115.67 +MethodHandle worker1 = strcat;
115.68 +MethodHandle worker2 = MethodHandles.permuteArguments(strcat, MT_str2, 1, 0);
115.69 +MethodHandle worker = spt.guardWithTest(worker1, worker2);
115.70 +assertEquals("method", (String) worker.invokeExact("met", "hod"));
115.71 +SwitchPoint.invalidateAll(new SwitchPoint[]{ spt });
115.72 +assertEquals("hodmet", (String) worker.invokeExact("met", "hod"));
115.73 + * </pre></blockquote>
115.74 + * <p style="font-size:smaller;">
115.75 + * <em>Discussion:</em>
115.76 + * Switch points are useful without subclassing. They may also be subclassed.
115.77 + * This may be useful in order to associate application-specific invalidation logic
115.78 + * with the switch point.
115.79 + * Notice that there is no permanent association between a switch point and
115.80 + * the method handles it produces and consumes.
115.81 + * The garbage collector may collect method handles produced or consumed
115.82 + * by a switch point independently of the lifetime of the switch point itself.
115.83 + * <p style="font-size:smaller;">
115.84 + * <em>Implementation Note:</em>
115.85 + * A switch point behaves as if implemented on top of {@link MutableCallSite},
115.86 + * approximately as follows:
115.87 + * <blockquote><pre>
115.88 +public class SwitchPoint {
115.89 + private static final MethodHandle
115.90 + K_true = MethodHandles.constant(boolean.class, true),
115.91 + K_false = MethodHandles.constant(boolean.class, false);
115.92 + private final MutableCallSite mcs;
115.93 + private final MethodHandle mcsInvoker;
115.94 + public SwitchPoint() {
115.95 + this.mcs = new MutableCallSite(K_true);
115.96 + this.mcsInvoker = mcs.dynamicInvoker();
115.97 + }
115.98 + public MethodHandle guardWithTest(
115.99 + MethodHandle target, MethodHandle fallback) {
115.100 + // Note: mcsInvoker is of type ()boolean.
115.101 + // Target and fallback may take any arguments, but must have the same type.
115.102 + return MethodHandles.guardWithTest(this.mcsInvoker, target, fallback);
115.103 + }
115.104 + public static void invalidateAll(SwitchPoint[] spts) {
115.105 + List<MutableCallSite> mcss = new ArrayList<>();
115.106 + for (SwitchPoint spt : spts) mcss.add(spt.mcs);
115.107 + for (MutableCallSite mcs : mcss) mcs.setTarget(K_false);
115.108 + MutableCallSite.syncAll(mcss.toArray(new MutableCallSite[0]));
115.109 + }
115.110 +}
115.111 + * </pre></blockquote>
115.112 + * @author Remi Forax, JSR 292 EG
115.113 + */
115.114 +public class SwitchPoint {
115.115 + private static final MethodHandle
115.116 + K_true = MethodHandles.constant(boolean.class, true),
115.117 + K_false = MethodHandles.constant(boolean.class, false);
115.118 +
115.119 + private final MutableCallSite mcs;
115.120 + private final MethodHandle mcsInvoker;
115.121 +
115.122 + /**
115.123 + * Creates a new switch point.
115.124 + */
115.125 + public SwitchPoint() {
115.126 + this.mcs = new MutableCallSite(K_true);
115.127 + this.mcsInvoker = mcs.dynamicInvoker();
115.128 + }
115.129 +
115.130 + /**
115.131 + * Returns a method handle which always delegates either to the target or the fallback.
115.132 + * The method handle will delegate to the target exactly as long as the switch point is valid.
115.133 + * After that, it will permanently delegate to the fallback.
115.134 + * <p>
115.135 + * The target and fallback must be of exactly the same method type,
115.136 + * and the resulting combined method handle will also be of this type.
115.137 + *
115.138 + * @param target the method handle selected by the switch point as long as it is valid
115.139 + * @param fallback the method handle selected by the switch point after it is invalidated
115.140 + * @return a combined method handle which always calls either the target or fallback
115.141 + * @throws NullPointerException if either argument is null
115.142 + * @see MethodHandles#guardWithTest
115.143 + */
115.144 + public MethodHandle guardWithTest(MethodHandle target, MethodHandle fallback) {
115.145 + if (mcs.getTarget() == K_false)
115.146 + return fallback; // already invalid
115.147 + return MethodHandles.guardWithTest(mcsInvoker, target, fallback);
115.148 + }
115.149 +
115.150 + /**
115.151 + * Sets all of the given switch points into the invalid state.
115.152 + * After this call executes, no thread will observe any of the
115.153 + * switch points to be in a valid state.
115.154 + * <p>
115.155 + * This operation is likely to be expensive and should be used sparingly.
115.156 + * If possible, it should be buffered for batch processing on sets of switch points.
115.157 + * <p>
115.158 + * If {@code switchPoints} contains a null element,
115.159 + * a {@code NullPointerException} will be raised.
115.160 + * In this case, some non-null elements in the array may be
115.161 + * processed before the method returns abnormally.
115.162 + * Which elements these are (if any) is implementation-dependent.
115.163 + *
115.164 + * <p style="font-size:smaller;">
115.165 + * <em>Discussion:</em>
115.166 + * For performance reasons, {@code invalidateAll} is not a virtual method
115.167 + * on a single switch point, but rather applies to a set of switch points.
115.168 + * Some implementations may incur a large fixed overhead cost
115.169 + * for processing one or more invalidation operations,
115.170 + * but a small incremental cost for each additional invalidation.
115.171 + * In any case, this operation is likely to be costly, since
115.172 + * other threads may have to be somehow interrupted
115.173 + * in order to make them notice the updated switch point state.
115.174 + * However, it may be observed that a single call to invalidate
115.175 + * several switch points has the same formal effect as many calls,
115.176 + * each on just one of the switch points.
115.177 + *
115.178 + * <p style="font-size:smaller;">
115.179 + * <em>Implementation Note:</em>
115.180 + * Simple implementations of {@code SwitchPoint} may use
115.181 + * a private {@link MutableCallSite} to publish the state of a switch point.
115.182 + * In such an implementation, the {@code invalidateAll} method can
115.183 + * simply change the call site's target, and issue one call to
115.184 + * {@linkplain MutableCallSite#syncAll synchronize} all the
115.185 + * private call sites.
115.186 + *
115.187 + * @param switchPoints an array of call sites to be synchronized
115.188 + * @throws NullPointerException if the {@code switchPoints} array reference is null
115.189 + * or the array contains a null
115.190 + */
115.191 + public static void invalidateAll(SwitchPoint[] switchPoints) {
115.192 + if (switchPoints.length == 0) return;
115.193 + MutableCallSite[] sites = new MutableCallSite[switchPoints.length];
115.194 + for (int i = 0; i < switchPoints.length; i++) {
115.195 + SwitchPoint spt = switchPoints[i];
115.196 + if (spt == null) break; // MSC.syncAll will trigger a NPE
115.197 + sites[i] = spt.mcs;
115.198 + spt.mcs.setTarget(K_false);
115.199 + }
115.200 + MutableCallSite.syncAll(sites);
115.201 + }
115.202 +}
116.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
116.2 +++ b/src/share/classes/java/lang/invoke/ToGeneric.java Tue Mar 29 20:19:55 2011 -0700
116.3 @@ -0,0 +1,1062 @@
116.4 +/*
116.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
116.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
116.7 + *
116.8 + * This code is free software; you can redistribute it and/or modify it
116.9 + * under the terms of the GNU General Public License version 2 only, as
116.10 + * published by the Free Software Foundation. Oracle designates this
116.11 + * particular file as subject to the "Classpath" exception as provided
116.12 + * by Oracle in the LICENSE file that accompanied this code.
116.13 + *
116.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
116.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
116.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
116.17 + * version 2 for more details (a copy is included in the LICENSE file that
116.18 + * accompanied this code).
116.19 + *
116.20 + * You should have received a copy of the GNU General Public License version
116.21 + * 2 along with this work; if not, write to the Free Software Foundation,
116.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
116.23 + *
116.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
116.25 + * or visit www.oracle.com if you need additional information or have any
116.26 + * questions.
116.27 + */
116.28 +
116.29 +package java.lang.invoke;
116.30 +
116.31 +import java.lang.reflect.Constructor;
116.32 +import java.lang.reflect.InvocationTargetException;
116.33 +import sun.invoke.util.ValueConversions;
116.34 +import sun.invoke.util.Wrapper;
116.35 +import static java.lang.invoke.MethodHandleStatics.*;
116.36 +import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
116.37 +
116.38 +/**
116.39 + * Adapters which mediate between incoming calls which are not generic
116.40 + * and outgoing calls which are. Any call can be represented generically
116.41 + * boxing up its arguments, and (on return) unboxing the return value.
116.42 + * <p>
116.43 + * A call is "generic" (in MethodHandle terms) if its MethodType features
116.44 + * only Object arguments. A non-generic call therefore features
116.45 + * primitives and/or reference types other than Object.
116.46 + * An adapter has types for its incoming and outgoing calls.
116.47 + * The incoming call type is simply determined by the adapter's type
116.48 + * (the MethodType it presents to callers). The outgoing call type
116.49 + * is determined by the adapter's target (a MethodHandle that the adapter
116.50 + * either binds internally or else takes as a leading argument).
116.51 + * (To stretch the term, adapter-like method handles may have multiple
116.52 + * targets or be polymorphic across multiple call types.)
116.53 + * @author jrose
116.54 + */
116.55 +class ToGeneric {
116.56 + // type for the incoming call (may be erased)
116.57 + private final MethodType entryType;
116.58 + // incoming type with primitives moved to the end and turned to int/long
116.59 + private final MethodType rawEntryType;
116.60 + // adapter for the erased type
116.61 + private final Adapter adapter;
116.62 + // entry point for adapter (Adapter mh, a...) => ...
116.63 + private final MethodHandle entryPoint;
116.64 + // permutation of arguments for primsAtEndType
116.65 + private final int[] primsAtEndOrder;
116.66 + // optional final argument list conversions (at least, invokes the target)
116.67 + private final MethodHandle invoker;
116.68 + // conversion which unboxes a primitive return value
116.69 + private final MethodHandle returnConversion;
116.70 +
116.71 + /** Compute and cache information common to all generifying (boxing) adapters
116.72 + * that implement members of the erasure-family of the given erased type.
116.73 + */
116.74 + private ToGeneric(MethodType entryType) {
116.75 + assert(entryType.erase() == entryType); // for now
116.76 + // incoming call will first "forget" all reference types except Object
116.77 + this.entryType = entryType;
116.78 + MethodHandle invoker0 = entryType.generic().invokers().exactInvoker();
116.79 + MethodType rawEntryTypeInit;
116.80 + Adapter ad = findAdapter(rawEntryTypeInit = entryType);
116.81 + if (ad != null) {
116.82 + // Immediate hit to exactly the adapter we want,
116.83 + // with no monkeying around with primitive types.
116.84 + this.returnConversion = computeReturnConversion(entryType, rawEntryTypeInit, false);
116.85 + this.rawEntryType = rawEntryTypeInit;
116.86 + this.adapter = ad;
116.87 + this.entryPoint = ad.prototypeEntryPoint();
116.88 + this.primsAtEndOrder = null;
116.89 + this.invoker = invoker0;
116.90 + return;
116.91 + }
116.92 +
116.93 + // next, it will reorder primitives after references
116.94 + MethodType primsAtEnd = entryType.form().primsAtEnd();
116.95 + // at the same time, it will "forget" all primitive types except int/long
116.96 + this.primsAtEndOrder = MethodTypeForm.primsAtEndOrder(entryType);
116.97 + if (primsAtEndOrder != null) {
116.98 + // reordering is required; build on top of a simpler ToGeneric
116.99 + ToGeneric va2 = ToGeneric.of(primsAtEnd);
116.100 + this.adapter = va2.adapter;
116.101 + if (true) throw new UnsupportedOperationException("NYI: primitive parameters must follow references; entryType = "+entryType);
116.102 + this.entryPoint = MethodHandleImpl.convertArguments(
116.103 + va2.entryPoint, primsAtEnd, entryType, primsAtEndOrder);
116.104 + // example: for entryType of (int,Object,Object), the reordered
116.105 + // type is (Object,Object,int) and the order is {1,2,0},
116.106 + // and putPAE is (mh,int0,obj1,obj2) => mh.invokeExact(obj1,obj2,int0)
116.107 + return;
116.108 + }
116.109 +
116.110 + // after any needed argument reordering, it will reinterpret
116.111 + // primitive arguments according to their "raw" types int/long
116.112 + MethodType intsAtEnd = primsAtEnd.form().primsAsInts();
116.113 + ad = findAdapter(rawEntryTypeInit = intsAtEnd);
116.114 + MethodHandle rawEntryPoint;
116.115 + if (ad != null) {
116.116 + rawEntryPoint = ad.prototypeEntryPoint();
116.117 + } else {
116.118 + // Perhaps the adapter is available only for longs.
116.119 + // If so, we can use it, but there will have to be a little
116.120 + // more stack motion on each call.
116.121 + MethodType longsAtEnd = primsAtEnd.form().primsAsLongs();
116.122 + ad = findAdapter(rawEntryTypeInit = longsAtEnd);
116.123 + if (ad != null) {
116.124 + MethodType eptWithLongs = longsAtEnd.insertParameterTypes(0, ad.getClass());
116.125 + MethodType eptWithInts = intsAtEnd.insertParameterTypes(0, ad.getClass());
116.126 + rawEntryPoint = ad.prototypeEntryPoint();
116.127 + MethodType midType = eptWithLongs; // will change longs to ints
116.128 + for (int i = 0, nargs = midType.parameterCount(); i < nargs; i++) {
116.129 + if (midType.parameterType(i) != eptWithInts.parameterType(i)) {
116.130 + assert(midType.parameterType(i) == long.class);
116.131 + assert(eptWithInts.parameterType(i) == int.class);
116.132 + MethodType nextType = midType.changeParameterType(i, int.class);
116.133 + rawEntryPoint = MethodHandleImpl.convertArguments(
116.134 + rawEntryPoint, nextType, midType, null);
116.135 + midType = nextType;
116.136 + }
116.137 + }
116.138 + assert(midType == eptWithInts);
116.139 + } else {
116.140 + // If there is no statically compiled adapter,
116.141 + // build one by means of dynamic bytecode generation.
116.142 + ad = buildAdapterFromBytecodes(rawEntryTypeInit = intsAtEnd);
116.143 + rawEntryPoint = ad.prototypeEntryPoint();
116.144 + }
116.145 + }
116.146 + MethodType tepType = entryType.insertParameterTypes(0, ad.getClass());
116.147 + this.entryPoint =
116.148 + AdapterMethodHandle.makeRetypeRaw(tepType, rawEntryPoint);
116.149 + if (this.entryPoint == null)
116.150 + throw new UnsupportedOperationException("cannot retype to "+entryType
116.151 + +" from "+rawEntryPoint.type().dropParameterTypes(0, 1));
116.152 + this.returnConversion = computeReturnConversion(entryType, rawEntryTypeInit, false);
116.153 + this.rawEntryType = rawEntryTypeInit;
116.154 + this.adapter = ad;
116.155 + this.invoker = makeRawArgumentFilter(invoker0, rawEntryTypeInit, entryType);
116.156 + }
116.157 +
116.158 + /** A generic argument list will be created by a call of type 'raw'.
116.159 + * The values need to be reboxed for to match 'cooked'.
116.160 + * Do this on the fly.
116.161 + */
116.162 + // TO DO: Use a generic argument converter in a different file
116.163 + static MethodHandle makeRawArgumentFilter(MethodHandle invoker,
116.164 + MethodType raw, MethodType cooked) {
116.165 + MethodHandle filteredInvoker = null;
116.166 + for (int i = 0, nargs = raw.parameterCount(); i < nargs; i++) {
116.167 + Class<?> src = raw.parameterType(i);
116.168 + Class<?> dst = cooked.parameterType(i);
116.169 + if (src == dst) continue;
116.170 + assert(src.isPrimitive() && dst.isPrimitive());
116.171 + if (filteredInvoker == null) {
116.172 + filteredInvoker =
116.173 + AdapterMethodHandle.makeCheckCast(
116.174 + invoker.type().generic(), invoker, 0, MethodHandle.class);
116.175 + if (filteredInvoker == null) throw new UnsupportedOperationException("NYI");
116.176 + }
116.177 + MethodHandle reboxer = ValueConversions.rebox(dst, false);
116.178 + filteredInvoker = FilterGeneric.makeArgumentFilter(1+i, reboxer, filteredInvoker);
116.179 + if (filteredInvoker == null) throw new InternalError();
116.180 + }
116.181 + if (filteredInvoker == null) return invoker;
116.182 + return AdapterMethodHandle.makeRetypeOnly(invoker.type(), filteredInvoker);
116.183 + }
116.184 +
116.185 + /**
116.186 + * Caller will be expecting a result from a call to {@code type},
116.187 + * while the internal adapter entry point is rawEntryType.
116.188 + * Also, the internal target method will be returning a boxed value,
116.189 + * as an untyped object.
116.190 + * <p>
116.191 + * Produce a value converter which will be typed to convert from
116.192 + * {@code Object} to the return value of {@code rawEntryType}, and will
116.193 + * in fact ensure that the value is compatible with the return type of
116.194 + * {@code type}.
116.195 + */
116.196 + private static MethodHandle computeReturnConversion(
116.197 + MethodType type, MethodType rawEntryType, boolean mustCast) {
116.198 + Class<?> tret = type.returnType();
116.199 + Class<?> rret = rawEntryType.returnType();
116.200 + if (mustCast || !tret.isPrimitive()) {
116.201 + assert(!tret.isPrimitive());
116.202 + assert(!rret.isPrimitive());
116.203 + if (rret == Object.class && !mustCast)
116.204 + return null;
116.205 + return ValueConversions.cast(tret, false);
116.206 + } else if (tret == rret) {
116.207 + return ValueConversions.unbox(tret, false);
116.208 + } else {
116.209 + assert(rret.isPrimitive());
116.210 + assert(tret == double.class ? rret == long.class : rret == int.class);
116.211 + return ValueConversions.unboxRaw(tret, false);
116.212 + }
116.213 + }
116.214 +
116.215 + Adapter makeInstance(MethodType type, MethodHandle genericTarget) {
116.216 + genericTarget.getClass(); // check for NPE
116.217 + MethodHandle convert = returnConversion;
116.218 + if (primsAtEndOrder != null)
116.219 + // reorder arguments passed to genericTarget, if primsAtEndOrder
116.220 + throw new UnsupportedOperationException("NYI");
116.221 + if (type == entryType) {
116.222 + if (convert == null) convert = ValueConversions.identity();
116.223 + return adapter.makeInstance(entryPoint, invoker, convert, genericTarget);
116.224 + }
116.225 + // my erased-type is not exactly the same as the desired type
116.226 + assert(type.erase() == entryType); // else we are busted
116.227 + if (convert == null)
116.228 + convert = computeReturnConversion(type, rawEntryType, true);
116.229 + // retype erased reference arguments (the cast makes it safe to do this)
116.230 + MethodType tepType = type.insertParameterTypes(0, adapter.getClass());
116.231 + MethodHandle typedEntryPoint =
116.232 + AdapterMethodHandle.makeRetypeRaw(tepType, entryPoint);
116.233 + return adapter.makeInstance(typedEntryPoint, invoker, convert, genericTarget);
116.234 + }
116.235 +
116.236 + /** Build an adapter of the given type, which invokes genericTarget
116.237 + * on the incoming arguments, after boxing as necessary.
116.238 + * The return value is unboxed if necessary.
116.239 + * @param type the required type of the
116.240 + * @param genericTarget the target, which must accept and return only Object values
116.241 + * @return an adapter method handle
116.242 + */
116.243 + public static MethodHandle make(MethodType type, MethodHandle genericTarget) {
116.244 + MethodType gtype = genericTarget.type();
116.245 + if (type.generic() != gtype)
116.246 + throw newIllegalArgumentException("type must be generic");
116.247 + if (type == gtype) return genericTarget;
116.248 + return ToGeneric.of(type).makeInstance(type, genericTarget);
116.249 + }
116.250 +
116.251 + /** Return the adapter information for this type's erasure. */
116.252 + static ToGeneric of(MethodType type) {
116.253 + MethodTypeForm form = type.form();
116.254 + ToGeneric toGen = form.toGeneric;
116.255 + if (toGen == null)
116.256 + form.toGeneric = toGen = new ToGeneric(form.erasedType());
116.257 + return toGen;
116.258 + }
116.259 +
116.260 + public String toString() {
116.261 + return "ToGeneric"+entryType
116.262 + +(primsAtEndOrder!=null?"[reorder]":"");
116.263 + }
116.264 +
116.265 + /* Create an adapter for the given incoming call type. */
116.266 + static Adapter findAdapter(MethodType entryPointType) {
116.267 + MethodTypeForm form = entryPointType.form();
116.268 + Class<?> rtype = entryPointType.returnType();
116.269 + int argc = form.parameterCount();
116.270 + int lac = form.longPrimitiveParameterCount();
116.271 + int iac = form.primitiveParameterCount() - lac;
116.272 + String intsAndLongs = (iac > 0 ? "I"+iac : "")+(lac > 0 ? "J"+lac : "");
116.273 + String rawReturn = String.valueOf(Wrapper.forPrimitiveType(rtype).basicTypeChar());
116.274 + String iname0 = "invoke_"+rawReturn;
116.275 + String iname1 = "invoke";
116.276 + String[] inames = { iname0, iname1 };
116.277 + String cname0 = rawReturn + argc;
116.278 + String cname1 = "A" + argc;
116.279 + String[] cnames = { cname1, cname1+intsAndLongs, cname0, cname0+intsAndLongs };
116.280 + // e.g., D5I2, D5, L5I2, L5
116.281 + for (String cname : cnames) {
116.282 + Class<? extends Adapter> acls = Adapter.findSubClass(cname);
116.283 + if (acls == null) continue;
116.284 + // see if it has the required invoke method
116.285 + for (String iname : inames) {
116.286 + MethodHandle entryPoint = null;
116.287 + try {
116.288 + entryPoint = IMPL_LOOKUP.
116.289 + findSpecial(acls, iname, entryPointType, acls);
116.290 + } catch (ReflectiveOperationException ex) {
116.291 + }
116.292 + if (entryPoint == null) continue;
116.293 + Constructor<? extends Adapter> ctor = null;
116.294 + try {
116.295 + // Prototype builder:
116.296 + ctor = acls.getDeclaredConstructor(MethodHandle.class);
116.297 + } catch (NoSuchMethodException ex) {
116.298 + } catch (SecurityException ex) {
116.299 + }
116.300 + if (ctor == null) continue;
116.301 + try {
116.302 + return ctor.newInstance(entryPoint);
116.303 + } catch (IllegalArgumentException ex) {
116.304 + } catch (InvocationTargetException wex) {
116.305 + Throwable ex = wex.getTargetException();
116.306 + if (ex instanceof Error) throw (Error)ex;
116.307 + if (ex instanceof RuntimeException) throw (RuntimeException)ex;
116.308 + } catch (InstantiationException ex) {
116.309 + } catch (IllegalAccessException ex) {
116.310 + }
116.311 + }
116.312 + }
116.313 + return null;
116.314 + }
116.315 +
116.316 + static Adapter buildAdapterFromBytecodes(MethodType entryPointType) {
116.317 + throw new UnsupportedOperationException("NYI");
116.318 + }
116.319 +
116.320 + /**
116.321 + * The invoke method takes some particular but unconstrained spread
116.322 + * of raw argument types, and returns a raw return type (in L/I/J/F/D).
116.323 + * Internally, it converts the incoming arguments uniformly into objects.
116.324 + * This series of objects is then passed to the {@code target} method,
116.325 + * which returns a result object. This result is finally converted,
116.326 + * via another method handle {@code convert}, which is responsible for
116.327 + * converting the object result into the raw return value.
116.328 + */
116.329 + static abstract class Adapter extends BoundMethodHandle {
116.330 + /*
116.331 + * class X<<R,A...>> extends Adapter {
116.332 + * Object...=>Object target;
116.333 + * Object=>R convert;
116.334 + * R invoke(A... a...) = convert(invoker(target, a...)))
116.335 + * }
116.336 + */
116.337 + protected final MethodHandle invoker; // (MH, Object...) -> Object
116.338 + protected final MethodHandle target; // Object... -> Object
116.339 + protected final MethodHandle convert; // Object -> R
116.340 +
116.341 + @Override
116.342 + public String toString() {
116.343 + return target == null ? "prototype:"+convert : addTypeString(target, this);
116.344 + }
116.345 +
116.346 + protected boolean isPrototype() { return target == null; }
116.347 + /* Prototype constructor. */
116.348 + protected Adapter(MethodHandle entryPoint) {
116.349 + super(entryPoint);
116.350 + this.invoker = null;
116.351 + this.convert = entryPoint;
116.352 + this.target = null;
116.353 + assert(isPrototype());
116.354 + }
116.355 + protected MethodHandle prototypeEntryPoint() {
116.356 + if (!isPrototype()) throw new InternalError();
116.357 + return convert;
116.358 + }
116.359 +
116.360 + protected Adapter(MethodHandle entryPoint, MethodHandle invoker, MethodHandle convert, MethodHandle target) {
116.361 + super(entryPoint);
116.362 + this.invoker = invoker;
116.363 + this.convert = convert;
116.364 + this.target = target;
116.365 + }
116.366 +
116.367 + /** Make a copy of self, with new fields. */
116.368 + protected abstract Adapter makeInstance(MethodHandle entryPoint,
116.369 + MethodHandle invoker, MethodHandle convert, MethodHandle target);
116.370 + // { return new ThisType(entryPoint, convert, target); }
116.371 +
116.372 + // Code to run when the arguments (<= 4) have all been boxed.
116.373 + protected Object target() throws Throwable { return invoker.invokeExact(target); }
116.374 + protected Object target(Object a0) throws Throwable { return invoker.invokeExact(target, a0); }
116.375 + protected Object target(Object a0, Object a1)
116.376 + throws Throwable { return invoker.invokeExact(target, a0, a1); }
116.377 + protected Object target(Object a0, Object a1, Object a2)
116.378 + throws Throwable { return invoker.invokeExact(target, a0, a1, a2); }
116.379 + protected Object target(Object a0, Object a1, Object a2, Object a3)
116.380 + throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3); }
116.381 + /*
116.382 + protected Object target_0(Object... av) throws Throwable { return invoker.invokeExact(target, av); }
116.383 + protected Object target_1(Object a0, Object... av)
116.384 + throws Throwable { return invoker.invokeExact(target, a0, (Object)av); }
116.385 + protected Object target_2(Object a0, Object a1, Object... av)
116.386 + throws Throwable { return invoker.invokeExact(target, a0, a1, (Object)av); }
116.387 + protected Object target_3(Object a0, Object a1, Object a2, Object... av)
116.388 + throws Throwable { return invoker.invokeExact(target, a0, a1, a2, (Object)av); }
116.389 + protected Object target_4(Object a0, Object a1, Object a2, Object a3, Object... av)
116.390 + throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, (Object)av); }
116.391 + // */
116.392 + // (For more than 4 arguments, generate the code in the adapter itself.)
116.393 +
116.394 + // Code to run when the generic target has finished and produced a value.
116.395 + protected Object return_L(Object res) throws Throwable { return (Object)convert.invokeExact(res); }
116.396 + protected int return_I(Object res) throws Throwable { return (int) convert.invokeExact(res); }
116.397 + protected long return_J(Object res) throws Throwable { return (long) convert.invokeExact(res); }
116.398 + protected float return_F(Object res) throws Throwable { return (float) convert.invokeExact(res); }
116.399 + protected double return_D(Object res) throws Throwable { return (double)convert.invokeExact(res); }
116.400 +
116.401 + static private final String CLASS_PREFIX; // "java.lang.invoke.ToGeneric$"
116.402 + static {
116.403 + String aname = Adapter.class.getName();
116.404 + String sname = Adapter.class.getSimpleName();
116.405 + if (!aname.endsWith(sname)) throw new InternalError();
116.406 + CLASS_PREFIX = aname.substring(0, aname.length() - sname.length());
116.407 + }
116.408 + /** Find a sibing class of Adapter. */
116.409 + static Class<? extends Adapter> findSubClass(String name) {
116.410 + String cname = Adapter.CLASS_PREFIX + name;
116.411 + try {
116.412 + return Class.forName(cname).asSubclass(Adapter.class);
116.413 + } catch (ClassNotFoundException ex) {
116.414 + return null;
116.415 + } catch (ClassCastException ex) {
116.416 + return null;
116.417 + }
116.418 + }
116.419 + }
116.420 +
116.421 + /* generated classes follow this pattern:
116.422 + static class A1 extends Adapter {
116.423 + protected A1(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
116.424 + protected A1(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
116.425 + protected A1 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A1(e, i, c, t); }
116.426 + protected Object target(Object a0) throws Throwable { return invoker.invokeExact(target, a0); }
116.427 + protected Object targetA1(Object a0) throws Throwable { return target(a0); }
116.428 + protected Object targetA1(int a0) throws Throwable { return target(a0); }
116.429 + protected Object targetA1(long a0) throws Throwable { return target(a0); }
116.430 + protected Object invoke_L(Object a0) throws Throwable { return return_L(targetA1(a0)); }
116.431 + protected int invoke_I(Object a0) throws Throwable { return return_I(targetA1(a0)); }
116.432 + protected long invoke_J(Object a0) throws Throwable { return return_J(targetA1(a0)); }
116.433 + protected float invoke_F(Object a0) throws Throwable { return return_F(targetA1(a0)); }
116.434 + protected double invoke_D(Object a0) throws Throwable { return return_D(targetA1(a0)); }
116.435 + protected Object invoke_L(int a0) throws Throwable { return return_L(targetA1(a0)); }
116.436 + protected int invoke_I(int a0) throws Throwable { return return_I(targetA1(a0)); }
116.437 + protected long invoke_J(int a0) throws Throwable { return return_J(targetA1(a0)); }
116.438 + protected float invoke_F(int a0) throws Throwable { return return_F(targetA1(a0)); }
116.439 + protected double invoke_D(int a0) throws Throwable { return return_D(targetA1(a0)); }
116.440 + protected Object invoke_L(long a0) throws Throwable { return return_L(targetA1(a0)); }
116.441 + protected int invoke_I(long a0) throws Throwable { return return_I(targetA1(a0)); }
116.442 + protected long invoke_J(long a0) throws Throwable { return return_J(targetA1(a0)); }
116.443 + protected float invoke_F(long a0) throws Throwable { return return_F(targetA1(a0)); }
116.444 + protected double invoke_D(long a0) throws Throwable { return return_D(targetA1(a0)); }
116.445 + }
116.446 + // */
116.447 +
116.448 +/*
116.449 +: SHELL; n=ToGeneric; cp -p $n.java $n.java-; sed < $n.java- > $n.java+ -e '/{{*{{/,/}}*}}/w /tmp/genclasses.java' -e '/}}*}}/q'; (cd /tmp; javac -d . genclasses.java; java -cp . genclasses) >> $n.java+; echo '}' >> $n.java+; mv $n.java+ $n.java; mv $n.java- $n.java~
116.450 +//{{{
116.451 +import java.util.*;
116.452 +class genclasses {
116.453 + static String[] TYPES = { "Object", "int ", "long ", "float ", "double" };
116.454 + static String[] TCHARS = { "L", "I", "J", "F", "D", "A" };
116.455 + static String[][] TEMPLATES = { {
116.456 + "@for@ arity=0..3 rcat<=4 nrefs<=99 nints<=99 nlongs<=99",
116.457 + "@for@ arity=4..4 rcat<=4 nrefs<=99 nints<=99 nlongs<=99",
116.458 + "@for@ arity=5..5 rcat<=2 nrefs<=99 nints<=99 nlongs<=99",
116.459 + "@for@ arity=6..10 rcat<=2 nrefs<=99 nints=0 nlongs<=99",
116.460 + " //@each-cat@",
116.461 + " static class @cat@ extends Adapter {",
116.462 + " protected @cat@(MethodHandle entryPoint) { super(entryPoint); } // to build prototype",
116.463 + " protected @cat@(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }",
116.464 + " protected @cat@ makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new @cat@(e, i, c, t); }",
116.465 + " protected Object target(@Ovav@) throws Throwable { return invoker.invokeExact(target@comma@@av@); }",
116.466 + " //@each-Tv@",
116.467 + " protected Object target@cat@(@Tvav@) throws Throwable { return target(@av@); }",
116.468 + " //@end-Tv@",
116.469 + " //@each-Tv@",
116.470 + " //@each-R@",
116.471 + " protected @R@ invoke_@Rc@(@Tvav@) throws Throwable { return return_@Rc@(target@cat@(@av@)); }",
116.472 + " //@end-R@",
116.473 + " //@end-Tv@",
116.474 + " }",
116.475 + } };
116.476 + enum VAR {
116.477 + cat, R, Rc, Tv, av, comma, Tvav, Ovav;
116.478 + public final String pattern = "@"+toString().replace('_','.')+"@";
116.479 + public String binding;
116.480 + static void makeBindings(boolean topLevel, int rcat, int nrefs, int nints, int nlongs) {
116.481 + int nargs = nrefs + nints + nlongs;
116.482 + if (topLevel)
116.483 + VAR.cat.binding = catstr(ALL_RETURN_TYPES ? TYPES.length : rcat, nrefs, nints, nlongs);
116.484 + VAR.R.binding = TYPES[rcat];
116.485 + VAR.Rc.binding = TCHARS[rcat];
116.486 + String[] Tv = new String[nargs];
116.487 + String[] av = new String[nargs];
116.488 + String[] Tvav = new String[nargs];
116.489 + String[] Ovav = new String[nargs];
116.490 + for (int i = 0; i < nargs; i++) {
116.491 + int tcat = (i < nrefs) ? 0 : (i < nrefs + nints) ? 1 : 2;
116.492 + Tv[i] = TYPES[tcat];
116.493 + av[i] = arg(i);
116.494 + Tvav[i] = param(Tv[i], av[i]);
116.495 + Ovav[i] = param("Object", av[i]);
116.496 + }
116.497 + VAR.Tv.binding = comma(Tv);
116.498 + VAR.av.binding = comma(av);
116.499 + VAR.comma.binding = (av.length == 0 ? "" : ", ");
116.500 + VAR.Tvav.binding = comma(Tvav);
116.501 + VAR.Ovav.binding = comma(Ovav);
116.502 + }
116.503 + static String arg(int i) { return "a"+i; }
116.504 + static String param(String t, String a) { return t+" "+a; }
116.505 + static String comma(String[] v) { return comma("", v); }
116.506 + static String comma(String sep, String[] v) {
116.507 + if (v.length == 0) return "";
116.508 + String res = sep+v[0];
116.509 + for (int i = 1; i < v.length; i++) res += ", "+v[i];
116.510 + return res;
116.511 + }
116.512 + static String transform(String string) {
116.513 + for (VAR var : values())
116.514 + string = string.replaceAll(var.pattern, var.binding);
116.515 + return string;
116.516 + }
116.517 + }
116.518 + static String[] stringsIn(String[] strings, int beg, int end) {
116.519 + return Arrays.copyOfRange(strings, beg, Math.min(end, strings.length));
116.520 + }
116.521 + static String[] stringsBefore(String[] strings, int pos) {
116.522 + return stringsIn(strings, 0, pos);
116.523 + }
116.524 + static String[] stringsAfter(String[] strings, int pos) {
116.525 + return stringsIn(strings, pos, strings.length);
116.526 + }
116.527 + static int indexAfter(String[] strings, int pos, String tag) {
116.528 + return Math.min(indexBefore(strings, pos, tag) + 1, strings.length);
116.529 + }
116.530 + static int indexBefore(String[] strings, int pos, String tag) {
116.531 + for (int i = pos, end = strings.length; ; i++) {
116.532 + if (i == end || strings[i].endsWith(tag)) return i;
116.533 + }
116.534 + }
116.535 + static int MIN_ARITY, MAX_ARITY, MAX_RCAT, MAX_REFS, MAX_INTS, MAX_LONGS;
116.536 + static boolean ALL_ARG_TYPES, ALL_RETURN_TYPES;
116.537 + static HashSet<String> done = new HashSet<String>();
116.538 + public static void main(String... av) {
116.539 + for (String[] template : TEMPLATES) {
116.540 + int forLinesLimit = indexBefore(template, 0, "@each-cat@");
116.541 + String[] forLines = stringsBefore(template, forLinesLimit);
116.542 + template = stringsAfter(template, forLinesLimit);
116.543 + for (String forLine : forLines)
116.544 + expandTemplate(forLine, template);
116.545 + }
116.546 + }
116.547 + static void expandTemplate(String forLine, String[] template) {
116.548 + String[] params = forLine.split("[^0-9]+");
116.549 + if (params[0].length() == 0) params = stringsAfter(params, 1);
116.550 + System.out.println("//params="+Arrays.asList(params));
116.551 + int pcur = 0;
116.552 + MIN_ARITY = Integer.valueOf(params[pcur++]);
116.553 + MAX_ARITY = Integer.valueOf(params[pcur++]);
116.554 + MAX_RCAT = Integer.valueOf(params[pcur++]);
116.555 + MAX_REFS = Integer.valueOf(params[pcur++]);
116.556 + MAX_INTS = Integer.valueOf(params[pcur++]);
116.557 + MAX_LONGS = Integer.valueOf(params[pcur++]);
116.558 + if (pcur != params.length) throw new RuntimeException("bad extra param: "+forLine);
116.559 + if (MAX_RCAT >= TYPES.length) MAX_RCAT = TYPES.length - 1;
116.560 + ALL_ARG_TYPES = (indexBefore(template, 0, "@each-Tv@") < template.length);
116.561 + ALL_RETURN_TYPES = (indexBefore(template, 0, "@each-R@") < template.length);
116.562 + for (int nargs = MIN_ARITY; nargs <= MAX_ARITY; nargs++) {
116.563 + for (int rcat = 0; rcat <= MAX_RCAT; rcat++) {
116.564 + expandTemplate(template, true, rcat, nargs, 0, 0);
116.565 + if (ALL_ARG_TYPES) break;
116.566 + expandTemplateForPrims(template, true, rcat, nargs, 1, 1);
116.567 + if (ALL_RETURN_TYPES) break;
116.568 + }
116.569 + }
116.570 + }
116.571 + static String catstr(int rcat, int nrefs, int nints, int nlongs) {
116.572 + int nargs = nrefs + nints + nlongs;
116.573 + String cat = TCHARS[rcat] + nargs;
116.574 + if (!ALL_ARG_TYPES) cat += (nints==0?"":"I"+nints)+(nlongs==0?"":"J"+nlongs);
116.575 + return cat;
116.576 + }
116.577 + static void expandTemplateForPrims(String[] template, boolean topLevel, int rcat, int nargs, int minints, int minlongs) {
116.578 + for (int isLong = 0; isLong <= 1; isLong++) {
116.579 + for (int nprims = 1; nprims <= nargs; nprims++) {
116.580 + int nrefs = nargs - nprims;
116.581 + int nints = ((1-isLong) * nprims);
116.582 + int nlongs = (isLong * nprims);
116.583 + expandTemplate(template, topLevel, rcat, nrefs, nints, nlongs);
116.584 + }
116.585 + }
116.586 + }
116.587 + static void expandTemplate(String[] template, boolean topLevel,
116.588 + int rcat, int nrefs, int nints, int nlongs) {
116.589 + int nargs = nrefs + nints + nlongs;
116.590 + if (nrefs > MAX_REFS || nints > MAX_INTS || nlongs > MAX_LONGS) return;
116.591 + VAR.makeBindings(topLevel, rcat, nrefs, nints, nlongs);
116.592 + if (topLevel && !done.add(VAR.cat.binding)) {
116.593 + System.out.println(" //repeat "+VAR.cat.binding);
116.594 + return;
116.595 + }
116.596 + for (int i = 0; i < template.length; i++) {
116.597 + String line = template[i];
116.598 + if (line.endsWith("@each-cat@")) {
116.599 + // ignore
116.600 + } else if (line.endsWith("@each-R@")) {
116.601 + int blockEnd = indexAfter(template, i, "@end-R@");
116.602 + String[] block = stringsIn(template, i+1, blockEnd-1);
116.603 + for (int rcat1 = rcat; rcat1 <= MAX_RCAT; rcat1++)
116.604 + expandTemplate(block, false, rcat1, nrefs, nints, nlongs);
116.605 + VAR.makeBindings(topLevel, rcat, nrefs, nints, nlongs);
116.606 + i = blockEnd-1; continue;
116.607 + } else if (line.endsWith("@each-Tv@")) {
116.608 + int blockEnd = indexAfter(template, i, "@end-Tv@");
116.609 + String[] block = stringsIn(template, i+1, blockEnd-1);
116.610 + expandTemplate(block, false, rcat, nrefs, nints, nlongs);
116.611 + expandTemplateForPrims(block, false, rcat, nargs, nints+1, nlongs+1);
116.612 + VAR.makeBindings(topLevel, rcat, nrefs, nints, nlongs);
116.613 + i = blockEnd-1; continue;
116.614 + } else {
116.615 + System.out.println(VAR.transform(line));
116.616 + }
116.617 + }
116.618 + }
116.619 +}
116.620 +//}}} */
116.621 +//params=[0, 3, 4, 99, 99, 99]
116.622 + static class A0 extends Adapter {
116.623 + protected A0(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
116.624 + protected A0(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
116.625 + protected A0 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A0(e, i, c, t); }
116.626 + protected Object target() throws Throwable { return invoker.invokeExact(target); }
116.627 + protected Object targetA0() throws Throwable { return target(); }
116.628 + protected Object invoke_L() throws Throwable { return return_L(targetA0()); }
116.629 + protected int invoke_I() throws Throwable { return return_I(targetA0()); }
116.630 + protected long invoke_J() throws Throwable { return return_J(targetA0()); }
116.631 + protected float invoke_F() throws Throwable { return return_F(targetA0()); }
116.632 + protected double invoke_D() throws Throwable { return return_D(targetA0()); }
116.633 + }
116.634 + static class A1 extends Adapter {
116.635 + protected A1(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
116.636 + protected A1(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
116.637 + protected A1 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A1(e, i, c, t); }
116.638 + protected Object target(Object a0) throws Throwable { return invoker.invokeExact(target, a0); }
116.639 + protected Object targetA1(Object a0) throws Throwable { return target(a0); }
116.640 + protected Object targetA1(int a0) throws Throwable { return target(a0); }
116.641 + protected Object targetA1(long a0) throws Throwable { return target(a0); }
116.642 + protected Object invoke_L(Object a0) throws Throwable { return return_L(targetA1(a0)); }
116.643 + protected int invoke_I(Object a0) throws Throwable { return return_I(targetA1(a0)); }
116.644 + protected long invoke_J(Object a0) throws Throwable { return return_J(targetA1(a0)); }
116.645 + protected float invoke_F(Object a0) throws Throwable { return return_F(targetA1(a0)); }
116.646 + protected double invoke_D(Object a0) throws Throwable { return return_D(targetA1(a0)); }
116.647 + protected Object invoke_L(int a0) throws Throwable { return return_L(targetA1(a0)); }
116.648 + protected int invoke_I(int a0) throws Throwable { return return_I(targetA1(a0)); }
116.649 + protected long invoke_J(int a0) throws Throwable { return return_J(targetA1(a0)); }
116.650 + protected float invoke_F(int a0) throws Throwable { return return_F(targetA1(a0)); }
116.651 + protected double invoke_D(int a0) throws Throwable { return return_D(targetA1(a0)); }
116.652 + protected Object invoke_L(long a0) throws Throwable { return return_L(targetA1(a0)); }
116.653 + protected int invoke_I(long a0) throws Throwable { return return_I(targetA1(a0)); }
116.654 + protected long invoke_J(long a0) throws Throwable { return return_J(targetA1(a0)); }
116.655 + protected float invoke_F(long a0) throws Throwable { return return_F(targetA1(a0)); }
116.656 + protected double invoke_D(long a0) throws Throwable { return return_D(targetA1(a0)); }
116.657 + }
116.658 + static class A2 extends Adapter {
116.659 + protected A2(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
116.660 + protected A2(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
116.661 + protected A2 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A2(e, i, c, t); }
116.662 + protected Object target(Object a0, Object a1) throws Throwable { return invoker.invokeExact(target, a0, a1); }
116.663 + protected Object targetA2(Object a0, Object a1) throws Throwable { return target(a0, a1); }
116.664 + protected Object targetA2(Object a0, int a1) throws Throwable { return target(a0, a1); }
116.665 + protected Object targetA2(int a0, int a1) throws Throwable { return target(a0, a1); }
116.666 + protected Object targetA2(Object a0, long a1) throws Throwable { return target(a0, a1); }
116.667 + protected Object targetA2(long a0, long a1) throws Throwable { return target(a0, a1); }
116.668 + protected Object invoke_L(Object a0, Object a1) throws Throwable { return return_L(targetA2(a0, a1)); }
116.669 + protected int invoke_I(Object a0, Object a1) throws Throwable { return return_I(targetA2(a0, a1)); }
116.670 + protected long invoke_J(Object a0, Object a1) throws Throwable { return return_J(targetA2(a0, a1)); }
116.671 + protected float invoke_F(Object a0, Object a1) throws Throwable { return return_F(targetA2(a0, a1)); }
116.672 + protected double invoke_D(Object a0, Object a1) throws Throwable { return return_D(targetA2(a0, a1)); }
116.673 + protected Object invoke_L(Object a0, int a1) throws Throwable { return return_L(targetA2(a0, a1)); }
116.674 + protected int invoke_I(Object a0, int a1) throws Throwable { return return_I(targetA2(a0, a1)); }
116.675 + protected long invoke_J(Object a0, int a1) throws Throwable { return return_J(targetA2(a0, a1)); }
116.676 + protected float invoke_F(Object a0, int a1) throws Throwable { return return_F(targetA2(a0, a1)); }
116.677 + protected double invoke_D(Object a0, int a1) throws Throwable { return return_D(targetA2(a0, a1)); }
116.678 + protected Object invoke_L(int a0, int a1) throws Throwable { return return_L(targetA2(a0, a1)); }
116.679 + protected int invoke_I(int a0, int a1) throws Throwable { return return_I(targetA2(a0, a1)); }
116.680 + protected long invoke_J(int a0, int a1) throws Throwable { return return_J(targetA2(a0, a1)); }
116.681 + protected float invoke_F(int a0, int a1) throws Throwable { return return_F(targetA2(a0, a1)); }
116.682 + protected double invoke_D(int a0, int a1) throws Throwable { return return_D(targetA2(a0, a1)); }
116.683 + protected Object invoke_L(Object a0, long a1) throws Throwable { return return_L(targetA2(a0, a1)); }
116.684 + protected int invoke_I(Object a0, long a1) throws Throwable { return return_I(targetA2(a0, a1)); }
116.685 + protected long invoke_J(Object a0, long a1) throws Throwable { return return_J(targetA2(a0, a1)); }
116.686 + protected float invoke_F(Object a0, long a1) throws Throwable { return return_F(targetA2(a0, a1)); }
116.687 + protected double invoke_D(Object a0, long a1) throws Throwable { return return_D(targetA2(a0, a1)); }
116.688 + protected Object invoke_L(long a0, long a1) throws Throwable { return return_L(targetA2(a0, a1)); }
116.689 + protected int invoke_I(long a0, long a1) throws Throwable { return return_I(targetA2(a0, a1)); }
116.690 + protected long invoke_J(long a0, long a1) throws Throwable { return return_J(targetA2(a0, a1)); }
116.691 + protected float invoke_F(long a0, long a1) throws Throwable { return return_F(targetA2(a0, a1)); }
116.692 + protected double invoke_D(long a0, long a1) throws Throwable { return return_D(targetA2(a0, a1)); }
116.693 + }
116.694 + static class A3 extends Adapter {
116.695 + protected A3(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
116.696 + protected A3(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
116.697 + protected A3 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A3(e, i, c, t); }
116.698 + protected Object target(Object a0, Object a1, Object a2) throws Throwable { return invoker.invokeExact(target, a0, a1, a2); }
116.699 + protected Object targetA3(Object a0, Object a1, Object a2) throws Throwable { return target(a0, a1, a2); }
116.700 + protected Object targetA3(Object a0, Object a1, int a2) throws Throwable { return target(a0, a1, a2); }
116.701 + protected Object targetA3(Object a0, int a1, int a2) throws Throwable { return target(a0, a1, a2); }
116.702 + protected Object targetA3(int a0, int a1, int a2) throws Throwable { return target(a0, a1, a2); }
116.703 + protected Object targetA3(Object a0, Object a1, long a2) throws Throwable { return target(a0, a1, a2); }
116.704 + protected Object targetA3(Object a0, long a1, long a2) throws Throwable { return target(a0, a1, a2); }
116.705 + protected Object targetA3(long a0, long a1, long a2) throws Throwable { return target(a0, a1, a2); }
116.706 + protected Object invoke_L(Object a0, Object a1, Object a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
116.707 + protected int invoke_I(Object a0, Object a1, Object a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
116.708 + protected long invoke_J(Object a0, Object a1, Object a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
116.709 + protected float invoke_F(Object a0, Object a1, Object a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
116.710 + protected double invoke_D(Object a0, Object a1, Object a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
116.711 + protected Object invoke_L(Object a0, Object a1, int a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
116.712 + protected int invoke_I(Object a0, Object a1, int a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
116.713 + protected long invoke_J(Object a0, Object a1, int a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
116.714 + protected float invoke_F(Object a0, Object a1, int a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
116.715 + protected double invoke_D(Object a0, Object a1, int a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
116.716 + protected Object invoke_L(Object a0, int a1, int a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
116.717 + protected int invoke_I(Object a0, int a1, int a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
116.718 + protected long invoke_J(Object a0, int a1, int a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
116.719 + protected float invoke_F(Object a0, int a1, int a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
116.720 + protected double invoke_D(Object a0, int a1, int a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
116.721 + protected Object invoke_L(int a0, int a1, int a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
116.722 + protected int invoke_I(int a0, int a1, int a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
116.723 + protected long invoke_J(int a0, int a1, int a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
116.724 + protected float invoke_F(int a0, int a1, int a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
116.725 + protected double invoke_D(int a0, int a1, int a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
116.726 + protected Object invoke_L(Object a0, Object a1, long a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
116.727 + protected int invoke_I(Object a0, Object a1, long a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
116.728 + protected long invoke_J(Object a0, Object a1, long a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
116.729 + protected float invoke_F(Object a0, Object a1, long a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
116.730 + protected double invoke_D(Object a0, Object a1, long a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
116.731 + protected Object invoke_L(Object a0, long a1, long a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
116.732 + protected int invoke_I(Object a0, long a1, long a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
116.733 + protected long invoke_J(Object a0, long a1, long a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
116.734 + protected float invoke_F(Object a0, long a1, long a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
116.735 + protected double invoke_D(Object a0, long a1, long a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
116.736 + protected Object invoke_L(long a0, long a1, long a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
116.737 + protected int invoke_I(long a0, long a1, long a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
116.738 + protected long invoke_J(long a0, long a1, long a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
116.739 + protected float invoke_F(long a0, long a1, long a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
116.740 + protected double invoke_D(long a0, long a1, long a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
116.741 + }
116.742 +//params=[4, 4, 4, 99, 99, 99]
116.743 + static class A4 extends Adapter {
116.744 + protected A4(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
116.745 + protected A4(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
116.746 + protected A4 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A4(e, i, c, t); }
116.747 + protected Object target(Object a0, Object a1, Object a2, Object a3) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3); }
116.748 + protected Object targetA4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return target(a0, a1, a2, a3); }
116.749 + protected Object targetA4(Object a0, Object a1, Object a2, int a3) throws Throwable { return target(a0, a1, a2, a3); }
116.750 + protected Object targetA4(Object a0, Object a1, int a2, int a3) throws Throwable { return target(a0, a1, a2, a3); }
116.751 + protected Object targetA4(Object a0, int a1, int a2, int a3) throws Throwable { return target(a0, a1, a2, a3); }
116.752 + protected Object targetA4(int a0, int a1, int a2, int a3) throws Throwable { return target(a0, a1, a2, a3); }
116.753 + protected Object targetA4(Object a0, Object a1, Object a2, long a3) throws Throwable { return target(a0, a1, a2, a3); }
116.754 + protected Object targetA4(Object a0, Object a1, long a2, long a3) throws Throwable { return target(a0, a1, a2, a3); }
116.755 + protected Object targetA4(Object a0, long a1, long a2, long a3) throws Throwable { return target(a0, a1, a2, a3); }
116.756 + protected Object targetA4(long a0, long a1, long a2, long a3) throws Throwable { return target(a0, a1, a2, a3); }
116.757 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
116.758 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
116.759 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
116.760 + protected float invoke_F(Object a0, Object a1, Object a2, Object a3) throws Throwable { return return_F(targetA4(a0, a1, a2, a3)); }
116.761 + protected double invoke_D(Object a0, Object a1, Object a2, Object a3) throws Throwable { return return_D(targetA4(a0, a1, a2, a3)); }
116.762 + protected Object invoke_L(Object a0, Object a1, Object a2, int a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
116.763 + protected int invoke_I(Object a0, Object a1, Object a2, int a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
116.764 + protected long invoke_J(Object a0, Object a1, Object a2, int a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
116.765 + protected float invoke_F(Object a0, Object a1, Object a2, int a3) throws Throwable { return return_F(targetA4(a0, a1, a2, a3)); }
116.766 + protected double invoke_D(Object a0, Object a1, Object a2, int a3) throws Throwable { return return_D(targetA4(a0, a1, a2, a3)); }
116.767 + protected Object invoke_L(Object a0, Object a1, int a2, int a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
116.768 + protected int invoke_I(Object a0, Object a1, int a2, int a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
116.769 + protected long invoke_J(Object a0, Object a1, int a2, int a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
116.770 + protected float invoke_F(Object a0, Object a1, int a2, int a3) throws Throwable { return return_F(targetA4(a0, a1, a2, a3)); }
116.771 + protected double invoke_D(Object a0, Object a1, int a2, int a3) throws Throwable { return return_D(targetA4(a0, a1, a2, a3)); }
116.772 + protected Object invoke_L(Object a0, int a1, int a2, int a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
116.773 + protected int invoke_I(Object a0, int a1, int a2, int a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
116.774 + protected long invoke_J(Object a0, int a1, int a2, int a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
116.775 + protected float invoke_F(Object a0, int a1, int a2, int a3) throws Throwable { return return_F(targetA4(a0, a1, a2, a3)); }
116.776 + protected double invoke_D(Object a0, int a1, int a2, int a3) throws Throwable { return return_D(targetA4(a0, a1, a2, a3)); }
116.777 + protected Object invoke_L(int a0, int a1, int a2, int a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
116.778 + protected int invoke_I(int a0, int a1, int a2, int a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
116.779 + protected long invoke_J(int a0, int a1, int a2, int a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
116.780 + protected float invoke_F(int a0, int a1, int a2, int a3) throws Throwable { return return_F(targetA4(a0, a1, a2, a3)); }
116.781 + protected double invoke_D(int a0, int a1, int a2, int a3) throws Throwable { return return_D(targetA4(a0, a1, a2, a3)); }
116.782 + protected Object invoke_L(Object a0, Object a1, Object a2, long a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
116.783 + protected int invoke_I(Object a0, Object a1, Object a2, long a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
116.784 + protected long invoke_J(Object a0, Object a1, Object a2, long a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
116.785 + protected float invoke_F(Object a0, Object a1, Object a2, long a3) throws Throwable { return return_F(targetA4(a0, a1, a2, a3)); }
116.786 + protected double invoke_D(Object a0, Object a1, Object a2, long a3) throws Throwable { return return_D(targetA4(a0, a1, a2, a3)); }
116.787 + protected Object invoke_L(Object a0, Object a1, long a2, long a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
116.788 + protected int invoke_I(Object a0, Object a1, long a2, long a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
116.789 + protected long invoke_J(Object a0, Object a1, long a2, long a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
116.790 + protected float invoke_F(Object a0, Object a1, long a2, long a3) throws Throwable { return return_F(targetA4(a0, a1, a2, a3)); }
116.791 + protected double invoke_D(Object a0, Object a1, long a2, long a3) throws Throwable { return return_D(targetA4(a0, a1, a2, a3)); }
116.792 + protected Object invoke_L(Object a0, long a1, long a2, long a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
116.793 + protected int invoke_I(Object a0, long a1, long a2, long a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
116.794 + protected long invoke_J(Object a0, long a1, long a2, long a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
116.795 + protected float invoke_F(Object a0, long a1, long a2, long a3) throws Throwable { return return_F(targetA4(a0, a1, a2, a3)); }
116.796 + protected double invoke_D(Object a0, long a1, long a2, long a3) throws Throwable { return return_D(targetA4(a0, a1, a2, a3)); }
116.797 + protected Object invoke_L(long a0, long a1, long a2, long a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
116.798 + protected int invoke_I(long a0, long a1, long a2, long a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
116.799 + protected long invoke_J(long a0, long a1, long a2, long a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
116.800 + protected float invoke_F(long a0, long a1, long a2, long a3) throws Throwable { return return_F(targetA4(a0, a1, a2, a3)); }
116.801 + protected double invoke_D(long a0, long a1, long a2, long a3) throws Throwable { return return_D(targetA4(a0, a1, a2, a3)); }
116.802 + }
116.803 +//params=[5, 5, 2, 99, 99, 99]
116.804 + static class A5 extends Adapter {
116.805 + protected A5(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
116.806 + protected A5(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
116.807 + protected A5 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A5(e, i, c, t); }
116.808 + protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4); }
116.809 + protected Object targetA5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
116.810 + protected Object targetA5(Object a0, Object a1, Object a2, Object a3, int a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
116.811 + protected Object targetA5(Object a0, Object a1, Object a2, int a3, int a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
116.812 + protected Object targetA5(Object a0, Object a1, int a2, int a3, int a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
116.813 + protected Object targetA5(Object a0, int a1, int a2, int a3, int a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
116.814 + protected Object targetA5(int a0, int a1, int a2, int a3, int a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
116.815 + protected Object targetA5(Object a0, Object a1, Object a2, Object a3, long a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
116.816 + protected Object targetA5(Object a0, Object a1, Object a2, long a3, long a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
116.817 + protected Object targetA5(Object a0, Object a1, long a2, long a3, long a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
116.818 + protected Object targetA5(Object a0, long a1, long a2, long a3, long a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
116.819 + protected Object targetA5(long a0, long a1, long a2, long a3, long a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
116.820 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
116.821 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
116.822 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
116.823 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, int a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
116.824 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, int a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
116.825 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, int a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
116.826 + protected Object invoke_L(Object a0, Object a1, Object a2, int a3, int a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
116.827 + protected int invoke_I(Object a0, Object a1, Object a2, int a3, int a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
116.828 + protected long invoke_J(Object a0, Object a1, Object a2, int a3, int a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
116.829 + protected Object invoke_L(Object a0, Object a1, int a2, int a3, int a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
116.830 + protected int invoke_I(Object a0, Object a1, int a2, int a3, int a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
116.831 + protected long invoke_J(Object a0, Object a1, int a2, int a3, int a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
116.832 + protected Object invoke_L(Object a0, int a1, int a2, int a3, int a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
116.833 + protected int invoke_I(Object a0, int a1, int a2, int a3, int a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
116.834 + protected long invoke_J(Object a0, int a1, int a2, int a3, int a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
116.835 + protected Object invoke_L(int a0, int a1, int a2, int a3, int a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
116.836 + protected int invoke_I(int a0, int a1, int a2, int a3, int a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
116.837 + protected long invoke_J(int a0, int a1, int a2, int a3, int a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
116.838 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
116.839 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, long a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
116.840 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, long a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
116.841 + protected Object invoke_L(Object a0, Object a1, Object a2, long a3, long a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
116.842 + protected int invoke_I(Object a0, Object a1, Object a2, long a3, long a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
116.843 + protected long invoke_J(Object a0, Object a1, Object a2, long a3, long a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
116.844 + protected Object invoke_L(Object a0, Object a1, long a2, long a3, long a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
116.845 + protected int invoke_I(Object a0, Object a1, long a2, long a3, long a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
116.846 + protected long invoke_J(Object a0, Object a1, long a2, long a3, long a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
116.847 + protected Object invoke_L(Object a0, long a1, long a2, long a3, long a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
116.848 + protected int invoke_I(Object a0, long a1, long a2, long a3, long a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
116.849 + protected long invoke_J(Object a0, long a1, long a2, long a3, long a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
116.850 + protected Object invoke_L(long a0, long a1, long a2, long a3, long a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
116.851 + protected int invoke_I(long a0, long a1, long a2, long a3, long a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
116.852 + protected long invoke_J(long a0, long a1, long a2, long a3, long a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
116.853 + }
116.854 +//params=[6, 10, 2, 99, 0, 99]
116.855 + static class A6 extends Adapter {
116.856 + protected A6(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
116.857 + protected A6(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
116.858 + protected A6 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A6(e, i, c, t); }
116.859 + protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5); }
116.860 + protected Object targetA6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
116.861 + protected Object targetA6(Object a0, Object a1, Object a2, Object a3, Object a4, long a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
116.862 + protected Object targetA6(Object a0, Object a1, Object a2, Object a3, long a4, long a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
116.863 + protected Object targetA6(Object a0, Object a1, Object a2, long a3, long a4, long a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
116.864 + protected Object targetA6(Object a0, Object a1, long a2, long a3, long a4, long a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
116.865 + protected Object targetA6(Object a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
116.866 + protected Object targetA6(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
116.867 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
116.868 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
116.869 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
116.870 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, long a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
116.871 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, long a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
116.872 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, long a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
116.873 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long a4, long a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
116.874 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, long a4, long a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
116.875 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, long a4, long a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
116.876 + protected Object invoke_L(Object a0, Object a1, Object a2, long a3, long a4, long a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
116.877 + protected int invoke_I(Object a0, Object a1, Object a2, long a3, long a4, long a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
116.878 + protected long invoke_J(Object a0, Object a1, Object a2, long a3, long a4, long a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
116.879 + protected Object invoke_L(Object a0, Object a1, long a2, long a3, long a4, long a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
116.880 + protected int invoke_I(Object a0, Object a1, long a2, long a3, long a4, long a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
116.881 + protected long invoke_J(Object a0, Object a1, long a2, long a3, long a4, long a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
116.882 + protected Object invoke_L(Object a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
116.883 + protected int invoke_I(Object a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
116.884 + protected long invoke_J(Object a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
116.885 + protected Object invoke_L(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
116.886 + protected int invoke_I(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
116.887 + protected long invoke_J(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
116.888 + }
116.889 + static class A7 extends Adapter {
116.890 + protected A7(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
116.891 + protected A7(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
116.892 + protected A7 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A7(e, i, c, t); }
116.893 + protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6); }
116.894 + protected Object targetA7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
116.895 + protected Object targetA7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
116.896 + protected Object targetA7(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
116.897 + protected Object targetA7(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
116.898 + protected Object targetA7(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
116.899 + protected Object targetA7(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
116.900 + protected Object targetA7(Object a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
116.901 + protected Object targetA7(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
116.902 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.903 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.904 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.905 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.906 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.907 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.908 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.909 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.910 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.911 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.912 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.913 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.914 + protected Object invoke_L(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.915 + protected int invoke_I(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.916 + protected long invoke_J(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.917 + protected Object invoke_L(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.918 + protected int invoke_I(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.919 + protected long invoke_J(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.920 + protected Object invoke_L(Object a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.921 + protected int invoke_I(Object a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.922 + protected long invoke_J(Object a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.923 + protected Object invoke_L(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.924 + protected int invoke_I(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.925 + protected long invoke_J(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
116.926 + }
116.927 + static class A8 extends Adapter {
116.928 + protected A8(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
116.929 + protected A8(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
116.930 + protected A8 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A8(e, i, c, t); }
116.931 + protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7); }
116.932 + protected Object targetA8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
116.933 + protected Object targetA8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
116.934 + protected Object targetA8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
116.935 + protected Object targetA8(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
116.936 + protected Object targetA8(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
116.937 + protected Object targetA8(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
116.938 + protected Object targetA8(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
116.939 + protected Object targetA8(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
116.940 + protected Object targetA8(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
116.941 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.942 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.943 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.944 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.945 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.946 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.947 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.948 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.949 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.950 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.951 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.952 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.953 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.954 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.955 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.956 + protected Object invoke_L(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.957 + protected int invoke_I(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.958 + protected long invoke_J(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.959 + protected Object invoke_L(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.960 + protected int invoke_I(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.961 + protected long invoke_J(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.962 + protected Object invoke_L(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.963 + protected int invoke_I(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.964 + protected long invoke_J(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.965 + protected Object invoke_L(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.966 + protected int invoke_I(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.967 + protected long invoke_J(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
116.968 + }
116.969 + static class A9 extends Adapter {
116.970 + protected A9(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
116.971 + protected A9(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
116.972 + protected A9 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A9(e, i, c, t); }
116.973 + protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8); }
116.974 + protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
116.975 + protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
116.976 + protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
116.977 + protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
116.978 + protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
116.979 + protected Object targetA9(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
116.980 + protected Object targetA9(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
116.981 + protected Object targetA9(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
116.982 + protected Object targetA9(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
116.983 + protected Object targetA9(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
116.984 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.985 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.986 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.987 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.988 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.989 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.990 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.991 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.992 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.993 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.994 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.995 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.996 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.997 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.998 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.999 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.1000 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.1001 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.1002 + protected Object invoke_L(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.1003 + protected int invoke_I(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.1004 + protected long invoke_J(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.1005 + protected Object invoke_L(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.1006 + protected int invoke_I(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.1007 + protected long invoke_J(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.1008 + protected Object invoke_L(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.1009 + protected int invoke_I(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.1010 + protected long invoke_J(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.1011 + protected Object invoke_L(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.1012 + protected int invoke_I(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.1013 + protected long invoke_J(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
116.1014 + }
116.1015 + static class A10 extends Adapter {
116.1016 + protected A10(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
116.1017 + protected A10(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
116.1018 + protected A10 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A10(e, i, c, t); }
116.1019 + protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
116.1020 + protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
116.1021 + protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
116.1022 + protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
116.1023 + protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
116.1024 + protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
116.1025 + protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
116.1026 + protected Object targetA10(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
116.1027 + protected Object targetA10(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
116.1028 + protected Object targetA10(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
116.1029 + protected Object targetA10(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
116.1030 + protected Object targetA10(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
116.1031 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1032 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1033 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1034 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, long a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1035 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, long a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1036 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, long a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1037 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8, long a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1038 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8, long a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1039 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8, long a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1040 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8, long a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1041 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8, long a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1042 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8, long a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1043 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8, long a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1044 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8, long a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1045 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8, long a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1046 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1047 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1048 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1049 + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1050 + protected int invoke_I(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1051 + protected long invoke_J(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1052 + protected Object invoke_L(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1053 + protected int invoke_I(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1054 + protected long invoke_J(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1055 + protected Object invoke_L(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1056 + protected int invoke_I(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1057 + protected long invoke_J(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1058 + protected Object invoke_L(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1059 + protected int invoke_I(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1060 + protected long invoke_J(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1061 + protected Object invoke_L(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1062 + protected int invoke_I(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1063 + protected long invoke_J(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
116.1064 + }
116.1065 +}
117.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
117.2 +++ b/src/share/classes/java/lang/invoke/VolatileCallSite.java Tue Mar 29 20:19:55 2011 -0700
117.3 @@ -0,0 +1,109 @@
117.4 +/*
117.5 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
117.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
117.7 + *
117.8 + * This code is free software; you can redistribute it and/or modify it
117.9 + * under the terms of the GNU General Public License version 2 only, as
117.10 + * published by the Free Software Foundation. Oracle designates this
117.11 + * particular file as subject to the "Classpath" exception as provided
117.12 + * by Oracle in the LICENSE file that accompanied this code.
117.13 + *
117.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
117.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
117.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
117.17 + * version 2 for more details (a copy is included in the LICENSE file that
117.18 + * accompanied this code).
117.19 + *
117.20 + * You should have received a copy of the GNU General Public License version
117.21 + * 2 along with this work; if not, write to the Free Software Foundation,
117.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
117.23 + *
117.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
117.25 + * or visit www.oracle.com if you need additional information or have any
117.26 + * questions.
117.27 + */
117.28 +
117.29 +package java.lang.invoke;
117.30 +
117.31 +/**
117.32 + * A {@code VolatileCallSite} is a {@link CallSite} whose target acts like a volatile variable.
117.33 + * An {@code invokedynamic} instruction linked to a {@code VolatileCallSite} sees updates
117.34 + * to its call site target immediately, even if the update occurs in another thread.
117.35 + * There may be a performance penalty for such tight coupling between threads.
117.36 + * <p>
117.37 + * Unlike {@code MutableCallSite}, there is no
117.38 + * {@linkplain MutableCallSite#syncAll syncAll operation} on volatile
117.39 + * call sites, since every write to a volatile variable is implicitly
117.40 + * synchronized with reader threads.
117.41 + * <p>
117.42 + * In other respects, a {@code VolatileCallSite} is interchangeable
117.43 + * with {@code MutableCallSite}.
117.44 + * @see MutableCallSite
117.45 + * @author John Rose, JSR 292 EG
117.46 + */
117.47 +public class VolatileCallSite extends CallSite {
117.48 + /**
117.49 + * Creates a call site with a volatile binding to its target.
117.50 + * The initial target is set to a method handle
117.51 + * of the given type which will throw an {@code IllegalStateException} if called.
117.52 + * @param type the method type that this call site will have
117.53 + * @throws NullPointerException if the proposed type is null
117.54 + */
117.55 + public VolatileCallSite(MethodType type) {
117.56 + super(type);
117.57 + }
117.58 +
117.59 + /**
117.60 + * Creates a call site with a volatile binding to its target.
117.61 + * The target is set to the given value.
117.62 + * @param target the method handle that will be the initial target of the call site
117.63 + * @throws NullPointerException if the proposed target is null
117.64 + */
117.65 + public VolatileCallSite(MethodHandle target) {
117.66 + super(target);
117.67 + }
117.68 +
117.69 + /**
117.70 + * Returns the target method of the call site, which behaves
117.71 + * like a {@code volatile} field of the {@code VolatileCallSite}.
117.72 + * <p>
117.73 + * The interactions of {@code getTarget} with memory are the same
117.74 + * as of a read from a {@code volatile} field.
117.75 + * <p>
117.76 + * In particular, the current thread is required to issue a fresh
117.77 + * read of the target from memory, and must not fail to see
117.78 + * a recent update to the target by another thread.
117.79 + *
117.80 + * @return the linkage state of this call site, a method handle which can change over time
117.81 + * @see #setTarget
117.82 + */
117.83 + @Override public final MethodHandle getTarget() {
117.84 + return getTargetVolatile();
117.85 + }
117.86 +
117.87 + /**
117.88 + * Updates the target method of this call site, as a volatile variable.
117.89 + * The type of the new target must agree with the type of the old target.
117.90 + * <p>
117.91 + * The interactions with memory are the same as of a write to a volatile field.
117.92 + * In particular, any threads is guaranteed to see the updated target
117.93 + * the next time it calls {@code getTarget}.
117.94 + * @param newTarget the new target
117.95 + * @throws NullPointerException if the proposed new target is null
117.96 + * @throws WrongMethodTypeException if the proposed new target
117.97 + * has a method type that differs from the previous target
117.98 + * @see #getTarget
117.99 + */
117.100 + @Override public void setTarget(MethodHandle newTarget) {
117.101 + checkTargetChange(getTargetVolatile(), newTarget);
117.102 + setTargetVolatile(newTarget);
117.103 + }
117.104 +
117.105 + /**
117.106 + * {@inheritDoc}
117.107 + */
117.108 + @Override
117.109 + public final MethodHandle dynamicInvoker() {
117.110 + return makeDynamicInvoker();
117.111 + }
117.112 +}
118.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
118.2 +++ b/src/share/classes/java/lang/invoke/WrongMethodTypeException.java Tue Mar 29 20:19:55 2011 -0700
118.3 @@ -0,0 +1,62 @@
118.4 +/*
118.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
118.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
118.7 + *
118.8 + * This code is free software; you can redistribute it and/or modify it
118.9 + * under the terms of the GNU General Public License version 2 only, as
118.10 + * published by the Free Software Foundation. Oracle designates this
118.11 + * particular file as subject to the "Classpath" exception as provided
118.12 + * by Oracle in the LICENSE file that accompanied this code.
118.13 + *
118.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
118.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
118.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
118.17 + * version 2 for more details (a copy is included in the LICENSE file that
118.18 + * accompanied this code).
118.19 + *
118.20 + * You should have received a copy of the GNU General Public License version
118.21 + * 2 along with this work; if not, write to the Free Software Foundation,
118.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
118.23 + *
118.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
118.25 + * or visit www.oracle.com if you need additional information or have any
118.26 + * questions.
118.27 + */
118.28 +
118.29 +package java.lang.invoke;
118.30 +
118.31 +/**
118.32 + * Thrown to indicate that code has attempted to call a method handle
118.33 + * via the wrong method type. As with the bytecode representation of
118.34 + * normal Java method calls, method handle calls are strongly typed
118.35 + * to a specific type descriptor associated with a call site.
118.36 + * <p>
118.37 + * This exception may also be thrown when two method handles are
118.38 + * composed, and the system detects that their types cannot be
118.39 + * matched up correctly. This amounts to an early evaluation
118.40 + * of the type mismatch, at method handle construction time,
118.41 + * instead of when the mismatched method handle is called.
118.42 + *
118.43 + * @author John Rose, JSR 292 EG
118.44 + * @since 1.7
118.45 + */
118.46 +public class WrongMethodTypeException extends RuntimeException {
118.47 + private static final long serialVersionUID = 292L;
118.48 +
118.49 + /**
118.50 + * Constructs a {@code WrongMethodTypeException} with no detail message.
118.51 + */
118.52 + public WrongMethodTypeException() {
118.53 + super();
118.54 + }
118.55 +
118.56 + /**
118.57 + * Constructs a {@code WrongMethodTypeException} with the specified
118.58 + * detail message.
118.59 + *
118.60 + * @param s the detail message.
118.61 + */
118.62 + public WrongMethodTypeException(String s) {
118.63 + super(s);
118.64 + }
118.65 +}
119.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
119.2 +++ b/src/share/classes/java/lang/invoke/package-info.java Tue Mar 29 20:19:55 2011 -0700
119.3 @@ -0,0 +1,466 @@
119.4 +/*
119.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
119.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
119.7 + *
119.8 + * This code is free software; you can redistribute it and/or modify it
119.9 + * under the terms of the GNU General Public License version 2 only, as
119.10 + * published by the Free Software Foundation. Oracle designates this
119.11 + * particular file as subject to the "Classpath" exception as provided
119.12 + * by Oracle in the LICENSE file that accompanied this code.
119.13 + *
119.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
119.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
119.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
119.17 + * version 2 for more details (a copy is included in the LICENSE file that
119.18 + * accompanied this code).
119.19 + *
119.20 + * You should have received a copy of the GNU General Public License version
119.21 + * 2 along with this work; if not, write to the Free Software Foundation,
119.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
119.23 + *
119.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
119.25 + * or visit www.oracle.com if you need additional information or have any
119.26 + * questions.
119.27 + */
119.28 +
119.29 +/**
119.30 + * The {@code java.lang.invoke} package contains dynamic language support provided directly by
119.31 + * the Java core class libraries and virtual machine.
119.32 + *
119.33 + * <p>
119.34 + * Certain types in this package have special relations to dynamic
119.35 + * language support in the virtual machine:
119.36 + * <ul>
119.37 + * <li>The class {@link java.lang.invoke.MethodHandle MethodHandle} contains
119.38 + * <a href="MethodHandle.html#sigpoly">signature polymorphic methods</a>
119.39 + * which can be linked regardless of their type descriptor.
119.40 + * Normally, method linkage requires exact matching of type descriptors.
119.41 + * </li>
119.42 + *
119.43 + * <li>The JVM bytecode format supports immediate constants of
119.44 + * the classes {@link java.lang.invoke.MethodHandle MethodHandle} and {@link java.lang.invoke.MethodType MethodType}.
119.45 + * </li>
119.46 + * </ul>
119.47 + *
119.48 + * <h2><a name="jvm_mods"></a>Corresponding JVM bytecode format changes</h2>
119.49 + * <em>The following low-level information is presented here as a preview of
119.50 + * changes being made to the Java Virtual Machine specification for JSR 292.
119.51 + * This information will be incorporated in a future version of the JVM specification.</em>
119.52 + *
119.53 + * <h3><a name="indyinsn"></a>{@code invokedynamic} instruction format</h3>
119.54 + * In bytecode, an {@code invokedynamic} instruction is formatted as five bytes.
119.55 + * The first byte is the opcode 186 (hexadecimal {@code BA}).
119.56 + * The next two bytes are a constant pool index (in the same format as for the other {@code invoke} instructions).
119.57 + * The final two bytes are reserved for future use and required to be zero.
119.58 + * The constant pool reference of an {@code invokedynamic} instruction is to a entry
119.59 + * with tag {@code CONSTANT_InvokeDynamic} (decimal 18). See below for its format.
119.60 + * The entry specifies the following information:
119.61 + * <ul>
119.62 + * <li>a bootstrap method (a {@link java.lang.invoke.MethodHandle MethodHandle} constant)</li>
119.63 + * <li>the dynamic invocation name (a UTF8 string)</li>
119.64 + * <li>the argument and return types of the call (encoded as a type descriptor in a UTF8 string)</li>
119.65 + * <li>optionally, a sequence of additional <em>static arguments</em> to the bootstrap method ({@code ldc}-type constants)</li>
119.66 + * </ul>
119.67 + * <p>
119.68 + * Each instance of an {@code invokedynamic} instruction is called a <em>dynamic call site</em>.
119.69 + * Multiple instances of an {@code invokedynamic} instruction can share a single
119.70 + * {@code CONSTANT_InvokeDynamic} entry.
119.71 + * In any case, distinct call sites always have distinct linkage state.
119.72 + * <p>
119.73 + * A dynamic call site is originally in an unlinked state. In this state, there is
119.74 + * no target method for the call site to invoke.
119.75 + * A dynamic call site is linked by means of a bootstrap method,
119.76 + * as <a href="#bsm">described below</a>.
119.77 + *
119.78 + * <h3><a name="indycon"></a>constant pool entries for {@code invokedynamic} instructions</h3>
119.79 + * If a constant pool entry has the tag {@code CONSTANT_InvokeDynamic} (decimal 18),
119.80 + * it must contain exactly four more bytes after the tag.
119.81 + * These bytes are interpreted as two 16-bit indexes, in the usual {@code u2} format.
119.82 + * The first pair of bytes after the tag must be an index into a side table called the
119.83 + * <em>bootstrap method table</em>, which is stored in the {@code BootstrapMethods}
119.84 + * attribute as <a href="#bsmattr">described below</a>.
119.85 + * The second pair of bytes must be an index to a {@code CONSTANT_NameAndType}.
119.86 + * <p>
119.87 + * The first index specifies a bootstrap method used by the associated dynamic call sites.
119.88 + * The second index specifies the method name, argument types, and return type of the dynamic call site.
119.89 + * The structure of such an entry is therefore analogous to a {@code CONSTANT_Methodref},
119.90 + * except that the bootstrap method specifier reference replaces
119.91 + * the {@code CONSTANT_Class} reference of a {@code CONSTANT_Methodref} entry.
119.92 + *
119.93 + * <h3><a name="mtcon"></a>constant pool entries for {@linkplain java.lang.invoke.MethodType method types}</h3>
119.94 + * If a constant pool entry has the tag {@code CONSTANT_MethodType} (decimal 16),
119.95 + * it must contain exactly two more bytes, which must be an index to a {@code CONSTANT_Utf8}
119.96 + * entry which represents a method type descriptor.
119.97 + * <p>
119.98 + * The JVM will ensure that on first
119.99 + * execution of an {@code ldc} instruction for this entry, a {@link java.lang.invoke.MethodType MethodType}
119.100 + * will be created which represents the type descriptor.
119.101 + * Any classes mentioned in the {@code MethodType} will be loaded if necessary,
119.102 + * but not initialized.
119.103 + * Access checking and error reporting is performed exactly as it is for
119.104 + * references by {@code ldc} instructions to {@code CONSTANT_Class} constants.
119.105 + *
119.106 + * <h3><a name="mhcon"></a>constant pool entries for {@linkplain java.lang.invoke.MethodHandle method handles}</h3>
119.107 + * If a constant pool entry has the tag {@code CONSTANT_MethodHandle} (decimal 15),
119.108 + * it must contain exactly three more bytes. The first byte after the tag is a subtag
119.109 + * value which must be in the range 1 through 9, and the last two must be an index to a
119.110 + * {@code CONSTANT_Fieldref}, {@code CONSTANT_Methodref}, or
119.111 + * {@code CONSTANT_InterfaceMethodref} entry which represents a field or method
119.112 + * for which a method handle is to be created.
119.113 + * Furthermore, the subtag value and the type of the constant index value
119.114 + * must agree according to the table below.
119.115 + * <p>
119.116 + * The JVM will ensure that on first execution of an {@code ldc} instruction
119.117 + * for this entry, a {@link java.lang.invoke.MethodHandle MethodHandle} will be created which represents
119.118 + * the field or method reference, according to the specific mode implied by the subtag.
119.119 + * <p>
119.120 + * As with {@code CONSTANT_Class} and {@code CONSTANT_MethodType} constants,
119.121 + * the {@code Class} or {@code MethodType} object which reifies the field or method's
119.122 + * type is created. Any classes mentioned in this reification will be loaded if necessary,
119.123 + * but not initialized, and access checking and error reporting performed as usual.
119.124 + * <p>
119.125 + * Unlike the reflective {@code Lookup} API, there are no security manager calls made
119.126 + * when these constants are resolved.
119.127 + * <p>
119.128 + * The method handle itself will have a type and behavior determined by the subtag as follows:
119.129 + * <code>
119.130 + * <table border=1 cellpadding=5 summary="CONSTANT_MethodHandle subtypes">
119.131 + * <tr><th>N</th><th>subtag name</th><th>member</th><th>MH type</th><th>bytecode behavior</th><th>lookup expression</th></tr>
119.132 + * <tr><td>1</td><td>REF_getField</td><td>C.f:T</td><td>(C)T</td><td>getfield C.f:T</td>
119.133 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findGetter findGetter(C.class,"f",T.class)}</td></tr>
119.134 + * <tr><td>2</td><td>REF_getStatic</td><td>C.f:T</td><td>( )T</td><td>getstatic C.f:T</td>
119.135 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findStaticGetter findStaticGetter(C.class,"f",T.class)}</td></tr>
119.136 + * <tr><td>3</td><td>REF_putField</td><td>C.f:T</td><td>(C,T)void</td><td>putfield C.f:T</td>
119.137 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findSetter findSetter(C.class,"f",T.class)}</td></tr>
119.138 + * <tr><td>4</td><td>REF_putStatic</td><td>C.f:T</td><td>(T)void</td><td>putstatic C.f:T</td>
119.139 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findStaticSetter findStaticSetter(C.class,"f",T.class)}</td></tr>
119.140 + * <tr><td>5</td><td>REF_invokeVirtual</td><td>C.m(A*)T</td><td>(C,A*)T</td><td>invokevirtual C.m(A*)T</td>
119.141 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findVirtual findVirtual(C.class,"m",MT)}</td></tr>
119.142 + * <tr><td>6</td><td>REF_invokeStatic</td><td>C.m(A*)T</td><td>(C,A*)T</td><td>invokestatic C.m(A*)T</td>
119.143 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findStatic findStatic(C.class,"m",MT)}</td></tr>
119.144 + * <tr><td>7</td><td>REF_invokeSpecial</td><td>C.m(A*)T</td><td>(C,A*)T</td><td>invokespecial C.m(A*)T</td>
119.145 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findSpecial findSpecial(C.class,"m",MT,this.class)}</td></tr>
119.146 + * <tr><td>8</td><td>REF_newInvokeSpecial</td><td>C.<init>(A*)void</td><td>(A*)C</td><td>new C; dup; invokespecial C.<init>(A*)void</td>
119.147 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findConstructor findConstructor(C.class,MT)}</td></tr>
119.148 + * <tr><td>9</td><td>REF_invokeInterface</td><td>C.m(A*)T</td><td>(C,A*)T</td><td>invokeinterface C.m(A*)T</td>
119.149 + * <td>{@linkplain java.lang.invoke.MethodHandles.Lookup#findVirtual findVirtual(C.class,"m",MT)}</td></tr>
119.150 + * </table>
119.151 + * </code>
119.152 + * Here, the type {@code C} is taken from the {@code CONSTANT_Class} reference associated
119.153 + * with the {@code CONSTANT_NameAndType} descriptor.
119.154 + * The field name {@code f} or method name {@code m} is taken from the {@code CONSTANT_NameAndType}
119.155 + * as is the result type {@code T} and (in the case of a method or constructor) the argument type sequence
119.156 + * {@code A*}.
119.157 + * <p>
119.158 + * Each method handle constant has an equivalent instruction sequence called its <em>bytecode behavior</em>.
119.159 + * In general, creating a method handle constant can be done in exactly the same circumstances that
119.160 + * the JVM would successfully resolve the symbolic references in the bytecode behavior.
119.161 + * Also, the type of a method handle constant is such that a valid {@code invokeExact} call
119.162 + * on the method handle has exactly the same JVM stack effects as the <em>bytecode behavior</em>.
119.163 + * Finally, calling a method handle constant on a valid set of arguments has exactly the same effect
119.164 + * and returns the same result (if any) as the corresponding <em>bytecode behavior</em>.
119.165 + * <p>
119.166 + * Each method handle constant also has an equivalent reflective <em>lookup expression</em>,
119.167 + * which is a query to a method in {@link java.lang.invoke.MethodHandles.Lookup}.
119.168 + * In the example lookup method expression given in the table above, the name {@code MT}
119.169 + * stands for a {@code MethodType} built from {@code T} and the sequence of argument types {@code A*}.
119.170 + * (Note that the type {@code C} is not prepended to the query type {@code MT} even if the member is non-static.)
119.171 + * In the case of {@code findSpecial}, the name {@code this.class} refers to the class containing
119.172 + * the bytecodes.
119.173 + * <p>
119.174 + * The special name {@code <clinit>} is not allowed.
119.175 + * The special name {@code <init>} is not allowed except for subtag 8 as shown.
119.176 + * <p>
119.177 + * The JVM verifier and linker apply the same access checks and restrictions for these references as for the hypothetical
119.178 + * bytecode instructions specified in the last column of the table.
119.179 + * A method handle constant will successfully resolve to a method handle if the symbolic references
119.180 + * of the corresponding bytecode instruction(s) would also resolve successfully.
119.181 + * Otherwise, an attempt to resolve the constant will throw equivalent linkage errors.
119.182 + * In particular, method handles to
119.183 + * private and protected members can be created in exactly those classes for which the corresponding
119.184 + * normal accesses are legal.
119.185 + * <p>
119.186 + * A constant may refer to a method or constructor with the {@code varargs}
119.187 + * bit (hexadecimal {@code 0x0080}) set in its modifier bitmask.
119.188 + * The method handle constant produced for such a method behaves as if
119.189 + * it were created by {@link java.lang.invoke.MethodHandle#asVarargsCollector asVarargsCollector}.
119.190 + * In other words, the constant method handle will exhibit variable arity,
119.191 + * when invoked via {@code invokeGeneric}.
119.192 + * On the other hand, its behavior with respect to {@code invokeExact} will be the same
119.193 + * as if the {@code varargs} bit were not set.
119.194 + * <p>
119.195 + * Although the {@code CONSTANT_MethodHandle} and {@code CONSTANT_MethodType} constant types
119.196 + * resolve class names, they do not force class initialization.
119.197 + * Method handle constants for subtags {@code REF_getStatic}, {@code REF_putStatic}, and {@code REF_invokeStatic}
119.198 + * may force class initialization on their first invocation, just like the corresponding bytecodes.
119.199 + * <p>
119.200 + * The rules of section 5.4.3 of the
119.201 + * <a href="http://java.sun.com/docs/books/jvms/second_edition/html/ConstantPool.doc.html#73492">JVM Specification</a>
119.202 + * apply to the resolution of {@code CONSTANT_MethodType}, {@code CONSTANT_MethodHandle},
119.203 + * and {@code CONSTANT_InvokeDynamic} constants,
119.204 + * by the execution of {@code invokedynamic} and {@code ldc} instructions.
119.205 + * (Roughly speaking, this means that every use of a constant pool entry
119.206 + * must lead to the same outcome.
119.207 + * If the resolution succeeds, the same object reference is produced
119.208 + * by every subsequent execution of the same instruction.
119.209 + * If the resolution of the constant causes an error to occur,
119.210 + * the same error will be re-thrown on every subsequent attempt
119.211 + * to use this particular constant.)
119.212 + * <p>
119.213 + * Constants created by the resolution of these constant pool types are not necessarily
119.214 + * interned. Except for {@code CONSTANT_Class} and {@code CONSTANT_String} entries,
119.215 + * two distinct constant pool entries might not resolve to the same reference
119.216 + * even if they contain the same symbolic reference.
119.217 + *
119.218 + * <h2><a name="bsm"></a>Bootstrap Methods</h2>
119.219 + * Before the JVM can execute a dynamic call site (an {@code invokedynamic} instruction),
119.220 + * the call site must first be <em>linked</em>.
119.221 + * Linking is accomplished by calling a <em>bootstrap method</em>
119.222 + * which is given the static information content of the call site,
119.223 + * and which must produce a {@link java.lang.invoke.MethodHandle method handle}
119.224 + * that gives the behavior of the call site.
119.225 + * <p>
119.226 + * Each {@code invokedynamic} instruction statically specifies its own
119.227 + * bootstrap method as a constant pool reference.
119.228 + * The constant pool reference also specifies the call site's name and type descriptor,
119.229 + * just like {@code invokevirtual} and the other invoke instructions.
119.230 + * <p>
119.231 + * Linking starts with resolving the constant pool entry for the
119.232 + * bootstrap method, and resolving a {@link java.lang.invoke.MethodType MethodType} object for
119.233 + * the type descriptor of the dynamic call site.
119.234 + * This resolution process may trigger class loading.
119.235 + * It may therefore throw an error if a class fails to load.
119.236 + * This error becomes the abnormal termination of the dynamic
119.237 + * call site execution.
119.238 + * Linkage does not trigger class initialization.
119.239 + * <p>
119.240 + * Next, the bootstrap method call is started, with at least four values being stacked:
119.241 + * <ul>
119.242 + * <li>a {@code MethodHandle}, the resolved bootstrap method itself </li>
119.243 + * <li>a {@code MethodHandles.Lookup}, a lookup object on the <em>caller class</em> in which dynamic call site occurs </li>
119.244 + * <li>a {@code String}, the method name mentioned in the call site </li>
119.245 + * <li>a {@code MethodType}, the resolved type descriptor of the call </li>
119.246 + * <li>optionally, one or more <a href="#args">additional static arguments</a> </li>
119.247 + * </ul>
119.248 + * The method handle is then applied to the other values as if by
119.249 + * {@link java.lang.invoke.MethodHandle#invokeGeneric invokeGeneric}.
119.250 + * The returned result must be a {@link java.lang.invoke.CallSite CallSite} (or a subclass).
119.251 + * The type of the call site's target must be exactly equal to the type
119.252 + * derived from the dynamic call site's type descriptor and passed to
119.253 + * the bootstrap method.
119.254 + * The call site then becomes permanently linked to the dynamic call site.
119.255 + * <p>
119.256 + * As long as each bootstrap method can be correctly invoked
119.257 + * by <code>invokeGeneric</code>, its detailed type is arbitrary.
119.258 + * For example, the first argument could be {@code Object}
119.259 + * instead of {@code MethodHandles.Lookup}, and the return type
119.260 + * could also be {@code Object} instead of {@code CallSite}.
119.261 + * (Note that the types and number of the stacked arguments limit
119.262 + * the legal kinds of bootstrap methods to appropriately typed
119.263 + * static methods and constructors of {@code CallSite} subclasses.)
119.264 + * <p>
119.265 + * After resolution, the linkage process may fail in a variety of ways.
119.266 + * All failures are reported by a {@link java.lang.BootstrapMethodError BootstrapMethodError},
119.267 + * which is thrown as the abnormal termination of the dynamic call
119.268 + * site execution.
119.269 + * The following circumstances will cause this:
119.270 + * <ul>
119.271 + * <li>the index to the bootstrap method specifier is out of range </li>
119.272 + * <li>the bootstrap method cannot be resolved </li>
119.273 + * <li>the {@code MethodType} to pass to the bootstrap method cannot be resolved </li>
119.274 + * <li>a static argument to the bootstrap method cannot be resolved
119.275 + * (i.e., a {@code CONSTANT_Class}, {@code CONSTANT_MethodType},
119.276 + * or {@code CONSTANT_MethodHandle} argument cannot be linked) </li>
119.277 + * <li>the bootstrap method has the wrong arity,
119.278 + * causing {@code invokeGeneric} to throw {@code WrongMethodTypeException} </li>
119.279 + * <li>the bootstrap method has a wrong argument or return type </li>
119.280 + * <li>the bootstrap method invocation completes abnormally </li>
119.281 + * <li>the result from the bootstrap invocation is not a reference to
119.282 + * an object of type {@link java.lang.invoke.CallSite CallSite} </li>
119.283 + * <li>the target of the {@code CallSite} does not have a target of
119.284 + * the expected {@code MethodType} </li>
119.285 + * </ul>
119.286 + *
119.287 + * <h3><a name="linktime"></a>timing of linkage</h3>
119.288 + * A dynamic call site is linked just before its first execution.
119.289 + * The bootstrap method call implementing the linkage occurs within
119.290 + * a thread that is attempting a first execution.
119.291 + * <p>
119.292 + * If there are several such threads, the bootstrap method may be
119.293 + * invoked in several threads concurrently.
119.294 + * Therefore, bootstrap methods which access global application
119.295 + * data must take the usual precautions against race conditions.
119.296 + * In any case, every {@code invokedynamic} instruction is either
119.297 + * unlinked or linked to a unique {@code CallSite} object.
119.298 + * <p>
119.299 + * In an application which requires dynamic call sites with individually
119.300 + * mutable behaviors, their bootstrap methods should produce distinct
119.301 + * {@link java.lang.invoke.CallSite CallSite} objects, one for each linkage request.
119.302 + * Alternatively, an application can link a single {@code CallSite} object
119.303 + * to several {@code invokedynamic} instructions, in which case
119.304 + * a change to the target method will become visible at each of
119.305 + * the instructions.
119.306 + * <p>
119.307 + * If several threads simultaneously execute a bootstrap method for a single dynamic
119.308 + * call site, the JVM must choose one {@code CallSite} object and install it visibly to
119.309 + * all threads. Any other bootstrap method calls are allowed to complete, but their
119.310 + * results are ignored, and their dynamic call site invocations proceed with the originally
119.311 + * chosen target object.
119.312 + *
119.313 + * <p style="font-size:smaller;">
119.314 + * <em>Discussion:</em>
119.315 + * These rules do not enable the JVM to duplicate dynamic call sites,
119.316 + * or to issue “causeless” bootstrap method calls.
119.317 + * Every dynamic call site transitions at most once from unlinked to linked,
119.318 + * just before its first invocation.
119.319 + * There is no way to undo the effect of a completed bootstrap method call.
119.320 + *
119.321 + * <h3><a name="bsmattr">the {@code BootstrapMethods} attribute </h3>
119.322 + * Each {@code CONSTANT_InvokeDynamic} entry contains an index which references
119.323 + * a bootstrap method specifier; all such specifiers are contained in a separate array.
119.324 + * This array is defined by a class attribute named {@code BootstrapMethods}.
119.325 + * The body of this attribute consists of a sequence of byte pairs, all interpreted as
119.326 + * as 16-bit counts or constant pool indexes, in the {@code u2} format.
119.327 + * The attribute body starts with a count of bootstrap method specifiers,
119.328 + * which is immediately followed by the sequence of specifiers.
119.329 + * <p>
119.330 + * Each bootstrap method specifier contains an index to a
119.331 + * {@code CONSTANT_MethodHandle} constant, which is the bootstrap
119.332 + * method itself.
119.333 + * This is followed by a count, and then a sequence (perhaps empty) of
119.334 + * indexes to <a href="#args">additional static arguments</a>
119.335 + * for the bootstrap method.
119.336 + * <p>
119.337 + * During class loading, the verifier must check the structure of the
119.338 + * {@code BootstrapMethods} attribute. In particular, each constant
119.339 + * pool index must be of the correct type. A bootstrap method index
119.340 + * must refer to a {@code CONSTANT_MethodHandle} (tag 15).
119.341 + * Every other index must refer to a valid operand of an
119.342 + * {@code ldc_w} or {@code ldc2_w} instruction (tag 3..8 or 15..16).
119.343 + *
119.344 + * <h3><a name="args">static arguments to the bootstrap method</h3>
119.345 + * An {@code invokedynamic} instruction specifies at least three arguments
119.346 + * to pass to its bootstrap method:
119.347 + * The caller class (expressed as a {@link java.lang.invoke.MethodHandles.Lookup Lookup object},
119.348 + * the name (extracted from the {@code CONSTANT_NameAndType} entry),
119.349 + * and the type (also extracted from the {@code CONSTANT_NameAndType} entry).
119.350 + * The {@code invokedynamic} instruction may specify additional metadata values
119.351 + * to pass to its bootstrap method.
119.352 + * Collectively, these values are called <em>static arguments</em> to the
119.353 + * {@code invokedynamic} instruction, because they are used once at link
119.354 + * time to determine the instruction's behavior on subsequent sets of
119.355 + * <em>dynamic arguments</em>.
119.356 + * <p>
119.357 + * Static arguments are used to communicate application-specific meta-data
119.358 + * to the bootstrap method.
119.359 + * Drawn from the constant pool, they may include references to classes, method handles,
119.360 + * strings, or numeric data that may be relevant to the task of linking that particular call site.
119.361 + * <p>
119.362 + * Static arguments are specified constant pool indexes stored in the {@code BootstrapMethods} attribute.
119.363 + * Before the bootstrap method is invoked, each index is used to compute an {@code Object}
119.364 + * reference to the indexed value in the constant pool.
119.365 + * The valid constant pool entries are listed in this table:
119.366 + * <code>
119.367 + * <table border=1 cellpadding=5 summary="Static argument types">
119.368 + * <tr><th>entry type</th><th>argument type</th><th>argument value</th></tr>
119.369 + * <tr><td>CONSTANT_String</td><td><code>java.lang.String</code></td><td>the indexed string literal</td></tr>
119.370 + * <tr><td>CONSTANT_Class</td><td><code>java.lang.Class</code></td><td>the indexed class, resolved</td></tr>
119.371 + * <tr><td>CONSTANT_Integer</td><td><code>java.lang.Integer</code></td><td>the indexed int value</td></tr>
119.372 + * <tr><td>CONSTANT_Long</td><td><code>java.lang.Long</code></td><td>the indexed long value</td></tr>
119.373 + * <tr><td>CONSTANT_Float</td><td><code>java.lang.Float</code></td><td>the indexed float value</td></tr>
119.374 + * <tr><td>CONSTANT_Double</td><td><code>java.lang.Double</code></td><td>the indexed double value</td></tr>
119.375 + * <tr><td>CONSTANT_MethodHandle</td><td><code>java.lang.invoke.MethodHandle</code></td><td>the indexed method handle constant</td></tr>
119.376 + * <tr><td>CONSTANT_MethodType</td><td><code>java.lang.invoke.MethodType</code></td><td>the indexed method type constant</td></tr>
119.377 + * </table>
119.378 + * </code>
119.379 + * <p>
119.380 + * If a given {@code invokedynamic} instruction specifies no static arguments,
119.381 + * the instruction's bootstrap method will be invoked on three arguments,
119.382 + * conveying the instruction's caller class, name, and method type.
119.383 + * If the {@code invokedynamic} instruction specifies one or more static arguments,
119.384 + * those values will be passed as additional arguments to the method handle.
119.385 + * (Note that because there is a limit of 255 arguments to any method,
119.386 + * at most 252 extra arguments can be supplied.)
119.387 + * The bootstrap method will be invoked as if by either {@code invokeGeneric}
119.388 + * or {@code invokeWithArguments}. (There is no way to tell the difference.)
119.389 + * <p>
119.390 + * The normal argument conversion rules for {@code invokeGeneric} apply to all stacked arguments.
119.391 + * For example, if a pushed value is a primitive type, it may be converted to a reference by boxing conversion.
119.392 + * If the bootstrap method is a variable arity method (its modifier bit {@code 0x0080} is set),
119.393 + * then some or all of the arguments specified here may be collected into a trailing array parameter.
119.394 + * (This is not a special rule, but rather a useful consequence of the interaction
119.395 + * between {@code CONSTANT_MethodHandle} constants, the modifier bit for variable arity methods,
119.396 + * and the {@code java.lang.invoke.MethodHandle#asVarargsCollector asVarargsCollector} transformation.)
119.397 + * <p>
119.398 + * Given these rules, here are examples of legal bootstrap method declarations,
119.399 + * given various numbers {@code N} of extra arguments.
119.400 + * The first rows (marked {@code *}) will work for any number of extra arguments.
119.401 + * <code>
119.402 + * <table border=1 cellpadding=5 summary="Static argument types">
119.403 + * <tr><th>N</th><th>sample bootstrap method</th></tr>
119.404 + * <tr><td>*</td><td><code>CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args)</code></td></tr>
119.405 + * <tr><td>*</td><td><code>CallSite bootstrap(Object... args)</code></td></tr>
119.406 + * <tr><td>*</td><td><code>CallSite bootstrap(Object caller, Object... nameAndTypeWithArgs)</code></td></tr>
119.407 + * <tr><td>0</td><td><code>CallSite bootstrap(Lookup caller, String name, MethodType type)</code></td></tr>
119.408 + * <tr><td>0</td><td><code>CallSite bootstrap(Lookup caller, Object... nameAndType)</code></td></tr>
119.409 + * <tr><td>1</td><td><code>CallSite bootstrap(Lookup caller, String name, MethodType type, Object arg)</code></td></tr>
119.410 + * <tr><td>2</td><td><code>CallSite bootstrap(Lookup caller, String name, MethodType type, Object... args)</code></td></tr>
119.411 + * <tr><td>2</td><td><code>CallSite bootstrap(Lookup caller, String name, MethodType type, String... args)</code></td></tr>
119.412 + * <tr><td>2</td><td><code>CallSite bootstrap(Lookup caller, String name, MethodType type, String x, int y)</code></td></tr>
119.413 + * </table>
119.414 + * </code>
119.415 + * The last example assumes that the extra arguments are of type
119.416 + * {@code CONSTANT_String} and {@code CONSTANT_Integer}, respectively.
119.417 + * The second-to-last example assumes that all extra arguments are of type
119.418 + * {@code CONSTANT_String}.
119.419 + * The other examples work with all types of extra arguments.
119.420 + * <p>
119.421 + * As noted above, the actual method type of the bootstrap method can vary.
119.422 + * For example, the fourth argument could be {@code MethodHandle},
119.423 + * if that is the type of the corresponding constant in
119.424 + * the {@code CONSTANT_InvokeDynamic} entry.
119.425 + * In that case, the {@code invokeGeneric} call will pass the extra method handle
119.426 + * constant as an {@code Object}, but the type matching machinery of {@code invokeGeneric}
119.427 + * will cast the reference back to {@code MethodHandle} before invoking the bootstrap method.
119.428 + * (If a string constant were passed instead, by badly generated code, that cast would then fail,
119.429 + * resulting in a {@code BootstrapMethodError}.)
119.430 + * <p>
119.431 + * Extra bootstrap method arguments are intended to allow language implementors
119.432 + * to safely and compactly encode metadata.
119.433 + * In principle, the name and extra arguments are redundant,
119.434 + * since each call site could be given its own unique bootstrap method.
119.435 + * Such a practice is likely to produce large class files and constant pools.
119.436 + *
119.437 + * <h2><a name="structs"></a>Structure Summary</h2>
119.438 + * <blockquote><pre>// summary of constant and attribute structures
119.439 +struct CONSTANT_MethodHandle_info {
119.440 + u1 tag = 15;
119.441 + u1 reference_kind; // 1..8 (one of REF_invokeVirtual, etc.)
119.442 + u2 reference_index; // index to CONSTANT_Fieldref or *Methodref
119.443 +}
119.444 +struct CONSTANT_MethodType_info {
119.445 + u1 tag = 16;
119.446 + u2 descriptor_index; // index to CONSTANT_Utf8, as in NameAndType
119.447 +}
119.448 +struct CONSTANT_InvokeDynamic_info {
119.449 + u1 tag = 18;
119.450 + u2 bootstrap_method_attr_index; // index into BootstrapMethods_attr
119.451 + u2 name_and_type_index; // index to CONSTANT_NameAndType, as in Methodref
119.452 +}
119.453 +struct BootstrapMethods_attr {
119.454 + u2 name; // CONSTANT_Utf8 = "BootstrapMethods"
119.455 + u4 size;
119.456 + u2 bootstrap_method_count;
119.457 + struct bootstrap_method_specifier {
119.458 + u2 bootstrap_method_ref; // index to CONSTANT_MethodHandle
119.459 + u2 bootstrap_argument_count;
119.460 + u2 bootstrap_arguments[bootstrap_argument_count]; // constant pool indexes
119.461 + } bootstrap_methods[bootstrap_method_count];
119.462 +}
119.463 + * </pre></blockquote>
119.464 + *
119.465 + * @author John Rose, JSR 292 EG
119.466 + * @since 1.7
119.467 + */
119.468 +
119.469 +package java.lang.invoke;
120.1 --- a/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java Tue Mar 29 11:29:01 2011 -0700
120.2 +++ b/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java Tue Mar 29 20:19:55 2011 -0700
120.3 @@ -28,6 +28,7 @@
120.4 import java.io.IOException;
120.5 import java.io.InterruptedIOException;
120.6 import java.util.Enumeration;
120.7 +import sun.net.ResourceManager;
120.8
120.9 /**
120.10 * Abstract datagram and multicast socket implementation base class.
120.11 @@ -66,7 +67,14 @@
120.12 */
120.13 protected synchronized void create() throws SocketException {
120.14 fd = new FileDescriptor();
120.15 - datagramSocketCreate();
120.16 + ResourceManager.beforeUdpCreate();
120.17 + try {
120.18 + datagramSocketCreate();
120.19 + } catch (SocketException ioe) {
120.20 + ResourceManager.afterUdpClose();
120.21 + fd = null;
120.22 + throw ioe;
120.23 + }
120.24 }
120.25
120.26 /**
120.27 @@ -211,6 +219,7 @@
120.28 protected void close() {
120.29 if (fd != null) {
120.30 datagramSocketClose();
120.31 + ResourceManager.afterUdpClose();
120.32 fd = null;
120.33 }
120.34 }
121.1 --- a/src/share/classes/java/net/AbstractPlainSocketImpl.java Tue Mar 29 11:29:01 2011 -0700
121.2 +++ b/src/share/classes/java/net/AbstractPlainSocketImpl.java Tue Mar 29 20:19:55 2011 -0700
121.3 @@ -32,6 +32,7 @@
121.4
121.5 import sun.net.ConnectionResetException;
121.6 import sun.net.NetHooks;
121.7 +import sun.net.ResourceManager;
121.8
121.9 /**
121.10 * Default Socket Implementation. This implementation does
121.11 @@ -68,6 +69,10 @@
121.12 private int resetState;
121.13 private final Object resetLock = new Object();
121.14
121.15 + /* whether this Socket is a stream (TCP) socket or not (UDP)
121.16 + */
121.17 + private boolean stream;
121.18 +
121.19 /**
121.20 * Load net library into runtime.
121.21 */
121.22 @@ -82,7 +87,19 @@
121.23 */
121.24 protected synchronized void create(boolean stream) throws IOException {
121.25 fd = new FileDescriptor();
121.26 - socketCreate(stream);
121.27 + this.stream = stream;
121.28 + if (!stream) {
121.29 + ResourceManager.beforeUdpCreate();
121.30 + try {
121.31 + socketCreate(false);
121.32 + } catch (IOException ioe) {
121.33 + ResourceManager.afterUdpClose();
121.34 + fd = null;
121.35 + throw ioe;
121.36 + }
121.37 + } else {
121.38 + socketCreate(true);
121.39 + }
121.40 if (socket != null)
121.41 socket.setCreated();
121.42 if (serverSocket != null)
121.43 @@ -479,6 +496,9 @@
121.44 protected void close() throws IOException {
121.45 synchronized(fdLock) {
121.46 if (fd != null) {
121.47 + if (!stream) {
121.48 + ResourceManager.afterUdpClose();
121.49 + }
121.50 if (fdUseCount == 0) {
121.51 if (closePending) {
121.52 return;
122.1 --- a/src/share/classes/java/net/URI.java Tue Mar 29 11:29:01 2011 -0700
122.2 +++ b/src/share/classes/java/net/URI.java Tue Mar 29 20:19:55 2011 -0700
122.3 @@ -1829,21 +1829,23 @@
122.4 } else if (authority != null) {
122.5 sb.append("//");
122.6 if (authority.startsWith("[")) {
122.7 + // authority should (but may not) contain an embedded IPv6 address
122.8 int end = authority.indexOf("]");
122.9 - if (end != -1 && authority.indexOf(":")!=-1) {
122.10 - String doquote, dontquote;
122.11 + String doquote = authority, dontquote = "";
122.12 + if (end != -1 && authority.indexOf(":") != -1) {
122.13 + // the authority contains an IPv6 address
122.14 if (end == authority.length()) {
122.15 dontquote = authority;
122.16 doquote = "";
122.17 } else {
122.18 - dontquote = authority.substring(0,end+1);
122.19 - doquote = authority.substring(end+1);
122.20 + dontquote = authority.substring(0 , end + 1);
122.21 + doquote = authority.substring(end + 1);
122.22 }
122.23 - sb.append (dontquote);
122.24 - sb.append(quote(doquote,
122.25 + }
122.26 + sb.append(dontquote);
122.27 + sb.append(quote(doquote,
122.28 L_REG_NAME | L_SERVER,
122.29 H_REG_NAME | H_SERVER));
122.30 - }
122.31 } else {
122.32 sb.append(quote(authority,
122.33 L_REG_NAME | L_SERVER,
123.1 --- a/src/share/classes/java/net/URLConnection.java Tue Mar 29 11:29:01 2011 -0700
123.2 +++ b/src/share/classes/java/net/URLConnection.java Tue Mar 29 20:19:55 2011 -0700
123.3 @@ -1,5 +1,5 @@
123.4 /*
123.5 - * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
123.6 + * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
123.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
123.8 *
123.9 * This code is free software; you can redistribute it and/or modify it
123.10 @@ -1422,7 +1422,7 @@
123.11 if (!is.markSupported())
123.12 return null;
123.13
123.14 - is.mark(12);
123.15 + is.mark(16);
123.16 int c1 = is.read();
123.17 int c2 = is.read();
123.18 int c3 = is.read();
123.19 @@ -1434,6 +1434,11 @@
123.20 int c9 = is.read();
123.21 int c10 = is.read();
123.22 int c11 = is.read();
123.23 + int c12 = is.read();
123.24 + int c13 = is.read();
123.25 + int c14 = is.read();
123.26 + int c15 = is.read();
123.27 + int c16 = is.read();
123.28 is.reset();
123.29
123.30 if (c1 == 0xCA && c2 == 0xFE && c3 == 0xBA && c4 == 0xBE) {
123.31 @@ -1461,6 +1466,13 @@
123.32 }
123.33 }
123.34
123.35 + // big and little (identical) endian UTF-8 encodings, with BOM
123.36 + if (c1 == 0xef && c2 == 0xbb && c3 == 0xbf) {
123.37 + if (c4 == '<' && c5 == '?' && c6 == 'x') {
123.38 + return "application/xml";
123.39 + }
123.40 + }
123.41 +
123.42 // big and little endian UTF-16 encodings, with byte order mark
123.43 if (c1 == 0xfe && c2 == 0xff) {
123.44 if (c3 == 0 && c4 == '<' && c5 == 0 && c6 == '?' &&
123.45 @@ -1476,6 +1488,23 @@
123.46 }
123.47 }
123.48
123.49 + // big and little endian UTF-32 encodings, with BOM
123.50 + if (c1 == 0x00 && c2 == 0x00 && c3 == 0xfe && c4 == 0xff) {
123.51 + if (c5 == 0 && c6 == 0 && c7 == 0 && c8 == '<' &&
123.52 + c9 == 0 && c10 == 0 && c11 == 0 && c12 == '?' &&
123.53 + c13 == 0 && c14 == 0 && c15 == 0 && c16 == 'x') {
123.54 + return "application/xml";
123.55 + }
123.56 + }
123.57 +
123.58 + if (c1 == 0xff && c2 == 0xfe && c3 == 0x00 && c4 == 0x00) {
123.59 + if (c5 == '<' && c6 == 0 && c7 == 0 && c8 == 0 &&
123.60 + c9 == '?' && c10 == 0 && c11 == 0 && c12 == 0 &&
123.61 + c13 == 'x' && c14 == 0 && c15 == 0 && c16 == 0) {
123.62 + return "application/xml";
123.63 + }
123.64 + }
123.65 +
123.66 if (c1 == 'G' && c2 == 'I' && c3 == 'F' && c4 == '8') {
123.67 return "image/gif";
123.68 }
124.1 --- a/src/share/classes/java/nio/file/Files.java Tue Mar 29 11:29:01 2011 -0700
124.2 +++ b/src/share/classes/java/nio/file/Files.java Tue Mar 29 20:19:55 2011 -0700
124.3 @@ -1712,10 +1712,10 @@
124.4 * @return the {@code path} parameter
124.5 *
124.6 * @throws UnsupportedOperationException
124.7 - * if the attribute view is not available or it does not support
124.8 - * updating the attribute
124.9 + * if the attribute view is not available
124.10 * @throws IllegalArgumentException
124.11 - * if the attribute value is of the correct type but has an
124.12 + * if the attribute name is not specified, or is not recognized, or
124.13 + * the attribute value is of the correct type but has an
124.14 * inappropriate value
124.15 * @throws ClassCastException
124.16 * if the attribute value is not of the expected type or is a
124.17 @@ -1776,9 +1776,12 @@
124.18 * @param options
124.19 * options indicating how symbolic links are handled
124.20 *
124.21 - * @return the attribute value or {@code null} if the attribute view
124.22 - * is not available or it does not support reading the attribute
124.23 + * @return the attribute value
124.24 *
124.25 + * @throws UnsupportedOperationException
124.26 + * if the attribute view is not available
124.27 + * @throws IllegalArgumentException
124.28 + * if the attribute name is not specified or is not recognized
124.29 * @throws IOException
124.30 * if an I/O error occurs
124.31 * @throws SecurityException
124.32 @@ -1794,8 +1797,9 @@
124.33 {
124.34 // only one attribute should be read
124.35 if (attribute.indexOf('*') >= 0 || attribute.indexOf(',') >= 0)
124.36 - return null;
124.37 + throw new IllegalArgumentException(attribute);
124.38 Map<String,Object> map = readAttributes(path, attribute, options);
124.39 + assert map.size() == 1;
124.40 String name;
124.41 int pos = attribute.indexOf(':');
124.42 if (pos == -1) {
124.43 @@ -1868,9 +1872,14 @@
124.44 * @param options
124.45 * options indicating how symbolic links are handled
124.46 *
124.47 - * @return a map of the attributes returned; may be empty. The map's keys
124.48 - * are the attribute names, its values are the attribute values
124.49 + * @return a map of the attributes returned; The map's keys are the
124.50 + * attribute names, its values are the attribute values
124.51 *
124.52 + * @throws UnsupportedOperationException
124.53 + * if the attribute view is not available
124.54 + * @throws IllegalArgumentException
124.55 + * if no attributes are specified or an unrecognized attributes is
124.56 + * specified
124.57 * @throws IOException
124.58 * if an I/O error occurs
124.59 * @throws SecurityException
125.1 --- a/src/share/classes/java/nio/file/Path.java Tue Mar 29 11:29:01 2011 -0700
125.2 +++ b/src/share/classes/java/nio/file/Path.java Tue Mar 29 20:19:55 2011 -0700
125.3 @@ -228,6 +228,9 @@
125.4 * not have a root component and the given path has a root component then
125.5 * this path does not start with the given path.
125.6 *
125.7 + * <p> If the given path is associated with a different {@code FileSystem}
125.8 + * to this path then {@code false} is returned.
125.9 + *
125.10 * @param other
125.11 * the given path
125.12 *
125.13 @@ -270,6 +273,9 @@
125.14 * does not have a root component and the given path has a root component
125.15 * then this path does not end with the given path.
125.16 *
125.17 + * <p> If the given path is associated with a different {@code FileSystem}
125.18 + * to this path then {@code false} is returned.
125.19 + *
125.20 * @param other
125.21 * the given path
125.22 *
125.23 @@ -283,7 +289,10 @@
125.24 * the given path string, in exactly the manner specified by the {@link
125.25 * #endsWith(Path) endsWith(Path)} method. On UNIX for example, the path
125.26 * "{@code foo/bar}" ends with "{@code foo/bar}" and "{@code bar}". It does
125.27 - * not end with "{@code r}" or "{@code /bar}".
125.28 + * not end with "{@code r}" or "{@code /bar}". Note that trailing separators
125.29 + * are not taken into account, and so invoking this method on the {@code
125.30 + * Path}"{@code foo/bar}" with the {@code String} "{@code bar/}" returns
125.31 + * {@code true}.
125.32 *
125.33 * @param other
125.34 * the given path string
125.35 @@ -724,12 +733,18 @@
125.36 * provider, platform specific. This method does not access the file system
125.37 * and neither file is required to exist.
125.38 *
125.39 + * <p> This method may not be used to compare paths that are associated
125.40 + * with different file system providers.
125.41 + *
125.42 * @param other the path compared to this path.
125.43 *
125.44 * @return zero if the argument is {@link #equals equal} to this path, a
125.45 * value less than zero if this path is lexicographically less than
125.46 * the argument, or a value greater than zero if this path is
125.47 * lexicographically greater than the argument
125.48 + *
125.49 + * @throws ClassCastException
125.50 + * if the paths are associated with different providers
125.51 */
125.52 @Override
125.53 int compareTo(Path other);
125.54 @@ -738,7 +753,7 @@
125.55 * Tests this path for equality with the given object.
125.56 *
125.57 * <p> If the given object is not a Path, or is a Path associated with a
125.58 - * different provider, then this method immediately returns {@code false}.
125.59 + * different {@code FileSystem}, then this method returns {@code false}.
125.60 *
125.61 * <p> Whether or not two path are equal depends on the file system
125.62 * implementation. In some cases the paths are compared without regard
126.1 --- a/src/share/classes/java/nio/file/WatchKey.java Tue Mar 29 11:29:01 2011 -0700
126.2 +++ b/src/share/classes/java/nio/file/WatchKey.java Tue Mar 29 20:19:55 2011 -0700
126.3 @@ -146,5 +146,5 @@
126.4 *
126.5 * @return the object for which this watch key was created
126.6 */
126.7 - //T watchable();
126.8 + Watchable watchable();
126.9 }
127.1 --- a/src/share/classes/java/nio/file/attribute/FileTime.java Tue Mar 29 11:29:01 2011 -0700
127.2 +++ b/src/share/classes/java/nio/file/attribute/FileTime.java Tue Mar 29 20:19:55 2011 -0700
127.3 @@ -216,12 +216,14 @@
127.4 * "2009-02-13T23:31:30Z"}, and {@code FileTime.fromMillis(1234567890123L).toString()}
127.5 * yields {@code "2009-02-13T23:31:30.123Z"}.
127.6 *
127.7 - * <p> A {@code FileTime} is primarly intended to represent the value of a
127.8 + * <p> A {@code FileTime} is primarily intended to represent the value of a
127.9 * file's time stamp. Where used to represent <i>extreme values</i>, where
127.10 * the year is less than "{@code 0001}" or greater than "{@code 9999}" then
127.11 - * the year may be expanded to more than four digits and may be
127.12 - * negative-signed. If more than four digits then leading zeros are not
127.13 - * present. The year before "{@code 0001}" is "{@code -0001}".
127.14 + * this method deviates from ISO 8601 in the same manner as the
127.15 + * <a href="http://www.w3.org/TR/xmlschema-2/#deviantformats">XML Schema
127.16 + * language</a>. That is, the year may be expanded to more than four digits
127.17 + * and may be negative-signed. If more than four digits then leading zeros
127.18 + * are not present. The year before "{@code 0001}" is "{@code -0001}".
127.19 *
127.20 * @return the string representation of this file time
127.21 */
128.1 --- a/src/share/classes/java/nio/file/spi/FileSystemProvider.java Tue Mar 29 11:29:01 2011 -0700
128.2 +++ b/src/share/classes/java/nio/file/spi/FileSystemProvider.java Tue Mar 29 20:19:55 2011 -0700
128.3 @@ -1037,6 +1037,11 @@
128.4 * @return a map of the attributes returned; may be empty. The map's keys
128.5 * are the attribute names, its values are the attribute values
128.6 *
128.7 + * @throws UnsupportedOperationException
128.8 + * if the attribute view is not available
128.9 + * @throws IllegalArgumentException
128.10 + * if no attributes are specified or an unrecognized attributes is
128.11 + * specified
128.12 * @throws IOException
128.13 * If an I/O error occurs
128.14 * @throws SecurityException
128.15 @@ -1064,10 +1069,10 @@
128.16 * options indicating how symbolic links are handled
128.17 *
128.18 * @throws UnsupportedOperationException
128.19 - * if the attribute view is not available or it does not support
128.20 - * updating the attribute
128.21 + * if the attribute view is not available
128.22 * @throws IllegalArgumentException
128.23 - * if the attribute value is of the correct type but has an
128.24 + * if the attribute name is not specified, or is not recognized, or
128.25 + * the attribute value is of the correct type but has an
128.26 * inappropriate value
128.27 * @throws ClassCastException
128.28 * If the attribute value is not of the expected type or is a
129.1 --- a/src/share/classes/java/security/AccessControlContext.java Tue Mar 29 11:29:01 2011 -0700
129.2 +++ b/src/share/classes/java/security/AccessControlContext.java Tue Mar 29 20:19:55 2011 -0700
129.3 @@ -29,6 +29,9 @@
129.4 import java.util.List;
129.5 import sun.security.util.Debug;
129.6 import sun.security.util.SecurityConstants;
129.7 +import sun.misc.JavaSecurityAccess;
129.8 +import sun.misc.SharedSecrets;
129.9 +
129.10
129.11 /**
129.12 * An AccessControlContext is used to make system resource access decisions
129.13 @@ -197,6 +200,24 @@
129.14 }
129.15
129.16 /**
129.17 + * Constructor for JavaSecurityAccess.doIntersectionPrivilege()
129.18 + */
129.19 + AccessControlContext(ProtectionDomain[] context,
129.20 + AccessControlContext privilegedContext)
129.21 + {
129.22 + this.context = context;
129.23 + this.privilegedContext = privilegedContext;
129.24 + this.isPrivileged = true;
129.25 + }
129.26 +
129.27 + /**
129.28 + * Returns this context's context.
129.29 + */
129.30 + ProtectionDomain[] getContext() {
129.31 + return context;
129.32 + }
129.33 +
129.34 + /**
129.35 * Returns true if this context is privileged.
129.36 */
129.37 boolean isPrivileged()
130.1 --- a/src/share/classes/java/security/CodeSource.java Tue Mar 29 11:29:01 2011 -0700
130.2 +++ b/src/share/classes/java/security/CodeSource.java Tue Mar 29 20:19:55 2011 -0700
130.3 @@ -1,5 +1,5 @@
130.4 /*
130.5 - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
130.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
130.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
130.8 *
130.9 * This code is free software; you can redistribute it and/or modify it
130.10 @@ -578,7 +578,7 @@
130.11
130.12 // Deserialize array of code signers (if any)
130.13 try {
130.14 - this.signers = (CodeSigner[])ois.readObject();
130.15 + this.signers = ((CodeSigner[])ois.readObject()).clone();
130.16 } catch (IOException ioe) {
130.17 // no signers present
130.18 }
131.1 --- a/src/share/classes/java/security/ProtectionDomain.java Tue Mar 29 11:29:01 2011 -0700
131.2 +++ b/src/share/classes/java/security/ProtectionDomain.java Tue Mar 29 20:19:55 2011 -0700
131.3 @@ -36,6 +36,8 @@
131.4 import sun.misc.SharedSecrets;
131.5 import sun.security.util.Debug;
131.6 import sun.security.util.SecurityConstants;
131.7 +import sun.misc.JavaSecurityAccess;
131.8 +import sun.misc.SharedSecrets;
131.9
131.10 /**
131.11 *
131.12 @@ -59,6 +61,36 @@
131.13
131.14 public class ProtectionDomain {
131.15
131.16 + static {
131.17 + // Set up JavaSecurityAccess in SharedSecrets
131.18 + SharedSecrets.setJavaSecurityAccess(
131.19 + new JavaSecurityAccess() {
131.20 + public <T> T doIntersectionPrivilege(
131.21 + PrivilegedAction<T> action,
131.22 + final AccessControlContext stack,
131.23 + final AccessControlContext context)
131.24 + {
131.25 + if (action == null) {
131.26 + throw new NullPointerException();
131.27 + }
131.28 + return AccessController.doPrivileged(
131.29 + action,
131.30 + new AccessControlContext(
131.31 + stack.getContext(), context).optimize()
131.32 + );
131.33 + }
131.34 +
131.35 + public <T> T doIntersectionPrivilege(
131.36 + PrivilegedAction<T> action,
131.37 + AccessControlContext context)
131.38 + {
131.39 + return doIntersectionPrivilege(action,
131.40 + AccessController.getContext(), context);
131.41 + }
131.42 + }
131.43 + );
131.44 + }
131.45 +
131.46 /* CodeSource */
131.47 private CodeSource codesource ;
131.48
132.1 --- a/src/share/classes/java/security/Timestamp.java Tue Mar 29 11:29:01 2011 -0700
132.2 +++ b/src/share/classes/java/security/Timestamp.java Tue Mar 29 20:19:55 2011 -0700
132.3 @@ -1,5 +1,5 @@
132.4 /*
132.5 - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
132.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
132.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
132.8 *
132.9 * This code is free software; you can redistribute it and/or modify it
132.10 @@ -157,7 +157,8 @@
132.11 // Explicitly reset hash code value to -1
132.12 private void readObject(ObjectInputStream ois)
132.13 throws IOException, ClassNotFoundException {
132.14 - ois.defaultReadObject();
132.15 - myhash = -1;
132.16 + ois.defaultReadObject();
132.17 + myhash = -1;
132.18 + timestamp = new Date(timestamp.getTime());
132.19 }
132.20 }
133.1 --- a/src/share/classes/java/sql/DriverManager.java Tue Mar 29 11:29:01 2011 -0700
133.2 +++ b/src/share/classes/java/sql/DriverManager.java Tue Mar 29 20:19:55 2011 -0700
133.3 @@ -1,5 +1,5 @@
133.4 /*
133.5 - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
133.6 + * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
133.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
133.8 *
133.9 * This code is free software; you can redistribute it and/or modify it
133.10 @@ -26,10 +26,10 @@
133.11 package java.sql;
133.12
133.13 import java.util.Iterator;
133.14 -import java.sql.Driver;
133.15 import java.util.ServiceLoader;
133.16 import java.security.AccessController;
133.17 import java.security.PrivilegedAction;
133.18 +import java.util.concurrent.CopyOnWriteArrayList;
133.19
133.20
133.21 /**
133.22 @@ -79,6 +79,27 @@
133.23 public class DriverManager {
133.24
133.25
133.26 + // List of registered JDBC drivers
133.27 + private final static CopyOnWriteArrayList<Driver> registeredDrivers = new CopyOnWriteArrayList<Driver>();
133.28 + private static volatile int loginTimeout = 0;
133.29 + private static volatile java.io.PrintWriter logWriter = null;
133.30 + private static volatile java.io.PrintStream logStream = null;
133.31 + // Used in println() to synchronize logWriter
133.32 + private final static Object logSync = new Object();
133.33 +
133.34 + /* Prevent the DriverManager class from being instantiated. */
133.35 + private DriverManager(){}
133.36 +
133.37 +
133.38 + /**
133.39 + * Load the initial JDBC drivers by checking the System property
133.40 + * jdbc.properties and then use the {@code ServiceLoader} mechanism
133.41 + */
133.42 + static {
133.43 + loadInitialDrivers();
133.44 + println("JDBC DriverManager initialized");
133.45 + }
133.46 +
133.47 /**
133.48 * The <code>SQLPermission</code> constant that allows the
133.49 * setting of the logging stream.
133.50 @@ -235,44 +256,33 @@
133.51 */
133.52 public static Driver getDriver(String url)
133.53 throws SQLException {
133.54 - java.util.Vector drivers = null;
133.55
133.56 println("DriverManager.getDriver(\"" + url + "\")");
133.57
133.58 - if (!initialized) {
133.59 - initialize();
133.60 - }
133.61 -
133.62 - synchronized (DriverManager.class){
133.63 - // use the read copy of the drivers vector
133.64 - drivers = readDrivers;
133.65 - }
133.66 -
133.67 // Gets the classloader of the code that called this method, may
133.68 // be null.
133.69 ClassLoader callerCL = DriverManager.getCallerClassLoader();
133.70
133.71 - // Walk through the loaded drivers attempting to locate someone
133.72 + // Walk through the loaded registeredDrivers attempting to locate someone
133.73 // who understands the given URL.
133.74 - for (int i = 0; i < drivers.size(); i++) {
133.75 - DriverInfo di = (DriverInfo)drivers.elementAt(i);
133.76 + for (Driver aDriver : registeredDrivers) {
133.77 // If the caller does not have permission to load the driver then
133.78 // skip it.
133.79 - if ( getCallerClass(callerCL, di.driverClassName ) !=
133.80 - di.driverClass ) {
133.81 - println(" skipping: " + di);
133.82 - continue;
133.83 + if(isDriverAllowed(aDriver, callerCL)) {
133.84 + try {
133.85 + if(aDriver.acceptsURL(url)) {
133.86 + // Success!
133.87 + println("getDriver returning " + aDriver.getClass().getName());
133.88 + return (aDriver);
133.89 + }
133.90 +
133.91 + } catch(SQLException sqe) {
133.92 + // Drop through and try the next driver.
133.93 + }
133.94 + } else {
133.95 + println(" skipping: " + aDriver.getClass().getName());
133.96 }
133.97 - try {
133.98 - println(" trying " + di);
133.99 - if (di.driver.acceptsURL(url)) {
133.100 - // Success!
133.101 - println("getDriver returning " + di);
133.102 - return (di.driver);
133.103 - }
133.104 - } catch (SQLException ex) {
133.105 - // Drop through and try the next driver.
133.106 - }
133.107 +
133.108 }
133.109
133.110 println("getDriver: no suitable driver");
133.111 @@ -292,23 +302,16 @@
133.112 */
133.113 public static synchronized void registerDriver(java.sql.Driver driver)
133.114 throws SQLException {
133.115 - if (!initialized) {
133.116 - initialize();
133.117 +
133.118 + /* Register the driver if it has not already been added to our list */
133.119 + if(driver != null) {
133.120 + registeredDrivers.addIfAbsent(driver);
133.121 + } else {
133.122 + // This is for compatibility with the original DriverManager
133.123 + throw new NullPointerException();
133.124 }
133.125
133.126 - DriverInfo di = new DriverInfo();
133.127 -
133.128 - di.driver = driver;
133.129 - di.driverClass = driver.getClass();
133.130 - di.driverClassName = di.driverClass.getName();
133.131 -
133.132 - // Not Required -- drivers.addElement(di);
133.133 -
133.134 - writeDrivers.addElement(di);
133.135 - println("registerDriver: " + di);
133.136 -
133.137 - /* update the read copy of drivers vector */
133.138 - readDrivers = (java.util.Vector) writeDrivers.clone();
133.139 + println("registerDriver: " + driver);
133.140
133.141 }
133.142
133.143 @@ -321,37 +324,26 @@
133.144 */
133.145 public static synchronized void deregisterDriver(Driver driver)
133.146 throws SQLException {
133.147 + if (driver == null) {
133.148 + return;
133.149 + }
133.150 +
133.151 // Gets the classloader of the code that called this method,
133.152 // may be null.
133.153 ClassLoader callerCL = DriverManager.getCallerClassLoader();
133.154 println("DriverManager.deregisterDriver: " + driver);
133.155
133.156 - // Walk through the loaded drivers.
133.157 - int i;
133.158 - DriverInfo di = null;
133.159 - for (i = 0; i < writeDrivers.size(); i++) {
133.160 - di = (DriverInfo)writeDrivers.elementAt(i);
133.161 - if (di.driver == driver) {
133.162 - break;
133.163 + if(registeredDrivers.contains(driver)) {
133.164 + if (isDriverAllowed(driver, callerCL)) {
133.165 + registeredDrivers.remove(driver);
133.166 + } else {
133.167 + // If the caller does not have permission to load the driver then
133.168 + // throw a SecurityException.
133.169 + throw new SecurityException();
133.170 }
133.171 + } else {
133.172 + println(" couldn't find driver to unload");
133.173 }
133.174 - // If we can't find the driver just return.
133.175 - if (i >= writeDrivers.size()) {
133.176 - println(" couldn't find driver to unload");
133.177 - return;
133.178 - }
133.179 -
133.180 - // If the caller does not have permission to load the driver then
133.181 - // throw a security exception.
133.182 - if (getCallerClass(callerCL, di.driverClassName ) != di.driverClass ) {
133.183 - throw new SecurityException();
133.184 - }
133.185 -
133.186 - // Remove the driver. Other entries in drivers get shuffled down.
133.187 - writeDrivers.removeElementAt(i);
133.188 -
133.189 - /* update the read copy of drivers vector */
133.190 - readDrivers = (java.util.Vector) writeDrivers.clone();
133.191 }
133.192
133.193 /**
133.194 @@ -364,34 +356,22 @@
133.195 * @return the list of JDBC Drivers loaded by the caller's class loader
133.196 */
133.197 public static java.util.Enumeration<Driver> getDrivers() {
133.198 - java.util.Vector<Driver> result = new java.util.Vector<>();
133.199 - java.util.Vector drivers = null;
133.200 -
133.201 - if (!initialized) {
133.202 - initialize();
133.203 - }
133.204 -
133.205 - synchronized (DriverManager.class){
133.206 - // use the readcopy of drivers
133.207 - drivers = readDrivers;
133.208 - }
133.209 + java.util.Vector<Driver> result = new java.util.Vector<Driver>();
133.210
133.211 // Gets the classloader of the code that called this method, may
133.212 // be null.
133.213 ClassLoader callerCL = DriverManager.getCallerClassLoader();
133.214
133.215 - // Walk through the loaded drivers.
133.216 - for (int i = 0; i < drivers.size(); i++) {
133.217 - DriverInfo di = (DriverInfo)drivers.elementAt(i);
133.218 + // Walk through the loaded registeredDrivers.
133.219 + for(Driver aDriver : registeredDrivers) {
133.220 // If the caller does not have permission to load the driver then
133.221 // skip it.
133.222 - if ( getCallerClass(callerCL, di.driverClassName ) != di.driverClass ) {
133.223 - println(" skipping: " + di);
133.224 - continue;
133.225 + if(isDriverAllowed(aDriver, callerCL)) {
133.226 + result.addElement(aDriver);
133.227 + } else {
133.228 + println(" skipping: " + aDriver.getClass().getName());
133.229 }
133.230 - result.addElement(di.driver);
133.231 }
133.232 -
133.233 return (result.elements());
133.234 }
133.235
133.236 @@ -481,21 +461,22 @@
133.237
133.238 //------------------------------------------------------------------------
133.239
133.240 - // Returns the class object that would be created if the code calling the
133.241 - // driver manager had loaded the driver class, or null if the class
133.242 - // is inaccessible.
133.243 - private static Class getCallerClass(ClassLoader callerClassLoader,
133.244 - String driverClassName) {
133.245 - Class callerC = null;
133.246 + // Indicates whether the class object that would be created if the code calling
133.247 + // DriverManager is accessible.
133.248 + private static boolean isDriverAllowed(Driver driver, ClassLoader classLoader) {
133.249 + boolean result = false;
133.250 + if(driver != null) {
133.251 + Class<?> aClass = null;
133.252 + try {
133.253 + aClass = Class.forName(driver.getClass().getName(), true, classLoader);
133.254 + } catch (Exception ex) {
133.255 + result = false;
133.256 + }
133.257
133.258 - try {
133.259 - callerC = Class.forName(driverClassName, true, callerClassLoader);
133.260 - }
133.261 - catch (Exception ex) {
133.262 - callerC = null; // being very careful
133.263 + result = ( aClass == driver.getClass() ) ? true : false;
133.264 }
133.265
133.266 - return callerC;
133.267 + return result;
133.268 }
133.269
133.270 private static void loadInitialDrivers() {
133.271 @@ -544,26 +525,17 @@
133.272 });
133.273
133.274 println("DriverManager.initialize: jdbc.drivers = " + drivers);
133.275 - if (drivers == null) {
133.276 +
133.277 + if (drivers == null || drivers.equals("")) {
133.278 return;
133.279 }
133.280 - while (drivers.length() != 0) {
133.281 - int x = drivers.indexOf(':');
133.282 - String driver;
133.283 - if (x < 0) {
133.284 - driver = drivers;
133.285 - drivers = "";
133.286 - } else {
133.287 - driver = drivers.substring(0, x);
133.288 - drivers = drivers.substring(x+1);
133.289 - }
133.290 - if (driver.length() == 0) {
133.291 - continue;
133.292 - }
133.293 + String[] driversList = drivers.split(":");
133.294 + println("number of Drivers:" + driversList.length);
133.295 + for (String aDriver : driversList) {
133.296 try {
133.297 - println("DriverManager.Initialize: loading " + driver);
133.298 - Class.forName(driver, true,
133.299 - ClassLoader.getSystemClassLoader());
133.300 + println("DriverManager.Initialize: loading " + aDriver);
133.301 + Class.forName(aDriver, true,
133.302 + ClassLoader.getSystemClassLoader());
133.303 } catch (Exception ex) {
133.304 println("DriverManager.Initialize: load failed: " + ex);
133.305 }
133.306 @@ -574,7 +546,6 @@
133.307 // Worker method called by the public getConnection() methods.
133.308 private static Connection getConnection(
133.309 String url, java.util.Properties info, ClassLoader callerCL) throws SQLException {
133.310 - java.util.Vector drivers = null;
133.311 /*
133.312 * When callerCl is null, we should check the application's
133.313 * (which is invoking this class indirectly)
133.314 @@ -594,40 +565,32 @@
133.315
133.316 println("DriverManager.getConnection(\"" + url + "\")");
133.317
133.318 - if (!initialized) {
133.319 - initialize();
133.320 - }
133.321 -
133.322 - synchronized (DriverManager.class){
133.323 - // use the readcopy of drivers
133.324 - drivers = readDrivers;
133.325 - }
133.326 -
133.327 - // Walk through the loaded drivers attempting to make a connection.
133.328 + // Walk through the loaded registeredDrivers attempting to make a connection.
133.329 // Remember the first exception that gets raised so we can reraise it.
133.330 SQLException reason = null;
133.331 - for (int i = 0; i < drivers.size(); i++) {
133.332 - DriverInfo di = (DriverInfo)drivers.elementAt(i);
133.333
133.334 + for(Driver aDriver : registeredDrivers) {
133.335 // If the caller does not have permission to load the driver then
133.336 // skip it.
133.337 - if ( getCallerClass(callerCL, di.driverClassName ) != di.driverClass ) {
133.338 - println(" skipping: " + di);
133.339 - continue;
133.340 + if(isDriverAllowed(aDriver, callerCL)) {
133.341 + try {
133.342 + println(" trying " + aDriver.getClass().getName());
133.343 + Connection con = aDriver.connect(url, info);
133.344 + if (con != null) {
133.345 + // Success!
133.346 + println("getConnection returning " + aDriver.getClass().getName());
133.347 + return (con);
133.348 + }
133.349 + } catch (SQLException ex) {
133.350 + if (reason == null) {
133.351 + reason = ex;
133.352 + }
133.353 + }
133.354 +
133.355 + } else {
133.356 + println(" skipping: " + aDriver.getClass().getName());
133.357 }
133.358 - try {
133.359 - println(" trying " + di);
133.360 - Connection result = di.driver.connect(url, info);
133.361 - if (result != null) {
133.362 - // Success!
133.363 - println("getConnection returning " + di);
133.364 - return (result);
133.365 - }
133.366 - } catch (SQLException ex) {
133.367 - if (reason == null) {
133.368 - reason = ex;
133.369 - }
133.370 - }
133.371 +
133.372 }
133.373
133.374 // if we got here nobody could connect.
133.375 @@ -640,45 +603,7 @@
133.376 throw new SQLException("No suitable driver found for "+ url, "08001");
133.377 }
133.378
133.379 -
133.380 - // Class initialization.
133.381 - static void initialize() {
133.382 - if (initialized) {
133.383 - return;
133.384 - }
133.385 - initialized = true;
133.386 - loadInitialDrivers();
133.387 - println("JDBC DriverManager initialized");
133.388 - }
133.389 -
133.390 - /* Prevent the DriverManager class from being instantiated. */
133.391 - private DriverManager(){}
133.392 -
133.393 - /* write copy of the drivers vector */
133.394 - private static java.util.Vector writeDrivers = new java.util.Vector();
133.395 -
133.396 - /* write copy of the drivers vector */
133.397 - private static java.util.Vector readDrivers = new java.util.Vector();
133.398 -
133.399 - private static int loginTimeout = 0;
133.400 - private static java.io.PrintWriter logWriter = null;
133.401 - private static java.io.PrintStream logStream = null;
133.402 - private static boolean initialized = false;
133.403 -
133.404 - private static Object logSync = new Object();
133.405 -
133.406 /* Returns the caller's class loader, or null if none */
133.407 private static native ClassLoader getCallerClassLoader();
133.408
133.409 }
133.410 -
133.411 -// DriverInfo is a package-private support class.
133.412 -class DriverInfo {
133.413 - Driver driver;
133.414 - Class driverClass;
133.415 - String driverClassName;
133.416 -
133.417 - public String toString() {
133.418 - return ("driver[className=" + driverClassName + "," + driver + "]");
133.419 - }
133.420 -}
134.1 --- a/src/share/classes/java/util/Formatter.java Tue Mar 29 11:29:01 2011 -0700
134.2 +++ b/src/share/classes/java/util/Formatter.java Tue Mar 29 20:19:55 2011 -0700
134.3 @@ -1401,10 +1401,9 @@
134.4 * <p> The number of digits in the result for the fractional part of
134.5 * <i>m</i> or <i>a</i> is equal to the precision. If the precision is not
134.6 * specified then the default value is {@code 6}. If the precision is
134.7 - * less than the number of digits which would appear after the decimal
134.8 - * point in the string returned by {@link Float#toString(float)} or {@link
134.9 - * Double#toString(double)} respectively, then the value will be rounded
134.10 - * using the {@linkplain java.math.BigDecimal#ROUND_HALF_UP round half up
134.11 + * less than the number of digits to the right of the decimal point then
134.12 + * the value will be rounded using the
134.13 + * {@linkplain java.math.BigDecimal#ROUND_HALF_UP round half up
134.14 * algorithm}. Otherwise, zeros may be appended to reach the precision.
134.15 * For a canonical representation of the value, use {@link
134.16 * BigDecimal#toString()}.
134.17 @@ -1463,12 +1462,11 @@
134.18 * more decimal digits representing the fractional part of <i>m</i>.
134.19 *
134.20 * <p> The number of digits in the result for the fractional part of
134.21 - * <i>m</i> or <i>a</i> is equal to the precision. If the precision is not
134.22 + * <i>m</i> or <i>a</i> is equal to the precision. If the precision is not
134.23 * specified then the default value is {@code 6}. If the precision is
134.24 - * less than the number of digits which would appear after the decimal
134.25 - * point in the string returned by {@link Float#toString(float)} or {@link
134.26 - * Double#toString(double)} respectively, then the value will be rounded
134.27 - * using the {@linkplain java.math.BigDecimal#ROUND_HALF_UP round half up
134.28 + * less than the number of digits to the right of the decimal point
134.29 + * then the value will be rounded using the
134.30 + * {@linkplain java.math.BigDecimal#ROUND_HALF_UP round half up
134.31 * algorithm}. Otherwise, zeros may be appended to reach the precision.
134.32 * For a canonical representation of the value, use {@link
134.33 * BigDecimal#toString()}.
134.34 @@ -3585,7 +3583,7 @@
134.35 int scale = value.scale();
134.36
134.37 if (scale > prec) {
134.38 - // more "scale" digits than the requested "precision
134.39 + // more "scale" digits than the requested "precision"
134.40 int compPrec = value.precision();
134.41 if (compPrec <= scale) {
134.42 // case of 0.xxxxxx
135.1 --- a/src/share/classes/java/util/JumboEnumSet.java Tue Mar 29 11:29:01 2011 -0700
135.2 +++ b/src/share/classes/java/util/JumboEnumSet.java Tue Mar 29 20:19:55 2011 -0700
135.3 @@ -34,6 +34,8 @@
135.4 * @serial exclude
135.5 */
135.6 class JumboEnumSet<E extends Enum<E>> extends EnumSet<E> {
135.7 + private static final long serialVersionUID = 334349849919042784L;
135.8 +
135.9 /**
135.10 * Bit vector representation of this set. The ith bit of the jth
135.11 * element of this array represents the presence of universe[64*j +i]
135.12 @@ -138,8 +140,11 @@
135.13 public void remove() {
135.14 if (lastReturned == 0)
135.15 throw new IllegalStateException();
135.16 - elements[lastReturnedIndex] -= lastReturned;
135.17 - size--;
135.18 + final long oldElements = elements[lastReturnedIndex];
135.19 + elements[lastReturnedIndex] &= ~lastReturned;
135.20 + if (oldElements != elements[lastReturnedIndex]) {
135.21 + size--;
135.22 + }
135.23 lastReturned = 0;
135.24 }
135.25 }
136.1 --- a/src/share/classes/java/util/Locale.java Tue Mar 29 11:29:01 2011 -0700
136.2 +++ b/src/share/classes/java/util/Locale.java Tue Mar 29 20:19:55 2011 -0700
136.3 @@ -1168,7 +1168,7 @@
136.4 boolean e = (_extensions.getID().length() != 0);
136.5
136.6 StringBuilder result = new StringBuilder(_baseLocale.getLanguage());
136.7 - if (r || (l && v)) {
136.8 + if (r || (l && (v || s || e))) {
136.9 result.append('_')
136.10 .append(_baseLocale.getRegion()); // This may just append '_'
136.11 }
137.1 --- a/src/share/classes/java/util/RegularEnumSet.java Tue Mar 29 11:29:01 2011 -0700
137.2 +++ b/src/share/classes/java/util/RegularEnumSet.java Tue Mar 29 20:19:55 2011 -0700
137.3 @@ -34,6 +34,7 @@
137.4 * @serial exclude
137.5 */
137.6 class RegularEnumSet<E extends Enum<E>> extends EnumSet<E> {
137.7 + private static final long serialVersionUID = 3411599620347842686L;
137.8 /**
137.9 * Bit vector representation of this set. The 2^k bit indicates the
137.10 * presence of universe[k] in this set.
137.11 @@ -106,7 +107,7 @@
137.12 public void remove() {
137.13 if (lastReturned == 0)
137.14 throw new IllegalStateException();
137.15 - elements -= lastReturned;
137.16 + elements &= ~lastReturned;
137.17 lastReturned = 0;
137.18 }
137.19 }
138.1 --- a/src/share/classes/java/util/TreeMap.java Tue Mar 29 11:29:01 2011 -0700
138.2 +++ b/src/share/classes/java/util/TreeMap.java Tue Mar 29 20:19:55 2011 -0700
138.3 @@ -528,11 +528,8 @@
138.4 public V put(K key, V value) {
138.5 Entry<K,V> t = root;
138.6 if (t == null) {
138.7 - // TBD:
138.8 - // 5045147: (coll) Adding null to an empty TreeSet should
138.9 - // throw NullPointerException
138.10 - //
138.11 - // compare(key, key); // type check
138.12 + compare(key, key); // type (and possibly null) check
138.13 +
138.14 root = new Entry<>(key, value, null);
138.15 size = 1;
138.16 modCount++;
139.1 --- a/src/share/classes/java/util/UUID.java Tue Mar 29 11:29:01 2011 -0700
139.2 +++ b/src/share/classes/java/util/UUID.java Tue Mar 29 20:19:55 2011 -0700
139.3 @@ -26,8 +26,6 @@
139.4 package java.util;
139.5
139.6 import java.security.*;
139.7 -import java.io.IOException;
139.8 -import java.io.UnsupportedEncodingException;
139.9
139.10 /**
139.11 * A class that represents an immutable universally unique identifier (UUID).
139.12 @@ -91,36 +89,6 @@
139.13 private final long leastSigBits;
139.14
139.15 /*
139.16 - * The version number associated with this UUID. Computed on demand.
139.17 - */
139.18 - private transient int version = -1;
139.19 -
139.20 - /*
139.21 - * The variant number associated with this UUID. Computed on demand.
139.22 - */
139.23 - private transient int variant = -1;
139.24 -
139.25 - /*
139.26 - * The timestamp associated with this UUID. Computed on demand.
139.27 - */
139.28 - private transient volatile long timestamp = -1;
139.29 -
139.30 - /*
139.31 - * The clock sequence associated with this UUID. Computed on demand.
139.32 - */
139.33 - private transient int sequence = -1;
139.34 -
139.35 - /*
139.36 - * The node number associated with this UUID. Computed on demand.
139.37 - */
139.38 - private transient long node = -1;
139.39 -
139.40 - /*
139.41 - * The hashcode of this UUID. Computed on demand.
139.42 - */
139.43 - private transient int hashCode = -1;
139.44 -
139.45 - /*
139.46 * The random number generator used by this class to create random
139.47 * based UUIDs.
139.48 */
139.49 @@ -134,7 +102,7 @@
139.50 private UUID(byte[] data) {
139.51 long msb = 0;
139.52 long lsb = 0;
139.53 - assert data.length == 16;
139.54 + assert data.length == 16 : "data must be 16 bytes in length";
139.55 for (int i=0; i<8; i++)
139.56 msb = (msb << 8) | (data[i] & 0xff);
139.57 for (int i=8; i<16; i++)
139.58 @@ -276,11 +244,8 @@
139.59 * @return The version number of this {@code UUID}
139.60 */
139.61 public int version() {
139.62 - if (version < 0) {
139.63 - // Version is bits masked by 0x000000000000F000 in MS long
139.64 - version = (int)((mostSigBits >> 12) & 0x0f);
139.65 - }
139.66 - return version;
139.67 + // Version is bits masked by 0x000000000000F000 in MS long
139.68 + return (int)((mostSigBits >> 12) & 0x0f);
139.69 }
139.70
139.71 /**
139.72 @@ -298,17 +263,13 @@
139.73 * @return The variant number of this {@code UUID}
139.74 */
139.75 public int variant() {
139.76 - if (variant < 0) {
139.77 - // This field is composed of a varying number of bits
139.78 - if ((leastSigBits >>> 63) == 0) {
139.79 - variant = 0;
139.80 - } else if ((leastSigBits >>> 62) == 2) {
139.81 - variant = 2;
139.82 - } else {
139.83 - variant = (int)(leastSigBits >>> 61);
139.84 - }
139.85 - }
139.86 - return variant;
139.87 + // This field is composed of a varying number of bits.
139.88 + // 0 - - Reserved for NCS backward compatibility
139.89 + // 1 0 - The Leach-Salz variant (used by this class)
139.90 + // 1 1 0 Reserved, Microsoft backward compatibility
139.91 + // 1 1 1 Reserved for future definition.
139.92 + return (int) ((leastSigBits >>> (64 - (leastSigBits >>> 62)))
139.93 + & (leastSigBits >> 63));
139.94 }
139.95
139.96 /**
139.97 @@ -330,14 +291,10 @@
139.98 if (version() != 1) {
139.99 throw new UnsupportedOperationException("Not a time-based UUID");
139.100 }
139.101 - long result = timestamp;
139.102 - if (result < 0) {
139.103 - result = (mostSigBits & 0x0000000000000FFFL) << 48;
139.104 - result |= ((mostSigBits >> 16) & 0xFFFFL) << 32;
139.105 - result |= mostSigBits >>> 32;
139.106 - timestamp = result;
139.107 - }
139.108 - return result;
139.109 +
139.110 + return (mostSigBits & 0x0FFFL) << 48
139.111 + | ((mostSigBits >> 16) & 0x0FFFFL) << 32
139.112 + | mostSigBits >>> 32;
139.113 }
139.114
139.115 /**
139.116 @@ -360,10 +317,8 @@
139.117 if (version() != 1) {
139.118 throw new UnsupportedOperationException("Not a time-based UUID");
139.119 }
139.120 - if (sequence < 0) {
139.121 - sequence = (int)((leastSigBits & 0x3FFF000000000000L) >>> 48);
139.122 - }
139.123 - return sequence;
139.124 +
139.125 + return (int)((leastSigBits & 0x3FFF000000000000L) >>> 48);
139.126 }
139.127
139.128 /**
139.129 @@ -386,10 +341,8 @@
139.130 if (version() != 1) {
139.131 throw new UnsupportedOperationException("Not a time-based UUID");
139.132 }
139.133 - if (node < 0) {
139.134 - node = leastSigBits & 0x0000FFFFFFFFFFFFL;
139.135 - }
139.136 - return node;
139.137 +
139.138 + return leastSigBits & 0x0000FFFFFFFFFFFFL;
139.139 }
139.140
139.141 // Object Inherited Methods
139.142 @@ -438,13 +391,8 @@
139.143 * @return A hash code value for this {@code UUID}
139.144 */
139.145 public int hashCode() {
139.146 - if (hashCode == -1) {
139.147 - hashCode = (int)((mostSigBits >> 32) ^
139.148 - mostSigBits ^
139.149 - (leastSigBits >> 32) ^
139.150 - leastSigBits);
139.151 - }
139.152 - return hashCode;
139.153 + long hilo = mostSigBits ^ leastSigBits;
139.154 + return ((int)(hilo >> 32)) ^ (int) hilo;
139.155 }
139.156
139.157 /**
139.158 @@ -460,9 +408,7 @@
139.159 * otherwise
139.160 */
139.161 public boolean equals(Object obj) {
139.162 - if (!(obj instanceof UUID))
139.163 - return false;
139.164 - if (((UUID)obj).variant() != this.variant())
139.165 + if ((null == obj) || (obj.getClass() != UUID.class))
139.166 return false;
139.167 UUID id = (UUID)obj;
139.168 return (mostSigBits == id.mostSigBits &&
139.169 @@ -494,23 +440,4 @@
139.170 (this.leastSigBits > val.leastSigBits ? 1 :
139.171 0))));
139.172 }
139.173 -
139.174 - /**
139.175 - * Reconstitute the {@code UUID} instance from a stream (that is,
139.176 - * deserialize it). This is necessary to set the transient fields to their
139.177 - * correct uninitialized value so they will be recomputed on demand.
139.178 - */
139.179 - private void readObject(java.io.ObjectInputStream in)
139.180 - throws java.io.IOException, ClassNotFoundException {
139.181 -
139.182 - in.defaultReadObject();
139.183 -
139.184 - // Set "cached computation" fields to their initial values
139.185 - version = -1;
139.186 - variant = -1;
139.187 - timestamp = -1;
139.188 - sequence = -1;
139.189 - node = -1;
139.190 - hashCode = -1;
139.191 - }
139.192 }
140.1 --- a/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java Tue Mar 29 11:29:01 2011 -0700
140.2 +++ b/src/share/classes/java/util/concurrent/ConcurrentSkipListMap.java Tue Mar 29 20:19:55 2011 -0700
140.3 @@ -44,8 +44,8 @@
140.4 * creation time, depending on which constructor is used.
140.5 *
140.6 * <p>This class implements a concurrent variant of <a
140.7 - * href="http://www.cs.umd.edu/~pugh/">SkipLists</a> providing
140.8 - * expected average <i>log(n)</i> time cost for the
140.9 + * href="http://en.wikipedia.org/wiki/Skip_list" target="_top">SkipLists</a>
140.10 + * providing expected average <i>log(n)</i> time cost for the
140.11 * <tt>containsKey</tt>, <tt>get</tt>, <tt>put</tt> and
140.12 * <tt>remove</tt> operations and their variants. Insertion, removal,
140.13 * update, and access operations safely execute concurrently by
141.1 --- a/src/share/classes/java/util/concurrent/Exchanger.java Tue Mar 29 11:29:01 2011 -0700
141.2 +++ b/src/share/classes/java/util/concurrent/Exchanger.java Tue Mar 29 20:19:55 2011 -0700
141.3 @@ -164,8 +164,8 @@
141.4 * races between two threads or thread pre-emptions occurring
141.5 * between reading and CASing. Also, very transient peak
141.6 * contention can be much higher than the average sustainable
141.7 - * levels. The max limit is decreased on average 50% of the times
141.8 - * that a non-slot-zero wait elapses without being fulfilled.
141.9 + * levels. An attempt to decrease the max limit is usually made
141.10 + * when a non-slot-zero wait elapses without being fulfilled.
141.11 * Threads experiencing elapsed waits move closer to zero, so
141.12 * eventually find existing (or future) threads even if the table
141.13 * has been shrunk due to inactivity. The chosen mechanics and
142.1 --- a/src/share/classes/java/util/concurrent/ForkJoinPool.java Tue Mar 29 11:29:01 2011 -0700
142.2 +++ b/src/share/classes/java/util/concurrent/ForkJoinPool.java Tue Mar 29 20:19:55 2011 -0700
142.3 @@ -40,6 +40,7 @@
142.4 import java.util.Collection;
142.5 import java.util.Collections;
142.6 import java.util.List;
142.7 +import java.util.Random;
142.8 import java.util.concurrent.AbstractExecutorService;
142.9 import java.util.concurrent.Callable;
142.10 import java.util.concurrent.ExecutorService;
142.11 @@ -51,6 +52,7 @@
142.12 import java.util.concurrent.atomic.AtomicInteger;
142.13 import java.util.concurrent.locks.LockSupport;
142.14 import java.util.concurrent.locks.ReentrantLock;
142.15 +import java.util.concurrent.locks.Condition;
142.16
142.17 /**
142.18 * An {@link ExecutorService} for running {@link ForkJoinTask}s.
142.19 @@ -158,239 +160,208 @@
142.20 * set of worker threads: Submissions from non-FJ threads enter
142.21 * into a submission queue. Workers take these tasks and typically
142.22 * split them into subtasks that may be stolen by other workers.
142.23 - * The main work-stealing mechanics implemented in class
142.24 - * ForkJoinWorkerThread give first priority to processing tasks
142.25 - * from their own queues (LIFO or FIFO, depending on mode), then
142.26 - * to randomized FIFO steals of tasks in other worker queues, and
142.27 - * lastly to new submissions. These mechanics do not consider
142.28 - * affinities, loads, cache localities, etc, so rarely provide the
142.29 - * best possible performance on a given machine, but portably
142.30 - * provide good throughput by averaging over these factors.
142.31 - * (Further, even if we did try to use such information, we do not
142.32 - * usually have a basis for exploiting it. For example, some sets
142.33 - * of tasks profit from cache affinities, but others are harmed by
142.34 - * cache pollution effects.)
142.35 + * Preference rules give first priority to processing tasks from
142.36 + * their own queues (LIFO or FIFO, depending on mode), then to
142.37 + * randomized FIFO steals of tasks in other worker queues, and
142.38 + * lastly to new submissions.
142.39 *
142.40 - * Beyond work-stealing support and essential bookkeeping, the
142.41 - * main responsibility of this framework is to take actions when
142.42 - * one worker is waiting to join a task stolen (or always held by)
142.43 - * another. Because we are multiplexing many tasks on to a pool
142.44 - * of workers, we can't just let them block (as in Thread.join).
142.45 - * We also cannot just reassign the joiner's run-time stack with
142.46 - * another and replace it later, which would be a form of
142.47 - * "continuation", that even if possible is not necessarily a good
142.48 - * idea. Given that the creation costs of most threads on most
142.49 - * systems mainly surrounds setting up runtime stacks, thread
142.50 - * creation and switching is usually not much more expensive than
142.51 - * stack creation and switching, and is more flexible). Instead we
142.52 + * The main throughput advantages of work-stealing stem from
142.53 + * decentralized control -- workers mostly take tasks from
142.54 + * themselves or each other. We cannot negate this in the
142.55 + * implementation of other management responsibilities. The main
142.56 + * tactic for avoiding bottlenecks is packing nearly all
142.57 + * essentially atomic control state into a single 64bit volatile
142.58 + * variable ("ctl"). This variable is read on the order of 10-100
142.59 + * times as often as it is modified (always via CAS). (There is
142.60 + * some additional control state, for example variable "shutdown"
142.61 + * for which we can cope with uncoordinated updates.) This
142.62 + * streamlines synchronization and control at the expense of messy
142.63 + * constructions needed to repack status bits upon updates.
142.64 + * Updates tend not to contend with each other except during
142.65 + * bursts while submitted tasks begin or end. In some cases when
142.66 + * they do contend, threads can instead do something else
142.67 + * (usually, scan for tasks) until contention subsides.
142.68 + *
142.69 + * To enable packing, we restrict maximum parallelism to (1<<15)-1
142.70 + * (which is far in excess of normal operating range) to allow
142.71 + * ids, counts, and their negations (used for thresholding) to fit
142.72 + * into 16bit fields.
142.73 + *
142.74 + * Recording Workers. Workers are recorded in the "workers" array
142.75 + * that is created upon pool construction and expanded if (rarely)
142.76 + * necessary. This is an array as opposed to some other data
142.77 + * structure to support index-based random steals by workers.
142.78 + * Updates to the array recording new workers and unrecording
142.79 + * terminated ones are protected from each other by a seqLock
142.80 + * (scanGuard) but the array is otherwise concurrently readable,
142.81 + * and accessed directly by workers. To simplify index-based
142.82 + * operations, the array size is always a power of two, and all
142.83 + * readers must tolerate null slots. To avoid flailing during
142.84 + * start-up, the array is presized to hold twice #parallelism
142.85 + * workers (which is unlikely to need further resizing during
142.86 + * execution). But to avoid dealing with so many null slots,
142.87 + * variable scanGuard includes a mask for the nearest power of two
142.88 + * that contains all current workers. All worker thread creation
142.89 + * is on-demand, triggered by task submissions, replacement of
142.90 + * terminated workers, and/or compensation for blocked
142.91 + * workers. However, all other support code is set up to work with
142.92 + * other policies. To ensure that we do not hold on to worker
142.93 + * references that would prevent GC, ALL accesses to workers are
142.94 + * via indices into the workers array (which is one source of some
142.95 + * of the messy code constructions here). In essence, the workers
142.96 + * array serves as a weak reference mechanism. Thus for example
142.97 + * the wait queue field of ctl stores worker indices, not worker
142.98 + * references. Access to the workers in associated methods (for
142.99 + * example signalWork) must both index-check and null-check the
142.100 + * IDs. All such accesses ignore bad IDs by returning out early
142.101 + * from what they are doing, since this can only be associated
142.102 + * with termination, in which case it is OK to give up.
142.103 + *
142.104 + * All uses of the workers array, as well as queue arrays, check
142.105 + * that the array is non-null (even if previously non-null). This
142.106 + * allows nulling during termination, which is currently not
142.107 + * necessary, but remains an option for resource-revocation-based
142.108 + * shutdown schemes.
142.109 + *
142.110 + * Wait Queuing. Unlike HPC work-stealing frameworks, we cannot
142.111 + * let workers spin indefinitely scanning for tasks when none can
142.112 + * be found immediately, and we cannot start/resume workers unless
142.113 + * there appear to be tasks available. On the other hand, we must
142.114 + * quickly prod them into action when new tasks are submitted or
142.115 + * generated. We park/unpark workers after placing in an event
142.116 + * wait queue when they cannot find work. This "queue" is actually
142.117 + * a simple Treiber stack, headed by the "id" field of ctl, plus a
142.118 + * 15bit counter value to both wake up waiters (by advancing their
142.119 + * count) and avoid ABA effects. Successors are held in worker
142.120 + * field "nextWait". Queuing deals with several intrinsic races,
142.121 + * mainly that a task-producing thread can miss seeing (and
142.122 + * signalling) another thread that gave up looking for work but
142.123 + * has not yet entered the wait queue. We solve this by requiring
142.124 + * a full sweep of all workers both before (in scan()) and after
142.125 + * (in tryAwaitWork()) a newly waiting worker is added to the wait
142.126 + * queue. During a rescan, the worker might release some other
142.127 + * queued worker rather than itself, which has the same net
142.128 + * effect. Because enqueued workers may actually be rescanning
142.129 + * rather than waiting, we set and clear the "parked" field of
142.130 + * ForkJoinWorkerThread to reduce unnecessary calls to unpark.
142.131 + * (Use of the parked field requires a secondary recheck to avoid
142.132 + * missed signals.)
142.133 + *
142.134 + * Signalling. We create or wake up workers only when there
142.135 + * appears to be at least one task they might be able to find and
142.136 + * execute. When a submission is added or another worker adds a
142.137 + * task to a queue that previously had two or fewer tasks, they
142.138 + * signal waiting workers (or trigger creation of new ones if
142.139 + * fewer than the given parallelism level -- see signalWork).
142.140 + * These primary signals are buttressed by signals during rescans
142.141 + * as well as those performed when a worker steals a task and
142.142 + * notices that there are more tasks too; together these cover the
142.143 + * signals needed in cases when more than two tasks are pushed
142.144 + * but untaken.
142.145 + *
142.146 + * Trimming workers. To release resources after periods of lack of
142.147 + * use, a worker starting to wait when the pool is quiescent will
142.148 + * time out and terminate if the pool has remained quiescent for
142.149 + * SHRINK_RATE nanosecs. This will slowly propagate, eventually
142.150 + * terminating all workers after long periods of non-use.
142.151 + *
142.152 + * Submissions. External submissions are maintained in an
142.153 + * array-based queue that is structured identically to
142.154 + * ForkJoinWorkerThread queues except for the use of
142.155 + * submissionLock in method addSubmission. Unlike the case for
142.156 + * worker queues, multiple external threads can add new
142.157 + * submissions, so adding requires a lock.
142.158 + *
142.159 + * Compensation. Beyond work-stealing support and lifecycle
142.160 + * control, the main responsibility of this framework is to take
142.161 + * actions when one worker is waiting to join a task stolen (or
142.162 + * always held by) another. Because we are multiplexing many
142.163 + * tasks on to a pool of workers, we can't just let them block (as
142.164 + * in Thread.join). We also cannot just reassign the joiner's
142.165 + * run-time stack with another and replace it later, which would
142.166 + * be a form of "continuation", that even if possible is not
142.167 + * necessarily a good idea since we sometimes need both an
142.168 + * unblocked task and its continuation to progress. Instead we
142.169 * combine two tactics:
142.170 *
142.171 * Helping: Arranging for the joiner to execute some task that it
142.172 * would be running if the steal had not occurred. Method
142.173 - * ForkJoinWorkerThread.helpJoinTask tracks joining->stealing
142.174 + * ForkJoinWorkerThread.joinTask tracks joining->stealing
142.175 * links to try to find such a task.
142.176 *
142.177 * Compensating: Unless there are already enough live threads,
142.178 - * method helpMaintainParallelism() may create or
142.179 - * re-activate a spare thread to compensate for blocked
142.180 - * joiners until they unblock.
142.181 - *
142.182 - * It is impossible to keep exactly the target (parallelism)
142.183 - * number of threads running at any given time. Determining
142.184 - * existence of conservatively safe helping targets, the
142.185 - * availability of already-created spares, and the apparent need
142.186 - * to create new spares are all racy and require heuristic
142.187 - * guidance, so we rely on multiple retries of each. Compensation
142.188 - * occurs in slow-motion. It is triggered only upon timeouts of
142.189 - * Object.wait used for joins. This reduces poor decisions that
142.190 - * would otherwise be made when threads are waiting for others
142.191 - * that are stalled because of unrelated activities such as
142.192 - * garbage collection.
142.193 + * method tryPreBlock() may create or re-activate a spare
142.194 + * thread to compensate for blocked joiners until they
142.195 + * unblock.
142.196 *
142.197 * The ManagedBlocker extension API can't use helping so relies
142.198 * only on compensation in method awaitBlocker.
142.199 *
142.200 - * The main throughput advantages of work-stealing stem from
142.201 - * decentralized control -- workers mostly steal tasks from each
142.202 - * other. We do not want to negate this by creating bottlenecks
142.203 - * implementing other management responsibilities. So we use a
142.204 - * collection of techniques that avoid, reduce, or cope well with
142.205 - * contention. These entail several instances of bit-packing into
142.206 - * CASable fields to maintain only the minimally required
142.207 - * atomicity. To enable such packing, we restrict maximum
142.208 - * parallelism to (1<<15)-1 (enabling twice this (to accommodate
142.209 - * unbalanced increments and decrements) to fit into a 16 bit
142.210 - * field, which is far in excess of normal operating range. Even
142.211 - * though updates to some of these bookkeeping fields do sometimes
142.212 - * contend with each other, they don't normally cache-contend with
142.213 - * updates to others enough to warrant memory padding or
142.214 - * isolation. So they are all held as fields of ForkJoinPool
142.215 - * objects. The main capabilities are as follows:
142.216 + * It is impossible to keep exactly the target parallelism number
142.217 + * of threads running at any given time. Determining the
142.218 + * existence of conservatively safe helping targets, the
142.219 + * availability of already-created spares, and the apparent need
142.220 + * to create new spares are all racy and require heuristic
142.221 + * guidance, so we rely on multiple retries of each. Currently,
142.222 + * in keeping with on-demand signalling policy, we compensate only
142.223 + * if blocking would leave less than one active (non-waiting,
142.224 + * non-blocked) worker. Additionally, to avoid some false alarms
142.225 + * due to GC, lagging counters, system activity, etc, compensated
142.226 + * blocking for joins is only attempted after rechecks stabilize
142.227 + * (retries are interspersed with Thread.yield, for good
142.228 + * citizenship). The variable blockedCount, incremented before
142.229 + * blocking and decremented after, is sometimes needed to
142.230 + * distinguish cases of waiting for work vs blocking on joins or
142.231 + * other managed sync. Both cases are equivalent for most pool
142.232 + * control, so we can update non-atomically. (Additionally,
142.233 + * contention on blockedCount alleviates some contention on ctl).
142.234 *
142.235 - * 1. Creating and removing workers. Workers are recorded in the
142.236 - * "workers" array. This is an array as opposed to some other data
142.237 - * structure to support index-based random steals by workers.
142.238 - * Updates to the array recording new workers and unrecording
142.239 - * terminated ones are protected from each other by a lock
142.240 - * (workerLock) but the array is otherwise concurrently readable,
142.241 - * and accessed directly by workers. To simplify index-based
142.242 - * operations, the array size is always a power of two, and all
142.243 - * readers must tolerate null slots. Currently, all worker thread
142.244 - * creation is on-demand, triggered by task submissions,
142.245 - * replacement of terminated workers, and/or compensation for
142.246 - * blocked workers. However, all other support code is set up to
142.247 - * work with other policies.
142.248 + * Shutdown and Termination. A call to shutdownNow atomically sets
142.249 + * the ctl stop bit and then (non-atomically) sets each workers
142.250 + * "terminate" status, cancels all unprocessed tasks, and wakes up
142.251 + * all waiting workers. Detecting whether termination should
142.252 + * commence after a non-abrupt shutdown() call requires more work
142.253 + * and bookkeeping. We need consensus about quiesence (i.e., that
142.254 + * there is no more work) which is reflected in active counts so
142.255 + * long as there are no current blockers, as well as possible
142.256 + * re-evaluations during independent changes in blocking or
142.257 + * quiescing workers.
142.258 *
142.259 - * To ensure that we do not hold on to worker references that
142.260 - * would prevent GC, ALL accesses to workers are via indices into
142.261 - * the workers array (which is one source of some of the unusual
142.262 - * code constructions here). In essence, the workers array serves
142.263 - * as a WeakReference mechanism. Thus for example the event queue
142.264 - * stores worker indices, not worker references. Access to the
142.265 - * workers in associated methods (for example releaseEventWaiters)
142.266 - * must both index-check and null-check the IDs. All such accesses
142.267 - * ignore bad IDs by returning out early from what they are doing,
142.268 - * since this can only be associated with shutdown, in which case
142.269 - * it is OK to give up. On termination, we just clobber these
142.270 - * data structures without trying to use them.
142.271 - *
142.272 - * 2. Bookkeeping for dynamically adding and removing workers. We
142.273 - * aim to approximately maintain the given level of parallelism.
142.274 - * When some workers are known to be blocked (on joins or via
142.275 - * ManagedBlocker), we may create or resume others to take their
142.276 - * place until they unblock (see below). Implementing this
142.277 - * requires counts of the number of "running" threads (i.e., those
142.278 - * that are neither blocked nor artificially suspended) as well as
142.279 - * the total number. These two values are packed into one field,
142.280 - * "workerCounts" because we need accurate snapshots when deciding
142.281 - * to create, resume or suspend. Note however that the
142.282 - * correspondence of these counts to reality is not guaranteed. In
142.283 - * particular updates for unblocked threads may lag until they
142.284 - * actually wake up.
142.285 - *
142.286 - * 3. Maintaining global run state. The run state of the pool
142.287 - * consists of a runLevel (SHUTDOWN, TERMINATING, etc) similar to
142.288 - * those in other Executor implementations, as well as a count of
142.289 - * "active" workers -- those that are, or soon will be, or
142.290 - * recently were executing tasks. The runLevel and active count
142.291 - * are packed together in order to correctly trigger shutdown and
142.292 - * termination. Without care, active counts can be subject to very
142.293 - * high contention. We substantially reduce this contention by
142.294 - * relaxing update rules. A worker must claim active status
142.295 - * prospectively, by activating if it sees that a submitted or
142.296 - * stealable task exists (it may find after activating that the
142.297 - * task no longer exists). It stays active while processing this
142.298 - * task (if it exists) and any other local subtasks it produces,
142.299 - * until it cannot find any other tasks. It then tries
142.300 - * inactivating (see method preStep), but upon update contention
142.301 - * instead scans for more tasks, later retrying inactivation if it
142.302 - * doesn't find any.
142.303 - *
142.304 - * 4. Managing idle workers waiting for tasks. We cannot let
142.305 - * workers spin indefinitely scanning for tasks when none are
142.306 - * available. On the other hand, we must quickly prod them into
142.307 - * action when new tasks are submitted or generated. We
142.308 - * park/unpark these idle workers using an event-count scheme.
142.309 - * Field eventCount is incremented upon events that may enable
142.310 - * workers that previously could not find a task to now find one:
142.311 - * Submission of a new task to the pool, or another worker pushing
142.312 - * a task onto a previously empty queue. (We also use this
142.313 - * mechanism for configuration and termination actions that
142.314 - * require wakeups of idle workers). Each worker maintains its
142.315 - * last known event count, and blocks when a scan for work did not
142.316 - * find a task AND its lastEventCount matches the current
142.317 - * eventCount. Waiting idle workers are recorded in a variant of
142.318 - * Treiber stack headed by field eventWaiters which, when nonzero,
142.319 - * encodes the thread index and count awaited for by the worker
142.320 - * thread most recently calling eventSync. This thread in turn has
142.321 - * a record (field nextEventWaiter) for the next waiting worker.
142.322 - * In addition to allowing simpler decisions about need for
142.323 - * wakeup, the event count bits in eventWaiters serve the role of
142.324 - * tags to avoid ABA errors in Treiber stacks. Upon any wakeup,
142.325 - * released threads also try to release at most two others. The
142.326 - * net effect is a tree-like diffusion of signals, where released
142.327 - * threads (and possibly others) help with unparks. To further
142.328 - * reduce contention effects a bit, failed CASes to increment
142.329 - * field eventCount are tolerated without retries in signalWork.
142.330 - * Conceptually they are merged into the same event, which is OK
142.331 - * when their only purpose is to enable workers to scan for work.
142.332 - *
142.333 - * 5. Managing suspension of extra workers. When a worker notices
142.334 - * (usually upon timeout of a wait()) that there are too few
142.335 - * running threads, we may create a new thread to maintain
142.336 - * parallelism level, or at least avoid starvation. Usually, extra
142.337 - * threads are needed for only very short periods, yet join
142.338 - * dependencies are such that we sometimes need them in
142.339 - * bursts. Rather than create new threads each time this happens,
142.340 - * we suspend no-longer-needed extra ones as "spares". For most
142.341 - * purposes, we don't distinguish "extra" spare threads from
142.342 - * normal "core" threads: On each call to preStep (the only point
142.343 - * at which we can do this) a worker checks to see if there are
142.344 - * now too many running workers, and if so, suspends itself.
142.345 - * Method helpMaintainParallelism looks for suspended threads to
142.346 - * resume before considering creating a new replacement. The
142.347 - * spares themselves are encoded on another variant of a Treiber
142.348 - * Stack, headed at field "spareWaiters". Note that the use of
142.349 - * spares is intrinsically racy. One thread may become a spare at
142.350 - * about the same time as another is needlessly being created. We
142.351 - * counteract this and related slop in part by requiring resumed
142.352 - * spares to immediately recheck (in preStep) to see whether they
142.353 - * should re-suspend.
142.354 - *
142.355 - * 6. Killing off unneeded workers. A timeout mechanism is used to
142.356 - * shed unused workers: The oldest (first) event queue waiter uses
142.357 - * a timed rather than hard wait. When this wait times out without
142.358 - * a normal wakeup, it tries to shutdown any one (for convenience
142.359 - * the newest) other spare or event waiter via
142.360 - * tryShutdownUnusedWorker. This eventually reduces the number of
142.361 - * worker threads to a minimum of one after a long enough period
142.362 - * without use.
142.363 - *
142.364 - * 7. Deciding when to create new workers. The main dynamic
142.365 - * control in this class is deciding when to create extra threads
142.366 - * in method helpMaintainParallelism. We would like to keep
142.367 - * exactly #parallelism threads running, which is an impossible
142.368 - * task. We always need to create one when the number of running
142.369 - * threads would become zero and all workers are busy. Beyond
142.370 - * this, we must rely on heuristics that work well in the
142.371 - * presence of transient phenomena such as GC stalls, dynamic
142.372 - * compilation, and wake-up lags. These transients are extremely
142.373 - * common -- we are normally trying to fully saturate the CPUs on
142.374 - * a machine, so almost any activity other than running tasks
142.375 - * impedes accuracy. Our main defense is to allow parallelism to
142.376 - * lapse for a while during joins, and use a timeout to see if,
142.377 - * after the resulting settling, there is still a need for
142.378 - * additional workers. This also better copes with the fact that
142.379 - * some of the methods in this class tend to never become compiled
142.380 - * (but are interpreted), so some components of the entire set of
142.381 - * controls might execute 100 times faster than others. And
142.382 - * similarly for cases where the apparent lack of work is just due
142.383 - * to GC stalls and other transient system activity.
142.384 - *
142.385 - * Beware that there is a lot of representation-level coupling
142.386 + * Style notes: There is a lot of representation-level coupling
142.387 * among classes ForkJoinPool, ForkJoinWorkerThread, and
142.388 - * ForkJoinTask. For example, direct access to "workers" array by
142.389 + * ForkJoinTask. Most fields of ForkJoinWorkerThread maintain
142.390 + * data structures managed by ForkJoinPool, so are directly
142.391 + * accessed. Conversely we allow access to "workers" array by
142.392 * workers, and direct access to ForkJoinTask.status by both
142.393 * ForkJoinPool and ForkJoinWorkerThread. There is little point
142.394 * trying to reduce this, since any associated future changes in
142.395 * representations will need to be accompanied by algorithmic
142.396 - * changes anyway.
142.397 + * changes anyway. All together, these low-level implementation
142.398 + * choices produce as much as a factor of 4 performance
142.399 + * improvement compared to naive implementations, and enable the
142.400 + * processing of billions of tasks per second, at the expense of
142.401 + * some ugliness.
142.402 *
142.403 - * Style notes: There are lots of inline assignments (of form
142.404 - * "while ((local = field) != 0)") which are usually the simplest
142.405 - * way to ensure the required read orderings (which are sometimes
142.406 - * critical). Also several occurrences of the unusual "do {}
142.407 - * while (!cas...)" which is the simplest way to force an update of
142.408 - * a CAS'ed variable. There are also other coding oddities that
142.409 - * help some methods perform reasonably even when interpreted (not
142.410 - * compiled), at the expense of some messy constructions that
142.411 - * reduce byte code counts.
142.412 + * Methods signalWork() and scan() are the main bottlenecks so are
142.413 + * especially heavily micro-optimized/mangled. There are lots of
142.414 + * inline assignments (of form "while ((local = field) != 0)")
142.415 + * which are usually the simplest way to ensure the required read
142.416 + * orderings (which are sometimes critical). This leads to a
142.417 + * "C"-like style of listing declarations of these locals at the
142.418 + * heads of methods or blocks. There are several occurrences of
142.419 + * the unusual "do {} while (!cas...)" which is the simplest way
142.420 + * to force an update of a CAS'ed variable. There are also other
142.421 + * coding oddities that help some methods perform reasonably even
142.422 + * when interpreted (not compiled).
142.423 *
142.424 - * The order of declarations in this file is: (1) statics (2)
142.425 - * fields (along with constants used when unpacking some of them)
142.426 - * (3) internal control methods (4) callbacks and other support
142.427 - * for ForkJoinTask and ForkJoinWorkerThread classes, (5) exported
142.428 - * methods (plus a few little helpers).
142.429 + * The order of declarations in this file is: (1) declarations of
142.430 + * statics (2) fields (along with constants used when unpacking
142.431 + * some of them), listed in an order that tends to reduce
142.432 + * contention among them a bit under most JVMs. (3) internal
142.433 + * control methods (4) callbacks and other support for
142.434 + * ForkJoinTask and ForkJoinWorkerThread classes, (5) exported
142.435 + * methods (plus a few little helpers). (6) static block
142.436 + * initializing all statics in a minimally dependent order.
142.437 */
142.438
142.439 /**
142.440 @@ -425,15 +396,13 @@
142.441 * overridden in ForkJoinPool constructors.
142.442 */
142.443 public static final ForkJoinWorkerThreadFactory
142.444 - defaultForkJoinWorkerThreadFactory =
142.445 - new DefaultForkJoinWorkerThreadFactory();
142.446 + defaultForkJoinWorkerThreadFactory;
142.447
142.448 /**
142.449 * Permission required for callers of methods that may start or
142.450 * kill threads.
142.451 */
142.452 - private static final RuntimePermission modifyThreadPermission =
142.453 - new RuntimePermission("modifyThread");
142.454 + private static final RuntimePermission modifyThreadPermission;
142.455
142.456 /**
142.457 * If there is a security manager, makes sure caller has
142.458 @@ -448,63 +417,59 @@
142.459 /**
142.460 * Generator for assigning sequence numbers as pool names.
142.461 */
142.462 - private static final AtomicInteger poolNumberGenerator =
142.463 - new AtomicInteger();
142.464 + private static final AtomicInteger poolNumberGenerator;
142.465
142.466 /**
142.467 - * The time to block in a join (see awaitJoin) before checking if
142.468 - * a new worker should be (re)started to maintain parallelism
142.469 - * level. The value should be short enough to maintain global
142.470 - * responsiveness and progress but long enough to avoid
142.471 - * counterproductive firings during GC stalls or unrelated system
142.472 - * activity, and to not bog down systems with continual re-firings
142.473 - * on GCs or legitimately long waits.
142.474 + * Generator for initial random seeds for worker victim
142.475 + * selection. This is used only to create initial seeds. Random
142.476 + * steals use a cheaper xorshift generator per steal attempt. We
142.477 + * don't expect much contention on seedGenerator, so just use a
142.478 + * plain Random.
142.479 */
142.480 - private static final long JOIN_TIMEOUT_MILLIS = 250L; // 4 per second
142.481 + static final Random workerSeedGenerator;
142.482
142.483 /**
142.484 - * The wakeup interval (in nanoseconds) for the oldest worker
142.485 - * waiting for an event to invoke tryShutdownUnusedWorker to
142.486 - * shrink the number of workers. The exact value does not matter
142.487 - * too much. It must be short enough to release resources during
142.488 - * sustained periods of idleness, but not so short that threads
142.489 - * are continually re-created.
142.490 + * Array holding all worker threads in the pool. Initialized upon
142.491 + * construction. Array size must be a power of two. Updates and
142.492 + * replacements are protected by scanGuard, but the array is
142.493 + * always kept in a consistent enough state to be randomly
142.494 + * accessed without locking by workers performing work-stealing,
142.495 + * as well as other traversal-based methods in this class, so long
142.496 + * as reads memory-acquire by first reading ctl. All readers must
142.497 + * tolerate that some array slots may be null.
142.498 */
142.499 - private static final long SHRINK_RATE_NANOS =
142.500 - 30L * 1000L * 1000L * 1000L; // 2 per minute
142.501 + ForkJoinWorkerThread[] workers;
142.502
142.503 /**
142.504 - * Absolute bound for parallelism level. Twice this number plus
142.505 - * one (i.e., 0xfff) must fit into a 16bit field to enable
142.506 - * word-packing for some counts and indices.
142.507 + * Initial size for submission queue array. Must be a power of
142.508 + * two. In many applications, these always stay small so we use a
142.509 + * small initial cap.
142.510 */
142.511 - private static final int MAX_WORKERS = 0x7fff;
142.512 + private static final int INITIAL_QUEUE_CAPACITY = 8;
142.513
142.514 /**
142.515 - * Array holding all worker threads in the pool. Array size must
142.516 - * be a power of two. Updates and replacements are protected by
142.517 - * workerLock, but the array is always kept in a consistent enough
142.518 - * state to be randomly accessed without locking by workers
142.519 - * performing work-stealing, as well as other traversal-based
142.520 - * methods in this class. All readers must tolerate that some
142.521 - * array slots may be null.
142.522 + * Maximum size for submission queue array. Must be a power of two
142.523 + * less than or equal to 1 << (31 - width of array entry) to
142.524 + * ensure lack of index wraparound, but is capped at a lower
142.525 + * value to help users trap runaway computations.
142.526 */
142.527 - volatile ForkJoinWorkerThread[] workers;
142.528 + private static final int MAXIMUM_QUEUE_CAPACITY = 1 << 24; // 16M
142.529
142.530 /**
142.531 - * Queue for external submissions.
142.532 + * Array serving as submission queue. Initialized upon construction.
142.533 */
142.534 - private final LinkedTransferQueue<ForkJoinTask<?>> submissionQueue;
142.535 + private ForkJoinTask<?>[] submissionQueue;
142.536
142.537 /**
142.538 - * Lock protecting updates to workers array.
142.539 + * Lock protecting submissions array for addSubmission
142.540 */
142.541 - private final ReentrantLock workerLock;
142.542 + private final ReentrantLock submissionLock;
142.543
142.544 /**
142.545 - * Latch released upon termination.
142.546 + * Condition for awaitTermination, using submissionLock for
142.547 + * convenience.
142.548 */
142.549 - private final Phaser termination;
142.550 + private final Condition termination;
142.551
142.552 /**
142.553 * Creation factory for worker threads.
142.554 @@ -512,227 +477,719 @@
142.555 private final ForkJoinWorkerThreadFactory factory;
142.556
142.557 /**
142.558 + * The uncaught exception handler used when any worker abruptly
142.559 + * terminates.
142.560 + */
142.561 + final Thread.UncaughtExceptionHandler ueh;
142.562 +
142.563 + /**
142.564 + * Prefix for assigning names to worker threads
142.565 + */
142.566 + private final String workerNamePrefix;
142.567 +
142.568 + /**
142.569 * Sum of per-thread steal counts, updated only when threads are
142.570 * idle or terminating.
142.571 */
142.572 private volatile long stealCount;
142.573
142.574 /**
142.575 - * Encoded record of top of Treiber stack of threads waiting for
142.576 - * events. The top 32 bits contain the count being waited for. The
142.577 - * bottom 16 bits contains one plus the pool index of waiting
142.578 - * worker thread. (Bits 16-31 are unused.)
142.579 + * Main pool control -- a long packed with:
142.580 + * AC: Number of active running workers minus target parallelism (16 bits)
142.581 + * TC: Number of total workers minus target parallelism (16bits)
142.582 + * ST: true if pool is terminating (1 bit)
142.583 + * EC: the wait count of top waiting thread (15 bits)
142.584 + * ID: ~poolIndex of top of Treiber stack of waiting threads (16 bits)
142.585 + *
142.586 + * When convenient, we can extract the upper 32 bits of counts and
142.587 + * the lower 32 bits of queue state, u = (int)(ctl >>> 32) and e =
142.588 + * (int)ctl. The ec field is never accessed alone, but always
142.589 + * together with id and st. The offsets of counts by the target
142.590 + * parallelism and the positionings of fields makes it possible to
142.591 + * perform the most common checks via sign tests of fields: When
142.592 + * ac is negative, there are not enough active workers, when tc is
142.593 + * negative, there are not enough total workers, when id is
142.594 + * negative, there is at least one waiting worker, and when e is
142.595 + * negative, the pool is terminating. To deal with these possibly
142.596 + * negative fields, we use casts in and out of "short" and/or
142.597 + * signed shifts to maintain signedness.
142.598 */
142.599 - private volatile long eventWaiters;
142.600 + volatile long ctl;
142.601
142.602 - private static final int EVENT_COUNT_SHIFT = 32;
142.603 - private static final int WAITER_ID_MASK = (1 << 16) - 1;
142.604 + // bit positions/shifts for fields
142.605 + private static final int AC_SHIFT = 48;
142.606 + private static final int TC_SHIFT = 32;
142.607 + private static final int ST_SHIFT = 31;
142.608 + private static final int EC_SHIFT = 16;
142.609
142.610 - /**
142.611 - * A counter for events that may wake up worker threads:
142.612 - * - Submission of a new task to the pool
142.613 - * - A worker pushing a task on an empty queue
142.614 - * - termination
142.615 - */
142.616 - private volatile int eventCount;
142.617 + // bounds
142.618 + private static final int MAX_ID = 0x7fff; // max poolIndex
142.619 + private static final int SMASK = 0xffff; // mask short bits
142.620 + private static final int SHORT_SIGN = 1 << 15;
142.621 + private static final int INT_SIGN = 1 << 31;
142.622
142.623 - /**
142.624 - * Encoded record of top of Treiber stack of spare threads waiting
142.625 - * for resumption. The top 16 bits contain an arbitrary count to
142.626 - * avoid ABA effects. The bottom 16bits contains one plus the pool
142.627 - * index of waiting worker thread.
142.628 - */
142.629 - private volatile int spareWaiters;
142.630 + // masks
142.631 + private static final long STOP_BIT = 0x0001L << ST_SHIFT;
142.632 + private static final long AC_MASK = ((long)SMASK) << AC_SHIFT;
142.633 + private static final long TC_MASK = ((long)SMASK) << TC_SHIFT;
142.634
142.635 - private static final int SPARE_COUNT_SHIFT = 16;
142.636 - private static final int SPARE_ID_MASK = (1 << 16) - 1;
142.637 + // units for incrementing and decrementing
142.638 + private static final long TC_UNIT = 1L << TC_SHIFT;
142.639 + private static final long AC_UNIT = 1L << AC_SHIFT;
142.640
142.641 - /**
142.642 - * Lifecycle control. The low word contains the number of workers
142.643 - * that are (probably) executing tasks. This value is atomically
142.644 - * incremented before a worker gets a task to run, and decremented
142.645 - * when a worker has no tasks and cannot find any. Bits 16-18
142.646 - * contain runLevel value. When all are zero, the pool is
142.647 - * running. Level transitions are monotonic (running -> shutdown
142.648 - * -> terminating -> terminated) so each transition adds a bit.
142.649 - * These are bundled together to ensure consistent read for
142.650 - * termination checks (i.e., that runLevel is at least SHUTDOWN
142.651 - * and active threads is zero).
142.652 - *
142.653 - * Notes: Most direct CASes are dependent on these bitfield
142.654 - * positions. Also, this field is non-private to enable direct
142.655 - * performance-sensitive CASes in ForkJoinWorkerThread.
142.656 - */
142.657 - volatile int runState;
142.658 + // masks and units for dealing with u = (int)(ctl >>> 32)
142.659 + private static final int UAC_SHIFT = AC_SHIFT - 32;
142.660 + private static final int UTC_SHIFT = TC_SHIFT - 32;
142.661 + private static final int UAC_MASK = SMASK << UAC_SHIFT;
142.662 + private static final int UTC_MASK = SMASK << UTC_SHIFT;
142.663 + private static final int UAC_UNIT = 1 << UAC_SHIFT;
142.664 + private static final int UTC_UNIT = 1 << UTC_SHIFT;
142.665
142.666 - // Note: The order among run level values matters.
142.667 - private static final int RUNLEVEL_SHIFT = 16;
142.668 - private static final int SHUTDOWN = 1 << RUNLEVEL_SHIFT;
142.669 - private static final int TERMINATING = 1 << (RUNLEVEL_SHIFT + 1);
142.670 - private static final int TERMINATED = 1 << (RUNLEVEL_SHIFT + 2);
142.671 - private static final int ACTIVE_COUNT_MASK = (1 << RUNLEVEL_SHIFT) - 1;
142.672 -
142.673 - /**
142.674 - * Holds number of total (i.e., created and not yet terminated)
142.675 - * and running (i.e., not blocked on joins or other managed sync)
142.676 - * threads, packed together to ensure consistent snapshot when
142.677 - * making decisions about creating and suspending spare
142.678 - * threads. Updated only by CAS. Note that adding a new worker
142.679 - * requires incrementing both counts, since workers start off in
142.680 - * running state.
142.681 - */
142.682 - private volatile int workerCounts;
142.683 -
142.684 - private static final int TOTAL_COUNT_SHIFT = 16;
142.685 - private static final int RUNNING_COUNT_MASK = (1 << TOTAL_COUNT_SHIFT) - 1;
142.686 - private static final int ONE_RUNNING = 1;
142.687 - private static final int ONE_TOTAL = 1 << TOTAL_COUNT_SHIFT;
142.688 + // masks and units for dealing with e = (int)ctl
142.689 + private static final int E_MASK = 0x7fffffff; // no STOP_BIT
142.690 + private static final int EC_UNIT = 1 << EC_SHIFT;
142.691
142.692 /**
142.693 * The target parallelism level.
142.694 - * Accessed directly by ForkJoinWorkerThreads.
142.695 */
142.696 final int parallelism;
142.697
142.698 /**
142.699 + * Index (mod submission queue length) of next element to take
142.700 + * from submission queue. Usage is identical to that for
142.701 + * per-worker queues -- see ForkJoinWorkerThread internal
142.702 + * documentation.
142.703 + */
142.704 + volatile int queueBase;
142.705 +
142.706 + /**
142.707 + * Index (mod submission queue length) of next element to add
142.708 + * in submission queue. Usage is identical to that for
142.709 + * per-worker queues -- see ForkJoinWorkerThread internal
142.710 + * documentation.
142.711 + */
142.712 + int queueTop;
142.713 +
142.714 + /**
142.715 + * True when shutdown() has been called.
142.716 + */
142.717 + volatile boolean shutdown;
142.718 +
142.719 + /**
142.720 * True if use local fifo, not default lifo, for local polling
142.721 * Read by, and replicated by ForkJoinWorkerThreads
142.722 */
142.723 final boolean locallyFifo;
142.724
142.725 /**
142.726 - * The uncaught exception handler used when any worker abruptly
142.727 - * terminates.
142.728 + * The number of threads in ForkJoinWorkerThreads.helpQuiescePool.
142.729 + * When non-zero, suppresses automatic shutdown when active
142.730 + * counts become zero.
142.731 */
142.732 - private final Thread.UncaughtExceptionHandler ueh;
142.733 + volatile int quiescerCount;
142.734
142.735 /**
142.736 - * Pool number, just for assigning useful names to worker threads
142.737 + * The number of threads blocked in join.
142.738 */
142.739 - private final int poolNumber;
142.740 -
142.741 - // Utilities for CASing fields. Note that most of these
142.742 - // are usually manually inlined by callers
142.743 + volatile int blockedCount;
142.744
142.745 /**
142.746 - * Increments running count part of workerCounts.
142.747 + * Counter for worker Thread names (unrelated to their poolIndex)
142.748 */
142.749 - final void incrementRunningCount() {
142.750 - int c;
142.751 - do {} while (!UNSAFE.compareAndSwapInt(this, workerCountsOffset,
142.752 - c = workerCounts,
142.753 - c + ONE_RUNNING));
142.754 + private volatile int nextWorkerNumber;
142.755 +
142.756 + /**
142.757 + * The index for the next created worker. Accessed under scanGuard.
142.758 + */
142.759 + private int nextWorkerIndex;
142.760 +
142.761 + /**
142.762 + * SeqLock and index masking for updates to workers array. Locked
142.763 + * when SG_UNIT is set. Unlocking clears bit by adding
142.764 + * SG_UNIT. Staleness of read-only operations can be checked by
142.765 + * comparing scanGuard to value before the reads. The low 16 bits
142.766 + * (i.e, anding with SMASK) hold (the smallest power of two
142.767 + * covering all worker indices, minus one, and is used to avoid
142.768 + * dealing with large numbers of null slots when the workers array
142.769 + * is overallocated.
142.770 + */
142.771 + volatile int scanGuard;
142.772 +
142.773 + private static final int SG_UNIT = 1 << 16;
142.774 +
142.775 + /**
142.776 + * The wakeup interval (in nanoseconds) for a worker waiting for a
142.777 + * task when the pool is quiescent to instead try to shrink the
142.778 + * number of workers. The exact value does not matter too
142.779 + * much. It must be short enough to release resources during
142.780 + * sustained periods of idleness, but not so short that threads
142.781 + * are continually re-created.
142.782 + */
142.783 + private static final long SHRINK_RATE =
142.784 + 4L * 1000L * 1000L * 1000L; // 4 seconds
142.785 +
142.786 + /**
142.787 + * Top-level loop for worker threads: On each step: if the
142.788 + * previous step swept through all queues and found no tasks, or
142.789 + * there are excess threads, then possibly blocks. Otherwise,
142.790 + * scans for and, if found, executes a task. Returns when pool
142.791 + * and/or worker terminate.
142.792 + *
142.793 + * @param w the worker
142.794 + */
142.795 + final void work(ForkJoinWorkerThread w) {
142.796 + boolean swept = false; // true on empty scans
142.797 + long c;
142.798 + while (!w.terminate && (int)(c = ctl) >= 0) {
142.799 + int a; // active count
142.800 + if (!swept && (a = (int)(c >> AC_SHIFT)) <= 0)
142.801 + swept = scan(w, a);
142.802 + else if (tryAwaitWork(w, c))
142.803 + swept = false;
142.804 + }
142.805 }
142.806
142.807 - /**
142.808 - * Tries to increment running count part of workerCounts.
142.809 - */
142.810 - final boolean tryIncrementRunningCount() {
142.811 - int c;
142.812 - return UNSAFE.compareAndSwapInt(this, workerCountsOffset,
142.813 - c = workerCounts,
142.814 - c + ONE_RUNNING);
142.815 - }
142.816 + // Signalling
142.817
142.818 /**
142.819 - * Tries to decrement running count unless already zero.
142.820 + * Wakes up or creates a worker.
142.821 */
142.822 - final boolean tryDecrementRunningCount() {
142.823 - int wc = workerCounts;
142.824 - if ((wc & RUNNING_COUNT_MASK) == 0)
142.825 - return false;
142.826 - return UNSAFE.compareAndSwapInt(this, workerCountsOffset,
142.827 - wc, wc - ONE_RUNNING);
142.828 - }
142.829 -
142.830 - /**
142.831 - * Forces decrement of encoded workerCounts, awaiting nonzero if
142.832 - * (rarely) necessary when other count updates lag.
142.833 - *
142.834 - * @param dr -- either zero or ONE_RUNNING
142.835 - * @param dt -- either zero or ONE_TOTAL
142.836 - */
142.837 - private void decrementWorkerCounts(int dr, int dt) {
142.838 - for (;;) {
142.839 - int wc = workerCounts;
142.840 - if ((wc & RUNNING_COUNT_MASK) - dr < 0 ||
142.841 - (wc >>> TOTAL_COUNT_SHIFT) - dt < 0) {
142.842 - if ((runState & TERMINATED) != 0)
142.843 - return; // lagging termination on a backout
142.844 - Thread.yield();
142.845 + final void signalWork() {
142.846 + /*
142.847 + * The while condition is true if: (there is are too few total
142.848 + * workers OR there is at least one waiter) AND (there are too
142.849 + * few active workers OR the pool is terminating). The value
142.850 + * of e distinguishes the remaining cases: zero (no waiters)
142.851 + * for create, negative if terminating (in which case do
142.852 + * nothing), else release a waiter. The secondary checks for
142.853 + * release (non-null array etc) can fail if the pool begins
142.854 + * terminating after the test, and don't impose any added cost
142.855 + * because JVMs must perform null and bounds checks anyway.
142.856 + */
142.857 + long c; int e, u;
142.858 + while ((((e = (int)(c = ctl)) | (u = (int)(c >>> 32))) &
142.859 + (INT_SIGN|SHORT_SIGN)) == (INT_SIGN|SHORT_SIGN) && e >= 0) {
142.860 + if (e > 0) { // release a waiting worker
142.861 + int i; ForkJoinWorkerThread w; ForkJoinWorkerThread[] ws;
142.862 + if ((ws = workers) == null ||
142.863 + (i = ~e & SMASK) >= ws.length ||
142.864 + (w = ws[i]) == null)
142.865 + break;
142.866 + long nc = (((long)(w.nextWait & E_MASK)) |
142.867 + ((long)(u + UAC_UNIT) << 32));
142.868 + if (w.eventCount == e &&
142.869 + UNSAFE.compareAndSwapLong(this, ctlOffset, c, nc)) {
142.870 + w.eventCount = (e + EC_UNIT) & E_MASK;
142.871 + if (w.parked)
142.872 + UNSAFE.unpark(w);
142.873 + break;
142.874 + }
142.875 }
142.876 - if (UNSAFE.compareAndSwapInt(this, workerCountsOffset,
142.877 - wc, wc - (dr + dt)))
142.878 - return;
142.879 + else if (UNSAFE.compareAndSwapLong
142.880 + (this, ctlOffset, c,
142.881 + (long)(((u + UTC_UNIT) & UTC_MASK) |
142.882 + ((u + UAC_UNIT) & UAC_MASK)) << 32)) {
142.883 + addWorker();
142.884 + break;
142.885 + }
142.886 }
142.887 }
142.888
142.889 /**
142.890 - * Tries decrementing active count; fails on contention.
142.891 - * Called when workers cannot find tasks to run.
142.892 + * Variant of signalWork to help release waiters on rescans.
142.893 + * Tries once to release a waiter if active count < 0.
142.894 + *
142.895 + * @return false if failed due to contention, else true
142.896 */
142.897 - final boolean tryDecrementActiveCount() {
142.898 - int c;
142.899 - return UNSAFE.compareAndSwapInt(this, runStateOffset,
142.900 - c = runState, c - 1);
142.901 + private boolean tryReleaseWaiter() {
142.902 + long c; int e, i; ForkJoinWorkerThread w; ForkJoinWorkerThread[] ws;
142.903 + if ((e = (int)(c = ctl)) > 0 &&
142.904 + (int)(c >> AC_SHIFT) < 0 &&
142.905 + (ws = workers) != null &&
142.906 + (i = ~e & SMASK) < ws.length &&
142.907 + (w = ws[i]) != null) {
142.908 + long nc = ((long)(w.nextWait & E_MASK) |
142.909 + ((c + AC_UNIT) & (AC_MASK|TC_MASK)));
142.910 + if (w.eventCount != e ||
142.911 + !UNSAFE.compareAndSwapLong(this, ctlOffset, c, nc))
142.912 + return false;
142.913 + w.eventCount = (e + EC_UNIT) & E_MASK;
142.914 + if (w.parked)
142.915 + UNSAFE.unpark(w);
142.916 + }
142.917 + return true;
142.918 + }
142.919 +
142.920 + // Scanning for tasks
142.921 +
142.922 + /**
142.923 + * Scans for and, if found, executes one task. Scans start at a
142.924 + * random index of workers array, and randomly select the first
142.925 + * (2*#workers)-1 probes, and then, if all empty, resort to 2
142.926 + * circular sweeps, which is necessary to check quiescence. and
142.927 + * taking a submission only if no stealable tasks were found. The
142.928 + * steal code inside the loop is a specialized form of
142.929 + * ForkJoinWorkerThread.deqTask, followed bookkeeping to support
142.930 + * helpJoinTask and signal propagation. The code for submission
142.931 + * queues is almost identical. On each steal, the worker completes
142.932 + * not only the task, but also all local tasks that this task may
142.933 + * have generated. On detecting staleness or contention when
142.934 + * trying to take a task, this method returns without finishing
142.935 + * sweep, which allows global state rechecks before retry.
142.936 + *
142.937 + * @param w the worker
142.938 + * @param a the number of active workers
142.939 + * @return true if swept all queues without finding a task
142.940 + */
142.941 + private boolean scan(ForkJoinWorkerThread w, int a) {
142.942 + int g = scanGuard; // mask 0 avoids useless scans if only one active
142.943 + int m = (parallelism == 1 - a && blockedCount == 0) ? 0 : g & SMASK;
142.944 + ForkJoinWorkerThread[] ws = workers;
142.945 + if (ws == null || ws.length <= m) // staleness check
142.946 + return false;
142.947 + for (int r = w.seed, k = r, j = -(m + m); j <= m + m; ++j) {
142.948 + ForkJoinTask<?> t; ForkJoinTask<?>[] q; int b, i;
142.949 + ForkJoinWorkerThread v = ws[k & m];
142.950 + if (v != null && (b = v.queueBase) != v.queueTop &&
142.951 + (q = v.queue) != null && (i = (q.length - 1) & b) >= 0) {
142.952 + long u = (i << ASHIFT) + ABASE;
142.953 + if ((t = q[i]) != null && v.queueBase == b &&
142.954 + UNSAFE.compareAndSwapObject(q, u, t, null)) {
142.955 + int d = (v.queueBase = b + 1) - v.queueTop;
142.956 + v.stealHint = w.poolIndex;
142.957 + if (d != 0)
142.958 + signalWork(); // propagate if nonempty
142.959 + w.execTask(t);
142.960 + }
142.961 + r ^= r << 13; r ^= r >>> 17; w.seed = r ^ (r << 5);
142.962 + return false; // store next seed
142.963 + }
142.964 + else if (j < 0) { // xorshift
142.965 + r ^= r << 13; r ^= r >>> 17; k = r ^= r << 5;
142.966 + }
142.967 + else
142.968 + ++k;
142.969 + }
142.970 + if (scanGuard != g) // staleness check
142.971 + return false;
142.972 + else { // try to take submission
142.973 + ForkJoinTask<?> t; ForkJoinTask<?>[] q; int b, i;
142.974 + if ((b = queueBase) != queueTop &&
142.975 + (q = submissionQueue) != null &&
142.976 + (i = (q.length - 1) & b) >= 0) {
142.977 + long u = (i << ASHIFT) + ABASE;
142.978 + if ((t = q[i]) != null && queueBase == b &&
142.979 + UNSAFE.compareAndSwapObject(q, u, t, null)) {
142.980 + queueBase = b + 1;
142.981 + w.execTask(t);
142.982 + }
142.983 + return false;
142.984 + }
142.985 + return true; // all queues empty
142.986 + }
142.987 }
142.988
142.989 /**
142.990 - * Advances to at least the given level. Returns true if not
142.991 - * already in at least the given level.
142.992 + * Tries to enqueue worker w in wait queue and await change in
142.993 + * worker's eventCount. If the pool is quiescent, possibly
142.994 + * terminates worker upon exit. Otherwise, before blocking,
142.995 + * rescans queues to avoid missed signals. Upon finding work,
142.996 + * releases at least one worker (which may be the current
142.997 + * worker). Rescans restart upon detected staleness or failure to
142.998 + * release due to contention. Note the unusual conventions about
142.999 + * Thread.interrupt here and elsewhere: Because interrupts are
142.1000 + * used solely to alert threads to check termination, which is
142.1001 + * checked here anyway, we clear status (using Thread.interrupted)
142.1002 + * before any call to park, so that park does not immediately
142.1003 + * return due to status being set via some other unrelated call to
142.1004 + * interrupt in user code.
142.1005 + *
142.1006 + * @param w the calling worker
142.1007 + * @param c the ctl value on entry
142.1008 + * @return true if waited or another thread was released upon enq
142.1009 */
142.1010 - private boolean advanceRunLevel(int level) {
142.1011 - for (;;) {
142.1012 - int s = runState;
142.1013 - if ((s & level) != 0)
142.1014 - return false;
142.1015 - if (UNSAFE.compareAndSwapInt(this, runStateOffset, s, s | level))
142.1016 + private boolean tryAwaitWork(ForkJoinWorkerThread w, long c) {
142.1017 + int v = w.eventCount;
142.1018 + w.nextWait = (int)c; // w's successor record
142.1019 + long nc = (long)(v & E_MASK) | ((c - AC_UNIT) & (AC_MASK|TC_MASK));
142.1020 + if (ctl != c || !UNSAFE.compareAndSwapLong(this, ctlOffset, c, nc)) {
142.1021 + long d = ctl; // return true if lost to a deq, to force scan
142.1022 + return (int)d != (int)c && ((d - c) & AC_MASK) >= 0L;
142.1023 + }
142.1024 + for (int sc = w.stealCount; sc != 0;) { // accumulate stealCount
142.1025 + long s = stealCount;
142.1026 + if (UNSAFE.compareAndSwapLong(this, stealCountOffset, s, s + sc))
142.1027 + sc = w.stealCount = 0;
142.1028 + else if (w.eventCount != v)
142.1029 + return true; // update next time
142.1030 + }
142.1031 + if (parallelism + (int)(nc >> AC_SHIFT) == 0 &&
142.1032 + blockedCount == 0 && quiescerCount == 0)
142.1033 + idleAwaitWork(w, nc, c, v); // quiescent
142.1034 + for (boolean rescanned = false;;) {
142.1035 + if (w.eventCount != v)
142.1036 return true;
142.1037 + if (!rescanned) {
142.1038 + int g = scanGuard, m = g & SMASK;
142.1039 + ForkJoinWorkerThread[] ws = workers;
142.1040 + if (ws != null && m < ws.length) {
142.1041 + rescanned = true;
142.1042 + for (int i = 0; i <= m; ++i) {
142.1043 + ForkJoinWorkerThread u = ws[i];
142.1044 + if (u != null) {
142.1045 + if (u.queueBase != u.queueTop &&
142.1046 + !tryReleaseWaiter())
142.1047 + rescanned = false; // contended
142.1048 + if (w.eventCount != v)
142.1049 + return true;
142.1050 + }
142.1051 + }
142.1052 + }
142.1053 + if (scanGuard != g || // stale
142.1054 + (queueBase != queueTop && !tryReleaseWaiter()))
142.1055 + rescanned = false;
142.1056 + if (!rescanned)
142.1057 + Thread.yield(); // reduce contention
142.1058 + else
142.1059 + Thread.interrupted(); // clear before park
142.1060 + }
142.1061 + else {
142.1062 + w.parked = true; // must recheck
142.1063 + if (w.eventCount != v) {
142.1064 + w.parked = false;
142.1065 + return true;
142.1066 + }
142.1067 + LockSupport.park(this);
142.1068 + rescanned = w.parked = false;
142.1069 + }
142.1070 }
142.1071 }
142.1072
142.1073 - // workers array maintenance
142.1074 + /**
142.1075 + * If inactivating worker w has caused pool to become
142.1076 + * quiescent, check for pool termination, and wait for event
142.1077 + * for up to SHRINK_RATE nanosecs (rescans are unnecessary in
142.1078 + * this case because quiescence reflects consensus about lack
142.1079 + * of work). On timeout, if ctl has not changed, terminate the
142.1080 + * worker. Upon its termination (see deregisterWorker), it may
142.1081 + * wake up another worker to possibly repeat this process.
142.1082 + *
142.1083 + * @param w the calling worker
142.1084 + * @param currentCtl the ctl value after enqueuing w
142.1085 + * @param prevCtl the ctl value if w terminated
142.1086 + * @param v the eventCount w awaits change
142.1087 + */
142.1088 + private void idleAwaitWork(ForkJoinWorkerThread w, long currentCtl,
142.1089 + long prevCtl, int v) {
142.1090 + if (w.eventCount == v) {
142.1091 + if (shutdown)
142.1092 + tryTerminate(false);
142.1093 + ForkJoinTask.helpExpungeStaleExceptions(); // help clean weak refs
142.1094 + while (ctl == currentCtl) {
142.1095 + long startTime = System.nanoTime();
142.1096 + w.parked = true;
142.1097 + if (w.eventCount == v) // must recheck
142.1098 + LockSupport.parkNanos(this, SHRINK_RATE);
142.1099 + w.parked = false;
142.1100 + if (w.eventCount != v)
142.1101 + break;
142.1102 + else if (System.nanoTime() - startTime < SHRINK_RATE)
142.1103 + Thread.interrupted(); // spurious wakeup
142.1104 + else if (UNSAFE.compareAndSwapLong(this, ctlOffset,
142.1105 + currentCtl, prevCtl)) {
142.1106 + w.terminate = true; // restore previous
142.1107 + w.eventCount = ((int)currentCtl + EC_UNIT) & E_MASK;
142.1108 + break;
142.1109 + }
142.1110 + }
142.1111 + }
142.1112 + }
142.1113 +
142.1114 + // Submissions
142.1115
142.1116 /**
142.1117 - * Records and returns a workers array index for new worker.
142.1118 + * Enqueues the given task in the submissionQueue. Same idea as
142.1119 + * ForkJoinWorkerThread.pushTask except for use of submissionLock.
142.1120 + *
142.1121 + * @param t the task
142.1122 */
142.1123 - private int recordWorker(ForkJoinWorkerThread w) {
142.1124 - // Try using slot totalCount-1. If not available, scan and/or resize
142.1125 - int k = (workerCounts >>> TOTAL_COUNT_SHIFT) - 1;
142.1126 - final ReentrantLock lock = this.workerLock;
142.1127 + private void addSubmission(ForkJoinTask<?> t) {
142.1128 + final ReentrantLock lock = this.submissionLock;
142.1129 lock.lock();
142.1130 try {
142.1131 - ForkJoinWorkerThread[] ws = workers;
142.1132 - int n = ws.length;
142.1133 - if (k < 0 || k >= n || ws[k] != null) {
142.1134 - for (k = 0; k < n && ws[k] != null; ++k)
142.1135 - ;
142.1136 - if (k == n)
142.1137 - ws = workers = Arrays.copyOf(ws, n << 1);
142.1138 + ForkJoinTask<?>[] q; int s, m;
142.1139 + if ((q = submissionQueue) != null) { // ignore if queue removed
142.1140 + long u = (((s = queueTop) & (m = q.length-1)) << ASHIFT)+ABASE;
142.1141 + UNSAFE.putOrderedObject(q, u, t);
142.1142 + queueTop = s + 1;
142.1143 + if (s - queueBase == m)
142.1144 + growSubmissionQueue();
142.1145 }
142.1146 - ws[k] = w;
142.1147 - int c = eventCount; // advance event count to ensure visibility
142.1148 - UNSAFE.compareAndSwapInt(this, eventCountOffset, c, c+1);
142.1149 } finally {
142.1150 lock.unlock();
142.1151 }
142.1152 - return k;
142.1153 + signalWork();
142.1154 + }
142.1155 +
142.1156 + // (pollSubmission is defined below with exported methods)
142.1157 +
142.1158 + /**
142.1159 + * Creates or doubles submissionQueue array.
142.1160 + * Basically identical to ForkJoinWorkerThread version.
142.1161 + */
142.1162 + private void growSubmissionQueue() {
142.1163 + ForkJoinTask<?>[] oldQ = submissionQueue;
142.1164 + int size = oldQ != null ? oldQ.length << 1 : INITIAL_QUEUE_CAPACITY;
142.1165 + if (size > MAXIMUM_QUEUE_CAPACITY)
142.1166 + throw new RejectedExecutionException("Queue capacity exceeded");
142.1167 + if (size < INITIAL_QUEUE_CAPACITY)
142.1168 + size = INITIAL_QUEUE_CAPACITY;
142.1169 + ForkJoinTask<?>[] q = submissionQueue = new ForkJoinTask<?>[size];
142.1170 + int mask = size - 1;
142.1171 + int top = queueTop;
142.1172 + int oldMask;
142.1173 + if (oldQ != null && (oldMask = oldQ.length - 1) >= 0) {
142.1174 + for (int b = queueBase; b != top; ++b) {
142.1175 + long u = ((b & oldMask) << ASHIFT) + ABASE;
142.1176 + Object x = UNSAFE.getObjectVolatile(oldQ, u);
142.1177 + if (x != null && UNSAFE.compareAndSwapObject(oldQ, u, x, null))
142.1178 + UNSAFE.putObjectVolatile
142.1179 + (q, ((b & mask) << ASHIFT) + ABASE, x);
142.1180 + }
142.1181 + }
142.1182 + }
142.1183 +
142.1184 + // Blocking support
142.1185 +
142.1186 + /**
142.1187 + * Tries to increment blockedCount, decrement active count
142.1188 + * (sometimes implicitly) and possibly release or create a
142.1189 + * compensating worker in preparation for blocking. Fails
142.1190 + * on contention or termination.
142.1191 + *
142.1192 + * @return true if the caller can block, else should recheck and retry
142.1193 + */
142.1194 + private boolean tryPreBlock() {
142.1195 + int b = blockedCount;
142.1196 + if (UNSAFE.compareAndSwapInt(this, blockedCountOffset, b, b + 1)) {
142.1197 + int pc = parallelism;
142.1198 + do {
142.1199 + ForkJoinWorkerThread[] ws; ForkJoinWorkerThread w;
142.1200 + int e, ac, tc, rc, i;
142.1201 + long c = ctl;
142.1202 + int u = (int)(c >>> 32);
142.1203 + if ((e = (int)c) < 0) {
142.1204 + // skip -- terminating
142.1205 + }
142.1206 + else if ((ac = (u >> UAC_SHIFT)) <= 0 && e != 0 &&
142.1207 + (ws = workers) != null &&
142.1208 + (i = ~e & SMASK) < ws.length &&
142.1209 + (w = ws[i]) != null) {
142.1210 + long nc = ((long)(w.nextWait & E_MASK) |
142.1211 + (c & (AC_MASK|TC_MASK)));
142.1212 + if (w.eventCount == e &&
142.1213 + UNSAFE.compareAndSwapLong(this, ctlOffset, c, nc)) {
142.1214 + w.eventCount = (e + EC_UNIT) & E_MASK;
142.1215 + if (w.parked)
142.1216 + UNSAFE.unpark(w);
142.1217 + return true; // release an idle worker
142.1218 + }
142.1219 + }
142.1220 + else if ((tc = (short)(u >>> UTC_SHIFT)) >= 0 && ac + pc > 1) {
142.1221 + long nc = ((c - AC_UNIT) & AC_MASK) | (c & ~AC_MASK);
142.1222 + if (UNSAFE.compareAndSwapLong(this, ctlOffset, c, nc))
142.1223 + return true; // no compensation needed
142.1224 + }
142.1225 + else if (tc + pc < MAX_ID) {
142.1226 + long nc = ((c + TC_UNIT) & TC_MASK) | (c & ~TC_MASK);
142.1227 + if (UNSAFE.compareAndSwapLong(this, ctlOffset, c, nc)) {
142.1228 + addWorker();
142.1229 + return true; // create a replacement
142.1230 + }
142.1231 + }
142.1232 + // try to back out on any failure and let caller retry
142.1233 + } while (!UNSAFE.compareAndSwapInt(this, blockedCountOffset,
142.1234 + b = blockedCount, b - 1));
142.1235 + }
142.1236 + return false;
142.1237 }
142.1238
142.1239 /**
142.1240 - * Nulls out record of worker in workers array.
142.1241 + * Decrements blockedCount and increments active count
142.1242 */
142.1243 - private void forgetWorker(ForkJoinWorkerThread w) {
142.1244 - int idx = w.poolIndex;
142.1245 - // Locking helps method recordWorker avoid unnecessary expansion
142.1246 - final ReentrantLock lock = this.workerLock;
142.1247 - lock.lock();
142.1248 + private void postBlock() {
142.1249 + long c;
142.1250 + do {} while (!UNSAFE.compareAndSwapLong(this, ctlOffset, // no mask
142.1251 + c = ctl, c + AC_UNIT));
142.1252 + int b;
142.1253 + do {} while(!UNSAFE.compareAndSwapInt(this, blockedCountOffset,
142.1254 + b = blockedCount, b - 1));
142.1255 + }
142.1256 +
142.1257 + /**
142.1258 + * Possibly blocks waiting for the given task to complete, or
142.1259 + * cancels the task if terminating. Fails to wait if contended.
142.1260 + *
142.1261 + * @param joinMe the task
142.1262 + */
142.1263 + final void tryAwaitJoin(ForkJoinTask<?> joinMe) {
142.1264 + int s;
142.1265 + Thread.interrupted(); // clear interrupts before checking termination
142.1266 + if (joinMe.status >= 0) {
142.1267 + if (tryPreBlock()) {
142.1268 + joinMe.tryAwaitDone(0L);
142.1269 + postBlock();
142.1270 + }
142.1271 + else if ((ctl & STOP_BIT) != 0L)
142.1272 + joinMe.cancelIgnoringExceptions();
142.1273 + }
142.1274 + }
142.1275 +
142.1276 + /**
142.1277 + * Possibly blocks the given worker waiting for joinMe to
142.1278 + * complete or timeout
142.1279 + *
142.1280 + * @param joinMe the task
142.1281 + * @param millis the wait time for underlying Object.wait
142.1282 + */
142.1283 + final void timedAwaitJoin(ForkJoinTask<?> joinMe, long nanos) {
142.1284 + while (joinMe.status >= 0) {
142.1285 + Thread.interrupted();
142.1286 + if ((ctl & STOP_BIT) != 0L) {
142.1287 + joinMe.cancelIgnoringExceptions();
142.1288 + break;
142.1289 + }
142.1290 + if (tryPreBlock()) {
142.1291 + long last = System.nanoTime();
142.1292 + while (joinMe.status >= 0) {
142.1293 + long millis = TimeUnit.NANOSECONDS.toMillis(nanos);
142.1294 + if (millis <= 0)
142.1295 + break;
142.1296 + joinMe.tryAwaitDone(millis);
142.1297 + if (joinMe.status < 0)
142.1298 + break;
142.1299 + if ((ctl & STOP_BIT) != 0L) {
142.1300 + joinMe.cancelIgnoringExceptions();
142.1301 + break;
142.1302 + }
142.1303 + long now = System.nanoTime();
142.1304 + nanos -= now - last;
142.1305 + last = now;
142.1306 + }
142.1307 + postBlock();
142.1308 + break;
142.1309 + }
142.1310 + }
142.1311 + }
142.1312 +
142.1313 + /**
142.1314 + * If necessary, compensates for blocker, and blocks
142.1315 + */
142.1316 + private void awaitBlocker(ManagedBlocker blocker)
142.1317 + throws InterruptedException {
142.1318 + while (!blocker.isReleasable()) {
142.1319 + if (tryPreBlock()) {
142.1320 + try {
142.1321 + do {} while (!blocker.isReleasable() && !blocker.block());
142.1322 + } finally {
142.1323 + postBlock();
142.1324 + }
142.1325 + break;
142.1326 + }
142.1327 + }
142.1328 + }
142.1329 +
142.1330 + // Creating, registering and deregistring workers
142.1331 +
142.1332 + /**
142.1333 + * Tries to create and start a worker; minimally rolls back counts
142.1334 + * on failure.
142.1335 + */
142.1336 + private void addWorker() {
142.1337 + Throwable ex = null;
142.1338 + ForkJoinWorkerThread t = null;
142.1339 try {
142.1340 - ForkJoinWorkerThread[] ws = workers;
142.1341 - if (idx >= 0 && idx < ws.length && ws[idx] == w) // verify
142.1342 - ws[idx] = null;
142.1343 - } finally {
142.1344 - lock.unlock();
142.1345 + t = factory.newThread(this);
142.1346 + } catch (Throwable e) {
142.1347 + ex = e;
142.1348 + }
142.1349 + if (t == null) { // null or exceptional factory return
142.1350 + long c; // adjust counts
142.1351 + do {} while (!UNSAFE.compareAndSwapLong
142.1352 + (this, ctlOffset, c = ctl,
142.1353 + (((c - AC_UNIT) & AC_MASK) |
142.1354 + ((c - TC_UNIT) & TC_MASK) |
142.1355 + (c & ~(AC_MASK|TC_MASK)))));
142.1356 + // Propagate exception if originating from an external caller
142.1357 + if (!tryTerminate(false) && ex != null &&
142.1358 + !(Thread.currentThread() instanceof ForkJoinWorkerThread))
142.1359 + UNSAFE.throwException(ex);
142.1360 + }
142.1361 + else
142.1362 + t.start();
142.1363 + }
142.1364 +
142.1365 + /**
142.1366 + * Callback from ForkJoinWorkerThread constructor to assign a
142.1367 + * public name
142.1368 + */
142.1369 + final String nextWorkerName() {
142.1370 + for (int n;;) {
142.1371 + if (UNSAFE.compareAndSwapInt(this, nextWorkerNumberOffset,
142.1372 + n = nextWorkerNumber, ++n))
142.1373 + return workerNamePrefix + n;
142.1374 + }
142.1375 + }
142.1376 +
142.1377 + /**
142.1378 + * Callback from ForkJoinWorkerThread constructor to
142.1379 + * determine its poolIndex and record in workers array.
142.1380 + *
142.1381 + * @param w the worker
142.1382 + * @return the worker's pool index
142.1383 + */
142.1384 + final int registerWorker(ForkJoinWorkerThread w) {
142.1385 + /*
142.1386 + * In the typical case, a new worker acquires the lock, uses
142.1387 + * next available index and returns quickly. Since we should
142.1388 + * not block callers (ultimately from signalWork or
142.1389 + * tryPreBlock) waiting for the lock needed to do this, we
142.1390 + * instead help release other workers while waiting for the
142.1391 + * lock.
142.1392 + */
142.1393 + for (int g;;) {
142.1394 + ForkJoinWorkerThread[] ws;
142.1395 + if (((g = scanGuard) & SG_UNIT) == 0 &&
142.1396 + UNSAFE.compareAndSwapInt(this, scanGuardOffset,
142.1397 + g, g | SG_UNIT)) {
142.1398 + int k = nextWorkerIndex;
142.1399 + try {
142.1400 + if ((ws = workers) != null) { // ignore on shutdown
142.1401 + int n = ws.length;
142.1402 + if (k < 0 || k >= n || ws[k] != null) {
142.1403 + for (k = 0; k < n && ws[k] != null; ++k)
142.1404 + ;
142.1405 + if (k == n)
142.1406 + ws = workers = Arrays.copyOf(ws, n << 1);
142.1407 + }
142.1408 + ws[k] = w;
142.1409 + nextWorkerIndex = k + 1;
142.1410 + int m = g & SMASK;
142.1411 + g = k >= m? ((m << 1) + 1) & SMASK : g + (SG_UNIT<<1);
142.1412 + }
142.1413 + } finally {
142.1414 + scanGuard = g;
142.1415 + }
142.1416 + return k;
142.1417 + }
142.1418 + else if ((ws = workers) != null) { // help release others
142.1419 + for (ForkJoinWorkerThread u : ws) {
142.1420 + if (u != null && u.queueBase != u.queueTop) {
142.1421 + if (tryReleaseWaiter())
142.1422 + break;
142.1423 + }
142.1424 + }
142.1425 + }
142.1426 }
142.1427 }
142.1428
142.1429 @@ -743,415 +1200,46 @@
142.1430 *
142.1431 * @param w the worker
142.1432 */
142.1433 - final void workerTerminated(ForkJoinWorkerThread w) {
142.1434 - forgetWorker(w);
142.1435 - decrementWorkerCounts(w.isTrimmed() ? 0 : ONE_RUNNING, ONE_TOTAL);
142.1436 - while (w.stealCount != 0) // collect final count
142.1437 - tryAccumulateStealCount(w);
142.1438 - tryTerminate(false);
142.1439 - }
142.1440 -
142.1441 - // Waiting for and signalling events
142.1442 -
142.1443 - /**
142.1444 - * Releases workers blocked on a count not equal to current count.
142.1445 - * Normally called after precheck that eventWaiters isn't zero to
142.1446 - * avoid wasted array checks. Gives up upon a change in count or
142.1447 - * upon releasing four workers, letting others take over.
142.1448 - */
142.1449 - private void releaseEventWaiters() {
142.1450 - ForkJoinWorkerThread[] ws = workers;
142.1451 - int n = ws.length;
142.1452 - long h = eventWaiters;
142.1453 - int ec = eventCount;
142.1454 - int releases = 4;
142.1455 - ForkJoinWorkerThread w; int id;
142.1456 - while ((id = (((int)h) & WAITER_ID_MASK) - 1) >= 0 &&
142.1457 - (int)(h >>> EVENT_COUNT_SHIFT) != ec &&
142.1458 - id < n && (w = ws[id]) != null) {
142.1459 - if (UNSAFE.compareAndSwapLong(this, eventWaitersOffset,
142.1460 - h, w.nextWaiter)) {
142.1461 - LockSupport.unpark(w);
142.1462 - if (--releases == 0)
142.1463 - break;
142.1464 + final void deregisterWorker(ForkJoinWorkerThread w, Throwable ex) {
142.1465 + int idx = w.poolIndex;
142.1466 + int sc = w.stealCount;
142.1467 + int steps = 0;
142.1468 + // Remove from array, adjust worker counts and collect steal count.
142.1469 + // We can intermix failed removes or adjusts with steal updates
142.1470 + do {
142.1471 + long s, c;
142.1472 + int g;
142.1473 + if (steps == 0 && ((g = scanGuard) & SG_UNIT) == 0 &&
142.1474 + UNSAFE.compareAndSwapInt(this, scanGuardOffset,
142.1475 + g, g |= SG_UNIT)) {
142.1476 + ForkJoinWorkerThread[] ws = workers;
142.1477 + if (ws != null && idx >= 0 &&
142.1478 + idx < ws.length && ws[idx] == w)
142.1479 + ws[idx] = null; // verify
142.1480 + nextWorkerIndex = idx;
142.1481 + scanGuard = g + SG_UNIT;
142.1482 + steps = 1;
142.1483 }
142.1484 - if (eventCount != ec)
142.1485 - break;
142.1486 - h = eventWaiters;
142.1487 + if (steps == 1 &&
142.1488 + UNSAFE.compareAndSwapLong(this, ctlOffset, c = ctl,
142.1489 + (((c - AC_UNIT) & AC_MASK) |
142.1490 + ((c - TC_UNIT) & TC_MASK) |
142.1491 + (c & ~(AC_MASK|TC_MASK)))))
142.1492 + steps = 2;
142.1493 + if (sc != 0 &&
142.1494 + UNSAFE.compareAndSwapLong(this, stealCountOffset,
142.1495 + s = stealCount, s + sc))
142.1496 + sc = 0;
142.1497 + } while (steps != 2 || sc != 0);
142.1498 + if (!tryTerminate(false)) {
142.1499 + if (ex != null) // possibly replace if died abnormally
142.1500 + signalWork();
142.1501 + else
142.1502 + tryReleaseWaiter();
142.1503 }
142.1504 }
142.1505
142.1506 - /**
142.1507 - * Tries to advance eventCount and releases waiters. Called only
142.1508 - * from workers.
142.1509 - */
142.1510 - final void signalWork() {
142.1511 - int c; // try to increment event count -- CAS failure OK
142.1512 - UNSAFE.compareAndSwapInt(this, eventCountOffset, c = eventCount, c+1);
142.1513 - if (eventWaiters != 0L)
142.1514 - releaseEventWaiters();
142.1515 - }
142.1516 -
142.1517 - /**
142.1518 - * Adds the given worker to event queue and blocks until
142.1519 - * terminating or event count advances from the given value
142.1520 - *
142.1521 - * @param w the calling worker thread
142.1522 - * @param ec the count
142.1523 - */
142.1524 - private void eventSync(ForkJoinWorkerThread w, int ec) {
142.1525 - long nh = (((long)ec) << EVENT_COUNT_SHIFT) | ((long)(w.poolIndex+1));
142.1526 - long h;
142.1527 - while ((runState < SHUTDOWN || !tryTerminate(false)) &&
142.1528 - (((int)(h = eventWaiters) & WAITER_ID_MASK) == 0 ||
142.1529 - (int)(h >>> EVENT_COUNT_SHIFT) == ec) &&
142.1530 - eventCount == ec) {
142.1531 - if (UNSAFE.compareAndSwapLong(this, eventWaitersOffset,
142.1532 - w.nextWaiter = h, nh)) {
142.1533 - awaitEvent(w, ec);
142.1534 - break;
142.1535 - }
142.1536 - }
142.1537 - }
142.1538 -
142.1539 - /**
142.1540 - * Blocks the given worker (that has already been entered as an
142.1541 - * event waiter) until terminating or event count advances from
142.1542 - * the given value. The oldest (first) waiter uses a timed wait to
142.1543 - * occasionally one-by-one shrink the number of workers (to a
142.1544 - * minimum of one) if the pool has not been used for extended
142.1545 - * periods.
142.1546 - *
142.1547 - * @param w the calling worker thread
142.1548 - * @param ec the count
142.1549 - */
142.1550 - private void awaitEvent(ForkJoinWorkerThread w, int ec) {
142.1551 - while (eventCount == ec) {
142.1552 - if (tryAccumulateStealCount(w)) { // transfer while idle
142.1553 - boolean untimed = (w.nextWaiter != 0L ||
142.1554 - (workerCounts & RUNNING_COUNT_MASK) <= 1);
142.1555 - long startTime = untimed ? 0 : System.nanoTime();
142.1556 - Thread.interrupted(); // clear/ignore interrupt
142.1557 - if (w.isTerminating() || eventCount != ec)
142.1558 - break; // recheck after clear
142.1559 - if (untimed)
142.1560 - LockSupport.park(w);
142.1561 - else {
142.1562 - LockSupport.parkNanos(w, SHRINK_RATE_NANOS);
142.1563 - if (eventCount != ec || w.isTerminating())
142.1564 - break;
142.1565 - if (System.nanoTime() - startTime >= SHRINK_RATE_NANOS)
142.1566 - tryShutdownUnusedWorker(ec);
142.1567 - }
142.1568 - }
142.1569 - }
142.1570 - }
142.1571 -
142.1572 - // Maintaining parallelism
142.1573 -
142.1574 - /**
142.1575 - * Pushes worker onto the spare stack.
142.1576 - */
142.1577 - final void pushSpare(ForkJoinWorkerThread w) {
142.1578 - int ns = (++w.spareCount << SPARE_COUNT_SHIFT) | (w.poolIndex + 1);
142.1579 - do {} while (!UNSAFE.compareAndSwapInt(this, spareWaitersOffset,
142.1580 - w.nextSpare = spareWaiters,ns));
142.1581 - }
142.1582 -
142.1583 - /**
142.1584 - * Tries (once) to resume a spare if the number of running
142.1585 - * threads is less than target.
142.1586 - */
142.1587 - private void tryResumeSpare() {
142.1588 - int sw, id;
142.1589 - ForkJoinWorkerThread[] ws = workers;
142.1590 - int n = ws.length;
142.1591 - ForkJoinWorkerThread w;
142.1592 - if ((sw = spareWaiters) != 0 &&
142.1593 - (id = (sw & SPARE_ID_MASK) - 1) >= 0 &&
142.1594 - id < n && (w = ws[id]) != null &&
142.1595 - (runState >= TERMINATING ||
142.1596 - (workerCounts & RUNNING_COUNT_MASK) < parallelism) &&
142.1597 - spareWaiters == sw &&
142.1598 - UNSAFE.compareAndSwapInt(this, spareWaitersOffset,
142.1599 - sw, w.nextSpare)) {
142.1600 - int c; // increment running count before resume
142.1601 - do {} while (!UNSAFE.compareAndSwapInt
142.1602 - (this, workerCountsOffset,
142.1603 - c = workerCounts, c + ONE_RUNNING));
142.1604 - if (w.tryUnsuspend())
142.1605 - LockSupport.unpark(w);
142.1606 - else // back out if w was shutdown
142.1607 - decrementWorkerCounts(ONE_RUNNING, 0);
142.1608 - }
142.1609 - }
142.1610 -
142.1611 - /**
142.1612 - * Tries to increase the number of running workers if below target
142.1613 - * parallelism: If a spare exists tries to resume it via
142.1614 - * tryResumeSpare. Otherwise, if not enough total workers or all
142.1615 - * existing workers are busy, adds a new worker. In all cases also
142.1616 - * helps wake up releasable workers waiting for work.
142.1617 - */
142.1618 - private void helpMaintainParallelism() {
142.1619 - int pc = parallelism;
142.1620 - int wc, rs, tc;
142.1621 - while (((wc = workerCounts) & RUNNING_COUNT_MASK) < pc &&
142.1622 - (rs = runState) < TERMINATING) {
142.1623 - if (spareWaiters != 0)
142.1624 - tryResumeSpare();
142.1625 - else if ((tc = wc >>> TOTAL_COUNT_SHIFT) >= MAX_WORKERS ||
142.1626 - (tc >= pc && (rs & ACTIVE_COUNT_MASK) != tc))
142.1627 - break; // enough total
142.1628 - else if (runState == rs && workerCounts == wc &&
142.1629 - UNSAFE.compareAndSwapInt(this, workerCountsOffset, wc,
142.1630 - wc + (ONE_RUNNING|ONE_TOTAL))) {
142.1631 - ForkJoinWorkerThread w = null;
142.1632 - Throwable fail = null;
142.1633 - try {
142.1634 - w = factory.newThread(this);
142.1635 - } catch (Throwable ex) {
142.1636 - fail = ex;
142.1637 - }
142.1638 - if (w == null) { // null or exceptional factory return
142.1639 - decrementWorkerCounts(ONE_RUNNING, ONE_TOTAL);
142.1640 - tryTerminate(false); // handle failure during shutdown
142.1641 - // If originating from an external caller,
142.1642 - // propagate exception, else ignore
142.1643 - if (fail != null && runState < TERMINATING &&
142.1644 - !(Thread.currentThread() instanceof
142.1645 - ForkJoinWorkerThread))
142.1646 - UNSAFE.throwException(fail);
142.1647 - break;
142.1648 - }
142.1649 - w.start(recordWorker(w), ueh);
142.1650 - if ((workerCounts >>> TOTAL_COUNT_SHIFT) >= pc)
142.1651 - break; // add at most one unless total below target
142.1652 - }
142.1653 - }
142.1654 - if (eventWaiters != 0L)
142.1655 - releaseEventWaiters();
142.1656 - }
142.1657 -
142.1658 - /**
142.1659 - * Callback from the oldest waiter in awaitEvent waking up after a
142.1660 - * period of non-use. If all workers are idle, tries (once) to
142.1661 - * shutdown an event waiter or a spare, if one exists. Note that
142.1662 - * we don't need CAS or locks here because the method is called
142.1663 - * only from one thread occasionally waking (and even misfires are
142.1664 - * OK). Note that until the shutdown worker fully terminates,
142.1665 - * workerCounts will overestimate total count, which is tolerable.
142.1666 - *
142.1667 - * @param ec the event count waited on by caller (to abort
142.1668 - * attempt if count has since changed).
142.1669 - */
142.1670 - private void tryShutdownUnusedWorker(int ec) {
142.1671 - if (runState == 0 && eventCount == ec) { // only trigger if all idle
142.1672 - ForkJoinWorkerThread[] ws = workers;
142.1673 - int n = ws.length;
142.1674 - ForkJoinWorkerThread w = null;
142.1675 - boolean shutdown = false;
142.1676 - int sw;
142.1677 - long h;
142.1678 - if ((sw = spareWaiters) != 0) { // prefer killing spares
142.1679 - int id = (sw & SPARE_ID_MASK) - 1;
142.1680 - if (id >= 0 && id < n && (w = ws[id]) != null &&
142.1681 - UNSAFE.compareAndSwapInt(this, spareWaitersOffset,
142.1682 - sw, w.nextSpare))
142.1683 - shutdown = true;
142.1684 - }
142.1685 - else if ((h = eventWaiters) != 0L) {
142.1686 - long nh;
142.1687 - int id = (((int)h) & WAITER_ID_MASK) - 1;
142.1688 - if (id >= 0 && id < n && (w = ws[id]) != null &&
142.1689 - (nh = w.nextWaiter) != 0L && // keep at least one worker
142.1690 - UNSAFE.compareAndSwapLong(this, eventWaitersOffset, h, nh))
142.1691 - shutdown = true;
142.1692 - }
142.1693 - if (w != null && shutdown) {
142.1694 - w.shutdown();
142.1695 - LockSupport.unpark(w);
142.1696 - }
142.1697 - }
142.1698 - releaseEventWaiters(); // in case of interference
142.1699 - }
142.1700 -
142.1701 - /**
142.1702 - * Callback from workers invoked upon each top-level action (i.e.,
142.1703 - * stealing a task or taking a submission and running it).
142.1704 - * Performs one or more of the following:
142.1705 - *
142.1706 - * 1. If the worker is active and either did not run a task
142.1707 - * or there are too many workers, try to set its active status
142.1708 - * to inactive and update activeCount. On contention, we may
142.1709 - * try again in this or a subsequent call.
142.1710 - *
142.1711 - * 2. If not enough total workers, help create some.
142.1712 - *
142.1713 - * 3. If there are too many running workers, suspend this worker
142.1714 - * (first forcing inactive if necessary). If it is not needed,
142.1715 - * it may be shutdown while suspended (via
142.1716 - * tryShutdownUnusedWorker). Otherwise, upon resume it
142.1717 - * rechecks running thread count and need for event sync.
142.1718 - *
142.1719 - * 4. If worker did not run a task, await the next task event via
142.1720 - * eventSync if necessary (first forcing inactivation), upon
142.1721 - * which the worker may be shutdown via
142.1722 - * tryShutdownUnusedWorker. Otherwise, help release any
142.1723 - * existing event waiters that are now releasable,
142.1724 - *
142.1725 - * @param w the worker
142.1726 - * @param ran true if worker ran a task since last call to this method
142.1727 - */
142.1728 - final void preStep(ForkJoinWorkerThread w, boolean ran) {
142.1729 - int wec = w.lastEventCount;
142.1730 - boolean active = w.active;
142.1731 - boolean inactivate = false;
142.1732 - int pc = parallelism;
142.1733 - while (w.runState == 0) {
142.1734 - int rs = runState;
142.1735 - if (rs >= TERMINATING) { // propagate shutdown
142.1736 - w.shutdown();
142.1737 - break;
142.1738 - }
142.1739 - if ((inactivate || (active && (rs & ACTIVE_COUNT_MASK) >= pc)) &&
142.1740 - UNSAFE.compareAndSwapInt(this, runStateOffset, rs, --rs)) {
142.1741 - inactivate = active = w.active = false;
142.1742 - if (rs == SHUTDOWN) { // all inactive and shut down
142.1743 - tryTerminate(false);
142.1744 - continue;
142.1745 - }
142.1746 - }
142.1747 - int wc = workerCounts; // try to suspend as spare
142.1748 - if ((wc & RUNNING_COUNT_MASK) > pc) {
142.1749 - if (!(inactivate |= active) && // must inactivate to suspend
142.1750 - workerCounts == wc &&
142.1751 - UNSAFE.compareAndSwapInt(this, workerCountsOffset,
142.1752 - wc, wc - ONE_RUNNING))
142.1753 - w.suspendAsSpare();
142.1754 - }
142.1755 - else if ((wc >>> TOTAL_COUNT_SHIFT) < pc)
142.1756 - helpMaintainParallelism(); // not enough workers
142.1757 - else if (ran)
142.1758 - break;
142.1759 - else {
142.1760 - long h = eventWaiters;
142.1761 - int ec = eventCount;
142.1762 - if (h != 0L && (int)(h >>> EVENT_COUNT_SHIFT) != ec)
142.1763 - releaseEventWaiters(); // release others before waiting
142.1764 - else if (ec != wec) {
142.1765 - w.lastEventCount = ec; // no need to wait
142.1766 - break;
142.1767 - }
142.1768 - else if (!(inactivate |= active))
142.1769 - eventSync(w, wec); // must inactivate before sync
142.1770 - }
142.1771 - }
142.1772 - }
142.1773 -
142.1774 - /**
142.1775 - * Helps and/or blocks awaiting join of the given task.
142.1776 - * See above for explanation.
142.1777 - *
142.1778 - * @param joinMe the task to join
142.1779 - * @param worker the current worker thread
142.1780 - * @param timed true if wait should time out
142.1781 - * @param nanos timeout value if timed
142.1782 - */
142.1783 - final void awaitJoin(ForkJoinTask<?> joinMe, ForkJoinWorkerThread worker,
142.1784 - boolean timed, long nanos) {
142.1785 - long startTime = timed ? System.nanoTime() : 0L;
142.1786 - int retries = 2 + (parallelism >> 2); // #helpJoins before blocking
142.1787 - boolean running = true; // false when count decremented
142.1788 - while (joinMe.status >= 0) {
142.1789 - if (runState >= TERMINATING) {
142.1790 - joinMe.cancelIgnoringExceptions();
142.1791 - break;
142.1792 - }
142.1793 - running = worker.helpJoinTask(joinMe, running);
142.1794 - if (joinMe.status < 0)
142.1795 - break;
142.1796 - if (retries > 0) {
142.1797 - --retries;
142.1798 - continue;
142.1799 - }
142.1800 - int wc = workerCounts;
142.1801 - if ((wc & RUNNING_COUNT_MASK) != 0) {
142.1802 - if (running) {
142.1803 - if (!UNSAFE.compareAndSwapInt(this, workerCountsOffset,
142.1804 - wc, wc - ONE_RUNNING))
142.1805 - continue;
142.1806 - running = false;
142.1807 - }
142.1808 - long h = eventWaiters;
142.1809 - if (h != 0L && (int)(h >>> EVENT_COUNT_SHIFT) != eventCount)
142.1810 - releaseEventWaiters();
142.1811 - if ((workerCounts & RUNNING_COUNT_MASK) != 0) {
142.1812 - long ms; int ns;
142.1813 - if (!timed) {
142.1814 - ms = JOIN_TIMEOUT_MILLIS;
142.1815 - ns = 0;
142.1816 - }
142.1817 - else { // at most JOIN_TIMEOUT_MILLIS per wait
142.1818 - long nt = nanos - (System.nanoTime() - startTime);
142.1819 - if (nt <= 0L)
142.1820 - break;
142.1821 - ms = nt / 1000000;
142.1822 - if (ms > JOIN_TIMEOUT_MILLIS) {
142.1823 - ms = JOIN_TIMEOUT_MILLIS;
142.1824 - ns = 0;
142.1825 - }
142.1826 - else
142.1827 - ns = (int) (nt % 1000000);
142.1828 - }
142.1829 - joinMe.internalAwaitDone(ms, ns);
142.1830 - }
142.1831 - if (joinMe.status < 0)
142.1832 - break;
142.1833 - }
142.1834 - helpMaintainParallelism();
142.1835 - }
142.1836 - if (!running) {
142.1837 - int c;
142.1838 - do {} while (!UNSAFE.compareAndSwapInt
142.1839 - (this, workerCountsOffset,
142.1840 - c = workerCounts, c + ONE_RUNNING));
142.1841 - }
142.1842 - }
142.1843 -
142.1844 - /**
142.1845 - * Same idea as awaitJoin, but no helping, retries, or timeouts.
142.1846 - */
142.1847 - final void awaitBlocker(ManagedBlocker blocker)
142.1848 - throws InterruptedException {
142.1849 - while (!blocker.isReleasable()) {
142.1850 - int wc = workerCounts;
142.1851 - if ((wc & RUNNING_COUNT_MASK) == 0)
142.1852 - helpMaintainParallelism();
142.1853 - else if (UNSAFE.compareAndSwapInt(this, workerCountsOffset,
142.1854 - wc, wc - ONE_RUNNING)) {
142.1855 - try {
142.1856 - while (!blocker.isReleasable()) {
142.1857 - long h = eventWaiters;
142.1858 - if (h != 0L &&
142.1859 - (int)(h >>> EVENT_COUNT_SHIFT) != eventCount)
142.1860 - releaseEventWaiters();
142.1861 - else if ((workerCounts & RUNNING_COUNT_MASK) == 0 &&
142.1862 - runState < TERMINATING)
142.1863 - helpMaintainParallelism();
142.1864 - else if (blocker.block())
142.1865 - break;
142.1866 - }
142.1867 - } finally {
142.1868 - int c;
142.1869 - do {} while (!UNSAFE.compareAndSwapInt
142.1870 - (this, workerCountsOffset,
142.1871 - c = workerCounts, c + ONE_RUNNING));
142.1872 - }
142.1873 - break;
142.1874 - }
142.1875 - }
142.1876 - }
142.1877 + // Shutdown and termination
142.1878
142.1879 /**
142.1880 * Possibly initiates and/or completes termination.
142.1881 @@ -1161,97 +1249,132 @@
142.1882 * @return true if now terminating or terminated
142.1883 */
142.1884 private boolean tryTerminate(boolean now) {
142.1885 - if (now)
142.1886 - advanceRunLevel(SHUTDOWN); // ensure at least SHUTDOWN
142.1887 - else if (runState < SHUTDOWN ||
142.1888 - !submissionQueue.isEmpty() ||
142.1889 - (runState & ACTIVE_COUNT_MASK) != 0)
142.1890 - return false;
142.1891 -
142.1892 - if (advanceRunLevel(TERMINATING))
142.1893 - startTerminating();
142.1894 -
142.1895 - // Finish now if all threads terminated; else in some subsequent call
142.1896 - if ((workerCounts >>> TOTAL_COUNT_SHIFT) == 0) {
142.1897 - advanceRunLevel(TERMINATED);
142.1898 - termination.forceTermination();
142.1899 + long c;
142.1900 + while (((c = ctl) & STOP_BIT) == 0) {
142.1901 + if (!now) {
142.1902 + if ((int)(c >> AC_SHIFT) != -parallelism)
142.1903 + return false;
142.1904 + if (!shutdown || blockedCount != 0 || quiescerCount != 0 ||
142.1905 + queueBase != queueTop) {
142.1906 + if (ctl == c) // staleness check
142.1907 + return false;
142.1908 + continue;
142.1909 + }
142.1910 + }
142.1911 + if (UNSAFE.compareAndSwapLong(this, ctlOffset, c, c | STOP_BIT))
142.1912 + startTerminating();
142.1913 + }
142.1914 + if ((short)(c >>> TC_SHIFT) == -parallelism) { // signal when 0 workers
142.1915 + final ReentrantLock lock = this.submissionLock;
142.1916 + lock.lock();
142.1917 + try {
142.1918 + termination.signalAll();
142.1919 + } finally {
142.1920 + lock.unlock();
142.1921 + }
142.1922 }
142.1923 return true;
142.1924 }
142.1925
142.1926 /**
142.1927 - * Actions on transition to TERMINATING
142.1928 - *
142.1929 - * Runs up to four passes through workers: (0) shutting down each
142.1930 - * (without waking up if parked) to quickly spread notifications
142.1931 - * without unnecessary bouncing around event queues etc (1) wake
142.1932 - * up and help cancel tasks (2) interrupt (3) mop up races with
142.1933 - * interrupted workers
142.1934 + * Runs up to three passes through workers: (0) Setting
142.1935 + * termination status for each worker, followed by wakeups up to
142.1936 + * queued workers; (1) helping cancel tasks; (2) interrupting
142.1937 + * lagging threads (likely in external tasks, but possibly also
142.1938 + * blocked in joins). Each pass repeats previous steps because of
142.1939 + * potential lagging thread creation.
142.1940 */
142.1941 private void startTerminating() {
142.1942 cancelSubmissions();
142.1943 - for (int passes = 0; passes < 4 && workerCounts != 0; ++passes) {
142.1944 - int c; // advance event count
142.1945 - UNSAFE.compareAndSwapInt(this, eventCountOffset,
142.1946 - c = eventCount, c+1);
142.1947 - eventWaiters = 0L; // clobber lists
142.1948 - spareWaiters = 0;
142.1949 - for (ForkJoinWorkerThread w : workers) {
142.1950 - if (w != null) {
142.1951 - w.shutdown();
142.1952 - if (passes > 0 && !w.isTerminated()) {
142.1953 - w.cancelTasks();
142.1954 - LockSupport.unpark(w);
142.1955 - if (passes > 1 && !w.isInterrupted()) {
142.1956 - try {
142.1957 - w.interrupt();
142.1958 - } catch (SecurityException ignore) {
142.1959 + for (int pass = 0; pass < 3; ++pass) {
142.1960 + ForkJoinWorkerThread[] ws = workers;
142.1961 + if (ws != null) {
142.1962 + for (ForkJoinWorkerThread w : ws) {
142.1963 + if (w != null) {
142.1964 + w.terminate = true;
142.1965 + if (pass > 0) {
142.1966 + w.cancelTasks();
142.1967 + if (pass > 1 && !w.isInterrupted()) {
142.1968 + try {
142.1969 + w.interrupt();
142.1970 + } catch (SecurityException ignore) {
142.1971 + }
142.1972 }
142.1973 }
142.1974 }
142.1975 }
142.1976 + terminateWaiters();
142.1977 + }
142.1978 + }
142.1979 + }
142.1980 +
142.1981 + /**
142.1982 + * Polls and cancels all submissions. Called only during termination.
142.1983 + */
142.1984 + private void cancelSubmissions() {
142.1985 + while (queueBase != queueTop) {
142.1986 + ForkJoinTask<?> task = pollSubmission();
142.1987 + if (task != null) {
142.1988 + try {
142.1989 + task.cancel(false);
142.1990 + } catch (Throwable ignore) {
142.1991 + }
142.1992 }
142.1993 }
142.1994 }
142.1995
142.1996 /**
142.1997 - * Clears out and cancels submissions, ignoring exceptions.
142.1998 + * Tries to set the termination status of waiting workers, and
142.1999 + * then wakes them up (after which they will terminate).
142.2000 */
142.2001 - private void cancelSubmissions() {
142.2002 - ForkJoinTask<?> task;
142.2003 - while ((task = submissionQueue.poll()) != null) {
142.2004 - try {
142.2005 - task.cancel(false);
142.2006 - } catch (Throwable ignore) {
142.2007 + private void terminateWaiters() {
142.2008 + ForkJoinWorkerThread[] ws = workers;
142.2009 + if (ws != null) {
142.2010 + ForkJoinWorkerThread w; long c; int i, e;
142.2011 + int n = ws.length;
142.2012 + while ((i = ~(e = (int)(c = ctl)) & SMASK) < n &&
142.2013 + (w = ws[i]) != null && w.eventCount == (e & E_MASK)) {
142.2014 + if (UNSAFE.compareAndSwapLong(this, ctlOffset, c,
142.2015 + (long)(w.nextWait & E_MASK) |
142.2016 + ((c + AC_UNIT) & AC_MASK) |
142.2017 + (c & (TC_MASK|STOP_BIT)))) {
142.2018 + w.terminate = true;
142.2019 + w.eventCount = e + EC_UNIT;
142.2020 + if (w.parked)
142.2021 + UNSAFE.unpark(w);
142.2022 + }
142.2023 }
142.2024 }
142.2025 }
142.2026
142.2027 - // misc support for ForkJoinWorkerThread
142.2028 + // misc ForkJoinWorkerThread support
142.2029
142.2030 /**
142.2031 - * Returns pool number.
142.2032 + * Increment or decrement quiescerCount. Needed only to prevent
142.2033 + * triggering shutdown if a worker is transiently inactive while
142.2034 + * checking quiescence.
142.2035 + *
142.2036 + * @param delta 1 for increment, -1 for decrement
142.2037 */
142.2038 - final int getPoolNumber() {
142.2039 - return poolNumber;
142.2040 + final void addQuiescerCount(int delta) {
142.2041 + int c;
142.2042 + do {} while(!UNSAFE.compareAndSwapInt(this, quiescerCountOffset,
142.2043 + c = quiescerCount, c + delta));
142.2044 }
142.2045
142.2046 /**
142.2047 - * Tries to accumulate steal count from a worker, clearing
142.2048 - * the worker's value if successful.
142.2049 + * Directly increment or decrement active count without
142.2050 + * queuing. This method is used to transiently assert inactivation
142.2051 + * while checking quiescence.
142.2052 *
142.2053 - * @return true if worker steal count now zero
142.2054 + * @param delta 1 for increment, -1 for decrement
142.2055 */
142.2056 - final boolean tryAccumulateStealCount(ForkJoinWorkerThread w) {
142.2057 - int sc = w.stealCount;
142.2058 - long c = stealCount;
142.2059 - // CAS even if zero, for fence effects
142.2060 - if (UNSAFE.compareAndSwapLong(this, stealCountOffset, c, c + sc)) {
142.2061 - if (sc != 0)
142.2062 - w.stealCount = 0;
142.2063 - return true;
142.2064 - }
142.2065 - return sc == 0;
142.2066 + final void addActiveCount(int delta) {
142.2067 + long d = delta < 0 ? -AC_UNIT : AC_UNIT;
142.2068 + long c;
142.2069 + do {} while (!UNSAFE.compareAndSwapLong(this, ctlOffset, c = ctl,
142.2070 + ((c + d) & AC_MASK) |
142.2071 + (c & ~AC_MASK)));
142.2072 }
142.2073
142.2074 /**
142.2075 @@ -1259,16 +1382,17 @@
142.2076 * active thread.
142.2077 */
142.2078 final int idlePerActive() {
142.2079 - int pc = parallelism; // use parallelism, not rc
142.2080 - int ac = runState; // no mask -- artificially boosts during shutdown
142.2081 - // Use exact results for small values, saturate past 4
142.2082 - return ((pc <= ac) ? 0 :
142.2083 - (pc >>> 1 <= ac) ? 1 :
142.2084 - (pc >>> 2 <= ac) ? 3 :
142.2085 - pc >>> 3);
142.2086 + // Approximate at powers of two for small values, saturate past 4
142.2087 + int p = parallelism;
142.2088 + int a = p + (int)(ctl >> AC_SHIFT);
142.2089 + return (a > (p >>>= 1) ? 0 :
142.2090 + a > (p >>>= 1) ? 1 :
142.2091 + a > (p >>>= 1) ? 2 :
142.2092 + a > (p >>>= 1) ? 4 :
142.2093 + 8);
142.2094 }
142.2095
142.2096 - // Public and protected methods
142.2097 + // Exported methods
142.2098
142.2099 // Constructors
142.2100
142.2101 @@ -1337,49 +1461,42 @@
142.2102 checkPermission();
142.2103 if (factory == null)
142.2104 throw new NullPointerException();
142.2105 - if (parallelism <= 0 || parallelism > MAX_WORKERS)
142.2106 + if (parallelism <= 0 || parallelism > MAX_ID)
142.2107 throw new IllegalArgumentException();
142.2108 this.parallelism = parallelism;
142.2109 this.factory = factory;
142.2110 this.ueh = handler;
142.2111 this.locallyFifo = asyncMode;
142.2112 - int arraySize = initialArraySizeFor(parallelism);
142.2113 - this.workers = new ForkJoinWorkerThread[arraySize];
142.2114 - this.submissionQueue = new LinkedTransferQueue<ForkJoinTask<?>>();
142.2115 - this.workerLock = new ReentrantLock();
142.2116 - this.termination = new Phaser(1);
142.2117 - this.poolNumber = poolNumberGenerator.incrementAndGet();
142.2118 - }
142.2119 -
142.2120 - /**
142.2121 - * Returns initial power of two size for workers array.
142.2122 - * @param pc the initial parallelism level
142.2123 - */
142.2124 - private static int initialArraySizeFor(int pc) {
142.2125 - // If possible, initially allocate enough space for one spare
142.2126 - int size = pc < MAX_WORKERS ? pc + 1 : MAX_WORKERS;
142.2127 - // See Hackers Delight, sec 3.2. We know MAX_WORKERS < (1 >>> 16)
142.2128 - size |= size >>> 1;
142.2129 - size |= size >>> 2;
142.2130 - size |= size >>> 4;
142.2131 - size |= size >>> 8;
142.2132 - return size + 1;
142.2133 + long np = (long)(-parallelism); // offset ctl counts
142.2134 + this.ctl = ((np << AC_SHIFT) & AC_MASK) | ((np << TC_SHIFT) & TC_MASK);
142.2135 + this.submissionQueue = new ForkJoinTask<?>[INITIAL_QUEUE_CAPACITY];
142.2136 + // initialize workers array with room for 2*parallelism if possible
142.2137 + int n = parallelism << 1;
142.2138 + if (n >= MAX_ID)
142.2139 + n = MAX_ID;
142.2140 + else { // See Hackers Delight, sec 3.2, where n < (1 << 16)
142.2141 + n |= n >>> 1; n |= n >>> 2; n |= n >>> 4; n |= n >>> 8;
142.2142 + }
142.2143 + workers = new ForkJoinWorkerThread[n + 1];
142.2144 + this.submissionLock = new ReentrantLock();
142.2145 + this.termination = submissionLock.newCondition();
142.2146 + StringBuilder sb = new StringBuilder("ForkJoinPool-");
142.2147 + sb.append(poolNumberGenerator.incrementAndGet());
142.2148 + sb.append("-worker-");
142.2149 + this.workerNamePrefix = sb.toString();
142.2150 }
142.2151
142.2152 // Execution methods
142.2153
142.2154 /**
142.2155 - * Submits task and creates, starts, or resumes some workers if necessary
142.2156 - */
142.2157 - private <T> void doSubmit(ForkJoinTask<T> task) {
142.2158 - submissionQueue.offer(task);
142.2159 - int c; // try to increment event count -- CAS failure OK
142.2160 - UNSAFE.compareAndSwapInt(this, eventCountOffset, c = eventCount, c+1);
142.2161 - helpMaintainParallelism();
142.2162 - }
142.2163 -
142.2164 - /**
142.2165 * Performs the given task, returning its result upon completion.
142.2166 + * If the computation encounters an unchecked Exception or Error,
142.2167 + * it is rethrown as the outcome of this invocation. Rethrown
142.2168 + * exceptions behave in the same way as regular exceptions, but,
142.2169 + * when possible, contain stack traces (as displayed for example
142.2170 + * using {@code ex.printStackTrace()}) of both the current thread
142.2171 + * as well as the thread actually encountering the exception;
142.2172 + * minimally only the latter.
142.2173 *
142.2174 * @param task the task
142.2175 * @return the task's result
142.2176 @@ -1388,16 +1505,16 @@
142.2177 * scheduled for execution
142.2178 */
142.2179 public <T> T invoke(ForkJoinTask<T> task) {
142.2180 + Thread t = Thread.currentThread();
142.2181 if (task == null)
142.2182 throw new NullPointerException();
142.2183 - if (runState >= SHUTDOWN)
142.2184 + if (shutdown)
142.2185 throw new RejectedExecutionException();
142.2186 - Thread t = Thread.currentThread();
142.2187 if ((t instanceof ForkJoinWorkerThread) &&
142.2188 ((ForkJoinWorkerThread)t).pool == this)
142.2189 return task.invoke(); // bypass submit if in same pool
142.2190 else {
142.2191 - doSubmit(task);
142.2192 + addSubmission(task);
142.2193 return task.join();
142.2194 }
142.2195 }
142.2196 @@ -1407,14 +1524,15 @@
142.2197 * computation in the current pool, else submits as external task.
142.2198 */
142.2199 private <T> void forkOrSubmit(ForkJoinTask<T> task) {
142.2200 - if (runState >= SHUTDOWN)
142.2201 + ForkJoinWorkerThread w;
142.2202 + Thread t = Thread.currentThread();
142.2203 + if (shutdown)
142.2204 throw new RejectedExecutionException();
142.2205 - Thread t = Thread.currentThread();
142.2206 if ((t instanceof ForkJoinWorkerThread) &&
142.2207 - ((ForkJoinWorkerThread)t).pool == this)
142.2208 - task.fork();
142.2209 + (w = (ForkJoinWorkerThread)t).pool == this)
142.2210 + w.pushTask(task);
142.2211 else
142.2212 - doSubmit(task);
142.2213 + addSubmission(task);
142.2214 }
142.2215
142.2216 /**
142.2217 @@ -1571,7 +1689,7 @@
142.2218 * @return the number of worker threads
142.2219 */
142.2220 public int getPoolSize() {
142.2221 - return workerCounts >>> TOTAL_COUNT_SHIFT;
142.2222 + return parallelism + (short)(ctl >>> TC_SHIFT);
142.2223 }
142.2224
142.2225 /**
142.2226 @@ -1593,7 +1711,8 @@
142.2227 * @return the number of worker threads
142.2228 */
142.2229 public int getRunningThreadCount() {
142.2230 - return workerCounts & RUNNING_COUNT_MASK;
142.2231 + int r = parallelism + (int)(ctl >> AC_SHIFT);
142.2232 + return r <= 0? 0 : r; // suppress momentarily negative values
142.2233 }
142.2234
142.2235 /**
142.2236 @@ -1604,7 +1723,8 @@
142.2237 * @return the number of active threads
142.2238 */
142.2239 public int getActiveThreadCount() {
142.2240 - return runState & ACTIVE_COUNT_MASK;
142.2241 + int r = parallelism + (int)(ctl >> AC_SHIFT) + blockedCount;
142.2242 + return r <= 0? 0 : r; // suppress momentarily negative values
142.2243 }
142.2244
142.2245 /**
142.2246 @@ -1619,7 +1739,7 @@
142.2247 * @return {@code true} if all threads are currently idle
142.2248 */
142.2249 public boolean isQuiescent() {
142.2250 - return (runState & ACTIVE_COUNT_MASK) == 0;
142.2251 + return parallelism + (int)(ctl >> AC_SHIFT) + blockedCount == 0;
142.2252 }
142.2253
142.2254 /**
142.2255 @@ -1649,21 +1769,25 @@
142.2256 */
142.2257 public long getQueuedTaskCount() {
142.2258 long count = 0;
142.2259 - for (ForkJoinWorkerThread w : workers)
142.2260 - if (w != null)
142.2261 - count += w.getQueueSize();
142.2262 + ForkJoinWorkerThread[] ws;
142.2263 + if ((short)(ctl >>> TC_SHIFT) > -parallelism &&
142.2264 + (ws = workers) != null) {
142.2265 + for (ForkJoinWorkerThread w : ws)
142.2266 + if (w != null)
142.2267 + count -= w.queueBase - w.queueTop; // must read base first
142.2268 + }
142.2269 return count;
142.2270 }
142.2271
142.2272 /**
142.2273 * Returns an estimate of the number of tasks submitted to this
142.2274 - * pool that have not yet begun executing. This method takes time
142.2275 - * proportional to the number of submissions.
142.2276 + * pool that have not yet begun executing. This method may take
142.2277 + * time proportional to the number of submissions.
142.2278 *
142.2279 * @return the number of queued submissions
142.2280 */
142.2281 public int getQueuedSubmissionCount() {
142.2282 - return submissionQueue.size();
142.2283 + return -queueBase + queueTop;
142.2284 }
142.2285
142.2286 /**
142.2287 @@ -1673,7 +1797,7 @@
142.2288 * @return {@code true} if there are any queued submissions
142.2289 */
142.2290 public boolean hasQueuedSubmissions() {
142.2291 - return !submissionQueue.isEmpty();
142.2292 + return queueBase != queueTop;
142.2293 }
142.2294
142.2295 /**
142.2296 @@ -1684,7 +1808,19 @@
142.2297 * @return the next submission, or {@code null} if none
142.2298 */
142.2299 protected ForkJoinTask<?> pollSubmission() {
142.2300 - return submissionQueue.poll();
142.2301 + ForkJoinTask<?> t; ForkJoinTask<?>[] q; int b, i;
142.2302 + while ((b = queueBase) != queueTop &&
142.2303 + (q = submissionQueue) != null &&
142.2304 + (i = (q.length - 1) & b) >= 0) {
142.2305 + long u = (i << ASHIFT) + ABASE;
142.2306 + if ((t = q[i]) != null &&
142.2307 + queueBase == b &&
142.2308 + UNSAFE.compareAndSwapObject(q, u, t, null)) {
142.2309 + queueBase = b + 1;
142.2310 + return t;
142.2311 + }
142.2312 + }
142.2313 + return null;
142.2314 }
142.2315
142.2316 /**
142.2317 @@ -1705,10 +1841,21 @@
142.2318 * @return the number of elements transferred
142.2319 */
142.2320 protected int drainTasksTo(Collection<? super ForkJoinTask<?>> c) {
142.2321 - int count = submissionQueue.drainTo(c);
142.2322 - for (ForkJoinWorkerThread w : workers)
142.2323 - if (w != null)
142.2324 - count += w.drainTasksTo(c);
142.2325 + int count = 0;
142.2326 + while (queueBase != queueTop) {
142.2327 + ForkJoinTask<?> t = pollSubmission();
142.2328 + if (t != null) {
142.2329 + c.add(t);
142.2330 + ++count;
142.2331 + }
142.2332 + }
142.2333 + ForkJoinWorkerThread[] ws;
142.2334 + if ((short)(ctl >>> TC_SHIFT) > -parallelism &&
142.2335 + (ws = workers) != null) {
142.2336 + for (ForkJoinWorkerThread w : ws)
142.2337 + if (w != null)
142.2338 + count += w.drainTasksTo(c);
142.2339 + }
142.2340 return count;
142.2341 }
142.2342
142.2343 @@ -1723,14 +1870,20 @@
142.2344 long st = getStealCount();
142.2345 long qt = getQueuedTaskCount();
142.2346 long qs = getQueuedSubmissionCount();
142.2347 - int wc = workerCounts;
142.2348 - int tc = wc >>> TOTAL_COUNT_SHIFT;
142.2349 - int rc = wc & RUNNING_COUNT_MASK;
142.2350 int pc = parallelism;
142.2351 - int rs = runState;
142.2352 - int ac = rs & ACTIVE_COUNT_MASK;
142.2353 + long c = ctl;
142.2354 + int tc = pc + (short)(c >>> TC_SHIFT);
142.2355 + int rc = pc + (int)(c >> AC_SHIFT);
142.2356 + if (rc < 0) // ignore transient negative
142.2357 + rc = 0;
142.2358 + int ac = rc + blockedCount;
142.2359 + String level;
142.2360 + if ((c & STOP_BIT) != 0)
142.2361 + level = (tc == 0)? "Terminated" : "Terminating";
142.2362 + else
142.2363 + level = shutdown? "Shutting down" : "Running";
142.2364 return super.toString() +
142.2365 - "[" + runLevelToString(rs) +
142.2366 + "[" + level +
142.2367 ", parallelism = " + pc +
142.2368 ", size = " + tc +
142.2369 ", active = " + ac +
142.2370 @@ -1741,13 +1894,6 @@
142.2371 "]";
142.2372 }
142.2373
142.2374 - private static String runLevelToString(int s) {
142.2375 - return ((s & TERMINATED) != 0 ? "Terminated" :
142.2376 - ((s & TERMINATING) != 0 ? "Terminating" :
142.2377 - ((s & SHUTDOWN) != 0 ? "Shutting down" :
142.2378 - "Running")));
142.2379 - }
142.2380 -
142.2381 /**
142.2382 * Initiates an orderly shutdown in which previously submitted
142.2383 * tasks are executed, but no new tasks will be accepted.
142.2384 @@ -1762,7 +1908,7 @@
142.2385 */
142.2386 public void shutdown() {
142.2387 checkPermission();
142.2388 - advanceRunLevel(SHUTDOWN);
142.2389 + shutdown = true;
142.2390 tryTerminate(false);
142.2391 }
142.2392
142.2393 @@ -1784,6 +1930,7 @@
142.2394 */
142.2395 public List<Runnable> shutdownNow() {
142.2396 checkPermission();
142.2397 + shutdown = true;
142.2398 tryTerminate(true);
142.2399 return Collections.emptyList();
142.2400 }
142.2401 @@ -1794,7 +1941,9 @@
142.2402 * @return {@code true} if all tasks have completed following shut down
142.2403 */
142.2404 public boolean isTerminated() {
142.2405 - return runState >= TERMINATED;
142.2406 + long c = ctl;
142.2407 + return ((c & STOP_BIT) != 0L &&
142.2408 + (short)(c >>> TC_SHIFT) == -parallelism);
142.2409 }
142.2410
142.2411 /**
142.2412 @@ -1811,14 +1960,16 @@
142.2413 * @return {@code true} if terminating but not yet terminated
142.2414 */
142.2415 public boolean isTerminating() {
142.2416 - return (runState & (TERMINATING|TERMINATED)) == TERMINATING;
142.2417 + long c = ctl;
142.2418 + return ((c & STOP_BIT) != 0L &&
142.2419 + (short)(c >>> TC_SHIFT) != -parallelism);
142.2420 }
142.2421
142.2422 /**
142.2423 * Returns true if terminating or terminated. Used by ForkJoinWorkerThread.
142.2424 */
142.2425 final boolean isAtLeastTerminating() {
142.2426 - return runState >= TERMINATING;
142.2427 + return (ctl & STOP_BIT) != 0L;
142.2428 }
142.2429
142.2430 /**
142.2431 @@ -1827,7 +1978,7 @@
142.2432 * @return {@code true} if this pool has been shut down
142.2433 */
142.2434 public boolean isShutdown() {
142.2435 - return runState >= SHUTDOWN;
142.2436 + return shutdown;
142.2437 }
142.2438
142.2439 /**
142.2440 @@ -1843,12 +1994,20 @@
142.2441 */
142.2442 public boolean awaitTermination(long timeout, TimeUnit unit)
142.2443 throws InterruptedException {
142.2444 + long nanos = unit.toNanos(timeout);
142.2445 + final ReentrantLock lock = this.submissionLock;
142.2446 + lock.lock();
142.2447 try {
142.2448 - termination.awaitAdvanceInterruptibly(0, timeout, unit);
142.2449 - } catch (TimeoutException ex) {
142.2450 - return false;
142.2451 + for (;;) {
142.2452 + if (isTerminated())
142.2453 + return true;
142.2454 + if (nanos <= 0)
142.2455 + return false;
142.2456 + nanos = termination.awaitNanos(nanos);
142.2457 + }
142.2458 + } finally {
142.2459 + lock.unlock();
142.2460 }
142.2461 - return true;
142.2462 }
142.2463
142.2464 /**
142.2465 @@ -1859,13 +2018,15 @@
142.2466 * {@code isReleasable} must return {@code true} if blocking is
142.2467 * not necessary. Method {@code block} blocks the current thread
142.2468 * if necessary (perhaps internally invoking {@code isReleasable}
142.2469 - * before actually blocking). The unusual methods in this API
142.2470 - * accommodate synchronizers that may, but don't usually, block
142.2471 - * for long periods. Similarly, they allow more efficient internal
142.2472 - * handling of cases in which additional workers may be, but
142.2473 - * usually are not, needed to ensure sufficient parallelism.
142.2474 - * Toward this end, implementations of method {@code isReleasable}
142.2475 - * must be amenable to repeated invocation.
142.2476 + * before actually blocking). These actions are performed by any
142.2477 + * thread invoking {@link ForkJoinPool#managedBlock}. The
142.2478 + * unusual methods in this API accommodate synchronizers that may,
142.2479 + * but don't usually, block for long periods. Similarly, they
142.2480 + * allow more efficient internal handling of cases in which
142.2481 + * additional workers may be, but usually are not, needed to
142.2482 + * ensure sufficient parallelism. Toward this end,
142.2483 + * implementations of method {@code isReleasable} must be amenable
142.2484 + * to repeated invocation.
142.2485 *
142.2486 * <p>For example, here is a ManagedBlocker based on a
142.2487 * ReentrantLock:
142.2488 @@ -1967,29 +2128,47 @@
142.2489 }
142.2490
142.2491 // Unsafe mechanics
142.2492 + private static final sun.misc.Unsafe UNSAFE;
142.2493 + private static final long ctlOffset;
142.2494 + private static final long stealCountOffset;
142.2495 + private static final long blockedCountOffset;
142.2496 + private static final long quiescerCountOffset;
142.2497 + private static final long scanGuardOffset;
142.2498 + private static final long nextWorkerNumberOffset;
142.2499 + private static final long ABASE;
142.2500 + private static final int ASHIFT;
142.2501
142.2502 - private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe();
142.2503 - private static final long workerCountsOffset =
142.2504 - objectFieldOffset("workerCounts", ForkJoinPool.class);
142.2505 - private static final long runStateOffset =
142.2506 - objectFieldOffset("runState", ForkJoinPool.class);
142.2507 - private static final long eventCountOffset =
142.2508 - objectFieldOffset("eventCount", ForkJoinPool.class);
142.2509 - private static final long eventWaitersOffset =
142.2510 - objectFieldOffset("eventWaiters", ForkJoinPool.class);
142.2511 - private static final long stealCountOffset =
142.2512 - objectFieldOffset("stealCount", ForkJoinPool.class);
142.2513 - private static final long spareWaitersOffset =
142.2514 - objectFieldOffset("spareWaiters", ForkJoinPool.class);
142.2515 + static {
142.2516 + poolNumberGenerator = new AtomicInteger();
142.2517 + workerSeedGenerator = new Random();
142.2518 + modifyThreadPermission = new RuntimePermission("modifyThread");
142.2519 + defaultForkJoinWorkerThreadFactory =
142.2520 + new DefaultForkJoinWorkerThreadFactory();
142.2521 + int s;
142.2522 + try {
142.2523 + UNSAFE = sun.misc.Unsafe.getUnsafe();
142.2524 + Class k = ForkJoinPool.class;
142.2525 + ctlOffset = UNSAFE.objectFieldOffset
142.2526 + (k.getDeclaredField("ctl"));
142.2527 + stealCountOffset = UNSAFE.objectFieldOffset
142.2528 + (k.getDeclaredField("stealCount"));
142.2529 + blockedCountOffset = UNSAFE.objectFieldOffset
142.2530 + (k.getDeclaredField("blockedCount"));
142.2531 + quiescerCountOffset = UNSAFE.objectFieldOffset
142.2532 + (k.getDeclaredField("quiescerCount"));
142.2533 + scanGuardOffset = UNSAFE.objectFieldOffset
142.2534 + (k.getDeclaredField("scanGuard"));
142.2535 + nextWorkerNumberOffset = UNSAFE.objectFieldOffset
142.2536 + (k.getDeclaredField("nextWorkerNumber"));
142.2537 + Class a = ForkJoinTask[].class;
142.2538 + ABASE = UNSAFE.arrayBaseOffset(a);
142.2539 + s = UNSAFE.arrayIndexScale(a);
142.2540 + } catch (Exception e) {
142.2541 + throw new Error(e);
142.2542 + }
142.2543 + if ((s & (s-1)) != 0)
142.2544 + throw new Error("data type scale not a power of two");
142.2545 + ASHIFT = 31 - Integer.numberOfLeadingZeros(s);
142.2546 + }
142.2547
142.2548 - private static long objectFieldOffset(String field, Class<?> klazz) {
142.2549 - try {
142.2550 - return UNSAFE.objectFieldOffset(klazz.getDeclaredField(field));
142.2551 - } catch (NoSuchFieldException e) {
142.2552 - // Convert Exception to corresponding Error
142.2553 - NoSuchFieldError error = new NoSuchFieldError(field);
142.2554 - error.initCause(e);
142.2555 - throw error;
142.2556 - }
142.2557 - }
142.2558 }
143.1 --- a/src/share/classes/java/util/concurrent/ForkJoinTask.java Tue Mar 29 11:29:01 2011 -0700
143.2 +++ b/src/share/classes/java/util/concurrent/ForkJoinTask.java Tue Mar 29 20:19:55 2011 -0700
143.3 @@ -41,7 +41,8 @@
143.4 import java.util.List;
143.5 import java.util.RandomAccess;
143.6 import java.util.Map;
143.7 -import java.util.WeakHashMap;
143.8 +import java.lang.ref.WeakReference;
143.9 +import java.lang.ref.ReferenceQueue;
143.10 import java.util.concurrent.Callable;
143.11 import java.util.concurrent.CancellationException;
143.12 import java.util.concurrent.ExecutionException;
143.13 @@ -52,6 +53,8 @@
143.14 import java.util.concurrent.RunnableFuture;
143.15 import java.util.concurrent.TimeUnit;
143.16 import java.util.concurrent.TimeoutException;
143.17 +import java.util.concurrent.locks.ReentrantLock;
143.18 +import java.lang.reflect.Constructor;
143.19
143.20 /**
143.21 * Abstract base class for tasks that run within a {@link ForkJoinPool}.
143.22 @@ -95,7 +98,11 @@
143.23 * rethrown to callers attempting to join them. These exceptions may
143.24 * additionally include {@link RejectedExecutionException} stemming
143.25 * from internal resource exhaustion, such as failure to allocate
143.26 - * internal task queues.
143.27 + * internal task queues. Rethrown exceptions behave in the same way as
143.28 + * regular exceptions, but, when possible, contain stack traces (as
143.29 + * displayed for example using {@code ex.printStackTrace()}) of both
143.30 + * the thread that initiated the computation as well as the thread
143.31 + * actually encountering the exception; minimally only the latter.
143.32 *
143.33 * <p>The primary method for awaiting completion and extracting
143.34 * results of a task is {@link #join}, but there are several variants:
143.35 @@ -192,8 +199,7 @@
143.36 * status maintenance (2) execution and awaiting completion (3)
143.37 * user-level methods that additionally report results. This is
143.38 * sometimes hard to see because this file orders exported methods
143.39 - * in a way that flows well in javadocs. In particular, most
143.40 - * join mechanics are in method quietlyJoin, below.
143.41 + * in a way that flows well in javadocs.
143.42 */
143.43
143.44 /*
143.45 @@ -215,91 +221,67 @@
143.46
143.47 /** The run status of this task */
143.48 volatile int status; // accessed directly by pool and workers
143.49 -
143.50 private static final int NORMAL = -1;
143.51 private static final int CANCELLED = -2;
143.52 private static final int EXCEPTIONAL = -3;
143.53 private static final int SIGNAL = 1;
143.54
143.55 /**
143.56 - * Table of exceptions thrown by tasks, to enable reporting by
143.57 - * callers. Because exceptions are rare, we don't directly keep
143.58 - * them with task objects, but instead use a weak ref table. Note
143.59 - * that cancellation exceptions don't appear in the table, but are
143.60 - * instead recorded as status values.
143.61 - * TODO: Use ConcurrentReferenceHashMap
143.62 - */
143.63 - static final Map<ForkJoinTask<?>, Throwable> exceptionMap =
143.64 - Collections.synchronizedMap
143.65 - (new WeakHashMap<ForkJoinTask<?>, Throwable>());
143.66 -
143.67 - // Maintaining completion status
143.68 -
143.69 - /**
143.70 * Marks completion and wakes up threads waiting to join this task,
143.71 * also clearing signal request bits.
143.72 *
143.73 * @param completion one of NORMAL, CANCELLED, EXCEPTIONAL
143.74 + * @return completion status on exit
143.75 */
143.76 - private void setCompletion(int completion) {
143.77 - int s;
143.78 - while ((s = status) >= 0) {
143.79 + private int setCompletion(int completion) {
143.80 + for (int s;;) {
143.81 + if ((s = status) < 0)
143.82 + return s;
143.83 if (UNSAFE.compareAndSwapInt(this, statusOffset, s, completion)) {
143.84 if (s != 0)
143.85 synchronized (this) { notifyAll(); }
143.86 - break;
143.87 + return completion;
143.88 }
143.89 }
143.90 }
143.91
143.92 /**
143.93 - * Records exception and sets exceptional completion.
143.94 + * Tries to block a worker thread until completed or timed out.
143.95 + * Uses Object.wait time argument conventions.
143.96 + * May fail on contention or interrupt.
143.97 *
143.98 - * @return status on exit
143.99 + * @param millis if > 0, wait time.
143.100 */
143.101 - private void setExceptionalCompletion(Throwable rex) {
143.102 - exceptionMap.put(this, rex);
143.103 - setCompletion(EXCEPTIONAL);
143.104 - }
143.105 -
143.106 - /**
143.107 - * Blocks a worker thread until completed or timed out. Called
143.108 - * only by pool.
143.109 - */
143.110 - final void internalAwaitDone(long millis, int nanos) {
143.111 - int s = status;
143.112 - if ((s == 0 &&
143.113 - UNSAFE.compareAndSwapInt(this, statusOffset, 0, SIGNAL)) ||
143.114 - s > 0) {
143.115 - try { // the odd construction reduces lock bias effects
143.116 + final void tryAwaitDone(long millis) {
143.117 + int s;
143.118 + try {
143.119 + if (((s = status) > 0 ||
143.120 + (s == 0 &&
143.121 + UNSAFE.compareAndSwapInt(this, statusOffset, 0, SIGNAL))) &&
143.122 + status > 0) {
143.123 synchronized (this) {
143.124 if (status > 0)
143.125 - wait(millis, nanos);
143.126 - else
143.127 - notifyAll();
143.128 + wait(millis);
143.129 }
143.130 - } catch (InterruptedException ie) {
143.131 - cancelIfTerminating();
143.132 }
143.133 + } catch (InterruptedException ie) {
143.134 + // caller must check termination
143.135 }
143.136 }
143.137
143.138 /**
143.139 * Blocks a non-worker-thread until completion.
143.140 + * @return status upon completion
143.141 */
143.142 - private void externalAwaitDone() {
143.143 - if (status >= 0) {
143.144 + private int externalAwaitDone() {
143.145 + int s;
143.146 + if ((s = status) >= 0) {
143.147 boolean interrupted = false;
143.148 synchronized (this) {
143.149 - for (;;) {
143.150 - int s = status;
143.151 + while ((s = status) >= 0) {
143.152 if (s == 0)
143.153 UNSAFE.compareAndSwapInt(this, statusOffset,
143.154 0, SIGNAL);
143.155 - else if (s < 0) {
143.156 - notifyAll();
143.157 - break;
143.158 - }
143.159 else {
143.160 try {
143.161 wait();
143.162 @@ -312,53 +294,308 @@
143.163 if (interrupted)
143.164 Thread.currentThread().interrupt();
143.165 }
143.166 + return s;
143.167 }
143.168
143.169 /**
143.170 * Blocks a non-worker-thread until completion or interruption or timeout.
143.171 */
143.172 - private void externalInterruptibleAwaitDone(boolean timed, long nanos)
143.173 + private int externalInterruptibleAwaitDone(long millis)
143.174 throws InterruptedException {
143.175 + int s;
143.176 if (Thread.interrupted())
143.177 throw new InterruptedException();
143.178 - if (status >= 0) {
143.179 - long startTime = timed ? System.nanoTime() : 0L;
143.180 + if ((s = status) >= 0) {
143.181 synchronized (this) {
143.182 - for (;;) {
143.183 - long nt;
143.184 - int s = status;
143.185 + while ((s = status) >= 0) {
143.186 if (s == 0)
143.187 UNSAFE.compareAndSwapInt(this, statusOffset,
143.188 0, SIGNAL);
143.189 - else if (s < 0) {
143.190 - notifyAll();
143.191 + else {
143.192 + wait(millis);
143.193 + if (millis > 0L)
143.194 + break;
143.195 + }
143.196 + }
143.197 + }
143.198 + }
143.199 + return s;
143.200 + }
143.201 +
143.202 + /**
143.203 + * Primary execution method for stolen tasks. Unless done, calls
143.204 + * exec and records status if completed, but doesn't wait for
143.205 + * completion otherwise.
143.206 + */
143.207 + final void doExec() {
143.208 + if (status >= 0) {
143.209 + boolean completed;
143.210 + try {
143.211 + completed = exec();
143.212 + } catch (Throwable rex) {
143.213 + setExceptionalCompletion(rex);
143.214 + return;
143.215 + }
143.216 + if (completed)
143.217 + setCompletion(NORMAL); // must be outside try block
143.218 + }
143.219 + }
143.220 +
143.221 + /**
143.222 + * Primary mechanics for join, get, quietlyJoin.
143.223 + * @return status upon completion
143.224 + */
143.225 + private int doJoin() {
143.226 + Thread t; ForkJoinWorkerThread w; int s; boolean completed;
143.227 + if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
143.228 + if ((s = status) < 0)
143.229 + return s;
143.230 + if ((w = (ForkJoinWorkerThread)t).unpushTask(this)) {
143.231 + try {
143.232 + completed = exec();
143.233 + } catch (Throwable rex) {
143.234 + return setExceptionalCompletion(rex);
143.235 + }
143.236 + if (completed)
143.237 + return setCompletion(NORMAL);
143.238 + }
143.239 + return w.joinTask(this);
143.240 + }
143.241 + else
143.242 + return externalAwaitDone();
143.243 + }
143.244 +
143.245 + /**
143.246 + * Primary mechanics for invoke, quietlyInvoke.
143.247 + * @return status upon completion
143.248 + */
143.249 + private int doInvoke() {
143.250 + int s; boolean completed;
143.251 + if ((s = status) < 0)
143.252 + return s;
143.253 + try {
143.254 + completed = exec();
143.255 + } catch (Throwable rex) {
143.256 + return setExceptionalCompletion(rex);
143.257 + }
143.258 + if (completed)
143.259 + return setCompletion(NORMAL);
143.260 + else
143.261 + return doJoin();
143.262 + }
143.263 +
143.264 + // Exception table support
143.265 +
143.266 + /**
143.267 + * Table of exceptions thrown by tasks, to enable reporting by
143.268 + * callers. Because exceptions are rare, we don't directly keep
143.269 + * them with task objects, but instead use a weak ref table. Note
143.270 + * that cancellation exceptions don't appear in the table, but are
143.271 + * instead recorded as status values.
143.272 + *
143.273 + * Note: These statics are initialized below in static block.
143.274 + */
143.275 + private static final ExceptionNode[] exceptionTable;
143.276 + private static final ReentrantLock exceptionTableLock;
143.277 + private static final ReferenceQueue<Object> exceptionTableRefQueue;
143.278 +
143.279 + /**
143.280 + * Fixed capacity for exceptionTable.
143.281 + */
143.282 + private static final int EXCEPTION_MAP_CAPACITY = 32;
143.283 +
143.284 + /**
143.285 + * Key-value nodes for exception table. The chained hash table
143.286 + * uses identity comparisons, full locking, and weak references
143.287 + * for keys. The table has a fixed capacity because it only
143.288 + * maintains task exceptions long enough for joiners to access
143.289 + * them, so should never become very large for sustained
143.290 + * periods. However, since we do not know when the last joiner
143.291 + * completes, we must use weak references and expunge them. We do
143.292 + * so on each operation (hence full locking). Also, some thread in
143.293 + * any ForkJoinPool will call helpExpungeStaleExceptions when its
143.294 + * pool becomes isQuiescent.
143.295 + */
143.296 + static final class ExceptionNode extends WeakReference<ForkJoinTask<?>>{
143.297 + final Throwable ex;
143.298 + ExceptionNode next;
143.299 + final long thrower; // use id not ref to avoid weak cycles
143.300 + ExceptionNode(ForkJoinTask<?> task, Throwable ex, ExceptionNode next) {
143.301 + super(task, exceptionTableRefQueue);
143.302 + this.ex = ex;
143.303 + this.next = next;
143.304 + this.thrower = Thread.currentThread().getId();
143.305 + }
143.306 + }
143.307 +
143.308 + /**
143.309 + * Records exception and sets exceptional completion.
143.310 + *
143.311 + * @return status on exit
143.312 + */
143.313 + private int setExceptionalCompletion(Throwable ex) {
143.314 + int h = System.identityHashCode(this);
143.315 + final ReentrantLock lock = exceptionTableLock;
143.316 + lock.lock();
143.317 + try {
143.318 + expungeStaleExceptions();
143.319 + ExceptionNode[] t = exceptionTable;
143.320 + int i = h & (t.length - 1);
143.321 + for (ExceptionNode e = t[i]; ; e = e.next) {
143.322 + if (e == null) {
143.323 + t[i] = new ExceptionNode(this, ex, t[i]);
143.324 + break;
143.325 + }
143.326 + if (e.get() == this) // already present
143.327 + break;
143.328 + }
143.329 + } finally {
143.330 + lock.unlock();
143.331 + }
143.332 + return setCompletion(EXCEPTIONAL);
143.333 + }
143.334 +
143.335 + /**
143.336 + * Removes exception node and clears status
143.337 + */
143.338 + private void clearExceptionalCompletion() {
143.339 + int h = System.identityHashCode(this);
143.340 + final ReentrantLock lock = exceptionTableLock;
143.341 + lock.lock();
143.342 + try {
143.343 + ExceptionNode[] t = exceptionTable;
143.344 + int i = h & (t.length - 1);
143.345 + ExceptionNode e = t[i];
143.346 + ExceptionNode pred = null;
143.347 + while (e != null) {
143.348 + ExceptionNode next = e.next;
143.349 + if (e.get() == this) {
143.350 + if (pred == null)
143.351 + t[i] = next;
143.352 + else
143.353 + pred.next = next;
143.354 + break;
143.355 + }
143.356 + pred = e;
143.357 + e = next;
143.358 + }
143.359 + expungeStaleExceptions();
143.360 + status = 0;
143.361 + } finally {
143.362 + lock.unlock();
143.363 + }
143.364 + }
143.365 +
143.366 + /**
143.367 + * Returns a rethrowable exception for the given task, if
143.368 + * available. To provide accurate stack traces, if the exception
143.369 + * was not thrown by the current thread, we try to create a new
143.370 + * exception of the same type as the one thrown, but with the
143.371 + * recorded exception as its cause. If there is no such
143.372 + * constructor, we instead try to use a no-arg constructor,
143.373 + * followed by initCause, to the same effect. If none of these
143.374 + * apply, or any fail due to other exceptions, we return the
143.375 + * recorded exception, which is still correct, although it may
143.376 + * contain a misleading stack trace.
143.377 + *
143.378 + * @return the exception, or null if none
143.379 + */
143.380 + private Throwable getThrowableException() {
143.381 + if (status != EXCEPTIONAL)
143.382 + return null;
143.383 + int h = System.identityHashCode(this);
143.384 + ExceptionNode e;
143.385 + final ReentrantLock lock = exceptionTableLock;
143.386 + lock.lock();
143.387 + try {
143.388 + expungeStaleExceptions();
143.389 + ExceptionNode[] t = exceptionTable;
143.390 + e = t[h & (t.length - 1)];
143.391 + while (e != null && e.get() != this)
143.392 + e = e.next;
143.393 + } finally {
143.394 + lock.unlock();
143.395 + }
143.396 + Throwable ex;
143.397 + if (e == null || (ex = e.ex) == null)
143.398 + return null;
143.399 + if (e.thrower != Thread.currentThread().getId()) {
143.400 + Class ec = ex.getClass();
143.401 + try {
143.402 + Constructor<?> noArgCtor = null;
143.403 + Constructor<?>[] cs = ec.getConstructors();// public ctors only
143.404 + for (int i = 0; i < cs.length; ++i) {
143.405 + Constructor<?> c = cs[i];
143.406 + Class<?>[] ps = c.getParameterTypes();
143.407 + if (ps.length == 0)
143.408 + noArgCtor = c;
143.409 + else if (ps.length == 1 && ps[0] == Throwable.class)
143.410 + return (Throwable)(c.newInstance(ex));
143.411 + }
143.412 + if (noArgCtor != null) {
143.413 + Throwable wx = (Throwable)(noArgCtor.newInstance());
143.414 + wx.initCause(ex);
143.415 + return wx;
143.416 + }
143.417 + } catch (Exception ignore) {
143.418 + }
143.419 + }
143.420 + return ex;
143.421 + }
143.422 +
143.423 + /**
143.424 + * Poll stale refs and remove them. Call only while holding lock.
143.425 + */
143.426 + private static void expungeStaleExceptions() {
143.427 + for (Object x; (x = exceptionTableRefQueue.poll()) != null;) {
143.428 + if (x instanceof ExceptionNode) {
143.429 + ForkJoinTask<?> key = ((ExceptionNode)x).get();
143.430 + ExceptionNode[] t = exceptionTable;
143.431 + int i = System.identityHashCode(key) & (t.length - 1);
143.432 + ExceptionNode e = t[i];
143.433 + ExceptionNode pred = null;
143.434 + while (e != null) {
143.435 + ExceptionNode next = e.next;
143.436 + if (e == x) {
143.437 + if (pred == null)
143.438 + t[i] = next;
143.439 + else
143.440 + pred.next = next;
143.441 break;
143.442 }
143.443 - else if (!timed)
143.444 - wait();
143.445 - else if ((nt = nanos - (System.nanoTime()-startTime)) > 0L)
143.446 - wait(nt / 1000000, (int)(nt % 1000000));
143.447 - else
143.448 - break;
143.449 + pred = e;
143.450 + e = next;
143.451 }
143.452 }
143.453 }
143.454 }
143.455
143.456 /**
143.457 - * Unless done, calls exec and records status if completed, but
143.458 - * doesn't wait for completion otherwise. Primary execution method
143.459 - * for ForkJoinWorkerThread.
143.460 + * If lock is available, poll stale refs and remove them.
143.461 + * Called from ForkJoinPool when pools become quiescent.
143.462 */
143.463 - final void quietlyExec() {
143.464 - try {
143.465 - if (status < 0 || !exec())
143.466 - return;
143.467 - } catch (Throwable rex) {
143.468 - setExceptionalCompletion(rex);
143.469 - return;
143.470 + static final void helpExpungeStaleExceptions() {
143.471 + final ReentrantLock lock = exceptionTableLock;
143.472 + if (lock.tryLock()) {
143.473 + try {
143.474 + expungeStaleExceptions();
143.475 + } finally {
143.476 + lock.unlock();
143.477 + }
143.478 }
143.479 - setCompletion(NORMAL); // must be outside try block
143.480 + }
143.481 +
143.482 + /**
143.483 + * Report the result of invoke or join; called only upon
143.484 + * non-normal return of internal versions.
143.485 + */
143.486 + private V reportResult() {
143.487 + int s; Throwable ex;
143.488 + if ((s = status) == CANCELLED)
143.489 + throw new CancellationException();
143.490 + if (s == EXCEPTIONAL && (ex = getThrowableException()) != null)
143.491 + UNSAFE.throwException(ex);
143.492 + return getRawResult();
143.493 }
143.494
143.495 // public methods
143.496 @@ -399,11 +636,10 @@
143.497 * @return the computed result
143.498 */
143.499 public final V join() {
143.500 - quietlyJoin();
143.501 - Throwable ex;
143.502 - if (status < NORMAL && (ex = getException()) != null)
143.503 - UNSAFE.throwException(ex);
143.504 - return getRawResult();
143.505 + if (doJoin() != NORMAL)
143.506 + return reportResult();
143.507 + else
143.508 + return getRawResult();
143.509 }
143.510
143.511 /**
143.512 @@ -415,11 +651,10 @@
143.513 * @return the computed result
143.514 */
143.515 public final V invoke() {
143.516 - quietlyInvoke();
143.517 - Throwable ex;
143.518 - if (status < NORMAL && (ex = getException()) != null)
143.519 - UNSAFE.throwException(ex);
143.520 - return getRawResult();
143.521 + if (doInvoke() != NORMAL)
143.522 + return reportResult();
143.523 + else
143.524 + return getRawResult();
143.525 }
143.526
143.527 /**
143.528 @@ -483,22 +718,16 @@
143.529 }
143.530 else if (i != 0)
143.531 t.fork();
143.532 - else {
143.533 - t.quietlyInvoke();
143.534 - if (ex == null && t.status < NORMAL)
143.535 - ex = t.getException();
143.536 - }
143.537 + else if (t.doInvoke() < NORMAL && ex == null)
143.538 + ex = t.getException();
143.539 }
143.540 for (int i = 1; i <= last; ++i) {
143.541 ForkJoinTask<?> t = tasks[i];
143.542 if (t != null) {
143.543 if (ex != null)
143.544 t.cancel(false);
143.545 - else {
143.546 - t.quietlyJoin();
143.547 - if (ex == null && t.status < NORMAL)
143.548 - ex = t.getException();
143.549 - }
143.550 + else if (t.doJoin() < NORMAL && ex == null)
143.551 + ex = t.getException();
143.552 }
143.553 }
143.554 if (ex != null)
143.555 @@ -546,22 +775,16 @@
143.556 }
143.557 else if (i != 0)
143.558 t.fork();
143.559 - else {
143.560 - t.quietlyInvoke();
143.561 - if (ex == null && t.status < NORMAL)
143.562 - ex = t.getException();
143.563 - }
143.564 + else if (t.doInvoke() < NORMAL && ex == null)
143.565 + ex = t.getException();
143.566 }
143.567 for (int i = 1; i <= last; ++i) {
143.568 ForkJoinTask<?> t = ts.get(i);
143.569 if (t != null) {
143.570 if (ex != null)
143.571 t.cancel(false);
143.572 - else {
143.573 - t.quietlyJoin();
143.574 - if (ex == null && t.status < NORMAL)
143.575 - ex = t.getException();
143.576 - }
143.577 + else if (t.doJoin() < NORMAL && ex == null)
143.578 + ex = t.getException();
143.579 }
143.580 }
143.581 if (ex != null)
143.582 @@ -597,8 +820,7 @@
143.583 * @return {@code true} if this task is now cancelled
143.584 */
143.585 public boolean cancel(boolean mayInterruptIfRunning) {
143.586 - setCompletion(CANCELLED);
143.587 - return status == CANCELLED;
143.588 + return setCompletion(CANCELLED) == CANCELLED;
143.589 }
143.590
143.591 /**
143.592 @@ -614,21 +836,6 @@
143.593 }
143.594 }
143.595
143.596 - /**
143.597 - * Cancels if current thread is a terminating worker thread,
143.598 - * ignoring any exceptions thrown by cancel.
143.599 - */
143.600 - final void cancelIfTerminating() {
143.601 - Thread t = Thread.currentThread();
143.602 - if ((t instanceof ForkJoinWorkerThread) &&
143.603 - ((ForkJoinWorkerThread) t).isTerminating()) {
143.604 - try {
143.605 - cancel(false);
143.606 - } catch (Throwable ignore) {
143.607 - }
143.608 - }
143.609 - }
143.610 -
143.611 public final boolean isDone() {
143.612 return status < 0;
143.613 }
143.614 @@ -668,7 +875,7 @@
143.615 int s = status;
143.616 return ((s >= NORMAL) ? null :
143.617 (s == CANCELLED) ? new CancellationException() :
143.618 - exceptionMap.get(this));
143.619 + getThrowableException());
143.620 }
143.621
143.622 /**
143.623 @@ -726,19 +933,13 @@
143.624 * member of a ForkJoinPool and was interrupted while waiting
143.625 */
143.626 public final V get() throws InterruptedException, ExecutionException {
143.627 - Thread t = Thread.currentThread();
143.628 - if (t instanceof ForkJoinWorkerThread)
143.629 - quietlyJoin();
143.630 - else
143.631 - externalInterruptibleAwaitDone(false, 0L);
143.632 - int s = status;
143.633 - if (s != NORMAL) {
143.634 - Throwable ex;
143.635 - if (s == CANCELLED)
143.636 - throw new CancellationException();
143.637 - if (s == EXCEPTIONAL && (ex = exceptionMap.get(this)) != null)
143.638 - throw new ExecutionException(ex);
143.639 - }
143.640 + int s = (Thread.currentThread() instanceof ForkJoinWorkerThread) ?
143.641 + doJoin() : externalInterruptibleAwaitDone(0L);
143.642 + Throwable ex;
143.643 + if (s == CANCELLED)
143.644 + throw new CancellationException();
143.645 + if (s == EXCEPTIONAL && (ex = getThrowableException()) != null)
143.646 + throw new ExecutionException(ex);
143.647 return getRawResult();
143.648 }
143.649
143.650 @@ -758,20 +959,39 @@
143.651 */
143.652 public final V get(long timeout, TimeUnit unit)
143.653 throws InterruptedException, ExecutionException, TimeoutException {
143.654 - long nanos = unit.toNanos(timeout);
143.655 Thread t = Thread.currentThread();
143.656 - if (t instanceof ForkJoinWorkerThread)
143.657 - ((ForkJoinWorkerThread)t).joinTask(this, true, nanos);
143.658 - else
143.659 - externalInterruptibleAwaitDone(true, nanos);
143.660 + if (t instanceof ForkJoinWorkerThread) {
143.661 + ForkJoinWorkerThread w = (ForkJoinWorkerThread) t;
143.662 + long nanos = unit.toNanos(timeout);
143.663 + if (status >= 0) {
143.664 + boolean completed = false;
143.665 + if (w.unpushTask(this)) {
143.666 + try {
143.667 + completed = exec();
143.668 + } catch (Throwable rex) {
143.669 + setExceptionalCompletion(rex);
143.670 + }
143.671 + }
143.672 + if (completed)
143.673 + setCompletion(NORMAL);
143.674 + else if (status >= 0 && nanos > 0)
143.675 + w.pool.timedAwaitJoin(this, nanos);
143.676 + }
143.677 + }
143.678 + else {
143.679 + long millis = unit.toMillis(timeout);
143.680 + if (millis > 0)
143.681 + externalInterruptibleAwaitDone(millis);
143.682 + }
143.683 int s = status;
143.684 if (s != NORMAL) {
143.685 Throwable ex;
143.686 if (s == CANCELLED)
143.687 throw new CancellationException();
143.688 - if (s == EXCEPTIONAL && (ex = exceptionMap.get(this)) != null)
143.689 + if (s != EXCEPTIONAL)
143.690 + throw new TimeoutException();
143.691 + if ((ex = getThrowableException()) != null)
143.692 throw new ExecutionException(ex);
143.693 - throw new TimeoutException();
143.694 }
143.695 return getRawResult();
143.696 }
143.697 @@ -783,28 +1003,7 @@
143.698 * known to have aborted.
143.699 */
143.700 public final void quietlyJoin() {
143.701 - Thread t;
143.702 - if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
143.703 - ForkJoinWorkerThread w = (ForkJoinWorkerThread) t;
143.704 - if (status >= 0) {
143.705 - if (w.unpushTask(this)) {
143.706 - boolean completed;
143.707 - try {
143.708 - completed = exec();
143.709 - } catch (Throwable rex) {
143.710 - setExceptionalCompletion(rex);
143.711 - return;
143.712 - }
143.713 - if (completed) {
143.714 - setCompletion(NORMAL);
143.715 - return;
143.716 - }
143.717 - }
143.718 - w.joinTask(this, false, 0L);
143.719 - }
143.720 - }
143.721 - else
143.722 - externalAwaitDone();
143.723 + doJoin();
143.724 }
143.725
143.726 /**
143.727 @@ -813,19 +1012,7 @@
143.728 * exception.
143.729 */
143.730 public final void quietlyInvoke() {
143.731 - if (status >= 0) {
143.732 - boolean completed;
143.733 - try {
143.734 - completed = exec();
143.735 - } catch (Throwable rex) {
143.736 - setExceptionalCompletion(rex);
143.737 - return;
143.738 - }
143.739 - if (completed)
143.740 - setCompletion(NORMAL);
143.741 - else
143.742 - quietlyJoin();
143.743 - }
143.744 + doInvoke();
143.745 }
143.746
143.747 /**
143.748 @@ -864,8 +1051,9 @@
143.749 */
143.750 public void reinitialize() {
143.751 if (status == EXCEPTIONAL)
143.752 - exceptionMap.remove(this);
143.753 - status = 0;
143.754 + clearExceptionalCompletion();
143.755 + else
143.756 + status = 0;
143.757 }
143.758
143.759 /**
143.760 @@ -1176,23 +1364,23 @@
143.761 s.defaultReadObject();
143.762 Object ex = s.readObject();
143.763 if (ex != null)
143.764 - setExceptionalCompletion((Throwable) ex);
143.765 + setExceptionalCompletion((Throwable)ex);
143.766 }
143.767
143.768 // Unsafe mechanics
143.769 -
143.770 - private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe();
143.771 - private static final long statusOffset =
143.772 - objectFieldOffset("status", ForkJoinTask.class);
143.773 -
143.774 - private static long objectFieldOffset(String field, Class<?> klazz) {
143.775 + private static final sun.misc.Unsafe UNSAFE;
143.776 + private static final long statusOffset;
143.777 + static {
143.778 + exceptionTableLock = new ReentrantLock();
143.779 + exceptionTableRefQueue = new ReferenceQueue<Object>();
143.780 + exceptionTable = new ExceptionNode[EXCEPTION_MAP_CAPACITY];
143.781 try {
143.782 - return UNSAFE.objectFieldOffset(klazz.getDeclaredField(field));
143.783 - } catch (NoSuchFieldException e) {
143.784 - // Convert Exception to corresponding Error
143.785 - NoSuchFieldError error = new NoSuchFieldError(field);
143.786 - error.initCause(e);
143.787 - throw error;
143.788 + UNSAFE = sun.misc.Unsafe.getUnsafe();
143.789 + statusOffset = UNSAFE.objectFieldOffset
143.790 + (ForkJoinTask.class.getDeclaredField("status"));
143.791 + } catch (Exception e) {
143.792 + throw new Error(e);
143.793 }
143.794 }
143.795 +
143.796 }
144.1 --- a/src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java Tue Mar 29 11:29:01 2011 -0700
144.2 +++ b/src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java Tue Mar 29 20:19:55 2011 -0700
144.3 @@ -35,9 +35,7 @@
144.4
144.5 package java.util.concurrent;
144.6
144.7 -import java.util.Random;
144.8 import java.util.Collection;
144.9 -import java.util.concurrent.locks.LockSupport;
144.10 import java.util.concurrent.RejectedExecutionException;
144.11
144.12 /**
144.13 @@ -84,33 +82,38 @@
144.14 * a footprint as possible even in programs generating huge
144.15 * numbers of tasks. To accomplish this, we shift the CAS
144.16 * arbitrating pop vs deq (steal) from being on the indices
144.17 - * ("base" and "sp") to the slots themselves (mainly via method
144.18 - * "casSlotNull()"). So, both a successful pop and deq mainly
144.19 - * entail a CAS of a slot from non-null to null. Because we rely
144.20 - * on CASes of references, we do not need tag bits on base or sp.
144.21 - * They are simple ints as used in any circular array-based queue
144.22 - * (see for example ArrayDeque). Updates to the indices must
144.23 - * still be ordered in a way that guarantees that sp == base means
144.24 - * the queue is empty, but otherwise may err on the side of
144.25 - * possibly making the queue appear nonempty when a push, pop, or
144.26 - * deq have not fully committed. Note that this means that the deq
144.27 - * operation, considered individually, is not wait-free. One thief
144.28 - * cannot successfully continue until another in-progress one (or,
144.29 - * if previously empty, a push) completes. However, in the
144.30 + * ("queueBase" and "queueTop") to the slots themselves (mainly
144.31 + * via method "casSlotNull()"). So, both a successful pop and deq
144.32 + * mainly entail a CAS of a slot from non-null to null. Because
144.33 + * we rely on CASes of references, we do not need tag bits on
144.34 + * queueBase or queueTop. They are simple ints as used in any
144.35 + * circular array-based queue (see for example ArrayDeque).
144.36 + * Updates to the indices must still be ordered in a way that
144.37 + * guarantees that queueTop == queueBase means the queue is empty,
144.38 + * but otherwise may err on the side of possibly making the queue
144.39 + * appear nonempty when a push, pop, or deq have not fully
144.40 + * committed. Note that this means that the deq operation,
144.41 + * considered individually, is not wait-free. One thief cannot
144.42 + * successfully continue until another in-progress one (or, if
144.43 + * previously empty, a push) completes. However, in the
144.44 * aggregate, we ensure at least probabilistic non-blockingness.
144.45 * If an attempted steal fails, a thief always chooses a different
144.46 * random victim target to try next. So, in order for one thief to
144.47 * progress, it suffices for any in-progress deq or new push on
144.48 - * any empty queue to complete. One reason this works well here is
144.49 - * that apparently-nonempty often means soon-to-be-stealable,
144.50 - * which gives threads a chance to set activation status if
144.51 - * necessary before stealing.
144.52 + * any empty queue to complete.
144.53 *
144.54 * This approach also enables support for "async mode" where local
144.55 * task processing is in FIFO, not LIFO order; simply by using a
144.56 * version of deq rather than pop when locallyFifo is true (as set
144.57 * by the ForkJoinPool). This allows use in message-passing
144.58 - * frameworks in which tasks are never joined.
144.59 + * frameworks in which tasks are never joined. However neither
144.60 + * mode considers affinities, loads, cache localities, etc, so
144.61 + * rarely provide the best possible performance on a given
144.62 + * machine, but portably provide good throughput by averaging over
144.63 + * these factors. (Further, even if we did try to use such
144.64 + * information, we do not usually have a basis for exploiting
144.65 + * it. For example, some sets of tasks profit from cache
144.66 + * affinities, but others are harmed by cache pollution effects.)
144.67 *
144.68 * When a worker would otherwise be blocked waiting to join a
144.69 * task, it first tries a form of linear helping: Each worker
144.70 @@ -137,29 +140,26 @@
144.71 * miss links in the chain during long-lived tasks, GC stalls etc
144.72 * (which is OK since blocking in such cases is usually a good
144.73 * idea). (4) We bound the number of attempts to find work (see
144.74 - * MAX_HELP_DEPTH) and fall back to suspending the worker and if
144.75 - * necessary replacing it with a spare (see
144.76 - * ForkJoinPool.awaitJoin).
144.77 + * MAX_HELP) and fall back to suspending the worker and if
144.78 + * necessary replacing it with another.
144.79 *
144.80 * Efficient implementation of these algorithms currently relies
144.81 * on an uncomfortable amount of "Unsafe" mechanics. To maintain
144.82 - * correct orderings, reads and writes of variable base require
144.83 - * volatile ordering. Variable sp does not require volatile
144.84 - * writes but still needs store-ordering, which we accomplish by
144.85 - * pre-incrementing sp before filling the slot with an ordered
144.86 - * store. (Pre-incrementing also enables backouts used in
144.87 - * joinTask.) Because they are protected by volatile base reads,
144.88 - * reads of the queue array and its slots by other threads do not
144.89 - * need volatile load semantics, but writes (in push) require
144.90 - * store order and CASes (in pop and deq) require (volatile) CAS
144.91 - * semantics. (Michael, Saraswat, and Vechev's algorithm has
144.92 - * similar properties, but without support for nulling slots.)
144.93 - * Since these combinations aren't supported using ordinary
144.94 - * volatiles, the only way to accomplish these efficiently is to
144.95 - * use direct Unsafe calls. (Using external AtomicIntegers and
144.96 - * AtomicReferenceArrays for the indices and array is
144.97 - * significantly slower because of memory locality and indirection
144.98 - * effects.)
144.99 + * correct orderings, reads and writes of variable queueBase
144.100 + * require volatile ordering. Variable queueTop need not be
144.101 + * volatile because non-local reads always follow those of
144.102 + * queueBase. Similarly, because they are protected by volatile
144.103 + * queueBase reads, reads of the queue array and its slots by
144.104 + * other threads do not need volatile load semantics, but writes
144.105 + * (in push) require store order and CASes (in pop and deq)
144.106 + * require (volatile) CAS semantics. (Michael, Saraswat, and
144.107 + * Vechev's algorithm has similar properties, but without support
144.108 + * for nulling slots.) Since these combinations aren't supported
144.109 + * using ordinary volatiles, the only way to accomplish these
144.110 + * efficiently is to use direct Unsafe calls. (Using external
144.111 + * AtomicIntegers and AtomicReferenceArrays for the indices and
144.112 + * array is significantly slower because of memory locality and
144.113 + * indirection effects.)
144.114 *
144.115 * Further, performance on most platforms is very sensitive to
144.116 * placement and sizing of the (resizable) queue array. Even
144.117 @@ -167,30 +167,13 @@
144.118 * initial size must be large enough to counteract cache
144.119 * contention effects across multiple queues (especially in the
144.120 * presence of GC cardmarking). Also, to improve thread-locality,
144.121 - * queues are initialized after starting. All together, these
144.122 - * low-level implementation choices produce as much as a factor of
144.123 - * 4 performance improvement compared to naive implementations,
144.124 - * and enable the processing of billions of tasks per second,
144.125 - * sometimes at the expense of ugliness.
144.126 + * queues are initialized after starting.
144.127 */
144.128
144.129 /**
144.130 - * Generator for initial random seeds for random victim
144.131 - * selection. This is used only to create initial seeds. Random
144.132 - * steals use a cheaper xorshift generator per steal attempt. We
144.133 - * expect only rare contention on seedGenerator, so just use a
144.134 - * plain Random.
144.135 + * Mask for pool indices encoded as shorts
144.136 */
144.137 - private static final Random seedGenerator = new Random();
144.138 -
144.139 - /**
144.140 - * The maximum stolen->joining link depth allowed in helpJoinTask.
144.141 - * Depths for legitimate chains are unbounded, but we use a fixed
144.142 - * constant to avoid (otherwise unchecked) cycles and bound
144.143 - * staleness of traversal parameters at the expense of sometimes
144.144 - * blocking when we could be helping.
144.145 - */
144.146 - private static final int MAX_HELP_DEPTH = 8;
144.147 + private static final int SMASK = 0xffff;
144.148
144.149 /**
144.150 * Capacity of work-stealing queue array upon initialization.
144.151 @@ -200,12 +183,19 @@
144.152 private static final int INITIAL_QUEUE_CAPACITY = 1 << 13;
144.153
144.154 /**
144.155 - * Maximum work-stealing queue array size. Must be less than or
144.156 - * equal to 1 << (31 - width of array entry) to ensure lack of
144.157 - * index wraparound. The value is set in the static block
144.158 - * at the end of this file after obtaining width.
144.159 + * Maximum size for queue array. Must be a power of two
144.160 + * less than or equal to 1 << (31 - width of array entry) to
144.161 + * ensure lack of index wraparound, but is capped at a lower
144.162 + * value to help users trap runaway computations.
144.163 */
144.164 - private static final int MAXIMUM_QUEUE_CAPACITY;
144.165 + private static final int MAXIMUM_QUEUE_CAPACITY = 1 << 24; // 16M
144.166 +
144.167 + /**
144.168 + * The work-stealing queue array. Size must be a power of two.
144.169 + * Initialized when started (as oposed to when constructed), to
144.170 + * improve memory locality.
144.171 + */
144.172 + ForkJoinTask<?>[] queue;
144.173
144.174 /**
144.175 * The pool this thread works in. Accessed directly by ForkJoinTask.
144.176 @@ -213,25 +203,19 @@
144.177 final ForkJoinPool pool;
144.178
144.179 /**
144.180 - * The work-stealing queue array. Size must be a power of two.
144.181 - * Initialized in onStart, to improve memory locality.
144.182 + * Index (mod queue.length) of next queue slot to push to or pop
144.183 + * from. It is written only by owner thread, and accessed by other
144.184 + * threads only after reading (volatile) queueBase. Both queueTop
144.185 + * and queueBase are allowed to wrap around on overflow, but
144.186 + * (queueTop - queueBase) still estimates size.
144.187 */
144.188 - private ForkJoinTask<?>[] queue;
144.189 + int queueTop;
144.190
144.191 /**
144.192 * Index (mod queue.length) of least valid queue slot, which is
144.193 * always the next position to steal from if nonempty.
144.194 */
144.195 - private volatile int base;
144.196 -
144.197 - /**
144.198 - * Index (mod queue.length) of next queue slot to push to or pop
144.199 - * from. It is written only by owner thread, and accessed by other
144.200 - * threads only after reading (volatile) base. Both sp and base
144.201 - * are allowed to wrap around on overflow, but (sp - base) still
144.202 - * estimates size.
144.203 - */
144.204 - private int sp;
144.205 + volatile int queueBase;
144.206
144.207 /**
144.208 * The index of most recent stealer, used as a hint to avoid
144.209 @@ -240,92 +224,68 @@
144.210 * of them (usually the most current). Declared non-volatile,
144.211 * relying on other prevailing sync to keep reasonably current.
144.212 */
144.213 - private int stealHint;
144.214 -
144.215 - /**
144.216 - * Run state of this worker. In addition to the usual run levels,
144.217 - * tracks if this worker is suspended as a spare, and if it was
144.218 - * killed (trimmed) while suspended. However, "active" status is
144.219 - * maintained separately and modified only in conjunction with
144.220 - * CASes of the pool's runState (which are currently sadly
144.221 - * manually inlined for performance.) Accessed directly by pool
144.222 - * to simplify checks for normal (zero) status.
144.223 - */
144.224 - volatile int runState;
144.225 -
144.226 - private static final int TERMINATING = 0x01;
144.227 - private static final int TERMINATED = 0x02;
144.228 - private static final int SUSPENDED = 0x04; // inactive spare
144.229 - private static final int TRIMMED = 0x08; // killed while suspended
144.230 -
144.231 - /**
144.232 - * Number of steals. Directly accessed (and reset) by
144.233 - * pool.tryAccumulateStealCount when idle.
144.234 - */
144.235 - int stealCount;
144.236 -
144.237 - /**
144.238 - * Seed for random number generator for choosing steal victims.
144.239 - * Uses Marsaglia xorshift. Must be initialized as nonzero.
144.240 - */
144.241 - private int seed;
144.242 -
144.243 - /**
144.244 - * Activity status. When true, this worker is considered active.
144.245 - * Accessed directly by pool. Must be false upon construction.
144.246 - */
144.247 - boolean active;
144.248 -
144.249 - /**
144.250 - * True if use local fifo, not default lifo, for local polling.
144.251 - * Shadows value from ForkJoinPool.
144.252 - */
144.253 - private final boolean locallyFifo;
144.254 + int stealHint;
144.255
144.256 /**
144.257 * Index of this worker in pool array. Set once by pool before
144.258 * running, and accessed directly by pool to locate this worker in
144.259 * its workers array.
144.260 */
144.261 - int poolIndex;
144.262 + final int poolIndex;
144.263
144.264 /**
144.265 - * The last pool event waited for. Accessed only by pool in
144.266 - * callback methods invoked within this thread.
144.267 + * Encoded record for pool task waits. Usages are always
144.268 + * surrounded by volatile reads/writes
144.269 */
144.270 - int lastEventCount;
144.271 + int nextWait;
144.272
144.273 /**
144.274 - * Encoded index and event count of next event waiter. Accessed
144.275 - * only by ForkJoinPool for managing event waiters.
144.276 + * Complement of poolIndex, offset by count of entries of task
144.277 + * waits. Accessed by ForkJoinPool to manage event waiters.
144.278 */
144.279 - volatile long nextWaiter;
144.280 + volatile int eventCount;
144.281
144.282 /**
144.283 - * Number of times this thread suspended as spare. Accessed only
144.284 - * by pool.
144.285 + * Seed for random number generator for choosing steal victims.
144.286 + * Uses Marsaglia xorshift. Must be initialized as nonzero.
144.287 */
144.288 - int spareCount;
144.289 + int seed;
144.290
144.291 /**
144.292 - * Encoded index and count of next spare waiter. Accessed only
144.293 - * by ForkJoinPool for managing spares.
144.294 + * Number of steals. Directly accessed (and reset) by pool when
144.295 + * idle.
144.296 */
144.297 - volatile int nextSpare;
144.298 + int stealCount;
144.299 +
144.300 + /**
144.301 + * True if this worker should or did terminate
144.302 + */
144.303 + volatile boolean terminate;
144.304 +
144.305 + /**
144.306 + * Set to true before LockSupport.park; false on return
144.307 + */
144.308 + volatile boolean parked;
144.309 +
144.310 + /**
144.311 + * True if use local fifo, not default lifo, for local polling.
144.312 + * Shadows value from ForkJoinPool.
144.313 + */
144.314 + final boolean locallyFifo;
144.315 +
144.316 + /**
144.317 + * The task most recently stolen from another worker (or
144.318 + * submission queue). All uses are surrounded by enough volatile
144.319 + * reads/writes to maintain as non-volatile.
144.320 + */
144.321 + ForkJoinTask<?> currentSteal;
144.322
144.323 /**
144.324 * The task currently being joined, set only when actively trying
144.325 - * to help other stealers in helpJoinTask. Written only by this
144.326 - * thread, but read by others.
144.327 + * to help other stealers in helpJoinTask. All uses are surrounded
144.328 + * by enough volatile reads/writes to maintain as non-volatile.
144.329 */
144.330 - private volatile ForkJoinTask<?> currentJoin;
144.331 -
144.332 - /**
144.333 - * The task most recently stolen from another worker (or
144.334 - * submission queue). Written only by this thread, but read by
144.335 - * others.
144.336 - */
144.337 - private volatile ForkJoinTask<?> currentSteal;
144.338 + ForkJoinTask<?> currentJoin;
144.339
144.340 /**
144.341 * Creates a ForkJoinWorkerThread operating in the given pool.
144.342 @@ -334,24 +294,19 @@
144.343 * @throws NullPointerException if pool is null
144.344 */
144.345 protected ForkJoinWorkerThread(ForkJoinPool pool) {
144.346 + super(pool.nextWorkerName());
144.347 this.pool = pool;
144.348 - this.locallyFifo = pool.locallyFifo;
144.349 + int k = pool.registerWorker(this);
144.350 + poolIndex = k;
144.351 + eventCount = ~k & SMASK; // clear wait count
144.352 + locallyFifo = pool.locallyFifo;
144.353 + Thread.UncaughtExceptionHandler ueh = pool.ueh;
144.354 + if (ueh != null)
144.355 + setUncaughtExceptionHandler(ueh);
144.356 setDaemon(true);
144.357 - // To avoid exposing construction details to subclasses,
144.358 - // remaining initialization is in start() and onStart()
144.359 }
144.360
144.361 - /**
144.362 - * Performs additional initialization and starts this thread.
144.363 - */
144.364 - final void start(int poolIndex, UncaughtExceptionHandler ueh) {
144.365 - this.poolIndex = poolIndex;
144.366 - if (ueh != null)
144.367 - setUncaughtExceptionHandler(ueh);
144.368 - start();
144.369 - }
144.370 -
144.371 - // Public/protected methods
144.372 + // Public methods
144.373
144.374 /**
144.375 * Returns the pool hosting this thread.
144.376 @@ -375,6 +330,25 @@
144.377 return poolIndex;
144.378 }
144.379
144.380 + // Randomization
144.381 +
144.382 + /**
144.383 + * Computes next value for random victim probes and backoffs.
144.384 + * Scans don't require a very high quality generator, but also not
144.385 + * a crummy one. Marsaglia xor-shift is cheap and works well
144.386 + * enough. Note: This is manually inlined in FJP.scan() to avoid
144.387 + * writes inside busy loops.
144.388 + */
144.389 + private int nextSeed() {
144.390 + int r = seed;
144.391 + r ^= r << 13;
144.392 + r ^= r >>> 17;
144.393 + r ^= r << 5;
144.394 + return seed = r;
144.395 + }
144.396 +
144.397 + // Run State management
144.398 +
144.399 /**
144.400 * Initializes internal state after construction but before
144.401 * processing any tasks. If you override this method, you must
144.402 @@ -385,15 +359,9 @@
144.403 * processing tasks.
144.404 */
144.405 protected void onStart() {
144.406 - int rs = seedGenerator.nextInt();
144.407 - seed = (rs == 0) ? 1 : rs; // seed must be nonzero
144.408 -
144.409 - // Allocate name string and arrays in this thread
144.410 - String pid = Integer.toString(pool.getPoolNumber());
144.411 - String wid = Integer.toString(poolIndex);
144.412 - setName("ForkJoinPool-" + pid + "-worker-" + wid);
144.413 -
144.414 queue = new ForkJoinTask<?>[INITIAL_QUEUE_CAPACITY];
144.415 + int r = pool.workerSeedGenerator.nextInt();
144.416 + seed = (r == 0)? 1 : r; // must be nonzero
144.417 }
144.418
144.419 /**
144.420 @@ -406,16 +374,9 @@
144.421 */
144.422 protected void onTermination(Throwable exception) {
144.423 try {
144.424 - ForkJoinPool p = pool;
144.425 - if (active) {
144.426 - int a; // inline p.tryDecrementActiveCount
144.427 - active = false;
144.428 - do {} while (!UNSAFE.compareAndSwapInt
144.429 - (p, poolRunStateOffset, a = p.runState, a - 1));
144.430 - }
144.431 + terminate = true;
144.432 cancelTasks();
144.433 - setTerminated();
144.434 - p.workerTerminated(this);
144.435 + pool.deregisterWorker(this, exception);
144.436 } catch (Throwable ex) { // Shouldn't ever happen
144.437 if (exception == null) // but if so, at least rethrown
144.438 exception = ex;
144.439 @@ -434,7 +395,7 @@
144.440 Throwable exception = null;
144.441 try {
144.442 onStart();
144.443 - mainLoop();
144.444 + pool.work(this);
144.445 } catch (Throwable ex) {
144.446 exception = ex;
144.447 } finally {
144.448 @@ -442,81 +403,6 @@
144.449 }
144.450 }
144.451
144.452 - // helpers for run()
144.453 -
144.454 - /**
144.455 - * Finds and executes tasks, and checks status while running.
144.456 - */
144.457 - private void mainLoop() {
144.458 - boolean ran = false; // true if ran a task on last step
144.459 - ForkJoinPool p = pool;
144.460 - for (;;) {
144.461 - p.preStep(this, ran);
144.462 - if (runState != 0)
144.463 - break;
144.464 - ran = tryExecSteal() || tryExecSubmission();
144.465 - }
144.466 - }
144.467 -
144.468 - /**
144.469 - * Tries to steal a task and execute it.
144.470 - *
144.471 - * @return true if ran a task
144.472 - */
144.473 - private boolean tryExecSteal() {
144.474 - ForkJoinTask<?> t;
144.475 - if ((t = scan()) != null) {
144.476 - t.quietlyExec();
144.477 - UNSAFE.putOrderedObject(this, currentStealOffset, null);
144.478 - if (sp != base)
144.479 - execLocalTasks();
144.480 - return true;
144.481 - }
144.482 - return false;
144.483 - }
144.484 -
144.485 - /**
144.486 - * If a submission exists, try to activate and run it.
144.487 - *
144.488 - * @return true if ran a task
144.489 - */
144.490 - private boolean tryExecSubmission() {
144.491 - ForkJoinPool p = pool;
144.492 - // This loop is needed in case attempt to activate fails, in
144.493 - // which case we only retry if there still appears to be a
144.494 - // submission.
144.495 - while (p.hasQueuedSubmissions()) {
144.496 - ForkJoinTask<?> t; int a;
144.497 - if (active || // inline p.tryIncrementActiveCount
144.498 - (active = UNSAFE.compareAndSwapInt(p, poolRunStateOffset,
144.499 - a = p.runState, a + 1))) {
144.500 - if ((t = p.pollSubmission()) != null) {
144.501 - UNSAFE.putOrderedObject(this, currentStealOffset, t);
144.502 - t.quietlyExec();
144.503 - UNSAFE.putOrderedObject(this, currentStealOffset, null);
144.504 - if (sp != base)
144.505 - execLocalTasks();
144.506 - return true;
144.507 - }
144.508 - }
144.509 - }
144.510 - return false;
144.511 - }
144.512 -
144.513 - /**
144.514 - * Runs local tasks until queue is empty or shut down. Call only
144.515 - * while active.
144.516 - */
144.517 - private void execLocalTasks() {
144.518 - while (runState == 0) {
144.519 - ForkJoinTask<?> t = locallyFifo ? locallyDeqTask() : popTask();
144.520 - if (t != null)
144.521 - t.quietlyExec();
144.522 - else if (sp == base)
144.523 - break;
144.524 - }
144.525 - }
144.526 -
144.527 /*
144.528 * Intrinsics-based atomic writes for queue slots. These are
144.529 * basically the same as methods in AtomicReferenceArray, but
144.530 @@ -528,10 +414,20 @@
144.531 * because they are protected by other volatile reads and are
144.532 * confirmed by CASes.
144.533 *
144.534 - * Most uses don't actually call these methods, but instead contain
144.535 - * inlined forms that enable more predictable optimization. We
144.536 - * don't define the version of write used in pushTask at all, but
144.537 - * instead inline there a store-fenced array slot write.
144.538 + * Most uses don't actually call these methods, but instead
144.539 + * contain inlined forms that enable more predictable
144.540 + * optimization. We don't define the version of write used in
144.541 + * pushTask at all, but instead inline there a store-fenced array
144.542 + * slot write.
144.543 + *
144.544 + * Also in most methods, as a performance (not correctness) issue,
144.545 + * we'd like to encourage compilers not to arbitrarily postpone
144.546 + * setting queueTop after writing slot. Currently there is no
144.547 + * intrinsic for arranging this, but using Unsafe putOrderedInt
144.548 + * may be a preferable strategy on some compilers even though its
144.549 + * main effect is a pre-, not post- fence. To simplify possible
144.550 + * changes, the option is left in comments next to the associated
144.551 + * assignments.
144.552 */
144.553
144.554 /**
144.555 @@ -540,7 +436,7 @@
144.556 */
144.557 private static final boolean casSlotNull(ForkJoinTask<?>[] q, int i,
144.558 ForkJoinTask<?> t) {
144.559 - return UNSAFE.compareAndSwapObject(q, (i << qShift) + qBase, t, null);
144.560 + return UNSAFE.compareAndSwapObject(q, (i << ASHIFT) + ABASE, t, null);
144.561 }
144.562
144.563 /**
144.564 @@ -550,7 +446,7 @@
144.565 */
144.566 private static final void writeSlot(ForkJoinTask<?>[] q, int i,
144.567 ForkJoinTask<?> t) {
144.568 - UNSAFE.putObjectVolatile(q, (i << qShift) + qBase, t);
144.569 + UNSAFE.putObjectVolatile(q, (i << ASHIFT) + ABASE, t);
144.570 }
144.571
144.572 // queue methods
144.573 @@ -561,14 +457,43 @@
144.574 * @param t the task. Caller must ensure non-null.
144.575 */
144.576 final void pushTask(ForkJoinTask<?> t) {
144.577 - ForkJoinTask<?>[] q = queue;
144.578 - int mask = q.length - 1; // implicit assert q != null
144.579 - int s = sp++; // ok to increment sp before slot write
144.580 - UNSAFE.putOrderedObject(q, ((s & mask) << qShift) + qBase, t);
144.581 - if ((s -= base) == 0)
144.582 - pool.signalWork(); // was empty
144.583 - else if (s == mask)
144.584 - growQueue(); // is full
144.585 + ForkJoinTask<?>[] q; int s, m;
144.586 + if ((q = queue) != null) { // ignore if queue removed
144.587 + long u = (((s = queueTop) & (m = q.length - 1)) << ASHIFT) + ABASE;
144.588 + UNSAFE.putOrderedObject(q, u, t);
144.589 + queueTop = s + 1; // or use putOrderedInt
144.590 + if ((s -= queueBase) <= 2)
144.591 + pool.signalWork();
144.592 + else if (s == m)
144.593 + growQueue();
144.594 + }
144.595 + }
144.596 +
144.597 + /**
144.598 + * Creates or doubles queue array. Transfers elements by
144.599 + * emulating steals (deqs) from old array and placing, oldest
144.600 + * first, into new array.
144.601 + */
144.602 + private void growQueue() {
144.603 + ForkJoinTask<?>[] oldQ = queue;
144.604 + int size = oldQ != null ? oldQ.length << 1 : INITIAL_QUEUE_CAPACITY;
144.605 + if (size > MAXIMUM_QUEUE_CAPACITY)
144.606 + throw new RejectedExecutionException("Queue capacity exceeded");
144.607 + if (size < INITIAL_QUEUE_CAPACITY)
144.608 + size = INITIAL_QUEUE_CAPACITY;
144.609 + ForkJoinTask<?>[] q = queue = new ForkJoinTask<?>[size];
144.610 + int mask = size - 1;
144.611 + int top = queueTop;
144.612 + int oldMask;
144.613 + if (oldQ != null && (oldMask = oldQ.length - 1) >= 0) {
144.614 + for (int b = queueBase; b != top; ++b) {
144.615 + long u = ((b & oldMask) << ASHIFT) + ABASE;
144.616 + Object x = UNSAFE.getObjectVolatile(oldQ, u);
144.617 + if (x != null && UNSAFE.compareAndSwapObject(oldQ, u, x, null))
144.618 + UNSAFE.putObjectVolatile
144.619 + (q, ((b & mask) << ASHIFT) + ABASE, x);
144.620 + }
144.621 + }
144.622 }
144.623
144.624 /**
144.625 @@ -579,35 +504,34 @@
144.626 * @return a task, or null if none or contended
144.627 */
144.628 final ForkJoinTask<?> deqTask() {
144.629 - ForkJoinTask<?> t;
144.630 - ForkJoinTask<?>[] q;
144.631 - int b, i;
144.632 - if (sp != (b = base) &&
144.633 + ForkJoinTask<?> t; ForkJoinTask<?>[] q; int b, i;
144.634 + if (queueTop != (b = queueBase) &&
144.635 (q = queue) != null && // must read q after b
144.636 - (t = q[i = (q.length - 1) & b]) != null && base == b &&
144.637 - UNSAFE.compareAndSwapObject(q, (i << qShift) + qBase, t, null)) {
144.638 - base = b + 1;
144.639 + (i = (q.length - 1) & b) >= 0 &&
144.640 + (t = q[i]) != null && queueBase == b &&
144.641 + UNSAFE.compareAndSwapObject(q, (i << ASHIFT) + ABASE, t, null)) {
144.642 + queueBase = b + 1;
144.643 return t;
144.644 }
144.645 return null;
144.646 }
144.647
144.648 /**
144.649 - * Tries to take a task from the base of own queue. Assumes active
144.650 - * status. Called only by this thread.
144.651 + * Tries to take a task from the base of own queue. Called only
144.652 + * by this thread.
144.653 *
144.654 * @return a task, or null if none
144.655 */
144.656 final ForkJoinTask<?> locallyDeqTask() {
144.657 + ForkJoinTask<?> t; int m, b, i;
144.658 ForkJoinTask<?>[] q = queue;
144.659 - if (q != null) {
144.660 - ForkJoinTask<?> t;
144.661 - int b, i;
144.662 - while (sp != (b = base)) {
144.663 - if ((t = q[i = (q.length - 1) & b]) != null && base == b &&
144.664 - UNSAFE.compareAndSwapObject(q, (i << qShift) + qBase,
144.665 + if (q != null && (m = q.length - 1) >= 0) {
144.666 + while (queueTop != (b = queueBase)) {
144.667 + if ((t = q[i = m & b]) != null &&
144.668 + queueBase == b &&
144.669 + UNSAFE.compareAndSwapObject(q, (i << ASHIFT) + ABASE,
144.670 t, null)) {
144.671 - base = b + 1;
144.672 + queueBase = b + 1;
144.673 return t;
144.674 }
144.675 }
144.676 @@ -616,35 +540,21 @@
144.677 }
144.678
144.679 /**
144.680 - * Returns a popped task, or null if empty. Assumes active status.
144.681 + * Returns a popped task, or null if empty.
144.682 * Called only by this thread.
144.683 */
144.684 private ForkJoinTask<?> popTask() {
144.685 + int m;
144.686 ForkJoinTask<?>[] q = queue;
144.687 - if (q != null) {
144.688 - int s;
144.689 - while ((s = sp) != base) {
144.690 - int i = (q.length - 1) & --s;
144.691 - long u = (i << qShift) + qBase; // raw offset
144.692 + if (q != null && (m = q.length - 1) >= 0) {
144.693 + for (int s; (s = queueTop) != queueBase;) {
144.694 + int i = m & --s;
144.695 + long u = (i << ASHIFT) + ABASE; // raw offset
144.696 ForkJoinTask<?> t = q[i];
144.697 if (t == null) // lost to stealer
144.698 break;
144.699 if (UNSAFE.compareAndSwapObject(q, u, t, null)) {
144.700 - /*
144.701 - * Note: here and in related methods, as a
144.702 - * performance (not correctness) issue, we'd like
144.703 - * to encourage compiler not to arbitrarily
144.704 - * postpone setting sp after successful CAS.
144.705 - * Currently there is no intrinsic for arranging
144.706 - * this, but using Unsafe putOrderedInt may be a
144.707 - * preferable strategy on some compilers even
144.708 - * though its main effect is a pre-, not post-
144.709 - * fence. To simplify possible changes, the option
144.710 - * is left in comments next to the associated
144.711 - * assignments.
144.712 - */
144.713 - sp = s; // putOrderedInt may encourage more timely write
144.714 - // UNSAFE.putOrderedInt(this, spOffset, s);
144.715 + queueTop = s; // or putOrderedInt
144.716 return t;
144.717 }
144.718 }
144.719 @@ -654,18 +564,17 @@
144.720
144.721 /**
144.722 * Specialized version of popTask to pop only if topmost element
144.723 - * is the given task. Called only by this thread while active.
144.724 + * is the given task. Called only by this thread.
144.725 *
144.726 * @param t the task. Caller must ensure non-null.
144.727 */
144.728 final boolean unpushTask(ForkJoinTask<?> t) {
144.729 + ForkJoinTask<?>[] q;
144.730 int s;
144.731 - ForkJoinTask<?>[] q = queue;
144.732 - if ((s = sp) != base && q != null &&
144.733 + if ((q = queue) != null && (s = queueTop) != queueBase &&
144.734 UNSAFE.compareAndSwapObject
144.735 - (q, (((q.length - 1) & --s) << qShift) + qBase, t, null)) {
144.736 - sp = s; // putOrderedInt may encourage more timely write
144.737 - // UNSAFE.putOrderedInt(this, spOffset, s);
144.738 + (q, (((q.length - 1) & --s) << ASHIFT) + ABASE, t, null)) {
144.739 + queueTop = s; // or putOrderedInt
144.740 return true;
144.741 }
144.742 return false;
144.743 @@ -675,222 +584,30 @@
144.744 * Returns next task, or null if empty or contended.
144.745 */
144.746 final ForkJoinTask<?> peekTask() {
144.747 + int m;
144.748 ForkJoinTask<?>[] q = queue;
144.749 - if (q == null)
144.750 + if (q == null || (m = q.length - 1) < 0)
144.751 return null;
144.752 - int mask = q.length - 1;
144.753 - int i = locallyFifo ? base : (sp - 1);
144.754 - return q[i & mask];
144.755 + int i = locallyFifo ? queueBase : (queueTop - 1);
144.756 + return q[i & m];
144.757 }
144.758
144.759 - /**
144.760 - * Doubles queue array size. Transfers elements by emulating
144.761 - * steals (deqs) from old array and placing, oldest first, into
144.762 - * new array.
144.763 - */
144.764 - private void growQueue() {
144.765 - ForkJoinTask<?>[] oldQ = queue;
144.766 - int oldSize = oldQ.length;
144.767 - int newSize = oldSize << 1;
144.768 - if (newSize > MAXIMUM_QUEUE_CAPACITY)
144.769 - throw new RejectedExecutionException("Queue capacity exceeded");
144.770 - ForkJoinTask<?>[] newQ = queue = new ForkJoinTask<?>[newSize];
144.771 -
144.772 - int b = base;
144.773 - int bf = b + oldSize;
144.774 - int oldMask = oldSize - 1;
144.775 - int newMask = newSize - 1;
144.776 - do {
144.777 - int oldIndex = b & oldMask;
144.778 - ForkJoinTask<?> t = oldQ[oldIndex];
144.779 - if (t != null && !casSlotNull(oldQ, oldIndex, t))
144.780 - t = null;
144.781 - writeSlot(newQ, b & newMask, t);
144.782 - } while (++b != bf);
144.783 - pool.signalWork();
144.784 - }
144.785 + // Support methods for ForkJoinPool
144.786
144.787 /**
144.788 - * Computes next value for random victim probe in scan(). Scans
144.789 - * don't require a very high quality generator, but also not a
144.790 - * crummy one. Marsaglia xor-shift is cheap and works well enough.
144.791 - * Note: This is manually inlined in scan().
144.792 + * Runs the given task, plus any local tasks until queue is empty
144.793 */
144.794 - private static final int xorShift(int r) {
144.795 - r ^= r << 13;
144.796 - r ^= r >>> 17;
144.797 - return r ^ (r << 5);
144.798 - }
144.799 -
144.800 - /**
144.801 - * Tries to steal a task from another worker. Starts at a random
144.802 - * index of workers array, and probes workers until finding one
144.803 - * with non-empty queue or finding that all are empty. It
144.804 - * randomly selects the first n probes. If these are empty, it
144.805 - * resorts to a circular sweep, which is necessary to accurately
144.806 - * set active status. (The circular sweep uses steps of
144.807 - * approximately half the array size plus 1, to avoid bias
144.808 - * stemming from leftmost packing of the array in ForkJoinPool.)
144.809 - *
144.810 - * This method must be both fast and quiet -- usually avoiding
144.811 - * memory accesses that could disrupt cache sharing etc other than
144.812 - * those needed to check for and take tasks (or to activate if not
144.813 - * already active). This accounts for, among other things,
144.814 - * updating random seed in place without storing it until exit.
144.815 - *
144.816 - * @return a task, or null if none found
144.817 - */
144.818 - private ForkJoinTask<?> scan() {
144.819 - ForkJoinPool p = pool;
144.820 - ForkJoinWorkerThread[] ws; // worker array
144.821 - int n; // upper bound of #workers
144.822 - if ((ws = p.workers) != null && (n = ws.length) > 1) {
144.823 - boolean canSteal = active; // shadow active status
144.824 - int r = seed; // extract seed once
144.825 - int mask = n - 1;
144.826 - int j = -n; // loop counter
144.827 - int k = r; // worker index, random if j < 0
144.828 - for (;;) {
144.829 - ForkJoinWorkerThread v = ws[k & mask];
144.830 - r ^= r << 13; r ^= r >>> 17; r ^= r << 5; // inline xorshift
144.831 - ForkJoinTask<?>[] q; ForkJoinTask<?> t; int b, a;
144.832 - if (v != null && (b = v.base) != v.sp &&
144.833 - (q = v.queue) != null) {
144.834 - int i = (q.length - 1) & b;
144.835 - long u = (i << qShift) + qBase; // raw offset
144.836 - int pid = poolIndex;
144.837 - if ((t = q[i]) != null) {
144.838 - if (!canSteal && // inline p.tryIncrementActiveCount
144.839 - UNSAFE.compareAndSwapInt(p, poolRunStateOffset,
144.840 - a = p.runState, a + 1))
144.841 - canSteal = active = true;
144.842 - if (canSteal && v.base == b++ &&
144.843 - UNSAFE.compareAndSwapObject(q, u, t, null)) {
144.844 - v.base = b;
144.845 - v.stealHint = pid;
144.846 - UNSAFE.putOrderedObject(this,
144.847 - currentStealOffset, t);
144.848 - seed = r;
144.849 - ++stealCount;
144.850 - return t;
144.851 - }
144.852 - }
144.853 - j = -n;
144.854 - k = r; // restart on contention
144.855 - }
144.856 - else if (++j <= 0)
144.857 - k = r;
144.858 - else if (j <= n)
144.859 - k += (n >>> 1) | 1;
144.860 - else
144.861 - break;
144.862 - }
144.863 + final void execTask(ForkJoinTask<?> t) {
144.864 + currentSteal = t;
144.865 + for (;;) {
144.866 + if (t != null)
144.867 + t.doExec();
144.868 + if (queueTop == queueBase)
144.869 + break;
144.870 + t = locallyFifo ? locallyDeqTask() : popTask();
144.871 }
144.872 - return null;
144.873 - }
144.874 -
144.875 - // Run State management
144.876 -
144.877 - // status check methods used mainly by ForkJoinPool
144.878 - final boolean isRunning() { return runState == 0; }
144.879 - final boolean isTerminated() { return (runState & TERMINATED) != 0; }
144.880 - final boolean isSuspended() { return (runState & SUSPENDED) != 0; }
144.881 - final boolean isTrimmed() { return (runState & TRIMMED) != 0; }
144.882 -
144.883 - final boolean isTerminating() {
144.884 - if ((runState & TERMINATING) != 0)
144.885 - return true;
144.886 - if (pool.isAtLeastTerminating()) { // propagate pool state
144.887 - shutdown();
144.888 - return true;
144.889 - }
144.890 - return false;
144.891 - }
144.892 -
144.893 - /**
144.894 - * Sets state to TERMINATING. Does NOT unpark or interrupt
144.895 - * to wake up if currently blocked. Callers must do so if desired.
144.896 - */
144.897 - final void shutdown() {
144.898 - for (;;) {
144.899 - int s = runState;
144.900 - if ((s & (TERMINATING|TERMINATED)) != 0)
144.901 - break;
144.902 - if ((s & SUSPENDED) != 0) { // kill and wakeup if suspended
144.903 - if (UNSAFE.compareAndSwapInt(this, runStateOffset, s,
144.904 - (s & ~SUSPENDED) |
144.905 - (TRIMMED|TERMINATING)))
144.906 - break;
144.907 - }
144.908 - else if (UNSAFE.compareAndSwapInt(this, runStateOffset, s,
144.909 - s | TERMINATING))
144.910 - break;
144.911 - }
144.912 - }
144.913 -
144.914 - /**
144.915 - * Sets state to TERMINATED. Called only by onTermination().
144.916 - */
144.917 - private void setTerminated() {
144.918 - int s;
144.919 - do {} while (!UNSAFE.compareAndSwapInt(this, runStateOffset,
144.920 - s = runState,
144.921 - s | (TERMINATING|TERMINATED)));
144.922 - }
144.923 -
144.924 - /**
144.925 - * If suspended, tries to set status to unsuspended.
144.926 - * Does NOT wake up if blocked.
144.927 - *
144.928 - * @return true if successful
144.929 - */
144.930 - final boolean tryUnsuspend() {
144.931 - int s;
144.932 - while (((s = runState) & SUSPENDED) != 0) {
144.933 - if (UNSAFE.compareAndSwapInt(this, runStateOffset, s,
144.934 - s & ~SUSPENDED))
144.935 - return true;
144.936 - }
144.937 - return false;
144.938 - }
144.939 -
144.940 - /**
144.941 - * Sets suspended status and blocks as spare until resumed
144.942 - * or shutdown.
144.943 - */
144.944 - final void suspendAsSpare() {
144.945 - for (;;) { // set suspended unless terminating
144.946 - int s = runState;
144.947 - if ((s & TERMINATING) != 0) { // must kill
144.948 - if (UNSAFE.compareAndSwapInt(this, runStateOffset, s,
144.949 - s | (TRIMMED | TERMINATING)))
144.950 - return;
144.951 - }
144.952 - else if (UNSAFE.compareAndSwapInt(this, runStateOffset, s,
144.953 - s | SUSPENDED))
144.954 - break;
144.955 - }
144.956 - ForkJoinPool p = pool;
144.957 - p.pushSpare(this);
144.958 - while ((runState & SUSPENDED) != 0) {
144.959 - if (p.tryAccumulateStealCount(this)) {
144.960 - interrupted(); // clear/ignore interrupts
144.961 - if ((runState & SUSPENDED) == 0)
144.962 - break;
144.963 - LockSupport.park(this);
144.964 - }
144.965 - }
144.966 - }
144.967 -
144.968 - // Misc support methods for ForkJoinPool
144.969 -
144.970 - /**
144.971 - * Returns an estimate of the number of tasks in the queue. Also
144.972 - * used by ForkJoinTask.
144.973 - */
144.974 - final int getQueueSize() {
144.975 - int n; // external calls must read base first
144.976 - return (n = -base + sp) <= 0 ? 0 : n;
144.977 + ++stealCount;
144.978 + currentSteal = null;
144.979 }
144.980
144.981 /**
144.982 @@ -899,17 +616,12 @@
144.983 */
144.984 final void cancelTasks() {
144.985 ForkJoinTask<?> cj = currentJoin; // try to cancel ongoing tasks
144.986 - if (cj != null && cj.status >= 0) {
144.987 + if (cj != null && cj.status >= 0)
144.988 cj.cancelIgnoringExceptions();
144.989 - try {
144.990 - this.interrupt(); // awaken wait
144.991 - } catch (SecurityException ignore) {
144.992 - }
144.993 - }
144.994 ForkJoinTask<?> cs = currentSteal;
144.995 if (cs != null && cs.status >= 0)
144.996 cs.cancelIgnoringExceptions();
144.997 - while (base != sp) {
144.998 + while (queueBase != queueTop) {
144.999 ForkJoinTask<?> t = deqTask();
144.1000 if (t != null)
144.1001 t.cancelIgnoringExceptions();
144.1002 @@ -923,7 +635,7 @@
144.1003 */
144.1004 final int drainTasksTo(Collection<? super ForkJoinTask<?>> c) {
144.1005 int n = 0;
144.1006 - while (base != sp) {
144.1007 + while (queueBase != queueTop) {
144.1008 ForkJoinTask<?> t = deqTask();
144.1009 if (t != null) {
144.1010 c.add(t);
144.1011 @@ -936,20 +648,19 @@
144.1012 // Support methods for ForkJoinTask
144.1013
144.1014 /**
144.1015 + * Returns an estimate of the number of tasks in the queue.
144.1016 + */
144.1017 + final int getQueueSize() {
144.1018 + return queueTop - queueBase;
144.1019 + }
144.1020 +
144.1021 + /**
144.1022 * Gets and removes a local task.
144.1023 *
144.1024 * @return a task, if available
144.1025 */
144.1026 final ForkJoinTask<?> pollLocalTask() {
144.1027 - ForkJoinPool p = pool;
144.1028 - while (sp != base) {
144.1029 - int a; // inline p.tryIncrementActiveCount
144.1030 - if (active ||
144.1031 - (active = UNSAFE.compareAndSwapInt(p, poolRunStateOffset,
144.1032 - a = p.runState, a + 1)))
144.1033 - return locallyFifo ? locallyDeqTask() : popTask();
144.1034 - }
144.1035 - return null;
144.1036 + return locallyFifo ? locallyDeqTask() : popTask();
144.1037 }
144.1038
144.1039 /**
144.1040 @@ -958,172 +669,205 @@
144.1041 * @return a task, if available
144.1042 */
144.1043 final ForkJoinTask<?> pollTask() {
144.1044 + ForkJoinWorkerThread[] ws;
144.1045 ForkJoinTask<?> t = pollLocalTask();
144.1046 - if (t == null) {
144.1047 - t = scan();
144.1048 - // cannot retain/track/help steal
144.1049 - UNSAFE.putOrderedObject(this, currentStealOffset, null);
144.1050 + if (t != null || (ws = pool.workers) == null)
144.1051 + return t;
144.1052 + int n = ws.length; // cheap version of FJP.scan
144.1053 + int steps = n << 1;
144.1054 + int r = nextSeed();
144.1055 + int i = 0;
144.1056 + while (i < steps) {
144.1057 + ForkJoinWorkerThread w = ws[(i++ + r) & (n - 1)];
144.1058 + if (w != null && w.queueBase != w.queueTop && w.queue != null) {
144.1059 + if ((t = w.deqTask()) != null)
144.1060 + return t;
144.1061 + i = 0;
144.1062 + }
144.1063 }
144.1064 - return t;
144.1065 + return null;
144.1066 }
144.1067
144.1068 /**
144.1069 - * Possibly runs some tasks and/or blocks, until task is done.
144.1070 + * The maximum stolen->joining link depth allowed in helpJoinTask,
144.1071 + * as well as the maximum number of retries (allowing on average
144.1072 + * one staleness retry per level) per attempt to instead try
144.1073 + * compensation. Depths for legitimate chains are unbounded, but
144.1074 + * we use a fixed constant to avoid (otherwise unchecked) cycles
144.1075 + * and bound staleness of traversal parameters at the expense of
144.1076 + * sometimes blocking when we could be helping.
144.1077 + */
144.1078 + private static final int MAX_HELP = 16;
144.1079 +
144.1080 + /**
144.1081 + * Possibly runs some tasks and/or blocks, until joinMe is done.
144.1082 *
144.1083 * @param joinMe the task to join
144.1084 - * @param timed true if use timed wait
144.1085 - * @param nanos wait time if timed
144.1086 + * @return completion status on exit
144.1087 */
144.1088 - final void joinTask(ForkJoinTask<?> joinMe, boolean timed, long nanos) {
144.1089 - // currentJoin only written by this thread; only need ordered store
144.1090 + final int joinTask(ForkJoinTask<?> joinMe) {
144.1091 ForkJoinTask<?> prevJoin = currentJoin;
144.1092 - UNSAFE.putOrderedObject(this, currentJoinOffset, joinMe);
144.1093 - pool.awaitJoin(joinMe, this, timed, nanos);
144.1094 - UNSAFE.putOrderedObject(this, currentJoinOffset, prevJoin);
144.1095 + currentJoin = joinMe;
144.1096 + for (int s, retries = MAX_HELP;;) {
144.1097 + if ((s = joinMe.status) < 0) {
144.1098 + currentJoin = prevJoin;
144.1099 + return s;
144.1100 + }
144.1101 + if (retries > 0) {
144.1102 + if (queueTop != queueBase) {
144.1103 + if (!localHelpJoinTask(joinMe))
144.1104 + retries = 0; // cannot help
144.1105 + }
144.1106 + else if (retries == MAX_HELP >>> 1) {
144.1107 + --retries; // check uncommon case
144.1108 + if (tryDeqAndExec(joinMe) >= 0)
144.1109 + Thread.yield(); // for politeness
144.1110 + }
144.1111 + else
144.1112 + retries = helpJoinTask(joinMe)? MAX_HELP : retries - 1;
144.1113 + }
144.1114 + else {
144.1115 + retries = MAX_HELP; // restart if not done
144.1116 + pool.tryAwaitJoin(joinMe);
144.1117 + }
144.1118 + }
144.1119 }
144.1120
144.1121 /**
144.1122 - * Tries to locate and help perform tasks for a stealer of the
144.1123 - * given task, or in turn one of its stealers. Traces
144.1124 + * If present, pops and executes the given task, or any other
144.1125 + * cancelled task
144.1126 + *
144.1127 + * @return false if any other non-cancelled task exists in local queue
144.1128 + */
144.1129 + private boolean localHelpJoinTask(ForkJoinTask<?> joinMe) {
144.1130 + int s, i; ForkJoinTask<?>[] q; ForkJoinTask<?> t;
144.1131 + if ((s = queueTop) != queueBase && (q = queue) != null &&
144.1132 + (i = (q.length - 1) & --s) >= 0 &&
144.1133 + (t = q[i]) != null) {
144.1134 + if (t != joinMe && t.status >= 0)
144.1135 + return false;
144.1136 + if (UNSAFE.compareAndSwapObject
144.1137 + (q, (i << ASHIFT) + ABASE, t, null)) {
144.1138 + queueTop = s; // or putOrderedInt
144.1139 + t.doExec();
144.1140 + }
144.1141 + }
144.1142 + return true;
144.1143 + }
144.1144 +
144.1145 + /**
144.1146 + * Tries to locate and execute tasks for a stealer of the given
144.1147 + * task, or in turn one of its stealers, Traces
144.1148 * currentSteal->currentJoin links looking for a thread working on
144.1149 * a descendant of the given task and with a non-empty queue to
144.1150 - * steal back and execute tasks from.
144.1151 - *
144.1152 - * The implementation is very branchy to cope with potential
144.1153 - * inconsistencies or loops encountering chains that are stale,
144.1154 - * unknown, or of length greater than MAX_HELP_DEPTH links. All
144.1155 - * of these cases are dealt with by just returning back to the
144.1156 - * caller, who is expected to retry if other join mechanisms also
144.1157 - * don't work out.
144.1158 + * steal back and execute tasks from. The implementation is very
144.1159 + * branchy to cope with potential inconsistencies or loops
144.1160 + * encountering chains that are stale, unknown, or of length
144.1161 + * greater than MAX_HELP links. All of these cases are dealt with
144.1162 + * by just retrying by caller.
144.1163 *
144.1164 * @param joinMe the task to join
144.1165 - * @param running if false, then must update pool count upon
144.1166 - * running a task
144.1167 - * @return value of running on exit
144.1168 + * @param canSteal true if local queue is empty
144.1169 + * @return true if ran a task
144.1170 */
144.1171 - final boolean helpJoinTask(ForkJoinTask<?> joinMe, boolean running) {
144.1172 - /*
144.1173 - * Initial checks to (1) abort if terminating; (2) clean out
144.1174 - * old cancelled tasks from local queue; (3) if joinMe is next
144.1175 - * task, run it; (4) omit scan if local queue nonempty (since
144.1176 - * it may contain non-descendents of joinMe).
144.1177 - */
144.1178 - ForkJoinPool p = pool;
144.1179 - for (;;) {
144.1180 - ForkJoinTask<?>[] q;
144.1181 - int s;
144.1182 - if (joinMe.status < 0)
144.1183 - return running;
144.1184 - else if ((runState & TERMINATING) != 0) {
144.1185 - joinMe.cancelIgnoringExceptions();
144.1186 - return running;
144.1187 + private boolean helpJoinTask(ForkJoinTask<?> joinMe) {
144.1188 + boolean helped = false;
144.1189 + int m = pool.scanGuard & SMASK;
144.1190 + ForkJoinWorkerThread[] ws = pool.workers;
144.1191 + if (ws != null && ws.length > m && joinMe.status >= 0) {
144.1192 + int levels = MAX_HELP; // remaining chain length
144.1193 + ForkJoinTask<?> task = joinMe; // base of chain
144.1194 + outer:for (ForkJoinWorkerThread thread = this;;) {
144.1195 + // Try to find v, the stealer of task, by first using hint
144.1196 + ForkJoinWorkerThread v = ws[thread.stealHint & m];
144.1197 + if (v == null || v.currentSteal != task) {
144.1198 + for (int j = 0; ;) { // search array
144.1199 + if ((v = ws[j]) != null && v.currentSteal == task) {
144.1200 + thread.stealHint = j;
144.1201 + break; // save hint for next time
144.1202 + }
144.1203 + if (++j > m)
144.1204 + break outer; // can't find stealer
144.1205 + }
144.1206 + }
144.1207 + // Try to help v, using specialized form of deqTask
144.1208 + for (;;) {
144.1209 + ForkJoinTask<?>[] q; int b, i;
144.1210 + if (joinMe.status < 0)
144.1211 + break outer;
144.1212 + if ((b = v.queueBase) == v.queueTop ||
144.1213 + (q = v.queue) == null ||
144.1214 + (i = (q.length-1) & b) < 0)
144.1215 + break; // empty
144.1216 + long u = (i << ASHIFT) + ABASE;
144.1217 + ForkJoinTask<?> t = q[i];
144.1218 + if (task.status < 0)
144.1219 + break outer; // stale
144.1220 + if (t != null && v.queueBase == b &&
144.1221 + UNSAFE.compareAndSwapObject(q, u, t, null)) {
144.1222 + v.queueBase = b + 1;
144.1223 + v.stealHint = poolIndex;
144.1224 + ForkJoinTask<?> ps = currentSteal;
144.1225 + currentSteal = t;
144.1226 + t.doExec();
144.1227 + currentSteal = ps;
144.1228 + helped = true;
144.1229 + }
144.1230 + }
144.1231 + // Try to descend to find v's stealer
144.1232 + ForkJoinTask<?> next = v.currentJoin;
144.1233 + if (--levels > 0 && task.status >= 0 &&
144.1234 + next != null && next != task) {
144.1235 + task = next;
144.1236 + thread = v;
144.1237 + }
144.1238 + else
144.1239 + break; // max levels, stale, dead-end, or cyclic
144.1240 }
144.1241 - else if ((s = sp) == base || (q = queue) == null)
144.1242 - break; // queue empty
144.1243 - else {
144.1244 - int i = (q.length - 1) & --s;
144.1245 - long u = (i << qShift) + qBase; // raw offset
144.1246 - ForkJoinTask<?> t = q[i];
144.1247 - if (t == null)
144.1248 - break; // lost to a stealer
144.1249 - else if (t != joinMe && t.status >= 0)
144.1250 - return running; // cannot safely help
144.1251 - else if ((running ||
144.1252 - (running = p.tryIncrementRunningCount())) &&
144.1253 - UNSAFE.compareAndSwapObject(q, u, t, null)) {
144.1254 - sp = s; // putOrderedInt may encourage more timely write
144.1255 - // UNSAFE.putOrderedInt(this, spOffset, s);
144.1256 - t.quietlyExec();
144.1257 + }
144.1258 + return helped;
144.1259 + }
144.1260 +
144.1261 + /**
144.1262 + * Performs an uncommon case for joinTask: If task t is at base of
144.1263 + * some workers queue, steals and executes it.
144.1264 + *
144.1265 + * @param t the task
144.1266 + * @return t's status
144.1267 + */
144.1268 + private int tryDeqAndExec(ForkJoinTask<?> t) {
144.1269 + int m = pool.scanGuard & SMASK;
144.1270 + ForkJoinWorkerThread[] ws = pool.workers;
144.1271 + if (ws != null && ws.length > m && t.status >= 0) {
144.1272 + for (int j = 0; j <= m; ++j) {
144.1273 + ForkJoinTask<?>[] q; int b, i;
144.1274 + ForkJoinWorkerThread v = ws[j];
144.1275 + if (v != null &&
144.1276 + (b = v.queueBase) != v.queueTop &&
144.1277 + (q = v.queue) != null &&
144.1278 + (i = (q.length - 1) & b) >= 0 &&
144.1279 + q[i] == t) {
144.1280 + long u = (i << ASHIFT) + ABASE;
144.1281 + if (v.queueBase == b &&
144.1282 + UNSAFE.compareAndSwapObject(q, u, t, null)) {
144.1283 + v.queueBase = b + 1;
144.1284 + v.stealHint = poolIndex;
144.1285 + ForkJoinTask<?> ps = currentSteal;
144.1286 + currentSteal = t;
144.1287 + t.doExec();
144.1288 + currentSteal = ps;
144.1289 + }
144.1290 + break;
144.1291 }
144.1292 }
144.1293 }
144.1294 -
144.1295 - int n; // worker array size
144.1296 - ForkJoinWorkerThread[] ws = p.workers;
144.1297 - if (ws != null && (n = ws.length) > 1) { // need at least 2 workers
144.1298 - ForkJoinTask<?> task = joinMe; // base of chain
144.1299 - ForkJoinWorkerThread thread = this; // thread with stolen task
144.1300 -
144.1301 - outer:for (int d = 0; d < MAX_HELP_DEPTH; ++d) { // chain length
144.1302 - // Try to find v, the stealer of task, by first using hint
144.1303 - ForkJoinWorkerThread v = ws[thread.stealHint & (n - 1)];
144.1304 - if (v == null || v.currentSteal != task) {
144.1305 - for (int j = 0; ; ++j) { // search array
144.1306 - if (j < n) {
144.1307 - ForkJoinTask<?> vs;
144.1308 - if ((v = ws[j]) != null &&
144.1309 - (vs = v.currentSteal) != null) {
144.1310 - if (joinMe.status < 0)
144.1311 - break outer;
144.1312 - if (vs == task) {
144.1313 - if (task.status < 0)
144.1314 - break outer; // stale
144.1315 - thread.stealHint = j;
144.1316 - break; // save hint for next time
144.1317 - }
144.1318 - }
144.1319 - }
144.1320 - else
144.1321 - break outer; // no stealer
144.1322 - }
144.1323 - }
144.1324 -
144.1325 - // Try to help v, using specialized form of deqTask
144.1326 - for (;;) {
144.1327 - if (joinMe.status < 0)
144.1328 - break outer;
144.1329 - int b = v.base;
144.1330 - ForkJoinTask<?>[] q = v.queue;
144.1331 - if (b == v.sp || q == null)
144.1332 - break; // empty
144.1333 - int i = (q.length - 1) & b;
144.1334 - long u = (i << qShift) + qBase;
144.1335 - ForkJoinTask<?> t = q[i];
144.1336 - if (task.status < 0)
144.1337 - break outer; // stale
144.1338 - if (t != null &&
144.1339 - (running ||
144.1340 - (running = p.tryIncrementRunningCount())) &&
144.1341 - v.base == b++ &&
144.1342 - UNSAFE.compareAndSwapObject(q, u, t, null)) {
144.1343 - if (t != joinMe && joinMe.status < 0) {
144.1344 - UNSAFE.putObjectVolatile(q, u, t);
144.1345 - break outer; // joinMe cancelled; back out
144.1346 - }
144.1347 - v.base = b;
144.1348 - if (t.status >= 0) {
144.1349 - ForkJoinTask<?> ps = currentSteal;
144.1350 - int pid = poolIndex;
144.1351 - v.stealHint = pid;
144.1352 - UNSAFE.putOrderedObject(this,
144.1353 - currentStealOffset, t);
144.1354 - t.quietlyExec();
144.1355 - UNSAFE.putOrderedObject(this,
144.1356 - currentStealOffset, ps);
144.1357 - }
144.1358 - }
144.1359 - else if ((runState & TERMINATING) != 0) {
144.1360 - joinMe.cancelIgnoringExceptions();
144.1361 - break outer;
144.1362 - }
144.1363 - }
144.1364 -
144.1365 - // Try to descend to find v's stealer
144.1366 - ForkJoinTask<?> next = v.currentJoin;
144.1367 - if (task.status < 0 || next == null || next == task ||
144.1368 - joinMe.status < 0)
144.1369 - break; // done, stale, dead-end, or cyclic
144.1370 - task = next;
144.1371 - thread = v;
144.1372 - }
144.1373 - }
144.1374 - return running;
144.1375 + return t.status;
144.1376 }
144.1377
144.1378 /**
144.1379 - * Implements ForkJoinTask.getSurplusQueuedTaskCount().
144.1380 - * Returns an estimate of the number of tasks, offset by a
144.1381 - * function of number of idle workers.
144.1382 + * Implements ForkJoinTask.getSurplusQueuedTaskCount(). Returns
144.1383 + * an estimate of the number of tasks, offset by a function of
144.1384 + * number of idle workers.
144.1385 *
144.1386 * This method provides a cheap heuristic guide for task
144.1387 * partitioning when programmers, frameworks, tools, or languages
144.1388 @@ -1159,82 +903,96 @@
144.1389 * When all threads are active, it is on average OK to estimate
144.1390 * surplus strictly locally. In steady-state, if one thread is
144.1391 * maintaining say 2 surplus tasks, then so are others. So we can
144.1392 - * just use estimated queue length (although note that (sp - base)
144.1393 - * can be an overestimate because of stealers lagging increments
144.1394 - * of base). However, this strategy alone leads to serious
144.1395 - * mis-estimates in some non-steady-state conditions (ramp-up,
144.1396 - * ramp-down, other stalls). We can detect many of these by
144.1397 - * further considering the number of "idle" threads, that are
144.1398 + * just use estimated queue length (although note that (queueTop -
144.1399 + * queueBase) can be an overestimate because of stealers lagging
144.1400 + * increments of queueBase). However, this strategy alone leads
144.1401 + * to serious mis-estimates in some non-steady-state conditions
144.1402 + * (ramp-up, ramp-down, other stalls). We can detect many of these
144.1403 + * by further considering the number of "idle" threads, that are
144.1404 * known to have zero queued tasks, so compensate by a factor of
144.1405 * (#idle/#active) threads.
144.1406 */
144.1407 final int getEstimatedSurplusTaskCount() {
144.1408 - return sp - base - pool.idlePerActive();
144.1409 + return queueTop - queueBase - pool.idlePerActive();
144.1410 }
144.1411
144.1412 /**
144.1413 - * Runs tasks until {@code pool.isQuiescent()}.
144.1414 + * Runs tasks until {@code pool.isQuiescent()}. We piggyback on
144.1415 + * pool's active count ctl maintenance, but rather than blocking
144.1416 + * when tasks cannot be found, we rescan until all others cannot
144.1417 + * find tasks either. The bracketing by pool quiescerCounts
144.1418 + * updates suppresses pool auto-shutdown mechanics that could
144.1419 + * otherwise prematurely terminate the pool because all threads
144.1420 + * appear to be inactive.
144.1421 */
144.1422 final void helpQuiescePool() {
144.1423 + boolean active = true;
144.1424 ForkJoinTask<?> ps = currentSteal; // to restore below
144.1425 + ForkJoinPool p = pool;
144.1426 + p.addQuiescerCount(1);
144.1427 for (;;) {
144.1428 - ForkJoinTask<?> t = pollLocalTask();
144.1429 - if (t != null || (t = scan()) != null)
144.1430 - t.quietlyExec();
144.1431 + ForkJoinWorkerThread[] ws = p.workers;
144.1432 + ForkJoinWorkerThread v = null;
144.1433 + int n;
144.1434 + if (queueTop != queueBase)
144.1435 + v = this;
144.1436 + else if (ws != null && (n = ws.length) > 1) {
144.1437 + ForkJoinWorkerThread w;
144.1438 + int r = nextSeed(); // cheap version of FJP.scan
144.1439 + int steps = n << 1;
144.1440 + for (int i = 0; i < steps; ++i) {
144.1441 + if ((w = ws[(i + r) & (n - 1)]) != null &&
144.1442 + w.queueBase != w.queueTop) {
144.1443 + v = w;
144.1444 + break;
144.1445 + }
144.1446 + }
144.1447 + }
144.1448 + if (v != null) {
144.1449 + ForkJoinTask<?> t;
144.1450 + if (!active) {
144.1451 + active = true;
144.1452 + p.addActiveCount(1);
144.1453 + }
144.1454 + if ((t = (v != this) ? v.deqTask() :
144.1455 + locallyFifo? locallyDeqTask() : popTask()) != null) {
144.1456 + currentSteal = t;
144.1457 + t.doExec();
144.1458 + currentSteal = ps;
144.1459 + }
144.1460 + }
144.1461 else {
144.1462 - ForkJoinPool p = pool;
144.1463 - int a; // to inline CASes
144.1464 if (active) {
144.1465 - if (!UNSAFE.compareAndSwapInt
144.1466 - (p, poolRunStateOffset, a = p.runState, a - 1))
144.1467 - continue; // retry later
144.1468 - active = false; // inactivate
144.1469 - UNSAFE.putOrderedObject(this, currentStealOffset, ps);
144.1470 + active = false;
144.1471 + p.addActiveCount(-1);
144.1472 }
144.1473 if (p.isQuiescent()) {
144.1474 - active = true; // re-activate
144.1475 - do {} while (!UNSAFE.compareAndSwapInt
144.1476 - (p, poolRunStateOffset, a = p.runState, a+1));
144.1477 - return;
144.1478 + p.addActiveCount(1);
144.1479 + p.addQuiescerCount(-1);
144.1480 + break;
144.1481 }
144.1482 }
144.1483 }
144.1484 }
144.1485
144.1486 // Unsafe mechanics
144.1487 -
144.1488 - private static final sun.misc.Unsafe UNSAFE = sun.misc.Unsafe.getUnsafe();
144.1489 - private static final long spOffset =
144.1490 - objectFieldOffset("sp", ForkJoinWorkerThread.class);
144.1491 - private static final long runStateOffset =
144.1492 - objectFieldOffset("runState", ForkJoinWorkerThread.class);
144.1493 - private static final long currentJoinOffset =
144.1494 - objectFieldOffset("currentJoin", ForkJoinWorkerThread.class);
144.1495 - private static final long currentStealOffset =
144.1496 - objectFieldOffset("currentSteal", ForkJoinWorkerThread.class);
144.1497 - private static final long qBase =
144.1498 - UNSAFE.arrayBaseOffset(ForkJoinTask[].class);
144.1499 - private static final long poolRunStateOffset = // to inline CAS
144.1500 - objectFieldOffset("runState", ForkJoinPool.class);
144.1501 -
144.1502 - private static final int qShift;
144.1503 + private static final sun.misc.Unsafe UNSAFE;
144.1504 + private static final long ABASE;
144.1505 + private static final int ASHIFT;
144.1506
144.1507 static {
144.1508 - int s = UNSAFE.arrayIndexScale(ForkJoinTask[].class);
144.1509 + int s;
144.1510 + try {
144.1511 + UNSAFE = sun.misc.Unsafe.getUnsafe();
144.1512 + Class a = ForkJoinTask[].class;
144.1513 + ABASE = UNSAFE.arrayBaseOffset(a);
144.1514 + s = UNSAFE.arrayIndexScale(a);
144.1515 + } catch (Exception e) {
144.1516 + throw new Error(e);
144.1517 + }
144.1518 if ((s & (s-1)) != 0)
144.1519 throw new Error("data type scale not a power of two");
144.1520 - qShift = 31 - Integer.numberOfLeadingZeros(s);
144.1521 - MAXIMUM_QUEUE_CAPACITY = 1 << (31 - qShift);
144.1522 + ASHIFT = 31 - Integer.numberOfLeadingZeros(s);
144.1523 }
144.1524
144.1525 - private static long objectFieldOffset(String field, Class<?> klazz) {
144.1526 - try {
144.1527 - return UNSAFE.objectFieldOffset(klazz.getDeclaredField(field));
144.1528 - } catch (NoSuchFieldException e) {
144.1529 - // Convert Exception to corresponding Error
144.1530 - NoSuchFieldError error = new NoSuchFieldError(field);
144.1531 - error.initCause(e);
144.1532 - throw error;
144.1533 - }
144.1534 - }
144.1535 }
145.1 --- a/src/share/classes/javax/swing/JOptionPane.java Tue Mar 29 11:29:01 2011 -0700
145.2 +++ b/src/share/classes/javax/swing/JOptionPane.java Tue Mar 29 20:19:55 2011 -0700
145.3 @@ -987,11 +987,33 @@
145.4 }
145.5 dialog.pack();
145.6 dialog.setLocationRelativeTo(parentComponent);
145.7 +
145.8 + final PropertyChangeListener listener = new PropertyChangeListener() {
145.9 + public void propertyChange(PropertyChangeEvent event) {
145.10 + // Let the defaultCloseOperation handle the closing
145.11 + // if the user closed the window without selecting a button
145.12 + // (newValue = null in that case). Otherwise, close the dialog.
145.13 + if (dialog.isVisible() && event.getSource() == JOptionPane.this &&
145.14 + (event.getPropertyName().equals(VALUE_PROPERTY) ||
145.15 + event.getPropertyName().equals(INPUT_VALUE_PROPERTY)) &&
145.16 + event.getNewValue() != null &&
145.17 + event.getNewValue() != JOptionPane.UNINITIALIZED_VALUE) {
145.18 + dialog.setVisible(false);
145.19 + }
145.20 + }
145.21 + };
145.22 +
145.23 WindowAdapter adapter = new WindowAdapter() {
145.24 private boolean gotFocus = false;
145.25 public void windowClosing(WindowEvent we) {
145.26 setValue(null);
145.27 }
145.28 +
145.29 + public void windowClosed(WindowEvent e) {
145.30 + removePropertyChangeListener(listener);
145.31 + dialog.getContentPane().removeAll();
145.32 + }
145.33 +
145.34 public void windowGainedFocus(WindowEvent we) {
145.35 // Once window gets focus, set initial focus
145.36 if (!gotFocus) {
145.37 @@ -1008,20 +1030,8 @@
145.38 setValue(JOptionPane.UNINITIALIZED_VALUE);
145.39 }
145.40 });
145.41 - addPropertyChangeListener(new PropertyChangeListener() {
145.42 - public void propertyChange(PropertyChangeEvent event) {
145.43 - // Let the defaultCloseOperation handle the closing
145.44 - // if the user closed the window without selecting a button
145.45 - // (newValue = null in that case). Otherwise, close the dialog.
145.46 - if (dialog.isVisible() && event.getSource() == JOptionPane.this &&
145.47 - (event.getPropertyName().equals(VALUE_PROPERTY) ||
145.48 - event.getPropertyName().equals(INPUT_VALUE_PROPERTY)) &&
145.49 - event.getNewValue() != null &&
145.50 - event.getNewValue() != JOptionPane.UNINITIALIZED_VALUE) {
145.51 - dialog.setVisible(false);
145.52 - }
145.53 - }
145.54 - });
145.55 +
145.56 + addPropertyChangeListener(listener);
145.57 }
145.58
145.59
146.1 --- a/src/share/classes/javax/swing/Timer.java Tue Mar 29 11:29:01 2011 -0700
146.2 +++ b/src/share/classes/javax/swing/Timer.java Tue Mar 29 20:19:55 2011 -0700
146.3 @@ -35,6 +35,10 @@
146.4 import java.awt.*;
146.5 import java.awt.event.*;
146.6 import java.io.Serializable;
146.7 +import java.io.*;
146.8 +import java.security.AccessControlContext;
146.9 +import java.security.AccessController;
146.10 +import java.security.PrivilegedAction;
146.11 import javax.swing.event.EventListenerList;
146.12
146.13
146.14 @@ -208,6 +212,22 @@
146.15 }
146.16 }
146.17
146.18 + /*
146.19 + * The timer's AccessControlContext.
146.20 + */
146.21 + private transient volatile AccessControlContext acc =
146.22 + AccessController.getContext();
146.23 +
146.24 + /**
146.25 + * Returns the acc this timer was constructed with.
146.26 + */
146.27 + final AccessControlContext getAccessControlContext() {
146.28 + if (acc == null) {
146.29 + throw new SecurityException(
146.30 + "Timer is missing AccessControlContext");
146.31 + }
146.32 + return acc;
146.33 + }
146.34
146.35 /**
146.36 * DoPostEvent is a runnable class that fires actionEvents to
146.37 @@ -587,8 +607,13 @@
146.38
146.39
146.40 void post() {
146.41 - if (notify.compareAndSet(false, true) || !coalesce) {
146.42 - SwingUtilities.invokeLater(doPostEvent);
146.43 + if (notify.compareAndSet(false, true) || !coalesce) {
146.44 + AccessController.doPrivileged(new PrivilegedAction<Void>() {
146.45 + public Void run() {
146.46 + SwingUtilities.invokeLater(doPostEvent);
146.47 + return null;
146.48 + }
146.49 + }, getAccessControlContext());
146.50 }
146.51 }
146.52
146.53 @@ -596,6 +621,13 @@
146.54 return lock;
146.55 }
146.56
146.57 + private void readObject(ObjectInputStream in)
146.58 + throws ClassNotFoundException, IOException
146.59 + {
146.60 + this.acc = AccessController.getContext();
146.61 + in.defaultReadObject();
146.62 + }
146.63 +
146.64 /*
146.65 * We have to use readResolve because we can not initialize final
146.66 * fields for deserialized object otherwise
147.1 --- a/src/share/classes/javax/swing/TransferHandler.java Tue Mar 29 11:29:01 2011 -0700
147.2 +++ b/src/share/classes/javax/swing/TransferHandler.java Tue Mar 29 20:19:55 2011 -0700
147.3 @@ -42,6 +42,16 @@
147.4 import sun.swing.*;
147.5 import sun.awt.SunToolkit;
147.6
147.7 +import java.security.AccessController;
147.8 +import java.security.PrivilegedAction;
147.9 +
147.10 +import java.security.AccessControlContext;
147.11 +import java.security.ProtectionDomain;
147.12 +import sun.misc.SharedSecrets;
147.13 +import sun.misc.JavaSecurityAccess;
147.14 +
147.15 +import sun.awt.AWTAccessor;
147.16 +
147.17 /**
147.18 * This class is used to handle the transfer of a <code>Transferable</code>
147.19 * to and from Swing components. The <code>Transferable</code> is used to
147.20 @@ -1686,7 +1696,37 @@
147.21 return true;
147.22 }
147.23
147.24 - public void actionPerformed(ActionEvent e) {
147.25 + private static final JavaSecurityAccess javaSecurityAccess =
147.26 + SharedSecrets.getJavaSecurityAccess();
147.27 +
147.28 + public void actionPerformed(final ActionEvent e) {
147.29 + final Object src = e.getSource();
147.30 +
147.31 + final PrivilegedAction<Void> action = new PrivilegedAction<Void>() {
147.32 + public Void run() {
147.33 + actionPerformedImpl(e);
147.34 + return null;
147.35 + }
147.36 + };
147.37 +
147.38 + final AccessControlContext stack = AccessController.getContext();
147.39 + final AccessControlContext srcAcc = AWTAccessor.getComponentAccessor().getAccessControlContext((Component)src);
147.40 + final AccessControlContext eventAcc = AWTAccessor.getAWTEventAccessor().getAccessControlContext(e);
147.41 +
147.42 + if (srcAcc == null) {
147.43 + javaSecurityAccess.doIntersectionPrivilege(action, stack, eventAcc);
147.44 + } else {
147.45 + javaSecurityAccess.doIntersectionPrivilege(
147.46 + new PrivilegedAction<Void>() {
147.47 + public Void run() {
147.48 + javaSecurityAccess.doIntersectionPrivilege(action, eventAcc);
147.49 + return null;
147.50 + }
147.51 + }, stack, srcAcc);
147.52 + }
147.53 + }
147.54 +
147.55 + private void actionPerformedImpl(ActionEvent e) {
147.56 Object src = e.getSource();
147.57 if (src instanceof JComponent) {
147.58 JComponent c = (JComponent) src;
148.1 --- a/src/share/classes/org/relaxng/datatype/Datatype.java Tue Mar 29 11:29:01 2011 -0700
148.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
148.3 @@ -1,262 +0,0 @@
148.4 -/*
148.5 - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
148.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
148.7 - *
148.8 - * This code is free software; you can redistribute it and/or modify it
148.9 - * under the terms of the GNU General Public License version 2 only, as
148.10 - * published by the Free Software Foundation. Oracle designates this
148.11 - * particular file as subject to the "Classpath" exception as provided
148.12 - * by Oracle in the LICENSE file that accompanied this code.
148.13 - *
148.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
148.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
148.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
148.17 - * version 2 for more details (a copy is included in the LICENSE file that
148.18 - * accompanied this code).
148.19 - *
148.20 - * You should have received a copy of the GNU General Public License version
148.21 - * 2 along with this work; if not, write to the Free Software Foundation,
148.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
148.23 - *
148.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
148.25 - * or visit www.oracle.com if you need additional information or have any
148.26 - * questions.
148.27 - */
148.28 -
148.29 -package org.relaxng.datatype;
148.30 -
148.31 -/**
148.32 - * Datatype object.
148.33 - *
148.34 - * This object has the following functionality:
148.35 - *
148.36 - * <ol>
148.37 - * <li> functionality to identify a class of character sequences. This is
148.38 - * done through the isValid method.
148.39 - *
148.40 - * <li> functionality to produce a "value object" from a character sequence and
148.41 - * context information.
148.42 - *
148.43 - * <li> functionality to test the equality of two value objects.
148.44 - * </ol>
148.45 - *
148.46 - * This interface also defines the createStreamingValidator method,
148.47 - * which is intended to efficiently support the validation of
148.48 - * large character sequences.
148.49 - *
148.50 - * @author <a href="mailto:jjc@jclark.com">James Clark</a>
148.51 - * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
148.52 - */
148.53 -public interface Datatype {
148.54 -
148.55 - /**
148.56 - * Checks if the specified 'literal' matches this Datatype
148.57 - * with respect to the current context.
148.58 - *
148.59 - * @param literal
148.60 - * the lexical representation to be checked.
148.61 - * @param context
148.62 - * If this datatype is context-dependent
148.63 - * (i.e. the {@link #isContextDependent} method returns true),
148.64 - * then the caller must provide a non-null valid context object.
148.65 - * Otherwise, the caller can pass null.
148.66 - *
148.67 - * @return
148.68 - * true if the 'literal' is a member of this Datatype;
148.69 - * false if it's not a member of this Datatype.
148.70 - */
148.71 - boolean isValid( String literal, ValidationContext context );
148.72 -
148.73 - /**
148.74 - * Similar to the isValid method but throws an exception with diagnosis
148.75 - * in case of errors.
148.76 - *
148.77 - * <p>
148.78 - * If the specified 'literal' is a valid lexical representation for this
148.79 - * datatype, then this method must return without throwing any exception.
148.80 - * If not, the callee must throw an exception (with diagnosis message,
148.81 - * if possible.)
148.82 - *
148.83 - * <p>
148.84 - * The application can use this method to provide detailed error message
148.85 - * to users. This method is kept separate from the isValid method to
148.86 - * achieve higher performance during normal validation.
148.87 - *
148.88 - * @exception DatatypeException
148.89 - * If the given literal is invalid, then this exception is thrown.
148.90 - * If the callee supports error diagnosis, then the exception should
148.91 - * contain a diagnosis message.
148.92 - */
148.93 - void checkValid( String literal, ValidationContext context )
148.94 - throws DatatypeException;
148.95 -
148.96 - /**
148.97 - * Creates an instance of a streaming validator for this type.
148.98 - *
148.99 - * <p>
148.100 - * By using streaming validators instead of the isValid method,
148.101 - * the caller can avoid keeping the entire string, which is
148.102 - * sometimes quite big, in memory.
148.103 - *
148.104 - * @param context
148.105 - * If this datatype is context-dependent
148.106 - * (i.e. the {@link #isContextDependent} method returns true),
148.107 - * then the caller must provide a non-null valid context object.
148.108 - * Otherwise, the caller can pass null.
148.109 - * The callee may keep a reference to this context object
148.110 - * only while the returned streaming validator is being used.
148.111 - */
148.112 - DatatypeStreamingValidator createStreamingValidator( ValidationContext context );
148.113 -
148.114 - /**
148.115 - * Converts lexcial value and the current context to the corresponding
148.116 - * value object.
148.117 - *
148.118 - * <p>
148.119 - * The caller cannot generally assume that the value object is
148.120 - * a meaningful Java object. For example, the caller cannot expect
148.121 - * this method to return <code>java.lang.Number</code> type for
148.122 - * the "integer" type of XML Schema Part 2.
148.123 - *
148.124 - * <p>
148.125 - * Also, the caller cannot assume that the equals method and
148.126 - * the hashCode method of the value object are consistent with
148.127 - * the semantics of the datatype. For that purpose, the sameValue
148.128 - * method and the valueHashCode method have to be used. Note that
148.129 - * this means you cannot use classes like
148.130 - * <code>java.util.Hashtable</code> to store the value objects.
148.131 - *
148.132 - * <p>
148.133 - * The returned value object should be used solely for the sameValue
148.134 - * and valueHashCode methods.
148.135 - *
148.136 - * @param context
148.137 - * If this datatype is context-dependent
148.138 - * (when the {@link #isContextDependent} method returns true),
148.139 - * then the caller must provide a non-null valid context object.
148.140 - * Otherwise, the caller can pass null.
148.141 - *
148.142 - * @return null
148.143 - * when the given lexical value is not a valid lexical
148.144 - * value for this type.
148.145 - */
148.146 - Object createValue( String literal, ValidationContext context );
148.147 -
148.148 - /**
148.149 - * Tests the equality of two value objects which were originally
148.150 - * created by the createValue method of this object.
148.151 - *
148.152 - * The behavior is undefined if objects not created by this type
148.153 - * are passed. It is the caller's responsibility to ensure that
148.154 - * value objects belong to this type.
148.155 - *
148.156 - * @return
148.157 - * true if two value objects are considered equal according to
148.158 - * the definition of this datatype; false if otherwise.
148.159 - */
148.160 - boolean sameValue( Object value1, Object value2 );
148.161 -
148.162 -
148.163 - /**
148.164 - * Computes the hash code for a value object,
148.165 - * which is consistent with the sameValue method.
148.166 - *
148.167 - * @return
148.168 - * hash code for the specified value object.
148.169 - */
148.170 - int valueHashCode( Object value );
148.171 -
148.172 -
148.173 -
148.174 -
148.175 - /**
148.176 - * Indicates that the datatype doesn't have ID/IDREF semantics.
148.177 - *
148.178 - * This value is one of the possible return values of the
148.179 - * {@link #getIdType} method.
148.180 - */
148.181 - public static final int ID_TYPE_NULL = 0;
148.182 -
148.183 - /**
148.184 - * Indicates that RELAX NG compatibility processors should
148.185 - * treat this datatype as having ID semantics.
148.186 - *
148.187 - * This value is one of the possible return values of the
148.188 - * {@link #getIdType} method.
148.189 - */
148.190 - public static final int ID_TYPE_ID = 1;
148.191 -
148.192 - /**
148.193 - * Indicates that RELAX NG compatibility processors should
148.194 - * treat this datatype as having IDREF semantics.
148.195 - *
148.196 - * This value is one of the possible return values of the
148.197 - * {@link #getIdType} method.
148.198 - */
148.199 - public static final int ID_TYPE_IDREF = 2;
148.200 -
148.201 - /**
148.202 - * Indicates that RELAX NG compatibility processors should
148.203 - * treat this datatype as having IDREFS semantics.
148.204 - *
148.205 - * This value is one of the possible return values of the
148.206 - * {@link #getIdType} method.
148.207 - */
148.208 - public static final int ID_TYPE_IDREFS = 3;
148.209 -
148.210 - /**
148.211 - * Checks if the ID/IDREF semantics is associated with this
148.212 - * datatype.
148.213 - *
148.214 - * <p>
148.215 - * This method is introduced to support the RELAX NG DTD
148.216 - * compatibility spec. (Of course it's always free to use
148.217 - * this method for other purposes.)
148.218 - *
148.219 - * <p>
148.220 - * If you are implementing a datatype library and have no idea about
148.221 - * the "RELAX NG DTD compatibility" thing, just return
148.222 - * <code>ID_TYPE_NULL</code> is fine.
148.223 - *
148.224 - * @return
148.225 - * If this datatype doesn't have any ID/IDREF semantics,
148.226 - * it returns {@link #ID_TYPE_NULL}. If it has such a semantics
148.227 - * (for example, XSD:ID, XSD:IDREF and comp:ID type), then
148.228 - * it returns {@link #ID_TYPE_ID}, {@link #ID_TYPE_IDREF} or
148.229 - * {@link #ID_TYPE_IDREFS}.
148.230 - */
148.231 - public int getIdType();
148.232 -
148.233 -
148.234 - /**
148.235 - * Checks if this datatype may need a context object for
148.236 - * the validation.
148.237 - *
148.238 - * <p>
148.239 - * The callee must return true even when the context
148.240 - * is not always necessary. (For example, the "QName" type
148.241 - * doesn't need a context object when validating unprefixed
148.242 - * string. But nonetheless QName must return true.)
148.243 - *
148.244 - * <p>
148.245 - * XSD's <code>string</code> and <code>short</code> types
148.246 - * are examples of context-independent datatypes.
148.247 - * Its <code>QName</code> and <code>ENTITY</code> types
148.248 - * are examples of context-dependent datatypes.
148.249 - *
148.250 - * <p>
148.251 - * When a datatype is context-independent, then
148.252 - * the {@link #isValid} method, the {@link #checkValid} method,
148.253 - * the {@link #createStreamingValidator} method and
148.254 - * the {@link #createValue} method can be called without
148.255 - * providing a context object.
148.256 - *
148.257 - * @return
148.258 - * <b>true</b> if this datatype is context-dependent
148.259 - * (it needs a context object sometimes);
148.260 - *
148.261 - * <b>false</b> if this datatype is context-<b>in</b>dependent
148.262 - * (it never needs a context object).
148.263 - */
148.264 - public boolean isContextDependent();
148.265 -}
149.1 --- a/src/share/classes/org/relaxng/datatype/DatatypeBuilder.java Tue Mar 29 11:29:01 2011 -0700
149.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
149.3 @@ -1,70 +0,0 @@
149.4 -/*
149.5 - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
149.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
149.7 - *
149.8 - * This code is free software; you can redistribute it and/or modify it
149.9 - * under the terms of the GNU General Public License version 2 only, as
149.10 - * published by the Free Software Foundation. Oracle designates this
149.11 - * particular file as subject to the "Classpath" exception as provided
149.12 - * by Oracle in the LICENSE file that accompanied this code.
149.13 - *
149.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
149.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
149.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
149.17 - * version 2 for more details (a copy is included in the LICENSE file that
149.18 - * accompanied this code).
149.19 - *
149.20 - * You should have received a copy of the GNU General Public License version
149.21 - * 2 along with this work; if not, write to the Free Software Foundation,
149.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
149.23 - *
149.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
149.25 - * or visit www.oracle.com if you need additional information or have any
149.26 - * questions.
149.27 - */
149.28 -
149.29 -package org.relaxng.datatype;
149.30 -
149.31 -/**
149.32 - * Creates a user-defined type by adding parameters to
149.33 - * the pre-defined type.
149.34 - *
149.35 - * @author <a href="mailto:jjc@jclark.com">James Clark</a>
149.36 - * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
149.37 - */
149.38 -public interface DatatypeBuilder {
149.39 -
149.40 - /**
149.41 - * Adds a new parameter.
149.42 - *
149.43 - * @param name
149.44 - * The name of the parameter to be added.
149.45 - * @param strValue
149.46 - * The raw value of the parameter. Caller may not normalize
149.47 - * this value because any white space is potentially significant.
149.48 - * @param context
149.49 - * The context information which can be used by the callee to
149.50 - * acquire additional information. This context object is
149.51 - * valid only during this method call. The callee may not
149.52 - * keep a reference to this object.
149.53 - * @exception DatatypeException
149.54 - * When the given parameter is inappropriate for some reason.
149.55 - * The callee is responsible to recover from this error.
149.56 - * That is, the object should behave as if no such error
149.57 - * was occured.
149.58 - */
149.59 - void addParameter( String name, String strValue, ValidationContext context )
149.60 - throws DatatypeException;
149.61 -
149.62 - /**
149.63 - * Derives a new Datatype from a Datatype by parameters that
149.64 - * were already set through the addParameter method.
149.65 - *
149.66 - * @exception DatatypeException
149.67 - * DatatypeException must be thrown if the derivation is
149.68 - * somehow invalid. For example, a required parameter is missing,
149.69 - * etc. The exception should contain a diagnosis message
149.70 - * if possible.
149.71 - */
149.72 - Datatype createDatatype() throws DatatypeException;
149.73 -}
150.1 --- a/src/share/classes/org/relaxng/datatype/DatatypeException.java Tue Mar 29 11:29:01 2011 -0700
150.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
150.3 @@ -1,64 +0,0 @@
150.4 -/*
150.5 - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
150.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
150.7 - *
150.8 - * This code is free software; you can redistribute it and/or modify it
150.9 - * under the terms of the GNU General Public License version 2 only, as
150.10 - * published by the Free Software Foundation. Oracle designates this
150.11 - * particular file as subject to the "Classpath" exception as provided
150.12 - * by Oracle in the LICENSE file that accompanied this code.
150.13 - *
150.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
150.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
150.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
150.17 - * version 2 for more details (a copy is included in the LICENSE file that
150.18 - * accompanied this code).
150.19 - *
150.20 - * You should have received a copy of the GNU General Public License version
150.21 - * 2 along with this work; if not, write to the Free Software Foundation,
150.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
150.23 - *
150.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
150.25 - * or visit www.oracle.com if you need additional information or have any
150.26 - * questions.
150.27 - */
150.28 -
150.29 -package org.relaxng.datatype;
150.30 -
150.31 -/**
150.32 - * Signals Datatype related exceptions.
150.33 - *
150.34 - * @author <a href="mailto:jjc@jclark.com">James Clark</a>
150.35 - * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
150.36 - */
150.37 -public class DatatypeException extends Exception {
150.38 -
150.39 - public DatatypeException( int index, String msg ) {
150.40 - super(msg);
150.41 - this.index = index;
150.42 - }
150.43 - public DatatypeException( String msg ) {
150.44 - this(UNKNOWN,msg);
150.45 - }
150.46 - /**
150.47 - * A constructor for those datatype libraries which don't support any
150.48 - * diagnostic information at all.
150.49 - */
150.50 - public DatatypeException() {
150.51 - this(UNKNOWN,null);
150.52 - }
150.53 -
150.54 -
150.55 - private final int index;
150.56 -
150.57 - public static final int UNKNOWN = -1;
150.58 -
150.59 - /**
150.60 - * Gets the index of the content where the error occured.
150.61 - * UNKNOWN can be returned to indicate that no index information
150.62 - * is available.
150.63 - */
150.64 - public int getIndex() {
150.65 - return index;
150.66 - }
150.67 -}
151.1 --- a/src/share/classes/org/relaxng/datatype/DatatypeLibrary.java Tue Mar 29 11:29:01 2011 -0700
151.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
151.3 @@ -1,62 +0,0 @@
151.4 -/*
151.5 - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
151.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
151.7 - *
151.8 - * This code is free software; you can redistribute it and/or modify it
151.9 - * under the terms of the GNU General Public License version 2 only, as
151.10 - * published by the Free Software Foundation. Oracle designates this
151.11 - * particular file as subject to the "Classpath" exception as provided
151.12 - * by Oracle in the LICENSE file that accompanied this code.
151.13 - *
151.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
151.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
151.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
151.17 - * version 2 for more details (a copy is included in the LICENSE file that
151.18 - * accompanied this code).
151.19 - *
151.20 - * You should have received a copy of the GNU General Public License version
151.21 - * 2 along with this work; if not, write to the Free Software Foundation,
151.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
151.23 - *
151.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
151.25 - * or visit www.oracle.com if you need additional information or have any
151.26 - * questions.
151.27 - */
151.28 -
151.29 -package org.relaxng.datatype;
151.30 -
151.31 -/**
151.32 - * A Datatype library
151.33 - *
151.34 - * @author <a href="mailto:jjc@jclark.com">James Clark</a>
151.35 - * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
151.36 - */
151.37 -public interface DatatypeLibrary {
151.38 -
151.39 - /**
151.40 - * Creates a new instance of DatatypeBuilder.
151.41 - *
151.42 - * The callee should throw a DatatypeException in case of an error.
151.43 - *
151.44 - * @param baseTypeLocalName
151.45 - * The local name of the base type.
151.46 - *
151.47 - * @return
151.48 - * A non-null valid datatype object.
151.49 - */
151.50 - DatatypeBuilder createDatatypeBuilder( String baseTypeLocalName )
151.51 - throws DatatypeException;
151.52 -
151.53 - /**
151.54 - * Gets or creates a pre-defined type.
151.55 - *
151.56 - * This is just a short-cut of
151.57 - * <code>createDatatypeBuilder(typeLocalName).createDatatype();</code>
151.58 - *
151.59 - * The callee should throw a DatatypeException in case of an error.
151.60 - *
151.61 - * @return
151.62 - * A non-null valid datatype object.
151.63 - */
151.64 - Datatype createDatatype( String typeLocalName ) throws DatatypeException;
151.65 -}
152.1 --- a/src/share/classes/org/relaxng/datatype/DatatypeLibraryFactory.java Tue Mar 29 11:29:01 2011 -0700
152.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
152.3 @@ -1,51 +0,0 @@
152.4 -/*
152.5 - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
152.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
152.7 - *
152.8 - * This code is free software; you can redistribute it and/or modify it
152.9 - * under the terms of the GNU General Public License version 2 only, as
152.10 - * published by the Free Software Foundation. Oracle designates this
152.11 - * particular file as subject to the "Classpath" exception as provided
152.12 - * by Oracle in the LICENSE file that accompanied this code.
152.13 - *
152.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
152.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
152.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
152.17 - * version 2 for more details (a copy is included in the LICENSE file that
152.18 - * accompanied this code).
152.19 - *
152.20 - * You should have received a copy of the GNU General Public License version
152.21 - * 2 along with this work; if not, write to the Free Software Foundation,
152.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
152.23 - *
152.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
152.25 - * or visit www.oracle.com if you need additional information or have any
152.26 - * questions.
152.27 - */
152.28 -
152.29 -package org.relaxng.datatype;
152.30 -
152.31 -/**
152.32 - * Factory class for the DatatypeLibrary class.
152.33 - *
152.34 - * <p>
152.35 - * The datatype library should provide the implementation of
152.36 - * this interface if it wants to be found by the schema processors.
152.37 - * The implementor also have to place a file in your jar file.
152.38 - * See the reference datatype library implementation for detail.
152.39 - *
152.40 - * @author <a href="mailto:jjc@jclark.com">James Clark</a>
152.41 - * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
152.42 - */
152.43 -public interface DatatypeLibraryFactory
152.44 -{
152.45 - /**
152.46 - * Creates a new instance of a DatatypeLibrary that supports
152.47 - * the specified namespace URI.
152.48 - *
152.49 - * @return
152.50 - * <code>null</code> if the specified namespace URI is not
152.51 - * supported.
152.52 - */
152.53 - DatatypeLibrary createDatatypeLibrary( String namespaceURI );
152.54 -}
153.1 --- a/src/share/classes/org/relaxng/datatype/DatatypeStreamingValidator.java Tue Mar 29 11:29:01 2011 -0700
153.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
153.3 @@ -1,71 +0,0 @@
153.4 -/*
153.5 - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
153.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
153.7 - *
153.8 - * This code is free software; you can redistribute it and/or modify it
153.9 - * under the terms of the GNU General Public License version 2 only, as
153.10 - * published by the Free Software Foundation. Oracle designates this
153.11 - * particular file as subject to the "Classpath" exception as provided
153.12 - * by Oracle in the LICENSE file that accompanied this code.
153.13 - *
153.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
153.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
153.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
153.17 - * version 2 for more details (a copy is included in the LICENSE file that
153.18 - * accompanied this code).
153.19 - *
153.20 - * You should have received a copy of the GNU General Public License version
153.21 - * 2 along with this work; if not, write to the Free Software Foundation,
153.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
153.23 - *
153.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
153.25 - * or visit www.oracle.com if you need additional information or have any
153.26 - * questions.
153.27 - */
153.28 -
153.29 -package org.relaxng.datatype;
153.30 -
153.31 -/**
153.32 - * Datatype streaming validator.
153.33 - *
153.34 - * <p>
153.35 - * The streaming validator is an optional feature that is useful for
153.36 - * certain Datatypes. It allows the caller to incrementally provide
153.37 - * the literal.
153.38 - *
153.39 - * @author <a href="mailto:jjc@jclark.com">James Clark</a>
153.40 - * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
153.41 - */
153.42 -public interface DatatypeStreamingValidator {
153.43 -
153.44 - /**
153.45 - * Passes an additional fragment of the literal.
153.46 - *
153.47 - * <p>
153.48 - * The application can call this method several times, then call
153.49 - * the isValid method (or the checkValid method) to check the validity
153.50 - * of the accumulated characters.
153.51 - */
153.52 - void addCharacters( char[] buf, int start, int len );
153.53 -
153.54 - /**
153.55 - * Tells if the accumulated literal is valid with respect to
153.56 - * the underlying Datatype.
153.57 - *
153.58 - * @return
153.59 - * True if it is valid. False if otherwise.
153.60 - */
153.61 - boolean isValid();
153.62 -
153.63 - /**
153.64 - * Similar to the isValid method, but this method throws
153.65 - * Exception (with possibly diagnostic information), instead of
153.66 - * returning false.
153.67 - *
153.68 - * @exception DatatypeException
153.69 - * If the callee supports the diagnosis and the accumulated
153.70 - * literal is invalid, then this exception that possibly
153.71 - * contains diagnosis information is thrown.
153.72 - */
153.73 - void checkValid() throws DatatypeException;
153.74 -}
154.1 --- a/src/share/classes/org/relaxng/datatype/ValidationContext.java Tue Mar 29 11:29:01 2011 -0700
154.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
154.3 @@ -1,91 +0,0 @@
154.4 -/*
154.5 - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
154.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
154.7 - *
154.8 - * This code is free software; you can redistribute it and/or modify it
154.9 - * under the terms of the GNU General Public License version 2 only, as
154.10 - * published by the Free Software Foundation. Oracle designates this
154.11 - * particular file as subject to the "Classpath" exception as provided
154.12 - * by Oracle in the LICENSE file that accompanied this code.
154.13 - *
154.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
154.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
154.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
154.17 - * version 2 for more details (a copy is included in the LICENSE file that
154.18 - * accompanied this code).
154.19 - *
154.20 - * You should have received a copy of the GNU General Public License version
154.21 - * 2 along with this work; if not, write to the Free Software Foundation,
154.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
154.23 - *
154.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
154.25 - * or visit www.oracle.com if you need additional information or have any
154.26 - * questions.
154.27 - */
154.28 -
154.29 -package org.relaxng.datatype;
154.30 -
154.31 -/**
154.32 - * An interface that must be implemented by caller to
154.33 - * provide context information that is necessary to
154.34 - * perform validation of some Datatypes.
154.35 - *
154.36 - * @author <a href="mailto:jjc@jclark.com">James Clark</a>
154.37 - * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
154.38 - */
154.39 -public interface ValidationContext {
154.40 -
154.41 - /**
154.42 - * Resolves a namespace prefix to the corresponding namespace URI.
154.43 - *
154.44 - * This method is used for validating the QName type, for example.
154.45 - *
154.46 - * <p>
154.47 - * If the prefix is "" (empty string), it indicates
154.48 - * an unprefixed value. The callee
154.49 - * should resolve it as for an unprefixed
154.50 - * element, rather than for an unprefixed attribute.
154.51 - *
154.52 - * <p>
154.53 - * If the prefix is "xml", then the callee must resolve
154.54 - * this prefix into "http://www.w3.org/XML/1998/namespace",
154.55 - * as defined in the XML Namespaces Recommendation.
154.56 - *
154.57 - * @return
154.58 - * namespace URI of this prefix.
154.59 - * If the specified prefix is not declared,
154.60 - * the implementation must return null.
154.61 - */
154.62 - String resolveNamespacePrefix( String prefix );
154.63 -
154.64 - /**
154.65 - * Returns the base URI of the context. The null string may be returned
154.66 - * if no base URI is known.
154.67 - */
154.68 - String getBaseUri();
154.69 -
154.70 - /**
154.71 - * Checks if an unparsed entity is declared with the
154.72 - * specified name.
154.73 - *
154.74 - * @return
154.75 - * true
154.76 - * if the DTD has an unparsed entity declaration for
154.77 - * the specified name.
154.78 - * false
154.79 - * otherwise.
154.80 - */
154.81 - boolean isUnparsedEntity( String entityName );
154.82 -
154.83 - /**
154.84 - * Checks if a notation is declared with the
154.85 - * specified name.
154.86 - *
154.87 - * @return
154.88 - * true
154.89 - * if the DTD has a notation declaration for the specified name.
154.90 - * false
154.91 - * otherwise.
154.92 - */
154.93 - boolean isNotation( String notationName );
154.94 -}
155.1 --- a/src/share/classes/org/relaxng/datatype/helpers/DatatypeLibraryLoader.java Tue Mar 29 11:29:01 2011 -0700
155.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
155.3 @@ -1,262 +0,0 @@
155.4 -/**
155.5 - * Copyright (c) 2001, Thai Open Source Software Center Ltd
155.6 - * All rights reserved.
155.7 - *
155.8 - * Redistribution and use in source and binary forms, with or without
155.9 - * modification, are permitted provided that the following conditions are
155.10 - * met:
155.11 - *
155.12 - * Redistributions of source code must retain the above copyright
155.13 - * notice, this list of conditions and the following disclaimer.
155.14 - *
155.15 - * Redistributions in binary form must reproduce the above copyright
155.16 - * notice, this list of conditions and the following disclaimer in
155.17 - * the documentation and/or other materials provided with the
155.18 - * distribution.
155.19 - *
155.20 - * Neither the name of the Thai Open Source Software Center Ltd nor
155.21 - * the names of its contributors may be used to endorse or promote
155.22 - * products derived from this software without specific prior written
155.23 - * permission.
155.24 - *
155.25 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
155.26 - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
155.27 - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
155.28 - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
155.29 - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
155.30 - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
155.31 - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
155.32 - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
155.33 - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
155.34 - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
155.35 - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
155.36 - */
155.37 -package org.relaxng.datatype.helpers;
155.38 -
155.39 -import org.relaxng.datatype.DatatypeLibraryFactory;
155.40 -import org.relaxng.datatype.DatatypeLibrary;
155.41 -import java.util.Enumeration;
155.42 -import java.util.NoSuchElementException;
155.43 -import java.util.Vector;
155.44 -import java.io.Reader;
155.45 -import java.io.InputStream;
155.46 -import java.io.InputStreamReader;
155.47 -import java.io.BufferedReader;
155.48 -import java.io.IOException;
155.49 -import java.io.UnsupportedEncodingException;
155.50 -import java.net.URL;
155.51 -
155.52 -/**
155.53 - * Discovers the datatype library implementation from the classpath.
155.54 - *
155.55 - * <p>
155.56 - * The call of the createDatatypeLibrary method finds an implementation
155.57 - * from a given datatype library URI at run-time.
155.58 - */
155.59 -public class DatatypeLibraryLoader implements DatatypeLibraryFactory {
155.60 - private final Service service = new Service(DatatypeLibraryFactory.class);
155.61 -
155.62 - public DatatypeLibrary createDatatypeLibrary(String uri) {
155.63 - for (Enumeration e = service.getProviders();
155.64 - e.hasMoreElements();) {
155.65 - DatatypeLibraryFactory factory
155.66 - = (DatatypeLibraryFactory)e.nextElement();
155.67 - DatatypeLibrary library = factory.createDatatypeLibrary(uri);
155.68 - if (library != null)
155.69 - return library;
155.70 - }
155.71 - return null;
155.72 - }
155.73 -
155.74 - private static class Service {
155.75 - private final Class serviceClass;
155.76 - private final Enumeration configFiles;
155.77 - private Enumeration classNames = null;
155.78 - private final Vector providers = new Vector();
155.79 - private Loader loader;
155.80 -
155.81 - private class ProviderEnumeration implements Enumeration {
155.82 - private int nextIndex = 0;
155.83 -
155.84 - public boolean hasMoreElements() {
155.85 - return nextIndex < providers.size() || moreProviders();
155.86 - }
155.87 -
155.88 - public Object nextElement() {
155.89 - try {
155.90 - return providers.elementAt(nextIndex++);
155.91 - }
155.92 - catch (ArrayIndexOutOfBoundsException e) {
155.93 - throw new NoSuchElementException();
155.94 - }
155.95 - }
155.96 - }
155.97 -
155.98 - private static class Singleton implements Enumeration {
155.99 - private Object obj;
155.100 - private Singleton(Object obj) {
155.101 - this.obj = obj;
155.102 - }
155.103 -
155.104 - public boolean hasMoreElements() {
155.105 - return obj != null;
155.106 - }
155.107 -
155.108 - public Object nextElement() {
155.109 - if (obj == null)
155.110 - throw new NoSuchElementException();
155.111 - Object tem = obj;
155.112 - obj = null;
155.113 - return tem;
155.114 - }
155.115 - }
155.116 -
155.117 - // JDK 1.1
155.118 - private static class Loader {
155.119 - Enumeration getResources(String resName) {
155.120 - ClassLoader cl = Loader.class.getClassLoader();
155.121 - URL url;
155.122 - if (cl == null)
155.123 - url = ClassLoader.getSystemResource(resName);
155.124 - else
155.125 - url = cl.getResource(resName);
155.126 - return new Singleton(url);
155.127 - }
155.128 -
155.129 - Class loadClass(String name) throws ClassNotFoundException {
155.130 - return Class.forName(name);
155.131 - }
155.132 - }
155.133 -
155.134 - // JDK 1.2+
155.135 - private static class Loader2 extends Loader {
155.136 - private ClassLoader cl;
155.137 -
155.138 - Loader2() {
155.139 - cl = Loader2.class.getClassLoader();
155.140 - // If the thread context class loader has the class loader
155.141 - // of this class as an ancestor, use the thread context class
155.142 - // loader. Otherwise, the thread context class loader
155.143 - // probably hasn't been set up properly, so don't use it.
155.144 - ClassLoader clt = Thread.currentThread().getContextClassLoader();
155.145 - for (ClassLoader tem = clt; tem != null; tem = tem.getParent())
155.146 - if (tem == cl) {
155.147 - cl = clt;
155.148 - break;
155.149 - }
155.150 - }
155.151 -
155.152 - Enumeration getResources(String resName) {
155.153 - try {
155.154 - return cl.getResources(resName);
155.155 -
155.156 - }
155.157 - catch (IOException e) {
155.158 - return new Singleton(null);
155.159 - }
155.160 - }
155.161 -
155.162 - Class loadClass(String name) throws ClassNotFoundException {
155.163 - return Class.forName(name, true, cl);
155.164 - }
155.165 - }
155.166 -
155.167 - public Service(Class cls) {
155.168 - try {
155.169 - loader = new Loader2();
155.170 - }
155.171 - catch (NoSuchMethodError e) {
155.172 - loader = new Loader();
155.173 - }
155.174 - serviceClass = cls;
155.175 - String resName = "META-INF/services/" + serviceClass.getName();
155.176 - configFiles = loader.getResources(resName);
155.177 - }
155.178 -
155.179 - public Enumeration getProviders() {
155.180 - return new ProviderEnumeration();
155.181 - }
155.182 -
155.183 - synchronized private boolean moreProviders() {
155.184 - for (;;) {
155.185 - while (classNames == null) {
155.186 - if (!configFiles.hasMoreElements())
155.187 - return false;
155.188 - classNames = parseConfigFile((URL)configFiles.nextElement());
155.189 - }
155.190 - while (classNames.hasMoreElements()) {
155.191 - String className = (String)classNames.nextElement();
155.192 - try {
155.193 - Class cls = loader.loadClass(className);
155.194 - Object obj = cls.newInstance();
155.195 - if (serviceClass.isInstance(obj)) {
155.196 - providers.addElement(obj);
155.197 - return true;
155.198 - }
155.199 - }
155.200 - catch (ClassNotFoundException e) { }
155.201 - catch (InstantiationException e) { }
155.202 - catch (IllegalAccessException e) { }
155.203 - catch (LinkageError e) { }
155.204 - }
155.205 - classNames = null;
155.206 - }
155.207 - }
155.208 -
155.209 - private static final int START = 0;
155.210 - private static final int IN_NAME = 1;
155.211 - private static final int IN_COMMENT = 2;
155.212 -
155.213 - private static Enumeration parseConfigFile(URL url) {
155.214 - try {
155.215 - InputStream in = url.openStream();
155.216 - Reader r;
155.217 - try {
155.218 - r = new InputStreamReader(in, "UTF-8");
155.219 - }
155.220 - catch (UnsupportedEncodingException e) {
155.221 - r = new InputStreamReader(in, "UTF8");
155.222 - }
155.223 - r = new BufferedReader(r);
155.224 - Vector tokens = new Vector();
155.225 - StringBuffer tokenBuf = new StringBuffer();
155.226 - int state = START;
155.227 - for (;;) {
155.228 - int n = r.read();
155.229 - if (n < 0)
155.230 - break;
155.231 - char c = (char)n;
155.232 - switch (c) {
155.233 - case '\r':
155.234 - case '\n':
155.235 - state = START;
155.236 - break;
155.237 - case ' ':
155.238 - case '\t':
155.239 - break;
155.240 - case '#':
155.241 - state = IN_COMMENT;
155.242 - break;
155.243 - default:
155.244 - if (state != IN_COMMENT) {
155.245 - state = IN_NAME;
155.246 - tokenBuf.append(c);
155.247 - }
155.248 - break;
155.249 - }
155.250 - if (tokenBuf.length() != 0 && state != IN_NAME) {
155.251 - tokens.addElement(tokenBuf.toString());
155.252 - tokenBuf.setLength(0);
155.253 - }
155.254 - }
155.255 - if (tokenBuf.length() != 0)
155.256 - tokens.addElement(tokenBuf.toString());
155.257 - return tokens.elements();
155.258 - }
155.259 - catch (IOException e) {
155.260 - return null;
155.261 - }
155.262 - }
155.263 - }
155.264 -
155.265 -}
156.1 --- a/src/share/classes/org/relaxng/datatype/helpers/ParameterlessDatatypeBuilder.java Tue Mar 29 11:29:01 2011 -0700
156.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
156.3 @@ -1,67 +0,0 @@
156.4 -/*
156.5 - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
156.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
156.7 - *
156.8 - * This code is free software; you can redistribute it and/or modify it
156.9 - * under the terms of the GNU General Public License version 2 only, as
156.10 - * published by the Free Software Foundation. Oracle designates this
156.11 - * particular file as subject to the "Classpath" exception as provided
156.12 - * by Oracle in the LICENSE file that accompanied this code.
156.13 - *
156.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
156.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
156.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
156.17 - * version 2 for more details (a copy is included in the LICENSE file that
156.18 - * accompanied this code).
156.19 - *
156.20 - * You should have received a copy of the GNU General Public License version
156.21 - * 2 along with this work; if not, write to the Free Software Foundation,
156.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
156.23 - *
156.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
156.25 - * or visit www.oracle.com if you need additional information or have any
156.26 - * questions.
156.27 - */
156.28 -
156.29 -package org.relaxng.datatype.helpers;
156.30 -
156.31 -import org.relaxng.datatype.*;
156.32 -
156.33 -/**
156.34 - * Dummy implementation of {@link DatatypeBuilder}.
156.35 - *
156.36 - * This implementation can be used for Datatypes which have no parameters.
156.37 - * Any attempt to add parameters will be rejected.
156.38 - *
156.39 - * <p>
156.40 - * Typical usage would be:
156.41 - * <PRE><XMP>
156.42 - * class MyDatatypeLibrary implements DatatypeLibrary {
156.43 - * ....
156.44 - * DatatypeBuilder createDatatypeBuilder( String typeName ) {
156.45 - * return new ParameterleessDatatypeBuilder(createDatatype(typeName));
156.46 - * }
156.47 - * ....
156.48 - * }
156.49 - * </XMP></PRE>
156.50 - *
156.51 - * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
156.52 - */
156.53 -public final class ParameterlessDatatypeBuilder implements DatatypeBuilder {
156.54 -
156.55 - /** This type object is returned for the derive method. */
156.56 - private final Datatype baseType;
156.57 -
156.58 - public ParameterlessDatatypeBuilder( Datatype baseType ) {
156.59 - this.baseType = baseType;
156.60 - }
156.61 -
156.62 - public void addParameter( String name, String strValue, ValidationContext context )
156.63 - throws DatatypeException {
156.64 - throw new DatatypeException();
156.65 - }
156.66 -
156.67 - public Datatype createDatatype() throws DatatypeException {
156.68 - return baseType;
156.69 - }
156.70 -}
157.1 --- a/src/share/classes/org/relaxng/datatype/helpers/StreamingValidatorImpl.java Tue Mar 29 11:29:01 2011 -0700
157.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
157.3 @@ -1,80 +0,0 @@
157.4 -/*
157.5 - * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
157.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
157.7 - *
157.8 - * This code is free software; you can redistribute it and/or modify it
157.9 - * under the terms of the GNU General Public License version 2 only, as
157.10 - * published by the Free Software Foundation. Oracle designates this
157.11 - * particular file as subject to the "Classpath" exception as provided
157.12 - * by Oracle in the LICENSE file that accompanied this code.
157.13 - *
157.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
157.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
157.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
157.17 - * version 2 for more details (a copy is included in the LICENSE file that
157.18 - * accompanied this code).
157.19 - *
157.20 - * You should have received a copy of the GNU General Public License version
157.21 - * 2 along with this work; if not, write to the Free Software Foundation,
157.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
157.23 - *
157.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
157.25 - * or visit www.oracle.com if you need additional information or have any
157.26 - * questions.
157.27 - */
157.28 -
157.29 -package org.relaxng.datatype.helpers;
157.30 -
157.31 -import org.relaxng.datatype.*;
157.32 -
157.33 -/**
157.34 - * Dummy implementation of {@link DatatypeStreamingValidator}.
157.35 - *
157.36 - * <p>
157.37 - * This implementation can be used as a quick hack when the performance
157.38 - * of streaming validation is not important. And this implementation
157.39 - * also shows you how to implement the DatatypeStreamingValidator interface.
157.40 - *
157.41 - * <p>
157.42 - * Typical usage would be:
157.43 - * <PRE><XMP>
157.44 - * class MyDatatype implements Datatype {
157.45 - * ....
157.46 - * public DatatypeStreamingValidator createStreamingValidator( ValidationContext context ) {
157.47 - * return new StreamingValidatorImpl(this,context);
157.48 - * }
157.49 - * ....
157.50 - * }
157.51 - * </XMP></PRE>
157.52 - *
157.53 - * @author <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
157.54 - */
157.55 -public final class StreamingValidatorImpl implements DatatypeStreamingValidator {
157.56 -
157.57 - /** This buffer accumulates characters. */
157.58 - private final StringBuffer buffer = new StringBuffer();
157.59 -
157.60 - /** Datatype obejct that creates this streaming validator. */
157.61 - private final Datatype baseType;
157.62 -
157.63 - /** The current context. */
157.64 - private final ValidationContext context;
157.65 -
157.66 - public void addCharacters( char[] buf, int start, int len ) {
157.67 - // append characters to the current buffer.
157.68 - buffer.append(buf,start,len);
157.69 - }
157.70 -
157.71 - public boolean isValid() {
157.72 - return baseType.isValid(buffer.toString(),context);
157.73 - }
157.74 -
157.75 - public void checkValid() throws DatatypeException {
157.76 - baseType.checkValid(buffer.toString(),context);
157.77 - }
157.78 -
157.79 - public StreamingValidatorImpl( Datatype baseType, ValidationContext context ) {
157.80 - this.baseType = baseType;
157.81 - this.context = context;
157.82 - }
157.83 -}
158.1 --- a/src/share/classes/overview-core.html Tue Mar 29 11:29:01 2011 -0700
158.2 +++ b/src/share/classes/overview-core.html Tue Mar 29 20:19:55 2011 -0700
158.3 @@ -33,7 +33,7 @@
158.4
158.5 <body>
158.6
158.7 -This document is the API specification for version 6 of the Java™
158.8 +This document is the API specification for the Java™
158.9 Platform, Standard Edition.
158.10
158.11 </body>
159.1 --- a/src/share/classes/sun/awt/AWTAccessor.java Tue Mar 29 11:29:01 2011 -0700
159.2 +++ b/src/share/classes/sun/awt/AWTAccessor.java Tue Mar 29 20:19:55 2011 -0700
159.3 @@ -33,6 +33,9 @@
159.4 import sun.misc.Unsafe;
159.5 import java.awt.peer.ComponentPeer;
159.6
159.7 +import java.security.AccessController;
159.8 +import java.security.AccessControlContext;
159.9 +
159.10 /**
159.11 * The AWTAccessor utility class.
159.12 * The main purpose of this class is to enable accessing
159.13 @@ -221,6 +224,13 @@
159.14 * Processes events occurring on this component.
159.15 */
159.16 void processEvent(Component comp, AWTEvent e);
159.17 +
159.18 +
159.19 + /*
159.20 + * Returns the acc this component was constructed with.
159.21 + */
159.22 + AccessControlContext getAccessControlContext(Component comp);
159.23 +
159.24 }
159.25
159.26 /*
159.27 @@ -323,6 +333,13 @@
159.28 * Indicates whether this AWTEvent was generated by the system.
159.29 */
159.30 boolean isSystemGenerated(AWTEvent ev);
159.31 +
159.32 +
159.33 + /*
159.34 + * Returns the acc this event was constructed with.
159.35 + */
159.36 + AccessControlContext getAccessControlContext(AWTEvent ev);
159.37 +
159.38 }
159.39
159.40 public interface InputEventAccessor {
160.1 --- a/src/share/classes/sun/dyn/Access.java Tue Mar 29 11:29:01 2011 -0700
160.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
160.3 @@ -1,109 +0,0 @@
160.4 -/*
160.5 - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
160.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
160.7 - *
160.8 - * This code is free software; you can redistribute it and/or modify it
160.9 - * under the terms of the GNU General Public License version 2 only, as
160.10 - * published by the Free Software Foundation. Oracle designates this
160.11 - * particular file as subject to the "Classpath" exception as provided
160.12 - * by Oracle in the LICENSE file that accompanied this code.
160.13 - *
160.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
160.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
160.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
160.17 - * version 2 for more details (a copy is included in the LICENSE file that
160.18 - * accompanied this code).
160.19 - *
160.20 - * You should have received a copy of the GNU General Public License version
160.21 - * 2 along with this work; if not, write to the Free Software Foundation,
160.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
160.23 - *
160.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
160.25 - * or visit www.oracle.com if you need additional information or have any
160.26 - * questions.
160.27 - */
160.28 -
160.29 -package sun.dyn;
160.30 -
160.31 -import sun.reflect.Reflection;
160.32 -
160.33 -/**
160.34 - * Access control to this package.
160.35 - * Classes in other packages can attempt to acquire the access token,
160.36 - * but will fail if they are not recognized as friends.
160.37 - * Certain methods in this package, although public, require a non-null
160.38 - * access token in order to proceed; they act like package-private methods.
160.39 - * @author jrose
160.40 - */
160.41 -
160.42 -public class Access {
160.43 -
160.44 - private Access() { }
160.45 -
160.46 - /**
160.47 - * The heart of this pattern: The list of classes which are
160.48 - * permitted to acquire the access token, and become honorary
160.49 - * members of this package.
160.50 - */
160.51 - private static final String[] FRIENDS = {
160.52 - "java.dyn.", "sun.dyn."
160.53 - };
160.54 -
160.55 - /**
160.56 - * The following object is NOT public. That's the point of the pattern.
160.57 - * It is package-private, so that any member of this package
160.58 - * can acquire the access token, and give it away to trusted friends.
160.59 - */
160.60 - static final Access TOKEN = new Access();
160.61 -
160.62 - /**
160.63 - * @return Access.TOKEN, if the caller is a friend of this package
160.64 - */
160.65 - public static Access getToken() {
160.66 - Class<?> callc = Reflection.getCallerClass(2);
160.67 - if (isFriend(callc))
160.68 - return TOKEN;
160.69 - else
160.70 - throw new IllegalAccessError("bad caller: " + callc);
160.71 - }
160.72 -
160.73 - /** Is the given name the name of a class which could be our friend? */
160.74 - public static boolean isFriendName(String name) {
160.75 - for (String friend : FRIENDS) {
160.76 - if (name.startsWith(friend))
160.77 - return true;
160.78 - }
160.79 - return false;
160.80 - }
160.81 -
160.82 - /** Is the given class a friend? True if {@link #isFriendName},
160.83 - * and the given class also shares a class loader with us.
160.84 - */
160.85 - public static boolean isFriend(Class<?> c) {
160.86 - return isFriendName(c.getName()) && c.getClassLoader() == CLASS_LOADER;
160.87 - }
160.88 -
160.89 - private static final ClassLoader CLASS_LOADER = Access.class.getClassLoader();
160.90 -
160.91 - /**
160.92 - * Throw an IllegalAccessError if the caller does not possess
160.93 - * the Access.TOKEN.
160.94 - * @param must be Access.TOKEN
160.95 - */
160.96 - public static void check(Access token) {
160.97 - if (token == null)
160.98 - fail();
160.99 - // else it must be the unique Access.TOKEN
160.100 - assert(token == Access.TOKEN);
160.101 - }
160.102 - private static void fail() {
160.103 - final int CALLER_DEPTH = 3;
160.104 - // 0: Reflection.getCC, 1: this.fail, 2: Access.*, 3: caller
160.105 - Class<?> callc = Reflection.getCallerClass(CALLER_DEPTH);
160.106 - throw new IllegalAccessError("bad caller: " + callc);
160.107 - }
160.108 -
160.109 - static {
160.110 - //sun.reflect.Reflection.registerMethodsToFilter(MH.class, "getToken");
160.111 - }
160.112 -}
161.1 --- a/src/share/classes/sun/dyn/AdapterMethodHandle.java Tue Mar 29 11:29:01 2011 -0700
161.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
161.3 @@ -1,974 +0,0 @@
161.4 -/*
161.5 - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
161.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
161.7 - *
161.8 - * This code is free software; you can redistribute it and/or modify it
161.9 - * under the terms of the GNU General Public License version 2 only, as
161.10 - * published by the Free Software Foundation. Oracle designates this
161.11 - * particular file as subject to the "Classpath" exception as provided
161.12 - * by Oracle in the LICENSE file that accompanied this code.
161.13 - *
161.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
161.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
161.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
161.17 - * version 2 for more details (a copy is included in the LICENSE file that
161.18 - * accompanied this code).
161.19 - *
161.20 - * You should have received a copy of the GNU General Public License version
161.21 - * 2 along with this work; if not, write to the Free Software Foundation,
161.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
161.23 - *
161.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
161.25 - * or visit www.oracle.com if you need additional information or have any
161.26 - * questions.
161.27 - */
161.28 -
161.29 -package sun.dyn;
161.30 -
161.31 -import sun.dyn.util.VerifyType;
161.32 -import sun.dyn.util.Wrapper;
161.33 -import java.dyn.*;
161.34 -import java.util.Arrays;
161.35 -import static sun.dyn.MethodHandleNatives.Constants.*;
161.36 -import static sun.dyn.MemberName.newIllegalArgumentException;
161.37 -
161.38 -/**
161.39 - * This method handle performs simple conversion or checking of a single argument.
161.40 - * @author jrose
161.41 - */
161.42 -public class AdapterMethodHandle extends BoundMethodHandle {
161.43 -
161.44 - //MethodHandle vmtarget; // next AMH or BMH in chain or final DMH
161.45 - //Object argument; // parameter to the conversion if needed
161.46 - //int vmargslot; // which argument slot is affected
161.47 - private final int conversion; // the type of conversion: RETYPE_ONLY, etc.
161.48 -
161.49 - // Constructors in this class *must* be package scoped or private.
161.50 - private AdapterMethodHandle(MethodHandle target, MethodType newType,
161.51 - long conv, Object convArg) {
161.52 - super(newType, convArg, newType.parameterSlotDepth(1+convArgPos(conv)));
161.53 - this.conversion = convCode(conv);
161.54 - if (MethodHandleNatives.JVM_SUPPORT) {
161.55 - // JVM might update VM-specific bits of conversion (ignore)
161.56 - MethodHandleNatives.init(this, target, convArgPos(conv));
161.57 - }
161.58 - }
161.59 - private AdapterMethodHandle(MethodHandle target, MethodType newType,
161.60 - long conv) {
161.61 - this(target, newType, conv, null);
161.62 - }
161.63 -
161.64 - private static final Access IMPL_TOKEN = Access.getToken();
161.65 -
161.66 - // TO DO: When adapting another MH with a null conversion, clone
161.67 - // the target and change its type, instead of adding another layer.
161.68 -
161.69 - /** Can a JVM-level adapter directly implement the proposed
161.70 - * argument conversions, as if by MethodHandles.convertArguments?
161.71 - */
161.72 - public static boolean canPairwiseConvert(MethodType newType, MethodType oldType) {
161.73 - // same number of args, of course
161.74 - int len = newType.parameterCount();
161.75 - if (len != oldType.parameterCount())
161.76 - return false;
161.77 -
161.78 - // Check return type. (Not much can be done with it.)
161.79 - Class<?> exp = newType.returnType();
161.80 - Class<?> ret = oldType.returnType();
161.81 - if (!VerifyType.isNullConversion(ret, exp))
161.82 - return false;
161.83 -
161.84 - // Check args pairwise.
161.85 - for (int i = 0; i < len; i++) {
161.86 - Class<?> src = newType.parameterType(i); // source type
161.87 - Class<?> dst = oldType.parameterType(i); // destination type
161.88 - if (!canConvertArgument(src, dst))
161.89 - return false;
161.90 - }
161.91 -
161.92 - return true;
161.93 - }
161.94 -
161.95 - /** Can a JVM-level adapter directly implement the proposed
161.96 - * argument conversion, as if by MethodHandles.convertArguments?
161.97 - */
161.98 - public static boolean canConvertArgument(Class<?> src, Class<?> dst) {
161.99 - // ? Retool this logic to use RETYPE_ONLY, CHECK_CAST, etc., as opcodes,
161.100 - // so we don't need to repeat so much decision making.
161.101 - if (VerifyType.isNullConversion(src, dst)) {
161.102 - return true;
161.103 - } else if (src.isPrimitive()) {
161.104 - if (dst.isPrimitive())
161.105 - return canPrimCast(src, dst);
161.106 - else
161.107 - return canBoxArgument(src, dst);
161.108 - } else {
161.109 - if (dst.isPrimitive())
161.110 - return canUnboxArgument(src, dst);
161.111 - else
161.112 - return true; // any two refs can be interconverted
161.113 - }
161.114 - }
161.115 -
161.116 - /**
161.117 - * Create a JVM-level adapter method handle to conform the given method
161.118 - * handle to the similar newType, using only pairwise argument conversions.
161.119 - * For each argument, convert incoming argument to the exact type needed.
161.120 - * Only null conversions are allowed on the return value (until
161.121 - * the JVM supports ricochet adapters).
161.122 - * The argument conversions allowed are casting, unboxing,
161.123 - * integral widening or narrowing, and floating point widening or narrowing.
161.124 - * @param token access check
161.125 - * @param newType required call type
161.126 - * @param target original method handle
161.127 - * @return an adapter to the original handle with the desired new type,
161.128 - * or the original target if the types are already identical
161.129 - * or null if the adaptation cannot be made
161.130 - */
161.131 - public static MethodHandle makePairwiseConvert(Access token,
161.132 - MethodType newType, MethodHandle target) {
161.133 - Access.check(token);
161.134 - MethodType oldType = target.type();
161.135 - if (newType == oldType) return target;
161.136 -
161.137 - if (!canPairwiseConvert(newType, oldType))
161.138 - return null;
161.139 - // (after this point, it is an assertion error to fail to convert)
161.140 -
161.141 - // Find last non-trivial conversion (if any).
161.142 - int lastConv = newType.parameterCount()-1;
161.143 - while (lastConv >= 0) {
161.144 - Class<?> src = newType.parameterType(lastConv); // source type
161.145 - Class<?> dst = oldType.parameterType(lastConv); // destination type
161.146 - if (VerifyType.isNullConversion(src, dst)) {
161.147 - --lastConv;
161.148 - } else {
161.149 - break;
161.150 - }
161.151 - }
161.152 - // Now build a chain of one or more adapters.
161.153 - MethodHandle adapter = target;
161.154 - MethodType midType = oldType.changeReturnType(newType.returnType());
161.155 - for (int i = 0; i <= lastConv; i++) {
161.156 - Class<?> src = newType.parameterType(i); // source type
161.157 - Class<?> dst = midType.parameterType(i); // destination type
161.158 - if (VerifyType.isNullConversion(src, dst)) {
161.159 - // do nothing: difference is trivial
161.160 - continue;
161.161 - }
161.162 - // Work the current type backward toward the desired caller type:
161.163 - if (i != lastConv) {
161.164 - midType = midType.changeParameterType(i, src);
161.165 - } else {
161.166 - // When doing the last (or only) real conversion,
161.167 - // force all remaining null conversions to happen also.
161.168 - assert(VerifyType.isNullConversion(newType, midType.changeParameterType(i, src)));
161.169 - midType = newType;
161.170 - }
161.171 -
161.172 - // Tricky case analysis follows.
161.173 - // It parallels canConvertArgument() above.
161.174 - if (src.isPrimitive()) {
161.175 - if (dst.isPrimitive()) {
161.176 - adapter = makePrimCast(token, midType, adapter, i, dst);
161.177 - } else {
161.178 - adapter = makeBoxArgument(token, midType, adapter, i, dst);
161.179 - }
161.180 - } else {
161.181 - if (dst.isPrimitive()) {
161.182 - // Caller has boxed a primitive. Unbox it for the target.
161.183 - // The box type must correspond exactly to the primitive type.
161.184 - // This is simpler than the powerful set of widening
161.185 - // conversions supported by reflect.Method.invoke.
161.186 - // Those conversions require a big nest of if/then/else logic,
161.187 - // which we prefer to make a user responsibility.
161.188 - adapter = makeUnboxArgument(token, midType, adapter, i, dst);
161.189 - } else {
161.190 - // Simple reference conversion.
161.191 - // Note: Do not check for a class hierarchy relation
161.192 - // between src and dst. In all cases a 'null' argument
161.193 - // will pass the cast conversion.
161.194 - adapter = makeCheckCast(token, midType, adapter, i, dst);
161.195 - }
161.196 - }
161.197 - assert(adapter != null);
161.198 - assert(adapter.type() == midType);
161.199 - }
161.200 - if (adapter.type() != newType) {
161.201 - // Only trivial conversions remain.
161.202 - adapter = makeRetypeOnly(IMPL_TOKEN, newType, adapter);
161.203 - assert(adapter != null);
161.204 - // Actually, that's because there were no non-trivial ones:
161.205 - assert(lastConv == -1);
161.206 - }
161.207 - assert(adapter.type() == newType);
161.208 - return adapter;
161.209 - }
161.210 -
161.211 - /**
161.212 - * Create a JVM-level adapter method handle to permute the arguments
161.213 - * of the given method.
161.214 - * @param token access check
161.215 - * @param newType required call type
161.216 - * @param target original method handle
161.217 - * @param argumentMap for each target argument, position of its source in newType
161.218 - * @return an adapter to the original handle with the desired new type,
161.219 - * or the original target if the types are already identical
161.220 - * and the permutation is null
161.221 - * @throws IllegalArgumentException if the adaptation cannot be made
161.222 - * directly by a JVM-level adapter, without help from Java code
161.223 - */
161.224 - public static MethodHandle makePermutation(Access token,
161.225 - MethodType newType, MethodHandle target,
161.226 - int[] argumentMap) {
161.227 - MethodType oldType = target.type();
161.228 - boolean nullPermutation = true;
161.229 - for (int i = 0; i < argumentMap.length; i++) {
161.230 - int pos = argumentMap[i];
161.231 - if (pos != i)
161.232 - nullPermutation = false;
161.233 - if (pos < 0 || pos >= newType.parameterCount()) {
161.234 - argumentMap = new int[0]; break;
161.235 - }
161.236 - }
161.237 - if (argumentMap.length != oldType.parameterCount())
161.238 - throw newIllegalArgumentException("bad permutation: "+Arrays.toString(argumentMap));
161.239 - if (nullPermutation) {
161.240 - MethodHandle res = makePairwiseConvert(token, newType, target);
161.241 - // well, that was easy
161.242 - if (res == null)
161.243 - throw newIllegalArgumentException("cannot convert pairwise: "+newType);
161.244 - return res;
161.245 - }
161.246 -
161.247 - // Check return type. (Not much can be done with it.)
161.248 - Class<?> exp = newType.returnType();
161.249 - Class<?> ret = oldType.returnType();
161.250 - if (!VerifyType.isNullConversion(ret, exp))
161.251 - throw newIllegalArgumentException("bad return conversion for "+newType);
161.252 -
161.253 - // See if the argument types match up.
161.254 - for (int i = 0; i < argumentMap.length; i++) {
161.255 - int j = argumentMap[i];
161.256 - Class<?> src = newType.parameterType(j);
161.257 - Class<?> dst = oldType.parameterType(i);
161.258 - if (!VerifyType.isNullConversion(src, dst))
161.259 - throw newIllegalArgumentException("bad argument #"+j+" conversion for "+newType);
161.260 - }
161.261 -
161.262 - // Now figure out a nice mix of SWAP, ROT, DUP, and DROP adapters.
161.263 - // A workable greedy algorithm is as follows:
161.264 - // Drop unused outgoing arguments (right to left: shallowest first).
161.265 - // Duplicate doubly-used outgoing arguments (left to right: deepest first).
161.266 - // Then the remaining problem is a true argument permutation.
161.267 - // Marshal the outgoing arguments as required from left to right.
161.268 - // That is, find the deepest outgoing stack position that does not yet
161.269 - // have the correct argument value, and correct at least that position
161.270 - // by swapping or rotating in the misplaced value (from a shallower place).
161.271 - // If the misplaced value is followed by one or more consecutive values
161.272 - // (also misplaced) issue a rotation which brings as many as possible
161.273 - // into position. Otherwise make progress with either a swap or a
161.274 - // rotation. Prefer the swap as cheaper, but do not use it if it
161.275 - // breaks a slot pair. Prefer the rotation over the swap if it would
161.276 - // preserve more consecutive values shallower than the target position.
161.277 - // When more than one rotation will work (because the required value
161.278 - // is already adjacent to the target position), then use a rotation
161.279 - // which moves the old value in the target position adjacent to
161.280 - // one of its consecutive values. Also, prefer shorter rotation
161.281 - // spans, since they use fewer memory cycles for shuffling.
161.282 -
161.283 - throw new UnsupportedOperationException("NYI");
161.284 - }
161.285 -
161.286 - private static byte basicType(Class<?> type) {
161.287 - if (type == null) return T_VOID;
161.288 - switch (Wrapper.forBasicType(type)) {
161.289 - case BOOLEAN: return T_BOOLEAN;
161.290 - case CHAR: return T_CHAR;
161.291 - case FLOAT: return T_FLOAT;
161.292 - case DOUBLE: return T_DOUBLE;
161.293 - case BYTE: return T_BYTE;
161.294 - case SHORT: return T_SHORT;
161.295 - case INT: return T_INT;
161.296 - case LONG: return T_LONG;
161.297 - case OBJECT: return T_OBJECT;
161.298 - case VOID: return T_VOID;
161.299 - }
161.300 - return 99; // T_ILLEGAL or some such
161.301 - }
161.302 -
161.303 - /** Number of stack slots for the given type.
161.304 - * Two for T_DOUBLE and T_FLOAT, one for the rest.
161.305 - */
161.306 - private static int type2size(int type) {
161.307 - assert(type >= T_BOOLEAN && type <= T_OBJECT);
161.308 - return (type == T_LONG || type == T_DOUBLE) ? 2 : 1;
161.309 - }
161.310 - private static int type2size(Class<?> type) {
161.311 - return type2size(basicType(type));
161.312 - }
161.313 -
161.314 - /** The given stackMove is the number of slots pushed.
161.315 - * It might be negative. Scale it (multiply) by the
161.316 - * VM's notion of how an address changes with a push,
161.317 - * to get the raw SP change for stackMove.
161.318 - * Then shift and mask it into the correct field.
161.319 - */
161.320 - private static long insertStackMove(int stackMove) {
161.321 - // following variable must be long to avoid sign extension after '<<'
161.322 - long spChange = stackMove * MethodHandleNatives.JVM_STACK_MOVE_UNIT;
161.323 - return (spChange & CONV_STACK_MOVE_MASK) << CONV_STACK_MOVE_SHIFT;
161.324 - }
161.325 -
161.326 - /** Construct an adapter conversion descriptor for a single-argument conversion. */
161.327 - private static long makeConv(int convOp, int argnum, int src, int dest) {
161.328 - assert(src == (src & 0xF));
161.329 - assert(dest == (dest & 0xF));
161.330 - assert(convOp >= OP_CHECK_CAST && convOp <= OP_PRIM_TO_REF);
161.331 - int stackMove = type2size(dest) - type2size(src);
161.332 - return ((long) argnum << 32 |
161.333 - (long) convOp << CONV_OP_SHIFT |
161.334 - (int) src << CONV_SRC_TYPE_SHIFT |
161.335 - (int) dest << CONV_DEST_TYPE_SHIFT |
161.336 - insertStackMove(stackMove)
161.337 - );
161.338 - }
161.339 - private static long makeConv(int convOp, int argnum, int stackMove) {
161.340 - assert(convOp >= OP_DUP_ARGS && convOp <= OP_SPREAD_ARGS);
161.341 - byte src = 0, dest = 0;
161.342 - if (convOp >= OP_COLLECT_ARGS && convOp <= OP_SPREAD_ARGS)
161.343 - src = dest = T_OBJECT;
161.344 - return ((long) argnum << 32 |
161.345 - (long) convOp << CONV_OP_SHIFT |
161.346 - (int) src << CONV_SRC_TYPE_SHIFT |
161.347 - (int) dest << CONV_DEST_TYPE_SHIFT |
161.348 - insertStackMove(stackMove)
161.349 - );
161.350 - }
161.351 - private static long makeSwapConv(int convOp, int srcArg, byte type, int destSlot) {
161.352 - assert(convOp >= OP_SWAP_ARGS && convOp <= OP_ROT_ARGS);
161.353 - return ((long) srcArg << 32 |
161.354 - (long) convOp << CONV_OP_SHIFT |
161.355 - (int) type << CONV_SRC_TYPE_SHIFT |
161.356 - (int) type << CONV_DEST_TYPE_SHIFT |
161.357 - (int) destSlot << CONV_VMINFO_SHIFT
161.358 - );
161.359 - }
161.360 - private static long makeConv(int convOp) {
161.361 - assert(convOp == OP_RETYPE_ONLY || convOp == OP_RETYPE_RAW);
161.362 - return ((long)-1 << 32) | (convOp << CONV_OP_SHIFT); // stackMove, src, dst all zero
161.363 - }
161.364 - private static int convCode(long conv) {
161.365 - return (int)conv;
161.366 - }
161.367 - private static int convArgPos(long conv) {
161.368 - return (int)(conv >>> 32);
161.369 - }
161.370 - private static boolean convOpSupported(int convOp) {
161.371 - assert(convOp >= 0 && convOp <= CONV_OP_LIMIT);
161.372 - return ((1<<convOp) & MethodHandleNatives.CONV_OP_IMPLEMENTED_MASK) != 0;
161.373 - }
161.374 -
161.375 - /** One of OP_RETYPE_ONLY, etc. */
161.376 - int conversionOp() { return (conversion & CONV_OP_MASK) >> CONV_OP_SHIFT; }
161.377 -
161.378 - /* Return one plus the position of the first non-trivial difference
161.379 - * between the given types. This is not a symmetric operation;
161.380 - * we are considering adapting the targetType to adapterType.
161.381 - * Trivial differences are those which could be ignored by the JVM
161.382 - * without subverting the verifier. Otherwise, adaptable differences
161.383 - * are ones for which we could create an adapter to make the type change.
161.384 - * Return zero if there are no differences (other than trivial ones).
161.385 - * Return 1+N if N is the only adaptable argument difference.
161.386 - * Return the -2-N where N is the first of several adaptable
161.387 - * argument differences.
161.388 - * Return -1 if there there are differences which are not adaptable.
161.389 - */
161.390 - private static int diffTypes(MethodType adapterType,
161.391 - MethodType targetType,
161.392 - boolean raw) {
161.393 - int diff;
161.394 - diff = diffReturnTypes(adapterType, targetType, raw);
161.395 - if (diff != 0) return diff;
161.396 - int nargs = adapterType.parameterCount();
161.397 - if (nargs != targetType.parameterCount())
161.398 - return -1;
161.399 - diff = diffParamTypes(adapterType, 0, targetType, 0, nargs, raw);
161.400 - //System.out.println("diff "+adapterType);
161.401 - //System.out.println(" "+diff+" "+targetType);
161.402 - return diff;
161.403 - }
161.404 - private static int diffReturnTypes(MethodType adapterType,
161.405 - MethodType targetType,
161.406 - boolean raw) {
161.407 - Class<?> src = targetType.returnType();
161.408 - Class<?> dst = adapterType.returnType();
161.409 - if ((!raw
161.410 - ? VerifyType.canPassUnchecked(src, dst)
161.411 - : VerifyType.canPassRaw(src, dst)
161.412 - ) > 0)
161.413 - return 0; // no significant difference
161.414 - if (raw && !src.isPrimitive() && !dst.isPrimitive())
161.415 - return 0; // can force a reference return (very carefully!)
161.416 - //if (false) return 1; // never adaptable!
161.417 - return -1; // some significant difference
161.418 - }
161.419 - private static int diffParamTypes(MethodType adapterType, int astart,
161.420 - MethodType targetType, int tstart,
161.421 - int nargs, boolean raw) {
161.422 - assert(nargs >= 0);
161.423 - int res = 0;
161.424 - for (int i = 0; i < nargs; i++) {
161.425 - Class<?> src = adapterType.parameterType(astart+i);
161.426 - Class<?> dest = targetType.parameterType(tstart+i);
161.427 - if ((!raw
161.428 - ? VerifyType.canPassUnchecked(src, dest)
161.429 - : VerifyType.canPassRaw(src, dest)
161.430 - ) <= 0) {
161.431 - // found a difference; is it the only one so far?
161.432 - if (res != 0)
161.433 - return -1-res; // return -2-i for prev. i
161.434 - res = 1+i;
161.435 - }
161.436 - }
161.437 - return res;
161.438 - }
161.439 -
161.440 - /** Can a retyping adapter (alone) validly convert the target to newType? */
161.441 - public static boolean canRetypeOnly(MethodType newType, MethodType targetType) {
161.442 - return canRetype(newType, targetType, false);
161.443 - }
161.444 - /** Can a retyping adapter (alone) convert the target to newType?
161.445 - * It is allowed to widen subword types and void to int, to make bitwise
161.446 - * conversions between float/int and double/long, and to perform unchecked
161.447 - * reference conversions on return. This last feature requires that the
161.448 - * caller be trusted, and perform explicit cast conversions on return values.
161.449 - */
161.450 - public static boolean canRetypeRaw(MethodType newType, MethodType targetType) {
161.451 - return canRetype(newType, targetType, true);
161.452 - }
161.453 - static boolean canRetype(MethodType newType, MethodType targetType, boolean raw) {
161.454 - if (!convOpSupported(raw ? OP_RETYPE_RAW : OP_RETYPE_ONLY)) return false;
161.455 - int diff = diffTypes(newType, targetType, raw);
161.456 - // %%% This assert is too strong. Factor diff into VerifyType and reconcile.
161.457 - assert(raw || (diff == 0) == VerifyType.isNullConversion(newType, targetType));
161.458 - return diff == 0;
161.459 - }
161.460 -
161.461 - /** Factory method: Performs no conversions; simply retypes the adapter.
161.462 - * Allows unchecked argument conversions pairwise, if they are safe.
161.463 - * Returns null if not possible.
161.464 - */
161.465 - public static MethodHandle makeRetypeOnly(Access token,
161.466 - MethodType newType, MethodHandle target) {
161.467 - return makeRetype(token, newType, target, false);
161.468 - }
161.469 - public static MethodHandle makeRetypeRaw(Access token,
161.470 - MethodType newType, MethodHandle target) {
161.471 - return makeRetype(token, newType, target, true);
161.472 - }
161.473 - static MethodHandle makeRetype(Access token,
161.474 - MethodType newType, MethodHandle target, boolean raw) {
161.475 - Access.check(token);
161.476 - MethodType oldType = target.type();
161.477 - if (oldType == newType) return target;
161.478 - if (!canRetype(newType, oldType, raw))
161.479 - return null;
161.480 - // TO DO: clone the target guy, whatever he is, with new type.
161.481 - return new AdapterMethodHandle(target, newType, makeConv(raw ? OP_RETYPE_RAW : OP_RETYPE_ONLY));
161.482 - }
161.483 -
161.484 - static MethodHandle makeVarargsCollector(Access token,
161.485 - MethodHandle target, Class<?> arrayType) {
161.486 - Access.check(token);
161.487 - return new AsVarargsCollector(target, arrayType);
161.488 - }
161.489 -
161.490 - static class AsVarargsCollector extends AdapterMethodHandle {
161.491 - final MethodHandle target;
161.492 - final Class<?> arrayType;
161.493 - MethodHandle cache;
161.494 -
161.495 - AsVarargsCollector(MethodHandle target, Class<?> arrayType) {
161.496 - super(target, target.type(), makeConv(OP_RETYPE_ONLY));
161.497 - this.target = target;
161.498 - this.arrayType = arrayType;
161.499 - this.cache = target.asCollector(arrayType, 0);
161.500 - }
161.501 -
161.502 - @Override
161.503 - public boolean isVarargsCollector() {
161.504 - return true;
161.505 - }
161.506 -
161.507 - @Override
161.508 - public MethodHandle asType(MethodType newType) {
161.509 - MethodType type = this.type();
161.510 - int collectArg = type.parameterCount() - 1;
161.511 - int newArity = newType.parameterCount();
161.512 - if (newArity == collectArg+1 &&
161.513 - type.parameterType(collectArg).isAssignableFrom(newType.parameterType(collectArg))) {
161.514 - // if arity and trailing parameter are compatible, do normal thing
161.515 - return super.asType(newType);
161.516 - }
161.517 - // check cache
161.518 - if (cache.type().parameterCount() == newArity)
161.519 - return cache.asType(newType);
161.520 - // build and cache a collector
161.521 - int arrayLength = newArity - collectArg;
161.522 - MethodHandle collector;
161.523 - try {
161.524 - collector = target.asCollector(arrayType, arrayLength);
161.525 - } catch (IllegalArgumentException ex) {
161.526 - throw new WrongMethodTypeException("cannot build collector");
161.527 - }
161.528 - cache = collector;
161.529 - return collector.asType(newType);
161.530 - }
161.531 -
161.532 - public MethodHandle asVarargsCollector(Class<?> arrayType) {
161.533 - MethodType type = this.type();
161.534 - if (type.parameterType(type.parameterCount()-1) == arrayType)
161.535 - return this;
161.536 - return super.asVarargsCollector(arrayType);
161.537 - }
161.538 - }
161.539 -
161.540 - /** Can a checkcast adapter validly convert the target to newType?
161.541 - * The JVM supports all kind of reference casts, even silly ones.
161.542 - */
161.543 - public static boolean canCheckCast(MethodType newType, MethodType targetType,
161.544 - int arg, Class<?> castType) {
161.545 - if (!convOpSupported(OP_CHECK_CAST)) return false;
161.546 - Class<?> src = newType.parameterType(arg);
161.547 - Class<?> dst = targetType.parameterType(arg);
161.548 - if (!canCheckCast(src, castType)
161.549 - || !VerifyType.isNullConversion(castType, dst))
161.550 - return false;
161.551 - int diff = diffTypes(newType, targetType, false);
161.552 - return (diff == arg+1); // arg is sole non-trivial diff
161.553 - }
161.554 - /** Can an primitive conversion adapter validly convert src to dst? */
161.555 - public static boolean canCheckCast(Class<?> src, Class<?> dst) {
161.556 - return (!src.isPrimitive() && !dst.isPrimitive());
161.557 - }
161.558 -
161.559 - /** Factory method: Forces a cast at the given argument.
161.560 - * The castType is the target of the cast, and can be any type
161.561 - * with a null conversion to the corresponding target parameter.
161.562 - * Return null if this cannot be done.
161.563 - */
161.564 - public static MethodHandle makeCheckCast(Access token,
161.565 - MethodType newType, MethodHandle target,
161.566 - int arg, Class<?> castType) {
161.567 - Access.check(token);
161.568 - if (!canCheckCast(newType, target.type(), arg, castType))
161.569 - return null;
161.570 - long conv = makeConv(OP_CHECK_CAST, arg, T_OBJECT, T_OBJECT);
161.571 - return new AdapterMethodHandle(target, newType, conv, castType);
161.572 - }
161.573 -
161.574 - /** Can an primitive conversion adapter validly convert the target to newType?
161.575 - * The JVM currently supports all conversions except those between
161.576 - * floating and integral types.
161.577 - */
161.578 - public static boolean canPrimCast(MethodType newType, MethodType targetType,
161.579 - int arg, Class<?> convType) {
161.580 - if (!convOpSupported(OP_PRIM_TO_PRIM)) return false;
161.581 - Class<?> src = newType.parameterType(arg);
161.582 - Class<?> dst = targetType.parameterType(arg);
161.583 - if (!canPrimCast(src, convType)
161.584 - || !VerifyType.isNullConversion(convType, dst))
161.585 - return false;
161.586 - int diff = diffTypes(newType, targetType, false);
161.587 - return (diff == arg+1); // arg is sole non-trivial diff
161.588 - }
161.589 - /** Can an primitive conversion adapter validly convert src to dst? */
161.590 - public static boolean canPrimCast(Class<?> src, Class<?> dst) {
161.591 - if (src == dst || !src.isPrimitive() || !dst.isPrimitive()) {
161.592 - return false;
161.593 - } else if (Wrapper.forPrimitiveType(dst).isFloating()) {
161.594 - // both must be floating types
161.595 - return Wrapper.forPrimitiveType(src).isFloating();
161.596 - } else {
161.597 - // both are integral, and all combinations work fine
161.598 - assert(Wrapper.forPrimitiveType(src).isIntegral() &&
161.599 - Wrapper.forPrimitiveType(dst).isIntegral());
161.600 - return true;
161.601 - }
161.602 - }
161.603 -
161.604 - /** Factory method: Truncate the given argument with zero or sign extension,
161.605 - * and/or convert between single and doubleword versions of integer or float.
161.606 - * The convType is the target of the conversion, and can be any type
161.607 - * with a null conversion to the corresponding target parameter.
161.608 - * Return null if this cannot be done.
161.609 - */
161.610 - public static MethodHandle makePrimCast(Access token,
161.611 - MethodType newType, MethodHandle target,
161.612 - int arg, Class<?> convType) {
161.613 - Access.check(token);
161.614 - MethodType oldType = target.type();
161.615 - if (!canPrimCast(newType, oldType, arg, convType))
161.616 - return null;
161.617 - Class<?> src = newType.parameterType(arg);
161.618 - long conv = makeConv(OP_PRIM_TO_PRIM, arg, basicType(src), basicType(convType));
161.619 - return new AdapterMethodHandle(target, newType, conv);
161.620 - }
161.621 -
161.622 - /** Can an unboxing conversion validly convert src to dst?
161.623 - * The JVM currently supports all kinds of casting and unboxing.
161.624 - * The convType is the unboxed type; it can be either a primitive or wrapper.
161.625 - */
161.626 - public static boolean canUnboxArgument(MethodType newType, MethodType targetType,
161.627 - int arg, Class<?> convType) {
161.628 - if (!convOpSupported(OP_REF_TO_PRIM)) return false;
161.629 - Class<?> src = newType.parameterType(arg);
161.630 - Class<?> dst = targetType.parameterType(arg);
161.631 - Class<?> boxType = Wrapper.asWrapperType(convType);
161.632 - convType = Wrapper.asPrimitiveType(convType);
161.633 - if (!canCheckCast(src, boxType)
161.634 - || boxType == convType
161.635 - || !VerifyType.isNullConversion(convType, dst))
161.636 - return false;
161.637 - int diff = diffTypes(newType, targetType, false);
161.638 - return (diff == arg+1); // arg is sole non-trivial diff
161.639 - }
161.640 - /** Can an primitive unboxing adapter validly convert src to dst? */
161.641 - public static boolean canUnboxArgument(Class<?> src, Class<?> dst) {
161.642 - return (!src.isPrimitive() && Wrapper.asPrimitiveType(dst).isPrimitive());
161.643 - }
161.644 -
161.645 - /** Factory method: Unbox the given argument.
161.646 - * Return null if this cannot be done.
161.647 - */
161.648 - public static MethodHandle makeUnboxArgument(Access token,
161.649 - MethodType newType, MethodHandle target,
161.650 - int arg, Class<?> convType) {
161.651 - MethodType oldType = target.type();
161.652 - Class<?> src = newType.parameterType(arg);
161.653 - Class<?> dst = oldType.parameterType(arg);
161.654 - Class<?> boxType = Wrapper.asWrapperType(convType);
161.655 - Class<?> primType = Wrapper.asPrimitiveType(convType);
161.656 - if (!canUnboxArgument(newType, oldType, arg, convType))
161.657 - return null;
161.658 - MethodType castDone = newType;
161.659 - if (!VerifyType.isNullConversion(src, boxType))
161.660 - castDone = newType.changeParameterType(arg, boxType);
161.661 - long conv = makeConv(OP_REF_TO_PRIM, arg, T_OBJECT, basicType(primType));
161.662 - MethodHandle adapter = new AdapterMethodHandle(target, castDone, conv, boxType);
161.663 - if (castDone == newType)
161.664 - return adapter;
161.665 - return makeCheckCast(token, newType, adapter, arg, boxType);
161.666 - }
161.667 -
161.668 - /** Can an primitive boxing adapter validly convert src to dst? */
161.669 - public static boolean canBoxArgument(Class<?> src, Class<?> dst) {
161.670 - if (!convOpSupported(OP_PRIM_TO_REF)) return false;
161.671 - throw new UnsupportedOperationException("NYI");
161.672 - }
161.673 -
161.674 - /** Factory method: Unbox the given argument.
161.675 - * Return null if this cannot be done.
161.676 - */
161.677 - public static MethodHandle makeBoxArgument(Access token,
161.678 - MethodType newType, MethodHandle target,
161.679 - int arg, Class<?> convType) {
161.680 - // this is difficult to do in the JVM because it must GC
161.681 - return null;
161.682 - }
161.683 -
161.684 - /** Can an adapter simply drop arguments to convert the target to newType? */
161.685 - public static boolean canDropArguments(MethodType newType, MethodType targetType,
161.686 - int dropArgPos, int dropArgCount) {
161.687 - if (dropArgCount == 0)
161.688 - return canRetypeOnly(newType, targetType);
161.689 - if (!convOpSupported(OP_DROP_ARGS)) return false;
161.690 - if (diffReturnTypes(newType, targetType, false) != 0)
161.691 - return false;
161.692 - int nptypes = newType.parameterCount();
161.693 - // parameter types must be the same up to the drop point
161.694 - if (dropArgPos != 0 && diffParamTypes(newType, 0, targetType, 0, dropArgPos, false) != 0)
161.695 - return false;
161.696 - int afterPos = dropArgPos + dropArgCount;
161.697 - int afterCount = nptypes - afterPos;
161.698 - if (dropArgPos < 0 || dropArgPos >= nptypes ||
161.699 - dropArgCount < 1 || afterPos > nptypes ||
161.700 - targetType.parameterCount() != nptypes - dropArgCount)
161.701 - return false;
161.702 - // parameter types after the drop point must also be the same
161.703 - if (afterCount != 0 && diffParamTypes(newType, afterPos, targetType, dropArgPos, afterCount, false) != 0)
161.704 - return false;
161.705 - return true;
161.706 - }
161.707 -
161.708 - /** Factory method: Drop selected arguments.
161.709 - * Allow unchecked retyping of remaining arguments, pairwise.
161.710 - * Return null if this is not possible.
161.711 - */
161.712 - public static MethodHandle makeDropArguments(Access token,
161.713 - MethodType newType, MethodHandle target,
161.714 - int dropArgPos, int dropArgCount) {
161.715 - Access.check(token);
161.716 - if (dropArgCount == 0)
161.717 - return makeRetypeOnly(IMPL_TOKEN, newType, target);
161.718 - if (!canDropArguments(newType, target.type(), dropArgPos, dropArgCount))
161.719 - return null;
161.720 - // in arglist: [0: ...keep1 | dpos: drop... | dpos+dcount: keep2... ]
161.721 - // out arglist: [0: ...keep1 | dpos: keep2... ]
161.722 - int keep2InPos = dropArgPos + dropArgCount;
161.723 - int dropSlot = newType.parameterSlotDepth(keep2InPos);
161.724 - int keep1InSlot = newType.parameterSlotDepth(dropArgPos);
161.725 - int slotCount = keep1InSlot - dropSlot;
161.726 - assert(slotCount >= dropArgCount);
161.727 - assert(target.type().parameterSlotCount() + slotCount == newType.parameterSlotCount());
161.728 - long conv = makeConv(OP_DROP_ARGS, dropArgPos + dropArgCount - 1, -slotCount);
161.729 - return new AdapterMethodHandle(target, newType, conv);
161.730 - }
161.731 -
161.732 - /** Can an adapter duplicate an argument to convert the target to newType? */
161.733 - public static boolean canDupArguments(MethodType newType, MethodType targetType,
161.734 - int dupArgPos, int dupArgCount) {
161.735 - if (!convOpSupported(OP_DUP_ARGS)) return false;
161.736 - if (diffReturnTypes(newType, targetType, false) != 0)
161.737 - return false;
161.738 - int nptypes = newType.parameterCount();
161.739 - if (dupArgCount < 0 || dupArgPos + dupArgCount > nptypes)
161.740 - return false;
161.741 - if (targetType.parameterCount() != nptypes + dupArgCount)
161.742 - return false;
161.743 - // parameter types must be the same up to the duplicated arguments
161.744 - if (diffParamTypes(newType, 0, targetType, 0, nptypes, false) != 0)
161.745 - return false;
161.746 - // duplicated types must be, well, duplicates
161.747 - if (diffParamTypes(newType, dupArgPos, targetType, nptypes, dupArgCount, false) != 0)
161.748 - return false;
161.749 - return true;
161.750 - }
161.751 -
161.752 - /** Factory method: Duplicate the selected argument.
161.753 - * Return null if this is not possible.
161.754 - */
161.755 - public static MethodHandle makeDupArguments(Access token,
161.756 - MethodType newType, MethodHandle target,
161.757 - int dupArgPos, int dupArgCount) {
161.758 - Access.check(token);
161.759 - if (!canDupArguments(newType, target.type(), dupArgPos, dupArgCount))
161.760 - return null;
161.761 - if (dupArgCount == 0)
161.762 - return target;
161.763 - // in arglist: [0: ...keep1 | dpos: dup... | dpos+dcount: keep2... ]
161.764 - // out arglist: [0: ...keep1 | dpos: dup... | dpos+dcount: keep2... | dup... ]
161.765 - int keep2InPos = dupArgPos + dupArgCount;
161.766 - int dupSlot = newType.parameterSlotDepth(keep2InPos);
161.767 - int keep1InSlot = newType.parameterSlotDepth(dupArgPos);
161.768 - int slotCount = keep1InSlot - dupSlot;
161.769 - assert(target.type().parameterSlotCount() - slotCount == newType.parameterSlotCount());
161.770 - long conv = makeConv(OP_DUP_ARGS, dupArgPos + dupArgCount - 1, slotCount);
161.771 - return new AdapterMethodHandle(target, newType, conv);
161.772 - }
161.773 -
161.774 - /** Can an adapter swap two arguments to convert the target to newType? */
161.775 - public static boolean canSwapArguments(MethodType newType, MethodType targetType,
161.776 - int swapArg1, int swapArg2) {
161.777 - if (!convOpSupported(OP_SWAP_ARGS)) return false;
161.778 - if (diffReturnTypes(newType, targetType, false) != 0)
161.779 - return false;
161.780 - if (swapArg1 >= swapArg2) return false; // caller resp
161.781 - int nptypes = newType.parameterCount();
161.782 - if (targetType.parameterCount() != nptypes)
161.783 - return false;
161.784 - if (swapArg1 < 0 || swapArg2 >= nptypes)
161.785 - return false;
161.786 - if (diffParamTypes(newType, 0, targetType, 0, swapArg1, false) != 0)
161.787 - return false;
161.788 - if (diffParamTypes(newType, swapArg1, targetType, swapArg2, 1, false) != 0)
161.789 - return false;
161.790 - if (diffParamTypes(newType, swapArg1+1, targetType, swapArg1+1, swapArg2-swapArg1-1, false) != 0)
161.791 - return false;
161.792 - if (diffParamTypes(newType, swapArg2, targetType, swapArg1, 1, false) != 0)
161.793 - return false;
161.794 - if (diffParamTypes(newType, swapArg2+1, targetType, swapArg2+1, nptypes-swapArg2-1, false) != 0)
161.795 - return false;
161.796 - return true;
161.797 - }
161.798 -
161.799 - /** Factory method: Swap the selected arguments.
161.800 - * Return null if this is not possible.
161.801 - */
161.802 - public static MethodHandle makeSwapArguments(Access token,
161.803 - MethodType newType, MethodHandle target,
161.804 - int swapArg1, int swapArg2) {
161.805 - Access.check(token);
161.806 - if (swapArg1 == swapArg2)
161.807 - return target;
161.808 - if (swapArg1 > swapArg2) { int t = swapArg1; swapArg1 = swapArg2; swapArg2 = t; }
161.809 - if (!canSwapArguments(newType, target.type(), swapArg1, swapArg2))
161.810 - return null;
161.811 - Class<?> swapType = newType.parameterType(swapArg1);
161.812 - // in arglist: [0: ...keep1 | pos1: a1 | pos1+1: keep2... | pos2: a2 | pos2+1: keep3... ]
161.813 - // out arglist: [0: ...keep1 | pos1: a2 | pos1+1: keep2... | pos2: a1 | pos2+1: keep3... ]
161.814 - int swapSlot2 = newType.parameterSlotDepth(swapArg2 + 1);
161.815 - long conv = makeSwapConv(OP_SWAP_ARGS, swapArg1, basicType(swapType), swapSlot2);
161.816 - return new AdapterMethodHandle(target, newType, conv);
161.817 - }
161.818 -
161.819 - static int positiveRotation(int argCount, int rotateBy) {
161.820 - assert(argCount > 0);
161.821 - if (rotateBy >= 0) {
161.822 - if (rotateBy < argCount)
161.823 - return rotateBy;
161.824 - return rotateBy % argCount;
161.825 - } else if (rotateBy >= -argCount) {
161.826 - return rotateBy + argCount;
161.827 - } else {
161.828 - return (-1-((-1-rotateBy) % argCount)) + argCount;
161.829 - }
161.830 - }
161.831 -
161.832 - final static int MAX_ARG_ROTATION = 1;
161.833 -
161.834 - /** Can an adapter rotate arguments to convert the target to newType? */
161.835 - public static boolean canRotateArguments(MethodType newType, MethodType targetType,
161.836 - int firstArg, int argCount, int rotateBy) {
161.837 - if (!convOpSupported(OP_ROT_ARGS)) return false;
161.838 - if (argCount <= 2) return false; // must be a swap, not a rotate
161.839 - rotateBy = positiveRotation(argCount, rotateBy);
161.840 - if (rotateBy == 0) return false; // no rotation
161.841 - if (rotateBy > MAX_ARG_ROTATION && rotateBy < argCount - MAX_ARG_ROTATION)
161.842 - return false; // too many argument positions
161.843 - // Rotate incoming args right N to the out args, N in 1..(argCouunt-1).
161.844 - if (diffReturnTypes(newType, targetType, false) != 0)
161.845 - return false;
161.846 - int nptypes = newType.parameterCount();
161.847 - if (targetType.parameterCount() != nptypes)
161.848 - return false;
161.849 - if (firstArg < 0 || firstArg >= nptypes) return false;
161.850 - int argLimit = firstArg + argCount;
161.851 - if (argLimit > nptypes) return false;
161.852 - if (diffParamTypes(newType, 0, targetType, 0, firstArg, false) != 0)
161.853 - return false;
161.854 - int newChunk1 = argCount - rotateBy, newChunk2 = rotateBy;
161.855 - // swap new chunk1 with target chunk2
161.856 - if (diffParamTypes(newType, firstArg, targetType, argLimit-newChunk1, newChunk1, false) != 0)
161.857 - return false;
161.858 - // swap new chunk2 with target chunk1
161.859 - if (diffParamTypes(newType, firstArg+newChunk1, targetType, firstArg, newChunk2, false) != 0)
161.860 - return false;
161.861 - return true;
161.862 - }
161.863 -
161.864 - /** Factory method: Rotate the selected argument range.
161.865 - * Return null if this is not possible.
161.866 - */
161.867 - public static MethodHandle makeRotateArguments(Access token,
161.868 - MethodType newType, MethodHandle target,
161.869 - int firstArg, int argCount, int rotateBy) {
161.870 - Access.check(token);
161.871 - rotateBy = positiveRotation(argCount, rotateBy);
161.872 - if (!canRotateArguments(newType, target.type(), firstArg, argCount, rotateBy))
161.873 - return null;
161.874 - // Decide whether it should be done as a right or left rotation,
161.875 - // on the JVM stack. Return the number of stack slots to rotate by,
161.876 - // positive if right, negative if left.
161.877 - int limit = firstArg + argCount;
161.878 - int depth0 = newType.parameterSlotDepth(firstArg);
161.879 - int depth1 = newType.parameterSlotDepth(limit-rotateBy);
161.880 - int depth2 = newType.parameterSlotDepth(limit);
161.881 - int chunk1Slots = depth0 - depth1; assert(chunk1Slots > 0);
161.882 - int chunk2Slots = depth1 - depth2; assert(chunk2Slots > 0);
161.883 - // From here on out, it assumes a single-argument shift.
161.884 - assert(MAX_ARG_ROTATION == 1);
161.885 - int srcArg, dstArg;
161.886 - byte basicType;
161.887 - if (chunk2Slots <= chunk1Slots) {
161.888 - // Rotate right/down N (rotateBy = +N, N small, c2 small):
161.889 - // in arglist: [0: ...keep1 | arg1: c1... | limit-N: c2 | limit: keep2... ]
161.890 - // out arglist: [0: ...keep1 | arg1: c2 | arg1+N: c1... | limit: keep2... ]
161.891 - srcArg = limit-1;
161.892 - dstArg = firstArg;
161.893 - basicType = basicType(newType.parameterType(srcArg));
161.894 - assert(chunk2Slots == type2size(basicType));
161.895 - } else {
161.896 - // Rotate left/up N (rotateBy = -N, N small, c1 small):
161.897 - // in arglist: [0: ...keep1 | arg1: c1 | arg1+N: c2... | limit: keep2... ]
161.898 - // out arglist: [0: ...keep1 | arg1: c2 ... | limit-N: c1 | limit: keep2... ]
161.899 - srcArg = firstArg;
161.900 - dstArg = limit-1;
161.901 - basicType = basicType(newType.parameterType(srcArg));
161.902 - assert(chunk1Slots == type2size(basicType));
161.903 - }
161.904 - int dstSlot = newType.parameterSlotDepth(dstArg + 1);
161.905 - long conv = makeSwapConv(OP_ROT_ARGS, srcArg, basicType, dstSlot);
161.906 - return new AdapterMethodHandle(target, newType, conv);
161.907 - }
161.908 -
161.909 - /** Can an adapter spread an argument to convert the target to newType? */
161.910 - public static boolean canSpreadArguments(MethodType newType, MethodType targetType,
161.911 - Class<?> spreadArgType, int spreadArgPos, int spreadArgCount) {
161.912 - if (!convOpSupported(OP_SPREAD_ARGS)) return false;
161.913 - if (diffReturnTypes(newType, targetType, false) != 0)
161.914 - return false;
161.915 - int nptypes = newType.parameterCount();
161.916 - // parameter types must be the same up to the spread point
161.917 - if (spreadArgPos != 0 && diffParamTypes(newType, 0, targetType, 0, spreadArgPos, false) != 0)
161.918 - return false;
161.919 - int afterPos = spreadArgPos + spreadArgCount;
161.920 - int afterCount = nptypes - (spreadArgPos + 1);
161.921 - if (spreadArgPos < 0 || spreadArgPos >= nptypes ||
161.922 - spreadArgCount < 0 ||
161.923 - targetType.parameterCount() != afterPos + afterCount)
161.924 - return false;
161.925 - // parameter types after the spread point must also be the same
161.926 - if (afterCount != 0 && diffParamTypes(newType, spreadArgPos+1, targetType, afterPos, afterCount, false) != 0)
161.927 - return false;
161.928 - // match the array element type to the spread arg types
161.929 - Class<?> rawSpreadArgType = newType.parameterType(spreadArgPos);
161.930 - if (rawSpreadArgType != spreadArgType && !canCheckCast(rawSpreadArgType, spreadArgType))
161.931 - return false;
161.932 - for (int i = 0; i < spreadArgCount; i++) {
161.933 - Class<?> src = VerifyType.spreadArgElementType(spreadArgType, i);
161.934 - Class<?> dst = targetType.parameterType(spreadArgPos + i);
161.935 - if (src == null || !VerifyType.isNullConversion(src, dst))
161.936 - return false;
161.937 - }
161.938 - return true;
161.939 - }
161.940 -
161.941 -
161.942 - /** Factory method: Spread selected argument. */
161.943 - public static MethodHandle makeSpreadArguments(Access token,
161.944 - MethodType newType, MethodHandle target,
161.945 - Class<?> spreadArgType, int spreadArgPos, int spreadArgCount) {
161.946 - Access.check(token);
161.947 - MethodType targetType = target.type();
161.948 - if (!canSpreadArguments(newType, targetType, spreadArgType, spreadArgPos, spreadArgCount))
161.949 - return null;
161.950 - // in arglist: [0: ...keep1 | spos: spreadArg | spos+1: keep2... ]
161.951 - // out arglist: [0: ...keep1 | spos: spread... | spos+scount: keep2... ]
161.952 - int keep2OutPos = spreadArgPos + spreadArgCount;
161.953 - int spreadSlot = targetType.parameterSlotDepth(keep2OutPos);
161.954 - int keep1OutSlot = targetType.parameterSlotDepth(spreadArgPos);
161.955 - int slotCount = keep1OutSlot - spreadSlot;
161.956 - assert(spreadSlot == newType.parameterSlotDepth(spreadArgPos+1));
161.957 - assert(slotCount >= spreadArgCount);
161.958 - long conv = makeConv(OP_SPREAD_ARGS, spreadArgPos, slotCount-1);
161.959 - MethodHandle res = new AdapterMethodHandle(target, newType, conv, spreadArgType);
161.960 - assert(res.type().parameterType(spreadArgPos) == spreadArgType);
161.961 - return res;
161.962 - }
161.963 -
161.964 - // TO DO: makeCollectArguments, makeFlyby, makeRicochet
161.965 -
161.966 - @Override
161.967 - public String toString() {
161.968 - return MethodHandleImpl.getNameString(IMPL_TOKEN, nonAdapter((MethodHandle)vmtarget), this);
161.969 - }
161.970 -
161.971 - private static MethodHandle nonAdapter(MethodHandle mh) {
161.972 - while (mh instanceof AdapterMethodHandle) {
161.973 - mh = (MethodHandle) mh.vmtarget;
161.974 - }
161.975 - return mh;
161.976 - }
161.977 -}
162.1 --- a/src/share/classes/sun/dyn/BoundMethodHandle.java Tue Mar 29 11:29:01 2011 -0700
162.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
162.3 @@ -1,204 +0,0 @@
162.4 -/*
162.5 - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
162.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
162.7 - *
162.8 - * This code is free software; you can redistribute it and/or modify it
162.9 - * under the terms of the GNU General Public License version 2 only, as
162.10 - * published by the Free Software Foundation. Oracle designates this
162.11 - * particular file as subject to the "Classpath" exception as provided
162.12 - * by Oracle in the LICENSE file that accompanied this code.
162.13 - *
162.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
162.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
162.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
162.17 - * version 2 for more details (a copy is included in the LICENSE file that
162.18 - * accompanied this code).
162.19 - *
162.20 - * You should have received a copy of the GNU General Public License version
162.21 - * 2 along with this work; if not, write to the Free Software Foundation,
162.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
162.23 - *
162.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
162.25 - * or visit www.oracle.com if you need additional information or have any
162.26 - * questions.
162.27 - */
162.28 -
162.29 -package sun.dyn;
162.30 -
162.31 -import sun.dyn.util.VerifyType;
162.32 -import sun.dyn.util.Wrapper;
162.33 -import java.dyn.*;
162.34 -import java.util.List;
162.35 -import sun.dyn.MethodHandleNatives.Constants;
162.36 -import static sun.dyn.MethodHandleImpl.IMPL_LOOKUP;
162.37 -import static sun.dyn.MemberName.newIllegalArgumentException;
162.38 -
162.39 -/**
162.40 - * The flavor of method handle which emulates an invoke instruction
162.41 - * on a predetermined argument. The JVM dispatches to the correct method
162.42 - * when the handle is created, not when it is invoked.
162.43 - * @author jrose
162.44 - */
162.45 -public class BoundMethodHandle extends MethodHandle {
162.46 - //MethodHandle vmtarget; // next BMH or final DMH or methodOop
162.47 - private final Object argument; // argument to insert
162.48 - private final int vmargslot; // position at which it is inserted
162.49 -
162.50 - private static final Access IMPL_TOKEN = Access.getToken();
162.51 - private static final MemberName.Factory IMPL_NAMES = MemberName.getFactory(IMPL_TOKEN);
162.52 -
162.53 - // Constructors in this class *must* be package scoped or private.
162.54 -
162.55 - /** Bind a direct MH to its receiver (or first ref. argument).
162.56 - * The JVM will pre-dispatch the MH if it is not already static.
162.57 - */
162.58 - BoundMethodHandle(DirectMethodHandle mh, Object argument) {
162.59 - super(Access.TOKEN, mh.type().dropParameterTypes(0, 1));
162.60 - // check the type now, once for all:
162.61 - this.argument = checkReferenceArgument(argument, mh, 0);
162.62 - this.vmargslot = this.type().parameterSlotCount();
162.63 - if (MethodHandleNatives.JVM_SUPPORT) {
162.64 - this.vmtarget = null; // maybe updated by JVM
162.65 - MethodHandleNatives.init(this, mh, 0);
162.66 - } else {
162.67 - this.vmtarget = mh;
162.68 - }
162.69 - }
162.70 -
162.71 - /** Insert an argument into an arbitrary method handle.
162.72 - * If argnum is zero, inserts the first argument, etc.
162.73 - * The argument type must be a reference.
162.74 - */
162.75 - BoundMethodHandle(MethodHandle mh, Object argument, int argnum) {
162.76 - this(mh.type().dropParameterTypes(argnum, argnum+1),
162.77 - mh, argument, argnum);
162.78 - }
162.79 -
162.80 - /** Insert an argument into an arbitrary method handle.
162.81 - * If argnum is zero, inserts the first argument, etc.
162.82 - */
162.83 - BoundMethodHandle(MethodType type, MethodHandle mh, Object argument, int argnum) {
162.84 - super(Access.TOKEN, type);
162.85 - if (mh.type().parameterType(argnum).isPrimitive())
162.86 - this.argument = bindPrimitiveArgument(argument, mh, argnum);
162.87 - else {
162.88 - this.argument = checkReferenceArgument(argument, mh, argnum);
162.89 - }
162.90 - this.vmargslot = type.parameterSlotDepth(argnum);
162.91 - initTarget(mh, argnum);
162.92 - }
162.93 -
162.94 - private void initTarget(MethodHandle mh, int argnum) {
162.95 - if (MethodHandleNatives.JVM_SUPPORT) {
162.96 - this.vmtarget = null; // maybe updated by JVM
162.97 - MethodHandleNatives.init(this, mh, argnum);
162.98 - } else {
162.99 - this.vmtarget = mh;
162.100 - }
162.101 - }
162.102 -
162.103 - /** For the AdapterMethodHandle subclass.
162.104 - */
162.105 - BoundMethodHandle(MethodType type, Object argument, int vmargslot) {
162.106 - super(Access.TOKEN, type);
162.107 - this.argument = argument;
162.108 - this.vmargslot = vmargslot;
162.109 - assert(this instanceof AdapterMethodHandle);
162.110 - }
162.111 -
162.112 - /** Initialize the current object as a self-bound method handle, binding it
162.113 - * as the first argument of the method handle {@code entryPoint}.
162.114 - * The invocation type of the resulting method handle will be the
162.115 - * same as {@code entryPoint}, except that the first argument
162.116 - * type will be dropped.
162.117 - */
162.118 - protected BoundMethodHandle(Access token, MethodHandle entryPoint) {
162.119 - super(token, entryPoint.type().dropParameterTypes(0, 1));
162.120 - this.argument = this; // kludge; get rid of
162.121 - this.vmargslot = this.type().parameterSlotDepth(0);
162.122 - initTarget(entryPoint, 0);
162.123 - }
162.124 -
162.125 - /** Make sure the given {@code argument} can be used as {@code argnum}-th
162.126 - * parameter of the given method handle {@code mh}, which must be a reference.
162.127 - * <p>
162.128 - * If this fails, throw a suitable {@code WrongMethodTypeException},
162.129 - * which will prevent the creation of an illegally typed bound
162.130 - * method handle.
162.131 - */
162.132 - final static Object checkReferenceArgument(Object argument, MethodHandle mh, int argnum) {
162.133 - Class<?> ptype = mh.type().parameterType(argnum);
162.134 - if (ptype.isPrimitive()) {
162.135 - // fail
162.136 - } else if (argument == null) {
162.137 - return null;
162.138 - } else if (VerifyType.isNullReferenceConversion(argument.getClass(), ptype)) {
162.139 - return argument;
162.140 - }
162.141 - throw badBoundArgumentException(argument, mh, argnum);
162.142 - }
162.143 -
162.144 - /** Make sure the given {@code argument} can be used as {@code argnum}-th
162.145 - * parameter of the given method handle {@code mh}, which must be a primitive.
162.146 - * <p>
162.147 - * If this fails, throw a suitable {@code WrongMethodTypeException},
162.148 - * which will prevent the creation of an illegally typed bound
162.149 - * method handle.
162.150 - */
162.151 - final static Object bindPrimitiveArgument(Object argument, MethodHandle mh, int argnum) {
162.152 - Class<?> ptype = mh.type().parameterType(argnum);
162.153 - Wrapper wrap = Wrapper.forPrimitiveType(ptype);
162.154 - Object zero = wrap.zero();
162.155 - if (zero == null) {
162.156 - // fail
162.157 - } else if (argument == null) {
162.158 - if (ptype != int.class && wrap.isSubwordOrInt())
162.159 - return Integer.valueOf(0);
162.160 - else
162.161 - return zero;
162.162 - } else if (VerifyType.isNullReferenceConversion(argument.getClass(), zero.getClass())) {
162.163 - if (ptype != int.class && wrap.isSubwordOrInt())
162.164 - return Wrapper.INT.wrap(argument);
162.165 - else
162.166 - return argument;
162.167 - }
162.168 - throw badBoundArgumentException(argument, mh, argnum);
162.169 - }
162.170 -
162.171 - final static RuntimeException badBoundArgumentException(Object argument, MethodHandle mh, int argnum) {
162.172 - String atype = (argument == null) ? "null" : argument.getClass().toString();
162.173 - return new WrongMethodTypeException("cannot bind "+atype+" argument to parameter #"+argnum+" of "+mh.type());
162.174 - }
162.175 -
162.176 - @Override
162.177 - public String toString() {
162.178 - return MethodHandleImpl.addTypeString(baseName(), this);
162.179 - }
162.180 -
162.181 - /** Component of toString() before the type string. */
162.182 - protected String baseName() {
162.183 - MethodHandle mh = this;
162.184 - while (mh instanceof BoundMethodHandle) {
162.185 - Object info = MethodHandleNatives.getTargetInfo(mh);
162.186 - if (info instanceof MethodHandle) {
162.187 - mh = (MethodHandle) info;
162.188 - } else {
162.189 - String name = null;
162.190 - if (info instanceof MemberName)
162.191 - name = ((MemberName)info).getName();
162.192 - if (name != null)
162.193 - return name;
162.194 - else
162.195 - return noParens(super.toString()); // "invoke", probably
162.196 - }
162.197 - assert(mh != this);
162.198 - }
162.199 - return noParens(mh.toString());
162.200 - }
162.201 -
162.202 - private static String noParens(String str) {
162.203 - int paren = str.indexOf('(');
162.204 - if (paren >= 0) str = str.substring(0, paren);
162.205 - return str;
162.206 - }
162.207 -}
163.1 --- a/src/share/classes/sun/dyn/CallSiteImpl.java Tue Mar 29 11:29:01 2011 -0700
163.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
163.3 @@ -1,141 +0,0 @@
163.4 -/*
163.5 - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
163.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
163.7 - *
163.8 - * This code is free software; you can redistribute it and/or modify it
163.9 - * under the terms of the GNU General Public License version 2 only, as
163.10 - * published by the Free Software Foundation. Oracle designates this
163.11 - * particular file as subject to the "Classpath" exception as provided
163.12 - * by Oracle in the LICENSE file that accompanied this code.
163.13 - *
163.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
163.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
163.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
163.17 - * version 2 for more details (a copy is included in the LICENSE file that
163.18 - * accompanied this code).
163.19 - *
163.20 - * You should have received a copy of the GNU General Public License version
163.21 - * 2 along with this work; if not, write to the Free Software Foundation,
163.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
163.23 - *
163.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
163.25 - * or visit www.oracle.com if you need additional information or have any
163.26 - * questions.
163.27 - */
163.28 -
163.29 -package sun.dyn;
163.30 -
163.31 -import java.dyn.*;
163.32 -import static sun.dyn.MemberName.uncaughtException;
163.33 -
163.34 -/**
163.35 - * Parts of CallSite known to the JVM.
163.36 - * @author jrose
163.37 - */
163.38 -public class CallSiteImpl {
163.39 - // this implements the upcall from the JVM, MethodHandleNatives.makeDynamicCallSite:
163.40 - static CallSite makeSite(MethodHandle bootstrapMethod,
163.41 - // Callee information:
163.42 - String name, MethodType type,
163.43 - // Extra arguments for BSM, if any:
163.44 - Object info,
163.45 - // Caller information:
163.46 - MemberName callerMethod, int callerBCI) {
163.47 - Class<?> callerClass = callerMethod.getDeclaringClass();
163.48 - Object caller;
163.49 - if (bootstrapMethod.type().parameterType(0) == Class.class && TRANSITIONAL_BEFORE_PFD)
163.50 - caller = callerClass; // remove for PFD
163.51 - else
163.52 - caller = MethodHandleImpl.IMPL_LOOKUP.in(callerClass);
163.53 - if (bootstrapMethod == null && TRANSITIONAL_BEFORE_PFD) {
163.54 - // If there is no bootstrap method, throw IncompatibleClassChangeError.
163.55 - // This is a valid generic error type for resolution (JLS 12.3.3).
163.56 - throw new IncompatibleClassChangeError
163.57 - ("Class "+callerClass.getName()+" has not declared a bootstrap method for invokedynamic");
163.58 - }
163.59 - CallSite site;
163.60 - try {
163.61 - Object binding;
163.62 - info = maybeReBox(info);
163.63 - if (info == null) {
163.64 - binding = bootstrapMethod.invokeGeneric(caller, name, type);
163.65 - } else if (!info.getClass().isArray()) {
163.66 - binding = bootstrapMethod.invokeGeneric(caller, name, type, info);
163.67 - } else {
163.68 - Object[] argv = (Object[]) info;
163.69 - if (3 + argv.length > 255)
163.70 - new InvokeDynamicBootstrapError("too many bootstrap method arguments");
163.71 - MethodType bsmType = bootstrapMethod.type();
163.72 - if (bsmType.parameterCount() == 4 && bsmType.parameterType(3) == Object[].class)
163.73 - binding = bootstrapMethod.invokeGeneric(caller, name, type, argv);
163.74 - else
163.75 - binding = MethodHandles.spreadInvoker(bsmType, 3)
163.76 - .invokeGeneric(bootstrapMethod, caller, name, type, argv);
163.77 - }
163.78 - //System.out.println("BSM for "+name+type+" => "+binding);
163.79 - if (binding instanceof CallSite) {
163.80 - site = (CallSite) binding;
163.81 - } else if (binding instanceof MethodHandle && TRANSITIONAL_BEFORE_PFD) {
163.82 - // Transitional!
163.83 - MethodHandle target = (MethodHandle) binding;
163.84 - site = new ConstantCallSite(target);
163.85 - } else {
163.86 - throw new ClassCastException("bootstrap method failed to produce a CallSite");
163.87 - }
163.88 - if (TRANSITIONAL_BEFORE_PFD)
163.89 - PRIVATE_INITIALIZE_CALL_SITE.invokeExact(site, name, type,
163.90 - callerMethod, callerBCI);
163.91 - assert(site.getTarget() != null);
163.92 - assert(site.getTarget().type().equals(type));
163.93 - } catch (Throwable ex) {
163.94 - InvokeDynamicBootstrapError bex;
163.95 - if (ex instanceof InvokeDynamicBootstrapError)
163.96 - bex = (InvokeDynamicBootstrapError) ex;
163.97 - else
163.98 - bex = new InvokeDynamicBootstrapError("call site initialization exception", ex);
163.99 - throw bex;
163.100 - }
163.101 - return site;
163.102 - }
163.103 -
163.104 - private static boolean TRANSITIONAL_BEFORE_PFD = true; // FIXME: remove for PFD
163.105 -
163.106 - private static Object maybeReBox(Object x) {
163.107 - if (x instanceof Integer) {
163.108 - int xi = (int) x;
163.109 - if (xi == (byte) xi)
163.110 - x = xi; // must rebox; see JLS 5.1.7
163.111 - return x;
163.112 - } else if (x instanceof Object[]) {
163.113 - Object[] xa = (Object[]) x;
163.114 - for (int i = 0; i < xa.length; i++) {
163.115 - if (xa[i] instanceof Integer)
163.116 - xa[i] = maybeReBox(xa[i]);
163.117 - }
163.118 - return xa;
163.119 - } else {
163.120 - return x;
163.121 - }
163.122 - }
163.123 -
163.124 - // This method is private in CallSite because it touches private fields in CallSite.
163.125 - // These private fields (vmmethod, vmindex) are specific to the JVM.
163.126 - private static final MethodHandle PRIVATE_INITIALIZE_CALL_SITE;
163.127 - static {
163.128 - try {
163.129 - PRIVATE_INITIALIZE_CALL_SITE =
163.130 - !TRANSITIONAL_BEFORE_PFD ? null :
163.131 - MethodHandleImpl.IMPL_LOOKUP.findVirtual(CallSite.class, "initializeFromJVM",
163.132 - MethodType.methodType(void.class,
163.133 - String.class, MethodType.class,
163.134 - MemberName.class, int.class));
163.135 - } catch (ReflectiveOperationException ex) {
163.136 - throw uncaughtException(ex);
163.137 - }
163.138 - }
163.139 -
163.140 - public static void setCallSiteTarget(Access token, CallSite site, MethodHandle target) {
163.141 - Access.check(token);
163.142 - MethodHandleNatives.setCallSiteTarget(site, target);
163.143 - }
163.144 -}
164.1 --- a/src/share/classes/sun/dyn/DirectMethodHandle.java Tue Mar 29 11:29:01 2011 -0700
164.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
164.3 @@ -1,54 +0,0 @@
164.4 -/*
164.5 - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
164.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
164.7 - *
164.8 - * This code is free software; you can redistribute it and/or modify it
164.9 - * under the terms of the GNU General Public License version 2 only, as
164.10 - * published by the Free Software Foundation. Oracle designates this
164.11 - * particular file as subject to the "Classpath" exception as provided
164.12 - * by Oracle in the LICENSE file that accompanied this code.
164.13 - *
164.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
164.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
164.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
164.17 - * version 2 for more details (a copy is included in the LICENSE file that
164.18 - * accompanied this code).
164.19 - *
164.20 - * You should have received a copy of the GNU General Public License version
164.21 - * 2 along with this work; if not, write to the Free Software Foundation,
164.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
164.23 - *
164.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
164.25 - * or visit www.oracle.com if you need additional information or have any
164.26 - * questions.
164.27 - */
164.28 -
164.29 -package sun.dyn;
164.30 -
164.31 -import java.dyn.*;
164.32 -import static sun.dyn.MethodHandleNatives.Constants.*;
164.33 -
164.34 -/**
164.35 - * The flavor of method handle which emulates invokespecial or invokestatic.
164.36 - * @author jrose
164.37 - */
164.38 -class DirectMethodHandle extends MethodHandle {
164.39 - //inherited oop vmtarget; // methodOop or virtual class/interface oop
164.40 - private final int vmindex; // method index within class or interface
164.41 - { vmindex = VM_INDEX_UNINITIALIZED; } // JVM may change this
164.42 -
164.43 - // Constructors in this class *must* be package scoped or private.
164.44 - DirectMethodHandle(MethodType mtype, MemberName m, boolean doDispatch, Class<?> lookupClass) {
164.45 - super(Access.TOKEN, mtype);
164.46 -
164.47 - assert(m.isMethod() || !doDispatch && m.isConstructor());
164.48 - if (!m.isResolved())
164.49 - throw new InternalError();
164.50 -
164.51 - MethodHandleNatives.init(this, (Object) m, doDispatch, lookupClass);
164.52 - }
164.53 -
164.54 - boolean isValid() {
164.55 - return (vmindex != VM_INDEX_UNINITIALIZED);
164.56 - }
164.57 -}
165.1 --- a/src/share/classes/sun/dyn/FilterGeneric.java Tue Mar 29 11:29:01 2011 -0700
165.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
165.3 @@ -1,4496 +0,0 @@
165.4 -/*
165.5 - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
165.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
165.7 - *
165.8 - * This code is free software; you can redistribute it and/or modify it
165.9 - * under the terms of the GNU General Public License version 2 only, as
165.10 - * published by the Free Software Foundation. Oracle designates this
165.11 - * particular file as subject to the "Classpath" exception as provided
165.12 - * by Oracle in the LICENSE file that accompanied this code.
165.13 - *
165.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
165.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
165.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
165.17 - * version 2 for more details (a copy is included in the LICENSE file that
165.18 - * accompanied this code).
165.19 - *
165.20 - * You should have received a copy of the GNU General Public License version
165.21 - * 2 along with this work; if not, write to the Free Software Foundation,
165.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
165.23 - *
165.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
165.25 - * or visit www.oracle.com if you need additional information or have any
165.26 - * questions.
165.27 - */
165.28 -
165.29 -package sun.dyn;
165.30 -
165.31 -import java.dyn.*;
165.32 -import java.lang.reflect.*;
165.33 -import static sun.dyn.MemberName.newIllegalArgumentException;
165.34 -
165.35 -/**
165.36 - * These adapters apply arbitrary conversions to arguments
165.37 - * on the way to a ultimate target.
165.38 - * For simplicity, these are all generically typed.
165.39 - * @author jrose
165.40 - */
165.41 -class FilterGeneric {
165.42 - // type for the incoming call (will be generic)
165.43 - private final MethodType entryType;
165.44 - // prototype adapters (clone and customize for each new target & conversion!)
165.45 - private final Adapter[] adapters;
165.46 -
165.47 - /** Compute and cache information common to all filtering adapters
165.48 - * with the given generic type
165.49 - */
165.50 - FilterGeneric(MethodType entryType) {
165.51 - this.entryType = entryType;
165.52 - int tableSize = Kind.LIMIT.invokerIndex(1 + entryType.parameterCount());
165.53 - this.adapters = new Adapter[tableSize];
165.54 - }
165.55 -
165.56 - Adapter getAdapter(Kind kind, int pos) {
165.57 - int index = kind.invokerIndex(pos);
165.58 - Adapter ad = adapters[index];
165.59 - if (ad != null) return ad;
165.60 - ad = findAdapter(entryType, kind, pos);
165.61 - if (ad == null)
165.62 - ad = buildAdapterFromBytecodes(entryType, kind, pos);
165.63 - adapters[index] = ad;
165.64 - return ad;
165.65 - }
165.66 -
165.67 - Adapter makeInstance(Kind kind, int pos, MethodHandle filter, MethodHandle target) {
165.68 - Adapter ad = getAdapter(kind, pos);
165.69 - return ad.makeInstance(ad.prototypeEntryPoint(), filter, target);
165.70 - }
165.71 -
165.72 - /** Build an adapter of the given generic type, which invokes filter
165.73 - * on the selected incoming argument before passing it to the target.
165.74 - * @param pos the argument to filter
165.75 - * @param filter the function to call on the argument
165.76 - * @param target the target to call with the modified argument list
165.77 - * @return an adapter method handle
165.78 - */
165.79 - public static MethodHandle makeArgumentFilter(int pos, MethodHandle filter, MethodHandle target) {
165.80 - return make(Kind.value, pos, filter, target);
165.81 - }
165.82 -
165.83 - /** Build an adapter of the given generic type, which invokes a combiner
165.84 - * on a selected group of leading arguments.
165.85 - * The result of the combiner is prepended before all those arguments.
165.86 - * @param combiner the function to call on the selected leading arguments
165.87 - * @param target the target to call with the modified argument list
165.88 - * @return an adapter method handle
165.89 - */
165.90 - public static MethodHandle makeArgumentFolder(MethodHandle combiner, MethodHandle target) {
165.91 - int num = combiner.type().parameterCount();
165.92 - return make(Kind.fold, num, combiner, target);
165.93 - }
165.94 -
165.95 - /** Build an adapter of the given generic type, which invokes a filter
165.96 - * on the incoming arguments, reified as a group.
165.97 - * The argument may be modified (by side effects in the filter).
165.98 - * The arguments, possibly modified, are passed on to the target.
165.99 - * @param filter the function to call on the arguments
165.100 - * @param target the target to call with the possibly-modified argument list
165.101 - * @return an adapter method handle
165.102 - */
165.103 - public static MethodHandle makeFlyby(MethodHandle filter, MethodHandle target) {
165.104 - return make(Kind.flyby, 0, filter, target);
165.105 - }
165.106 -
165.107 - /** Build an adapter of the given generic type, which invokes a collector
165.108 - * on the selected incoming argument and all following arguments.
165.109 - * The result of the collector replaces all those arguments.
165.110 - * @param collector the function to call on the selected trailing arguments
165.111 - * @param target the target to call with the modified argument list
165.112 - * @return an adapter method handle
165.113 - */
165.114 - public static MethodHandle makeArgumentCollector(MethodHandle collector, MethodHandle target) {
165.115 - int pos = target.type().parameterCount() - 1;
165.116 - return make(Kind.collect, pos, collector, target);
165.117 - }
165.118 -
165.119 - static MethodHandle make(Kind kind, int pos, MethodHandle filter, MethodHandle target) {
165.120 - FilterGeneric fgen = of(kind, pos, filter.type(), target.type());
165.121 - return fgen.makeInstance(kind, pos, filter, target);
165.122 - }
165.123 -
165.124 - /** Return the adapter information for this target and filter type. */
165.125 - static FilterGeneric of(Kind kind, int pos, MethodType filterType, MethodType targetType) {
165.126 - MethodType entryType = entryType(kind, pos, filterType, targetType);
165.127 - if (entryType.generic() != entryType)
165.128 - throw newIllegalArgumentException("must be generic: "+entryType);
165.129 - MethodTypeImpl form = MethodTypeImpl.of(entryType);
165.130 - FilterGeneric filterGen = form.filterGeneric;
165.131 - if (filterGen == null)
165.132 - form.filterGeneric = filterGen = new FilterGeneric(entryType);
165.133 - return filterGen;
165.134 - }
165.135 -
165.136 - public String toString() {
165.137 - return "FilterGeneric/"+entryType;
165.138 - }
165.139 -
165.140 - static MethodType targetType(MethodType entryType, Kind kind, int pos, MethodType filterType) {
165.141 - MethodType type = entryType;
165.142 - switch (kind) {
165.143 - case value:
165.144 - case flyby:
165.145 - break; // no change
165.146 - case fold:
165.147 - type = type.insertParameterTypes(0, filterType.returnType());
165.148 - break;
165.149 - case collect:
165.150 - type = type.dropParameterTypes(pos, type.parameterCount());
165.151 - type = type.insertParameterTypes(pos, filterType.returnType());
165.152 - break;
165.153 - default:
165.154 - throw new InternalError();
165.155 - }
165.156 - return type;
165.157 - }
165.158 -
165.159 - static MethodType entryType(Kind kind, int pos, MethodType filterType, MethodType targetType) {
165.160 - MethodType type = targetType;
165.161 - switch (kind) {
165.162 - case value:
165.163 - case flyby:
165.164 - break; // no change
165.165 - case fold:
165.166 - type = type.dropParameterTypes(0, 1);
165.167 - break;
165.168 - case collect:
165.169 - type = type.dropParameterTypes(pos, pos+1);
165.170 - type = type.insertParameterTypes(pos, filterType.parameterList());
165.171 - break;
165.172 - default:
165.173 - throw new InternalError();
165.174 - }
165.175 - return type;
165.176 - }
165.177 -
165.178 - /* Create an adapter that handles spreading calls for the given type. */
165.179 - static Adapter findAdapter(MethodType entryType, Kind kind, int pos) {
165.180 - int argc = entryType.parameterCount();
165.181 - String cname0 = "F"+argc;
165.182 - String cname1 = "F"+argc+kind.key;
165.183 - String[] cnames = { cname0, cname1 };
165.184 - String iname = kind.invokerName(pos);
165.185 - // e.g., F5; invoke_C3
165.186 - for (String cname : cnames) {
165.187 - Class<? extends Adapter> acls = Adapter.findSubClass(cname);
165.188 - if (acls == null) continue;
165.189 - // see if it has the required invoke method
165.190 - MethodHandle entryPoint = null;
165.191 - try {
165.192 - entryPoint = MethodHandleImpl.IMPL_LOOKUP.findSpecial(acls, iname, entryType, acls);
165.193 - } catch (ReflectiveOperationException ex) {
165.194 - }
165.195 - if (entryPoint == null) continue;
165.196 - Constructor<? extends Adapter> ctor = null;
165.197 - try {
165.198 - ctor = acls.getDeclaredConstructor(MethodHandle.class);
165.199 - } catch (NoSuchMethodException ex) {
165.200 - } catch (SecurityException ex) {
165.201 - }
165.202 - if (ctor == null) continue;
165.203 - try {
165.204 - // Produce an instance configured as a prototype.
165.205 - return ctor.newInstance(entryPoint);
165.206 - } catch (IllegalArgumentException ex) {
165.207 - } catch (InvocationTargetException wex) {
165.208 - Throwable ex = wex.getTargetException();
165.209 - if (ex instanceof Error) throw (Error)ex;
165.210 - if (ex instanceof RuntimeException) throw (RuntimeException)ex;
165.211 - } catch (InstantiationException ex) {
165.212 - } catch (IllegalAccessException ex) {
165.213 - }
165.214 - }
165.215 - return null;
165.216 - }
165.217 -
165.218 - static Adapter buildAdapterFromBytecodes(MethodType entryType, Kind kind, int pos) {
165.219 - throw new UnsupportedOperationException("NYI");
165.220 - }
165.221 -
165.222 - /**
165.223 - * This adapter takes some untyped arguments, and returns an untyped result.
165.224 - * Internally, it applies the invoker to the target, which causes the
165.225 - * objects to be unboxed; the result is a raw type in L/I/J/F/D.
165.226 - * This result is passed to convert, which is responsible for
165.227 - * converting the raw result into a boxed object.
165.228 - * The invoker is kept separate from the target because it can be
165.229 - * generated once per type erasure family, and reused across adapters.
165.230 - */
165.231 - static abstract class Adapter extends BoundMethodHandle {
165.232 - protected final MethodHandle filter; // transforms one or more arguments
165.233 - protected final MethodHandle target; // ultimate target
165.234 -
165.235 - @Override
165.236 - public String toString() {
165.237 - return MethodHandleImpl.addTypeString(target, this);
165.238 - }
165.239 -
165.240 - protected boolean isPrototype() { return target == null; }
165.241 - protected Adapter(MethodHandle entryPoint) {
165.242 - this(entryPoint, entryPoint, null);
165.243 - assert(isPrototype());
165.244 - }
165.245 - protected MethodHandle prototypeEntryPoint() {
165.246 - if (!isPrototype()) throw new InternalError();
165.247 - return filter;
165.248 - }
165.249 -
165.250 - protected Adapter(MethodHandle entryPoint,
165.251 - MethodHandle filter, MethodHandle target) {
165.252 - super(Access.TOKEN, entryPoint);
165.253 - this.filter = filter;
165.254 - this.target = target;
165.255 - }
165.256 -
165.257 - /** Make a copy of self, with new fields. */
165.258 - protected abstract Adapter makeInstance(MethodHandle entryPoint,
165.259 - MethodHandle filter, MethodHandle target);
165.260 - // { return new ThisType(entryPoint, filter, target); }
165.261 -
165.262 - static private final String CLASS_PREFIX; // "sun.dyn.FilterGeneric$"
165.263 - static {
165.264 - String aname = Adapter.class.getName();
165.265 - String sname = Adapter.class.getSimpleName();
165.266 - if (!aname.endsWith(sname)) throw new InternalError();
165.267 - CLASS_PREFIX = aname.substring(0, aname.length() - sname.length());
165.268 - }
165.269 - /** Find a sibing class of Adapter. */
165.270 - static Class<? extends Adapter> findSubClass(String name) {
165.271 - String cname = Adapter.CLASS_PREFIX + name;
165.272 - try {
165.273 - return Class.forName(cname).asSubclass(Adapter.class);
165.274 - } catch (ClassNotFoundException ex) {
165.275 - return null;
165.276 - } catch (ClassCastException ex) {
165.277 - return null;
165.278 - }
165.279 - }
165.280 - }
165.281 -
165.282 - static enum Kind {
165.283 - value('V'), // filter and replace Nth argument value
165.284 - fold('F'), // fold first N arguments, prepend result
165.285 - collect('C'), // collect last N arguments, replace with result
165.286 - flyby('Y'), // reify entire argument list, filter, pass to target
165.287 - LIMIT('?');
165.288 - static final int COUNT = LIMIT.ordinal();
165.289 -
165.290 - final char key;
165.291 - Kind(char key) { this.key = key; }
165.292 - String invokerName(int pos) { return "invoke_"+key+""+pos; }
165.293 - int invokerIndex(int pos) { return pos * COUNT + ordinal(); }
165.294 - }
165.295 -
165.296 - /* generated classes follow this pattern:
165.297 - static class F1X extends Adapter {
165.298 - protected F1X(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.299 - protected F1X(MethodHandle e, MethodHandle f, MethodHandle t)
165.300 - { super(e, f, t); }
165.301 - protected F1X makeInstance(MethodHandle e, MethodHandle f, MethodHandle t)
165.302 - { return new F1X(e, f, t); }
165.303 - protected Object invoke_V0(Object a0) { return target.invokeExact(filter.invokeExact(a0)); }
165.304 - protected Object invoke_F0(Object a0) { return target.invokeExact(filter.invokeExact(), a0); }
165.305 - protected Object invoke_F1(Object a0) { return target.invokeExact(filter.invokeExact(a0), a0); }
165.306 - protected Object invoke_C0(Object a0) { return target.invokeExact(filter.invokeExact(a0)); }
165.307 - protected Object invoke_C1(Object a0) { return target.invokeExact(a0, filter.invokeExact()); }
165.308 - protected Object invoke_Y0(Object a0) { Object[] av = { a0 };
165.309 - filter.invokeExact(av); return target.invokeExact(av[0]); }
165.310 - }
165.311 - static class F2X extends Adapter {
165.312 - protected F2X(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.313 - protected F2X(MethodHandle e, MethodHandle f, MethodHandle t)
165.314 - { super(e, f, t); }
165.315 - protected F2X makeInstance(MethodHandle e, MethodHandle f, MethodHandle t)
165.316 - { return new F2X(e, f, t); }
165.317 - protected Object invoke_V0(Object a0, Object a1) { return target.invokeExact(filter.invokeExact(a0), a1); }
165.318 - protected Object invoke_V1(Object a0, Object a1) { return target.invokeExact(a0, filter.invokeExact(a1)); }
165.319 - protected Object invoke_F0(Object a0, Object a1) { return target.invokeExact(filter.invokeExact(), a0, a1); }
165.320 - protected Object invoke_F1(Object a0, Object a1) { return target.invokeExact(filter.invokeExact(a0), a0, a1); }
165.321 - protected Object invoke_F2(Object a0, Object a1) { return target.invokeExact(filter.invokeExact(a0, a1), a0, a1); }
165.322 - protected Object invoke_C0(Object a0, Object a1) { return target.invokeExact(filter.invokeExact(a0, a1)); }
165.323 - protected Object invoke_C1(Object a0, Object a1) { return target.invokeExact(a0, filter.invokeExact(a1)); }
165.324 - protected Object invoke_C2(Object a0, Object a1) { return target.invokeExact(a0, a1, filter.invokeExact()); }
165.325 - protected Object invoke_Y0(Object a0, Object a1) { Object[] av = { a0, a1 };
165.326 - filter.invokeExact(av); return target.invokeExact(av[0], av[1]); }
165.327 - }
165.328 - // */
165.329 -
165.330 - // This one is written by hand:
165.331 - static class F0 extends Adapter {
165.332 - protected F0(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.333 - protected F0(MethodHandle e, MethodHandle f, MethodHandle t) {
165.334 - super(e, f, t); }
165.335 - protected F0 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.336 - return new F0(e, f, t); }
165.337 - protected Object invoke_F0() throws Throwable {
165.338 - return target.invokeExact(filter.invokeExact()); }
165.339 - protected Object invoke_C0() throws Throwable {
165.340 - return target.invokeExact(filter.invokeExact()); }
165.341 - static final Object[] NO_ARGS = { };
165.342 - protected Object invoke_Y0() throws Throwable {
165.343 - filter.invokeExact(NO_ARGS); // make the flyby
165.344 - return target.invokeExact(); }
165.345 - }
165.346 -
165.347 -/*
165.348 - : SHELL; n=FilterGeneric; cp -p $n.java $n.java-; sed < $n.java- > $n.java+ -e '/{{*{{/,/}}*}}/w /tmp/genclasses.java' -e '/}}*}}/q'; (cd /tmp; javac -d . genclasses.java; java -ea -cp . genclasses | sed 's| *[/]/ *$||') >> $n.java+; echo '}' >> $n.java+; mv $n.java+ $n.java; mv $n.java- $n.java~
165.349 -//{{{
165.350 -import java.util.*;
165.351 -class genclasses {
165.352 - static String[][] TEMPLATES = { {
165.353 - "@for@ N=1..20",
165.354 - " //@each-cat@",
165.355 - " static class @cat@ extends Adapter {",
165.356 - " protected @cat@(MethodHandle entryPoint) { super(entryPoint); } // to build prototype",
165.357 - " protected @cat@(MethodHandle e, MethodHandle f, MethodHandle t) {",
165.358 - " super(e, f, t); }",
165.359 - " protected @cat@ makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {",
165.360 - " return new @cat@(e, f, t); }",
165.361 - " //@each-P@",
165.362 - " protected Object invoke_V@P@(@Tvav@) throws Throwable {",
165.363 - " return target.invokeExact(@a0_@@Psp@filter.invokeExact(a@P@)@_aN@); }",
165.364 - " //@end-P@",
165.365 - " //@each-P@",
165.366 - " protected Object invoke_F@P@(@Tvav@) throws Throwable {",
165.367 - " return target.invokeExact(filter.invokeExact(@a0@),",
165.368 - " @av@); }",
165.369 - " //@end-P@",
165.370 - " protected Object invoke_F@N@(@Tvav@) throws Throwable {",
165.371 - " return target.invokeExact(filter.invokeExact(@av@),",
165.372 - " @av@); }",
165.373 - " //@each-P@",
165.374 - " protected Object invoke_C@P@(@Tvav@) throws Throwable {",
165.375 - " return target.invokeExact(@a0_@filter.invokeExact(a@P@@_aN@)); }",
165.376 - " //@end-P@",
165.377 - " protected Object invoke_C@N@(@Tvav@) throws Throwable {",
165.378 - " return target.invokeExact(@av@, filter.invokeExact()); }",
165.379 - " protected Object invoke_Y0(@Tvav@) throws Throwable {",
165.380 - " Object[] av = { @av@ };",
165.381 - " filter.invokeExact(av); // make the flyby",
165.382 - " return target.invokeExact(@av[i]@); }",
165.383 - " }",
165.384 - } };
165.385 - static final String NEWLINE_INDENT = " //\n ";
165.386 - enum VAR {
165.387 - cat, N, P, Tvav, av, a0, a0_, _aN, Psp, av_i_;
165.388 - public final String pattern = "@"+toString().replace('_','.')+"@";
165.389 - public String binding = toString();
165.390 - static void makeBindings(boolean topLevel, int inargs, int pos) {
165.391 - assert(-1 <= pos && pos < inargs);
165.392 - VAR.cat.binding = "F"+inargs;
165.393 - VAR.N.binding = String.valueOf(inargs); // incoming arg count
165.394 - VAR.P.binding = String.valueOf(pos); // selected arg position
165.395 - String[] av = new String[inargs];
165.396 - String[] Tvav = new String[inargs];
165.397 - String[] av_i_ = new String[inargs];
165.398 - for (int i = 0; i < inargs; i++) {
165.399 - av[i] = arg(i);
165.400 - av_i_[i] = "av["+i+"]";
165.401 - String spc = "";
165.402 - if (i > 0 && i % 4 == 0) spc = NEWLINE_INDENT+(pos>9?" ":"")+" ";
165.403 - Tvav[i] = spc+param("Object", av[i]);
165.404 - }
165.405 - VAR.av.binding = comma(av);
165.406 - VAR.av_i_.binding = comma(av_i_);
165.407 - VAR.Tvav.binding = comma(Tvav);
165.408 - if (pos >= 0) {
165.409 - VAR.Psp.binding = (pos > 0 && pos % 10 == 0) ? NEWLINE_INDENT : "";
165.410 - String[] a0 = new String[pos];
165.411 - String[] aN = new String[inargs - (pos+1)];
165.412 - for (int i = 0; i < pos; i++) {
165.413 - String spc = "";
165.414 - if (i > 0 && i % 10 == 0) spc = NEWLINE_INDENT;
165.415 - a0[i] = spc+av[i];
165.416 - }
165.417 - VAR.a0.binding = comma(a0);
165.418 - VAR.a0_.binding = comma(a0, ", ");
165.419 - for (int i = pos+1; i < inargs; i++) {
165.420 - String spc = "";
165.421 - if (i > 0 && i % 10 == 0) spc = NEWLINE_INDENT;
165.422 - aN[i - (pos+1)] = spc+av[i];
165.423 - }
165.424 - VAR._aN.binding = comma(", ", aN);
165.425 - }
165.426 - }
165.427 - static String arg(int i) { return "a"+i; }
165.428 - static String param(String t, String a) { return t+" "+a; }
165.429 - static String comma(String[] v) { return comma(v, ""); }
165.430 - static String comma(String[] v, String sep) { return comma("", v, sep); }
165.431 - static String comma(String sep, String[] v) { return comma(sep, v, ""); }
165.432 - static String comma(String sep1, String[] v, String sep2) {
165.433 - if (v.length == 0) return "";
165.434 - String res = v[0];
165.435 - for (int i = 1; i < v.length; i++) res += ", "+v[i];
165.436 - return sep1 + res + sep2;
165.437 - }
165.438 - static String transform(String string) {
165.439 - for (VAR var : values())
165.440 - string = string.replaceAll(var.pattern, var.binding);
165.441 - return string;
165.442 - }
165.443 - }
165.444 - static String[] stringsIn(String[] strings, int beg, int end) {
165.445 - return Arrays.copyOfRange(strings, beg, Math.min(end, strings.length));
165.446 - }
165.447 - static String[] stringsBefore(String[] strings, int pos) {
165.448 - return stringsIn(strings, 0, pos);
165.449 - }
165.450 - static String[] stringsAfter(String[] strings, int pos) {
165.451 - return stringsIn(strings, pos, strings.length);
165.452 - }
165.453 - static int indexAfter(String[] strings, int pos, String tag) {
165.454 - return Math.min(indexBefore(strings, pos, tag) + 1, strings.length);
165.455 - }
165.456 - static int indexBefore(String[] strings, int pos, String tag) {
165.457 - for (int i = pos, end = strings.length; ; i++) {
165.458 - if (i == end || strings[i].endsWith(tag)) return i;
165.459 - }
165.460 - }
165.461 - static int MIN_ARITY, MAX_ARITY;
165.462 - public static void main(String... av) {
165.463 - for (String[] template : TEMPLATES) {
165.464 - int forLinesLimit = indexBefore(template, 0, "@each-cat@");
165.465 - String[] forLines = stringsBefore(template, forLinesLimit);
165.466 - template = stringsAfter(template, forLinesLimit);
165.467 - for (String forLine : forLines)
165.468 - expandTemplate(forLine, template);
165.469 - }
165.470 - }
165.471 - static void expandTemplate(String forLine, String[] template) {
165.472 - String[] params = forLine.split("[^0-9]+");
165.473 - if (params[0].length() == 0) params = stringsAfter(params, 1);
165.474 - System.out.println("//params="+Arrays.asList(params));
165.475 - int pcur = 0;
165.476 - MIN_ARITY = Integer.valueOf(params[pcur++]);
165.477 - MAX_ARITY = Integer.valueOf(params[pcur++]);
165.478 - if (pcur != params.length) throw new RuntimeException("bad extra param: "+forLine);
165.479 - for (int inargs = MIN_ARITY; inargs <= MAX_ARITY; inargs++) {
165.480 - expandTemplate(template, true, inargs, -1);
165.481 - }
165.482 - }
165.483 - static void expandTemplate(String[] template, boolean topLevel, int inargs, int pos) {
165.484 - VAR.makeBindings(topLevel, inargs, pos);
165.485 - for (int i = 0; i < template.length; i++) {
165.486 - String line = template[i];
165.487 - if (line.endsWith("@each-cat@")) {
165.488 - // ignore
165.489 - } else if (line.endsWith("@each-P@")) {
165.490 - int blockEnd = indexAfter(template, i, "@end-P@");
165.491 - String[] block = stringsIn(template, i+1, blockEnd-1);
165.492 - for (int pos1 = Math.max(0,pos); pos1 < inargs; pos1++)
165.493 - expandTemplate(block, false, inargs, pos1);
165.494 - VAR.makeBindings(topLevel, inargs, pos);
165.495 - i = blockEnd-1; continue;
165.496 - } else {
165.497 - System.out.println(VAR.transform(line));
165.498 - }
165.499 - }
165.500 - }
165.501 -}
165.502 -//}}} */
165.503 -//params=[1, 20]
165.504 - static class F1 extends Adapter {
165.505 - protected F1(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.506 - protected F1(MethodHandle e, MethodHandle f, MethodHandle t) {
165.507 - super(e, f, t); }
165.508 - protected F1 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.509 - return new F1(e, f, t); }
165.510 - protected Object invoke_V0(Object a0) throws Throwable {
165.511 - return target.invokeExact(filter.invokeExact(a0)); }
165.512 - protected Object invoke_F0(Object a0) throws Throwable {
165.513 - return target.invokeExact(filter.invokeExact(),
165.514 - a0); }
165.515 - protected Object invoke_F1(Object a0) throws Throwable {
165.516 - return target.invokeExact(filter.invokeExact(a0),
165.517 - a0); }
165.518 - protected Object invoke_C0(Object a0) throws Throwable {
165.519 - return target.invokeExact(filter.invokeExact(a0)); }
165.520 - protected Object invoke_C1(Object a0) throws Throwable {
165.521 - return target.invokeExact(a0, filter.invokeExact()); }
165.522 - protected Object invoke_Y0(Object a0) throws Throwable {
165.523 - Object[] av = { a0 };
165.524 - filter.invokeExact(av); // make the flyby
165.525 - return target.invokeExact(av[0]); }
165.526 - }
165.527 - static class F2 extends Adapter {
165.528 - protected F2(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.529 - protected F2(MethodHandle e, MethodHandle f, MethodHandle t) {
165.530 - super(e, f, t); }
165.531 - protected F2 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.532 - return new F2(e, f, t); }
165.533 - protected Object invoke_V0(Object a0, Object a1) throws Throwable {
165.534 - return target.invokeExact(filter.invokeExact(a0), a1); }
165.535 - protected Object invoke_V1(Object a0, Object a1) throws Throwable {
165.536 - return target.invokeExact(a0, filter.invokeExact(a1)); }
165.537 - protected Object invoke_F0(Object a0, Object a1) throws Throwable {
165.538 - return target.invokeExact(filter.invokeExact(),
165.539 - a0, a1); }
165.540 - protected Object invoke_F1(Object a0, Object a1) throws Throwable {
165.541 - return target.invokeExact(filter.invokeExact(a0),
165.542 - a0, a1); }
165.543 - protected Object invoke_F2(Object a0, Object a1) throws Throwable {
165.544 - return target.invokeExact(filter.invokeExact(a0, a1),
165.545 - a0, a1); }
165.546 - protected Object invoke_C0(Object a0, Object a1) throws Throwable {
165.547 - return target.invokeExact(filter.invokeExact(a0, a1)); }
165.548 - protected Object invoke_C1(Object a0, Object a1) throws Throwable {
165.549 - return target.invokeExact(a0, filter.invokeExact(a1)); }
165.550 - protected Object invoke_C2(Object a0, Object a1) throws Throwable {
165.551 - return target.invokeExact(a0, a1, filter.invokeExact()); }
165.552 - protected Object invoke_Y0(Object a0, Object a1) throws Throwable {
165.553 - Object[] av = { a0, a1 };
165.554 - filter.invokeExact(av); // make the flyby
165.555 - return target.invokeExact(av[0], av[1]); }
165.556 - }
165.557 - static class F3 extends Adapter {
165.558 - protected F3(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.559 - protected F3(MethodHandle e, MethodHandle f, MethodHandle t) {
165.560 - super(e, f, t); }
165.561 - protected F3 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.562 - return new F3(e, f, t); }
165.563 - protected Object invoke_V0(Object a0, Object a1, Object a2) throws Throwable {
165.564 - return target.invokeExact(filter.invokeExact(a0), a1, a2); }
165.565 - protected Object invoke_V1(Object a0, Object a1, Object a2) throws Throwable {
165.566 - return target.invokeExact(a0, filter.invokeExact(a1), a2); }
165.567 - protected Object invoke_V2(Object a0, Object a1, Object a2) throws Throwable {
165.568 - return target.invokeExact(a0, a1, filter.invokeExact(a2)); }
165.569 - protected Object invoke_F0(Object a0, Object a1, Object a2) throws Throwable {
165.570 - return target.invokeExact(filter.invokeExact(),
165.571 - a0, a1, a2); }
165.572 - protected Object invoke_F1(Object a0, Object a1, Object a2) throws Throwable {
165.573 - return target.invokeExact(filter.invokeExact(a0),
165.574 - a0, a1, a2); }
165.575 - protected Object invoke_F2(Object a0, Object a1, Object a2) throws Throwable {
165.576 - return target.invokeExact(filter.invokeExact(a0, a1),
165.577 - a0, a1, a2); }
165.578 - protected Object invoke_F3(Object a0, Object a1, Object a2) throws Throwable {
165.579 - return target.invokeExact(filter.invokeExact(a0, a1, a2),
165.580 - a0, a1, a2); }
165.581 - protected Object invoke_C0(Object a0, Object a1, Object a2) throws Throwable {
165.582 - return target.invokeExact(filter.invokeExact(a0, a1, a2)); }
165.583 - protected Object invoke_C1(Object a0, Object a1, Object a2) throws Throwable {
165.584 - return target.invokeExact(a0, filter.invokeExact(a1, a2)); }
165.585 - protected Object invoke_C2(Object a0, Object a1, Object a2) throws Throwable {
165.586 - return target.invokeExact(a0, a1, filter.invokeExact(a2)); }
165.587 - protected Object invoke_C3(Object a0, Object a1, Object a2) throws Throwable {
165.588 - return target.invokeExact(a0, a1, a2, filter.invokeExact()); }
165.589 - protected Object invoke_Y0(Object a0, Object a1, Object a2) throws Throwable {
165.590 - Object[] av = { a0, a1, a2 };
165.591 - filter.invokeExact(av); // make the flyby
165.592 - return target.invokeExact(av[0], av[1], av[2]); }
165.593 - }
165.594 - static class F4 extends Adapter {
165.595 - protected F4(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.596 - protected F4(MethodHandle e, MethodHandle f, MethodHandle t) {
165.597 - super(e, f, t); }
165.598 - protected F4 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.599 - return new F4(e, f, t); }
165.600 - protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3) throws Throwable {
165.601 - return target.invokeExact(filter.invokeExact(a0), a1, a2, a3); }
165.602 - protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3) throws Throwable {
165.603 - return target.invokeExact(a0, filter.invokeExact(a1), a2, a3); }
165.604 - protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3) throws Throwable {
165.605 - return target.invokeExact(a0, a1, filter.invokeExact(a2), a3); }
165.606 - protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3) throws Throwable {
165.607 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3)); }
165.608 - protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3) throws Throwable {
165.609 - return target.invokeExact(filter.invokeExact(),
165.610 - a0, a1, a2, a3); }
165.611 - protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3) throws Throwable {
165.612 - return target.invokeExact(filter.invokeExact(a0),
165.613 - a0, a1, a2, a3); }
165.614 - protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3) throws Throwable {
165.615 - return target.invokeExact(filter.invokeExact(a0, a1),
165.616 - a0, a1, a2, a3); }
165.617 - protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3) throws Throwable {
165.618 - return target.invokeExact(filter.invokeExact(a0, a1, a2),
165.619 - a0, a1, a2, a3); }
165.620 - protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3) throws Throwable {
165.621 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
165.622 - a0, a1, a2, a3); }
165.623 - protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3) throws Throwable {
165.624 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3)); }
165.625 - protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3) throws Throwable {
165.626 - return target.invokeExact(a0, filter.invokeExact(a1, a2, a3)); }
165.627 - protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3) throws Throwable {
165.628 - return target.invokeExact(a0, a1, filter.invokeExact(a2, a3)); }
165.629 - protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3) throws Throwable {
165.630 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3)); }
165.631 - protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3) throws Throwable {
165.632 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact()); }
165.633 - protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3) throws Throwable {
165.634 - Object[] av = { a0, a1, a2, a3 };
165.635 - filter.invokeExact(av); // make the flyby
165.636 - return target.invokeExact(av[0], av[1], av[2], av[3]); }
165.637 - }
165.638 - static class F5 extends Adapter {
165.639 - protected F5(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.640 - protected F5(MethodHandle e, MethodHandle f, MethodHandle t) {
165.641 - super(e, f, t); }
165.642 - protected F5 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.643 - return new F5(e, f, t); }
165.644 - protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
165.645 - Object a4) throws Throwable {
165.646 - return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4); }
165.647 - protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
165.648 - Object a4) throws Throwable {
165.649 - return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4); }
165.650 - protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
165.651 - Object a4) throws Throwable {
165.652 - return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4); }
165.653 - protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
165.654 - Object a4) throws Throwable {
165.655 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4); }
165.656 - protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
165.657 - Object a4) throws Throwable {
165.658 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4)); }
165.659 - protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
165.660 - Object a4) throws Throwable {
165.661 - return target.invokeExact(filter.invokeExact(),
165.662 - a0, a1, a2, a3, a4); }
165.663 - protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
165.664 - Object a4) throws Throwable {
165.665 - return target.invokeExact(filter.invokeExact(a0),
165.666 - a0, a1, a2, a3, a4); }
165.667 - protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
165.668 - Object a4) throws Throwable {
165.669 - return target.invokeExact(filter.invokeExact(a0, a1),
165.670 - a0, a1, a2, a3, a4); }
165.671 - protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
165.672 - Object a4) throws Throwable {
165.673 - return target.invokeExact(filter.invokeExact(a0, a1, a2),
165.674 - a0, a1, a2, a3, a4); }
165.675 - protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
165.676 - Object a4) throws Throwable {
165.677 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
165.678 - a0, a1, a2, a3, a4); }
165.679 - protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
165.680 - Object a4) throws Throwable {
165.681 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
165.682 - a0, a1, a2, a3, a4); }
165.683 - protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
165.684 - Object a4) throws Throwable {
165.685 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4)); }
165.686 - protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
165.687 - Object a4) throws Throwable {
165.688 - return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4)); }
165.689 - protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
165.690 - Object a4) throws Throwable {
165.691 - return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4)); }
165.692 - protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
165.693 - Object a4) throws Throwable {
165.694 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4)); }
165.695 - protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
165.696 - Object a4) throws Throwable {
165.697 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4)); }
165.698 - protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
165.699 - Object a4) throws Throwable {
165.700 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact()); }
165.701 - protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
165.702 - Object a4) throws Throwable {
165.703 - Object[] av = { a0, a1, a2, a3, a4 };
165.704 - filter.invokeExact(av); // make the flyby
165.705 - return target.invokeExact(av[0], av[1], av[2], av[3], av[4]); }
165.706 - }
165.707 - static class F6 extends Adapter {
165.708 - protected F6(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.709 - protected F6(MethodHandle e, MethodHandle f, MethodHandle t) {
165.710 - super(e, f, t); }
165.711 - protected F6 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.712 - return new F6(e, f, t); }
165.713 - protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
165.714 - Object a4, Object a5) throws Throwable {
165.715 - return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5); }
165.716 - protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
165.717 - Object a4, Object a5) throws Throwable {
165.718 - return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5); }
165.719 - protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
165.720 - Object a4, Object a5) throws Throwable {
165.721 - return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5); }
165.722 - protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
165.723 - Object a4, Object a5) throws Throwable {
165.724 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5); }
165.725 - protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
165.726 - Object a4, Object a5) throws Throwable {
165.727 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5); }
165.728 - protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
165.729 - Object a4, Object a5) throws Throwable {
165.730 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5)); }
165.731 - protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
165.732 - Object a4, Object a5) throws Throwable {
165.733 - return target.invokeExact(filter.invokeExact(),
165.734 - a0, a1, a2, a3, a4, a5); }
165.735 - protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
165.736 - Object a4, Object a5) throws Throwable {
165.737 - return target.invokeExact(filter.invokeExact(a0),
165.738 - a0, a1, a2, a3, a4, a5); }
165.739 - protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
165.740 - Object a4, Object a5) throws Throwable {
165.741 - return target.invokeExact(filter.invokeExact(a0, a1),
165.742 - a0, a1, a2, a3, a4, a5); }
165.743 - protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
165.744 - Object a4, Object a5) throws Throwable {
165.745 - return target.invokeExact(filter.invokeExact(a0, a1, a2),
165.746 - a0, a1, a2, a3, a4, a5); }
165.747 - protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
165.748 - Object a4, Object a5) throws Throwable {
165.749 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
165.750 - a0, a1, a2, a3, a4, a5); }
165.751 - protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
165.752 - Object a4, Object a5) throws Throwable {
165.753 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
165.754 - a0, a1, a2, a3, a4, a5); }
165.755 - protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
165.756 - Object a4, Object a5) throws Throwable {
165.757 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
165.758 - a0, a1, a2, a3, a4, a5); }
165.759 - protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
165.760 - Object a4, Object a5) throws Throwable {
165.761 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5)); }
165.762 - protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
165.763 - Object a4, Object a5) throws Throwable {
165.764 - return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5)); }
165.765 - protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
165.766 - Object a4, Object a5) throws Throwable {
165.767 - return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5)); }
165.768 - protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
165.769 - Object a4, Object a5) throws Throwable {
165.770 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5)); }
165.771 - protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
165.772 - Object a4, Object a5) throws Throwable {
165.773 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5)); }
165.774 - protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
165.775 - Object a4, Object a5) throws Throwable {
165.776 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5)); }
165.777 - protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
165.778 - Object a4, Object a5) throws Throwable {
165.779 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact()); }
165.780 - protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
165.781 - Object a4, Object a5) throws Throwable {
165.782 - Object[] av = { a0, a1, a2, a3, a4, a5 };
165.783 - filter.invokeExact(av); // make the flyby
165.784 - return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5]); }
165.785 - }
165.786 - static class F7 extends Adapter {
165.787 - protected F7(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.788 - protected F7(MethodHandle e, MethodHandle f, MethodHandle t) {
165.789 - super(e, f, t); }
165.790 - protected F7 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.791 - return new F7(e, f, t); }
165.792 - protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
165.793 - Object a4, Object a5, Object a6) throws Throwable {
165.794 - return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6); }
165.795 - protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
165.796 - Object a4, Object a5, Object a6) throws Throwable {
165.797 - return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6); }
165.798 - protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
165.799 - Object a4, Object a5, Object a6) throws Throwable {
165.800 - return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6); }
165.801 - protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
165.802 - Object a4, Object a5, Object a6) throws Throwable {
165.803 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6); }
165.804 - protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
165.805 - Object a4, Object a5, Object a6) throws Throwable {
165.806 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6); }
165.807 - protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
165.808 - Object a4, Object a5, Object a6) throws Throwable {
165.809 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6); }
165.810 - protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
165.811 - Object a4, Object a5, Object a6) throws Throwable {
165.812 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6)); }
165.813 - protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
165.814 - Object a4, Object a5, Object a6) throws Throwable {
165.815 - return target.invokeExact(filter.invokeExact(),
165.816 - a0, a1, a2, a3, a4, a5, a6); }
165.817 - protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
165.818 - Object a4, Object a5, Object a6) throws Throwable {
165.819 - return target.invokeExact(filter.invokeExact(a0),
165.820 - a0, a1, a2, a3, a4, a5, a6); }
165.821 - protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
165.822 - Object a4, Object a5, Object a6) throws Throwable {
165.823 - return target.invokeExact(filter.invokeExact(a0, a1),
165.824 - a0, a1, a2, a3, a4, a5, a6); }
165.825 - protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
165.826 - Object a4, Object a5, Object a6) throws Throwable {
165.827 - return target.invokeExact(filter.invokeExact(a0, a1, a2),
165.828 - a0, a1, a2, a3, a4, a5, a6); }
165.829 - protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
165.830 - Object a4, Object a5, Object a6) throws Throwable {
165.831 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
165.832 - a0, a1, a2, a3, a4, a5, a6); }
165.833 - protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
165.834 - Object a4, Object a5, Object a6) throws Throwable {
165.835 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
165.836 - a0, a1, a2, a3, a4, a5, a6); }
165.837 - protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
165.838 - Object a4, Object a5, Object a6) throws Throwable {
165.839 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
165.840 - a0, a1, a2, a3, a4, a5, a6); }
165.841 - protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
165.842 - Object a4, Object a5, Object a6) throws Throwable {
165.843 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
165.844 - a0, a1, a2, a3, a4, a5, a6); }
165.845 - protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
165.846 - Object a4, Object a5, Object a6) throws Throwable {
165.847 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6)); }
165.848 - protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
165.849 - Object a4, Object a5, Object a6) throws Throwable {
165.850 - return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6)); }
165.851 - protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
165.852 - Object a4, Object a5, Object a6) throws Throwable {
165.853 - return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6)); }
165.854 - protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
165.855 - Object a4, Object a5, Object a6) throws Throwable {
165.856 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6)); }
165.857 - protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
165.858 - Object a4, Object a5, Object a6) throws Throwable {
165.859 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6)); }
165.860 - protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
165.861 - Object a4, Object a5, Object a6) throws Throwable {
165.862 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6)); }
165.863 - protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
165.864 - Object a4, Object a5, Object a6) throws Throwable {
165.865 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6)); }
165.866 - protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
165.867 - Object a4, Object a5, Object a6) throws Throwable {
165.868 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact()); }
165.869 - protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
165.870 - Object a4, Object a5, Object a6) throws Throwable {
165.871 - Object[] av = { a0, a1, a2, a3, a4, a5, a6 };
165.872 - filter.invokeExact(av); // make the flyby
165.873 - return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6]); }
165.874 - }
165.875 - static class F8 extends Adapter {
165.876 - protected F8(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.877 - protected F8(MethodHandle e, MethodHandle f, MethodHandle t) {
165.878 - super(e, f, t); }
165.879 - protected F8 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.880 - return new F8(e, f, t); }
165.881 - protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
165.882 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.883 - return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7); }
165.884 - protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
165.885 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.886 - return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7); }
165.887 - protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
165.888 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.889 - return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7); }
165.890 - protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
165.891 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.892 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7); }
165.893 - protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
165.894 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.895 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7); }
165.896 - protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
165.897 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.898 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7); }
165.899 - protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
165.900 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.901 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7); }
165.902 - protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
165.903 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.904 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7)); }
165.905 - protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
165.906 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.907 - return target.invokeExact(filter.invokeExact(),
165.908 - a0, a1, a2, a3, a4, a5, a6, a7); }
165.909 - protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
165.910 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.911 - return target.invokeExact(filter.invokeExact(a0),
165.912 - a0, a1, a2, a3, a4, a5, a6, a7); }
165.913 - protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
165.914 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.915 - return target.invokeExact(filter.invokeExact(a0, a1),
165.916 - a0, a1, a2, a3, a4, a5, a6, a7); }
165.917 - protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
165.918 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.919 - return target.invokeExact(filter.invokeExact(a0, a1, a2),
165.920 - a0, a1, a2, a3, a4, a5, a6, a7); }
165.921 - protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
165.922 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.923 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
165.924 - a0, a1, a2, a3, a4, a5, a6, a7); }
165.925 - protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
165.926 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.927 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
165.928 - a0, a1, a2, a3, a4, a5, a6, a7); }
165.929 - protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
165.930 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.931 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
165.932 - a0, a1, a2, a3, a4, a5, a6, a7); }
165.933 - protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
165.934 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.935 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
165.936 - a0, a1, a2, a3, a4, a5, a6, a7); }
165.937 - protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
165.938 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.939 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
165.940 - a0, a1, a2, a3, a4, a5, a6, a7); }
165.941 - protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
165.942 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.943 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7)); }
165.944 - protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
165.945 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.946 - return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7)); }
165.947 - protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
165.948 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.949 - return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7)); }
165.950 - protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
165.951 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.952 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7)); }
165.953 - protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
165.954 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.955 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7)); }
165.956 - protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
165.957 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.958 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7)); }
165.959 - protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
165.960 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.961 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7)); }
165.962 - protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
165.963 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.964 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7)); }
165.965 - protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
165.966 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.967 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact()); }
165.968 - protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
165.969 - Object a4, Object a5, Object a6, Object a7) throws Throwable {
165.970 - Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7 };
165.971 - filter.invokeExact(av); // make the flyby
165.972 - return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7]); }
165.973 - }
165.974 - static class F9 extends Adapter {
165.975 - protected F9(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.976 - protected F9(MethodHandle e, MethodHandle f, MethodHandle t) {
165.977 - super(e, f, t); }
165.978 - protected F9 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.979 - return new F9(e, f, t); }
165.980 - protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
165.981 - Object a4, Object a5, Object a6, Object a7,
165.982 - Object a8) throws Throwable {
165.983 - return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8); }
165.984 - protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
165.985 - Object a4, Object a5, Object a6, Object a7,
165.986 - Object a8) throws Throwable {
165.987 - return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8); }
165.988 - protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
165.989 - Object a4, Object a5, Object a6, Object a7,
165.990 - Object a8) throws Throwable {
165.991 - return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8); }
165.992 - protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
165.993 - Object a4, Object a5, Object a6, Object a7,
165.994 - Object a8) throws Throwable {
165.995 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8); }
165.996 - protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
165.997 - Object a4, Object a5, Object a6, Object a7,
165.998 - Object a8) throws Throwable {
165.999 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8); }
165.1000 - protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
165.1001 - Object a4, Object a5, Object a6, Object a7,
165.1002 - Object a8) throws Throwable {
165.1003 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8); }
165.1004 - protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
165.1005 - Object a4, Object a5, Object a6, Object a7,
165.1006 - Object a8) throws Throwable {
165.1007 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8); }
165.1008 - protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
165.1009 - Object a4, Object a5, Object a6, Object a7,
165.1010 - Object a8) throws Throwable {
165.1011 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8); }
165.1012 - protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
165.1013 - Object a4, Object a5, Object a6, Object a7,
165.1014 - Object a8) throws Throwable {
165.1015 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8)); }
165.1016 - protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
165.1017 - Object a4, Object a5, Object a6, Object a7,
165.1018 - Object a8) throws Throwable {
165.1019 - return target.invokeExact(filter.invokeExact(),
165.1020 - a0, a1, a2, a3, a4, a5, a6, a7, a8); }
165.1021 - protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
165.1022 - Object a4, Object a5, Object a6, Object a7,
165.1023 - Object a8) throws Throwable {
165.1024 - return target.invokeExact(filter.invokeExact(a0),
165.1025 - a0, a1, a2, a3, a4, a5, a6, a7, a8); }
165.1026 - protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
165.1027 - Object a4, Object a5, Object a6, Object a7,
165.1028 - Object a8) throws Throwable {
165.1029 - return target.invokeExact(filter.invokeExact(a0, a1),
165.1030 - a0, a1, a2, a3, a4, a5, a6, a7, a8); }
165.1031 - protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
165.1032 - Object a4, Object a5, Object a6, Object a7,
165.1033 - Object a8) throws Throwable {
165.1034 - return target.invokeExact(filter.invokeExact(a0, a1, a2),
165.1035 - a0, a1, a2, a3, a4, a5, a6, a7, a8); }
165.1036 - protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
165.1037 - Object a4, Object a5, Object a6, Object a7,
165.1038 - Object a8) throws Throwable {
165.1039 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
165.1040 - a0, a1, a2, a3, a4, a5, a6, a7, a8); }
165.1041 - protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
165.1042 - Object a4, Object a5, Object a6, Object a7,
165.1043 - Object a8) throws Throwable {
165.1044 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
165.1045 - a0, a1, a2, a3, a4, a5, a6, a7, a8); }
165.1046 - protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
165.1047 - Object a4, Object a5, Object a6, Object a7,
165.1048 - Object a8) throws Throwable {
165.1049 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
165.1050 - a0, a1, a2, a3, a4, a5, a6, a7, a8); }
165.1051 - protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
165.1052 - Object a4, Object a5, Object a6, Object a7,
165.1053 - Object a8) throws Throwable {
165.1054 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
165.1055 - a0, a1, a2, a3, a4, a5, a6, a7, a8); }
165.1056 - protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
165.1057 - Object a4, Object a5, Object a6, Object a7,
165.1058 - Object a8) throws Throwable {
165.1059 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
165.1060 - a0, a1, a2, a3, a4, a5, a6, a7, a8); }
165.1061 - protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
165.1062 - Object a4, Object a5, Object a6, Object a7,
165.1063 - Object a8) throws Throwable {
165.1064 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
165.1065 - a0, a1, a2, a3, a4, a5, a6, a7, a8); }
165.1066 - protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
165.1067 - Object a4, Object a5, Object a6, Object a7,
165.1068 - Object a8) throws Throwable {
165.1069 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
165.1070 - protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
165.1071 - Object a4, Object a5, Object a6, Object a7,
165.1072 - Object a8) throws Throwable {
165.1073 - return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8)); }
165.1074 - protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
165.1075 - Object a4, Object a5, Object a6, Object a7,
165.1076 - Object a8) throws Throwable {
165.1077 - return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8)); }
165.1078 - protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
165.1079 - Object a4, Object a5, Object a6, Object a7,
165.1080 - Object a8) throws Throwable {
165.1081 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8)); }
165.1082 - protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
165.1083 - Object a4, Object a5, Object a6, Object a7,
165.1084 - Object a8) throws Throwable {
165.1085 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8)); }
165.1086 - protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
165.1087 - Object a4, Object a5, Object a6, Object a7,
165.1088 - Object a8) throws Throwable {
165.1089 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8)); }
165.1090 - protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
165.1091 - Object a4, Object a5, Object a6, Object a7,
165.1092 - Object a8) throws Throwable {
165.1093 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8)); }
165.1094 - protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
165.1095 - Object a4, Object a5, Object a6, Object a7,
165.1096 - Object a8) throws Throwable {
165.1097 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8)); }
165.1098 - protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
165.1099 - Object a4, Object a5, Object a6, Object a7,
165.1100 - Object a8) throws Throwable {
165.1101 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8)); }
165.1102 - protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
165.1103 - Object a4, Object a5, Object a6, Object a7,
165.1104 - Object a8) throws Throwable {
165.1105 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact()); }
165.1106 - protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
165.1107 - Object a4, Object a5, Object a6, Object a7,
165.1108 - Object a8) throws Throwable {
165.1109 - Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8 };
165.1110 - filter.invokeExact(av); // make the flyby
165.1111 - return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8]); }
165.1112 - }
165.1113 - static class F10 extends Adapter {
165.1114 - protected F10(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.1115 - protected F10(MethodHandle e, MethodHandle f, MethodHandle t) {
165.1116 - super(e, f, t); }
165.1117 - protected F10 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.1118 - return new F10(e, f, t); }
165.1119 - protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
165.1120 - Object a4, Object a5, Object a6, Object a7,
165.1121 - Object a8, Object a9) throws Throwable {
165.1122 - return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9); }
165.1123 - protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
165.1124 - Object a4, Object a5, Object a6, Object a7,
165.1125 - Object a8, Object a9) throws Throwable {
165.1126 - return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9); }
165.1127 - protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
165.1128 - Object a4, Object a5, Object a6, Object a7,
165.1129 - Object a8, Object a9) throws Throwable {
165.1130 - return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9); }
165.1131 - protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
165.1132 - Object a4, Object a5, Object a6, Object a7,
165.1133 - Object a8, Object a9) throws Throwable {
165.1134 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9); }
165.1135 - protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
165.1136 - Object a4, Object a5, Object a6, Object a7,
165.1137 - Object a8, Object a9) throws Throwable {
165.1138 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9); }
165.1139 - protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
165.1140 - Object a4, Object a5, Object a6, Object a7,
165.1141 - Object a8, Object a9) throws Throwable {
165.1142 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9); }
165.1143 - protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
165.1144 - Object a4, Object a5, Object a6, Object a7,
165.1145 - Object a8, Object a9) throws Throwable {
165.1146 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9); }
165.1147 - protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
165.1148 - Object a4, Object a5, Object a6, Object a7,
165.1149 - Object a8, Object a9) throws Throwable {
165.1150 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9); }
165.1151 - protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
165.1152 - Object a4, Object a5, Object a6, Object a7,
165.1153 - Object a8, Object a9) throws Throwable {
165.1154 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9); }
165.1155 - protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
165.1156 - Object a4, Object a5, Object a6, Object a7,
165.1157 - Object a8, Object a9) throws Throwable {
165.1158 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9)); }
165.1159 - protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
165.1160 - Object a4, Object a5, Object a6, Object a7,
165.1161 - Object a8, Object a9) throws Throwable {
165.1162 - return target.invokeExact(filter.invokeExact(),
165.1163 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
165.1164 - protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
165.1165 - Object a4, Object a5, Object a6, Object a7,
165.1166 - Object a8, Object a9) throws Throwable {
165.1167 - return target.invokeExact(filter.invokeExact(a0),
165.1168 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
165.1169 - protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
165.1170 - Object a4, Object a5, Object a6, Object a7,
165.1171 - Object a8, Object a9) throws Throwable {
165.1172 - return target.invokeExact(filter.invokeExact(a0, a1),
165.1173 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
165.1174 - protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
165.1175 - Object a4, Object a5, Object a6, Object a7,
165.1176 - Object a8, Object a9) throws Throwable {
165.1177 - return target.invokeExact(filter.invokeExact(a0, a1, a2),
165.1178 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
165.1179 - protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
165.1180 - Object a4, Object a5, Object a6, Object a7,
165.1181 - Object a8, Object a9) throws Throwable {
165.1182 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
165.1183 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
165.1184 - protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
165.1185 - Object a4, Object a5, Object a6, Object a7,
165.1186 - Object a8, Object a9) throws Throwable {
165.1187 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
165.1188 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
165.1189 - protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
165.1190 - Object a4, Object a5, Object a6, Object a7,
165.1191 - Object a8, Object a9) throws Throwable {
165.1192 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
165.1193 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
165.1194 - protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
165.1195 - Object a4, Object a5, Object a6, Object a7,
165.1196 - Object a8, Object a9) throws Throwable {
165.1197 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
165.1198 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
165.1199 - protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
165.1200 - Object a4, Object a5, Object a6, Object a7,
165.1201 - Object a8, Object a9) throws Throwable {
165.1202 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
165.1203 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
165.1204 - protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
165.1205 - Object a4, Object a5, Object a6, Object a7,
165.1206 - Object a8, Object a9) throws Throwable {
165.1207 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
165.1208 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
165.1209 - protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
165.1210 - Object a4, Object a5, Object a6, Object a7,
165.1211 - Object a8, Object a9) throws Throwable {
165.1212 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
165.1213 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
165.1214 - protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
165.1215 - Object a4, Object a5, Object a6, Object a7,
165.1216 - Object a8, Object a9) throws Throwable {
165.1217 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
165.1218 - protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
165.1219 - Object a4, Object a5, Object a6, Object a7,
165.1220 - Object a8, Object a9) throws Throwable {
165.1221 - return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
165.1222 - protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
165.1223 - Object a4, Object a5, Object a6, Object a7,
165.1224 - Object a8, Object a9) throws Throwable {
165.1225 - return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9)); }
165.1226 - protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
165.1227 - Object a4, Object a5, Object a6, Object a7,
165.1228 - Object a8, Object a9) throws Throwable {
165.1229 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9)); }
165.1230 - protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
165.1231 - Object a4, Object a5, Object a6, Object a7,
165.1232 - Object a8, Object a9) throws Throwable {
165.1233 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9)); }
165.1234 - protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
165.1235 - Object a4, Object a5, Object a6, Object a7,
165.1236 - Object a8, Object a9) throws Throwable {
165.1237 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9)); }
165.1238 - protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
165.1239 - Object a4, Object a5, Object a6, Object a7,
165.1240 - Object a8, Object a9) throws Throwable {
165.1241 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9)); }
165.1242 - protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
165.1243 - Object a4, Object a5, Object a6, Object a7,
165.1244 - Object a8, Object a9) throws Throwable {
165.1245 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9)); }
165.1246 - protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
165.1247 - Object a4, Object a5, Object a6, Object a7,
165.1248 - Object a8, Object a9) throws Throwable {
165.1249 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9)); }
165.1250 - protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
165.1251 - Object a4, Object a5, Object a6, Object a7,
165.1252 - Object a8, Object a9) throws Throwable {
165.1253 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9)); }
165.1254 - protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
165.1255 - Object a4, Object a5, Object a6, Object a7,
165.1256 - Object a8, Object a9) throws Throwable {
165.1257 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact()); }
165.1258 - protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
165.1259 - Object a4, Object a5, Object a6, Object a7,
165.1260 - Object a8, Object a9) throws Throwable {
165.1261 - Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9 };
165.1262 - filter.invokeExact(av); // make the flyby
165.1263 - return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9]); }
165.1264 - }
165.1265 - static class F11 extends Adapter {
165.1266 - protected F11(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.1267 - protected F11(MethodHandle e, MethodHandle f, MethodHandle t) {
165.1268 - super(e, f, t); }
165.1269 - protected F11 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.1270 - return new F11(e, f, t); }
165.1271 - protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
165.1272 - Object a4, Object a5, Object a6, Object a7,
165.1273 - Object a8, Object a9, Object a10) throws Throwable {
165.1274 - return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1275 - a10); }
165.1276 - protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
165.1277 - Object a4, Object a5, Object a6, Object a7,
165.1278 - Object a8, Object a9, Object a10) throws Throwable {
165.1279 - return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
165.1280 - a10); }
165.1281 - protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
165.1282 - Object a4, Object a5, Object a6, Object a7,
165.1283 - Object a8, Object a9, Object a10) throws Throwable {
165.1284 - return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
165.1285 - a10); }
165.1286 - protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
165.1287 - Object a4, Object a5, Object a6, Object a7,
165.1288 - Object a8, Object a9, Object a10) throws Throwable {
165.1289 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
165.1290 - a10); }
165.1291 - protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
165.1292 - Object a4, Object a5, Object a6, Object a7,
165.1293 - Object a8, Object a9, Object a10) throws Throwable {
165.1294 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
165.1295 - a10); }
165.1296 - protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
165.1297 - Object a4, Object a5, Object a6, Object a7,
165.1298 - Object a8, Object a9, Object a10) throws Throwable {
165.1299 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
165.1300 - a10); }
165.1301 - protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
165.1302 - Object a4, Object a5, Object a6, Object a7,
165.1303 - Object a8, Object a9, Object a10) throws Throwable {
165.1304 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
165.1305 - a10); }
165.1306 - protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
165.1307 - Object a4, Object a5, Object a6, Object a7,
165.1308 - Object a8, Object a9, Object a10) throws Throwable {
165.1309 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
165.1310 - a10); }
165.1311 - protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
165.1312 - Object a4, Object a5, Object a6, Object a7,
165.1313 - Object a8, Object a9, Object a10) throws Throwable {
165.1314 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
165.1315 - a10); }
165.1316 - protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
165.1317 - Object a4, Object a5, Object a6, Object a7,
165.1318 - Object a8, Object a9, Object a10) throws Throwable {
165.1319 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
165.1320 - a10); }
165.1321 - protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
165.1322 - Object a4, Object a5, Object a6, Object a7,
165.1323 - Object a8, Object a9, Object a10) throws Throwable {
165.1324 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1325 - filter.invokeExact(a10)); }
165.1326 - protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
165.1327 - Object a4, Object a5, Object a6, Object a7,
165.1328 - Object a8, Object a9, Object a10) throws Throwable {
165.1329 - return target.invokeExact(filter.invokeExact(),
165.1330 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
165.1331 - protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
165.1332 - Object a4, Object a5, Object a6, Object a7,
165.1333 - Object a8, Object a9, Object a10) throws Throwable {
165.1334 - return target.invokeExact(filter.invokeExact(a0),
165.1335 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
165.1336 - protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
165.1337 - Object a4, Object a5, Object a6, Object a7,
165.1338 - Object a8, Object a9, Object a10) throws Throwable {
165.1339 - return target.invokeExact(filter.invokeExact(a0, a1),
165.1340 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
165.1341 - protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
165.1342 - Object a4, Object a5, Object a6, Object a7,
165.1343 - Object a8, Object a9, Object a10) throws Throwable {
165.1344 - return target.invokeExact(filter.invokeExact(a0, a1, a2),
165.1345 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
165.1346 - protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
165.1347 - Object a4, Object a5, Object a6, Object a7,
165.1348 - Object a8, Object a9, Object a10) throws Throwable {
165.1349 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
165.1350 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
165.1351 - protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
165.1352 - Object a4, Object a5, Object a6, Object a7,
165.1353 - Object a8, Object a9, Object a10) throws Throwable {
165.1354 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
165.1355 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
165.1356 - protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
165.1357 - Object a4, Object a5, Object a6, Object a7,
165.1358 - Object a8, Object a9, Object a10) throws Throwable {
165.1359 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
165.1360 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
165.1361 - protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
165.1362 - Object a4, Object a5, Object a6, Object a7,
165.1363 - Object a8, Object a9, Object a10) throws Throwable {
165.1364 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
165.1365 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
165.1366 - protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
165.1367 - Object a4, Object a5, Object a6, Object a7,
165.1368 - Object a8, Object a9, Object a10) throws Throwable {
165.1369 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
165.1370 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
165.1371 - protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
165.1372 - Object a4, Object a5, Object a6, Object a7,
165.1373 - Object a8, Object a9, Object a10) throws Throwable {
165.1374 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
165.1375 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
165.1376 - protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
165.1377 - Object a4, Object a5, Object a6, Object a7,
165.1378 - Object a8, Object a9, Object a10) throws Throwable {
165.1379 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
165.1380 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
165.1381 - protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
165.1382 - Object a4, Object a5, Object a6, Object a7,
165.1383 - Object a8, Object a9, Object a10) throws Throwable {
165.1384 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10),
165.1385 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); }
165.1386 - protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
165.1387 - Object a4, Object a5, Object a6, Object a7,
165.1388 - Object a8, Object a9, Object a10) throws Throwable {
165.1389 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1390 - a10)); }
165.1391 - protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
165.1392 - Object a4, Object a5, Object a6, Object a7,
165.1393 - Object a8, Object a9, Object a10) throws Throwable {
165.1394 - return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1395 - a10)); }
165.1396 - protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
165.1397 - Object a4, Object a5, Object a6, Object a7,
165.1398 - Object a8, Object a9, Object a10) throws Throwable {
165.1399 - return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
165.1400 - a10)); }
165.1401 - protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
165.1402 - Object a4, Object a5, Object a6, Object a7,
165.1403 - Object a8, Object a9, Object a10) throws Throwable {
165.1404 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
165.1405 - a10)); }
165.1406 - protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
165.1407 - Object a4, Object a5, Object a6, Object a7,
165.1408 - Object a8, Object a9, Object a10) throws Throwable {
165.1409 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
165.1410 - a10)); }
165.1411 - protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
165.1412 - Object a4, Object a5, Object a6, Object a7,
165.1413 - Object a8, Object a9, Object a10) throws Throwable {
165.1414 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
165.1415 - a10)); }
165.1416 - protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
165.1417 - Object a4, Object a5, Object a6, Object a7,
165.1418 - Object a8, Object a9, Object a10) throws Throwable {
165.1419 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
165.1420 - a10)); }
165.1421 - protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
165.1422 - Object a4, Object a5, Object a6, Object a7,
165.1423 - Object a8, Object a9, Object a10) throws Throwable {
165.1424 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
165.1425 - a10)); }
165.1426 - protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
165.1427 - Object a4, Object a5, Object a6, Object a7,
165.1428 - Object a8, Object a9, Object a10) throws Throwable {
165.1429 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
165.1430 - a10)); }
165.1431 - protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
165.1432 - Object a4, Object a5, Object a6, Object a7,
165.1433 - Object a8, Object a9, Object a10) throws Throwable {
165.1434 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
165.1435 - a10)); }
165.1436 - protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
165.1437 - Object a4, Object a5, Object a6, Object a7,
165.1438 - Object a8, Object a9, Object a10) throws Throwable {
165.1439 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10)); }
165.1440 - protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
165.1441 - Object a4, Object a5, Object a6, Object a7,
165.1442 - Object a8, Object a9, Object a10) throws Throwable {
165.1443 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, filter.invokeExact()); }
165.1444 - protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
165.1445 - Object a4, Object a5, Object a6, Object a7,
165.1446 - Object a8, Object a9, Object a10) throws Throwable {
165.1447 - Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 };
165.1448 - filter.invokeExact(av); // make the flyby
165.1449 - return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10]); }
165.1450 - }
165.1451 - static class F12 extends Adapter {
165.1452 - protected F12(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.1453 - protected F12(MethodHandle e, MethodHandle f, MethodHandle t) {
165.1454 - super(e, f, t); }
165.1455 - protected F12 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.1456 - return new F12(e, f, t); }
165.1457 - protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
165.1458 - Object a4, Object a5, Object a6, Object a7,
165.1459 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1460 - return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1461 - a10, a11); }
165.1462 - protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
165.1463 - Object a4, Object a5, Object a6, Object a7,
165.1464 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1465 - return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
165.1466 - a10, a11); }
165.1467 - protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
165.1468 - Object a4, Object a5, Object a6, Object a7,
165.1469 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1470 - return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
165.1471 - a10, a11); }
165.1472 - protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
165.1473 - Object a4, Object a5, Object a6, Object a7,
165.1474 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1475 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
165.1476 - a10, a11); }
165.1477 - protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
165.1478 - Object a4, Object a5, Object a6, Object a7,
165.1479 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1480 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
165.1481 - a10, a11); }
165.1482 - protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
165.1483 - Object a4, Object a5, Object a6, Object a7,
165.1484 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1485 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
165.1486 - a10, a11); }
165.1487 - protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
165.1488 - Object a4, Object a5, Object a6, Object a7,
165.1489 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1490 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
165.1491 - a10, a11); }
165.1492 - protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
165.1493 - Object a4, Object a5, Object a6, Object a7,
165.1494 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1495 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
165.1496 - a10, a11); }
165.1497 - protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
165.1498 - Object a4, Object a5, Object a6, Object a7,
165.1499 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1500 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
165.1501 - a10, a11); }
165.1502 - protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
165.1503 - Object a4, Object a5, Object a6, Object a7,
165.1504 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1505 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
165.1506 - a10, a11); }
165.1507 - protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
165.1508 - Object a4, Object a5, Object a6, Object a7,
165.1509 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1510 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1511 - filter.invokeExact(a10), a11); }
165.1512 - protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
165.1513 - Object a4, Object a5, Object a6, Object a7,
165.1514 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1515 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1516 - a10, filter.invokeExact(a11)); }
165.1517 - protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
165.1518 - Object a4, Object a5, Object a6, Object a7,
165.1519 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1520 - return target.invokeExact(filter.invokeExact(),
165.1521 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
165.1522 - protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
165.1523 - Object a4, Object a5, Object a6, Object a7,
165.1524 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1525 - return target.invokeExact(filter.invokeExact(a0),
165.1526 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
165.1527 - protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
165.1528 - Object a4, Object a5, Object a6, Object a7,
165.1529 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1530 - return target.invokeExact(filter.invokeExact(a0, a1),
165.1531 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
165.1532 - protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
165.1533 - Object a4, Object a5, Object a6, Object a7,
165.1534 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1535 - return target.invokeExact(filter.invokeExact(a0, a1, a2),
165.1536 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
165.1537 - protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
165.1538 - Object a4, Object a5, Object a6, Object a7,
165.1539 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1540 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
165.1541 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
165.1542 - protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
165.1543 - Object a4, Object a5, Object a6, Object a7,
165.1544 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1545 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
165.1546 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
165.1547 - protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
165.1548 - Object a4, Object a5, Object a6, Object a7,
165.1549 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1550 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
165.1551 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
165.1552 - protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
165.1553 - Object a4, Object a5, Object a6, Object a7,
165.1554 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1555 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
165.1556 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
165.1557 - protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
165.1558 - Object a4, Object a5, Object a6, Object a7,
165.1559 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1560 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
165.1561 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
165.1562 - protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
165.1563 - Object a4, Object a5, Object a6, Object a7,
165.1564 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1565 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
165.1566 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
165.1567 - protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
165.1568 - Object a4, Object a5, Object a6, Object a7,
165.1569 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1570 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
165.1571 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
165.1572 - protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
165.1573 - Object a4, Object a5, Object a6, Object a7,
165.1574 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1575 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1576 - a10),
165.1577 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
165.1578 - protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
165.1579 - Object a4, Object a5, Object a6, Object a7,
165.1580 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1581 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11),
165.1582 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); }
165.1583 - protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
165.1584 - Object a4, Object a5, Object a6, Object a7,
165.1585 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1586 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1587 - a10, a11)); }
165.1588 - protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
165.1589 - Object a4, Object a5, Object a6, Object a7,
165.1590 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1591 - return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1592 - a10, a11)); }
165.1593 - protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
165.1594 - Object a4, Object a5, Object a6, Object a7,
165.1595 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1596 - return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
165.1597 - a10, a11)); }
165.1598 - protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
165.1599 - Object a4, Object a5, Object a6, Object a7,
165.1600 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1601 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
165.1602 - a10, a11)); }
165.1603 - protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
165.1604 - Object a4, Object a5, Object a6, Object a7,
165.1605 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1606 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
165.1607 - a10, a11)); }
165.1608 - protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
165.1609 - Object a4, Object a5, Object a6, Object a7,
165.1610 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1611 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
165.1612 - a10, a11)); }
165.1613 - protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
165.1614 - Object a4, Object a5, Object a6, Object a7,
165.1615 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1616 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
165.1617 - a10, a11)); }
165.1618 - protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
165.1619 - Object a4, Object a5, Object a6, Object a7,
165.1620 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1621 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
165.1622 - a10, a11)); }
165.1623 - protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
165.1624 - Object a4, Object a5, Object a6, Object a7,
165.1625 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1626 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
165.1627 - a10, a11)); }
165.1628 - protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
165.1629 - Object a4, Object a5, Object a6, Object a7,
165.1630 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1631 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
165.1632 - a10, a11)); }
165.1633 - protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
165.1634 - Object a4, Object a5, Object a6, Object a7,
165.1635 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1636 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11)); }
165.1637 - protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
165.1638 - Object a4, Object a5, Object a6, Object a7,
165.1639 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1640 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1641 - a10, filter.invokeExact(a11)); }
165.1642 - protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
165.1643 - Object a4, Object a5, Object a6, Object a7,
165.1644 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1645 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, filter.invokeExact()); }
165.1646 - protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
165.1647 - Object a4, Object a5, Object a6, Object a7,
165.1648 - Object a8, Object a9, Object a10, Object a11) throws Throwable {
165.1649 - Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11 };
165.1650 - filter.invokeExact(av); // make the flyby
165.1651 - return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11]); }
165.1652 - }
165.1653 - static class F13 extends Adapter {
165.1654 - protected F13(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.1655 - protected F13(MethodHandle e, MethodHandle f, MethodHandle t) {
165.1656 - super(e, f, t); }
165.1657 - protected F13 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.1658 - return new F13(e, f, t); }
165.1659 - protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
165.1660 - Object a4, Object a5, Object a6, Object a7,
165.1661 - Object a8, Object a9, Object a10, Object a11,
165.1662 - Object a12) throws Throwable {
165.1663 - return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1664 - a10, a11, a12); }
165.1665 - protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
165.1666 - Object a4, Object a5, Object a6, Object a7,
165.1667 - Object a8, Object a9, Object a10, Object a11,
165.1668 - Object a12) throws Throwable {
165.1669 - return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
165.1670 - a10, a11, a12); }
165.1671 - protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
165.1672 - Object a4, Object a5, Object a6, Object a7,
165.1673 - Object a8, Object a9, Object a10, Object a11,
165.1674 - Object a12) throws Throwable {
165.1675 - return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
165.1676 - a10, a11, a12); }
165.1677 - protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
165.1678 - Object a4, Object a5, Object a6, Object a7,
165.1679 - Object a8, Object a9, Object a10, Object a11,
165.1680 - Object a12) throws Throwable {
165.1681 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
165.1682 - a10, a11, a12); }
165.1683 - protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
165.1684 - Object a4, Object a5, Object a6, Object a7,
165.1685 - Object a8, Object a9, Object a10, Object a11,
165.1686 - Object a12) throws Throwable {
165.1687 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
165.1688 - a10, a11, a12); }
165.1689 - protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
165.1690 - Object a4, Object a5, Object a6, Object a7,
165.1691 - Object a8, Object a9, Object a10, Object a11,
165.1692 - Object a12) throws Throwable {
165.1693 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
165.1694 - a10, a11, a12); }
165.1695 - protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
165.1696 - Object a4, Object a5, Object a6, Object a7,
165.1697 - Object a8, Object a9, Object a10, Object a11,
165.1698 - Object a12) throws Throwable {
165.1699 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
165.1700 - a10, a11, a12); }
165.1701 - protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
165.1702 - Object a4, Object a5, Object a6, Object a7,
165.1703 - Object a8, Object a9, Object a10, Object a11,
165.1704 - Object a12) throws Throwable {
165.1705 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
165.1706 - a10, a11, a12); }
165.1707 - protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
165.1708 - Object a4, Object a5, Object a6, Object a7,
165.1709 - Object a8, Object a9, Object a10, Object a11,
165.1710 - Object a12) throws Throwable {
165.1711 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
165.1712 - a10, a11, a12); }
165.1713 - protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
165.1714 - Object a4, Object a5, Object a6, Object a7,
165.1715 - Object a8, Object a9, Object a10, Object a11,
165.1716 - Object a12) throws Throwable {
165.1717 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
165.1718 - a10, a11, a12); }
165.1719 - protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
165.1720 - Object a4, Object a5, Object a6, Object a7,
165.1721 - Object a8, Object a9, Object a10, Object a11,
165.1722 - Object a12) throws Throwable {
165.1723 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1724 - filter.invokeExact(a10), a11, a12); }
165.1725 - protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
165.1726 - Object a4, Object a5, Object a6, Object a7,
165.1727 - Object a8, Object a9, Object a10, Object a11,
165.1728 - Object a12) throws Throwable {
165.1729 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1730 - a10, filter.invokeExact(a11), a12); }
165.1731 - protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
165.1732 - Object a4, Object a5, Object a6, Object a7,
165.1733 - Object a8, Object a9, Object a10, Object a11,
165.1734 - Object a12) throws Throwable {
165.1735 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1736 - a10, a11, filter.invokeExact(a12)); }
165.1737 - protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
165.1738 - Object a4, Object a5, Object a6, Object a7,
165.1739 - Object a8, Object a9, Object a10, Object a11,
165.1740 - Object a12) throws Throwable {
165.1741 - return target.invokeExact(filter.invokeExact(),
165.1742 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
165.1743 - protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
165.1744 - Object a4, Object a5, Object a6, Object a7,
165.1745 - Object a8, Object a9, Object a10, Object a11,
165.1746 - Object a12) throws Throwable {
165.1747 - return target.invokeExact(filter.invokeExact(a0),
165.1748 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
165.1749 - protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
165.1750 - Object a4, Object a5, Object a6, Object a7,
165.1751 - Object a8, Object a9, Object a10, Object a11,
165.1752 - Object a12) throws Throwable {
165.1753 - return target.invokeExact(filter.invokeExact(a0, a1),
165.1754 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
165.1755 - protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
165.1756 - Object a4, Object a5, Object a6, Object a7,
165.1757 - Object a8, Object a9, Object a10, Object a11,
165.1758 - Object a12) throws Throwable {
165.1759 - return target.invokeExact(filter.invokeExact(a0, a1, a2),
165.1760 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
165.1761 - protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
165.1762 - Object a4, Object a5, Object a6, Object a7,
165.1763 - Object a8, Object a9, Object a10, Object a11,
165.1764 - Object a12) throws Throwable {
165.1765 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
165.1766 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
165.1767 - protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
165.1768 - Object a4, Object a5, Object a6, Object a7,
165.1769 - Object a8, Object a9, Object a10, Object a11,
165.1770 - Object a12) throws Throwable {
165.1771 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
165.1772 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
165.1773 - protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
165.1774 - Object a4, Object a5, Object a6, Object a7,
165.1775 - Object a8, Object a9, Object a10, Object a11,
165.1776 - Object a12) throws Throwable {
165.1777 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
165.1778 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
165.1779 - protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
165.1780 - Object a4, Object a5, Object a6, Object a7,
165.1781 - Object a8, Object a9, Object a10, Object a11,
165.1782 - Object a12) throws Throwable {
165.1783 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
165.1784 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
165.1785 - protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
165.1786 - Object a4, Object a5, Object a6, Object a7,
165.1787 - Object a8, Object a9, Object a10, Object a11,
165.1788 - Object a12) throws Throwable {
165.1789 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
165.1790 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
165.1791 - protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
165.1792 - Object a4, Object a5, Object a6, Object a7,
165.1793 - Object a8, Object a9, Object a10, Object a11,
165.1794 - Object a12) throws Throwable {
165.1795 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
165.1796 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
165.1797 - protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
165.1798 - Object a4, Object a5, Object a6, Object a7,
165.1799 - Object a8, Object a9, Object a10, Object a11,
165.1800 - Object a12) throws Throwable {
165.1801 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
165.1802 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
165.1803 - protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
165.1804 - Object a4, Object a5, Object a6, Object a7,
165.1805 - Object a8, Object a9, Object a10, Object a11,
165.1806 - Object a12) throws Throwable {
165.1807 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1808 - a10),
165.1809 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
165.1810 - protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
165.1811 - Object a4, Object a5, Object a6, Object a7,
165.1812 - Object a8, Object a9, Object a10, Object a11,
165.1813 - Object a12) throws Throwable {
165.1814 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1815 - a10, a11),
165.1816 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
165.1817 - protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
165.1818 - Object a4, Object a5, Object a6, Object a7,
165.1819 - Object a8, Object a9, Object a10, Object a11,
165.1820 - Object a12) throws Throwable {
165.1821 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12),
165.1822 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); }
165.1823 - protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
165.1824 - Object a4, Object a5, Object a6, Object a7,
165.1825 - Object a8, Object a9, Object a10, Object a11,
165.1826 - Object a12) throws Throwable {
165.1827 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1828 - a10, a11, a12)); }
165.1829 - protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
165.1830 - Object a4, Object a5, Object a6, Object a7,
165.1831 - Object a8, Object a9, Object a10, Object a11,
165.1832 - Object a12) throws Throwable {
165.1833 - return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1834 - a10, a11, a12)); }
165.1835 - protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
165.1836 - Object a4, Object a5, Object a6, Object a7,
165.1837 - Object a8, Object a9, Object a10, Object a11,
165.1838 - Object a12) throws Throwable {
165.1839 - return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
165.1840 - a10, a11, a12)); }
165.1841 - protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
165.1842 - Object a4, Object a5, Object a6, Object a7,
165.1843 - Object a8, Object a9, Object a10, Object a11,
165.1844 - Object a12) throws Throwable {
165.1845 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
165.1846 - a10, a11, a12)); }
165.1847 - protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
165.1848 - Object a4, Object a5, Object a6, Object a7,
165.1849 - Object a8, Object a9, Object a10, Object a11,
165.1850 - Object a12) throws Throwable {
165.1851 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
165.1852 - a10, a11, a12)); }
165.1853 - protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
165.1854 - Object a4, Object a5, Object a6, Object a7,
165.1855 - Object a8, Object a9, Object a10, Object a11,
165.1856 - Object a12) throws Throwable {
165.1857 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
165.1858 - a10, a11, a12)); }
165.1859 - protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
165.1860 - Object a4, Object a5, Object a6, Object a7,
165.1861 - Object a8, Object a9, Object a10, Object a11,
165.1862 - Object a12) throws Throwable {
165.1863 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
165.1864 - a10, a11, a12)); }
165.1865 - protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
165.1866 - Object a4, Object a5, Object a6, Object a7,
165.1867 - Object a8, Object a9, Object a10, Object a11,
165.1868 - Object a12) throws Throwable {
165.1869 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
165.1870 - a10, a11, a12)); }
165.1871 - protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
165.1872 - Object a4, Object a5, Object a6, Object a7,
165.1873 - Object a8, Object a9, Object a10, Object a11,
165.1874 - Object a12) throws Throwable {
165.1875 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
165.1876 - a10, a11, a12)); }
165.1877 - protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
165.1878 - Object a4, Object a5, Object a6, Object a7,
165.1879 - Object a8, Object a9, Object a10, Object a11,
165.1880 - Object a12) throws Throwable {
165.1881 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
165.1882 - a10, a11, a12)); }
165.1883 - protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
165.1884 - Object a4, Object a5, Object a6, Object a7,
165.1885 - Object a8, Object a9, Object a10, Object a11,
165.1886 - Object a12) throws Throwable {
165.1887 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12)); }
165.1888 - protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
165.1889 - Object a4, Object a5, Object a6, Object a7,
165.1890 - Object a8, Object a9, Object a10, Object a11,
165.1891 - Object a12) throws Throwable {
165.1892 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1893 - a10, filter.invokeExact(a11, a12)); }
165.1894 - protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
165.1895 - Object a4, Object a5, Object a6, Object a7,
165.1896 - Object a8, Object a9, Object a10, Object a11,
165.1897 - Object a12) throws Throwable {
165.1898 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1899 - a10, a11, filter.invokeExact(a12)); }
165.1900 - protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
165.1901 - Object a4, Object a5, Object a6, Object a7,
165.1902 - Object a8, Object a9, Object a10, Object a11,
165.1903 - Object a12) throws Throwable {
165.1904 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, filter.invokeExact()); }
165.1905 - protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
165.1906 - Object a4, Object a5, Object a6, Object a7,
165.1907 - Object a8, Object a9, Object a10, Object a11,
165.1908 - Object a12) throws Throwable {
165.1909 - Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12 };
165.1910 - filter.invokeExact(av); // make the flyby
165.1911 - return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12]); }
165.1912 - }
165.1913 - static class F14 extends Adapter {
165.1914 - protected F14(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.1915 - protected F14(MethodHandle e, MethodHandle f, MethodHandle t) {
165.1916 - super(e, f, t); }
165.1917 - protected F14 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.1918 - return new F14(e, f, t); }
165.1919 - protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
165.1920 - Object a4, Object a5, Object a6, Object a7,
165.1921 - Object a8, Object a9, Object a10, Object a11,
165.1922 - Object a12, Object a13) throws Throwable {
165.1923 - return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1924 - a10, a11, a12, a13); }
165.1925 - protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
165.1926 - Object a4, Object a5, Object a6, Object a7,
165.1927 - Object a8, Object a9, Object a10, Object a11,
165.1928 - Object a12, Object a13) throws Throwable {
165.1929 - return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
165.1930 - a10, a11, a12, a13); }
165.1931 - protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
165.1932 - Object a4, Object a5, Object a6, Object a7,
165.1933 - Object a8, Object a9, Object a10, Object a11,
165.1934 - Object a12, Object a13) throws Throwable {
165.1935 - return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
165.1936 - a10, a11, a12, a13); }
165.1937 - protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
165.1938 - Object a4, Object a5, Object a6, Object a7,
165.1939 - Object a8, Object a9, Object a10, Object a11,
165.1940 - Object a12, Object a13) throws Throwable {
165.1941 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
165.1942 - a10, a11, a12, a13); }
165.1943 - protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
165.1944 - Object a4, Object a5, Object a6, Object a7,
165.1945 - Object a8, Object a9, Object a10, Object a11,
165.1946 - Object a12, Object a13) throws Throwable {
165.1947 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
165.1948 - a10, a11, a12, a13); }
165.1949 - protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
165.1950 - Object a4, Object a5, Object a6, Object a7,
165.1951 - Object a8, Object a9, Object a10, Object a11,
165.1952 - Object a12, Object a13) throws Throwable {
165.1953 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
165.1954 - a10, a11, a12, a13); }
165.1955 - protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
165.1956 - Object a4, Object a5, Object a6, Object a7,
165.1957 - Object a8, Object a9, Object a10, Object a11,
165.1958 - Object a12, Object a13) throws Throwable {
165.1959 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
165.1960 - a10, a11, a12, a13); }
165.1961 - protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
165.1962 - Object a4, Object a5, Object a6, Object a7,
165.1963 - Object a8, Object a9, Object a10, Object a11,
165.1964 - Object a12, Object a13) throws Throwable {
165.1965 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
165.1966 - a10, a11, a12, a13); }
165.1967 - protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
165.1968 - Object a4, Object a5, Object a6, Object a7,
165.1969 - Object a8, Object a9, Object a10, Object a11,
165.1970 - Object a12, Object a13) throws Throwable {
165.1971 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
165.1972 - a10, a11, a12, a13); }
165.1973 - protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
165.1974 - Object a4, Object a5, Object a6, Object a7,
165.1975 - Object a8, Object a9, Object a10, Object a11,
165.1976 - Object a12, Object a13) throws Throwable {
165.1977 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
165.1978 - a10, a11, a12, a13); }
165.1979 - protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
165.1980 - Object a4, Object a5, Object a6, Object a7,
165.1981 - Object a8, Object a9, Object a10, Object a11,
165.1982 - Object a12, Object a13) throws Throwable {
165.1983 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1984 - filter.invokeExact(a10), a11, a12, a13); }
165.1985 - protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
165.1986 - Object a4, Object a5, Object a6, Object a7,
165.1987 - Object a8, Object a9, Object a10, Object a11,
165.1988 - Object a12, Object a13) throws Throwable {
165.1989 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1990 - a10, filter.invokeExact(a11), a12, a13); }
165.1991 - protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
165.1992 - Object a4, Object a5, Object a6, Object a7,
165.1993 - Object a8, Object a9, Object a10, Object a11,
165.1994 - Object a12, Object a13) throws Throwable {
165.1995 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.1996 - a10, a11, filter.invokeExact(a12), a13); }
165.1997 - protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
165.1998 - Object a4, Object a5, Object a6, Object a7,
165.1999 - Object a8, Object a9, Object a10, Object a11,
165.2000 - Object a12, Object a13) throws Throwable {
165.2001 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2002 - a10, a11, a12, filter.invokeExact(a13)); }
165.2003 - protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
165.2004 - Object a4, Object a5, Object a6, Object a7,
165.2005 - Object a8, Object a9, Object a10, Object a11,
165.2006 - Object a12, Object a13) throws Throwable {
165.2007 - return target.invokeExact(filter.invokeExact(),
165.2008 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
165.2009 - protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
165.2010 - Object a4, Object a5, Object a6, Object a7,
165.2011 - Object a8, Object a9, Object a10, Object a11,
165.2012 - Object a12, Object a13) throws Throwable {
165.2013 - return target.invokeExact(filter.invokeExact(a0),
165.2014 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
165.2015 - protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
165.2016 - Object a4, Object a5, Object a6, Object a7,
165.2017 - Object a8, Object a9, Object a10, Object a11,
165.2018 - Object a12, Object a13) throws Throwable {
165.2019 - return target.invokeExact(filter.invokeExact(a0, a1),
165.2020 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
165.2021 - protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
165.2022 - Object a4, Object a5, Object a6, Object a7,
165.2023 - Object a8, Object a9, Object a10, Object a11,
165.2024 - Object a12, Object a13) throws Throwable {
165.2025 - return target.invokeExact(filter.invokeExact(a0, a1, a2),
165.2026 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
165.2027 - protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
165.2028 - Object a4, Object a5, Object a6, Object a7,
165.2029 - Object a8, Object a9, Object a10, Object a11,
165.2030 - Object a12, Object a13) throws Throwable {
165.2031 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
165.2032 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
165.2033 - protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
165.2034 - Object a4, Object a5, Object a6, Object a7,
165.2035 - Object a8, Object a9, Object a10, Object a11,
165.2036 - Object a12, Object a13) throws Throwable {
165.2037 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
165.2038 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
165.2039 - protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
165.2040 - Object a4, Object a5, Object a6, Object a7,
165.2041 - Object a8, Object a9, Object a10, Object a11,
165.2042 - Object a12, Object a13) throws Throwable {
165.2043 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
165.2044 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
165.2045 - protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
165.2046 - Object a4, Object a5, Object a6, Object a7,
165.2047 - Object a8, Object a9, Object a10, Object a11,
165.2048 - Object a12, Object a13) throws Throwable {
165.2049 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
165.2050 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
165.2051 - protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
165.2052 - Object a4, Object a5, Object a6, Object a7,
165.2053 - Object a8, Object a9, Object a10, Object a11,
165.2054 - Object a12, Object a13) throws Throwable {
165.2055 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
165.2056 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
165.2057 - protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
165.2058 - Object a4, Object a5, Object a6, Object a7,
165.2059 - Object a8, Object a9, Object a10, Object a11,
165.2060 - Object a12, Object a13) throws Throwable {
165.2061 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
165.2062 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
165.2063 - protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
165.2064 - Object a4, Object a5, Object a6, Object a7,
165.2065 - Object a8, Object a9, Object a10, Object a11,
165.2066 - Object a12, Object a13) throws Throwable {
165.2067 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
165.2068 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
165.2069 - protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
165.2070 - Object a4, Object a5, Object a6, Object a7,
165.2071 - Object a8, Object a9, Object a10, Object a11,
165.2072 - Object a12, Object a13) throws Throwable {
165.2073 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2074 - a10),
165.2075 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
165.2076 - protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
165.2077 - Object a4, Object a5, Object a6, Object a7,
165.2078 - Object a8, Object a9, Object a10, Object a11,
165.2079 - Object a12, Object a13) throws Throwable {
165.2080 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2081 - a10, a11),
165.2082 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
165.2083 - protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
165.2084 - Object a4, Object a5, Object a6, Object a7,
165.2085 - Object a8, Object a9, Object a10, Object a11,
165.2086 - Object a12, Object a13) throws Throwable {
165.2087 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2088 - a10, a11, a12),
165.2089 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
165.2090 - protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
165.2091 - Object a4, Object a5, Object a6, Object a7,
165.2092 - Object a8, Object a9, Object a10, Object a11,
165.2093 - Object a12, Object a13) throws Throwable {
165.2094 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13),
165.2095 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); }
165.2096 - protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
165.2097 - Object a4, Object a5, Object a6, Object a7,
165.2098 - Object a8, Object a9, Object a10, Object a11,
165.2099 - Object a12, Object a13) throws Throwable {
165.2100 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2101 - a10, a11, a12, a13)); }
165.2102 - protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
165.2103 - Object a4, Object a5, Object a6, Object a7,
165.2104 - Object a8, Object a9, Object a10, Object a11,
165.2105 - Object a12, Object a13) throws Throwable {
165.2106 - return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2107 - a10, a11, a12, a13)); }
165.2108 - protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
165.2109 - Object a4, Object a5, Object a6, Object a7,
165.2110 - Object a8, Object a9, Object a10, Object a11,
165.2111 - Object a12, Object a13) throws Throwable {
165.2112 - return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
165.2113 - a10, a11, a12, a13)); }
165.2114 - protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
165.2115 - Object a4, Object a5, Object a6, Object a7,
165.2116 - Object a8, Object a9, Object a10, Object a11,
165.2117 - Object a12, Object a13) throws Throwable {
165.2118 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
165.2119 - a10, a11, a12, a13)); }
165.2120 - protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
165.2121 - Object a4, Object a5, Object a6, Object a7,
165.2122 - Object a8, Object a9, Object a10, Object a11,
165.2123 - Object a12, Object a13) throws Throwable {
165.2124 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
165.2125 - a10, a11, a12, a13)); }
165.2126 - protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
165.2127 - Object a4, Object a5, Object a6, Object a7,
165.2128 - Object a8, Object a9, Object a10, Object a11,
165.2129 - Object a12, Object a13) throws Throwable {
165.2130 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
165.2131 - a10, a11, a12, a13)); }
165.2132 - protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
165.2133 - Object a4, Object a5, Object a6, Object a7,
165.2134 - Object a8, Object a9, Object a10, Object a11,
165.2135 - Object a12, Object a13) throws Throwable {
165.2136 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
165.2137 - a10, a11, a12, a13)); }
165.2138 - protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
165.2139 - Object a4, Object a5, Object a6, Object a7,
165.2140 - Object a8, Object a9, Object a10, Object a11,
165.2141 - Object a12, Object a13) throws Throwable {
165.2142 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
165.2143 - a10, a11, a12, a13)); }
165.2144 - protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
165.2145 - Object a4, Object a5, Object a6, Object a7,
165.2146 - Object a8, Object a9, Object a10, Object a11,
165.2147 - Object a12, Object a13) throws Throwable {
165.2148 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
165.2149 - a10, a11, a12, a13)); }
165.2150 - protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
165.2151 - Object a4, Object a5, Object a6, Object a7,
165.2152 - Object a8, Object a9, Object a10, Object a11,
165.2153 - Object a12, Object a13) throws Throwable {
165.2154 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
165.2155 - a10, a11, a12, a13)); }
165.2156 - protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
165.2157 - Object a4, Object a5, Object a6, Object a7,
165.2158 - Object a8, Object a9, Object a10, Object a11,
165.2159 - Object a12, Object a13) throws Throwable {
165.2160 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13)); }
165.2161 - protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
165.2162 - Object a4, Object a5, Object a6, Object a7,
165.2163 - Object a8, Object a9, Object a10, Object a11,
165.2164 - Object a12, Object a13) throws Throwable {
165.2165 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2166 - a10, filter.invokeExact(a11, a12, a13)); }
165.2167 - protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
165.2168 - Object a4, Object a5, Object a6, Object a7,
165.2169 - Object a8, Object a9, Object a10, Object a11,
165.2170 - Object a12, Object a13) throws Throwable {
165.2171 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2172 - a10, a11, filter.invokeExact(a12, a13)); }
165.2173 - protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
165.2174 - Object a4, Object a5, Object a6, Object a7,
165.2175 - Object a8, Object a9, Object a10, Object a11,
165.2176 - Object a12, Object a13) throws Throwable {
165.2177 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2178 - a10, a11, a12, filter.invokeExact(a13)); }
165.2179 - protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
165.2180 - Object a4, Object a5, Object a6, Object a7,
165.2181 - Object a8, Object a9, Object a10, Object a11,
165.2182 - Object a12, Object a13) throws Throwable {
165.2183 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, filter.invokeExact()); }
165.2184 - protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
165.2185 - Object a4, Object a5, Object a6, Object a7,
165.2186 - Object a8, Object a9, Object a10, Object a11,
165.2187 - Object a12, Object a13) throws Throwable {
165.2188 - Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13 };
165.2189 - filter.invokeExact(av); // make the flyby
165.2190 - return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13]); }
165.2191 - }
165.2192 - static class F15 extends Adapter {
165.2193 - protected F15(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.2194 - protected F15(MethodHandle e, MethodHandle f, MethodHandle t) {
165.2195 - super(e, f, t); }
165.2196 - protected F15 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.2197 - return new F15(e, f, t); }
165.2198 - protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
165.2199 - Object a4, Object a5, Object a6, Object a7,
165.2200 - Object a8, Object a9, Object a10, Object a11,
165.2201 - Object a12, Object a13, Object a14) throws Throwable {
165.2202 - return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2203 - a10, a11, a12, a13, a14); }
165.2204 - protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
165.2205 - Object a4, Object a5, Object a6, Object a7,
165.2206 - Object a8, Object a9, Object a10, Object a11,
165.2207 - Object a12, Object a13, Object a14) throws Throwable {
165.2208 - return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
165.2209 - a10, a11, a12, a13, a14); }
165.2210 - protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
165.2211 - Object a4, Object a5, Object a6, Object a7,
165.2212 - Object a8, Object a9, Object a10, Object a11,
165.2213 - Object a12, Object a13, Object a14) throws Throwable {
165.2214 - return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
165.2215 - a10, a11, a12, a13, a14); }
165.2216 - protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
165.2217 - Object a4, Object a5, Object a6, Object a7,
165.2218 - Object a8, Object a9, Object a10, Object a11,
165.2219 - Object a12, Object a13, Object a14) throws Throwable {
165.2220 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
165.2221 - a10, a11, a12, a13, a14); }
165.2222 - protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
165.2223 - Object a4, Object a5, Object a6, Object a7,
165.2224 - Object a8, Object a9, Object a10, Object a11,
165.2225 - Object a12, Object a13, Object a14) throws Throwable {
165.2226 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
165.2227 - a10, a11, a12, a13, a14); }
165.2228 - protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
165.2229 - Object a4, Object a5, Object a6, Object a7,
165.2230 - Object a8, Object a9, Object a10, Object a11,
165.2231 - Object a12, Object a13, Object a14) throws Throwable {
165.2232 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
165.2233 - a10, a11, a12, a13, a14); }
165.2234 - protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
165.2235 - Object a4, Object a5, Object a6, Object a7,
165.2236 - Object a8, Object a9, Object a10, Object a11,
165.2237 - Object a12, Object a13, Object a14) throws Throwable {
165.2238 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
165.2239 - a10, a11, a12, a13, a14); }
165.2240 - protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
165.2241 - Object a4, Object a5, Object a6, Object a7,
165.2242 - Object a8, Object a9, Object a10, Object a11,
165.2243 - Object a12, Object a13, Object a14) throws Throwable {
165.2244 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
165.2245 - a10, a11, a12, a13, a14); }
165.2246 - protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
165.2247 - Object a4, Object a5, Object a6, Object a7,
165.2248 - Object a8, Object a9, Object a10, Object a11,
165.2249 - Object a12, Object a13, Object a14) throws Throwable {
165.2250 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
165.2251 - a10, a11, a12, a13, a14); }
165.2252 - protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
165.2253 - Object a4, Object a5, Object a6, Object a7,
165.2254 - Object a8, Object a9, Object a10, Object a11,
165.2255 - Object a12, Object a13, Object a14) throws Throwable {
165.2256 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
165.2257 - a10, a11, a12, a13, a14); }
165.2258 - protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
165.2259 - Object a4, Object a5, Object a6, Object a7,
165.2260 - Object a8, Object a9, Object a10, Object a11,
165.2261 - Object a12, Object a13, Object a14) throws Throwable {
165.2262 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2263 - filter.invokeExact(a10), a11, a12, a13, a14); }
165.2264 - protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
165.2265 - Object a4, Object a5, Object a6, Object a7,
165.2266 - Object a8, Object a9, Object a10, Object a11,
165.2267 - Object a12, Object a13, Object a14) throws Throwable {
165.2268 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2269 - a10, filter.invokeExact(a11), a12, a13, a14); }
165.2270 - protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
165.2271 - Object a4, Object a5, Object a6, Object a7,
165.2272 - Object a8, Object a9, Object a10, Object a11,
165.2273 - Object a12, Object a13, Object a14) throws Throwable {
165.2274 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2275 - a10, a11, filter.invokeExact(a12), a13, a14); }
165.2276 - protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
165.2277 - Object a4, Object a5, Object a6, Object a7,
165.2278 - Object a8, Object a9, Object a10, Object a11,
165.2279 - Object a12, Object a13, Object a14) throws Throwable {
165.2280 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2281 - a10, a11, a12, filter.invokeExact(a13), a14); }
165.2282 - protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3,
165.2283 - Object a4, Object a5, Object a6, Object a7,
165.2284 - Object a8, Object a9, Object a10, Object a11,
165.2285 - Object a12, Object a13, Object a14) throws Throwable {
165.2286 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2287 - a10, a11, a12, a13, filter.invokeExact(a14)); }
165.2288 - protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
165.2289 - Object a4, Object a5, Object a6, Object a7,
165.2290 - Object a8, Object a9, Object a10, Object a11,
165.2291 - Object a12, Object a13, Object a14) throws Throwable {
165.2292 - return target.invokeExact(filter.invokeExact(),
165.2293 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
165.2294 - protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
165.2295 - Object a4, Object a5, Object a6, Object a7,
165.2296 - Object a8, Object a9, Object a10, Object a11,
165.2297 - Object a12, Object a13, Object a14) throws Throwable {
165.2298 - return target.invokeExact(filter.invokeExact(a0),
165.2299 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
165.2300 - protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
165.2301 - Object a4, Object a5, Object a6, Object a7,
165.2302 - Object a8, Object a9, Object a10, Object a11,
165.2303 - Object a12, Object a13, Object a14) throws Throwable {
165.2304 - return target.invokeExact(filter.invokeExact(a0, a1),
165.2305 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
165.2306 - protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
165.2307 - Object a4, Object a5, Object a6, Object a7,
165.2308 - Object a8, Object a9, Object a10, Object a11,
165.2309 - Object a12, Object a13, Object a14) throws Throwable {
165.2310 - return target.invokeExact(filter.invokeExact(a0, a1, a2),
165.2311 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
165.2312 - protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
165.2313 - Object a4, Object a5, Object a6, Object a7,
165.2314 - Object a8, Object a9, Object a10, Object a11,
165.2315 - Object a12, Object a13, Object a14) throws Throwable {
165.2316 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
165.2317 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
165.2318 - protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
165.2319 - Object a4, Object a5, Object a6, Object a7,
165.2320 - Object a8, Object a9, Object a10, Object a11,
165.2321 - Object a12, Object a13, Object a14) throws Throwable {
165.2322 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
165.2323 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
165.2324 - protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
165.2325 - Object a4, Object a5, Object a6, Object a7,
165.2326 - Object a8, Object a9, Object a10, Object a11,
165.2327 - Object a12, Object a13, Object a14) throws Throwable {
165.2328 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
165.2329 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
165.2330 - protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
165.2331 - Object a4, Object a5, Object a6, Object a7,
165.2332 - Object a8, Object a9, Object a10, Object a11,
165.2333 - Object a12, Object a13, Object a14) throws Throwable {
165.2334 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
165.2335 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
165.2336 - protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
165.2337 - Object a4, Object a5, Object a6, Object a7,
165.2338 - Object a8, Object a9, Object a10, Object a11,
165.2339 - Object a12, Object a13, Object a14) throws Throwable {
165.2340 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
165.2341 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
165.2342 - protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
165.2343 - Object a4, Object a5, Object a6, Object a7,
165.2344 - Object a8, Object a9, Object a10, Object a11,
165.2345 - Object a12, Object a13, Object a14) throws Throwable {
165.2346 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
165.2347 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
165.2348 - protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
165.2349 - Object a4, Object a5, Object a6, Object a7,
165.2350 - Object a8, Object a9, Object a10, Object a11,
165.2351 - Object a12, Object a13, Object a14) throws Throwable {
165.2352 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
165.2353 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
165.2354 - protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
165.2355 - Object a4, Object a5, Object a6, Object a7,
165.2356 - Object a8, Object a9, Object a10, Object a11,
165.2357 - Object a12, Object a13, Object a14) throws Throwable {
165.2358 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2359 - a10),
165.2360 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
165.2361 - protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
165.2362 - Object a4, Object a5, Object a6, Object a7,
165.2363 - Object a8, Object a9, Object a10, Object a11,
165.2364 - Object a12, Object a13, Object a14) throws Throwable {
165.2365 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2366 - a10, a11),
165.2367 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
165.2368 - protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
165.2369 - Object a4, Object a5, Object a6, Object a7,
165.2370 - Object a8, Object a9, Object a10, Object a11,
165.2371 - Object a12, Object a13, Object a14) throws Throwable {
165.2372 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2373 - a10, a11, a12),
165.2374 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
165.2375 - protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
165.2376 - Object a4, Object a5, Object a6, Object a7,
165.2377 - Object a8, Object a9, Object a10, Object a11,
165.2378 - Object a12, Object a13, Object a14) throws Throwable {
165.2379 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2380 - a10, a11, a12, a13),
165.2381 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
165.2382 - protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3,
165.2383 - Object a4, Object a5, Object a6, Object a7,
165.2384 - Object a8, Object a9, Object a10, Object a11,
165.2385 - Object a12, Object a13, Object a14) throws Throwable {
165.2386 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14),
165.2387 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); }
165.2388 - protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
165.2389 - Object a4, Object a5, Object a6, Object a7,
165.2390 - Object a8, Object a9, Object a10, Object a11,
165.2391 - Object a12, Object a13, Object a14) throws Throwable {
165.2392 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2393 - a10, a11, a12, a13, a14)); }
165.2394 - protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
165.2395 - Object a4, Object a5, Object a6, Object a7,
165.2396 - Object a8, Object a9, Object a10, Object a11,
165.2397 - Object a12, Object a13, Object a14) throws Throwable {
165.2398 - return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2399 - a10, a11, a12, a13, a14)); }
165.2400 - protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
165.2401 - Object a4, Object a5, Object a6, Object a7,
165.2402 - Object a8, Object a9, Object a10, Object a11,
165.2403 - Object a12, Object a13, Object a14) throws Throwable {
165.2404 - return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
165.2405 - a10, a11, a12, a13, a14)); }
165.2406 - protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
165.2407 - Object a4, Object a5, Object a6, Object a7,
165.2408 - Object a8, Object a9, Object a10, Object a11,
165.2409 - Object a12, Object a13, Object a14) throws Throwable {
165.2410 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
165.2411 - a10, a11, a12, a13, a14)); }
165.2412 - protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
165.2413 - Object a4, Object a5, Object a6, Object a7,
165.2414 - Object a8, Object a9, Object a10, Object a11,
165.2415 - Object a12, Object a13, Object a14) throws Throwable {
165.2416 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
165.2417 - a10, a11, a12, a13, a14)); }
165.2418 - protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
165.2419 - Object a4, Object a5, Object a6, Object a7,
165.2420 - Object a8, Object a9, Object a10, Object a11,
165.2421 - Object a12, Object a13, Object a14) throws Throwable {
165.2422 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
165.2423 - a10, a11, a12, a13, a14)); }
165.2424 - protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
165.2425 - Object a4, Object a5, Object a6, Object a7,
165.2426 - Object a8, Object a9, Object a10, Object a11,
165.2427 - Object a12, Object a13, Object a14) throws Throwable {
165.2428 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
165.2429 - a10, a11, a12, a13, a14)); }
165.2430 - protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
165.2431 - Object a4, Object a5, Object a6, Object a7,
165.2432 - Object a8, Object a9, Object a10, Object a11,
165.2433 - Object a12, Object a13, Object a14) throws Throwable {
165.2434 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
165.2435 - a10, a11, a12, a13, a14)); }
165.2436 - protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
165.2437 - Object a4, Object a5, Object a6, Object a7,
165.2438 - Object a8, Object a9, Object a10, Object a11,
165.2439 - Object a12, Object a13, Object a14) throws Throwable {
165.2440 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
165.2441 - a10, a11, a12, a13, a14)); }
165.2442 - protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
165.2443 - Object a4, Object a5, Object a6, Object a7,
165.2444 - Object a8, Object a9, Object a10, Object a11,
165.2445 - Object a12, Object a13, Object a14) throws Throwable {
165.2446 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
165.2447 - a10, a11, a12, a13, a14)); }
165.2448 - protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
165.2449 - Object a4, Object a5, Object a6, Object a7,
165.2450 - Object a8, Object a9, Object a10, Object a11,
165.2451 - Object a12, Object a13, Object a14) throws Throwable {
165.2452 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13, a14)); }
165.2453 - protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
165.2454 - Object a4, Object a5, Object a6, Object a7,
165.2455 - Object a8, Object a9, Object a10, Object a11,
165.2456 - Object a12, Object a13, Object a14) throws Throwable {
165.2457 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2458 - a10, filter.invokeExact(a11, a12, a13, a14)); }
165.2459 - protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
165.2460 - Object a4, Object a5, Object a6, Object a7,
165.2461 - Object a8, Object a9, Object a10, Object a11,
165.2462 - Object a12, Object a13, Object a14) throws Throwable {
165.2463 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2464 - a10, a11, filter.invokeExact(a12, a13, a14)); }
165.2465 - protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
165.2466 - Object a4, Object a5, Object a6, Object a7,
165.2467 - Object a8, Object a9, Object a10, Object a11,
165.2468 - Object a12, Object a13, Object a14) throws Throwable {
165.2469 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2470 - a10, a11, a12, filter.invokeExact(a13, a14)); }
165.2471 - protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
165.2472 - Object a4, Object a5, Object a6, Object a7,
165.2473 - Object a8, Object a9, Object a10, Object a11,
165.2474 - Object a12, Object a13, Object a14) throws Throwable {
165.2475 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2476 - a10, a11, a12, a13, filter.invokeExact(a14)); }
165.2477 - protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3,
165.2478 - Object a4, Object a5, Object a6, Object a7,
165.2479 - Object a8, Object a9, Object a10, Object a11,
165.2480 - Object a12, Object a13, Object a14) throws Throwable {
165.2481 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, filter.invokeExact()); }
165.2482 - protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
165.2483 - Object a4, Object a5, Object a6, Object a7,
165.2484 - Object a8, Object a9, Object a10, Object a11,
165.2485 - Object a12, Object a13, Object a14) throws Throwable {
165.2486 - Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14 };
165.2487 - filter.invokeExact(av); // make the flyby
165.2488 - return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14]); }
165.2489 - }
165.2490 - static class F16 extends Adapter {
165.2491 - protected F16(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.2492 - protected F16(MethodHandle e, MethodHandle f, MethodHandle t) {
165.2493 - super(e, f, t); }
165.2494 - protected F16 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.2495 - return new F16(e, f, t); }
165.2496 - protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
165.2497 - Object a4, Object a5, Object a6, Object a7,
165.2498 - Object a8, Object a9, Object a10, Object a11,
165.2499 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2500 - return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2501 - a10, a11, a12, a13, a14, a15); }
165.2502 - protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
165.2503 - Object a4, Object a5, Object a6, Object a7,
165.2504 - Object a8, Object a9, Object a10, Object a11,
165.2505 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2506 - return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
165.2507 - a10, a11, a12, a13, a14, a15); }
165.2508 - protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
165.2509 - Object a4, Object a5, Object a6, Object a7,
165.2510 - Object a8, Object a9, Object a10, Object a11,
165.2511 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2512 - return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
165.2513 - a10, a11, a12, a13, a14, a15); }
165.2514 - protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
165.2515 - Object a4, Object a5, Object a6, Object a7,
165.2516 - Object a8, Object a9, Object a10, Object a11,
165.2517 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2518 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
165.2519 - a10, a11, a12, a13, a14, a15); }
165.2520 - protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
165.2521 - Object a4, Object a5, Object a6, Object a7,
165.2522 - Object a8, Object a9, Object a10, Object a11,
165.2523 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2524 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
165.2525 - a10, a11, a12, a13, a14, a15); }
165.2526 - protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
165.2527 - Object a4, Object a5, Object a6, Object a7,
165.2528 - Object a8, Object a9, Object a10, Object a11,
165.2529 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2530 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
165.2531 - a10, a11, a12, a13, a14, a15); }
165.2532 - protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
165.2533 - Object a4, Object a5, Object a6, Object a7,
165.2534 - Object a8, Object a9, Object a10, Object a11,
165.2535 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2536 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
165.2537 - a10, a11, a12, a13, a14, a15); }
165.2538 - protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
165.2539 - Object a4, Object a5, Object a6, Object a7,
165.2540 - Object a8, Object a9, Object a10, Object a11,
165.2541 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2542 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
165.2543 - a10, a11, a12, a13, a14, a15); }
165.2544 - protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
165.2545 - Object a4, Object a5, Object a6, Object a7,
165.2546 - Object a8, Object a9, Object a10, Object a11,
165.2547 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2548 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
165.2549 - a10, a11, a12, a13, a14, a15); }
165.2550 - protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
165.2551 - Object a4, Object a5, Object a6, Object a7,
165.2552 - Object a8, Object a9, Object a10, Object a11,
165.2553 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2554 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
165.2555 - a10, a11, a12, a13, a14, a15); }
165.2556 - protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
165.2557 - Object a4, Object a5, Object a6, Object a7,
165.2558 - Object a8, Object a9, Object a10, Object a11,
165.2559 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2560 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2561 - filter.invokeExact(a10), a11, a12, a13, a14, a15); }
165.2562 - protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
165.2563 - Object a4, Object a5, Object a6, Object a7,
165.2564 - Object a8, Object a9, Object a10, Object a11,
165.2565 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2566 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2567 - a10, filter.invokeExact(a11), a12, a13, a14, a15); }
165.2568 - protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
165.2569 - Object a4, Object a5, Object a6, Object a7,
165.2570 - Object a8, Object a9, Object a10, Object a11,
165.2571 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2572 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2573 - a10, a11, filter.invokeExact(a12), a13, a14, a15); }
165.2574 - protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
165.2575 - Object a4, Object a5, Object a6, Object a7,
165.2576 - Object a8, Object a9, Object a10, Object a11,
165.2577 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2578 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2579 - a10, a11, a12, filter.invokeExact(a13), a14, a15); }
165.2580 - protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3,
165.2581 - Object a4, Object a5, Object a6, Object a7,
165.2582 - Object a8, Object a9, Object a10, Object a11,
165.2583 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2584 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2585 - a10, a11, a12, a13, filter.invokeExact(a14), a15); }
165.2586 - protected Object invoke_V15(Object a0, Object a1, Object a2, Object a3,
165.2587 - Object a4, Object a5, Object a6, Object a7,
165.2588 - Object a8, Object a9, Object a10, Object a11,
165.2589 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2590 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2591 - a10, a11, a12, a13, a14, filter.invokeExact(a15)); }
165.2592 - protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
165.2593 - Object a4, Object a5, Object a6, Object a7,
165.2594 - Object a8, Object a9, Object a10, Object a11,
165.2595 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2596 - return target.invokeExact(filter.invokeExact(),
165.2597 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
165.2598 - protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
165.2599 - Object a4, Object a5, Object a6, Object a7,
165.2600 - Object a8, Object a9, Object a10, Object a11,
165.2601 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2602 - return target.invokeExact(filter.invokeExact(a0),
165.2603 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
165.2604 - protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
165.2605 - Object a4, Object a5, Object a6, Object a7,
165.2606 - Object a8, Object a9, Object a10, Object a11,
165.2607 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2608 - return target.invokeExact(filter.invokeExact(a0, a1),
165.2609 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
165.2610 - protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
165.2611 - Object a4, Object a5, Object a6, Object a7,
165.2612 - Object a8, Object a9, Object a10, Object a11,
165.2613 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2614 - return target.invokeExact(filter.invokeExact(a0, a1, a2),
165.2615 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
165.2616 - protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
165.2617 - Object a4, Object a5, Object a6, Object a7,
165.2618 - Object a8, Object a9, Object a10, Object a11,
165.2619 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2620 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
165.2621 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
165.2622 - protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
165.2623 - Object a4, Object a5, Object a6, Object a7,
165.2624 - Object a8, Object a9, Object a10, Object a11,
165.2625 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2626 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
165.2627 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
165.2628 - protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
165.2629 - Object a4, Object a5, Object a6, Object a7,
165.2630 - Object a8, Object a9, Object a10, Object a11,
165.2631 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2632 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
165.2633 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
165.2634 - protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
165.2635 - Object a4, Object a5, Object a6, Object a7,
165.2636 - Object a8, Object a9, Object a10, Object a11,
165.2637 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2638 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
165.2639 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
165.2640 - protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
165.2641 - Object a4, Object a5, Object a6, Object a7,
165.2642 - Object a8, Object a9, Object a10, Object a11,
165.2643 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2644 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
165.2645 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
165.2646 - protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
165.2647 - Object a4, Object a5, Object a6, Object a7,
165.2648 - Object a8, Object a9, Object a10, Object a11,
165.2649 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2650 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
165.2651 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
165.2652 - protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
165.2653 - Object a4, Object a5, Object a6, Object a7,
165.2654 - Object a8, Object a9, Object a10, Object a11,
165.2655 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2656 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
165.2657 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
165.2658 - protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
165.2659 - Object a4, Object a5, Object a6, Object a7,
165.2660 - Object a8, Object a9, Object a10, Object a11,
165.2661 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2662 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2663 - a10),
165.2664 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
165.2665 - protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
165.2666 - Object a4, Object a5, Object a6, Object a7,
165.2667 - Object a8, Object a9, Object a10, Object a11,
165.2668 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2669 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2670 - a10, a11),
165.2671 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
165.2672 - protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
165.2673 - Object a4, Object a5, Object a6, Object a7,
165.2674 - Object a8, Object a9, Object a10, Object a11,
165.2675 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2676 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2677 - a10, a11, a12),
165.2678 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
165.2679 - protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
165.2680 - Object a4, Object a5, Object a6, Object a7,
165.2681 - Object a8, Object a9, Object a10, Object a11,
165.2682 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2683 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2684 - a10, a11, a12, a13),
165.2685 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
165.2686 - protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3,
165.2687 - Object a4, Object a5, Object a6, Object a7,
165.2688 - Object a8, Object a9, Object a10, Object a11,
165.2689 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2690 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2691 - a10, a11, a12, a13, a14),
165.2692 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
165.2693 - protected Object invoke_F16(Object a0, Object a1, Object a2, Object a3,
165.2694 - Object a4, Object a5, Object a6, Object a7,
165.2695 - Object a8, Object a9, Object a10, Object a11,
165.2696 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2697 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15),
165.2698 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); }
165.2699 - protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
165.2700 - Object a4, Object a5, Object a6, Object a7,
165.2701 - Object a8, Object a9, Object a10, Object a11,
165.2702 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2703 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2704 - a10, a11, a12, a13, a14, a15)); }
165.2705 - protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
165.2706 - Object a4, Object a5, Object a6, Object a7,
165.2707 - Object a8, Object a9, Object a10, Object a11,
165.2708 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2709 - return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2710 - a10, a11, a12, a13, a14, a15)); }
165.2711 - protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
165.2712 - Object a4, Object a5, Object a6, Object a7,
165.2713 - Object a8, Object a9, Object a10, Object a11,
165.2714 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2715 - return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
165.2716 - a10, a11, a12, a13, a14, a15)); }
165.2717 - protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
165.2718 - Object a4, Object a5, Object a6, Object a7,
165.2719 - Object a8, Object a9, Object a10, Object a11,
165.2720 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2721 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
165.2722 - a10, a11, a12, a13, a14, a15)); }
165.2723 - protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
165.2724 - Object a4, Object a5, Object a6, Object a7,
165.2725 - Object a8, Object a9, Object a10, Object a11,
165.2726 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2727 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
165.2728 - a10, a11, a12, a13, a14, a15)); }
165.2729 - protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
165.2730 - Object a4, Object a5, Object a6, Object a7,
165.2731 - Object a8, Object a9, Object a10, Object a11,
165.2732 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2733 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
165.2734 - a10, a11, a12, a13, a14, a15)); }
165.2735 - protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
165.2736 - Object a4, Object a5, Object a6, Object a7,
165.2737 - Object a8, Object a9, Object a10, Object a11,
165.2738 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2739 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
165.2740 - a10, a11, a12, a13, a14, a15)); }
165.2741 - protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
165.2742 - Object a4, Object a5, Object a6, Object a7,
165.2743 - Object a8, Object a9, Object a10, Object a11,
165.2744 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2745 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
165.2746 - a10, a11, a12, a13, a14, a15)); }
165.2747 - protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
165.2748 - Object a4, Object a5, Object a6, Object a7,
165.2749 - Object a8, Object a9, Object a10, Object a11,
165.2750 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2751 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
165.2752 - a10, a11, a12, a13, a14, a15)); }
165.2753 - protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
165.2754 - Object a4, Object a5, Object a6, Object a7,
165.2755 - Object a8, Object a9, Object a10, Object a11,
165.2756 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2757 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
165.2758 - a10, a11, a12, a13, a14, a15)); }
165.2759 - protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
165.2760 - Object a4, Object a5, Object a6, Object a7,
165.2761 - Object a8, Object a9, Object a10, Object a11,
165.2762 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2763 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13, a14, a15)); }
165.2764 - protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
165.2765 - Object a4, Object a5, Object a6, Object a7,
165.2766 - Object a8, Object a9, Object a10, Object a11,
165.2767 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2768 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2769 - a10, filter.invokeExact(a11, a12, a13, a14, a15)); }
165.2770 - protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
165.2771 - Object a4, Object a5, Object a6, Object a7,
165.2772 - Object a8, Object a9, Object a10, Object a11,
165.2773 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2774 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2775 - a10, a11, filter.invokeExact(a12, a13, a14, a15)); }
165.2776 - protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
165.2777 - Object a4, Object a5, Object a6, Object a7,
165.2778 - Object a8, Object a9, Object a10, Object a11,
165.2779 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2780 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2781 - a10, a11, a12, filter.invokeExact(a13, a14, a15)); }
165.2782 - protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
165.2783 - Object a4, Object a5, Object a6, Object a7,
165.2784 - Object a8, Object a9, Object a10, Object a11,
165.2785 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2786 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2787 - a10, a11, a12, a13, filter.invokeExact(a14, a15)); }
165.2788 - protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3,
165.2789 - Object a4, Object a5, Object a6, Object a7,
165.2790 - Object a8, Object a9, Object a10, Object a11,
165.2791 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2792 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2793 - a10, a11, a12, a13, a14, filter.invokeExact(a15)); }
165.2794 - protected Object invoke_C16(Object a0, Object a1, Object a2, Object a3,
165.2795 - Object a4, Object a5, Object a6, Object a7,
165.2796 - Object a8, Object a9, Object a10, Object a11,
165.2797 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2798 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, filter.invokeExact()); }
165.2799 - protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
165.2800 - Object a4, Object a5, Object a6, Object a7,
165.2801 - Object a8, Object a9, Object a10, Object a11,
165.2802 - Object a12, Object a13, Object a14, Object a15) throws Throwable {
165.2803 - Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 };
165.2804 - filter.invokeExact(av); // make the flyby
165.2805 - return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14], av[15]); }
165.2806 - }
165.2807 - static class F17 extends Adapter {
165.2808 - protected F17(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.2809 - protected F17(MethodHandle e, MethodHandle f, MethodHandle t) {
165.2810 - super(e, f, t); }
165.2811 - protected F17 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.2812 - return new F17(e, f, t); }
165.2813 - protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
165.2814 - Object a4, Object a5, Object a6, Object a7,
165.2815 - Object a8, Object a9, Object a10, Object a11,
165.2816 - Object a12, Object a13, Object a14, Object a15,
165.2817 - Object a16) throws Throwable {
165.2818 - return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2819 - a10, a11, a12, a13, a14, a15, a16); }
165.2820 - protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
165.2821 - Object a4, Object a5, Object a6, Object a7,
165.2822 - Object a8, Object a9, Object a10, Object a11,
165.2823 - Object a12, Object a13, Object a14, Object a15,
165.2824 - Object a16) throws Throwable {
165.2825 - return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
165.2826 - a10, a11, a12, a13, a14, a15, a16); }
165.2827 - protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
165.2828 - Object a4, Object a5, Object a6, Object a7,
165.2829 - Object a8, Object a9, Object a10, Object a11,
165.2830 - Object a12, Object a13, Object a14, Object a15,
165.2831 - Object a16) throws Throwable {
165.2832 - return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
165.2833 - a10, a11, a12, a13, a14, a15, a16); }
165.2834 - protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
165.2835 - Object a4, Object a5, Object a6, Object a7,
165.2836 - Object a8, Object a9, Object a10, Object a11,
165.2837 - Object a12, Object a13, Object a14, Object a15,
165.2838 - Object a16) throws Throwable {
165.2839 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
165.2840 - a10, a11, a12, a13, a14, a15, a16); }
165.2841 - protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
165.2842 - Object a4, Object a5, Object a6, Object a7,
165.2843 - Object a8, Object a9, Object a10, Object a11,
165.2844 - Object a12, Object a13, Object a14, Object a15,
165.2845 - Object a16) throws Throwable {
165.2846 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
165.2847 - a10, a11, a12, a13, a14, a15, a16); }
165.2848 - protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
165.2849 - Object a4, Object a5, Object a6, Object a7,
165.2850 - Object a8, Object a9, Object a10, Object a11,
165.2851 - Object a12, Object a13, Object a14, Object a15,
165.2852 - Object a16) throws Throwable {
165.2853 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
165.2854 - a10, a11, a12, a13, a14, a15, a16); }
165.2855 - protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
165.2856 - Object a4, Object a5, Object a6, Object a7,
165.2857 - Object a8, Object a9, Object a10, Object a11,
165.2858 - Object a12, Object a13, Object a14, Object a15,
165.2859 - Object a16) throws Throwable {
165.2860 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
165.2861 - a10, a11, a12, a13, a14, a15, a16); }
165.2862 - protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
165.2863 - Object a4, Object a5, Object a6, Object a7,
165.2864 - Object a8, Object a9, Object a10, Object a11,
165.2865 - Object a12, Object a13, Object a14, Object a15,
165.2866 - Object a16) throws Throwable {
165.2867 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
165.2868 - a10, a11, a12, a13, a14, a15, a16); }
165.2869 - protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
165.2870 - Object a4, Object a5, Object a6, Object a7,
165.2871 - Object a8, Object a9, Object a10, Object a11,
165.2872 - Object a12, Object a13, Object a14, Object a15,
165.2873 - Object a16) throws Throwable {
165.2874 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
165.2875 - a10, a11, a12, a13, a14, a15, a16); }
165.2876 - protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
165.2877 - Object a4, Object a5, Object a6, Object a7,
165.2878 - Object a8, Object a9, Object a10, Object a11,
165.2879 - Object a12, Object a13, Object a14, Object a15,
165.2880 - Object a16) throws Throwable {
165.2881 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
165.2882 - a10, a11, a12, a13, a14, a15, a16); }
165.2883 - protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
165.2884 - Object a4, Object a5, Object a6, Object a7,
165.2885 - Object a8, Object a9, Object a10, Object a11,
165.2886 - Object a12, Object a13, Object a14, Object a15,
165.2887 - Object a16) throws Throwable {
165.2888 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2889 - filter.invokeExact(a10), a11, a12, a13, a14, a15, a16); }
165.2890 - protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
165.2891 - Object a4, Object a5, Object a6, Object a7,
165.2892 - Object a8, Object a9, Object a10, Object a11,
165.2893 - Object a12, Object a13, Object a14, Object a15,
165.2894 - Object a16) throws Throwable {
165.2895 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2896 - a10, filter.invokeExact(a11), a12, a13, a14, a15, a16); }
165.2897 - protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
165.2898 - Object a4, Object a5, Object a6, Object a7,
165.2899 - Object a8, Object a9, Object a10, Object a11,
165.2900 - Object a12, Object a13, Object a14, Object a15,
165.2901 - Object a16) throws Throwable {
165.2902 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2903 - a10, a11, filter.invokeExact(a12), a13, a14, a15, a16); }
165.2904 - protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
165.2905 - Object a4, Object a5, Object a6, Object a7,
165.2906 - Object a8, Object a9, Object a10, Object a11,
165.2907 - Object a12, Object a13, Object a14, Object a15,
165.2908 - Object a16) throws Throwable {
165.2909 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2910 - a10, a11, a12, filter.invokeExact(a13), a14, a15, a16); }
165.2911 - protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3,
165.2912 - Object a4, Object a5, Object a6, Object a7,
165.2913 - Object a8, Object a9, Object a10, Object a11,
165.2914 - Object a12, Object a13, Object a14, Object a15,
165.2915 - Object a16) throws Throwable {
165.2916 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2917 - a10, a11, a12, a13, filter.invokeExact(a14), a15, a16); }
165.2918 - protected Object invoke_V15(Object a0, Object a1, Object a2, Object a3,
165.2919 - Object a4, Object a5, Object a6, Object a7,
165.2920 - Object a8, Object a9, Object a10, Object a11,
165.2921 - Object a12, Object a13, Object a14, Object a15,
165.2922 - Object a16) throws Throwable {
165.2923 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2924 - a10, a11, a12, a13, a14, filter.invokeExact(a15), a16); }
165.2925 - protected Object invoke_V16(Object a0, Object a1, Object a2, Object a3,
165.2926 - Object a4, Object a5, Object a6, Object a7,
165.2927 - Object a8, Object a9, Object a10, Object a11,
165.2928 - Object a12, Object a13, Object a14, Object a15,
165.2929 - Object a16) throws Throwable {
165.2930 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.2931 - a10, a11, a12, a13, a14, a15, filter.invokeExact(a16)); }
165.2932 - protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
165.2933 - Object a4, Object a5, Object a6, Object a7,
165.2934 - Object a8, Object a9, Object a10, Object a11,
165.2935 - Object a12, Object a13, Object a14, Object a15,
165.2936 - Object a16) throws Throwable {
165.2937 - return target.invokeExact(filter.invokeExact(),
165.2938 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
165.2939 - protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
165.2940 - Object a4, Object a5, Object a6, Object a7,
165.2941 - Object a8, Object a9, Object a10, Object a11,
165.2942 - Object a12, Object a13, Object a14, Object a15,
165.2943 - Object a16) throws Throwable {
165.2944 - return target.invokeExact(filter.invokeExact(a0),
165.2945 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
165.2946 - protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
165.2947 - Object a4, Object a5, Object a6, Object a7,
165.2948 - Object a8, Object a9, Object a10, Object a11,
165.2949 - Object a12, Object a13, Object a14, Object a15,
165.2950 - Object a16) throws Throwable {
165.2951 - return target.invokeExact(filter.invokeExact(a0, a1),
165.2952 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
165.2953 - protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
165.2954 - Object a4, Object a5, Object a6, Object a7,
165.2955 - Object a8, Object a9, Object a10, Object a11,
165.2956 - Object a12, Object a13, Object a14, Object a15,
165.2957 - Object a16) throws Throwable {
165.2958 - return target.invokeExact(filter.invokeExact(a0, a1, a2),
165.2959 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
165.2960 - protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
165.2961 - Object a4, Object a5, Object a6, Object a7,
165.2962 - Object a8, Object a9, Object a10, Object a11,
165.2963 - Object a12, Object a13, Object a14, Object a15,
165.2964 - Object a16) throws Throwable {
165.2965 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
165.2966 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
165.2967 - protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
165.2968 - Object a4, Object a5, Object a6, Object a7,
165.2969 - Object a8, Object a9, Object a10, Object a11,
165.2970 - Object a12, Object a13, Object a14, Object a15,
165.2971 - Object a16) throws Throwable {
165.2972 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
165.2973 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
165.2974 - protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
165.2975 - Object a4, Object a5, Object a6, Object a7,
165.2976 - Object a8, Object a9, Object a10, Object a11,
165.2977 - Object a12, Object a13, Object a14, Object a15,
165.2978 - Object a16) throws Throwable {
165.2979 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
165.2980 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
165.2981 - protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
165.2982 - Object a4, Object a5, Object a6, Object a7,
165.2983 - Object a8, Object a9, Object a10, Object a11,
165.2984 - Object a12, Object a13, Object a14, Object a15,
165.2985 - Object a16) throws Throwable {
165.2986 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
165.2987 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
165.2988 - protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
165.2989 - Object a4, Object a5, Object a6, Object a7,
165.2990 - Object a8, Object a9, Object a10, Object a11,
165.2991 - Object a12, Object a13, Object a14, Object a15,
165.2992 - Object a16) throws Throwable {
165.2993 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
165.2994 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
165.2995 - protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
165.2996 - Object a4, Object a5, Object a6, Object a7,
165.2997 - Object a8, Object a9, Object a10, Object a11,
165.2998 - Object a12, Object a13, Object a14, Object a15,
165.2999 - Object a16) throws Throwable {
165.3000 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
165.3001 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
165.3002 - protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
165.3003 - Object a4, Object a5, Object a6, Object a7,
165.3004 - Object a8, Object a9, Object a10, Object a11,
165.3005 - Object a12, Object a13, Object a14, Object a15,
165.3006 - Object a16) throws Throwable {
165.3007 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
165.3008 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
165.3009 - protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
165.3010 - Object a4, Object a5, Object a6, Object a7,
165.3011 - Object a8, Object a9, Object a10, Object a11,
165.3012 - Object a12, Object a13, Object a14, Object a15,
165.3013 - Object a16) throws Throwable {
165.3014 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3015 - a10),
165.3016 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
165.3017 - protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
165.3018 - Object a4, Object a5, Object a6, Object a7,
165.3019 - Object a8, Object a9, Object a10, Object a11,
165.3020 - Object a12, Object a13, Object a14, Object a15,
165.3021 - Object a16) throws Throwable {
165.3022 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3023 - a10, a11),
165.3024 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
165.3025 - protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
165.3026 - Object a4, Object a5, Object a6, Object a7,
165.3027 - Object a8, Object a9, Object a10, Object a11,
165.3028 - Object a12, Object a13, Object a14, Object a15,
165.3029 - Object a16) throws Throwable {
165.3030 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3031 - a10, a11, a12),
165.3032 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
165.3033 - protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
165.3034 - Object a4, Object a5, Object a6, Object a7,
165.3035 - Object a8, Object a9, Object a10, Object a11,
165.3036 - Object a12, Object a13, Object a14, Object a15,
165.3037 - Object a16) throws Throwable {
165.3038 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3039 - a10, a11, a12, a13),
165.3040 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
165.3041 - protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3,
165.3042 - Object a4, Object a5, Object a6, Object a7,
165.3043 - Object a8, Object a9, Object a10, Object a11,
165.3044 - Object a12, Object a13, Object a14, Object a15,
165.3045 - Object a16) throws Throwable {
165.3046 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3047 - a10, a11, a12, a13, a14),
165.3048 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
165.3049 - protected Object invoke_F16(Object a0, Object a1, Object a2, Object a3,
165.3050 - Object a4, Object a5, Object a6, Object a7,
165.3051 - Object a8, Object a9, Object a10, Object a11,
165.3052 - Object a12, Object a13, Object a14, Object a15,
165.3053 - Object a16) throws Throwable {
165.3054 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3055 - a10, a11, a12, a13, a14, a15),
165.3056 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
165.3057 - protected Object invoke_F17(Object a0, Object a1, Object a2, Object a3,
165.3058 - Object a4, Object a5, Object a6, Object a7,
165.3059 - Object a8, Object a9, Object a10, Object a11,
165.3060 - Object a12, Object a13, Object a14, Object a15,
165.3061 - Object a16) throws Throwable {
165.3062 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16),
165.3063 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); }
165.3064 - protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
165.3065 - Object a4, Object a5, Object a6, Object a7,
165.3066 - Object a8, Object a9, Object a10, Object a11,
165.3067 - Object a12, Object a13, Object a14, Object a15,
165.3068 - Object a16) throws Throwable {
165.3069 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3070 - a10, a11, a12, a13, a14, a15, a16)); }
165.3071 - protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
165.3072 - Object a4, Object a5, Object a6, Object a7,
165.3073 - Object a8, Object a9, Object a10, Object a11,
165.3074 - Object a12, Object a13, Object a14, Object a15,
165.3075 - Object a16) throws Throwable {
165.3076 - return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3077 - a10, a11, a12, a13, a14, a15, a16)); }
165.3078 - protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
165.3079 - Object a4, Object a5, Object a6, Object a7,
165.3080 - Object a8, Object a9, Object a10, Object a11,
165.3081 - Object a12, Object a13, Object a14, Object a15,
165.3082 - Object a16) throws Throwable {
165.3083 - return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
165.3084 - a10, a11, a12, a13, a14, a15, a16)); }
165.3085 - protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
165.3086 - Object a4, Object a5, Object a6, Object a7,
165.3087 - Object a8, Object a9, Object a10, Object a11,
165.3088 - Object a12, Object a13, Object a14, Object a15,
165.3089 - Object a16) throws Throwable {
165.3090 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
165.3091 - a10, a11, a12, a13, a14, a15, a16)); }
165.3092 - protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
165.3093 - Object a4, Object a5, Object a6, Object a7,
165.3094 - Object a8, Object a9, Object a10, Object a11,
165.3095 - Object a12, Object a13, Object a14, Object a15,
165.3096 - Object a16) throws Throwable {
165.3097 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
165.3098 - a10, a11, a12, a13, a14, a15, a16)); }
165.3099 - protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
165.3100 - Object a4, Object a5, Object a6, Object a7,
165.3101 - Object a8, Object a9, Object a10, Object a11,
165.3102 - Object a12, Object a13, Object a14, Object a15,
165.3103 - Object a16) throws Throwable {
165.3104 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
165.3105 - a10, a11, a12, a13, a14, a15, a16)); }
165.3106 - protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
165.3107 - Object a4, Object a5, Object a6, Object a7,
165.3108 - Object a8, Object a9, Object a10, Object a11,
165.3109 - Object a12, Object a13, Object a14, Object a15,
165.3110 - Object a16) throws Throwable {
165.3111 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
165.3112 - a10, a11, a12, a13, a14, a15, a16)); }
165.3113 - protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
165.3114 - Object a4, Object a5, Object a6, Object a7,
165.3115 - Object a8, Object a9, Object a10, Object a11,
165.3116 - Object a12, Object a13, Object a14, Object a15,
165.3117 - Object a16) throws Throwable {
165.3118 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
165.3119 - a10, a11, a12, a13, a14, a15, a16)); }
165.3120 - protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
165.3121 - Object a4, Object a5, Object a6, Object a7,
165.3122 - Object a8, Object a9, Object a10, Object a11,
165.3123 - Object a12, Object a13, Object a14, Object a15,
165.3124 - Object a16) throws Throwable {
165.3125 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
165.3126 - a10, a11, a12, a13, a14, a15, a16)); }
165.3127 - protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
165.3128 - Object a4, Object a5, Object a6, Object a7,
165.3129 - Object a8, Object a9, Object a10, Object a11,
165.3130 - Object a12, Object a13, Object a14, Object a15,
165.3131 - Object a16) throws Throwable {
165.3132 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
165.3133 - a10, a11, a12, a13, a14, a15, a16)); }
165.3134 - protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
165.3135 - Object a4, Object a5, Object a6, Object a7,
165.3136 - Object a8, Object a9, Object a10, Object a11,
165.3137 - Object a12, Object a13, Object a14, Object a15,
165.3138 - Object a16) throws Throwable {
165.3139 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13, a14, a15, a16)); }
165.3140 - protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
165.3141 - Object a4, Object a5, Object a6, Object a7,
165.3142 - Object a8, Object a9, Object a10, Object a11,
165.3143 - Object a12, Object a13, Object a14, Object a15,
165.3144 - Object a16) throws Throwable {
165.3145 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3146 - a10, filter.invokeExact(a11, a12, a13, a14, a15, a16)); }
165.3147 - protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
165.3148 - Object a4, Object a5, Object a6, Object a7,
165.3149 - Object a8, Object a9, Object a10, Object a11,
165.3150 - Object a12, Object a13, Object a14, Object a15,
165.3151 - Object a16) throws Throwable {
165.3152 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3153 - a10, a11, filter.invokeExact(a12, a13, a14, a15, a16)); }
165.3154 - protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
165.3155 - Object a4, Object a5, Object a6, Object a7,
165.3156 - Object a8, Object a9, Object a10, Object a11,
165.3157 - Object a12, Object a13, Object a14, Object a15,
165.3158 - Object a16) throws Throwable {
165.3159 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3160 - a10, a11, a12, filter.invokeExact(a13, a14, a15, a16)); }
165.3161 - protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
165.3162 - Object a4, Object a5, Object a6, Object a7,
165.3163 - Object a8, Object a9, Object a10, Object a11,
165.3164 - Object a12, Object a13, Object a14, Object a15,
165.3165 - Object a16) throws Throwable {
165.3166 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3167 - a10, a11, a12, a13, filter.invokeExact(a14, a15, a16)); }
165.3168 - protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3,
165.3169 - Object a4, Object a5, Object a6, Object a7,
165.3170 - Object a8, Object a9, Object a10, Object a11,
165.3171 - Object a12, Object a13, Object a14, Object a15,
165.3172 - Object a16) throws Throwable {
165.3173 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3174 - a10, a11, a12, a13, a14, filter.invokeExact(a15, a16)); }
165.3175 - protected Object invoke_C16(Object a0, Object a1, Object a2, Object a3,
165.3176 - Object a4, Object a5, Object a6, Object a7,
165.3177 - Object a8, Object a9, Object a10, Object a11,
165.3178 - Object a12, Object a13, Object a14, Object a15,
165.3179 - Object a16) throws Throwable {
165.3180 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3181 - a10, a11, a12, a13, a14, a15, filter.invokeExact(a16)); }
165.3182 - protected Object invoke_C17(Object a0, Object a1, Object a2, Object a3,
165.3183 - Object a4, Object a5, Object a6, Object a7,
165.3184 - Object a8, Object a9, Object a10, Object a11,
165.3185 - Object a12, Object a13, Object a14, Object a15,
165.3186 - Object a16) throws Throwable {
165.3187 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, filter.invokeExact()); }
165.3188 - protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
165.3189 - Object a4, Object a5, Object a6, Object a7,
165.3190 - Object a8, Object a9, Object a10, Object a11,
165.3191 - Object a12, Object a13, Object a14, Object a15,
165.3192 - Object a16) throws Throwable {
165.3193 - Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16 };
165.3194 - filter.invokeExact(av); // make the flyby
165.3195 - return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14], av[15], av[16]); }
165.3196 - }
165.3197 - static class F18 extends Adapter {
165.3198 - protected F18(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.3199 - protected F18(MethodHandle e, MethodHandle f, MethodHandle t) {
165.3200 - super(e, f, t); }
165.3201 - protected F18 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.3202 - return new F18(e, f, t); }
165.3203 - protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
165.3204 - Object a4, Object a5, Object a6, Object a7,
165.3205 - Object a8, Object a9, Object a10, Object a11,
165.3206 - Object a12, Object a13, Object a14, Object a15,
165.3207 - Object a16, Object a17) throws Throwable {
165.3208 - return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3209 - a10, a11, a12, a13, a14, a15, a16, a17); }
165.3210 - protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
165.3211 - Object a4, Object a5, Object a6, Object a7,
165.3212 - Object a8, Object a9, Object a10, Object a11,
165.3213 - Object a12, Object a13, Object a14, Object a15,
165.3214 - Object a16, Object a17) throws Throwable {
165.3215 - return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
165.3216 - a10, a11, a12, a13, a14, a15, a16, a17); }
165.3217 - protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
165.3218 - Object a4, Object a5, Object a6, Object a7,
165.3219 - Object a8, Object a9, Object a10, Object a11,
165.3220 - Object a12, Object a13, Object a14, Object a15,
165.3221 - Object a16, Object a17) throws Throwable {
165.3222 - return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
165.3223 - a10, a11, a12, a13, a14, a15, a16, a17); }
165.3224 - protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
165.3225 - Object a4, Object a5, Object a6, Object a7,
165.3226 - Object a8, Object a9, Object a10, Object a11,
165.3227 - Object a12, Object a13, Object a14, Object a15,
165.3228 - Object a16, Object a17) throws Throwable {
165.3229 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
165.3230 - a10, a11, a12, a13, a14, a15, a16, a17); }
165.3231 - protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
165.3232 - Object a4, Object a5, Object a6, Object a7,
165.3233 - Object a8, Object a9, Object a10, Object a11,
165.3234 - Object a12, Object a13, Object a14, Object a15,
165.3235 - Object a16, Object a17) throws Throwable {
165.3236 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
165.3237 - a10, a11, a12, a13, a14, a15, a16, a17); }
165.3238 - protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
165.3239 - Object a4, Object a5, Object a6, Object a7,
165.3240 - Object a8, Object a9, Object a10, Object a11,
165.3241 - Object a12, Object a13, Object a14, Object a15,
165.3242 - Object a16, Object a17) throws Throwable {
165.3243 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
165.3244 - a10, a11, a12, a13, a14, a15, a16, a17); }
165.3245 - protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
165.3246 - Object a4, Object a5, Object a6, Object a7,
165.3247 - Object a8, Object a9, Object a10, Object a11,
165.3248 - Object a12, Object a13, Object a14, Object a15,
165.3249 - Object a16, Object a17) throws Throwable {
165.3250 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
165.3251 - a10, a11, a12, a13, a14, a15, a16, a17); }
165.3252 - protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
165.3253 - Object a4, Object a5, Object a6, Object a7,
165.3254 - Object a8, Object a9, Object a10, Object a11,
165.3255 - Object a12, Object a13, Object a14, Object a15,
165.3256 - Object a16, Object a17) throws Throwable {
165.3257 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
165.3258 - a10, a11, a12, a13, a14, a15, a16, a17); }
165.3259 - protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
165.3260 - Object a4, Object a5, Object a6, Object a7,
165.3261 - Object a8, Object a9, Object a10, Object a11,
165.3262 - Object a12, Object a13, Object a14, Object a15,
165.3263 - Object a16, Object a17) throws Throwable {
165.3264 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
165.3265 - a10, a11, a12, a13, a14, a15, a16, a17); }
165.3266 - protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
165.3267 - Object a4, Object a5, Object a6, Object a7,
165.3268 - Object a8, Object a9, Object a10, Object a11,
165.3269 - Object a12, Object a13, Object a14, Object a15,
165.3270 - Object a16, Object a17) throws Throwable {
165.3271 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
165.3272 - a10, a11, a12, a13, a14, a15, a16, a17); }
165.3273 - protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
165.3274 - Object a4, Object a5, Object a6, Object a7,
165.3275 - Object a8, Object a9, Object a10, Object a11,
165.3276 - Object a12, Object a13, Object a14, Object a15,
165.3277 - Object a16, Object a17) throws Throwable {
165.3278 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3279 - filter.invokeExact(a10), a11, a12, a13, a14, a15, a16, a17); }
165.3280 - protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
165.3281 - Object a4, Object a5, Object a6, Object a7,
165.3282 - Object a8, Object a9, Object a10, Object a11,
165.3283 - Object a12, Object a13, Object a14, Object a15,
165.3284 - Object a16, Object a17) throws Throwable {
165.3285 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3286 - a10, filter.invokeExact(a11), a12, a13, a14, a15, a16, a17); }
165.3287 - protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
165.3288 - Object a4, Object a5, Object a6, Object a7,
165.3289 - Object a8, Object a9, Object a10, Object a11,
165.3290 - Object a12, Object a13, Object a14, Object a15,
165.3291 - Object a16, Object a17) throws Throwable {
165.3292 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3293 - a10, a11, filter.invokeExact(a12), a13, a14, a15, a16, a17); }
165.3294 - protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
165.3295 - Object a4, Object a5, Object a6, Object a7,
165.3296 - Object a8, Object a9, Object a10, Object a11,
165.3297 - Object a12, Object a13, Object a14, Object a15,
165.3298 - Object a16, Object a17) throws Throwable {
165.3299 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3300 - a10, a11, a12, filter.invokeExact(a13), a14, a15, a16, a17); }
165.3301 - protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3,
165.3302 - Object a4, Object a5, Object a6, Object a7,
165.3303 - Object a8, Object a9, Object a10, Object a11,
165.3304 - Object a12, Object a13, Object a14, Object a15,
165.3305 - Object a16, Object a17) throws Throwable {
165.3306 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3307 - a10, a11, a12, a13, filter.invokeExact(a14), a15, a16, a17); }
165.3308 - protected Object invoke_V15(Object a0, Object a1, Object a2, Object a3,
165.3309 - Object a4, Object a5, Object a6, Object a7,
165.3310 - Object a8, Object a9, Object a10, Object a11,
165.3311 - Object a12, Object a13, Object a14, Object a15,
165.3312 - Object a16, Object a17) throws Throwable {
165.3313 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3314 - a10, a11, a12, a13, a14, filter.invokeExact(a15), a16, a17); }
165.3315 - protected Object invoke_V16(Object a0, Object a1, Object a2, Object a3,
165.3316 - Object a4, Object a5, Object a6, Object a7,
165.3317 - Object a8, Object a9, Object a10, Object a11,
165.3318 - Object a12, Object a13, Object a14, Object a15,
165.3319 - Object a16, Object a17) throws Throwable {
165.3320 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3321 - a10, a11, a12, a13, a14, a15, filter.invokeExact(a16), a17); }
165.3322 - protected Object invoke_V17(Object a0, Object a1, Object a2, Object a3,
165.3323 - Object a4, Object a5, Object a6, Object a7,
165.3324 - Object a8, Object a9, Object a10, Object a11,
165.3325 - Object a12, Object a13, Object a14, Object a15,
165.3326 - Object a16, Object a17) throws Throwable {
165.3327 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3328 - a10, a11, a12, a13, a14, a15, a16, filter.invokeExact(a17)); }
165.3329 - protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
165.3330 - Object a4, Object a5, Object a6, Object a7,
165.3331 - Object a8, Object a9, Object a10, Object a11,
165.3332 - Object a12, Object a13, Object a14, Object a15,
165.3333 - Object a16, Object a17) throws Throwable {
165.3334 - return target.invokeExact(filter.invokeExact(),
165.3335 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
165.3336 - protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
165.3337 - Object a4, Object a5, Object a6, Object a7,
165.3338 - Object a8, Object a9, Object a10, Object a11,
165.3339 - Object a12, Object a13, Object a14, Object a15,
165.3340 - Object a16, Object a17) throws Throwable {
165.3341 - return target.invokeExact(filter.invokeExact(a0),
165.3342 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
165.3343 - protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
165.3344 - Object a4, Object a5, Object a6, Object a7,
165.3345 - Object a8, Object a9, Object a10, Object a11,
165.3346 - Object a12, Object a13, Object a14, Object a15,
165.3347 - Object a16, Object a17) throws Throwable {
165.3348 - return target.invokeExact(filter.invokeExact(a0, a1),
165.3349 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
165.3350 - protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
165.3351 - Object a4, Object a5, Object a6, Object a7,
165.3352 - Object a8, Object a9, Object a10, Object a11,
165.3353 - Object a12, Object a13, Object a14, Object a15,
165.3354 - Object a16, Object a17) throws Throwable {
165.3355 - return target.invokeExact(filter.invokeExact(a0, a1, a2),
165.3356 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
165.3357 - protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
165.3358 - Object a4, Object a5, Object a6, Object a7,
165.3359 - Object a8, Object a9, Object a10, Object a11,
165.3360 - Object a12, Object a13, Object a14, Object a15,
165.3361 - Object a16, Object a17) throws Throwable {
165.3362 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
165.3363 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
165.3364 - protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
165.3365 - Object a4, Object a5, Object a6, Object a7,
165.3366 - Object a8, Object a9, Object a10, Object a11,
165.3367 - Object a12, Object a13, Object a14, Object a15,
165.3368 - Object a16, Object a17) throws Throwable {
165.3369 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
165.3370 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
165.3371 - protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
165.3372 - Object a4, Object a5, Object a6, Object a7,
165.3373 - Object a8, Object a9, Object a10, Object a11,
165.3374 - Object a12, Object a13, Object a14, Object a15,
165.3375 - Object a16, Object a17) throws Throwable {
165.3376 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
165.3377 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
165.3378 - protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
165.3379 - Object a4, Object a5, Object a6, Object a7,
165.3380 - Object a8, Object a9, Object a10, Object a11,
165.3381 - Object a12, Object a13, Object a14, Object a15,
165.3382 - Object a16, Object a17) throws Throwable {
165.3383 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
165.3384 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
165.3385 - protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
165.3386 - Object a4, Object a5, Object a6, Object a7,
165.3387 - Object a8, Object a9, Object a10, Object a11,
165.3388 - Object a12, Object a13, Object a14, Object a15,
165.3389 - Object a16, Object a17) throws Throwable {
165.3390 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
165.3391 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
165.3392 - protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
165.3393 - Object a4, Object a5, Object a6, Object a7,
165.3394 - Object a8, Object a9, Object a10, Object a11,
165.3395 - Object a12, Object a13, Object a14, Object a15,
165.3396 - Object a16, Object a17) throws Throwable {
165.3397 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
165.3398 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
165.3399 - protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
165.3400 - Object a4, Object a5, Object a6, Object a7,
165.3401 - Object a8, Object a9, Object a10, Object a11,
165.3402 - Object a12, Object a13, Object a14, Object a15,
165.3403 - Object a16, Object a17) throws Throwable {
165.3404 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
165.3405 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
165.3406 - protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
165.3407 - Object a4, Object a5, Object a6, Object a7,
165.3408 - Object a8, Object a9, Object a10, Object a11,
165.3409 - Object a12, Object a13, Object a14, Object a15,
165.3410 - Object a16, Object a17) throws Throwable {
165.3411 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3412 - a10),
165.3413 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
165.3414 - protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
165.3415 - Object a4, Object a5, Object a6, Object a7,
165.3416 - Object a8, Object a9, Object a10, Object a11,
165.3417 - Object a12, Object a13, Object a14, Object a15,
165.3418 - Object a16, Object a17) throws Throwable {
165.3419 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3420 - a10, a11),
165.3421 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
165.3422 - protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
165.3423 - Object a4, Object a5, Object a6, Object a7,
165.3424 - Object a8, Object a9, Object a10, Object a11,
165.3425 - Object a12, Object a13, Object a14, Object a15,
165.3426 - Object a16, Object a17) throws Throwable {
165.3427 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3428 - a10, a11, a12),
165.3429 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
165.3430 - protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
165.3431 - Object a4, Object a5, Object a6, Object a7,
165.3432 - Object a8, Object a9, Object a10, Object a11,
165.3433 - Object a12, Object a13, Object a14, Object a15,
165.3434 - Object a16, Object a17) throws Throwable {
165.3435 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3436 - a10, a11, a12, a13),
165.3437 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
165.3438 - protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3,
165.3439 - Object a4, Object a5, Object a6, Object a7,
165.3440 - Object a8, Object a9, Object a10, Object a11,
165.3441 - Object a12, Object a13, Object a14, Object a15,
165.3442 - Object a16, Object a17) throws Throwable {
165.3443 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3444 - a10, a11, a12, a13, a14),
165.3445 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
165.3446 - protected Object invoke_F16(Object a0, Object a1, Object a2, Object a3,
165.3447 - Object a4, Object a5, Object a6, Object a7,
165.3448 - Object a8, Object a9, Object a10, Object a11,
165.3449 - Object a12, Object a13, Object a14, Object a15,
165.3450 - Object a16, Object a17) throws Throwable {
165.3451 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3452 - a10, a11, a12, a13, a14, a15),
165.3453 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
165.3454 - protected Object invoke_F17(Object a0, Object a1, Object a2, Object a3,
165.3455 - Object a4, Object a5, Object a6, Object a7,
165.3456 - Object a8, Object a9, Object a10, Object a11,
165.3457 - Object a12, Object a13, Object a14, Object a15,
165.3458 - Object a16, Object a17) throws Throwable {
165.3459 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3460 - a10, a11, a12, a13, a14, a15, a16),
165.3461 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
165.3462 - protected Object invoke_F18(Object a0, Object a1, Object a2, Object a3,
165.3463 - Object a4, Object a5, Object a6, Object a7,
165.3464 - Object a8, Object a9, Object a10, Object a11,
165.3465 - Object a12, Object a13, Object a14, Object a15,
165.3466 - Object a16, Object a17) throws Throwable {
165.3467 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17),
165.3468 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); }
165.3469 - protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
165.3470 - Object a4, Object a5, Object a6, Object a7,
165.3471 - Object a8, Object a9, Object a10, Object a11,
165.3472 - Object a12, Object a13, Object a14, Object a15,
165.3473 - Object a16, Object a17) throws Throwable {
165.3474 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3475 - a10, a11, a12, a13, a14, a15, a16, a17)); }
165.3476 - protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
165.3477 - Object a4, Object a5, Object a6, Object a7,
165.3478 - Object a8, Object a9, Object a10, Object a11,
165.3479 - Object a12, Object a13, Object a14, Object a15,
165.3480 - Object a16, Object a17) throws Throwable {
165.3481 - return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3482 - a10, a11, a12, a13, a14, a15, a16, a17)); }
165.3483 - protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
165.3484 - Object a4, Object a5, Object a6, Object a7,
165.3485 - Object a8, Object a9, Object a10, Object a11,
165.3486 - Object a12, Object a13, Object a14, Object a15,
165.3487 - Object a16, Object a17) throws Throwable {
165.3488 - return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
165.3489 - a10, a11, a12, a13, a14, a15, a16, a17)); }
165.3490 - protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
165.3491 - Object a4, Object a5, Object a6, Object a7,
165.3492 - Object a8, Object a9, Object a10, Object a11,
165.3493 - Object a12, Object a13, Object a14, Object a15,
165.3494 - Object a16, Object a17) throws Throwable {
165.3495 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
165.3496 - a10, a11, a12, a13, a14, a15, a16, a17)); }
165.3497 - protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
165.3498 - Object a4, Object a5, Object a6, Object a7,
165.3499 - Object a8, Object a9, Object a10, Object a11,
165.3500 - Object a12, Object a13, Object a14, Object a15,
165.3501 - Object a16, Object a17) throws Throwable {
165.3502 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
165.3503 - a10, a11, a12, a13, a14, a15, a16, a17)); }
165.3504 - protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
165.3505 - Object a4, Object a5, Object a6, Object a7,
165.3506 - Object a8, Object a9, Object a10, Object a11,
165.3507 - Object a12, Object a13, Object a14, Object a15,
165.3508 - Object a16, Object a17) throws Throwable {
165.3509 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
165.3510 - a10, a11, a12, a13, a14, a15, a16, a17)); }
165.3511 - protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
165.3512 - Object a4, Object a5, Object a6, Object a7,
165.3513 - Object a8, Object a9, Object a10, Object a11,
165.3514 - Object a12, Object a13, Object a14, Object a15,
165.3515 - Object a16, Object a17) throws Throwable {
165.3516 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
165.3517 - a10, a11, a12, a13, a14, a15, a16, a17)); }
165.3518 - protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
165.3519 - Object a4, Object a5, Object a6, Object a7,
165.3520 - Object a8, Object a9, Object a10, Object a11,
165.3521 - Object a12, Object a13, Object a14, Object a15,
165.3522 - Object a16, Object a17) throws Throwable {
165.3523 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
165.3524 - a10, a11, a12, a13, a14, a15, a16, a17)); }
165.3525 - protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
165.3526 - Object a4, Object a5, Object a6, Object a7,
165.3527 - Object a8, Object a9, Object a10, Object a11,
165.3528 - Object a12, Object a13, Object a14, Object a15,
165.3529 - Object a16, Object a17) throws Throwable {
165.3530 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
165.3531 - a10, a11, a12, a13, a14, a15, a16, a17)); }
165.3532 - protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
165.3533 - Object a4, Object a5, Object a6, Object a7,
165.3534 - Object a8, Object a9, Object a10, Object a11,
165.3535 - Object a12, Object a13, Object a14, Object a15,
165.3536 - Object a16, Object a17) throws Throwable {
165.3537 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
165.3538 - a10, a11, a12, a13, a14, a15, a16, a17)); }
165.3539 - protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
165.3540 - Object a4, Object a5, Object a6, Object a7,
165.3541 - Object a8, Object a9, Object a10, Object a11,
165.3542 - Object a12, Object a13, Object a14, Object a15,
165.3543 - Object a16, Object a17) throws Throwable {
165.3544 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13, a14, a15, a16, a17)); }
165.3545 - protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
165.3546 - Object a4, Object a5, Object a6, Object a7,
165.3547 - Object a8, Object a9, Object a10, Object a11,
165.3548 - Object a12, Object a13, Object a14, Object a15,
165.3549 - Object a16, Object a17) throws Throwable {
165.3550 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3551 - a10, filter.invokeExact(a11, a12, a13, a14, a15, a16, a17)); }
165.3552 - protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
165.3553 - Object a4, Object a5, Object a6, Object a7,
165.3554 - Object a8, Object a9, Object a10, Object a11,
165.3555 - Object a12, Object a13, Object a14, Object a15,
165.3556 - Object a16, Object a17) throws Throwable {
165.3557 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3558 - a10, a11, filter.invokeExact(a12, a13, a14, a15, a16, a17)); }
165.3559 - protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
165.3560 - Object a4, Object a5, Object a6, Object a7,
165.3561 - Object a8, Object a9, Object a10, Object a11,
165.3562 - Object a12, Object a13, Object a14, Object a15,
165.3563 - Object a16, Object a17) throws Throwable {
165.3564 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3565 - a10, a11, a12, filter.invokeExact(a13, a14, a15, a16, a17)); }
165.3566 - protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
165.3567 - Object a4, Object a5, Object a6, Object a7,
165.3568 - Object a8, Object a9, Object a10, Object a11,
165.3569 - Object a12, Object a13, Object a14, Object a15,
165.3570 - Object a16, Object a17) throws Throwable {
165.3571 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3572 - a10, a11, a12, a13, filter.invokeExact(a14, a15, a16, a17)); }
165.3573 - protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3,
165.3574 - Object a4, Object a5, Object a6, Object a7,
165.3575 - Object a8, Object a9, Object a10, Object a11,
165.3576 - Object a12, Object a13, Object a14, Object a15,
165.3577 - Object a16, Object a17) throws Throwable {
165.3578 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3579 - a10, a11, a12, a13, a14, filter.invokeExact(a15, a16, a17)); }
165.3580 - protected Object invoke_C16(Object a0, Object a1, Object a2, Object a3,
165.3581 - Object a4, Object a5, Object a6, Object a7,
165.3582 - Object a8, Object a9, Object a10, Object a11,
165.3583 - Object a12, Object a13, Object a14, Object a15,
165.3584 - Object a16, Object a17) throws Throwable {
165.3585 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3586 - a10, a11, a12, a13, a14, a15, filter.invokeExact(a16, a17)); }
165.3587 - protected Object invoke_C17(Object a0, Object a1, Object a2, Object a3,
165.3588 - Object a4, Object a5, Object a6, Object a7,
165.3589 - Object a8, Object a9, Object a10, Object a11,
165.3590 - Object a12, Object a13, Object a14, Object a15,
165.3591 - Object a16, Object a17) throws Throwable {
165.3592 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3593 - a10, a11, a12, a13, a14, a15, a16, filter.invokeExact(a17)); }
165.3594 - protected Object invoke_C18(Object a0, Object a1, Object a2, Object a3,
165.3595 - Object a4, Object a5, Object a6, Object a7,
165.3596 - Object a8, Object a9, Object a10, Object a11,
165.3597 - Object a12, Object a13, Object a14, Object a15,
165.3598 - Object a16, Object a17) throws Throwable {
165.3599 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, filter.invokeExact()); }
165.3600 - protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
165.3601 - Object a4, Object a5, Object a6, Object a7,
165.3602 - Object a8, Object a9, Object a10, Object a11,
165.3603 - Object a12, Object a13, Object a14, Object a15,
165.3604 - Object a16, Object a17) throws Throwable {
165.3605 - Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17 };
165.3606 - filter.invokeExact(av); // make the flyby
165.3607 - return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14], av[15], av[16], av[17]); }
165.3608 - }
165.3609 - static class F19 extends Adapter {
165.3610 - protected F19(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.3611 - protected F19(MethodHandle e, MethodHandle f, MethodHandle t) {
165.3612 - super(e, f, t); }
165.3613 - protected F19 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.3614 - return new F19(e, f, t); }
165.3615 - protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
165.3616 - Object a4, Object a5, Object a6, Object a7,
165.3617 - Object a8, Object a9, Object a10, Object a11,
165.3618 - Object a12, Object a13, Object a14, Object a15,
165.3619 - Object a16, Object a17, Object a18) throws Throwable {
165.3620 - return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3621 - a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3622 - protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
165.3623 - Object a4, Object a5, Object a6, Object a7,
165.3624 - Object a8, Object a9, Object a10, Object a11,
165.3625 - Object a12, Object a13, Object a14, Object a15,
165.3626 - Object a16, Object a17, Object a18) throws Throwable {
165.3627 - return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
165.3628 - a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3629 - protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
165.3630 - Object a4, Object a5, Object a6, Object a7,
165.3631 - Object a8, Object a9, Object a10, Object a11,
165.3632 - Object a12, Object a13, Object a14, Object a15,
165.3633 - Object a16, Object a17, Object a18) throws Throwable {
165.3634 - return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
165.3635 - a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3636 - protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
165.3637 - Object a4, Object a5, Object a6, Object a7,
165.3638 - Object a8, Object a9, Object a10, Object a11,
165.3639 - Object a12, Object a13, Object a14, Object a15,
165.3640 - Object a16, Object a17, Object a18) throws Throwable {
165.3641 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
165.3642 - a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3643 - protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
165.3644 - Object a4, Object a5, Object a6, Object a7,
165.3645 - Object a8, Object a9, Object a10, Object a11,
165.3646 - Object a12, Object a13, Object a14, Object a15,
165.3647 - Object a16, Object a17, Object a18) throws Throwable {
165.3648 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
165.3649 - a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3650 - protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
165.3651 - Object a4, Object a5, Object a6, Object a7,
165.3652 - Object a8, Object a9, Object a10, Object a11,
165.3653 - Object a12, Object a13, Object a14, Object a15,
165.3654 - Object a16, Object a17, Object a18) throws Throwable {
165.3655 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
165.3656 - a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3657 - protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
165.3658 - Object a4, Object a5, Object a6, Object a7,
165.3659 - Object a8, Object a9, Object a10, Object a11,
165.3660 - Object a12, Object a13, Object a14, Object a15,
165.3661 - Object a16, Object a17, Object a18) throws Throwable {
165.3662 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
165.3663 - a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3664 - protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
165.3665 - Object a4, Object a5, Object a6, Object a7,
165.3666 - Object a8, Object a9, Object a10, Object a11,
165.3667 - Object a12, Object a13, Object a14, Object a15,
165.3668 - Object a16, Object a17, Object a18) throws Throwable {
165.3669 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
165.3670 - a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3671 - protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
165.3672 - Object a4, Object a5, Object a6, Object a7,
165.3673 - Object a8, Object a9, Object a10, Object a11,
165.3674 - Object a12, Object a13, Object a14, Object a15,
165.3675 - Object a16, Object a17, Object a18) throws Throwable {
165.3676 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
165.3677 - a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3678 - protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
165.3679 - Object a4, Object a5, Object a6, Object a7,
165.3680 - Object a8, Object a9, Object a10, Object a11,
165.3681 - Object a12, Object a13, Object a14, Object a15,
165.3682 - Object a16, Object a17, Object a18) throws Throwable {
165.3683 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
165.3684 - a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3685 - protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
165.3686 - Object a4, Object a5, Object a6, Object a7,
165.3687 - Object a8, Object a9, Object a10, Object a11,
165.3688 - Object a12, Object a13, Object a14, Object a15,
165.3689 - Object a16, Object a17, Object a18) throws Throwable {
165.3690 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3691 - filter.invokeExact(a10), a11, a12, a13, a14, a15, a16, a17, a18); }
165.3692 - protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
165.3693 - Object a4, Object a5, Object a6, Object a7,
165.3694 - Object a8, Object a9, Object a10, Object a11,
165.3695 - Object a12, Object a13, Object a14, Object a15,
165.3696 - Object a16, Object a17, Object a18) throws Throwable {
165.3697 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3698 - a10, filter.invokeExact(a11), a12, a13, a14, a15, a16, a17, a18); }
165.3699 - protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
165.3700 - Object a4, Object a5, Object a6, Object a7,
165.3701 - Object a8, Object a9, Object a10, Object a11,
165.3702 - Object a12, Object a13, Object a14, Object a15,
165.3703 - Object a16, Object a17, Object a18) throws Throwable {
165.3704 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3705 - a10, a11, filter.invokeExact(a12), a13, a14, a15, a16, a17, a18); }
165.3706 - protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
165.3707 - Object a4, Object a5, Object a6, Object a7,
165.3708 - Object a8, Object a9, Object a10, Object a11,
165.3709 - Object a12, Object a13, Object a14, Object a15,
165.3710 - Object a16, Object a17, Object a18) throws Throwable {
165.3711 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3712 - a10, a11, a12, filter.invokeExact(a13), a14, a15, a16, a17, a18); }
165.3713 - protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3,
165.3714 - Object a4, Object a5, Object a6, Object a7,
165.3715 - Object a8, Object a9, Object a10, Object a11,
165.3716 - Object a12, Object a13, Object a14, Object a15,
165.3717 - Object a16, Object a17, Object a18) throws Throwable {
165.3718 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3719 - a10, a11, a12, a13, filter.invokeExact(a14), a15, a16, a17, a18); }
165.3720 - protected Object invoke_V15(Object a0, Object a1, Object a2, Object a3,
165.3721 - Object a4, Object a5, Object a6, Object a7,
165.3722 - Object a8, Object a9, Object a10, Object a11,
165.3723 - Object a12, Object a13, Object a14, Object a15,
165.3724 - Object a16, Object a17, Object a18) throws Throwable {
165.3725 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3726 - a10, a11, a12, a13, a14, filter.invokeExact(a15), a16, a17, a18); }
165.3727 - protected Object invoke_V16(Object a0, Object a1, Object a2, Object a3,
165.3728 - Object a4, Object a5, Object a6, Object a7,
165.3729 - Object a8, Object a9, Object a10, Object a11,
165.3730 - Object a12, Object a13, Object a14, Object a15,
165.3731 - Object a16, Object a17, Object a18) throws Throwable {
165.3732 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3733 - a10, a11, a12, a13, a14, a15, filter.invokeExact(a16), a17, a18); }
165.3734 - protected Object invoke_V17(Object a0, Object a1, Object a2, Object a3,
165.3735 - Object a4, Object a5, Object a6, Object a7,
165.3736 - Object a8, Object a9, Object a10, Object a11,
165.3737 - Object a12, Object a13, Object a14, Object a15,
165.3738 - Object a16, Object a17, Object a18) throws Throwable {
165.3739 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3740 - a10, a11, a12, a13, a14, a15, a16, filter.invokeExact(a17), a18); }
165.3741 - protected Object invoke_V18(Object a0, Object a1, Object a2, Object a3,
165.3742 - Object a4, Object a5, Object a6, Object a7,
165.3743 - Object a8, Object a9, Object a10, Object a11,
165.3744 - Object a12, Object a13, Object a14, Object a15,
165.3745 - Object a16, Object a17, Object a18) throws Throwable {
165.3746 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3747 - a10, a11, a12, a13, a14, a15, a16, a17, filter.invokeExact(a18)); }
165.3748 - protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
165.3749 - Object a4, Object a5, Object a6, Object a7,
165.3750 - Object a8, Object a9, Object a10, Object a11,
165.3751 - Object a12, Object a13, Object a14, Object a15,
165.3752 - Object a16, Object a17, Object a18) throws Throwable {
165.3753 - return target.invokeExact(filter.invokeExact(),
165.3754 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3755 - protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
165.3756 - Object a4, Object a5, Object a6, Object a7,
165.3757 - Object a8, Object a9, Object a10, Object a11,
165.3758 - Object a12, Object a13, Object a14, Object a15,
165.3759 - Object a16, Object a17, Object a18) throws Throwable {
165.3760 - return target.invokeExact(filter.invokeExact(a0),
165.3761 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3762 - protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
165.3763 - Object a4, Object a5, Object a6, Object a7,
165.3764 - Object a8, Object a9, Object a10, Object a11,
165.3765 - Object a12, Object a13, Object a14, Object a15,
165.3766 - Object a16, Object a17, Object a18) throws Throwable {
165.3767 - return target.invokeExact(filter.invokeExact(a0, a1),
165.3768 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3769 - protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
165.3770 - Object a4, Object a5, Object a6, Object a7,
165.3771 - Object a8, Object a9, Object a10, Object a11,
165.3772 - Object a12, Object a13, Object a14, Object a15,
165.3773 - Object a16, Object a17, Object a18) throws Throwable {
165.3774 - return target.invokeExact(filter.invokeExact(a0, a1, a2),
165.3775 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3776 - protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
165.3777 - Object a4, Object a5, Object a6, Object a7,
165.3778 - Object a8, Object a9, Object a10, Object a11,
165.3779 - Object a12, Object a13, Object a14, Object a15,
165.3780 - Object a16, Object a17, Object a18) throws Throwable {
165.3781 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
165.3782 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3783 - protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
165.3784 - Object a4, Object a5, Object a6, Object a7,
165.3785 - Object a8, Object a9, Object a10, Object a11,
165.3786 - Object a12, Object a13, Object a14, Object a15,
165.3787 - Object a16, Object a17, Object a18) throws Throwable {
165.3788 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
165.3789 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3790 - protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
165.3791 - Object a4, Object a5, Object a6, Object a7,
165.3792 - Object a8, Object a9, Object a10, Object a11,
165.3793 - Object a12, Object a13, Object a14, Object a15,
165.3794 - Object a16, Object a17, Object a18) throws Throwable {
165.3795 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
165.3796 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3797 - protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
165.3798 - Object a4, Object a5, Object a6, Object a7,
165.3799 - Object a8, Object a9, Object a10, Object a11,
165.3800 - Object a12, Object a13, Object a14, Object a15,
165.3801 - Object a16, Object a17, Object a18) throws Throwable {
165.3802 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
165.3803 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3804 - protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
165.3805 - Object a4, Object a5, Object a6, Object a7,
165.3806 - Object a8, Object a9, Object a10, Object a11,
165.3807 - Object a12, Object a13, Object a14, Object a15,
165.3808 - Object a16, Object a17, Object a18) throws Throwable {
165.3809 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
165.3810 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3811 - protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
165.3812 - Object a4, Object a5, Object a6, Object a7,
165.3813 - Object a8, Object a9, Object a10, Object a11,
165.3814 - Object a12, Object a13, Object a14, Object a15,
165.3815 - Object a16, Object a17, Object a18) throws Throwable {
165.3816 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
165.3817 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3818 - protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
165.3819 - Object a4, Object a5, Object a6, Object a7,
165.3820 - Object a8, Object a9, Object a10, Object a11,
165.3821 - Object a12, Object a13, Object a14, Object a15,
165.3822 - Object a16, Object a17, Object a18) throws Throwable {
165.3823 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
165.3824 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3825 - protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
165.3826 - Object a4, Object a5, Object a6, Object a7,
165.3827 - Object a8, Object a9, Object a10, Object a11,
165.3828 - Object a12, Object a13, Object a14, Object a15,
165.3829 - Object a16, Object a17, Object a18) throws Throwable {
165.3830 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3831 - a10),
165.3832 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3833 - protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
165.3834 - Object a4, Object a5, Object a6, Object a7,
165.3835 - Object a8, Object a9, Object a10, Object a11,
165.3836 - Object a12, Object a13, Object a14, Object a15,
165.3837 - Object a16, Object a17, Object a18) throws Throwable {
165.3838 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3839 - a10, a11),
165.3840 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3841 - protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
165.3842 - Object a4, Object a5, Object a6, Object a7,
165.3843 - Object a8, Object a9, Object a10, Object a11,
165.3844 - Object a12, Object a13, Object a14, Object a15,
165.3845 - Object a16, Object a17, Object a18) throws Throwable {
165.3846 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3847 - a10, a11, a12),
165.3848 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3849 - protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
165.3850 - Object a4, Object a5, Object a6, Object a7,
165.3851 - Object a8, Object a9, Object a10, Object a11,
165.3852 - Object a12, Object a13, Object a14, Object a15,
165.3853 - Object a16, Object a17, Object a18) throws Throwable {
165.3854 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3855 - a10, a11, a12, a13),
165.3856 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3857 - protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3,
165.3858 - Object a4, Object a5, Object a6, Object a7,
165.3859 - Object a8, Object a9, Object a10, Object a11,
165.3860 - Object a12, Object a13, Object a14, Object a15,
165.3861 - Object a16, Object a17, Object a18) throws Throwable {
165.3862 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3863 - a10, a11, a12, a13, a14),
165.3864 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3865 - protected Object invoke_F16(Object a0, Object a1, Object a2, Object a3,
165.3866 - Object a4, Object a5, Object a6, Object a7,
165.3867 - Object a8, Object a9, Object a10, Object a11,
165.3868 - Object a12, Object a13, Object a14, Object a15,
165.3869 - Object a16, Object a17, Object a18) throws Throwable {
165.3870 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3871 - a10, a11, a12, a13, a14, a15),
165.3872 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3873 - protected Object invoke_F17(Object a0, Object a1, Object a2, Object a3,
165.3874 - Object a4, Object a5, Object a6, Object a7,
165.3875 - Object a8, Object a9, Object a10, Object a11,
165.3876 - Object a12, Object a13, Object a14, Object a15,
165.3877 - Object a16, Object a17, Object a18) throws Throwable {
165.3878 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3879 - a10, a11, a12, a13, a14, a15, a16),
165.3880 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3881 - protected Object invoke_F18(Object a0, Object a1, Object a2, Object a3,
165.3882 - Object a4, Object a5, Object a6, Object a7,
165.3883 - Object a8, Object a9, Object a10, Object a11,
165.3884 - Object a12, Object a13, Object a14, Object a15,
165.3885 - Object a16, Object a17, Object a18) throws Throwable {
165.3886 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3887 - a10, a11, a12, a13, a14, a15, a16, a17),
165.3888 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3889 - protected Object invoke_F19(Object a0, Object a1, Object a2, Object a3,
165.3890 - Object a4, Object a5, Object a6, Object a7,
165.3891 - Object a8, Object a9, Object a10, Object a11,
165.3892 - Object a12, Object a13, Object a14, Object a15,
165.3893 - Object a16, Object a17, Object a18) throws Throwable {
165.3894 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18),
165.3895 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); }
165.3896 - protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
165.3897 - Object a4, Object a5, Object a6, Object a7,
165.3898 - Object a8, Object a9, Object a10, Object a11,
165.3899 - Object a12, Object a13, Object a14, Object a15,
165.3900 - Object a16, Object a17, Object a18) throws Throwable {
165.3901 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3902 - a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
165.3903 - protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
165.3904 - Object a4, Object a5, Object a6, Object a7,
165.3905 - Object a8, Object a9, Object a10, Object a11,
165.3906 - Object a12, Object a13, Object a14, Object a15,
165.3907 - Object a16, Object a17, Object a18) throws Throwable {
165.3908 - return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3909 - a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
165.3910 - protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
165.3911 - Object a4, Object a5, Object a6, Object a7,
165.3912 - Object a8, Object a9, Object a10, Object a11,
165.3913 - Object a12, Object a13, Object a14, Object a15,
165.3914 - Object a16, Object a17, Object a18) throws Throwable {
165.3915 - return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
165.3916 - a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
165.3917 - protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
165.3918 - Object a4, Object a5, Object a6, Object a7,
165.3919 - Object a8, Object a9, Object a10, Object a11,
165.3920 - Object a12, Object a13, Object a14, Object a15,
165.3921 - Object a16, Object a17, Object a18) throws Throwable {
165.3922 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
165.3923 - a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
165.3924 - protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
165.3925 - Object a4, Object a5, Object a6, Object a7,
165.3926 - Object a8, Object a9, Object a10, Object a11,
165.3927 - Object a12, Object a13, Object a14, Object a15,
165.3928 - Object a16, Object a17, Object a18) throws Throwable {
165.3929 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
165.3930 - a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
165.3931 - protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
165.3932 - Object a4, Object a5, Object a6, Object a7,
165.3933 - Object a8, Object a9, Object a10, Object a11,
165.3934 - Object a12, Object a13, Object a14, Object a15,
165.3935 - Object a16, Object a17, Object a18) throws Throwable {
165.3936 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
165.3937 - a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
165.3938 - protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
165.3939 - Object a4, Object a5, Object a6, Object a7,
165.3940 - Object a8, Object a9, Object a10, Object a11,
165.3941 - Object a12, Object a13, Object a14, Object a15,
165.3942 - Object a16, Object a17, Object a18) throws Throwable {
165.3943 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
165.3944 - a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
165.3945 - protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
165.3946 - Object a4, Object a5, Object a6, Object a7,
165.3947 - Object a8, Object a9, Object a10, Object a11,
165.3948 - Object a12, Object a13, Object a14, Object a15,
165.3949 - Object a16, Object a17, Object a18) throws Throwable {
165.3950 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
165.3951 - a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
165.3952 - protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
165.3953 - Object a4, Object a5, Object a6, Object a7,
165.3954 - Object a8, Object a9, Object a10, Object a11,
165.3955 - Object a12, Object a13, Object a14, Object a15,
165.3956 - Object a16, Object a17, Object a18) throws Throwable {
165.3957 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
165.3958 - a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
165.3959 - protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
165.3960 - Object a4, Object a5, Object a6, Object a7,
165.3961 - Object a8, Object a9, Object a10, Object a11,
165.3962 - Object a12, Object a13, Object a14, Object a15,
165.3963 - Object a16, Object a17, Object a18) throws Throwable {
165.3964 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
165.3965 - a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
165.3966 - protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
165.3967 - Object a4, Object a5, Object a6, Object a7,
165.3968 - Object a8, Object a9, Object a10, Object a11,
165.3969 - Object a12, Object a13, Object a14, Object a15,
165.3970 - Object a16, Object a17, Object a18) throws Throwable {
165.3971 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
165.3972 - protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
165.3973 - Object a4, Object a5, Object a6, Object a7,
165.3974 - Object a8, Object a9, Object a10, Object a11,
165.3975 - Object a12, Object a13, Object a14, Object a15,
165.3976 - Object a16, Object a17, Object a18) throws Throwable {
165.3977 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3978 - a10, filter.invokeExact(a11, a12, a13, a14, a15, a16, a17, a18)); }
165.3979 - protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
165.3980 - Object a4, Object a5, Object a6, Object a7,
165.3981 - Object a8, Object a9, Object a10, Object a11,
165.3982 - Object a12, Object a13, Object a14, Object a15,
165.3983 - Object a16, Object a17, Object a18) throws Throwable {
165.3984 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3985 - a10, a11, filter.invokeExact(a12, a13, a14, a15, a16, a17, a18)); }
165.3986 - protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
165.3987 - Object a4, Object a5, Object a6, Object a7,
165.3988 - Object a8, Object a9, Object a10, Object a11,
165.3989 - Object a12, Object a13, Object a14, Object a15,
165.3990 - Object a16, Object a17, Object a18) throws Throwable {
165.3991 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3992 - a10, a11, a12, filter.invokeExact(a13, a14, a15, a16, a17, a18)); }
165.3993 - protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
165.3994 - Object a4, Object a5, Object a6, Object a7,
165.3995 - Object a8, Object a9, Object a10, Object a11,
165.3996 - Object a12, Object a13, Object a14, Object a15,
165.3997 - Object a16, Object a17, Object a18) throws Throwable {
165.3998 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.3999 - a10, a11, a12, a13, filter.invokeExact(a14, a15, a16, a17, a18)); }
165.4000 - protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3,
165.4001 - Object a4, Object a5, Object a6, Object a7,
165.4002 - Object a8, Object a9, Object a10, Object a11,
165.4003 - Object a12, Object a13, Object a14, Object a15,
165.4004 - Object a16, Object a17, Object a18) throws Throwable {
165.4005 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4006 - a10, a11, a12, a13, a14, filter.invokeExact(a15, a16, a17, a18)); }
165.4007 - protected Object invoke_C16(Object a0, Object a1, Object a2, Object a3,
165.4008 - Object a4, Object a5, Object a6, Object a7,
165.4009 - Object a8, Object a9, Object a10, Object a11,
165.4010 - Object a12, Object a13, Object a14, Object a15,
165.4011 - Object a16, Object a17, Object a18) throws Throwable {
165.4012 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4013 - a10, a11, a12, a13, a14, a15, filter.invokeExact(a16, a17, a18)); }
165.4014 - protected Object invoke_C17(Object a0, Object a1, Object a2, Object a3,
165.4015 - Object a4, Object a5, Object a6, Object a7,
165.4016 - Object a8, Object a9, Object a10, Object a11,
165.4017 - Object a12, Object a13, Object a14, Object a15,
165.4018 - Object a16, Object a17, Object a18) throws Throwable {
165.4019 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4020 - a10, a11, a12, a13, a14, a15, a16, filter.invokeExact(a17, a18)); }
165.4021 - protected Object invoke_C18(Object a0, Object a1, Object a2, Object a3,
165.4022 - Object a4, Object a5, Object a6, Object a7,
165.4023 - Object a8, Object a9, Object a10, Object a11,
165.4024 - Object a12, Object a13, Object a14, Object a15,
165.4025 - Object a16, Object a17, Object a18) throws Throwable {
165.4026 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4027 - a10, a11, a12, a13, a14, a15, a16, a17, filter.invokeExact(a18)); }
165.4028 - protected Object invoke_C19(Object a0, Object a1, Object a2, Object a3,
165.4029 - Object a4, Object a5, Object a6, Object a7,
165.4030 - Object a8, Object a9, Object a10, Object a11,
165.4031 - Object a12, Object a13, Object a14, Object a15,
165.4032 - Object a16, Object a17, Object a18) throws Throwable {
165.4033 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, filter.invokeExact()); }
165.4034 - protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
165.4035 - Object a4, Object a5, Object a6, Object a7,
165.4036 - Object a8, Object a9, Object a10, Object a11,
165.4037 - Object a12, Object a13, Object a14, Object a15,
165.4038 - Object a16, Object a17, Object a18) throws Throwable {
165.4039 - Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18 };
165.4040 - filter.invokeExact(av); // make the flyby
165.4041 - return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14], av[15], av[16], av[17], av[18]); }
165.4042 - }
165.4043 - static class F20 extends Adapter {
165.4044 - protected F20(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
165.4045 - protected F20(MethodHandle e, MethodHandle f, MethodHandle t) {
165.4046 - super(e, f, t); }
165.4047 - protected F20 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
165.4048 - return new F20(e, f, t); }
165.4049 - protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
165.4050 - Object a4, Object a5, Object a6, Object a7,
165.4051 - Object a8, Object a9, Object a10, Object a11,
165.4052 - Object a12, Object a13, Object a14, Object a15,
165.4053 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4054 - return target.invokeExact(filter.invokeExact(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4055 - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4056 - protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3,
165.4057 - Object a4, Object a5, Object a6, Object a7,
165.4058 - Object a8, Object a9, Object a10, Object a11,
165.4059 - Object a12, Object a13, Object a14, Object a15,
165.4060 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4061 - return target.invokeExact(a0, filter.invokeExact(a1), a2, a3, a4, a5, a6, a7, a8, a9,
165.4062 - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4063 - protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3,
165.4064 - Object a4, Object a5, Object a6, Object a7,
165.4065 - Object a8, Object a9, Object a10, Object a11,
165.4066 - Object a12, Object a13, Object a14, Object a15,
165.4067 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4068 - return target.invokeExact(a0, a1, filter.invokeExact(a2), a3, a4, a5, a6, a7, a8, a9,
165.4069 - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4070 - protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3,
165.4071 - Object a4, Object a5, Object a6, Object a7,
165.4072 - Object a8, Object a9, Object a10, Object a11,
165.4073 - Object a12, Object a13, Object a14, Object a15,
165.4074 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4075 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3), a4, a5, a6, a7, a8, a9,
165.4076 - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4077 - protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3,
165.4078 - Object a4, Object a5, Object a6, Object a7,
165.4079 - Object a8, Object a9, Object a10, Object a11,
165.4080 - Object a12, Object a13, Object a14, Object a15,
165.4081 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4082 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4), a5, a6, a7, a8, a9,
165.4083 - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4084 - protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3,
165.4085 - Object a4, Object a5, Object a6, Object a7,
165.4086 - Object a8, Object a9, Object a10, Object a11,
165.4087 - Object a12, Object a13, Object a14, Object a15,
165.4088 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4089 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5), a6, a7, a8, a9,
165.4090 - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4091 - protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3,
165.4092 - Object a4, Object a5, Object a6, Object a7,
165.4093 - Object a8, Object a9, Object a10, Object a11,
165.4094 - Object a12, Object a13, Object a14, Object a15,
165.4095 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4096 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6), a7, a8, a9,
165.4097 - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4098 - protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3,
165.4099 - Object a4, Object a5, Object a6, Object a7,
165.4100 - Object a8, Object a9, Object a10, Object a11,
165.4101 - Object a12, Object a13, Object a14, Object a15,
165.4102 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4103 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7), a8, a9,
165.4104 - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4105 - protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3,
165.4106 - Object a4, Object a5, Object a6, Object a7,
165.4107 - Object a8, Object a9, Object a10, Object a11,
165.4108 - Object a12, Object a13, Object a14, Object a15,
165.4109 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4110 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8), a9,
165.4111 - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4112 - protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3,
165.4113 - Object a4, Object a5, Object a6, Object a7,
165.4114 - Object a8, Object a9, Object a10, Object a11,
165.4115 - Object a12, Object a13, Object a14, Object a15,
165.4116 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4117 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9),
165.4118 - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4119 - protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3,
165.4120 - Object a4, Object a5, Object a6, Object a7,
165.4121 - Object a8, Object a9, Object a10, Object a11,
165.4122 - Object a12, Object a13, Object a14, Object a15,
165.4123 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4124 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4125 - filter.invokeExact(a10), a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4126 - protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3,
165.4127 - Object a4, Object a5, Object a6, Object a7,
165.4128 - Object a8, Object a9, Object a10, Object a11,
165.4129 - Object a12, Object a13, Object a14, Object a15,
165.4130 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4131 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4132 - a10, filter.invokeExact(a11), a12, a13, a14, a15, a16, a17, a18, a19); }
165.4133 - protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3,
165.4134 - Object a4, Object a5, Object a6, Object a7,
165.4135 - Object a8, Object a9, Object a10, Object a11,
165.4136 - Object a12, Object a13, Object a14, Object a15,
165.4137 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4138 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4139 - a10, a11, filter.invokeExact(a12), a13, a14, a15, a16, a17, a18, a19); }
165.4140 - protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3,
165.4141 - Object a4, Object a5, Object a6, Object a7,
165.4142 - Object a8, Object a9, Object a10, Object a11,
165.4143 - Object a12, Object a13, Object a14, Object a15,
165.4144 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4145 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4146 - a10, a11, a12, filter.invokeExact(a13), a14, a15, a16, a17, a18, a19); }
165.4147 - protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3,
165.4148 - Object a4, Object a5, Object a6, Object a7,
165.4149 - Object a8, Object a9, Object a10, Object a11,
165.4150 - Object a12, Object a13, Object a14, Object a15,
165.4151 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4152 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4153 - a10, a11, a12, a13, filter.invokeExact(a14), a15, a16, a17, a18, a19); }
165.4154 - protected Object invoke_V15(Object a0, Object a1, Object a2, Object a3,
165.4155 - Object a4, Object a5, Object a6, Object a7,
165.4156 - Object a8, Object a9, Object a10, Object a11,
165.4157 - Object a12, Object a13, Object a14, Object a15,
165.4158 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4159 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4160 - a10, a11, a12, a13, a14, filter.invokeExact(a15), a16, a17, a18, a19); }
165.4161 - protected Object invoke_V16(Object a0, Object a1, Object a2, Object a3,
165.4162 - Object a4, Object a5, Object a6, Object a7,
165.4163 - Object a8, Object a9, Object a10, Object a11,
165.4164 - Object a12, Object a13, Object a14, Object a15,
165.4165 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4166 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4167 - a10, a11, a12, a13, a14, a15, filter.invokeExact(a16), a17, a18, a19); }
165.4168 - protected Object invoke_V17(Object a0, Object a1, Object a2, Object a3,
165.4169 - Object a4, Object a5, Object a6, Object a7,
165.4170 - Object a8, Object a9, Object a10, Object a11,
165.4171 - Object a12, Object a13, Object a14, Object a15,
165.4172 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4173 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4174 - a10, a11, a12, a13, a14, a15, a16, filter.invokeExact(a17), a18, a19); }
165.4175 - protected Object invoke_V18(Object a0, Object a1, Object a2, Object a3,
165.4176 - Object a4, Object a5, Object a6, Object a7,
165.4177 - Object a8, Object a9, Object a10, Object a11,
165.4178 - Object a12, Object a13, Object a14, Object a15,
165.4179 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4180 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4181 - a10, a11, a12, a13, a14, a15, a16, a17, filter.invokeExact(a18), a19); }
165.4182 - protected Object invoke_V19(Object a0, Object a1, Object a2, Object a3,
165.4183 - Object a4, Object a5, Object a6, Object a7,
165.4184 - Object a8, Object a9, Object a10, Object a11,
165.4185 - Object a12, Object a13, Object a14, Object a15,
165.4186 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4187 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4188 - a10, a11, a12, a13, a14, a15, a16, a17, a18, filter.invokeExact(a19)); }
165.4189 - protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3,
165.4190 - Object a4, Object a5, Object a6, Object a7,
165.4191 - Object a8, Object a9, Object a10, Object a11,
165.4192 - Object a12, Object a13, Object a14, Object a15,
165.4193 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4194 - return target.invokeExact(filter.invokeExact(),
165.4195 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4196 - protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3,
165.4197 - Object a4, Object a5, Object a6, Object a7,
165.4198 - Object a8, Object a9, Object a10, Object a11,
165.4199 - Object a12, Object a13, Object a14, Object a15,
165.4200 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4201 - return target.invokeExact(filter.invokeExact(a0),
165.4202 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4203 - protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3,
165.4204 - Object a4, Object a5, Object a6, Object a7,
165.4205 - Object a8, Object a9, Object a10, Object a11,
165.4206 - Object a12, Object a13, Object a14, Object a15,
165.4207 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4208 - return target.invokeExact(filter.invokeExact(a0, a1),
165.4209 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4210 - protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3,
165.4211 - Object a4, Object a5, Object a6, Object a7,
165.4212 - Object a8, Object a9, Object a10, Object a11,
165.4213 - Object a12, Object a13, Object a14, Object a15,
165.4214 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4215 - return target.invokeExact(filter.invokeExact(a0, a1, a2),
165.4216 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4217 - protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3,
165.4218 - Object a4, Object a5, Object a6, Object a7,
165.4219 - Object a8, Object a9, Object a10, Object a11,
165.4220 - Object a12, Object a13, Object a14, Object a15,
165.4221 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4222 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3),
165.4223 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4224 - protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3,
165.4225 - Object a4, Object a5, Object a6, Object a7,
165.4226 - Object a8, Object a9, Object a10, Object a11,
165.4227 - Object a12, Object a13, Object a14, Object a15,
165.4228 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4229 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4),
165.4230 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4231 - protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3,
165.4232 - Object a4, Object a5, Object a6, Object a7,
165.4233 - Object a8, Object a9, Object a10, Object a11,
165.4234 - Object a12, Object a13, Object a14, Object a15,
165.4235 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4236 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5),
165.4237 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4238 - protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3,
165.4239 - Object a4, Object a5, Object a6, Object a7,
165.4240 - Object a8, Object a9, Object a10, Object a11,
165.4241 - Object a12, Object a13, Object a14, Object a15,
165.4242 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4243 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6),
165.4244 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4245 - protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3,
165.4246 - Object a4, Object a5, Object a6, Object a7,
165.4247 - Object a8, Object a9, Object a10, Object a11,
165.4248 - Object a12, Object a13, Object a14, Object a15,
165.4249 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4250 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7),
165.4251 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4252 - protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3,
165.4253 - Object a4, Object a5, Object a6, Object a7,
165.4254 - Object a8, Object a9, Object a10, Object a11,
165.4255 - Object a12, Object a13, Object a14, Object a15,
165.4256 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4257 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8),
165.4258 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4259 - protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3,
165.4260 - Object a4, Object a5, Object a6, Object a7,
165.4261 - Object a8, Object a9, Object a10, Object a11,
165.4262 - Object a12, Object a13, Object a14, Object a15,
165.4263 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4264 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
165.4265 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4266 - protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3,
165.4267 - Object a4, Object a5, Object a6, Object a7,
165.4268 - Object a8, Object a9, Object a10, Object a11,
165.4269 - Object a12, Object a13, Object a14, Object a15,
165.4270 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4271 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4272 - a10),
165.4273 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4274 - protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3,
165.4275 - Object a4, Object a5, Object a6, Object a7,
165.4276 - Object a8, Object a9, Object a10, Object a11,
165.4277 - Object a12, Object a13, Object a14, Object a15,
165.4278 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4279 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4280 - a10, a11),
165.4281 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4282 - protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3,
165.4283 - Object a4, Object a5, Object a6, Object a7,
165.4284 - Object a8, Object a9, Object a10, Object a11,
165.4285 - Object a12, Object a13, Object a14, Object a15,
165.4286 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4287 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4288 - a10, a11, a12),
165.4289 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4290 - protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3,
165.4291 - Object a4, Object a5, Object a6, Object a7,
165.4292 - Object a8, Object a9, Object a10, Object a11,
165.4293 - Object a12, Object a13, Object a14, Object a15,
165.4294 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4295 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4296 - a10, a11, a12, a13),
165.4297 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4298 - protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3,
165.4299 - Object a4, Object a5, Object a6, Object a7,
165.4300 - Object a8, Object a9, Object a10, Object a11,
165.4301 - Object a12, Object a13, Object a14, Object a15,
165.4302 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4303 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4304 - a10, a11, a12, a13, a14),
165.4305 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4306 - protected Object invoke_F16(Object a0, Object a1, Object a2, Object a3,
165.4307 - Object a4, Object a5, Object a6, Object a7,
165.4308 - Object a8, Object a9, Object a10, Object a11,
165.4309 - Object a12, Object a13, Object a14, Object a15,
165.4310 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4311 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4312 - a10, a11, a12, a13, a14, a15),
165.4313 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4314 - protected Object invoke_F17(Object a0, Object a1, Object a2, Object a3,
165.4315 - Object a4, Object a5, Object a6, Object a7,
165.4316 - Object a8, Object a9, Object a10, Object a11,
165.4317 - Object a12, Object a13, Object a14, Object a15,
165.4318 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4319 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4320 - a10, a11, a12, a13, a14, a15, a16),
165.4321 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4322 - protected Object invoke_F18(Object a0, Object a1, Object a2, Object a3,
165.4323 - Object a4, Object a5, Object a6, Object a7,
165.4324 - Object a8, Object a9, Object a10, Object a11,
165.4325 - Object a12, Object a13, Object a14, Object a15,
165.4326 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4327 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4328 - a10, a11, a12, a13, a14, a15, a16, a17),
165.4329 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4330 - protected Object invoke_F19(Object a0, Object a1, Object a2, Object a3,
165.4331 - Object a4, Object a5, Object a6, Object a7,
165.4332 - Object a8, Object a9, Object a10, Object a11,
165.4333 - Object a12, Object a13, Object a14, Object a15,
165.4334 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4335 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4336 - a10, a11, a12, a13, a14, a15, a16, a17, a18),
165.4337 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4338 - protected Object invoke_F20(Object a0, Object a1, Object a2, Object a3,
165.4339 - Object a4, Object a5, Object a6, Object a7,
165.4340 - Object a8, Object a9, Object a10, Object a11,
165.4341 - Object a12, Object a13, Object a14, Object a15,
165.4342 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4343 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19),
165.4344 - a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); }
165.4345 - protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3,
165.4346 - Object a4, Object a5, Object a6, Object a7,
165.4347 - Object a8, Object a9, Object a10, Object a11,
165.4348 - Object a12, Object a13, Object a14, Object a15,
165.4349 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4350 - return target.invokeExact(filter.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4351 - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
165.4352 - protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3,
165.4353 - Object a4, Object a5, Object a6, Object a7,
165.4354 - Object a8, Object a9, Object a10, Object a11,
165.4355 - Object a12, Object a13, Object a14, Object a15,
165.4356 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4357 - return target.invokeExact(a0, filter.invokeExact(a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4358 - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
165.4359 - protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3,
165.4360 - Object a4, Object a5, Object a6, Object a7,
165.4361 - Object a8, Object a9, Object a10, Object a11,
165.4362 - Object a12, Object a13, Object a14, Object a15,
165.4363 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4364 - return target.invokeExact(a0, a1, filter.invokeExact(a2, a3, a4, a5, a6, a7, a8, a9,
165.4365 - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
165.4366 - protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3,
165.4367 - Object a4, Object a5, Object a6, Object a7,
165.4368 - Object a8, Object a9, Object a10, Object a11,
165.4369 - Object a12, Object a13, Object a14, Object a15,
165.4370 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4371 - return target.invokeExact(a0, a1, a2, filter.invokeExact(a3, a4, a5, a6, a7, a8, a9,
165.4372 - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
165.4373 - protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3,
165.4374 - Object a4, Object a5, Object a6, Object a7,
165.4375 - Object a8, Object a9, Object a10, Object a11,
165.4376 - Object a12, Object a13, Object a14, Object a15,
165.4377 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4378 - return target.invokeExact(a0, a1, a2, a3, filter.invokeExact(a4, a5, a6, a7, a8, a9,
165.4379 - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
165.4380 - protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3,
165.4381 - Object a4, Object a5, Object a6, Object a7,
165.4382 - Object a8, Object a9, Object a10, Object a11,
165.4383 - Object a12, Object a13, Object a14, Object a15,
165.4384 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4385 - return target.invokeExact(a0, a1, a2, a3, a4, filter.invokeExact(a5, a6, a7, a8, a9,
165.4386 - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
165.4387 - protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3,
165.4388 - Object a4, Object a5, Object a6, Object a7,
165.4389 - Object a8, Object a9, Object a10, Object a11,
165.4390 - Object a12, Object a13, Object a14, Object a15,
165.4391 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4392 - return target.invokeExact(a0, a1, a2, a3, a4, a5, filter.invokeExact(a6, a7, a8, a9,
165.4393 - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
165.4394 - protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3,
165.4395 - Object a4, Object a5, Object a6, Object a7,
165.4396 - Object a8, Object a9, Object a10, Object a11,
165.4397 - Object a12, Object a13, Object a14, Object a15,
165.4398 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4399 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, filter.invokeExact(a7, a8, a9,
165.4400 - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
165.4401 - protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3,
165.4402 - Object a4, Object a5, Object a6, Object a7,
165.4403 - Object a8, Object a9, Object a10, Object a11,
165.4404 - Object a12, Object a13, Object a14, Object a15,
165.4405 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4406 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, filter.invokeExact(a8, a9,
165.4407 - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
165.4408 - protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3,
165.4409 - Object a4, Object a5, Object a6, Object a7,
165.4410 - Object a8, Object a9, Object a10, Object a11,
165.4411 - Object a12, Object a13, Object a14, Object a15,
165.4412 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4413 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invokeExact(a9,
165.4414 - a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
165.4415 - protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3,
165.4416 - Object a4, Object a5, Object a6, Object a7,
165.4417 - Object a8, Object a9, Object a10, Object a11,
165.4418 - Object a12, Object a13, Object a14, Object a15,
165.4419 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4420 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invokeExact(a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
165.4421 - protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3,
165.4422 - Object a4, Object a5, Object a6, Object a7,
165.4423 - Object a8, Object a9, Object a10, Object a11,
165.4424 - Object a12, Object a13, Object a14, Object a15,
165.4425 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4426 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4427 - a10, filter.invokeExact(a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
165.4428 - protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3,
165.4429 - Object a4, Object a5, Object a6, Object a7,
165.4430 - Object a8, Object a9, Object a10, Object a11,
165.4431 - Object a12, Object a13, Object a14, Object a15,
165.4432 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4433 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4434 - a10, a11, filter.invokeExact(a12, a13, a14, a15, a16, a17, a18, a19)); }
165.4435 - protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3,
165.4436 - Object a4, Object a5, Object a6, Object a7,
165.4437 - Object a8, Object a9, Object a10, Object a11,
165.4438 - Object a12, Object a13, Object a14, Object a15,
165.4439 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4440 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4441 - a10, a11, a12, filter.invokeExact(a13, a14, a15, a16, a17, a18, a19)); }
165.4442 - protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3,
165.4443 - Object a4, Object a5, Object a6, Object a7,
165.4444 - Object a8, Object a9, Object a10, Object a11,
165.4445 - Object a12, Object a13, Object a14, Object a15,
165.4446 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4447 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4448 - a10, a11, a12, a13, filter.invokeExact(a14, a15, a16, a17, a18, a19)); }
165.4449 - protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3,
165.4450 - Object a4, Object a5, Object a6, Object a7,
165.4451 - Object a8, Object a9, Object a10, Object a11,
165.4452 - Object a12, Object a13, Object a14, Object a15,
165.4453 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4454 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4455 - a10, a11, a12, a13, a14, filter.invokeExact(a15, a16, a17, a18, a19)); }
165.4456 - protected Object invoke_C16(Object a0, Object a1, Object a2, Object a3,
165.4457 - Object a4, Object a5, Object a6, Object a7,
165.4458 - Object a8, Object a9, Object a10, Object a11,
165.4459 - Object a12, Object a13, Object a14, Object a15,
165.4460 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4461 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4462 - a10, a11, a12, a13, a14, a15, filter.invokeExact(a16, a17, a18, a19)); }
165.4463 - protected Object invoke_C17(Object a0, Object a1, Object a2, Object a3,
165.4464 - Object a4, Object a5, Object a6, Object a7,
165.4465 - Object a8, Object a9, Object a10, Object a11,
165.4466 - Object a12, Object a13, Object a14, Object a15,
165.4467 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4468 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4469 - a10, a11, a12, a13, a14, a15, a16, filter.invokeExact(a17, a18, a19)); }
165.4470 - protected Object invoke_C18(Object a0, Object a1, Object a2, Object a3,
165.4471 - Object a4, Object a5, Object a6, Object a7,
165.4472 - Object a8, Object a9, Object a10, Object a11,
165.4473 - Object a12, Object a13, Object a14, Object a15,
165.4474 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4475 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4476 - a10, a11, a12, a13, a14, a15, a16, a17, filter.invokeExact(a18, a19)); }
165.4477 - protected Object invoke_C19(Object a0, Object a1, Object a2, Object a3,
165.4478 - Object a4, Object a5, Object a6, Object a7,
165.4479 - Object a8, Object a9, Object a10, Object a11,
165.4480 - Object a12, Object a13, Object a14, Object a15,
165.4481 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4482 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
165.4483 - a10, a11, a12, a13, a14, a15, a16, a17, a18, filter.invokeExact(a19)); }
165.4484 - protected Object invoke_C20(Object a0, Object a1, Object a2, Object a3,
165.4485 - Object a4, Object a5, Object a6, Object a7,
165.4486 - Object a8, Object a9, Object a10, Object a11,
165.4487 - Object a12, Object a13, Object a14, Object a15,
165.4488 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4489 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, filter.invokeExact()); }
165.4490 - protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3,
165.4491 - Object a4, Object a5, Object a6, Object a7,
165.4492 - Object a8, Object a9, Object a10, Object a11,
165.4493 - Object a12, Object a13, Object a14, Object a15,
165.4494 - Object a16, Object a17, Object a18, Object a19) throws Throwable {
165.4495 - Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19 };
165.4496 - filter.invokeExact(av); // make the flyby
165.4497 - return target.invokeExact(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11], av[12], av[13], av[14], av[15], av[16], av[17], av[18], av[19]); }
165.4498 - }
165.4499 -}
166.1 --- a/src/share/classes/sun/dyn/FilterOneArgument.java Tue Mar 29 11:29:01 2011 -0700
166.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
166.3 @@ -1,80 +0,0 @@
166.4 -/*
166.5 - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
166.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
166.7 - *
166.8 - * This code is free software; you can redistribute it and/or modify it
166.9 - * under the terms of the GNU General Public License version 2 only, as
166.10 - * published by the Free Software Foundation. Oracle designates this
166.11 - * particular file as subject to the "Classpath" exception as provided
166.12 - * by Oracle in the LICENSE file that accompanied this code.
166.13 - *
166.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
166.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
166.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
166.17 - * version 2 for more details (a copy is included in the LICENSE file that
166.18 - * accompanied this code).
166.19 - *
166.20 - * You should have received a copy of the GNU General Public License version
166.21 - * 2 along with this work; if not, write to the Free Software Foundation,
166.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
166.23 - *
166.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
166.25 - * or visit www.oracle.com if you need additional information or have any
166.26 - * questions.
166.27 - */
166.28 -
166.29 -package sun.dyn;
166.30 -
166.31 -import java.dyn.*;
166.32 -import static sun.dyn.MemberName.uncaughtException;
166.33 -
166.34 -/**
166.35 - * Unary function composition, useful for many small plumbing jobs.
166.36 - * The invoke method takes a single reference argument, and returns a reference
166.37 - * Internally, it first calls the {@code filter} method on the argument,
166.38 - * Making up the difference between the raw method type and the
166.39 - * final method type is the responsibility of a JVM-level adapter.
166.40 - * @author jrose
166.41 - */
166.42 -public class FilterOneArgument extends BoundMethodHandle {
166.43 - protected final MethodHandle filter; // Object -> Object
166.44 - protected final MethodHandle target; // Object -> Object
166.45 -
166.46 - @Override
166.47 - public String toString() {
166.48 - return target.toString();
166.49 - }
166.50 -
166.51 - protected Object invoke(Object argument) throws Throwable {
166.52 - Object filteredArgument = filter.invokeExact(argument);
166.53 - return target.invokeExact(filteredArgument);
166.54 - }
166.55 -
166.56 - private static final MethodHandle INVOKE;
166.57 - static {
166.58 - try {
166.59 - INVOKE =
166.60 - MethodHandleImpl.IMPL_LOOKUP.findVirtual(FilterOneArgument.class, "invoke",
166.61 - MethodType.genericMethodType(1));
166.62 - } catch (ReflectiveOperationException ex) {
166.63 - throw uncaughtException(ex);
166.64 - }
166.65 - }
166.66 -
166.67 - protected FilterOneArgument(MethodHandle filter, MethodHandle target) {
166.68 - super(Access.TOKEN, INVOKE);
166.69 - this.filter = filter;
166.70 - this.target = target;
166.71 - }
166.72 -
166.73 - public static MethodHandle make(MethodHandle filter, MethodHandle target) {
166.74 - if (filter == null) return target;
166.75 - if (target == null) return filter;
166.76 - return new FilterOneArgument(filter, target);
166.77 - }
166.78 -
166.79 -// MethodHandle make(MethodHandle filter1, MethodHandle filter2, MethodHandle target) {
166.80 -// MethodHandle filter = make(filter1, filter2);
166.81 -// return make(filter, target);
166.82 -// }
166.83 -}
167.1 --- a/src/share/classes/sun/dyn/FromGeneric.java Tue Mar 29 11:29:01 2011 -0700
167.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
167.3 @@ -1,629 +0,0 @@
167.4 -/*
167.5 - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
167.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
167.7 - *
167.8 - * This code is free software; you can redistribute it and/or modify it
167.9 - * under the terms of the GNU General Public License version 2 only, as
167.10 - * published by the Free Software Foundation. Oracle designates this
167.11 - * particular file as subject to the "Classpath" exception as provided
167.12 - * by Oracle in the LICENSE file that accompanied this code.
167.13 - *
167.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
167.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
167.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
167.17 - * version 2 for more details (a copy is included in the LICENSE file that
167.18 - * accompanied this code).
167.19 - *
167.20 - * You should have received a copy of the GNU General Public License version
167.21 - * 2 along with this work; if not, write to the Free Software Foundation,
167.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
167.23 - *
167.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
167.25 - * or visit www.oracle.com if you need additional information or have any
167.26 - * questions.
167.27 - */
167.28 -
167.29 -package sun.dyn;
167.30 -
167.31 -import java.dyn.*;
167.32 -import java.lang.reflect.*;
167.33 -import sun.dyn.util.*;
167.34 -import static sun.dyn.MethodTypeImpl.invokers;
167.35 -
167.36 -/**
167.37 - * Adapters which mediate between incoming calls which are generic
167.38 - * and outgoing calls which are not. Any call can be represented generically
167.39 - * boxing up its arguments, and (on return) unboxing the return value.
167.40 - * <p>
167.41 - * A call is "generic" (in MethodHandle terms) if its MethodType features
167.42 - * only Object arguments. A non-generic call therefore features
167.43 - * primitives and/or reference types other than Object.
167.44 - * An adapter has types for its incoming and outgoing calls.
167.45 - * The incoming call type is simply determined by the adapter's type
167.46 - * (the MethodType it presents to callers). The outgoing call type
167.47 - * is determined by the adapter's target (a MethodHandle that the adapter
167.48 - * either binds internally or else takes as a leading argument).
167.49 - * (To stretch the term, adapter-like method handles may have multiple
167.50 - * targets or be polymorphic across multiple call types.)
167.51 - * @author jrose
167.52 - */
167.53 -class FromGeneric {
167.54 - // type for the outgoing call (may have primitives, etc.)
167.55 - private final MethodType targetType;
167.56 - // type of the outgoing call internal to the adapter
167.57 - private final MethodType internalType;
167.58 - // prototype adapter (clone and customize for each new target!)
167.59 - private final Adapter adapter;
167.60 - // entry point for adapter (Adapter mh, a...) => ...
167.61 - private final MethodHandle entryPoint;
167.62 - // unboxing invoker of type (MH, Object**N) => raw return value
167.63 - // it makes up the difference of internalType => targetType
167.64 - private final MethodHandle unboxingInvoker;
167.65 - // conversion which boxes a the target's raw return value
167.66 - private final MethodHandle returnConversion;
167.67 -
167.68 - /** Compute and cache information common to all unboxing adapters
167.69 - * that can call out to targets of the erasure-family of the given erased type.
167.70 - */
167.71 - private FromGeneric(MethodType targetType) {
167.72 - this.targetType = targetType;
167.73 - MethodType internalType0;
167.74 - // the target invoker will generally need casts on reference arguments
167.75 - Adapter ad = findAdapter(internalType0 = targetType.erase());
167.76 - if (ad != null) {
167.77 - // Immediate hit to exactly the adapter we want,
167.78 - // with no monkeying around with primitive types.
167.79 - this.internalType = internalType0;
167.80 - this.adapter = ad;
167.81 - this.entryPoint = ad.prototypeEntryPoint();
167.82 - this.returnConversion = computeReturnConversion(targetType, internalType0);
167.83 - this.unboxingInvoker = computeUnboxingInvoker(targetType, internalType0);
167.84 - return;
167.85 - }
167.86 -
167.87 - // outgoing primitive arguments will be wrapped; unwrap them
167.88 - MethodType primsAsObj = MethodTypeImpl.of(targetType).primArgsAsBoxes();
167.89 - MethodType objArgsRawRet = MethodTypeImpl.of(primsAsObj).primsAsInts();
167.90 - if (objArgsRawRet != targetType)
167.91 - ad = findAdapter(internalType0 = objArgsRawRet);
167.92 - if (ad == null) {
167.93 - ad = buildAdapterFromBytecodes(internalType0 = targetType);
167.94 - }
167.95 - this.internalType = internalType0;
167.96 - this.adapter = ad;
167.97 - MethodType tepType = targetType.insertParameterTypes(0, adapter.getClass());
167.98 - this.entryPoint = ad.prototypeEntryPoint();
167.99 - this.returnConversion = computeReturnConversion(targetType, internalType0);
167.100 - this.unboxingInvoker = computeUnboxingInvoker(targetType, internalType0);
167.101 - }
167.102 -
167.103 - /**
167.104 - * The typed target will be called according to targetType.
167.105 - * The adapter code will in fact see the raw result from internalType,
167.106 - * and must box it into an object. Produce a converter for this.
167.107 - */
167.108 - private static MethodHandle computeReturnConversion(
167.109 - MethodType targetType, MethodType internalType) {
167.110 - Class<?> tret = targetType.returnType();
167.111 - Class<?> iret = internalType.returnType();
167.112 - Wrapper wrap = Wrapper.forBasicType(tret);
167.113 - if (!iret.isPrimitive()) {
167.114 - assert(iret == Object.class);
167.115 - return ValueConversions.identity();
167.116 - } else if (wrap.primitiveType() == iret) {
167.117 - return ValueConversions.box(wrap, false);
167.118 - } else {
167.119 - assert(tret == double.class ? iret == long.class : iret == int.class);
167.120 - return ValueConversions.boxRaw(wrap, false);
167.121 - }
167.122 - }
167.123 -
167.124 - /**
167.125 - * The typed target will need an exact invocation point; provide it here.
167.126 - * The adapter will possibly need to make a slightly different call,
167.127 - * so adapt the invoker. This way, the logic for making up the
167.128 - * difference between what the adapter can call and what the target
167.129 - * needs can be cached once per type.
167.130 - */
167.131 - private static MethodHandle computeUnboxingInvoker(
167.132 - MethodType targetType, MethodType internalType) {
167.133 - // All the adapters we have here have reference-untyped internal calls.
167.134 - assert(internalType == internalType.erase());
167.135 - MethodHandle invoker = invokers(targetType).exactInvoker();
167.136 - // cast all narrow reference types, unbox all primitive arguments:
167.137 - MethodType fixArgsType = internalType.changeReturnType(targetType.returnType());
167.138 - MethodHandle fixArgs = AdapterMethodHandle.convertArguments(Access.TOKEN,
167.139 - invoker, Invokers.invokerType(fixArgsType),
167.140 - invoker.type(), null);
167.141 - if (fixArgs == null)
167.142 - throw new InternalError("bad fixArgs");
167.143 - // reinterpret the calling sequence as raw:
167.144 - MethodHandle retyper = AdapterMethodHandle.makeRetypeRaw(Access.TOKEN,
167.145 - Invokers.invokerType(internalType), fixArgs);
167.146 - if (retyper == null)
167.147 - throw new InternalError("bad retyper");
167.148 - return retyper;
167.149 - }
167.150 -
167.151 - Adapter makeInstance(MethodHandle typedTarget) {
167.152 - MethodType type = typedTarget.type();
167.153 - if (type == targetType) {
167.154 - return adapter.makeInstance(entryPoint, unboxingInvoker, returnConversion, typedTarget);
167.155 - }
167.156 - // my erased-type is not exactly the same as the desired type
167.157 - assert(type.erase() == targetType); // else we are busted
167.158 - MethodHandle invoker = computeUnboxingInvoker(type, internalType);
167.159 - return adapter.makeInstance(entryPoint, invoker, returnConversion, typedTarget);
167.160 - }
167.161 -
167.162 - /** Build an adapter of the given generic type, which invokes typedTarget
167.163 - * on the incoming arguments, after unboxing as necessary.
167.164 - * The return value is boxed if necessary.
167.165 - * @param genericType the required type of the result
167.166 - * @param typedTarget the target
167.167 - * @return an adapter method handle
167.168 - */
167.169 - public static MethodHandle make(MethodHandle typedTarget) {
167.170 - MethodType type = typedTarget.type();
167.171 - if (type == type.generic()) return typedTarget;
167.172 - return FromGeneric.of(type).makeInstance(typedTarget);
167.173 - }
167.174 -
167.175 - /** Return the adapter information for this type's erasure. */
167.176 - static FromGeneric of(MethodType type) {
167.177 - MethodTypeImpl form = MethodTypeImpl.of(type);
167.178 - FromGeneric fromGen = form.fromGeneric;
167.179 - if (fromGen == null)
167.180 - form.fromGeneric = fromGen = new FromGeneric(form.erasedType());
167.181 - return fromGen;
167.182 - }
167.183 -
167.184 - public String toString() {
167.185 - return "FromGeneric"+targetType;
167.186 - }
167.187 -
167.188 - /* Create an adapter that handles spreading calls for the given type. */
167.189 - static Adapter findAdapter(MethodType internalType) {
167.190 - MethodType entryType = internalType.generic();
167.191 - MethodTypeImpl form = MethodTypeImpl.of(internalType);
167.192 - Class<?> rtype = internalType.returnType();
167.193 - int argc = form.parameterCount();
167.194 - int lac = form.longPrimitiveParameterCount();
167.195 - int iac = form.primitiveParameterCount() - lac;
167.196 - String intsAndLongs = (iac > 0 ? "I"+iac : "")+(lac > 0 ? "J"+lac : "");
167.197 - String rawReturn = String.valueOf(Wrapper.forPrimitiveType(rtype).basicTypeChar());
167.198 - String cname0 = rawReturn + argc;
167.199 - String cname1 = "A" + argc;
167.200 - String[] cnames = { cname0+intsAndLongs, cname0, cname1+intsAndLongs, cname1 };
167.201 - String iname = "invoke_"+cname0+intsAndLongs;
167.202 - // e.g., D5I2, D5, L5I2, L5; invoke_D5
167.203 - for (String cname : cnames) {
167.204 - Class<? extends Adapter> acls = Adapter.findSubClass(cname);
167.205 - if (acls == null) continue;
167.206 - // see if it has the required invoke method
167.207 - MethodHandle entryPoint = null;
167.208 - try {
167.209 - entryPoint = MethodHandleImpl.IMPL_LOOKUP.findSpecial(acls, iname, entryType, acls);
167.210 - } catch (ReflectiveOperationException ex) {
167.211 - }
167.212 - if (entryPoint == null) continue;
167.213 - Constructor<? extends Adapter> ctor = null;
167.214 - try {
167.215 - ctor = acls.getDeclaredConstructor(MethodHandle.class);
167.216 - } catch (NoSuchMethodException ex) {
167.217 - } catch (SecurityException ex) {
167.218 - }
167.219 - if (ctor == null) continue;
167.220 - try {
167.221 - // Produce an instance configured as a prototype.
167.222 - return ctor.newInstance(entryPoint);
167.223 - } catch (IllegalArgumentException ex) {
167.224 - } catch (InvocationTargetException wex) {
167.225 - Throwable ex = wex.getTargetException();
167.226 - if (ex instanceof Error) throw (Error)ex;
167.227 - if (ex instanceof RuntimeException) throw (RuntimeException)ex;
167.228 - } catch (InstantiationException ex) {
167.229 - } catch (IllegalAccessException ex) {
167.230 - }
167.231 - }
167.232 - return null;
167.233 - }
167.234 -
167.235 - static Adapter buildAdapterFromBytecodes(MethodType internalType) {
167.236 - throw new UnsupportedOperationException("NYI");
167.237 - }
167.238 -
167.239 - /**
167.240 - * This adapter takes some untyped arguments, and returns an untyped result.
167.241 - * Internally, it applies the invoker to the target, which causes the
167.242 - * objects to be unboxed; the result is a raw type in L/I/J/F/D.
167.243 - * This result is passed to convert, which is responsible for
167.244 - * converting the raw result into a boxed object.
167.245 - * The invoker is kept separate from the target because it can be
167.246 - * generated once per type erasure family, and reused across adapters.
167.247 - */
167.248 - static abstract class Adapter extends BoundMethodHandle {
167.249 - /*
167.250 - * class X<<R,int N>> extends Adapter {
167.251 - * (MH, Object**N)=>raw(R) invoker;
167.252 - * (any**N)=>R target;
167.253 - * raw(R)=>Object convert;
167.254 - * Object invoke(Object**N a) = convert(invoker(target, a...))
167.255 - * }
167.256 - */
167.257 - protected final MethodHandle invoker; // (MH, Object**N) => raw(R)
167.258 - protected final MethodHandle convert; // raw(R) => Object
167.259 - protected final MethodHandle target; // (any**N) => R
167.260 -
167.261 - @Override
167.262 - public String toString() {
167.263 - return MethodHandleImpl.addTypeString(target, this);
167.264 - }
167.265 -
167.266 - protected boolean isPrototype() { return target == null; }
167.267 - protected Adapter(MethodHandle entryPoint) {
167.268 - this(entryPoint, null, entryPoint, null);
167.269 - assert(isPrototype());
167.270 - }
167.271 - protected MethodHandle prototypeEntryPoint() {
167.272 - if (!isPrototype()) throw new InternalError();
167.273 - return convert;
167.274 - }
167.275 -
167.276 - protected Adapter(MethodHandle entryPoint,
167.277 - MethodHandle invoker, MethodHandle convert, MethodHandle target) {
167.278 - super(Access.TOKEN, entryPoint);
167.279 - this.invoker = invoker;
167.280 - this.convert = convert;
167.281 - this.target = target;
167.282 - }
167.283 -
167.284 - /** Make a copy of self, with new fields. */
167.285 - protected abstract Adapter makeInstance(MethodHandle entryPoint,
167.286 - MethodHandle invoker, MethodHandle convert, MethodHandle target);
167.287 - // { return new ThisType(entryPoint, convert, target); }
167.288 -
167.289 - /// Conversions on the value returned from the target.
167.290 - protected Object convert_L(Object result) throws Throwable { return convert.invokeExact(result); }
167.291 - protected Object convert_I(int result) throws Throwable { return convert.invokeExact(result); }
167.292 - protected Object convert_J(long result) throws Throwable { return convert.invokeExact(result); }
167.293 - protected Object convert_F(float result) throws Throwable { return convert.invokeExact(result); }
167.294 - protected Object convert_D(double result) throws Throwable { return convert.invokeExact(result); }
167.295 -
167.296 - static private final String CLASS_PREFIX; // "sun.dyn.FromGeneric$"
167.297 - static {
167.298 - String aname = Adapter.class.getName();
167.299 - String sname = Adapter.class.getSimpleName();
167.300 - if (!aname.endsWith(sname)) throw new InternalError();
167.301 - CLASS_PREFIX = aname.substring(0, aname.length() - sname.length());
167.302 - }
167.303 - /** Find a sibing class of Adapter. */
167.304 - static Class<? extends Adapter> findSubClass(String name) {
167.305 - String cname = Adapter.CLASS_PREFIX + name;
167.306 - try {
167.307 - return Class.forName(cname).asSubclass(Adapter.class);
167.308 - } catch (ClassNotFoundException ex) {
167.309 - return null;
167.310 - } catch (ClassCastException ex) {
167.311 - return null;
167.312 - }
167.313 - }
167.314 - }
167.315 -
167.316 - /* generated classes follow this pattern:
167.317 - static class xA2 extends Adapter {
167.318 - protected xA2(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
167.319 - protected xA2(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.320 - { super(e, i, c, t); }
167.321 - protected xA2 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.322 - { return new xA2(e, i, c, t); }
167.323 - protected Object invoke_L2(Object a0, Object a1) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1)); }
167.324 - protected Object invoke_I2(Object a0, Object a1) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1)); }
167.325 - protected Object invoke_J2(Object a0, Object a1) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1)); }
167.326 - protected Object invoke_F2(Object a0, Object a1) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1)); }
167.327 - protected Object invoke_D2(Object a0, Object a1) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1)); }
167.328 - }
167.329 - // */
167.330 -
167.331 -/*
167.332 -: SHELL; n=FromGeneric; cp -p $n.java $n.java-; sed < $n.java- > $n.java+ -e '/{{*{{/,/}}*}}/w /tmp/genclasses.java' -e '/}}*}}/q'; (cd /tmp; javac -d . genclasses.java; java -cp . genclasses) >> $n.java+; echo '}' >> $n.java+; mv $n.java+ $n.java; mv $n.java- $n.java~
167.333 -//{{{
167.334 -import java.util.*;
167.335 -class genclasses {
167.336 - static String[] TYPES = { "Object", "int ", "long ", "float ", "double" };
167.337 - static String[] WRAPS = { " ", "(Integer)", "(Long) ", "(Float) ", "(Double) " };
167.338 - static String[] TCHARS = { "L", "I", "J", "F", "D", "A" };
167.339 - static String[][] TEMPLATES = { {
167.340 - "@for@ arity=0..10 rcat<=4 nrefs<=99 nints=0 nlongs=0",
167.341 - " //@each-cat@",
167.342 - " static class @cat@ extends Adapter {",
167.343 - " protected @cat@(MethodHandle entryPoint) { super(entryPoint); } // to build prototype",
167.344 - " protected @cat@(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)",
167.345 - " { super(e, i, c, t); }",
167.346 - " protected @cat@ makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)",
167.347 - " { return new @cat@(e, i, c, t); }",
167.348 - " //@each-R@",
167.349 - " protected Object invoke_@catN@(@Tvav@) throws Throwable { return convert_@Rc@((@R@)@W@invoker.invokeExact(target@av@)); }",
167.350 - " //@end-R@",
167.351 - " }",
167.352 - } };
167.353 - static final String NEWLINE_INDENT = "\n ";
167.354 - enum VAR {
167.355 - cat, catN, R, Rc, W, av, Tvav, Ovav;
167.356 - public final String pattern = "@"+toString().replace('_','.')+"@";
167.357 - public String binding;
167.358 - static void makeBindings(boolean topLevel, int rcat, int nrefs, int nints, int nlongs) {
167.359 - int nargs = nrefs + nints + nlongs;
167.360 - if (topLevel)
167.361 - VAR.cat.binding = catstr(ALL_RETURN_TYPES ? TYPES.length : rcat, nrefs, nints, nlongs);
167.362 - VAR.catN.binding = catstr(rcat, nrefs, nints, nlongs);
167.363 - VAR.R.binding = TYPES[rcat];
167.364 - VAR.Rc.binding = TCHARS[rcat];
167.365 - VAR.W.binding = WRAPS[rcat];
167.366 - String[] Tv = new String[nargs];
167.367 - String[] av = new String[nargs];
167.368 - String[] Tvav = new String[nargs];
167.369 - String[] Ovav = new String[nargs];
167.370 - for (int i = 0; i < nargs; i++) {
167.371 - int tcat = (i < nrefs) ? 0 : (i < nrefs + nints) ? 1 : 2;
167.372 - Tv[i] = TYPES[tcat];
167.373 - av[i] = arg(i);
167.374 - Tvav[i] = param(Tv[i], av[i]);
167.375 - Ovav[i] = param("Object", av[i]);
167.376 - }
167.377 - VAR.av.binding = comma(", ", av);
167.378 - VAR.Tvav.binding = comma(Tvav);
167.379 - VAR.Ovav.binding = comma(Ovav);
167.380 - }
167.381 - static String arg(int i) { return "a"+i; }
167.382 - static String param(String t, String a) { return t+" "+a; }
167.383 - static String comma(String[] v) { return comma("", v); }
167.384 - static String comma(String sep, String[] v) {
167.385 - if (v.length == 0) return "";
167.386 - String res = sep+v[0];
167.387 - for (int i = 1; i < v.length; i++) res += ", "+v[i];
167.388 - return res;
167.389 - }
167.390 - static String transform(String string) {
167.391 - for (VAR var : values())
167.392 - string = string.replaceAll(var.pattern, var.binding);
167.393 - return string;
167.394 - }
167.395 - }
167.396 - static String[] stringsIn(String[] strings, int beg, int end) {
167.397 - return Arrays.copyOfRange(strings, beg, Math.min(end, strings.length));
167.398 - }
167.399 - static String[] stringsBefore(String[] strings, int pos) {
167.400 - return stringsIn(strings, 0, pos);
167.401 - }
167.402 - static String[] stringsAfter(String[] strings, int pos) {
167.403 - return stringsIn(strings, pos, strings.length);
167.404 - }
167.405 - static int indexAfter(String[] strings, int pos, String tag) {
167.406 - return Math.min(indexBefore(strings, pos, tag) + 1, strings.length);
167.407 - }
167.408 - static int indexBefore(String[] strings, int pos, String tag) {
167.409 - for (int i = pos, end = strings.length; ; i++) {
167.410 - if (i == end || strings[i].endsWith(tag)) return i;
167.411 - }
167.412 - }
167.413 - static int MIN_ARITY, MAX_ARITY, MAX_RCAT, MAX_REFS, MAX_INTS, MAX_LONGS;
167.414 - static boolean ALL_ARG_TYPES, ALL_RETURN_TYPES;
167.415 - static HashSet<String> done = new HashSet<String>();
167.416 - public static void main(String... av) {
167.417 - for (String[] template : TEMPLATES) {
167.418 - int forLinesLimit = indexBefore(template, 0, "@each-cat@");
167.419 - String[] forLines = stringsBefore(template, forLinesLimit);
167.420 - template = stringsAfter(template, forLinesLimit);
167.421 - for (String forLine : forLines)
167.422 - expandTemplate(forLine, template);
167.423 - }
167.424 - }
167.425 - static void expandTemplate(String forLine, String[] template) {
167.426 - String[] params = forLine.split("[^0-9]+");
167.427 - if (params[0].length() == 0) params = stringsAfter(params, 1);
167.428 - System.out.println("//params="+Arrays.asList(params));
167.429 - int pcur = 0;
167.430 - MIN_ARITY = Integer.valueOf(params[pcur++]);
167.431 - MAX_ARITY = Integer.valueOf(params[pcur++]);
167.432 - MAX_RCAT = Integer.valueOf(params[pcur++]);
167.433 - MAX_REFS = Integer.valueOf(params[pcur++]);
167.434 - MAX_INTS = Integer.valueOf(params[pcur++]);
167.435 - MAX_LONGS = Integer.valueOf(params[pcur++]);
167.436 - if (pcur != params.length) throw new RuntimeException("bad extra param: "+forLine);
167.437 - if (MAX_RCAT >= TYPES.length) MAX_RCAT = TYPES.length - 1;
167.438 - ALL_ARG_TYPES = (indexBefore(template, 0, "@each-Tv@") < template.length);
167.439 - ALL_RETURN_TYPES = (indexBefore(template, 0, "@each-R@") < template.length);
167.440 - for (int nargs = MIN_ARITY; nargs <= MAX_ARITY; nargs++) {
167.441 - for (int rcat = 0; rcat <= MAX_RCAT; rcat++) {
167.442 - expandTemplate(template, true, rcat, nargs, 0, 0);
167.443 - if (ALL_ARG_TYPES) break;
167.444 - expandTemplateForPrims(template, true, rcat, nargs, 1, 1);
167.445 - if (ALL_RETURN_TYPES) break;
167.446 - }
167.447 - }
167.448 - }
167.449 - static String catstr(int rcat, int nrefs, int nints, int nlongs) {
167.450 - int nargs = nrefs + nints + nlongs;
167.451 - String cat = TCHARS[rcat] + nargs;
167.452 - if (!ALL_ARG_TYPES) cat += (nints==0?"":"I"+nints)+(nlongs==0?"":"J"+nlongs);
167.453 - return cat;
167.454 - }
167.455 - static void expandTemplateForPrims(String[] template, boolean topLevel, int rcat, int nargs, int minints, int minlongs) {
167.456 - for (int isLong = 0; isLong <= 1; isLong++) {
167.457 - for (int nprims = 1; nprims <= nargs; nprims++) {
167.458 - int nrefs = nargs - nprims;
167.459 - int nints = ((1-isLong) * nprims);
167.460 - int nlongs = (isLong * nprims);
167.461 - expandTemplate(template, topLevel, rcat, nrefs, nints, nlongs);
167.462 - }
167.463 - }
167.464 - }
167.465 - static void expandTemplate(String[] template, boolean topLevel,
167.466 - int rcat, int nrefs, int nints, int nlongs) {
167.467 - int nargs = nrefs + nints + nlongs;
167.468 - if (nrefs > MAX_REFS || nints > MAX_INTS || nlongs > MAX_LONGS) return;
167.469 - VAR.makeBindings(topLevel, rcat, nrefs, nints, nlongs);
167.470 - if (topLevel && !done.add(VAR.cat.binding)) {
167.471 - System.out.println(" //repeat "+VAR.cat.binding);
167.472 - return;
167.473 - }
167.474 - for (int i = 0; i < template.length; i++) {
167.475 - String line = template[i];
167.476 - if (line.endsWith("@each-cat@")) {
167.477 - // ignore
167.478 - } else if (line.endsWith("@each-R@")) {
167.479 - int blockEnd = indexAfter(template, i, "@end-R@");
167.480 - String[] block = stringsIn(template, i+1, blockEnd-1);
167.481 - for (int rcat1 = rcat; rcat1 <= MAX_RCAT; rcat1++)
167.482 - expandTemplate(block, false, rcat1, nrefs, nints, nlongs);
167.483 - VAR.makeBindings(topLevel, rcat, nrefs, nints, nlongs);
167.484 - i = blockEnd-1; continue;
167.485 - } else if (line.endsWith("@each-Tv@")) {
167.486 - int blockEnd = indexAfter(template, i, "@end-Tv@");
167.487 - String[] block = stringsIn(template, i+1, blockEnd-1);
167.488 - expandTemplate(block, false, rcat, nrefs, nints, nlongs);
167.489 - expandTemplateForPrims(block, false, rcat, nargs, nints+1, nlongs+1);
167.490 - VAR.makeBindings(topLevel, rcat, nrefs, nints, nlongs);
167.491 - i = blockEnd-1; continue;
167.492 - } else {
167.493 - System.out.println(VAR.transform(line));
167.494 - }
167.495 - }
167.496 - }
167.497 -}
167.498 -//}}} */
167.499 -//params=[0, 10, 4, 99, 0, 0]
167.500 - static class A0 extends Adapter {
167.501 - protected A0(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
167.502 - protected A0(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.503 - { super(e, i, c, t); }
167.504 - protected A0 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.505 - { return new A0(e, i, c, t); }
167.506 - protected Object invoke_L0() throws Throwable { return convert_L((Object)invoker.invokeExact(target)); }
167.507 - protected Object invoke_I0() throws Throwable { return convert_I((int) invoker.invokeExact(target)); }
167.508 - protected Object invoke_J0() throws Throwable { return convert_J((long) invoker.invokeExact(target)); }
167.509 - protected Object invoke_F0() throws Throwable { return convert_F((float) invoker.invokeExact(target)); }
167.510 - protected Object invoke_D0() throws Throwable { return convert_D((double)invoker.invokeExact(target)); }
167.511 - }
167.512 - static class A1 extends Adapter {
167.513 - protected A1(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
167.514 - protected A1(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.515 - { super(e, i, c, t); }
167.516 - protected A1 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.517 - { return new A1(e, i, c, t); }
167.518 - protected Object invoke_L1(Object a0) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0)); }
167.519 - protected Object invoke_I1(Object a0) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0)); }
167.520 - protected Object invoke_J1(Object a0) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0)); }
167.521 - protected Object invoke_F1(Object a0) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0)); }
167.522 - protected Object invoke_D1(Object a0) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0)); }
167.523 - }
167.524 - static class A2 extends Adapter {
167.525 - protected A2(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
167.526 - protected A2(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.527 - { super(e, i, c, t); }
167.528 - protected A2 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.529 - { return new A2(e, i, c, t); }
167.530 - protected Object invoke_L2(Object a0, Object a1) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1)); }
167.531 - protected Object invoke_I2(Object a0, Object a1) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1)); }
167.532 - protected Object invoke_J2(Object a0, Object a1) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1)); }
167.533 - protected Object invoke_F2(Object a0, Object a1) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1)); }
167.534 - protected Object invoke_D2(Object a0, Object a1) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1)); }
167.535 - }
167.536 - static class A3 extends Adapter {
167.537 - protected A3(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
167.538 - protected A3(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.539 - { super(e, i, c, t); }
167.540 - protected A3 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.541 - { return new A3(e, i, c, t); }
167.542 - protected Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2)); }
167.543 - protected Object invoke_I3(Object a0, Object a1, Object a2) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2)); }
167.544 - protected Object invoke_J3(Object a0, Object a1, Object a2) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2)); }
167.545 - protected Object invoke_F3(Object a0, Object a1, Object a2) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2)); }
167.546 - protected Object invoke_D3(Object a0, Object a1, Object a2) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2)); }
167.547 - }
167.548 - static class A4 extends Adapter {
167.549 - protected A4(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
167.550 - protected A4(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.551 - { super(e, i, c, t); }
167.552 - protected A4 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.553 - { return new A4(e, i, c, t); }
167.554 - protected Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3)); }
167.555 - protected Object invoke_I4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3)); }
167.556 - protected Object invoke_J4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3)); }
167.557 - protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3)); }
167.558 - protected Object invoke_D4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3)); }
167.559 - }
167.560 - static class A5 extends Adapter {
167.561 - protected A5(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
167.562 - protected A5(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.563 - { super(e, i, c, t); }
167.564 - protected A5 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.565 - { return new A5(e, i, c, t); }
167.566 - protected Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4)); }
167.567 - protected Object invoke_I5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4)); }
167.568 - protected Object invoke_J5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4)); }
167.569 - protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4)); }
167.570 - protected Object invoke_D5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4)); }
167.571 - }
167.572 - static class A6 extends Adapter {
167.573 - protected A6(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
167.574 - protected A6(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.575 - { super(e, i, c, t); }
167.576 - protected A6 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.577 - { return new A6(e, i, c, t); }
167.578 - protected Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); }
167.579 - protected Object invoke_I6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); }
167.580 - protected Object invoke_J6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); }
167.581 - protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); }
167.582 - protected Object invoke_D6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5)); }
167.583 - }
167.584 - static class A7 extends Adapter {
167.585 - protected A7(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
167.586 - protected A7(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.587 - { super(e, i, c, t); }
167.588 - protected A7 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.589 - { return new A7(e, i, c, t); }
167.590 - protected Object invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); }
167.591 - protected Object invoke_I7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); }
167.592 - protected Object invoke_J7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); }
167.593 - protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); }
167.594 - protected Object invoke_D7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); }
167.595 - }
167.596 - static class A8 extends Adapter {
167.597 - protected A8(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
167.598 - protected A8(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.599 - { super(e, i, c, t); }
167.600 - protected A8 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.601 - { return new A8(e, i, c, t); }
167.602 - protected Object invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); }
167.603 - protected Object invoke_I8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); }
167.604 - protected Object invoke_J8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); }
167.605 - protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); }
167.606 - protected Object invoke_D8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); }
167.607 - }
167.608 - static class A9 extends Adapter {
167.609 - protected A9(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
167.610 - protected A9(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.611 - { super(e, i, c, t); }
167.612 - protected A9 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.613 - { return new A9(e, i, c, t); }
167.614 - protected Object invoke_L9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
167.615 - protected Object invoke_I9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
167.616 - protected Object invoke_J9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
167.617 - protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
167.618 - protected Object invoke_D9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
167.619 - }
167.620 - static class A10 extends Adapter {
167.621 - protected A10(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
167.622 - protected A10(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.623 - { super(e, i, c, t); }
167.624 - protected A10 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)
167.625 - { return new A10(e, i, c, t); }
167.626 - protected Object invoke_L10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_L((Object)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
167.627 - protected Object invoke_I10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_I((int) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
167.628 - protected Object invoke_J10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_J((long) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
167.629 - protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_F((float) invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
167.630 - protected Object invoke_D10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return convert_D((double)invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
167.631 - }
167.632 -}
168.1 --- a/src/share/classes/sun/dyn/InvokeGeneric.java Tue Mar 29 11:29:01 2011 -0700
168.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
168.3 @@ -1,161 +0,0 @@
168.4 -/*
168.5 - * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
168.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
168.7 - *
168.8 - * This code is free software; you can redistribute it and/or modify it
168.9 - * under the terms of the GNU General Public License version 2 only, as
168.10 - * published by the Free Software Foundation. Oracle designates this
168.11 - * particular file as subject to the "Classpath" exception as provided
168.12 - * by Oracle in the LICENSE file that accompanied this code.
168.13 - *
168.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
168.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
168.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
168.17 - * version 2 for more details (a copy is included in the LICENSE file that
168.18 - * accompanied this code).
168.19 - *
168.20 - * You should have received a copy of the GNU General Public License version
168.21 - * 2 along with this work; if not, write to the Free Software Foundation,
168.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
168.23 - *
168.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
168.25 - * or visit www.oracle.com if you need additional information or have any
168.26 - * questions.
168.27 - */
168.28 -
168.29 -package sun.dyn;
168.30 -
168.31 -import java.dyn.*;
168.32 -import java.lang.reflect.*;
168.33 -import sun.dyn.util.*;
168.34 -import static sun.dyn.MethodTypeImpl.invokers;
168.35 -
168.36 -/**
168.37 - * Adapters which manage MethodHanndle.invokeGeneric calls.
168.38 - * The JVM calls one of these when the exact type match fails.
168.39 - * @author jrose
168.40 - */
168.41 -class InvokeGeneric {
168.42 - // erased type for the call, which originates from an invokeGeneric site
168.43 - private final MethodType erasedCallerType;
168.44 - // an invoker of type (MT, MH; A...) -> R
168.45 - private final MethodHandle initialInvoker;
168.46 -
168.47 - /** Compute and cache information for this adapter, so that it can
168.48 - * call out to targets of the erasure-family of the given erased type.
168.49 - */
168.50 - private InvokeGeneric(MethodType erasedCallerType) throws ReflectiveOperationException {
168.51 - this.erasedCallerType = erasedCallerType;
168.52 - this.initialInvoker = makeInitialInvoker();
168.53 - assert initialInvoker.type().equals(erasedCallerType
168.54 - .insertParameterTypes(0, MethodType.class, MethodHandle.class))
168.55 - : initialInvoker.type();
168.56 - }
168.57 -
168.58 - private static MethodHandles.Lookup lookup() {
168.59 - return MethodHandleImpl.IMPL_LOOKUP;
168.60 - }
168.61 -
168.62 - /** Return the adapter information for this type's erasure. */
168.63 - static MethodHandle genericInvokerOf(MethodType type) {
168.64 - MethodTypeImpl form = MethodTypeImpl.of(type);
168.65 - MethodHandle genericInvoker = form.genericInvoker;
168.66 - if (genericInvoker == null) {
168.67 - try {
168.68 - InvokeGeneric gen = new InvokeGeneric(form.erasedType());
168.69 - form.genericInvoker = genericInvoker = gen.initialInvoker;
168.70 - } catch (ReflectiveOperationException ex) {
168.71 - throw new RuntimeException(ex);
168.72 - }
168.73 - }
168.74 - return genericInvoker;
168.75 - }
168.76 -
168.77 - private MethodHandle makeInitialInvoker() throws ReflectiveOperationException {
168.78 - // postDispatch = #(MH'; MT, MH; A...){MH'(MT, MH; A)}
168.79 - MethodHandle postDispatch = makePostDispatchInvoker();
168.80 - MethodHandle invoker;
168.81 - if (returnConversionPossible()) {
168.82 - invoker = MethodHandles.foldArguments(postDispatch,
168.83 - dispatcher("dispatchWithConversion"));
168.84 - } else {
168.85 - invoker = MethodHandles.foldArguments(postDispatch, dispatcher("dispatch"));
168.86 - }
168.87 - return invoker;
168.88 - }
168.89 -
168.90 - private static final Class<?>[] EXTRA_ARGS = { MethodType.class, MethodHandle.class };
168.91 - private MethodHandle makePostDispatchInvoker() {
168.92 - // Take (MH'; MT, MH; A...) and run MH'(MT, MH; A...).
168.93 - MethodType invokerType = erasedCallerType.insertParameterTypes(0, EXTRA_ARGS);
168.94 - return invokers(invokerType).exactInvoker();
168.95 - }
168.96 - private MethodHandle dropDispatchArguments(MethodHandle targetInvoker) {
168.97 - assert(targetInvoker.type().parameterType(0) == MethodHandle.class);
168.98 - return MethodHandles.dropArguments(targetInvoker, 1, EXTRA_ARGS);
168.99 - }
168.100 -
168.101 - private MethodHandle dispatcher(String dispatchName) throws ReflectiveOperationException {
168.102 - return lookup().bind(this, dispatchName,
168.103 - MethodType.methodType(MethodHandle.class,
168.104 - MethodType.class, MethodHandle.class));
168.105 - }
168.106 -
168.107 - static final boolean USE_AS_TYPE_PATH = true;
168.108 -
168.109 - /** Return a method handle to invoke on the callerType, target, and remaining arguments.
168.110 - * The method handle must finish the call.
168.111 - * This is the first look at the caller type and target.
168.112 - */
168.113 - private MethodHandle dispatch(MethodType callerType, MethodHandle target) {
168.114 - MethodType targetType = target.type();
168.115 - if (USE_AS_TYPE_PATH || target.isVarargsCollector()) {
168.116 - MethodHandle newTarget = target.asType(callerType);
168.117 - targetType = callerType;
168.118 - Invokers invokers = MethodTypeImpl.invokers(Access.TOKEN, targetType);
168.119 - MethodHandle invoker = invokers.erasedInvokerWithDrops;
168.120 - if (invoker == null) {
168.121 - invokers.erasedInvokerWithDrops = invoker =
168.122 - dropDispatchArguments(invokers.erasedInvoker());
168.123 - }
168.124 - return invoker.bindTo(newTarget);
168.125 - }
168.126 - throw new RuntimeException("NYI");
168.127 - }
168.128 -
168.129 - private MethodHandle dispatchWithConversion(MethodType callerType, MethodHandle target) {
168.130 - MethodHandle finisher = dispatch(callerType, target);
168.131 - if (returnConversionNeeded(callerType, target))
168.132 - finisher = addReturnConversion(finisher, callerType.returnType()); //FIXME: slow
168.133 - return finisher;
168.134 - }
168.135 -
168.136 - private boolean returnConversionPossible() {
168.137 - Class<?> needType = erasedCallerType.returnType();
168.138 - return !needType.isPrimitive();
168.139 - }
168.140 - private boolean returnConversionNeeded(MethodType callerType, MethodHandle target) {
168.141 - Class<?> needType = callerType.returnType();
168.142 - if (needType == erasedCallerType.returnType())
168.143 - return false; // no conversions possible, since must be primitive or Object
168.144 - Class<?> haveType = target.type().returnType();
168.145 - if (VerifyType.isNullConversion(haveType, needType))
168.146 - return false;
168.147 - return true;
168.148 - }
168.149 - private MethodHandle addReturnConversion(MethodHandle target, Class<?> type) {
168.150 - if (true) throw new RuntimeException("NYI");
168.151 - // FIXME: This is slow because it creates a closure node on every call that requires a return cast.
168.152 - MethodType targetType = target.type();
168.153 - MethodHandle caster = ValueConversions.identity(type);
168.154 - caster = caster.asType(MethodType.methodType(type, targetType.returnType()));
168.155 - // Drop irrelevant arguments, because we only care about the return value:
168.156 - caster = MethodHandles.dropArguments(caster, 1, targetType.parameterList());
168.157 - MethodHandle result = MethodHandles.foldArguments(caster, target);
168.158 - return result.asType(target.type());
168.159 - }
168.160 -
168.161 - public String toString() {
168.162 - return "InvokeGeneric"+erasedCallerType;
168.163 - }
168.164 -}
169.1 --- a/src/share/classes/sun/dyn/Invokers.java Tue Mar 29 11:29:01 2011 -0700
169.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
169.3 @@ -1,144 +0,0 @@
169.4 -/*
169.5 - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
169.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
169.7 - *
169.8 - * This code is free software; you can redistribute it and/or modify it
169.9 - * under the terms of the GNU General Public License version 2 only, as
169.10 - * published by the Free Software Foundation. Oracle designates this
169.11 - * particular file as subject to the "Classpath" exception as provided
169.12 - * by Oracle in the LICENSE file that accompanied this code.
169.13 - *
169.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
169.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
169.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
169.17 - * version 2 for more details (a copy is included in the LICENSE file that
169.18 - * accompanied this code).
169.19 - *
169.20 - * You should have received a copy of the GNU General Public License version
169.21 - * 2 along with this work; if not, write to the Free Software Foundation,
169.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
169.23 - *
169.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
169.25 - * or visit www.oracle.com if you need additional information or have any
169.26 - * questions.
169.27 - */
169.28 -
169.29 -package sun.dyn;
169.30 -
169.31 -import java.dyn.*;
169.32 -import sun.dyn.empty.Empty;
169.33 -
169.34 -/**
169.35 - * Construction and caching of often-used invokers.
169.36 - * @author jrose
169.37 - */
169.38 -public class Invokers {
169.39 - // exact type (sans leading taget MH) for the outgoing call
169.40 - private final MethodType targetType;
169.41 -
169.42 - // exact invoker for the outgoing call
169.43 - private /*lazy*/ MethodHandle exactInvoker;
169.44 -
169.45 - // erased (partially untyped but with primitives) invoker for the outgoing call
169.46 - private /*lazy*/ MethodHandle erasedInvoker;
169.47 - /*lazy*/ MethodHandle erasedInvokerWithDrops; // for InvokeGeneric
169.48 -
169.49 - // generic (untyped) invoker for the outgoing call
169.50 - private /*lazy*/ MethodHandle genericInvoker;
169.51 -
169.52 - // generic (untyped) invoker for the outgoing call; accepts a single Object[]
169.53 - private final /*lazy*/ MethodHandle[] spreadInvokers;
169.54 -
169.55 - // invoker for an unbound callsite
169.56 - private /*lazy*/ MethodHandle uninitializedCallSite;
169.57 -
169.58 - /** Compute and cache information common to all collecting adapters
169.59 - * that implement members of the erasure-family of the given erased type.
169.60 - */
169.61 - /*non-public*/ Invokers(MethodType targetType) {
169.62 - this.targetType = targetType;
169.63 - this.spreadInvokers = new MethodHandle[targetType.parameterCount()+1];
169.64 - }
169.65 -
169.66 - public static MethodType invokerType(MethodType targetType) {
169.67 - return targetType.insertParameterTypes(0, MethodHandle.class);
169.68 - }
169.69 -
169.70 - public MethodHandle exactInvoker() {
169.71 - MethodHandle invoker = exactInvoker;
169.72 - if (invoker != null) return invoker;
169.73 - try {
169.74 - invoker = MethodHandleImpl.IMPL_LOOKUP.findVirtual(MethodHandle.class, "invokeExact", targetType);
169.75 - } catch (ReflectiveOperationException ex) {
169.76 - throw new InternalError("JVM cannot find invoker for "+targetType);
169.77 - }
169.78 - assert(invokerType(targetType) == invoker.type());
169.79 - exactInvoker = invoker;
169.80 - return invoker;
169.81 - }
169.82 -
169.83 - public MethodHandle genericInvoker() {
169.84 - MethodHandle invoker1 = exactInvoker();
169.85 - MethodHandle invoker = genericInvoker;
169.86 - if (invoker != null) return invoker;
169.87 - MethodType genericType = targetType.generic();
169.88 - invoker = MethodHandles.convertArguments(invoker1, invokerType(genericType));
169.89 - genericInvoker = invoker;
169.90 - return invoker;
169.91 - }
169.92 -
169.93 - public MethodHandle erasedInvoker() {
169.94 - MethodHandle invoker1 = exactInvoker();
169.95 - MethodHandle invoker = erasedInvoker;
169.96 - if (invoker != null) return invoker;
169.97 - MethodType erasedType = targetType.erase();
169.98 - if (erasedType == targetType.generic())
169.99 - invoker = genericInvoker();
169.100 - else
169.101 - invoker = MethodHandles.convertArguments(invoker1, invokerType(erasedType));
169.102 - erasedInvoker = invoker;
169.103 - return invoker;
169.104 - }
169.105 -
169.106 - public MethodHandle spreadInvoker(int objectArgCount) {
169.107 - MethodHandle vaInvoker = spreadInvokers[objectArgCount];
169.108 - if (vaInvoker != null) return vaInvoker;
169.109 - MethodHandle gInvoker = genericInvoker();
169.110 - vaInvoker = gInvoker.asSpreader(Object[].class, targetType.parameterCount() - objectArgCount);
169.111 - spreadInvokers[objectArgCount] = vaInvoker;
169.112 - return vaInvoker;
169.113 - }
169.114 -
169.115 - private static MethodHandle THROW_UCS = null;
169.116 -
169.117 - public MethodHandle uninitializedCallSite() {
169.118 - MethodHandle invoker = uninitializedCallSite;
169.119 - if (invoker != null) return invoker;
169.120 - if (targetType.parameterCount() > 0) {
169.121 - MethodType type0 = targetType.dropParameterTypes(0, targetType.parameterCount());
169.122 - Invokers invokers0 = MethodTypeImpl.invokers(type0);
169.123 - invoker = MethodHandles.dropArguments(invokers0.uninitializedCallSite(),
169.124 - 0, targetType.parameterList());
169.125 - assert(invoker.type().equals(targetType));
169.126 - uninitializedCallSite = invoker;
169.127 - return invoker;
169.128 - }
169.129 - if (THROW_UCS == null) {
169.130 - try {
169.131 - THROW_UCS = MethodHandleImpl.IMPL_LOOKUP
169.132 - .findStatic(CallSite.class, "uninitializedCallSite",
169.133 - MethodType.methodType(Empty.class));
169.134 - } catch (ReflectiveOperationException ex) {
169.135 - throw new RuntimeException(ex);
169.136 - }
169.137 - }
169.138 - invoker = AdapterMethodHandle.makeRetypeRaw(Access.TOKEN, targetType, THROW_UCS);
169.139 - assert(invoker.type().equals(targetType));
169.140 - uninitializedCallSite = invoker;
169.141 - return invoker;
169.142 - }
169.143 -
169.144 - public String toString() {
169.145 - return "Invokers"+targetType;
169.146 - }
169.147 -}
170.1 --- a/src/share/classes/sun/dyn/MemberName.java Tue Mar 29 11:29:01 2011 -0700
170.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
170.3 @@ -1,739 +0,0 @@
170.4 -/*
170.5 - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
170.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
170.7 - *
170.8 - * This code is free software; you can redistribute it and/or modify it
170.9 - * under the terms of the GNU General Public License version 2 only, as
170.10 - * published by the Free Software Foundation. Oracle designates this
170.11 - * particular file as subject to the "Classpath" exception as provided
170.12 - * by Oracle in the LICENSE file that accompanied this code.
170.13 - *
170.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
170.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
170.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
170.17 - * version 2 for more details (a copy is included in the LICENSE file that
170.18 - * accompanied this code).
170.19 - *
170.20 - * You should have received a copy of the GNU General Public License version
170.21 - * 2 along with this work; if not, write to the Free Software Foundation,
170.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
170.23 - *
170.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
170.25 - * or visit www.oracle.com if you need additional information or have any
170.26 - * questions.
170.27 - */
170.28 -
170.29 -package sun.dyn;
170.30 -
170.31 -import sun.dyn.util.BytecodeDescriptor;
170.32 -import java.dyn.*;
170.33 -import java.lang.reflect.Constructor;
170.34 -import java.lang.reflect.Field;
170.35 -import java.lang.reflect.Method;
170.36 -import java.lang.reflect.Member;
170.37 -import java.lang.reflect.Modifier;
170.38 -import java.util.ArrayList;
170.39 -import java.util.Arrays;
170.40 -import java.util.Collections;
170.41 -import java.util.Iterator;
170.42 -import java.util.List;
170.43 -import static sun.dyn.MethodHandleNatives.Constants.*;
170.44 -
170.45 -/**
170.46 - * A {@code MemberName} is a compact symbolic datum which fully characterizes
170.47 - * a method or field reference.
170.48 - * A member name refers to a field, method, constructor, or member type.
170.49 - * Every member name has a simple name (a string) and a type (either a Class or MethodType).
170.50 - * A member name may also have a non-null declaring class, or it may be simply
170.51 - * a naked name/type pair.
170.52 - * A member name may also have non-zero modifier flags.
170.53 - * Finally, a member name may be either resolved or unresolved.
170.54 - * If it is resolved, the existence of the named
170.55 - * <p>
170.56 - * Whether resolved or not, a member name provides no access rights or
170.57 - * invocation capability to its possessor. It is merely a compact
170.58 - * representation of all symbolic information necessary to link to
170.59 - * and properly use the named member.
170.60 - * <p>
170.61 - * When resolved, a member name's internal implementation may include references to JVM metadata.
170.62 - * This representation is stateless and only decriptive.
170.63 - * It provides no private information and no capability to use the member.
170.64 - * <p>
170.65 - * By contrast, a {@linkplain java.lang.reflect.Method} contains fuller information
170.66 - * about the internals of a method (except its bytecodes) and also
170.67 - * allows invocation. A MemberName is much lighter than a Method,
170.68 - * since it contains about 7 fields to the 16 of Method (plus its sub-arrays),
170.69 - * and those seven fields omit much of the information in Method.
170.70 - * @author jrose
170.71 - */
170.72 -public final class MemberName implements Member, Cloneable {
170.73 - private Class<?> clazz; // class in which the method is defined
170.74 - private String name; // may be null if not yet materialized
170.75 - private Object type; // may be null if not yet materialized
170.76 - private int flags; // modifier bits; see reflect.Modifier
170.77 -
170.78 - private Object vmtarget; // VM-specific target value
170.79 - private int vmindex; // method index within class or interface
170.80 -
170.81 - { vmindex = VM_INDEX_UNINITIALIZED; }
170.82 -
170.83 - /** Return the declaring class of this member.
170.84 - * In the case of a bare name and type, the declaring class will be null.
170.85 - */
170.86 - public Class<?> getDeclaringClass() {
170.87 - if (clazz == null && isResolved()) {
170.88 - expandFromVM();
170.89 - }
170.90 - return clazz;
170.91 - }
170.92 -
170.93 - /** Utility method producing the class loader of the declaring class. */
170.94 - public ClassLoader getClassLoader() {
170.95 - return clazz.getClassLoader();
170.96 - }
170.97 -
170.98 - /** Return the simple name of this member.
170.99 - * For a type, it is the same as {@link Class#getSimpleName}.
170.100 - * For a method or field, it is the simple name of the member.
170.101 - * For a constructor, it is always {@code "<init>"}.
170.102 - */
170.103 - public String getName() {
170.104 - if (name == null) {
170.105 - expandFromVM();
170.106 - if (name == null) return null;
170.107 - }
170.108 - return name;
170.109 - }
170.110 -
170.111 - /** Return the declared type of this member, which
170.112 - * must be a method or constructor.
170.113 - */
170.114 - public MethodType getMethodType() {
170.115 - if (type == null) {
170.116 - expandFromVM();
170.117 - if (type == null) return null;
170.118 - }
170.119 - if (!isInvocable())
170.120 - throw newIllegalArgumentException("not invocable, no method type");
170.121 - if (type instanceof MethodType) {
170.122 - return (MethodType) type;
170.123 - }
170.124 - if (type instanceof String) {
170.125 - String sig = (String) type;
170.126 - MethodType res = MethodType.fromMethodDescriptorString(sig, getClassLoader());
170.127 - this.type = res;
170.128 - return res;
170.129 - }
170.130 - if (type instanceof Object[]) {
170.131 - Object[] typeInfo = (Object[]) type;
170.132 - Class<?>[] ptypes = (Class<?>[]) typeInfo[1];
170.133 - Class<?> rtype = (Class<?>) typeInfo[0];
170.134 - MethodType res = MethodType.methodType(rtype, ptypes);
170.135 - this.type = res;
170.136 - return res;
170.137 - }
170.138 - throw new InternalError("bad method type "+type);
170.139 - }
170.140 -
170.141 - /** Return the actual type under which this method or constructor must be invoked.
170.142 - * For non-static methods or constructors, this is the type with a leading parameter,
170.143 - * a reference to declaring class. For static methods, it is the same as the declared type.
170.144 - */
170.145 - public MethodType getInvocationType() {
170.146 - MethodType itype = getMethodType();
170.147 - if (!isStatic())
170.148 - itype = itype.insertParameterTypes(0, clazz);
170.149 - return itype;
170.150 - }
170.151 -
170.152 - /** Utility method producing the parameter types of the method type. */
170.153 - public Class<?>[] getParameterTypes() {
170.154 - return getMethodType().parameterArray();
170.155 - }
170.156 -
170.157 - /** Utility method producing the return type of the method type. */
170.158 - public Class<?> getReturnType() {
170.159 - return getMethodType().returnType();
170.160 - }
170.161 -
170.162 - /** Return the declared type of this member, which
170.163 - * must be a field or type.
170.164 - * If it is a type member, that type itself is returned.
170.165 - */
170.166 - public Class<?> getFieldType() {
170.167 - if (type == null) {
170.168 - expandFromVM();
170.169 - if (type == null) return null;
170.170 - }
170.171 - if (isInvocable())
170.172 - throw newIllegalArgumentException("not a field or nested class, no simple type");
170.173 - if (type instanceof Class<?>) {
170.174 - return (Class<?>) type;
170.175 - }
170.176 - if (type instanceof String) {
170.177 - String sig = (String) type;
170.178 - MethodType mtype = MethodType.fromMethodDescriptorString("()"+sig, getClassLoader());
170.179 - Class<?> res = mtype.returnType();
170.180 - this.type = res;
170.181 - return res;
170.182 - }
170.183 - throw new InternalError("bad field type "+type);
170.184 - }
170.185 -
170.186 - /** Utility method to produce either the method type or field type of this member. */
170.187 - public Object getType() {
170.188 - return (isInvocable() ? getMethodType() : getFieldType());
170.189 - }
170.190 -
170.191 - /** Utility method to produce the signature of this member,
170.192 - * used within the class file format to describe its type.
170.193 - */
170.194 - public String getSignature() {
170.195 - if (type == null) {
170.196 - expandFromVM();
170.197 - if (type == null) return null;
170.198 - }
170.199 - if (type instanceof String)
170.200 - return (String) type;
170.201 - if (isInvocable())
170.202 - return BytecodeDescriptor.unparse(getMethodType());
170.203 - else
170.204 - return BytecodeDescriptor.unparse(getFieldType());
170.205 - }
170.206 -
170.207 - /** Return the modifier flags of this member.
170.208 - * @see java.lang.reflect.Modifier
170.209 - */
170.210 - public int getModifiers() {
170.211 - return (flags & RECOGNIZED_MODIFIERS);
170.212 - }
170.213 -
170.214 - private void setFlags(int flags) {
170.215 - this.flags = flags;
170.216 - assert(testAnyFlags(ALL_KINDS));
170.217 - }
170.218 -
170.219 - private boolean testFlags(int mask, int value) {
170.220 - return (flags & mask) == value;
170.221 - }
170.222 - private boolean testAllFlags(int mask) {
170.223 - return testFlags(mask, mask);
170.224 - }
170.225 - private boolean testAnyFlags(int mask) {
170.226 - return !testFlags(mask, 0);
170.227 - }
170.228 -
170.229 - /** Utility method to query the modifier flags of this member. */
170.230 - public boolean isStatic() {
170.231 - return Modifier.isStatic(flags);
170.232 - }
170.233 - /** Utility method to query the modifier flags of this member. */
170.234 - public boolean isPublic() {
170.235 - return Modifier.isPublic(flags);
170.236 - }
170.237 - /** Utility method to query the modifier flags of this member. */
170.238 - public boolean isPrivate() {
170.239 - return Modifier.isPrivate(flags);
170.240 - }
170.241 - /** Utility method to query the modifier flags of this member. */
170.242 - public boolean isProtected() {
170.243 - return Modifier.isProtected(flags);
170.244 - }
170.245 - /** Utility method to query the modifier flags of this member. */
170.246 - public boolean isFinal() {
170.247 - return Modifier.isFinal(flags);
170.248 - }
170.249 - /** Utility method to query the modifier flags of this member. */
170.250 - public boolean isAbstract() {
170.251 - return Modifier.isAbstract(flags);
170.252 - }
170.253 - // let the rest (native, volatile, transient, etc.) be tested via Modifier.isFoo
170.254 -
170.255 - // unofficial modifier flags, used by HotSpot:
170.256 - static final int BRIDGE = 0x00000040;
170.257 - static final int VARARGS = 0x00000080;
170.258 - static final int SYNTHETIC = 0x00001000;
170.259 - static final int ANNOTATION= 0x00002000;
170.260 - static final int ENUM = 0x00004000;
170.261 - /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
170.262 - public boolean isBridge() {
170.263 - return testAllFlags(IS_METHOD | BRIDGE);
170.264 - }
170.265 - /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
170.266 - public boolean isVarargs() {
170.267 - return testAllFlags(VARARGS) && isInvocable();
170.268 - }
170.269 - /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
170.270 - public boolean isSynthetic() {
170.271 - return testAllFlags(SYNTHETIC);
170.272 - }
170.273 -
170.274 - static final String CONSTRUCTOR_NAME = "<init>"; // the ever-popular
170.275 -
170.276 - // modifiers exported by the JVM:
170.277 - static final int RECOGNIZED_MODIFIERS = 0xFFFF;
170.278 -
170.279 - // private flags, not part of RECOGNIZED_MODIFIERS:
170.280 - static final int
170.281 - IS_METHOD = MN_IS_METHOD, // method (not constructor)
170.282 - IS_CONSTRUCTOR = MN_IS_CONSTRUCTOR, // constructor
170.283 - IS_FIELD = MN_IS_FIELD, // field
170.284 - IS_TYPE = MN_IS_TYPE; // nested type
170.285 - static final int // for MethodHandleNatives.getMembers
170.286 - SEARCH_SUPERCLASSES = MN_SEARCH_SUPERCLASSES,
170.287 - SEARCH_INTERFACES = MN_SEARCH_INTERFACES;
170.288 -
170.289 - static final int ALL_ACCESS = Modifier.PUBLIC | Modifier.PRIVATE | Modifier.PROTECTED;
170.290 - static final int ALL_KINDS = IS_METHOD | IS_CONSTRUCTOR | IS_FIELD | IS_TYPE;
170.291 - static final int IS_INVOCABLE = IS_METHOD | IS_CONSTRUCTOR;
170.292 - static final int IS_FIELD_OR_METHOD = IS_METHOD | IS_FIELD;
170.293 - static final int SEARCH_ALL_SUPERS = SEARCH_SUPERCLASSES | SEARCH_INTERFACES;
170.294 -
170.295 - /** Utility method to query whether this member is a method or constructor. */
170.296 - public boolean isInvocable() {
170.297 - return testAnyFlags(IS_INVOCABLE);
170.298 - }
170.299 - /** Utility method to query whether this member is a method, constructor, or field. */
170.300 - public boolean isFieldOrMethod() {
170.301 - return testAnyFlags(IS_FIELD_OR_METHOD);
170.302 - }
170.303 - /** Query whether this member is a method. */
170.304 - public boolean isMethod() {
170.305 - return testAllFlags(IS_METHOD);
170.306 - }
170.307 - /** Query whether this member is a constructor. */
170.308 - public boolean isConstructor() {
170.309 - return testAllFlags(IS_CONSTRUCTOR);
170.310 - }
170.311 - /** Query whether this member is a field. */
170.312 - public boolean isField() {
170.313 - return testAllFlags(IS_FIELD);
170.314 - }
170.315 - /** Query whether this member is a type. */
170.316 - public boolean isType() {
170.317 - return testAllFlags(IS_TYPE);
170.318 - }
170.319 - /** Utility method to query whether this member is neither public, private, nor protected. */
170.320 - public boolean isPackage() {
170.321 - return !testAnyFlags(ALL_ACCESS);
170.322 - }
170.323 -
170.324 - /** Initialize a query. It is not resolved. */
170.325 - private void init(Class<?> defClass, String name, Object type, int flags) {
170.326 - // defining class is allowed to be null (for a naked name/type pair)
170.327 - //name.toString(); // null check
170.328 - //type.equals(type); // null check
170.329 - // fill in fields:
170.330 - this.clazz = defClass;
170.331 - this.name = name;
170.332 - this.type = type;
170.333 - setFlags(flags);
170.334 - assert(!isResolved());
170.335 - }
170.336 -
170.337 - private void expandFromVM() {
170.338 - if (!isResolved()) return;
170.339 - if (type instanceof Object[])
170.340 - type = null; // don't saddle JVM w/ typeInfo
170.341 - MethodHandleNatives.expand(this);
170.342 - }
170.343 -
170.344 - // Capturing information from the Core Reflection API:
170.345 - private static int flagsMods(int flags, int mods) {
170.346 - assert((flags & RECOGNIZED_MODIFIERS) == 0);
170.347 - assert((mods & ~RECOGNIZED_MODIFIERS) == 0);
170.348 - return flags | mods;
170.349 - }
170.350 - /** Create a name for the given reflected method. The resulting name will be in a resolved state. */
170.351 - public MemberName(Method m) {
170.352 - Object[] typeInfo = { m.getReturnType(), m.getParameterTypes() };
170.353 - init(m.getDeclaringClass(), m.getName(), typeInfo, flagsMods(IS_METHOD, m.getModifiers()));
170.354 - // fill in vmtarget, vmindex while we have m in hand:
170.355 - MethodHandleNatives.init(this, m);
170.356 - assert(isResolved());
170.357 - }
170.358 - /** Create a name for the given reflected constructor. The resulting name will be in a resolved state. */
170.359 - public MemberName(Constructor ctor) {
170.360 - Object[] typeInfo = { void.class, ctor.getParameterTypes() };
170.361 - init(ctor.getDeclaringClass(), CONSTRUCTOR_NAME, typeInfo, flagsMods(IS_CONSTRUCTOR, ctor.getModifiers()));
170.362 - // fill in vmtarget, vmindex while we have ctor in hand:
170.363 - MethodHandleNatives.init(this, ctor);
170.364 - assert(isResolved());
170.365 - }
170.366 - /** Create a name for the given reflected field. The resulting name will be in a resolved state. */
170.367 - public MemberName(Field fld) {
170.368 - init(fld.getDeclaringClass(), fld.getName(), fld.getType(), flagsMods(IS_FIELD, fld.getModifiers()));
170.369 - // fill in vmtarget, vmindex while we have fld in hand:
170.370 - MethodHandleNatives.init(this, fld);
170.371 - assert(isResolved());
170.372 - }
170.373 - /** Create a name for the given class. The resulting name will be in a resolved state. */
170.374 - public MemberName(Class<?> type) {
170.375 - init(type.getDeclaringClass(), type.getSimpleName(), type, flagsMods(IS_TYPE, type.getModifiers()));
170.376 - vmindex = 0; // isResolved
170.377 - assert(isResolved());
170.378 - }
170.379 -
170.380 - // bare-bones constructor; the JVM will fill it in
170.381 - MemberName() { }
170.382 -
170.383 - // locally useful cloner
170.384 - @Override protected MemberName clone() {
170.385 - try {
170.386 - return (MemberName) super.clone();
170.387 - } catch (CloneNotSupportedException ex) {
170.388 - throw new InternalError();
170.389 - }
170.390 - }
170.391 -
170.392 - // %%% define equals/hashcode?
170.393 -
170.394 - // Construction from symbolic parts, for queries:
170.395 - /** Create a field or type name from the given components: Declaring class, name, type, modifiers.
170.396 - * The declaring class may be supplied as null if this is to be a bare name and type.
170.397 - * The resulting name will in an unresolved state.
170.398 - */
170.399 - public MemberName(Class<?> defClass, String name, Class<?> type, int modifiers) {
170.400 - init(defClass, name, type, IS_FIELD | (modifiers & RECOGNIZED_MODIFIERS));
170.401 - }
170.402 - /** Create a field or type name from the given components: Declaring class, name, type.
170.403 - * The declaring class may be supplied as null if this is to be a bare name and type.
170.404 - * The modifier flags default to zero.
170.405 - * The resulting name will in an unresolved state.
170.406 - */
170.407 - public MemberName(Class<?> defClass, String name, Class<?> type) {
170.408 - this(defClass, name, type, 0);
170.409 - }
170.410 - /** Create a method or constructor name from the given components: Declaring class, name, type, modifiers.
170.411 - * It will be a constructor if and only if the name is {@code "<init>"}.
170.412 - * The declaring class may be supplied as null if this is to be a bare name and type.
170.413 - * The resulting name will in an unresolved state.
170.414 - */
170.415 - public MemberName(Class<?> defClass, String name, MethodType type, int modifiers) {
170.416 - int flagBit = (name.equals(CONSTRUCTOR_NAME) ? IS_CONSTRUCTOR : IS_METHOD);
170.417 - init(defClass, name, type, flagBit | (modifiers & RECOGNIZED_MODIFIERS));
170.418 - }
170.419 - /** Create a method or constructor name from the given components: Declaring class, name, type, modifiers.
170.420 - * It will be a constructor if and only if the name is {@code "<init>"}.
170.421 - * The declaring class may be supplied as null if this is to be a bare name and type.
170.422 - * The modifier flags default to zero.
170.423 - * The resulting name will in an unresolved state.
170.424 - */
170.425 - public MemberName(Class<?> defClass, String name, MethodType type) {
170.426 - this(defClass, name, type, 0);
170.427 - }
170.428 -
170.429 - /** Query whether this member name is resolved.
170.430 - * A resolved member name is one for which the JVM has found
170.431 - * a method, constructor, field, or type binding corresponding exactly to the name.
170.432 - * (Document?)
170.433 - */
170.434 - public boolean isResolved() {
170.435 - return (vmindex != VM_INDEX_UNINITIALIZED);
170.436 - }
170.437 -
170.438 - /** Query whether this member name is resolved to a non-static, non-final method.
170.439 - */
170.440 - public boolean hasReceiverTypeDispatch() {
170.441 - return (isMethod() && getVMIndex(Access.TOKEN) >= 0);
170.442 - }
170.443 -
170.444 - /** Produce a string form of this member name.
170.445 - * For types, it is simply the type's own string (as reported by {@code toString}).
170.446 - * For fields, it is {@code "DeclaringClass.name/type"}.
170.447 - * For methods and constructors, it is {@code "DeclaringClass.name(ptype...)rtype"}.
170.448 - * If the declaring class is null, the prefix {@code "DeclaringClass."} is omitted.
170.449 - * If the member is unresolved, a prefix {@code "*."} is prepended.
170.450 - */
170.451 - @Override
170.452 - public String toString() {
170.453 - if (isType())
170.454 - return type.toString(); // class java.lang.String
170.455 - // else it is a field, method, or constructor
170.456 - StringBuilder buf = new StringBuilder();
170.457 - if (getDeclaringClass() != null) {
170.458 - buf.append(getName(clazz));
170.459 - buf.append('.');
170.460 - }
170.461 - String name = getName();
170.462 - buf.append(name == null ? "*" : name);
170.463 - Object type = getType();
170.464 - if (!isInvocable()) {
170.465 - buf.append('/');
170.466 - buf.append(type == null ? "*" : getName(type));
170.467 - } else {
170.468 - buf.append(type == null ? "(*)*" : getName(type));
170.469 - }
170.470 - /*
170.471 - buf.append('/');
170.472 - // key: Public, private, pRotected, sTatic, Final, sYnchronized,
170.473 - // transient/Varargs, native, (interface), abstract, sTrict, sYnthetic,
170.474 - // (annotation), Enum, (unused)
170.475 - final String FIELD_MOD_CHARS = "PprTF?vt????Y?E?";
170.476 - final String METHOD_MOD_CHARS = "PprTFybVn?atY???";
170.477 - String modChars = (isInvocable() ? METHOD_MOD_CHARS : FIELD_MOD_CHARS);
170.478 - for (int i = 0; i < modChars.length(); i++) {
170.479 - if ((flags & (1 << i)) != 0) {
170.480 - char mc = modChars.charAt(i);
170.481 - if (mc != '?')
170.482 - buf.append(mc);
170.483 - }
170.484 - }
170.485 - */
170.486 - return buf.toString();
170.487 - }
170.488 - private static String getName(Object obj) {
170.489 - if (obj instanceof Class<?>)
170.490 - return ((Class<?>)obj).getName();
170.491 - return String.valueOf(obj);
170.492 - }
170.493 -
170.494 - // Queries to the JVM:
170.495 - /** Document? */
170.496 - public int getVMIndex(Access token) {
170.497 - Access.check(token);
170.498 - if (!isResolved())
170.499 - throw newIllegalStateException("not resolved");
170.500 - return vmindex;
170.501 - }
170.502 -// public Object getVMTarget(Access token) {
170.503 -// Access.check(token);
170.504 -// if (!isResolved())
170.505 -// throw newIllegalStateException("not resolved");
170.506 -// return vmtarget;
170.507 -// }
170.508 - private RuntimeException newIllegalStateException(String message) {
170.509 - return new IllegalStateException(message+": "+this);
170.510 - }
170.511 -
170.512 - // handy shared exception makers (they simplify the common case code)
170.513 - public static RuntimeException newIllegalArgumentException(String message) {
170.514 - return new IllegalArgumentException(message);
170.515 - }
170.516 - public static IllegalAccessException newNoAccessException(MemberName name, Object from) {
170.517 - return newNoAccessException("cannot access", name, from);
170.518 - }
170.519 - public static IllegalAccessException newNoAccessException(String message,
170.520 - MemberName name, Object from) {
170.521 - message += ": " + name;
170.522 - if (from != null) message += ", from " + from;
170.523 - return new IllegalAccessException(message);
170.524 - }
170.525 - public static ReflectiveOperationException newNoAccessException(MemberName name) {
170.526 - if (name.isResolved())
170.527 - return new IllegalAccessException(name.toString());
170.528 - else if (name.isConstructor())
170.529 - return new NoSuchMethodException(name.toString());
170.530 - else if (name.isMethod())
170.531 - return new NoSuchMethodException(name.toString());
170.532 - else
170.533 - return new NoSuchFieldException(name.toString());
170.534 - }
170.535 - public static Error uncaughtException(Exception ex) {
170.536 - Error err = new InternalError("uncaught exception");
170.537 - err.initCause(ex);
170.538 - return err;
170.539 - }
170.540 -
170.541 - /** Actually making a query requires an access check. */
170.542 - public static Factory getFactory(Access token) {
170.543 - Access.check(token);
170.544 - return Factory.INSTANCE;
170.545 - }
170.546 - public static Factory getFactory() {
170.547 - return getFactory(Access.getToken());
170.548 - }
170.549 - /** A factory type for resolving member names with the help of the VM.
170.550 - * TBD: Define access-safe public constructors for this factory.
170.551 - */
170.552 - public static class Factory {
170.553 - private Factory() { } // singleton pattern
170.554 - static Factory INSTANCE = new Factory();
170.555 -
170.556 - private static int ALLOWED_FLAGS = SEARCH_ALL_SUPERS | ALL_KINDS;
170.557 -
170.558 - /// Queries
170.559 - List<MemberName> getMembers(Class<?> defc,
170.560 - String matchName, Object matchType,
170.561 - int matchFlags, Class<?> lookupClass) {
170.562 - matchFlags &= ALLOWED_FLAGS;
170.563 - String matchSig = null;
170.564 - if (matchType != null) {
170.565 - matchSig = BytecodeDescriptor.unparse(matchType);
170.566 - if (matchSig.startsWith("("))
170.567 - matchFlags &= ~(ALL_KINDS & ~IS_INVOCABLE);
170.568 - else
170.569 - matchFlags &= ~(ALL_KINDS & ~IS_FIELD);
170.570 - }
170.571 - final int BUF_MAX = 0x2000;
170.572 - int len1 = matchName == null ? 10 : matchType == null ? 4 : 1;
170.573 - MemberName[] buf = newMemberBuffer(len1);
170.574 - int totalCount = 0;
170.575 - ArrayList<MemberName[]> bufs = null;
170.576 - int bufCount = 0;
170.577 - for (;;) {
170.578 - bufCount = MethodHandleNatives.getMembers(defc,
170.579 - matchName, matchSig, matchFlags,
170.580 - lookupClass,
170.581 - totalCount, buf);
170.582 - if (bufCount <= buf.length) {
170.583 - if (bufCount < 0) bufCount = 0;
170.584 - totalCount += bufCount;
170.585 - break;
170.586 - }
170.587 - // JVM returned to us with an intentional overflow!
170.588 - totalCount += buf.length;
170.589 - int excess = bufCount - buf.length;
170.590 - if (bufs == null) bufs = new ArrayList<MemberName[]>(1);
170.591 - bufs.add(buf);
170.592 - int len2 = buf.length;
170.593 - len2 = Math.max(len2, excess);
170.594 - len2 = Math.max(len2, totalCount / 4);
170.595 - buf = newMemberBuffer(Math.min(BUF_MAX, len2));
170.596 - }
170.597 - ArrayList<MemberName> result = new ArrayList<MemberName>(totalCount);
170.598 - if (bufs != null) {
170.599 - for (MemberName[] buf0 : bufs) {
170.600 - Collections.addAll(result, buf0);
170.601 - }
170.602 - }
170.603 - result.addAll(Arrays.asList(buf).subList(0, bufCount));
170.604 - // Signature matching is not the same as type matching, since
170.605 - // one signature might correspond to several types.
170.606 - // So if matchType is a Class or MethodType, refilter the results.
170.607 - if (matchType != null && matchType != matchSig) {
170.608 - for (Iterator<MemberName> it = result.iterator(); it.hasNext();) {
170.609 - MemberName m = it.next();
170.610 - if (!matchType.equals(m.getType()))
170.611 - it.remove();
170.612 - }
170.613 - }
170.614 - return result;
170.615 - }
170.616 - boolean resolveInPlace(MemberName m, boolean searchSupers, Class<?> lookupClass) {
170.617 - if (m.name == null || m.type == null) { // find unique non-overloaded name
170.618 - Class<?> defc = m.getDeclaringClass();
170.619 - List<MemberName> choices = null;
170.620 - if (m.isMethod())
170.621 - choices = getMethods(defc, searchSupers, m.name, (MethodType) m.type, lookupClass);
170.622 - else if (m.isConstructor())
170.623 - choices = getConstructors(defc, lookupClass);
170.624 - else if (m.isField())
170.625 - choices = getFields(defc, searchSupers, m.name, (Class<?>) m.type, lookupClass);
170.626 - //System.out.println("resolving "+m+" to "+choices);
170.627 - if (choices == null || choices.size() != 1)
170.628 - return false;
170.629 - if (m.name == null) m.name = choices.get(0).name;
170.630 - if (m.type == null) m.type = choices.get(0).type;
170.631 - }
170.632 - MethodHandleNatives.resolve(m, lookupClass);
170.633 - if (m.isResolved()) return true;
170.634 - int matchFlags = m.flags | (searchSupers ? SEARCH_ALL_SUPERS : 0);
170.635 - String matchSig = m.getSignature();
170.636 - MemberName[] buf = { m };
170.637 - int n = MethodHandleNatives.getMembers(m.getDeclaringClass(),
170.638 - m.getName(), matchSig, matchFlags, lookupClass, 0, buf);
170.639 - if (n != 1) return false;
170.640 - return m.isResolved();
170.641 - }
170.642 - /** Produce a resolved version of the given member.
170.643 - * Super types are searched (for inherited members) if {@code searchSupers} is true.
170.644 - * Access checking is performed on behalf of the given {@code lookupClass}.
170.645 - * If lookup fails or access is not permitted, null is returned.
170.646 - * Otherwise a fresh copy of the given member is returned, with modifier bits filled in.
170.647 - */
170.648 - public MemberName resolveOrNull(MemberName m, boolean searchSupers, Class<?> lookupClass) {
170.649 - MemberName result = m.clone();
170.650 - if (resolveInPlace(result, searchSupers, lookupClass))
170.651 - return result;
170.652 - return null;
170.653 - }
170.654 - /** Produce a resolved version of the given member.
170.655 - * Super types are searched (for inherited members) if {@code searchSupers} is true.
170.656 - * Access checking is performed on behalf of the given {@code lookupClass}.
170.657 - * If lookup fails or access is not permitted, a {@linkplain ReflectiveOperationException} is thrown.
170.658 - * Otherwise a fresh copy of the given member is returned, with modifier bits filled in.
170.659 - */
170.660 - public
170.661 - <NoSuchMemberException extends ReflectiveOperationException>
170.662 - MemberName resolveOrFail(MemberName m, boolean searchSupers, Class<?> lookupClass,
170.663 - Class<NoSuchMemberException> nsmClass)
170.664 - throws IllegalAccessException, NoSuchMemberException {
170.665 - MemberName result = resolveOrNull(m, searchSupers, lookupClass);
170.666 - if (result != null)
170.667 - return result;
170.668 - ReflectiveOperationException ex = newNoAccessException(m);
170.669 - if (ex instanceof IllegalAccessException) throw (IllegalAccessException) ex;
170.670 - throw nsmClass.cast(ex);
170.671 - }
170.672 - /** Return a list of all methods defined by the given class.
170.673 - * Super types are searched (for inherited members) if {@code searchSupers} is true.
170.674 - * Access checking is performed on behalf of the given {@code lookupClass}.
170.675 - * Inaccessible members are not added to the last.
170.676 - */
170.677 - public List<MemberName> getMethods(Class<?> defc, boolean searchSupers,
170.678 - Class<?> lookupClass) {
170.679 - return getMethods(defc, searchSupers, null, null, lookupClass);
170.680 - }
170.681 - /** Return a list of matching methods defined by the given class.
170.682 - * Super types are searched (for inherited members) if {@code searchSupers} is true.
170.683 - * Returned methods will match the name (if not null) and the type (if not null).
170.684 - * Access checking is performed on behalf of the given {@code lookupClass}.
170.685 - * Inaccessible members are not added to the last.
170.686 - */
170.687 - public List<MemberName> getMethods(Class<?> defc, boolean searchSupers,
170.688 - String name, MethodType type, Class<?> lookupClass) {
170.689 - int matchFlags = IS_METHOD | (searchSupers ? SEARCH_ALL_SUPERS : 0);
170.690 - return getMembers(defc, name, type, matchFlags, lookupClass);
170.691 - }
170.692 - /** Return a list of all constructors defined by the given class.
170.693 - * Access checking is performed on behalf of the given {@code lookupClass}.
170.694 - * Inaccessible members are not added to the last.
170.695 - */
170.696 - public List<MemberName> getConstructors(Class<?> defc, Class<?> lookupClass) {
170.697 - return getMembers(defc, null, null, IS_CONSTRUCTOR, lookupClass);
170.698 - }
170.699 - /** Return a list of all fields defined by the given class.
170.700 - * Super types are searched (for inherited members) if {@code searchSupers} is true.
170.701 - * Access checking is performed on behalf of the given {@code lookupClass}.
170.702 - * Inaccessible members are not added to the last.
170.703 - */
170.704 - public List<MemberName> getFields(Class<?> defc, boolean searchSupers,
170.705 - Class<?> lookupClass) {
170.706 - return getFields(defc, searchSupers, null, null, lookupClass);
170.707 - }
170.708 - /** Return a list of all fields defined by the given class.
170.709 - * Super types are searched (for inherited members) if {@code searchSupers} is true.
170.710 - * Returned fields will match the name (if not null) and the type (if not null).
170.711 - * Access checking is performed on behalf of the given {@code lookupClass}.
170.712 - * Inaccessible members are not added to the last.
170.713 - */
170.714 - public List<MemberName> getFields(Class<?> defc, boolean searchSupers,
170.715 - String name, Class<?> type, Class<?> lookupClass) {
170.716 - int matchFlags = IS_FIELD | (searchSupers ? SEARCH_ALL_SUPERS : 0);
170.717 - return getMembers(defc, name, type, matchFlags, lookupClass);
170.718 - }
170.719 - /** Return a list of all nested types defined by the given class.
170.720 - * Super types are searched (for inherited members) if {@code searchSupers} is true.
170.721 - * Access checking is performed on behalf of the given {@code lookupClass}.
170.722 - * Inaccessible members are not added to the last.
170.723 - */
170.724 - public List<MemberName> getNestedTypes(Class<?> defc, boolean searchSupers,
170.725 - Class<?> lookupClass) {
170.726 - int matchFlags = IS_TYPE | (searchSupers ? SEARCH_ALL_SUPERS : 0);
170.727 - return getMembers(defc, null, null, matchFlags, lookupClass);
170.728 - }
170.729 - private static MemberName[] newMemberBuffer(int length) {
170.730 - MemberName[] buf = new MemberName[length];
170.731 - // fill the buffer with dummy structs for the JVM to fill in
170.732 - for (int i = 0; i < length; i++)
170.733 - buf[i] = new MemberName();
170.734 - return buf;
170.735 - }
170.736 - }
170.737 -
170.738 -// static {
170.739 -// System.out.println("Hello world! My methods are:");
170.740 -// System.out.println(Factory.INSTANCE.getMethods(MemberName.class, true, null));
170.741 -// }
170.742 -}
171.1 --- a/src/share/classes/sun/dyn/MethodHandleImpl.java Tue Mar 29 11:29:01 2011 -0700
171.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
171.3 @@ -1,1284 +0,0 @@
171.4 -/*
171.5 - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
171.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
171.7 - *
171.8 - * This code is free software; you can redistribute it and/or modify it
171.9 - * under the terms of the GNU General Public License version 2 only, as
171.10 - * published by the Free Software Foundation. Oracle designates this
171.11 - * particular file as subject to the "Classpath" exception as provided
171.12 - * by Oracle in the LICENSE file that accompanied this code.
171.13 - *
171.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
171.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
171.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
171.17 - * version 2 for more details (a copy is included in the LICENSE file that
171.18 - * accompanied this code).
171.19 - *
171.20 - * You should have received a copy of the GNU General Public License version
171.21 - * 2 along with this work; if not, write to the Free Software Foundation,
171.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
171.23 - *
171.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
171.25 - * or visit www.oracle.com if you need additional information or have any
171.26 - * questions.
171.27 - */
171.28 -
171.29 -package sun.dyn;
171.30 -
171.31 -import java.dyn.*;
171.32 -import java.dyn.MethodHandles.Lookup;
171.33 -import java.util.logging.Level;
171.34 -import java.util.logging.Logger;
171.35 -import sun.dyn.util.VerifyType;
171.36 -import java.util.ArrayList;
171.37 -import java.util.Arrays;
171.38 -import java.util.Collections;
171.39 -import java.util.HashMap;
171.40 -import java.util.Iterator;
171.41 -import java.util.List;
171.42 -import sun.dyn.empty.Empty;
171.43 -import sun.dyn.util.ValueConversions;
171.44 -import sun.dyn.util.Wrapper;
171.45 -import sun.misc.Unsafe;
171.46 -import static sun.dyn.MemberName.newIllegalArgumentException;
171.47 -import static sun.dyn.MemberName.newNoAccessException;
171.48 -import static sun.dyn.MemberName.uncaughtException;
171.49 -
171.50 -/**
171.51 - * Base class for method handles, containing JVM-specific fields and logic.
171.52 - * TO DO: It should not be a base class.
171.53 - * @author jrose
171.54 - */
171.55 -public abstract class MethodHandleImpl {
171.56 -
171.57 - // Fields which really belong in MethodHandle:
171.58 - private byte vmentry; // adapter stub or method entry point
171.59 - //private int vmslots; // optionally, hoist type.form.vmslots
171.60 - protected Object vmtarget; // VM-specific, class-specific target value
171.61 - //MethodType type; // defined in MethodHandle
171.62 -
171.63 - // TO DO: vmtarget should be invisible to Java, since the JVM puts internal
171.64 - // managed pointers into it. Making it visible exposes it to debuggers,
171.65 - // which can cause errors when they treat the pointer as an Object.
171.66 -
171.67 - // These two dummy fields are present to force 'I' and 'J' signatures
171.68 - // into this class's constant pool, so they can be transferred
171.69 - // to vmentry when this class is loaded.
171.70 - static final int INT_FIELD = 0;
171.71 - static final long LONG_FIELD = 0;
171.72 -
171.73 - /** Access methods for the internals of MethodHandle, supplied to
171.74 - * MethodHandleImpl as a trusted agent.
171.75 - */
171.76 - static public interface MethodHandleFriend {
171.77 - void initType(MethodHandle mh, MethodType type);
171.78 - }
171.79 - public static void setMethodHandleFriend(Access token, MethodHandleFriend am) {
171.80 - Access.check(token);
171.81 - if (METHOD_HANDLE_FRIEND != null)
171.82 - throw new InternalError(); // just once
171.83 - METHOD_HANDLE_FRIEND = am;
171.84 - }
171.85 - static private MethodHandleFriend METHOD_HANDLE_FRIEND;
171.86 -
171.87 - // NOT public
171.88 - static void initType(MethodHandle mh, MethodType type) {
171.89 - METHOD_HANDLE_FRIEND.initType(mh, type);
171.90 - }
171.91 -
171.92 - // type is defined in java.dyn.MethodHandle, which is platform-independent
171.93 -
171.94 - // vmentry (a void* field) is used *only* by by the JVM.
171.95 - // The JVM adjusts its type to int or long depending on system wordsize.
171.96 - // Since it is statically typed as neither int nor long, it is impossible
171.97 - // to use this field from Java bytecode. (Please don't try to, either.)
171.98 -
171.99 - // The vmentry is an assembly-language stub which is jumped to
171.100 - // immediately after the method type is verified.
171.101 - // For a direct MH, this stub loads the vmtarget's entry point
171.102 - // and jumps to it.
171.103 -
171.104 - /**
171.105 - * VM-based method handles must have a security token.
171.106 - * This security token can only be obtained by trusted code.
171.107 - * Do not create method handles directly; use factory methods.
171.108 - */
171.109 - public MethodHandleImpl(Access token) {
171.110 - Access.check(token);
171.111 - }
171.112 -
171.113 - /** Initialize the method type form to participate in JVM calls.
171.114 - * This is done once for each erased type.
171.115 - */
171.116 - public static void init(Access token, MethodType self) {
171.117 - Access.check(token);
171.118 - if (MethodHandleNatives.JVM_SUPPORT)
171.119 - MethodHandleNatives.init(self);
171.120 - }
171.121 -
171.122 - /// Factory methods to create method handles:
171.123 -
171.124 - private static final MemberName.Factory LOOKUP = MemberName.Factory.INSTANCE;
171.125 -
171.126 - static private Lookup IMPL_LOOKUP_INIT;
171.127 -
171.128 - public static void initLookup(Access token, Lookup lookup) {
171.129 - Access.check(token);
171.130 - if (IMPL_LOOKUP_INIT != null)
171.131 - throw new InternalError();
171.132 - IMPL_LOOKUP_INIT = lookup;
171.133 - }
171.134 -
171.135 - public static Lookup getLookup(Access token) {
171.136 - Access.check(token);
171.137 - return IMPL_LOOKUP;
171.138 - }
171.139 -
171.140 - static {
171.141 - if (!MethodHandleNatives.JVM_SUPPORT) // force init of native API
171.142 - throw new InternalError("No JVM support for JSR 292");
171.143 - // Force initialization of Lookup, so it calls us back as initLookup:
171.144 - MethodHandles.publicLookup();
171.145 - if (IMPL_LOOKUP_INIT == null)
171.146 - throw new InternalError();
171.147 - }
171.148 -
171.149 - public static void initStatics() {
171.150 - // Trigger preceding sequence.
171.151 - }
171.152 -
171.153 - /** Shared secret with MethodHandles.Lookup, a copy of Lookup.IMPL_LOOKUP. */
171.154 - static final Lookup IMPL_LOOKUP = IMPL_LOOKUP_INIT;
171.155 -
171.156 -
171.157 - /** Look up a given method.
171.158 - * Callable only from java.dyn and related packages.
171.159 - * <p>
171.160 - * The resulting method handle type will be of the given type,
171.161 - * with a receiver type {@code rcvc} prepended if the member is not static.
171.162 - * <p>
171.163 - * Access checks are made as of the given lookup class.
171.164 - * In particular, if the method is protected and {@code defc} is in a
171.165 - * different package from the lookup class, then {@code rcvc} must be
171.166 - * the lookup class or a subclass.
171.167 - * @param token Proof that the lookup class has access to this package.
171.168 - * @param member Resolved method or constructor to call.
171.169 - * @param name Name of the desired method.
171.170 - * @param rcvc Receiver type of desired non-static method (else null)
171.171 - * @param doDispatch whether the method handle will test the receiver type
171.172 - * @param lookupClass access-check relative to this class
171.173 - * @return a direct handle to the matching method
171.174 - * @throws IllegalAccessException if the given method cannot be accessed by the lookup class
171.175 - */
171.176 - public static
171.177 - MethodHandle findMethod(Access token, MemberName method,
171.178 - boolean doDispatch, Class<?> lookupClass) throws IllegalAccessException {
171.179 - Access.check(token); // only trusted calls
171.180 - MethodType mtype = method.getMethodType();
171.181 - if (!method.isStatic()) {
171.182 - // adjust the advertised receiver type to be exactly the one requested
171.183 - // (in the case of invokespecial, this will be the calling class)
171.184 - Class<?> recvType = method.getDeclaringClass();
171.185 - mtype = mtype.insertParameterTypes(0, recvType);
171.186 - }
171.187 - DirectMethodHandle mh = new DirectMethodHandle(mtype, method, doDispatch, lookupClass);
171.188 - if (!mh.isValid())
171.189 - throw newNoAccessException(method, lookupClass);
171.190 - assert(mh.type() == mtype);
171.191 - if (!method.isVarargs())
171.192 - return mh;
171.193 - else
171.194 - return mh.asVarargsCollector(mtype.parameterType(mtype.parameterCount()-1));
171.195 - }
171.196 -
171.197 - public static
171.198 - MethodHandle makeAllocator(Access token, MethodHandle rawConstructor) {
171.199 - Access.check(token);
171.200 - MethodType rawConType = rawConstructor.type();
171.201 - // Wrap the raw (unsafe) constructor with the allocation of a suitable object.
171.202 - MethodHandle allocator
171.203 - = AllocateObject.make(token, rawConType.parameterType(0), rawConstructor);
171.204 - assert(allocator.type()
171.205 - .equals(rawConType.dropParameterTypes(0, 1).changeReturnType(rawConType.parameterType(0))));
171.206 - return allocator;
171.207 - }
171.208 -
171.209 - static final class AllocateObject<C> extends BoundMethodHandle {
171.210 - private static final Unsafe unsafe = Unsafe.getUnsafe();
171.211 -
171.212 - private final Class<C> allocateClass;
171.213 - private final MethodHandle rawConstructor;
171.214 -
171.215 - private AllocateObject(MethodHandle invoker,
171.216 - Class<C> allocateClass, MethodHandle rawConstructor) {
171.217 - super(Access.TOKEN, invoker);
171.218 - this.allocateClass = allocateClass;
171.219 - this.rawConstructor = rawConstructor;
171.220 - }
171.221 - static MethodHandle make(Access token,
171.222 - Class<?> allocateClass, MethodHandle rawConstructor) {
171.223 - Access.check(token);
171.224 - MethodType rawConType = rawConstructor.type();
171.225 - assert(rawConType.parameterType(0) == allocateClass);
171.226 - MethodType newType = rawConType.dropParameterTypes(0, 1).changeReturnType(allocateClass);
171.227 - int nargs = rawConType.parameterCount() - 1;
171.228 - if (nargs < INVOKES.length) {
171.229 - MethodHandle invoke = INVOKES[nargs];
171.230 - MethodType conType = CON_TYPES[nargs];
171.231 - MethodHandle gcon = convertArguments(token, rawConstructor, conType, rawConType, null);
171.232 - if (gcon == null) return null;
171.233 - MethodHandle galloc = new AllocateObject(invoke, allocateClass, gcon);
171.234 - assert(galloc.type() == newType.generic());
171.235 - return convertArguments(token, galloc, newType, galloc.type(), null);
171.236 - } else {
171.237 - MethodHandle invoke = VARARGS_INVOKE;
171.238 - MethodType conType = CON_TYPES[nargs];
171.239 - MethodHandle gcon = spreadArguments(token, rawConstructor, conType, 1);
171.240 - if (gcon == null) return null;
171.241 - MethodHandle galloc = new AllocateObject(invoke, allocateClass, gcon);
171.242 - return collectArguments(token, galloc, newType, 1, null);
171.243 - }
171.244 - }
171.245 - @Override
171.246 - public String toString() {
171.247 - return addTypeString(allocateClass.getSimpleName(), this);
171.248 - }
171.249 - @SuppressWarnings("unchecked")
171.250 - private C allocate() throws InstantiationException {
171.251 - return (C) unsafe.allocateInstance(allocateClass);
171.252 - }
171.253 - private C invoke_V(Object... av) throws Throwable {
171.254 - C obj = allocate();
171.255 - rawConstructor.invokeExact((Object)obj, av);
171.256 - return obj;
171.257 - }
171.258 - private C invoke_L0() throws Throwable {
171.259 - C obj = allocate();
171.260 - rawConstructor.invokeExact((Object)obj);
171.261 - return obj;
171.262 - }
171.263 - private C invoke_L1(Object a0) throws Throwable {
171.264 - C obj = allocate();
171.265 - rawConstructor.invokeExact((Object)obj, a0);
171.266 - return obj;
171.267 - }
171.268 - private C invoke_L2(Object a0, Object a1) throws Throwable {
171.269 - C obj = allocate();
171.270 - rawConstructor.invokeExact((Object)obj, a0, a1);
171.271 - return obj;
171.272 - }
171.273 - private C invoke_L3(Object a0, Object a1, Object a2) throws Throwable {
171.274 - C obj = allocate();
171.275 - rawConstructor.invokeExact((Object)obj, a0, a1, a2);
171.276 - return obj;
171.277 - }
171.278 - private C invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable {
171.279 - C obj = allocate();
171.280 - rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3);
171.281 - return obj;
171.282 - }
171.283 - private C invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable {
171.284 - C obj = allocate();
171.285 - rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3, a4);
171.286 - return obj;
171.287 - }
171.288 - private C invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable {
171.289 - C obj = allocate();
171.290 - rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3, a4, a5);
171.291 - return obj;
171.292 - }
171.293 - private C invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable {
171.294 - C obj = allocate();
171.295 - rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3, a4, a5, a6);
171.296 - return obj;
171.297 - }
171.298 - private C invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable {
171.299 - C obj = allocate();
171.300 - rawConstructor.invokeExact((Object)obj, a0, a1, a2, a3, a4, a5, a6, a7);
171.301 - return obj;
171.302 - }
171.303 - static MethodHandle[] makeInvokes() {
171.304 - ArrayList<MethodHandle> invokes = new ArrayList<MethodHandle>();
171.305 - MethodHandles.Lookup lookup = IMPL_LOOKUP;
171.306 - for (;;) {
171.307 - int nargs = invokes.size();
171.308 - String name = "invoke_L"+nargs;
171.309 - MethodHandle invoke = null;
171.310 - try {
171.311 - invoke = lookup.findVirtual(AllocateObject.class, name, MethodType.genericMethodType(nargs));
171.312 - } catch (ReflectiveOperationException ex) {
171.313 - }
171.314 - if (invoke == null) break;
171.315 - invokes.add(invoke);
171.316 - }
171.317 - assert(invokes.size() == 9); // current number of methods
171.318 - return invokes.toArray(new MethodHandle[0]);
171.319 - };
171.320 - static final MethodHandle[] INVOKES = makeInvokes();
171.321 - // For testing use this:
171.322 - //static final MethodHandle[] INVOKES = Arrays.copyOf(makeInvokes(), 2);
171.323 - static final MethodHandle VARARGS_INVOKE;
171.324 - static {
171.325 - try {
171.326 - VARARGS_INVOKE = IMPL_LOOKUP.findVirtual(AllocateObject.class, "invoke_V", MethodType.genericMethodType(0, true));
171.327 - } catch (ReflectiveOperationException ex) {
171.328 - throw uncaughtException(ex);
171.329 - }
171.330 - }
171.331 - // Corresponding generic constructor types:
171.332 - static final MethodType[] CON_TYPES = new MethodType[INVOKES.length];
171.333 - static {
171.334 - for (int i = 0; i < INVOKES.length; i++)
171.335 - CON_TYPES[i] = makeConType(INVOKES[i]);
171.336 - }
171.337 - static final MethodType VARARGS_CON_TYPE = makeConType(VARARGS_INVOKE);
171.338 - static MethodType makeConType(MethodHandle invoke) {
171.339 - MethodType invType = invoke.type();
171.340 - return invType.changeParameterType(0, Object.class).changeReturnType(void.class);
171.341 - }
171.342 - }
171.343 -
171.344 - public static
171.345 - MethodHandle accessField(Access token,
171.346 - MemberName member, boolean isSetter,
171.347 - Class<?> lookupClass) {
171.348 - Access.check(token);
171.349 - // Use sun. misc.Unsafe to dig up the dirt on the field.
171.350 - MethodHandle mh = new FieldAccessor(token, member, isSetter);
171.351 - return mh;
171.352 - }
171.353 -
171.354 - public static
171.355 - MethodHandle accessArrayElement(Access token,
171.356 - Class<?> arrayClass, boolean isSetter) {
171.357 - Access.check(token);
171.358 - if (!arrayClass.isArray())
171.359 - throw newIllegalArgumentException("not an array: "+arrayClass);
171.360 - Class<?> elemClass = arrayClass.getComponentType();
171.361 - MethodHandle[] mhs = FieldAccessor.ARRAY_CACHE.get(elemClass);
171.362 - if (mhs == null) {
171.363 - if (!FieldAccessor.doCache(elemClass))
171.364 - return FieldAccessor.ahandle(arrayClass, isSetter);
171.365 - mhs = new MethodHandle[] {
171.366 - FieldAccessor.ahandle(arrayClass, false),
171.367 - FieldAccessor.ahandle(arrayClass, true)
171.368 - };
171.369 - if (mhs[0].type().parameterType(0) == Class.class) {
171.370 - mhs[0] = MethodHandles.insertArguments(mhs[0], 0, elemClass);
171.371 - mhs[1] = MethodHandles.insertArguments(mhs[1], 0, elemClass);
171.372 - }
171.373 - synchronized (FieldAccessor.ARRAY_CACHE) {} // memory barrier
171.374 - FieldAccessor.ARRAY_CACHE.put(elemClass, mhs);
171.375 - }
171.376 - return mhs[isSetter ? 1 : 0];
171.377 - }
171.378 -
171.379 - static final class FieldAccessor<C,V> extends BoundMethodHandle {
171.380 - private static final Unsafe unsafe = Unsafe.getUnsafe();
171.381 - final Object base; // for static refs only
171.382 - final long offset;
171.383 - final String name;
171.384 -
171.385 - public FieldAccessor(Access token, MemberName field, boolean isSetter) {
171.386 - super(Access.TOKEN, fhandle(field.getDeclaringClass(), field.getFieldType(), isSetter, field.isStatic()));
171.387 - this.offset = (long) field.getVMIndex(token);
171.388 - this.name = field.getName();
171.389 - this.base = staticBase(field);
171.390 - }
171.391 - public String toString() { return addTypeString(name, this); }
171.392 -
171.393 - int getFieldI(C obj) { return unsafe.getInt(obj, offset); }
171.394 - void setFieldI(C obj, int x) { unsafe.putInt(obj, offset, x); }
171.395 - long getFieldJ(C obj) { return unsafe.getLong(obj, offset); }
171.396 - void setFieldJ(C obj, long x) { unsafe.putLong(obj, offset, x); }
171.397 - float getFieldF(C obj) { return unsafe.getFloat(obj, offset); }
171.398 - void setFieldF(C obj, float x) { unsafe.putFloat(obj, offset, x); }
171.399 - double getFieldD(C obj) { return unsafe.getDouble(obj, offset); }
171.400 - void setFieldD(C obj, double x) { unsafe.putDouble(obj, offset, x); }
171.401 - boolean getFieldZ(C obj) { return unsafe.getBoolean(obj, offset); }
171.402 - void setFieldZ(C obj, boolean x) { unsafe.putBoolean(obj, offset, x); }
171.403 - byte getFieldB(C obj) { return unsafe.getByte(obj, offset); }
171.404 - void setFieldB(C obj, byte x) { unsafe.putByte(obj, offset, x); }
171.405 - short getFieldS(C obj) { return unsafe.getShort(obj, offset); }
171.406 - void setFieldS(C obj, short x) { unsafe.putShort(obj, offset, x); }
171.407 - char getFieldC(C obj) { return unsafe.getChar(obj, offset); }
171.408 - void setFieldC(C obj, char x) { unsafe.putChar(obj, offset, x); }
171.409 - @SuppressWarnings("unchecked")
171.410 - V getFieldL(C obj) { return (V) unsafe.getObject(obj, offset); }
171.411 - @SuppressWarnings("unchecked")
171.412 - void setFieldL(C obj, V x) { unsafe.putObject(obj, offset, x); }
171.413 - // cast (V) is OK here, since we wrap convertArguments around the MH.
171.414 -
171.415 - static Object staticBase(MemberName field) {
171.416 - if (!field.isStatic()) return null;
171.417 - Class c = field.getDeclaringClass();
171.418 - java.lang.reflect.Field f;
171.419 - try {
171.420 - // FIXME: Should not have to create 'f' to get this value.
171.421 - f = c.getDeclaredField(field.getName());
171.422 - return unsafe.staticFieldBase(f);
171.423 - } catch (Exception ee) {
171.424 - throw uncaughtException(ee);
171.425 - }
171.426 - }
171.427 -
171.428 - int getStaticI() { return unsafe.getInt(base, offset); }
171.429 - void setStaticI(int x) { unsafe.putInt(base, offset, x); }
171.430 - long getStaticJ() { return unsafe.getLong(base, offset); }
171.431 - void setStaticJ(long x) { unsafe.putLong(base, offset, x); }
171.432 - float getStaticF() { return unsafe.getFloat(base, offset); }
171.433 - void setStaticF(float x) { unsafe.putFloat(base, offset, x); }
171.434 - double getStaticD() { return unsafe.getDouble(base, offset); }
171.435 - void setStaticD(double x) { unsafe.putDouble(base, offset, x); }
171.436 - boolean getStaticZ() { return unsafe.getBoolean(base, offset); }
171.437 - void setStaticZ(boolean x) { unsafe.putBoolean(base, offset, x); }
171.438 - byte getStaticB() { return unsafe.getByte(base, offset); }
171.439 - void setStaticB(byte x) { unsafe.putByte(base, offset, x); }
171.440 - short getStaticS() { return unsafe.getShort(base, offset); }
171.441 - void setStaticS(short x) { unsafe.putShort(base, offset, x); }
171.442 - char getStaticC() { return unsafe.getChar(base, offset); }
171.443 - void setStaticC(char x) { unsafe.putChar(base, offset, x); }
171.444 - V getStaticL() { return (V) unsafe.getObject(base, offset); }
171.445 - void setStaticL(V x) { unsafe.putObject(base, offset, x); }
171.446 -
171.447 - static String fname(Class<?> vclass, boolean isSetter, boolean isStatic) {
171.448 - String stem;
171.449 - if (!isStatic)
171.450 - stem = (!isSetter ? "getField" : "setField");
171.451 - else
171.452 - stem = (!isSetter ? "getStatic" : "setStatic");
171.453 - return stem + Wrapper.basicTypeChar(vclass);
171.454 - }
171.455 - static MethodType ftype(Class<?> cclass, Class<?> vclass, boolean isSetter, boolean isStatic) {
171.456 - MethodType type;
171.457 - if (!isStatic) {
171.458 - if (!isSetter)
171.459 - return MethodType.methodType(vclass, cclass);
171.460 - else
171.461 - return MethodType.methodType(void.class, cclass, vclass);
171.462 - } else {
171.463 - if (!isSetter)
171.464 - return MethodType.methodType(vclass);
171.465 - else
171.466 - return MethodType.methodType(void.class, vclass);
171.467 - }
171.468 - }
171.469 - static MethodHandle fhandle(Class<?> cclass, Class<?> vclass, boolean isSetter, boolean isStatic) {
171.470 - String name = FieldAccessor.fname(vclass, isSetter, isStatic);
171.471 - if (cclass.isPrimitive()) throw newIllegalArgumentException("primitive "+cclass);
171.472 - Class<?> ecclass = Object.class; //erase this type
171.473 - Class<?> evclass = vclass;
171.474 - if (!evclass.isPrimitive()) evclass = Object.class;
171.475 - MethodType type = FieldAccessor.ftype(ecclass, evclass, isSetter, isStatic);
171.476 - MethodHandle mh;
171.477 - try {
171.478 - mh = IMPL_LOOKUP.findVirtual(FieldAccessor.class, name, type);
171.479 - } catch (ReflectiveOperationException ex) {
171.480 - throw uncaughtException(ex);
171.481 - }
171.482 - if (evclass != vclass || (!isStatic && ecclass != cclass)) {
171.483 - MethodType strongType = FieldAccessor.ftype(cclass, vclass, isSetter, isStatic);
171.484 - strongType = strongType.insertParameterTypes(0, FieldAccessor.class);
171.485 - mh = MethodHandles.convertArguments(mh, strongType);
171.486 - }
171.487 - return mh;
171.488 - }
171.489 -
171.490 - /// Support for array element access
171.491 - static final HashMap<Class<?>, MethodHandle[]> ARRAY_CACHE =
171.492 - new HashMap<Class<?>, MethodHandle[]>();
171.493 - // FIXME: Cache on the classes themselves, not here.
171.494 - static boolean doCache(Class<?> elemClass) {
171.495 - if (elemClass.isPrimitive()) return true;
171.496 - ClassLoader cl = elemClass.getClassLoader();
171.497 - return cl == null || cl == ClassLoader.getSystemClassLoader();
171.498 - }
171.499 - static int getElementI(int[] a, int i) { return a[i]; }
171.500 - static void setElementI(int[] a, int i, int x) { a[i] = x; }
171.501 - static long getElementJ(long[] a, int i) { return a[i]; }
171.502 - static void setElementJ(long[] a, int i, long x) { a[i] = x; }
171.503 - static float getElementF(float[] a, int i) { return a[i]; }
171.504 - static void setElementF(float[] a, int i, float x) { a[i] = x; }
171.505 - static double getElementD(double[] a, int i) { return a[i]; }
171.506 - static void setElementD(double[] a, int i, double x) { a[i] = x; }
171.507 - static boolean getElementZ(boolean[] a, int i) { return a[i]; }
171.508 - static void setElementZ(boolean[] a, int i, boolean x) { a[i] = x; }
171.509 - static byte getElementB(byte[] a, int i) { return a[i]; }
171.510 - static void setElementB(byte[] a, int i, byte x) { a[i] = x; }
171.511 - static short getElementS(short[] a, int i) { return a[i]; }
171.512 - static void setElementS(short[] a, int i, short x) { a[i] = x; }
171.513 - static char getElementC(char[] a, int i) { return a[i]; }
171.514 - static void setElementC(char[] a, int i, char x) { a[i] = x; }
171.515 - static Object getElementL(Object[] a, int i) { return a[i]; }
171.516 - static void setElementL(Object[] a, int i, Object x) { a[i] = x; }
171.517 - static <V> V getElementL(Class<V[]> aclass, V[] a, int i) { return aclass.cast(a)[i]; }
171.518 - static <V> void setElementL(Class<V[]> aclass, V[] a, int i, V x) { aclass.cast(a)[i] = x; }
171.519 -
171.520 - static String aname(Class<?> aclass, boolean isSetter) {
171.521 - Class<?> vclass = aclass.getComponentType();
171.522 - if (vclass == null) throw new IllegalArgumentException();
171.523 - return (!isSetter ? "getElement" : "setElement") + Wrapper.basicTypeChar(vclass);
171.524 - }
171.525 - static MethodType atype(Class<?> aclass, boolean isSetter) {
171.526 - Class<?> vclass = aclass.getComponentType();
171.527 - if (!isSetter)
171.528 - return MethodType.methodType(vclass, aclass, int.class);
171.529 - else
171.530 - return MethodType.methodType(void.class, aclass, int.class, vclass);
171.531 - }
171.532 - static MethodHandle ahandle(Class<?> aclass, boolean isSetter) {
171.533 - Class<?> vclass = aclass.getComponentType();
171.534 - String name = FieldAccessor.aname(aclass, isSetter);
171.535 - Class<?> caclass = null;
171.536 - if (!vclass.isPrimitive() && vclass != Object.class) {
171.537 - caclass = aclass;
171.538 - aclass = Object[].class;
171.539 - vclass = Object.class;
171.540 - }
171.541 - MethodType type = FieldAccessor.atype(aclass, isSetter);
171.542 - if (caclass != null)
171.543 - type = type.insertParameterTypes(0, Class.class);
171.544 - MethodHandle mh;
171.545 - try {
171.546 - mh = IMPL_LOOKUP.findStatic(FieldAccessor.class, name, type);
171.547 - } catch (ReflectiveOperationException ex) {
171.548 - throw uncaughtException(ex);
171.549 - }
171.550 - if (caclass != null) {
171.551 - MethodType strongType = FieldAccessor.atype(caclass, isSetter);
171.552 - mh = MethodHandles.insertArguments(mh, 0, caclass);
171.553 - mh = MethodHandles.convertArguments(mh, strongType);
171.554 - }
171.555 - return mh;
171.556 - }
171.557 - }
171.558 -
171.559 - /** Bind a predetermined first argument to the given direct method handle.
171.560 - * Callable only from MethodHandles.
171.561 - * @param token Proof that the caller has access to this package.
171.562 - * @param target Any direct method handle.
171.563 - * @param receiver Receiver (or first static method argument) to pre-bind.
171.564 - * @return a BoundMethodHandle for the given DirectMethodHandle, or null if it does not exist
171.565 - */
171.566 - public static
171.567 - MethodHandle bindReceiver(Access token,
171.568 - MethodHandle target, Object receiver) {
171.569 - Access.check(token);
171.570 - if (target instanceof AdapterMethodHandle &&
171.571 - ((AdapterMethodHandle)target).conversionOp() == MethodHandleNatives.Constants.OP_RETYPE_ONLY
171.572 - ) {
171.573 - Object info = MethodHandleNatives.getTargetInfo(target);
171.574 - if (info instanceof DirectMethodHandle) {
171.575 - DirectMethodHandle dmh = (DirectMethodHandle) info;
171.576 - if (receiver == null ||
171.577 - dmh.type().parameterType(0).isAssignableFrom(receiver.getClass())) {
171.578 - MethodHandle bmh = new BoundMethodHandle(dmh, receiver, 0);
171.579 - MethodType newType = target.type().dropParameterTypes(0, 1);
171.580 - return convertArguments(token, bmh, newType, bmh.type(), null);
171.581 - }
171.582 - }
171.583 - }
171.584 - if (target instanceof DirectMethodHandle)
171.585 - return new BoundMethodHandle((DirectMethodHandle)target, receiver, 0);
171.586 - return null; // let caller try something else
171.587 - }
171.588 -
171.589 - /** Bind a predetermined argument to the given arbitrary method handle.
171.590 - * Callable only from MethodHandles.
171.591 - * @param token Proof that the caller has access to this package.
171.592 - * @param target Any method handle.
171.593 - * @param receiver Argument (which can be a boxed primitive) to pre-bind.
171.594 - * @return a suitable BoundMethodHandle
171.595 - */
171.596 - public static
171.597 - MethodHandle bindArgument(Access token,
171.598 - MethodHandle target, int argnum, Object receiver) {
171.599 - Access.check(token);
171.600 - return new BoundMethodHandle(target, receiver, argnum);
171.601 - }
171.602 -
171.603 - public static MethodHandle convertArguments(Access token,
171.604 - MethodHandle target,
171.605 - MethodType newType,
171.606 - MethodType oldType,
171.607 - int[] permutationOrNull) {
171.608 - Access.check(token);
171.609 - assert(oldType.parameterCount() == target.type().parameterCount());
171.610 - if (permutationOrNull != null) {
171.611 - int outargs = oldType.parameterCount(), inargs = newType.parameterCount();
171.612 - if (permutationOrNull.length != outargs)
171.613 - throw newIllegalArgumentException("wrong number of arguments in permutation");
171.614 - // Make the individual outgoing argument types match up first.
171.615 - Class<?>[] callTypeArgs = new Class<?>[outargs];
171.616 - for (int i = 0; i < outargs; i++)
171.617 - callTypeArgs[i] = newType.parameterType(permutationOrNull[i]);
171.618 - MethodType callType = MethodType.methodType(oldType.returnType(), callTypeArgs);
171.619 - target = convertArguments(token, target, callType, oldType, null);
171.620 - assert(target != null);
171.621 - oldType = target.type();
171.622 - List<Integer> goal = new ArrayList<Integer>(); // i*TOKEN
171.623 - List<Integer> state = new ArrayList<Integer>(); // i*TOKEN
171.624 - List<Integer> drops = new ArrayList<Integer>(); // not tokens
171.625 - List<Integer> dups = new ArrayList<Integer>(); // not tokens
171.626 - final int TOKEN = 10; // to mark items which are symbolic only
171.627 - // state represents the argument values coming into target
171.628 - for (int i = 0; i < outargs; i++) {
171.629 - state.add(permutationOrNull[i] * TOKEN);
171.630 - }
171.631 - // goal represents the desired state
171.632 - for (int i = 0; i < inargs; i++) {
171.633 - if (state.contains(i * TOKEN)) {
171.634 - goal.add(i * TOKEN);
171.635 - } else {
171.636 - // adapter must initially drop all unused arguments
171.637 - drops.add(i);
171.638 - }
171.639 - }
171.640 - // detect duplications
171.641 - while (state.size() > goal.size()) {
171.642 - for (int i2 = 0; i2 < state.size(); i2++) {
171.643 - int arg1 = state.get(i2);
171.644 - int i1 = state.indexOf(arg1);
171.645 - if (i1 != i2) {
171.646 - // found duplicate occurrence at i2
171.647 - int arg2 = (inargs++) * TOKEN;
171.648 - state.set(i2, arg2);
171.649 - dups.add(goal.indexOf(arg1));
171.650 - goal.add(arg2);
171.651 - }
171.652 - }
171.653 - }
171.654 - assert(state.size() == goal.size());
171.655 - int size = goal.size();
171.656 - while (!state.equals(goal)) {
171.657 - // Look for a maximal sequence of adjacent misplaced arguments,
171.658 - // and try to rotate them into place.
171.659 - int bestRotArg = -10 * TOKEN, bestRotLen = 0;
171.660 - int thisRotArg = -10 * TOKEN, thisRotLen = 0;
171.661 - for (int i = 0; i < size; i++) {
171.662 - int arg = state.get(i);
171.663 - // Does this argument match the current run?
171.664 - if (arg == thisRotArg + TOKEN) {
171.665 - thisRotArg = arg;
171.666 - thisRotLen += 1;
171.667 - if (bestRotLen < thisRotLen) {
171.668 - bestRotLen = thisRotLen;
171.669 - bestRotArg = thisRotArg;
171.670 - }
171.671 - } else {
171.672 - // The old sequence (if any) stops here.
171.673 - thisRotLen = 0;
171.674 - thisRotArg = -10 * TOKEN;
171.675 - // But maybe a new one starts here also.
171.676 - int wantArg = goal.get(i);
171.677 - final int MAX_ARG_ROTATION = AdapterMethodHandle.MAX_ARG_ROTATION;
171.678 - if (arg != wantArg &&
171.679 - arg >= wantArg - TOKEN * MAX_ARG_ROTATION &&
171.680 - arg <= wantArg + TOKEN * MAX_ARG_ROTATION) {
171.681 - thisRotArg = arg;
171.682 - thisRotLen = 1;
171.683 - }
171.684 - }
171.685 - }
171.686 - if (bestRotLen >= 2) {
171.687 - // Do a rotation if it can improve argument positioning
171.688 - // by at least 2 arguments. This is not always optimal,
171.689 - // but it seems to catch common cases.
171.690 - int dstEnd = state.indexOf(bestRotArg);
171.691 - int srcEnd = goal.indexOf(bestRotArg);
171.692 - int rotBy = dstEnd - srcEnd;
171.693 - int dstBeg = dstEnd - (bestRotLen - 1);
171.694 - int srcBeg = srcEnd - (bestRotLen - 1);
171.695 - assert((dstEnd | dstBeg | srcEnd | srcBeg) >= 0); // no negs
171.696 - // Make a span which covers both source and destination.
171.697 - int rotBeg = Math.min(dstBeg, srcBeg);
171.698 - int rotEnd = Math.max(dstEnd, srcEnd);
171.699 - int score = 0;
171.700 - for (int i = rotBeg; i <= rotEnd; i++) {
171.701 - if ((int)state.get(i) != (int)goal.get(i))
171.702 - score += 1;
171.703 - }
171.704 - List<Integer> rotSpan = state.subList(rotBeg, rotEnd+1);
171.705 - Collections.rotate(rotSpan, -rotBy); // reverse direction
171.706 - for (int i = rotBeg; i <= rotEnd; i++) {
171.707 - if ((int)state.get(i) != (int)goal.get(i))
171.708 - score -= 1;
171.709 - }
171.710 - if (score >= 2) {
171.711 - // Improved at least two argument positions. Do it.
171.712 - List<Class<?>> ptypes = Arrays.asList(oldType.parameterArray());
171.713 - Collections.rotate(ptypes.subList(rotBeg, rotEnd+1), -rotBy);
171.714 - MethodType rotType = MethodType.methodType(oldType.returnType(), ptypes);
171.715 - MethodHandle nextTarget
171.716 - = AdapterMethodHandle.makeRotateArguments(token, rotType, target,
171.717 - rotBeg, rotSpan.size(), rotBy);
171.718 - if (nextTarget != null) {
171.719 - //System.out.println("Rot: "+rotSpan+" by "+rotBy);
171.720 - target = nextTarget;
171.721 - oldType = rotType;
171.722 - continue;
171.723 - }
171.724 - }
171.725 - // Else de-rotate, and drop through to the swap-fest.
171.726 - Collections.rotate(rotSpan, rotBy);
171.727 - }
171.728 -
171.729 - // Now swap like the wind!
171.730 - List<Class<?>> ptypes = Arrays.asList(oldType.parameterArray());
171.731 - for (int i = 0; i < size; i++) {
171.732 - // What argument do I want here?
171.733 - int arg = goal.get(i);
171.734 - if (arg != state.get(i)) {
171.735 - // Where is it now?
171.736 - int j = state.indexOf(arg);
171.737 - Collections.swap(ptypes, i, j);
171.738 - MethodType swapType = MethodType.methodType(oldType.returnType(), ptypes);
171.739 - target = AdapterMethodHandle.makeSwapArguments(token, swapType, target, i, j);
171.740 - if (target == null) throw newIllegalArgumentException("cannot swap");
171.741 - assert(target.type() == swapType);
171.742 - oldType = swapType;
171.743 - Collections.swap(state, i, j);
171.744 - }
171.745 - }
171.746 - // One pass of swapping must finish the job.
171.747 - assert(state.equals(goal));
171.748 - }
171.749 - while (!dups.isEmpty()) {
171.750 - // Grab a contiguous trailing sequence of dups.
171.751 - int grab = dups.size() - 1;
171.752 - int dupArgPos = dups.get(grab), dupArgCount = 1;
171.753 - while (grab - 1 >= 0) {
171.754 - int dup0 = dups.get(grab - 1);
171.755 - if (dup0 != dupArgPos - 1) break;
171.756 - dupArgPos -= 1;
171.757 - dupArgCount += 1;
171.758 - grab -= 1;
171.759 - }
171.760 - //if (dupArgCount > 1) System.out.println("Dup: "+dups.subList(grab, dups.size()));
171.761 - dups.subList(grab, dups.size()).clear();
171.762 - // In the new target type drop that many args from the tail:
171.763 - List<Class<?>> ptypes = oldType.parameterList();
171.764 - ptypes = ptypes.subList(0, ptypes.size() - dupArgCount);
171.765 - MethodType dupType = MethodType.methodType(oldType.returnType(), ptypes);
171.766 - target = AdapterMethodHandle.makeDupArguments(token, dupType, target, dupArgPos, dupArgCount);
171.767 - if (target == null)
171.768 - throw newIllegalArgumentException("cannot dup");
171.769 - oldType = target.type();
171.770 - }
171.771 - while (!drops.isEmpty()) {
171.772 - // Grab a contiguous initial sequence of drops.
171.773 - int dropArgPos = drops.get(0), dropArgCount = 1;
171.774 - while (dropArgCount < drops.size()) {
171.775 - int drop1 = drops.get(dropArgCount);
171.776 - if (drop1 != dropArgPos + dropArgCount) break;
171.777 - dropArgCount += 1;
171.778 - }
171.779 - //if (dropArgCount > 1) System.out.println("Drop: "+drops.subList(0, dropArgCount));
171.780 - drops.subList(0, dropArgCount).clear();
171.781 - List<Class<?>> dropTypes = newType.parameterList()
171.782 - .subList(dropArgPos, dropArgPos + dropArgCount);
171.783 - MethodType dropType = oldType.insertParameterTypes(dropArgPos, dropTypes);
171.784 - target = AdapterMethodHandle.makeDropArguments(token, dropType, target, dropArgPos, dropArgCount);
171.785 - if (target == null) throw newIllegalArgumentException("cannot drop");
171.786 - oldType = target.type();
171.787 - }
171.788 - }
171.789 - if (newType == oldType)
171.790 - return target;
171.791 - if (oldType.parameterCount() != newType.parameterCount())
171.792 - throw newIllegalArgumentException("mismatched parameter count");
171.793 - MethodHandle res = AdapterMethodHandle.makePairwiseConvert(token, newType, target);
171.794 - if (res != null)
171.795 - return res;
171.796 - int argc = oldType.parameterCount();
171.797 - // The JVM can't do it directly, so fill in the gap with a Java adapter.
171.798 - // TO DO: figure out what to put here from case-by-case experience
171.799 - // Use a heavier method: Convert all the arguments to Object,
171.800 - // then back to the desired types. We might have to use Java-based
171.801 - // method handles to do this.
171.802 - MethodType objType = MethodType.genericMethodType(argc);
171.803 - MethodHandle objTarget = AdapterMethodHandle.makePairwiseConvert(token, objType, target);
171.804 - if (objTarget == null)
171.805 - objTarget = FromGeneric.make(target);
171.806 - res = AdapterMethodHandle.makePairwiseConvert(token, newType, objTarget);
171.807 - if (res != null)
171.808 - return res;
171.809 - return ToGeneric.make(newType, objTarget);
171.810 - }
171.811 -
171.812 - public static MethodHandle spreadArguments(Access token,
171.813 - MethodHandle target,
171.814 - MethodType newType,
171.815 - int spreadArg) {
171.816 - Access.check(token);
171.817 - // TO DO: maybe allow the restarg to be Object and implicitly cast to Object[]
171.818 - MethodType oldType = target.type();
171.819 - // spread the last argument of newType to oldType
171.820 - int spreadCount = oldType.parameterCount() - spreadArg;
171.821 - Class<Object[]> spreadArgType = Object[].class;
171.822 - MethodHandle res = AdapterMethodHandle.makeSpreadArguments(token, newType, target, spreadArgType, spreadArg, spreadCount);
171.823 - if (res != null)
171.824 - return res;
171.825 - // try an intermediate adapter
171.826 - Class<?> spreadType = null;
171.827 - if (spreadArg < 0 || spreadArg >= newType.parameterCount()
171.828 - || !VerifyType.isSpreadArgType(spreadType = newType.parameterType(spreadArg)))
171.829 - throw newIllegalArgumentException("no restarg in "+newType);
171.830 - Class<?>[] ptypes = oldType.parameterArray();
171.831 - for (int i = 0; i < spreadCount; i++)
171.832 - ptypes[spreadArg + i] = VerifyType.spreadArgElementType(spreadType, i);
171.833 - MethodType midType = MethodType.methodType(newType.returnType(), ptypes);
171.834 - // after spreading, some arguments may need further conversion
171.835 - MethodHandle target2 = convertArguments(token, target, midType, oldType, null);
171.836 - if (target2 == null)
171.837 - throw new UnsupportedOperationException("NYI: convert "+midType+" =calls=> "+oldType);
171.838 - res = AdapterMethodHandle.makeSpreadArguments(token, newType, target2, spreadArgType, spreadArg, spreadCount);
171.839 - if (res != null)
171.840 - return res;
171.841 - res = SpreadGeneric.make(target2, spreadCount);
171.842 - if (res != null)
171.843 - res = convertArguments(token, res, newType, res.type(), null);
171.844 - return res;
171.845 - }
171.846 -
171.847 - public static MethodHandle collectArguments(Access token,
171.848 - MethodHandle target,
171.849 - MethodType newType,
171.850 - int collectArg,
171.851 - MethodHandle collector) {
171.852 - MethodType oldType = target.type(); // (a...,c)=>r
171.853 - if (collector == null) {
171.854 - int numCollect = newType.parameterCount() - oldType.parameterCount() + 1;
171.855 - collector = ValueConversions.varargsArray(numCollect);
171.856 - }
171.857 - // newType // (a..., b...)=>r
171.858 - MethodType colType = collector.type(); // (b...)=>c
171.859 - // oldType // (a..., b...)=>r
171.860 - assert(newType.parameterCount() == collectArg + colType.parameterCount());
171.861 - assert(oldType.parameterCount() == collectArg + 1);
171.862 - MethodHandle gtarget = convertArguments(token, target, oldType.generic(), oldType, null);
171.863 - MethodHandle gcollector = convertArguments(token, collector, colType.generic(), colType, null);
171.864 - if (gtarget == null || gcollector == null) return null;
171.865 - MethodHandle gresult = FilterGeneric.makeArgumentCollector(gcollector, gtarget);
171.866 - MethodHandle result = convertArguments(token, gresult, newType, gresult.type(), null);
171.867 - return result;
171.868 - }
171.869 -
171.870 - public static MethodHandle filterArgument(Access token,
171.871 - MethodHandle target,
171.872 - int pos,
171.873 - MethodHandle filter) {
171.874 - Access.check(token);
171.875 - MethodType ttype = target.type(), gttype = ttype.generic();
171.876 - if (ttype != gttype) {
171.877 - target = convertArguments(token, target, gttype, ttype, null);
171.878 - ttype = gttype;
171.879 - }
171.880 - MethodType ftype = filter.type(), gftype = ftype.generic();
171.881 - if (ftype.parameterCount() != 1)
171.882 - throw new InternalError();
171.883 - if (ftype != gftype) {
171.884 - filter = convertArguments(token, filter, gftype, ftype, null);
171.885 - ftype = gftype;
171.886 - }
171.887 - if (ftype == ttype) {
171.888 - // simple unary case
171.889 - return FilterOneArgument.make(filter, target);
171.890 - }
171.891 - return FilterGeneric.makeArgumentFilter(pos, filter, target);
171.892 - }
171.893 -
171.894 - public static MethodHandle foldArguments(Access token,
171.895 - MethodHandle target,
171.896 - MethodType newType,
171.897 - MethodHandle combiner) {
171.898 - Access.check(token);
171.899 - MethodType oldType = target.type();
171.900 - MethodType ctype = combiner.type();
171.901 - MethodHandle gtarget = convertArguments(token, target, oldType.generic(), oldType, null);
171.902 - MethodHandle gcombiner = convertArguments(token, combiner, ctype.generic(), ctype, null);
171.903 - if (gtarget == null || gcombiner == null) return null;
171.904 - MethodHandle gresult = FilterGeneric.makeArgumentFolder(gcombiner, gtarget);
171.905 - MethodHandle result = convertArguments(token, gresult, newType, gresult.type(), null);
171.906 - return result;
171.907 - }
171.908 -
171.909 - public static
171.910 - MethodHandle dropArguments(Access token, MethodHandle target,
171.911 - MethodType newType, int argnum) {
171.912 - Access.check(token);
171.913 - int drops = newType.parameterCount() - target.type().parameterCount();
171.914 - MethodHandle res = AdapterMethodHandle.makeDropArguments(token, newType, target, argnum, drops);
171.915 - if (res != null)
171.916 - return res;
171.917 - throw new UnsupportedOperationException("NYI");
171.918 - }
171.919 -
171.920 - private static class GuardWithTest extends BoundMethodHandle {
171.921 - private final MethodHandle test, target, fallback;
171.922 - private GuardWithTest(MethodHandle invoker,
171.923 - MethodHandle test, MethodHandle target, MethodHandle fallback) {
171.924 - super(Access.TOKEN, invoker);
171.925 - this.test = test;
171.926 - this.target = target;
171.927 - this.fallback = fallback;
171.928 - }
171.929 - static MethodHandle make(Access token,
171.930 - MethodHandle test, MethodHandle target, MethodHandle fallback) {
171.931 - Access.check(token);
171.932 - MethodType type = target.type();
171.933 - int nargs = type.parameterCount();
171.934 - if (nargs < INVOKES.length) {
171.935 - MethodHandle invoke = INVOKES[nargs];
171.936 - MethodType gtype = type.generic();
171.937 - assert(invoke.type().dropParameterTypes(0,1) == gtype);
171.938 - MethodHandle gtest = convertArguments(token, test, gtype.changeReturnType(boolean.class), test.type(), null);
171.939 - MethodHandle gtarget = convertArguments(token, target, gtype, type, null);
171.940 - MethodHandle gfallback = convertArguments(token, fallback, gtype, type, null);
171.941 - if (gtest == null || gtarget == null || gfallback == null) return null;
171.942 - MethodHandle gguard = new GuardWithTest(invoke, gtest, gtarget, gfallback);
171.943 - return convertArguments(token, gguard, type, gtype, null);
171.944 - } else {
171.945 - MethodHandle invoke = VARARGS_INVOKE;
171.946 - MethodType gtype = MethodType.genericMethodType(1);
171.947 - assert(invoke.type().dropParameterTypes(0,1) == gtype);
171.948 - MethodHandle gtest = spreadArguments(token, test, gtype.changeReturnType(boolean.class), 0);
171.949 - MethodHandle gtarget = spreadArguments(token, target, gtype, 0);
171.950 - MethodHandle gfallback = spreadArguments(token, fallback, gtype, 0);
171.951 - MethodHandle gguard = new GuardWithTest(invoke, gtest, gtarget, gfallback);
171.952 - if (gtest == null || gtarget == null || gfallback == null) return null;
171.953 - return collectArguments(token, gguard, type, 0, null);
171.954 - }
171.955 - }
171.956 - @Override
171.957 - public String toString() {
171.958 - return addTypeString(target, this);
171.959 - }
171.960 - private Object invoke_V(Object... av) throws Throwable {
171.961 - if ((boolean) test.invokeExact(av))
171.962 - return target.invokeExact(av);
171.963 - return fallback.invokeExact(av);
171.964 - }
171.965 - private Object invoke_L0() throws Throwable {
171.966 - if ((boolean) test.invokeExact())
171.967 - return target.invokeExact();
171.968 - return fallback.invokeExact();
171.969 - }
171.970 - private Object invoke_L1(Object a0) throws Throwable {
171.971 - if ((boolean) test.invokeExact(a0))
171.972 - return target.invokeExact(a0);
171.973 - return fallback.invokeExact(a0);
171.974 - }
171.975 - private Object invoke_L2(Object a0, Object a1) throws Throwable {
171.976 - if ((boolean) test.invokeExact(a0, a1))
171.977 - return target.invokeExact(a0, a1);
171.978 - return fallback.invokeExact(a0, a1);
171.979 - }
171.980 - private Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable {
171.981 - if ((boolean) test.invokeExact(a0, a1, a2))
171.982 - return target.invokeExact(a0, a1, a2);
171.983 - return fallback.invokeExact(a0, a1, a2);
171.984 - }
171.985 - private Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable {
171.986 - if ((boolean) test.invokeExact(a0, a1, a2, a3))
171.987 - return target.invokeExact(a0, a1, a2, a3);
171.988 - return fallback.invokeExact(a0, a1, a2, a3);
171.989 - }
171.990 - private Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable {
171.991 - if ((boolean) test.invokeExact(a0, a1, a2, a3, a4))
171.992 - return target.invokeExact(a0, a1, a2, a3, a4);
171.993 - return fallback.invokeExact(a0, a1, a2, a3, a4);
171.994 - }
171.995 - private Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable {
171.996 - if ((boolean) test.invokeExact(a0, a1, a2, a3, a4, a5))
171.997 - return target.invokeExact(a0, a1, a2, a3, a4, a5);
171.998 - return fallback.invokeExact(a0, a1, a2, a3, a4, a5);
171.999 - }
171.1000 - private Object invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable {
171.1001 - if ((boolean) test.invokeExact(a0, a1, a2, a3, a4, a5, a6))
171.1002 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6);
171.1003 - return fallback.invokeExact(a0, a1, a2, a3, a4, a5, a6);
171.1004 - }
171.1005 - private Object invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable {
171.1006 - if ((boolean) test.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7))
171.1007 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7);
171.1008 - return fallback.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7);
171.1009 - }
171.1010 - static MethodHandle[] makeInvokes() {
171.1011 - ArrayList<MethodHandle> invokes = new ArrayList<MethodHandle>();
171.1012 - MethodHandles.Lookup lookup = IMPL_LOOKUP;
171.1013 - for (;;) {
171.1014 - int nargs = invokes.size();
171.1015 - String name = "invoke_L"+nargs;
171.1016 - MethodHandle invoke = null;
171.1017 - try {
171.1018 - invoke = lookup.findVirtual(GuardWithTest.class, name, MethodType.genericMethodType(nargs));
171.1019 - } catch (ReflectiveOperationException ex) {
171.1020 - }
171.1021 - if (invoke == null) break;
171.1022 - invokes.add(invoke);
171.1023 - }
171.1024 - assert(invokes.size() == 9); // current number of methods
171.1025 - return invokes.toArray(new MethodHandle[0]);
171.1026 - };
171.1027 - static final MethodHandle[] INVOKES = makeInvokes();
171.1028 - // For testing use this:
171.1029 - //static final MethodHandle[] INVOKES = Arrays.copyOf(makeInvokes(), 2);
171.1030 - static final MethodHandle VARARGS_INVOKE;
171.1031 - static {
171.1032 - try {
171.1033 - VARARGS_INVOKE = IMPL_LOOKUP.findVirtual(GuardWithTest.class, "invoke_V", MethodType.genericMethodType(0, true));
171.1034 - } catch (ReflectiveOperationException ex) {
171.1035 - throw uncaughtException(ex);
171.1036 - }
171.1037 - }
171.1038 - }
171.1039 -
171.1040 - public static
171.1041 - MethodHandle makeGuardWithTest(Access token,
171.1042 - MethodHandle test,
171.1043 - MethodHandle target,
171.1044 - MethodHandle fallback) {
171.1045 - return GuardWithTest.make(token, test, target, fallback);
171.1046 - }
171.1047 -
171.1048 - private static class GuardWithCatch extends BoundMethodHandle {
171.1049 - private final MethodHandle target;
171.1050 - private final Class<? extends Throwable> exType;
171.1051 - private final MethodHandle catcher;
171.1052 - public GuardWithCatch(MethodHandle target, Class<? extends Throwable> exType, MethodHandle catcher) {
171.1053 - this(INVOKES[target.type().parameterCount()], target, exType, catcher);
171.1054 - }
171.1055 - public GuardWithCatch(MethodHandle invoker,
171.1056 - MethodHandle target, Class<? extends Throwable> exType, MethodHandle catcher) {
171.1057 - super(Access.TOKEN, invoker);
171.1058 - this.target = target;
171.1059 - this.exType = exType;
171.1060 - this.catcher = catcher;
171.1061 - }
171.1062 - @Override
171.1063 - public String toString() {
171.1064 - return addTypeString(target, this);
171.1065 - }
171.1066 - private Object invoke_V(Object... av) throws Throwable {
171.1067 - try {
171.1068 - return target.invokeExact(av);
171.1069 - } catch (Throwable t) {
171.1070 - if (!exType.isInstance(t)) throw t;
171.1071 - return catcher.invokeExact(t, av);
171.1072 - }
171.1073 - }
171.1074 - private Object invoke_L0() throws Throwable {
171.1075 - try {
171.1076 - return target.invokeExact();
171.1077 - } catch (Throwable t) {
171.1078 - if (!exType.isInstance(t)) throw t;
171.1079 - return catcher.invokeExact(t);
171.1080 - }
171.1081 - }
171.1082 - private Object invoke_L1(Object a0) throws Throwable {
171.1083 - try {
171.1084 - return target.invokeExact(a0);
171.1085 - } catch (Throwable t) {
171.1086 - if (!exType.isInstance(t)) throw t;
171.1087 - return catcher.invokeExact(t, a0);
171.1088 - }
171.1089 - }
171.1090 - private Object invoke_L2(Object a0, Object a1) throws Throwable {
171.1091 - try {
171.1092 - return target.invokeExact(a0, a1);
171.1093 - } catch (Throwable t) {
171.1094 - if (!exType.isInstance(t)) throw t;
171.1095 - return catcher.invokeExact(t, a0, a1);
171.1096 - }
171.1097 - }
171.1098 - private Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable {
171.1099 - try {
171.1100 - return target.invokeExact(a0, a1, a2);
171.1101 - } catch (Throwable t) {
171.1102 - if (!exType.isInstance(t)) throw t;
171.1103 - return catcher.invokeExact(t, a0, a1, a2);
171.1104 - }
171.1105 - }
171.1106 - private Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable {
171.1107 - try {
171.1108 - return target.invokeExact(a0, a1, a2, a3);
171.1109 - } catch (Throwable t) {
171.1110 - if (!exType.isInstance(t)) throw t;
171.1111 - return catcher.invokeExact(t, a0, a1, a2, a3);
171.1112 - }
171.1113 - }
171.1114 - private Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable {
171.1115 - try {
171.1116 - return target.invokeExact(a0, a1, a2, a3, a4);
171.1117 - } catch (Throwable t) {
171.1118 - if (!exType.isInstance(t)) throw t;
171.1119 - return catcher.invokeExact(t, a0, a1, a2, a3, a4);
171.1120 - }
171.1121 - }
171.1122 - private Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable {
171.1123 - try {
171.1124 - return target.invokeExact(a0, a1, a2, a3, a4, a5);
171.1125 - } catch (Throwable t) {
171.1126 - if (!exType.isInstance(t)) throw t;
171.1127 - return catcher.invokeExact(t, a0, a1, a2, a3, a4, a5);
171.1128 - }
171.1129 - }
171.1130 - private Object invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable {
171.1131 - try {
171.1132 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6);
171.1133 - } catch (Throwable t) {
171.1134 - if (!exType.isInstance(t)) throw t;
171.1135 - return catcher.invokeExact(t, a0, a1, a2, a3, a4, a5, a6);
171.1136 - }
171.1137 - }
171.1138 - private Object invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable {
171.1139 - try {
171.1140 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7);
171.1141 - } catch (Throwable t) {
171.1142 - if (!exType.isInstance(t)) throw t;
171.1143 - return catcher.invokeExact(t, a0, a1, a2, a3, a4, a5, a6, a7);
171.1144 - }
171.1145 - }
171.1146 - static MethodHandle[] makeInvokes() {
171.1147 - ArrayList<MethodHandle> invokes = new ArrayList<MethodHandle>();
171.1148 - MethodHandles.Lookup lookup = IMPL_LOOKUP;
171.1149 - for (;;) {
171.1150 - int nargs = invokes.size();
171.1151 - String name = "invoke_L"+nargs;
171.1152 - MethodHandle invoke = null;
171.1153 - try {
171.1154 - invoke = lookup.findVirtual(GuardWithCatch.class, name, MethodType.genericMethodType(nargs));
171.1155 - } catch (ReflectiveOperationException ex) {
171.1156 - }
171.1157 - if (invoke == null) break;
171.1158 - invokes.add(invoke);
171.1159 - }
171.1160 - assert(invokes.size() == 9); // current number of methods
171.1161 - return invokes.toArray(new MethodHandle[0]);
171.1162 - };
171.1163 - static final MethodHandle[] INVOKES = makeInvokes();
171.1164 - // For testing use this:
171.1165 - //static final MethodHandle[] INVOKES = Arrays.copyOf(makeInvokes(), 2);
171.1166 - static final MethodHandle VARARGS_INVOKE;
171.1167 - static {
171.1168 - try {
171.1169 - VARARGS_INVOKE = IMPL_LOOKUP.findVirtual(GuardWithCatch.class, "invoke_V", MethodType.genericMethodType(0, true));
171.1170 - } catch (ReflectiveOperationException ex) {
171.1171 - throw uncaughtException(ex);
171.1172 - }
171.1173 - }
171.1174 - }
171.1175 -
171.1176 -
171.1177 - public static
171.1178 - MethodHandle makeGuardWithCatch(Access token,
171.1179 - MethodHandle target,
171.1180 - Class<? extends Throwable> exType,
171.1181 - MethodHandle catcher) {
171.1182 - Access.check(token);
171.1183 - MethodType type = target.type();
171.1184 - MethodType ctype = catcher.type();
171.1185 - int nargs = type.parameterCount();
171.1186 - if (nargs < GuardWithCatch.INVOKES.length) {
171.1187 - MethodType gtype = type.generic();
171.1188 - MethodType gcatchType = gtype.insertParameterTypes(0, Throwable.class);
171.1189 - MethodHandle gtarget = convertArguments(token, target, gtype, type, null);
171.1190 - MethodHandle gcatcher = convertArguments(token, catcher, gcatchType, ctype, null);
171.1191 - MethodHandle gguard = new GuardWithCatch(gtarget, exType, gcatcher);
171.1192 - if (gtarget == null || gcatcher == null || gguard == null) return null;
171.1193 - return convertArguments(token, gguard, type, gtype, null);
171.1194 - } else {
171.1195 - MethodType gtype = MethodType.genericMethodType(0, true);
171.1196 - MethodType gcatchType = gtype.insertParameterTypes(0, Throwable.class);
171.1197 - MethodHandle gtarget = spreadArguments(token, target, gtype, 0);
171.1198 - MethodHandle gcatcher = spreadArguments(token, catcher, gcatchType, 1);
171.1199 - MethodHandle gguard = new GuardWithCatch(GuardWithCatch.VARARGS_INVOKE, gtarget, exType, gcatcher);
171.1200 - if (gtarget == null || gcatcher == null || gguard == null) return null;
171.1201 - return collectArguments(token, gguard, type, 0, null);
171.1202 - }
171.1203 - }
171.1204 -
171.1205 - public static
171.1206 - MethodHandle throwException(Access token, MethodType type) {
171.1207 - Access.check(token);
171.1208 - return AdapterMethodHandle.makeRetypeRaw(token, type, THROW_EXCEPTION);
171.1209 - }
171.1210 -
171.1211 - static final MethodHandle THROW_EXCEPTION;
171.1212 - static {
171.1213 - try {
171.1214 - THROW_EXCEPTION
171.1215 - = IMPL_LOOKUP.findStatic(MethodHandleImpl.class, "throwException",
171.1216 - MethodType.methodType(Empty.class, Throwable.class));
171.1217 - } catch (ReflectiveOperationException ex) {
171.1218 - throw new RuntimeException(ex);
171.1219 - }
171.1220 - }
171.1221 - static <T extends Throwable> Empty throwException(T t) throws T { throw t; }
171.1222 -
171.1223 - public static String getNameString(Access token, MethodHandle target, Object type) {
171.1224 - Access.check(token);
171.1225 - if (!(type instanceof MethodType)) {
171.1226 - if (type == null)
171.1227 - type = target.type();
171.1228 - else if (type instanceof MethodHandle)
171.1229 - type = ((MethodHandle)type).type();
171.1230 - }
171.1231 - MemberName name = null;
171.1232 - if (target != null)
171.1233 - name = MethodHandleNatives.getMethodName(target);
171.1234 - if (name == null)
171.1235 - return "invoke" + type;
171.1236 - return name.getName() + type;
171.1237 - }
171.1238 -
171.1239 - public static String getNameString(Access token, MethodHandle target) {
171.1240 - return getNameString(token, target, null);
171.1241 - }
171.1242 -
171.1243 - static String addTypeString(Object obj, MethodHandle target) {
171.1244 - String str = String.valueOf(obj);
171.1245 - if (target == null) return str;
171.1246 - int paren = str.indexOf('(');
171.1247 - if (paren >= 0) str = str.substring(0, paren);
171.1248 - return str + target.type();
171.1249 - }
171.1250 -
171.1251 - static void checkSpreadArgument(Object av, int n) {
171.1252 - if (av == null ? n != 0 : ((Object[])av).length != n)
171.1253 - throw newIllegalArgumentException("Array is not of length "+n);
171.1254 - }
171.1255 -
171.1256 - static void raiseException(int code, Object actual, Object required) {
171.1257 - String message;
171.1258 - // disregard the identity of the actual object, if it is not a class:
171.1259 - if (!(actual instanceof Class) && !(actual instanceof MethodType))
171.1260 - actual = actual.getClass();
171.1261 - if (actual != null)
171.1262 - message = "required "+required+" but encountered "+actual;
171.1263 - else
171.1264 - message = "required "+required;
171.1265 - switch (code) {
171.1266 - case 192: // checkcast
171.1267 - throw new ClassCastException(message);
171.1268 - default:
171.1269 - throw new InternalError("unexpected code "+code+": "+message);
171.1270 - }
171.1271 - }
171.1272 -
171.1273 - // Linkage support:
171.1274 - public static void registerBootstrap(Access token, Class<?> callerClass, MethodHandle bootstrapMethod) {
171.1275 - Access.check(token);
171.1276 - MethodHandleNatives.registerBootstrap(callerClass, bootstrapMethod);
171.1277 - }
171.1278 - public static MethodHandle getBootstrap(Access token, Class<?> callerClass) {
171.1279 - Access.check(token);
171.1280 - return MethodHandleNatives.getBootstrap(callerClass);
171.1281 - }
171.1282 -
171.1283 - public static MethodHandle asVarargsCollector(Access token, MethodHandle target, Class<?> arrayType) {
171.1284 - Access.check(token);
171.1285 - return AdapterMethodHandle.makeVarargsCollector(token, target, arrayType);
171.1286 - }
171.1287 -}
172.1 --- a/src/share/classes/sun/dyn/MethodHandleNatives.java Tue Mar 29 11:29:01 2011 -0700
172.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
172.3 @@ -1,359 +0,0 @@
172.4 -/*
172.5 - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
172.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
172.7 - *
172.8 - * This code is free software; you can redistribute it and/or modify it
172.9 - * under the terms of the GNU General Public License version 2 only, as
172.10 - * published by the Free Software Foundation. Oracle designates this
172.11 - * particular file as subject to the "Classpath" exception as provided
172.12 - * by Oracle in the LICENSE file that accompanied this code.
172.13 - *
172.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
172.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
172.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
172.17 - * version 2 for more details (a copy is included in the LICENSE file that
172.18 - * accompanied this code).
172.19 - *
172.20 - * You should have received a copy of the GNU General Public License version
172.21 - * 2 along with this work; if not, write to the Free Software Foundation,
172.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
172.23 - *
172.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
172.25 - * or visit www.oracle.com if you need additional information or have any
172.26 - * questions.
172.27 - */
172.28 -
172.29 -package sun.dyn;
172.30 -
172.31 -import java.dyn.*;
172.32 -import java.dyn.MethodHandles.Lookup;
172.33 -import java.lang.reflect.AccessibleObject;
172.34 -import java.lang.reflect.Field;
172.35 -import static sun.dyn.MethodHandleNatives.Constants.*;
172.36 -import static sun.dyn.MethodHandleImpl.IMPL_LOOKUP;
172.37 -
172.38 -/**
172.39 - * The JVM interface for the method handles package is all here.
172.40 - * This is an interface internal and private to an implemetantion of JSR 292.
172.41 - * <em>This class is not part of the JSR 292 standard.</em>
172.42 - * @author jrose
172.43 - */
172.44 -class MethodHandleNatives {
172.45 -
172.46 - private MethodHandleNatives() { } // static only
172.47 -
172.48 - /// MethodName support
172.49 -
172.50 - static native void init(MemberName self, Object ref);
172.51 - static native void expand(MemberName self);
172.52 - static native void resolve(MemberName self, Class<?> caller);
172.53 - static native int getMembers(Class<?> defc, String matchName, String matchSig,
172.54 - int matchFlags, Class<?> caller, int skip, MemberName[] results);
172.55 -
172.56 - /// MethodHandle support
172.57 -
172.58 - /** Initialize the method handle to adapt the call. */
172.59 - static native void init(AdapterMethodHandle self, MethodHandle target, int argnum);
172.60 - /** Initialize the method handle to call the correct method, directly. */
172.61 - static native void init(BoundMethodHandle self, Object target, int argnum);
172.62 - /** Initialize the method handle to call as if by an invoke* instruction. */
172.63 - static native void init(DirectMethodHandle self, Object ref, boolean doDispatch, Class<?> caller);
172.64 -
172.65 - /** Initialize a method type, once per form. */
172.66 - static native void init(MethodType self);
172.67 -
172.68 - /** Tell the JVM about a class's bootstrap method. */
172.69 - static native void registerBootstrap(Class<?> caller, MethodHandle bootstrapMethod);
172.70 -
172.71 - /** Ask the JVM about a class's bootstrap method. */
172.72 - static native MethodHandle getBootstrap(Class<?> caller);
172.73 -
172.74 - /** Tell the JVM that we need to change the target of an invokedynamic. */
172.75 - static native void setCallSiteTarget(CallSite site, MethodHandle target);
172.76 -
172.77 - /** Fetch the vmtarget field.
172.78 - * It will be sanitized as necessary to avoid exposing non-Java references.
172.79 - * This routine is for debugging and reflection.
172.80 - */
172.81 - static native Object getTarget(MethodHandle self, int format);
172.82 -
172.83 - /** Fetch the name of the handled method, if available.
172.84 - * This routine is for debugging and reflection.
172.85 - */
172.86 - static MemberName getMethodName(MethodHandle self) {
172.87 - if (!JVM_SUPPORT) return null;
172.88 - return (MemberName) getTarget(self, ETF_METHOD_NAME);
172.89 - }
172.90 -
172.91 - /** Fetch the reflective version of the handled method, if available.
172.92 - */
172.93 - static AccessibleObject getTargetMethod(MethodHandle self) {
172.94 - if (!JVM_SUPPORT) return null;
172.95 - return (AccessibleObject) getTarget(self, ETF_REFLECT_METHOD);
172.96 - }
172.97 -
172.98 - /** Fetch the target of this method handle.
172.99 - * If it directly targets a method, return a MemberName for the method.
172.100 - * If it is chained to another method handle, return that handle.
172.101 - */
172.102 - static Object getTargetInfo(MethodHandle self) {
172.103 - if (!JVM_SUPPORT) return null;
172.104 - return getTarget(self, ETF_HANDLE_OR_METHOD_NAME);
172.105 - }
172.106 -
172.107 - static Object[] makeTarget(Class<?> defc, String name, String sig, int mods, Class<?> refc) {
172.108 - return new Object[] { defc, name, sig, mods, refc };
172.109 - }
172.110 -
172.111 - /** Fetch MH-related JVM parameter.
172.112 - * which=0 retrieves MethodHandlePushLimit
172.113 - * which=1 retrieves stack slot push size (in address units)
172.114 - */
172.115 - static native int getConstant(int which);
172.116 -
172.117 - /** True iff this HotSpot JVM has built-in support for method handles.
172.118 - * If false, some test cases might run, but functionality will be missing.
172.119 - */
172.120 - public static final boolean JVM_SUPPORT;
172.121 -
172.122 - /** Java copy of MethodHandlePushLimit in range 2..255. */
172.123 - static final int JVM_PUSH_LIMIT;
172.124 - /** JVM stack motion (in words) after one slot is pushed, usually -1.
172.125 - */
172.126 - static final int JVM_STACK_MOVE_UNIT;
172.127 -
172.128 - /** Which conv-ops are implemented by the JVM? */
172.129 - static final int CONV_OP_IMPLEMENTED_MASK;
172.130 -
172.131 - private static native void registerNatives();
172.132 - static {
172.133 - boolean JVM_SUPPORT_;
172.134 - int JVM_PUSH_LIMIT_;
172.135 - int JVM_STACK_MOVE_UNIT_;
172.136 - int CONV_OP_IMPLEMENTED_MASK_;
172.137 - try {
172.138 - registerNatives();
172.139 - JVM_SUPPORT_ = true;
172.140 - JVM_PUSH_LIMIT_ = getConstant(Constants.GC_JVM_PUSH_LIMIT);
172.141 - JVM_STACK_MOVE_UNIT_ = getConstant(Constants.GC_JVM_STACK_MOVE_UNIT);
172.142 - CONV_OP_IMPLEMENTED_MASK_ = getConstant(Constants.GC_CONV_OP_IMPLEMENTED_MASK);
172.143 - //sun.reflect.Reflection.registerMethodsToFilter(MethodHandleImpl.class, "init");
172.144 - } catch (UnsatisfiedLinkError ee) {
172.145 - // ignore; if we use init() methods later we'll see linkage errors
172.146 - JVM_SUPPORT_ = false;
172.147 - JVM_PUSH_LIMIT_ = 3; // arbitrary
172.148 - JVM_STACK_MOVE_UNIT_ = -1; // arbitrary
172.149 - CONV_OP_IMPLEMENTED_MASK_ = 0;
172.150 - //System.out.println("Warning: Running with JVM_SUPPORT=false");
172.151 - //System.out.println(ee);
172.152 - JVM_SUPPORT = JVM_SUPPORT_;
172.153 - JVM_PUSH_LIMIT = JVM_PUSH_LIMIT_;
172.154 - JVM_STACK_MOVE_UNIT = JVM_STACK_MOVE_UNIT_;
172.155 - throw ee; // just die; hopeless to try to run with an older JVM
172.156 - }
172.157 - JVM_SUPPORT = JVM_SUPPORT_;
172.158 - JVM_PUSH_LIMIT = JVM_PUSH_LIMIT_;
172.159 - JVM_STACK_MOVE_UNIT = JVM_STACK_MOVE_UNIT_;
172.160 - if (CONV_OP_IMPLEMENTED_MASK_ == 0)
172.161 - CONV_OP_IMPLEMENTED_MASK_ = DEFAULT_CONV_OP_IMPLEMENTED_MASK;
172.162 - CONV_OP_IMPLEMENTED_MASK = CONV_OP_IMPLEMENTED_MASK_;
172.163 - }
172.164 -
172.165 - // All compile-time constants go here.
172.166 - // There is an opportunity to check them against the JVM's idea of them.
172.167 - static class Constants {
172.168 - Constants() { } // static only
172.169 - // MethodHandleImpl
172.170 - static final int // for getConstant
172.171 - GC_JVM_PUSH_LIMIT = 0,
172.172 - GC_JVM_STACK_MOVE_UNIT = 1,
172.173 - GC_CONV_OP_IMPLEMENTED_MASK = 2;
172.174 - static final int
172.175 - ETF_HANDLE_OR_METHOD_NAME = 0, // all available data (immediate MH or method)
172.176 - ETF_DIRECT_HANDLE = 1, // ultimate method handle (will be a DMH, may be self)
172.177 - ETF_METHOD_NAME = 2, // ultimate method as MemberName
172.178 - ETF_REFLECT_METHOD = 3; // ultimate method as java.lang.reflect object (sans refClass)
172.179 -
172.180 - // MemberName
172.181 - // The JVM uses values of -2 and above for vtable indexes.
172.182 - // Field values are simple positive offsets.
172.183 - // Ref: src/share/vm/oops/methodOop.hpp
172.184 - // This value is negative enough to avoid such numbers,
172.185 - // but not too negative.
172.186 - static final int
172.187 - MN_IS_METHOD = 0x00010000, // method (not constructor)
172.188 - MN_IS_CONSTRUCTOR = 0x00020000, // constructor
172.189 - MN_IS_FIELD = 0x00040000, // field
172.190 - MN_IS_TYPE = 0x00080000, // nested type
172.191 - MN_SEARCH_SUPERCLASSES = 0x00100000, // for MHN.getMembers
172.192 - MN_SEARCH_INTERFACES = 0x00200000, // for MHN.getMembers
172.193 - VM_INDEX_UNINITIALIZED = -99;
172.194 -
172.195 - // AdapterMethodHandle
172.196 - /** Conversions recognized by the JVM.
172.197 - * They must align with the constants in sun.dyn_AdapterMethodHandle,
172.198 - * in the JVM file hotspot/src/share/vm/classfile/javaClasses.hpp.
172.199 - */
172.200 - static final int
172.201 - OP_RETYPE_ONLY = 0x0, // no argument changes; straight retype
172.202 - OP_RETYPE_RAW = 0x1, // no argument changes; straight retype
172.203 - OP_CHECK_CAST = 0x2, // ref-to-ref conversion; requires a Class argument
172.204 - OP_PRIM_TO_PRIM = 0x3, // converts from one primitive to another
172.205 - OP_REF_TO_PRIM = 0x4, // unboxes a wrapper to produce a primitive
172.206 - OP_PRIM_TO_REF = 0x5, // boxes a primitive into a wrapper (NYI)
172.207 - OP_SWAP_ARGS = 0x6, // swap arguments (vminfo is 2nd arg)
172.208 - OP_ROT_ARGS = 0x7, // rotate arguments (vminfo is displaced arg)
172.209 - OP_DUP_ARGS = 0x8, // duplicates one or more arguments (at TOS)
172.210 - OP_DROP_ARGS = 0x9, // remove one or more argument slots
172.211 - OP_COLLECT_ARGS = 0xA, // combine one or more arguments into a varargs (NYI)
172.212 - OP_SPREAD_ARGS = 0xB, // expand in place a varargs array (of known size)
172.213 - OP_FLYBY = 0xC, // operate first on reified argument list (NYI)
172.214 - OP_RICOCHET = 0xD, // run an adapter chain on the return value (NYI)
172.215 - CONV_OP_LIMIT = 0xE; // limit of CONV_OP enumeration
172.216 - /** Shift and mask values for decoding the AMH.conversion field.
172.217 - * These numbers are shared with the JVM for creating AMHs.
172.218 - */
172.219 - static final int
172.220 - CONV_OP_MASK = 0xF00, // this nybble contains the conversion op field
172.221 - CONV_VMINFO_MASK = 0x0FF, // LSB is reserved for JVM use
172.222 - CONV_VMINFO_SHIFT = 0, // position of bits in CONV_VMINFO_MASK
172.223 - CONV_OP_SHIFT = 8, // position of bits in CONV_OP_MASK
172.224 - CONV_DEST_TYPE_SHIFT = 12, // byte 2 has the adapter BasicType (if needed)
172.225 - CONV_SRC_TYPE_SHIFT = 16, // byte 2 has the source BasicType (if needed)
172.226 - CONV_STACK_MOVE_SHIFT = 20, // high 12 bits give signed SP change
172.227 - CONV_STACK_MOVE_MASK = (1 << (32 - CONV_STACK_MOVE_SHIFT)) - 1;
172.228 -
172.229 - /** Which conv-ops are implemented by the JVM? */
172.230 - static final int DEFAULT_CONV_OP_IMPLEMENTED_MASK =
172.231 - // Value to use if the corresponding JVM query fails.
172.232 - ((1<<OP_RETYPE_ONLY)
172.233 - |(1<<OP_RETYPE_RAW)
172.234 - |(1<<OP_CHECK_CAST)
172.235 - |(1<<OP_PRIM_TO_PRIM)
172.236 - |(1<<OP_REF_TO_PRIM)
172.237 - |(1<<OP_SWAP_ARGS)
172.238 - |(1<<OP_ROT_ARGS)
172.239 - |(1<<OP_DUP_ARGS)
172.240 - |(1<<OP_DROP_ARGS)
172.241 - //|(1<<OP_SPREAD_ARGS)
172.242 - );
172.243 -
172.244 - /**
172.245 - * Basic types as encoded in the JVM. These code values are not
172.246 - * intended for use outside this class. They are used as part of
172.247 - * a private interface between the JVM and this class.
172.248 - */
172.249 - static final int
172.250 - T_BOOLEAN = 4,
172.251 - T_CHAR = 5,
172.252 - T_FLOAT = 6,
172.253 - T_DOUBLE = 7,
172.254 - T_BYTE = 8,
172.255 - T_SHORT = 9,
172.256 - T_INT = 10,
172.257 - T_LONG = 11,
172.258 - T_OBJECT = 12,
172.259 - //T_ARRAY = 13
172.260 - T_VOID = 14;
172.261 - //T_ADDRESS = 15
172.262 -
172.263 - /**
172.264 - * Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries.
172.265 - */
172.266 - static final int
172.267 - REF_getField = 1,
172.268 - REF_getStatic = 2,
172.269 - REF_putField = 3,
172.270 - REF_putStatic = 4,
172.271 - REF_invokeVirtual = 5,
172.272 - REF_invokeStatic = 6,
172.273 - REF_invokeSpecial = 7,
172.274 - REF_newInvokeSpecial = 8,
172.275 - REF_invokeInterface = 9;
172.276 - }
172.277 -
172.278 - private static native int getNamedCon(int which, Object[] name);
172.279 - static boolean verifyConstants() {
172.280 - Object[] box = { null };
172.281 - for (int i = 0; ; i++) {
172.282 - box[0] = null;
172.283 - int vmval = getNamedCon(i, box);
172.284 - if (box[0] == null) break;
172.285 - String name = (String) box[0];
172.286 - try {
172.287 - Field con = Constants.class.getDeclaredField(name);
172.288 - int jval = con.getInt(null);
172.289 - if (jval != vmval)
172.290 - throw new InternalError(name+": JVM has "+vmval+" while Java has "+jval);
172.291 - } catch (Exception ex) {
172.292 - throw new InternalError(name+": access failed, got "+ex);
172.293 - }
172.294 - }
172.295 - return true;
172.296 - }
172.297 - static {
172.298 - if (JVM_SUPPORT) verifyConstants();
172.299 - }
172.300 -
172.301 - // Up-calls from the JVM.
172.302 - // These must NOT be public.
172.303 -
172.304 - /**
172.305 - * The JVM is linking an invokedynamic instruction. Create a reified call site for it.
172.306 - */
172.307 - static CallSite makeDynamicCallSite(MethodHandle bootstrapMethod,
172.308 - String name, MethodType type,
172.309 - Object info,
172.310 - MemberName callerMethod, int callerBCI) {
172.311 - return CallSiteImpl.makeSite(bootstrapMethod, name, type, info, callerMethod, callerBCI);
172.312 - }
172.313 -
172.314 - /**
172.315 - * The JVM wants a pointer to a MethodType. Oblige it by finding or creating one.
172.316 - */
172.317 - static MethodType findMethodHandleType(Class<?> rtype, Class<?>[] ptypes) {
172.318 - MethodType.genericMethodType(0); // trigger initialization
172.319 - return MethodTypeImpl.makeImpl(Access.TOKEN, rtype, ptypes, true);
172.320 - }
172.321 -
172.322 - /**
172.323 - * The JVM wants to use a MethodType with invokeGeneric. Give the runtime fair warning.
172.324 - */
172.325 - static void notifyGenericMethodType(MethodType type) {
172.326 - try {
172.327 - // Trigger adapter creation.
172.328 - InvokeGeneric.genericInvokerOf(type);
172.329 - } catch (Exception ex) {
172.330 - Error err = new InternalError("Exception while resolving invokeGeneric");
172.331 - err.initCause(ex);
172.332 - throw err;
172.333 - }
172.334 - }
172.335 -
172.336 - /**
172.337 - * The JVM is resolving a CONSTANT_MethodHandle CP entry. And it wants our help.
172.338 - * It will make an up-call to this method. (Do not change the name or signature.)
172.339 - */
172.340 - static MethodHandle linkMethodHandleConstant(Class<?> callerClass, int refKind,
172.341 - Class<?> defc, String name, Object type) {
172.342 - try {
172.343 - Lookup lookup = IMPL_LOOKUP.in(callerClass);
172.344 - switch (refKind) {
172.345 - case REF_getField: return lookup.findGetter( defc, name, (Class<?>) type );
172.346 - case REF_getStatic: return lookup.findStaticGetter( defc, name, (Class<?>) type );
172.347 - case REF_putField: return lookup.findSetter( defc, name, (Class<?>) type );
172.348 - case REF_putStatic: return lookup.findStaticSetter( defc, name, (Class<?>) type );
172.349 - case REF_invokeVirtual: return lookup.findVirtual( defc, name, (MethodType) type );
172.350 - case REF_invokeStatic: return lookup.findStatic( defc, name, (MethodType) type );
172.351 - case REF_invokeSpecial: return lookup.findSpecial( defc, name, (MethodType) type, callerClass );
172.352 - case REF_newInvokeSpecial: return lookup.findConstructor( defc, (MethodType) type );
172.353 - case REF_invokeInterface: return lookup.findVirtual( defc, name, (MethodType) type );
172.354 - }
172.355 - throw new IllegalArgumentException("bad MethodHandle constant "+name+" : "+type);
172.356 - } catch (ReflectiveOperationException ex) {
172.357 - Error err = new IncompatibleClassChangeError();
172.358 - err.initCause(ex);
172.359 - throw err;
172.360 - }
172.361 - }
172.362 -}
173.1 --- a/src/share/classes/sun/dyn/MethodTypeImpl.java Tue Mar 29 11:29:01 2011 -0700
173.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
173.3 @@ -1,516 +0,0 @@
173.4 -/*
173.5 - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
173.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
173.7 - *
173.8 - * This code is free software; you can redistribute it and/or modify it
173.9 - * under the terms of the GNU General Public License version 2 only, as
173.10 - * published by the Free Software Foundation. Oracle designates this
173.11 - * particular file as subject to the "Classpath" exception as provided
173.12 - * by Oracle in the LICENSE file that accompanied this code.
173.13 - *
173.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
173.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
173.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
173.17 - * version 2 for more details (a copy is included in the LICENSE file that
173.18 - * accompanied this code).
173.19 - *
173.20 - * You should have received a copy of the GNU General Public License version
173.21 - * 2 along with this work; if not, write to the Free Software Foundation,
173.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
173.23 - *
173.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
173.25 - * or visit www.oracle.com if you need additional information or have any
173.26 - * questions.
173.27 - */
173.28 -
173.29 -package sun.dyn;
173.30 -
173.31 -import java.dyn.*;
173.32 -import sun.dyn.util.Wrapper;
173.33 -import static sun.dyn.MemberName.newIllegalArgumentException;
173.34 -
173.35 -/**
173.36 - * Shared information for a group of method types, which differ
173.37 - * only by reference types, and therefore share a common erasure
173.38 - * and wrapping.
173.39 - * <p>
173.40 - * For an empirical discussion of the structure of method types,
173.41 - * see <a href="http://groups.google.com/group/jvm-languages/browse_thread/thread/ac9308ae74da9b7e/">
173.42 - * the thread "Avoiding Boxing" on jvm-languages</a>.
173.43 - * There are approximately 2000 distinct erased method types in the JDK.
173.44 - * There are a little over 10 times that number of unerased types.
173.45 - * No more than half of these are likely to be loaded at once.
173.46 - * @author John Rose
173.47 - */
173.48 -public class MethodTypeImpl {
173.49 - final int[] argToSlotTable, slotToArgTable;
173.50 - final long argCounts; // packed slot & value counts
173.51 - final long primCounts; // packed prim & double counts
173.52 - final int vmslots; // total number of parameter slots
173.53 - final MethodType erasedType; // the canonical erasure
173.54 -
173.55 - /*lazy*/ MethodType primsAsBoxes; // replace prims by wrappers
173.56 - /*lazy*/ MethodType primArgsAsBoxes; // wrap args only; make raw return
173.57 - /*lazy*/ MethodType primsAsInts; // replace prims by int/long
173.58 - /*lazy*/ MethodType primsAsLongs; // replace prims by long
173.59 - /*lazy*/ MethodType primsAtEnd; // reorder primitives to the end
173.60 -
173.61 - // Cached adapter information:
173.62 - /*lazy*/ ToGeneric toGeneric; // convert cs. with prims to w/o
173.63 - /*lazy*/ FromGeneric fromGeneric; // convert cs. w/o prims to with
173.64 - /*lazy*/ SpreadGeneric[] spreadGeneric; // expand one argument to many
173.65 - /*lazy*/ FilterGeneric filterGeneric; // convert argument(s) on the fly
173.66 - /*lazy*/ MethodHandle genericInvoker; // hook for invokeGeneric
173.67 -
173.68 - public MethodType erasedType() {
173.69 - return erasedType;
173.70 - }
173.71 -
173.72 - public static MethodTypeImpl of(MethodType type) {
173.73 - return METHOD_TYPE_FRIEND.form(type);
173.74 - }
173.75 -
173.76 - /** Access methods for the internals of MethodType, supplied to
173.77 - * MethodTypeImpl as a trusted agent.
173.78 - */
173.79 - static public interface MethodTypeFriend {
173.80 - Class<?>[] ptypes(MethodType mt);
173.81 - MethodTypeImpl form(MethodType mt);
173.82 - void setForm(MethodType mt, MethodTypeImpl form);
173.83 - MethodType makeImpl(Class<?> rtype, Class<?>[] ptypes, boolean trusted);
173.84 - MethodTypeImpl newMethodTypeForm(MethodType mt);
173.85 - Invokers getInvokers(MethodType mt);
173.86 - void setInvokers(MethodType mt, Invokers inv);
173.87 - }
173.88 - public static void setMethodTypeFriend(Access token, MethodTypeFriend am) {
173.89 - Access.check(token);
173.90 - if (METHOD_TYPE_FRIEND != null)
173.91 - throw new InternalError(); // just once
173.92 - METHOD_TYPE_FRIEND = am;
173.93 - }
173.94 - static private MethodTypeFriend METHOD_TYPE_FRIEND;
173.95 -
173.96 - static MethodType makeImpl(Access token, Class<?> rtype, Class<?>[] ptypes, boolean trusted) {
173.97 - Access.check(token);
173.98 - return METHOD_TYPE_FRIEND.makeImpl(rtype, ptypes, trusted);
173.99 - }
173.100 -
173.101 - protected MethodTypeImpl(MethodType erasedType) {
173.102 - this.erasedType = erasedType;
173.103 -
173.104 - Class<?>[] ptypes = METHOD_TYPE_FRIEND.ptypes(erasedType);
173.105 - int ptypeCount = ptypes.length;
173.106 - int pslotCount = ptypeCount; // temp. estimate
173.107 - int rtypeCount = 1; // temp. estimate
173.108 - int rslotCount = 1; // temp. estimate
173.109 -
173.110 - int[] argToSlotTab = null, slotToArgTab = null;
173.111 -
173.112 - // Walk the argument types, looking for primitives.
173.113 - int pac = 0, lac = 0, prc = 0, lrc = 0;
173.114 - Class<?> epts[] = ptypes;
173.115 - for (int i = 0; i < epts.length; i++) {
173.116 - Class<?> pt = epts[i];
173.117 - if (pt != Object.class) {
173.118 - assert(pt.isPrimitive());
173.119 - ++pac;
173.120 - if (hasTwoArgSlots(pt)) ++lac;
173.121 - }
173.122 - }
173.123 - pslotCount += lac; // #slots = #args + #longs
173.124 - Class<?> rt = erasedType.returnType();
173.125 - if (rt != Object.class) {
173.126 - ++prc; // even void.class counts as a prim here
173.127 - if (hasTwoArgSlots(rt)) ++lrc;
173.128 - // adjust #slots, #args
173.129 - if (rt == void.class)
173.130 - rtypeCount = rslotCount = 0;
173.131 - else
173.132 - rslotCount += lrc;
173.133 - }
173.134 - if (lac != 0) {
173.135 - int slot = ptypeCount + lac;
173.136 - slotToArgTab = new int[slot+1];
173.137 - argToSlotTab = new int[1+ptypeCount];
173.138 - argToSlotTab[0] = slot; // argument "-1" is past end of slots
173.139 - for (int i = 0; i < epts.length; i++) {
173.140 - Class<?> pt = epts[i];
173.141 - if (hasTwoArgSlots(pt)) --slot;
173.142 - --slot;
173.143 - slotToArgTab[slot] = i+1; // "+1" see argSlotToParameter note
173.144 - argToSlotTab[1+i] = slot;
173.145 - }
173.146 - assert(slot == 0); // filled the table
173.147 - }
173.148 - this.primCounts = pack(lrc, prc, lac, pac);
173.149 - this.argCounts = pack(rslotCount, rtypeCount, pslotCount, ptypeCount);
173.150 - if (slotToArgTab == null) {
173.151 - int slot = ptypeCount; // first arg is deepest in stack
173.152 - slotToArgTab = new int[slot+1];
173.153 - argToSlotTab = new int[1+ptypeCount];
173.154 - argToSlotTab[0] = slot; // argument "-1" is past end of slots
173.155 - for (int i = 0; i < ptypeCount; i++) {
173.156 - --slot;
173.157 - slotToArgTab[slot] = i+1; // "+1" see argSlotToParameter note
173.158 - argToSlotTab[1+i] = slot;
173.159 - }
173.160 - }
173.161 - this.argToSlotTable = argToSlotTab;
173.162 - this.slotToArgTable = slotToArgTab;
173.163 -
173.164 - if (pslotCount >= 256) throw newIllegalArgumentException("too many arguments");
173.165 -
173.166 - // send a few bits down to the JVM:
173.167 - this.vmslots = parameterSlotCount();
173.168 -
173.169 - // short circuit some no-op canonicalizations:
173.170 - if (!hasPrimitives()) {
173.171 - primsAsBoxes = erasedType;
173.172 - primArgsAsBoxes = erasedType;
173.173 - primsAsInts = erasedType;
173.174 - primsAsLongs = erasedType;
173.175 - primsAtEnd = erasedType;
173.176 - }
173.177 - }
173.178 -
173.179 - /** Turn all primitive types to corresponding wrapper types.
173.180 - */
173.181 - public MethodType primsAsBoxes() {
173.182 - MethodType ct = primsAsBoxes;
173.183 - if (ct != null) return ct;
173.184 - MethodType t = erasedType;
173.185 - ct = canonicalize(erasedType, WRAP, WRAP);
173.186 - if (ct == null) ct = t; // no prims to box
173.187 - return primsAsBoxes = ct;
173.188 - }
173.189 -
173.190 - /** Turn all primitive argument types to corresponding wrapper types.
173.191 - * Subword and void return types are promoted to int.
173.192 - */
173.193 - public MethodType primArgsAsBoxes() {
173.194 - MethodType ct = primArgsAsBoxes;
173.195 - if (ct != null) return ct;
173.196 - MethodType t = erasedType;
173.197 - ct = canonicalize(erasedType, RAW_RETURN, WRAP);
173.198 - if (ct == null) ct = t; // no prims to box
173.199 - return primArgsAsBoxes = ct;
173.200 - }
173.201 -
173.202 - /** Turn all primitive types to either int or long.
173.203 - * Floating point return types are not changed, because
173.204 - * they may require special calling sequences.
173.205 - * A void return value is turned to int.
173.206 - */
173.207 - public MethodType primsAsInts() {
173.208 - MethodType ct = primsAsInts;
173.209 - if (ct != null) return ct;
173.210 - MethodType t = erasedType;
173.211 - ct = canonicalize(t, RAW_RETURN, INTS);
173.212 - if (ct == null) ct = t; // no prims to int-ify
173.213 - return primsAsInts = ct;
173.214 - }
173.215 -
173.216 - /** Turn all primitive types to either int or long.
173.217 - * Floating point return types are not changed, because
173.218 - * they may require special calling sequences.
173.219 - * A void return value is turned to int.
173.220 - */
173.221 - public MethodType primsAsLongs() {
173.222 - MethodType ct = primsAsLongs;
173.223 - if (ct != null) return ct;
173.224 - MethodType t = erasedType;
173.225 - ct = canonicalize(t, RAW_RETURN, LONGS);
173.226 - if (ct == null) ct = t; // no prims to int-ify
173.227 - return primsAsLongs = ct;
173.228 - }
173.229 -
173.230 - /** Stably sort parameters into 3 buckets: ref, int, long. */
173.231 - public MethodType primsAtEnd() {
173.232 - MethodType ct = primsAtEnd;
173.233 - if (ct != null) return ct;
173.234 - MethodType t = erasedType;
173.235 -
173.236 - int pac = primitiveParameterCount();
173.237 - if (pac == 0)
173.238 - return primsAtEnd = t;
173.239 -
173.240 - int argc = parameterCount();
173.241 - int lac = longPrimitiveParameterCount();
173.242 - if (pac == argc && (lac == 0 || lac == argc))
173.243 - return primsAtEnd = t;
173.244 -
173.245 - // known to have a mix of 2 or 3 of ref, int, long
173.246 - int[] reorder = primsAtEndOrder(t);
173.247 - ct = reorderParameters(t, reorder, null);
173.248 - //System.out.println("t="+t+" / reorder="+java.util.Arrays.toString(reorder)+" => "+ct);
173.249 - return primsAtEnd = ct;
173.250 - }
173.251 -
173.252 - /** Compute a new ordering of parameters so that all references
173.253 - * are before all ints or longs, and all ints are before all longs.
173.254 - * For this ordering, doubles count as longs, and all other primitive
173.255 - * values count as ints.
173.256 - * As a special case, if the parameters are already in the specified
173.257 - * order, this method returns a null reference, rather than an array
173.258 - * specifying a null permutation.
173.259 - * <p>
173.260 - * For example, the type {@code (int,boolean,int,Object,String)void}
173.261 - * produces the order {@code {3,4,0,1,2}}, the type
173.262 - * {@code (long,int,String)void} produces {@code {2,1,2}}, and
173.263 - * the type {@code (Object,int)Object} produces {@code null}.
173.264 - */
173.265 - public static int[] primsAtEndOrder(MethodType mt) {
173.266 - MethodTypeImpl form = METHOD_TYPE_FRIEND.form(mt);
173.267 - if (form.primsAtEnd == form.erasedType)
173.268 - // quick check shows no reordering is necessary
173.269 - return null;
173.270 -
173.271 - int argc = form.parameterCount();
173.272 - int[] paramOrder = new int[argc];
173.273 -
173.274 - // 3-way bucket sort:
173.275 - int pac = form.primitiveParameterCount();
173.276 - int lac = form.longPrimitiveParameterCount();
173.277 - int rfill = 0, ifill = argc - pac, lfill = argc - lac;
173.278 -
173.279 - Class<?>[] ptypes = METHOD_TYPE_FRIEND.ptypes(mt);
173.280 - boolean changed = false;
173.281 - for (int i = 0; i < ptypes.length; i++) {
173.282 - Class<?> pt = ptypes[i];
173.283 - int ord;
173.284 - if (!pt.isPrimitive()) ord = rfill++;
173.285 - else if (!hasTwoArgSlots(pt)) ord = ifill++;
173.286 - else ord = lfill++;
173.287 - if (ord != i) changed = true;
173.288 - assert(paramOrder[ord] == 0);
173.289 - paramOrder[ord] = i;
173.290 - }
173.291 - assert(rfill == argc - pac && ifill == argc - lac && lfill == argc);
173.292 - if (!changed) {
173.293 - form.primsAtEnd = form.erasedType;
173.294 - return null;
173.295 - }
173.296 - return paramOrder;
173.297 - }
173.298 -
173.299 - /** Put the existing parameters of mt into a new order, given by newParamOrder.
173.300 - * The third argument is logically appended to mt.parameterArray,
173.301 - * so that elements of newParamOrder can index either pre-existing or
173.302 - * new parameter types.
173.303 - */
173.304 - public static MethodType reorderParameters(MethodType mt, int[] newParamOrder, Class<?>[] moreParams) {
173.305 - if (newParamOrder == null) return mt; // no-op reordering
173.306 - Class<?>[] ptypes = METHOD_TYPE_FRIEND.ptypes(mt);
173.307 - Class<?>[] ntypes = new Class<?>[newParamOrder.length];
173.308 - int maxParam = ptypes.length + (moreParams == null ? 0 : moreParams.length);
173.309 - boolean changed = (ntypes.length != ptypes.length);
173.310 - for (int i = 0; i < newParamOrder.length; i++) {
173.311 - int param = newParamOrder[i];
173.312 - if (param != i) changed = true;
173.313 - Class<?> nt;
173.314 - if (param < ptypes.length) nt = ptypes[param];
173.315 - else if (param == maxParam) nt = mt.returnType();
173.316 - else nt = moreParams[param - ptypes.length];
173.317 - ntypes[i] = nt;
173.318 - }
173.319 - if (!changed) return mt;
173.320 - return METHOD_TYPE_FRIEND.makeImpl(mt.returnType(), ntypes, true);
173.321 - }
173.322 -
173.323 - private static boolean hasTwoArgSlots(Class<?> type) {
173.324 - return type == long.class || type == double.class;
173.325 - }
173.326 -
173.327 - private static long pack(int a, int b, int c, int d) {
173.328 - assert(((a|b|c|d) & ~0xFFFF) == 0);
173.329 - long hw = ((a << 16) | b), lw = ((c << 16) | d);
173.330 - return (hw << 32) | lw;
173.331 - }
173.332 - private static char unpack(long packed, int word) { // word==0 => return a, ==3 => return d
173.333 - assert(word <= 3);
173.334 - return (char)(packed >> ((3-word) * 16));
173.335 - }
173.336 -
173.337 - public int parameterCount() { // # outgoing values
173.338 - return unpack(argCounts, 3);
173.339 - }
173.340 - public int parameterSlotCount() { // # outgoing interpreter slots
173.341 - return unpack(argCounts, 2);
173.342 - }
173.343 - public int returnCount() { // = 0 (V), or 1
173.344 - return unpack(argCounts, 1);
173.345 - }
173.346 - public int returnSlotCount() { // = 0 (V), 2 (J/D), or 1
173.347 - return unpack(argCounts, 0);
173.348 - }
173.349 - public int primitiveParameterCount() {
173.350 - return unpack(primCounts, 3);
173.351 - }
173.352 - public int longPrimitiveParameterCount() {
173.353 - return unpack(primCounts, 2);
173.354 - }
173.355 - public int primitiveReturnCount() { // = 0 (obj), or 1
173.356 - return unpack(primCounts, 1);
173.357 - }
173.358 - public int longPrimitiveReturnCount() { // = 1 (J/D), or 0
173.359 - return unpack(primCounts, 0);
173.360 - }
173.361 - public boolean hasPrimitives() {
173.362 - return primCounts != 0;
173.363 - }
173.364 -// public boolean hasNonVoidPrimitives() {
173.365 -// if (primCounts == 0) return false;
173.366 -// if (primitiveParameterCount() != 0) return true;
173.367 -// return (primitiveReturnCount() != 0 && returnCount() != 0);
173.368 -// }
173.369 - public boolean hasLongPrimitives() {
173.370 - return (longPrimitiveParameterCount() | longPrimitiveReturnCount()) != 0;
173.371 - }
173.372 - public int parameterToArgSlot(int i) {
173.373 - return argToSlotTable[1+i];
173.374 - }
173.375 - public int argSlotToParameter(int argSlot) {
173.376 - // Note: Empty slots are represented by zero in this table.
173.377 - // Valid arguments slots contain incremented entries, so as to be non-zero.
173.378 - // We return -1 the caller to mean an empty slot.
173.379 - return slotToArgTable[argSlot] - 1;
173.380 - }
173.381 -
173.382 - public static void initForm(Access token, MethodType mt) {
173.383 - Access.check(token);
173.384 - MethodTypeImpl form = findForm(mt);
173.385 - METHOD_TYPE_FRIEND.setForm(mt, form);
173.386 - if (form.erasedType == mt) {
173.387 - // This is a principal (erased) type; show it to the JVM.
173.388 - MethodHandleImpl.init(token, mt);
173.389 - }
173.390 - }
173.391 -
173.392 - static MethodTypeImpl findForm(MethodType mt) {
173.393 - MethodType erased = canonicalize(mt, ERASE, ERASE);
173.394 - if (erased == null) {
173.395 - // It is already erased. Make a new MethodTypeImpl.
173.396 - return METHOD_TYPE_FRIEND.newMethodTypeForm(mt);
173.397 - } else {
173.398 - // Share the MethodTypeImpl with the erased version.
173.399 - return METHOD_TYPE_FRIEND.form(erased);
173.400 - }
173.401 - }
173.402 -
173.403 - /** Codes for {@link #canonicalize(java.lang.Class, int).
173.404 - * ERASE means change every reference to {@code Object}.
173.405 - * WRAP means convert primitives (including {@code void} to their
173.406 - * corresponding wrapper types. UNWRAP means the reverse of WRAP.
173.407 - * INTS means convert all non-void primitive types to int or long,
173.408 - * according to size. LONGS means convert all non-void primitives
173.409 - * to long, regardless of size. RAW_RETURN means convert a type
173.410 - * (assumed to be a return type) to int if it is smaller than an int,
173.411 - * or if it is void.
173.412 - */
173.413 - public static final int NO_CHANGE = 0, ERASE = 1, WRAP = 2, UNWRAP = 3, INTS = 4, LONGS = 5, RAW_RETURN = 6;
173.414 -
173.415 - /** Canonicalize the types in the given method type.
173.416 - * If any types change, intern the new type, and return it.
173.417 - * Otherwise return null.
173.418 - */
173.419 - public static MethodType canonicalize(MethodType mt, int howRet, int howArgs) {
173.420 - Class<?>[] ptypes = METHOD_TYPE_FRIEND.ptypes(mt);
173.421 - Class<?>[] ptc = MethodTypeImpl.canonicalizes(ptypes, howArgs);
173.422 - Class<?> rtype = mt.returnType();
173.423 - Class<?> rtc = MethodTypeImpl.canonicalize(rtype, howRet);
173.424 - if (ptc == null && rtc == null) {
173.425 - // It is already canonical.
173.426 - return null;
173.427 - }
173.428 - // Find the erased version of the method type:
173.429 - if (rtc == null) rtc = rtype;
173.430 - if (ptc == null) ptc = ptypes;
173.431 - return METHOD_TYPE_FRIEND.makeImpl(rtc, ptc, true);
173.432 - }
173.433 -
173.434 - /** Canonicalize the given return or param type.
173.435 - * Return null if the type is already canonicalized.
173.436 - */
173.437 - static Class<?> canonicalize(Class<?> t, int how) {
173.438 - Class<?> ct;
173.439 - if (t == Object.class) {
173.440 - // no change, ever
173.441 - } else if (!t.isPrimitive()) {
173.442 - switch (how) {
173.443 - case UNWRAP:
173.444 - ct = Wrapper.asPrimitiveType(t);
173.445 - if (ct != t) return ct;
173.446 - break;
173.447 - case RAW_RETURN:
173.448 - case ERASE:
173.449 - return Object.class;
173.450 - }
173.451 - } else if (t == void.class) {
173.452 - // no change, usually
173.453 - switch (how) {
173.454 - case RAW_RETURN:
173.455 - return int.class;
173.456 - case WRAP:
173.457 - return Void.class;
173.458 - }
173.459 - } else {
173.460 - // non-void primitive
173.461 - switch (how) {
173.462 - case WRAP:
173.463 - return Wrapper.asWrapperType(t);
173.464 - case INTS:
173.465 - if (t == int.class || t == long.class)
173.466 - return null; // no change
173.467 - if (t == double.class)
173.468 - return long.class;
173.469 - return int.class;
173.470 - case LONGS:
173.471 - if (t == long.class)
173.472 - return null; // no change
173.473 - return long.class;
173.474 - case RAW_RETURN:
173.475 - if (t == int.class || t == long.class ||
173.476 - t == float.class || t == double.class)
173.477 - return null; // no change
173.478 - // everything else returns as an int
173.479 - return int.class;
173.480 - }
173.481 - }
173.482 - // no change; return null to signify
173.483 - return null;
173.484 - }
173.485 -
173.486 - /** Canonicalize each param type in the given array.
173.487 - * Return null if all types are already canonicalized.
173.488 - */
173.489 - static Class<?>[] canonicalizes(Class<?>[] ts, int how) {
173.490 - Class<?>[] cs = null;
173.491 - for (int imax = ts.length, i = 0; i < imax; i++) {
173.492 - Class<?> c = canonicalize(ts[i], how);
173.493 - if (c != null) {
173.494 - if (cs == null)
173.495 - cs = ts.clone();
173.496 - cs[i] = c;
173.497 - }
173.498 - }
173.499 - return cs;
173.500 - }
173.501 -
173.502 - public static Invokers invokers(Access token, MethodType type) {
173.503 - Access.check(token);
173.504 - return invokers(type);
173.505 - }
173.506 - /*non-public*/ static Invokers invokers(MethodType type) {
173.507 - Invokers inv = METHOD_TYPE_FRIEND.getInvokers(type);
173.508 - if (inv != null) return inv;
173.509 - inv = new Invokers(type);
173.510 - METHOD_TYPE_FRIEND.setInvokers(type, inv);
173.511 - return inv;
173.512 - }
173.513 -
173.514 - @Override
173.515 - public String toString() {
173.516 - return "Form"+erasedType;
173.517 - }
173.518 -
173.519 -}
174.1 --- a/src/share/classes/sun/dyn/SpreadGeneric.java Tue Mar 29 11:29:01 2011 -0700
174.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
174.3 @@ -1,678 +0,0 @@
174.4 -/*
174.5 - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
174.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
174.7 - *
174.8 - * This code is free software; you can redistribute it and/or modify it
174.9 - * under the terms of the GNU General Public License version 2 only, as
174.10 - * published by the Free Software Foundation. Oracle designates this
174.11 - * particular file as subject to the "Classpath" exception as provided
174.12 - * by Oracle in the LICENSE file that accompanied this code.
174.13 - *
174.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
174.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
174.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
174.17 - * version 2 for more details (a copy is included in the LICENSE file that
174.18 - * accompanied this code).
174.19 - *
174.20 - * You should have received a copy of the GNU General Public License version
174.21 - * 2 along with this work; if not, write to the Free Software Foundation,
174.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
174.23 - *
174.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
174.25 - * or visit www.oracle.com if you need additional information or have any
174.26 - * questions.
174.27 - */
174.28 -
174.29 -package sun.dyn;
174.30 -
174.31 -import java.dyn.*;
174.32 -import java.lang.reflect.Constructor;
174.33 -import java.lang.reflect.InvocationTargetException;
174.34 -import java.util.ArrayList;
174.35 -import sun.dyn.util.ValueConversions;
174.36 -import static sun.dyn.MemberName.newIllegalArgumentException;
174.37 -
174.38 -/**
174.39 - * Generic spread adapter.
174.40 - * Expands a final argument into multiple (zero or more) arguments, keeping the others the same.
174.41 - * @author jrose
174.42 - */
174.43 -class SpreadGeneric {
174.44 - // type for the outgoing call
174.45 - private final MethodType targetType;
174.46 - // number of arguments to spread
174.47 - private final int spreadCount;
174.48 - // prototype adapter (clone and customize for each new target!)
174.49 - private final Adapter adapter;
174.50 - // entry point for adapter (Adapter mh, a...) => ...
174.51 - private final MethodHandle entryPoint;
174.52 -
174.53 - /** Compute and cache information common to all spreading adapters
174.54 - * that accept calls of the given (generic) type.
174.55 - */
174.56 - private SpreadGeneric(MethodType targetType, int spreadCount) {
174.57 - assert(targetType == targetType.generic());
174.58 - this.targetType = targetType;
174.59 - this.spreadCount = spreadCount;
174.60 - // the target invoker will generally need casts on reference arguments
174.61 - MethodHandle[] ep = { null };
174.62 - Adapter ad = findAdapter(this, ep);
174.63 - if (ad != null) {
174.64 - this.adapter = ad;
174.65 - this.entryPoint = ep[0];
174.66 - return;
174.67 - }
174.68 - this.adapter = buildAdapterFromBytecodes(targetType, spreadCount, ep);
174.69 - this.entryPoint = ep[0];
174.70 - }
174.71 -
174.72 - /** From targetType remove the last spreadCount arguments, and instead
174.73 - * append a simple Object argument.
174.74 - */
174.75 - static MethodType preSpreadType(MethodType targetType, int spreadCount) {
174.76 - @SuppressWarnings("unchecked")
174.77 - ArrayList<Class<?>> params = new ArrayList(targetType.parameterList());
174.78 - int outargs = params.size();
174.79 - params.subList(outargs - spreadCount, outargs).clear();
174.80 - params.add(Object.class);
174.81 - return MethodType.methodType(targetType.returnType(), params);
174.82 - }
174.83 -
174.84 - MethodHandle makeInstance(MethodHandle target) {
174.85 - MethodType type = target.type();
174.86 - if (type != targetType) {
174.87 - throw new UnsupportedOperationException("NYI type="+type);
174.88 - }
174.89 - return adapter.makeInstance(this, target);
174.90 - }
174.91 -
174.92 - /** Build an adapter of the given generic type, which invokes typedTarget
174.93 - * on the incoming arguments, after unboxing as necessary.
174.94 - * The return value is boxed if necessary.
174.95 - * @param genericType the required type of the result
174.96 - * @param typedTarget the target
174.97 - * @return an adapter method handle
174.98 - */
174.99 - public static MethodHandle make(MethodHandle target, int spreadCount) {
174.100 - MethodType type = target.type();
174.101 - MethodType gtype = type.generic();
174.102 - if (type == gtype) {
174.103 - return SpreadGeneric.of(type, spreadCount).makeInstance(target);
174.104 - } else {
174.105 - MethodHandle gtarget = FromGeneric.make(target);
174.106 - assert(gtarget.type() == gtype);
174.107 - MethodHandle gspread = SpreadGeneric.of(gtype, spreadCount).makeInstance(gtarget);
174.108 - return ToGeneric.make(preSpreadType(type, spreadCount), gspread);
174.109 - }
174.110 - }
174.111 -
174.112 - /** Return the adapter information for this type's erasure. */
174.113 - static SpreadGeneric of(MethodType targetType, int spreadCount) {
174.114 - if (targetType != targetType.generic())
174.115 - throw new UnsupportedOperationException("NYI type="+targetType);
174.116 - MethodTypeImpl form = MethodTypeImpl.of(targetType);
174.117 - int outcount = form.parameterCount();
174.118 - assert(spreadCount <= outcount);
174.119 - SpreadGeneric[] spreadGens = form.spreadGeneric;
174.120 - if (spreadGens == null)
174.121 - form.spreadGeneric = spreadGens = new SpreadGeneric[outcount+1];
174.122 - SpreadGeneric spreadGen = spreadGens[spreadCount];
174.123 - if (spreadGen == null)
174.124 - spreadGens[spreadCount] = spreadGen = new SpreadGeneric(form.erasedType(), spreadCount);
174.125 - return spreadGen;
174.126 - }
174.127 -
174.128 - public String toString() {
174.129 - return getClass().getSimpleName()+targetType+"["+spreadCount+"]";
174.130 - }
174.131 -
174.132 - // This mini-api is called from an Adapter to manage the spread.
174.133 - /** A check/coercion that happens once before any selections. */
174.134 - protected Object check(Object av, int n) {
174.135 - MethodHandleImpl.checkSpreadArgument(av, n);
174.136 - return av;
174.137 - }
174.138 -
174.139 - /** The selection operator for spreading; note that it takes Object not Object[]. */
174.140 - protected Object select(Object av, int n) {
174.141 - return ((Object[])av)[n];
174.142 - }
174.143 - /*
174.144 - protected int select_I(Object av, int n) {
174.145 - // maybe return ((int[])select)[n]
174.146 - throw new UnsupportedOperationException("subclass resp.");
174.147 - }
174.148 - protected int select_J(Object av, int n) {
174.149 - // maybe return ((long[])select)[n]
174.150 - throw new UnsupportedOperationException("subclass resp.");
174.151 - }
174.152 - // */
174.153 -
174.154 - /* Create an adapter that handles spreading calls for the given type. */
174.155 - static Adapter findAdapter(SpreadGeneric outer, MethodHandle[] ep) {
174.156 - MethodType targetType = outer.targetType;
174.157 - int spreadCount = outer.spreadCount;
174.158 - int outargs = targetType.parameterCount();
174.159 - int inargs = outargs - spreadCount;
174.160 - if (inargs < 0) return null;
174.161 - MethodType entryType = MethodType.genericMethodType(inargs + 1); // 1 for av
174.162 - String cname1 = "S" + outargs;
174.163 - String[] cnames = { cname1 };
174.164 - String iname = "invoke_S"+spreadCount;
174.165 - // e.g., D5I2, D5, L5I2, L5; invoke_D5
174.166 - for (String cname : cnames) {
174.167 - Class<? extends Adapter> acls = Adapter.findSubClass(cname);
174.168 - if (acls == null) continue;
174.169 - // see if it has the required invoke method
174.170 - MethodHandle entryPoint = null;
174.171 - try {
174.172 - entryPoint = MethodHandleImpl.IMPL_LOOKUP.findSpecial(acls, iname, entryType, acls);
174.173 - } catch (ReflectiveOperationException ex) {
174.174 - }
174.175 - if (entryPoint == null) continue;
174.176 - Constructor<? extends Adapter> ctor = null;
174.177 - try {
174.178 - ctor = acls.getDeclaredConstructor(SpreadGeneric.class);
174.179 - } catch (NoSuchMethodException ex) {
174.180 - } catch (SecurityException ex) {
174.181 - }
174.182 - if (ctor == null) continue;
174.183 - try {
174.184 - // Produce an instance configured as a prototype.
174.185 - Adapter ad = ctor.newInstance(outer);
174.186 - ep[0] = entryPoint;
174.187 - return ad;
174.188 - } catch (IllegalArgumentException ex) {
174.189 - } catch (InvocationTargetException wex) {
174.190 - Throwable ex = wex.getTargetException();
174.191 - if (ex instanceof Error) throw (Error)ex;
174.192 - if (ex instanceof RuntimeException) throw (RuntimeException)ex;
174.193 - } catch (InstantiationException ex) {
174.194 - } catch (IllegalAccessException ex) {
174.195 - }
174.196 - }
174.197 - return null;
174.198 - }
174.199 -
174.200 - static Adapter buildAdapterFromBytecodes(MethodType targetType,
174.201 - int spreadCount, MethodHandle[] ep) {
174.202 - throw new UnsupportedOperationException("NYI");
174.203 - }
174.204 -
174.205 - /**
174.206 - * This adapter takes some untyped arguments, and returns an untyped result.
174.207 - * Internally, it applies the invoker to the target, which causes the
174.208 - * objects to be unboxed; the result is a raw type in L/I/J/F/D.
174.209 - * This result is passed to convert, which is responsible for
174.210 - * converting the raw result into a boxed object.
174.211 - * The invoker is kept separate from the target because it can be
174.212 - * generated once per type erasure family, and reused across adapters.
174.213 - */
174.214 - static abstract class Adapter extends BoundMethodHandle {
174.215 - /*
174.216 - * class X<<R,int M,int N>> extends Adapter {
174.217 - * (Object**N)=>R target;
174.218 - * static int S = N-M;
174.219 - * Object invoke(Object**M a, Object v) = target(a..., v[0]...v[S-1]);
174.220 - * }
174.221 - */
174.222 - protected final SpreadGeneric outer;
174.223 - protected final MethodHandle target; // (any**N) => R
174.224 -
174.225 - @Override
174.226 - public String toString() {
174.227 - return MethodHandleImpl.addTypeString(target, this);
174.228 - }
174.229 -
174.230 - static final MethodHandle NO_ENTRY = ValueConversions.identity();
174.231 -
174.232 - protected boolean isPrototype() { return target == null; }
174.233 - protected Adapter(SpreadGeneric outer) {
174.234 - super(Access.TOKEN, NO_ENTRY);
174.235 - this.outer = outer;
174.236 - this.target = null;
174.237 - assert(isPrototype());
174.238 - }
174.239 -
174.240 - protected Adapter(SpreadGeneric outer, MethodHandle target) {
174.241 - super(Access.TOKEN, outer.entryPoint);
174.242 - this.outer = outer;
174.243 - this.target = target;
174.244 - }
174.245 -
174.246 - /** Make a copy of self, with new fields. */
174.247 - protected abstract Adapter makeInstance(SpreadGeneric outer, MethodHandle target);
174.248 - // { return new ThisType(outer, target); }
174.249 -
174.250 - protected Object check(Object av, int n) {
174.251 - return outer.check(av, n);
174.252 - }
174.253 - protected Object select(Object av, int n) {
174.254 - return outer.select(av, n);
174.255 - }
174.256 -
174.257 - static private final String CLASS_PREFIX; // "sun.dyn.SpreadGeneric$"
174.258 - static {
174.259 - String aname = Adapter.class.getName();
174.260 - String sname = Adapter.class.getSimpleName();
174.261 - if (!aname.endsWith(sname)) throw new InternalError();
174.262 - CLASS_PREFIX = aname.substring(0, aname.length() - sname.length());
174.263 - }
174.264 - /** Find a sibing class of Adapter. */
174.265 - static Class<? extends Adapter> findSubClass(String name) {
174.266 - String cname = Adapter.CLASS_PREFIX + name;
174.267 - try {
174.268 - return Class.forName(cname).asSubclass(Adapter.class);
174.269 - } catch (ClassNotFoundException ex) {
174.270 - return null;
174.271 - } catch (ClassCastException ex) {
174.272 - return null;
174.273 - }
174.274 - }
174.275 - }
174.276 -
174.277 - /* generated classes follow this pattern:
174.278 - static class xS2 extends Adapter {
174.279 - protected xS2(SpreadGeneric outer) { super(outer); } // to build prototype
174.280 - protected xS2(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
174.281 - protected xS2 makeInstance(SpreadGeneric outer, MethodHandle t) { return new xS2(outer, t); }
174.282 - protected Object invoke_S0(Object a0, Object a1, Object av) throws Throwable { av = super.check(av,0);
174.283 - return target.invokeExact(a0, a1)); }
174.284 - protected Object invoke_S1(Object a0, Object av) throws Throwable { av = super.check(av,1);
174.285 - return target.invokeExact(a0,
174.286 - super.select(av,0)); }
174.287 - protected Object invoke_S2(Object a0, Object av) throws Throwable { av = super.check(av,1);
174.288 - return target.invokeExact(
174.289 - super.select(av,0), super.select(av,1)); }
174.290 - }
174.291 - // */
174.292 -
174.293 -/*
174.294 -: SHELL; n=SpreadGeneric; cp -p $n.java $n.java-; sed < $n.java- > $n.java+ -e '/{{*{{/,/}}*}}/w /tmp/genclasses.java' -e '/}}*}}/q'; (cd /tmp; javac -d . genclasses.java; java -cp . genclasses) >> $n.java+; echo '}' >> $n.java+; mv $n.java+ $n.java; mv $n.java- $n.java~
174.295 -//{{{
174.296 -import java.util.*;
174.297 -class genclasses {
174.298 - static String[][] TEMPLATES = { {
174.299 - "@for@ N=0..10",
174.300 - " //@each-cat@",
174.301 - " static class @cat@ extends Adapter {",
174.302 - " protected @cat@(SpreadGeneric outer) { super(outer); } // to build prototype",
174.303 - " protected @cat@(SpreadGeneric outer, MethodHandle t) { super(outer, t); }",
174.304 - " protected @cat@ makeInstance(SpreadGeneric outer, MethodHandle t) { return new @cat@(outer, t); }",
174.305 - " protected Object invoke_S0(@Tvav,@Object av) throws Throwable { av = super.check(av, 0);",
174.306 - " return target.invokeExact(@av@); }",
174.307 - " //@each-S@",
174.308 - " protected Object invoke_S@S@(@Tvav,@Object av) throws Throwable { av = super.check(av, @S@);",
174.309 - " return target.invokeExact(@av,@@sv@); }",
174.310 - " //@end-S@",
174.311 - " }",
174.312 - } };
174.313 - static final String NEWLINE_INDENT = "\n ";
174.314 - enum VAR {
174.315 - cat, N, S, av, av_, Tvav_, sv;
174.316 - public final String pattern = "@"+toString().replace('_','.')+"@";
174.317 - public String binding = toString();
174.318 - static void makeBindings(boolean topLevel, int outargs, int spread) {
174.319 - int inargs = outargs - spread;
174.320 - VAR.cat.binding = "S"+outargs;
174.321 - VAR.N.binding = String.valueOf(outargs); // outgoing arg count
174.322 - VAR.S.binding = String.valueOf(spread); // spread count
174.323 - String[] av = new String[inargs];
174.324 - String[] Tvav = new String[inargs];
174.325 - for (int i = 0; i < inargs; i++) {
174.326 - av[i] = arg(i);
174.327 - Tvav[i] = param("Object", av[i]);
174.328 - }
174.329 - VAR.av.binding = comma(av);
174.330 - VAR.av_.binding = comma(av, ", ");
174.331 - VAR.Tvav_.binding = comma(Tvav, ", ");
174.332 - String[] sv = new String[spread];
174.333 - for (int i = 0; i < spread; i++) {
174.334 - String spc = "";
174.335 - if (i % 4 == 0) spc = NEWLINE_INDENT;
174.336 - sv[i] = spc+"super.select(av,"+i+")";
174.337 - }
174.338 - VAR.sv.binding = comma(sv);
174.339 - }
174.340 - static String arg(int i) { return "a"+i; }
174.341 - static String param(String t, String a) { return t+" "+a; }
174.342 - static String comma(String[] v) { return comma(v, ""); }
174.343 - static String comma(String[] v, String sep) {
174.344 - if (v.length == 0) return "";
174.345 - String res = v[0];
174.346 - for (int i = 1; i < v.length; i++) res += ", "+v[i];
174.347 - return res + sep;
174.348 - }
174.349 - static String transform(String string) {
174.350 - for (VAR var : values())
174.351 - string = string.replaceAll(var.pattern, var.binding);
174.352 - return string;
174.353 - }
174.354 - }
174.355 - static String[] stringsIn(String[] strings, int beg, int end) {
174.356 - return Arrays.copyOfRange(strings, beg, Math.min(end, strings.length));
174.357 - }
174.358 - static String[] stringsBefore(String[] strings, int pos) {
174.359 - return stringsIn(strings, 0, pos);
174.360 - }
174.361 - static String[] stringsAfter(String[] strings, int pos) {
174.362 - return stringsIn(strings, pos, strings.length);
174.363 - }
174.364 - static int indexAfter(String[] strings, int pos, String tag) {
174.365 - return Math.min(indexBefore(strings, pos, tag) + 1, strings.length);
174.366 - }
174.367 - static int indexBefore(String[] strings, int pos, String tag) {
174.368 - for (int i = pos, end = strings.length; ; i++) {
174.369 - if (i == end || strings[i].endsWith(tag)) return i;
174.370 - }
174.371 - }
174.372 - static int MIN_ARITY, MAX_ARITY;
174.373 - public static void main(String... av) {
174.374 - for (String[] template : TEMPLATES) {
174.375 - int forLinesLimit = indexBefore(template, 0, "@each-cat@");
174.376 - String[] forLines = stringsBefore(template, forLinesLimit);
174.377 - template = stringsAfter(template, forLinesLimit);
174.378 - for (String forLine : forLines)
174.379 - expandTemplate(forLine, template);
174.380 - }
174.381 - }
174.382 - static void expandTemplate(String forLine, String[] template) {
174.383 - String[] params = forLine.split("[^0-9]+");
174.384 - if (params[0].length() == 0) params = stringsAfter(params, 1);
174.385 - System.out.println("//params="+Arrays.asList(params));
174.386 - int pcur = 0;
174.387 - MIN_ARITY = Integer.valueOf(params[pcur++]);
174.388 - MAX_ARITY = Integer.valueOf(params[pcur++]);
174.389 - if (pcur != params.length) throw new RuntimeException("bad extra param: "+forLine);
174.390 - for (int outargs = MIN_ARITY; outargs <= MAX_ARITY; outargs++) {
174.391 - expandTemplate(template, true, outargs, 0);
174.392 - }
174.393 - }
174.394 - static void expandTemplate(String[] template, boolean topLevel, int outargs, int spread) {
174.395 - VAR.makeBindings(topLevel, outargs, spread);
174.396 - for (int i = 0; i < template.length; i++) {
174.397 - String line = template[i];
174.398 - if (line.endsWith("@each-cat@")) {
174.399 - // ignore
174.400 - } else if (line.endsWith("@each-S@")) {
174.401 - int blockEnd = indexAfter(template, i, "@end-S@");
174.402 - String[] block = stringsIn(template, i+1, blockEnd-1);
174.403 - for (int spread1 = spread+1; spread1 <= outargs; spread1++)
174.404 - expandTemplate(block, false, outargs, spread1);
174.405 - VAR.makeBindings(topLevel, outargs, spread);
174.406 - i = blockEnd-1; continue;
174.407 - } else {
174.408 - System.out.println(VAR.transform(line));
174.409 - }
174.410 - }
174.411 - }
174.412 -}
174.413 -//}}} */
174.414 -//params=[0, 10]
174.415 - static class S0 extends Adapter {
174.416 - protected S0(SpreadGeneric outer) { super(outer); } // to build prototype
174.417 - protected S0(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
174.418 - protected S0 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S0(outer, t); }
174.419 - protected Object invoke_S0(Object av) throws Throwable { av = super.check(av, 0);
174.420 - return target.invokeExact(); }
174.421 - }
174.422 - static class S1 extends Adapter {
174.423 - protected S1(SpreadGeneric outer) { super(outer); } // to build prototype
174.424 - protected S1(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
174.425 - protected S1 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S1(outer, t); }
174.426 - protected Object invoke_S0(Object a0, Object av) throws Throwable { av = super.check(av, 0);
174.427 - return target.invokeExact(a0); }
174.428 - protected Object invoke_S1(Object av) throws Throwable { av = super.check(av, 1);
174.429 - return target.invokeExact(
174.430 - super.select(av,0)); }
174.431 - }
174.432 - static class S2 extends Adapter {
174.433 - protected S2(SpreadGeneric outer) { super(outer); } // to build prototype
174.434 - protected S2(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
174.435 - protected S2 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S2(outer, t); }
174.436 - protected Object invoke_S0(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 0);
174.437 - return target.invokeExact(a0, a1); }
174.438 - protected Object invoke_S1(Object a0, Object av) throws Throwable { av = super.check(av, 1);
174.439 - return target.invokeExact(a0,
174.440 - super.select(av,0)); }
174.441 - protected Object invoke_S2(Object av) throws Throwable { av = super.check(av, 2);
174.442 - return target.invokeExact(
174.443 - super.select(av,0), super.select(av,1)); }
174.444 - }
174.445 - static class S3 extends Adapter {
174.446 - protected S3(SpreadGeneric outer) { super(outer); } // to build prototype
174.447 - protected S3(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
174.448 - protected S3 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S3(outer, t); }
174.449 - protected Object invoke_S0(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 0);
174.450 - return target.invokeExact(a0, a1, a2); }
174.451 - protected Object invoke_S1(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 1);
174.452 - return target.invokeExact(a0, a1,
174.453 - super.select(av,0)); }
174.454 - protected Object invoke_S2(Object a0, Object av) throws Throwable { av = super.check(av, 2);
174.455 - return target.invokeExact(a0,
174.456 - super.select(av,0), super.select(av,1)); }
174.457 - protected Object invoke_S3(Object av) throws Throwable { av = super.check(av, 3);
174.458 - return target.invokeExact(
174.459 - super.select(av,0), super.select(av,1), super.select(av,2)); }
174.460 - }
174.461 - static class S4 extends Adapter {
174.462 - protected S4(SpreadGeneric outer) { super(outer); } // to build prototype
174.463 - protected S4(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
174.464 - protected S4 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S4(outer, t); }
174.465 - protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 0);
174.466 - return target.invokeExact(a0, a1, a2, a3); }
174.467 - protected Object invoke_S1(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 1);
174.468 - return target.invokeExact(a0, a1, a2,
174.469 - super.select(av,0)); }
174.470 - protected Object invoke_S2(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 2);
174.471 - return target.invokeExact(a0, a1,
174.472 - super.select(av,0), super.select(av,1)); }
174.473 - protected Object invoke_S3(Object a0, Object av) throws Throwable { av = super.check(av, 3);
174.474 - return target.invokeExact(a0,
174.475 - super.select(av,0), super.select(av,1), super.select(av,2)); }
174.476 - protected Object invoke_S4(Object av) throws Throwable { av = super.check(av, 4);
174.477 - return target.invokeExact(
174.478 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
174.479 - }
174.480 - static class S5 extends Adapter {
174.481 - protected S5(SpreadGeneric outer) { super(outer); } // to build prototype
174.482 - protected S5(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
174.483 - protected S5 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S5(outer, t); }
174.484 - protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 0);
174.485 - return target.invokeExact(a0, a1, a2, a3, a4); }
174.486 - protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 1);
174.487 - return target.invokeExact(a0, a1, a2, a3,
174.488 - super.select(av,0)); }
174.489 - protected Object invoke_S2(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 2);
174.490 - return target.invokeExact(a0, a1, a2,
174.491 - super.select(av,0), super.select(av,1)); }
174.492 - protected Object invoke_S3(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 3);
174.493 - return target.invokeExact(a0, a1,
174.494 - super.select(av,0), super.select(av,1), super.select(av,2)); }
174.495 - protected Object invoke_S4(Object a0, Object av) throws Throwable { av = super.check(av, 4);
174.496 - return target.invokeExact(a0,
174.497 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
174.498 - protected Object invoke_S5(Object av) throws Throwable { av = super.check(av, 5);
174.499 - return target.invokeExact(
174.500 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.501 - super.select(av,4)); }
174.502 - }
174.503 - static class S6 extends Adapter {
174.504 - protected S6(SpreadGeneric outer) { super(outer); } // to build prototype
174.505 - protected S6(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
174.506 - protected S6 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S6(outer, t); }
174.507 - protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object av) throws Throwable { av = super.check(av, 0);
174.508 - return target.invokeExact(a0, a1, a2, a3, a4, a5); }
174.509 - protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 1);
174.510 - return target.invokeExact(a0, a1, a2, a3, a4,
174.511 - super.select(av,0)); }
174.512 - protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 2);
174.513 - return target.invokeExact(a0, a1, a2, a3,
174.514 - super.select(av,0), super.select(av,1)); }
174.515 - protected Object invoke_S3(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 3);
174.516 - return target.invokeExact(a0, a1, a2,
174.517 - super.select(av,0), super.select(av,1), super.select(av,2)); }
174.518 - protected Object invoke_S4(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 4);
174.519 - return target.invokeExact(a0, a1,
174.520 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
174.521 - protected Object invoke_S5(Object a0, Object av) throws Throwable { av = super.check(av, 5);
174.522 - return target.invokeExact(a0,
174.523 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.524 - super.select(av,4)); }
174.525 - protected Object invoke_S6(Object av) throws Throwable { av = super.check(av, 6);
174.526 - return target.invokeExact(
174.527 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.528 - super.select(av,4), super.select(av,5)); }
174.529 - }
174.530 - static class S7 extends Adapter {
174.531 - protected S7(SpreadGeneric outer) { super(outer); } // to build prototype
174.532 - protected S7(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
174.533 - protected S7 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S7(outer, t); }
174.534 - protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object av) throws Throwable { av = super.check(av, 0);
174.535 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6); }
174.536 - protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object av) throws Throwable { av = super.check(av, 1);
174.537 - return target.invokeExact(a0, a1, a2, a3, a4, a5,
174.538 - super.select(av,0)); }
174.539 - protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 2);
174.540 - return target.invokeExact(a0, a1, a2, a3, a4,
174.541 - super.select(av,0), super.select(av,1)); }
174.542 - protected Object invoke_S3(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 3);
174.543 - return target.invokeExact(a0, a1, a2, a3,
174.544 - super.select(av,0), super.select(av,1), super.select(av,2)); }
174.545 - protected Object invoke_S4(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 4);
174.546 - return target.invokeExact(a0, a1, a2,
174.547 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
174.548 - protected Object invoke_S5(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 5);
174.549 - return target.invokeExact(a0, a1,
174.550 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.551 - super.select(av,4)); }
174.552 - protected Object invoke_S6(Object a0, Object av) throws Throwable { av = super.check(av, 6);
174.553 - return target.invokeExact(a0,
174.554 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.555 - super.select(av,4), super.select(av,5)); }
174.556 - protected Object invoke_S7(Object av) throws Throwable { av = super.check(av, 7);
174.557 - return target.invokeExact(
174.558 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.559 - super.select(av,4), super.select(av,5), super.select(av,6)); }
174.560 - }
174.561 - static class S8 extends Adapter {
174.562 - protected S8(SpreadGeneric outer) { super(outer); } // to build prototype
174.563 - protected S8(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
174.564 - protected S8 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S8(outer, t); }
174.565 - protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object av) throws Throwable { av = super.check(av, 0);
174.566 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7); }
174.567 - protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object av) throws Throwable { av = super.check(av, 1);
174.568 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6,
174.569 - super.select(av,0)); }
174.570 - protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object av) throws Throwable { av = super.check(av, 2);
174.571 - return target.invokeExact(a0, a1, a2, a3, a4, a5,
174.572 - super.select(av,0), super.select(av,1)); }
174.573 - protected Object invoke_S3(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 3);
174.574 - return target.invokeExact(a0, a1, a2, a3, a4,
174.575 - super.select(av,0), super.select(av,1), super.select(av,2)); }
174.576 - protected Object invoke_S4(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 4);
174.577 - return target.invokeExact(a0, a1, a2, a3,
174.578 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
174.579 - protected Object invoke_S5(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 5);
174.580 - return target.invokeExact(a0, a1, a2,
174.581 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.582 - super.select(av,4)); }
174.583 - protected Object invoke_S6(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 6);
174.584 - return target.invokeExact(a0, a1,
174.585 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.586 - super.select(av,4), super.select(av,5)); }
174.587 - protected Object invoke_S7(Object a0, Object av) throws Throwable { av = super.check(av, 7);
174.588 - return target.invokeExact(a0,
174.589 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.590 - super.select(av,4), super.select(av,5), super.select(av,6)); }
174.591 - protected Object invoke_S8(Object av) throws Throwable { av = super.check(av, 8);
174.592 - return target.invokeExact(
174.593 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.594 - super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7)); }
174.595 - }
174.596 - static class S9 extends Adapter {
174.597 - protected S9(SpreadGeneric outer) { super(outer); } // to build prototype
174.598 - protected S9(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
174.599 - protected S9 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S9(outer, t); }
174.600 - protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object av) throws Throwable { av = super.check(av, 0);
174.601 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
174.602 - protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object av) throws Throwable { av = super.check(av, 1);
174.603 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7,
174.604 - super.select(av,0)); }
174.605 - protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object av) throws Throwable { av = super.check(av, 2);
174.606 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6,
174.607 - super.select(av,0), super.select(av,1)); }
174.608 - protected Object invoke_S3(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object av) throws Throwable { av = super.check(av, 3);
174.609 - return target.invokeExact(a0, a1, a2, a3, a4, a5,
174.610 - super.select(av,0), super.select(av,1), super.select(av,2)); }
174.611 - protected Object invoke_S4(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 4);
174.612 - return target.invokeExact(a0, a1, a2, a3, a4,
174.613 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
174.614 - protected Object invoke_S5(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 5);
174.615 - return target.invokeExact(a0, a1, a2, a3,
174.616 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.617 - super.select(av,4)); }
174.618 - protected Object invoke_S6(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 6);
174.619 - return target.invokeExact(a0, a1, a2,
174.620 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.621 - super.select(av,4), super.select(av,5)); }
174.622 - protected Object invoke_S7(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 7);
174.623 - return target.invokeExact(a0, a1,
174.624 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.625 - super.select(av,4), super.select(av,5), super.select(av,6)); }
174.626 - protected Object invoke_S8(Object a0, Object av) throws Throwable { av = super.check(av, 8);
174.627 - return target.invokeExact(a0,
174.628 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.629 - super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7)); }
174.630 - protected Object invoke_S9(Object av) throws Throwable { av = super.check(av, 9);
174.631 - return target.invokeExact(
174.632 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.633 - super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7),
174.634 - super.select(av,8)); }
174.635 - }
174.636 - static class S10 extends Adapter {
174.637 - protected S10(SpreadGeneric outer) { super(outer); } // to build prototype
174.638 - protected S10(SpreadGeneric outer, MethodHandle t) { super(outer, t); }
174.639 - protected S10 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S10(outer, t); }
174.640 - protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9, Object av) throws Throwable { av = super.check(av, 0);
174.641 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
174.642 - protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object av) throws Throwable { av = super.check(av, 1);
174.643 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7, a8,
174.644 - super.select(av,0)); }
174.645 - protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object av) throws Throwable { av = super.check(av, 2);
174.646 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6, a7,
174.647 - super.select(av,0), super.select(av,1)); }
174.648 - protected Object invoke_S3(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object av) throws Throwable { av = super.check(av, 3);
174.649 - return target.invokeExact(a0, a1, a2, a3, a4, a5, a6,
174.650 - super.select(av,0), super.select(av,1), super.select(av,2)); }
174.651 - protected Object invoke_S4(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object av) throws Throwable { av = super.check(av, 4);
174.652 - return target.invokeExact(a0, a1, a2, a3, a4, a5,
174.653 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
174.654 - protected Object invoke_S5(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 5);
174.655 - return target.invokeExact(a0, a1, a2, a3, a4,
174.656 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.657 - super.select(av,4)); }
174.658 - protected Object invoke_S6(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 6);
174.659 - return target.invokeExact(a0, a1, a2, a3,
174.660 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.661 - super.select(av,4), super.select(av,5)); }
174.662 - protected Object invoke_S7(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 7);
174.663 - return target.invokeExact(a0, a1, a2,
174.664 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.665 - super.select(av,4), super.select(av,5), super.select(av,6)); }
174.666 - protected Object invoke_S8(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 8);
174.667 - return target.invokeExact(a0, a1,
174.668 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.669 - super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7)); }
174.670 - protected Object invoke_S9(Object a0, Object av) throws Throwable { av = super.check(av, 9);
174.671 - return target.invokeExact(a0,
174.672 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.673 - super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7),
174.674 - super.select(av,8)); }
174.675 - protected Object invoke_S10(Object av) throws Throwable { av = super.check(av, 10);
174.676 - return target.invokeExact(
174.677 - super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
174.678 - super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7),
174.679 - super.select(av,8), super.select(av,9)); }
174.680 - }
174.681 -}
175.1 --- a/src/share/classes/sun/dyn/ToGeneric.java Tue Mar 29 11:29:01 2011 -0700
175.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
175.3 @@ -1,1042 +0,0 @@
175.4 -/*
175.5 - * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
175.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
175.7 - *
175.8 - * This code is free software; you can redistribute it and/or modify it
175.9 - * under the terms of the GNU General Public License version 2 only, as
175.10 - * published by the Free Software Foundation. Oracle designates this
175.11 - * particular file as subject to the "Classpath" exception as provided
175.12 - * by Oracle in the LICENSE file that accompanied this code.
175.13 - *
175.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
175.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
175.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
175.17 - * version 2 for more details (a copy is included in the LICENSE file that
175.18 - * accompanied this code).
175.19 - *
175.20 - * You should have received a copy of the GNU General Public License version
175.21 - * 2 along with this work; if not, write to the Free Software Foundation,
175.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
175.23 - *
175.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
175.25 - * or visit www.oracle.com if you need additional information or have any
175.26 - * questions.
175.27 - */
175.28 -
175.29 -package sun.dyn;
175.30 -
175.31 -import java.dyn.*;
175.32 -import java.lang.reflect.Constructor;
175.33 -import java.lang.reflect.InvocationTargetException;
175.34 -import sun.dyn.util.ValueConversions;
175.35 -import sun.dyn.util.Wrapper;
175.36 -import static sun.dyn.MemberName.newIllegalArgumentException;
175.37 -import static sun.dyn.MethodTypeImpl.invokers;
175.38 -
175.39 -/**
175.40 - * Adapters which mediate between incoming calls which are not generic
175.41 - * and outgoing calls which are. Any call can be represented generically
175.42 - * boxing up its arguments, and (on return) unboxing the return value.
175.43 - * <p>
175.44 - * A call is "generic" (in MethodHandle terms) if its MethodType features
175.45 - * only Object arguments. A non-generic call therefore features
175.46 - * primitives and/or reference types other than Object.
175.47 - * An adapter has types for its incoming and outgoing calls.
175.48 - * The incoming call type is simply determined by the adapter's type
175.49 - * (the MethodType it presents to callers). The outgoing call type
175.50 - * is determined by the adapter's target (a MethodHandle that the adapter
175.51 - * either binds internally or else takes as a leading argument).
175.52 - * (To stretch the term, adapter-like method handles may have multiple
175.53 - * targets or be polymorphic across multiple call types.)
175.54 - * @author jrose
175.55 - */
175.56 -class ToGeneric {
175.57 - // type for the incoming call (may be erased)
175.58 - private final MethodType entryType;
175.59 - // incoming type with primitives moved to the end and turned to int/long
175.60 - private final MethodType rawEntryType;
175.61 - // adapter for the erased type
175.62 - private final Adapter adapter;
175.63 - // entry point for adapter (Adapter mh, a...) => ...
175.64 - private final MethodHandle entryPoint;
175.65 - // permutation of arguments for primsAtEndType
175.66 - private final int[] primsAtEndOrder;
175.67 - // optional final argument list conversions (at least, invokes the target)
175.68 - private final MethodHandle invoker;
175.69 - // conversion which unboxes a primitive return value
175.70 - private final MethodHandle returnConversion;
175.71 -
175.72 - /** Compute and cache information common to all generifying (boxing) adapters
175.73 - * that implement members of the erasure-family of the given erased type.
175.74 - */
175.75 - private ToGeneric(MethodType entryType) {
175.76 - assert(entryType.erase() == entryType); // for now
175.77 - // incoming call will first "forget" all reference types except Object
175.78 - this.entryType = entryType;
175.79 - MethodHandle invoker0 = invokers(entryType.generic()).exactInvoker();
175.80 - MethodType rawEntryTypeInit;
175.81 - Adapter ad = findAdapter(rawEntryTypeInit = entryType);
175.82 - if (ad != null) {
175.83 - // Immediate hit to exactly the adapter we want,
175.84 - // with no monkeying around with primitive types.
175.85 - this.returnConversion = computeReturnConversion(entryType, rawEntryTypeInit, false);
175.86 - this.rawEntryType = rawEntryTypeInit;
175.87 - this.adapter = ad;
175.88 - this.entryPoint = ad.prototypeEntryPoint();
175.89 - this.primsAtEndOrder = null;
175.90 - this.invoker = invoker0;
175.91 - return;
175.92 - }
175.93 -
175.94 - // next, it will reorder primitives after references
175.95 - MethodType primsAtEnd = MethodTypeImpl.of(entryType).primsAtEnd();
175.96 - // at the same time, it will "forget" all primitive types except int/long
175.97 - this.primsAtEndOrder = MethodTypeImpl.primsAtEndOrder(entryType);
175.98 - if (primsAtEndOrder != null) {
175.99 - // reordering is required; build on top of a simpler ToGeneric
175.100 - ToGeneric va2 = ToGeneric.of(primsAtEnd);
175.101 - this.adapter = va2.adapter;
175.102 - if (true) throw new UnsupportedOperationException("NYI: primitive parameters must follow references; entryType = "+entryType);
175.103 - this.entryPoint = MethodHandleImpl.convertArguments(Access.TOKEN,
175.104 - va2.entryPoint, primsAtEnd, entryType, primsAtEndOrder);
175.105 - // example: for entryType of (int,Object,Object), the reordered
175.106 - // type is (Object,Object,int) and the order is {1,2,0},
175.107 - // and putPAE is (mh,int0,obj1,obj2) => mh.invokeExact(obj1,obj2,int0)
175.108 - return;
175.109 - }
175.110 -
175.111 - // after any needed argument reordering, it will reinterpret
175.112 - // primitive arguments according to their "raw" types int/long
175.113 - MethodType intsAtEnd = MethodTypeImpl.of(primsAtEnd).primsAsInts();
175.114 - ad = findAdapter(rawEntryTypeInit = intsAtEnd);
175.115 - MethodHandle rawEntryPoint;
175.116 - if (ad != null) {
175.117 - rawEntryPoint = ad.prototypeEntryPoint();
175.118 - } else {
175.119 - // Perhaps the adapter is available only for longs.
175.120 - // If so, we can use it, but there will have to be a little
175.121 - // more stack motion on each call.
175.122 - MethodType longsAtEnd = MethodTypeImpl.of(primsAtEnd).primsAsLongs();
175.123 - ad = findAdapter(rawEntryTypeInit = longsAtEnd);
175.124 - if (ad != null) {
175.125 - MethodType eptWithLongs = longsAtEnd.insertParameterTypes(0, ad.getClass());
175.126 - MethodType eptWithInts = intsAtEnd.insertParameterTypes(0, ad.getClass());
175.127 - rawEntryPoint = ad.prototypeEntryPoint();
175.128 - MethodType midType = eptWithLongs; // will change longs to ints
175.129 - for (int i = 0, nargs = midType.parameterCount(); i < nargs; i++) {
175.130 - if (midType.parameterType(i) != eptWithInts.parameterType(i)) {
175.131 - assert(midType.parameterType(i) == long.class);
175.132 - assert(eptWithInts.parameterType(i) == int.class);
175.133 - MethodType nextType = midType.changeParameterType(i, int.class);
175.134 - rawEntryPoint = MethodHandle.convertArguments(Access.TOKEN,
175.135 - rawEntryPoint, nextType, midType, null);
175.136 - midType = nextType;
175.137 - }
175.138 - }
175.139 - assert(midType == eptWithInts);
175.140 - } else {
175.141 - // If there is no statically compiled adapter,
175.142 - // build one by means of dynamic bytecode generation.
175.143 - ad = buildAdapterFromBytecodes(rawEntryTypeInit = intsAtEnd);
175.144 - rawEntryPoint = ad.prototypeEntryPoint();
175.145 - }
175.146 - }
175.147 - MethodType tepType = entryType.insertParameterTypes(0, ad.getClass());
175.148 - this.entryPoint =
175.149 - AdapterMethodHandle.makeRetypeRaw(Access.TOKEN, tepType, rawEntryPoint);
175.150 - if (this.entryPoint == null)
175.151 - throw new UnsupportedOperationException("cannot retype to "+entryType
175.152 - +" from "+rawEntryPoint.type().dropParameterTypes(0, 1));
175.153 - this.returnConversion = computeReturnConversion(entryType, rawEntryTypeInit, false);
175.154 - this.rawEntryType = rawEntryTypeInit;
175.155 - this.adapter = ad;
175.156 - this.invoker = makeRawArgumentFilter(invoker0, rawEntryTypeInit, entryType);
175.157 - }
175.158 -
175.159 - /** A generic argument list will be created by a call of type 'raw'.
175.160 - * The values need to be reboxed for to match 'cooked'.
175.161 - * Do this on the fly.
175.162 - */
175.163 - // TO DO: Use a generic argument converter in a different file
175.164 - static MethodHandle makeRawArgumentFilter(MethodHandle invoker,
175.165 - MethodType raw, MethodType cooked) {
175.166 - MethodHandle filteredInvoker = null;
175.167 - for (int i = 0, nargs = raw.parameterCount(); i < nargs; i++) {
175.168 - Class<?> src = raw.parameterType(i);
175.169 - Class<?> dst = cooked.parameterType(i);
175.170 - if (src == dst) continue;
175.171 - assert(src.isPrimitive() && dst.isPrimitive());
175.172 - if (filteredInvoker == null) {
175.173 - filteredInvoker =
175.174 - AdapterMethodHandle.makeCheckCast(Access.TOKEN,
175.175 - invoker.type().generic(), invoker, 0, MethodHandle.class);
175.176 - if (filteredInvoker == null) throw new UnsupportedOperationException("NYI");
175.177 - }
175.178 - MethodHandle reboxer = ValueConversions.rebox(dst, false);
175.179 - filteredInvoker = FilterGeneric.makeArgumentFilter(1+i, reboxer, filteredInvoker);
175.180 - if (filteredInvoker == null) throw new InternalError();
175.181 - }
175.182 - if (filteredInvoker == null) return invoker;
175.183 - return AdapterMethodHandle.makeRetypeOnly(Access.TOKEN, invoker.type(), filteredInvoker);
175.184 - }
175.185 -
175.186 - /**
175.187 - * Caller will be expecting a result from a call to {@code type},
175.188 - * while the internal adapter entry point is rawEntryType.
175.189 - * Also, the internal target method will be returning a boxed value,
175.190 - * as an untyped object.
175.191 - * <p>
175.192 - * Produce a value converter which will be typed to convert from
175.193 - * {@code Object} to the return value of {@code rawEntryType}, and will
175.194 - * in fact ensure that the value is compatible with the return type of
175.195 - * {@code type}.
175.196 - */
175.197 - private static MethodHandle computeReturnConversion(
175.198 - MethodType type, MethodType rawEntryType, boolean mustCast) {
175.199 - Class<?> tret = type.returnType();
175.200 - Class<?> rret = rawEntryType.returnType();
175.201 - if (mustCast || !tret.isPrimitive()) {
175.202 - assert(!tret.isPrimitive());
175.203 - assert(!rret.isPrimitive());
175.204 - if (rret == Object.class && !mustCast)
175.205 - return null;
175.206 - return ValueConversions.cast(tret, false);
175.207 - } else if (tret == rret) {
175.208 - return ValueConversions.unbox(tret, false);
175.209 - } else {
175.210 - assert(rret.isPrimitive());
175.211 - assert(tret == double.class ? rret == long.class : rret == int.class);
175.212 - return ValueConversions.unboxRaw(tret, false);
175.213 - }
175.214 - }
175.215 -
175.216 - Adapter makeInstance(MethodType type, MethodHandle genericTarget) {
175.217 - genericTarget.getClass(); // check for NPE
175.218 - MethodHandle convert = returnConversion;
175.219 - if (primsAtEndOrder != null)
175.220 - // reorder arguments passed to genericTarget, if primsAtEndOrder
175.221 - throw new UnsupportedOperationException("NYI");
175.222 - if (type == entryType) {
175.223 - if (convert == null) convert = ValueConversions.identity();
175.224 - return adapter.makeInstance(entryPoint, invoker, convert, genericTarget);
175.225 - }
175.226 - // my erased-type is not exactly the same as the desired type
175.227 - assert(type.erase() == entryType); // else we are busted
175.228 - if (convert == null)
175.229 - convert = computeReturnConversion(type, rawEntryType, true);
175.230 - // retype erased reference arguments (the cast makes it safe to do this)
175.231 - MethodType tepType = type.insertParameterTypes(0, adapter.getClass());
175.232 - MethodHandle typedEntryPoint =
175.233 - AdapterMethodHandle.makeRetypeRaw(Access.TOKEN, tepType, entryPoint);
175.234 - return adapter.makeInstance(typedEntryPoint, invoker, convert, genericTarget);
175.235 - }
175.236 -
175.237 - /** Build an adapter of the given type, which invokes genericTarget
175.238 - * on the incoming arguments, after boxing as necessary.
175.239 - * The return value is unboxed if necessary.
175.240 - * @param type the required type of the
175.241 - * @param genericTarget the target, which must accept and return only Object values
175.242 - * @return an adapter method handle
175.243 - */
175.244 - public static MethodHandle make(MethodType type, MethodHandle genericTarget) {
175.245 - MethodType gtype = genericTarget.type();
175.246 - if (type.generic() != gtype)
175.247 - throw newIllegalArgumentException("type must be generic");
175.248 - if (type == gtype) return genericTarget;
175.249 - return ToGeneric.of(type).makeInstance(type, genericTarget);
175.250 - }
175.251 -
175.252 - /** Return the adapter information for this type's erasure. */
175.253 - static ToGeneric of(MethodType type) {
175.254 - MethodTypeImpl form = MethodTypeImpl.of(type);
175.255 - ToGeneric toGen = form.toGeneric;
175.256 - if (toGen == null)
175.257 - form.toGeneric = toGen = new ToGeneric(form.erasedType());
175.258 - return toGen;
175.259 - }
175.260 -
175.261 - public String toString() {
175.262 - return "ToGeneric"+entryType
175.263 - +(primsAtEndOrder!=null?"[reorder]":"");
175.264 - }
175.265 -
175.266 - /* Create an adapter for the given incoming call type. */
175.267 - static Adapter findAdapter(MethodType entryPointType) {
175.268 - MethodTypeImpl form = MethodTypeImpl.of(entryPointType);
175.269 - Class<?> rtype = entryPointType.returnType();
175.270 - int argc = form.parameterCount();
175.271 - int lac = form.longPrimitiveParameterCount();
175.272 - int iac = form.primitiveParameterCount() - lac;
175.273 - String intsAndLongs = (iac > 0 ? "I"+iac : "")+(lac > 0 ? "J"+lac : "");
175.274 - String rawReturn = String.valueOf(Wrapper.forPrimitiveType(rtype).basicTypeChar());
175.275 - String iname0 = "invoke_"+rawReturn;
175.276 - String iname1 = "invoke";
175.277 - String[] inames = { iname0, iname1 };
175.278 - String cname0 = rawReturn + argc;
175.279 - String cname1 = "A" + argc;
175.280 - String[] cnames = { cname1, cname1+intsAndLongs, cname0, cname0+intsAndLongs };
175.281 - // e.g., D5I2, D5, L5I2, L5
175.282 - for (String cname : cnames) {
175.283 - Class<? extends Adapter> acls = Adapter.findSubClass(cname);
175.284 - if (acls == null) continue;
175.285 - // see if it has the required invoke method
175.286 - for (String iname : inames) {
175.287 - MethodHandle entryPoint = null;
175.288 - try {
175.289 - entryPoint = MethodHandleImpl.IMPL_LOOKUP.
175.290 - findSpecial(acls, iname, entryPointType, acls);
175.291 - } catch (ReflectiveOperationException ex) {
175.292 - }
175.293 - if (entryPoint == null) continue;
175.294 - Constructor<? extends Adapter> ctor = null;
175.295 - try {
175.296 - // Prototype builder:
175.297 - ctor = acls.getDeclaredConstructor(MethodHandle.class);
175.298 - } catch (NoSuchMethodException ex) {
175.299 - } catch (SecurityException ex) {
175.300 - }
175.301 - if (ctor == null) continue;
175.302 - try {
175.303 - return ctor.newInstance(entryPoint);
175.304 - } catch (IllegalArgumentException ex) {
175.305 - } catch (InvocationTargetException wex) {
175.306 - Throwable ex = wex.getTargetException();
175.307 - if (ex instanceof Error) throw (Error)ex;
175.308 - if (ex instanceof RuntimeException) throw (RuntimeException)ex;
175.309 - } catch (InstantiationException ex) {
175.310 - } catch (IllegalAccessException ex) {
175.311 - }
175.312 - }
175.313 - }
175.314 - return null;
175.315 - }
175.316 -
175.317 - static Adapter buildAdapterFromBytecodes(MethodType entryPointType) {
175.318 - throw new UnsupportedOperationException("NYI");
175.319 - }
175.320 -
175.321 - /**
175.322 - * The invoke method takes some particular but unconstrained spread
175.323 - * of raw argument types, and returns a raw return type (in L/I/J/F/D).
175.324 - * Internally, it converts the incoming arguments uniformly into objects.
175.325 - * This series of objects is then passed to the {@code target} method,
175.326 - * which returns a result object. This result is finally converted,
175.327 - * via another method handle {@code convert}, which is responsible for
175.328 - * converting the object result into the raw return value.
175.329 - */
175.330 - static abstract class Adapter extends BoundMethodHandle {
175.331 - /*
175.332 - * class X<<R,A...>> extends Adapter {
175.333 - * Object...=>Object target;
175.334 - * Object=>R convert;
175.335 - * R invoke(A... a...) = convert(invoker(target, a...)))
175.336 - * }
175.337 - */
175.338 - protected final MethodHandle invoker; // (MH, Object...) -> Object
175.339 - protected final MethodHandle target; // Object... -> Object
175.340 - protected final MethodHandle convert; // Object -> R
175.341 -
175.342 - @Override
175.343 - public String toString() {
175.344 - return target == null ? "prototype:"+convert : MethodHandleImpl.addTypeString(target, this);
175.345 - }
175.346 -
175.347 - protected boolean isPrototype() { return target == null; }
175.348 - /* Prototype constructor. */
175.349 - protected Adapter(MethodHandle entryPoint) {
175.350 - super(Access.TOKEN, entryPoint);
175.351 - this.invoker = null;
175.352 - this.convert = entryPoint;
175.353 - this.target = null;
175.354 - assert(isPrototype());
175.355 - }
175.356 - protected MethodHandle prototypeEntryPoint() {
175.357 - if (!isPrototype()) throw new InternalError();
175.358 - return convert;
175.359 - }
175.360 -
175.361 - protected Adapter(MethodHandle entryPoint, MethodHandle invoker, MethodHandle convert, MethodHandle target) {
175.362 - super(Access.TOKEN, entryPoint);
175.363 - this.invoker = invoker;
175.364 - this.convert = convert;
175.365 - this.target = target;
175.366 - }
175.367 -
175.368 - /** Make a copy of self, with new fields. */
175.369 - protected abstract Adapter makeInstance(MethodHandle entryPoint,
175.370 - MethodHandle invoker, MethodHandle convert, MethodHandle target);
175.371 - // { return new ThisType(entryPoint, convert, target); }
175.372 -
175.373 - // Code to run when the arguments (<= 4) have all been boxed.
175.374 - protected Object target() throws Throwable { return invoker.invokeExact(target); }
175.375 - protected Object target(Object a0) throws Throwable { return invoker.invokeExact(target, a0); }
175.376 - protected Object target(Object a0, Object a1)
175.377 - throws Throwable { return invoker.invokeExact(target, a0, a1); }
175.378 - protected Object target(Object a0, Object a1, Object a2)
175.379 - throws Throwable { return invoker.invokeExact(target, a0, a1, a2); }
175.380 - protected Object target(Object a0, Object a1, Object a2, Object a3)
175.381 - throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3); }
175.382 - /*
175.383 - protected Object target_0(Object... av) throws Throwable { return invoker.invokeExact(target, av); }
175.384 - protected Object target_1(Object a0, Object... av)
175.385 - throws Throwable { return invoker.invokeExact(target, a0, (Object)av); }
175.386 - protected Object target_2(Object a0, Object a1, Object... av)
175.387 - throws Throwable { return invoker.invokeExact(target, a0, a1, (Object)av); }
175.388 - protected Object target_3(Object a0, Object a1, Object a2, Object... av)
175.389 - throws Throwable { return invoker.invokeExact(target, a0, a1, a2, (Object)av); }
175.390 - protected Object target_4(Object a0, Object a1, Object a2, Object a3, Object... av)
175.391 - throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, (Object)av); }
175.392 - // */
175.393 - // (For more than 4 arguments, generate the code in the adapter itself.)
175.394 -
175.395 - // Code to run when the generic target has finished and produced a value.
175.396 - protected Object return_L(Object res) throws Throwable { return (Object)convert.invokeExact(res); }
175.397 - protected int return_I(Object res) throws Throwable { return (int) convert.invokeExact(res); }
175.398 - protected long return_J(Object res) throws Throwable { return (long) convert.invokeExact(res); }
175.399 - protected float return_F(Object res) throws Throwable { return (float) convert.invokeExact(res); }
175.400 - protected double return_D(Object res) throws Throwable { return (double)convert.invokeExact(res); }
175.401 -
175.402 - static private final String CLASS_PREFIX; // "sun.dyn.ToGeneric$"
175.403 - static {
175.404 - String aname = Adapter.class.getName();
175.405 - String sname = Adapter.class.getSimpleName();
175.406 - if (!aname.endsWith(sname)) throw new InternalError();
175.407 - CLASS_PREFIX = aname.substring(0, aname.length() - sname.length());
175.408 - }
175.409 - /** Find a sibing class of Adapter. */
175.410 - static Class<? extends Adapter> findSubClass(String name) {
175.411 - String cname = Adapter.CLASS_PREFIX + name;
175.412 - try {
175.413 - return Class.forName(cname).asSubclass(Adapter.class);
175.414 - } catch (ClassNotFoundException ex) {
175.415 - return null;
175.416 - } catch (ClassCastException ex) {
175.417 - return null;
175.418 - }
175.419 - }
175.420 - }
175.421 -
175.422 - /* generated classes follow this pattern:
175.423 - static class A1 extends Adapter {
175.424 - protected A1(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
175.425 - protected A1(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
175.426 - protected A1 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A1(e, i, c, t); }
175.427 - protected Object target(Object a0) throws Throwable { return invoker.invokeExact(target, a0); }
175.428 - protected Object targetA1(Object a0) throws Throwable { return target(a0); }
175.429 - protected Object targetA1(int a0) throws Throwable { return target(a0); }
175.430 - protected Object targetA1(long a0) throws Throwable { return target(a0); }
175.431 - protected Object invoke_L(Object a0) throws Throwable { return return_L(targetA1(a0)); }
175.432 - protected int invoke_I(Object a0) throws Throwable { return return_I(targetA1(a0)); }
175.433 - protected long invoke_J(Object a0) throws Throwable { return return_J(targetA1(a0)); }
175.434 - protected float invoke_F(Object a0) throws Throwable { return return_F(targetA1(a0)); }
175.435 - protected double invoke_D(Object a0) throws Throwable { return return_D(targetA1(a0)); }
175.436 - protected Object invoke_L(int a0) throws Throwable { return return_L(targetA1(a0)); }
175.437 - protected int invoke_I(int a0) throws Throwable { return return_I(targetA1(a0)); }
175.438 - protected long invoke_J(int a0) throws Throwable { return return_J(targetA1(a0)); }
175.439 - protected float invoke_F(int a0) throws Throwable { return return_F(targetA1(a0)); }
175.440 - protected double invoke_D(int a0) throws Throwable { return return_D(targetA1(a0)); }
175.441 - protected Object invoke_L(long a0) throws Throwable { return return_L(targetA1(a0)); }
175.442 - protected int invoke_I(long a0) throws Throwable { return return_I(targetA1(a0)); }
175.443 - protected long invoke_J(long a0) throws Throwable { return return_J(targetA1(a0)); }
175.444 - protected float invoke_F(long a0) throws Throwable { return return_F(targetA1(a0)); }
175.445 - protected double invoke_D(long a0) throws Throwable { return return_D(targetA1(a0)); }
175.446 - }
175.447 - // */
175.448 -
175.449 -/*
175.450 -: SHELL; n=ToGeneric; cp -p $n.java $n.java-; sed < $n.java- > $n.java+ -e '/{{*{{/,/}}*}}/w /tmp/genclasses.java' -e '/}}*}}/q'; (cd /tmp; javac -d . genclasses.java; java -cp . genclasses) >> $n.java+; echo '}' >> $n.java+; mv $n.java+ $n.java; mv $n.java- $n.java~
175.451 -//{{{
175.452 -import java.util.*;
175.453 -class genclasses {
175.454 - static String[] TYPES = { "Object", "int ", "long ", "float ", "double" };
175.455 - static String[] TCHARS = { "L", "I", "J", "F", "D", "A" };
175.456 - static String[][] TEMPLATES = { {
175.457 - "@for@ arity=0..3 rcat<=4 nrefs<=99 nints<=99 nlongs<=99",
175.458 - "@for@ arity=4..5 rcat<=2 nrefs<=99 nints<=99 nlongs<=99",
175.459 - "@for@ arity=6..10 rcat<=2 nrefs<=99 nints=0 nlongs<=99",
175.460 - " //@each-cat@",
175.461 - " static class @cat@ extends Adapter {",
175.462 - " protected @cat@(MethodHandle entryPoint) { super(entryPoint); } // to build prototype",
175.463 - " protected @cat@(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }",
175.464 - " protected @cat@ makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new @cat@(e, i, c, t); }",
175.465 - " protected Object target(@Ovav@) throws Throwable { return invoker.invokeExact(target, @av@); }",
175.466 - " //@each-Tv@",
175.467 - " protected Object target@cat@(@Tvav@) throws Throwable { return target(@av@); }",
175.468 - " //@end-Tv@",
175.469 - " //@each-Tv@",
175.470 - " //@each-R@",
175.471 - " protected @R@ invoke_@Rc@(@Tvav@) throws Throwable { return return_@Rc@(target@cat@(@av@)); }",
175.472 - " //@end-R@",
175.473 - " //@end-Tv@",
175.474 - " }",
175.475 - } };
175.476 - enum VAR {
175.477 - cat, R, Rc, Tv, av, Tvav, Ovav;
175.478 - public final String pattern = "@"+toString().replace('_','.')+"@";
175.479 - public String binding;
175.480 - static void makeBindings(boolean topLevel, int rcat, int nrefs, int nints, int nlongs) {
175.481 - int nargs = nrefs + nints + nlongs;
175.482 - if (topLevel)
175.483 - VAR.cat.binding = catstr(ALL_RETURN_TYPES ? TYPES.length : rcat, nrefs, nints, nlongs);
175.484 - VAR.R.binding = TYPES[rcat];
175.485 - VAR.Rc.binding = TCHARS[rcat];
175.486 - String[] Tv = new String[nargs];
175.487 - String[] av = new String[nargs];
175.488 - String[] Tvav = new String[nargs];
175.489 - String[] Ovav = new String[nargs];
175.490 - for (int i = 0; i < nargs; i++) {
175.491 - int tcat = (i < nrefs) ? 0 : (i < nrefs + nints) ? 1 : 2;
175.492 - Tv[i] = TYPES[tcat];
175.493 - av[i] = arg(i);
175.494 - Tvav[i] = param(Tv[i], av[i]);
175.495 - Ovav[i] = param("Object", av[i]);
175.496 - }
175.497 - VAR.Tv.binding = comma(Tv);
175.498 - VAR.av.binding = comma(av);
175.499 - VAR.Tvav.binding = comma(Tvav);
175.500 - VAR.Ovav.binding = comma(Ovav);
175.501 - }
175.502 - static String arg(int i) { return "a"+i; }
175.503 - static String param(String t, String a) { return t+" "+a; }
175.504 - static String comma(String[] v) { return comma(v, ""); }
175.505 - static String comma(String sep, String[] v) {
175.506 - if (v.length == 0) return "";
175.507 - String res = sep+v[0];
175.508 - for (int i = 1; i < v.length; i++) res += ", "+v[i];
175.509 - return res;
175.510 - }
175.511 - static String transform(String string) {
175.512 - for (VAR var : values())
175.513 - string = string.replaceAll(var.pattern, var.binding);
175.514 - return string;
175.515 - }
175.516 - }
175.517 - static String[] stringsIn(String[] strings, int beg, int end) {
175.518 - return Arrays.copyOfRange(strings, beg, Math.min(end, strings.length));
175.519 - }
175.520 - static String[] stringsBefore(String[] strings, int pos) {
175.521 - return stringsIn(strings, 0, pos);
175.522 - }
175.523 - static String[] stringsAfter(String[] strings, int pos) {
175.524 - return stringsIn(strings, pos, strings.length);
175.525 - }
175.526 - static int indexAfter(String[] strings, int pos, String tag) {
175.527 - return Math.min(indexBefore(strings, pos, tag) + 1, strings.length);
175.528 - }
175.529 - static int indexBefore(String[] strings, int pos, String tag) {
175.530 - for (int i = pos, end = strings.length; ; i++) {
175.531 - if (i == end || strings[i].endsWith(tag)) return i;
175.532 - }
175.533 - }
175.534 - static int MIN_ARITY, MAX_ARITY, MAX_RCAT, MAX_REFS, MAX_INTS, MAX_LONGS;
175.535 - static boolean ALL_ARG_TYPES, ALL_RETURN_TYPES;
175.536 - static HashSet<String> done = new HashSet<String>();
175.537 - public static void main(String... av) {
175.538 - for (String[] template : TEMPLATES) {
175.539 - int forLinesLimit = indexBefore(template, 0, "@each-cat@");
175.540 - String[] forLines = stringsBefore(template, forLinesLimit);
175.541 - template = stringsAfter(template, forLinesLimit);
175.542 - for (String forLine : forLines)
175.543 - expandTemplate(forLine, template);
175.544 - }
175.545 - }
175.546 - static void expandTemplate(String forLine, String[] template) {
175.547 - String[] params = forLine.split("[^0-9]+");
175.548 - if (params[0].length() == 0) params = stringsAfter(params, 1);
175.549 - System.out.println("//params="+Arrays.asList(params));
175.550 - int pcur = 0;
175.551 - MIN_ARITY = Integer.valueOf(params[pcur++]);
175.552 - MAX_ARITY = Integer.valueOf(params[pcur++]);
175.553 - MAX_RCAT = Integer.valueOf(params[pcur++]);
175.554 - MAX_REFS = Integer.valueOf(params[pcur++]);
175.555 - MAX_INTS = Integer.valueOf(params[pcur++]);
175.556 - MAX_LONGS = Integer.valueOf(params[pcur++]);
175.557 - if (pcur != params.length) throw new RuntimeException("bad extra param: "+forLine);
175.558 - if (MAX_RCAT >= TYPES.length) MAX_RCAT = TYPES.length - 1;
175.559 - ALL_ARG_TYPES = (indexBefore(template, 0, "@each-Tv@") < template.length);
175.560 - ALL_RETURN_TYPES = (indexBefore(template, 0, "@each-R@") < template.length);
175.561 - for (int nargs = MIN_ARITY; nargs <= MAX_ARITY; nargs++) {
175.562 - for (int rcat = 0; rcat <= MAX_RCAT; rcat++) {
175.563 - expandTemplate(template, true, rcat, nargs, 0, 0);
175.564 - if (ALL_ARG_TYPES) break;
175.565 - expandTemplateForPrims(template, true, rcat, nargs, 1, 1);
175.566 - if (ALL_RETURN_TYPES) break;
175.567 - }
175.568 - }
175.569 - }
175.570 - static String catstr(int rcat, int nrefs, int nints, int nlongs) {
175.571 - int nargs = nrefs + nints + nlongs;
175.572 - String cat = TCHARS[rcat] + nargs;
175.573 - if (!ALL_ARG_TYPES) cat += (nints==0?"":"I"+nints)+(nlongs==0?"":"J"+nlongs);
175.574 - return cat;
175.575 - }
175.576 - static void expandTemplateForPrims(String[] template, boolean topLevel, int rcat, int nargs, int minints, int minlongs) {
175.577 - for (int isLong = 0; isLong <= 1; isLong++) {
175.578 - for (int nprims = 1; nprims <= nargs; nprims++) {
175.579 - int nrefs = nargs - nprims;
175.580 - int nints = ((1-isLong) * nprims);
175.581 - int nlongs = (isLong * nprims);
175.582 - expandTemplate(template, topLevel, rcat, nrefs, nints, nlongs);
175.583 - }
175.584 - }
175.585 - }
175.586 - static void expandTemplate(String[] template, boolean topLevel,
175.587 - int rcat, int nrefs, int nints, int nlongs) {
175.588 - int nargs = nrefs + nints + nlongs;
175.589 - if (nrefs > MAX_REFS || nints > MAX_INTS || nlongs > MAX_LONGS) return;
175.590 - VAR.makeBindings(topLevel, rcat, nrefs, nints, nlongs);
175.591 - if (topLevel && !done.add(VAR.cat.binding)) {
175.592 - System.out.println(" //repeat "+VAR.cat.binding);
175.593 - return;
175.594 - }
175.595 - for (int i = 0; i < template.length; i++) {
175.596 - String line = template[i];
175.597 - if (line.endsWith("@each-cat@")) {
175.598 - // ignore
175.599 - } else if (line.endsWith("@each-R@")) {
175.600 - int blockEnd = indexAfter(template, i, "@end-R@");
175.601 - String[] block = stringsIn(template, i+1, blockEnd-1);
175.602 - for (int rcat1 = rcat; rcat1 <= MAX_RCAT; rcat1++)
175.603 - expandTemplate(block, false, rcat1, nrefs, nints, nlongs);
175.604 - VAR.makeBindings(topLevel, rcat, nrefs, nints, nlongs);
175.605 - i = blockEnd-1; continue;
175.606 - } else if (line.endsWith("@each-Tv@")) {
175.607 - int blockEnd = indexAfter(template, i, "@end-Tv@");
175.608 - String[] block = stringsIn(template, i+1, blockEnd-1);
175.609 - expandTemplate(block, false, rcat, nrefs, nints, nlongs);
175.610 - expandTemplateForPrims(block, false, rcat, nargs, nints+1, nlongs+1);
175.611 - VAR.makeBindings(topLevel, rcat, nrefs, nints, nlongs);
175.612 - i = blockEnd-1; continue;
175.613 - } else {
175.614 - System.out.println(VAR.transform(line));
175.615 - }
175.616 - }
175.617 - }
175.618 -}
175.619 -//}}} */
175.620 -//params=[0, 3, 4, 99, 99, 99]
175.621 - static class A0 extends Adapter {
175.622 - protected A0(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
175.623 - protected A0(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
175.624 - protected A0 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A0(e, i, c, t); }
175.625 - protected Object target() throws Throwable { return invoker.invokeExact(target); }
175.626 - protected Object targetA0() throws Throwable { return target(); }
175.627 - protected Object invoke_L() throws Throwable { return return_L(targetA0()); }
175.628 - protected int invoke_I() throws Throwable { return return_I(targetA0()); }
175.629 - protected long invoke_J() throws Throwable { return return_J(targetA0()); }
175.630 - protected float invoke_F() throws Throwable { return return_F(targetA0()); }
175.631 - protected double invoke_D() throws Throwable { return return_D(targetA0()); }
175.632 - }
175.633 - static class A1 extends Adapter {
175.634 - protected A1(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
175.635 - protected A1(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
175.636 - protected A1 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A1(e, i, c, t); }
175.637 - protected Object target(Object a0) throws Throwable { return invoker.invokeExact(target, a0); }
175.638 - protected Object targetA1(Object a0) throws Throwable { return target(a0); }
175.639 - protected Object targetA1(int a0) throws Throwable { return target(a0); }
175.640 - protected Object targetA1(long a0) throws Throwable { return target(a0); }
175.641 - protected Object invoke_L(Object a0) throws Throwable { return return_L(targetA1(a0)); }
175.642 - protected int invoke_I(Object a0) throws Throwable { return return_I(targetA1(a0)); }
175.643 - protected long invoke_J(Object a0) throws Throwable { return return_J(targetA1(a0)); }
175.644 - protected float invoke_F(Object a0) throws Throwable { return return_F(targetA1(a0)); }
175.645 - protected double invoke_D(Object a0) throws Throwable { return return_D(targetA1(a0)); }
175.646 - protected Object invoke_L(int a0) throws Throwable { return return_L(targetA1(a0)); }
175.647 - protected int invoke_I(int a0) throws Throwable { return return_I(targetA1(a0)); }
175.648 - protected long invoke_J(int a0) throws Throwable { return return_J(targetA1(a0)); }
175.649 - protected float invoke_F(int a0) throws Throwable { return return_F(targetA1(a0)); }
175.650 - protected double invoke_D(int a0) throws Throwable { return return_D(targetA1(a0)); }
175.651 - protected Object invoke_L(long a0) throws Throwable { return return_L(targetA1(a0)); }
175.652 - protected int invoke_I(long a0) throws Throwable { return return_I(targetA1(a0)); }
175.653 - protected long invoke_J(long a0) throws Throwable { return return_J(targetA1(a0)); }
175.654 - protected float invoke_F(long a0) throws Throwable { return return_F(targetA1(a0)); }
175.655 - protected double invoke_D(long a0) throws Throwable { return return_D(targetA1(a0)); }
175.656 - }
175.657 - static class A2 extends Adapter {
175.658 - protected A2(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
175.659 - protected A2(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
175.660 - protected A2 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A2(e, i, c, t); }
175.661 - protected Object target(Object a0, Object a1) throws Throwable { return invoker.invokeExact(target, a0, a1); }
175.662 - protected Object targetA2(Object a0, Object a1) throws Throwable { return target(a0, a1); }
175.663 - protected Object targetA2(Object a0, int a1) throws Throwable { return target(a0, a1); }
175.664 - protected Object targetA2(int a0, int a1) throws Throwable { return target(a0, a1); }
175.665 - protected Object targetA2(Object a0, long a1) throws Throwable { return target(a0, a1); }
175.666 - protected Object targetA2(long a0, long a1) throws Throwable { return target(a0, a1); }
175.667 - protected Object invoke_L(Object a0, Object a1) throws Throwable { return return_L(targetA2(a0, a1)); }
175.668 - protected int invoke_I(Object a0, Object a1) throws Throwable { return return_I(targetA2(a0, a1)); }
175.669 - protected long invoke_J(Object a0, Object a1) throws Throwable { return return_J(targetA2(a0, a1)); }
175.670 - protected float invoke_F(Object a0, Object a1) throws Throwable { return return_F(targetA2(a0, a1)); }
175.671 - protected double invoke_D(Object a0, Object a1) throws Throwable { return return_D(targetA2(a0, a1)); }
175.672 - protected Object invoke_L(Object a0, int a1) throws Throwable { return return_L(targetA2(a0, a1)); }
175.673 - protected int invoke_I(Object a0, int a1) throws Throwable { return return_I(targetA2(a0, a1)); }
175.674 - protected long invoke_J(Object a0, int a1) throws Throwable { return return_J(targetA2(a0, a1)); }
175.675 - protected float invoke_F(Object a0, int a1) throws Throwable { return return_F(targetA2(a0, a1)); }
175.676 - protected double invoke_D(Object a0, int a1) throws Throwable { return return_D(targetA2(a0, a1)); }
175.677 - protected Object invoke_L(int a0, int a1) throws Throwable { return return_L(targetA2(a0, a1)); }
175.678 - protected int invoke_I(int a0, int a1) throws Throwable { return return_I(targetA2(a0, a1)); }
175.679 - protected long invoke_J(int a0, int a1) throws Throwable { return return_J(targetA2(a0, a1)); }
175.680 - protected float invoke_F(int a0, int a1) throws Throwable { return return_F(targetA2(a0, a1)); }
175.681 - protected double invoke_D(int a0, int a1) throws Throwable { return return_D(targetA2(a0, a1)); }
175.682 - protected Object invoke_L(Object a0, long a1) throws Throwable { return return_L(targetA2(a0, a1)); }
175.683 - protected int invoke_I(Object a0, long a1) throws Throwable { return return_I(targetA2(a0, a1)); }
175.684 - protected long invoke_J(Object a0, long a1) throws Throwable { return return_J(targetA2(a0, a1)); }
175.685 - protected float invoke_F(Object a0, long a1) throws Throwable { return return_F(targetA2(a0, a1)); }
175.686 - protected double invoke_D(Object a0, long a1) throws Throwable { return return_D(targetA2(a0, a1)); }
175.687 - protected Object invoke_L(long a0, long a1) throws Throwable { return return_L(targetA2(a0, a1)); }
175.688 - protected int invoke_I(long a0, long a1) throws Throwable { return return_I(targetA2(a0, a1)); }
175.689 - protected long invoke_J(long a0, long a1) throws Throwable { return return_J(targetA2(a0, a1)); }
175.690 - protected float invoke_F(long a0, long a1) throws Throwable { return return_F(targetA2(a0, a1)); }
175.691 - protected double invoke_D(long a0, long a1) throws Throwable { return return_D(targetA2(a0, a1)); }
175.692 - }
175.693 - static class A3 extends Adapter {
175.694 - protected A3(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
175.695 - protected A3(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
175.696 - protected A3 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A3(e, i, c, t); }
175.697 - protected Object target(Object a0, Object a1, Object a2) throws Throwable { return invoker.invokeExact(target, a0, a1, a2); }
175.698 - protected Object targetA3(Object a0, Object a1, Object a2) throws Throwable { return target(a0, a1, a2); }
175.699 - protected Object targetA3(Object a0, Object a1, int a2) throws Throwable { return target(a0, a1, a2); }
175.700 - protected Object targetA3(Object a0, int a1, int a2) throws Throwable { return target(a0, a1, a2); }
175.701 - protected Object targetA3(int a0, int a1, int a2) throws Throwable { return target(a0, a1, a2); }
175.702 - protected Object targetA3(Object a0, Object a1, long a2) throws Throwable { return target(a0, a1, a2); }
175.703 - protected Object targetA3(Object a0, long a1, long a2) throws Throwable { return target(a0, a1, a2); }
175.704 - protected Object targetA3(long a0, long a1, long a2) throws Throwable { return target(a0, a1, a2); }
175.705 - protected Object invoke_L(Object a0, Object a1, Object a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
175.706 - protected int invoke_I(Object a0, Object a1, Object a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
175.707 - protected long invoke_J(Object a0, Object a1, Object a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
175.708 - protected float invoke_F(Object a0, Object a1, Object a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
175.709 - protected double invoke_D(Object a0, Object a1, Object a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
175.710 - protected Object invoke_L(Object a0, Object a1, int a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
175.711 - protected int invoke_I(Object a0, Object a1, int a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
175.712 - protected long invoke_J(Object a0, Object a1, int a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
175.713 - protected float invoke_F(Object a0, Object a1, int a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
175.714 - protected double invoke_D(Object a0, Object a1, int a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
175.715 - protected Object invoke_L(Object a0, int a1, int a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
175.716 - protected int invoke_I(Object a0, int a1, int a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
175.717 - protected long invoke_J(Object a0, int a1, int a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
175.718 - protected float invoke_F(Object a0, int a1, int a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
175.719 - protected double invoke_D(Object a0, int a1, int a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
175.720 - protected Object invoke_L(int a0, int a1, int a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
175.721 - protected int invoke_I(int a0, int a1, int a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
175.722 - protected long invoke_J(int a0, int a1, int a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
175.723 - protected float invoke_F(int a0, int a1, int a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
175.724 - protected double invoke_D(int a0, int a1, int a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
175.725 - protected Object invoke_L(Object a0, Object a1, long a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
175.726 - protected int invoke_I(Object a0, Object a1, long a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
175.727 - protected long invoke_J(Object a0, Object a1, long a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
175.728 - protected float invoke_F(Object a0, Object a1, long a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
175.729 - protected double invoke_D(Object a0, Object a1, long a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
175.730 - protected Object invoke_L(Object a0, long a1, long a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
175.731 - protected int invoke_I(Object a0, long a1, long a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
175.732 - protected long invoke_J(Object a0, long a1, long a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
175.733 - protected float invoke_F(Object a0, long a1, long a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
175.734 - protected double invoke_D(Object a0, long a1, long a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
175.735 - protected Object invoke_L(long a0, long a1, long a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); }
175.736 - protected int invoke_I(long a0, long a1, long a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); }
175.737 - protected long invoke_J(long a0, long a1, long a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); }
175.738 - protected float invoke_F(long a0, long a1, long a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); }
175.739 - protected double invoke_D(long a0, long a1, long a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); }
175.740 - }
175.741 -//params=[4, 5, 2, 99, 99, 99]
175.742 - static class A4 extends Adapter {
175.743 - protected A4(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
175.744 - protected A4(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
175.745 - protected A4 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A4(e, i, c, t); }
175.746 - protected Object target(Object a0, Object a1, Object a2, Object a3) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3); }
175.747 - protected Object targetA4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return target(a0, a1, a2, a3); }
175.748 - protected Object targetA4(Object a0, Object a1, Object a2, int a3) throws Throwable { return target(a0, a1, a2, a3); }
175.749 - protected Object targetA4(Object a0, Object a1, int a2, int a3) throws Throwable { return target(a0, a1, a2, a3); }
175.750 - protected Object targetA4(Object a0, int a1, int a2, int a3) throws Throwable { return target(a0, a1, a2, a3); }
175.751 - protected Object targetA4(int a0, int a1, int a2, int a3) throws Throwable { return target(a0, a1, a2, a3); }
175.752 - protected Object targetA4(Object a0, Object a1, Object a2, long a3) throws Throwable { return target(a0, a1, a2, a3); }
175.753 - protected Object targetA4(Object a0, Object a1, long a2, long a3) throws Throwable { return target(a0, a1, a2, a3); }
175.754 - protected Object targetA4(Object a0, long a1, long a2, long a3) throws Throwable { return target(a0, a1, a2, a3); }
175.755 - protected Object targetA4(long a0, long a1, long a2, long a3) throws Throwable { return target(a0, a1, a2, a3); }
175.756 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
175.757 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
175.758 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
175.759 - protected Object invoke_L(Object a0, Object a1, Object a2, int a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
175.760 - protected int invoke_I(Object a0, Object a1, Object a2, int a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
175.761 - protected long invoke_J(Object a0, Object a1, Object a2, int a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
175.762 - protected Object invoke_L(Object a0, Object a1, int a2, int a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
175.763 - protected int invoke_I(Object a0, Object a1, int a2, int a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
175.764 - protected long invoke_J(Object a0, Object a1, int a2, int a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
175.765 - protected Object invoke_L(Object a0, int a1, int a2, int a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
175.766 - protected int invoke_I(Object a0, int a1, int a2, int a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
175.767 - protected long invoke_J(Object a0, int a1, int a2, int a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
175.768 - protected Object invoke_L(int a0, int a1, int a2, int a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
175.769 - protected int invoke_I(int a0, int a1, int a2, int a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
175.770 - protected long invoke_J(int a0, int a1, int a2, int a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
175.771 - protected Object invoke_L(Object a0, Object a1, Object a2, long a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
175.772 - protected int invoke_I(Object a0, Object a1, Object a2, long a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
175.773 - protected long invoke_J(Object a0, Object a1, Object a2, long a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
175.774 - protected Object invoke_L(Object a0, Object a1, long a2, long a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
175.775 - protected int invoke_I(Object a0, Object a1, long a2, long a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
175.776 - protected long invoke_J(Object a0, Object a1, long a2, long a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
175.777 - protected Object invoke_L(Object a0, long a1, long a2, long a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
175.778 - protected int invoke_I(Object a0, long a1, long a2, long a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
175.779 - protected long invoke_J(Object a0, long a1, long a2, long a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
175.780 - protected Object invoke_L(long a0, long a1, long a2, long a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); }
175.781 - protected int invoke_I(long a0, long a1, long a2, long a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); }
175.782 - protected long invoke_J(long a0, long a1, long a2, long a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); }
175.783 - }
175.784 - static class A5 extends Adapter {
175.785 - protected A5(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
175.786 - protected A5(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
175.787 - protected A5 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A5(e, i, c, t); }
175.788 - protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4); }
175.789 - protected Object targetA5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
175.790 - protected Object targetA5(Object a0, Object a1, Object a2, Object a3, int a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
175.791 - protected Object targetA5(Object a0, Object a1, Object a2, int a3, int a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
175.792 - protected Object targetA5(Object a0, Object a1, int a2, int a3, int a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
175.793 - protected Object targetA5(Object a0, int a1, int a2, int a3, int a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
175.794 - protected Object targetA5(int a0, int a1, int a2, int a3, int a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
175.795 - protected Object targetA5(Object a0, Object a1, Object a2, Object a3, long a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
175.796 - protected Object targetA5(Object a0, Object a1, Object a2, long a3, long a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
175.797 - protected Object targetA5(Object a0, Object a1, long a2, long a3, long a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
175.798 - protected Object targetA5(Object a0, long a1, long a2, long a3, long a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
175.799 - protected Object targetA5(long a0, long a1, long a2, long a3, long a4) throws Throwable { return target(a0, a1, a2, a3, a4); }
175.800 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
175.801 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
175.802 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
175.803 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, int a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
175.804 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, int a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
175.805 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, int a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
175.806 - protected Object invoke_L(Object a0, Object a1, Object a2, int a3, int a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
175.807 - protected int invoke_I(Object a0, Object a1, Object a2, int a3, int a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
175.808 - protected long invoke_J(Object a0, Object a1, Object a2, int a3, int a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
175.809 - protected Object invoke_L(Object a0, Object a1, int a2, int a3, int a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
175.810 - protected int invoke_I(Object a0, Object a1, int a2, int a3, int a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
175.811 - protected long invoke_J(Object a0, Object a1, int a2, int a3, int a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
175.812 - protected Object invoke_L(Object a0, int a1, int a2, int a3, int a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
175.813 - protected int invoke_I(Object a0, int a1, int a2, int a3, int a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
175.814 - protected long invoke_J(Object a0, int a1, int a2, int a3, int a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
175.815 - protected Object invoke_L(int a0, int a1, int a2, int a3, int a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
175.816 - protected int invoke_I(int a0, int a1, int a2, int a3, int a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
175.817 - protected long invoke_J(int a0, int a1, int a2, int a3, int a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
175.818 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
175.819 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, long a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
175.820 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, long a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
175.821 - protected Object invoke_L(Object a0, Object a1, Object a2, long a3, long a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
175.822 - protected int invoke_I(Object a0, Object a1, Object a2, long a3, long a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
175.823 - protected long invoke_J(Object a0, Object a1, Object a2, long a3, long a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
175.824 - protected Object invoke_L(Object a0, Object a1, long a2, long a3, long a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
175.825 - protected int invoke_I(Object a0, Object a1, long a2, long a3, long a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
175.826 - protected long invoke_J(Object a0, Object a1, long a2, long a3, long a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
175.827 - protected Object invoke_L(Object a0, long a1, long a2, long a3, long a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
175.828 - protected int invoke_I(Object a0, long a1, long a2, long a3, long a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
175.829 - protected long invoke_J(Object a0, long a1, long a2, long a3, long a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
175.830 - protected Object invoke_L(long a0, long a1, long a2, long a3, long a4) throws Throwable { return return_L(targetA5(a0, a1, a2, a3, a4)); }
175.831 - protected int invoke_I(long a0, long a1, long a2, long a3, long a4) throws Throwable { return return_I(targetA5(a0, a1, a2, a3, a4)); }
175.832 - protected long invoke_J(long a0, long a1, long a2, long a3, long a4) throws Throwable { return return_J(targetA5(a0, a1, a2, a3, a4)); }
175.833 - }
175.834 -//params=[6, 10, 2, 99, 0, 99]
175.835 - static class A6 extends Adapter {
175.836 - protected A6(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
175.837 - protected A6(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
175.838 - protected A6 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A6(e, i, c, t); }
175.839 - protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5); }
175.840 - protected Object targetA6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
175.841 - protected Object targetA6(Object a0, Object a1, Object a2, Object a3, Object a4, long a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
175.842 - protected Object targetA6(Object a0, Object a1, Object a2, Object a3, long a4, long a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
175.843 - protected Object targetA6(Object a0, Object a1, Object a2, long a3, long a4, long a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
175.844 - protected Object targetA6(Object a0, Object a1, long a2, long a3, long a4, long a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
175.845 - protected Object targetA6(Object a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
175.846 - protected Object targetA6(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return target(a0, a1, a2, a3, a4, a5); }
175.847 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
175.848 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
175.849 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
175.850 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, long a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
175.851 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, long a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
175.852 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, long a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
175.853 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long a4, long a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
175.854 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, long a4, long a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
175.855 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, long a4, long a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
175.856 - protected Object invoke_L(Object a0, Object a1, Object a2, long a3, long a4, long a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
175.857 - protected int invoke_I(Object a0, Object a1, Object a2, long a3, long a4, long a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
175.858 - protected long invoke_J(Object a0, Object a1, Object a2, long a3, long a4, long a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
175.859 - protected Object invoke_L(Object a0, Object a1, long a2, long a3, long a4, long a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
175.860 - protected int invoke_I(Object a0, Object a1, long a2, long a3, long a4, long a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
175.861 - protected long invoke_J(Object a0, Object a1, long a2, long a3, long a4, long a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
175.862 - protected Object invoke_L(Object a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
175.863 - protected int invoke_I(Object a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
175.864 - protected long invoke_J(Object a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
175.865 - protected Object invoke_L(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); }
175.866 - protected int invoke_I(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); }
175.867 - protected long invoke_J(long a0, long a1, long a2, long a3, long a4, long a5) throws Throwable { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); }
175.868 - }
175.869 - static class A7 extends Adapter {
175.870 - protected A7(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
175.871 - protected A7(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
175.872 - protected A7 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A7(e, i, c, t); }
175.873 - protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6); }
175.874 - protected Object targetA7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
175.875 - protected Object targetA7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
175.876 - protected Object targetA7(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
175.877 - protected Object targetA7(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
175.878 - protected Object targetA7(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
175.879 - protected Object targetA7(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
175.880 - protected Object targetA7(Object a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
175.881 - protected Object targetA7(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6); }
175.882 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.883 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.884 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.885 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.886 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.887 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.888 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.889 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.890 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.891 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.892 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.893 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.894 - protected Object invoke_L(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.895 - protected int invoke_I(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.896 - protected long invoke_J(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.897 - protected Object invoke_L(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.898 - protected int invoke_I(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.899 - protected long invoke_J(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.900 - protected Object invoke_L(Object a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.901 - protected int invoke_I(Object a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.902 - protected long invoke_J(Object a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.903 - protected Object invoke_L(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.904 - protected int invoke_I(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.905 - protected long invoke_J(long a0, long a1, long a2, long a3, long a4, long a5, long a6) throws Throwable { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); }
175.906 - }
175.907 - static class A8 extends Adapter {
175.908 - protected A8(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
175.909 - protected A8(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
175.910 - protected A8 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A8(e, i, c, t); }
175.911 - protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7); }
175.912 - protected Object targetA8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
175.913 - protected Object targetA8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
175.914 - protected Object targetA8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
175.915 - protected Object targetA8(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
175.916 - protected Object targetA8(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
175.917 - protected Object targetA8(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
175.918 - protected Object targetA8(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
175.919 - protected Object targetA8(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
175.920 - protected Object targetA8(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7); }
175.921 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.922 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.923 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.924 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.925 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.926 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.927 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.928 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.929 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.930 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.931 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.932 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.933 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.934 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.935 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.936 - protected Object invoke_L(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.937 - protected int invoke_I(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.938 - protected long invoke_J(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.939 - protected Object invoke_L(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.940 - protected int invoke_I(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.941 - protected long invoke_J(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.942 - protected Object invoke_L(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.943 - protected int invoke_I(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.944 - protected long invoke_J(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.945 - protected Object invoke_L(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.946 - protected int invoke_I(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.947 - protected long invoke_J(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) throws Throwable { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); }
175.948 - }
175.949 - static class A9 extends Adapter {
175.950 - protected A9(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
175.951 - protected A9(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
175.952 - protected A9 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A9(e, i, c, t); }
175.953 - protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8); }
175.954 - protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
175.955 - protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
175.956 - protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
175.957 - protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
175.958 - protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
175.959 - protected Object targetA9(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
175.960 - protected Object targetA9(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
175.961 - protected Object targetA9(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
175.962 - protected Object targetA9(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
175.963 - protected Object targetA9(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
175.964 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.965 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.966 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.967 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.968 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.969 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.970 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.971 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.972 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.973 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.974 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.975 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.976 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.977 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.978 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.979 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.980 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.981 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.982 - protected Object invoke_L(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.983 - protected int invoke_I(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.984 - protected long invoke_J(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.985 - protected Object invoke_L(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.986 - protected int invoke_I(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.987 - protected long invoke_J(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.988 - protected Object invoke_L(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.989 - protected int invoke_I(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.990 - protected long invoke_J(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.991 - protected Object invoke_L(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.992 - protected int invoke_I(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.993 - protected long invoke_J(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) throws Throwable { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
175.994 - }
175.995 - static class A10 extends Adapter {
175.996 - protected A10(MethodHandle entryPoint) { super(entryPoint); } // to build prototype
175.997 - protected A10(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }
175.998 - protected A10 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A10(e, i, c, t); }
175.999 - protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return invoker.invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
175.1000 - protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
175.1001 - protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
175.1002 - protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
175.1003 - protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
175.1004 - protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
175.1005 - protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
175.1006 - protected Object targetA10(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
175.1007 - protected Object targetA10(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
175.1008 - protected Object targetA10(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
175.1009 - protected Object targetA10(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
175.1010 - protected Object targetA10(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
175.1011 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1012 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1013 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1014 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, long a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1015 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, long a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1016 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, long a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1017 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8, long a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1018 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8, long a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1019 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8, long a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1020 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8, long a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1021 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8, long a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1022 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8, long a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1023 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8, long a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1024 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8, long a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1025 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8, long a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1026 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1027 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1028 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1029 - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1030 - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1031 - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1032 - protected Object invoke_L(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1033 - protected int invoke_I(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1034 - protected long invoke_J(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1035 - protected Object invoke_L(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1036 - protected int invoke_I(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1037 - protected long invoke_J(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1038 - protected Object invoke_L(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1039 - protected int invoke_I(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1040 - protected long invoke_J(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1041 - protected Object invoke_L(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1042 - protected int invoke_I(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1043 - protected long invoke_J(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) throws Throwable { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
175.1044 - }
175.1045 -}
176.1 --- a/src/share/classes/sun/dyn/WrapperInstance.java Tue Mar 29 11:29:01 2011 -0700
176.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
176.3 @@ -1,48 +0,0 @@
176.4 -/*
176.5 - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
176.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
176.7 - *
176.8 - * This code is free software; you can redistribute it and/or modify it
176.9 - * under the terms of the GNU General Public License version 2 only, as
176.10 - * published by the Free Software Foundation. Oracle designates this
176.11 - * particular file as subject to the "Classpath" exception as provided
176.12 - * by Oracle in the LICENSE file that accompanied this code.
176.13 - *
176.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
176.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
176.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
176.17 - * version 2 for more details (a copy is included in the LICENSE file that
176.18 - * accompanied this code).
176.19 - *
176.20 - * You should have received a copy of the GNU General Public License version
176.21 - * 2 along with this work; if not, write to the Free Software Foundation,
176.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
176.23 - *
176.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
176.25 - * or visit www.oracle.com if you need additional information or have any
176.26 - * questions.
176.27 - */
176.28 -
176.29 -package sun.dyn;
176.30 -
176.31 -import java.dyn.MethodHandle;
176.32 -
176.33 -/**
176.34 - * Private API used inside of java.dyn.MethodHandles.
176.35 - * Interface implemented by every object which is produced by
176.36 - * {@link java.dyn.MethodHandles#asInstance MethodHandles.asInstance}.
176.37 - * The methods of this interface allow a caller to recover the parameters
176.38 - * to {@code asInstance}.
176.39 - * This allows applications to repeatedly convert between method handles
176.40 - * and SAM objects, without the risk of creating unbounded delegation chains.
176.41 - */
176.42 -public interface WrapperInstance {
176.43 - /** Produce or recover a target method handle which is behaviorally
176.44 - * equivalent to the SAM method of this object.
176.45 - */
176.46 - public MethodHandle getWrapperInstanceTarget();
176.47 - /** Recover the SAM type for which this object was created.
176.48 - */
176.49 - public Class<?> getWrapperInstanceType();
176.50 -}
176.51 -
177.1 --- a/src/share/classes/sun/dyn/anon/AnonymousClassLoader.java Tue Mar 29 11:29:01 2011 -0700
177.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
177.3 @@ -1,290 +0,0 @@
177.4 -/*
177.5 - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
177.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
177.7 - *
177.8 - * This code is free software; you can redistribute it and/or modify it
177.9 - * under the terms of the GNU General Public License version 2 only, as
177.10 - * published by the Free Software Foundation. Oracle designates this
177.11 - * particular file as subject to the "Classpath" exception as provided
177.12 - * by Oracle in the LICENSE file that accompanied this code.
177.13 - *
177.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
177.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
177.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
177.17 - * version 2 for more details (a copy is included in the LICENSE file that
177.18 - * accompanied this code).
177.19 - *
177.20 - * You should have received a copy of the GNU General Public License version
177.21 - * 2 along with this work; if not, write to the Free Software Foundation,
177.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
177.23 - *
177.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
177.25 - * or visit www.oracle.com if you need additional information or have any
177.26 - * questions.
177.27 - */
177.28 -
177.29 -package sun.dyn.anon;
177.30 -
177.31 -import java.io.IOException;
177.32 -import java.lang.reflect.InvocationTargetException;
177.33 -import java.lang.reflect.Method;
177.34 -import sun.misc.IOUtils;
177.35 -
177.36 -/**
177.37 - * Anonymous class loader. Will load any valid classfile, producing
177.38 - * a {@link Class} metaobject, without installing that class in the
177.39 - * system dictionary. Therefore, {@link Class#forName(String)} will never
177.40 - * produce a reference to an anonymous class.
177.41 - * <p>
177.42 - * The access permissions of the anonymous class are borrowed from
177.43 - * a <em>host class</em>. The new class behaves as if it were an
177.44 - * inner class of the host class. It can access the host's private
177.45 - * members, if the creator of the class loader has permission to
177.46 - * do so (or to create accessible reflective objects).
177.47 - * <p>
177.48 - * When the anonymous class is loaded, elements of its constant pool
177.49 - * can be patched to new values. This provides a hook to pre-resolve
177.50 - * named classes in the constant pool to other classes, including
177.51 - * anonymous ones. Also, string constants can be pre-resolved to
177.52 - * any reference. (The verifier treats non-string, non-class reference
177.53 - * constants as plain objects.)
177.54 - * <p>
177.55 - * Why include the patching function? It makes some use cases much easier.
177.56 - * Second, the constant pool needed some internal patching anyway,
177.57 - * to anonymize the loaded class itself. Finally, if you are going
177.58 - * to use this seriously, you'll want to build anonymous classes
177.59 - * on top of pre-existing anonymous classes, and that requires patching.
177.60 - *
177.61 - * <p>%%% TO-DO:
177.62 - * <ul>
177.63 - * <li>needs better documentation</li>
177.64 - * <li>needs more security work (for safe delegation)</li>
177.65 - * <li>needs a clearer story about error processing</li>
177.66 - * <li>patch member references also (use ';' as delimiter char)</li>
177.67 - * <li>patch method references to (conforming) method handles</li>
177.68 - * </ul>
177.69 - *
177.70 - * @author jrose
177.71 - * @author Remi Forax
177.72 - * @see <a href="http://blogs.sun.com/jrose/entry/anonymous_classes_in_the_vm">
177.73 - * http://blogs.sun.com/jrose/entry/anonymous_classes_in_the_vm</a>
177.74 - */
177.75 -
177.76 -public class AnonymousClassLoader {
177.77 - final Class<?> hostClass;
177.78 -
177.79 - // Note: Do not refactor the calls to checkHostClass unless you
177.80 - // also adjust this constant:
177.81 - private static int CHC_CALLERS = 3;
177.82 -
177.83 - public AnonymousClassLoader() {
177.84 - this.hostClass = checkHostClass(null);
177.85 - }
177.86 - public AnonymousClassLoader(Class<?> hostClass) {
177.87 - this.hostClass = checkHostClass(hostClass);
177.88 - }
177.89 -
177.90 - private static Class<?> getTopLevelClass(Class<?> clazz) {
177.91 - for(Class<?> outer = clazz.getDeclaringClass(); outer != null;
177.92 - outer = outer.getDeclaringClass()) {
177.93 - clazz = outer;
177.94 - }
177.95 - return clazz;
177.96 - }
177.97 -
177.98 - private static Class<?> checkHostClass(Class<?> hostClass) {
177.99 - // called only from the constructor
177.100 - // does a context-sensitive check on caller class
177.101 - // CC[0..3] = {Reflection, this.checkHostClass, this.<init>, caller}
177.102 - Class<?> caller = sun.reflect.Reflection.getCallerClass(CHC_CALLERS);
177.103 -
177.104 - if (caller == null) {
177.105 - // called from the JVM directly
177.106 - if (hostClass == null)
177.107 - return AnonymousClassLoader.class; // anything central will do
177.108 - return hostClass;
177.109 - }
177.110 -
177.111 - if (hostClass == null)
177.112 - hostClass = caller; // default value is caller itself
177.113 -
177.114 - // anonymous class will access hostClass on behalf of caller
177.115 - Class<?> callee = hostClass;
177.116 -
177.117 - if (caller == callee)
177.118 - // caller can always nominate itself to grant caller's own access rights
177.119 - return hostClass;
177.120 -
177.121 - // normalize caller and callee to their top-level classes:
177.122 - caller = getTopLevelClass(caller);
177.123 - callee = getTopLevelClass(callee);
177.124 - if (caller == callee)
177.125 - return caller;
177.126 -
177.127 - ClassLoader callerCL = caller.getClassLoader();
177.128 - if (callerCL == null) {
177.129 - // caller is trusted code, so accept the proposed hostClass
177.130 - return hostClass;
177.131 - }
177.132 -
177.133 - // %%% should do something with doPrivileged, because trusted
177.134 - // code should have a way to execute on behalf of
177.135 - // partially-trusted clients
177.136 -
177.137 - // Does the caller have the right to access the private
177.138 - // members of the callee? If not, raise an error.
177.139 - final int ACC_PRIVATE = 2;
177.140 - try {
177.141 - sun.reflect.Reflection.ensureMemberAccess(caller, callee, null, ACC_PRIVATE);
177.142 - } catch (IllegalAccessException ee) {
177.143 - throw new IllegalArgumentException(ee);
177.144 - }
177.145 -
177.146 - return hostClass;
177.147 - }
177.148 -
177.149 - public Class<?> loadClass(byte[] classFile) {
177.150 - if (defineAnonymousClass == null) {
177.151 - // no JVM support; try to fake an approximation
177.152 - try {
177.153 - return fakeLoadClass(new ConstantPoolParser(classFile).createPatch());
177.154 - } catch (InvalidConstantPoolFormatException ee) {
177.155 - throw new IllegalArgumentException(ee);
177.156 - }
177.157 - }
177.158 - return loadClass(classFile, null);
177.159 - }
177.160 -
177.161 - public Class<?> loadClass(ConstantPoolPatch classPatch) {
177.162 - if (defineAnonymousClass == null) {
177.163 - // no JVM support; try to fake an approximation
177.164 - return fakeLoadClass(classPatch);
177.165 - }
177.166 - Object[] patches = classPatch.patchArray;
177.167 - // Convert class names (this late in the game)
177.168 - // to use slash '/' instead of dot '.'.
177.169 - // Java likes dots, but the JVM likes slashes.
177.170 - for (int i = 0; i < patches.length; i++) {
177.171 - Object value = patches[i];
177.172 - if (value != null) {
177.173 - byte tag = classPatch.getTag(i);
177.174 - switch (tag) {
177.175 - case ConstantPoolVisitor.CONSTANT_Class:
177.176 - if (value instanceof String) {
177.177 - if (patches == classPatch.patchArray)
177.178 - patches = patches.clone();
177.179 - patches[i] = ((String)value).replace('.', '/');
177.180 - }
177.181 - break;
177.182 - case ConstantPoolVisitor.CONSTANT_Fieldref:
177.183 - case ConstantPoolVisitor.CONSTANT_Methodref:
177.184 - case ConstantPoolVisitor.CONSTANT_InterfaceMethodref:
177.185 - case ConstantPoolVisitor.CONSTANT_NameAndType:
177.186 - // When/if the JVM supports these patches,
177.187 - // we'll probably need to reformat them also.
177.188 - // Meanwhile, let the class loader create the error.
177.189 - break;
177.190 - }
177.191 - }
177.192 - }
177.193 - return loadClass(classPatch.outer.classFile, classPatch.patchArray);
177.194 - }
177.195 -
177.196 - private Class<?> loadClass(byte[] classFile, Object[] patchArray) {
177.197 - try {
177.198 - return (Class<?>)
177.199 - defineAnonymousClass.invoke(unsafe,
177.200 - hostClass, classFile, patchArray);
177.201 - } catch (Exception ex) {
177.202 - throwReflectedException(ex);
177.203 - throw new RuntimeException("error loading into "+hostClass, ex);
177.204 - }
177.205 - }
177.206 -
177.207 - private static void throwReflectedException(Exception ex) {
177.208 - if (ex instanceof InvocationTargetException) {
177.209 - Throwable tex = ((InvocationTargetException)ex).getTargetException();
177.210 - if (tex instanceof Error)
177.211 - throw (Error) tex;
177.212 - ex = (Exception) tex;
177.213 - }
177.214 - if (ex instanceof RuntimeException) {
177.215 - throw (RuntimeException) ex;
177.216 - }
177.217 - }
177.218 -
177.219 - private Class<?> fakeLoadClass(ConstantPoolPatch classPatch) {
177.220 - // Implementation:
177.221 - // 1. Make up a new name nobody has used yet.
177.222 - // 2. Inspect the tail-header of the class to find the this_class index.
177.223 - // 3. Patch the CONSTANT_Class for this_class to the new name.
177.224 - // 4. Add other CP entries required by (e.g.) string patches.
177.225 - // 5. Flatten Class constants down to their names, making sure that
177.226 - // the host class loader can pick them up again accurately.
177.227 - // 6. Generate the edited class file bytes.
177.228 - //
177.229 - // Potential limitations:
177.230 - // * The class won't be truly anonymous, and may interfere with others.
177.231 - // * Flattened class constants might not work, because of loader issues.
177.232 - // * Pseudo-string constants will not flatten down to real strings.
177.233 - // * Method handles will (of course) fail to flatten to linkage strings.
177.234 - if (true) throw new UnsupportedOperationException("NYI");
177.235 - Object[] cpArray;
177.236 - try {
177.237 - cpArray = classPatch.getOriginalCP();
177.238 - } catch (InvalidConstantPoolFormatException ex) {
177.239 - throw new RuntimeException(ex);
177.240 - }
177.241 - int thisClassIndex = classPatch.getParser().getThisClassIndex();
177.242 - String thisClassName = (String) cpArray[thisClassIndex];
177.243 - synchronized (AnonymousClassLoader.class) {
177.244 - thisClassName = thisClassName+"\\|"+(++fakeNameCounter);
177.245 - }
177.246 - classPatch.putUTF8(thisClassIndex, thisClassName);
177.247 - byte[] classFile = null;
177.248 - return unsafe.defineClass(null, classFile, 0, classFile.length,
177.249 - hostClass.getClassLoader(),
177.250 - hostClass.getProtectionDomain());
177.251 - }
177.252 - private static int fakeNameCounter = 99999;
177.253 -
177.254 - // ignore two warnings on this line:
177.255 - static sun.misc.Unsafe unsafe = sun.misc.Unsafe.getUnsafe();
177.256 - // preceding line requires that this class be on the boot class path
177.257 -
177.258 - static private final Method defineAnonymousClass;
177.259 - static {
177.260 - Method dac = null;
177.261 - Class<? extends sun.misc.Unsafe> unsafeClass = unsafe.getClass();
177.262 - try {
177.263 - dac = unsafeClass.getMethod("defineAnonymousClass",
177.264 - Class.class,
177.265 - byte[].class,
177.266 - Object[].class);
177.267 - } catch (Exception ee) {
177.268 - dac = null;
177.269 - }
177.270 - defineAnonymousClass = dac;
177.271 - }
177.272 -
177.273 - private static void noJVMSupport() {
177.274 - throw new UnsupportedOperationException("no JVM support for anonymous classes");
177.275 - }
177.276 -
177.277 -
177.278 - private static native Class<?> loadClassInternal(Class<?> hostClass,
177.279 - byte[] classFile,
177.280 - Object[] patchArray);
177.281 -
177.282 - public static byte[] readClassFile(Class<?> templateClass) throws IOException {
177.283 - String templateName = templateClass.getName();
177.284 - int lastDot = templateName.lastIndexOf('.');
177.285 - java.net.URL url = templateClass.getResource(templateName.substring(lastDot+1)+".class");
177.286 - java.net.URLConnection connection = url.openConnection();
177.287 - int contentLength = connection.getContentLength();
177.288 - if (contentLength < 0)
177.289 - throw new IOException("invalid content length "+contentLength);
177.290 -
177.291 - return IOUtils.readFully(connection.getInputStream(), contentLength, true);
177.292 - }
177.293 -}
178.1 --- a/src/share/classes/sun/dyn/anon/ConstantPoolParser.java Tue Mar 29 11:29:01 2011 -0700
178.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
178.3 @@ -1,368 +0,0 @@
178.4 -/*
178.5 - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
178.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
178.7 - *
178.8 - * This code is free software; you can redistribute it and/or modify it
178.9 - * under the terms of the GNU General Public License version 2 only, as
178.10 - * published by the Free Software Foundation. Oracle designates this
178.11 - * particular file as subject to the "Classpath" exception as provided
178.12 - * by Oracle in the LICENSE file that accompanied this code.
178.13 - *
178.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
178.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
178.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
178.17 - * version 2 for more details (a copy is included in the LICENSE file that
178.18 - * accompanied this code).
178.19 - *
178.20 - * You should have received a copy of the GNU General Public License version
178.21 - * 2 along with this work; if not, write to the Free Software Foundation,
178.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
178.23 - *
178.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
178.25 - * or visit www.oracle.com if you need additional information or have any
178.26 - * questions.
178.27 - */
178.28 -
178.29 -package sun.dyn.anon;
178.30 -
178.31 -import java.io.IOException;
178.32 -import java.io.OutputStream;
178.33 -import java.nio.BufferUnderflowException;
178.34 -import java.nio.ByteBuffer;
178.35 -
178.36 -import static sun.dyn.anon.ConstantPoolVisitor.*;
178.37 -
178.38 -/** A constant pool parser.
178.39 - */
178.40 -public class ConstantPoolParser {
178.41 - final byte[] classFile;
178.42 - final byte[] tags;
178.43 - final char[] firstHeader; // maghi, maglo, minor, major, cplen
178.44 -
178.45 - // these are filled in on first parse:
178.46 - int endOffset;
178.47 - char[] secondHeader; // flags, this_class, super_class, intlen
178.48 -
178.49 - // used to decode UTF8 array
178.50 - private char[] charArray = new char[80];
178.51 -
178.52 - /** Creates a constant pool parser.
178.53 - * @param classFile an array of bytes containing a class.
178.54 - * @throws InvalidConstantPoolFormatException if the header of the class has errors.
178.55 - */
178.56 - public ConstantPoolParser(byte[] classFile) throws InvalidConstantPoolFormatException {
178.57 - this.classFile = classFile;
178.58 - this.firstHeader = parseHeader(classFile);
178.59 - this.tags = new byte[firstHeader[4]];
178.60 - }
178.61 -
178.62 - /** Create a constant pool parser by loading the bytecodes of the
178.63 - * class taken as argument.
178.64 - *
178.65 - * @param templateClass the class to parse.
178.66 - *
178.67 - * @throws IOException raised if an I/O occurs when loading
178.68 - * the bytecode of the template class.
178.69 - * @throws InvalidConstantPoolFormatException if the header of the class has errors.
178.70 - *
178.71 - * @see #ConstantPoolParser(byte[])
178.72 - * @see AnonymousClassLoader#readClassFile(Class)
178.73 - */
178.74 - public ConstantPoolParser(Class<?> templateClass) throws IOException, InvalidConstantPoolFormatException {
178.75 - this(AnonymousClassLoader.readClassFile(templateClass));
178.76 - }
178.77 -
178.78 - /** Creates an empty patch to patch the class file
178.79 - * used by the current parser.
178.80 - * @return a new class patch.
178.81 - */
178.82 - public ConstantPoolPatch createPatch() {
178.83 - return new ConstantPoolPatch(this);
178.84 - }
178.85 -
178.86 - /** Report the tag of the indicated CP entry.
178.87 - * @param index
178.88 - * @return one of {@link ConstantPoolVisitor#CONSTANT_Utf8}, etc.
178.89 - */
178.90 - public byte getTag(int index) {
178.91 - getEndOffset(); // trigger an exception if we haven't parsed yet
178.92 - return tags[index];
178.93 - }
178.94 -
178.95 - /** Report the length of the constant pool. */
178.96 - public int getLength() {
178.97 - return firstHeader[4];
178.98 - }
178.99 -
178.100 - /** Report the offset, within the class file, of the start of the constant pool. */
178.101 - public int getStartOffset() {
178.102 - return firstHeader.length * 2;
178.103 - }
178.104 -
178.105 - /** Report the offset, within the class file, of the end of the constant pool. */
178.106 - public int getEndOffset() {
178.107 - if (endOffset == 0)
178.108 - throw new IllegalStateException("class file has not yet been parsed");
178.109 - return endOffset;
178.110 - }
178.111 -
178.112 - /** Report the CP index of this class's own name. */
178.113 - public int getThisClassIndex() {
178.114 - getEndOffset(); // provoke exception if not yet parsed
178.115 - return secondHeader[1];
178.116 - }
178.117 -
178.118 - /** Report the total size of the class file. */
178.119 - public int getTailLength() {
178.120 - return classFile.length - getEndOffset();
178.121 - }
178.122 -
178.123 - /** Write the head (header plus constant pool)
178.124 - * of the class file to the indicated stream.
178.125 - */
178.126 - public void writeHead(OutputStream out) throws IOException {
178.127 - out.write(classFile, 0, getEndOffset());
178.128 - }
178.129 -
178.130 - /** Write the head (header plus constant pool)
178.131 - * of the class file to the indicated stream,
178.132 - * incorporating the non-null entries of the given array
178.133 - * as patches.
178.134 - */
178.135 - void writePatchedHead(OutputStream out, Object[] patchArray) {
178.136 - // this will be useful to partially emulate the class loader on old JVMs
178.137 - throw new UnsupportedOperationException("Not yet implemented");
178.138 - }
178.139 -
178.140 - /** Write the tail (everything after the constant pool)
178.141 - * of the class file to the indicated stream.
178.142 - */
178.143 - public void writeTail(OutputStream out) throws IOException {
178.144 - out.write(classFile, getEndOffset(), getTailLength());
178.145 - }
178.146 -
178.147 - private static char[] parseHeader(byte[] classFile) throws InvalidConstantPoolFormatException {
178.148 - char[] result = new char[5];
178.149 - ByteBuffer buffer = ByteBuffer.wrap(classFile);
178.150 - for (int i = 0; i < result.length; i++)
178.151 - result[i] = (char) getUnsignedShort(buffer);
178.152 - int magic = result[0] << 16 | result[1] << 0;
178.153 - if (magic != 0xCAFEBABE)
178.154 - throw new InvalidConstantPoolFormatException("invalid magic number "+magic);
178.155 - // skip major, minor version
178.156 - int len = result[4];
178.157 - if (len < 1)
178.158 - throw new InvalidConstantPoolFormatException("constant pool length < 1");
178.159 - return result;
178.160 - }
178.161 -
178.162 - /** Parse the constant pool of the class
178.163 - * calling a method visit* each time a constant pool entry is parsed.
178.164 - *
178.165 - * The order of the calls to visit* is not guaranteed to be the same
178.166 - * than the order of the constant pool entry in the bytecode array.
178.167 - *
178.168 - * @param visitor
178.169 - * @throws InvalidConstantPoolFormatException
178.170 - */
178.171 - public void parse(ConstantPoolVisitor visitor) throws InvalidConstantPoolFormatException {
178.172 - ByteBuffer buffer = ByteBuffer.wrap(classFile);
178.173 - buffer.position(getStartOffset()); //skip header
178.174 -
178.175 - Object[] values = new Object[getLength()];
178.176 - try {
178.177 - parseConstantPool(buffer, values, visitor);
178.178 - } catch(BufferUnderflowException e) {
178.179 - throw new InvalidConstantPoolFormatException(e);
178.180 - }
178.181 - if (endOffset == 0) {
178.182 - endOffset = buffer.position();
178.183 - secondHeader = new char[4];
178.184 - for (int i = 0; i < secondHeader.length; i++) {
178.185 - secondHeader[i] = (char) getUnsignedShort(buffer);
178.186 - }
178.187 - }
178.188 - resolveConstantPool(values, visitor);
178.189 - }
178.190 -
178.191 - private char[] getCharArray(int utfLength) {
178.192 - if (utfLength <= charArray.length)
178.193 - return charArray;
178.194 - return charArray = new char[utfLength];
178.195 - }
178.196 -
178.197 - private void parseConstantPool(ByteBuffer buffer, Object[] values, ConstantPoolVisitor visitor) throws InvalidConstantPoolFormatException {
178.198 - for (int i = 1; i < tags.length; ) {
178.199 - byte tag = (byte) getUnsignedByte(buffer);
178.200 - assert(tags[i] == 0 || tags[i] == tag);
178.201 - tags[i] = tag;
178.202 - switch (tag) {
178.203 - case CONSTANT_Utf8:
178.204 - int utfLen = getUnsignedShort(buffer);
178.205 - String value = getUTF8(buffer, utfLen, getCharArray(utfLen));
178.206 - visitor.visitUTF8(i, CONSTANT_Utf8, value);
178.207 - tags[i] = tag;
178.208 - values[i++] = value;
178.209 - break;
178.210 - case CONSTANT_Integer:
178.211 - visitor.visitConstantValue(i, tag, buffer.getInt());
178.212 - i++;
178.213 - break;
178.214 - case CONSTANT_Float:
178.215 - visitor.visitConstantValue(i, tag, buffer.getFloat());
178.216 - i++;
178.217 - break;
178.218 - case CONSTANT_Long:
178.219 - visitor.visitConstantValue(i, tag, buffer.getLong());
178.220 - i+=2;
178.221 - break;
178.222 - case CONSTANT_Double:
178.223 - visitor.visitConstantValue(i, tag, buffer.getDouble());
178.224 - i+=2;
178.225 - break;
178.226 -
178.227 - case CONSTANT_Class: // fall through:
178.228 - case CONSTANT_String:
178.229 - tags[i] = tag;
178.230 - values[i++] = new int[] { getUnsignedShort(buffer) };
178.231 - break;
178.232 -
178.233 - case CONSTANT_Fieldref: // fall through:
178.234 - case CONSTANT_Methodref: // fall through:
178.235 - case CONSTANT_InterfaceMethodref: // fall through:
178.236 - case CONSTANT_NameAndType:
178.237 - tags[i] = tag;
178.238 - values[i++] = new int[] { getUnsignedShort(buffer), getUnsignedShort(buffer) };
178.239 - break;
178.240 - default:
178.241 - throw new AssertionError("invalid constant "+tag);
178.242 - }
178.243 - }
178.244 - }
178.245 -
178.246 - private void resolveConstantPool(Object[] values, ConstantPoolVisitor visitor) {
178.247 - // clean out the int[] values, which are temporary
178.248 - for (int beg = 1, end = values.length-1, beg2, end2;
178.249 - beg <= end;
178.250 - beg = beg2, end = end2) {
178.251 - beg2 = end; end2 = beg-1;
178.252 - //System.out.println("CP resolve pass: "+beg+".."+end);
178.253 - for (int i = beg; i <= end; i++) {
178.254 - Object value = values[i];
178.255 - if (!(value instanceof int[]))
178.256 - continue;
178.257 - int[] array = (int[]) value;
178.258 - byte tag = tags[i];
178.259 - switch (tag) {
178.260 - case CONSTANT_String:
178.261 - String stringBody = (String) values[array[0]];
178.262 - visitor.visitConstantString(i, tag, stringBody, array[0]);
178.263 - values[i] = null;
178.264 - break;
178.265 - case CONSTANT_Class: {
178.266 - String className = (String) values[array[0]];
178.267 - // use the external form favored by Class.forName:
178.268 - className = className.replace('/', '.');
178.269 - visitor.visitConstantString(i, tag, className, array[0]);
178.270 - values[i] = className;
178.271 - break;
178.272 - }
178.273 - case CONSTANT_NameAndType: {
178.274 - String memberName = (String) values[array[0]];
178.275 - String signature = (String) values[array[1]];
178.276 - visitor.visitDescriptor(i, tag, memberName, signature,
178.277 - array[0], array[1]);
178.278 - values[i] = new String[] {memberName, signature};
178.279 - break;
178.280 - }
178.281 - case CONSTANT_Fieldref: // fall through:
178.282 - case CONSTANT_Methodref: // fall through:
178.283 - case CONSTANT_InterfaceMethodref: {
178.284 - Object className = values[array[0]];
178.285 - Object nameAndType = values[array[1]];
178.286 - if (!(className instanceof String) ||
178.287 - !(nameAndType instanceof String[])) {
178.288 - // one more pass is needed
178.289 - if (beg2 > i) beg2 = i;
178.290 - if (end2 < i) end2 = i;
178.291 - continue;
178.292 - }
178.293 - String[] nameAndTypeArray = (String[]) nameAndType;
178.294 - visitor.visitMemberRef(i, tag,
178.295 - (String)className,
178.296 - nameAndTypeArray[0],
178.297 - nameAndTypeArray[1],
178.298 - array[0], array[1]);
178.299 - values[i] = null;
178.300 - }
178.301 - break;
178.302 - default:
178.303 - continue;
178.304 - }
178.305 - }
178.306 - }
178.307 - }
178.308 -
178.309 - private static int getUnsignedByte(ByteBuffer buffer) {
178.310 - return buffer.get() & 0xFF;
178.311 - }
178.312 -
178.313 - private static int getUnsignedShort(ByteBuffer buffer) {
178.314 - int b1 = getUnsignedByte(buffer);
178.315 - int b2 = getUnsignedByte(buffer);
178.316 - return (b1 << 8) + (b2 << 0);
178.317 - }
178.318 -
178.319 - private static String getUTF8(ByteBuffer buffer, int utfLen, char[] charArray) throws InvalidConstantPoolFormatException {
178.320 - int utfLimit = buffer.position() + utfLen;
178.321 - int index = 0;
178.322 - while (buffer.position() < utfLimit) {
178.323 - int c = buffer.get() & 0xff;
178.324 - if (c > 127) {
178.325 - buffer.position(buffer.position() - 1);
178.326 - return getUTF8Extended(buffer, utfLimit, charArray, index);
178.327 - }
178.328 - charArray[index++] = (char)c;
178.329 - }
178.330 - return new String(charArray, 0, index);
178.331 - }
178.332 -
178.333 - private static String getUTF8Extended(ByteBuffer buffer, int utfLimit, char[] charArray, int index) throws InvalidConstantPoolFormatException {
178.334 - int c, c2, c3;
178.335 - while (buffer.position() < utfLimit) {
178.336 - c = buffer.get() & 0xff;
178.337 - switch (c >> 4) {
178.338 - case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
178.339 - /* 0xxxxxxx*/
178.340 - charArray[index++] = (char)c;
178.341 - break;
178.342 - case 12: case 13:
178.343 - /* 110x xxxx 10xx xxxx*/
178.344 - c2 = buffer.get();
178.345 - if ((c2 & 0xC0) != 0x80)
178.346 - throw new InvalidConstantPoolFormatException(
178.347 - "malformed input around byte " + buffer.position());
178.348 - charArray[index++] = (char)(((c & 0x1F) << 6) |
178.349 - (c2 & 0x3F));
178.350 - break;
178.351 - case 14:
178.352 - /* 1110 xxxx 10xx xxxx 10xx xxxx */
178.353 - c2 = buffer.get();
178.354 - c3 = buffer.get();
178.355 - if (((c2 & 0xC0) != 0x80) || ((c3 & 0xC0) != 0x80))
178.356 - throw new InvalidConstantPoolFormatException(
178.357 - "malformed input around byte " + (buffer.position()));
178.358 - charArray[index++] = (char)(((c & 0x0F) << 12) |
178.359 - ((c2 & 0x3F) << 6) |
178.360 - ((c3 & 0x3F) << 0));
178.361 - break;
178.362 - default:
178.363 - /* 10xx xxxx, 1111 xxxx */
178.364 - throw new InvalidConstantPoolFormatException(
178.365 - "malformed input around byte " + buffer.position());
178.366 - }
178.367 - }
178.368 - // The number of chars produced may be less than utflen
178.369 - return new String(charArray, 0, index);
178.370 - }
178.371 -}
179.1 --- a/src/share/classes/sun/dyn/anon/ConstantPoolPatch.java Tue Mar 29 11:29:01 2011 -0700
179.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
179.3 @@ -1,503 +0,0 @@
179.4 -/*
179.5 - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
179.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
179.7 - *
179.8 - * This code is free software; you can redistribute it and/or modify it
179.9 - * under the terms of the GNU General Public License version 2 only, as
179.10 - * published by the Free Software Foundation. Oracle designates this
179.11 - * particular file as subject to the "Classpath" exception as provided
179.12 - * by Oracle in the LICENSE file that accompanied this code.
179.13 - *
179.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
179.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
179.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
179.17 - * version 2 for more details (a copy is included in the LICENSE file that
179.18 - * accompanied this code).
179.19 - *
179.20 - * You should have received a copy of the GNU General Public License version
179.21 - * 2 along with this work; if not, write to the Free Software Foundation,
179.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
179.23 - *
179.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
179.25 - * or visit www.oracle.com if you need additional information or have any
179.26 - * questions.
179.27 - */
179.28 -
179.29 -package sun.dyn.anon;
179.30 -
179.31 -import java.io.IOException;
179.32 -import java.io.OutputStream;
179.33 -import java.util.Arrays;
179.34 -import java.util.HashSet;
179.35 -import java.util.IdentityHashMap;
179.36 -import java.util.Map;
179.37 -
179.38 -import static sun.dyn.anon.ConstantPoolVisitor.*;
179.39 -
179.40 -/** A class and its patched constant pool.
179.41 - *
179.42 - * This class allow to modify (patch) a constant pool
179.43 - * by changing the value of its entry.
179.44 - * Entry are referenced using index that can be get
179.45 - * by parsing the constant pool using
179.46 - * {@link ConstantPoolParser#parse(ConstantPoolVisitor)}.
179.47 - *
179.48 - * @see ConstantPoolVisitor
179.49 - * @see ConstantPoolParser#createPatch()
179.50 - */
179.51 -public class ConstantPoolPatch {
179.52 - final ConstantPoolParser outer;
179.53 - final Object[] patchArray;
179.54 -
179.55 - ConstantPoolPatch(ConstantPoolParser outer) {
179.56 - this.outer = outer;
179.57 - this.patchArray = new Object[outer.getLength()];
179.58 - }
179.59 -
179.60 - /** Create a {@link ConstantPoolParser} and
179.61 - * a {@link ConstantPoolPatch} in one step.
179.62 - * Equivalent to {@code new ConstantPoolParser(classFile).createPatch()}.
179.63 - *
179.64 - * @param classFile an array of bytes containing a class.
179.65 - * @see #ConstantPoolParser(Class)
179.66 - */
179.67 - public ConstantPoolPatch(byte[] classFile) throws InvalidConstantPoolFormatException {
179.68 - this(new ConstantPoolParser(classFile));
179.69 - }
179.70 -
179.71 - /** Create a {@link ConstantPoolParser} and
179.72 - * a {@link ConstantPoolPatch} in one step.
179.73 - * Equivalent to {@code new ConstantPoolParser(templateClass).createPatch()}.
179.74 - *
179.75 - * @param templateClass the class to parse.
179.76 - * @see #ConstantPoolParser(Class)
179.77 - */
179.78 - public ConstantPoolPatch(Class<?> templateClass) throws IOException, InvalidConstantPoolFormatException {
179.79 - this(new ConstantPoolParser(templateClass));
179.80 - }
179.81 -
179.82 -
179.83 - /** Creates a patch from an existing patch.
179.84 - * All changes are copied from that patch.
179.85 - * @param patch a patch
179.86 - *
179.87 - * @see ConstantPoolParser#createPatch()
179.88 - */
179.89 - public ConstantPoolPatch(ConstantPoolPatch patch) {
179.90 - outer = patch.outer;
179.91 - patchArray = patch.patchArray.clone();
179.92 - }
179.93 -
179.94 - /** Which parser built this patch? */
179.95 - public ConstantPoolParser getParser() {
179.96 - return outer;
179.97 - }
179.98 -
179.99 - /** Report the tag at the given index in the constant pool. */
179.100 - public byte getTag(int index) {
179.101 - return outer.getTag(index);
179.102 - }
179.103 -
179.104 - /** Report the current patch at the given index of the constant pool.
179.105 - * Null means no patch will be made.
179.106 - * To observe the unpatched entry at the given index, use
179.107 - * {@link #getParser()}{@code .}@link ConstantPoolParser#parse(ConstantPoolVisitor)}
179.108 - */
179.109 - public Object getPatch(int index) {
179.110 - Object value = patchArray[index];
179.111 - if (value == null) return null;
179.112 - switch (getTag(index)) {
179.113 - case CONSTANT_Fieldref:
179.114 - case CONSTANT_Methodref:
179.115 - case CONSTANT_InterfaceMethodref:
179.116 - if (value instanceof String)
179.117 - value = stripSemis(2, (String) value);
179.118 - break;
179.119 - case CONSTANT_NameAndType:
179.120 - if (value instanceof String)
179.121 - value = stripSemis(1, (String) value);
179.122 - break;
179.123 - }
179.124 - return value;
179.125 - }
179.126 -
179.127 - /** Clear all patches. */
179.128 - public void clear() {
179.129 - Arrays.fill(patchArray, null);
179.130 - }
179.131 -
179.132 - /** Clear one patch. */
179.133 - public void clear(int index) {
179.134 - patchArray[index] = null;
179.135 - }
179.136 -
179.137 - /** Produce the patches as an array. */
179.138 - public Object[] getPatches() {
179.139 - return patchArray.clone();
179.140 - }
179.141 -
179.142 - /** Produce the original constant pool as an array. */
179.143 - public Object[] getOriginalCP() throws InvalidConstantPoolFormatException {
179.144 - return getOriginalCP(0, patchArray.length, -1);
179.145 - }
179.146 -
179.147 - /** Walk the constant pool, applying patches using the given map.
179.148 - *
179.149 - * @param utf8Map Utf8 strings to modify, if encountered
179.150 - * @param classMap Classes (or their names) to modify, if encountered
179.151 - * @param valueMap Constant values to modify, if encountered
179.152 - * @param deleteUsedEntries if true, delete map entries that are used
179.153 - */
179.154 - public void putPatches(final Map<String,String> utf8Map,
179.155 - final Map<String,Object> classMap,
179.156 - final Map<Object,Object> valueMap,
179.157 - boolean deleteUsedEntries) throws InvalidConstantPoolFormatException {
179.158 - final HashSet<String> usedUtf8Keys;
179.159 - final HashSet<String> usedClassKeys;
179.160 - final HashSet<Object> usedValueKeys;
179.161 - if (deleteUsedEntries) {
179.162 - usedUtf8Keys = (utf8Map == null) ? null : new HashSet<String>();
179.163 - usedClassKeys = (classMap == null) ? null : new HashSet<String>();
179.164 - usedValueKeys = (valueMap == null) ? null : new HashSet<Object>();
179.165 - } else {
179.166 - usedUtf8Keys = null;
179.167 - usedClassKeys = null;
179.168 - usedValueKeys = null;
179.169 - }
179.170 -
179.171 - outer.parse(new ConstantPoolVisitor() {
179.172 -
179.173 - @Override
179.174 - public void visitUTF8(int index, byte tag, String utf8) {
179.175 - putUTF8(index, utf8Map.get(utf8));
179.176 - if (usedUtf8Keys != null) usedUtf8Keys.add(utf8);
179.177 - }
179.178 -
179.179 - @Override
179.180 - public void visitConstantValue(int index, byte tag, Object value) {
179.181 - putConstantValue(index, tag, valueMap.get(value));
179.182 - if (usedValueKeys != null) usedValueKeys.add(value);
179.183 - }
179.184 -
179.185 - @Override
179.186 - public void visitConstantString(int index, byte tag, String name, int nameIndex) {
179.187 - if (tag == CONSTANT_Class) {
179.188 - putConstantValue(index, tag, classMap.get(name));
179.189 - if (usedClassKeys != null) usedClassKeys.add(name);
179.190 - } else {
179.191 - assert(tag == CONSTANT_String);
179.192 - visitConstantValue(index, tag, name);
179.193 - }
179.194 - }
179.195 - });
179.196 - if (usedUtf8Keys != null) utf8Map.keySet().removeAll(usedUtf8Keys);
179.197 - if (usedClassKeys != null) classMap.keySet().removeAll(usedClassKeys);
179.198 - if (usedValueKeys != null) valueMap.keySet().removeAll(usedValueKeys);
179.199 - }
179.200 -
179.201 - Object[] getOriginalCP(final int startIndex,
179.202 - final int endIndex,
179.203 - final int tagMask) throws InvalidConstantPoolFormatException {
179.204 - final Object[] cpArray = new Object[endIndex - startIndex];
179.205 - outer.parse(new ConstantPoolVisitor() {
179.206 -
179.207 - void show(int index, byte tag, Object value) {
179.208 - if (index < startIndex || index >= endIndex) return;
179.209 - if (((1 << tag) & tagMask) == 0) return;
179.210 - cpArray[index - startIndex] = value;
179.211 - }
179.212 -
179.213 - @Override
179.214 - public void visitUTF8(int index, byte tag, String utf8) {
179.215 - show(index, tag, utf8);
179.216 - }
179.217 -
179.218 - @Override
179.219 - public void visitConstantValue(int index, byte tag, Object value) {
179.220 - assert(tag != CONSTANT_String);
179.221 - show(index, tag, value);
179.222 - }
179.223 -
179.224 - @Override
179.225 - public void visitConstantString(int index, byte tag,
179.226 - String value, int j) {
179.227 - show(index, tag, value);
179.228 - }
179.229 -
179.230 - @Override
179.231 - public void visitMemberRef(int index, byte tag,
179.232 - String className, String memberName,
179.233 - String signature,
179.234 - int j, int k) {
179.235 - show(index, tag, new String[]{ className, memberName, signature });
179.236 - }
179.237 -
179.238 - @Override
179.239 - public void visitDescriptor(int index, byte tag,
179.240 - String memberName, String signature,
179.241 - int j, int k) {
179.242 - show(index, tag, new String[]{ memberName, signature });
179.243 - }
179.244 - });
179.245 - return cpArray;
179.246 - }
179.247 -
179.248 - /** Write the head (header plus constant pool)
179.249 - * of the patched class file to the indicated stream.
179.250 - */
179.251 - void writeHead(OutputStream out) throws IOException {
179.252 - outer.writePatchedHead(out, patchArray);
179.253 - }
179.254 -
179.255 - /** Write the tail (everything after the constant pool)
179.256 - * of the patched class file to the indicated stream.
179.257 - */
179.258 - void writeTail(OutputStream out) throws IOException {
179.259 - outer.writeTail(out);
179.260 - }
179.261 -
179.262 - private void checkConstantTag(byte tag, Object value) {
179.263 - if (value == null)
179.264 - throw new IllegalArgumentException(
179.265 - "invalid null constant value");
179.266 - if (classForTag(tag) != value.getClass())
179.267 - throw new IllegalArgumentException(
179.268 - "invalid constant value"
179.269 - + (tag == CONSTANT_None ? ""
179.270 - : " for tag "+tagName(tag))
179.271 - + " of class "+value.getClass());
179.272 - }
179.273 -
179.274 - private void checkTag(int index, byte putTag) {
179.275 - byte tag = outer.tags[index];
179.276 - if (tag != putTag)
179.277 - throw new IllegalArgumentException(
179.278 - "invalid put operation"
179.279 - + " for " + tagName(putTag)
179.280 - + " at index " + index + " found " + tagName(tag));
179.281 - }
179.282 -
179.283 - private void checkTagMask(int index, int tagBitMask) {
179.284 - byte tag = outer.tags[index];
179.285 - int tagBit = ((tag & 0x1F) == tag) ? (1 << tag) : 0;
179.286 - if ((tagBit & tagBitMask) == 0)
179.287 - throw new IllegalArgumentException(
179.288 - "invalid put operation"
179.289 - + " at index " + index + " found " + tagName(tag));
179.290 - }
179.291 -
179.292 - private static void checkMemberName(String memberName) {
179.293 - if (memberName.indexOf(';') >= 0)
179.294 - throw new IllegalArgumentException("memberName " + memberName + " contains a ';'");
179.295 - }
179.296 -
179.297 - /** Set the entry of the constant pool indexed by index to
179.298 - * a new string.
179.299 - *
179.300 - * @param index an index to a constant pool entry containing a
179.301 - * {@link ConstantPoolVisitor#CONSTANT_Utf8} value.
179.302 - * @param utf8 a string
179.303 - *
179.304 - * @see ConstantPoolVisitor#visitUTF8(int, byte, String)
179.305 - */
179.306 - public void putUTF8(int index, String utf8) {
179.307 - if (utf8 == null) { clear(index); return; }
179.308 - checkTag(index, CONSTANT_Utf8);
179.309 - patchArray[index] = utf8;
179.310 - }
179.311 -
179.312 - /** Set the entry of the constant pool indexed by index to
179.313 - * a new value, depending on its dynamic type.
179.314 - *
179.315 - * @param index an index to a constant pool entry containing a
179.316 - * one of the following structures:
179.317 - * {@link ConstantPoolVisitor#CONSTANT_Integer},
179.318 - * {@link ConstantPoolVisitor#CONSTANT_Float},
179.319 - * {@link ConstantPoolVisitor#CONSTANT_Long},
179.320 - * {@link ConstantPoolVisitor#CONSTANT_Double},
179.321 - * {@link ConstantPoolVisitor#CONSTANT_String}, or
179.322 - * {@link ConstantPoolVisitor#CONSTANT_Class}
179.323 - * @param value a boxed int, float, long or double; or a string or class object
179.324 - * @throws IllegalArgumentException if the type of the constant does not
179.325 - * match the constant pool entry type,
179.326 - * as reported by {@link #getTag(int)}
179.327 - *
179.328 - * @see #putConstantValue(int, byte, Object)
179.329 - * @see ConstantPoolVisitor#visitConstantValue(int, byte, Object)
179.330 - * @see ConstantPoolVisitor#visitConstantString(int, byte, String, int)
179.331 - */
179.332 - public void putConstantValue(int index, Object value) {
179.333 - if (value == null) { clear(index); return; }
179.334 - byte tag = tagForConstant(value.getClass());
179.335 - checkConstantTag(tag, value);
179.336 - checkTag(index, tag);
179.337 - patchArray[index] = value;
179.338 - }
179.339 -
179.340 - /** Set the entry of the constant pool indexed by index to
179.341 - * a new value.
179.342 - *
179.343 - * @param index an index to a constant pool entry matching the given tag
179.344 - * @param tag one of the following values:
179.345 - * {@link ConstantPoolVisitor#CONSTANT_Integer},
179.346 - * {@link ConstantPoolVisitor#CONSTANT_Float},
179.347 - * {@link ConstantPoolVisitor#CONSTANT_Long},
179.348 - * {@link ConstantPoolVisitor#CONSTANT_Double},
179.349 - * {@link ConstantPoolVisitor#CONSTANT_String}, or
179.350 - * {@link ConstantPoolVisitor#CONSTANT_Class}
179.351 - * @param value a boxed number, string, or class object
179.352 - * @throws IllegalArgumentException if the type of the constant does not
179.353 - * match the constant pool entry type, or if a class name contains
179.354 - * '/' or ';'
179.355 - *
179.356 - * @see #putConstantValue(int, Object)
179.357 - * @see ConstantPoolVisitor#visitConstantValue(int, byte, Object)
179.358 - * @see ConstantPoolVisitor#visitConstantString(int, byte, String, int)
179.359 - */
179.360 - public void putConstantValue(int index, byte tag, Object value) {
179.361 - if (value == null) { clear(index); return; }
179.362 - checkTag(index, tag);
179.363 - if (tag == CONSTANT_Class && value instanceof String) {
179.364 - checkClassName((String) value);
179.365 - } else if (tag == CONSTANT_String) {
179.366 - // the JVM accepts any object as a patch for a string
179.367 - } else {
179.368 - // make sure the incoming value is the right type
179.369 - checkConstantTag(tag, value);
179.370 - }
179.371 - checkTag(index, tag);
179.372 - patchArray[index] = value;
179.373 - }
179.374 -
179.375 - /** Set the entry of the constant pool indexed by index to
179.376 - * a new {@link ConstantPoolVisitor#CONSTANT_NameAndType} value.
179.377 - *
179.378 - * @param index an index to a constant pool entry containing a
179.379 - * {@link ConstantPoolVisitor#CONSTANT_NameAndType} value.
179.380 - * @param memberName a memberName
179.381 - * @param signature a signature
179.382 - * @throws IllegalArgumentException if memberName contains the character ';'
179.383 - *
179.384 - * @see ConstantPoolVisitor#visitDescriptor(int, byte, String, String, int, int)
179.385 - */
179.386 - public void putDescriptor(int index, String memberName, String signature) {
179.387 - checkTag(index, CONSTANT_NameAndType);
179.388 - checkMemberName(memberName);
179.389 - patchArray[index] = addSemis(memberName, signature);
179.390 - }
179.391 -
179.392 - /** Set the entry of the constant pool indexed by index to
179.393 - * a new {@link ConstantPoolVisitor#CONSTANT_Fieldref},
179.394 - * {@link ConstantPoolVisitor#CONSTANT_Methodref}, or
179.395 - * {@link ConstantPoolVisitor#CONSTANT_InterfaceMethodref} value.
179.396 - *
179.397 - * @param index an index to a constant pool entry containing a member reference
179.398 - * @param className a class name
179.399 - * @param memberName a field or method name
179.400 - * @param signature a field or method signature
179.401 - * @throws IllegalArgumentException if memberName contains the character ';'
179.402 - * or signature is not a correct signature
179.403 - *
179.404 - * @see ConstantPoolVisitor#visitMemberRef(int, byte, String, String, String, int, int)
179.405 - */
179.406 - public void putMemberRef(int index, byte tag,
179.407 - String className, String memberName, String signature) {
179.408 - checkTagMask(tag, CONSTANT_MemberRef_MASK);
179.409 - checkTag(index, tag);
179.410 - checkClassName(className);
179.411 - checkMemberName(memberName);
179.412 - if (signature.startsWith("(") == (tag == CONSTANT_Fieldref))
179.413 - throw new IllegalArgumentException("bad signature: "+signature);
179.414 - patchArray[index] = addSemis(className, memberName, signature);
179.415 - }
179.416 -
179.417 - static private final int CONSTANT_MemberRef_MASK =
179.418 - CONSTANT_Fieldref
179.419 - | CONSTANT_Methodref
179.420 - | CONSTANT_InterfaceMethodref;
179.421 -
179.422 - private static final Map<Class<?>, Byte> CONSTANT_VALUE_CLASS_TAG
179.423 - = new IdentityHashMap<Class<?>, Byte>();
179.424 - private static final Class[] CONSTANT_VALUE_CLASS = new Class[16];
179.425 - static {
179.426 - Object[][] values = {
179.427 - {Integer.class, CONSTANT_Integer},
179.428 - {Long.class, CONSTANT_Long},
179.429 - {Float.class, CONSTANT_Float},
179.430 - {Double.class, CONSTANT_Double},
179.431 - {String.class, CONSTANT_String},
179.432 - {Class.class, CONSTANT_Class}
179.433 - };
179.434 - for (Object[] value : values) {
179.435 - Class<?> cls = (Class<?>)value[0];
179.436 - Byte tag = (Byte) value[1];
179.437 - CONSTANT_VALUE_CLASS_TAG.put(cls, tag);
179.438 - CONSTANT_VALUE_CLASS[(byte)tag] = cls;
179.439 - }
179.440 - }
179.441 -
179.442 - static Class<?> classForTag(byte tag) {
179.443 - if ((tag & 0xFF) >= CONSTANT_VALUE_CLASS.length)
179.444 - return null;
179.445 - return CONSTANT_VALUE_CLASS[tag];
179.446 - }
179.447 -
179.448 - static byte tagForConstant(Class<?> cls) {
179.449 - Byte tag = CONSTANT_VALUE_CLASS_TAG.get(cls);
179.450 - return (tag == null) ? CONSTANT_None : (byte)tag;
179.451 - }
179.452 -
179.453 - private static void checkClassName(String className) {
179.454 - if (className.indexOf('/') >= 0 || className.indexOf(';') >= 0)
179.455 - throw new IllegalArgumentException("invalid class name " + className);
179.456 - }
179.457 -
179.458 - static String addSemis(String name, String... names) {
179.459 - StringBuilder buf = new StringBuilder(name.length() * 5);
179.460 - buf.append(name);
179.461 - for (String name2 : names) {
179.462 - buf.append(';').append(name2);
179.463 - }
179.464 - String res = buf.toString();
179.465 - assert(stripSemis(names.length, res)[0].equals(name));
179.466 - assert(stripSemis(names.length, res)[1].equals(names[0]));
179.467 - assert(names.length == 1 ||
179.468 - stripSemis(names.length, res)[2].equals(names[1]));
179.469 - return res;
179.470 - }
179.471 -
179.472 - static String[] stripSemis(int count, String string) {
179.473 - String[] res = new String[count+1];
179.474 - int pos = 0;
179.475 - for (int i = 0; i < count; i++) {
179.476 - int pos2 = string.indexOf(';', pos);
179.477 - if (pos2 < 0) pos2 = string.length(); // yuck
179.478 - res[i] = string.substring(pos, pos2);
179.479 - pos = pos2;
179.480 - }
179.481 - res[count] = string.substring(pos);
179.482 - return res;
179.483 - }
179.484 -
179.485 - public String toString() {
179.486 - StringBuilder buf = new StringBuilder(this.getClass().getName());
179.487 - buf.append("{");
179.488 - Object[] origCP = null;
179.489 - for (int i = 0; i < patchArray.length; i++) {
179.490 - if (patchArray[i] == null) continue;
179.491 - if (origCP != null) {
179.492 - buf.append(", ");
179.493 - } else {
179.494 - try {
179.495 - origCP = getOriginalCP();
179.496 - } catch (InvalidConstantPoolFormatException ee) {
179.497 - origCP = new Object[0];
179.498 - }
179.499 - }
179.500 - Object orig = (i < origCP.length) ? origCP[i] : "?";
179.501 - buf.append(orig).append("=").append(patchArray[i]);
179.502 - }
179.503 - buf.append("}");
179.504 - return buf.toString();
179.505 - }
179.506 -}
180.1 --- a/src/share/classes/sun/dyn/anon/ConstantPoolVisitor.java Tue Mar 29 11:29:01 2011 -0700
180.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
180.3 @@ -1,192 +0,0 @@
180.4 -/*
180.5 - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
180.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
180.7 - *
180.8 - * This code is free software; you can redistribute it and/or modify it
180.9 - * under the terms of the GNU General Public License version 2 only, as
180.10 - * published by the Free Software Foundation. Oracle designates this
180.11 - * particular file as subject to the "Classpath" exception as provided
180.12 - * by Oracle in the LICENSE file that accompanied this code.
180.13 - *
180.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
180.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
180.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
180.17 - * version 2 for more details (a copy is included in the LICENSE file that
180.18 - * accompanied this code).
180.19 - *
180.20 - * You should have received a copy of the GNU General Public License version
180.21 - * 2 along with this work; if not, write to the Free Software Foundation,
180.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
180.23 - *
180.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
180.25 - * or visit www.oracle.com if you need additional information or have any
180.26 - * questions.
180.27 - */
180.28 -
180.29 -package sun.dyn.anon;
180.30 -
180.31 -/**
180.32 - * A visitor called by {@link ConstantPoolParser#parse(ConstantPoolVisitor)}
180.33 - * when a constant pool entry is parsed.
180.34 - * <p>
180.35 - * A visit* method is called when a constant pool entry is parsed.
180.36 - * The first argument is always the constant pool index.
180.37 - * The second argument is always the constant pool tag,
180.38 - * even for methods like {@link #visitUTF8(int, byte, String)} which only apply to one tag.
180.39 - * String arguments refer to Utf8 or NameAndType entries declared elsewhere,
180.40 - * and are always accompanied by the indexes of those entries.
180.41 - * <p>
180.42 - * The order of the calls to the visit* methods is not necessarily related
180.43 - * to the order of the entries in the constant pool.
180.44 - * If one entry has a reference to another entry, the latter (lower-level)
180.45 - * entry will be visited first.
180.46 - * <p>
180.47 - * The following table shows the relation between constant pool entry
180.48 - * types and the corresponding visit* methods:
180.49 - *
180.50 - * <table border=1 cellpadding=5 summary="constant pool visitor methods">
180.51 - * <tr><th>Tag(s)</th><th>Method</th></tr>
180.52 - * <tr>
180.53 - * <td>{@link #CONSTANT_Utf8}</td>
180.54 - * <td>{@link #visitUTF8(int, byte, String)}</td>
180.55 - * </tr><tr>
180.56 - * <td>{@link #CONSTANT_Integer}, {@link #CONSTANT_Float},
180.57 - * {@link #CONSTANT_Long}, {@link #CONSTANT_Double}</td>
180.58 - * <td>{@link #visitConstantValue(int, byte, Object)}</td>
180.59 - * </tr><tr>
180.60 - * <td>{@link #CONSTANT_String}, {@link #CONSTANT_Class}</td>
180.61 - * <td>{@link #visitConstantString(int, byte, String, int)}</td>
180.62 - * </tr><tr>
180.63 - * <td>{@link #CONSTANT_NameAndType}</td>
180.64 - * <td>{@link #visitDescriptor(int, byte, String, String, int, int)}</td>
180.65 - * </tr><tr>
180.66 - * <td>{@link #CONSTANT_Fieldref},
180.67 - * {@link #CONSTANT_Methodref},
180.68 - * {@link #CONSTANT_InterfaceMethodref}</td>
180.69 - * <td>{@link #visitMemberRef(int, byte, String, String, String, int, int)}</td>
180.70 - * </tr>
180.71 - * </table>
180.72 - *
180.73 - * @see ConstantPoolPatch
180.74 - * @author Remi Forax
180.75 - * @author jrose
180.76 - */
180.77 -public class ConstantPoolVisitor {
180.78 - /** Called each time an UTF8 constant pool entry is found.
180.79 - * @param index the constant pool index
180.80 - * @param tag always {@link #CONSTANT_Utf8}
180.81 - * @param utf8 string encoded in modified UTF-8 format passed as a {@code String}
180.82 - *
180.83 - * @see ConstantPoolPatch#putUTF8(int, String)
180.84 - */
180.85 - public void visitUTF8(int index, byte tag, String utf8) {
180.86 - // do nothing
180.87 - }
180.88 -
180.89 - /** Called for each constant pool entry that encodes an integer,
180.90 - * a float, a long, or a double.
180.91 - * Constant strings and classes are not managed by this method but
180.92 - * by {@link #visitConstantString(int, byte, String, int)}.
180.93 - *
180.94 - * @param index the constant pool index
180.95 - * @param tag one of {@link #CONSTANT_Integer},
180.96 - * {@link #CONSTANT_Float},
180.97 - * {@link #CONSTANT_Long},
180.98 - * or {@link #CONSTANT_Double}
180.99 - * @param value encoded value
180.100 - *
180.101 - * @see ConstantPoolPatch#putConstantValue(int, Object)
180.102 - */
180.103 - public void visitConstantValue(int index, byte tag, Object value) {
180.104 - // do nothing
180.105 - }
180.106 -
180.107 - /** Called for each constant pool entry that encodes a string or a class.
180.108 - * @param index the constant pool index
180.109 - * @param tag one of {@link #CONSTANT_String},
180.110 - * {@link #CONSTANT_Class},
180.111 - * @param name string body or class name (using dot separator)
180.112 - * @param nameIndex the index of the Utf8 string for the name
180.113 - *
180.114 - * @see ConstantPoolPatch#putConstantValue(int, byte, Object)
180.115 - */
180.116 - public void visitConstantString(int index, byte tag,
180.117 - String name, int nameIndex) {
180.118 - // do nothing
180.119 - }
180.120 -
180.121 - /** Called for each constant pool entry that encodes a name and type.
180.122 - * @param index the constant pool index
180.123 - * @param tag always {@link #CONSTANT_NameAndType}
180.124 - * @param memberName a field or method name
180.125 - * @param signature the member signature
180.126 - * @param memberNameIndex index of the Utf8 string for the member name
180.127 - * @param signatureIndex index of the Utf8 string for the signature
180.128 - *
180.129 - * @see ConstantPoolPatch#putDescriptor(int, String, String)
180.130 - */
180.131 - public void visitDescriptor(int index, byte tag,
180.132 - String memberName, String signature,
180.133 - int memberNameIndex, int signatureIndex) {
180.134 - // do nothing
180.135 - }
180.136 -
180.137 - /** Called for each constant pool entry that encodes a field or method.
180.138 - * @param index the constant pool index
180.139 - * @param tag one of {@link #CONSTANT_Fieldref},
180.140 - * or {@link #CONSTANT_Methodref},
180.141 - * or {@link #CONSTANT_InterfaceMethodref}
180.142 - * @param className the class name (using dot separator)
180.143 - * @param memberName name of the field or method
180.144 - * @param signature the field or method signature
180.145 - * @param classNameIndex index of the Utf8 string for the class name
180.146 - * @param descriptorIndex index of the NameAndType descriptor constant
180.147 - *
180.148 - * @see ConstantPoolPatch#putMemberRef(int, byte, String, String, String)
180.149 - */
180.150 - public void visitMemberRef(int index, byte tag,
180.151 - String className, String memberName, String signature,
180.152 - int classNameIndex, int descriptorIndex) {
180.153 - // do nothing
180.154 - }
180.155 -
180.156 - public static final byte
180.157 - CONSTANT_None = 0,
180.158 - CONSTANT_Utf8 = 1,
180.159 - //CONSTANT_Unicode = 2, /* unused */
180.160 - CONSTANT_Integer = 3,
180.161 - CONSTANT_Float = 4,
180.162 - CONSTANT_Long = 5,
180.163 - CONSTANT_Double = 6,
180.164 - CONSTANT_Class = 7,
180.165 - CONSTANT_String = 8,
180.166 - CONSTANT_Fieldref = 9,
180.167 - CONSTANT_Methodref = 10,
180.168 - CONSTANT_InterfaceMethodref = 11,
180.169 - CONSTANT_NameAndType = 12;
180.170 -
180.171 - private static String[] TAG_NAMES = {
180.172 - "Empty",
180.173 - "Utf8",
180.174 - null, //"Unicode",
180.175 - "Integer",
180.176 - "Float",
180.177 - "Long",
180.178 - "Double",
180.179 - "Class",
180.180 - "String",
180.181 - "Fieldref",
180.182 - "Methodref",
180.183 - "InterfaceMethodref",
180.184 - "NameAndType"
180.185 - };
180.186 -
180.187 - public static String tagName(byte tag) {
180.188 - String name = null;
180.189 - if ((tag & 0xFF) < TAG_NAMES.length)
180.190 - name = TAG_NAMES[tag];
180.191 - if (name == null)
180.192 - name = "Unknown#"+(tag&0xFF);
180.193 - return name;
180.194 - }
180.195 -}
181.1 --- a/src/share/classes/sun/dyn/anon/InvalidConstantPoolFormatException.java Tue Mar 29 11:29:01 2011 -0700
181.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
181.3 @@ -1,45 +0,0 @@
181.4 -/*
181.5 - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
181.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
181.7 - *
181.8 - * This code is free software; you can redistribute it and/or modify it
181.9 - * under the terms of the GNU General Public License version 2 only, as
181.10 - * published by the Free Software Foundation. Oracle designates this
181.11 - * particular file as subject to the "Classpath" exception as provided
181.12 - * by Oracle in the LICENSE file that accompanied this code.
181.13 - *
181.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
181.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
181.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
181.17 - * version 2 for more details (a copy is included in the LICENSE file that
181.18 - * accompanied this code).
181.19 - *
181.20 - * You should have received a copy of the GNU General Public License version
181.21 - * 2 along with this work; if not, write to the Free Software Foundation,
181.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
181.23 - *
181.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
181.25 - * or visit www.oracle.com if you need additional information or have any
181.26 - * questions.
181.27 - */
181.28 -
181.29 -package sun.dyn.anon;
181.30 -
181.31 -/** Exception used when there is an error in the constant pool
181.32 - * format.
181.33 - */
181.34 -public class InvalidConstantPoolFormatException extends Exception {
181.35 - private static final long serialVersionUID=-6103888330523770949L;
181.36 -
181.37 - public InvalidConstantPoolFormatException(String message,Throwable cause) {
181.38 - super(message,cause);
181.39 - }
181.40 -
181.41 - public InvalidConstantPoolFormatException(String message) {
181.42 - super(message);
181.43 - }
181.44 -
181.45 - public InvalidConstantPoolFormatException(Throwable cause) {
181.46 - super(cause);
181.47 - }
181.48 -}
182.1 --- a/src/share/classes/sun/dyn/empty/Empty.java Tue Mar 29 11:29:01 2011 -0700
182.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
182.3 @@ -1,40 +0,0 @@
182.4 -/*
182.5 - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
182.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
182.7 - *
182.8 - * This code is free software; you can redistribute it and/or modify it
182.9 - * under the terms of the GNU General Public License version 2 only, as
182.10 - * published by the Free Software Foundation. Oracle designates this
182.11 - * particular file as subject to the "Classpath" exception as provided
182.12 - * by Oracle in the LICENSE file that accompanied this code.
182.13 - *
182.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
182.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
182.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
182.17 - * version 2 for more details (a copy is included in the LICENSE file that
182.18 - * accompanied this code).
182.19 - *
182.20 - * You should have received a copy of the GNU General Public License version
182.21 - * 2 along with this work; if not, write to the Free Software Foundation,
182.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
182.23 - *
182.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
182.25 - * or visit www.oracle.com if you need additional information or have any
182.26 - * questions.
182.27 - */
182.28 -
182.29 -package sun.dyn.empty;
182.30 -
182.31 -/**
182.32 - * An empty class in an empty package.
182.33 - * Used as a proxy for unprivileged code, since making access checks
182.34 - * against it will only succeed against public methods in public types.
182.35 - * <p>
182.36 - * This class also stands (internally to sun.dyn) for the type of a
182.37 - * value that cannot be produced, because the expression of this type
182.38 - * always returns abnormally. (Cf. Nothing in the closures proposal.)
182.39 - * @author jrose
182.40 - */
182.41 -public class Empty {
182.42 - private Empty() { throw new InternalError(); }
182.43 -}
183.1 --- a/src/share/classes/sun/dyn/package-info.java Tue Mar 29 11:29:01 2011 -0700
183.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
183.3 @@ -1,31 +0,0 @@
183.4 -/*
183.5 - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
183.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
183.7 - *
183.8 - * This code is free software; you can redistribute it and/or modify it
183.9 - * under the terms of the GNU General Public License version 2 only, as
183.10 - * published by the Free Software Foundation. Oracle designates this
183.11 - * particular file as subject to the "Classpath" exception as provided
183.12 - * by Oracle in the LICENSE file that accompanied this code.
183.13 - *
183.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
183.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
183.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
183.17 - * version 2 for more details (a copy is included in the LICENSE file that
183.18 - * accompanied this code).
183.19 - *
183.20 - * You should have received a copy of the GNU General Public License version
183.21 - * 2 along with this work; if not, write to the Free Software Foundation,
183.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
183.23 - *
183.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
183.25 - * or visit www.oracle.com if you need additional information or have any
183.26 - * questions.
183.27 - */
183.28 -
183.29 -/**
183.30 - * Implementation details for JSR 292 RI, package java.dyn.
183.31 - * @author jrose
183.32 - */
183.33 -
183.34 -package sun.dyn;
184.1 --- a/src/share/classes/sun/dyn/util/BytecodeDescriptor.java Tue Mar 29 11:29:01 2011 -0700
184.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
184.3 @@ -1,137 +0,0 @@
184.4 -/*
184.5 - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
184.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
184.7 - *
184.8 - * This code is free software; you can redistribute it and/or modify it
184.9 - * under the terms of the GNU General Public License version 2 only, as
184.10 - * published by the Free Software Foundation. Oracle designates this
184.11 - * particular file as subject to the "Classpath" exception as provided
184.12 - * by Oracle in the LICENSE file that accompanied this code.
184.13 - *
184.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
184.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
184.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
184.17 - * version 2 for more details (a copy is included in the LICENSE file that
184.18 - * accompanied this code).
184.19 - *
184.20 - * You should have received a copy of the GNU General Public License version
184.21 - * 2 along with this work; if not, write to the Free Software Foundation,
184.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
184.23 - *
184.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
184.25 - * or visit www.oracle.com if you need additional information or have any
184.26 - * questions.
184.27 - */
184.28 -
184.29 -package sun.dyn.util;
184.30 -
184.31 -import java.dyn.MethodType;
184.32 -import java.util.ArrayList;
184.33 -import java.util.List;
184.34 -
184.35 -/**
184.36 - * Utility routines for dealing with bytecode-level signatures.
184.37 - * @author jrose
184.38 - */
184.39 -public class BytecodeDescriptor {
184.40 -
184.41 - private BytecodeDescriptor() { } // cannot instantiate
184.42 -
184.43 - public static List<Class<?>> parseMethod(String bytecodeSignature, ClassLoader loader) {
184.44 - return parseMethod(bytecodeSignature, 0, bytecodeSignature.length(), loader);
184.45 - }
184.46 -
184.47 - static List<Class<?>> parseMethod(String bytecodeSignature,
184.48 - int start, int end, ClassLoader loader) {
184.49 - if (loader == null)
184.50 - loader = ClassLoader.getSystemClassLoader();
184.51 - String str = bytecodeSignature;
184.52 - int[] i = {start};
184.53 - ArrayList<Class<?>> ptypes = new ArrayList<Class<?>>();
184.54 - if (i[0] < end && str.charAt(i[0]) == '(') {
184.55 - ++i[0]; // skip '('
184.56 - while (i[0] < end && str.charAt(i[0]) != ')') {
184.57 - Class<?> pt = parseSig(str, i, end, loader);
184.58 - if (pt == null || pt == void.class)
184.59 - parseError(str, "bad argument type");
184.60 - ptypes.add(pt);
184.61 - }
184.62 - ++i[0]; // skip ')'
184.63 - } else {
184.64 - parseError(str, "not a method type");
184.65 - }
184.66 - Class<?> rtype = parseSig(str, i, end, loader);
184.67 - if (rtype == null || i[0] != end)
184.68 - parseError(str, "bad return type");
184.69 - ptypes.add(rtype);
184.70 - return ptypes;
184.71 - }
184.72 -
184.73 - static private void parseError(String str, String msg) {
184.74 - throw new IllegalArgumentException("bad signature: "+str+": "+msg);
184.75 - }
184.76 -
184.77 - static private Class<?> parseSig(String str, int[] i, int end, ClassLoader loader) {
184.78 - if (i[0] == end) return null;
184.79 - char c = str.charAt(i[0]++);
184.80 - if (c == 'L') {
184.81 - int begc = i[0], endc = str.indexOf(';', begc);
184.82 - if (endc < 0) return null;
184.83 - i[0] = endc+1;
184.84 - String name = str.substring(begc, endc).replace('/', '.');
184.85 - try {
184.86 - return loader.loadClass(name);
184.87 - } catch (ClassNotFoundException ex) {
184.88 - throw new TypeNotPresentException(name, ex);
184.89 - }
184.90 - } else if (c == '[') {
184.91 - Class<?> t = parseSig(str, i, end, loader);
184.92 - if (t != null)
184.93 - t = java.lang.reflect.Array.newInstance(t, 0).getClass();
184.94 - return t;
184.95 - } else {
184.96 - return Wrapper.forBasicType(c).primitiveType();
184.97 - }
184.98 - }
184.99 -
184.100 - public static String unparse(Class<?> type) {
184.101 - StringBuilder sb = new StringBuilder();
184.102 - unparseSig(type, sb);
184.103 - return sb.toString();
184.104 - }
184.105 -
184.106 - public static String unparse(MethodType type) {
184.107 - return unparseMethod(type.returnType(), type.parameterList());
184.108 - }
184.109 -
184.110 - public static String unparse(Object type) {
184.111 - if (type instanceof Class<?>)
184.112 - return unparse((Class<?>) type);
184.113 - if (type instanceof MethodType)
184.114 - return unparse((MethodType) type);
184.115 - return (String) type;
184.116 - }
184.117 -
184.118 - public static String unparseMethod(Class<?> rtype, List<Class<?>> ptypes) {
184.119 - StringBuilder sb = new StringBuilder();
184.120 - sb.append('(');
184.121 - for (Class<?> pt : ptypes)
184.122 - unparseSig(pt, sb);
184.123 - sb.append(')');
184.124 - unparseSig(rtype, sb);
184.125 - return sb.toString();
184.126 - }
184.127 -
184.128 - static private void unparseSig(Class<?> t, StringBuilder sb) {
184.129 - char c = Wrapper.forBasicType(t).basicTypeChar();
184.130 - if (c != 'L') {
184.131 - sb.append(c);
184.132 - } else {
184.133 - boolean lsemi = (!t.isArray());
184.134 - if (lsemi) sb.append('L');
184.135 - sb.append(t.getName().replace('.', '/'));
184.136 - if (lsemi) sb.append(';');
184.137 - }
184.138 - }
184.139 -
184.140 -}
185.1 --- a/src/share/classes/sun/dyn/util/BytecodeName.java Tue Mar 29 11:29:01 2011 -0700
185.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
185.3 @@ -1,627 +0,0 @@
185.4 -/*
185.5 - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
185.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
185.7 - *
185.8 - * This code is free software; you can redistribute it and/or modify it
185.9 - * under the terms of the GNU General Public License version 2 only, as
185.10 - * published by the Free Software Foundation. Oracle designates this
185.11 - * particular file as subject to the "Classpath" exception as provided
185.12 - * by Oracle in the LICENSE file that accompanied this code.
185.13 - *
185.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
185.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
185.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
185.17 - * version 2 for more details (a copy is included in the LICENSE file that
185.18 - * accompanied this code).
185.19 - *
185.20 - * You should have received a copy of the GNU General Public License version
185.21 - * 2 along with this work; if not, write to the Free Software Foundation,
185.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
185.23 - *
185.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
185.25 - * or visit www.oracle.com if you need additional information or have any
185.26 - * questions.
185.27 - */
185.28 -
185.29 -package sun.dyn.util;
185.30 -
185.31 -/**
185.32 - * Utility routines for dealing with bytecode-level names.
185.33 - * Includes universal mangling rules for the JVM.
185.34 - *
185.35 - * <h3>Avoiding Dangerous Characters </h3>
185.36 - *
185.37 - * <p>
185.38 - * The JVM defines a very small set of characters which are illegal
185.39 - * in name spellings. We will slightly extend and regularize this set
185.40 - * into a group of <cite>dangerous characters</cite>.
185.41 - * These characters will then be replaced, in mangled names, by escape sequences.
185.42 - * In addition, accidental escape sequences must be further escaped.
185.43 - * Finally, a special prefix will be applied if and only if
185.44 - * the mangling would otherwise fail to begin with the escape character.
185.45 - * This happens to cover the corner case of the null string,
185.46 - * and also clearly marks symbols which need demangling.
185.47 - * </p>
185.48 - * <p>
185.49 - * Dangerous characters are the union of all characters forbidden
185.50 - * or otherwise restricted by the JVM specification,
185.51 - * plus their mates, if they are brackets
185.52 - * (<code><big><b>[</b></big></code> and <code><big><b>]</b></big></code>,
185.53 - * <code><big><b><</b></big></code> and <code><big><b>></b></big></code>),
185.54 - * plus, arbitrarily, the colon character <code><big><b>:</b></big></code>.
185.55 - * There is no distinction between type, method, and field names.
185.56 - * This makes it easier to convert between mangled names of different
185.57 - * types, since they do not need to be decoded (demangled).
185.58 - * </p>
185.59 - * <p>
185.60 - * The escape character is backslash <code><big><b>\</b></big></code>
185.61 - * (also known as reverse solidus).
185.62 - * This character is, until now, unheard of in bytecode names,
185.63 - * but traditional in the proposed role.
185.64 - *
185.65 - * </p>
185.66 - * <h3> Replacement Characters </h3>
185.67 - *
185.68 - *
185.69 - * <p>
185.70 - * Every escape sequence is two characters
185.71 - * (in fact, two UTF8 bytes) beginning with
185.72 - * the escape character and followed by a
185.73 - * <cite>replacement character</cite>.
185.74 - * (Since the replacement character is never a backslash,
185.75 - * iterated manglings do not double in size.)
185.76 - * </p>
185.77 - * <p>
185.78 - * Each dangerous character has some rough visual similarity
185.79 - * to its corresponding replacement character.
185.80 - * This makes mangled symbols easier to recognize by sight.
185.81 - * </p>
185.82 - * <p>
185.83 - * The dangerous characters are
185.84 - * <code><big><b>/</b></big></code> (forward slash, used to delimit package components),
185.85 - * <code><big><b>.</b></big></code> (dot, also a package delimiter),
185.86 - * <code><big><b>;</b></big></code> (semicolon, used in signatures),
185.87 - * <code><big><b>$</b></big></code> (dollar, used in inner classes and synthetic members),
185.88 - * <code><big><b><</b></big></code> (left angle),
185.89 - * <code><big><b>></b></big></code> (right angle),
185.90 - * <code><big><b>[</b></big></code> (left square bracket, used in array types),
185.91 - * <code><big><b>]</b></big></code> (right square bracket, reserved in this scheme for language use),
185.92 - * and <code><big><b>:</b></big></code> (colon, reserved in this scheme for language use).
185.93 - * Their replacements are, respectively,
185.94 - * <code><big><b>|</b></big></code> (vertical bar),
185.95 - * <code><big><b>,</b></big></code> (comma),
185.96 - * <code><big><b>?</b></big></code> (question mark),
185.97 - * <code><big><b>%</b></big></code> (percent),
185.98 - * <code><big><b>^</b></big></code> (caret),
185.99 - * <code><big><b>_</b></big></code> (underscore), and
185.100 - * <code><big><b>{</b></big></code> (left curly bracket),
185.101 - * <code><big><b>}</b></big></code> (right curly bracket),
185.102 - * <code><big><b>!</b></big></code> (exclamation mark).
185.103 - * In addition, the replacement character for the escape character itself is
185.104 - * <code><big><b>-</b></big></code> (hyphen),
185.105 - * and the replacement character for the null prefix is
185.106 - * <code><big><b>=</b></big></code> (equal sign).
185.107 - * </p>
185.108 - * <p>
185.109 - * An escape character <code><big><b>\</b></big></code>
185.110 - * followed by any of these replacement characters
185.111 - * is an escape sequence, and there are no other escape sequences.
185.112 - * An equal sign is only part of an escape sequence
185.113 - * if it is the second character in the whole string, following a backslash.
185.114 - * Two consecutive backslashes do <em>not</em> form an escape sequence.
185.115 - * </p>
185.116 - * <p>
185.117 - * Each escape sequence replaces a so-called <cite>original character</cite>
185.118 - * which is either one of the dangerous characters or the escape character.
185.119 - * A null prefix replaces an initial null string, not a character.
185.120 - * </p>
185.121 - * <p>
185.122 - * All this implies that escape sequences cannot overlap and may be
185.123 - * determined all at once for a whole string. Note that a spelling
185.124 - * string can contain <cite>accidental escapes</cite>, apparent escape
185.125 - * sequences which must not be interpreted as manglings.
185.126 - * These are disabled by replacing their leading backslash with an
185.127 - * escape sequence (<code><big><b>\-</b></big></code>). To mangle a string, three logical steps
185.128 - * are required, though they may be carried out in one pass:
185.129 - * </p>
185.130 - * <ol>
185.131 - * <li>In each accidental escape, replace the backslash with an escape sequence
185.132 - * (<code><big><b>\-</b></big></code>).</li>
185.133 - * <li>Replace each dangerous character with an escape sequence
185.134 - * (<code><big><b>\|</b></big></code> for <code><big><b>/</b></big></code>, etc.).</li>
185.135 - * <li>If the first two steps introduced any change, <em>and</em>
185.136 - * if the string does not already begin with a backslash, prepend a null prefix (<code><big><b>\=</b></big></code>).</li>
185.137 - * </ol>
185.138 - *
185.139 - * To demangle a mangled string that begins with an escape,
185.140 - * remove any null prefix, and then replace (in parallel)
185.141 - * each escape sequence by its original character.
185.142 - * <p>Spelling strings which contain accidental
185.143 - * escapes <em>must</em> have them replaced, even if those
185.144 - * strings do not contain dangerous characters.
185.145 - * This restriction means that mangling a string always
185.146 - * requires a scan of the string for escapes.
185.147 - * But then, a scan would be required anyway,
185.148 - * to check for dangerous characters.
185.149 - *
185.150 - * </p>
185.151 - * <h3> Nice Properties </h3>
185.152 - *
185.153 - * <p>
185.154 - * If a bytecode name does not contain any escape sequence,
185.155 - * demangling is a no-op: The string demangles to itself.
185.156 - * Such a string is called <cite>self-mangling</cite>.
185.157 - * Almost all strings are self-mangling.
185.158 - * In practice, to demangle almost any name “found in nature”,
185.159 - * simply verify that it does not begin with a backslash.
185.160 - * </p>
185.161 - * <p>
185.162 - * Mangling is a one-to-one function, while demangling
185.163 - * is a many-to-one function.
185.164 - * A mangled string is defined as <cite>validly mangled</cite> if
185.165 - * it is in fact the unique mangling of its spelling string.
185.166 - * Three examples of invalidly mangled strings are <code><big><b>\=foo</b></big></code>,
185.167 - * <code><big><b>\-bar</b></big></code>, and <code><big><b>baz\!</b></big></code>, which demangle to <code><big><b>foo</b></big></code>, <code><big><b>\bar</b></big></code>, and
185.168 - * <code><big><b>baz\!</b></big></code>, but then remangle to <code><big><b>foo</b></big></code>, <code><big><b>\bar</b></big></code>, and <code><big><b>\=baz\-!</b></big></code>.
185.169 - * If a language back-end or runtime is using mangled names,
185.170 - * it should never present an invalidly mangled bytecode
185.171 - * name to the JVM. If the runtime encounters one,
185.172 - * it should also report an error, since such an occurrence
185.173 - * probably indicates a bug in name encoding which
185.174 - * will lead to errors in linkage.
185.175 - * However, this note does not propose that the JVM verifier
185.176 - * detect invalidly mangled names.
185.177 - * </p>
185.178 - * <p>
185.179 - * As a result of these rules, it is a simple matter to
185.180 - * compute validly mangled substrings and concatenations
185.181 - * of validly mangled strings, and (with a little care)
185.182 - * these correspond to corresponding operations on their
185.183 - * spelling strings.
185.184 - * </p>
185.185 - * <ul>
185.186 - * <li>Any prefix of a validly mangled string is also validly mangled,
185.187 - * although a null prefix may need to be removed.</li>
185.188 - * <li>Any suffix of a validly mangled string is also validly mangled,
185.189 - * although a null prefix may need to be added.</li>
185.190 - * <li>Two validly mangled strings, when concatenated,
185.191 - * are also validly mangled, although any null prefix
185.192 - * must be removed from the second string,
185.193 - * and a trailing backslash on the first string may need escaping,
185.194 - * if it would participate in an accidental escape when followed
185.195 - * by the first character of the second string.</li>
185.196 - * </ul>
185.197 - * <p>If languages that include non-Java symbol spellings use this
185.198 - * mangling convention, they will enjoy the following advantages:
185.199 - * </p>
185.200 - * <ul>
185.201 - * <li>They can interoperate via symbols they share in common.</li>
185.202 - * <li>Low-level tools, such as backtrace printers, will have readable displays.</li>
185.203 - * <li>Future JVM and language extensions can safely use the dangerous characters
185.204 - * for structuring symbols, but will never interfere with valid spellings.</li>
185.205 - * <li>Runtimes and compilers can use standard libraries for mangling and demangling.</li>
185.206 - * <li>Occasional transliterations and name composition will be simple and regular,
185.207 - * for classes, methods, and fields.</li>
185.208 - * <li>Bytecode names will continue to be compact.
185.209 - * When mangled, spellings will at most double in length, either in
185.210 - * UTF8 or UTF16 format, and most will not change at all.</li>
185.211 - * </ul>
185.212 - *
185.213 - *
185.214 - * <h3> Suggestions for Human Readable Presentations </h3>
185.215 - *
185.216 - *
185.217 - * <p>
185.218 - * For human readable displays of symbols,
185.219 - * it will be better to present a string-like quoted
185.220 - * representation of the spelling, because JVM users
185.221 - * are generally familiar with such tokens.
185.222 - * We suggest using single or double quotes before and after
185.223 - * mangled symbols which are not valid Java identifiers,
185.224 - * with quotes, backslashes, and non-printing characters
185.225 - * escaped as if for literals in the Java language.
185.226 - * </p>
185.227 - * <p>
185.228 - * For example, an HTML-like spelling
185.229 - * <code><big><b><pre></b></big></code> mangles to
185.230 - * <code><big><b>\^pre\_</b></big></code> and could
185.231 - * display more cleanly as
185.232 - * <code><big><b>'<pre>'</b></big></code>,
185.233 - * with the quotes included.
185.234 - * Such string-like conventions are <em>not</em> suitable
185.235 - * for mangled bytecode names, in part because
185.236 - * dangerous characters must be eliminated, rather
185.237 - * than just quoted. Otherwise internally structured
185.238 - * strings like package prefixes and method signatures
185.239 - * could not be reliably parsed.
185.240 - * </p>
185.241 - * <p>
185.242 - * In such human-readable displays, invalidly mangled
185.243 - * names should <em>not</em> be demangled and quoted,
185.244 - * for this would be misleading. Likewise, JVM symbols
185.245 - * which contain dangerous characters (like dots in field
185.246 - * names or brackets in method names) should not be
185.247 - * simply quoted. The bytecode names
185.248 - * <code><big><b>\=phase\,1</b></big></code> and
185.249 - * <code><big><b>phase.1</b></big></code> are distinct,
185.250 - * and in demangled displays they should be presented as
185.251 - * <code><big><b>'phase.1'</b></big></code> and something like
185.252 - * <code><big><b>'phase'.1</b></big></code>, respectively.
185.253 - * </p>
185.254 - *
185.255 - * @author John Rose
185.256 - * @version 1.2, 02/06/2008
185.257 - * @see http://blogs.sun.com/jrose/entry/symbolic_freedom_in_the_vm
185.258 - */
185.259 -public class BytecodeName {
185.260 - private BytecodeName() { } // static only class
185.261 -
185.262 - /** Given a source name, produce the corresponding bytecode name.
185.263 - * The source name should not be qualified, because any syntactic
185.264 - * markers (dots, slashes, dollar signs, colons, etc.) will be mangled.
185.265 - * @param s the source name
185.266 - * @return a valid bytecode name which represents the source name
185.267 - */
185.268 - public static String toBytecodeName(String s) {
185.269 - String bn = mangle(s);
185.270 - assert((Object)bn == s || looksMangled(bn)) : bn;
185.271 - assert(s.equals(toSourceName(bn))) : s;
185.272 - return bn;
185.273 - }
185.274 -
185.275 - /** Given an unqualified bytecode name, produce the corresponding source name.
185.276 - * The bytecode name must not contain dangerous characters.
185.277 - * In particular, it must not be qualified or segmented by colon {@code ':'}.
185.278 - * @param s the bytecode name
185.279 - * @return the source name, which may possibly have unsafe characters
185.280 - * @throws IllegalArgumentException if the bytecode name is not {@link #isSafeBytecodeName safe}
185.281 - * @see #isSafeBytecodeName(java.lang.String)
185.282 - */
185.283 - public static String toSourceName(String s) {
185.284 - checkSafeBytecodeName(s);
185.285 - String sn = s;
185.286 - if (looksMangled(s)) {
185.287 - sn = demangle(s);
185.288 - assert(s.equals(mangle(sn))) : s+" => "+sn+" => "+mangle(sn);
185.289 - }
185.290 - return sn;
185.291 - }
185.292 -
185.293 - /**
185.294 - * Given a bytecode name from a classfile, separate it into
185.295 - * components delimited by dangerous characters.
185.296 - * Each resulting array element will be either a dangerous character,
185.297 - * or else a safe bytecode name.
185.298 - * (The safe name might possibly be mangled to hide further dangerous characters.)
185.299 - * For example, the qualified class name {@code java/lang/String}
185.300 - * will be parsed into the array {@code {"java", '/', "lang", '/', "String"}}.
185.301 - * The name {@code <init>} will be parsed into { '<', "init", '>'}}
185.302 - * The name {@code foo/bar$:baz} will be parsed into
185.303 - * {@code {"foo", '/', "bar", '$', ':', "baz"}}.
185.304 - * The name {@code ::\=:foo:\=bar\!baz} will be parsed into
185.305 - * {@code {':', ':', "", ':', "foo", ':', "bar:baz"}}.
185.306 - */
185.307 - public static Object[] parseBytecodeName(String s) {
185.308 - int slen = s.length();
185.309 - Object[] res = null;
185.310 - for (int pass = 0; pass <= 1; pass++) {
185.311 - int fillp = 0;
185.312 - int lasti = 0;
185.313 - for (int i = 0; i <= slen; i++) {
185.314 - int whichDC = -1;
185.315 - if (i < slen) {
185.316 - whichDC = DANGEROUS_CHARS.indexOf(s.charAt(i));
185.317 - if (whichDC < DANGEROUS_CHAR_FIRST_INDEX) continue;
185.318 - }
185.319 - // got to end of string or next dangerous char
185.320 - if (lasti < i) {
185.321 - // normal component
185.322 - if (pass != 0)
185.323 - res[fillp] = toSourceName(s.substring(lasti, i));
185.324 - fillp++;
185.325 - lasti = i+1;
185.326 - }
185.327 - if (whichDC >= DANGEROUS_CHAR_FIRST_INDEX) {
185.328 - if (pass != 0)
185.329 - res[fillp] = DANGEROUS_CHARS_CA[whichDC];
185.330 - fillp++;
185.331 - lasti = i+1;
185.332 - }
185.333 - }
185.334 - if (pass != 0) break;
185.335 - // between passes, build the result array
185.336 - res = new Object[fillp];
185.337 - if (fillp <= 1 && lasti == 0) {
185.338 - if (fillp != 0) res[0] = toSourceName(s);
185.339 - break;
185.340 - }
185.341 - }
185.342 - return res;
185.343 - }
185.344 -
185.345 - /**
185.346 - * Given a series of components, create a bytecode name for a classfile.
185.347 - * This is the inverse of {@link #parseBytecodeName(java.lang.String)}.
185.348 - * Each component must either be an interned one-character string of
185.349 - * a dangerous character, or else a safe bytecode name.
185.350 - * @param components a series of name components
185.351 - * @return the concatenation of all components
185.352 - * @throws IllegalArgumentException if any component contains an unsafe
185.353 - * character, and is not an interned one-character string
185.354 - * @throws NullPointerException if any component is null
185.355 - */
185.356 - public static String unparseBytecodeName(Object[] components) {
185.357 - Object[] components0 = components;
185.358 - for (int i = 0; i < components.length; i++) {
185.359 - Object c = components[i];
185.360 - if (c instanceof String) {
185.361 - String mc = toBytecodeName((String) c);
185.362 - if (i == 0 && components.length == 1)
185.363 - return mc; // usual case
185.364 - if ((Object)mc != c) {
185.365 - if (components == components0)
185.366 - components = components.clone();
185.367 - components[i] = c = mc;
185.368 - }
185.369 - }
185.370 - }
185.371 - return appendAll(components);
185.372 - }
185.373 - private static String appendAll(Object[] components) {
185.374 - if (components.length <= 1) {
185.375 - if (components.length == 1) {
185.376 - return String.valueOf(components[0]);
185.377 - }
185.378 - return "";
185.379 - }
185.380 - int slen = 0;
185.381 - for (Object c : components) {
185.382 - if (c instanceof String)
185.383 - slen += String.valueOf(c).length();
185.384 - else
185.385 - slen += 1;
185.386 - }
185.387 - StringBuilder sb = new StringBuilder(slen);
185.388 - for (Object c : components) {
185.389 - sb.append(c);
185.390 - }
185.391 - return sb.toString();
185.392 - }
185.393 -
185.394 - /**
185.395 - * Given a bytecode name, produce the corresponding display name.
185.396 - * This is the source name, plus quotes if needed.
185.397 - * If the bytecode name contains dangerous characters,
185.398 - * assume that they are being used as punctuation,
185.399 - * and pass them through unchanged.
185.400 - * Non-empty runs of non-dangerous characters are demangled
185.401 - * if necessary, and the resulting names are quoted if
185.402 - * they are not already valid Java identifiers, or if
185.403 - * they contain a dangerous character (i.e., dollar sign "$").
185.404 - * Single quotes are used when quoting.
185.405 - * Within quoted names, embedded single quotes and backslashes
185.406 - * are further escaped by prepended backslashes.
185.407 - *
185.408 - * @param s the original bytecode name (which may be qualified)
185.409 - * @return a human-readable presentation
185.410 - */
185.411 - public static String toDisplayName(String s) {
185.412 - Object[] components = parseBytecodeName(s);
185.413 - for (int i = 0; i < components.length; i++) {
185.414 - if (!(components[i] instanceof String))
185.415 - continue;
185.416 - String sn = (String) components[i];
185.417 - // note that the name is already demangled!
185.418 - //sn = toSourceName(sn);
185.419 - if (!isJavaIdent(sn) || sn.indexOf('$') >=0 ) {
185.420 - components[i] = quoteDisplay(sn);
185.421 - }
185.422 - }
185.423 - return appendAll(components);
185.424 - }
185.425 - private static boolean isJavaIdent(String s) {
185.426 - int slen = s.length();
185.427 - if (slen == 0) return false;
185.428 - if (!Character.isJavaIdentifierStart(s.charAt(0)))
185.429 - return false;
185.430 - for (int i = 1; i < slen; i++) {
185.431 - if (!Character.isJavaIdentifierPart(s.charAt(i)))
185.432 - return false;
185.433 - }
185.434 - return true;
185.435 - }
185.436 - private static String quoteDisplay(String s) {
185.437 - // TO DO: Replace wierd characters in s by C-style escapes.
185.438 - return "'"+s.replaceAll("['\\\\]", "\\\\$0")+"'";
185.439 - }
185.440 -
185.441 - private static void checkSafeBytecodeName(String s)
185.442 - throws IllegalArgumentException {
185.443 - if (!isSafeBytecodeName(s)) {
185.444 - throw new IllegalArgumentException(s);
185.445 - }
185.446 - }
185.447 -
185.448 - /**
185.449 - * Report whether a simple name is safe as a bytecode name.
185.450 - * Such names are acceptable in class files as class, method, and field names.
185.451 - * Additionally, they are free of "dangerous" characters, even if those
185.452 - * characters are legal in some (or all) names in class files.
185.453 - * @param s the proposed bytecode name
185.454 - * @return true if the name is non-empty and all of its characters are safe
185.455 - */
185.456 - public static boolean isSafeBytecodeName(String s) {
185.457 - if (s.length() == 0) return false;
185.458 - // check occurrences of each DANGEROUS char
185.459 - for (char xc : DANGEROUS_CHARS_A) {
185.460 - if (xc == ESCAPE_C) continue; // not really that dangerous
185.461 - if (s.indexOf(xc) >= 0) return false;
185.462 - }
185.463 - return true;
185.464 - }
185.465 -
185.466 - /**
185.467 - * Report whether a character is safe in a bytecode name.
185.468 - * This is true of any unicode character except the following
185.469 - * <em>dangerous characters</em>: {@code ".;:$[]<>/"}.
185.470 - * @param s the proposed character
185.471 - * @return true if the character is safe to use in classfiles
185.472 - */
185.473 - public static boolean isSafeBytecodeChar(char c) {
185.474 - return DANGEROUS_CHARS.indexOf(c) < DANGEROUS_CHAR_FIRST_INDEX;
185.475 - }
185.476 -
185.477 - private static boolean looksMangled(String s) {
185.478 - return s.charAt(0) == ESCAPE_C;
185.479 - }
185.480 -
185.481 - private static String mangle(String s) {
185.482 - if (s.length() == 0)
185.483 - return NULL_ESCAPE;
185.484 -
185.485 - // build this lazily, when we first need an escape:
185.486 - StringBuilder sb = null;
185.487 -
185.488 - for (int i = 0, slen = s.length(); i < slen; i++) {
185.489 - char c = s.charAt(i);
185.490 -
185.491 - boolean needEscape = false;
185.492 - if (c == ESCAPE_C) {
185.493 - if (i+1 < slen) {
185.494 - char c1 = s.charAt(i+1);
185.495 - if ((i == 0 && c1 == NULL_ESCAPE_C)
185.496 - || c1 != originalOfReplacement(c1)) {
185.497 - // an accidental escape
185.498 - needEscape = true;
185.499 - }
185.500 - }
185.501 - } else {
185.502 - needEscape = isDangerous(c);
185.503 - }
185.504 -
185.505 - if (!needEscape) {
185.506 - if (sb != null) sb.append(c);
185.507 - continue;
185.508 - }
185.509 -
185.510 - // build sb if this is the first escape
185.511 - if (sb == null) {
185.512 - sb = new StringBuilder(s.length()+10);
185.513 - // mangled names must begin with a backslash:
185.514 - if (s.charAt(0) != ESCAPE_C && i > 0)
185.515 - sb.append(NULL_ESCAPE);
185.516 - // append the string so far, which is unremarkable:
185.517 - sb.append(s.substring(0, i));
185.518 - }
185.519 -
185.520 - // rewrite \ to \-, / to \|, etc.
185.521 - sb.append(ESCAPE_C);
185.522 - sb.append(replacementOf(c));
185.523 - }
185.524 -
185.525 - if (sb != null) return sb.toString();
185.526 -
185.527 - return s;
185.528 - }
185.529 -
185.530 - private static String demangle(String s) {
185.531 - // build this lazily, when we first meet an escape:
185.532 - StringBuilder sb = null;
185.533 -
185.534 - int stringStart = 0;
185.535 - if (s.startsWith(NULL_ESCAPE))
185.536 - stringStart = 2;
185.537 -
185.538 - for (int i = stringStart, slen = s.length(); i < slen; i++) {
185.539 - char c = s.charAt(i);
185.540 -
185.541 - if (c == ESCAPE_C && i+1 < slen) {
185.542 - // might be an escape sequence
185.543 - char rc = s.charAt(i+1);
185.544 - char oc = originalOfReplacement(rc);
185.545 - if (oc != rc) {
185.546 - // build sb if this is the first escape
185.547 - if (sb == null) {
185.548 - sb = new StringBuilder(s.length());
185.549 - // append the string so far, which is unremarkable:
185.550 - sb.append(s.substring(stringStart, i));
185.551 - }
185.552 - ++i; // skip both characters
185.553 - c = oc;
185.554 - }
185.555 - }
185.556 -
185.557 - if (sb != null)
185.558 - sb.append(c);
185.559 - }
185.560 -
185.561 - if (sb != null) return sb.toString();
185.562 -
185.563 - return s.substring(stringStart);
185.564 - }
185.565 -
185.566 - static char ESCAPE_C = '\\';
185.567 - // empty escape sequence to avoid a null name or illegal prefix
185.568 - static char NULL_ESCAPE_C = '=';
185.569 - static String NULL_ESCAPE = ESCAPE_C+""+NULL_ESCAPE_C;
185.570 -
185.571 - static final String DANGEROUS_CHARS = "\\/.;:$[]<>"; // \\ must be first
185.572 - static final String REPLACEMENT_CHARS = "-|,?!%{}^_";
185.573 - static final int DANGEROUS_CHAR_FIRST_INDEX = 1; // index after \\
185.574 - static char[] DANGEROUS_CHARS_A = DANGEROUS_CHARS.toCharArray();
185.575 - static char[] REPLACEMENT_CHARS_A = REPLACEMENT_CHARS.toCharArray();
185.576 - static final Character[] DANGEROUS_CHARS_CA;
185.577 - static {
185.578 - Character[] dcca = new Character[DANGEROUS_CHARS.length()];
185.579 - for (int i = 0; i < dcca.length; i++)
185.580 - dcca[i] = Character.valueOf(DANGEROUS_CHARS.charAt(i));
185.581 - DANGEROUS_CHARS_CA = dcca;
185.582 - }
185.583 -
185.584 - static final long[] SPECIAL_BITMAP = new long[2]; // 128 bits
185.585 - static {
185.586 - String SPECIAL = DANGEROUS_CHARS + REPLACEMENT_CHARS;
185.587 - //System.out.println("SPECIAL = "+SPECIAL);
185.588 - for (char c : SPECIAL.toCharArray()) {
185.589 - SPECIAL_BITMAP[c >>> 6] |= 1L << c;
185.590 - }
185.591 - }
185.592 - static boolean isSpecial(char c) {
185.593 - if ((c >>> 6) < SPECIAL_BITMAP.length)
185.594 - return ((SPECIAL_BITMAP[c >>> 6] >> c) & 1) != 0;
185.595 - else
185.596 - return false;
185.597 - }
185.598 - static char replacementOf(char c) {
185.599 - if (!isSpecial(c)) return c;
185.600 - int i = DANGEROUS_CHARS.indexOf(c);
185.601 - if (i < 0) return c;
185.602 - return REPLACEMENT_CHARS.charAt(i);
185.603 - }
185.604 - static char originalOfReplacement(char c) {
185.605 - if (!isSpecial(c)) return c;
185.606 - int i = REPLACEMENT_CHARS.indexOf(c);
185.607 - if (i < 0) return c;
185.608 - return DANGEROUS_CHARS.charAt(i);
185.609 - }
185.610 - static boolean isDangerous(char c) {
185.611 - if (!isSpecial(c)) return false;
185.612 - return (DANGEROUS_CHARS.indexOf(c) >= DANGEROUS_CHAR_FIRST_INDEX);
185.613 - }
185.614 - static int indexOfDangerousChar(String s, int from) {
185.615 - for (int i = from, slen = s.length(); i < slen; i++) {
185.616 - if (isDangerous(s.charAt(i)))
185.617 - return i;
185.618 - }
185.619 - return -1;
185.620 - }
185.621 - static int lastIndexOfDangerousChar(String s, int from) {
185.622 - for (int i = Math.min(from, s.length()-1); i >= 0; i--) {
185.623 - if (isDangerous(s.charAt(i)))
185.624 - return i;
185.625 - }
185.626 - return -1;
185.627 - }
185.628 -
185.629 -
185.630 -}
186.1 --- a/src/share/classes/sun/dyn/util/ValueConversions.java Tue Mar 29 11:29:01 2011 -0700
186.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
186.3 @@ -1,807 +0,0 @@
186.4 -/*
186.5 - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
186.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
186.7 - *
186.8 - * This code is free software; you can redistribute it and/or modify it
186.9 - * under the terms of the GNU General Public License version 2 only, as
186.10 - * published by the Free Software Foundation. Oracle designates this
186.11 - * particular file as subject to the "Classpath" exception as provided
186.12 - * by Oracle in the LICENSE file that accompanied this code.
186.13 - *
186.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
186.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
186.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
186.17 - * version 2 for more details (a copy is included in the LICENSE file that
186.18 - * accompanied this code).
186.19 - *
186.20 - * You should have received a copy of the GNU General Public License version
186.21 - * 2 along with this work; if not, write to the Free Software Foundation,
186.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
186.23 - *
186.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
186.25 - * or visit www.oracle.com if you need additional information or have any
186.26 - * questions.
186.27 - */
186.28 -
186.29 -package sun.dyn.util;
186.30 -
186.31 -import java.dyn.*;
186.32 -import java.dyn.MethodHandles.Lookup;
186.33 -import java.util.ArrayList;
186.34 -import java.util.Arrays;
186.35 -import java.util.EnumMap;
186.36 -import java.util.List;
186.37 -import sun.dyn.Access;
186.38 -import sun.dyn.AdapterMethodHandle;
186.39 -import sun.dyn.MethodHandleImpl;
186.40 -import static sun.dyn.MemberName.uncaughtException;
186.41 -
186.42 -public class ValueConversions {
186.43 - private static final Access IMPL_TOKEN = Access.getToken();
186.44 - private static final Lookup IMPL_LOOKUP = MethodHandleImpl.getLookup(IMPL_TOKEN);
186.45 -
186.46 - private static EnumMap<Wrapper, MethodHandle>[] newWrapperCaches(int n) {
186.47 - @SuppressWarnings("unchecked")
186.48 - EnumMap<Wrapper, MethodHandle>[] caches
186.49 - = (EnumMap<Wrapper, MethodHandle>[]) new EnumMap[n]; // unchecked warning expected here
186.50 - for (int i = 0; i < n; i++)
186.51 - caches[i] = new EnumMap<Wrapper, MethodHandle>(Wrapper.class);
186.52 - return caches;
186.53 - }
186.54 -
186.55 - /// Converting references to values.
186.56 -
186.57 - static int unboxInteger(Object x) {
186.58 - if (x == null) return 0; // never NPE
186.59 - return ((Integer) x).intValue();
186.60 - }
186.61 -
186.62 - static byte unboxByte(Object x) {
186.63 - if (x == null) return 0; // never NPE
186.64 - return ((Byte) x).byteValue();
186.65 - }
186.66 -
186.67 - static short unboxShort(Object x) {
186.68 - if (x == null) return 0; // never NPE
186.69 - return ((Short) x).shortValue();
186.70 - }
186.71 -
186.72 - static boolean unboxBoolean(Object x) {
186.73 - if (x == null) return false; // never NPE
186.74 - return ((Boolean) x).booleanValue();
186.75 - }
186.76 -
186.77 - static char unboxCharacter(Object x) {
186.78 - if (x == null) return 0; // never NPE
186.79 - return ((Character) x).charValue();
186.80 - }
186.81 -
186.82 - static long unboxLong(Object x) {
186.83 - if (x == null) return 0; // never NPE
186.84 - return ((Long) x).longValue();
186.85 - }
186.86 -
186.87 - static float unboxFloat(Object x) {
186.88 - if (x == null) return 0; // never NPE
186.89 - return ((Float) x).floatValue();
186.90 - }
186.91 -
186.92 - static double unboxDouble(Object x) {
186.93 - if (x == null) return 0; // never NPE
186.94 - return ((Double) x).doubleValue();
186.95 - }
186.96 -
186.97 - /// Converting references to "raw" values.
186.98 - /// A raw primitive value is always an int or long.
186.99 -
186.100 - static int unboxByteRaw(Object x) {
186.101 - return unboxByte(x);
186.102 - }
186.103 -
186.104 - static int unboxShortRaw(Object x) {
186.105 - return unboxShort(x);
186.106 - }
186.107 -
186.108 - static int unboxBooleanRaw(Object x) {
186.109 - return unboxBoolean(x) ? 1 : 0;
186.110 - }
186.111 -
186.112 - static int unboxCharacterRaw(Object x) {
186.113 - return unboxCharacter(x);
186.114 - }
186.115 -
186.116 - static int unboxFloatRaw(Object x) {
186.117 - return Float.floatToIntBits(unboxFloat(x));
186.118 - }
186.119 -
186.120 - static long unboxDoubleRaw(Object x) {
186.121 - return Double.doubleToRawLongBits(unboxDouble(x));
186.122 - }
186.123 -
186.124 - private static MethodType unboxType(Wrapper wrap, boolean raw) {
186.125 - return MethodType.methodType(rawWrapper(wrap, raw).primitiveType(), wrap.wrapperType());
186.126 - }
186.127 -
186.128 - private static final EnumMap<Wrapper, MethodHandle>[]
186.129 - UNBOX_CONVERSIONS = newWrapperCaches(4);
186.130 -
186.131 - private static MethodHandle unbox(Wrapper wrap, boolean exact, boolean raw) {
186.132 - EnumMap<Wrapper, MethodHandle> cache = UNBOX_CONVERSIONS[(exact?1:0)+(raw?2:0)];
186.133 - MethodHandle mh = cache.get(wrap);
186.134 - if (mh != null) {
186.135 - return mh;
186.136 - }
186.137 - // slow path
186.138 - switch (wrap) {
186.139 - case OBJECT:
186.140 - mh = IDENTITY; break;
186.141 - case VOID:
186.142 - mh = raw ? ALWAYS_ZERO : IGNORE; break;
186.143 - case INT: case LONG:
186.144 - // these guys don't need separate raw channels
186.145 - if (raw) mh = unbox(wrap, exact, false);
186.146 - break;
186.147 - }
186.148 - if (mh != null) {
186.149 - cache.put(wrap, mh);
186.150 - return mh;
186.151 - }
186.152 - // look up the method
186.153 - String name = "unbox" + wrap.simpleName() + (raw ? "Raw" : "");
186.154 - MethodType type = unboxType(wrap, raw);
186.155 - if (!exact) {
186.156 - try {
186.157 - // actually, type is wrong; the Java method takes Object
186.158 - mh = IMPL_LOOKUP.findStatic(ValueConversions.class, name, type.erase());
186.159 - } catch (ReflectiveOperationException ex) {
186.160 - mh = null;
186.161 - }
186.162 - } else {
186.163 - mh = retype(type, unbox(wrap, !exact, raw));
186.164 - }
186.165 - if (mh != null) {
186.166 - cache.put(wrap, mh);
186.167 - return mh;
186.168 - }
186.169 - throw new IllegalArgumentException("cannot find unbox adapter for " + wrap + (raw ? " (raw)" : ""));
186.170 - }
186.171 -
186.172 - public static MethodHandle unbox(Wrapper type, boolean exact) {
186.173 - return unbox(type, exact, false);
186.174 - }
186.175 -
186.176 - public static MethodHandle unboxRaw(Wrapper type, boolean exact) {
186.177 - return unbox(type, exact, true);
186.178 - }
186.179 -
186.180 - public static MethodHandle unbox(Class<?> type, boolean exact) {
186.181 - return unbox(Wrapper.forPrimitiveType(type), exact, false);
186.182 - }
186.183 -
186.184 - public static MethodHandle unboxRaw(Class<?> type, boolean exact) {
186.185 - return unbox(Wrapper.forPrimitiveType(type), exact, true);
186.186 - }
186.187 -
186.188 - /// Converting primitives to references
186.189 -
186.190 - static Integer boxInteger(int x) {
186.191 - return x;
186.192 - }
186.193 -
186.194 - static Byte boxByte(byte x) {
186.195 - return x;
186.196 - }
186.197 -
186.198 - static Short boxShort(short x) {
186.199 - return x;
186.200 - }
186.201 -
186.202 - static Boolean boxBoolean(boolean x) {
186.203 - return x;
186.204 - }
186.205 -
186.206 - static Character boxCharacter(char x) {
186.207 - return x;
186.208 - }
186.209 -
186.210 - static Long boxLong(long x) {
186.211 - return x;
186.212 - }
186.213 -
186.214 - static Float boxFloat(float x) {
186.215 - return x;
186.216 - }
186.217 -
186.218 - static Double boxDouble(double x) {
186.219 - return x;
186.220 - }
186.221 -
186.222 - /// Converting raw primitives to references
186.223 -
186.224 - static Byte boxByteRaw(int x) {
186.225 - return boxByte((byte)x);
186.226 - }
186.227 -
186.228 - static Short boxShortRaw(int x) {
186.229 - return boxShort((short)x);
186.230 - }
186.231 -
186.232 - static Boolean boxBooleanRaw(int x) {
186.233 - return boxBoolean(x != 0);
186.234 - }
186.235 -
186.236 - static Character boxCharacterRaw(int x) {
186.237 - return boxCharacter((char)x);
186.238 - }
186.239 -
186.240 - static Float boxFloatRaw(int x) {
186.241 - return boxFloat(Float.intBitsToFloat(x));
186.242 - }
186.243 -
186.244 - static Double boxDoubleRaw(long x) {
186.245 - return boxDouble(Double.longBitsToDouble(x));
186.246 - }
186.247 -
186.248 - // a raw void value is (arbitrarily) a garbage int
186.249 - static Void boxVoidRaw(int x) {
186.250 - return null;
186.251 - }
186.252 -
186.253 - private static MethodType boxType(Wrapper wrap, boolean raw) {
186.254 - // be exact, since return casts are hard to compose
186.255 - Class<?> boxType = wrap.wrapperType();
186.256 - return MethodType.methodType(boxType, rawWrapper(wrap, raw).primitiveType());
186.257 - }
186.258 -
186.259 - private static Wrapper rawWrapper(Wrapper wrap, boolean raw) {
186.260 - if (raw) return wrap.isDoubleWord() ? Wrapper.LONG : Wrapper.INT;
186.261 - return wrap;
186.262 - }
186.263 -
186.264 - private static final EnumMap<Wrapper, MethodHandle>[]
186.265 - BOX_CONVERSIONS = newWrapperCaches(4);
186.266 -
186.267 - private static MethodHandle box(Wrapper wrap, boolean exact, boolean raw) {
186.268 - EnumMap<Wrapper, MethodHandle> cache = BOX_CONVERSIONS[(exact?1:0)+(raw?2:0)];
186.269 - MethodHandle mh = cache.get(wrap);
186.270 - if (mh != null) {
186.271 - return mh;
186.272 - }
186.273 - // slow path
186.274 - switch (wrap) {
186.275 - case OBJECT:
186.276 - mh = IDENTITY; break;
186.277 - case VOID:
186.278 - if (!raw) mh = ZERO_OBJECT;
186.279 - break;
186.280 - case INT: case LONG:
186.281 - // these guys don't need separate raw channels
186.282 - if (raw) mh = box(wrap, exact, false);
186.283 - break;
186.284 - }
186.285 - if (mh != null) {
186.286 - cache.put(wrap, mh);
186.287 - return mh;
186.288 - }
186.289 - // look up the method
186.290 - String name = "box" + wrap.simpleName() + (raw ? "Raw" : "");
186.291 - MethodType type = boxType(wrap, raw);
186.292 - if (exact) {
186.293 - try {
186.294 - mh = IMPL_LOOKUP.findStatic(ValueConversions.class, name, type);
186.295 - } catch (ReflectiveOperationException ex) {
186.296 - mh = null;
186.297 - }
186.298 - } else {
186.299 - mh = retype(type.erase(), box(wrap, !exact, raw));
186.300 - }
186.301 - if (mh != null) {
186.302 - cache.put(wrap, mh);
186.303 - return mh;
186.304 - }
186.305 - throw new IllegalArgumentException("cannot find box adapter for " + wrap + (raw ? " (raw)" : ""));
186.306 - }
186.307 -
186.308 - public static MethodHandle box(Class<?> type, boolean exact) {
186.309 - return box(Wrapper.forPrimitiveType(type), exact, false);
186.310 - }
186.311 -
186.312 - public static MethodHandle boxRaw(Class<?> type, boolean exact) {
186.313 - return box(Wrapper.forPrimitiveType(type), exact, true);
186.314 - }
186.315 -
186.316 - public static MethodHandle box(Wrapper type, boolean exact) {
186.317 - return box(type, exact, false);
186.318 - }
186.319 -
186.320 - public static MethodHandle boxRaw(Wrapper type, boolean exact) {
186.321 - return box(type, exact, true);
186.322 - }
186.323 -
186.324 - /// Kludges for when raw values get accidentally boxed.
186.325 -
186.326 - static int unboxRawInteger(Object x) {
186.327 - if (x instanceof Integer)
186.328 - return unboxInteger(x);
186.329 - else
186.330 - return (int) unboxLong(x);
186.331 - }
186.332 -
186.333 - static Integer reboxRawInteger(Object x) {
186.334 - if (x instanceof Integer)
186.335 - return (Integer) x;
186.336 - else
186.337 - return (int) unboxLong(x);
186.338 - }
186.339 -
186.340 - static Byte reboxRawByte(Object x) {
186.341 - if (x instanceof Byte) return (Byte) x;
186.342 - return boxByteRaw(unboxRawInteger(x));
186.343 - }
186.344 -
186.345 - static Short reboxRawShort(Object x) {
186.346 - if (x instanceof Short) return (Short) x;
186.347 - return boxShortRaw(unboxRawInteger(x));
186.348 - }
186.349 -
186.350 - static Boolean reboxRawBoolean(Object x) {
186.351 - if (x instanceof Boolean) return (Boolean) x;
186.352 - return boxBooleanRaw(unboxRawInteger(x));
186.353 - }
186.354 -
186.355 - static Character reboxRawCharacter(Object x) {
186.356 - if (x instanceof Character) return (Character) x;
186.357 - return boxCharacterRaw(unboxRawInteger(x));
186.358 - }
186.359 -
186.360 - static Float reboxRawFloat(Object x) {
186.361 - if (x instanceof Float) return (Float) x;
186.362 - return boxFloatRaw(unboxRawInteger(x));
186.363 - }
186.364 -
186.365 - static Long reboxRawLong(Object x) {
186.366 - return (Long) x; //never a rebox
186.367 - }
186.368 -
186.369 - static Double reboxRawDouble(Object x) {
186.370 - if (x instanceof Double) return (Double) x;
186.371 - return boxDoubleRaw(unboxLong(x));
186.372 - }
186.373 -
186.374 - private static MethodType reboxType(Wrapper wrap) {
186.375 - Class<?> boxType = wrap.wrapperType();
186.376 - return MethodType.methodType(boxType, Object.class);
186.377 - }
186.378 -
186.379 - private static final EnumMap<Wrapper, MethodHandle>[]
186.380 - REBOX_CONVERSIONS = newWrapperCaches(2);
186.381 -
186.382 - /**
186.383 - * Because we normalize primitive types to reduce the number of signatures,
186.384 - * primitives are sometimes manipulated under an "erased" type,
186.385 - * either int (for types other than long/double) or long (for all types).
186.386 - * When the erased primitive value is then boxed into an Integer or Long,
186.387 - * the final boxed primitive is sometimes required. This transformation
186.388 - * is called a "rebox". It takes an Integer or Long and produces some
186.389 - * other boxed value.
186.390 - */
186.391 - public static MethodHandle rebox(Wrapper wrap, boolean exact) {
186.392 - EnumMap<Wrapper, MethodHandle> cache = REBOX_CONVERSIONS[exact?1:0];
186.393 - MethodHandle mh = cache.get(wrap);
186.394 - if (mh != null) {
186.395 - return mh;
186.396 - }
186.397 - // slow path
186.398 - switch (wrap) {
186.399 - case OBJECT:
186.400 - mh = IDENTITY; break;
186.401 - case VOID:
186.402 - throw new IllegalArgumentException("cannot rebox a void");
186.403 - }
186.404 - if (mh != null) {
186.405 - cache.put(wrap, mh);
186.406 - return mh;
186.407 - }
186.408 - // look up the method
186.409 - String name = "reboxRaw" + wrap.simpleName();
186.410 - MethodType type = reboxType(wrap);
186.411 - if (exact) {
186.412 - try {
186.413 - mh = IMPL_LOOKUP.findStatic(ValueConversions.class, name, type);
186.414 - } catch (ReflectiveOperationException ex) {
186.415 - mh = null;
186.416 - }
186.417 - } else {
186.418 - mh = retype(IDENTITY.type(), rebox(wrap, !exact));
186.419 - }
186.420 - if (mh != null) {
186.421 - cache.put(wrap, mh);
186.422 - return mh;
186.423 - }
186.424 - throw new IllegalArgumentException("cannot find rebox adapter for " + wrap);
186.425 - }
186.426 -
186.427 - public static MethodHandle rebox(Class<?> type, boolean exact) {
186.428 - return rebox(Wrapper.forPrimitiveType(type), exact);
186.429 - }
186.430 -
186.431 - /// Width-changing conversions between int and long.
186.432 -
186.433 - static long widenInt(int x) {
186.434 - return (long) x;
186.435 - }
186.436 -
186.437 - static Long widenBoxedInt(Integer x) {
186.438 - return (long)(int)x;
186.439 - }
186.440 -
186.441 - static int narrowLong(long x) {
186.442 - return (int) x;
186.443 - }
186.444 -
186.445 - static Integer narrowBoxedLong(Long x) {
186.446 - return (int)(long) x;
186.447 - }
186.448 -
186.449 - /// Constant functions
186.450 -
186.451 - static void ignore(Object x) {
186.452 - // no value to return; this is an unbox of null
186.453 - return;
186.454 - }
186.455 -
186.456 - static void empty() {
186.457 - return;
186.458 - }
186.459 -
186.460 - static Object zeroObject() {
186.461 - return null;
186.462 - }
186.463 -
186.464 - static int zeroInteger() {
186.465 - return 0;
186.466 - }
186.467 -
186.468 - static long zeroLong() {
186.469 - return 0;
186.470 - }
186.471 -
186.472 - static float zeroFloat() {
186.473 - return 0;
186.474 - }
186.475 -
186.476 - static double zeroDouble() {
186.477 - return 0;
186.478 - }
186.479 -
186.480 - private static final EnumMap<Wrapper, MethodHandle>[]
186.481 - CONSTANT_FUNCTIONS = newWrapperCaches(2);
186.482 -
186.483 - public static MethodHandle zeroConstantFunction(Wrapper wrap) {
186.484 - EnumMap<Wrapper, MethodHandle> cache = CONSTANT_FUNCTIONS[0];
186.485 - MethodHandle mh = cache.get(wrap);
186.486 - if (mh != null) {
186.487 - return mh;
186.488 - }
186.489 - // slow path
186.490 - MethodType type = MethodType.methodType(wrap.primitiveType());
186.491 - switch (wrap) {
186.492 - case VOID:
186.493 - mh = EMPTY;
186.494 - break;
186.495 - case INT: case LONG: case FLOAT: case DOUBLE:
186.496 - try {
186.497 - mh = IMPL_LOOKUP.findStatic(ValueConversions.class, "zero"+wrap.simpleName(), type);
186.498 - } catch (ReflectiveOperationException ex) {
186.499 - mh = null;
186.500 - }
186.501 - break;
186.502 - }
186.503 - if (mh != null) {
186.504 - cache.put(wrap, mh);
186.505 - return mh;
186.506 - }
186.507 -
186.508 - // use the raw method
186.509 - Wrapper rawWrap = wrap.rawPrimitive();
186.510 - if (rawWrap != wrap) {
186.511 - mh = retype(type, zeroConstantFunction(rawWrap));
186.512 - }
186.513 - if (mh != null) {
186.514 - cache.put(wrap, mh);
186.515 - return mh;
186.516 - }
186.517 - throw new IllegalArgumentException("cannot find zero constant for " + wrap);
186.518 - }
186.519 -
186.520 - /// Converting references to references.
186.521 -
186.522 - /**
186.523 - * Value-killing function.
186.524 - * @param x an arbitrary reference value
186.525 - * @return a null
186.526 - */
186.527 - static Object alwaysNull(Object x) {
186.528 - return null;
186.529 - }
186.530 -
186.531 - /**
186.532 - * Value-killing function.
186.533 - * @param x an arbitrary reference value
186.534 - * @return a zero
186.535 - */
186.536 - static int alwaysZero(Object x) {
186.537 - return 0;
186.538 - }
186.539 -
186.540 - /**
186.541 - * Identity function.
186.542 - * @param x an arbitrary reference value
186.543 - * @return the same value x
186.544 - */
186.545 - static <T> T identity(T x) {
186.546 - return x;
186.547 - }
186.548 -
186.549 - /**
186.550 - * Identity function on ints.
186.551 - * @param x an arbitrary int value
186.552 - * @return the same value x
186.553 - */
186.554 - static int identity(int x) {
186.555 - return x;
186.556 - }
186.557 -
186.558 - /**
186.559 - * Identity function on longs.
186.560 - * @param x an arbitrary long value
186.561 - * @return the same value x
186.562 - */
186.563 - static long identity(long x) {
186.564 - return x;
186.565 - }
186.566 -
186.567 - /**
186.568 - * Identity function, with reference cast.
186.569 - * @param t an arbitrary reference type
186.570 - * @param x an arbitrary reference value
186.571 - * @return the same value x
186.572 - */
186.573 - static <T,U> T castReference(Class<? extends T> t, U x) {
186.574 - return t.cast(x);
186.575 - }
186.576 -
186.577 - private static final MethodHandle IDENTITY, IDENTITY_I, IDENTITY_J, CAST_REFERENCE, ALWAYS_NULL, ALWAYS_ZERO, ZERO_OBJECT, IGNORE, EMPTY;
186.578 - static {
186.579 - try {
186.580 - MethodType idType = MethodType.genericMethodType(1);
186.581 - MethodType castType = idType.insertParameterTypes(0, Class.class);
186.582 - MethodType alwaysZeroType = idType.changeReturnType(int.class);
186.583 - MethodType ignoreType = idType.changeReturnType(void.class);
186.584 - MethodType zeroObjectType = MethodType.genericMethodType(0);
186.585 - IDENTITY = IMPL_LOOKUP.findStatic(ValueConversions.class, "identity", idType);
186.586 - IDENTITY_I = IMPL_LOOKUP.findStatic(ValueConversions.class, "identity", MethodType.methodType(int.class, int.class));
186.587 - IDENTITY_J = IMPL_LOOKUP.findStatic(ValueConversions.class, "identity", MethodType.methodType(long.class, long.class));
186.588 - //CAST_REFERENCE = IMPL_LOOKUP.findVirtual(Class.class, "cast", idType);
186.589 - CAST_REFERENCE = IMPL_LOOKUP.findStatic(ValueConversions.class, "castReference", castType);
186.590 - ALWAYS_NULL = IMPL_LOOKUP.findStatic(ValueConversions.class, "alwaysNull", idType);
186.591 - ALWAYS_ZERO = IMPL_LOOKUP.findStatic(ValueConversions.class, "alwaysZero", alwaysZeroType);
186.592 - ZERO_OBJECT = IMPL_LOOKUP.findStatic(ValueConversions.class, "zeroObject", zeroObjectType);
186.593 - IGNORE = IMPL_LOOKUP.findStatic(ValueConversions.class, "ignore", ignoreType);
186.594 - EMPTY = IMPL_LOOKUP.findStatic(ValueConversions.class, "empty", ignoreType.dropParameterTypes(0, 1));
186.595 - } catch (Exception ex) {
186.596 - throw uncaughtException(ex);
186.597 - }
186.598 - }
186.599 -
186.600 - private static final EnumMap<Wrapper, MethodHandle> WRAPPER_CASTS
186.601 - = new EnumMap<Wrapper, MethodHandle>(Wrapper.class);
186.602 -
186.603 - private static final EnumMap<Wrapper, MethodHandle> EXACT_WRAPPER_CASTS
186.604 - = new EnumMap<Wrapper, MethodHandle>(Wrapper.class);
186.605 -
186.606 - /** Return a method that casts its sole argument (an Object) to the given type
186.607 - * and returns it as the given type (if exact is true), or as plain Object (if erase is true).
186.608 - */
186.609 - public static MethodHandle cast(Class<?> type, boolean exact) {
186.610 - if (type.isPrimitive()) throw new IllegalArgumentException("cannot cast primitive type "+type);
186.611 - MethodHandle mh = null;
186.612 - Wrapper wrap = null;
186.613 - EnumMap<Wrapper, MethodHandle> cache = null;
186.614 - if (Wrapper.isWrapperType(type)) {
186.615 - wrap = Wrapper.forWrapperType(type);
186.616 - cache = (exact ? EXACT_WRAPPER_CASTS : WRAPPER_CASTS);
186.617 - mh = cache.get(wrap);
186.618 - if (mh != null) return mh;
186.619 - }
186.620 - if (VerifyType.isNullReferenceConversion(Object.class, type))
186.621 - mh = IDENTITY;
186.622 - else if (VerifyType.isNullType(type))
186.623 - mh = ALWAYS_NULL;
186.624 - else
186.625 - mh = MethodHandles.insertArguments(CAST_REFERENCE, 0, type);
186.626 - if (exact) {
186.627 - MethodType xmt = MethodType.methodType(type, Object.class);
186.628 - mh = AdapterMethodHandle.makeRetypeRaw(IMPL_TOKEN, xmt, mh);
186.629 - }
186.630 - if (cache != null)
186.631 - cache.put(wrap, mh);
186.632 - return mh;
186.633 - }
186.634 -
186.635 - public static MethodHandle identity() {
186.636 - return IDENTITY;
186.637 - }
186.638 -
186.639 - public static MethodHandle identity(Class<?> type) {
186.640 - if (type == Object.class)
186.641 - return IDENTITY;
186.642 - else if (!type.isPrimitive())
186.643 - return retype(MethodType.methodType(type, type), IDENTITY);
186.644 - else
186.645 - return identity(Wrapper.forPrimitiveType(type));
186.646 - }
186.647 -
186.648 - static MethodHandle identity(Wrapper wrap) {
186.649 - EnumMap<Wrapper, MethodHandle> cache = CONSTANT_FUNCTIONS[1];
186.650 - MethodHandle mh = cache.get(wrap);
186.651 - if (mh != null) {
186.652 - return mh;
186.653 - }
186.654 - // slow path
186.655 - MethodType type = MethodType.methodType(wrap.primitiveType());
186.656 - if (wrap != Wrapper.VOID)
186.657 - type = type.appendParameterTypes(wrap.primitiveType());
186.658 - try {
186.659 - mh = IMPL_LOOKUP.findStatic(ValueConversions.class, "identity", type);
186.660 - } catch (ReflectiveOperationException ex) {
186.661 - mh = null;
186.662 - }
186.663 - if (mh == null && wrap == Wrapper.VOID) {
186.664 - mh = EMPTY; // #(){} : #()void
186.665 - }
186.666 - if (mh != null) {
186.667 - cache.put(wrap, mh);
186.668 - return mh;
186.669 - }
186.670 -
186.671 - // use a raw conversion
186.672 - if (wrap.isSingleWord() && wrap != Wrapper.INT) {
186.673 - mh = retype(type, identity(Wrapper.INT));
186.674 - } else if (wrap.isDoubleWord() && wrap != Wrapper.LONG) {
186.675 - mh = retype(type, identity(Wrapper.LONG));
186.676 - }
186.677 - if (mh != null) {
186.678 - cache.put(wrap, mh);
186.679 - return mh;
186.680 - }
186.681 - throw new IllegalArgumentException("cannot find identity for " + wrap);
186.682 - }
186.683 -
186.684 - private static MethodHandle retype(MethodType type, MethodHandle mh) {
186.685 - return AdapterMethodHandle.makeRetypeRaw(IMPL_TOKEN, type, mh);
186.686 - }
186.687 -
186.688 - private static final Object[] NO_ARGS_ARRAY = {};
186.689 - private static Object[] makeArray(Object... args) { return args; }
186.690 - private static Object[] array() { return NO_ARGS_ARRAY; }
186.691 - private static Object[] array(Object a0)
186.692 - { return makeArray(a0); }
186.693 - private static Object[] array(Object a0, Object a1)
186.694 - { return makeArray(a0, a1); }
186.695 - private static Object[] array(Object a0, Object a1, Object a2)
186.696 - { return makeArray(a0, a1, a2); }
186.697 - private static Object[] array(Object a0, Object a1, Object a2, Object a3)
186.698 - { return makeArray(a0, a1, a2, a3); }
186.699 - private static Object[] array(Object a0, Object a1, Object a2, Object a3,
186.700 - Object a4)
186.701 - { return makeArray(a0, a1, a2, a3, a4); }
186.702 - private static Object[] array(Object a0, Object a1, Object a2, Object a3,
186.703 - Object a4, Object a5)
186.704 - { return makeArray(a0, a1, a2, a3, a4, a5); }
186.705 - private static Object[] array(Object a0, Object a1, Object a2, Object a3,
186.706 - Object a4, Object a5, Object a6)
186.707 - { return makeArray(a0, a1, a2, a3, a4, a5, a6); }
186.708 - private static Object[] array(Object a0, Object a1, Object a2, Object a3,
186.709 - Object a4, Object a5, Object a6, Object a7)
186.710 - { return makeArray(a0, a1, a2, a3, a4, a5, a6, a7); }
186.711 - private static Object[] array(Object a0, Object a1, Object a2, Object a3,
186.712 - Object a4, Object a5, Object a6, Object a7,
186.713 - Object a8)
186.714 - { return makeArray(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
186.715 - private static Object[] array(Object a0, Object a1, Object a2, Object a3,
186.716 - Object a4, Object a5, Object a6, Object a7,
186.717 - Object a8, Object a9)
186.718 - { return makeArray(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
186.719 - static MethodHandle[] makeArrays() {
186.720 - ArrayList<MethodHandle> arrays = new ArrayList<MethodHandle>();
186.721 - MethodHandles.Lookup lookup = IMPL_LOOKUP;
186.722 - for (;;) {
186.723 - int nargs = arrays.size();
186.724 - MethodType type = MethodType.genericMethodType(nargs).changeReturnType(Object[].class);
186.725 - String name = "array";
186.726 - MethodHandle array = null;
186.727 - try {
186.728 - array = lookup.findStatic(ValueConversions.class, name, type);
186.729 - } catch (ReflectiveOperationException ex) {
186.730 - }
186.731 - if (array == null) break;
186.732 - arrays.add(array);
186.733 - }
186.734 - assert(arrays.size() == 11); // current number of methods
186.735 - return arrays.toArray(new MethodHandle[0]);
186.736 - }
186.737 - static final MethodHandle[] ARRAYS = makeArrays();
186.738 -
186.739 - /** Return a method handle that takes the indicated number of Object
186.740 - * arguments and returns an Object array of them, as if for varargs.
186.741 - */
186.742 - public static MethodHandle varargsArray(int nargs) {
186.743 - if (nargs < ARRAYS.length)
186.744 - return ARRAYS[nargs];
186.745 - // else need to spin bytecode or do something else fancy
186.746 - throw new UnsupportedOperationException("NYI: cannot form a varargs array of length "+nargs);
186.747 - }
186.748 -
186.749 - private static final List<Object> NO_ARGS_LIST = Arrays.asList(NO_ARGS_ARRAY);
186.750 - private static List<Object> makeList(Object... args) { return Arrays.asList(args); }
186.751 - private static List<Object> list() { return NO_ARGS_LIST; }
186.752 - private static List<Object> list(Object a0)
186.753 - { return makeList(a0); }
186.754 - private static List<Object> list(Object a0, Object a1)
186.755 - { return makeList(a0, a1); }
186.756 - private static List<Object> list(Object a0, Object a1, Object a2)
186.757 - { return makeList(a0, a1, a2); }
186.758 - private static List<Object> list(Object a0, Object a1, Object a2, Object a3)
186.759 - { return makeList(a0, a1, a2, a3); }
186.760 - private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
186.761 - Object a4)
186.762 - { return makeList(a0, a1, a2, a3, a4); }
186.763 - private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
186.764 - Object a4, Object a5)
186.765 - { return makeList(a0, a1, a2, a3, a4, a5); }
186.766 - private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
186.767 - Object a4, Object a5, Object a6)
186.768 - { return makeList(a0, a1, a2, a3, a4, a5, a6); }
186.769 - private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
186.770 - Object a4, Object a5, Object a6, Object a7)
186.771 - { return makeList(a0, a1, a2, a3, a4, a5, a6, a7); }
186.772 - private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
186.773 - Object a4, Object a5, Object a6, Object a7,
186.774 - Object a8)
186.775 - { return makeList(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
186.776 - private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
186.777 - Object a4, Object a5, Object a6, Object a7,
186.778 - Object a8, Object a9)
186.779 - { return makeList(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
186.780 - static MethodHandle[] makeLists() {
186.781 - ArrayList<MethodHandle> arrays = new ArrayList<MethodHandle>();
186.782 - MethodHandles.Lookup lookup = IMPL_LOOKUP;
186.783 - for (;;) {
186.784 - int nargs = arrays.size();
186.785 - MethodType type = MethodType.genericMethodType(nargs).changeReturnType(List.class);
186.786 - String name = "list";
186.787 - MethodHandle array = null;
186.788 - try {
186.789 - array = lookup.findStatic(ValueConversions.class, name, type);
186.790 - } catch (ReflectiveOperationException ex) {
186.791 - }
186.792 - if (array == null) break;
186.793 - arrays.add(array);
186.794 - }
186.795 - assert(arrays.size() == 11); // current number of methods
186.796 - return arrays.toArray(new MethodHandle[0]);
186.797 - }
186.798 - static final MethodHandle[] LISTS = makeLists();
186.799 -
186.800 - /** Return a method handle that takes the indicated number of Object
186.801 - * arguments and returns List.
186.802 - */
186.803 - public static MethodHandle varargsList(int nargs) {
186.804 - if (nargs < LISTS.length)
186.805 - return LISTS[nargs];
186.806 - // else need to spin bytecode or do something else fancy
186.807 - throw new UnsupportedOperationException("NYI");
186.808 - }
186.809 -}
186.810 -
187.1 --- a/src/share/classes/sun/dyn/util/VerifyAccess.java Tue Mar 29 11:29:01 2011 -0700
187.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
187.3 @@ -1,213 +0,0 @@
187.4 -/*
187.5 - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
187.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
187.7 - *
187.8 - * This code is free software; you can redistribute it and/or modify it
187.9 - * under the terms of the GNU General Public License version 2 only, as
187.10 - * published by the Free Software Foundation. Oracle designates this
187.11 - * particular file as subject to the "Classpath" exception as provided
187.12 - * by Oracle in the LICENSE file that accompanied this code.
187.13 - *
187.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
187.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
187.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
187.17 - * version 2 for more details (a copy is included in the LICENSE file that
187.18 - * accompanied this code).
187.19 - *
187.20 - * You should have received a copy of the GNU General Public License version
187.21 - * 2 along with this work; if not, write to the Free Software Foundation,
187.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
187.23 - *
187.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
187.25 - * or visit www.oracle.com if you need additional information or have any
187.26 - * questions.
187.27 - */
187.28 -
187.29 -package sun.dyn.util;
187.30 -
187.31 -import java.lang.reflect.Modifier;
187.32 -import sun.dyn.MemberName;
187.33 -import sun.dyn.MethodHandleImpl;
187.34 -import sun.dyn.empty.Empty;
187.35 -import static java.lang.reflect.Modifier.*;
187.36 -
187.37 -/**
187.38 - * This class centralizes information about the JVM's linkage access control.
187.39 - * @author jrose
187.40 - */
187.41 -public class VerifyAccess {
187.42 -
187.43 - private VerifyAccess() { } // cannot instantiate
187.44 -
187.45 - private static final int PACKAGE_ONLY = 0;
187.46 - private static final int ALL_ACCESS_MODES = (PUBLIC|PRIVATE|PROTECTED|PACKAGE_ONLY);
187.47 - private static final boolean ALLOW_NESTMATE_ACCESS = false;
187.48 -
187.49 - /**
187.50 - * Evaluate the JVM linkage rules for access to the given method
187.51 - * on behalf of a caller class which proposes to perform the access.
187.52 - * Return true if the caller class has privileges to invoke a method
187.53 - * or access a field with the given properties.
187.54 - * This requires an accessibility check of the referencing class,
187.55 - * plus an accessibility check of the member within the class,
187.56 - * which depends on the member's modifier flags.
187.57 - * <p>
187.58 - * The relevant properties include the defining class ({@code defc})
187.59 - * of the member, and its modifier flags ({@code mods}).
187.60 - * Also relevant is the class used to make the initial symbolic reference
187.61 - * to the member ({@code refc}). If this latter class is not distinguished,
187.62 - * the defining class should be passed for both arguments ({@code defc == refc}).
187.63 - * <h3>JVM Specification, 5.4.4 "Access Control"</h3>
187.64 - * A field or method R is accessible to a class or interface D if
187.65 - * and only if any of the following conditions is true:<ul>
187.66 - * <li>R is public.
187.67 - * <li>R is protected and is declared in a class C, and D is either
187.68 - * a subclass of C or C itself. Furthermore, if R is not
187.69 - * static, then the symbolic reference to R must contain a
187.70 - * symbolic reference to a class T, such that T is either a
187.71 - * subclass of D, a superclass of D or D itself.
187.72 - * <li>R is either protected or has default access (that is,
187.73 - * neither public nor protected nor private), and is declared
187.74 - * by a class in the same runtime package as D.
187.75 - * <li>R is private and is declared in D.
187.76 - * </ul>
187.77 - * This discussion of access control omits a related restriction
187.78 - * on the target of a protected field access or method invocation
187.79 - * (the target must be of class D or a subtype of D). That
187.80 - * requirement is checked as part of the verification process
187.81 - * (5.4.1); it is not part of link-time access control.
187.82 - * @param refc the class used in the symbolic reference to the proposed member
187.83 - * @param defc the class in which the proposed member is actually defined
187.84 - * @param mods modifier flags for the proposed member
187.85 - * @param lookupClass the class for which the access check is being made
187.86 - * @return true iff the the accessing class can access such a member
187.87 - */
187.88 - public static boolean isMemberAccessible(Class<?> refc, // symbolic ref class
187.89 - Class<?> defc, // actual def class
187.90 - int mods, // actual member mods
187.91 - Class<?> lookupClass) {
187.92 - // Usually refc and defc are the same, but if they differ, verify them both.
187.93 - if (refc != defc) {
187.94 - if (!isClassAccessible(refc, lookupClass)) {
187.95 - // Note that defc is verified in the switch below.
187.96 - return false;
187.97 - }
187.98 - if ((mods & (ALL_ACCESS_MODES|STATIC)) == (PROTECTED|STATIC)) {
187.99 - // Apply the special rules for refc here.
187.100 - if (!isRelatedClass(refc, lookupClass))
187.101 - return isSamePackage(defc, lookupClass);
187.102 - // If refc == defc, the call to isPublicSuperClass will do
187.103 - // the whole job, since in that case refc (as defc) will be
187.104 - // a superclass of the lookup class.
187.105 - }
187.106 - }
187.107 - if (defc == lookupClass)
187.108 - return true; // easy check; all self-access is OK
187.109 - switch (mods & ALL_ACCESS_MODES) {
187.110 - case PUBLIC:
187.111 - if (refc != defc) return true; // already checked above
187.112 - return isClassAccessible(refc, lookupClass);
187.113 - case PROTECTED:
187.114 - return isSamePackage(defc, lookupClass) || isPublicSuperClass(defc, lookupClass);
187.115 - case PACKAGE_ONLY:
187.116 - return isSamePackage(defc, lookupClass);
187.117 - case PRIVATE:
187.118 - // Loosened rules for privates follows access rules for inner classes.
187.119 - return (ALLOW_NESTMATE_ACCESS &&
187.120 - isSamePackageMember(defc, lookupClass));
187.121 - default:
187.122 - throw new IllegalArgumentException("bad modifiers: "+Modifier.toString(mods));
187.123 - }
187.124 - }
187.125 -
187.126 - static boolean isRelatedClass(Class<?> refc, Class<?> lookupClass) {
187.127 - return (refc == lookupClass ||
187.128 - refc.isAssignableFrom(lookupClass) ||
187.129 - lookupClass.isAssignableFrom(refc));
187.130 - }
187.131 -
187.132 - static boolean isPublicSuperClass(Class<?> defc, Class<?> lookupClass) {
187.133 - return isPublic(defc.getModifiers()) && defc.isAssignableFrom(lookupClass);
187.134 - }
187.135 -
187.136 - /**
187.137 - * Evaluate the JVM linkage rules for access to the given class on behalf of caller.
187.138 - * <h3>JVM Specification, 5.4.4 "Access Control"</h3>
187.139 - * A class or interface C is accessible to a class or interface D
187.140 - * if and only if either of the following conditions are true:<ul>
187.141 - * <li>C is public.
187.142 - * <li>C and D are members of the same runtime package.
187.143 - * </ul>
187.144 - * @param refc the symbolic reference class to which access is being checked (C)
187.145 - * @param lookupClass the class performing the lookup (D)
187.146 - */
187.147 - public static boolean isClassAccessible(Class<?> refc, Class<?> lookupClass) {
187.148 - int mods = refc.getModifiers();
187.149 - if (isPublic(mods))
187.150 - return true;
187.151 - if (isSamePackage(lookupClass, refc))
187.152 - return true;
187.153 - return false;
187.154 - }
187.155 -
187.156 - /**
187.157 - * Test if two classes have the same class loader and package qualifier.
187.158 - * @param class1
187.159 - * @param class2
187.160 - * @return whether they are in the same package
187.161 - */
187.162 - public static boolean isSamePackage(Class<?> class1, Class<?> class2) {
187.163 - if (class1 == class2)
187.164 - return true;
187.165 - if (!loadersAreRelated(class1.getClassLoader(), class2.getClassLoader()))
187.166 - return false;
187.167 - String name1 = class1.getName(), name2 = class2.getName();
187.168 - int dot = name1.lastIndexOf('.');
187.169 - if (dot != name2.lastIndexOf('.'))
187.170 - return false;
187.171 - for (int i = 0; i < dot; i++) {
187.172 - if (name1.charAt(i) != name2.charAt(i))
187.173 - return false;
187.174 - }
187.175 - return true;
187.176 - }
187.177 -
187.178 - /**
187.179 - * Test if two classes are defined as part of the same package member (top-level class).
187.180 - * If this is true, they can share private access with each other.
187.181 - * @param class1
187.182 - * @param class2
187.183 - * @return whether they are identical or nested together
187.184 - */
187.185 - public static boolean isSamePackageMember(Class<?> class1, Class<?> class2) {
187.186 - if (class1 == class2)
187.187 - return true;
187.188 - if (!isSamePackage(class1, class2))
187.189 - return false;
187.190 - if (getOutermostEnclosingClass(class1) != getOutermostEnclosingClass(class2))
187.191 - return false;
187.192 - return true;
187.193 - }
187.194 -
187.195 - private static Class<?> getOutermostEnclosingClass(Class<?> c) {
187.196 - Class<?> pkgmem = c;
187.197 - for (Class<?> enc = c; (enc = enc.getEnclosingClass()) != null; )
187.198 - pkgmem = enc;
187.199 - return pkgmem;
187.200 - }
187.201 -
187.202 - private static boolean loadersAreRelated(ClassLoader loader1, ClassLoader loader2) {
187.203 - if (loader1 == loader2 || loader1 == null || loader2 == null) {
187.204 - return true;
187.205 - }
187.206 - for (ClassLoader scan1 = loader1;
187.207 - scan1 != null; scan1 = scan1.getParent()) {
187.208 - if (scan1 == loader2) return true;
187.209 - }
187.210 - for (ClassLoader scan2 = loader2;
187.211 - scan2 != null; scan2 = scan2.getParent()) {
187.212 - if (scan2 == loader1) return true;
187.213 - }
187.214 - return false;
187.215 - }
187.216 -}
188.1 --- a/src/share/classes/sun/dyn/util/VerifyType.java Tue Mar 29 11:29:01 2011 -0700
188.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
188.3 @@ -1,224 +0,0 @@
188.4 -/*
188.5 - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
188.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
188.7 - *
188.8 - * This code is free software; you can redistribute it and/or modify it
188.9 - * under the terms of the GNU General Public License version 2 only, as
188.10 - * published by the Free Software Foundation. Oracle designates this
188.11 - * particular file as subject to the "Classpath" exception as provided
188.12 - * by Oracle in the LICENSE file that accompanied this code.
188.13 - *
188.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
188.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
188.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
188.17 - * version 2 for more details (a copy is included in the LICENSE file that
188.18 - * accompanied this code).
188.19 - *
188.20 - * You should have received a copy of the GNU General Public License version
188.21 - * 2 along with this work; if not, write to the Free Software Foundation,
188.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
188.23 - *
188.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
188.25 - * or visit www.oracle.com if you need additional information or have any
188.26 - * questions.
188.27 - */
188.28 -
188.29 -package sun.dyn.util;
188.30 -
188.31 -import java.dyn.MethodType;
188.32 -import sun.dyn.empty.Empty;
188.33 -
188.34 -/**
188.35 - * This class centralizes information about the JVM verifier
188.36 - * and its requirements about type correctness.
188.37 - * @author jrose
188.38 - */
188.39 -public class VerifyType {
188.40 -
188.41 - private VerifyType() { } // cannot instantiate
188.42 -
188.43 - /**
188.44 - * True if a value can be stacked as the source type and unstacked as the
188.45 - * destination type, without violating the JVM's type consistency.
188.46 - *
188.47 - * @param call the type of a stacked value
188.48 - * @param recv the type by which we'd like to treat it
188.49 - * @return whether the retyping can be done without motion or reformatting
188.50 - */
188.51 - public static boolean isNullConversion(Class<?> src, Class<?> dst) {
188.52 - if (src == dst) return true;
188.53 - // Verifier allows any interface to be treated as Object:
188.54 - if (dst.isInterface()) dst = Object.class;
188.55 - if (src.isInterface()) src = Object.class;
188.56 - if (src == dst) return true; // check again
188.57 - if (dst == void.class) return true; // drop any return value
188.58 - if (isNullType(src)) return !dst.isPrimitive();
188.59 - if (!src.isPrimitive()) return dst.isAssignableFrom(src);
188.60 - // Verifier allows an int to carry byte, short, char, or even boolean:
188.61 - if (dst == int.class) return Wrapper.forPrimitiveType(src).isSubwordOrInt();
188.62 - return false;
188.63 - }
188.64 -
188.65 - /**
188.66 - * Specialization of isNullConversion to reference types.
188.67 -
188.68 - * @param call the type of a stacked value
188.69 - * @param recv the reference type by which we'd like to treat it
188.70 - * @return whether the retyping can be done without a cast
188.71 - */
188.72 - public static boolean isNullReferenceConversion(Class<?> src, Class<?> dst) {
188.73 - assert(!dst.isPrimitive());
188.74 - if (dst.isInterface()) return true; // verifier allows this
188.75 - if (isNullType(src)) return true;
188.76 - return dst.isAssignableFrom(src);
188.77 - }
188.78 -
188.79 - /**
188.80 - * Is the given type java.lang.Null or an equivalent null-only type?
188.81 - */
188.82 - public static boolean isNullType(Class<?> type) {
188.83 - if (type == null) return false;
188.84 - return type == NULL_CLASS
188.85 - // This one may also be used as a null type.
188.86 - // TO DO: Decide if we really want to legitimize it here.
188.87 - // Probably we do, unless java.lang.Null really makes it into Java 7
188.88 - //|| type == Void.class
188.89 - // Locally known null-only class:
188.90 - || type == Empty.class
188.91 - ;
188.92 - }
188.93 - private static final Class<?> NULL_CLASS;
188.94 - static {
188.95 - Class<?> nullClass = null;
188.96 - try {
188.97 - nullClass = Class.forName("java.lang.Null");
188.98 - } catch (ClassNotFoundException ex) {
188.99 - // OK, we'll cope
188.100 - }
188.101 - NULL_CLASS = nullClass;
188.102 - }
188.103 -
188.104 - /**
188.105 - * True if a method handle can receive a call under a slightly different
188.106 - * method type, without moving or reformatting any stack elements.
188.107 - *
188.108 - * @param call the type of call being made
188.109 - * @param recv the type of the method handle receiving the call
188.110 - * @return whether the retyping can be done without motion or reformatting
188.111 - */
188.112 - public static boolean isNullConversion(MethodType call, MethodType recv) {
188.113 - if (call == recv) return true;
188.114 - int len = call.parameterCount();
188.115 - if (len != recv.parameterCount()) return false;
188.116 - for (int i = 0; i < len; i++)
188.117 - if (!isNullConversion(call.parameterType(i), recv.parameterType(i)))
188.118 - return false;
188.119 - return isNullConversion(recv.returnType(), call.returnType());
188.120 - }
188.121 -
188.122 - //TO DO: isRawConversion
188.123 -
188.124 - /**
188.125 - * Determine if the JVM verifier allows a value of type call to be
188.126 - * passed to a formal parameter (or return variable) of type recv.
188.127 - * Returns 1 if the verifier allows the types to match without conversion.
188.128 - * Returns -1 if the types can be made to match by a JVM-supported adapter.
188.129 - * Cases supported are:
188.130 - * <ul><li>checkcast
188.131 - * </li><li>conversion between any two integral types (but not floats)
188.132 - * </li><li>unboxing from a wrapper to its corresponding primitive type
188.133 - * </li><li>conversion in either direction between float and double
188.134 - * </li></ul>
188.135 - * (Autoboxing is not supported here; it must be done via Java code.)
188.136 - * Returns 0 otherwise.
188.137 - */
188.138 - public static int canPassUnchecked(Class<?> src, Class<?> dst) {
188.139 - if (src == dst)
188.140 - return 1;
188.141 -
188.142 - if (dst.isPrimitive()) {
188.143 - if (dst == void.class)
188.144 - // Return anything to a caller expecting void.
188.145 - // This is a property of the implementation, which links
188.146 - // return values via a register rather than via a stack push.
188.147 - // This makes it possible to ignore cleanly.
188.148 - return 1;
188.149 - if (src == void.class)
188.150 - return 0; // void-to-something?
188.151 - if (!src.isPrimitive())
188.152 - // Cannot pass a reference to any primitive type (exc. void).
188.153 - return 0;
188.154 - Wrapper sw = Wrapper.forPrimitiveType(src);
188.155 - Wrapper dw = Wrapper.forPrimitiveType(dst);
188.156 - if (sw.isSubwordOrInt() && dw.isSubwordOrInt()) {
188.157 - if (sw.bitWidth() >= dw.bitWidth())
188.158 - return -1; // truncation may be required
188.159 - if (!dw.isSigned() && sw.isSigned())
188.160 - return -1; // sign elimination may be required
188.161 - }
188.162 - if (src == float.class || dst == float.class) {
188.163 - if (src == double.class || dst == double.class)
188.164 - return -1; // floating conversion may be required
188.165 - else
188.166 - return 0; // other primitive conversions NYI
188.167 - } else {
188.168 - // all fixed-point conversions are supported
188.169 - return 0;
188.170 - }
188.171 - } else if (src.isPrimitive()) {
188.172 - // Cannot pass a primitive to any reference type.
188.173 - // (Maybe allow null.class?)
188.174 - return 0;
188.175 - }
188.176 -
188.177 - // Handle reference types in the rest of the block:
188.178 -
188.179 - // The verifier treats interfaces exactly like Object.
188.180 - if (isNullReferenceConversion(src, dst))
188.181 - // pass any reference to object or an arb. interface
188.182 - return 1;
188.183 - // else it's a definite "maybe" (cast is required)
188.184 - return -1;
188.185 - }
188.186 -
188.187 - public static int canPassRaw(Class<?> src, Class<?> dst) {
188.188 - if (dst.isPrimitive()) {
188.189 - if (dst == void.class)
188.190 - // As above, return anything to a caller expecting void.
188.191 - return 1;
188.192 - if (src == void.class)
188.193 - // Special permission for raw conversions: allow a void
188.194 - // to be captured as a garbage int.
188.195 - // Caller promises that the actual value will be disregarded.
188.196 - return dst == int.class ? 1 : 0;
188.197 - if (isNullType(src))
188.198 - // Special permission for raw conversions: allow a null
188.199 - // to be reinterpreted as anything. For objects, it is safe,
188.200 - // and for primitives you get a garbage value (probably zero).
188.201 - return 1;
188.202 - if (!src.isPrimitive())
188.203 - return 0;
188.204 - Wrapper sw = Wrapper.forPrimitiveType(src);
188.205 - Wrapper dw = Wrapper.forPrimitiveType(dst);
188.206 - if (sw.stackSlots() == dw.stackSlots())
188.207 - return 1; // can do a reinterpret-cast on a stacked primitive
188.208 - if (sw.isSubwordOrInt() && dw == Wrapper.VOID)
188.209 - return 1; // can drop an outgoing int value
188.210 - return 0;
188.211 - } else if (src.isPrimitive()) {
188.212 - return 0;
188.213 - }
188.214 -
188.215 - // Both references.
188.216 - if (isNullReferenceConversion(src, dst))
188.217 - return 1;
188.218 - return -1;
188.219 - }
188.220 -
188.221 - public static boolean isSpreadArgType(Class<?> spreadArg) {
188.222 - return spreadArg.isArray();
188.223 - }
188.224 - public static Class<?> spreadArgElementType(Class<?> spreadArg, int i) {
188.225 - return spreadArg.getComponentType();
188.226 - }
188.227 -}
189.1 --- a/src/share/classes/sun/dyn/util/Wrapper.java Tue Mar 29 11:29:01 2011 -0700
189.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
189.3 @@ -1,562 +0,0 @@
189.4 -/*
189.5 - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
189.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
189.7 - *
189.8 - * This code is free software; you can redistribute it and/or modify it
189.9 - * under the terms of the GNU General Public License version 2 only, as
189.10 - * published by the Free Software Foundation. Oracle designates this
189.11 - * particular file as subject to the "Classpath" exception as provided
189.12 - * by Oracle in the LICENSE file that accompanied this code.
189.13 - *
189.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
189.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
189.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
189.17 - * version 2 for more details (a copy is included in the LICENSE file that
189.18 - * accompanied this code).
189.19 - *
189.20 - * You should have received a copy of the GNU General Public License version
189.21 - * 2 along with this work; if not, write to the Free Software Foundation,
189.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
189.23 - *
189.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
189.25 - * or visit www.oracle.com if you need additional information or have any
189.26 - * questions.
189.27 - */
189.28 -
189.29 -package sun.dyn.util;
189.30 -
189.31 -public enum Wrapper {
189.32 - BOOLEAN(Boolean.class, boolean.class, 'Z', (Boolean)false, Format.unsigned(1)),
189.33 - // These must be in the order defined for widening primitive conversions in JLS 5.1.2
189.34 - BYTE(Byte.class, byte.class, 'B', (Byte)(byte)0, Format.signed(8)),
189.35 - SHORT(Short.class, short.class, 'S', (Short)(short)0, Format.signed(16)),
189.36 - CHAR(Character.class, char.class, 'C', (Character)(char)0, Format.unsigned(16)),
189.37 - INT(Integer.class, int.class, 'I', (Integer)(int)0, Format.signed(32)),
189.38 - LONG(Long.class, long.class, 'J', (Long)(long)0, Format.signed(64)),
189.39 - FLOAT(Float.class, float.class, 'F', (Float)(float)0, Format.floating(32)),
189.40 - DOUBLE(Double.class, double.class, 'D', (Double)(double)0, Format.floating(64)),
189.41 - //NULL(Null.class, null.class, 'N', null, Format.other(1)),
189.42 - OBJECT(Object.class, Object.class, 'L', null, Format.other(1)),
189.43 - // VOID must be the last type, since it is "assignable" from any other type:
189.44 - VOID(Void.class, void.class, 'V', null, Format.other(0)),
189.45 - ;
189.46 -
189.47 - private final Class<?> wrapperType;
189.48 - private final Class<?> primitiveType;
189.49 - private final char basicTypeChar;
189.50 - private final Object zero;
189.51 - private final int format;
189.52 - private final String simpleName;
189.53 -
189.54 - private Wrapper(Class<?> wtype, Class<?> ptype, char tchar, Object zero, int format) {
189.55 - this.wrapperType = wtype;
189.56 - this.primitiveType = ptype;
189.57 - this.basicTypeChar = tchar;
189.58 - this.zero = zero;
189.59 - this.format = format;
189.60 - this.simpleName = wtype.getSimpleName();
189.61 - }
189.62 -
189.63 - private static abstract class Format {
189.64 - static final int SLOT_SHIFT = 0, SIZE_SHIFT = 2, KIND_SHIFT = 12;
189.65 - static final int
189.66 - SIGNED = (-1) << KIND_SHIFT,
189.67 - UNSIGNED = 0 << KIND_SHIFT,
189.68 - FLOATING = 1 << KIND_SHIFT;
189.69 - static final int
189.70 - SLOT_MASK = ((1<<(SIZE_SHIFT-SLOT_SHIFT))-1),
189.71 - SIZE_MASK = ((1<<(KIND_SHIFT-SIZE_SHIFT))-1);
189.72 - static int format(int kind, int size, int slots) {
189.73 - assert(((kind >> KIND_SHIFT) << KIND_SHIFT) == kind);
189.74 - assert((size & (size-1)) == 0); // power of two
189.75 - assert((kind == SIGNED) ? (size > 0) :
189.76 - (kind == UNSIGNED) ? (size > 0) :
189.77 - (kind == FLOATING) ? (size == 32 || size == 64) :
189.78 - false);
189.79 - assert((slots == 2) ? (size == 64) :
189.80 - (slots == 1) ? (size <= 32) :
189.81 - false);
189.82 - return kind | (size << SIZE_SHIFT) | (slots << SLOT_SHIFT);
189.83 - }
189.84 - static final int
189.85 - INT = SIGNED | (32 << SIZE_SHIFT) | (1 << SLOT_SHIFT),
189.86 - SHORT = SIGNED | (16 << SIZE_SHIFT) | (1 << SLOT_SHIFT),
189.87 - BOOLEAN = UNSIGNED | (1 << SIZE_SHIFT) | (1 << SLOT_SHIFT),
189.88 - CHAR = UNSIGNED | (16 << SIZE_SHIFT) | (1 << SLOT_SHIFT),
189.89 - FLOAT = FLOATING | (32 << SIZE_SHIFT) | (1 << SLOT_SHIFT),
189.90 - VOID = UNSIGNED | (0 << SIZE_SHIFT) | (0 << SLOT_SHIFT),
189.91 - NUM_MASK = (-1) << SIZE_SHIFT;
189.92 - static int signed(int size) { return format(SIGNED, size, (size > 32 ? 2 : 1)); }
189.93 - static int unsigned(int size) { return format(UNSIGNED, size, (size > 32 ? 2 : 1)); }
189.94 - static int floating(int size) { return format(FLOATING, size, (size > 32 ? 2 : 1)); }
189.95 - static int other(int slots) { return slots << SLOT_SHIFT; }
189.96 - }
189.97 -
189.98 - /// format queries:
189.99 -
189.100 - /** How many bits are in the wrapped value? Returns 0 for OBJECT or VOID. */
189.101 - public int bitWidth() { return (format >> Format.SIZE_SHIFT) & Format.SIZE_MASK; }
189.102 - /** How many JVM stack slots occupied by the wrapped value? Returns 0 for VOID. */
189.103 - public int stackSlots() { return (format >> Format.SLOT_SHIFT) & Format.SLOT_MASK; }
189.104 - /** Does the wrapped value occupy a single JVM stack slot? */
189.105 - public boolean isSingleWord() { return (format & (1 << Format.SLOT_SHIFT)) != 0; }
189.106 - /** Does the wrapped value occupy two JVM stack slots? */
189.107 - public boolean isDoubleWord() { return (format & (2 << Format.SLOT_SHIFT)) != 0; }
189.108 - /** Is the wrapped type numeric (not void or object)? */
189.109 - public boolean isNumeric() { return (format & Format.NUM_MASK) != 0; }
189.110 - /** Is the wrapped type a primitive other than float, double, or void? */
189.111 - public boolean isIntegral() { return isNumeric() && format < Format.FLOAT; }
189.112 - /** Is the wrapped type one of int, boolean, byte, char, or short? */
189.113 - public boolean isSubwordOrInt() { return isIntegral() && isSingleWord(); }
189.114 - /* Is the wrapped value a signed integral type (one of byte, short, int, or long)? */
189.115 - public boolean isSigned() { return format < Format.VOID; }
189.116 - /* Is the wrapped value an unsigned integral type (one of boolean or char)? */
189.117 - public boolean isUnsigned() { return format >= Format.BOOLEAN && format < Format.FLOAT; }
189.118 - /** Is the wrapped type either float or double? */
189.119 - public boolean isFloating() { return format >= Format.FLOAT; }
189.120 -
189.121 - /** Does the JVM verifier allow a variable of this wrapper's
189.122 - * primitive type to be assigned from a value of the given wrapper's primitive type?
189.123 - * Cases:
189.124 - * <ul>
189.125 - * <li>unboxing followed by widening primitive conversion
189.126 - * <li>any type converted to {@code void}
189.127 - * <li>boxing conversion followed by widening reference conversion to {@code Object}
189.128 - * <li>conversion of {@code boolean} to any type
189.129 - * </ul>
189.130 - */
189.131 - public boolean isConvertibleFrom(Wrapper source) {
189.132 - if (this == source) return true;
189.133 - if (this.compareTo(source) < 0) {
189.134 - // At best, this is a narrowing conversion.
189.135 - return false;
189.136 - }
189.137 - if ((this.format ^ source.format) == (Format.SHORT ^ Format.CHAR)) {
189.138 - assert (this == SHORT && source == CHAR) || (this == CHAR && source == SHORT);
189.139 - return false;
189.140 - }
189.141 - return true;
189.142 - }
189.143 -
189.144 - /** Produce a zero value for the given wrapper type.
189.145 - * This will be a numeric zero for a number or character,
189.146 - * false for a boolean, and null for a reference or void.
189.147 - * The common thread is that this is what is contained
189.148 - * in a default-initialized variable of the given primitive
189.149 - * type. (For void, it is what a reflective method returns
189.150 - * instead of no value at all.)
189.151 - */
189.152 - public Object zero() { return zero; }
189.153 -
189.154 - /** Produce a zero value for the given wrapper type T.
189.155 - * The optional argument must a type compatible with this wrapper.
189.156 - * Equivalent to {@code this.cast(this.zero(), type)}.
189.157 - */
189.158 - public <T> T zero(Class<T> type) { return convert(zero, type); }
189.159 -
189.160 -// /** Produce a wrapper for the given wrapper or primitive type. */
189.161 -// public static Wrapper valueOf(Class<?> type) {
189.162 -// if (isPrimitiveType(type))
189.163 -// return forPrimitiveType(type);
189.164 -// else
189.165 -// return forWrapperType(type);
189.166 -// }
189.167 -
189.168 - /** Return the wrapper that wraps values of the given type.
189.169 - * The type may be {@code Object}, meaning the {@code OBJECT} wrapper.
189.170 - * Otherwise, the type must be a primitive.
189.171 - * @throws IllegalArgumentException for unexpected types
189.172 - */
189.173 - public static Wrapper forPrimitiveType(Class<?> type) {
189.174 - Wrapper w = findPrimitiveType(type);
189.175 - if (w != null) return w;
189.176 - if (type.isPrimitive())
189.177 - throw new InternalError(); // redo hash function
189.178 - throw newIllegalArgumentException("not primitive: "+type);
189.179 - }
189.180 -
189.181 - static Wrapper findPrimitiveType(Class<?> type) {
189.182 - Wrapper w = FROM_PRIM[hashPrim(type)];
189.183 - if (w != null && w.primitiveType == type) {
189.184 - return w;
189.185 - }
189.186 - return null;
189.187 - }
189.188 -
189.189 - /** Return the wrapper that wraps values into the given wrapper type.
189.190 - * If it is {@code Object} or an interface, return {@code OBJECT}.
189.191 - * Otherwise, it must be a wrapper type.
189.192 - * The type must not be a primitive type.
189.193 - * @throws IllegalArgumentException for unexpected types
189.194 - */
189.195 - public static Wrapper forWrapperType(Class<?> type) {
189.196 - Wrapper w = findWrapperType(type);
189.197 - if (w != null) return w;
189.198 - for (Wrapper x : values())
189.199 - if (x.wrapperType == type)
189.200 - throw new InternalError(); // redo hash function
189.201 - throw newIllegalArgumentException("not wrapper: "+type);
189.202 - }
189.203 -
189.204 - static Wrapper findWrapperType(Class<?> type) {
189.205 - Wrapper w = FROM_WRAP[hashWrap(type)];
189.206 - if (w != null && w.wrapperType == type) {
189.207 - return w;
189.208 - }
189.209 - if (type.isInterface())
189.210 - return OBJECT;
189.211 - return null;
189.212 - }
189.213 -
189.214 - /** Return the wrapper that corresponds to the given bytecode
189.215 - * signature character. Return {@code OBJECT} for the character 'L'.
189.216 - * @throws IllegalArgumentException for any non-signature character or {@code '['}.
189.217 - */
189.218 - public static Wrapper forBasicType(char type) {
189.219 - Wrapper w = FROM_CHAR[hashChar(type)];
189.220 - if (w != null && w.basicTypeChar == type) {
189.221 - return w;
189.222 - }
189.223 - for (Wrapper x : values())
189.224 - if (w.basicTypeChar == type)
189.225 - throw new InternalError(); // redo hash function
189.226 - throw newIllegalArgumentException("not basic type char: "+type);
189.227 - }
189.228 -
189.229 - /** Return the wrapper for the given type, if it is
189.230 - * a primitive type, else return {@code OBJECT}.
189.231 - */
189.232 - public static Wrapper forBasicType(Class<?> type) {
189.233 - if (type.isPrimitive())
189.234 - return forPrimitiveType(type);
189.235 - return OBJECT; // any reference, including wrappers or arrays
189.236 - }
189.237 -
189.238 - // Note on perfect hashes:
189.239 - // for signature chars c, do (c + (c >> 1)) % 16
189.240 - // for primitive type names n, do (n[0] + n[2]) % 16
189.241 - // The type name hash works for both primitive and wrapper names.
189.242 - // You can add "java/lang/Object" to the primitive names.
189.243 - // But you add the wrapper name Object, use (n[2] + (3*n[1])) % 16.
189.244 - private static final Wrapper[] FROM_PRIM = new Wrapper[16];
189.245 - private static final Wrapper[] FROM_WRAP = new Wrapper[16];
189.246 - private static final Wrapper[] FROM_CHAR = new Wrapper[16];
189.247 - private static int hashPrim(Class<?> x) {
189.248 - String xn = x.getName();
189.249 - if (xn.length() < 3) return 0;
189.250 - return (xn.charAt(0) + xn.charAt(2)) % 16;
189.251 - }
189.252 - private static int hashWrap(Class<?> x) {
189.253 - String xn = x.getName();
189.254 - final int offset = 10; assert(offset == "java.lang.".length());
189.255 - if (xn.length() < offset+3) return 0;
189.256 - return (3*xn.charAt(offset+1) + xn.charAt(offset+2)) % 16;
189.257 - }
189.258 - private static int hashChar(char x) {
189.259 - return (x + (x >> 1)) % 16;
189.260 - }
189.261 - static {
189.262 - for (Wrapper w : values()) {
189.263 - int pi = hashPrim(w.primitiveType);
189.264 - int wi = hashWrap(w.wrapperType);
189.265 - int ci = hashChar(w.basicTypeChar);
189.266 - assert(FROM_PRIM[pi] == null);
189.267 - assert(FROM_WRAP[wi] == null);
189.268 - assert(FROM_CHAR[ci] == null);
189.269 - FROM_PRIM[pi] = w;
189.270 - FROM_WRAP[wi] = w;
189.271 - FROM_CHAR[ci] = w;
189.272 - }
189.273 - //assert(jdk.sun.dyn.util.WrapperTest.test(false));
189.274 - }
189.275 -
189.276 - /** What is the primitive type wrapped by this wrapper? */
189.277 - public Class<?> primitiveType() { return primitiveType; }
189.278 -
189.279 - /** What is the wrapper type for this wrapper? */
189.280 - public Class<?> wrapperType() { return wrapperType; }
189.281 -
189.282 - /** What is the wrapper type for this wrapper?
189.283 - * Otherwise, the example type must be the wrapper type,
189.284 - * or the corresponding primitive type.
189.285 - * (For {@code OBJECT}, the example type can be any non-primitive,
189.286 - * and is normalized to {@code Object.class}.)
189.287 - * The resulting class type has the same type parameter.
189.288 - */
189.289 - public <T> Class<T> wrapperType(Class<T> exampleType) {
189.290 - if (exampleType == wrapperType) {
189.291 - return exampleType;
189.292 - } else if (exampleType == primitiveType ||
189.293 - wrapperType == Object.class ||
189.294 - exampleType.isInterface()) {
189.295 - return forceType(wrapperType, exampleType);
189.296 - }
189.297 - throw newClassCastException(exampleType, primitiveType);
189.298 - }
189.299 -
189.300 - private static ClassCastException newClassCastException(Class<?> actual, Class<?> expected) {
189.301 - return new ClassCastException(actual + " is not compatible with " + expected);
189.302 - }
189.303 -
189.304 - /** If {@code type} is a primitive type, return the corresponding
189.305 - * wrapper type, else return {@code type} unchanged.
189.306 - */
189.307 - public static <T> Class<T> asWrapperType(Class<T> type) {
189.308 - if (type.isPrimitive()) {
189.309 - return forPrimitiveType(type).wrapperType(type);
189.310 - }
189.311 - return type;
189.312 - }
189.313 -
189.314 - /** If {@code type} is a wrapper type, return the corresponding
189.315 - * primitive type, else return {@code type} unchanged.
189.316 - */
189.317 - public static <T> Class<T> asPrimitiveType(Class<T> type) {
189.318 - Wrapper w = findWrapperType(type);
189.319 - if (w != null) {
189.320 - return forceType(w.primitiveType(), type);
189.321 - }
189.322 - return type;
189.323 - }
189.324 -
189.325 - /** Query: Is the given type a wrapper, such as {@code Integer} or {@code Void}? */
189.326 - public static boolean isWrapperType(Class<?> type) {
189.327 - return findWrapperType(type) != null;
189.328 - }
189.329 -
189.330 - /** Query: Is the given type a primitive, such as {@code int} or {@code void}? */
189.331 - public static boolean isPrimitiveType(Class<?> type) {
189.332 - return type.isPrimitive();
189.333 - }
189.334 -
189.335 - /** What is the bytecode signature character for this type?
189.336 - * All non-primitives, including array types, report as 'L', the signature character for references.
189.337 - */
189.338 - public static char basicTypeChar(Class<?> type) {
189.339 - if (!type.isPrimitive())
189.340 - return 'L';
189.341 - else
189.342 - return forPrimitiveType(type).basicTypeChar();
189.343 - }
189.344 -
189.345 - /** What is the bytecode signature character for this wrapper's
189.346 - * primitive type?
189.347 - */
189.348 - public char basicTypeChar() { return basicTypeChar; }
189.349 -
189.350 - /** What is the simple name of the wrapper type?
189.351 - */
189.352 - public String simpleName() { return simpleName; }
189.353 -
189.354 -// /** Wrap a value in the given type, which may be either a primitive or wrapper type.
189.355 -// * Performs standard primitive conversions, including truncation and float conversions.
189.356 -// */
189.357 -// public static <T> T wrap(Object x, Class<T> type) {
189.358 -// return Wrapper.valueOf(type).cast(x, type);
189.359 -// }
189.360 -
189.361 - /** Cast a wrapped value to the given type, which may be either a primitive or wrapper type.
189.362 - * The given target type must be this wrapper's primitive or wrapper type.
189.363 - * If this wrapper is OBJECT, the target type may also be an interface, perform no runtime check.
189.364 - * Performs standard primitive conversions, including truncation and float conversions.
189.365 - * The given type must be compatible with this wrapper. That is, it must either
189.366 - * be the wrapper type (or a subtype, in the case of {@code OBJECT}) or else
189.367 - * it must be the wrapper's primitive type.
189.368 - * Primitive conversions are only performed if the given type is itself a primitive.
189.369 - * @throws ClassCastException if the given type is not compatible with this wrapper
189.370 - */
189.371 - public <T> T cast(Object x, Class<T> type) {
189.372 - return convert(x, type, true);
189.373 - }
189.374 -
189.375 - /** Convert a wrapped value to the given type.
189.376 - * The given target type must be this wrapper's primitive or wrapper type.
189.377 - * This is equivalent to {@link #cast}, except that it refuses to perform
189.378 - * narrowing primitive conversions.
189.379 - */
189.380 - public <T> T convert(Object x, Class<T> type) {
189.381 - return convert(x, type, false);
189.382 - }
189.383 -
189.384 - private <T> T convert(Object x, Class<T> type, boolean isCast) {
189.385 - if (this == OBJECT) {
189.386 - // If the target wrapper is OBJECT, just do a reference cast.
189.387 - // If the target type is an interface, perform no runtime check.
189.388 - // (This loophole is safe, and is allowed by the JVM verifier.)
189.389 - // If the target type is a primitive, change it to a wrapper.
189.390 - @SuppressWarnings("unchecked")
189.391 - T result = (T) x; // unchecked warning is expected here
189.392 - return result;
189.393 - }
189.394 - Class<T> wtype = wrapperType(type);
189.395 - if (wtype.isInstance(x)) {
189.396 - @SuppressWarnings("unchecked")
189.397 - T result = (T) x; // unchecked warning is expected here
189.398 - return result;
189.399 - }
189.400 - Class<?> sourceType = x.getClass(); // throw NPE if x is null
189.401 - if (!isCast) {
189.402 - Wrapper source = findWrapperType(sourceType);
189.403 - if (source == null || !this.isConvertibleFrom(source)) {
189.404 - throw newClassCastException(wtype, sourceType);
189.405 - }
189.406 - }
189.407 - @SuppressWarnings("unchecked")
189.408 - T result = (T) wrap(x); // unchecked warning is expected here
189.409 - assert result.getClass() == wtype;
189.410 - return result;
189.411 - }
189.412 -
189.413 - /** Cast a reference type to another reference type.
189.414 - * If the target type is an interface, perform no runtime check.
189.415 - * (This loophole is safe, and is allowed by the JVM verifier.)
189.416 - * If the target type is a primitive, change it to a wrapper.
189.417 - */
189.418 - static <T> Class<T> forceType(Class<?> type, Class<T> exampleType) {
189.419 - boolean z = (type == exampleType ||
189.420 - type.isPrimitive() && forPrimitiveType(type) == findWrapperType(exampleType) ||
189.421 - exampleType.isPrimitive() && forPrimitiveType(exampleType) == findWrapperType(type) ||
189.422 - type == Object.class && !exampleType.isPrimitive());
189.423 - if (!z)
189.424 - System.out.println(type+" <= "+exampleType);
189.425 - assert(type == exampleType ||
189.426 - type.isPrimitive() && forPrimitiveType(type) == findWrapperType(exampleType) ||
189.427 - exampleType.isPrimitive() && forPrimitiveType(exampleType) == findWrapperType(type) ||
189.428 - type == Object.class && !exampleType.isPrimitive());
189.429 - @SuppressWarnings("unchecked")
189.430 - Class<T> result = (Class<T>) type; // unchecked warning is expected here
189.431 - return result;
189.432 - }
189.433 -
189.434 - /** Wrap a value in this wrapper's type.
189.435 - * Performs standard primitive conversions, including truncation and float conversions.
189.436 - * Performs returns the unchanged reference for {@code OBJECT}.
189.437 - * Returns null for {@code VOID}.
189.438 - * Returns a zero value for a null input.
189.439 - * @throws ClassCastException if this wrapper is numeric and the operand
189.440 - * is not a number, character, boolean, or null
189.441 - */
189.442 - public Object wrap(Object x) {
189.443 - // do non-numeric wrappers first
189.444 - switch (basicTypeChar) {
189.445 - case 'L': return x;
189.446 - case 'V': return null;
189.447 - }
189.448 - Number xn = numberValue(x);
189.449 - switch (basicTypeChar) {
189.450 - case 'I': return Integer.valueOf(xn.intValue());
189.451 - case 'J': return Long.valueOf(xn.longValue());
189.452 - case 'F': return Float.valueOf(xn.floatValue());
189.453 - case 'D': return Double.valueOf(xn.doubleValue());
189.454 - case 'S': return Short.valueOf((short) xn.intValue());
189.455 - case 'B': return Byte.valueOf((byte) xn.intValue());
189.456 - case 'C': return Character.valueOf((char) xn.intValue());
189.457 - case 'Z': return Boolean.valueOf(boolValue(xn.longValue()));
189.458 - }
189.459 - throw new InternalError("bad wrapper");
189.460 - }
189.461 -
189.462 - /** Wrap a value (an int or smaller value) in this wrapper's type.
189.463 - * Performs standard primitive conversions, including truncation and float conversions.
189.464 - * Produces an {@code Integer} for {@code OBJECT}, although the exact type
189.465 - * of the operand is not known.
189.466 - * Returns null for {@code VOID}.
189.467 - */
189.468 - public Object wrap(int x) {
189.469 - if (basicTypeChar == 'L') return (Integer)x;
189.470 - switch (basicTypeChar) {
189.471 - case 'L': throw newIllegalArgumentException("cannot wrap to object type");
189.472 - case 'V': return null;
189.473 - case 'I': return Integer.valueOf((int)x);
189.474 - case 'J': return Long.valueOf(x);
189.475 - case 'F': return Float.valueOf(x);
189.476 - case 'D': return Double.valueOf(x);
189.477 - case 'S': return Short.valueOf((short) x);
189.478 - case 'B': return Byte.valueOf((byte) x);
189.479 - case 'C': return Character.valueOf((char) x);
189.480 - case 'Z': return Boolean.valueOf(boolValue(x));
189.481 - }
189.482 - throw new InternalError("bad wrapper");
189.483 - }
189.484 -
189.485 - /** Wrap a value (a long or smaller value) in this wrapper's type.
189.486 - * Does not perform floating point conversion.
189.487 - * Produces a {@code Long} for {@code OBJECT}, although the exact type
189.488 - * of the operand is not known.
189.489 - * Returns null for {@code VOID}.
189.490 - */
189.491 - public Object wrapRaw(long x) {
189.492 - switch (basicTypeChar) {
189.493 - case 'F': return Float.valueOf(Float.intBitsToFloat((int)x));
189.494 - case 'D': return Double.valueOf(Double.longBitsToDouble(x));
189.495 - case 'L': // same as 'J':
189.496 - case 'J': return (Long) x;
189.497 - }
189.498 - // Other wrapping operations are just the same, given that the
189.499 - // operand is already promoted to an int.
189.500 - return wrap((int)x);
189.501 - }
189.502 -
189.503 - /** Produce bitwise value which encodes the given wrapped value.
189.504 - * Does not perform floating point conversion.
189.505 - * Returns zero for {@code VOID}.
189.506 - */
189.507 - public long unwrapRaw(Object x) {
189.508 - switch (basicTypeChar) {
189.509 - case 'F': return Float.floatToRawIntBits((Float) x);
189.510 - case 'D': return Double.doubleToRawLongBits((Double) x);
189.511 -
189.512 - case 'L': throw newIllegalArgumentException("cannot unwrap from sobject type");
189.513 - case 'V': return 0;
189.514 - case 'I': return (int)(Integer) x;
189.515 - case 'J': return (long)(Long) x;
189.516 - case 'S': return (short)(Short) x;
189.517 - case 'B': return (byte)(Byte) x;
189.518 - case 'C': return (char)(Character) x;
189.519 - case 'Z': return (boolean)(Boolean) x ? 1 : 0;
189.520 - }
189.521 - throw new InternalError("bad wrapper");
189.522 - }
189.523 -
189.524 - /** Report what primitive type holds this guy's raw value. */
189.525 - public Class<?> rawPrimitiveType() {
189.526 - return rawPrimitive().primitiveType();
189.527 - }
189.528 -
189.529 - /** Report, as a wrapper, what primitive type holds this guy's raw value.
189.530 - * Returns self for INT, LONG, OBJECT; returns LONG for DOUBLE,
189.531 - * else returns INT.
189.532 - */
189.533 - public Wrapper rawPrimitive() {
189.534 - switch (basicTypeChar) {
189.535 - case 'S': case 'B':
189.536 - case 'C': case 'Z':
189.537 - case 'V':
189.538 - case 'F':
189.539 - return INT;
189.540 - case 'D':
189.541 - return LONG;
189.542 - }
189.543 - return this;
189.544 - }
189.545 -
189.546 - private static Number numberValue(Object x) {
189.547 - if (x instanceof Number) return (Number)x;
189.548 - if (x instanceof Character) return (int)(Character)x;
189.549 - if (x instanceof Boolean) return (Boolean)x ? 1 : 0;
189.550 - // Remaining allowed case of void: Must be a null reference.
189.551 - return (Number)x;
189.552 - }
189.553 -
189.554 - private static boolean boolValue(long bits) {
189.555 - //bits &= 1; // simple 31-bit zero extension
189.556 - return (bits != 0);
189.557 - }
189.558 -
189.559 - private static RuntimeException newIllegalArgumentException(String message, Object x) {
189.560 - return newIllegalArgumentException(message + x);
189.561 - }
189.562 - private static RuntimeException newIllegalArgumentException(String message) {
189.563 - return new IllegalArgumentException(message);
189.564 - }
189.565 -}
190.1 --- a/src/share/classes/sun/dyn/util/package-info.java Tue Mar 29 11:29:01 2011 -0700
190.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
190.3 @@ -1,31 +0,0 @@
190.4 -/*
190.5 - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
190.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
190.7 - *
190.8 - * This code is free software; you can redistribute it and/or modify it
190.9 - * under the terms of the GNU General Public License version 2 only, as
190.10 - * published by the Free Software Foundation. Oracle designates this
190.11 - * particular file as subject to the "Classpath" exception as provided
190.12 - * by Oracle in the LICENSE file that accompanied this code.
190.13 - *
190.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
190.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
190.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
190.17 - * version 2 for more details (a copy is included in the LICENSE file that
190.18 - * accompanied this code).
190.19 - *
190.20 - * You should have received a copy of the GNU General Public License version
190.21 - * 2 along with this work; if not, write to the Free Software Foundation,
190.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
190.23 - *
190.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
190.25 - * or visit www.oracle.com if you need additional information or have any
190.26 - * questions.
190.27 - */
190.28 -
190.29 -/**
190.30 - * Extra support for using JSR 292 RI, package java.dyn.
190.31 - * @author jrose
190.32 - */
190.33 -
190.34 -package sun.dyn.util;
191.1 --- a/src/share/classes/sun/font/FileFont.java Tue Mar 29 11:29:01 2011 -0700
191.2 +++ b/src/share/classes/sun/font/FileFont.java Tue Mar 29 20:19:55 2011 -0700
191.3 @@ -32,22 +32,13 @@
191.4 import java.awt.geom.Rectangle2D;
191.5 import java.io.File;
191.6 import java.nio.ByteBuffer;
191.7 -import java.nio.channels.FileChannel;
191.8 import sun.java2d.Disposer;
191.9 import sun.java2d.DisposerRecord;
191.10
191.11 -import java.lang.ref.WeakReference;
191.12 -import java.io.FileNotFoundException;
191.13 import java.io.IOException;
191.14 -import java.io.RandomAccessFile;
191.15 -import java.io.UnsupportedEncodingException;
191.16 -import java.nio.ByteOrder;
191.17 -import java.nio.MappedByteBuffer;
191.18 -import java.nio.BufferUnderflowException;
191.19 -import java.nio.channels.ClosedChannelException;
191.20 -import java.util.HashSet;
191.21 -import java.util.HashMap;
191.22 -import java.awt.Font;
191.23 +import java.security.AccessController;
191.24 +import java.security.PrivilegedActionException;
191.25 +import java.security.PrivilegedExceptionAction;
191.26
191.27 public abstract class FileFont extends PhysicalFont {
191.28
191.29 @@ -286,4 +277,49 @@
191.30 });
191.31 }
191.32 }
191.33 +
191.34 + protected String getPublicFileName() {
191.35 + SecurityManager sm = System.getSecurityManager();
191.36 + if (sm == null) {
191.37 + return platName;
191.38 + }
191.39 + boolean canReadProperty = true;
191.40 +
191.41 + try {
191.42 + sm.checkPropertyAccess("java.io.tmpdir");
191.43 + } catch (SecurityException e) {
191.44 + canReadProperty = false;
191.45 + }
191.46 +
191.47 + if (canReadProperty) {
191.48 + return platName;
191.49 + }
191.50 +
191.51 + final File f = new File(platName);
191.52 +
191.53 + Boolean isTmpFile = Boolean.FALSE;
191.54 + try {
191.55 + isTmpFile = AccessController.doPrivileged(
191.56 + new PrivilegedExceptionAction<Boolean>() {
191.57 + public Boolean run() {
191.58 + File tmp = new File(System.getProperty("java.io.tmpdir"));
191.59 + try {
191.60 + String tpath = tmp.getCanonicalPath();
191.61 + String fpath = f.getCanonicalPath();
191.62 +
191.63 + return (fpath == null) || fpath.startsWith(tpath);
191.64 + } catch (IOException e) {
191.65 + return Boolean.TRUE;
191.66 + }
191.67 + }
191.68 + }
191.69 + );
191.70 + } catch (PrivilegedActionException e) {
191.71 + // unable to verify whether value of java.io.tempdir will be
191.72 + // exposed, so return only a name of the font file.
191.73 + isTmpFile = Boolean.TRUE;
191.74 + }
191.75 +
191.76 + return isTmpFile ? "temp file" : platName;
191.77 + }
191.78 }
192.1 --- a/src/share/classes/sun/font/TrueTypeFont.java Tue Mar 29 11:29:01 2011 -0700
192.2 +++ b/src/share/classes/sun/font/TrueTypeFont.java Tue Mar 29 20:19:55 2011 -0700
192.3 @@ -519,7 +519,8 @@
192.4 break;
192.5
192.6 default:
192.7 - throw new FontFormatException("Unsupported sfnt " + platName);
192.8 + throw new FontFormatException("Unsupported sfnt " +
192.9 + getPublicFileName());
192.10 }
192.11
192.12 /* Now have the offset of this TT font (possibly within a TTC)
192.13 @@ -1680,7 +1681,6 @@
192.14 @Override
192.15 public String toString() {
192.16 return "** TrueType Font: Family="+familyName+ " Name="+fullName+
192.17 - " style="+style+" fileName="+platName;
192.18 + " style="+style+" fileName="+getPublicFileName();
192.19 }
192.20 -
192.21 }
193.1 --- a/src/share/classes/sun/font/Type1Font.java Tue Mar 29 11:29:01 2011 -0700
193.2 +++ b/src/share/classes/sun/font/Type1Font.java Tue Mar 29 20:19:55 2011 -0700
193.3 @@ -677,6 +677,6 @@
193.4
193.5 public String toString() {
193.6 return "** Type1 Font: Family="+familyName+ " Name="+fullName+
193.7 - " style="+style+" fileName="+platName;
193.8 + " style="+style+" fileName="+getPublicFileName();
193.9 }
193.10 }
194.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
194.2 +++ b/src/share/classes/sun/invoke/WrapperInstance.java Tue Mar 29 20:19:55 2011 -0700
194.3 @@ -0,0 +1,48 @@
194.4 +/*
194.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
194.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
194.7 + *
194.8 + * This code is free software; you can redistribute it and/or modify it
194.9 + * under the terms of the GNU General Public License version 2 only, as
194.10 + * published by the Free Software Foundation. Oracle designates this
194.11 + * particular file as subject to the "Classpath" exception as provided
194.12 + * by Oracle in the LICENSE file that accompanied this code.
194.13 + *
194.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
194.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
194.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
194.17 + * version 2 for more details (a copy is included in the LICENSE file that
194.18 + * accompanied this code).
194.19 + *
194.20 + * You should have received a copy of the GNU General Public License version
194.21 + * 2 along with this work; if not, write to the Free Software Foundation,
194.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
194.23 + *
194.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
194.25 + * or visit www.oracle.com if you need additional information or have any
194.26 + * questions.
194.27 + */
194.28 +
194.29 +package sun.invoke;
194.30 +
194.31 +import java.lang.invoke.MethodHandle;
194.32 +
194.33 +/**
194.34 + * Private API used inside of java.lang.invoke.MethodHandles.
194.35 + * Interface implemented by every object which is produced by
194.36 + * {@link java.lang.invoke.MethodHandles#asInstance MethodHandles.asInstance}.
194.37 + * The methods of this interface allow a caller to recover the parameters
194.38 + * to {@code asInstance}.
194.39 + * This allows applications to repeatedly convert between method handles
194.40 + * and SAM objects, without the risk of creating unbounded delegation chains.
194.41 + */
194.42 +public interface WrapperInstance {
194.43 + /** Produce or recover a target method handle which is behaviorally
194.44 + * equivalent to the SAM method of this object.
194.45 + */
194.46 + public MethodHandle getWrapperInstanceTarget();
194.47 + /** Recover the SAM type for which this object was created.
194.48 + */
194.49 + public Class<?> getWrapperInstanceType();
194.50 +}
194.51 +
195.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
195.2 +++ b/src/share/classes/sun/invoke/anon/AnonymousClassLoader.java Tue Mar 29 20:19:55 2011 -0700
195.3 @@ -0,0 +1,290 @@
195.4 +/*
195.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
195.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
195.7 + *
195.8 + * This code is free software; you can redistribute it and/or modify it
195.9 + * under the terms of the GNU General Public License version 2 only, as
195.10 + * published by the Free Software Foundation. Oracle designates this
195.11 + * particular file as subject to the "Classpath" exception as provided
195.12 + * by Oracle in the LICENSE file that accompanied this code.
195.13 + *
195.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
195.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
195.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
195.17 + * version 2 for more details (a copy is included in the LICENSE file that
195.18 + * accompanied this code).
195.19 + *
195.20 + * You should have received a copy of the GNU General Public License version
195.21 + * 2 along with this work; if not, write to the Free Software Foundation,
195.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
195.23 + *
195.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
195.25 + * or visit www.oracle.com if you need additional information or have any
195.26 + * questions.
195.27 + */
195.28 +
195.29 +package sun.invoke.anon;
195.30 +
195.31 +import java.io.IOException;
195.32 +import java.lang.reflect.InvocationTargetException;
195.33 +import java.lang.reflect.Method;
195.34 +import sun.misc.IOUtils;
195.35 +
195.36 +/**
195.37 + * Anonymous class loader. Will load any valid classfile, producing
195.38 + * a {@link Class} metaobject, without installing that class in the
195.39 + * system dictionary. Therefore, {@link Class#forName(String)} will never
195.40 + * produce a reference to an anonymous class.
195.41 + * <p>
195.42 + * The access permissions of the anonymous class are borrowed from
195.43 + * a <em>host class</em>. The new class behaves as if it were an
195.44 + * inner class of the host class. It can access the host's private
195.45 + * members, if the creator of the class loader has permission to
195.46 + * do so (or to create accessible reflective objects).
195.47 + * <p>
195.48 + * When the anonymous class is loaded, elements of its constant pool
195.49 + * can be patched to new values. This provides a hook to pre-resolve
195.50 + * named classes in the constant pool to other classes, including
195.51 + * anonymous ones. Also, string constants can be pre-resolved to
195.52 + * any reference. (The verifier treats non-string, non-class reference
195.53 + * constants as plain objects.)
195.54 + * <p>
195.55 + * Why include the patching function? It makes some use cases much easier.
195.56 + * Second, the constant pool needed some internal patching anyway,
195.57 + * to anonymize the loaded class itself. Finally, if you are going
195.58 + * to use this seriously, you'll want to build anonymous classes
195.59 + * on top of pre-existing anonymous classes, and that requires patching.
195.60 + *
195.61 + * <p>%%% TO-DO:
195.62 + * <ul>
195.63 + * <li>needs better documentation</li>
195.64 + * <li>needs more security work (for safe delegation)</li>
195.65 + * <li>needs a clearer story about error processing</li>
195.66 + * <li>patch member references also (use ';' as delimiter char)</li>
195.67 + * <li>patch method references to (conforming) method handles</li>
195.68 + * </ul>
195.69 + *
195.70 + * @author jrose
195.71 + * @author Remi Forax
195.72 + * @see <a href="http://blogs.sun.com/jrose/entry/anonymous_classes_in_the_vm">
195.73 + * http://blogs.sun.com/jrose/entry/anonymous_classes_in_the_vm</a>
195.74 + */
195.75 +
195.76 +public class AnonymousClassLoader {
195.77 + final Class<?> hostClass;
195.78 +
195.79 + // Note: Do not refactor the calls to checkHostClass unless you
195.80 + // also adjust this constant:
195.81 + private static int CHC_CALLERS = 3;
195.82 +
195.83 + public AnonymousClassLoader() {
195.84 + this.hostClass = checkHostClass(null);
195.85 + }
195.86 + public AnonymousClassLoader(Class<?> hostClass) {
195.87 + this.hostClass = checkHostClass(hostClass);
195.88 + }
195.89 +
195.90 + private static Class<?> getTopLevelClass(Class<?> clazz) {
195.91 + for(Class<?> outer = clazz.getDeclaringClass(); outer != null;
195.92 + outer = outer.getDeclaringClass()) {
195.93 + clazz = outer;
195.94 + }
195.95 + return clazz;
195.96 + }
195.97 +
195.98 + private static Class<?> checkHostClass(Class<?> hostClass) {
195.99 + // called only from the constructor
195.100 + // does a context-sensitive check on caller class
195.101 + // CC[0..3] = {Reflection, this.checkHostClass, this.<init>, caller}
195.102 + Class<?> caller = sun.reflect.Reflection.getCallerClass(CHC_CALLERS);
195.103 +
195.104 + if (caller == null) {
195.105 + // called from the JVM directly
195.106 + if (hostClass == null)
195.107 + return AnonymousClassLoader.class; // anything central will do
195.108 + return hostClass;
195.109 + }
195.110 +
195.111 + if (hostClass == null)
195.112 + hostClass = caller; // default value is caller itself
195.113 +
195.114 + // anonymous class will access hostClass on behalf of caller
195.115 + Class<?> callee = hostClass;
195.116 +
195.117 + if (caller == callee)
195.118 + // caller can always nominate itself to grant caller's own access rights
195.119 + return hostClass;
195.120 +
195.121 + // normalize caller and callee to their top-level classes:
195.122 + caller = getTopLevelClass(caller);
195.123 + callee = getTopLevelClass(callee);
195.124 + if (caller == callee)
195.125 + return caller;
195.126 +
195.127 + ClassLoader callerCL = caller.getClassLoader();
195.128 + if (callerCL == null) {
195.129 + // caller is trusted code, so accept the proposed hostClass
195.130 + return hostClass;
195.131 + }
195.132 +
195.133 + // %%% should do something with doPrivileged, because trusted
195.134 + // code should have a way to execute on behalf of
195.135 + // partially-trusted clients
195.136 +
195.137 + // Does the caller have the right to access the private
195.138 + // members of the callee? If not, raise an error.
195.139 + final int ACC_PRIVATE = 2;
195.140 + try {
195.141 + sun.reflect.Reflection.ensureMemberAccess(caller, callee, null, ACC_PRIVATE);
195.142 + } catch (IllegalAccessException ee) {
195.143 + throw new IllegalArgumentException(ee);
195.144 + }
195.145 +
195.146 + return hostClass;
195.147 + }
195.148 +
195.149 + public Class<?> loadClass(byte[] classFile) {
195.150 + if (defineAnonymousClass == null) {
195.151 + // no JVM support; try to fake an approximation
195.152 + try {
195.153 + return fakeLoadClass(new ConstantPoolParser(classFile).createPatch());
195.154 + } catch (InvalidConstantPoolFormatException ee) {
195.155 + throw new IllegalArgumentException(ee);
195.156 + }
195.157 + }
195.158 + return loadClass(classFile, null);
195.159 + }
195.160 +
195.161 + public Class<?> loadClass(ConstantPoolPatch classPatch) {
195.162 + if (defineAnonymousClass == null) {
195.163 + // no JVM support; try to fake an approximation
195.164 + return fakeLoadClass(classPatch);
195.165 + }
195.166 + Object[] patches = classPatch.patchArray;
195.167 + // Convert class names (this late in the game)
195.168 + // to use slash '/' instead of dot '.'.
195.169 + // Java likes dots, but the JVM likes slashes.
195.170 + for (int i = 0; i < patches.length; i++) {
195.171 + Object value = patches[i];
195.172 + if (value != null) {
195.173 + byte tag = classPatch.getTag(i);
195.174 + switch (tag) {
195.175 + case ConstantPoolVisitor.CONSTANT_Class:
195.176 + if (value instanceof String) {
195.177 + if (patches == classPatch.patchArray)
195.178 + patches = patches.clone();
195.179 + patches[i] = ((String)value).replace('.', '/');
195.180 + }
195.181 + break;
195.182 + case ConstantPoolVisitor.CONSTANT_Fieldref:
195.183 + case ConstantPoolVisitor.CONSTANT_Methodref:
195.184 + case ConstantPoolVisitor.CONSTANT_InterfaceMethodref:
195.185 + case ConstantPoolVisitor.CONSTANT_NameAndType:
195.186 + // When/if the JVM supports these patches,
195.187 + // we'll probably need to reformat them also.
195.188 + // Meanwhile, let the class loader create the error.
195.189 + break;
195.190 + }
195.191 + }
195.192 + }
195.193 + return loadClass(classPatch.outer.classFile, classPatch.patchArray);
195.194 + }
195.195 +
195.196 + private Class<?> loadClass(byte[] classFile, Object[] patchArray) {
195.197 + try {
195.198 + return (Class<?>)
195.199 + defineAnonymousClass.invoke(unsafe,
195.200 + hostClass, classFile, patchArray);
195.201 + } catch (Exception ex) {
195.202 + throwReflectedException(ex);
195.203 + throw new RuntimeException("error loading into "+hostClass, ex);
195.204 + }
195.205 + }
195.206 +
195.207 + private static void throwReflectedException(Exception ex) {
195.208 + if (ex instanceof InvocationTargetException) {
195.209 + Throwable tex = ((InvocationTargetException)ex).getTargetException();
195.210 + if (tex instanceof Error)
195.211 + throw (Error) tex;
195.212 + ex = (Exception) tex;
195.213 + }
195.214 + if (ex instanceof RuntimeException) {
195.215 + throw (RuntimeException) ex;
195.216 + }
195.217 + }
195.218 +
195.219 + private Class<?> fakeLoadClass(ConstantPoolPatch classPatch) {
195.220 + // Implementation:
195.221 + // 1. Make up a new name nobody has used yet.
195.222 + // 2. Inspect the tail-header of the class to find the this_class index.
195.223 + // 3. Patch the CONSTANT_Class for this_class to the new name.
195.224 + // 4. Add other CP entries required by (e.g.) string patches.
195.225 + // 5. Flatten Class constants down to their names, making sure that
195.226 + // the host class loader can pick them up again accurately.
195.227 + // 6. Generate the edited class file bytes.
195.228 + //
195.229 + // Potential limitations:
195.230 + // * The class won't be truly anonymous, and may interfere with others.
195.231 + // * Flattened class constants might not work, because of loader issues.
195.232 + // * Pseudo-string constants will not flatten down to real strings.
195.233 + // * Method handles will (of course) fail to flatten to linkage strings.
195.234 + if (true) throw new UnsupportedOperationException("NYI");
195.235 + Object[] cpArray;
195.236 + try {
195.237 + cpArray = classPatch.getOriginalCP();
195.238 + } catch (InvalidConstantPoolFormatException ex) {
195.239 + throw new RuntimeException(ex);
195.240 + }
195.241 + int thisClassIndex = classPatch.getParser().getThisClassIndex();
195.242 + String thisClassName = (String) cpArray[thisClassIndex];
195.243 + synchronized (AnonymousClassLoader.class) {
195.244 + thisClassName = thisClassName+"\\|"+(++fakeNameCounter);
195.245 + }
195.246 + classPatch.putUTF8(thisClassIndex, thisClassName);
195.247 + byte[] classFile = null;
195.248 + return unsafe.defineClass(null, classFile, 0, classFile.length,
195.249 + hostClass.getClassLoader(),
195.250 + hostClass.getProtectionDomain());
195.251 + }
195.252 + private static int fakeNameCounter = 99999;
195.253 +
195.254 + // ignore two warnings on this line:
195.255 + static sun.misc.Unsafe unsafe = sun.misc.Unsafe.getUnsafe();
195.256 + // preceding line requires that this class be on the boot class path
195.257 +
195.258 + static private final Method defineAnonymousClass;
195.259 + static {
195.260 + Method dac = null;
195.261 + Class<? extends sun.misc.Unsafe> unsafeClass = unsafe.getClass();
195.262 + try {
195.263 + dac = unsafeClass.getMethod("defineAnonymousClass",
195.264 + Class.class,
195.265 + byte[].class,
195.266 + Object[].class);
195.267 + } catch (Exception ee) {
195.268 + dac = null;
195.269 + }
195.270 + defineAnonymousClass = dac;
195.271 + }
195.272 +
195.273 + private static void noJVMSupport() {
195.274 + throw new UnsupportedOperationException("no JVM support for anonymous classes");
195.275 + }
195.276 +
195.277 +
195.278 + private static native Class<?> loadClassInternal(Class<?> hostClass,
195.279 + byte[] classFile,
195.280 + Object[] patchArray);
195.281 +
195.282 + public static byte[] readClassFile(Class<?> templateClass) throws IOException {
195.283 + String templateName = templateClass.getName();
195.284 + int lastDot = templateName.lastIndexOf('.');
195.285 + java.net.URL url = templateClass.getResource(templateName.substring(lastDot+1)+".class");
195.286 + java.net.URLConnection connection = url.openConnection();
195.287 + int contentLength = connection.getContentLength();
195.288 + if (contentLength < 0)
195.289 + throw new IOException("invalid content length "+contentLength);
195.290 +
195.291 + return IOUtils.readFully(connection.getInputStream(), contentLength, true);
195.292 + }
195.293 +}
196.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
196.2 +++ b/src/share/classes/sun/invoke/anon/ConstantPoolParser.java Tue Mar 29 20:19:55 2011 -0700
196.3 @@ -0,0 +1,368 @@
196.4 +/*
196.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
196.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
196.7 + *
196.8 + * This code is free software; you can redistribute it and/or modify it
196.9 + * under the terms of the GNU General Public License version 2 only, as
196.10 + * published by the Free Software Foundation. Oracle designates this
196.11 + * particular file as subject to the "Classpath" exception as provided
196.12 + * by Oracle in the LICENSE file that accompanied this code.
196.13 + *
196.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
196.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
196.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
196.17 + * version 2 for more details (a copy is included in the LICENSE file that
196.18 + * accompanied this code).
196.19 + *
196.20 + * You should have received a copy of the GNU General Public License version
196.21 + * 2 along with this work; if not, write to the Free Software Foundation,
196.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
196.23 + *
196.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
196.25 + * or visit www.oracle.com if you need additional information or have any
196.26 + * questions.
196.27 + */
196.28 +
196.29 +package sun.invoke.anon;
196.30 +
196.31 +import java.io.IOException;
196.32 +import java.io.OutputStream;
196.33 +import java.nio.BufferUnderflowException;
196.34 +import java.nio.ByteBuffer;
196.35 +
196.36 +import static sun.invoke.anon.ConstantPoolVisitor.*;
196.37 +
196.38 +/** A constant pool parser.
196.39 + */
196.40 +public class ConstantPoolParser {
196.41 + final byte[] classFile;
196.42 + final byte[] tags;
196.43 + final char[] firstHeader; // maghi, maglo, minor, major, cplen
196.44 +
196.45 + // these are filled in on first parse:
196.46 + int endOffset;
196.47 + char[] secondHeader; // flags, this_class, super_class, intlen
196.48 +
196.49 + // used to decode UTF8 array
196.50 + private char[] charArray = new char[80];
196.51 +
196.52 + /** Creates a constant pool parser.
196.53 + * @param classFile an array of bytes containing a class.
196.54 + * @throws InvalidConstantPoolFormatException if the header of the class has errors.
196.55 + */
196.56 + public ConstantPoolParser(byte[] classFile) throws InvalidConstantPoolFormatException {
196.57 + this.classFile = classFile;
196.58 + this.firstHeader = parseHeader(classFile);
196.59 + this.tags = new byte[firstHeader[4]];
196.60 + }
196.61 +
196.62 + /** Create a constant pool parser by loading the bytecodes of the
196.63 + * class taken as argument.
196.64 + *
196.65 + * @param templateClass the class to parse.
196.66 + *
196.67 + * @throws IOException raised if an I/O occurs when loading
196.68 + * the bytecode of the template class.
196.69 + * @throws InvalidConstantPoolFormatException if the header of the class has errors.
196.70 + *
196.71 + * @see #ConstantPoolParser(byte[])
196.72 + * @see AnonymousClassLoader#readClassFile(Class)
196.73 + */
196.74 + public ConstantPoolParser(Class<?> templateClass) throws IOException, InvalidConstantPoolFormatException {
196.75 + this(AnonymousClassLoader.readClassFile(templateClass));
196.76 + }
196.77 +
196.78 + /** Creates an empty patch to patch the class file
196.79 + * used by the current parser.
196.80 + * @return a new class patch.
196.81 + */
196.82 + public ConstantPoolPatch createPatch() {
196.83 + return new ConstantPoolPatch(this);
196.84 + }
196.85 +
196.86 + /** Report the tag of the indicated CP entry.
196.87 + * @param index
196.88 + * @return one of {@link ConstantPoolVisitor#CONSTANT_Utf8}, etc.
196.89 + */
196.90 + public byte getTag(int index) {
196.91 + getEndOffset(); // trigger an exception if we haven't parsed yet
196.92 + return tags[index];
196.93 + }
196.94 +
196.95 + /** Report the length of the constant pool. */
196.96 + public int getLength() {
196.97 + return firstHeader[4];
196.98 + }
196.99 +
196.100 + /** Report the offset, within the class file, of the start of the constant pool. */
196.101 + public int getStartOffset() {
196.102 + return firstHeader.length * 2;
196.103 + }
196.104 +
196.105 + /** Report the offset, within the class file, of the end of the constant pool. */
196.106 + public int getEndOffset() {
196.107 + if (endOffset == 0)
196.108 + throw new IllegalStateException("class file has not yet been parsed");
196.109 + return endOffset;
196.110 + }
196.111 +
196.112 + /** Report the CP index of this class's own name. */
196.113 + public int getThisClassIndex() {
196.114 + getEndOffset(); // provoke exception if not yet parsed
196.115 + return secondHeader[1];
196.116 + }
196.117 +
196.118 + /** Report the total size of the class file. */
196.119 + public int getTailLength() {
196.120 + return classFile.length - getEndOffset();
196.121 + }
196.122 +
196.123 + /** Write the head (header plus constant pool)
196.124 + * of the class file to the indicated stream.
196.125 + */
196.126 + public void writeHead(OutputStream out) throws IOException {
196.127 + out.write(classFile, 0, getEndOffset());
196.128 + }
196.129 +
196.130 + /** Write the head (header plus constant pool)
196.131 + * of the class file to the indicated stream,
196.132 + * incorporating the non-null entries of the given array
196.133 + * as patches.
196.134 + */
196.135 + void writePatchedHead(OutputStream out, Object[] patchArray) {
196.136 + // this will be useful to partially emulate the class loader on old JVMs
196.137 + throw new UnsupportedOperationException("Not yet implemented");
196.138 + }
196.139 +
196.140 + /** Write the tail (everything after the constant pool)
196.141 + * of the class file to the indicated stream.
196.142 + */
196.143 + public void writeTail(OutputStream out) throws IOException {
196.144 + out.write(classFile, getEndOffset(), getTailLength());
196.145 + }
196.146 +
196.147 + private static char[] parseHeader(byte[] classFile) throws InvalidConstantPoolFormatException {
196.148 + char[] result = new char[5];
196.149 + ByteBuffer buffer = ByteBuffer.wrap(classFile);
196.150 + for (int i = 0; i < result.length; i++)
196.151 + result[i] = (char) getUnsignedShort(buffer);
196.152 + int magic = result[0] << 16 | result[1] << 0;
196.153 + if (magic != 0xCAFEBABE)
196.154 + throw new InvalidConstantPoolFormatException("invalid magic number "+magic);
196.155 + // skip major, minor version
196.156 + int len = result[4];
196.157 + if (len < 1)
196.158 + throw new InvalidConstantPoolFormatException("constant pool length < 1");
196.159 + return result;
196.160 + }
196.161 +
196.162 + /** Parse the constant pool of the class
196.163 + * calling a method visit* each time a constant pool entry is parsed.
196.164 + *
196.165 + * The order of the calls to visit* is not guaranteed to be the same
196.166 + * than the order of the constant pool entry in the bytecode array.
196.167 + *
196.168 + * @param visitor
196.169 + * @throws InvalidConstantPoolFormatException
196.170 + */
196.171 + public void parse(ConstantPoolVisitor visitor) throws InvalidConstantPoolFormatException {
196.172 + ByteBuffer buffer = ByteBuffer.wrap(classFile);
196.173 + buffer.position(getStartOffset()); //skip header
196.174 +
196.175 + Object[] values = new Object[getLength()];
196.176 + try {
196.177 + parseConstantPool(buffer, values, visitor);
196.178 + } catch(BufferUnderflowException e) {
196.179 + throw new InvalidConstantPoolFormatException(e);
196.180 + }
196.181 + if (endOffset == 0) {
196.182 + endOffset = buffer.position();
196.183 + secondHeader = new char[4];
196.184 + for (int i = 0; i < secondHeader.length; i++) {
196.185 + secondHeader[i] = (char) getUnsignedShort(buffer);
196.186 + }
196.187 + }
196.188 + resolveConstantPool(values, visitor);
196.189 + }
196.190 +
196.191 + private char[] getCharArray(int utfLength) {
196.192 + if (utfLength <= charArray.length)
196.193 + return charArray;
196.194 + return charArray = new char[utfLength];
196.195 + }
196.196 +
196.197 + private void parseConstantPool(ByteBuffer buffer, Object[] values, ConstantPoolVisitor visitor) throws InvalidConstantPoolFormatException {
196.198 + for (int i = 1; i < tags.length; ) {
196.199 + byte tag = (byte) getUnsignedByte(buffer);
196.200 + assert(tags[i] == 0 || tags[i] == tag);
196.201 + tags[i] = tag;
196.202 + switch (tag) {
196.203 + case CONSTANT_Utf8:
196.204 + int utfLen = getUnsignedShort(buffer);
196.205 + String value = getUTF8(buffer, utfLen, getCharArray(utfLen));
196.206 + visitor.visitUTF8(i, CONSTANT_Utf8, value);
196.207 + tags[i] = tag;
196.208 + values[i++] = value;
196.209 + break;
196.210 + case CONSTANT_Integer:
196.211 + visitor.visitConstantValue(i, tag, buffer.getInt());
196.212 + i++;
196.213 + break;
196.214 + case CONSTANT_Float:
196.215 + visitor.visitConstantValue(i, tag, buffer.getFloat());
196.216 + i++;
196.217 + break;
196.218 + case CONSTANT_Long:
196.219 + visitor.visitConstantValue(i, tag, buffer.getLong());
196.220 + i+=2;
196.221 + break;
196.222 + case CONSTANT_Double:
196.223 + visitor.visitConstantValue(i, tag, buffer.getDouble());
196.224 + i+=2;
196.225 + break;
196.226 +
196.227 + case CONSTANT_Class: // fall through:
196.228 + case CONSTANT_String:
196.229 + tags[i] = tag;
196.230 + values[i++] = new int[] { getUnsignedShort(buffer) };
196.231 + break;
196.232 +
196.233 + case CONSTANT_Fieldref: // fall through:
196.234 + case CONSTANT_Methodref: // fall through:
196.235 + case CONSTANT_InterfaceMethodref: // fall through:
196.236 + case CONSTANT_NameAndType:
196.237 + tags[i] = tag;
196.238 + values[i++] = new int[] { getUnsignedShort(buffer), getUnsignedShort(buffer) };
196.239 + break;
196.240 + default:
196.241 + throw new AssertionError("invalid constant "+tag);
196.242 + }
196.243 + }
196.244 + }
196.245 +
196.246 + private void resolveConstantPool(Object[] values, ConstantPoolVisitor visitor) {
196.247 + // clean out the int[] values, which are temporary
196.248 + for (int beg = 1, end = values.length-1, beg2, end2;
196.249 + beg <= end;
196.250 + beg = beg2, end = end2) {
196.251 + beg2 = end; end2 = beg-1;
196.252 + //System.out.println("CP resolve pass: "+beg+".."+end);
196.253 + for (int i = beg; i <= end; i++) {
196.254 + Object value = values[i];
196.255 + if (!(value instanceof int[]))
196.256 + continue;
196.257 + int[] array = (int[]) value;
196.258 + byte tag = tags[i];
196.259 + switch (tag) {
196.260 + case CONSTANT_String:
196.261 + String stringBody = (String) values[array[0]];
196.262 + visitor.visitConstantString(i, tag, stringBody, array[0]);
196.263 + values[i] = null;
196.264 + break;
196.265 + case CONSTANT_Class: {
196.266 + String className = (String) values[array[0]];
196.267 + // use the external form favored by Class.forName:
196.268 + className = className.replace('/', '.');
196.269 + visitor.visitConstantString(i, tag, className, array[0]);
196.270 + values[i] = className;
196.271 + break;
196.272 + }
196.273 + case CONSTANT_NameAndType: {
196.274 + String memberName = (String) values[array[0]];
196.275 + String signature = (String) values[array[1]];
196.276 + visitor.visitDescriptor(i, tag, memberName, signature,
196.277 + array[0], array[1]);
196.278 + values[i] = new String[] {memberName, signature};
196.279 + break;
196.280 + }
196.281 + case CONSTANT_Fieldref: // fall through:
196.282 + case CONSTANT_Methodref: // fall through:
196.283 + case CONSTANT_InterfaceMethodref: {
196.284 + Object className = values[array[0]];
196.285 + Object nameAndType = values[array[1]];
196.286 + if (!(className instanceof String) ||
196.287 + !(nameAndType instanceof String[])) {
196.288 + // one more pass is needed
196.289 + if (beg2 > i) beg2 = i;
196.290 + if (end2 < i) end2 = i;
196.291 + continue;
196.292 + }
196.293 + String[] nameAndTypeArray = (String[]) nameAndType;
196.294 + visitor.visitMemberRef(i, tag,
196.295 + (String)className,
196.296 + nameAndTypeArray[0],
196.297 + nameAndTypeArray[1],
196.298 + array[0], array[1]);
196.299 + values[i] = null;
196.300 + }
196.301 + break;
196.302 + default:
196.303 + continue;
196.304 + }
196.305 + }
196.306 + }
196.307 + }
196.308 +
196.309 + private static int getUnsignedByte(ByteBuffer buffer) {
196.310 + return buffer.get() & 0xFF;
196.311 + }
196.312 +
196.313 + private static int getUnsignedShort(ByteBuffer buffer) {
196.314 + int b1 = getUnsignedByte(buffer);
196.315 + int b2 = getUnsignedByte(buffer);
196.316 + return (b1 << 8) + (b2 << 0);
196.317 + }
196.318 +
196.319 + private static String getUTF8(ByteBuffer buffer, int utfLen, char[] charArray) throws InvalidConstantPoolFormatException {
196.320 + int utfLimit = buffer.position() + utfLen;
196.321 + int index = 0;
196.322 + while (buffer.position() < utfLimit) {
196.323 + int c = buffer.get() & 0xff;
196.324 + if (c > 127) {
196.325 + buffer.position(buffer.position() - 1);
196.326 + return getUTF8Extended(buffer, utfLimit, charArray, index);
196.327 + }
196.328 + charArray[index++] = (char)c;
196.329 + }
196.330 + return new String(charArray, 0, index);
196.331 + }
196.332 +
196.333 + private static String getUTF8Extended(ByteBuffer buffer, int utfLimit, char[] charArray, int index) throws InvalidConstantPoolFormatException {
196.334 + int c, c2, c3;
196.335 + while (buffer.position() < utfLimit) {
196.336 + c = buffer.get() & 0xff;
196.337 + switch (c >> 4) {
196.338 + case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
196.339 + /* 0xxxxxxx*/
196.340 + charArray[index++] = (char)c;
196.341 + break;
196.342 + case 12: case 13:
196.343 + /* 110x xxxx 10xx xxxx*/
196.344 + c2 = buffer.get();
196.345 + if ((c2 & 0xC0) != 0x80)
196.346 + throw new InvalidConstantPoolFormatException(
196.347 + "malformed input around byte " + buffer.position());
196.348 + charArray[index++] = (char)(((c & 0x1F) << 6) |
196.349 + (c2 & 0x3F));
196.350 + break;
196.351 + case 14:
196.352 + /* 1110 xxxx 10xx xxxx 10xx xxxx */
196.353 + c2 = buffer.get();
196.354 + c3 = buffer.get();
196.355 + if (((c2 & 0xC0) != 0x80) || ((c3 & 0xC0) != 0x80))
196.356 + throw new InvalidConstantPoolFormatException(
196.357 + "malformed input around byte " + (buffer.position()));
196.358 + charArray[index++] = (char)(((c & 0x0F) << 12) |
196.359 + ((c2 & 0x3F) << 6) |
196.360 + ((c3 & 0x3F) << 0));
196.361 + break;
196.362 + default:
196.363 + /* 10xx xxxx, 1111 xxxx */
196.364 + throw new InvalidConstantPoolFormatException(
196.365 + "malformed input around byte " + buffer.position());
196.366 + }
196.367 + }
196.368 + // The number of chars produced may be less than utflen
196.369 + return new String(charArray, 0, index);
196.370 + }
196.371 +}
197.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
197.2 +++ b/src/share/classes/sun/invoke/anon/ConstantPoolPatch.java Tue Mar 29 20:19:55 2011 -0700
197.3 @@ -0,0 +1,503 @@
197.4 +/*
197.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
197.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
197.7 + *
197.8 + * This code is free software; you can redistribute it and/or modify it
197.9 + * under the terms of the GNU General Public License version 2 only, as
197.10 + * published by the Free Software Foundation. Oracle designates this
197.11 + * particular file as subject to the "Classpath" exception as provided
197.12 + * by Oracle in the LICENSE file that accompanied this code.
197.13 + *
197.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
197.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
197.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
197.17 + * version 2 for more details (a copy is included in the LICENSE file that
197.18 + * accompanied this code).
197.19 + *
197.20 + * You should have received a copy of the GNU General Public License version
197.21 + * 2 along with this work; if not, write to the Free Software Foundation,
197.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
197.23 + *
197.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
197.25 + * or visit www.oracle.com if you need additional information or have any
197.26 + * questions.
197.27 + */
197.28 +
197.29 +package sun.invoke.anon;
197.30 +
197.31 +import java.io.IOException;
197.32 +import java.io.OutputStream;
197.33 +import java.util.Arrays;
197.34 +import java.util.HashSet;
197.35 +import java.util.IdentityHashMap;
197.36 +import java.util.Map;
197.37 +
197.38 +import static sun.invoke.anon.ConstantPoolVisitor.*;
197.39 +
197.40 +/** A class and its patched constant pool.
197.41 + *
197.42 + * This class allow to modify (patch) a constant pool
197.43 + * by changing the value of its entry.
197.44 + * Entry are referenced using index that can be get
197.45 + * by parsing the constant pool using
197.46 + * {@link ConstantPoolParser#parse(ConstantPoolVisitor)}.
197.47 + *
197.48 + * @see ConstantPoolVisitor
197.49 + * @see ConstantPoolParser#createPatch()
197.50 + */
197.51 +public class ConstantPoolPatch {
197.52 + final ConstantPoolParser outer;
197.53 + final Object[] patchArray;
197.54 +
197.55 + ConstantPoolPatch(ConstantPoolParser outer) {
197.56 + this.outer = outer;
197.57 + this.patchArray = new Object[outer.getLength()];
197.58 + }
197.59 +
197.60 + /** Create a {@link ConstantPoolParser} and
197.61 + * a {@link ConstantPoolPatch} in one step.
197.62 + * Equivalent to {@code new ConstantPoolParser(classFile).createPatch()}.
197.63 + *
197.64 + * @param classFile an array of bytes containing a class.
197.65 + * @see #ConstantPoolParser(Class)
197.66 + */
197.67 + public ConstantPoolPatch(byte[] classFile) throws InvalidConstantPoolFormatException {
197.68 + this(new ConstantPoolParser(classFile));
197.69 + }
197.70 +
197.71 + /** Create a {@link ConstantPoolParser} and
197.72 + * a {@link ConstantPoolPatch} in one step.
197.73 + * Equivalent to {@code new ConstantPoolParser(templateClass).createPatch()}.
197.74 + *
197.75 + * @param templateClass the class to parse.
197.76 + * @see #ConstantPoolParser(Class)
197.77 + */
197.78 + public ConstantPoolPatch(Class<?> templateClass) throws IOException, InvalidConstantPoolFormatException {
197.79 + this(new ConstantPoolParser(templateClass));
197.80 + }
197.81 +
197.82 +
197.83 + /** Creates a patch from an existing patch.
197.84 + * All changes are copied from that patch.
197.85 + * @param patch a patch
197.86 + *
197.87 + * @see ConstantPoolParser#createPatch()
197.88 + */
197.89 + public ConstantPoolPatch(ConstantPoolPatch patch) {
197.90 + outer = patch.outer;
197.91 + patchArray = patch.patchArray.clone();
197.92 + }
197.93 +
197.94 + /** Which parser built this patch? */
197.95 + public ConstantPoolParser getParser() {
197.96 + return outer;
197.97 + }
197.98 +
197.99 + /** Report the tag at the given index in the constant pool. */
197.100 + public byte getTag(int index) {
197.101 + return outer.getTag(index);
197.102 + }
197.103 +
197.104 + /** Report the current patch at the given index of the constant pool.
197.105 + * Null means no patch will be made.
197.106 + * To observe the unpatched entry at the given index, use
197.107 + * {@link #getParser()}{@code .}@link ConstantPoolParser#parse(ConstantPoolVisitor)}
197.108 + */
197.109 + public Object getPatch(int index) {
197.110 + Object value = patchArray[index];
197.111 + if (value == null) return null;
197.112 + switch (getTag(index)) {
197.113 + case CONSTANT_Fieldref:
197.114 + case CONSTANT_Methodref:
197.115 + case CONSTANT_InterfaceMethodref:
197.116 + if (value instanceof String)
197.117 + value = stripSemis(2, (String) value);
197.118 + break;
197.119 + case CONSTANT_NameAndType:
197.120 + if (value instanceof String)
197.121 + value = stripSemis(1, (String) value);
197.122 + break;
197.123 + }
197.124 + return value;
197.125 + }
197.126 +
197.127 + /** Clear all patches. */
197.128 + public void clear() {
197.129 + Arrays.fill(patchArray, null);
197.130 + }
197.131 +
197.132 + /** Clear one patch. */
197.133 + public void clear(int index) {
197.134 + patchArray[index] = null;
197.135 + }
197.136 +
197.137 + /** Produce the patches as an array. */
197.138 + public Object[] getPatches() {
197.139 + return patchArray.clone();
197.140 + }
197.141 +
197.142 + /** Produce the original constant pool as an array. */
197.143 + public Object[] getOriginalCP() throws InvalidConstantPoolFormatException {
197.144 + return getOriginalCP(0, patchArray.length, -1);
197.145 + }
197.146 +
197.147 + /** Walk the constant pool, applying patches using the given map.
197.148 + *
197.149 + * @param utf8Map Utf8 strings to modify, if encountered
197.150 + * @param classMap Classes (or their names) to modify, if encountered
197.151 + * @param valueMap Constant values to modify, if encountered
197.152 + * @param deleteUsedEntries if true, delete map entries that are used
197.153 + */
197.154 + public void putPatches(final Map<String,String> utf8Map,
197.155 + final Map<String,Object> classMap,
197.156 + final Map<Object,Object> valueMap,
197.157 + boolean deleteUsedEntries) throws InvalidConstantPoolFormatException {
197.158 + final HashSet<String> usedUtf8Keys;
197.159 + final HashSet<String> usedClassKeys;
197.160 + final HashSet<Object> usedValueKeys;
197.161 + if (deleteUsedEntries) {
197.162 + usedUtf8Keys = (utf8Map == null) ? null : new HashSet<String>();
197.163 + usedClassKeys = (classMap == null) ? null : new HashSet<String>();
197.164 + usedValueKeys = (valueMap == null) ? null : new HashSet<Object>();
197.165 + } else {
197.166 + usedUtf8Keys = null;
197.167 + usedClassKeys = null;
197.168 + usedValueKeys = null;
197.169 + }
197.170 +
197.171 + outer.parse(new ConstantPoolVisitor() {
197.172 +
197.173 + @Override
197.174 + public void visitUTF8(int index, byte tag, String utf8) {
197.175 + putUTF8(index, utf8Map.get(utf8));
197.176 + if (usedUtf8Keys != null) usedUtf8Keys.add(utf8);
197.177 + }
197.178 +
197.179 + @Override
197.180 + public void visitConstantValue(int index, byte tag, Object value) {
197.181 + putConstantValue(index, tag, valueMap.get(value));
197.182 + if (usedValueKeys != null) usedValueKeys.add(value);
197.183 + }
197.184 +
197.185 + @Override
197.186 + public void visitConstantString(int index, byte tag, String name, int nameIndex) {
197.187 + if (tag == CONSTANT_Class) {
197.188 + putConstantValue(index, tag, classMap.get(name));
197.189 + if (usedClassKeys != null) usedClassKeys.add(name);
197.190 + } else {
197.191 + assert(tag == CONSTANT_String);
197.192 + visitConstantValue(index, tag, name);
197.193 + }
197.194 + }
197.195 + });
197.196 + if (usedUtf8Keys != null) utf8Map.keySet().removeAll(usedUtf8Keys);
197.197 + if (usedClassKeys != null) classMap.keySet().removeAll(usedClassKeys);
197.198 + if (usedValueKeys != null) valueMap.keySet().removeAll(usedValueKeys);
197.199 + }
197.200 +
197.201 + Object[] getOriginalCP(final int startIndex,
197.202 + final int endIndex,
197.203 + final int tagMask) throws InvalidConstantPoolFormatException {
197.204 + final Object[] cpArray = new Object[endIndex - startIndex];
197.205 + outer.parse(new ConstantPoolVisitor() {
197.206 +
197.207 + void show(int index, byte tag, Object value) {
197.208 + if (index < startIndex || index >= endIndex) return;
197.209 + if (((1 << tag) & tagMask) == 0) return;
197.210 + cpArray[index - startIndex] = value;
197.211 + }
197.212 +
197.213 + @Override
197.214 + public void visitUTF8(int index, byte tag, String utf8) {
197.215 + show(index, tag, utf8);
197.216 + }
197.217 +
197.218 + @Override
197.219 + public void visitConstantValue(int index, byte tag, Object value) {
197.220 + assert(tag != CONSTANT_String);
197.221 + show(index, tag, value);
197.222 + }
197.223 +
197.224 + @Override
197.225 + public void visitConstantString(int index, byte tag,
197.226 + String value, int j) {
197.227 + show(index, tag, value);
197.228 + }
197.229 +
197.230 + @Override
197.231 + public void visitMemberRef(int index, byte tag,
197.232 + String className, String memberName,
197.233 + String signature,
197.234 + int j, int k) {
197.235 + show(index, tag, new String[]{ className, memberName, signature });
197.236 + }
197.237 +
197.238 + @Override
197.239 + public void visitDescriptor(int index, byte tag,
197.240 + String memberName, String signature,
197.241 + int j, int k) {
197.242 + show(index, tag, new String[]{ memberName, signature });
197.243 + }
197.244 + });
197.245 + return cpArray;
197.246 + }
197.247 +
197.248 + /** Write the head (header plus constant pool)
197.249 + * of the patched class file to the indicated stream.
197.250 + */
197.251 + void writeHead(OutputStream out) throws IOException {
197.252 + outer.writePatchedHead(out, patchArray);
197.253 + }
197.254 +
197.255 + /** Write the tail (everything after the constant pool)
197.256 + * of the patched class file to the indicated stream.
197.257 + */
197.258 + void writeTail(OutputStream out) throws IOException {
197.259 + outer.writeTail(out);
197.260 + }
197.261 +
197.262 + private void checkConstantTag(byte tag, Object value) {
197.263 + if (value == null)
197.264 + throw new IllegalArgumentException(
197.265 + "invalid null constant value");
197.266 + if (classForTag(tag) != value.getClass())
197.267 + throw new IllegalArgumentException(
197.268 + "invalid constant value"
197.269 + + (tag == CONSTANT_None ? ""
197.270 + : " for tag "+tagName(tag))
197.271 + + " of class "+value.getClass());
197.272 + }
197.273 +
197.274 + private void checkTag(int index, byte putTag) {
197.275 + byte tag = outer.tags[index];
197.276 + if (tag != putTag)
197.277 + throw new IllegalArgumentException(
197.278 + "invalid put operation"
197.279 + + " for " + tagName(putTag)
197.280 + + " at index " + index + " found " + tagName(tag));
197.281 + }
197.282 +
197.283 + private void checkTagMask(int index, int tagBitMask) {
197.284 + byte tag = outer.tags[index];
197.285 + int tagBit = ((tag & 0x1F) == tag) ? (1 << tag) : 0;
197.286 + if ((tagBit & tagBitMask) == 0)
197.287 + throw new IllegalArgumentException(
197.288 + "invalid put operation"
197.289 + + " at index " + index + " found " + tagName(tag));
197.290 + }
197.291 +
197.292 + private static void checkMemberName(String memberName) {
197.293 + if (memberName.indexOf(';') >= 0)
197.294 + throw new IllegalArgumentException("memberName " + memberName + " contains a ';'");
197.295 + }
197.296 +
197.297 + /** Set the entry of the constant pool indexed by index to
197.298 + * a new string.
197.299 + *
197.300 + * @param index an index to a constant pool entry containing a
197.301 + * {@link ConstantPoolVisitor#CONSTANT_Utf8} value.
197.302 + * @param utf8 a string
197.303 + *
197.304 + * @see ConstantPoolVisitor#visitUTF8(int, byte, String)
197.305 + */
197.306 + public void putUTF8(int index, String utf8) {
197.307 + if (utf8 == null) { clear(index); return; }
197.308 + checkTag(index, CONSTANT_Utf8);
197.309 + patchArray[index] = utf8;
197.310 + }
197.311 +
197.312 + /** Set the entry of the constant pool indexed by index to
197.313 + * a new value, depending on its dynamic type.
197.314 + *
197.315 + * @param index an index to a constant pool entry containing a
197.316 + * one of the following structures:
197.317 + * {@link ConstantPoolVisitor#CONSTANT_Integer},
197.318 + * {@link ConstantPoolVisitor#CONSTANT_Float},
197.319 + * {@link ConstantPoolVisitor#CONSTANT_Long},
197.320 + * {@link ConstantPoolVisitor#CONSTANT_Double},
197.321 + * {@link ConstantPoolVisitor#CONSTANT_String}, or
197.322 + * {@link ConstantPoolVisitor#CONSTANT_Class}
197.323 + * @param value a boxed int, float, long or double; or a string or class object
197.324 + * @throws IllegalArgumentException if the type of the constant does not
197.325 + * match the constant pool entry type,
197.326 + * as reported by {@link #getTag(int)}
197.327 + *
197.328 + * @see #putConstantValue(int, byte, Object)
197.329 + * @see ConstantPoolVisitor#visitConstantValue(int, byte, Object)
197.330 + * @see ConstantPoolVisitor#visitConstantString(int, byte, String, int)
197.331 + */
197.332 + public void putConstantValue(int index, Object value) {
197.333 + if (value == null) { clear(index); return; }
197.334 + byte tag = tagForConstant(value.getClass());
197.335 + checkConstantTag(tag, value);
197.336 + checkTag(index, tag);
197.337 + patchArray[index] = value;
197.338 + }
197.339 +
197.340 + /** Set the entry of the constant pool indexed by index to
197.341 + * a new value.
197.342 + *
197.343 + * @param index an index to a constant pool entry matching the given tag
197.344 + * @param tag one of the following values:
197.345 + * {@link ConstantPoolVisitor#CONSTANT_Integer},
197.346 + * {@link ConstantPoolVisitor#CONSTANT_Float},
197.347 + * {@link ConstantPoolVisitor#CONSTANT_Long},
197.348 + * {@link ConstantPoolVisitor#CONSTANT_Double},
197.349 + * {@link ConstantPoolVisitor#CONSTANT_String}, or
197.350 + * {@link ConstantPoolVisitor#CONSTANT_Class}
197.351 + * @param value a boxed number, string, or class object
197.352 + * @throws IllegalArgumentException if the type of the constant does not
197.353 + * match the constant pool entry type, or if a class name contains
197.354 + * '/' or ';'
197.355 + *
197.356 + * @see #putConstantValue(int, Object)
197.357 + * @see ConstantPoolVisitor#visitConstantValue(int, byte, Object)
197.358 + * @see ConstantPoolVisitor#visitConstantString(int, byte, String, int)
197.359 + */
197.360 + public void putConstantValue(int index, byte tag, Object value) {
197.361 + if (value == null) { clear(index); return; }
197.362 + checkTag(index, tag);
197.363 + if (tag == CONSTANT_Class && value instanceof String) {
197.364 + checkClassName((String) value);
197.365 + } else if (tag == CONSTANT_String) {
197.366 + // the JVM accepts any object as a patch for a string
197.367 + } else {
197.368 + // make sure the incoming value is the right type
197.369 + checkConstantTag(tag, value);
197.370 + }
197.371 + checkTag(index, tag);
197.372 + patchArray[index] = value;
197.373 + }
197.374 +
197.375 + /** Set the entry of the constant pool indexed by index to
197.376 + * a new {@link ConstantPoolVisitor#CONSTANT_NameAndType} value.
197.377 + *
197.378 + * @param index an index to a constant pool entry containing a
197.379 + * {@link ConstantPoolVisitor#CONSTANT_NameAndType} value.
197.380 + * @param memberName a memberName
197.381 + * @param signature a signature
197.382 + * @throws IllegalArgumentException if memberName contains the character ';'
197.383 + *
197.384 + * @see ConstantPoolVisitor#visitDescriptor(int, byte, String, String, int, int)
197.385 + */
197.386 + public void putDescriptor(int index, String memberName, String signature) {
197.387 + checkTag(index, CONSTANT_NameAndType);
197.388 + checkMemberName(memberName);
197.389 + patchArray[index] = addSemis(memberName, signature);
197.390 + }
197.391 +
197.392 + /** Set the entry of the constant pool indexed by index to
197.393 + * a new {@link ConstantPoolVisitor#CONSTANT_Fieldref},
197.394 + * {@link ConstantPoolVisitor#CONSTANT_Methodref}, or
197.395 + * {@link ConstantPoolVisitor#CONSTANT_InterfaceMethodref} value.
197.396 + *
197.397 + * @param index an index to a constant pool entry containing a member reference
197.398 + * @param className a class name
197.399 + * @param memberName a field or method name
197.400 + * @param signature a field or method signature
197.401 + * @throws IllegalArgumentException if memberName contains the character ';'
197.402 + * or signature is not a correct signature
197.403 + *
197.404 + * @see ConstantPoolVisitor#visitMemberRef(int, byte, String, String, String, int, int)
197.405 + */
197.406 + public void putMemberRef(int index, byte tag,
197.407 + String className, String memberName, String signature) {
197.408 + checkTagMask(tag, CONSTANT_MemberRef_MASK);
197.409 + checkTag(index, tag);
197.410 + checkClassName(className);
197.411 + checkMemberName(memberName);
197.412 + if (signature.startsWith("(") == (tag == CONSTANT_Fieldref))
197.413 + throw new IllegalArgumentException("bad signature: "+signature);
197.414 + patchArray[index] = addSemis(className, memberName, signature);
197.415 + }
197.416 +
197.417 + static private final int CONSTANT_MemberRef_MASK =
197.418 + CONSTANT_Fieldref
197.419 + | CONSTANT_Methodref
197.420 + | CONSTANT_InterfaceMethodref;
197.421 +
197.422 + private static final Map<Class<?>, Byte> CONSTANT_VALUE_CLASS_TAG
197.423 + = new IdentityHashMap<Class<?>, Byte>();
197.424 + private static final Class[] CONSTANT_VALUE_CLASS = new Class[16];
197.425 + static {
197.426 + Object[][] values = {
197.427 + {Integer.class, CONSTANT_Integer},
197.428 + {Long.class, CONSTANT_Long},
197.429 + {Float.class, CONSTANT_Float},
197.430 + {Double.class, CONSTANT_Double},
197.431 + {String.class, CONSTANT_String},
197.432 + {Class.class, CONSTANT_Class}
197.433 + };
197.434 + for (Object[] value : values) {
197.435 + Class<?> cls = (Class<?>)value[0];
197.436 + Byte tag = (Byte) value[1];
197.437 + CONSTANT_VALUE_CLASS_TAG.put(cls, tag);
197.438 + CONSTANT_VALUE_CLASS[(byte)tag] = cls;
197.439 + }
197.440 + }
197.441 +
197.442 + static Class<?> classForTag(byte tag) {
197.443 + if ((tag & 0xFF) >= CONSTANT_VALUE_CLASS.length)
197.444 + return null;
197.445 + return CONSTANT_VALUE_CLASS[tag];
197.446 + }
197.447 +
197.448 + static byte tagForConstant(Class<?> cls) {
197.449 + Byte tag = CONSTANT_VALUE_CLASS_TAG.get(cls);
197.450 + return (tag == null) ? CONSTANT_None : (byte)tag;
197.451 + }
197.452 +
197.453 + private static void checkClassName(String className) {
197.454 + if (className.indexOf('/') >= 0 || className.indexOf(';') >= 0)
197.455 + throw new IllegalArgumentException("invalid class name " + className);
197.456 + }
197.457 +
197.458 + static String addSemis(String name, String... names) {
197.459 + StringBuilder buf = new StringBuilder(name.length() * 5);
197.460 + buf.append(name);
197.461 + for (String name2 : names) {
197.462 + buf.append(';').append(name2);
197.463 + }
197.464 + String res = buf.toString();
197.465 + assert(stripSemis(names.length, res)[0].equals(name));
197.466 + assert(stripSemis(names.length, res)[1].equals(names[0]));
197.467 + assert(names.length == 1 ||
197.468 + stripSemis(names.length, res)[2].equals(names[1]));
197.469 + return res;
197.470 + }
197.471 +
197.472 + static String[] stripSemis(int count, String string) {
197.473 + String[] res = new String[count+1];
197.474 + int pos = 0;
197.475 + for (int i = 0; i < count; i++) {
197.476 + int pos2 = string.indexOf(';', pos);
197.477 + if (pos2 < 0) pos2 = string.length(); // yuck
197.478 + res[i] = string.substring(pos, pos2);
197.479 + pos = pos2;
197.480 + }
197.481 + res[count] = string.substring(pos);
197.482 + return res;
197.483 + }
197.484 +
197.485 + public String toString() {
197.486 + StringBuilder buf = new StringBuilder(this.getClass().getName());
197.487 + buf.append("{");
197.488 + Object[] origCP = null;
197.489 + for (int i = 0; i < patchArray.length; i++) {
197.490 + if (patchArray[i] == null) continue;
197.491 + if (origCP != null) {
197.492 + buf.append(", ");
197.493 + } else {
197.494 + try {
197.495 + origCP = getOriginalCP();
197.496 + } catch (InvalidConstantPoolFormatException ee) {
197.497 + origCP = new Object[0];
197.498 + }
197.499 + }
197.500 + Object orig = (i < origCP.length) ? origCP[i] : "?";
197.501 + buf.append(orig).append("=").append(patchArray[i]);
197.502 + }
197.503 + buf.append("}");
197.504 + return buf.toString();
197.505 + }
197.506 +}
198.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
198.2 +++ b/src/share/classes/sun/invoke/anon/ConstantPoolVisitor.java Tue Mar 29 20:19:55 2011 -0700
198.3 @@ -0,0 +1,192 @@
198.4 +/*
198.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
198.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
198.7 + *
198.8 + * This code is free software; you can redistribute it and/or modify it
198.9 + * under the terms of the GNU General Public License version 2 only, as
198.10 + * published by the Free Software Foundation. Oracle designates this
198.11 + * particular file as subject to the "Classpath" exception as provided
198.12 + * by Oracle in the LICENSE file that accompanied this code.
198.13 + *
198.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
198.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
198.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
198.17 + * version 2 for more details (a copy is included in the LICENSE file that
198.18 + * accompanied this code).
198.19 + *
198.20 + * You should have received a copy of the GNU General Public License version
198.21 + * 2 along with this work; if not, write to the Free Software Foundation,
198.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
198.23 + *
198.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
198.25 + * or visit www.oracle.com if you need additional information or have any
198.26 + * questions.
198.27 + */
198.28 +
198.29 +package sun.invoke.anon;
198.30 +
198.31 +/**
198.32 + * A visitor called by {@link ConstantPoolParser#parse(ConstantPoolVisitor)}
198.33 + * when a constant pool entry is parsed.
198.34 + * <p>
198.35 + * A visit* method is called when a constant pool entry is parsed.
198.36 + * The first argument is always the constant pool index.
198.37 + * The second argument is always the constant pool tag,
198.38 + * even for methods like {@link #visitUTF8(int, byte, String)} which only apply to one tag.
198.39 + * String arguments refer to Utf8 or NameAndType entries declared elsewhere,
198.40 + * and are always accompanied by the indexes of those entries.
198.41 + * <p>
198.42 + * The order of the calls to the visit* methods is not necessarily related
198.43 + * to the order of the entries in the constant pool.
198.44 + * If one entry has a reference to another entry, the latter (lower-level)
198.45 + * entry will be visited first.
198.46 + * <p>
198.47 + * The following table shows the relation between constant pool entry
198.48 + * types and the corresponding visit* methods:
198.49 + *
198.50 + * <table border=1 cellpadding=5 summary="constant pool visitor methods">
198.51 + * <tr><th>Tag(s)</th><th>Method</th></tr>
198.52 + * <tr>
198.53 + * <td>{@link #CONSTANT_Utf8}</td>
198.54 + * <td>{@link #visitUTF8(int, byte, String)}</td>
198.55 + * </tr><tr>
198.56 + * <td>{@link #CONSTANT_Integer}, {@link #CONSTANT_Float},
198.57 + * {@link #CONSTANT_Long}, {@link #CONSTANT_Double}</td>
198.58 + * <td>{@link #visitConstantValue(int, byte, Object)}</td>
198.59 + * </tr><tr>
198.60 + * <td>{@link #CONSTANT_String}, {@link #CONSTANT_Class}</td>
198.61 + * <td>{@link #visitConstantString(int, byte, String, int)}</td>
198.62 + * </tr><tr>
198.63 + * <td>{@link #CONSTANT_NameAndType}</td>
198.64 + * <td>{@link #visitDescriptor(int, byte, String, String, int, int)}</td>
198.65 + * </tr><tr>
198.66 + * <td>{@link #CONSTANT_Fieldref},
198.67 + * {@link #CONSTANT_Methodref},
198.68 + * {@link #CONSTANT_InterfaceMethodref}</td>
198.69 + * <td>{@link #visitMemberRef(int, byte, String, String, String, int, int)}</td>
198.70 + * </tr>
198.71 + * </table>
198.72 + *
198.73 + * @see ConstantPoolPatch
198.74 + * @author Remi Forax
198.75 + * @author jrose
198.76 + */
198.77 +public class ConstantPoolVisitor {
198.78 + /** Called each time an UTF8 constant pool entry is found.
198.79 + * @param index the constant pool index
198.80 + * @param tag always {@link #CONSTANT_Utf8}
198.81 + * @param utf8 string encoded in modified UTF-8 format passed as a {@code String}
198.82 + *
198.83 + * @see ConstantPoolPatch#putUTF8(int, String)
198.84 + */
198.85 + public void visitUTF8(int index, byte tag, String utf8) {
198.86 + // do nothing
198.87 + }
198.88 +
198.89 + /** Called for each constant pool entry that encodes an integer,
198.90 + * a float, a long, or a double.
198.91 + * Constant strings and classes are not managed by this method but
198.92 + * by {@link #visitConstantString(int, byte, String, int)}.
198.93 + *
198.94 + * @param index the constant pool index
198.95 + * @param tag one of {@link #CONSTANT_Integer},
198.96 + * {@link #CONSTANT_Float},
198.97 + * {@link #CONSTANT_Long},
198.98 + * or {@link #CONSTANT_Double}
198.99 + * @param value encoded value
198.100 + *
198.101 + * @see ConstantPoolPatch#putConstantValue(int, Object)
198.102 + */
198.103 + public void visitConstantValue(int index, byte tag, Object value) {
198.104 + // do nothing
198.105 + }
198.106 +
198.107 + /** Called for each constant pool entry that encodes a string or a class.
198.108 + * @param index the constant pool index
198.109 + * @param tag one of {@link #CONSTANT_String},
198.110 + * {@link #CONSTANT_Class},
198.111 + * @param name string body or class name (using dot separator)
198.112 + * @param nameIndex the index of the Utf8 string for the name
198.113 + *
198.114 + * @see ConstantPoolPatch#putConstantValue(int, byte, Object)
198.115 + */
198.116 + public void visitConstantString(int index, byte tag,
198.117 + String name, int nameIndex) {
198.118 + // do nothing
198.119 + }
198.120 +
198.121 + /** Called for each constant pool entry that encodes a name and type.
198.122 + * @param index the constant pool index
198.123 + * @param tag always {@link #CONSTANT_NameAndType}
198.124 + * @param memberName a field or method name
198.125 + * @param signature the member signature
198.126 + * @param memberNameIndex index of the Utf8 string for the member name
198.127 + * @param signatureIndex index of the Utf8 string for the signature
198.128 + *
198.129 + * @see ConstantPoolPatch#putDescriptor(int, String, String)
198.130 + */
198.131 + public void visitDescriptor(int index, byte tag,
198.132 + String memberName, String signature,
198.133 + int memberNameIndex, int signatureIndex) {
198.134 + // do nothing
198.135 + }
198.136 +
198.137 + /** Called for each constant pool entry that encodes a field or method.
198.138 + * @param index the constant pool index
198.139 + * @param tag one of {@link #CONSTANT_Fieldref},
198.140 + * or {@link #CONSTANT_Methodref},
198.141 + * or {@link #CONSTANT_InterfaceMethodref}
198.142 + * @param className the class name (using dot separator)
198.143 + * @param memberName name of the field or method
198.144 + * @param signature the field or method signature
198.145 + * @param classNameIndex index of the Utf8 string for the class name
198.146 + * @param descriptorIndex index of the NameAndType descriptor constant
198.147 + *
198.148 + * @see ConstantPoolPatch#putMemberRef(int, byte, String, String, String)
198.149 + */
198.150 + public void visitMemberRef(int index, byte tag,
198.151 + String className, String memberName, String signature,
198.152 + int classNameIndex, int descriptorIndex) {
198.153 + // do nothing
198.154 + }
198.155 +
198.156 + public static final byte
198.157 + CONSTANT_None = 0,
198.158 + CONSTANT_Utf8 = 1,
198.159 + //CONSTANT_Unicode = 2, /* unused */
198.160 + CONSTANT_Integer = 3,
198.161 + CONSTANT_Float = 4,
198.162 + CONSTANT_Long = 5,
198.163 + CONSTANT_Double = 6,
198.164 + CONSTANT_Class = 7,
198.165 + CONSTANT_String = 8,
198.166 + CONSTANT_Fieldref = 9,
198.167 + CONSTANT_Methodref = 10,
198.168 + CONSTANT_InterfaceMethodref = 11,
198.169 + CONSTANT_NameAndType = 12;
198.170 +
198.171 + private static String[] TAG_NAMES = {
198.172 + "Empty",
198.173 + "Utf8",
198.174 + null, //"Unicode",
198.175 + "Integer",
198.176 + "Float",
198.177 + "Long",
198.178 + "Double",
198.179 + "Class",
198.180 + "String",
198.181 + "Fieldref",
198.182 + "Methodref",
198.183 + "InterfaceMethodref",
198.184 + "NameAndType"
198.185 + };
198.186 +
198.187 + public static String tagName(byte tag) {
198.188 + String name = null;
198.189 + if ((tag & 0xFF) < TAG_NAMES.length)
198.190 + name = TAG_NAMES[tag];
198.191 + if (name == null)
198.192 + name = "Unknown#"+(tag&0xFF);
198.193 + return name;
198.194 + }
198.195 +}
199.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
199.2 +++ b/src/share/classes/sun/invoke/anon/InvalidConstantPoolFormatException.java Tue Mar 29 20:19:55 2011 -0700
199.3 @@ -0,0 +1,45 @@
199.4 +/*
199.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
199.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
199.7 + *
199.8 + * This code is free software; you can redistribute it and/or modify it
199.9 + * under the terms of the GNU General Public License version 2 only, as
199.10 + * published by the Free Software Foundation. Oracle designates this
199.11 + * particular file as subject to the "Classpath" exception as provided
199.12 + * by Oracle in the LICENSE file that accompanied this code.
199.13 + *
199.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
199.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
199.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
199.17 + * version 2 for more details (a copy is included in the LICENSE file that
199.18 + * accompanied this code).
199.19 + *
199.20 + * You should have received a copy of the GNU General Public License version
199.21 + * 2 along with this work; if not, write to the Free Software Foundation,
199.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
199.23 + *
199.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
199.25 + * or visit www.oracle.com if you need additional information or have any
199.26 + * questions.
199.27 + */
199.28 +
199.29 +package sun.invoke.anon;
199.30 +
199.31 +/** Exception used when there is an error in the constant pool
199.32 + * format.
199.33 + */
199.34 +public class InvalidConstantPoolFormatException extends Exception {
199.35 + private static final long serialVersionUID=-6103888330523770949L;
199.36 +
199.37 + public InvalidConstantPoolFormatException(String message,Throwable cause) {
199.38 + super(message,cause);
199.39 + }
199.40 +
199.41 + public InvalidConstantPoolFormatException(String message) {
199.42 + super(message);
199.43 + }
199.44 +
199.45 + public InvalidConstantPoolFormatException(Throwable cause) {
199.46 + super(cause);
199.47 + }
199.48 +}
200.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
200.2 +++ b/src/share/classes/sun/invoke/empty/Empty.java Tue Mar 29 20:19:55 2011 -0700
200.3 @@ -0,0 +1,40 @@
200.4 +/*
200.5 + * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
200.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
200.7 + *
200.8 + * This code is free software; you can redistribute it and/or modify it
200.9 + * under the terms of the GNU General Public License version 2 only, as
200.10 + * published by the Free Software Foundation. Oracle designates this
200.11 + * particular file as subject to the "Classpath" exception as provided
200.12 + * by Oracle in the LICENSE file that accompanied this code.
200.13 + *
200.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
200.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
200.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
200.17 + * version 2 for more details (a copy is included in the LICENSE file that
200.18 + * accompanied this code).
200.19 + *
200.20 + * You should have received a copy of the GNU General Public License version
200.21 + * 2 along with this work; if not, write to the Free Software Foundation,
200.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
200.23 + *
200.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
200.25 + * or visit www.oracle.com if you need additional information or have any
200.26 + * questions.
200.27 + */
200.28 +
200.29 +package sun.invoke.empty;
200.30 +
200.31 +/**
200.32 + * An empty class in an empty package.
200.33 + * Used as a proxy for unprivileged code, since making access checks
200.34 + * against it will only succeed against public methods in public types.
200.35 + * <p>
200.36 + * This class also stands (internally to sun.invoke) for the type of a
200.37 + * value that cannot be produced, because the expression of this type
200.38 + * always returns abnormally. (Cf. Nothing in the closures proposal.)
200.39 + * @author jrose
200.40 + */
200.41 +public class Empty {
200.42 + private Empty() { throw new InternalError(); }
200.43 +}
201.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
201.2 +++ b/src/share/classes/sun/invoke/package-info.java Tue Mar 29 20:19:55 2011 -0700
201.3 @@ -0,0 +1,31 @@
201.4 +/*
201.5 + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
201.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
201.7 + *
201.8 + * This code is free software; you can redistribute it and/or modify it
201.9 + * under the terms of the GNU General Public License version 2 only, as
201.10 + * published by the Free Software Foundation. Oracle designates this
201.11 + * particular file as subject to the "Classpath" exception as provided
201.12 + * by Oracle in the LICENSE file that accompanied this code.
201.13 + *
201.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
201.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
201.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
201.17 + * version 2 for more details (a copy is included in the LICENSE file that
201.18 + * accompanied this code).
201.19 + *
201.20 + * You should have received a copy of the GNU General Public License version
201.21 + * 2 along with this work; if not, write to the Free Software Foundation,
201.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
201.23 + *
201.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
201.25 + * or visit www.oracle.com if you need additional information or have any
201.26 + * questions.
201.27 + */
201.28 +
201.29 +/**
201.30 + * Implementation details for JSR 292 RI, package java.lang.invoke.
201.31 + * @author jrose
201.32 + */
201.33 +
201.34 +package sun.invoke;
202.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
202.2 +++ b/src/share/classes/sun/invoke/util/BytecodeDescriptor.java Tue Mar 29 20:19:55 2011 -0700
202.3 @@ -0,0 +1,137 @@
202.4 +/*
202.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
202.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
202.7 + *
202.8 + * This code is free software; you can redistribute it and/or modify it
202.9 + * under the terms of the GNU General Public License version 2 only, as
202.10 + * published by the Free Software Foundation. Oracle designates this
202.11 + * particular file as subject to the "Classpath" exception as provided
202.12 + * by Oracle in the LICENSE file that accompanied this code.
202.13 + *
202.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
202.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
202.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
202.17 + * version 2 for more details (a copy is included in the LICENSE file that
202.18 + * accompanied this code).
202.19 + *
202.20 + * You should have received a copy of the GNU General Public License version
202.21 + * 2 along with this work; if not, write to the Free Software Foundation,
202.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
202.23 + *
202.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202.25 + * or visit www.oracle.com if you need additional information or have any
202.26 + * questions.
202.27 + */
202.28 +
202.29 +package sun.invoke.util;
202.30 +
202.31 +import java.lang.invoke.MethodType;
202.32 +import java.util.ArrayList;
202.33 +import java.util.List;
202.34 +
202.35 +/**
202.36 + * Utility routines for dealing with bytecode-level signatures.
202.37 + * @author jrose
202.38 + */
202.39 +public class BytecodeDescriptor {
202.40 +
202.41 + private BytecodeDescriptor() { } // cannot instantiate
202.42 +
202.43 + public static List<Class<?>> parseMethod(String bytecodeSignature, ClassLoader loader) {
202.44 + return parseMethod(bytecodeSignature, 0, bytecodeSignature.length(), loader);
202.45 + }
202.46 +
202.47 + static List<Class<?>> parseMethod(String bytecodeSignature,
202.48 + int start, int end, ClassLoader loader) {
202.49 + if (loader == null)
202.50 + loader = ClassLoader.getSystemClassLoader();
202.51 + String str = bytecodeSignature;
202.52 + int[] i = {start};
202.53 + ArrayList<Class<?>> ptypes = new ArrayList<Class<?>>();
202.54 + if (i[0] < end && str.charAt(i[0]) == '(') {
202.55 + ++i[0]; // skip '('
202.56 + while (i[0] < end && str.charAt(i[0]) != ')') {
202.57 + Class<?> pt = parseSig(str, i, end, loader);
202.58 + if (pt == null || pt == void.class)
202.59 + parseError(str, "bad argument type");
202.60 + ptypes.add(pt);
202.61 + }
202.62 + ++i[0]; // skip ')'
202.63 + } else {
202.64 + parseError(str, "not a method type");
202.65 + }
202.66 + Class<?> rtype = parseSig(str, i, end, loader);
202.67 + if (rtype == null || i[0] != end)
202.68 + parseError(str, "bad return type");
202.69 + ptypes.add(rtype);
202.70 + return ptypes;
202.71 + }
202.72 +
202.73 + static private void parseError(String str, String msg) {
202.74 + throw new IllegalArgumentException("bad signature: "+str+": "+msg);
202.75 + }
202.76 +
202.77 + static private Class<?> parseSig(String str, int[] i, int end, ClassLoader loader) {
202.78 + if (i[0] == end) return null;
202.79 + char c = str.charAt(i[0]++);
202.80 + if (c == 'L') {
202.81 + int begc = i[0], endc = str.indexOf(';', begc);
202.82 + if (endc < 0) return null;
202.83 + i[0] = endc+1;
202.84 + String name = str.substring(begc, endc).replace('/', '.');
202.85 + try {
202.86 + return loader.loadClass(name);
202.87 + } catch (ClassNotFoundException ex) {
202.88 + throw new TypeNotPresentException(name, ex);
202.89 + }
202.90 + } else if (c == '[') {
202.91 + Class<?> t = parseSig(str, i, end, loader);
202.92 + if (t != null)
202.93 + t = java.lang.reflect.Array.newInstance(t, 0).getClass();
202.94 + return t;
202.95 + } else {
202.96 + return Wrapper.forBasicType(c).primitiveType();
202.97 + }
202.98 + }
202.99 +
202.100 + public static String unparse(Class<?> type) {
202.101 + StringBuilder sb = new StringBuilder();
202.102 + unparseSig(type, sb);
202.103 + return sb.toString();
202.104 + }
202.105 +
202.106 + public static String unparse(MethodType type) {
202.107 + return unparseMethod(type.returnType(), type.parameterList());
202.108 + }
202.109 +
202.110 + public static String unparse(Object type) {
202.111 + if (type instanceof Class<?>)
202.112 + return unparse((Class<?>) type);
202.113 + if (type instanceof MethodType)
202.114 + return unparse((MethodType) type);
202.115 + return (String) type;
202.116 + }
202.117 +
202.118 + public static String unparseMethod(Class<?> rtype, List<Class<?>> ptypes) {
202.119 + StringBuilder sb = new StringBuilder();
202.120 + sb.append('(');
202.121 + for (Class<?> pt : ptypes)
202.122 + unparseSig(pt, sb);
202.123 + sb.append(')');
202.124 + unparseSig(rtype, sb);
202.125 + return sb.toString();
202.126 + }
202.127 +
202.128 + static private void unparseSig(Class<?> t, StringBuilder sb) {
202.129 + char c = Wrapper.forBasicType(t).basicTypeChar();
202.130 + if (c != 'L') {
202.131 + sb.append(c);
202.132 + } else {
202.133 + boolean lsemi = (!t.isArray());
202.134 + if (lsemi) sb.append('L');
202.135 + sb.append(t.getName().replace('.', '/'));
202.136 + if (lsemi) sb.append(';');
202.137 + }
202.138 + }
202.139 +
202.140 +}
203.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
203.2 +++ b/src/share/classes/sun/invoke/util/BytecodeName.java Tue Mar 29 20:19:55 2011 -0700
203.3 @@ -0,0 +1,627 @@
203.4 +/*
203.5 + * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
203.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
203.7 + *
203.8 + * This code is free software; you can redistribute it and/or modify it
203.9 + * under the terms of the GNU General Public License version 2 only, as
203.10 + * published by the Free Software Foundation. Oracle designates this
203.11 + * particular file as subject to the "Classpath" exception as provided
203.12 + * by Oracle in the LICENSE file that accompanied this code.
203.13 + *
203.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
203.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
203.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
203.17 + * version 2 for more details (a copy is included in the LICENSE file that
203.18 + * accompanied this code).
203.19 + *
203.20 + * You should have received a copy of the GNU General Public License version
203.21 + * 2 along with this work; if not, write to the Free Software Foundation,
203.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
203.23 + *
203.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
203.25 + * or visit www.oracle.com if you need additional information or have any
203.26 + * questions.
203.27 + */
203.28 +
203.29 +package sun.invoke.util;
203.30 +
203.31 +/**
203.32 + * Utility routines for dealing with bytecode-level names.
203.33 + * Includes universal mangling rules for the JVM.
203.34 + *
203.35 + * <h3>Avoiding Dangerous Characters </h3>
203.36 + *
203.37 + * <p>
203.38 + * The JVM defines a very small set of characters which are illegal
203.39 + * in name spellings. We will slightly extend and regularize this set
203.40 + * into a group of <cite>dangerous characters</cite>.
203.41 + * These characters will then be replaced, in mangled names, by escape sequences.
203.42 + * In addition, accidental escape sequences must be further escaped.
203.43 + * Finally, a special prefix will be applied if and only if
203.44 + * the mangling would otherwise fail to begin with the escape character.
203.45 + * This happens to cover the corner case of the null string,
203.46 + * and also clearly marks symbols which need demangling.
203.47 + * </p>
203.48 + * <p>
203.49 + * Dangerous characters are the union of all characters forbidden
203.50 + * or otherwise restricted by the JVM specification,
203.51 + * plus their mates, if they are brackets
203.52 + * (<code><big><b>[</b></big></code> and <code><big><b>]</b></big></code>,
203.53 + * <code><big><b><</b></big></code> and <code><big><b>></b></big></code>),
203.54 + * plus, arbitrarily, the colon character <code><big><b>:</b></big></code>.
203.55 + * There is no distinction between type, method, and field names.
203.56 + * This makes it easier to convert between mangled names of different
203.57 + * types, since they do not need to be decoded (demangled).
203.58 + * </p>
203.59 + * <p>
203.60 + * The escape character is backslash <code><big><b>\</b></big></code>
203.61 + * (also known as reverse solidus).
203.62 + * This character is, until now, unheard of in bytecode names,
203.63 + * but traditional in the proposed role.
203.64 + *
203.65 + * </p>
203.66 + * <h3> Replacement Characters </h3>
203.67 + *
203.68 + *
203.69 + * <p>
203.70 + * Every escape sequence is two characters
203.71 + * (in fact, two UTF8 bytes) beginning with
203.72 + * the escape character and followed by a
203.73 + * <cite>replacement character</cite>.
203.74 + * (Since the replacement character is never a backslash,
203.75 + * iterated manglings do not double in size.)
203.76 + * </p>
203.77 + * <p>
203.78 + * Each dangerous character has some rough visual similarity
203.79 + * to its corresponding replacement character.
203.80 + * This makes mangled symbols easier to recognize by sight.
203.81 + * </p>
203.82 + * <p>
203.83 + * The dangerous characters are
203.84 + * <code><big><b>/</b></big></code> (forward slash, used to delimit package components),
203.85 + * <code><big><b>.</b></big></code> (dot, also a package delimiter),
203.86 + * <code><big><b>;</b></big></code> (semicolon, used in signatures),
203.87 + * <code><big><b>$</b></big></code> (dollar, used in inner classes and synthetic members),
203.88 + * <code><big><b><</b></big></code> (left angle),
203.89 + * <code><big><b>></b></big></code> (right angle),
203.90 + * <code><big><b>[</b></big></code> (left square bracket, used in array types),
203.91 + * <code><big><b>]</b></big></code> (right square bracket, reserved in this scheme for language use),
203.92 + * and <code><big><b>:</b></big></code> (colon, reserved in this scheme for language use).
203.93 + * Their replacements are, respectively,
203.94 + * <code><big><b>|</b></big></code> (vertical bar),
203.95 + * <code><big><b>,</b></big></code> (comma),
203.96 + * <code><big><b>?</b></big></code> (question mark),
203.97 + * <code><big><b>%</b></big></code> (percent),
203.98 + * <code><big><b>^</b></big></code> (caret),
203.99 + * <code><big><b>_</b></big></code> (underscore), and
203.100 + * <code><big><b>{</b></big></code> (left curly bracket),
203.101 + * <code><big><b>}</b></big></code> (right curly bracket),
203.102 + * <code><big><b>!</b></big></code> (exclamation mark).
203.103 + * In addition, the replacement character for the escape character itself is
203.104 + * <code><big><b>-</b></big></code> (hyphen),
203.105 + * and the replacement character for the null prefix is
203.106 + * <code><big><b>=</b></big></code> (equal sign).
203.107 + * </p>
203.108 + * <p>
203.109 + * An escape character <code><big><b>\</b></big></code>
203.110 + * followed by any of these replacement characters
203.111 + * is an escape sequence, and there are no other escape sequences.
203.112 + * An equal sign is only part of an escape sequence
203.113 + * if it is the second character in the whole string, following a backslash.
203.114 + * Two consecutive backslashes do <em>not</em> form an escape sequence.
203.115 + * </p>
203.116 + * <p>
203.117 + * Each escape sequence replaces a so-called <cite>original character</cite>
203.118 + * which is either one of the dangerous characters or the escape character.
203.119 + * A null prefix replaces an initial null string, not a character.
203.120 + * </p>
203.121 + * <p>
203.122 + * All this implies that escape sequences cannot overlap and may be
203.123 + * determined all at once for a whole string. Note that a spelling
203.124 + * string can contain <cite>accidental escapes</cite>, apparent escape
203.125 + * sequences which must not be interpreted as manglings.
203.126 + * These are disabled by replacing their leading backslash with an
203.127 + * escape sequence (<code><big><b>\-</b></big></code>). To mangle a string, three logical steps
203.128 + * are required, though they may be carried out in one pass:
203.129 + * </p>
203.130 + * <ol>
203.131 + * <li>In each accidental escape, replace the backslash with an escape sequence
203.132 + * (<code><big><b>\-</b></big></code>).</li>
203.133 + * <li>Replace each dangerous character with an escape sequence
203.134 + * (<code><big><b>\|</b></big></code> for <code><big><b>/</b></big></code>, etc.).</li>
203.135 + * <li>If the first two steps introduced any change, <em>and</em>
203.136 + * if the string does not already begin with a backslash, prepend a null prefix (<code><big><b>\=</b></big></code>).</li>
203.137 + * </ol>
203.138 + *
203.139 + * To demangle a mangled string that begins with an escape,
203.140 + * remove any null prefix, and then replace (in parallel)
203.141 + * each escape sequence by its original character.
203.142 + * <p>Spelling strings which contain accidental
203.143 + * escapes <em>must</em> have them replaced, even if those
203.144 + * strings do not contain dangerous characters.
203.145 + * This restriction means that mangling a string always
203.146 + * requires a scan of the string for escapes.
203.147 + * But then, a scan would be required anyway,
203.148 + * to check for dangerous characters.
203.149 + *
203.150 + * </p>
203.151 + * <h3> Nice Properties </h3>
203.152 + *
203.153 + * <p>
203.154 + * If a bytecode name does not contain any escape sequence,
203.155 + * demangling is a no-op: The string demangles to itself.
203.156 + * Such a string is called <cite>self-mangling</cite>.
203.157 + * Almost all strings are self-mangling.
203.158 + * In practice, to demangle almost any name “found in nature”,
203.159 + * simply verify that it does not begin with a backslash.
203.160 + * </p>
203.161 + * <p>
203.162 + * Mangling is a one-to-one function, while demangling
203.163 + * is a many-to-one function.
203.164 + * A mangled string is defined as <cite>validly mangled</cite> if
203.165 + * it is in fact the unique mangling of its spelling string.
203.166 + * Three examples of invalidly mangled strings are <code><big><b>\=foo</b></big></code>,
203.167 + * <code><big><b>\-bar</b></big></code>, and <code><big><b>baz\!</b></big></code>, which demangle to <code><big><b>foo</b></big></code>, <code><big><b>\bar</b></big></code>, and
203.168 + * <code><big><b>baz\!</b></big></code>, but then remangle to <code><big><b>foo</b></big></code>, <code><big><b>\bar</b></big></code>, and <code><big><b>\=baz\-!</b></big></code>.
203.169 + * If a language back-end or runtime is using mangled names,
203.170 + * it should never present an invalidly mangled bytecode
203.171 + * name to the JVM. If the runtime encounters one,
203.172 + * it should also report an error, since such an occurrence
203.173 + * probably indicates a bug in name encoding which
203.174 + * will lead to errors in linkage.
203.175 + * However, this note does not propose that the JVM verifier
203.176 + * detect invalidly mangled names.
203.177 + * </p>
203.178 + * <p>
203.179 + * As a result of these rules, it is a simple matter to
203.180 + * compute validly mangled substrings and concatenations
203.181 + * of validly mangled strings, and (with a little care)
203.182 + * these correspond to corresponding operations on their
203.183 + * spelling strings.
203.184 + * </p>
203.185 + * <ul>
203.186 + * <li>Any prefix of a validly mangled string is also validly mangled,
203.187 + * although a null prefix may need to be removed.</li>
203.188 + * <li>Any suffix of a validly mangled string is also validly mangled,
203.189 + * although a null prefix may need to be added.</li>
203.190 + * <li>Two validly mangled strings, when concatenated,
203.191 + * are also validly mangled, although any null prefix
203.192 + * must be removed from the second string,
203.193 + * and a trailing backslash on the first string may need escaping,
203.194 + * if it would participate in an accidental escape when followed
203.195 + * by the first character of the second string.</li>
203.196 + * </ul>
203.197 + * <p>If languages that include non-Java symbol spellings use this
203.198 + * mangling convention, they will enjoy the following advantages:
203.199 + * </p>
203.200 + * <ul>
203.201 + * <li>They can interoperate via symbols they share in common.</li>
203.202 + * <li>Low-level tools, such as backtrace printers, will have readable displays.</li>
203.203 + * <li>Future JVM and language extensions can safely use the dangerous characters
203.204 + * for structuring symbols, but will never interfere with valid spellings.</li>
203.205 + * <li>Runtimes and compilers can use standard libraries for mangling and demangling.</li>
203.206 + * <li>Occasional transliterations and name composition will be simple and regular,
203.207 + * for classes, methods, and fields.</li>
203.208 + * <li>Bytecode names will continue to be compact.
203.209 + * When mangled, spellings will at most double in length, either in
203.210 + * UTF8 or UTF16 format, and most will not change at all.</li>
203.211 + * </ul>
203.212 + *
203.213 + *
203.214 + * <h3> Suggestions for Human Readable Presentations </h3>
203.215 + *
203.216 + *
203.217 + * <p>
203.218 + * For human readable displays of symbols,
203.219 + * it will be better to present a string-like quoted
203.220 + * representation of the spelling, because JVM users
203.221 + * are generally familiar with such tokens.
203.222 + * We suggest using single or double quotes before and after
203.223 + * mangled symbols which are not valid Java identifiers,
203.224 + * with quotes, backslashes, and non-printing characters
203.225 + * escaped as if for literals in the Java language.
203.226 + * </p>
203.227 + * <p>
203.228 + * For example, an HTML-like spelling
203.229 + * <code><big><b><pre></b></big></code> mangles to
203.230 + * <code><big><b>\^pre\_</b></big></code> and could
203.231 + * display more cleanly as
203.232 + * <code><big><b>'<pre>'</b></big></code>,
203.233 + * with the quotes included.
203.234 + * Such string-like conventions are <em>not</em> suitable
203.235 + * for mangled bytecode names, in part because
203.236 + * dangerous characters must be eliminated, rather
203.237 + * than just quoted. Otherwise internally structured
203.238 + * strings like package prefixes and method signatures
203.239 + * could not be reliably parsed.
203.240 + * </p>
203.241 + * <p>
203.242 + * In such human-readable displays, invalidly mangled
203.243 + * names should <em>not</em> be demangled and quoted,
203.244 + * for this would be misleading. Likewise, JVM symbols
203.245 + * which contain dangerous characters (like dots in field
203.246 + * names or brackets in method names) should not be
203.247 + * simply quoted. The bytecode names
203.248 + * <code><big><b>\=phase\,1</b></big></code> and
203.249 + * <code><big><b>phase.1</b></big></code> are distinct,
203.250 + * and in demangled displays they should be presented as
203.251 + * <code><big><b>'phase.1'</b></big></code> and something like
203.252 + * <code><big><b>'phase'.1</b></big></code>, respectively.
203.253 + * </p>
203.254 + *
203.255 + * @author John Rose
203.256 + * @version 1.2, 02/06/2008
203.257 + * @see http://blogs.sun.com/jrose/entry/symbolic_freedom_in_the_vm
203.258 + */
203.259 +public class BytecodeName {
203.260 + private BytecodeName() { } // static only class
203.261 +
203.262 + /** Given a source name, produce the corresponding bytecode name.
203.263 + * The source name should not be qualified, because any syntactic
203.264 + * markers (dots, slashes, dollar signs, colons, etc.) will be mangled.
203.265 + * @param s the source name
203.266 + * @return a valid bytecode name which represents the source name
203.267 + */
203.268 + public static String toBytecodeName(String s) {
203.269 + String bn = mangle(s);
203.270 + assert((Object)bn == s || looksMangled(bn)) : bn;
203.271 + assert(s.equals(toSourceName(bn))) : s;
203.272 + return bn;
203.273 + }
203.274 +
203.275 + /** Given an unqualified bytecode name, produce the corresponding source name.
203.276 + * The bytecode name must not contain dangerous characters.
203.277 + * In particular, it must not be qualified or segmented by colon {@code ':'}.
203.278 + * @param s the bytecode name
203.279 + * @return the source name, which may possibly have unsafe characters
203.280 + * @throws IllegalArgumentException if the bytecode name is not {@link #isSafeBytecodeName safe}
203.281 + * @see #isSafeBytecodeName(java.lang.String)
203.282 + */
203.283 + public static String toSourceName(String s) {
203.284 + checkSafeBytecodeName(s);
203.285 + String sn = s;
203.286 + if (looksMangled(s)) {
203.287 + sn = demangle(s);
203.288 + assert(s.equals(mangle(sn))) : s+" => "+sn+" => "+mangle(sn);
203.289 + }
203.290 + return sn;
203.291 + }
203.292 +
203.293 + /**
203.294 + * Given a bytecode name from a classfile, separate it into
203.295 + * components delimited by dangerous characters.
203.296 + * Each resulting array element will be either a dangerous character,
203.297 + * or else a safe bytecode name.
203.298 + * (The safe name might possibly be mangled to hide further dangerous characters.)
203.299 + * For example, the qualified class name {@code java/lang/String}
203.300 + * will be parsed into the array {@code {"java", '/', "lang", '/', "String"}}.
203.301 + * The name {@code <init>} will be parsed into { '<', "init", '>'}}
203.302 + * The name {@code foo/bar$:baz} will be parsed into
203.303 + * {@code {"foo", '/', "bar", '$', ':', "baz"}}.
203.304 + * The name {@code ::\=:foo:\=bar\!baz} will be parsed into
203.305 + * {@code {':', ':', "", ':', "foo", ':', "bar:baz"}}.
203.306 + */
203.307 + public static Object[] parseBytecodeName(String s) {
203.308 + int slen = s.length();
203.309 + Object[] res = null;
203.310 + for (int pass = 0; pass <= 1; pass++) {
203.311 + int fillp = 0;
203.312 + int lasti = 0;
203.313 + for (int i = 0; i <= slen; i++) {
203.314 + int whichDC = -1;
203.315 + if (i < slen) {
203.316 + whichDC = DANGEROUS_CHARS.indexOf(s.charAt(i));
203.317 + if (whichDC < DANGEROUS_CHAR_FIRST_INDEX) continue;
203.318 + }
203.319 + // got to end of string or next dangerous char
203.320 + if (lasti < i) {
203.321 + // normal component
203.322 + if (pass != 0)
203.323 + res[fillp] = toSourceName(s.substring(lasti, i));
203.324 + fillp++;
203.325 + lasti = i+1;
203.326 + }
203.327 + if (whichDC >= DANGEROUS_CHAR_FIRST_INDEX) {
203.328 + if (pass != 0)
203.329 + res[fillp] = DANGEROUS_CHARS_CA[whichDC];
203.330 + fillp++;
203.331 + lasti = i+1;
203.332 + }
203.333 + }
203.334 + if (pass != 0) break;
203.335 + // between passes, build the result array
203.336 + res = new Object[fillp];
203.337 + if (fillp <= 1 && lasti == 0) {
203.338 + if (fillp != 0) res[0] = toSourceName(s);
203.339 + break;
203.340 + }
203.341 + }
203.342 + return res;
203.343 + }
203.344 +
203.345 + /**
203.346 + * Given a series of components, create a bytecode name for a classfile.
203.347 + * This is the inverse of {@link #parseBytecodeName(java.lang.String)}.
203.348 + * Each component must either be an interned one-character string of
203.349 + * a dangerous character, or else a safe bytecode name.
203.350 + * @param components a series of name components
203.351 + * @return the concatenation of all components
203.352 + * @throws IllegalArgumentException if any component contains an unsafe
203.353 + * character, and is not an interned one-character string
203.354 + * @throws NullPointerException if any component is null
203.355 + */
203.356 + public static String unparseBytecodeName(Object[] components) {
203.357 + Object[] components0 = components;
203.358 + for (int i = 0; i < components.length; i++) {
203.359 + Object c = components[i];
203.360 + if (c instanceof String) {
203.361 + String mc = toBytecodeName((String) c);
203.362 + if (i == 0 && components.length == 1)
203.363 + return mc; // usual case
203.364 + if ((Object)mc != c) {
203.365 + if (components == components0)
203.366 + components = components.clone();
203.367 + components[i] = c = mc;
203.368 + }
203.369 + }
203.370 + }
203.371 + return appendAll(components);
203.372 + }
203.373 + private static String appendAll(Object[] components) {
203.374 + if (components.length <= 1) {
203.375 + if (components.length == 1) {
203.376 + return String.valueOf(components[0]);
203.377 + }
203.378 + return "";
203.379 + }
203.380 + int slen = 0;
203.381 + for (Object c : components) {
203.382 + if (c instanceof String)
203.383 + slen += String.valueOf(c).length();
203.384 + else
203.385 + slen += 1;
203.386 + }
203.387 + StringBuilder sb = new StringBuilder(slen);
203.388 + for (Object c : components) {
203.389 + sb.append(c);
203.390 + }
203.391 + return sb.toString();
203.392 + }
203.393 +
203.394 + /**
203.395 + * Given a bytecode name, produce the corresponding display name.
203.396 + * This is the source name, plus quotes if needed.
203.397 + * If the bytecode name contains dangerous characters,
203.398 + * assume that they are being used as punctuation,
203.399 + * and pass them through unchanged.
203.400 + * Non-empty runs of non-dangerous characters are demangled
203.401 + * if necessary, and the resulting names are quoted if
203.402 + * they are not already valid Java identifiers, or if
203.403 + * they contain a dangerous character (i.e., dollar sign "$").
203.404 + * Single quotes are used when quoting.
203.405 + * Within quoted names, embedded single quotes and backslashes
203.406 + * are further escaped by prepended backslashes.
203.407 + *
203.408 + * @param s the original bytecode name (which may be qualified)
203.409 + * @return a human-readable presentation
203.410 + */
203.411 + public static String toDisplayName(String s) {
203.412 + Object[] components = parseBytecodeName(s);
203.413 + for (int i = 0; i < components.length; i++) {
203.414 + if (!(components[i] instanceof String))
203.415 + continue;
203.416 + String sn = (String) components[i];
203.417 + // note that the name is already demangled!
203.418 + //sn = toSourceName(sn);
203.419 + if (!isJavaIdent(sn) || sn.indexOf('$') >=0 ) {
203.420 + components[i] = quoteDisplay(sn);
203.421 + }
203.422 + }
203.423 + return appendAll(components);
203.424 + }
203.425 + private static boolean isJavaIdent(String s) {
203.426 + int slen = s.length();
203.427 + if (slen == 0) return false;
203.428 + if (!Character.isJavaIdentifierStart(s.charAt(0)))
203.429 + return false;
203.430 + for (int i = 1; i < slen; i++) {
203.431 + if (!Character.isJavaIdentifierPart(s.charAt(i)))
203.432 + return false;
203.433 + }
203.434 + return true;
203.435 + }
203.436 + private static String quoteDisplay(String s) {
203.437 + // TO DO: Replace wierd characters in s by C-style escapes.
203.438 + return "'"+s.replaceAll("['\\\\]", "\\\\$0")+"'";
203.439 + }
203.440 +
203.441 + private static void checkSafeBytecodeName(String s)
203.442 + throws IllegalArgumentException {
203.443 + if (!isSafeBytecodeName(s)) {
203.444 + throw new IllegalArgumentException(s);
203.445 + }
203.446 + }
203.447 +
203.448 + /**
203.449 + * Report whether a simple name is safe as a bytecode name.
203.450 + * Such names are acceptable in class files as class, method, and field names.
203.451 + * Additionally, they are free of "dangerous" characters, even if those
203.452 + * characters are legal in some (or all) names in class files.
203.453 + * @param s the proposed bytecode name
203.454 + * @return true if the name is non-empty and all of its characters are safe
203.455 + */
203.456 + public static boolean isSafeBytecodeName(String s) {
203.457 + if (s.length() == 0) return false;
203.458 + // check occurrences of each DANGEROUS char
203.459 + for (char xc : DANGEROUS_CHARS_A) {
203.460 + if (xc == ESCAPE_C) continue; // not really that dangerous
203.461 + if (s.indexOf(xc) >= 0) return false;
203.462 + }
203.463 + return true;
203.464 + }
203.465 +
203.466 + /**
203.467 + * Report whether a character is safe in a bytecode name.
203.468 + * This is true of any unicode character except the following
203.469 + * <em>dangerous characters</em>: {@code ".;:$[]<>/"}.
203.470 + * @param s the proposed character
203.471 + * @return true if the character is safe to use in classfiles
203.472 + */
203.473 + public static boolean isSafeBytecodeChar(char c) {
203.474 + return DANGEROUS_CHARS.indexOf(c) < DANGEROUS_CHAR_FIRST_INDEX;
203.475 + }
203.476 +
203.477 + private static boolean looksMangled(String s) {
203.478 + return s.charAt(0) == ESCAPE_C;
203.479 + }
203.480 +
203.481 + private static String mangle(String s) {
203.482 + if (s.length() == 0)
203.483 + return NULL_ESCAPE;
203.484 +
203.485 + // build this lazily, when we first need an escape:
203.486 + StringBuilder sb = null;
203.487 +
203.488 + for (int i = 0, slen = s.length(); i < slen; i++) {
203.489 + char c = s.charAt(i);
203.490 +
203.491 + boolean needEscape = false;
203.492 + if (c == ESCAPE_C) {
203.493 + if (i+1 < slen) {
203.494 + char c1 = s.charAt(i+1);
203.495 + if ((i == 0 && c1 == NULL_ESCAPE_C)
203.496 + || c1 != originalOfReplacement(c1)) {
203.497 + // an accidental escape
203.498 + needEscape = true;
203.499 + }
203.500 + }
203.501 + } else {
203.502 + needEscape = isDangerous(c);
203.503 + }
203.504 +
203.505 + if (!needEscape) {
203.506 + if (sb != null) sb.append(c);
203.507 + continue;
203.508 + }
203.509 +
203.510 + // build sb if this is the first escape
203.511 + if (sb == null) {
203.512 + sb = new StringBuilder(s.length()+10);
203.513 + // mangled names must begin with a backslash:
203.514 + if (s.charAt(0) != ESCAPE_C && i > 0)
203.515 + sb.append(NULL_ESCAPE);
203.516 + // append the string so far, which is unremarkable:
203.517 + sb.append(s.substring(0, i));
203.518 + }
203.519 +
203.520 + // rewrite \ to \-, / to \|, etc.
203.521 + sb.append(ESCAPE_C);
203.522 + sb.append(replacementOf(c));
203.523 + }
203.524 +
203.525 + if (sb != null) return sb.toString();
203.526 +
203.527 + return s;
203.528 + }
203.529 +
203.530 + private static String demangle(String s) {
203.531 + // build this lazily, when we first meet an escape:
203.532 + StringBuilder sb = null;
203.533 +
203.534 + int stringStart = 0;
203.535 + if (s.startsWith(NULL_ESCAPE))
203.536 + stringStart = 2;
203.537 +
203.538 + for (int i = stringStart, slen = s.length(); i < slen; i++) {
203.539 + char c = s.charAt(i);
203.540 +
203.541 + if (c == ESCAPE_C && i+1 < slen) {
203.542 + // might be an escape sequence
203.543 + char rc = s.charAt(i+1);
203.544 + char oc = originalOfReplacement(rc);
203.545 + if (oc != rc) {
203.546 + // build sb if this is the first escape
203.547 + if (sb == null) {
203.548 + sb = new StringBuilder(s.length());
203.549 + // append the string so far, which is unremarkable:
203.550 + sb.append(s.substring(stringStart, i));
203.551 + }
203.552 + ++i; // skip both characters
203.553 + c = oc;
203.554 + }
203.555 + }
203.556 +
203.557 + if (sb != null)
203.558 + sb.append(c);
203.559 + }
203.560 +
203.561 + if (sb != null) return sb.toString();
203.562 +
203.563 + return s.substring(stringStart);
203.564 + }
203.565 +
203.566 + static char ESCAPE_C = '\\';
203.567 + // empty escape sequence to avoid a null name or illegal prefix
203.568 + static char NULL_ESCAPE_C = '=';
203.569 + static String NULL_ESCAPE = ESCAPE_C+""+NULL_ESCAPE_C;
203.570 +
203.571 + static final String DANGEROUS_CHARS = "\\/.;:$[]<>"; // \\ must be first
203.572 + static final String REPLACEMENT_CHARS = "-|,?!%{}^_";
203.573 + static final int DANGEROUS_CHAR_FIRST_INDEX = 1; // index after \\
203.574 + static char[] DANGEROUS_CHARS_A = DANGEROUS_CHARS.toCharArray();
203.575 + static char[] REPLACEMENT_CHARS_A = REPLACEMENT_CHARS.toCharArray();
203.576 + static final Character[] DANGEROUS_CHARS_CA;
203.577 + static {
203.578 + Character[] dcca = new Character[DANGEROUS_CHARS.length()];
203.579 + for (int i = 0; i < dcca.length; i++)
203.580 + dcca[i] = Character.valueOf(DANGEROUS_CHARS.charAt(i));
203.581 + DANGEROUS_CHARS_CA = dcca;
203.582 + }
203.583 +
203.584 + static final long[] SPECIAL_BITMAP = new long[2]; // 128 bits
203.585 + static {
203.586 + String SPECIAL = DANGEROUS_CHARS + REPLACEMENT_CHARS;
203.587 + //System.out.println("SPECIAL = "+SPECIAL);
203.588 + for (char c : SPECIAL.toCharArray()) {
203.589 + SPECIAL_BITMAP[c >>> 6] |= 1L << c;
203.590 + }
203.591 + }
203.592 + static boolean isSpecial(char c) {
203.593 + if ((c >>> 6) < SPECIAL_BITMAP.length)
203.594 + return ((SPECIAL_BITMAP[c >>> 6] >> c) & 1) != 0;
203.595 + else
203.596 + return false;
203.597 + }
203.598 + static char replacementOf(char c) {
203.599 + if (!isSpecial(c)) return c;
203.600 + int i = DANGEROUS_CHARS.indexOf(c);
203.601 + if (i < 0) return c;
203.602 + return REPLACEMENT_CHARS.charAt(i);
203.603 + }
203.604 + static char originalOfReplacement(char c) {
203.605 + if (!isSpecial(c)) return c;
203.606 + int i = REPLACEMENT_CHARS.indexOf(c);
203.607 + if (i < 0) return c;
203.608 + return DANGEROUS_CHARS.charAt(i);
203.609 + }
203.610 + static boolean isDangerous(char c) {
203.611 + if (!isSpecial(c)) return false;
203.612 + return (DANGEROUS_CHARS.indexOf(c) >= DANGEROUS_CHAR_FIRST_INDEX);
203.613 + }
203.614 + static int indexOfDangerousChar(String s, int from) {
203.615 + for (int i = from, slen = s.length(); i < slen; i++) {
203.616 + if (isDangerous(s.charAt(i)))
203.617 + return i;
203.618 + }
203.619 + return -1;
203.620 + }
203.621 + static int lastIndexOfDangerousChar(String s, int from) {
203.622 + for (int i = Math.min(from, s.length()-1); i >= 0; i--) {
203.623 + if (isDangerous(s.charAt(i)))
203.624 + return i;
203.625 + }
203.626 + return -1;
203.627 + }
203.628 +
203.629 +
203.630 +}
204.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
204.2 +++ b/src/share/classes/sun/invoke/util/ValueConversions.java Tue Mar 29 20:19:55 2011 -0700
204.3 @@ -0,0 +1,817 @@
204.4 +/*
204.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
204.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
204.7 + *
204.8 + * This code is free software; you can redistribute it and/or modify it
204.9 + * under the terms of the GNU General Public License version 2 only, as
204.10 + * published by the Free Software Foundation. Oracle designates this
204.11 + * particular file as subject to the "Classpath" exception as provided
204.12 + * by Oracle in the LICENSE file that accompanied this code.
204.13 + *
204.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
204.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
204.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
204.17 + * version 2 for more details (a copy is included in the LICENSE file that
204.18 + * accompanied this code).
204.19 + *
204.20 + * You should have received a copy of the GNU General Public License version
204.21 + * 2 along with this work; if not, write to the Free Software Foundation,
204.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
204.23 + *
204.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
204.25 + * or visit www.oracle.com if you need additional information or have any
204.26 + * questions.
204.27 + */
204.28 +
204.29 +package sun.invoke.util;
204.30 +
204.31 +import java.lang.invoke.MethodHandle;
204.32 +import java.lang.invoke.MethodHandles;
204.33 +import java.lang.invoke.MethodHandles.Lookup;
204.34 +import java.lang.invoke.MethodType;
204.35 +import java.util.ArrayList;
204.36 +import java.util.Arrays;
204.37 +import java.util.EnumMap;
204.38 +import java.util.List;
204.39 +
204.40 +public class ValueConversions {
204.41 + private static final Lookup IMPL_LOOKUP = MethodHandles.lookup();
204.42 +
204.43 + private static EnumMap<Wrapper, MethodHandle>[] newWrapperCaches(int n) {
204.44 + @SuppressWarnings("unchecked")
204.45 + EnumMap<Wrapper, MethodHandle>[] caches
204.46 + = (EnumMap<Wrapper, MethodHandle>[]) new EnumMap[n]; // unchecked warning expected here
204.47 + for (int i = 0; i < n; i++)
204.48 + caches[i] = new EnumMap<Wrapper, MethodHandle>(Wrapper.class);
204.49 + return caches;
204.50 + }
204.51 +
204.52 + /// Converting references to values.
204.53 +
204.54 + static int unboxInteger(Object x) {
204.55 + if (x == null) return 0; // never NPE
204.56 + return ((Integer) x).intValue();
204.57 + }
204.58 +
204.59 + static byte unboxByte(Object x) {
204.60 + if (x == null) return 0; // never NPE
204.61 + return ((Byte) x).byteValue();
204.62 + }
204.63 +
204.64 + static short unboxShort(Object x) {
204.65 + if (x == null) return 0; // never NPE
204.66 + return ((Short) x).shortValue();
204.67 + }
204.68 +
204.69 + static boolean unboxBoolean(Object x) {
204.70 + if (x == null) return false; // never NPE
204.71 + return ((Boolean) x).booleanValue();
204.72 + }
204.73 +
204.74 + static char unboxCharacter(Object x) {
204.75 + if (x == null) return 0; // never NPE
204.76 + return ((Character) x).charValue();
204.77 + }
204.78 +
204.79 + static long unboxLong(Object x) {
204.80 + if (x == null) return 0; // never NPE
204.81 + return ((Long) x).longValue();
204.82 + }
204.83 +
204.84 + static float unboxFloat(Object x) {
204.85 + if (x == null) return 0; // never NPE
204.86 + return ((Float) x).floatValue();
204.87 + }
204.88 +
204.89 + static double unboxDouble(Object x) {
204.90 + if (x == null) return 0; // never NPE
204.91 + return ((Double) x).doubleValue();
204.92 + }
204.93 +
204.94 + /// Converting references to "raw" values.
204.95 + /// A raw primitive value is always an int or long.
204.96 +
204.97 + static int unboxByteRaw(Object x) {
204.98 + return unboxByte(x);
204.99 + }
204.100 +
204.101 + static int unboxShortRaw(Object x) {
204.102 + return unboxShort(x);
204.103 + }
204.104 +
204.105 + static int unboxBooleanRaw(Object x) {
204.106 + return unboxBoolean(x) ? 1 : 0;
204.107 + }
204.108 +
204.109 + static int unboxCharacterRaw(Object x) {
204.110 + return unboxCharacter(x);
204.111 + }
204.112 +
204.113 + static int unboxFloatRaw(Object x) {
204.114 + return Float.floatToIntBits(unboxFloat(x));
204.115 + }
204.116 +
204.117 + static long unboxDoubleRaw(Object x) {
204.118 + return Double.doubleToRawLongBits(unboxDouble(x));
204.119 + }
204.120 +
204.121 + private static MethodType unboxType(Wrapper wrap, boolean raw) {
204.122 + return MethodType.methodType(rawWrapper(wrap, raw).primitiveType(), wrap.wrapperType());
204.123 + }
204.124 +
204.125 + private static final EnumMap<Wrapper, MethodHandle>[]
204.126 + UNBOX_CONVERSIONS = newWrapperCaches(4);
204.127 +
204.128 + private static MethodHandle unbox(Wrapper wrap, boolean exact, boolean raw) {
204.129 + EnumMap<Wrapper, MethodHandle> cache = UNBOX_CONVERSIONS[(exact?1:0)+(raw?2:0)];
204.130 + MethodHandle mh = cache.get(wrap);
204.131 + if (mh != null) {
204.132 + return mh;
204.133 + }
204.134 + // slow path
204.135 + switch (wrap) {
204.136 + case OBJECT:
204.137 + mh = IDENTITY; break;
204.138 + case VOID:
204.139 + mh = raw ? ALWAYS_ZERO : IGNORE; break;
204.140 + case INT: case LONG:
204.141 + // these guys don't need separate raw channels
204.142 + if (raw) mh = unbox(wrap, exact, false);
204.143 + break;
204.144 + }
204.145 + if (mh != null) {
204.146 + cache.put(wrap, mh);
204.147 + return mh;
204.148 + }
204.149 + // look up the method
204.150 + String name = "unbox" + wrap.simpleName() + (raw ? "Raw" : "");
204.151 + MethodType type = unboxType(wrap, raw);
204.152 + if (!exact) {
204.153 + try {
204.154 + // actually, type is wrong; the Java method takes Object
204.155 + mh = IMPL_LOOKUP.findStatic(ValueConversions.class, name, type.erase());
204.156 + } catch (ReflectiveOperationException ex) {
204.157 + mh = null;
204.158 + }
204.159 + } else {
204.160 + mh = unbox(wrap, !exact, raw).asType(type);
204.161 + }
204.162 + if (mh != null) {
204.163 + cache.put(wrap, mh);
204.164 + return mh;
204.165 + }
204.166 + throw new IllegalArgumentException("cannot find unbox adapter for " + wrap + (raw ? " (raw)" : ""));
204.167 + }
204.168 +
204.169 + public static MethodHandle unbox(Wrapper type, boolean exact) {
204.170 + return unbox(type, exact, false);
204.171 + }
204.172 +
204.173 + public static MethodHandle unboxRaw(Wrapper type, boolean exact) {
204.174 + return unbox(type, exact, true);
204.175 + }
204.176 +
204.177 + public static MethodHandle unbox(Class<?> type, boolean exact) {
204.178 + return unbox(Wrapper.forPrimitiveType(type), exact, false);
204.179 + }
204.180 +
204.181 + public static MethodHandle unboxRaw(Class<?> type, boolean exact) {
204.182 + return unbox(Wrapper.forPrimitiveType(type), exact, true);
204.183 + }
204.184 +
204.185 + /// Converting primitives to references
204.186 +
204.187 + static Integer boxInteger(int x) {
204.188 + return x;
204.189 + }
204.190 +
204.191 + static Byte boxByte(byte x) {
204.192 + return x;
204.193 + }
204.194 +
204.195 + static Short boxShort(short x) {
204.196 + return x;
204.197 + }
204.198 +
204.199 + static Boolean boxBoolean(boolean x) {
204.200 + return x;
204.201 + }
204.202 +
204.203 + static Character boxCharacter(char x) {
204.204 + return x;
204.205 + }
204.206 +
204.207 + static Long boxLong(long x) {
204.208 + return x;
204.209 + }
204.210 +
204.211 + static Float boxFloat(float x) {
204.212 + return x;
204.213 + }
204.214 +
204.215 + static Double boxDouble(double x) {
204.216 + return x;
204.217 + }
204.218 +
204.219 + /// Converting raw primitives to references
204.220 +
204.221 + static Byte boxByteRaw(int x) {
204.222 + return boxByte((byte)x);
204.223 + }
204.224 +
204.225 + static Short boxShortRaw(int x) {
204.226 + return boxShort((short)x);
204.227 + }
204.228 +
204.229 + static Boolean boxBooleanRaw(int x) {
204.230 + return boxBoolean(x != 0);
204.231 + }
204.232 +
204.233 + static Character boxCharacterRaw(int x) {
204.234 + return boxCharacter((char)x);
204.235 + }
204.236 +
204.237 + static Float boxFloatRaw(int x) {
204.238 + return boxFloat(Float.intBitsToFloat(x));
204.239 + }
204.240 +
204.241 + static Double boxDoubleRaw(long x) {
204.242 + return boxDouble(Double.longBitsToDouble(x));
204.243 + }
204.244 +
204.245 + // a raw void value is (arbitrarily) a garbage int
204.246 + static Void boxVoidRaw(int x) {
204.247 + return null;
204.248 + }
204.249 +
204.250 + private static MethodType boxType(Wrapper wrap, boolean raw) {
204.251 + // be exact, since return casts are hard to compose
204.252 + Class<?> boxType = wrap.wrapperType();
204.253 + return MethodType.methodType(boxType, rawWrapper(wrap, raw).primitiveType());
204.254 + }
204.255 +
204.256 + private static Wrapper rawWrapper(Wrapper wrap, boolean raw) {
204.257 + if (raw) return wrap.isDoubleWord() ? Wrapper.LONG : Wrapper.INT;
204.258 + return wrap;
204.259 + }
204.260 +
204.261 + private static final EnumMap<Wrapper, MethodHandle>[]
204.262 + BOX_CONVERSIONS = newWrapperCaches(4);
204.263 +
204.264 + private static MethodHandle box(Wrapper wrap, boolean exact, boolean raw) {
204.265 + EnumMap<Wrapper, MethodHandle> cache = BOX_CONVERSIONS[(exact?1:0)+(raw?2:0)];
204.266 + MethodHandle mh = cache.get(wrap);
204.267 + if (mh != null) {
204.268 + return mh;
204.269 + }
204.270 + // slow path
204.271 + switch (wrap) {
204.272 + case OBJECT:
204.273 + mh = IDENTITY; break;
204.274 + case VOID:
204.275 + if (!raw) mh = ZERO_OBJECT;
204.276 + break;
204.277 + case INT: case LONG:
204.278 + // these guys don't need separate raw channels
204.279 + if (raw) mh = box(wrap, exact, false);
204.280 + break;
204.281 + }
204.282 + if (mh != null) {
204.283 + cache.put(wrap, mh);
204.284 + return mh;
204.285 + }
204.286 + // look up the method
204.287 + String name = "box" + wrap.simpleName() + (raw ? "Raw" : "");
204.288 + MethodType type = boxType(wrap, raw);
204.289 + if (exact) {
204.290 + try {
204.291 + mh = IMPL_LOOKUP.findStatic(ValueConversions.class, name, type);
204.292 + } catch (ReflectiveOperationException ex) {
204.293 + mh = null;
204.294 + }
204.295 + } else {
204.296 + mh = box(wrap, !exact, raw).asType(type.erase());
204.297 + }
204.298 + if (mh != null) {
204.299 + cache.put(wrap, mh);
204.300 + return mh;
204.301 + }
204.302 + throw new IllegalArgumentException("cannot find box adapter for " + wrap + (raw ? " (raw)" : ""));
204.303 + }
204.304 +
204.305 + public static MethodHandle box(Class<?> type, boolean exact) {
204.306 + return box(Wrapper.forPrimitiveType(type), exact, false);
204.307 + }
204.308 +
204.309 + public static MethodHandle boxRaw(Class<?> type, boolean exact) {
204.310 + return box(Wrapper.forPrimitiveType(type), exact, true);
204.311 + }
204.312 +
204.313 + public static MethodHandle box(Wrapper type, boolean exact) {
204.314 + return box(type, exact, false);
204.315 + }
204.316 +
204.317 + public static MethodHandle boxRaw(Wrapper type, boolean exact) {
204.318 + return box(type, exact, true);
204.319 + }
204.320 +
204.321 + /// Kludges for when raw values get accidentally boxed.
204.322 +
204.323 + static int unboxRawInteger(Object x) {
204.324 + if (x instanceof Integer)
204.325 + return unboxInteger(x);
204.326 + else
204.327 + return (int) unboxLong(x);
204.328 + }
204.329 +
204.330 + static Integer reboxRawInteger(Object x) {
204.331 + if (x instanceof Integer)
204.332 + return (Integer) x;
204.333 + else
204.334 + return (int) unboxLong(x);
204.335 + }
204.336 +
204.337 + static Byte reboxRawByte(Object x) {
204.338 + if (x instanceof Byte) return (Byte) x;
204.339 + return boxByteRaw(unboxRawInteger(x));
204.340 + }
204.341 +
204.342 + static Short reboxRawShort(Object x) {
204.343 + if (x instanceof Short) return (Short) x;
204.344 + return boxShortRaw(unboxRawInteger(x));
204.345 + }
204.346 +
204.347 + static Boolean reboxRawBoolean(Object x) {
204.348 + if (x instanceof Boolean) return (Boolean) x;
204.349 + return boxBooleanRaw(unboxRawInteger(x));
204.350 + }
204.351 +
204.352 + static Character reboxRawCharacter(Object x) {
204.353 + if (x instanceof Character) return (Character) x;
204.354 + return boxCharacterRaw(unboxRawInteger(x));
204.355 + }
204.356 +
204.357 + static Float reboxRawFloat(Object x) {
204.358 + if (x instanceof Float) return (Float) x;
204.359 + return boxFloatRaw(unboxRawInteger(x));
204.360 + }
204.361 +
204.362 + static Long reboxRawLong(Object x) {
204.363 + return (Long) x; //never a rebox
204.364 + }
204.365 +
204.366 + static Double reboxRawDouble(Object x) {
204.367 + if (x instanceof Double) return (Double) x;
204.368 + return boxDoubleRaw(unboxLong(x));
204.369 + }
204.370 +
204.371 + private static MethodType reboxType(Wrapper wrap) {
204.372 + Class<?> boxType = wrap.wrapperType();
204.373 + return MethodType.methodType(boxType, Object.class);
204.374 + }
204.375 +
204.376 + private static final EnumMap<Wrapper, MethodHandle>[]
204.377 + REBOX_CONVERSIONS = newWrapperCaches(2);
204.378 +
204.379 + /**
204.380 + * Because we normalize primitive types to reduce the number of signatures,
204.381 + * primitives are sometimes manipulated under an "erased" type,
204.382 + * either int (for types other than long/double) or long (for all types).
204.383 + * When the erased primitive value is then boxed into an Integer or Long,
204.384 + * the final boxed primitive is sometimes required. This transformation
204.385 + * is called a "rebox". It takes an Integer or Long and produces some
204.386 + * other boxed value.
204.387 + */
204.388 + public static MethodHandle rebox(Wrapper wrap, boolean exact) {
204.389 + EnumMap<Wrapper, MethodHandle> cache = REBOX_CONVERSIONS[exact?1:0];
204.390 + MethodHandle mh = cache.get(wrap);
204.391 + if (mh != null) {
204.392 + return mh;
204.393 + }
204.394 + // slow path
204.395 + switch (wrap) {
204.396 + case OBJECT:
204.397 + mh = IDENTITY; break;
204.398 + case VOID:
204.399 + throw new IllegalArgumentException("cannot rebox a void");
204.400 + }
204.401 + if (mh != null) {
204.402 + cache.put(wrap, mh);
204.403 + return mh;
204.404 + }
204.405 + // look up the method
204.406 + String name = "reboxRaw" + wrap.simpleName();
204.407 + MethodType type = reboxType(wrap);
204.408 + if (exact) {
204.409 + try {
204.410 + mh = IMPL_LOOKUP.findStatic(ValueConversions.class, name, type);
204.411 + } catch (ReflectiveOperationException ex) {
204.412 + mh = null;
204.413 + }
204.414 + } else {
204.415 + mh = rebox(wrap, !exact).asType(IDENTITY.type());
204.416 + }
204.417 + if (mh != null) {
204.418 + cache.put(wrap, mh);
204.419 + return mh;
204.420 + }
204.421 + throw new IllegalArgumentException("cannot find rebox adapter for " + wrap);
204.422 + }
204.423 +
204.424 + public static MethodHandle rebox(Class<?> type, boolean exact) {
204.425 + return rebox(Wrapper.forPrimitiveType(type), exact);
204.426 + }
204.427 +
204.428 + /// Width-changing conversions between int and long.
204.429 +
204.430 + static long widenInt(int x) {
204.431 + return (long) x;
204.432 + }
204.433 +
204.434 + static Long widenBoxedInt(Integer x) {
204.435 + return (long)(int)x;
204.436 + }
204.437 +
204.438 + static int narrowLong(long x) {
204.439 + return (int) x;
204.440 + }
204.441 +
204.442 + static Integer narrowBoxedLong(Long x) {
204.443 + return (int)(long) x;
204.444 + }
204.445 +
204.446 + /// Constant functions
204.447 +
204.448 + static void ignore(Object x) {
204.449 + // no value to return; this is an unbox of null
204.450 + return;
204.451 + }
204.452 +
204.453 + static void empty() {
204.454 + return;
204.455 + }
204.456 +
204.457 + static Object zeroObject() {
204.458 + return null;
204.459 + }
204.460 +
204.461 + static int zeroInteger() {
204.462 + return 0;
204.463 + }
204.464 +
204.465 + static long zeroLong() {
204.466 + return 0;
204.467 + }
204.468 +
204.469 + static float zeroFloat() {
204.470 + return 0;
204.471 + }
204.472 +
204.473 + static double zeroDouble() {
204.474 + return 0;
204.475 + }
204.476 +
204.477 + private static final EnumMap<Wrapper, MethodHandle>[]
204.478 + CONSTANT_FUNCTIONS = newWrapperCaches(2);
204.479 +
204.480 + public static MethodHandle zeroConstantFunction(Wrapper wrap) {
204.481 + EnumMap<Wrapper, MethodHandle> cache = CONSTANT_FUNCTIONS[0];
204.482 + MethodHandle mh = cache.get(wrap);
204.483 + if (mh != null) {
204.484 + return mh;
204.485 + }
204.486 + // slow path
204.487 + MethodType type = MethodType.methodType(wrap.primitiveType());
204.488 + switch (wrap) {
204.489 + case VOID:
204.490 + mh = EMPTY;
204.491 + break;
204.492 + case INT: case LONG: case FLOAT: case DOUBLE:
204.493 + try {
204.494 + mh = IMPL_LOOKUP.findStatic(ValueConversions.class, "zero"+wrap.simpleName(), type);
204.495 + } catch (ReflectiveOperationException ex) {
204.496 + mh = null;
204.497 + }
204.498 + break;
204.499 + }
204.500 + if (mh != null) {
204.501 + cache.put(wrap, mh);
204.502 + return mh;
204.503 + }
204.504 +
204.505 + // use the raw method
204.506 + Wrapper rawWrap = wrap.rawPrimitive();
204.507 + if (mh == null && rawWrap != wrap) {
204.508 + mh = MethodHandles.explicitCastArguments(zeroConstantFunction(rawWrap), type);
204.509 + }
204.510 + if (mh != null) {
204.511 + cache.put(wrap, mh);
204.512 + return mh;
204.513 + }
204.514 + throw new IllegalArgumentException("cannot find zero constant for " + wrap);
204.515 + }
204.516 +
204.517 + /// Converting references to references.
204.518 +
204.519 + /**
204.520 + * Value-killing function.
204.521 + * @param x an arbitrary reference value
204.522 + * @return a null
204.523 + */
204.524 + static Object alwaysNull(Object x) {
204.525 + return null;
204.526 + }
204.527 +
204.528 + /**
204.529 + * Value-killing function.
204.530 + * @param x an arbitrary reference value
204.531 + * @return a zero
204.532 + */
204.533 + static int alwaysZero(Object x) {
204.534 + return 0;
204.535 + }
204.536 +
204.537 + /**
204.538 + * Identity function.
204.539 + * @param x an arbitrary reference value
204.540 + * @return the same value x
204.541 + */
204.542 + static <T> T identity(T x) {
204.543 + return x;
204.544 + }
204.545 +
204.546 + /**
204.547 + * Identity function on ints.
204.548 + * @param x an arbitrary int value
204.549 + * @return the same value x
204.550 + */
204.551 + static int identity(int x) {
204.552 + return x;
204.553 + }
204.554 +
204.555 + static byte identity(byte x) {
204.556 + return x;
204.557 + }
204.558 +
204.559 + static short identity(short x) {
204.560 + return x;
204.561 + }
204.562 +
204.563 + static boolean identity(boolean x) {
204.564 + return x;
204.565 + }
204.566 +
204.567 + static char identity(char x) {
204.568 + return x;
204.569 + }
204.570 +
204.571 + /**
204.572 + * Identity function on longs.
204.573 + * @param x an arbitrary long value
204.574 + * @return the same value x
204.575 + */
204.576 + static long identity(long x) {
204.577 + return x;
204.578 + }
204.579 +
204.580 + static float identity(float x) {
204.581 + return x;
204.582 + }
204.583 +
204.584 + static double identity(double x) {
204.585 + return x;
204.586 + }
204.587 +
204.588 + /**
204.589 + * Identity function, with reference cast.
204.590 + * @param t an arbitrary reference type
204.591 + * @param x an arbitrary reference value
204.592 + * @return the same value x
204.593 + */
204.594 + static <T,U> T castReference(Class<? extends T> t, U x) {
204.595 + return t.cast(x);
204.596 + }
204.597 +
204.598 + private static final MethodHandle IDENTITY, IDENTITY_I, IDENTITY_J, CAST_REFERENCE, ALWAYS_NULL, ALWAYS_ZERO, ZERO_OBJECT, IGNORE, EMPTY;
204.599 + static {
204.600 + try {
204.601 + MethodType idType = MethodType.genericMethodType(1);
204.602 + MethodType castType = idType.insertParameterTypes(0, Class.class);
204.603 + MethodType alwaysZeroType = idType.changeReturnType(int.class);
204.604 + MethodType ignoreType = idType.changeReturnType(void.class);
204.605 + MethodType zeroObjectType = MethodType.genericMethodType(0);
204.606 + IDENTITY = IMPL_LOOKUP.findStatic(ValueConversions.class, "identity", idType);
204.607 + IDENTITY_I = IMPL_LOOKUP.findStatic(ValueConversions.class, "identity", MethodType.methodType(int.class, int.class));
204.608 + IDENTITY_J = IMPL_LOOKUP.findStatic(ValueConversions.class, "identity", MethodType.methodType(long.class, long.class));
204.609 + //CAST_REFERENCE = IMPL_LOOKUP.findVirtual(Class.class, "cast", idType);
204.610 + CAST_REFERENCE = IMPL_LOOKUP.findStatic(ValueConversions.class, "castReference", castType);
204.611 + ALWAYS_NULL = IMPL_LOOKUP.findStatic(ValueConversions.class, "alwaysNull", idType);
204.612 + ALWAYS_ZERO = IMPL_LOOKUP.findStatic(ValueConversions.class, "alwaysZero", alwaysZeroType);
204.613 + ZERO_OBJECT = IMPL_LOOKUP.findStatic(ValueConversions.class, "zeroObject", zeroObjectType);
204.614 + IGNORE = IMPL_LOOKUP.findStatic(ValueConversions.class, "ignore", ignoreType);
204.615 + EMPTY = IMPL_LOOKUP.findStatic(ValueConversions.class, "empty", ignoreType.dropParameterTypes(0, 1));
204.616 + } catch (Exception ex) {
204.617 + Error err = new InternalError("uncaught exception");
204.618 + err.initCause(ex);
204.619 + throw err;
204.620 + }
204.621 + }
204.622 +
204.623 + private static final EnumMap<Wrapper, MethodHandle> WRAPPER_CASTS
204.624 + = new EnumMap<Wrapper, MethodHandle>(Wrapper.class);
204.625 +
204.626 + private static final EnumMap<Wrapper, MethodHandle> EXACT_WRAPPER_CASTS
204.627 + = new EnumMap<Wrapper, MethodHandle>(Wrapper.class);
204.628 +
204.629 + /** Return a method that casts its sole argument (an Object) to the given type
204.630 + * and returns it as the given type (if exact is true), or as plain Object (if erase is true).
204.631 + */
204.632 + public static MethodHandle cast(Class<?> type, boolean exact) {
204.633 + if (type.isPrimitive()) throw new IllegalArgumentException("cannot cast primitive type "+type);
204.634 + MethodHandle mh = null;
204.635 + Wrapper wrap = null;
204.636 + EnumMap<Wrapper, MethodHandle> cache = null;
204.637 + if (Wrapper.isWrapperType(type)) {
204.638 + wrap = Wrapper.forWrapperType(type);
204.639 + cache = (exact ? EXACT_WRAPPER_CASTS : WRAPPER_CASTS);
204.640 + mh = cache.get(wrap);
204.641 + if (mh != null) return mh;
204.642 + }
204.643 + if (VerifyType.isNullReferenceConversion(Object.class, type))
204.644 + mh = IDENTITY;
204.645 + else if (VerifyType.isNullType(type))
204.646 + mh = ALWAYS_NULL;
204.647 + else
204.648 + mh = MethodHandles.insertArguments(CAST_REFERENCE, 0, type);
204.649 + if (exact) {
204.650 + MethodType xmt = MethodType.methodType(type, Object.class);
204.651 + mh = MethodHandles.explicitCastArguments(mh, xmt);
204.652 + //mh = AdapterMethodHandle.makeRetypeRaw(IMPL_TOKEN, xmt, mh);
204.653 + }
204.654 + if (cache != null)
204.655 + cache.put(wrap, mh);
204.656 + return mh;
204.657 + }
204.658 +
204.659 + public static MethodHandle identity() {
204.660 + return IDENTITY;
204.661 + }
204.662 +
204.663 + public static MethodHandle identity(Class<?> type) {
204.664 + // This stuff has been moved into MethodHandles:
204.665 + return MethodHandles.identity(type);
204.666 + }
204.667 +
204.668 + public static MethodHandle identity(Wrapper wrap) {
204.669 + EnumMap<Wrapper, MethodHandle> cache = CONSTANT_FUNCTIONS[1];
204.670 + MethodHandle mh = cache.get(wrap);
204.671 + if (mh != null) {
204.672 + return mh;
204.673 + }
204.674 + // slow path
204.675 + MethodType type = MethodType.methodType(wrap.primitiveType());
204.676 + if (wrap != Wrapper.VOID)
204.677 + type = type.appendParameterTypes(wrap.primitiveType());
204.678 + try {
204.679 + mh = IMPL_LOOKUP.findStatic(ValueConversions.class, "identity", type);
204.680 + } catch (ReflectiveOperationException ex) {
204.681 + mh = null;
204.682 + }
204.683 + if (mh == null && wrap == Wrapper.VOID) {
204.684 + mh = EMPTY; // #(){} : #()void
204.685 + }
204.686 + if (mh != null) {
204.687 + cache.put(wrap, mh);
204.688 + return mh;
204.689 + }
204.690 +
204.691 + if (mh != null) {
204.692 + cache.put(wrap, mh);
204.693 + return mh;
204.694 + }
204.695 + throw new IllegalArgumentException("cannot find identity for " + wrap);
204.696 + }
204.697 +
204.698 + private static final Object[] NO_ARGS_ARRAY = {};
204.699 + private static Object[] makeArray(Object... args) { return args; }
204.700 + private static Object[] array() { return NO_ARGS_ARRAY; }
204.701 + private static Object[] array(Object a0)
204.702 + { return makeArray(a0); }
204.703 + private static Object[] array(Object a0, Object a1)
204.704 + { return makeArray(a0, a1); }
204.705 + private static Object[] array(Object a0, Object a1, Object a2)
204.706 + { return makeArray(a0, a1, a2); }
204.707 + private static Object[] array(Object a0, Object a1, Object a2, Object a3)
204.708 + { return makeArray(a0, a1, a2, a3); }
204.709 + private static Object[] array(Object a0, Object a1, Object a2, Object a3,
204.710 + Object a4)
204.711 + { return makeArray(a0, a1, a2, a3, a4); }
204.712 + private static Object[] array(Object a0, Object a1, Object a2, Object a3,
204.713 + Object a4, Object a5)
204.714 + { return makeArray(a0, a1, a2, a3, a4, a5); }
204.715 + private static Object[] array(Object a0, Object a1, Object a2, Object a3,
204.716 + Object a4, Object a5, Object a6)
204.717 + { return makeArray(a0, a1, a2, a3, a4, a5, a6); }
204.718 + private static Object[] array(Object a0, Object a1, Object a2, Object a3,
204.719 + Object a4, Object a5, Object a6, Object a7)
204.720 + { return makeArray(a0, a1, a2, a3, a4, a5, a6, a7); }
204.721 + private static Object[] array(Object a0, Object a1, Object a2, Object a3,
204.722 + Object a4, Object a5, Object a6, Object a7,
204.723 + Object a8)
204.724 + { return makeArray(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
204.725 + private static Object[] array(Object a0, Object a1, Object a2, Object a3,
204.726 + Object a4, Object a5, Object a6, Object a7,
204.727 + Object a8, Object a9)
204.728 + { return makeArray(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
204.729 + static MethodHandle[] makeArrays() {
204.730 + ArrayList<MethodHandle> arrays = new ArrayList<MethodHandle>();
204.731 + MethodHandles.Lookup lookup = IMPL_LOOKUP;
204.732 + for (;;) {
204.733 + int nargs = arrays.size();
204.734 + MethodType type = MethodType.genericMethodType(nargs).changeReturnType(Object[].class);
204.735 + String name = "array";
204.736 + MethodHandle array = null;
204.737 + try {
204.738 + array = lookup.findStatic(ValueConversions.class, name, type);
204.739 + } catch (ReflectiveOperationException ex) {
204.740 + }
204.741 + if (array == null) break;
204.742 + arrays.add(array);
204.743 + }
204.744 + assert(arrays.size() == 11); // current number of methods
204.745 + return arrays.toArray(new MethodHandle[0]);
204.746 + }
204.747 + static final MethodHandle[] ARRAYS = makeArrays();
204.748 +
204.749 + /** Return a method handle that takes the indicated number of Object
204.750 + * arguments and returns an Object array of them, as if for varargs.
204.751 + */
204.752 + public static MethodHandle varargsArray(int nargs) {
204.753 + if (nargs < ARRAYS.length)
204.754 + return ARRAYS[nargs];
204.755 + // else need to spin bytecode or do something else fancy
204.756 + throw new UnsupportedOperationException("NYI: cannot form a varargs array of length "+nargs);
204.757 + }
204.758 +
204.759 + private static final List<Object> NO_ARGS_LIST = Arrays.asList(NO_ARGS_ARRAY);
204.760 + private static List<Object> makeList(Object... args) { return Arrays.asList(args); }
204.761 + private static List<Object> list() { return NO_ARGS_LIST; }
204.762 + private static List<Object> list(Object a0)
204.763 + { return makeList(a0); }
204.764 + private static List<Object> list(Object a0, Object a1)
204.765 + { return makeList(a0, a1); }
204.766 + private static List<Object> list(Object a0, Object a1, Object a2)
204.767 + { return makeList(a0, a1, a2); }
204.768 + private static List<Object> list(Object a0, Object a1, Object a2, Object a3)
204.769 + { return makeList(a0, a1, a2, a3); }
204.770 + private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
204.771 + Object a4)
204.772 + { return makeList(a0, a1, a2, a3, a4); }
204.773 + private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
204.774 + Object a4, Object a5)
204.775 + { return makeList(a0, a1, a2, a3, a4, a5); }
204.776 + private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
204.777 + Object a4, Object a5, Object a6)
204.778 + { return makeList(a0, a1, a2, a3, a4, a5, a6); }
204.779 + private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
204.780 + Object a4, Object a5, Object a6, Object a7)
204.781 + { return makeList(a0, a1, a2, a3, a4, a5, a6, a7); }
204.782 + private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
204.783 + Object a4, Object a5, Object a6, Object a7,
204.784 + Object a8)
204.785 + { return makeList(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
204.786 + private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
204.787 + Object a4, Object a5, Object a6, Object a7,
204.788 + Object a8, Object a9)
204.789 + { return makeList(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
204.790 + static MethodHandle[] makeLists() {
204.791 + ArrayList<MethodHandle> arrays = new ArrayList<MethodHandle>();
204.792 + MethodHandles.Lookup lookup = IMPL_LOOKUP;
204.793 + for (;;) {
204.794 + int nargs = arrays.size();
204.795 + MethodType type = MethodType.genericMethodType(nargs).changeReturnType(List.class);
204.796 + String name = "list";
204.797 + MethodHandle array = null;
204.798 + try {
204.799 + array = lookup.findStatic(ValueConversions.class, name, type);
204.800 + } catch (ReflectiveOperationException ex) {
204.801 + }
204.802 + if (array == null) break;
204.803 + arrays.add(array);
204.804 + }
204.805 + assert(arrays.size() == 11); // current number of methods
204.806 + return arrays.toArray(new MethodHandle[0]);
204.807 + }
204.808 + static final MethodHandle[] LISTS = makeLists();
204.809 +
204.810 + /** Return a method handle that takes the indicated number of Object
204.811 + * arguments and returns List.
204.812 + */
204.813 + public static MethodHandle varargsList(int nargs) {
204.814 + if (nargs < LISTS.length)
204.815 + return LISTS[nargs];
204.816 + // else need to spin bytecode or do something else fancy
204.817 + throw new UnsupportedOperationException("NYI");
204.818 + }
204.819 +}
204.820 +
205.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
205.2 +++ b/src/share/classes/sun/invoke/util/VerifyAccess.java Tue Mar 29 20:19:55 2011 -0700
205.3 @@ -0,0 +1,210 @@
205.4 +/*
205.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
205.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
205.7 + *
205.8 + * This code is free software; you can redistribute it and/or modify it
205.9 + * under the terms of the GNU General Public License version 2 only, as
205.10 + * published by the Free Software Foundation. Oracle designates this
205.11 + * particular file as subject to the "Classpath" exception as provided
205.12 + * by Oracle in the LICENSE file that accompanied this code.
205.13 + *
205.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
205.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
205.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
205.17 + * version 2 for more details (a copy is included in the LICENSE file that
205.18 + * accompanied this code).
205.19 + *
205.20 + * You should have received a copy of the GNU General Public License version
205.21 + * 2 along with this work; if not, write to the Free Software Foundation,
205.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
205.23 + *
205.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
205.25 + * or visit www.oracle.com if you need additional information or have any
205.26 + * questions.
205.27 + */
205.28 +
205.29 +package sun.invoke.util;
205.30 +
205.31 +import java.lang.reflect.Modifier;
205.32 +import static java.lang.reflect.Modifier.*;
205.33 +
205.34 +/**
205.35 + * This class centralizes information about the JVM's linkage access control.
205.36 + * @author jrose
205.37 + */
205.38 +public class VerifyAccess {
205.39 +
205.40 + private VerifyAccess() { } // cannot instantiate
205.41 +
205.42 + private static final int PACKAGE_ONLY = 0;
205.43 + private static final int ALL_ACCESS_MODES = (PUBLIC|PRIVATE|PROTECTED|PACKAGE_ONLY);
205.44 + private static final boolean ALLOW_NESTMATE_ACCESS = false;
205.45 +
205.46 + /**
205.47 + * Evaluate the JVM linkage rules for access to the given method
205.48 + * on behalf of a caller class which proposes to perform the access.
205.49 + * Return true if the caller class has privileges to invoke a method
205.50 + * or access a field with the given properties.
205.51 + * This requires an accessibility check of the referencing class,
205.52 + * plus an accessibility check of the member within the class,
205.53 + * which depends on the member's modifier flags.
205.54 + * <p>
205.55 + * The relevant properties include the defining class ({@code defc})
205.56 + * of the member, and its modifier flags ({@code mods}).
205.57 + * Also relevant is the class used to make the initial symbolic reference
205.58 + * to the member ({@code refc}). If this latter class is not distinguished,
205.59 + * the defining class should be passed for both arguments ({@code defc == refc}).
205.60 + * <h3>JVM Specification, 5.4.4 "Access Control"</h3>
205.61 + * A field or method R is accessible to a class or interface D if
205.62 + * and only if any of the following conditions is true:<ul>
205.63 + * <li>R is public.
205.64 + * <li>R is protected and is declared in a class C, and D is either
205.65 + * a subclass of C or C itself. Furthermore, if R is not
205.66 + * static, then the symbolic reference to R must contain a
205.67 + * symbolic reference to a class T, such that T is either a
205.68 + * subclass of D, a superclass of D or D itself.
205.69 + * <li>R is either protected or has default access (that is,
205.70 + * neither public nor protected nor private), and is declared
205.71 + * by a class in the same runtime package as D.
205.72 + * <li>R is private and is declared in D.
205.73 + * </ul>
205.74 + * This discussion of access control omits a related restriction
205.75 + * on the target of a protected field access or method invocation
205.76 + * (the target must be of class D or a subtype of D). That
205.77 + * requirement is checked as part of the verification process
205.78 + * (5.4.1); it is not part of link-time access control.
205.79 + * @param refc the class used in the symbolic reference to the proposed member
205.80 + * @param defc the class in which the proposed member is actually defined
205.81 + * @param mods modifier flags for the proposed member
205.82 + * @param lookupClass the class for which the access check is being made
205.83 + * @return true iff the the accessing class can access such a member
205.84 + */
205.85 + public static boolean isMemberAccessible(Class<?> refc, // symbolic ref class
205.86 + Class<?> defc, // actual def class
205.87 + int mods, // actual member mods
205.88 + Class<?> lookupClass) {
205.89 + // Usually refc and defc are the same, but if they differ, verify them both.
205.90 + if (refc != defc) {
205.91 + if (!isClassAccessible(refc, lookupClass)) {
205.92 + // Note that defc is verified in the switch below.
205.93 + return false;
205.94 + }
205.95 + if ((mods & (ALL_ACCESS_MODES|STATIC)) == (PROTECTED|STATIC)) {
205.96 + // Apply the special rules for refc here.
205.97 + if (!isRelatedClass(refc, lookupClass))
205.98 + return isSamePackage(defc, lookupClass);
205.99 + // If refc == defc, the call to isPublicSuperClass will do
205.100 + // the whole job, since in that case refc (as defc) will be
205.101 + // a superclass of the lookup class.
205.102 + }
205.103 + }
205.104 + if (defc == lookupClass)
205.105 + return true; // easy check; all self-access is OK
205.106 + switch (mods & ALL_ACCESS_MODES) {
205.107 + case PUBLIC:
205.108 + if (refc != defc) return true; // already checked above
205.109 + return isClassAccessible(refc, lookupClass);
205.110 + case PROTECTED:
205.111 + return isSamePackage(defc, lookupClass) || isPublicSuperClass(defc, lookupClass);
205.112 + case PACKAGE_ONLY:
205.113 + return isSamePackage(defc, lookupClass);
205.114 + case PRIVATE:
205.115 + // Loosened rules for privates follows access rules for inner classes.
205.116 + return (ALLOW_NESTMATE_ACCESS &&
205.117 + isSamePackageMember(defc, lookupClass));
205.118 + default:
205.119 + throw new IllegalArgumentException("bad modifiers: "+Modifier.toString(mods));
205.120 + }
205.121 + }
205.122 +
205.123 + static boolean isRelatedClass(Class<?> refc, Class<?> lookupClass) {
205.124 + return (refc == lookupClass ||
205.125 + refc.isAssignableFrom(lookupClass) ||
205.126 + lookupClass.isAssignableFrom(refc));
205.127 + }
205.128 +
205.129 + static boolean isPublicSuperClass(Class<?> defc, Class<?> lookupClass) {
205.130 + return isPublic(defc.getModifiers()) && defc.isAssignableFrom(lookupClass);
205.131 + }
205.132 +
205.133 + /**
205.134 + * Evaluate the JVM linkage rules for access to the given class on behalf of caller.
205.135 + * <h3>JVM Specification, 5.4.4 "Access Control"</h3>
205.136 + * A class or interface C is accessible to a class or interface D
205.137 + * if and only if either of the following conditions are true:<ul>
205.138 + * <li>C is public.
205.139 + * <li>C and D are members of the same runtime package.
205.140 + * </ul>
205.141 + * @param refc the symbolic reference class to which access is being checked (C)
205.142 + * @param lookupClass the class performing the lookup (D)
205.143 + */
205.144 + public static boolean isClassAccessible(Class<?> refc, Class<?> lookupClass) {
205.145 + int mods = refc.getModifiers();
205.146 + if (isPublic(mods))
205.147 + return true;
205.148 + if (isSamePackage(lookupClass, refc))
205.149 + return true;
205.150 + return false;
205.151 + }
205.152 +
205.153 + /**
205.154 + * Test if two classes have the same class loader and package qualifier.
205.155 + * @param class1
205.156 + * @param class2
205.157 + * @return whether they are in the same package
205.158 + */
205.159 + public static boolean isSamePackage(Class<?> class1, Class<?> class2) {
205.160 + if (class1 == class2)
205.161 + return true;
205.162 + if (!loadersAreRelated(class1.getClassLoader(), class2.getClassLoader()))
205.163 + return false;
205.164 + String name1 = class1.getName(), name2 = class2.getName();
205.165 + int dot = name1.lastIndexOf('.');
205.166 + if (dot != name2.lastIndexOf('.'))
205.167 + return false;
205.168 + for (int i = 0; i < dot; i++) {
205.169 + if (name1.charAt(i) != name2.charAt(i))
205.170 + return false;
205.171 + }
205.172 + return true;
205.173 + }
205.174 +
205.175 + /**
205.176 + * Test if two classes are defined as part of the same package member (top-level class).
205.177 + * If this is true, they can share private access with each other.
205.178 + * @param class1
205.179 + * @param class2
205.180 + * @return whether they are identical or nested together
205.181 + */
205.182 + public static boolean isSamePackageMember(Class<?> class1, Class<?> class2) {
205.183 + if (class1 == class2)
205.184 + return true;
205.185 + if (!isSamePackage(class1, class2))
205.186 + return false;
205.187 + if (getOutermostEnclosingClass(class1) != getOutermostEnclosingClass(class2))
205.188 + return false;
205.189 + return true;
205.190 + }
205.191 +
205.192 + private static Class<?> getOutermostEnclosingClass(Class<?> c) {
205.193 + Class<?> pkgmem = c;
205.194 + for (Class<?> enc = c; (enc = enc.getEnclosingClass()) != null; )
205.195 + pkgmem = enc;
205.196 + return pkgmem;
205.197 + }
205.198 +
205.199 + private static boolean loadersAreRelated(ClassLoader loader1, ClassLoader loader2) {
205.200 + if (loader1 == loader2 || loader1 == null || loader2 == null) {
205.201 + return true;
205.202 + }
205.203 + for (ClassLoader scan1 = loader1;
205.204 + scan1 != null; scan1 = scan1.getParent()) {
205.205 + if (scan1 == loader2) return true;
205.206 + }
205.207 + for (ClassLoader scan2 = loader2;
205.208 + scan2 != null; scan2 = scan2.getParent()) {
205.209 + if (scan2 == loader1) return true;
205.210 + }
205.211 + return false;
205.212 + }
205.213 +}
206.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
206.2 +++ b/src/share/classes/sun/invoke/util/VerifyType.java Tue Mar 29 20:19:55 2011 -0700
206.3 @@ -0,0 +1,224 @@
206.4 +/*
206.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
206.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
206.7 + *
206.8 + * This code is free software; you can redistribute it and/or modify it
206.9 + * under the terms of the GNU General Public License version 2 only, as
206.10 + * published by the Free Software Foundation. Oracle designates this
206.11 + * particular file as subject to the "Classpath" exception as provided
206.12 + * by Oracle in the LICENSE file that accompanied this code.
206.13 + *
206.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
206.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
206.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
206.17 + * version 2 for more details (a copy is included in the LICENSE file that
206.18 + * accompanied this code).
206.19 + *
206.20 + * You should have received a copy of the GNU General Public License version
206.21 + * 2 along with this work; if not, write to the Free Software Foundation,
206.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
206.23 + *
206.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
206.25 + * or visit www.oracle.com if you need additional information or have any
206.26 + * questions.
206.27 + */
206.28 +
206.29 +package sun.invoke.util;
206.30 +
206.31 +import java.lang.invoke.MethodType;
206.32 +import sun.invoke.empty.Empty;
206.33 +
206.34 +/**
206.35 + * This class centralizes information about the JVM verifier
206.36 + * and its requirements about type correctness.
206.37 + * @author jrose
206.38 + */
206.39 +public class VerifyType {
206.40 +
206.41 + private VerifyType() { } // cannot instantiate
206.42 +
206.43 + /**
206.44 + * True if a value can be stacked as the source type and unstacked as the
206.45 + * destination type, without violating the JVM's type consistency.
206.46 + *
206.47 + * @param call the type of a stacked value
206.48 + * @param recv the type by which we'd like to treat it
206.49 + * @return whether the retyping can be done without motion or reformatting
206.50 + */
206.51 + public static boolean isNullConversion(Class<?> src, Class<?> dst) {
206.52 + if (src == dst) return true;
206.53 + // Verifier allows any interface to be treated as Object:
206.54 + if (dst.isInterface()) dst = Object.class;
206.55 + if (src.isInterface()) src = Object.class;
206.56 + if (src == dst) return true; // check again
206.57 + if (dst == void.class) return true; // drop any return value
206.58 + if (isNullType(src)) return !dst.isPrimitive();
206.59 + if (!src.isPrimitive()) return dst.isAssignableFrom(src);
206.60 + // Verifier allows an int to carry byte, short, char, or even boolean:
206.61 + if (dst == int.class) return Wrapper.forPrimitiveType(src).isSubwordOrInt();
206.62 + return false;
206.63 + }
206.64 +
206.65 + /**
206.66 + * Specialization of isNullConversion to reference types.
206.67 +
206.68 + * @param call the type of a stacked value
206.69 + * @param recv the reference type by which we'd like to treat it
206.70 + * @return whether the retyping can be done without a cast
206.71 + */
206.72 + public static boolean isNullReferenceConversion(Class<?> src, Class<?> dst) {
206.73 + assert(!dst.isPrimitive());
206.74 + if (dst.isInterface()) return true; // verifier allows this
206.75 + if (isNullType(src)) return true;
206.76 + return dst.isAssignableFrom(src);
206.77 + }
206.78 +
206.79 + /**
206.80 + * Is the given type java.lang.Null or an equivalent null-only type?
206.81 + */
206.82 + public static boolean isNullType(Class<?> type) {
206.83 + if (type == null) return false;
206.84 + return type == NULL_CLASS
206.85 + // This one may also be used as a null type.
206.86 + // TO DO: Decide if we really want to legitimize it here.
206.87 + // Probably we do, unless java.lang.Null really makes it into Java 7
206.88 + //|| type == Void.class
206.89 + // Locally known null-only class:
206.90 + || type == Empty.class
206.91 + ;
206.92 + }
206.93 + private static final Class<?> NULL_CLASS;
206.94 + static {
206.95 + Class<?> nullClass = null;
206.96 + try {
206.97 + nullClass = Class.forName("java.lang.Null");
206.98 + } catch (ClassNotFoundException ex) {
206.99 + // OK, we'll cope
206.100 + }
206.101 + NULL_CLASS = nullClass;
206.102 + }
206.103 +
206.104 + /**
206.105 + * True if a method handle can receive a call under a slightly different
206.106 + * method type, without moving or reformatting any stack elements.
206.107 + *
206.108 + * @param call the type of call being made
206.109 + * @param recv the type of the method handle receiving the call
206.110 + * @return whether the retyping can be done without motion or reformatting
206.111 + */
206.112 + public static boolean isNullConversion(MethodType call, MethodType recv) {
206.113 + if (call == recv) return true;
206.114 + int len = call.parameterCount();
206.115 + if (len != recv.parameterCount()) return false;
206.116 + for (int i = 0; i < len; i++)
206.117 + if (!isNullConversion(call.parameterType(i), recv.parameterType(i)))
206.118 + return false;
206.119 + return isNullConversion(recv.returnType(), call.returnType());
206.120 + }
206.121 +
206.122 + //TO DO: isRawConversion
206.123 +
206.124 + /**
206.125 + * Determine if the JVM verifier allows a value of type call to be
206.126 + * passed to a formal parameter (or return variable) of type recv.
206.127 + * Returns 1 if the verifier allows the types to match without conversion.
206.128 + * Returns -1 if the types can be made to match by a JVM-supported adapter.
206.129 + * Cases supported are:
206.130 + * <ul><li>checkcast
206.131 + * </li><li>conversion between any two integral types (but not floats)
206.132 + * </li><li>unboxing from a wrapper to its corresponding primitive type
206.133 + * </li><li>conversion in either direction between float and double
206.134 + * </li></ul>
206.135 + * (Autoboxing is not supported here; it must be done via Java code.)
206.136 + * Returns 0 otherwise.
206.137 + */
206.138 + public static int canPassUnchecked(Class<?> src, Class<?> dst) {
206.139 + if (src == dst)
206.140 + return 1;
206.141 +
206.142 + if (dst.isPrimitive()) {
206.143 + if (dst == void.class)
206.144 + // Return anything to a caller expecting void.
206.145 + // This is a property of the implementation, which links
206.146 + // return values via a register rather than via a stack push.
206.147 + // This makes it possible to ignore cleanly.
206.148 + return 1;
206.149 + if (src == void.class)
206.150 + return 0; // void-to-something?
206.151 + if (!src.isPrimitive())
206.152 + // Cannot pass a reference to any primitive type (exc. void).
206.153 + return 0;
206.154 + Wrapper sw = Wrapper.forPrimitiveType(src);
206.155 + Wrapper dw = Wrapper.forPrimitiveType(dst);
206.156 + if (sw.isSubwordOrInt() && dw.isSubwordOrInt()) {
206.157 + if (sw.bitWidth() >= dw.bitWidth())
206.158 + return -1; // truncation may be required
206.159 + if (!dw.isSigned() && sw.isSigned())
206.160 + return -1; // sign elimination may be required
206.161 + }
206.162 + if (src == float.class || dst == float.class) {
206.163 + if (src == double.class || dst == double.class)
206.164 + return -1; // floating conversion may be required
206.165 + else
206.166 + return 0; // other primitive conversions NYI
206.167 + } else {
206.168 + // all fixed-point conversions are supported
206.169 + return 0;
206.170 + }
206.171 + } else if (src.isPrimitive()) {
206.172 + // Cannot pass a primitive to any reference type.
206.173 + // (Maybe allow null.class?)
206.174 + return 0;
206.175 + }
206.176 +
206.177 + // Handle reference types in the rest of the block:
206.178 +
206.179 + // The verifier treats interfaces exactly like Object.
206.180 + if (isNullReferenceConversion(src, dst))
206.181 + // pass any reference to object or an arb. interface
206.182 + return 1;
206.183 + // else it's a definite "maybe" (cast is required)
206.184 + return -1;
206.185 + }
206.186 +
206.187 + public static int canPassRaw(Class<?> src, Class<?> dst) {
206.188 + if (dst.isPrimitive()) {
206.189 + if (dst == void.class)
206.190 + // As above, return anything to a caller expecting void.
206.191 + return 1;
206.192 + if (src == void.class)
206.193 + // Special permission for raw conversions: allow a void
206.194 + // to be captured as a garbage int.
206.195 + // Caller promises that the actual value will be disregarded.
206.196 + return dst == int.class ? 1 : 0;
206.197 + if (isNullType(src))
206.198 + // Special permission for raw conversions: allow a null
206.199 + // to be reinterpreted as anything. For objects, it is safe,
206.200 + // and for primitives you get a garbage value (probably zero).
206.201 + return 1;
206.202 + if (!src.isPrimitive())
206.203 + return 0;
206.204 + Wrapper sw = Wrapper.forPrimitiveType(src);
206.205 + Wrapper dw = Wrapper.forPrimitiveType(dst);
206.206 + if (sw.stackSlots() == dw.stackSlots())
206.207 + return 1; // can do a reinterpret-cast on a stacked primitive
206.208 + if (sw.isSubwordOrInt() && dw == Wrapper.VOID)
206.209 + return 1; // can drop an outgoing int value
206.210 + return 0;
206.211 + } else if (src.isPrimitive()) {
206.212 + return 0;
206.213 + }
206.214 +
206.215 + // Both references.
206.216 + if (isNullReferenceConversion(src, dst))
206.217 + return 1;
206.218 + return -1;
206.219 + }
206.220 +
206.221 + public static boolean isSpreadArgType(Class<?> spreadArg) {
206.222 + return spreadArg.isArray();
206.223 + }
206.224 + public static Class<?> spreadArgElementType(Class<?> spreadArg, int i) {
206.225 + return spreadArg.getComponentType();
206.226 + }
206.227 +}
207.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
207.2 +++ b/src/share/classes/sun/invoke/util/Wrapper.java Tue Mar 29 20:19:55 2011 -0700
207.3 @@ -0,0 +1,562 @@
207.4 +/*
207.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
207.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
207.7 + *
207.8 + * This code is free software; you can redistribute it and/or modify it
207.9 + * under the terms of the GNU General Public License version 2 only, as
207.10 + * published by the Free Software Foundation. Oracle designates this
207.11 + * particular file as subject to the "Classpath" exception as provided
207.12 + * by Oracle in the LICENSE file that accompanied this code.
207.13 + *
207.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
207.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
207.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
207.17 + * version 2 for more details (a copy is included in the LICENSE file that
207.18 + * accompanied this code).
207.19 + *
207.20 + * You should have received a copy of the GNU General Public License version
207.21 + * 2 along with this work; if not, write to the Free Software Foundation,
207.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
207.23 + *
207.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
207.25 + * or visit www.oracle.com if you need additional information or have any
207.26 + * questions.
207.27 + */
207.28 +
207.29 +package sun.invoke.util;
207.30 +
207.31 +public enum Wrapper {
207.32 + BOOLEAN(Boolean.class, boolean.class, 'Z', (Boolean)false, Format.unsigned(1)),
207.33 + // These must be in the order defined for widening primitive conversions in JLS 5.1.2
207.34 + BYTE(Byte.class, byte.class, 'B', (Byte)(byte)0, Format.signed(8)),
207.35 + SHORT(Short.class, short.class, 'S', (Short)(short)0, Format.signed(16)),
207.36 + CHAR(Character.class, char.class, 'C', (Character)(char)0, Format.unsigned(16)),
207.37 + INT(Integer.class, int.class, 'I', (Integer)(int)0, Format.signed(32)),
207.38 + LONG(Long.class, long.class, 'J', (Long)(long)0, Format.signed(64)),
207.39 + FLOAT(Float.class, float.class, 'F', (Float)(float)0, Format.floating(32)),
207.40 + DOUBLE(Double.class, double.class, 'D', (Double)(double)0, Format.floating(64)),
207.41 + //NULL(Null.class, null.class, 'N', null, Format.other(1)),
207.42 + OBJECT(Object.class, Object.class, 'L', null, Format.other(1)),
207.43 + // VOID must be the last type, since it is "assignable" from any other type:
207.44 + VOID(Void.class, void.class, 'V', null, Format.other(0)),
207.45 + ;
207.46 +
207.47 + private final Class<?> wrapperType;
207.48 + private final Class<?> primitiveType;
207.49 + private final char basicTypeChar;
207.50 + private final Object zero;
207.51 + private final int format;
207.52 + private final String simpleName;
207.53 +
207.54 + private Wrapper(Class<?> wtype, Class<?> ptype, char tchar, Object zero, int format) {
207.55 + this.wrapperType = wtype;
207.56 + this.primitiveType = ptype;
207.57 + this.basicTypeChar = tchar;
207.58 + this.zero = zero;
207.59 + this.format = format;
207.60 + this.simpleName = wtype.getSimpleName();
207.61 + }
207.62 +
207.63 + private static abstract class Format {
207.64 + static final int SLOT_SHIFT = 0, SIZE_SHIFT = 2, KIND_SHIFT = 12;
207.65 + static final int
207.66 + SIGNED = (-1) << KIND_SHIFT,
207.67 + UNSIGNED = 0 << KIND_SHIFT,
207.68 + FLOATING = 1 << KIND_SHIFT;
207.69 + static final int
207.70 + SLOT_MASK = ((1<<(SIZE_SHIFT-SLOT_SHIFT))-1),
207.71 + SIZE_MASK = ((1<<(KIND_SHIFT-SIZE_SHIFT))-1);
207.72 + static int format(int kind, int size, int slots) {
207.73 + assert(((kind >> KIND_SHIFT) << KIND_SHIFT) == kind);
207.74 + assert((size & (size-1)) == 0); // power of two
207.75 + assert((kind == SIGNED) ? (size > 0) :
207.76 + (kind == UNSIGNED) ? (size > 0) :
207.77 + (kind == FLOATING) ? (size == 32 || size == 64) :
207.78 + false);
207.79 + assert((slots == 2) ? (size == 64) :
207.80 + (slots == 1) ? (size <= 32) :
207.81 + false);
207.82 + return kind | (size << SIZE_SHIFT) | (slots << SLOT_SHIFT);
207.83 + }
207.84 + static final int
207.85 + INT = SIGNED | (32 << SIZE_SHIFT) | (1 << SLOT_SHIFT),
207.86 + SHORT = SIGNED | (16 << SIZE_SHIFT) | (1 << SLOT_SHIFT),
207.87 + BOOLEAN = UNSIGNED | (1 << SIZE_SHIFT) | (1 << SLOT_SHIFT),
207.88 + CHAR = UNSIGNED | (16 << SIZE_SHIFT) | (1 << SLOT_SHIFT),
207.89 + FLOAT = FLOATING | (32 << SIZE_SHIFT) | (1 << SLOT_SHIFT),
207.90 + VOID = UNSIGNED | (0 << SIZE_SHIFT) | (0 << SLOT_SHIFT),
207.91 + NUM_MASK = (-1) << SIZE_SHIFT;
207.92 + static int signed(int size) { return format(SIGNED, size, (size > 32 ? 2 : 1)); }
207.93 + static int unsigned(int size) { return format(UNSIGNED, size, (size > 32 ? 2 : 1)); }
207.94 + static int floating(int size) { return format(FLOATING, size, (size > 32 ? 2 : 1)); }
207.95 + static int other(int slots) { return slots << SLOT_SHIFT; }
207.96 + }
207.97 +
207.98 + /// format queries:
207.99 +
207.100 + /** How many bits are in the wrapped value? Returns 0 for OBJECT or VOID. */
207.101 + public int bitWidth() { return (format >> Format.SIZE_SHIFT) & Format.SIZE_MASK; }
207.102 + /** How many JVM stack slots occupied by the wrapped value? Returns 0 for VOID. */
207.103 + public int stackSlots() { return (format >> Format.SLOT_SHIFT) & Format.SLOT_MASK; }
207.104 + /** Does the wrapped value occupy a single JVM stack slot? */
207.105 + public boolean isSingleWord() { return (format & (1 << Format.SLOT_SHIFT)) != 0; }
207.106 + /** Does the wrapped value occupy two JVM stack slots? */
207.107 + public boolean isDoubleWord() { return (format & (2 << Format.SLOT_SHIFT)) != 0; }
207.108 + /** Is the wrapped type numeric (not void or object)? */
207.109 + public boolean isNumeric() { return (format & Format.NUM_MASK) != 0; }
207.110 + /** Is the wrapped type a primitive other than float, double, or void? */
207.111 + public boolean isIntegral() { return isNumeric() && format < Format.FLOAT; }
207.112 + /** Is the wrapped type one of int, boolean, byte, char, or short? */
207.113 + public boolean isSubwordOrInt() { return isIntegral() && isSingleWord(); }
207.114 + /* Is the wrapped value a signed integral type (one of byte, short, int, or long)? */
207.115 + public boolean isSigned() { return format < Format.VOID; }
207.116 + /* Is the wrapped value an unsigned integral type (one of boolean or char)? */
207.117 + public boolean isUnsigned() { return format >= Format.BOOLEAN && format < Format.FLOAT; }
207.118 + /** Is the wrapped type either float or double? */
207.119 + public boolean isFloating() { return format >= Format.FLOAT; }
207.120 +
207.121 + /** Does the JVM verifier allow a variable of this wrapper's
207.122 + * primitive type to be assigned from a value of the given wrapper's primitive type?
207.123 + * Cases:
207.124 + * <ul>
207.125 + * <li>unboxing followed by widening primitive conversion
207.126 + * <li>any type converted to {@code void}
207.127 + * <li>boxing conversion followed by widening reference conversion to {@code Object}
207.128 + * <li>conversion of {@code boolean} to any type
207.129 + * </ul>
207.130 + */
207.131 + public boolean isConvertibleFrom(Wrapper source) {
207.132 + if (this == source) return true;
207.133 + if (this.compareTo(source) < 0) {
207.134 + // At best, this is a narrowing conversion.
207.135 + return false;
207.136 + }
207.137 + if ((this.format ^ source.format) == (Format.SHORT ^ Format.CHAR)) {
207.138 + assert (this == SHORT && source == CHAR) || (this == CHAR && source == SHORT);
207.139 + return false;
207.140 + }
207.141 + return true;
207.142 + }
207.143 +
207.144 + /** Produce a zero value for the given wrapper type.
207.145 + * This will be a numeric zero for a number or character,
207.146 + * false for a boolean, and null for a reference or void.
207.147 + * The common thread is that this is what is contained
207.148 + * in a default-initialized variable of the given primitive
207.149 + * type. (For void, it is what a reflective method returns
207.150 + * instead of no value at all.)
207.151 + */
207.152 + public Object zero() { return zero; }
207.153 +
207.154 + /** Produce a zero value for the given wrapper type T.
207.155 + * The optional argument must a type compatible with this wrapper.
207.156 + * Equivalent to {@code this.cast(this.zero(), type)}.
207.157 + */
207.158 + public <T> T zero(Class<T> type) { return convert(zero, type); }
207.159 +
207.160 +// /** Produce a wrapper for the given wrapper or primitive type. */
207.161 +// public static Wrapper valueOf(Class<?> type) {
207.162 +// if (isPrimitiveType(type))
207.163 +// return forPrimitiveType(type);
207.164 +// else
207.165 +// return forWrapperType(type);
207.166 +// }
207.167 +
207.168 + /** Return the wrapper that wraps values of the given type.
207.169 + * The type may be {@code Object}, meaning the {@code OBJECT} wrapper.
207.170 + * Otherwise, the type must be a primitive.
207.171 + * @throws IllegalArgumentException for unexpected types
207.172 + */
207.173 + public static Wrapper forPrimitiveType(Class<?> type) {
207.174 + Wrapper w = findPrimitiveType(type);
207.175 + if (w != null) return w;
207.176 + if (type.isPrimitive())
207.177 + throw new InternalError(); // redo hash function
207.178 + throw newIllegalArgumentException("not primitive: "+type);
207.179 + }
207.180 +
207.181 + static Wrapper findPrimitiveType(Class<?> type) {
207.182 + Wrapper w = FROM_PRIM[hashPrim(type)];
207.183 + if (w != null && w.primitiveType == type) {
207.184 + return w;
207.185 + }
207.186 + return null;
207.187 + }
207.188 +
207.189 + /** Return the wrapper that wraps values into the given wrapper type.
207.190 + * If it is {@code Object} or an interface, return {@code OBJECT}.
207.191 + * Otherwise, it must be a wrapper type.
207.192 + * The type must not be a primitive type.
207.193 + * @throws IllegalArgumentException for unexpected types
207.194 + */
207.195 + public static Wrapper forWrapperType(Class<?> type) {
207.196 + Wrapper w = findWrapperType(type);
207.197 + if (w != null) return w;
207.198 + for (Wrapper x : values())
207.199 + if (x.wrapperType == type)
207.200 + throw new InternalError(); // redo hash function
207.201 + throw newIllegalArgumentException("not wrapper: "+type);
207.202 + }
207.203 +
207.204 + static Wrapper findWrapperType(Class<?> type) {
207.205 + Wrapper w = FROM_WRAP[hashWrap(type)];
207.206 + if (w != null && w.wrapperType == type) {
207.207 + return w;
207.208 + }
207.209 + if (type.isInterface())
207.210 + return OBJECT;
207.211 + return null;
207.212 + }
207.213 +
207.214 + /** Return the wrapper that corresponds to the given bytecode
207.215 + * signature character. Return {@code OBJECT} for the character 'L'.
207.216 + * @throws IllegalArgumentException for any non-signature character or {@code '['}.
207.217 + */
207.218 + public static Wrapper forBasicType(char type) {
207.219 + Wrapper w = FROM_CHAR[hashChar(type)];
207.220 + if (w != null && w.basicTypeChar == type) {
207.221 + return w;
207.222 + }
207.223 + for (Wrapper x : values())
207.224 + if (w.basicTypeChar == type)
207.225 + throw new InternalError(); // redo hash function
207.226 + throw newIllegalArgumentException("not basic type char: "+type);
207.227 + }
207.228 +
207.229 + /** Return the wrapper for the given type, if it is
207.230 + * a primitive type, else return {@code OBJECT}.
207.231 + */
207.232 + public static Wrapper forBasicType(Class<?> type) {
207.233 + if (type.isPrimitive())
207.234 + return forPrimitiveType(type);
207.235 + return OBJECT; // any reference, including wrappers or arrays
207.236 + }
207.237 +
207.238 + // Note on perfect hashes:
207.239 + // for signature chars c, do (c + (c >> 1)) % 16
207.240 + // for primitive type names n, do (n[0] + n[2]) % 16
207.241 + // The type name hash works for both primitive and wrapper names.
207.242 + // You can add "java/lang/Object" to the primitive names.
207.243 + // But you add the wrapper name Object, use (n[2] + (3*n[1])) % 16.
207.244 + private static final Wrapper[] FROM_PRIM = new Wrapper[16];
207.245 + private static final Wrapper[] FROM_WRAP = new Wrapper[16];
207.246 + private static final Wrapper[] FROM_CHAR = new Wrapper[16];
207.247 + private static int hashPrim(Class<?> x) {
207.248 + String xn = x.getName();
207.249 + if (xn.length() < 3) return 0;
207.250 + return (xn.charAt(0) + xn.charAt(2)) % 16;
207.251 + }
207.252 + private static int hashWrap(Class<?> x) {
207.253 + String xn = x.getName();
207.254 + final int offset = 10; assert(offset == "java.lang.".length());
207.255 + if (xn.length() < offset+3) return 0;
207.256 + return (3*xn.charAt(offset+1) + xn.charAt(offset+2)) % 16;
207.257 + }
207.258 + private static int hashChar(char x) {
207.259 + return (x + (x >> 1)) % 16;
207.260 + }
207.261 + static {
207.262 + for (Wrapper w : values()) {
207.263 + int pi = hashPrim(w.primitiveType);
207.264 + int wi = hashWrap(w.wrapperType);
207.265 + int ci = hashChar(w.basicTypeChar);
207.266 + assert(FROM_PRIM[pi] == null);
207.267 + assert(FROM_WRAP[wi] == null);
207.268 + assert(FROM_CHAR[ci] == null);
207.269 + FROM_PRIM[pi] = w;
207.270 + FROM_WRAP[wi] = w;
207.271 + FROM_CHAR[ci] = w;
207.272 + }
207.273 + //assert(jdk.sun.invoke.util.WrapperTest.test(false));
207.274 + }
207.275 +
207.276 + /** What is the primitive type wrapped by this wrapper? */
207.277 + public Class<?> primitiveType() { return primitiveType; }
207.278 +
207.279 + /** What is the wrapper type for this wrapper? */
207.280 + public Class<?> wrapperType() { return wrapperType; }
207.281 +
207.282 + /** What is the wrapper type for this wrapper?
207.283 + * Otherwise, the example type must be the wrapper type,
207.284 + * or the corresponding primitive type.
207.285 + * (For {@code OBJECT}, the example type can be any non-primitive,
207.286 + * and is normalized to {@code Object.class}.)
207.287 + * The resulting class type has the same type parameter.
207.288 + */
207.289 + public <T> Class<T> wrapperType(Class<T> exampleType) {
207.290 + if (exampleType == wrapperType) {
207.291 + return exampleType;
207.292 + } else if (exampleType == primitiveType ||
207.293 + wrapperType == Object.class ||
207.294 + exampleType.isInterface()) {
207.295 + return forceType(wrapperType, exampleType);
207.296 + }
207.297 + throw newClassCastException(exampleType, primitiveType);
207.298 + }
207.299 +
207.300 + private static ClassCastException newClassCastException(Class<?> actual, Class<?> expected) {
207.301 + return new ClassCastException(actual + " is not compatible with " + expected);
207.302 + }
207.303 +
207.304 + /** If {@code type} is a primitive type, return the corresponding
207.305 + * wrapper type, else return {@code type} unchanged.
207.306 + */
207.307 + public static <T> Class<T> asWrapperType(Class<T> type) {
207.308 + if (type.isPrimitive()) {
207.309 + return forPrimitiveType(type).wrapperType(type);
207.310 + }
207.311 + return type;
207.312 + }
207.313 +
207.314 + /** If {@code type} is a wrapper type, return the corresponding
207.315 + * primitive type, else return {@code type} unchanged.
207.316 + */
207.317 + public static <T> Class<T> asPrimitiveType(Class<T> type) {
207.318 + Wrapper w = findWrapperType(type);
207.319 + if (w != null) {
207.320 + return forceType(w.primitiveType(), type);
207.321 + }
207.322 + return type;
207.323 + }
207.324 +
207.325 + /** Query: Is the given type a wrapper, such as {@code Integer} or {@code Void}? */
207.326 + public static boolean isWrapperType(Class<?> type) {
207.327 + return findWrapperType(type) != null;
207.328 + }
207.329 +
207.330 + /** Query: Is the given type a primitive, such as {@code int} or {@code void}? */
207.331 + public static boolean isPrimitiveType(Class<?> type) {
207.332 + return type.isPrimitive();
207.333 + }
207.334 +
207.335 + /** What is the bytecode signature character for this type?
207.336 + * All non-primitives, including array types, report as 'L', the signature character for references.
207.337 + */
207.338 + public static char basicTypeChar(Class<?> type) {
207.339 + if (!type.isPrimitive())
207.340 + return 'L';
207.341 + else
207.342 + return forPrimitiveType(type).basicTypeChar();
207.343 + }
207.344 +
207.345 + /** What is the bytecode signature character for this wrapper's
207.346 + * primitive type?
207.347 + */
207.348 + public char basicTypeChar() { return basicTypeChar; }
207.349 +
207.350 + /** What is the simple name of the wrapper type?
207.351 + */
207.352 + public String simpleName() { return simpleName; }
207.353 +
207.354 +// /** Wrap a value in the given type, which may be either a primitive or wrapper type.
207.355 +// * Performs standard primitive conversions, including truncation and float conversions.
207.356 +// */
207.357 +// public static <T> T wrap(Object x, Class<T> type) {
207.358 +// return Wrapper.valueOf(type).cast(x, type);
207.359 +// }
207.360 +
207.361 + /** Cast a wrapped value to the given type, which may be either a primitive or wrapper type.
207.362 + * The given target type must be this wrapper's primitive or wrapper type.
207.363 + * If this wrapper is OBJECT, the target type may also be an interface, perform no runtime check.
207.364 + * Performs standard primitive conversions, including truncation and float conversions.
207.365 + * The given type must be compatible with this wrapper. That is, it must either
207.366 + * be the wrapper type (or a subtype, in the case of {@code OBJECT}) or else
207.367 + * it must be the wrapper's primitive type.
207.368 + * Primitive conversions are only performed if the given type is itself a primitive.
207.369 + * @throws ClassCastException if the given type is not compatible with this wrapper
207.370 + */
207.371 + public <T> T cast(Object x, Class<T> type) {
207.372 + return convert(x, type, true);
207.373 + }
207.374 +
207.375 + /** Convert a wrapped value to the given type.
207.376 + * The given target type must be this wrapper's primitive or wrapper type.
207.377 + * This is equivalent to {@link #cast}, except that it refuses to perform
207.378 + * narrowing primitive conversions.
207.379 + */
207.380 + public <T> T convert(Object x, Class<T> type) {
207.381 + return convert(x, type, false);
207.382 + }
207.383 +
207.384 + private <T> T convert(Object x, Class<T> type, boolean isCast) {
207.385 + if (this == OBJECT) {
207.386 + // If the target wrapper is OBJECT, just do a reference cast.
207.387 + // If the target type is an interface, perform no runtime check.
207.388 + // (This loophole is safe, and is allowed by the JVM verifier.)
207.389 + // If the target type is a primitive, change it to a wrapper.
207.390 + @SuppressWarnings("unchecked")
207.391 + T result = (T) x; // unchecked warning is expected here
207.392 + return result;
207.393 + }
207.394 + Class<T> wtype = wrapperType(type);
207.395 + if (wtype.isInstance(x)) {
207.396 + @SuppressWarnings("unchecked")
207.397 + T result = (T) x; // unchecked warning is expected here
207.398 + return result;
207.399 + }
207.400 + Class<?> sourceType = x.getClass(); // throw NPE if x is null
207.401 + if (!isCast) {
207.402 + Wrapper source = findWrapperType(sourceType);
207.403 + if (source == null || !this.isConvertibleFrom(source)) {
207.404 + throw newClassCastException(wtype, sourceType);
207.405 + }
207.406 + }
207.407 + @SuppressWarnings("unchecked")
207.408 + T result = (T) wrap(x); // unchecked warning is expected here
207.409 + assert result.getClass() == wtype;
207.410 + return result;
207.411 + }
207.412 +
207.413 + /** Cast a reference type to another reference type.
207.414 + * If the target type is an interface, perform no runtime check.
207.415 + * (This loophole is safe, and is allowed by the JVM verifier.)
207.416 + * If the target type is a primitive, change it to a wrapper.
207.417 + */
207.418 + static <T> Class<T> forceType(Class<?> type, Class<T> exampleType) {
207.419 + boolean z = (type == exampleType ||
207.420 + type.isPrimitive() && forPrimitiveType(type) == findWrapperType(exampleType) ||
207.421 + exampleType.isPrimitive() && forPrimitiveType(exampleType) == findWrapperType(type) ||
207.422 + type == Object.class && !exampleType.isPrimitive());
207.423 + if (!z)
207.424 + System.out.println(type+" <= "+exampleType);
207.425 + assert(type == exampleType ||
207.426 + type.isPrimitive() && forPrimitiveType(type) == findWrapperType(exampleType) ||
207.427 + exampleType.isPrimitive() && forPrimitiveType(exampleType) == findWrapperType(type) ||
207.428 + type == Object.class && !exampleType.isPrimitive());
207.429 + @SuppressWarnings("unchecked")
207.430 + Class<T> result = (Class<T>) type; // unchecked warning is expected here
207.431 + return result;
207.432 + }
207.433 +
207.434 + /** Wrap a value in this wrapper's type.
207.435 + * Performs standard primitive conversions, including truncation and float conversions.
207.436 + * Performs returns the unchanged reference for {@code OBJECT}.
207.437 + * Returns null for {@code VOID}.
207.438 + * Returns a zero value for a null input.
207.439 + * @throws ClassCastException if this wrapper is numeric and the operand
207.440 + * is not a number, character, boolean, or null
207.441 + */
207.442 + public Object wrap(Object x) {
207.443 + // do non-numeric wrappers first
207.444 + switch (basicTypeChar) {
207.445 + case 'L': return x;
207.446 + case 'V': return null;
207.447 + }
207.448 + Number xn = numberValue(x);
207.449 + switch (basicTypeChar) {
207.450 + case 'I': return Integer.valueOf(xn.intValue());
207.451 + case 'J': return Long.valueOf(xn.longValue());
207.452 + case 'F': return Float.valueOf(xn.floatValue());
207.453 + case 'D': return Double.valueOf(xn.doubleValue());
207.454 + case 'S': return Short.valueOf((short) xn.intValue());
207.455 + case 'B': return Byte.valueOf((byte) xn.intValue());
207.456 + case 'C': return Character.valueOf((char) xn.intValue());
207.457 + case 'Z': return Boolean.valueOf(boolValue(xn.longValue()));
207.458 + }
207.459 + throw new InternalError("bad wrapper");
207.460 + }
207.461 +
207.462 + /** Wrap a value (an int or smaller value) in this wrapper's type.
207.463 + * Performs standard primitive conversions, including truncation and float conversions.
207.464 + * Produces an {@code Integer} for {@code OBJECT}, although the exact type
207.465 + * of the operand is not known.
207.466 + * Returns null for {@code VOID}.
207.467 + */
207.468 + public Object wrap(int x) {
207.469 + if (basicTypeChar == 'L') return (Integer)x;
207.470 + switch (basicTypeChar) {
207.471 + case 'L': throw newIllegalArgumentException("cannot wrap to object type");
207.472 + case 'V': return null;
207.473 + case 'I': return Integer.valueOf((int)x);
207.474 + case 'J': return Long.valueOf(x);
207.475 + case 'F': return Float.valueOf(x);
207.476 + case 'D': return Double.valueOf(x);
207.477 + case 'S': return Short.valueOf((short) x);
207.478 + case 'B': return Byte.valueOf((byte) x);
207.479 + case 'C': return Character.valueOf((char) x);
207.480 + case 'Z': return Boolean.valueOf(boolValue(x));
207.481 + }
207.482 + throw new InternalError("bad wrapper");
207.483 + }
207.484 +
207.485 + /** Wrap a value (a long or smaller value) in this wrapper's type.
207.486 + * Does not perform floating point conversion.
207.487 + * Produces a {@code Long} for {@code OBJECT}, although the exact type
207.488 + * of the operand is not known.
207.489 + * Returns null for {@code VOID}.
207.490 + */
207.491 + public Object wrapRaw(long x) {
207.492 + switch (basicTypeChar) {
207.493 + case 'F': return Float.valueOf(Float.intBitsToFloat((int)x));
207.494 + case 'D': return Double.valueOf(Double.longBitsToDouble(x));
207.495 + case 'L': // same as 'J':
207.496 + case 'J': return (Long) x;
207.497 + }
207.498 + // Other wrapping operations are just the same, given that the
207.499 + // operand is already promoted to an int.
207.500 + return wrap((int)x);
207.501 + }
207.502 +
207.503 + /** Produce bitwise value which encodes the given wrapped value.
207.504 + * Does not perform floating point conversion.
207.505 + * Returns zero for {@code VOID}.
207.506 + */
207.507 + public long unwrapRaw(Object x) {
207.508 + switch (basicTypeChar) {
207.509 + case 'F': return Float.floatToRawIntBits((Float) x);
207.510 + case 'D': return Double.doubleToRawLongBits((Double) x);
207.511 +
207.512 + case 'L': throw newIllegalArgumentException("cannot unwrap from sobject type");
207.513 + case 'V': return 0;
207.514 + case 'I': return (int)(Integer) x;
207.515 + case 'J': return (long)(Long) x;
207.516 + case 'S': return (short)(Short) x;
207.517 + case 'B': return (byte)(Byte) x;
207.518 + case 'C': return (char)(Character) x;
207.519 + case 'Z': return (boolean)(Boolean) x ? 1 : 0;
207.520 + }
207.521 + throw new InternalError("bad wrapper");
207.522 + }
207.523 +
207.524 + /** Report what primitive type holds this guy's raw value. */
207.525 + public Class<?> rawPrimitiveType() {
207.526 + return rawPrimitive().primitiveType();
207.527 + }
207.528 +
207.529 + /** Report, as a wrapper, what primitive type holds this guy's raw value.
207.530 + * Returns self for INT, LONG, OBJECT; returns LONG for DOUBLE,
207.531 + * else returns INT.
207.532 + */
207.533 + public Wrapper rawPrimitive() {
207.534 + switch (basicTypeChar) {
207.535 + case 'S': case 'B':
207.536 + case 'C': case 'Z':
207.537 + case 'V':
207.538 + case 'F':
207.539 + return INT;
207.540 + case 'D':
207.541 + return LONG;
207.542 + }
207.543 + return this;
207.544 + }
207.545 +
207.546 + private static Number numberValue(Object x) {
207.547 + if (x instanceof Number) return (Number)x;
207.548 + if (x instanceof Character) return (int)(Character)x;
207.549 + if (x instanceof Boolean) return (Boolean)x ? 1 : 0;
207.550 + // Remaining allowed case of void: Must be a null reference.
207.551 + return (Number)x;
207.552 + }
207.553 +
207.554 + private static boolean boolValue(long bits) {
207.555 + //bits &= 1; // simple 31-bit zero extension
207.556 + return (bits != 0);
207.557 + }
207.558 +
207.559 + private static RuntimeException newIllegalArgumentException(String message, Object x) {
207.560 + return newIllegalArgumentException(message + x);
207.561 + }
207.562 + private static RuntimeException newIllegalArgumentException(String message) {
207.563 + return new IllegalArgumentException(message);
207.564 + }
207.565 +}
208.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
208.2 +++ b/src/share/classes/sun/invoke/util/package-info.java Tue Mar 29 20:19:55 2011 -0700
208.3 @@ -0,0 +1,31 @@
208.4 +/*
208.5 + * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
208.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
208.7 + *
208.8 + * This code is free software; you can redistribute it and/or modify it
208.9 + * under the terms of the GNU General Public License version 2 only, as
208.10 + * published by the Free Software Foundation. Oracle designates this
208.11 + * particular file as subject to the "Classpath" exception as provided
208.12 + * by Oracle in the LICENSE file that accompanied this code.
208.13 + *
208.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
208.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
208.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
208.17 + * version 2 for more details (a copy is included in the LICENSE file that
208.18 + * accompanied this code).
208.19 + *
208.20 + * You should have received a copy of the GNU General Public License version
208.21 + * 2 along with this work; if not, write to the Free Software Foundation,
208.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
208.23 + *
208.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
208.25 + * or visit www.oracle.com if you need additional information or have any
208.26 + * questions.
208.27 + */
208.28 +
208.29 +/**
208.30 + * Extra support for using JSR 292 RI, package java.lang.invoke.
208.31 + * @author jrose
208.32 + */
208.33 +
208.34 +package sun.invoke.util;
209.1 --- a/src/share/classes/sun/java2d/pisces/Helpers.java Tue Mar 29 11:29:01 2011 -0700
209.2 +++ b/src/share/classes/sun/java2d/pisces/Helpers.java Tue Mar 29 20:19:55 2011 -0700
209.3 @@ -154,9 +154,6 @@
209.4 // These use a hardcoded factor of 2 for increasing sizes. Perhaps this
209.5 // should be provided as an argument.
209.6 static float[] widenArray(float[] in, final int cursize, final int numToAdd) {
209.7 - if (in == null) {
209.8 - return new float[5 * numToAdd];
209.9 - }
209.10 if (in.length >= cursize + numToAdd) {
209.11 return in;
209.12 }
210.1 --- a/src/share/classes/sun/java2d/pisces/PiscesTileGenerator.java Tue Mar 29 11:29:01 2011 -0700
210.2 +++ b/src/share/classes/sun/java2d/pisces/PiscesTileGenerator.java Tue Mar 29 20:19:55 2011 -0700
210.3 @@ -191,8 +191,7 @@
210.4 System.out.println("len = "+runLen);
210.5 System.out.print(cache.toString());
210.6 e0.printStackTrace();
210.7 - System.exit(1);
210.8 - return;
210.9 + throw e0;
210.10 }
210.11
210.12 int rx0 = cx;
210.13 @@ -215,8 +214,7 @@
210.14 System.out.println("len = "+runLen);
210.15 System.out.print(cache.toString());
210.16 e.printStackTrace();
210.17 - System.exit(1);
210.18 - return;
210.19 + throw e;
210.20 }
210.21 }
210.22 pos += 2;
210.23 @@ -250,4 +248,5 @@
210.24 * No further calls will be made on this instance.
210.25 */
210.26 public void dispose() {}
210.27 -}
210.28 \ No newline at end of file
210.29 +}
210.30 +
211.1 --- a/src/share/classes/sun/java2d/pisces/Renderer.java Tue Mar 29 11:29:01 2011 -0700
211.2 +++ b/src/share/classes/sun/java2d/pisces/Renderer.java Tue Mar 29 20:19:55 2011 -0700
211.3 @@ -47,16 +47,16 @@
211.4
211.5 private static final int INIT_CROSSINGS_SIZE = 10;
211.6
211.7 - private ScanlineIterator() {
211.8 + // Preconditions: Only subpixel scanlines in the range
211.9 + // (start <= subpixel_y <= end) will be evaluated. No
211.10 + // edge may have a valid (i.e. inside the supplied clip)
211.11 + // crossing that would be generated outside that range.
211.12 + private ScanlineIterator(int start, int end) {
211.13 crossings = new int[INIT_CROSSINGS_SIZE];
211.14 edgePtrs = new int[INIT_CROSSINGS_SIZE];
211.15
211.16 - // We don't care if we clip some of the line off with ceil, since
211.17 - // no scan line crossings will be eliminated (in fact, the ceil is
211.18 - // the y of the first scan line crossing).
211.19 - final int minY = getFirstScanLineCrossing();
211.20 - nextY = minY;
211.21 - maxY = getScanLineCrossingEnd()-1;
211.22 + nextY = start;
211.23 + maxY = end;
211.24 edgeCount = 0;
211.25 }
211.26
211.27 @@ -148,6 +148,7 @@
211.28 // don't just set NULL to -1, because we want NULL+NEXT to be negative.
211.29 private static final int NULL = -SIZEOF_EDGE;
211.30 private float[] edges = null;
211.31 + private static final int INIT_NUM_EDGES = 8;
211.32 private int[] edgeBuckets = null;
211.33 private int[] edgeBucketCounts = null; // 2*newedges + (1 if pruning needed)
211.34 private int numEdges;
211.35 @@ -156,7 +157,7 @@
211.36 private static final float INC_BND = 8f;
211.37
211.38 // each bucket is a linked list. this method adds eptr to the
211.39 - // start "bucket"th linked list.
211.40 + // start of the "bucket"th linked list.
211.41 private void addEdgeToBucket(final int eptr, final int bucket) {
211.42 edges[eptr+NEXT] = edgeBuckets[bucket];
211.43 edgeBuckets[bucket] = eptr;
211.44 @@ -168,7 +169,8 @@
211.45 // X0, Y0, D*[X|Y], COUNT; not variables used for computing scanline crossings).
211.46 private void quadBreakIntoLinesAndAdd(float x0, float y0,
211.47 final Curve c,
211.48 - final float x2, final float y2) {
211.49 + final float x2, final float y2)
211.50 + {
211.51 final float QUAD_DEC_BND = 32;
211.52 final int countlg = 4;
211.53 int count = 1 << countlg;
211.54 @@ -204,7 +206,8 @@
211.55 // here, but then too many numbers are passed around.
211.56 private void curveBreakIntoLinesAndAdd(float x0, float y0,
211.57 final Curve c,
211.58 - final float x3, final float y3) {
211.59 + final float x3, final float y3)
211.60 + {
211.61 final int countlg = 3;
211.62 int count = 1 << countlg;
211.63
211.64 @@ -259,8 +262,6 @@
211.65 }
211.66 }
211.67
211.68 - // Preconditions: y2 > y1 and the curve must cross some scanline
211.69 - // i.e.: y1 <= y < y2 for some y such that boundsMinY <= y < boundsMaxY
211.70 private void addLine(float x1, float y1, float x2, float y2) {
211.71 float or = 1; // orientation of the line. 1 if y increases, 0 otherwise.
211.72 if (y2 < y1) {
211.73 @@ -272,12 +273,11 @@
211.74 x1 = or;
211.75 or = 0;
211.76 }
211.77 - final int firstCrossing = Math.max((int) Math.ceil(y1), boundsMinY);
211.78 + final int firstCrossing = Math.max((int)Math.ceil(y1), boundsMinY);
211.79 final int lastCrossing = Math.min((int)Math.ceil(y2), boundsMaxY);
211.80 if (firstCrossing >= lastCrossing) {
211.81 return;
211.82 }
211.83 -
211.84 if (y1 < edgeMinY) { edgeMinY = y1; }
211.85 if (y2 > edgeMaxY) { edgeMaxY = y2; }
211.86
211.87 @@ -297,22 +297,10 @@
211.88 edges[ptr+OR] = or;
211.89 edges[ptr+CURX] = x1 + (firstCrossing - y1) * slope;
211.90 edges[ptr+SLOPE] = slope;
211.91 - edges[ptr+YMAX] = y2;
211.92 + edges[ptr+YMAX] = lastCrossing;
211.93 final int bucketIdx = firstCrossing - boundsMinY;
211.94 addEdgeToBucket(ptr, bucketIdx);
211.95 - if (lastCrossing < boundsMaxY) {
211.96 - edgeBucketCounts[lastCrossing - boundsMinY] |= 1;
211.97 - }
211.98 - }
211.99 -
211.100 - // preconditions: should not be called before the last line has been added
211.101 - // to the edge list (even though it will return a correct answer at that
211.102 - // point in time, it's not meant to be used that way).
211.103 - private int getFirstScanLineCrossing() {
211.104 - return Math.max(boundsMinY, (int)Math.ceil(edgeMinY));
211.105 - }
211.106 - private int getScanLineCrossingEnd() {
211.107 - return Math.min(boundsMaxY, (int)Math.ceil(edgeMaxY));
211.108 + edgeBucketCounts[lastCrossing - boundsMinY] |= 1;
211.109 }
211.110
211.111 // END EDGE LIST
211.112 @@ -366,9 +354,11 @@
211.113 this.boundsMaxX = (pix_boundsX + pix_boundsWidth) * SUBPIXEL_POSITIONS_X;
211.114 this.boundsMaxY = (pix_boundsY + pix_boundsHeight) * SUBPIXEL_POSITIONS_Y;
211.115
211.116 + edges = new float[INIT_NUM_EDGES * SIZEOF_EDGE];
211.117 + numEdges = 0;
211.118 edgeBuckets = new int[boundsMaxY - boundsMinY];
211.119 java.util.Arrays.fill(edgeBuckets, NULL);
211.120 - edgeBucketCounts = new int[edgeBuckets.length];
211.121 + edgeBucketCounts = new int[edgeBuckets.length + 1];
211.122 }
211.123
211.124 private float tosubpixx(float pix_x) {
211.125 @@ -394,7 +384,7 @@
211.126 y0 = y1;
211.127 }
211.128
211.129 - Curve c = new Curve();
211.130 + private Curve c = new Curve();
211.131 @Override public void curveTo(float x1, float y1,
211.132 float x2, float y2,
211.133 float x3, float y3)
211.134 @@ -431,8 +421,8 @@
211.135 throw new InternalError("Renderer does not use a native consumer.");
211.136 }
211.137
211.138 - private void _endRendering(final int pix_bboxx0, final int pix_bboxy0,
211.139 - final int pix_bboxx1, final int pix_bboxy1)
211.140 + private void _endRendering(final int pix_bboxx0, final int pix_bboxx1,
211.141 + int ymin, int ymax)
211.142 {
211.143 // Mask to determine the relevant bit of the crossing sum
211.144 // 0x1 if EVEN_ODD, all bits if NON_ZERO
211.145 @@ -455,7 +445,7 @@
211.146 int pix_minX = Integer.MAX_VALUE;
211.147
211.148 int y = boundsMinY; // needs to be declared here so we emit the last row properly.
211.149 - ScanlineIterator it = this.new ScanlineIterator();
211.150 + ScanlineIterator it = this.new ScanlineIterator(ymin, ymax);
211.151 for ( ; it.hasNext(); ) {
211.152 int numCrossings = it.next();
211.153 int[] crossings = it.crossings;
211.154 @@ -477,7 +467,7 @@
211.155 int curxo = crossings[i];
211.156 int curx = curxo >> 1;
211.157 // to turn {0, 1} into {-1, 1}, multiply by 2 and subtract 1.
211.158 - int crorientation = ((curxo & 0x1) << 1) -1;
211.159 + int crorientation = ((curxo & 0x1) << 1) - 1;
211.160 if ((sum & mask) != 0) {
211.161 int x0 = Math.max(prev, bboxx0);
211.162 int x1 = Math.min(curx, bboxx1);
211.163 @@ -541,7 +531,7 @@
211.164 }
211.165
211.166 this.cache = new PiscesCache(pminX, pminY, pmaxX, pmaxY);
211.167 - _endRendering(pminX, pminY, pmaxX, pmaxY);
211.168 + _endRendering(pminX, pmaxX, spminY, spmaxY);
211.169 }
211.170
211.171 public PiscesCache getCache() {
212.1 --- a/src/share/classes/sun/java2d/pisces/Stroker.java Tue Mar 29 11:29:01 2011 -0700
212.2 +++ b/src/share/classes/sun/java2d/pisces/Stroker.java Tue Mar 29 20:19:55 2011 -0700
212.3 @@ -764,6 +764,11 @@
212.4 private static final int MAX_N_CURVES = 11;
212.5 private float[] subdivTs = new float[MAX_N_CURVES - 1];
212.6
212.7 + // If this class is compiled with ecj, then Hotspot crashes when OSR
212.8 + // compiling this function. See bugs 7004570 and 6675699
212.9 + // TODO: until those are fixed, we should work around that by
212.10 + // manually inlining this into curveTo and quadTo.
212.11 +/******************************* WORKAROUND **********************************
212.12 private void somethingTo(final int type) {
212.13 // need these so we can update the state at the end of this method
212.14 final float xf = middle[type-2], yf = middle[type-1];
212.15 @@ -866,6 +871,7 @@
212.16 this.cy0 = yf;
212.17 this.prev = DRAWING_OP_TO;
212.18 }
212.19 +****************************** END WORKAROUND *******************************/
212.20
212.21 // finds values of t where the curve in pts should be subdivided in order
212.22 // to get good offset curves a distance of w away from the middle curve.
212.23 @@ -932,18 +938,168 @@
212.24 middle[2] = x1; middle[3] = y1;
212.25 middle[4] = x2; middle[5] = y2;
212.26 middle[6] = x3; middle[7] = y3;
212.27 - somethingTo(8);
212.28 - }
212.29
212.30 - @Override public long getNativeConsumer() {
212.31 - throw new InternalError("Stroker doesn't use a native consumer");
212.32 + // inlined version of somethingTo(8);
212.33 + // See the TODO on somethingTo
212.34 +
212.35 + // need these so we can update the state at the end of this method
212.36 + final float xf = middle[6], yf = middle[7];
212.37 + float dxs = middle[2] - middle[0];
212.38 + float dys = middle[3] - middle[1];
212.39 + float dxf = middle[6] - middle[4];
212.40 + float dyf = middle[7] - middle[5];
212.41 +
212.42 + boolean p1eqp2 = (dxs == 0f && dys == 0f);
212.43 + boolean p3eqp4 = (dxf == 0f && dyf == 0f);
212.44 + if (p1eqp2) {
212.45 + dxs = middle[4] - middle[0];
212.46 + dys = middle[5] - middle[1];
212.47 + if (dxs == 0f && dys == 0f) {
212.48 + dxs = middle[6] - middle[0];
212.49 + dys = middle[7] - middle[1];
212.50 + }
212.51 + }
212.52 + if (p3eqp4) {
212.53 + dxf = middle[6] - middle[2];
212.54 + dyf = middle[7] - middle[3];
212.55 + if (dxf == 0f && dyf == 0f) {
212.56 + dxf = middle[6] - middle[0];
212.57 + dyf = middle[7] - middle[1];
212.58 + }
212.59 + }
212.60 + if (dxs == 0f && dys == 0f) {
212.61 + // this happens iff the "curve" is just a point
212.62 + lineTo(middle[0], middle[1]);
212.63 + return;
212.64 + }
212.65 +
212.66 + // if these vectors are too small, normalize them, to avoid future
212.67 + // precision problems.
212.68 + if (Math.abs(dxs) < 0.1f && Math.abs(dys) < 0.1f) {
212.69 + float len = (float)Math.sqrt(dxs*dxs + dys*dys);
212.70 + dxs /= len;
212.71 + dys /= len;
212.72 + }
212.73 + if (Math.abs(dxf) < 0.1f && Math.abs(dyf) < 0.1f) {
212.74 + float len = (float)Math.sqrt(dxf*dxf + dyf*dyf);
212.75 + dxf /= len;
212.76 + dyf /= len;
212.77 + }
212.78 +
212.79 + computeOffset(dxs, dys, lineWidth2, offset[0]);
212.80 + final float mx = offset[0][0];
212.81 + final float my = offset[0][1];
212.82 + drawJoin(cdx, cdy, cx0, cy0, dxs, dys, cmx, cmy, mx, my);
212.83 +
212.84 + int nSplits = findSubdivPoints(middle, subdivTs, 8, lineWidth2);
212.85 +
212.86 + int kind = 0;
212.87 + Iterator<Integer> it = Curve.breakPtsAtTs(middle, 8, subdivTs, nSplits);
212.88 + while(it.hasNext()) {
212.89 + int curCurveOff = it.next();
212.90 +
212.91 + kind = computeOffsetCubic(middle, curCurveOff, lp, rp);
212.92 + if (kind != 0) {
212.93 + emitLineTo(lp[0], lp[1]);
212.94 + switch(kind) {
212.95 + case 8:
212.96 + emitCurveTo(lp[0], lp[1], lp[2], lp[3], lp[4], lp[5], lp[6], lp[7], false);
212.97 + emitCurveTo(rp[0], rp[1], rp[2], rp[3], rp[4], rp[5], rp[6], rp[7], true);
212.98 + break;
212.99 + case 4:
212.100 + emitLineTo(lp[2], lp[3]);
212.101 + emitLineTo(rp[0], rp[1], true);
212.102 + break;
212.103 + }
212.104 + emitLineTo(rp[kind - 2], rp[kind - 1], true);
212.105 + }
212.106 + }
212.107 +
212.108 + this.cmx = (lp[kind - 2] - rp[kind - 2]) / 2;
212.109 + this.cmy = (lp[kind - 1] - rp[kind - 1]) / 2;
212.110 + this.cdx = dxf;
212.111 + this.cdy = dyf;
212.112 + this.cx0 = xf;
212.113 + this.cy0 = yf;
212.114 + this.prev = DRAWING_OP_TO;
212.115 }
212.116
212.117 @Override public void quadTo(float x1, float y1, float x2, float y2) {
212.118 middle[0] = cx0; middle[1] = cy0;
212.119 middle[2] = x1; middle[3] = y1;
212.120 middle[4] = x2; middle[5] = y2;
212.121 - somethingTo(6);
212.122 +
212.123 + // inlined version of somethingTo(8);
212.124 + // See the TODO on somethingTo
212.125 +
212.126 + // need these so we can update the state at the end of this method
212.127 + final float xf = middle[4], yf = middle[5];
212.128 + float dxs = middle[2] - middle[0];
212.129 + float dys = middle[3] - middle[1];
212.130 + float dxf = middle[4] - middle[2];
212.131 + float dyf = middle[5] - middle[3];
212.132 + if ((dxs == 0f && dys == 0f) || (dxf == 0f && dyf == 0f)) {
212.133 + dxs = dxf = middle[4] - middle[0];
212.134 + dys = dyf = middle[5] - middle[1];
212.135 + }
212.136 + if (dxs == 0f && dys == 0f) {
212.137 + // this happens iff the "curve" is just a point
212.138 + lineTo(middle[0], middle[1]);
212.139 + return;
212.140 + }
212.141 + // if these vectors are too small, normalize them, to avoid future
212.142 + // precision problems.
212.143 + if (Math.abs(dxs) < 0.1f && Math.abs(dys) < 0.1f) {
212.144 + float len = (float)Math.sqrt(dxs*dxs + dys*dys);
212.145 + dxs /= len;
212.146 + dys /= len;
212.147 + }
212.148 + if (Math.abs(dxf) < 0.1f && Math.abs(dyf) < 0.1f) {
212.149 + float len = (float)Math.sqrt(dxf*dxf + dyf*dyf);
212.150 + dxf /= len;
212.151 + dyf /= len;
212.152 + }
212.153 +
212.154 + computeOffset(dxs, dys, lineWidth2, offset[0]);
212.155 + final float mx = offset[0][0];
212.156 + final float my = offset[0][1];
212.157 + drawJoin(cdx, cdy, cx0, cy0, dxs, dys, cmx, cmy, mx, my);
212.158 +
212.159 + int nSplits = findSubdivPoints(middle, subdivTs, 6, lineWidth2);
212.160 +
212.161 + int kind = 0;
212.162 + Iterator<Integer> it = Curve.breakPtsAtTs(middle, 6, subdivTs, nSplits);
212.163 + while(it.hasNext()) {
212.164 + int curCurveOff = it.next();
212.165 +
212.166 + kind = computeOffsetQuad(middle, curCurveOff, lp, rp);
212.167 + if (kind != 0) {
212.168 + emitLineTo(lp[0], lp[1]);
212.169 + switch(kind) {
212.170 + case 6:
212.171 + emitQuadTo(lp[0], lp[1], lp[2], lp[3], lp[4], lp[5], false);
212.172 + emitQuadTo(rp[0], rp[1], rp[2], rp[3], rp[4], rp[5], true);
212.173 + break;
212.174 + case 4:
212.175 + emitLineTo(lp[2], lp[3]);
212.176 + emitLineTo(rp[0], rp[1], true);
212.177 + break;
212.178 + }
212.179 + emitLineTo(rp[kind - 2], rp[kind - 1], true);
212.180 + }
212.181 + }
212.182 +
212.183 + this.cmx = (lp[kind - 2] - rp[kind - 2]) / 2;
212.184 + this.cmy = (lp[kind - 1] - rp[kind - 1]) / 2;
212.185 + this.cdx = dxf;
212.186 + this.cdy = dyf;
212.187 + this.cx0 = xf;
212.188 + this.cy0 = yf;
212.189 + this.prev = DRAWING_OP_TO;
212.190 + }
212.191 +
212.192 + @Override public long getNativeConsumer() {
212.193 + throw new InternalError("Stroker doesn't use a native consumer");
212.194 }
212.195
212.196 // a stack of polynomial curves where each curve shares endpoints with
213.1 --- a/src/share/classes/sun/launcher/LauncherHelper.java Tue Mar 29 11:29:01 2011 -0700
213.2 +++ b/src/share/classes/sun/launcher/LauncherHelper.java Tue Mar 29 20:19:55 2011 -0700
213.3 @@ -42,10 +42,12 @@
213.4 import java.io.File;
213.5 import java.io.IOException;
213.6 import java.io.PrintStream;
213.7 +import java.io.UnsupportedEncodingException;
213.8 import java.lang.reflect.Method;
213.9 import java.lang.reflect.Modifier;
213.10 import java.math.BigDecimal;
213.11 import java.math.RoundingMode;
213.12 +import java.nio.charset.Charset;
213.13 import java.util.ResourceBundle;
213.14 import java.text.MessageFormat;
213.15 import java.util.ArrayList;
213.16 @@ -471,11 +473,11 @@
213.17 } catch (ClassNotFoundException cnfe) {
213.18 abort(ostream, cnfe, "java.launcher.cls.error1", cn);
213.19 }
213.20 - signatureDiagnostic(ostream, c);
213.21 + getMainMethod(ostream, c);
213.22 return c;
213.23 }
213.24
213.25 - static void signatureDiagnostic(PrintStream ostream, Class<?> clazz) {
213.26 + static Method getMainMethod(PrintStream ostream, Class<?> clazz) {
213.27 String classname = clazz.getName();
213.28 Method method = null;
213.29 try {
213.30 @@ -495,6 +497,31 @@
213.31 if (method.getReturnType() != java.lang.Void.TYPE) {
213.32 abort(ostream, null, "java.launcher.cls.error3", classname);
213.33 }
213.34 - return;
213.35 + return method;
213.36 + }
213.37 +
213.38 + private static final String encprop = "sun.jnu.encoding";
213.39 + private static String encoding = null;
213.40 + private static boolean isCharsetSupported = false;
213.41 +
213.42 + /*
213.43 + * converts a c or a byte array to a platform specific string,
213.44 + * previously implemented as a native method in the launcher.
213.45 + */
213.46 + static String makePlatformString(boolean printToStderr, byte[] inArray) {
213.47 + final PrintStream ostream = (printToStderr) ? System.err : System.out;
213.48 + if (encoding == null) {
213.49 + encoding = System.getProperty(encprop);
213.50 + isCharsetSupported = Charset.isSupported(encoding);
213.51 + }
213.52 + try {
213.53 + String out = isCharsetSupported
213.54 + ? new String(inArray, encoding)
213.55 + : new String(inArray);
213.56 + return out;
213.57 + } catch (UnsupportedEncodingException uee) {
213.58 + abort(ostream, uee, null);
213.59 + }
213.60 + return null; // keep the compiler happy
213.61 }
213.62 }
214.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
214.2 +++ b/src/share/classes/sun/misc/JavaSecurityAccess.java Tue Mar 29 20:19:55 2011 -0700
214.3 @@ -0,0 +1,40 @@
214.4 +/*
214.5 + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
214.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
214.7 + *
214.8 + * This code is free software; you can redistribute it and/or modify it
214.9 + * under the terms of the GNU General Public License version 2 only, as
214.10 + * published by the Free Software Foundation. Oracle designates this
214.11 + * particular file as subject to the "Classpath" exception as provided
214.12 + * by Oracle in the LICENSE file that accompanied this code.
214.13 + *
214.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
214.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
214.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
214.17 + * version 2 for more details (a copy is included in the LICENSE file that
214.18 + * accompanied this code).
214.19 + *
214.20 + * You should have received a copy of the GNU General Public License version
214.21 + * 2 along with this work; if not, write to the Free Software Foundation,
214.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
214.23 + *
214.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
214.25 + * or visit www.oracle.com if you need additional information or have any
214.26 + * questions.
214.27 + */
214.28 +
214.29 +package sun.misc;
214.30 +
214.31 +import java.security.AccessControlContext;
214.32 +import java.security.PrivilegedAction;
214.33 +
214.34 +public interface JavaSecurityAccess {
214.35 +
214.36 + <T> T doIntersectionPrivilege(PrivilegedAction<T> action,
214.37 + AccessControlContext stack,
214.38 + AccessControlContext context);
214.39 +
214.40 + <T> T doIntersectionPrivilege(PrivilegedAction<T> action,
214.41 + AccessControlContext context);
214.42 +
214.43 +}
215.1 --- a/src/share/classes/sun/misc/SharedSecrets.java Tue Mar 29 11:29:01 2011 -0700
215.2 +++ b/src/share/classes/sun/misc/SharedSecrets.java Tue Mar 29 20:19:55 2011 -0700
215.3 @@ -30,6 +30,8 @@
215.4 import java.io.FileDescriptor;
215.5 import java.security.ProtectionDomain;
215.6
215.7 +import java.security.AccessController;
215.8 +
215.9 /** A repository of "shared secrets", which are a mechanism for
215.10 calling implementation-private methods in another package without
215.11 using reflection. A package-private class implements a public
215.12 @@ -48,6 +50,7 @@
215.13 private static JavaNioAccess javaNioAccess;
215.14 private static JavaIOFileDescriptorAccess javaIOFileDescriptorAccess;
215.15 private static JavaSecurityProtectionDomainAccess javaSecurityProtectionDomainAccess;
215.16 + private static JavaSecurityAccess javaSecurityAccess;
215.17
215.18 public static JavaUtilJarAccess javaUtilJarAccess() {
215.19 if (javaUtilJarAccess == null) {
215.20 @@ -125,4 +128,15 @@
215.21 unsafe.ensureClassInitialized(ProtectionDomain.class);
215.22 return javaSecurityProtectionDomainAccess;
215.23 }
215.24 +
215.25 + public static void setJavaSecurityAccess(JavaSecurityAccess jsa) {
215.26 + javaSecurityAccess = jsa;
215.27 + }
215.28 +
215.29 + public static JavaSecurityAccess getJavaSecurityAccess() {
215.30 + if (javaSecurityAccess == null) {
215.31 + unsafe.ensureClassInitialized(AccessController.class);
215.32 + }
215.33 + return javaSecurityAccess;
215.34 + }
215.35 }
216.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
216.2 +++ b/src/share/classes/sun/net/ResourceManager.java Tue Mar 29 20:19:55 2011 -0700
216.3 @@ -0,0 +1,82 @@
216.4 +/*
216.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
216.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
216.7 + *
216.8 + * This code is free software; you can redistribute it and/or modify it
216.9 + * under the terms of the GNU General Public License version 2 only, as
216.10 + * published by the Free Software Foundation. Oracle designates this
216.11 + * particular file as subject to the "Classpath" exception as provided
216.12 + * by Oracle in the LICENSE file that accompanied this code.
216.13 + *
216.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
216.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
216.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
216.17 + * version 2 for more details (a copy is included in the LICENSE file that
216.18 + * accompanied this code).
216.19 + *
216.20 + * You should have received a copy of the GNU General Public License version
216.21 + * 2 along with this work; if not, write to the Free Software Foundation,
216.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
216.23 + *
216.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
216.25 + * or visit www.oracle.com if you need additional information or have any
216.26 + * questions.
216.27 + */
216.28 +
216.29 +package sun.net;
216.30 +
216.31 +import java.net.SocketException;
216.32 +import java.util.concurrent.atomic.AtomicInteger;
216.33 +import sun.security.action.GetPropertyAction;
216.34 +
216.35 +/**
216.36 + * Manages count of total number of UDP sockets and ensures
216.37 + * that exception is thrown if we try to create more than the
216.38 + * configured limit.
216.39 + *
216.40 + * This functionality could be put in NetHooks some time in future.
216.41 + */
216.42 +
216.43 +public class ResourceManager {
216.44 +
216.45 + /* default maximum number of udp sockets per VM
216.46 + * when a security manager is enabled.
216.47 + * The default is 1024 which is high enough to be useful
216.48 + * but low enough to be well below the maximum number
216.49 + * of port numbers actually available on all OSes for
216.50 + * such sockets (5000 on some versions of windows)
216.51 + */
216.52 +
216.53 + private static final int DEFAULT_MAX_SOCKETS = 1024;
216.54 + private static final int maxSockets;
216.55 + private static final AtomicInteger numSockets;
216.56 +
216.57 + static {
216.58 + String prop = java.security.AccessController.doPrivileged(
216.59 + new GetPropertyAction("sun.net.maxDatagramSockets")
216.60 + );
216.61 + int defmax = DEFAULT_MAX_SOCKETS;
216.62 + try {
216.63 + if (prop != null) {
216.64 + defmax = Integer.parseInt(prop);
216.65 + }
216.66 + } catch (NumberFormatException e) {}
216.67 + maxSockets = defmax;
216.68 + numSockets = new AtomicInteger(0);
216.69 + }
216.70 +
216.71 + public static void beforeUdpCreate() throws SocketException {
216.72 + if (System.getSecurityManager() != null) {
216.73 + if (numSockets.incrementAndGet() > maxSockets) {
216.74 + numSockets.decrementAndGet();
216.75 + throw new SocketException("maximum number of DatagramSockets reached");
216.76 + }
216.77 + }
216.78 + }
216.79 +
216.80 + public static void afterUdpClose() {
216.81 + if (System.getSecurityManager() != null) {
216.82 + numSockets.decrementAndGet();
216.83 + }
216.84 + }
216.85 +}
217.1 --- a/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Tue Mar 29 11:29:01 2011 -0700
217.2 +++ b/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Tue Mar 29 20:19:55 2011 -0700
217.3 @@ -2173,6 +2173,13 @@
217.4 if (tryTransparentNTLMServer) {
217.5 tryTransparentNTLMServer =
217.6 NTLMAuthenticationProxy.proxy.supportsTransparentAuth;
217.7 + /* If the platform supports transparent authentication
217.8 + * then check if we are in a secure environment
217.9 + * whether, or not, we should try transparent authentication.*/
217.10 + if (tryTransparentNTLMServer) {
217.11 + tryTransparentNTLMServer =
217.12 + NTLMAuthenticationProxy.proxy.isTrustedSite(url);
217.13 + }
217.14 }
217.15 a = null;
217.16 if (tryTransparentNTLMServer) {
218.1 --- a/src/share/classes/sun/net/www/protocol/http/NTLMAuthenticationProxy.java Tue Mar 29 11:29:01 2011 -0700
218.2 +++ b/src/share/classes/sun/net/www/protocol/http/NTLMAuthenticationProxy.java Tue Mar 29 20:19:55 2011 -0700
218.3 @@ -36,12 +36,14 @@
218.4 */
218.5 class NTLMAuthenticationProxy {
218.6 private static Method supportsTA;
218.7 + private static Method isTrustedSite;
218.8 private static final String clazzStr = "sun.net.www.protocol.http.ntlm.NTLMAuthentication";
218.9 private static final String supportsTAStr = "supportsTransparentAuth";
218.10 + private static final String isTrustedSiteStr = "isTrustedSite";
218.11
218.12 static final NTLMAuthenticationProxy proxy = tryLoadNTLMAuthentication();
218.13 static final boolean supported = proxy != null ? true : false;
218.14 - static final boolean supportsTransparentAuth = supported ? supportsTransparentAuth(supportsTA) : false;
218.15 + static final boolean supportsTransparentAuth = supported ? supportsTransparentAuth() : false;
218.16
218.17 private final Constructor<? extends AuthenticationInfo> threeArgCtr;
218.18 private final Constructor<? extends AuthenticationInfo> fiveArgCtr;
218.19 @@ -82,9 +84,22 @@
218.20 * authentication (try with the current users credentials before
218.21 * prompting for username and password, etc).
218.22 */
218.23 - private static boolean supportsTransparentAuth(Method method) {
218.24 + private static boolean supportsTransparentAuth() {
218.25 try {
218.26 - return (Boolean)method.invoke(null);
218.27 + return (Boolean)supportsTA.invoke(null);
218.28 + } catch (ReflectiveOperationException roe) {
218.29 + finest(roe);
218.30 + }
218.31 +
218.32 + return false;
218.33 + }
218.34 +
218.35 + /* Transparent authentication should only be tried with a trusted
218.36 + * site ( when running in a secure environment ).
218.37 + */
218.38 + public static boolean isTrustedSite(URL url) {
218.39 + try {
218.40 + return (Boolean)isTrustedSite.invoke(null, url);
218.41 } catch (ReflectiveOperationException roe) {
218.42 finest(roe);
218.43 }
218.44 @@ -112,6 +127,7 @@
218.45 int.class,
218.46 PasswordAuthentication.class);
218.47 supportsTA = cl.getDeclaredMethod(supportsTAStr);
218.48 + isTrustedSite = cl.getDeclaredMethod(isTrustedSiteStr, java.net.URL.class);
218.49 return new NTLMAuthenticationProxy(threeArg,
218.50 fiveArg);
218.51 }
219.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
219.2 +++ b/src/share/classes/sun/net/www/protocol/http/ntlm/NTLMAuthenticationCallback.java Tue Mar 29 20:19:55 2011 -0700
219.3 @@ -0,0 +1,59 @@
219.4 +/*
219.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
219.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
219.7 + *
219.8 + * This code is free software; you can redistribute it and/or modify it
219.9 + * under the terms of the GNU General Public License version 2 only, as
219.10 + * published by the Free Software Foundation. Oracle designates this
219.11 + * particular file as subject to the "Classpath" exception as provided
219.12 + * by Oracle in the LICENSE file that accompanied this code.
219.13 + *
219.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
219.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
219.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
219.17 + * version 2 for more details (a copy is included in the LICENSE file that
219.18 + * accompanied this code).
219.19 + *
219.20 + * You should have received a copy of the GNU General Public License version
219.21 + * 2 along with this work; if not, write to the Free Software Foundation,
219.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
219.23 + *
219.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
219.25 + * or visit www.oracle.com if you need additional information or have any
219.26 + * questions.
219.27 + */
219.28 +
219.29 +package sun.net.www.protocol.http.ntlm;
219.30 +
219.31 +import java.net.URL;
219.32 +
219.33 +/**
219.34 + * This class is used to call back to deployment to determine if a given
219.35 + * URL is trusted. Transparent authentication (try with logged in users
219.36 + * credentials without prompting) should only be tried with trusted sites.
219.37 + */
219.38 +public abstract class NTLMAuthenticationCallback {
219.39 + private static volatile NTLMAuthenticationCallback callback =
219.40 + new DefaultNTLMAuthenticationCallback();
219.41 +
219.42 + public static void setNTLMAuthenticationCallback(
219.43 + NTLMAuthenticationCallback callback) {
219.44 + NTLMAuthenticationCallback.callback = callback;
219.45 + }
219.46 +
219.47 + public static NTLMAuthenticationCallback getNTLMAuthenticationCallback() {
219.48 + return callback;
219.49 + }
219.50 +
219.51 + /**
219.52 + * Returns true if the given site is trusted, i.e. we can try
219.53 + * transparent Authentication.
219.54 + */
219.55 + public abstract boolean isTrustedSite(URL url);
219.56 +
219.57 + static class DefaultNTLMAuthenticationCallback extends NTLMAuthenticationCallback {
219.58 + @Override
219.59 + public boolean isTrustedSite(URL url) { return true; }
219.60 + }
219.61 +}
219.62 +
220.1 --- a/src/share/classes/sun/nio/ch/DatagramChannelImpl.java Tue Mar 29 11:29:01 2011 -0700
220.2 +++ b/src/share/classes/sun/nio/ch/DatagramChannelImpl.java Tue Mar 29 20:19:55 2011 -0700
220.3 @@ -32,6 +32,7 @@
220.4 import java.nio.channels.*;
220.5 import java.nio.channels.spi.*;
220.6 import java.util.*;
220.7 +import sun.net.ResourceManager;
220.8
220.9
220.10 /**
220.11 @@ -101,14 +102,22 @@
220.12 throws IOException
220.13 {
220.14 super(sp);
220.15 - this.family = Net.isIPv6Available() ?
220.16 - StandardProtocolFamily.INET6 : StandardProtocolFamily.INET;
220.17 - this.fd = Net.socket(family, false);
220.18 - this.fdVal = IOUtil.fdVal(fd);
220.19 - this.state = ST_UNCONNECTED;
220.20 + ResourceManager.beforeUdpCreate();
220.21 + try {
220.22 + this.family = Net.isIPv6Available() ?
220.23 + StandardProtocolFamily.INET6 : StandardProtocolFamily.INET;
220.24 + this.fd = Net.socket(family, false);
220.25 + this.fdVal = IOUtil.fdVal(fd);
220.26 + this.state = ST_UNCONNECTED;
220.27 + } catch (IOException ioe) {
220.28 + ResourceManager.afterUdpClose();
220.29 + throw ioe;
220.30 + }
220.31 }
220.32
220.33 - public DatagramChannelImpl(SelectorProvider sp, ProtocolFamily family) {
220.34 + public DatagramChannelImpl(SelectorProvider sp, ProtocolFamily family)
220.35 + throws IOException
220.36 + {
220.37 super(sp);
220.38 if ((family != StandardProtocolFamily.INET) &&
220.39 (family != StandardProtocolFamily.INET6))
220.40 @@ -755,11 +764,14 @@
220.41 throw new IllegalArgumentException("Group not a multicast address");
220.42
220.43 // check multicast address is compatible with this socket
220.44 - if (!(group instanceof Inet4Address)) {
220.45 - if (family == StandardProtocolFamily.INET)
220.46 - throw new IllegalArgumentException("Group is not IPv4 address");
220.47 - if (!(group instanceof Inet6Address))
220.48 - throw new IllegalArgumentException("Address type not supported");
220.49 + if (group instanceof Inet4Address) {
220.50 + if (family == StandardProtocolFamily.INET6 && !Net.canIPv6SocketJoinIPv4Group())
220.51 + throw new IllegalArgumentException("Group is not IPv4 multicast address");
220.52 + } else if (group instanceof Inet6Address) {
220.53 + if (family != StandardProtocolFamily.INET6)
220.54 + throw new IllegalArgumentException("Group is not IPv6 multicast address");
220.55 + } else {
220.56 + throw new IllegalArgumentException("Address type not supported");
220.57 }
220.58
220.59 // check source address
220.60 @@ -791,7 +803,9 @@
220.61 }
220.62
220.63 MembershipKeyImpl key;
220.64 - if (family == StandardProtocolFamily.INET6) {
220.65 + if ((family == StandardProtocolFamily.INET6) &&
220.66 + ((group instanceof Inet6Address) || Net.canJoin6WithIPv4Group()))
220.67 + {
220.68 int index = interf.getIndex();
220.69 if (index == -1)
220.70 throw new IOException("Network interface cannot be identified");
220.71 @@ -861,7 +875,7 @@
220.72 return;
220.73
220.74 try {
220.75 - if (family == StandardProtocolFamily.INET6) {
220.76 + if (key instanceof MembershipKeyImpl.Type6) {
220.77 MembershipKeyImpl.Type6 key6 =
220.78 (MembershipKeyImpl.Type6)key;
220.79 Net.drop6(fd, key6.groupAddress(), key6.index(), key6.source());
220.80 @@ -901,7 +915,7 @@
220.81 throw new IllegalArgumentException("Source address is different type to group");
220.82
220.83 int n;
220.84 - if (family == StandardProtocolFamily.INET6) {
220.85 + if (key instanceof MembershipKeyImpl.Type6) {
220.86 MembershipKeyImpl.Type6 key6 =
220.87 (MembershipKeyImpl.Type6)key;
220.88 n = Net.block6(fd, key6.groupAddress(), key6.index(),
220.89 @@ -931,7 +945,7 @@
220.90 throw new IllegalStateException("key is no longer valid");
220.91
220.92 try {
220.93 - if (family == StandardProtocolFamily.INET6) {
220.94 + if (key instanceof MembershipKeyImpl.Type6) {
220.95 MembershipKeyImpl.Type6 key6 =
220.96 (MembershipKeyImpl.Type6)key;
220.97 Net.unblock6(fd, key6.groupAddress(), key6.index(),
220.98 @@ -952,6 +966,7 @@
220.99 protected void implCloseSelectableChannel() throws IOException {
220.100 synchronized (stateLock) {
220.101 nd.preClose(fd);
220.102 + ResourceManager.afterUdpClose();
220.103
220.104 // if member of mulitcast group then invalidate all keys
220.105 if (registry != null)
221.1 --- a/src/share/classes/sun/nio/ch/Net.java Tue Mar 29 11:29:01 2011 -0700
221.2 +++ b/src/share/classes/sun/nio/ch/Net.java Tue Mar 29 20:19:55 2011 -0700
221.3 @@ -60,6 +60,21 @@
221.4 return isIPv6Available;
221.5 }
221.6
221.7 + /**
221.8 + * Tells whether IPv6 sockets can join IPv4 multicast groups
221.9 + */
221.10 + static boolean canIPv6SocketJoinIPv4Group() {
221.11 + return canIPv6SocketJoinIPv4Group0();
221.12 + }
221.13 +
221.14 + /**
221.15 + * Tells whether {@link #join6} can be used to join an IPv4
221.16 + * multicast group (IPv4 group as IPv4-mapped IPv6 address)
221.17 + */
221.18 + static boolean canJoin6WithIPv4Group() {
221.19 + return canJoin6WithIPv4Group0();
221.20 + }
221.21 +
221.22 static InetSocketAddress checkAddress(SocketAddress sa) {
221.23 if (sa == null)
221.24 throw new NullPointerException();
221.25 @@ -291,13 +306,18 @@
221.26
221.27 // -- Socket operations --
221.28
221.29 - static native boolean isIPv6Available0();
221.30 + private static native boolean isIPv6Available0();
221.31
221.32 - static FileDescriptor socket(boolean stream) {
221.33 + private static native boolean canIPv6SocketJoinIPv4Group0();
221.34 +
221.35 + private static native boolean canJoin6WithIPv4Group0();
221.36 +
221.37 + static FileDescriptor socket(boolean stream) throws IOException {
221.38 return socket(UNSPEC, stream);
221.39 }
221.40
221.41 - static FileDescriptor socket(ProtocolFamily family, boolean stream) {
221.42 + static FileDescriptor socket(ProtocolFamily family, boolean stream)
221.43 + throws IOException {
221.44 boolean preferIPv6 = isIPv6Available() &&
221.45 (family != StandardProtocolFamily.INET);
221.46 return IOUtil.newFD(socket0(preferIPv6, stream, false));
222.1 --- a/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java Tue Mar 29 11:29:01 2011 -0700
222.2 +++ b/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java Tue Mar 29 20:19:55 2011 -0700
222.3 @@ -679,6 +679,14 @@
222.4 "1124"
222.5 });
222.6
222.7 + charset("x-IBM1364", "IBM1364",
222.8 + new String[] {
222.9 + "cp1364",
222.10 + "ibm1364",
222.11 + "ibm-1364",
222.12 + "1364"
222.13 + });
222.14 +
222.15 charset("IBM273", "IBM273",
222.16 new String[] {
222.17 "cp273", // JDK historical
223.1 --- a/src/share/classes/sun/nio/fs/AbstractAclFileAttributeView.java Tue Mar 29 11:29:01 2011 -0700
223.2 +++ b/src/share/classes/sun/nio/fs/AbstractAclFileAttributeView.java Tue Mar 29 20:19:55 2011 -0700
223.3 @@ -57,8 +57,8 @@
223.4 setAcl((List<AclEntry>)value);
223.5 return;
223.6 }
223.7 - throw new UnsupportedOperationException("'" + name() + ":" +
223.8 - attribute + "' not supported");
223.9 + throw new IllegalArgumentException("'" + name() + ":" +
223.10 + attribute + "' not recognized");
223.11 }
223.12
223.13 @Override
223.14 @@ -81,6 +81,8 @@
223.15 owner = true;
223.16 continue;
223.17 }
223.18 + throw new IllegalArgumentException("'" + name() + ":" +
223.19 + attribute + "' not recognized");
223.20 }
223.21 Map<String,Object> result = new HashMap<>(2);
223.22 if (acl)
224.1 --- a/src/share/classes/sun/nio/fs/AbstractBasicFileAttributeView.java Tue Mar 29 11:29:01 2011 -0700
224.2 +++ b/src/share/classes/sun/nio/fs/AbstractBasicFileAttributeView.java Tue Mar 29 20:19:55 2011 -0700
224.3 @@ -46,6 +46,18 @@
224.4 private static final String IS_SYMBOLIC_LINK_NAME = "isSymbolicLink";
224.5 private static final String IS_OTHER_NAME = "isOther";
224.6
224.7 + // the names of the basic attributes
224.8 + static final Set<String> basicAttributeNames =
224.9 + Util.newSet(SIZE_NAME,
224.10 + CREATION_TIME_NAME,
224.11 + LAST_ACCESS_TIME_NAME,
224.12 + LAST_MODIFIED_TIME_NAME,
224.13 + FILE_KEY_NAME,
224.14 + IS_DIRECTORY_NAME,
224.15 + IS_REGULAR_FILE_NAME,
224.16 + IS_SYMBOLIC_LINK_NAME,
224.17 + IS_OTHER_NAME);
224.18 +
224.19 protected AbstractBasicFileAttributeView() { }
224.20
224.21 @Override
224.22 @@ -69,24 +81,26 @@
224.23 setTimes(null, null, (FileTime)value);
224.24 return;
224.25 }
224.26 - throw new UnsupportedOperationException("'" + attribute +
224.27 - "' is unknown or read-only attribute");
224.28 + throw new IllegalArgumentException("'" + name() + ":" +
224.29 + attribute + "' not recognized");
224.30 }
224.31
224.32 /**
224.33 * Used to build a map of attribute name/values.
224.34 */
224.35 static class AttributesBuilder {
224.36 - private Set<String> set = new HashSet<>();
224.37 + private Set<String> names = new HashSet<>();
224.38 private Map<String,Object> map = new HashMap<>();
224.39 private boolean copyAll;
224.40
224.41 - private AttributesBuilder(String[] attributes) {
224.42 - for (String attribute: attributes) {
224.43 - if (attribute.equals("*")) {
224.44 + private AttributesBuilder(Set<String> allowed, String[] requested) {
224.45 + for (String name: requested) {
224.46 + if (name.equals("*")) {
224.47 copyAll = true;
224.48 } else {
224.49 - set.add(attribute);
224.50 + if (!allowed.contains(name))
224.51 + throw new IllegalArgumentException("'" + name + "' not recognized");
224.52 + names.add(name);
224.53 }
224.54 }
224.55 }
224.56 @@ -94,21 +108,19 @@
224.57 /**
224.58 * Creates builder to build up a map of the matching attributes
224.59 */
224.60 - static AttributesBuilder create(String[] attributes) {
224.61 - return new AttributesBuilder(attributes);
224.62 + static AttributesBuilder create(Set<String> allowed, String[] requested) {
224.63 + return new AttributesBuilder(allowed, requested);
224.64 }
224.65
224.66 /**
224.67 * Returns true if the attribute should be returned in the map
224.68 */
224.69 - boolean match(String attribute) {
224.70 - if (copyAll)
224.71 - return true;
224.72 - return set.contains(attribute);
224.73 + boolean match(String name) {
224.74 + return copyAll || names.contains(name);
224.75 }
224.76
224.77 - void add(String attribute, Object value) {
224.78 - map.put(attribute, value);
224.79 + void add(String name, Object value) {
224.80 + map.put(name, value);
224.81 }
224.82
224.83 /**
224.84 @@ -124,7 +136,7 @@
224.85 * Invoked by readAttributes or sub-classes to add all matching basic
224.86 * attributes to the builder
224.87 */
224.88 - final void addBasicAttributesToBuilder(BasicFileAttributes attrs,
224.89 + final void addRequestedBasicAttributes(BasicFileAttributes attrs,
224.90 AttributesBuilder builder)
224.91 {
224.92 if (builder.match(SIZE_NAME))
224.93 @@ -148,9 +160,12 @@
224.94 }
224.95
224.96 @Override
224.97 - public Map<String,Object> readAttributes(String[] attributes) throws IOException {
224.98 - AttributesBuilder builder = AttributesBuilder.create(attributes);
224.99 - addBasicAttributesToBuilder(readAttributes(), builder);
224.100 + public Map<String,Object> readAttributes(String[] requested)
224.101 + throws IOException
224.102 + {
224.103 + AttributesBuilder builder =
224.104 + AttributesBuilder.create(basicAttributeNames, requested);
224.105 + addRequestedBasicAttributes(readAttributes(), builder);
224.106 return builder.unmodifiableMap();
224.107 }
224.108 }
225.1 --- a/src/share/classes/sun/nio/fs/AbstractFileSystemProvider.java Tue Mar 29 11:29:01 2011 -0700
225.2 +++ b/src/share/classes/sun/nio/fs/AbstractFileSystemProvider.java Tue Mar 29 20:19:55 2011 -0700
225.3 @@ -29,7 +29,6 @@
225.4 import java.nio.file.spi.FileSystemProvider;
225.5 import java.io.IOException;
225.6 import java.util.Map;
225.7 -import java.util.Collections;
225.8
225.9 /**
225.10 * Base implementation class of FileSystemProvider
225.11 @@ -72,6 +71,8 @@
225.12 throws IOException
225.13 {
225.14 String[] s = split(attribute);
225.15 + if (s[0].length() == 0)
225.16 + throw new IllegalArgumentException(attribute);
225.17 DynamicFileAttributeView view = getFileAttributeView(file, s[0], options);
225.18 if (view == null)
225.19 throw new UnsupportedOperationException("View '" + s[0] + "' not available");
225.20 @@ -83,9 +84,11 @@
225.21 throws IOException
225.22 {
225.23 String[] s = split(attributes);
225.24 + if (s[0].length() == 0)
225.25 + throw new IllegalArgumentException(attributes);
225.26 DynamicFileAttributeView view = getFileAttributeView(file, s[0], options);
225.27 if (view == null)
225.28 - return Collections.emptyMap();
225.29 + throw new UnsupportedOperationException("View '" + s[0] + "' not available");
225.30 return view.readAttributes(s[1].split(","));
225.31 }
225.32
226.1 --- a/src/share/classes/sun/nio/fs/AbstractUserDefinedFileAttributeView.java Tue Mar 29 11:29:01 2011 -0700
226.2 +++ b/src/share/classes/sun/nio/fs/AbstractUserDefinedFileAttributeView.java Tue Mar 29 20:19:55 2011 -0700
226.3 @@ -59,22 +59,6 @@
226.4 return "user";
226.5 }
226.6
226.7 - private Object getAttribute(String attribute) throws IOException {
226.8 - int size;
226.9 - try {
226.10 - size = size(attribute);
226.11 - } catch (IOException e) {
226.12 - // not found or some other I/O error
226.13 - if (list().contains(attribute))
226.14 - throw e;
226.15 - return null;
226.16 - }
226.17 -
226.18 - byte[] buf = new byte[size];
226.19 - int n = read(attribute, ByteBuffer.wrap(buf));
226.20 - return (n == size) ? buf : Arrays.copyOf(buf, n);
226.21 - }
226.22 -
226.23 @Override
226.24 public final void setAttribute(String attribute, Object value)
226.25 throws IOException
226.26 @@ -94,12 +78,13 @@
226.27 {
226.28 // names of attributes to return
226.29 List<String> names = new ArrayList<>();
226.30 -
226.31 for (String name: attributes) {
226.32 if (name.equals("*")) {
226.33 names = list();
226.34 break;
226.35 } else {
226.36 + if (name.length() == 0)
226.37 + throw new IllegalArgumentException();
226.38 names.add(name);
226.39 }
226.40 }
226.41 @@ -107,11 +92,12 @@
226.42 // read each value and return in map
226.43 Map<String,Object> result = new HashMap<>();
226.44 for (String name: names) {
226.45 - Object value = getAttribute(name);
226.46 - if (value != null)
226.47 - result.put(name, value);
226.48 + int size = size(name);
226.49 + byte[] buf = new byte[size];
226.50 + int n = read(name, ByteBuffer.wrap(buf));
226.51 + byte[] value = (n == size) ? buf : Arrays.copyOf(buf, n);
226.52 + result.put(name, value);
226.53 }
226.54 -
226.55 return result;
226.56 }
226.57 }
227.1 --- a/src/share/classes/sun/nio/fs/AbstractWatchKey.java Tue Mar 29 11:29:01 2011 -0700
227.2 +++ b/src/share/classes/sun/nio/fs/AbstractWatchKey.java Tue Mar 29 20:19:55 2011 -0700
227.3 @@ -81,7 +81,8 @@
227.4 /**
227.5 * Return the original watchable (Path)
227.6 */
227.7 - Path watchable() {
227.8 + @Override
227.9 + public Path watchable() {
227.10 return dir;
227.11 }
227.12
228.1 --- a/src/share/classes/sun/nio/fs/FileOwnerAttributeViewImpl.java Tue Mar 29 11:29:01 2011 -0700
228.2 +++ b/src/share/classes/sun/nio/fs/FileOwnerAttributeViewImpl.java Tue Mar 29 20:19:55 2011 -0700
228.3 @@ -63,10 +63,10 @@
228.4 {
228.5 if (attribute.equals(OWNER_NAME)) {
228.6 setOwner((UserPrincipal)value);
228.7 - return;
228.8 + } else {
228.9 + throw new IllegalArgumentException("'" + name() + ":" +
228.10 + attribute + "' not recognized");
228.11 }
228.12 - throw new UnsupportedOperationException("'" + name() + ":" +
228.13 - attribute + "' not supported");
228.14 }
228.15
228.16 @Override
228.17 @@ -75,6 +75,9 @@
228.18 for (String attribute: attributes) {
228.19 if (attribute.equals("*") || attribute.equals(OWNER_NAME)) {
228.20 result.put(OWNER_NAME, getOwner());
228.21 + } else {
228.22 + throw new IllegalArgumentException("'" + name() + ":" +
228.23 + attribute + "' not recognized");
228.24 }
228.25 }
228.26 return result;
229.1 --- a/src/share/classes/sun/nio/fs/Util.java Tue Mar 29 11:29:01 2011 -0700
229.2 +++ b/src/share/classes/sun/nio/fs/Util.java Tue Mar 29 20:19:55 2011 -0700
229.3 @@ -25,6 +25,8 @@
229.4
229.5 package sun.nio.fs;
229.6
229.7 +import java.util.*;
229.8 +
229.9 /**
229.10 * Utility methods
229.11 */
229.12 @@ -54,6 +56,28 @@
229.13 }
229.14 result[n] = s.substring(last, s.length());
229.15 return result;
229.16 + }
229.17
229.18 + /**
229.19 + * Returns a Set containing the given elements.
229.20 + */
229.21 + static <E> Set<E> newSet(E... elements) {
229.22 + HashSet<E> set = new HashSet<>();
229.23 + for (E e: elements) {
229.24 + set.add(e);
229.25 + }
229.26 + return set;
229.27 + }
229.28 +
229.29 + /**
229.30 + * Returns a Set containing all the elements of the given Set plus
229.31 + * the given elements.
229.32 + */
229.33 + static <E> Set<E> newSet(Set<E> other, E... elements) {
229.34 + HashSet<E> set = new HashSet<>(other);
229.35 + for (E e: elements) {
229.36 + set.add(e);
229.37 + }
229.38 + return set;
229.39 }
229.40 }
230.1 --- a/src/share/classes/sun/security/pkcs11/P11Key.java Tue Mar 29 11:29:01 2011 -0700
230.2 +++ b/src/share/classes/sun/security/pkcs11/P11Key.java Tue Mar 29 20:19:55 2011 -0700
230.3 @@ -999,18 +999,34 @@
230.4 new CK_ATTRIBUTE(CKA_EC_PARAMS),
230.5 };
230.6 fetchAttributes(attributes);
230.7 +
230.8 try {
230.9 params = P11ECKeyFactory.decodeParameters
230.10 (attributes[1].getByteArray());
230.11 - DerValue wECPoint = new DerValue(attributes[0].getByteArray());
230.12 - if (wECPoint.getTag() != DerValue.tag_OctetString)
230.13 - throw new IOException("Unexpected tag: " +
230.14 - wECPoint.getTag());
230.15 - params = P11ECKeyFactory.decodeParameters
230.16 - (attributes[1].getByteArray());
230.17 - w = P11ECKeyFactory.decodePoint
230.18 - (wECPoint.getDataBytes(), params.getCurve());
230.19
230.20 + /*
230.21 + * An uncompressed EC point may be in either of two formats.
230.22 + * First try the OCTET STRING encoding:
230.23 + * 04 <length> 04 <X-coordinate> <Y-coordinate>
230.24 + *
230.25 + * Otherwise try the raw encoding:
230.26 + * 04 <X-coordinate> <Y-coordinate>
230.27 + */
230.28 + byte[] ecKey = attributes[0].getByteArray();
230.29 +
230.30 + try {
230.31 + DerValue wECPoint = new DerValue(ecKey);
230.32 + if (wECPoint.getTag() != DerValue.tag_OctetString)
230.33 + throw new IOException("Unexpected tag: " +
230.34 + wECPoint.getTag());
230.35 +
230.36 + w = P11ECKeyFactory.decodePoint
230.37 + (wECPoint.getDataBytes(), params.getCurve());
230.38 +
230.39 + } catch (IOException e) {
230.40 + // Failover
230.41 + w = P11ECKeyFactory.decodePoint(ecKey, params.getCurve());
230.42 + }
230.43
230.44 } catch (Exception e) {
230.45 throw new RuntimeException("Could not parse key values", e);
231.1 --- a/src/share/classes/sun/security/provider/certpath/AdaptableX509CertSelector.java Tue Mar 29 11:29:01 2011 -0700
231.2 +++ b/src/share/classes/sun/security/provider/certpath/AdaptableX509CertSelector.java Tue Mar 29 20:19:55 2011 -0700
231.3 @@ -46,10 +46,16 @@
231.4 */
231.5 class AdaptableX509CertSelector extends X509CertSelector {
231.6 // The start date of a validity period.
231.7 - private Date startDate = null;
231.8 + private Date startDate;
231.9
231.10 // The end date of a validity period.
231.11 - private Date endDate = null;
231.12 + private Date endDate;
231.13 +
231.14 + // Is subject key identifier sensitive?
231.15 + private boolean isSKIDSensitive = false;
231.16 +
231.17 + // Is serial number sensitive?
231.18 + private boolean isSNSensitive = false;
231.19
231.20 AdaptableX509CertSelector() {
231.21 super();
231.22 @@ -97,15 +103,24 @@
231.23 if (akidext != null) {
231.24 KeyIdentifier akid = (KeyIdentifier)akidext.get(akidext.KEY_ID);
231.25 if (akid != null) {
231.26 - DerOutputStream derout = new DerOutputStream();
231.27 - derout.putOctetString(akid.getIdentifier());
231.28 - super.setSubjectKeyIdentifier(derout.toByteArray());
231.29 + // Do not override the previous setting for initial selection.
231.30 + if (isSKIDSensitive || getSubjectKeyIdentifier() == null) {
231.31 + DerOutputStream derout = new DerOutputStream();
231.32 + derout.putOctetString(akid.getIdentifier());
231.33 + super.setSubjectKeyIdentifier(derout.toByteArray());
231.34 +
231.35 + isSKIDSensitive = true;
231.36 + }
231.37 }
231.38
231.39 SerialNumber asn =
231.40 (SerialNumber)akidext.get(akidext.SERIAL_NUMBER);
231.41 if (asn != null) {
231.42 - super.setSerialNumber(asn.getNumber());
231.43 + // Do not override the previous setting for initial selection.
231.44 + if (isSNSensitive || getSerialNumber() == null) {
231.45 + super.setSerialNumber(asn.getNumber());
231.46 + isSNSensitive = true;
231.47 + }
231.48 }
231.49
231.50 // the subject criterion should be set by the caller.
231.51 @@ -148,11 +163,25 @@
231.52 }
231.53 }
231.54
231.55 - if (version < 3 || xcert.getExtensionValue("2.5.29.14") == null) {
231.56 - // If no SubjectKeyIdentifier extension, don't bother to check it.
231.57 + // If no SubjectKeyIdentifier extension, don't bother to check it.
231.58 + if (isSKIDSensitive &&
231.59 + (version < 3 || xcert.getExtensionValue("2.5.29.14") == null)) {
231.60 setSubjectKeyIdentifier(null);
231.61 }
231.62
231.63 + // In practice, a CA may replace its root certificate and require that
231.64 + // the existing certificate is still valid, even if the AKID extension
231.65 + // does not match the replacement root certificate fields.
231.66 + //
231.67 + // Conservatively, we only support the replacement for version 1 and
231.68 + // version 2 certificate. As for version 2, the certificate extension
231.69 + // may contain sensitive information (for example, policies), the
231.70 + // AKID need to be respected to seek the exact certificate in case
231.71 + // of key or certificate abuse.
231.72 + if (isSNSensitive && version < 3) {
231.73 + setSerialNumber(null);
231.74 + }
231.75 +
231.76 return super.match(cert);
231.77 }
231.78
232.1 --- a/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java Tue Mar 29 11:29:01 2011 -0700
232.2 +++ b/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java Tue Mar 29 20:19:55 2011 -0700
232.3 @@ -243,12 +243,6 @@
232.4 caTargetSelector.setPolicy(getMatchingPolicies());
232.5 }
232.6
232.7 - /*
232.8 - * Require CA certs with a pathLenConstraint that allows
232.9 - * at least as many CA certs that have already been traversed
232.10 - */
232.11 - caTargetSelector.setBasicConstraints(currentState.traversedCACerts);
232.12 -
232.13 sel = caTargetSelector;
232.14 } else {
232.15
232.16 @@ -283,12 +277,6 @@
232.17 (caSelector, currentState.subjectNamesTraversed);
232.18
232.19 /*
232.20 - * Require CA certs with a pathLenConstraint that allows
232.21 - * at least as many CA certs that have already been traversed
232.22 - */
232.23 - caSelector.setBasicConstraints(currentState.traversedCACerts);
232.24 -
232.25 - /*
232.26 * Facilitate certification path construction with authority
232.27 * key identifier and subject key identifier.
232.28 */
232.29 @@ -305,6 +293,14 @@
232.30 sel = caSelector;
232.31 }
232.32
232.33 + /*
232.34 + * For compatibility, conservatively, we don't check the path
232.35 + * length constraint of trusted anchors. Please don't set the
232.36 + * basic constraints criterion unless the trusted certificate
232.37 + * matching is completed.
232.38 + */
232.39 + sel.setBasicConstraints(-1);
232.40 +
232.41 for (X509Certificate trustedCert : trustedCerts) {
232.42 if (sel.match(trustedCert)) {
232.43 if (debug != null) {
232.44 @@ -324,6 +320,12 @@
232.45 sel.setCertificateValid(date);
232.46
232.47 /*
232.48 + * Require CA certs with a pathLenConstraint that allows
232.49 + * at least as many CA certs that have already been traversed
232.50 + */
232.51 + sel.setBasicConstraints(currentState.traversedCACerts);
232.52 +
232.53 + /*
232.54 * If we have already traversed as many CA certs as the maxPathLength
232.55 * will allow us to, then we don't bother looking through these
232.56 * certificate pairs. If maxPathLength has a value of -1, this
233.1 --- a/src/share/classes/sun/security/ssl/ClientHandshaker.java Tue Mar 29 11:29:01 2011 -0700
233.2 +++ b/src/share/classes/sun/security/ssl/ClientHandshaker.java Tue Mar 29 20:19:55 2011 -0700
233.3 @@ -1,5 +1,5 @@
233.4 /*
233.5 - * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
233.6 + * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
233.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
233.8 *
233.9 * This code is free software; you can redistribute it and/or modify it
233.10 @@ -377,8 +377,9 @@
233.11 ProtocolVersion mesgVersion = mesg.protocolVersion;
233.12 if (!isNegotiable(mesgVersion)) {
233.13 throw new SSLHandshakeException(
233.14 - "Server chose unsupported or disabled protocol: " +
233.15 - mesgVersion);
233.16 + "Server chose " + mesgVersion +
233.17 + ", but that protocol version is not enabled or not supported " +
233.18 + "by the client.");
233.19 }
233.20
233.21 handshakeHash.protocolDetermined(mesgVersion);
234.1 --- a/src/share/classes/sun/security/ssl/SunJSSE.java Tue Mar 29 11:29:01 2011 -0700
234.2 +++ b/src/share/classes/sun/security/ssl/SunJSSE.java Tue Mar 29 20:19:55 2011 -0700
234.3 @@ -1,5 +1,5 @@
234.4 /*
234.5 - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
234.6 + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
234.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
234.8 *
234.9 * This code is free software; you can redistribute it and/or modify it
234.10 @@ -195,6 +195,8 @@
234.11 "sun.security.ssl.KeyManagerFactoryImpl$SunX509");
234.12 put("KeyManagerFactory.NewSunX509",
234.13 "sun.security.ssl.KeyManagerFactoryImpl$X509");
234.14 + put("Alg.Alias.KeyManagerFactory.PKIX", "NewSunX509");
234.15 +
234.16 put("TrustManagerFactory.SunX509",
234.17 "sun.security.ssl.TrustManagerFactoryImpl$SimpleFactory");
234.18 put("TrustManagerFactory.PKIX",
235.1 --- a/src/share/classes/sun/util/resources/TimeZoneNames.java Tue Mar 29 11:29:01 2011 -0700
235.2 +++ b/src/share/classes/sun/util/resources/TimeZoneNames.java Tue Mar 29 20:19:55 2011 -0700
235.3 @@ -216,6 +216,7 @@
235.4 {"America/Anchorage", AKST},
235.5 {"AST", AKST},
235.6 {"America/Halifax", AST},
235.7 + {"America/Sitka", AKST},
235.8 {"America/St_Johns", NST},
235.9 {"CNT", NST},
235.10 {"Europe/Paris", CET},
235.11 @@ -392,6 +393,8 @@
235.12 {"America/Mendoza", AGT},
235.13 {"America/Menominee", CST},
235.14 {"America/Merida", CST},
235.15 + {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
235.16 + "Metlakatla Daylight Time", "MeDT"}},
235.17 {"America/Mexico_City", CST},
235.18 {"America/Miquelon", new String[] {"Pierre & Miquelon Standard Time", "PMST",
235.19 "Pierre & Miquelon Daylight Time", "PMDT"}},
236.1 --- a/src/share/classes/sun/util/resources/TimeZoneNames_de.java Tue Mar 29 11:29:01 2011 -0700
236.2 +++ b/src/share/classes/sun/util/resources/TimeZoneNames_de.java Tue Mar 29 20:19:55 2011 -0700
236.3 @@ -216,6 +216,7 @@
236.4 {"America/Anchorage", AKST},
236.5 {"AST", AKST},
236.6 {"America/Halifax", AST},
236.7 + {"America/Sitka", AKST},
236.8 {"America/St_Johns", NST},
236.9 {"CNT", NST},
236.10 {"Europe/Paris", CET},
236.11 @@ -392,6 +393,8 @@
236.12 {"America/Mendoza", AGT},
236.13 {"America/Menominee", CST},
236.14 {"America/Merida", CST},
236.15 + {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
236.16 + "Metlakatla Daylight Time", "MeDT"}},
236.17 {"America/Mexico_City", CST},
236.18 {"America/Miquelon", new String[] {"Pierre & Miquelon Normalzeit", "PMST",
236.19 "Pierre & Miquelon Sommerzeit", "PMDT"}},
237.1 --- a/src/share/classes/sun/util/resources/TimeZoneNames_es.java Tue Mar 29 11:29:01 2011 -0700
237.2 +++ b/src/share/classes/sun/util/resources/TimeZoneNames_es.java Tue Mar 29 20:19:55 2011 -0700
237.3 @@ -216,6 +216,7 @@
237.4 {"America/Anchorage", AKST},
237.5 {"AST", AKST},
237.6 {"America/Halifax", AST},
237.7 + {"America/Sitka", AKST},
237.8 {"America/St_Johns", NST},
237.9 {"CNT", NST},
237.10 {"Europe/Paris", CET},
237.11 @@ -392,6 +393,8 @@
237.12 {"America/Mendoza", AGT},
237.13 {"America/Menominee", CST},
237.14 {"America/Merida", CST},
237.15 + {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
237.16 + "Metlakatla Daylight Time", "MeDT"}},
237.17 {"America/Mexico_City", CST},
237.18 {"America/Miquelon", new String[] {"Hora est\u00e1ndar de Pierre & Miquelon", "PMST",
237.19 "Hora de verano de Pierre & Miquelon", "PMDT"}},
238.1 --- a/src/share/classes/sun/util/resources/TimeZoneNames_fr.java Tue Mar 29 11:29:01 2011 -0700
238.2 +++ b/src/share/classes/sun/util/resources/TimeZoneNames_fr.java Tue Mar 29 20:19:55 2011 -0700
238.3 @@ -216,6 +216,7 @@
238.4 {"America/Anchorage", AKST},
238.5 {"AST", AKST},
238.6 {"America/Halifax", AST},
238.7 + {"America/Sitka", AKST},
238.8 {"America/St_Johns", NST},
238.9 {"CNT", NST},
238.10 {"Europe/Paris", CET},
238.11 @@ -392,6 +393,8 @@
238.12 {"America/Mendoza", AGT},
238.13 {"America/Menominee", CST},
238.14 {"America/Merida", CST},
238.15 + {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
238.16 + "Metlakatla Daylight Time", "MeDT"}},
238.17 {"America/Mexico_City", CST},
238.18 {"America/Miquelon", new String[] {"Heure normale de Saint-Pierre et Miquelon", "PMST",
238.19 "Heure avanc\u00e9e de Saint-Pierre et Miquelon", "PMDT"}},
239.1 --- a/src/share/classes/sun/util/resources/TimeZoneNames_it.java Tue Mar 29 11:29:01 2011 -0700
239.2 +++ b/src/share/classes/sun/util/resources/TimeZoneNames_it.java Tue Mar 29 20:19:55 2011 -0700
239.3 @@ -216,6 +216,7 @@
239.4 {"America/Anchorage", AKST},
239.5 {"AST", AKST},
239.6 {"America/Halifax", AST},
239.7 + {"America/Sitka", AKST},
239.8 {"America/St_Johns", NST},
239.9 {"CNT", NST},
239.10 {"Europe/Paris", CET},
239.11 @@ -392,6 +393,8 @@
239.12 {"America/Mendoza", AGT},
239.13 {"America/Menominee", CST},
239.14 {"America/Merida", CST},
239.15 + {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
239.16 + "Metlakatla Daylight Time", "MeDT"}},
239.17 {"America/Mexico_City", CST},
239.18 {"America/Miquelon", new String[] {"Ora solare di Saint-Pierre e Miquelon", "PMST",
239.19 "Ora legale di Saint-Pierre e Miquelon", "PMDT"}},
240.1 --- a/src/share/classes/sun/util/resources/TimeZoneNames_ja.java Tue Mar 29 11:29:01 2011 -0700
240.2 +++ b/src/share/classes/sun/util/resources/TimeZoneNames_ja.java Tue Mar 29 20:19:55 2011 -0700
240.3 @@ -216,6 +216,7 @@
240.4 {"America/Anchorage", AKST},
240.5 {"AST", AKST},
240.6 {"America/Halifax", AST},
240.7 + {"America/Sitka", AKST},
240.8 {"America/St_Johns", NST},
240.9 {"CNT", NST},
240.10 {"Europe/Paris", CET},
240.11 @@ -392,6 +393,8 @@
240.12 {"America/Mendoza", AGT},
240.13 {"America/Menominee", CST},
240.14 {"America/Merida", CST},
240.15 + {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
240.16 + "Metlakatla Daylight Time", "MeDT"}},
240.17 {"America/Mexico_City", CST},
240.18 {"America/Miquelon", new String[] {"\u30b5\u30f3\u30d4\u30a8\u30fc\u30eb\u30fb\u30df\u30af\u30ed\u30f3\u8af8\u5cf6\u6a19\u6e96\u6642", "PMST",
240.19 "\u30b5\u30f3\u30d4\u30a8\u30fc\u30eb\u30fb\u30df\u30af\u30ed\u30f3\u8af8\u5cf6\u590f\u6642\u9593", "PMDT"}},
241.1 --- a/src/share/classes/sun/util/resources/TimeZoneNames_ko.java Tue Mar 29 11:29:01 2011 -0700
241.2 +++ b/src/share/classes/sun/util/resources/TimeZoneNames_ko.java Tue Mar 29 20:19:55 2011 -0700
241.3 @@ -216,6 +216,7 @@
241.4 {"America/Anchorage", AKST},
241.5 {"AST", AKST},
241.6 {"America/Halifax", AST},
241.7 + {"America/Sitka", AKST},
241.8 {"America/St_Johns", NST},
241.9 {"CNT", NST},
241.10 {"Europe/Paris", CET},
241.11 @@ -392,6 +393,8 @@
241.12 {"America/Mendoza", AGT},
241.13 {"America/Menominee", CST},
241.14 {"America/Merida", CST},
241.15 + {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
241.16 + "Metlakatla Daylight Time", "MeDT"}},
241.17 {"America/Mexico_City", CST},
241.18 {"America/Miquelon", new String[] {"\ud53c\uc5d0\ub974 \ubbf8\ud06c\ub860 \ud45c\uc900\uc2dc", "PMST",
241.19 "\ud53c\uc5d0\ub974 \ubbf8\ud06c\ub860 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "PMDT"}},
242.1 --- a/src/share/classes/sun/util/resources/TimeZoneNames_pt_BR.java Tue Mar 29 11:29:01 2011 -0700
242.2 +++ b/src/share/classes/sun/util/resources/TimeZoneNames_pt_BR.java Tue Mar 29 20:19:55 2011 -0700
242.3 @@ -217,6 +217,7 @@
242.4 {"America/Anchorage", AKST},
242.5 {"AST", AKST},
242.6 {"America/Halifax", AST},
242.7 + {"America/Sitka", AKST},
242.8 {"America/St_Johns", NST},
242.9 {"CNT", NST},
242.10 {"Europe/Paris", CET},
242.11 @@ -392,6 +393,8 @@
242.12 {"America/Mendoza", AGT},
242.13 {"America/Menominee", CST},
242.14 {"America/Merida", CST},
242.15 + {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
242.16 + "Metlakatla Daylight Time", "MeDT"}},
242.17 {"America/Mexico_City", CST},
242.18 {"America/Miquelon", new String[] {"Fuso hor\u00e1rio padr\u00e3o de S\u00e3o Pedro e Miquelon", "PMST",
242.19 "Hor\u00e1rio de luz natural de S\u00e3o Pedro e Miquelon", "PMDT"}},
243.1 --- a/src/share/classes/sun/util/resources/TimeZoneNames_sv.java Tue Mar 29 11:29:01 2011 -0700
243.2 +++ b/src/share/classes/sun/util/resources/TimeZoneNames_sv.java Tue Mar 29 20:19:55 2011 -0700
243.3 @@ -216,6 +216,7 @@
243.4 {"America/Anchorage", AKST},
243.5 {"AST", AKST},
243.6 {"America/Halifax", AST},
243.7 + {"America/Sitka", AKST},
243.8 {"America/St_Johns", NST},
243.9 {"CNT", NST},
243.10 {"Europe/Paris", CET},
243.11 @@ -392,6 +393,8 @@
243.12 {"America/Mendoza", AGT},
243.13 {"America/Menominee", CST},
243.14 {"America/Merida", CST},
243.15 + {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
243.16 + "Metlakatla Daylight Time", "MeDT"}},
243.17 {"America/Mexico_City", CST},
243.18 {"America/Miquelon", new String[] {"Saint-Pierre-et-Miquelon, normaltid", "PMST",
243.19 "Saint-Pierre-et-Miquelon, sommartid", "PMDT"}},
244.1 --- a/src/share/classes/sun/util/resources/TimeZoneNames_zh_CN.java Tue Mar 29 11:29:01 2011 -0700
244.2 +++ b/src/share/classes/sun/util/resources/TimeZoneNames_zh_CN.java Tue Mar 29 20:19:55 2011 -0700
244.3 @@ -216,6 +216,7 @@
244.4 {"America/Anchorage", AKST},
244.5 {"AST", AKST},
244.6 {"America/Halifax", AST},
244.7 + {"America/Sitka", AKST},
244.8 {"America/St_Johns", NST},
244.9 {"CNT", NST},
244.10 {"Europe/Paris", CET},
244.11 @@ -392,6 +393,8 @@
244.12 {"America/Mendoza", AGT},
244.13 {"America/Menominee", CST},
244.14 {"America/Merida", CST},
244.15 + {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
244.16 + "Metlakatla Daylight Time", "MeDT"}},
244.17 {"America/Mexico_City", CST},
244.18 {"America/Miquelon", new String[] {"\u76ae\u57c3\u5c14\u5c9b\u53ca\u5bc6\u514b\u9686\u5c9b\u6807\u51c6\u65f6\u95f4", "PMST",
244.19 "\u76ae\u57c3\u5c14\u5c9b\u53ca\u5bc6\u514b\u9686\u5c9b\u590f\u4ee4\u65f6", "PMDT"}},
245.1 --- a/src/share/classes/sun/util/resources/TimeZoneNames_zh_TW.java Tue Mar 29 11:29:01 2011 -0700
245.2 +++ b/src/share/classes/sun/util/resources/TimeZoneNames_zh_TW.java Tue Mar 29 20:19:55 2011 -0700
245.3 @@ -216,6 +216,7 @@
245.4 {"America/Anchorage", AKST},
245.5 {"AST", AKST},
245.6 {"America/Halifax", AST},
245.7 + {"America/Sitka", AKST},
245.8 {"America/St_Johns", NST},
245.9 {"CNT", NST},
245.10 {"Europe/Paris", CET},
245.11 @@ -392,6 +393,8 @@
245.12 {"America/Mendoza", AGT},
245.13 {"America/Menominee", CST},
245.14 {"America/Merida", CST},
245.15 + {"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
245.16 + "Metlakatla Daylight Time", "MeDT"}},
245.17 {"America/Mexico_City", CST},
245.18 {"America/Miquelon", new String[] {"\u76ae\u57c3\u723e\u5cf6\u53ca\u5bc6\u514b\u9686\u5cf6\u6a19\u6e96\u6642\u9593", "PMST",
245.19 "\u76ae\u57c3\u723e\u5cf6\u53ca\u5bc6\u514b\u9686\u5cf6\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "PMDT"}},
246.1 --- a/src/share/lib/security/java.security Tue Mar 29 11:29:01 2011 -0700
246.2 +++ b/src/share/lib/security/java.security Tue Mar 29 20:19:55 2011 -0700
246.3 @@ -123,7 +123,7 @@
246.4 # passed to checkPackageAccess unless the
246.5 # corresponding RuntimePermission ("accessClassInPackage."+package) has
246.6 # been granted.
246.7 -package.access=sun.,com.sun.imageio.
246.8 +package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.
246.9
246.10 #
246.11 # List of comma-separated packages that start with or equal this string
247.1 --- a/src/share/lib/security/java.security-solaris Tue Mar 29 11:29:01 2011 -0700
247.2 +++ b/src/share/lib/security/java.security-solaris Tue Mar 29 20:19:55 2011 -0700
247.3 @@ -124,7 +124,7 @@
247.4 # passed to checkPackageAccess unless the
247.5 # corresponding RuntimePermission ("accessClassInPackage."+package) has
247.6 # been granted.
247.7 -package.access=sun.,com.sun.imageio.
247.8 +package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.
247.9
247.10 #
247.11 # List of comma-separated packages that start with or equal this string
248.1 --- a/src/share/lib/security/java.security-windows Tue Mar 29 11:29:01 2011 -0700
248.2 +++ b/src/share/lib/security/java.security-windows Tue Mar 29 20:19:55 2011 -0700
248.3 @@ -124,7 +124,7 @@
248.4 # passed to checkPackageAccess unless the
248.5 # corresponding RuntimePermission ("accessClassInPackage."+package) has
248.6 # been granted.
248.7 -package.access=sun.,com.sun.imageio.
248.8 +package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.
248.9
248.10 #
248.11 # List of comma-separated packages that start with or equal this string
249.1 --- a/src/share/native/com/sun/java/util/jar/pack/unpack.cpp Tue Mar 29 11:29:01 2011 -0700
249.2 +++ b/src/share/native/com/sun/java/util/jar/pack/unpack.cpp Tue Mar 29 20:19:55 2011 -0700
249.3 @@ -489,7 +489,6 @@
249.4
249.5 // Call malloc. Try to combine small blocks and free much later.
249.6 void* unpacker::alloc_heap(size_t size, bool smallOK, bool temp) {
249.7 - CHECK_0;
249.8 if (!smallOK || size > SMALL) {
249.9 void* res = must_malloc((int)size);
249.10 (temp ? &tmallocs : &mallocs)->add(res);
249.11 @@ -2560,6 +2559,10 @@
249.12 int i;
249.13 int prevBII = -1;
249.14 int prevBCI = -1;
249.15 + if (body == NULL) {
249.16 + abort("putlayout: unexpected NULL for body");
249.17 + return;
249.18 + }
249.19 for (i = 0; body[i] != null; i++) {
249.20 band& b = *body[i];
249.21 byte le_kind = b.le_kind;
249.22 @@ -4767,7 +4770,9 @@
249.23 }
249.24
249.25 char *tname = tempnam(tmpdir,"#upkg");
249.26 + if (tname == NULL) return;
249.27 sprintf(log_file_name, "%s", tname);
249.28 + ::free(tname);
249.29 if ((errstrm = fopen(log_file_name, "a+")) != NULL) {
249.30 log_file = errstrm_name = saveStr(log_file_name);
249.31 return ;
250.1 --- a/src/share/native/com/sun/media/sound/SoundDefs.h Tue Mar 29 11:29:01 2011 -0700
250.2 +++ b/src/share/native/com/sun/media/sound/SoundDefs.h Tue Mar 29 20:19:55 2011 -0700
250.3 @@ -1,5 +1,5 @@
250.4 /*
250.5 - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
250.6 + * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
250.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
250.8 *
250.9 * This code is free software; you can redistribute it and/or modify it
250.10 @@ -39,6 +39,8 @@
250.11 #define X_IA64 4
250.12 #define X_AMD64 5
250.13 #define X_ZERO 6
250.14 +#define X_ARM 7
250.15 +#define X_PPC 8
250.16
250.17 // **********************************
250.18 // Make sure you set X_PLATFORM and X_ARCH defines correctly.
251.1 --- a/src/share/native/common/check_code.c Tue Mar 29 11:29:01 2011 -0700
251.2 +++ b/src/share/native/common/check_code.c Tue Mar 29 20:19:55 2011 -0700
251.3 @@ -2685,11 +2685,11 @@
251.4 switch (type_table[operand]) {
251.5 case JVM_CONSTANT_MethodType:
251.6 full_info = make_class_info_from_name(context,
251.7 - "java/dyn/MethodType");
251.8 + "java/lang/invoke/MethodType");
251.9 break;
251.10 default: //JVM_CONSTANT_MethodHandle
251.11 full_info = make_class_info_from_name(context,
251.12 - "java/dyn/MethodHandle");
251.13 + "java/lang/invoke/MethodHandle");
251.14 break;
251.15 }
251.16 break;
252.1 --- a/src/share/native/java/lang/fdlibm/include/fdlibm.h Tue Mar 29 11:29:01 2011 -0700
252.2 +++ b/src/share/native/java/lang/fdlibm/include/fdlibm.h Tue Mar 29 20:19:55 2011 -0700
252.3 @@ -1,6 +1,6 @@
252.4
252.5 /*
252.6 - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
252.7 + * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
252.8 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
252.9 *
252.10 * This code is free software; you can redistribute it and/or modify it
252.11 @@ -28,8 +28,8 @@
252.12
252.13 #ifdef __NEWVALID /* special setup for Sun test regime */
252.14 #if defined(i386) || defined(i486) || \
252.15 - defined(intel) || defined(x86) || \
252.16 - defined(i86pc) || defined(_M_IA64) || defined(ia64)
252.17 + defined(intel) || defined(x86) || defined(arm) || \
252.18 + defined(i86pc) || defined(_M_IA64) || defined(ia64)
252.19 #define _LITTLE_ENDIAN
252.20 #endif
252.21 #endif
253.1 --- a/src/share/native/sun/awt/image/jpeg/imageioJPEG.c Tue Mar 29 11:29:01 2011 -0700
253.2 +++ b/src/share/native/sun/awt/image/jpeg/imageioJPEG.c Tue Mar 29 20:19:55 2011 -0700
253.3 @@ -40,7 +40,7 @@
253.4 #include <setjmp.h>
253.5 #include <assert.h>
253.6 #include <string.h>
253.7 -
253.8 +#include <limits.h>
253.9
253.10 /* java native interface headers */
253.11 #include "jni.h"
253.12 @@ -2657,7 +2657,7 @@
253.13 (destWidth < 0) || (destWidth > srcWidth) ||
253.14 (destHeight < 0) ||
253.15 (stepX < 0) || (stepY < 0) ||
253.16 - ((scanLineSize / numBands) < destWidth)) /* destWidth causes an integer overflow */
253.17 + ((INT_MAX / numBands) < destWidth)) /* destWidth causes an integer overflow */
253.18 {
253.19 JNU_ThrowByName(env, "javax/imageio/IIOException",
253.20 "Invalid argument to native writeImage");
254.1 --- a/src/share/native/sun/font/layout/KernTable.cpp Tue Mar 29 11:29:01 2011 -0700
254.2 +++ b/src/share/native/sun/font/layout/KernTable.cpp Tue Mar 29 20:19:55 2011 -0700
254.3 @@ -210,7 +210,7 @@
254.4 // all the elements ahead of time and store them in the font
254.5
254.6 const PairInfo* p = pairs;
254.7 - const PairInfo* tp = (const PairInfo*)(p + rangeShift);
254.8 + const PairInfo* tp = (const PairInfo*)(p + (rangeShift/KERN_PAIRINFO_SIZE)); /* rangeshift is in original table bytes */
254.9 if (key > tp->key) {
254.10 p = tp;
254.11 }
254.12 @@ -222,7 +222,7 @@
254.13 le_uint32 probe = searchRange;
254.14 while (probe > 1) {
254.15 probe >>= 1;
254.16 - tp = (const PairInfo*)(p + probe);
254.17 + tp = (const PairInfo*)(p + (probe/KERN_PAIRINFO_SIZE));
254.18 le_uint32 tkey = tp->key;
254.19 #if DEBUG
254.20 fprintf(stdout, " %.3d (%0.8x)\n", (tp - pairs), tkey);
255.1 --- a/src/share/native/sun/font/layout/LayoutEngine.cpp Tue Mar 29 11:29:01 2011 -0700
255.2 +++ b/src/share/native/sun/font/layout/LayoutEngine.cpp Tue Mar 29 20:19:55 2011 -0700
255.3 @@ -251,6 +251,10 @@
255.4 return 0;
255.5 }
255.6
255.7 + if ((fTypoFlags & 0x4) == 0) { // no canonical processing
255.8 + return count;
255.9 + }
255.10 +
255.11 const GlyphSubstitutionTableHeader *canonGSUBTable = (GlyphSubstitutionTableHeader *) CanonShaping::glyphSubstitutionTable;
255.12 LETag scriptTag = OpenTypeLayoutEngine::getScriptTag(fScriptCode);
255.13 LETag langSysTag = OpenTypeLayoutEngine::getLangSysTag(fLanguageCode);
256.1 --- a/src/share/native/sun/java2d/loops/ProcessPath.c Tue Mar 29 11:29:01 2011 -0700
256.2 +++ b/src/share/native/sun/java2d/loops/ProcessPath.c Tue Mar 29 20:19:55 2011 -0700
256.3 @@ -118,19 +118,25 @@
256.4 jint Y1 = (fY1) >> MDP_PREC; \
256.5 jint res; \
256.6 \
256.7 - /* Checking bounds and clipping if necessary */ \
256.8 + /* Checking bounds and clipping if necessary. \
256.9 + * REMIND: It's temporary solution to avoid OOB in rendering code. \
256.10 + * Current approach uses float equations which are unreliable for \
256.11 + * clipping and makes assumptions about the line biases of the \
256.12 + * rendering algorithm. Also, clipping code should be moved down \
256.13 + * into only those output renderers that need it. \
256.14 + */ \
256.15 if (checkBounds) { \
256.16 - TESTANDCLIP(hnd->dhnd->yMin, hnd->dhnd->yMax, Y0, X0, Y1, X1, \
256.17 - jint, res); \
256.18 + jfloat xMinf = hnd->dhnd->xMinf + 0.5f; \
256.19 + jfloat yMinf = hnd->dhnd->yMinf + 0.5f; \
256.20 + jfloat xMaxf = hnd->dhnd->xMaxf + 0.5f; \
256.21 + jfloat yMaxf = hnd->dhnd->yMaxf + 0.5f; \
256.22 + TESTANDCLIP(yMinf, yMaxf, Y0, X0, Y1, X1, jint, res); \
256.23 if (res == CRES_INVISIBLE) break; \
256.24 - TESTANDCLIP(hnd->dhnd->yMin, hnd->dhnd->yMax, Y1, X1, Y0, X0, \
256.25 - jint, res); \
256.26 + TESTANDCLIP(yMinf, yMaxf, Y1, X1, Y0, X0, jint, res); \
256.27 if (res == CRES_INVISIBLE) break; \
256.28 - TESTANDCLIP(hnd->dhnd->xMin, hnd->dhnd->xMax, X0, Y0, X1, Y1, \
256.29 - jint, res); \
256.30 + TESTANDCLIP(xMinf, xMaxf, X0, Y0, X1, Y1, jint, res); \
256.31 if (res == CRES_INVISIBLE) break; \
256.32 - TESTANDCLIP(hnd->dhnd->xMin, hnd->dhnd->xMax, X1, Y1, X0, Y0, \
256.33 - jint, res); \
256.34 + TESTANDCLIP(xMinf, xMaxf, X1, Y1, X0, Y0, jint, res); \
256.35 if (res == CRES_INVISIBLE) break; \
256.36 } \
256.37 \
257.1 --- a/src/share/sample/nio/file/WatchDir.java Tue Mar 29 11:29:01 2011 -0700
257.2 +++ b/src/share/sample/nio/file/WatchDir.java Tue Mar 29 20:19:55 2011 -0700
257.3 @@ -33,8 +33,7 @@
257.4 import static java.nio.file.StandardWatchEventKind.*;
257.5 import static java.nio.file.LinkOption.*;
257.6 import java.nio.file.attribute.*;
257.7 -import java.io.*;
257.8 -import java.util.*;
257.9 +import java.io.IOException;
257.10
257.11 /**
257.12 * Example to watch a directory (or tree) for changes to files.
257.13 @@ -43,9 +42,9 @@
257.14 public class WatchDir {
257.15
257.16 private final WatchService watcher;
257.17 - private final Map<WatchKey,Path> keys;
257.18 private final boolean recursive;
257.19 private boolean trace = false;
257.20 + private int count;
257.21
257.22 @SuppressWarnings("unchecked")
257.23 static <T> WatchEvent<T> cast(WatchEvent<?> event) {
257.24 @@ -57,17 +56,9 @@
257.25 */
257.26 private void register(Path dir) throws IOException {
257.27 WatchKey key = dir.register(watcher, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY);
257.28 - if (trace) {
257.29 - Path prev = keys.get(key);
257.30 - if (prev == null) {
257.31 - System.out.format("register: %s\n", dir);
257.32 - } else {
257.33 - if (!dir.equals(prev)) {
257.34 - System.out.format("update: %s -> %s\n", prev, dir);
257.35 - }
257.36 - }
257.37 - }
257.38 - keys.put(key, dir);
257.39 + count++;
257.40 + if (trace)
257.41 + System.out.format("register: %s\n", dir);
257.42 }
257.43
257.44 /**
257.45 @@ -92,7 +83,6 @@
257.46 */
257.47 WatchDir(Path dir, boolean recursive) throws IOException {
257.48 this.watcher = FileSystems.getDefault().newWatchService();
257.49 - this.keys = new HashMap<WatchKey,Path>();
257.50 this.recursive = recursive;
257.51
257.52 if (recursive) {
257.53 @@ -121,12 +111,6 @@
257.54 return;
257.55 }
257.56
257.57 - Path dir = keys.get(key);
257.58 - if (dir == null) {
257.59 - System.err.println("WatchKey not recognized!!");
257.60 - continue;
257.61 - }
257.62 -
257.63 for (WatchEvent<?> event: key.pollEvents()) {
257.64 WatchEvent.Kind kind = event.kind();
257.65
257.66 @@ -138,7 +122,7 @@
257.67 // Context for directory entry event is the file name of entry
257.68 WatchEvent<Path> ev = cast(event);
257.69 Path name = ev.context();
257.70 - Path child = dir.resolve(name);
257.71 + Path child = ((Path)key.watchable()).resolve(name);
257.72
257.73 // print out event
257.74 System.out.format("%s: %s\n", event.kind().name(), child);
257.75 @@ -156,15 +140,13 @@
257.76 }
257.77 }
257.78
257.79 - // reset key and remove from set if directory no longer accessible
257.80 + // reset key
257.81 boolean valid = key.reset();
257.82 if (!valid) {
257.83 - keys.remove(key);
257.84 -
257.85 - // all directories are inaccessible
257.86 - if (keys.isEmpty()) {
257.87 + // directory no longer accessible
257.88 + count--;
257.89 + if (count == 0)
257.90 break;
257.91 - }
257.92 }
257.93 }
257.94 }
258.1 --- a/src/solaris/bin/ergo.c Tue Mar 29 11:29:01 2011 -0700
258.2 +++ b/src/solaris/bin/ergo.c Tue Mar 29 20:19:55 2011 -0700
258.3 @@ -1,5 +1,5 @@
258.4 /*
258.5 - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
258.6 + * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
258.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
258.8 *
258.9 * This code is free software; you can redistribute it and/or modify it
258.10 @@ -67,6 +67,35 @@
258.11 }
258.12 }
258.13
258.14 +#ifdef USE_GENERIC_ERGO
258.15 +/* Ask the OS how many processors there are. */
258.16 +static unsigned long
258.17 +physical_processors(void) {
258.18 + const unsigned long sys_processors = sysconf(_SC_NPROCESSORS_CONF);
258.19 + JLI_TraceLauncher("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors);
258.20 + return sys_processors;
258.21 +}
258.22 +
258.23 +jboolean
258.24 +ServerClassMachineImpl(void) {
258.25 + jboolean result = JNI_FALSE;
258.26 + /* How big is a server class machine? */
258.27 + const unsigned long server_processors = 2UL;
258.28 + const uint64_t server_memory = 2UL * GB;
258.29 + const uint64_t actual_memory = physical_memory();
258.30 +
258.31 + /* Is this a server class machine? */
258.32 + if (actual_memory >= server_memory) {
258.33 + const unsigned long actual_processors = physical_processors();
258.34 + if (actual_processors >= server_processors) {
258.35 + result = JNI_TRUE;
258.36 + }
258.37 + }
258.38 + JLI_TraceLauncher("unix_" LIBARCHNAME "_ServerClassMachine: %s\n",
258.39 + (result == JNI_TRUE ? "JNI_TRUE" : "JNI_FALSE"));
258.40 + return result;
258.41 +}
258.42 +#endif
258.43
258.44 /* Compute physical memory by asking the OS */
258.45 uint64_t
259.1 --- a/src/solaris/bin/ergo_sparc.c Tue Mar 29 11:29:01 2011 -0700
259.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
259.3 @@ -1,58 +0,0 @@
259.4 -/*
259.5 - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
259.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
259.7 - *
259.8 - * This code is free software; you can redistribute it and/or modify it
259.9 - * under the terms of the GNU General Public License version 2 only, as
259.10 - * published by the Free Software Foundation. Oracle designates this
259.11 - * particular file as subject to the "Classpath" exception as provided
259.12 - * by Oracle in the LICENSE file that accompanied this code.
259.13 - *
259.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
259.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
259.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
259.17 - * version 2 for more details (a copy is included in the LICENSE file that
259.18 - * accompanied this code).
259.19 - *
259.20 - * You should have received a copy of the GNU General Public License version
259.21 - * 2 along with this work; if not, write to the Free Software Foundation,
259.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
259.23 - *
259.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
259.25 - * or visit www.oracle.com if you need additional information or have any
259.26 - * questions.
259.27 - */
259.28 -#include "ergo.h"
259.29 -
259.30 -
259.31 -/* Methods for solaris-sparc and linux-sparc: these are easy. */
259.32 -
259.33 -/* Ask the OS how many processors there are. */
259.34 -static unsigned long
259.35 -physical_processors(void) {
259.36 - const unsigned long sys_processors = sysconf(_SC_NPROCESSORS_CONF);
259.37 -
259.38 - JLI_TraceLauncher("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors);
259.39 - return sys_processors;
259.40 -}
259.41 -
259.42 -/* The sparc version of the "server-class" predicate. */
259.43 -jboolean
259.44 -ServerClassMachineImpl(void) {
259.45 - jboolean result = JNI_FALSE;
259.46 - /* How big is a server class machine? */
259.47 - const unsigned long server_processors = 2UL;
259.48 - const uint64_t server_memory = 2UL * GB;
259.49 - const uint64_t actual_memory = physical_memory();
259.50 -
259.51 - /* Is this a server class machine? */
259.52 - if (actual_memory >= server_memory) {
259.53 - const unsigned long actual_processors = physical_processors();
259.54 - if (actual_processors >= server_processors) {
259.55 - result = JNI_TRUE;
259.56 - }
259.57 - }
259.58 - JLI_TraceLauncher("unix_" LIBARCHNAME "_ServerClassMachine: %s\n",
259.59 - (result == JNI_TRUE ? "JNI_TRUE" : "JNI_FALSE"));
259.60 - return result;
259.61 -}
260.1 --- a/src/solaris/bin/ergo_zero.c Tue Mar 29 11:29:01 2011 -0700
260.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
260.3 @@ -1,58 +0,0 @@
260.4 -/*
260.5 - * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
260.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
260.7 - *
260.8 - * This code is free software; you can redistribute it and/or modify it
260.9 - * under the terms of the GNU General Public License version 2 only, as
260.10 - * published by the Free Software Foundation. Oracle designates this
260.11 - * particular file as subject to the "Classpath" exception as provided
260.12 - * by Oracle in the LICENSE file that accompanied this code.
260.13 - *
260.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
260.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
260.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
260.17 - * version 2 for more details (a copy is included in the LICENSE file that
260.18 - * accompanied this code).
260.19 - *
260.20 - * You should have received a copy of the GNU General Public License version
260.21 - * 2 along with this work; if not, write to the Free Software Foundation,
260.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
260.23 - *
260.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
260.25 - * or visit www.oracle.com if you need additional information or have any
260.26 - * questions.
260.27 - */
260.28 -#include "ergo.h"
260.29 -
260.30 -
260.31 -/* Methods for solaris-sparc and linux-sparc: these are easy. */
260.32 -
260.33 -/* Ask the OS how many processors there are. */
260.34 -static unsigned long
260.35 -physical_processors(void) {
260.36 - const unsigned long sys_processors = sysconf(_SC_NPROCESSORS_CONF);
260.37 -
260.38 - JLI_TraceLauncher("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors);
260.39 - return sys_processors;
260.40 -}
260.41 -
260.42 -/* The sparc version of the "server-class" predicate. */
260.43 -jboolean
260.44 -ServerClassMachineImpl(void) {
260.45 - jboolean result = JNI_FALSE;
260.46 - /* How big is a server class machine? */
260.47 - const unsigned long server_processors = 2UL;
260.48 - const uint64_t server_memory = 2UL * GB;
260.49 - const uint64_t actual_memory = physical_memory();
260.50 -
260.51 - /* Is this a server class machine? */
260.52 - if (actual_memory >= server_memory) {
260.53 - const unsigned long actual_processors = physical_processors();
260.54 - if (actual_processors >= server_processors) {
260.55 - result = JNI_TRUE;
260.56 - }
260.57 - }
260.58 - JLI_TraceLauncher("unix_" LIBARCHNAME "_ServerClassMachine: %s\n",
260.59 - (result == JNI_TRUE ? "JNI_TRUE" : "JNI_FALSE"));
260.60 - return result;
260.61 -}
261.1 --- a/src/solaris/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java Tue Mar 29 11:29:01 2011 -0700
261.2 +++ b/src/solaris/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java Tue Mar 29 20:19:55 2011 -0700
261.3 @@ -68,6 +68,9 @@
261.4 public class NTLMAuthentication extends AuthenticationInfo {
261.5 private static final long serialVersionUID = 170L;
261.6
261.7 + private static final NTLMAuthenticationCallback NTLMAuthCallback =
261.8 + NTLMAuthenticationCallback.getNTLMAuthenticationCallback();
261.9 +
261.10 private String hostname;
261.11 private static String defaultDomain; /* Domain to use if not specified by user */
261.12
261.13 @@ -81,6 +84,14 @@
261.14 return false;
261.15 }
261.16
261.17 + /**
261.18 + * Returns true if the given site is trusted, i.e. we can try
261.19 + * transparent Authentication.
261.20 + */
261.21 + public static boolean isTrustedSite(URL url) {
261.22 + return NTLMAuthCallback.isTrustedSite(url);
261.23 + }
261.24 +
261.25 private void init0() {
261.26
261.27 hostname = java.security.AccessController.doPrivileged(
262.1 --- a/src/solaris/classes/sun/nio/fs/LinuxDosFileAttributeView.java Tue Mar 29 11:29:01 2011 -0700
262.2 +++ b/src/solaris/classes/sun/nio/fs/LinuxDosFileAttributeView.java Tue Mar 29 20:19:55 2011 -0700
262.3 @@ -27,6 +27,7 @@
262.4
262.5 import java.nio.file.attribute.*;
262.6 import java.util.Map;
262.7 +import java.util.Set;
262.8 import java.io.IOException;
262.9 import sun.misc.Unsafe;
262.10
262.11 @@ -57,6 +58,10 @@
262.12 private static final int DOS_XATTR_SYSTEM = 0x04;
262.13 private static final int DOS_XATTR_ARCHIVE = 0x20;
262.14
262.15 + // the names of the DOS attributes (includes basic)
262.16 + private static final Set<String> dosAttributeNames =
262.17 + Util.newSet(basicAttributeNames, READONLY_NAME, ARCHIVE_NAME, SYSTEM_NAME, HIDDEN_NAME);
262.18 +
262.19 LinuxDosFileAttributeView(UnixPath file, boolean followLinks) {
262.20 super(file, followLinks);
262.21 }
262.22 @@ -93,9 +98,10 @@
262.23 public Map<String,Object> readAttributes(String[] attributes)
262.24 throws IOException
262.25 {
262.26 - AttributesBuilder builder = AttributesBuilder.create(attributes);
262.27 + AttributesBuilder builder =
262.28 + AttributesBuilder.create(dosAttributeNames, attributes);
262.29 DosFileAttributes attrs = readAttributes();
262.30 - addBasicAttributesToBuilder(attrs, builder);
262.31 + addRequestedBasicAttributes(attrs, builder);
262.32 if (builder.match(READONLY_NAME))
262.33 builder.add(READONLY_NAME, attrs.isReadOnly());
262.34 if (builder.match(ARCHIVE_NAME))
263.1 --- a/src/solaris/classes/sun/nio/fs/LinuxFileSystem.java Tue Mar 29 11:29:01 2011 -0700
263.2 +++ b/src/solaris/classes/sun/nio/fs/LinuxFileSystem.java Tue Mar 29 20:19:55 2011 -0700
263.3 @@ -28,8 +28,6 @@
263.4 import java.nio.file.*;
263.5 import java.io.IOException;
263.6 import java.util.*;
263.7 -import java.security.AccessController;
263.8 -import sun.security.action.GetPropertyAction;
263.9 import static sun.nio.fs.LinuxNativeDispatcher.*;
263.10
263.11 /**
263.12 @@ -37,42 +35,16 @@
263.13 */
263.14
263.15 class LinuxFileSystem extends UnixFileSystem {
263.16 - private final boolean hasInotify;
263.17 -
263.18 LinuxFileSystem(UnixFileSystemProvider provider, String dir) {
263.19 super(provider, dir);
263.20 -
263.21 - // assume X.Y[-Z] format
263.22 - String osversion = AccessController
263.23 - .doPrivileged(new GetPropertyAction("os.version"));
263.24 - String[] vers = Util.split(osversion, '.');
263.25 - assert vers.length >= 2;
263.26 -
263.27 - int majorVersion = Integer.parseInt(vers[0]);
263.28 - int minorVersion = Integer.parseInt(vers[1]);
263.29 - int microVersion = 0;
263.30 - if (vers.length > 2) {
263.31 - String[] microVers = Util.split(vers[2], '-');
263.32 - microVersion = (microVers.length > 0) ?
263.33 - Integer.parseInt(microVers[0]) : 0;
263.34 - }
263.35 -
263.36 - // inotify available since 2.6.13
263.37 - this.hasInotify = ((majorVersion > 2) ||
263.38 - (majorVersion == 2 && minorVersion > 6) ||
263.39 - ((majorVersion == 2) && (minorVersion == 6) && (microVersion >= 13)));
263.40 }
263.41
263.42 @Override
263.43 public WatchService newWatchService()
263.44 throws IOException
263.45 {
263.46 - if (hasInotify) {
263.47 - return new LinuxWatchService(this);
263.48 - } else {
263.49 - // use polling implementation on older kernels
263.50 - return new PollingWatchService();
263.51 - }
263.52 + // assume 2.6.13 or newer
263.53 + return new LinuxWatchService(this);
263.54 }
263.55
263.56
264.1 --- a/src/solaris/classes/sun/nio/fs/UnixFileAttributeViews.java Tue Mar 29 11:29:01 2011 -0700
264.2 +++ b/src/solaris/classes/sun/nio/fs/UnixFileAttributeViews.java Tue Mar 29 20:19:55 2011 -0700
264.3 @@ -123,6 +123,10 @@
264.4 private static final String OWNER_NAME = "owner";
264.5 private static final String GROUP_NAME = "group";
264.6
264.7 + // the names of the posix attributes (incudes basic)
264.8 + static final Set<String> posixAttributeNames =
264.9 + Util.newSet(basicAttributeNames, PERMISSIONS_NAME, OWNER_NAME, GROUP_NAME);
264.10 +
264.11 Posix(UnixPath file, boolean followLinks) {
264.12 super(file, followLinks);
264.13 }
264.14 @@ -172,9 +176,10 @@
264.15 * Invoked by readAttributes or sub-classes to add all matching posix
264.16 * attributes to the builder
264.17 */
264.18 - final void addPosixAttributesToBuilder(PosixFileAttributes attrs,
264.19 + final void addRequestedPosixAttributes(PosixFileAttributes attrs,
264.20 AttributesBuilder builder)
264.21 {
264.22 + addRequestedBasicAttributes(attrs, builder);
264.23 if (builder.match(PERMISSIONS_NAME))
264.24 builder.add(PERMISSIONS_NAME, attrs.permissions());
264.25 if (builder.match(OWNER_NAME))
264.26 @@ -184,13 +189,13 @@
264.27 }
264.28
264.29 @Override
264.30 - public Map<String,Object> readAttributes(String[] attributes)
264.31 + public Map<String,Object> readAttributes(String[] requested)
264.32 throws IOException
264.33 {
264.34 - AttributesBuilder builder = AttributesBuilder.create(attributes);
264.35 + AttributesBuilder builder =
264.36 + AttributesBuilder.create(posixAttributeNames, requested);
264.37 PosixFileAttributes attrs = readAttributes();
264.38 - addBasicAttributesToBuilder(attrs, builder);
264.39 - addPosixAttributesToBuilder(attrs, builder);
264.40 + addRequestedPosixAttributes(attrs, builder);
264.41 return builder.unmodifiableMap();
264.42 }
264.43
264.44 @@ -287,6 +292,12 @@
264.45 private static final String GID_NAME = "gid";
264.46 private static final String CTIME_NAME = "ctime";
264.47
264.48 + // the names of the unix attributes (including posix)
264.49 + static final Set<String> unixAttributeNames =
264.50 + Util.newSet(posixAttributeNames,
264.51 + MODE_NAME, INO_NAME, DEV_NAME, RDEV_NAME,
264.52 + NLINK_NAME, UID_NAME, GID_NAME, CTIME_NAME);
264.53 +
264.54 Unix(UnixPath file, boolean followLinks) {
264.55 super(file, followLinks);
264.56 }
264.57 @@ -316,13 +327,13 @@
264.58 }
264.59
264.60 @Override
264.61 - public Map<String,Object> readAttributes(String[] attributes)
264.62 + public Map<String,Object> readAttributes(String[] requested)
264.63 throws IOException
264.64 {
264.65 - AttributesBuilder builder = AttributesBuilder.create(attributes);
264.66 + AttributesBuilder builder =
264.67 + AttributesBuilder.create(unixAttributeNames, requested);
264.68 UnixFileAttributes attrs = readAttributes();
264.69 - addBasicAttributesToBuilder(attrs, builder);
264.70 - addPosixAttributesToBuilder(attrs, builder);
264.71 + addRequestedPosixAttributes(attrs, builder);
264.72 if (builder.match(MODE_NAME))
264.73 builder.add(MODE_NAME, attrs.mode());
264.74 if (builder.match(INO_NAME))
265.1 --- a/src/solaris/classes/sun/nio/fs/UnixPath.java Tue Mar 29 11:29:01 2011 -0700
265.2 +++ b/src/solaris/classes/sun/nio/fs/UnixPath.java Tue Mar 29 20:19:55 2011 -0700
265.3 @@ -606,7 +606,9 @@
265.4
265.5 @Override
265.6 public boolean startsWith(Path other) {
265.7 - UnixPath that = toUnixPath(other);
265.8 + if (!(Objects.requireNonNull(other) instanceof UnixPath))
265.9 + return false;
265.10 + UnixPath that = (UnixPath)other;
265.11
265.12 // other path is longer
265.13 if (that.path.length > path.length)
265.14 @@ -655,7 +657,9 @@
265.15
265.16 @Override
265.17 public boolean endsWith(Path other) {
265.18 - UnixPath that = toUnixPath(other);
265.19 + if (!(Objects.requireNonNull(other) instanceof UnixPath))
265.20 + return false;
265.21 + UnixPath that = (UnixPath)other;
265.22
265.23 int thisLen = path.length;
265.24 int thatLen = that.path.length;
266.1 --- a/src/solaris/native/java/net/Inet4AddressImpl.c Tue Mar 29 11:29:01 2011 -0700
266.2 +++ b/src/solaris/native/java/net/Inet4AddressImpl.c Tue Mar 29 20:19:55 2011 -0700
266.3 @@ -60,7 +60,7 @@
266.4 char hostname[MAXHOSTNAMELEN+1];
266.5
266.6 hostname[0] = '\0';
266.7 - if (JVM_GetHostName(hostname, MAXHOSTNAMELEN)) {
266.8 + if (JVM_GetHostName(hostname, sizeof(hostname))) {
266.9 /* Something went wrong, maybe networking is not setup? */
266.10 strcpy(hostname, "localhost");
266.11 } else {
266.12 @@ -83,6 +83,9 @@
266.13 char *buf2[HENT_BUF_SIZE/(sizeof (char *))];
266.14 int h_error=0;
266.15
266.16 + // ensure null-terminated
266.17 + hostname[MAXHOSTNAMELEN] = '\0';
266.18 +
266.19 #ifdef __GLIBC__
266.20 gethostbyname_r(hostname, &res, (char*)buf, sizeof(buf), &hp, &h_error);
266.21 #else
267.1 --- a/src/solaris/native/java/net/Inet6AddressImpl.c Tue Mar 29 11:29:01 2011 -0700
267.2 +++ b/src/solaris/native/java/net/Inet6AddressImpl.c Tue Mar 29 20:19:55 2011 -0700
267.3 @@ -64,10 +64,12 @@
267.4 char hostname[NI_MAXHOST+1];
267.5
267.6 hostname[0] = '\0';
267.7 - if (JVM_GetHostName(hostname, MAXHOSTNAMELEN)) {
267.8 + if (JVM_GetHostName(hostname, sizeof(hostname))) {
267.9 /* Something went wrong, maybe networking is not setup? */
267.10 strcpy(hostname, "localhost");
267.11 } else {
267.12 + // ensure null-terminated
267.13 + hostname[NI_MAXHOST] = '\0';
267.14 #ifdef __linux__
267.15 /* On Linux gethostname() says "host.domain.sun.com". On
267.16 * Solaris gethostname() says "host", so extra work is needed.
268.1 --- a/src/solaris/native/sun/awt/awt_DrawingSurface.c Tue Mar 29 11:29:01 2011 -0700
268.2 +++ b/src/solaris/native/sun/awt/awt_DrawingSurface.c Tue Mar 29 20:19:55 2011 -0700
268.3 @@ -302,6 +302,7 @@
268.4 #ifdef DEBUG
268.5 fprintf(stderr, "Drawing Surface Info is NULL\n");
268.6 #endif
268.7 + return;
268.8 }
268.9 free(dsi->platformInfo);
268.10 free(dsi);
269.1 --- a/src/solaris/native/sun/awt/awt_GraphicsEnv.c Tue Mar 29 11:29:01 2011 -0700
269.2 +++ b/src/solaris/native/sun/awt/awt_GraphicsEnv.c Tue Mar 29 20:19:55 2011 -0700
269.3 @@ -240,7 +240,7 @@
269.4
269.5 AwtGraphicsConfigDataPtr defaultConfig;
269.6 int xinawareScreen = 0;
269.7 - VisualID forcedVisualID, defaultVisualID;
269.8 + VisualID forcedVisualID = 0, defaultVisualID;
269.9 char *forcedVisualStr;
269.10 XVisualInfo vinfo;
269.11 long mask;
269.12 @@ -254,7 +254,7 @@
269.13
269.14 if ((forcedVisualStr = getenv("FORCEDEFVIS"))) {
269.15 mask = VisualIDMask | VisualScreenMask;
269.16 - if (sscanf(forcedVisualStr, "%x", &forcedVisualID) > 0 &&
269.17 + if (sscanf(forcedVisualStr, "%lx", &forcedVisualID) > 0 &&
269.18 forcedVisualID > 0)
269.19 {
269.20 vinfo.visualid = forcedVisualID;
270.1 --- a/src/solaris/native/sun/nio/ch/Net.c Tue Mar 29 11:29:01 2011 -0700
270.2 +++ b/src/solaris/native/sun/nio/ch/Net.c Tue Mar 29 20:19:55 2011 -0700
270.3 @@ -154,6 +154,22 @@
270.4 return (ipv6_available()) ? JNI_TRUE : JNI_FALSE;
270.5 }
270.6
270.7 +JNIEXPORT jboolean JNICALL
270.8 +Java_sun_nio_ch_Net_canIPv6SocketJoinIPv4Group0(JNIEnv* env, jclass cl)
270.9 +{
270.10 + return JNI_TRUE;
270.11 +}
270.12 +
270.13 +JNIEXPORT jboolean JNICALL
270.14 +Java_sun_nio_ch_Net_canJoin6WithIPv4Group0(JNIEnv* env, jclass cl)
270.15 +{
270.16 +#ifdef __solaris__
270.17 + return JNI_TRUE;
270.18 +#else
270.19 + return JNI_FALSE;
270.20 +#endif
270.21 +}
270.22 +
270.23 JNIEXPORT int JNICALL
270.24 Java_sun_nio_ch_Net_socket0(JNIEnv *env, jclass cl, jboolean preferIPv6,
270.25 jboolean stream, jboolean reuse)
271.1 --- a/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java Tue Mar 29 11:29:01 2011 -0700
271.2 +++ b/src/windows/classes/java/net/TwoStacksPlainDatagramSocketImpl.java Tue Mar 29 20:19:55 2011 -0700
271.3 @@ -26,6 +26,7 @@
271.4
271.5 import java.io.IOException;
271.6 import java.io.FileDescriptor;
271.7 +import sun.net.ResourceManager;
271.8
271.9 /**
271.10 * This class defines the plain DatagramSocketImpl that is used for all
271.11 @@ -108,6 +109,7 @@
271.12 protected void close() {
271.13 if (fd != null || fd1 != null) {
271.14 datagramSocketClose();
271.15 + ResourceManager.afterUdpClose();
271.16 fd = null;
271.17 fd1 = null;
271.18 }
272.1 --- a/src/windows/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java Tue Mar 29 11:29:01 2011 -0700
272.2 +++ b/src/windows/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java Tue Mar 29 20:19:55 2011 -0700
272.3 @@ -45,6 +45,9 @@
272.4
272.5 private static final long serialVersionUID = 100L;
272.6
272.7 + private static final NTLMAuthenticationCallback NTLMAuthCallback =
272.8 + NTLMAuthenticationCallback.getNTLMAuthenticationCallback();
272.9 +
272.10 private String hostname;
272.11 private static String defaultDomain; /* Domain to use if not specified by user */
272.12
272.13 @@ -143,6 +146,14 @@
272.14 }
272.15
272.16 /**
272.17 + * Returns true if the given site is trusted, i.e. we can try
272.18 + * transparent Authentication.
272.19 + */
272.20 + public static boolean isTrustedSite(URL url) {
272.21 + return NTLMAuthCallback.isTrustedSite(url);
272.22 + }
272.23 +
272.24 + /**
272.25 * Not supported. Must use the setHeaders() method
272.26 */
272.27 @Override
273.1 --- a/src/windows/classes/sun/nio/fs/WindowsFileAttributeViews.java Tue Mar 29 11:29:01 2011 -0700
273.2 +++ b/src/windows/classes/sun/nio/fs/WindowsFileAttributeViews.java Tue Mar 29 20:19:55 2011 -0700
273.3 @@ -157,6 +157,11 @@
273.4 private static final String HIDDEN_NAME = "hidden";
273.5 private static final String ATTRIBUTES_NAME = "attributes";
273.6
273.7 + // the names of the DOS attribtues (includes basic)
273.8 + static final Set<String> dosAttributeNames =
273.9 + Util.newSet(basicAttributeNames,
273.10 + READONLY_NAME, ARCHIVE_NAME, SYSTEM_NAME, HIDDEN_NAME, ATTRIBUTES_NAME);
273.11 +
273.12 Dos(WindowsPath file, boolean followLinks) {
273.13 super(file, followLinks);
273.14 }
273.15 @@ -193,9 +198,10 @@
273.16 public Map<String,Object> readAttributes(String[] attributes)
273.17 throws IOException
273.18 {
273.19 - AttributesBuilder builder = AttributesBuilder.create(attributes);
273.20 + AttributesBuilder builder =
273.21 + AttributesBuilder.create(dosAttributeNames, attributes);
273.22 WindowsFileAttributes attrs = readAttributes();
273.23 - addBasicAttributesToBuilder(attrs, builder);
273.24 + addRequestedBasicAttributes(attrs, builder);
273.25 if (builder.match(READONLY_NAME))
273.26 builder.add(READONLY_NAME, attrs.isReadOnly());
273.27 if (builder.match(ARCHIVE_NAME))
274.1 --- a/src/windows/classes/sun/nio/fs/WindowsPath.java Tue Mar 29 11:29:01 2011 -0700
274.2 +++ b/src/windows/classes/sun/nio/fs/WindowsPath.java Tue Mar 29 20:19:55 2011 -0700
274.3 @@ -646,7 +646,9 @@
274.4
274.5 @Override
274.6 public boolean startsWith(Path obj) {
274.7 - WindowsPath other = toWindowsPath(obj);
274.8 + if (!(Objects.requireNonNull(obj) instanceof WindowsPath))
274.9 + return false;
274.10 + WindowsPath other = (WindowsPath)obj;
274.11
274.12 // if this path has a root component the given path's root must match
274.13 if (!this.root.equalsIgnoreCase(other.root)) {
274.14 @@ -675,7 +677,9 @@
274.15
274.16 @Override
274.17 public boolean endsWith(Path obj) {
274.18 - WindowsPath other = toWindowsPath(obj);
274.19 + if (!(Objects.requireNonNull(obj) instanceof WindowsPath))
274.20 + return false;
274.21 + WindowsPath other = (WindowsPath)obj;
274.22
274.23 // other path is longer
274.24 if (other.path.length() > this.path.length()) {
275.1 --- a/src/windows/native/sun/nio/ch/Net.c Tue Mar 29 11:29:01 2011 -0700
275.2 +++ b/src/windows/native/sun/nio/ch/Net.c Tue Mar 29 20:19:55 2011 -0700
275.3 @@ -100,6 +100,18 @@
275.4 return JNI_FALSE;
275.5 }
275.6
275.7 +JNIEXPORT jboolean JNICALL
275.8 +Java_sun_nio_ch_Net_canIPv6SocketJoinIPv4Group0(JNIEnv* env, jclass cl)
275.9 +{
275.10 + return JNI_FALSE;
275.11 +}
275.12 +
275.13 +JNIEXPORT jboolean JNICALL
275.14 +Java_sun_nio_ch_Net_canJoin6WithIPv4Group0(JNIEnv* env, jclass cl)
275.15 +{
275.16 + return JNI_FALSE;
275.17 +}
275.18 +
275.19 JNIEXPORT jint JNICALL
275.20 Java_sun_nio_ch_Net_socket0(JNIEnv *env, jclass cl, jboolean preferIPv6,
275.21 jboolean stream, jboolean reuse)
276.1 --- a/src/windows/native/sun/security/krb5/NativeCreds.c Tue Mar 29 11:29:01 2011 -0700
276.2 +++ b/src/windows/native/sun/security/krb5/NativeCreds.c Tue Mar 29 20:19:55 2011 -0700
276.3 @@ -1,5 +1,5 @@
276.4 /*
276.5 - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
276.6 + * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
276.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
276.8 *
276.9 * This code is free software; you can redistribute it and/or modify it
276.10 @@ -1032,12 +1032,12 @@
276.11 // XXX Cannot use %02.2ld, because the leading 0 is ignored for integers.
276.12 // So, print them to strings, and then print them to the master string with a
276.13 // format pattern that makes it two digits and prefix with a 0 if necessary.
276.14 - swprintf( (wchar_t *)month, L"%2.2d", systemTime.wMonth);
276.15 - swprintf( (wchar_t *)day, L"%2.2d", systemTime.wDay);
276.16 - swprintf( (wchar_t *)hour, L"%2.2d", systemTime.wHour);
276.17 - swprintf( (wchar_t *)minute, L"%2.2d", systemTime.wMinute);
276.18 - swprintf( (wchar_t *)second, L"%2.2d", systemTime.wSecond);
276.19 - swprintf( (wchar_t *)timeString,
276.20 + swprintf( (wchar_t *)month, 3, L"%2.2d", systemTime.wMonth);
276.21 + swprintf( (wchar_t *)day, 3, L"%2.2d", systemTime.wDay);
276.22 + swprintf( (wchar_t *)hour, 3, L"%2.2d", systemTime.wHour);
276.23 + swprintf( (wchar_t *)minute, 3, L"%2.2d", systemTime.wMinute);
276.24 + swprintf( (wchar_t *)second, 3, L"%2.2d", systemTime.wSecond);
276.25 + swprintf( (wchar_t *)timeString, 16,
276.26 L"%ld%02.2s%02.2s%02.2s%02.2s%02.2sZ",
276.27 systemTime.wYear,
276.28 month,
277.1 --- a/src/windows/native/sun/tools/attach/WindowsVirtualMachine.c Tue Mar 29 11:29:01 2011 -0700
277.2 +++ b/src/windows/native/sun/tools/attach/WindowsVirtualMachine.c Tue Mar 29 20:19:55 2011 -0700
277.3 @@ -1,5 +1,5 @@
277.4 /*
277.5 - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
277.6 + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
277.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
277.8 *
277.9 * This code is free software; you can redistribute it and/or modify it
277.10 @@ -173,24 +173,45 @@
277.11 JNIEXPORT jlong JNICALL Java_sun_tools_attach_WindowsVirtualMachine_openProcess
277.12 (JNIEnv *env, jclass cls, jint pid)
277.13 {
277.14 - HANDLE hProcess;
277.15 + HANDLE hProcess = NULL;
277.16
277.17 - /*
277.18 - * Attempt to open process. If it fails then we try to enable the
277.19 - * SE_DEBUG_NAME privilege and retry.
277.20 - */
277.21 - hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, (DWORD)pid);
277.22 - if (hProcess == NULL && GetLastError() == ERROR_ACCESS_DENIED) {
277.23 - hProcess = doPrivilegedOpenProcess(PROCESS_ALL_ACCESS, FALSE, (DWORD)pid);
277.24 + if (pid == (jint) GetCurrentProcessId()) {
277.25 + /* process is attaching to itself; get a pseudo handle instead */
277.26 + hProcess = GetCurrentProcess();
277.27 + /* duplicate the pseudo handle so it can be used in more contexts */
277.28 + if (DuplicateHandle(hProcess, hProcess, hProcess, &hProcess,
277.29 + PROCESS_ALL_ACCESS, FALSE, 0) == 0) {
277.30 + /*
277.31 + * Could not duplicate the handle which isn't a good sign,
277.32 + * but we'll try again with OpenProcess() below.
277.33 + */
277.34 + hProcess = NULL;
277.35 + }
277.36 }
277.37
277.38 if (hProcess == NULL) {
277.39 - if (GetLastError() == ERROR_INVALID_PARAMETER) {
277.40 - JNU_ThrowIOException(env, "no such process");
277.41 - } else {
277.42 - JNU_ThrowIOExceptionWithLastError(env, "OpenProcess failed");
277.43 + /*
277.44 + * Attempt to open process. If it fails then we try to enable the
277.45 + * SE_DEBUG_NAME privilege and retry.
277.46 + */
277.47 + hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, (DWORD)pid);
277.48 + if (hProcess == NULL && GetLastError() == ERROR_ACCESS_DENIED) {
277.49 + hProcess = doPrivilegedOpenProcess(PROCESS_ALL_ACCESS, FALSE,
277.50 + (DWORD)pid);
277.51 }
277.52 - return (jlong)0;
277.53 +
277.54 + if (hProcess == NULL) {
277.55 + if (GetLastError() == ERROR_INVALID_PARAMETER) {
277.56 + JNU_ThrowIOException(env, "no such process");
277.57 + } else {
277.58 + char err_mesg[255];
277.59 + /* include the last error in the default detail message */
277.60 + sprintf(err_mesg, "OpenProcess(pid=%d) failed; LastError=0x%x",
277.61 + (int)pid, (int)GetLastError());
277.62 + JNU_ThrowIOExceptionWithLastError(env, err_mesg);
277.63 + }
277.64 + return (jlong)0;
277.65 + }
277.66 }
277.67
277.68 /*
278.1 --- a/src/windows/native/sun/windows/awt_PrintJob.cpp Tue Mar 29 11:29:01 2011 -0700
278.2 +++ b/src/windows/native/sun/windows/awt_PrintJob.cpp Tue Mar 29 20:19:55 2011 -0700
278.3 @@ -3699,7 +3699,9 @@
278.4 double* newWid, double *newHgt,
278.5 WORD* paperSize) {
278.6
278.7 - const double epsilon = 0.50;
278.8 + // Tolerated differences in comparing page dimensions between passed in
278.9 + // "orig" media with that of Windows' device.
278.10 + const double epsilon = 3.6; // (1/72) of an inch
278.11 const double tolerance = (1.0 * 72.0); // # inches * 72
278.12
278.13 *newWid = origWid;
279.1 --- a/test/Makefile Tue Mar 29 11:29:01 2011 -0700
279.2 +++ b/test/Makefile Tue Mar 29 20:19:55 2011 -0700
279.3 @@ -399,12 +399,12 @@
279.4 endef
279.5 # Running batches of tests with or without samevm
279.6 define RunSamevmBatch
279.7 -$(ECHO) "Running tests in samevm mode: $(call TestDirs, $?)"
279.8 -$(MAKE) TESTDIRS="$(call TestDirs, $?)" USE_JTREG_SAMEVM=true UNIQUE_DIR=$@ jtreg_tests
279.9 +$(ECHO) "Running tests in samevm mode: $?"
279.10 +$(MAKE) TESTDIRS="$?" USE_JTREG_SAMEVM=true UNIQUE_DIR=$@ jtreg_tests
279.11 endef
279.12 define RunOthervmBatch
279.13 -$(ECHO) "Running tests in othervm mode: $(call TestDirs, $?)"
279.14 -$(MAKE) TESTDIRS="$(call TestDirs, $?)" USE_JTREG_SAMEVM=false UNIQUE_DIR=$@ jtreg_tests
279.15 +$(ECHO) "Running tests in othervm mode: $?"
279.16 +$(MAKE) TESTDIRS="$?" USE_JTREG_SAMEVM=false UNIQUE_DIR=$@ jtreg_tests
279.17 endef
279.18 define SummaryInfo
279.19 $(ECHO) "########################################################"
279.20 @@ -420,27 +420,29 @@
279.21 # Stable othervm testruns (minus items from PROBLEM_LIST)
279.22 # Using samevm has problems, and doesn't help performance as much as others.
279.23 JDK_ALL_TARGETS += jdk_awt
279.24 -jdk_awt: com/sun/awt java/awt sun/awt
279.25 +jdk_awt: $(call TestDirs, com/sun/awt java/awt sun/awt)
279.26 $(call RunOthervmBatch)
279.27
279.28 # Stable samevm testruns (minus items from PROBLEM_LIST)
279.29 JDK_ALL_TARGETS += jdk_beans1
279.30 -jdk_beans1: java/beans/beancontext java/beans/PropertyChangeSupport \
279.31 +jdk_beans1: $(call TestDirs, \
279.32 + java/beans/beancontext java/beans/PropertyChangeSupport \
279.33 java/beans/Introspector java/beans/Performance \
279.34 - java/beans/VetoableChangeSupport java/beans/Statement
279.35 + java/beans/VetoableChangeSupport java/beans/Statement)
279.36 $(call RunSamevmBatch)
279.37
279.38 # Stable othervm testruns (minus items from PROBLEM_LIST)
279.39 # Using samevm has serious problems with these tests
279.40 JDK_ALL_TARGETS += jdk_beans2
279.41 -jdk_beans2: java/beans/Beans java/beans/EventHandler java/beans/XMLDecoder \
279.42 - java/beans/PropertyEditor
279.43 +jdk_beans2: $(call TestDirs, \
279.44 + java/beans/Beans java/beans/EventHandler java/beans/XMLDecoder \
279.45 + java/beans/PropertyEditor)
279.46 $(call RunOthervmBatch)
279.47
279.48 # Stable othervm testruns (minus items from PROBLEM_LIST)
279.49 # Using samevm has serious problems with these tests
279.50 JDK_ALL_TARGETS += jdk_beans3
279.51 -jdk_beans3: java/beans/XMLEncoder
279.52 +jdk_beans3: $(call TestDirs, java/beans/XMLEncoder)
279.53 $(call RunOthervmBatch)
279.54
279.55 # All beans tests
279.56 @@ -449,24 +451,24 @@
279.57
279.58 # Stable samevm testruns (minus items from PROBLEM_LIST)
279.59 JDK_ALL_TARGETS += jdk_io
279.60 -jdk_io: java/io
279.61 +jdk_io: $(call TestDirs, java/io)
279.62 $(call RunSamevmBatch)
279.63
279.64 # Stable samevm testruns (minus items from PROBLEM_LIST)
279.65 JDK_ALL_TARGETS += jdk_lang
279.66 -jdk_lang: java/lang
279.67 +jdk_lang: $(call TestDirs, java/lang)
279.68 $(call RunSamevmBatch)
279.69
279.70 # Stable othervm testruns (minus items from PROBLEM_LIST)
279.71 # Using samevm has serious problems with these tests
279.72 JDK_ALL_TARGETS += jdk_management1
279.73 -jdk_management1: javax/management
279.74 +jdk_management1: $(call TestDirs, javax/management)
279.75 $(call RunOthervmBatch)
279.76
279.77 # Stable othervm testruns (minus items from PROBLEM_LIST)
279.78 # Using samevm has serious problems with these tests
279.79 JDK_ALL_TARGETS += jdk_management2
279.80 -jdk_management2: com/sun/jmx com/sun/management sun/management
279.81 +jdk_management2: $(call TestDirs, com/sun/jmx com/sun/management sun/management)
279.82 $(call RunOthervmBatch)
279.83
279.84 # All management tests
279.85 @@ -475,36 +477,37 @@
279.86
279.87 # Stable samevm testruns (minus items from PROBLEM_LIST)
279.88 JDK_ALL_TARGETS += jdk_math
279.89 -jdk_math: java/math
279.90 +jdk_math: $(call TestDirs, java/math)
279.91 $(call RunSamevmBatch)
279.92
279.93 # Stable samevm testruns (minus items from PROBLEM_LIST)
279.94 JDK_ALL_TARGETS += jdk_misc
279.95 -jdk_misc: demo javax/imageio javax/naming javax/print javax/script \
279.96 +jdk_misc: $(call TestDirs, \
279.97 + demo javax/imageio javax/naming javax/print javax/script \
279.98 javax/smartcardio javax/sound com/sun/java com/sun/jndi \
279.99 - com/sun/org sun/misc sun/pisces
279.100 + com/sun/org com/sun/xml sun/misc sun/pisces)
279.101 $(call RunSamevmBatch)
279.102
279.103 # Stable samevm testruns (minus items from PROBLEM_LIST)
279.104 JDK_ALL_TARGETS += jdk_net
279.105 -jdk_net: com/sun/net java/net sun/net
279.106 +jdk_net: $(call TestDirs, com/sun/net java/net sun/net)
279.107 $(call RunSamevmBatch)
279.108
279.109 # Stable samevm testruns (minus items from PROBLEM_LIST)
279.110 JDK_ALL_TARGETS += jdk_nio1
279.111 -jdk_nio1: java/nio/file
279.112 +jdk_nio1: $(call TestDirs, java/nio/file)
279.113 $(call RunSamevmBatch)
279.114
279.115 # Stable samevm testruns (minus items from PROBLEM_LIST)
279.116 JDK_ALL_TARGETS += jdk_nio2
279.117 -jdk_nio2: java/nio/Buffer java/nio/ByteOrder \
279.118 - java/nio/channels java/nio/BufferPoolMXBean java/nio/MappedByteBuffer
279.119 +jdk_nio2: $(call TestDirs, java/nio/Buffer java/nio/ByteOrder \
279.120 + java/nio/channels java/nio/BufferPoolMXBean java/nio/MappedByteBuffer)
279.121 $(call SharedLibraryPermissions,java/nio/channels)
279.122 $(call RunSamevmBatch)
279.123
279.124 # Stable samevm testruns (minus items from PROBLEM_LIST)
279.125 JDK_ALL_TARGETS += jdk_nio3
279.126 -jdk_nio3: com/sun/nio sun/nio
279.127 +jdk_nio3: $(call TestDirs, com/sun/nio sun/nio)
279.128 $(call RunSamevmBatch)
279.129
279.130 # All nio tests
279.131 @@ -514,24 +517,25 @@
279.132 # Stable othervm testruns (minus items from PROBLEM_LIST)
279.133 # Using samevm has serious problems with these tests
279.134 JDK_ALL_TARGETS += jdk_rmi
279.135 -jdk_rmi: java/rmi javax/rmi sun/rmi
279.136 +jdk_rmi: $(call TestDirs, java/rmi javax/rmi sun/rmi)
279.137 $(call RunOthervmBatch)
279.138
279.139 # Stable samevm testruns (minus items from PROBLEM_LIST)
279.140 JDK_ALL_TARGETS += jdk_security1
279.141 -jdk_security1: java/security
279.142 +jdk_security1: $(call TestDirs, java/security)
279.143 $(call RunSamevmBatch)
279.144
279.145 # Stable othervm testruns (minus items from PROBLEM_LIST)
279.146 # Using samevm has serious problems with these tests
279.147 JDK_ALL_TARGETS += jdk_security2
279.148 -jdk_security2: javax/crypto com/sun/crypto
279.149 +jdk_security2: $(call TestDirs, javax/crypto com/sun/crypto)
279.150 $(call RunOthervmBatch)
279.151
279.152 # Stable othervm testruns (minus items from PROBLEM_LIST)
279.153 # Using samevm has serious problems with these tests
279.154 JDK_ALL_TARGETS += jdk_security3
279.155 -jdk_security3: com/sun/security lib/security javax/security sun/security
279.156 +jdk_security3: $(call TestDirs, com/sun/security lib/security \
279.157 + javax/security sun/security)
279.158 $(call SharedLibraryPermissions,sun/security)
279.159 $(call RunOthervmBatch)
279.160
279.161 @@ -542,23 +546,25 @@
279.162 # Stable othervm testruns (minus items from PROBLEM_LIST)
279.163 # Using samevm has problems, and doesn't help performance as much as others.
279.164 JDK_ALL_TARGETS += jdk_swing
279.165 -jdk_swing: javax/swing sun/java2d
279.166 +jdk_swing: $(call TestDirs, javax/swing sun/java2d)
279.167 $(call RunOthervmBatch)
279.168
279.169 # Stable samevm testruns (minus items from PROBLEM_LIST)
279.170 JDK_ALL_TARGETS += jdk_text
279.171 -jdk_text: java/text sun/text
279.172 +jdk_text: $(call TestDirs, java/text sun/text)
279.173 $(call RunSamevmBatch)
279.174
279.175 # Stable samevm testruns (minus items from PROBLEM_LIST)
279.176 JDK_ALL_TARGETS += jdk_tools1
279.177 -jdk_tools1: com/sun/jdi
279.178 +jdk_tools1: $(call TestDirs, com/sun/jdi)
279.179 $(call RunSamevmBatch)
279.180
279.181 # Stable othervm testruns (minus items from PROBLEM_LIST)
279.182 # Using samevm has serious problems with these tests
279.183 JDK_ALL_TARGETS += jdk_tools2
279.184 -jdk_tools2: com/sun/tools sun/jvmstat sun/tools tools vm com/sun/servicetag com/sun/tracing
279.185 +jdk_tools2: $(call TestDirs, \
279.186 + com/sun/tools sun/jvmstat sun/tools tools vm \
279.187 + com/sun/servicetag com/sun/tracing)
279.188 $(call SharedLibraryPermissions,tools/launcher)
279.189 $(call RunSamevmBatch)
279.190
279.191 @@ -568,7 +574,7 @@
279.192
279.193 # Stable samevm testruns (minus items from PROBLEM_LIST)
279.194 JDK_ALL_TARGETS += jdk_util
279.195 -jdk_util: java/util sun/util
279.196 +jdk_util: $(call TestDirs, java/util sun/util)
279.197 $(call RunSamevmBatch)
279.198
279.199 # ------------------------------------------------------------------
280.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
280.2 +++ b/test/java/awt/font/TextLayout/CombiningPerf.java Tue Mar 29 20:19:55 2011 -0700
280.3 @@ -0,0 +1,85 @@
280.4 +/*
280.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
280.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
280.7 + *
280.8 + * This code is free software; you can redistribute it and/or modify it
280.9 + * under the terms of the GNU General Public License version 2 only, as
280.10 + * published by the Free Software Foundation.
280.11 + *
280.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
280.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
280.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
280.15 + * version 2 for more details (a copy is included in the LICENSE file that
280.16 + * accompanied this code).
280.17 + *
280.18 + * You should have received a copy of the GNU General Public License version
280.19 + * 2 along with this work; if not, write to the Free Software Foundation,
280.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
280.21 + *
280.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
280.23 + * or visit www.oracle.com if you need additional information or have any
280.24 + * questions.
280.25 + */
280.26 +
280.27 +/**
280.28 + * @test
280.29 + * @bug 6328154 6962082
280.30 + * @summary ensure that ascii, and latin-1 text without combining marks, both layout faster
280.31 + * than latin-1 text with combining marks. The presumption is then that the canonical
280.32 + * GSUB table is being run only on the latter and not on either of the former.
280.33 + */
280.34 +
280.35 +import java.awt.Font;
280.36 +import java.awt.GraphicsEnvironment;
280.37 +import java.awt.font.FontRenderContext;
280.38 +import java.awt.font.TextLayout;
280.39 +
280.40 +import static java.awt.Font.*;
280.41 +
280.42 +public class CombiningPerf {
280.43 + private static Font font;
280.44 + private static FontRenderContext frc;
280.45 +
280.46 + public static void main(String[] args) throws Exception {
280.47 + System.err.println("start");
280.48 +
280.49 + GraphicsEnvironment.getLocalGraphicsEnvironment();
280.50 +
280.51 + font = new Font("Lucida Sans Regular", PLAIN, 12);
280.52 + frc = new FontRenderContext(null, false, false);
280.53 +
280.54 + String ascii = "the characters are critical noodles?";
280.55 + String french = "l'aper\u00e7u caract\u00e8re one \u00e9t\u00e9 cr\u00e9\u00e9s";
280.56 + String frenchX = "l'aper\u00e7u caracte\u0300re one e\u0301te\u0301 ere\u0301e\u0301s";
280.57 +
280.58 + // warmup
280.59 + for (int i = 0; i < 100; ++i) {
280.60 + TextLayout tl = new TextLayout(french, font, frc);
280.61 + tl = new TextLayout(ascii, font, frc);
280.62 + tl = new TextLayout(frenchX, font, frc);
280.63 + }
280.64 + /**/
280.65 + long atime = test(ascii);
280.66 + System.err.println("atime: " + (atime/1000000.0) + " length: " + ascii.length());
280.67 +
280.68 + long ftime = test(french);
280.69 + System.err.println("ftime: " + (ftime/1000000.0) + " length: " + french.length());
280.70 +
280.71 + long xtime = test(frenchX);
280.72 + System.err.println("xtime: " + (xtime/1000000.0) + " length: " + frenchX.length());
280.73 +
280.74 + long limit = xtime * 2 / 3;
280.75 + if (atime > limit || ftime > limit) {
280.76 + throw new Exception("took too long");
280.77 + }
280.78 + /**/
280.79 + }
280.80 +
280.81 + private static long test(String text) {
280.82 + long start = System.nanoTime();
280.83 + for (int i = 0; i < 2000; ++i) {
280.84 + TextLayout tl = new TextLayout(text, font, frc);
280.85 + }
280.86 + return System.nanoTime() - start;
280.87 + }
280.88 +}
281.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
281.2 +++ b/test/java/awt/font/TextLayout/KernCrash.java Tue Mar 29 20:19:55 2011 -0700
281.3 @@ -0,0 +1,67 @@
281.4 +/*
281.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
281.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
281.7 + *
281.8 + * This code is free software; you can redistribute it and/or modify it
281.9 + * under the terms of the GNU General Public License version 2 only, as
281.10 + * published by the Free Software Foundation.
281.11 + *
281.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
281.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
281.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
281.15 + * version 2 for more details (a copy is included in the LICENSE file that
281.16 + * accompanied this code).
281.17 + *
281.18 + * You should have received a copy of the GNU General Public License version
281.19 + * 2 along with this work; if not, write to the Free Software Foundation,
281.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
281.21 + *
281.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
281.23 + * or visit www.oracle.com if you need additional information or have any
281.24 + * questions.
281.25 + */
281.26 +
281.27 +import java.io.*;
281.28 +import java.awt.*;
281.29 +import java.awt.font.*;
281.30 +import java.util.*;
281.31 +
281.32 +/**
281.33 + * Shows (top) with kerning, (middle) without, (bottom) also without.
281.34 + *
281.35 + * @bug 7017324
281.36 + */
281.37 +public class KernCrash extends Frame {
281.38 + private static Font font0;
281.39 + private static Font font1;
281.40 + private static Font font2;
281.41 +
281.42 + public static void main(String[] args) throws Exception {
281.43 + HashMap attrs = new HashMap();
281.44 + font0 = Font.createFont(Font.TRUETYPE_FONT, new File("Vera.ttf"));
281.45 + System.out.println("using " + font0);
281.46 + attrs.put(TextAttribute.SIZE, new Float(58f));
281.47 + font1 = font0.deriveFont(attrs);
281.48 + attrs.put(TextAttribute.KERNING, TextAttribute.KERNING_ON);
281.49 + font2 = font0.deriveFont(attrs);
281.50 +
281.51 + KernCrash f = new KernCrash();
281.52 + f.setTitle("Kerning Crash");
281.53 + f.setSize(600, 300);
281.54 + f.setForeground(Color.black);
281.55 + f.show();
281.56 + }
281.57 +
281.58 + public void paint(Graphics g) {
281.59 + Graphics2D g2 = (Graphics2D)g;
281.60 + FontRenderContext frc = g2.getFontRenderContext();
281.61 + TextLayout layout = new TextLayout("text", font2, frc);
281.62 + layout.draw(g2, 10, 150);
281.63 +
281.64 + String s = "WAVATastic";
281.65 + TextLayout layout2 = new TextLayout(s, font1, frc);
281.66 + layout2.draw(g2, 10, 200);
281.67 + TextLayout layout3 = new TextLayout(s, font2, frc);
281.68 + layout3.draw(g2, 10, 100);
281.69 + }
281.70 +}
282.1 --- a/test/java/dyn/ClassValueTest.java Tue Mar 29 11:29:01 2011 -0700
282.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
282.3 @@ -1,165 +0,0 @@
282.4 -/*
282.5 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
282.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
282.7 - *
282.8 - * This code is free software; you can redistribute it and/or modify it
282.9 - * under the terms of the GNU General Public License version 2 only, as
282.10 - * published by the Free Software Foundation. Oracle designates this
282.11 - * particular file as subject to the "Classpath" exception as provided
282.12 - * by Oracle in the LICENSE file that accompanied this code.
282.13 - *
282.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
282.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
282.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
282.17 - * version 2 for more details (a copy is included in the LICENSE file that
282.18 - * accompanied this code).
282.19 - *
282.20 - * You should have received a copy of the GNU General Public License version
282.21 - * 2 along with this work; if not, write to the Free Software Foundation,
282.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
282.23 - *
282.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
282.25 - * or visit www.oracle.com if you need additional information or have any
282.26 - * questions.
282.27 - */
282.28 -
282.29 -/* @test
282.30 - * @summary tests for class-specific values
282.31 - * @compile ClassValueTest.java
282.32 - * @run junit/othervm test.java.dyn.ClassValueTest
282.33 - */
282.34 -
282.35 -/*
282.36 - Manually:
282.37 - $ $JAVA7X_HOME/bin/javac -d foo -cp $JUNIT4_JAR test/java/dyn/ClassValueTest.java
282.38 - $ $JAVA7X_HOME/bin/java -cp foo:$JUNIT4_JAR org.junit.runner.JUnitCore test.java.dyn.ClassValueTest
282.39 - Output: .testAdd => 1000 : Integer
282.40 - */
282.41 -
282.42 -package test.java.dyn;
282.43 -
282.44 -import java.util.*;
282.45 -
282.46 -import java.dyn.*;
282.47 -
282.48 -import org.junit.*;
282.49 -import static org.junit.Assert.*;
282.50 -
282.51 -/**
282.52 - * @author jrose
282.53 - */
282.54 -public class ClassValueTest {
282.55 - static String nameForCV1(Class<?> type) {
282.56 - return "CV1:" + type.getName();
282.57 - }
282.58 - static int countForCV1;
282.59 - static final ClassValue<String> CV1 = new CV1();
282.60 - private static class CV1 extends ClassValue<String> {
282.61 - protected String computeValue(Class<?> type) {
282.62 - countForCV1++;
282.63 - return nameForCV1(type);
282.64 - }
282.65 - }
282.66 -
282.67 - static final Class[] CLASSES = {
282.68 - String.class,
282.69 - Integer.class,
282.70 - int.class,
282.71 - boolean[].class,
282.72 - char[][].class,
282.73 - ClassValueTest.class
282.74 - };
282.75 -
282.76 - @Test
282.77 - public void testGet() {
282.78 - countForCV1 = 0;
282.79 - for (Class c : CLASSES) {
282.80 - assertEquals(nameForCV1(c), CV1.get(c));
282.81 - }
282.82 - assertEquals(CLASSES.length, countForCV1);
282.83 - for (Class c : CLASSES) {
282.84 - assertEquals(nameForCV1(c), CV1.get(c));
282.85 - }
282.86 - assertEquals(CLASSES.length, countForCV1);
282.87 - }
282.88 -
282.89 - @Test
282.90 - public void testRemove() {
282.91 - for (Class c : CLASSES) {
282.92 - CV1.get(c);
282.93 - }
282.94 - countForCV1 = 0;
282.95 - int REMCOUNT = 3;
282.96 - for (int i = 0; i < REMCOUNT; i++) {
282.97 - CV1.remove(CLASSES[i]);
282.98 - }
282.99 - assertEquals(0, countForCV1); // no change
282.100 - for (Class c : CLASSES) {
282.101 - assertEquals(nameForCV1(c), CV1.get(c));
282.102 - }
282.103 - assertEquals(REMCOUNT, countForCV1);
282.104 - }
282.105 -
282.106 - static String nameForCVN(Class<?> type, int n) {
282.107 - return "CV[" + n + "]" + type.getName();
282.108 - }
282.109 - static int countForCVN;
282.110 - static class CVN extends ClassValue<String> {
282.111 - final int n;
282.112 - CVN(int n) { this.n = n; }
282.113 - protected String computeValue(Class<?> type) {
282.114 - countForCVN++;
282.115 - return nameForCVN(type, n);
282.116 - }
282.117 - };
282.118 -
282.119 - @Test
282.120 - public void testGetMany() {
282.121 - int CVN_COUNT1 = 100, CVN_COUNT2 = 100;
282.122 - CVN cvns[] = new CVN[CVN_COUNT1 * CVN_COUNT2];
282.123 - for (int n = 0; n < cvns.length; n++) {
282.124 - cvns[n] = new CVN(n);
282.125 - }
282.126 - countForCVN = 0;
282.127 - for (int pass = 0; pass <= 2; pass++) {
282.128 - for (int i1 = 0; i1 < CVN_COUNT1; i1++) {
282.129 - eachClass:
282.130 - for (Class c : CLASSES) {
282.131 - for (int i2 = 0; i2 < CVN_COUNT2; i2++) {
282.132 - int n = i1*CVN_COUNT2 + i2;
282.133 - assertEquals(0, countForCVN);
282.134 - assertEquals(nameForCVN(c, n), cvns[n].get(c));
282.135 - cvns[n].get(c); //get it again
282.136 - //System.out.println("getting "+n+":"+cvns[n].get(c));
282.137 - boolean doremove = (((i1 + i2) & 3) == 0);
282.138 - switch (pass) {
282.139 - case 0:
282.140 - assertEquals(1, countForCVN);
282.141 - break;
282.142 - case 1:
282.143 - // remove on middle pass
282.144 - assertEquals(0, countForCVN);
282.145 - if (doremove) {
282.146 - //System.out.println("removing "+n+":"+cvns[n].get(c));
282.147 - cvns[n].remove(c);
282.148 - assertEquals(0, countForCVN);
282.149 - }
282.150 - break;
282.151 - case 2:
282.152 - assertEquals(doremove ? 1 : 0, countForCVN);
282.153 - break;
282.154 - }
282.155 - countForCVN = 0;
282.156 - if (i1 > i2 && i1 < i2+5) continue eachClass; // leave diagonal gap
282.157 - }
282.158 - }
282.159 - }
282.160 - }
282.161 - assertEquals(countForCVN, 0);
282.162 - for (int n = 0; n < cvns.length; n++) {
282.163 - for (Class c : CLASSES) {
282.164 - assertEquals(nameForCVN(c, n), cvns[n].get(c));
282.165 - }
282.166 - }
282.167 - }
282.168 -}
283.1 --- a/test/java/dyn/InvokeDynamicPrintArgs.java Tue Mar 29 11:29:01 2011 -0700
283.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
283.3 @@ -1,187 +0,0 @@
283.4 -/*
283.5 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
283.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
283.7 - *
283.8 - * This code is free software; you can redistribute it and/or modify it
283.9 - * under the terms of the GNU General Public License version 2 only, as
283.10 - * published by the Free Software Foundation.
283.11 - *
283.12 - * This code is distributed in the hope that it will be useful, but WITHOUT
283.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
283.14 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
283.15 - * version 2 for more details (a copy is included in the LICENSE file that
283.16 - * accompanied this code).
283.17 - *
283.18 - * You should have received a copy of the GNU General Public License version
283.19 - * 2 along with this work; if not, write to the Free Software Foundation,
283.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
283.21 - *
283.22 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
283.23 - * or visit www.oracle.com if you need additional information or have any
283.24 - * questions.
283.25 - */
283.26 -
283.27 -/* @test
283.28 - * @summary smoke test for invokedynamic instructions
283.29 - * @build indify.Indify
283.30 - * @compile InvokeDynamicPrintArgs.java
283.31 - * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic
283.32 - * indify.Indify
283.33 - * --verify-specifier-count=3 --transitionalJSR292=false
283.34 - * --expand-properties --classpath ${test.classes}
283.35 - * --java test.java.dyn.InvokeDynamicPrintArgs --check-output
283.36 - */
283.37 -
283.38 -package test.java.dyn;
283.39 -
283.40 -import org.junit.Test;
283.41 -
283.42 -import java.util.*;
283.43 -import java.io.*;
283.44 -
283.45 -import java.dyn.*;
283.46 -import static java.dyn.MethodHandles.*;
283.47 -import static java.dyn.MethodType.*;
283.48 -
283.49 -public class InvokeDynamicPrintArgs {
283.50 - public static void main(String... av) throws Throwable {
283.51 - if (av.length > 0) openBuf(); // --check-output mode
283.52 - System.out.println("Printing some argument lists, starting with a empty one:");
283.53 - INDY_nothing().invokeExact(); // BSM specifier #0 = {bsm}
283.54 - INDY_bar().invokeExact("bar arg", 1); // BSM specifier #1 = {bsm2, Void.class, "void type"}
283.55 - INDY_bar2().invokeExact("bar2 arg", 222); // BSM specifier #1 = (same)
283.56 - INDY_baz().invokeExact("baz arg", 2, 3.14); // BSM specifier #2 = {bsm2, 1234.5}
283.57 - INDY_foo().invokeExact("foo arg"); // BSM specifier #0 = (same)
283.58 - // Hence, BSM specifier count should be 3. See "--verify-specifier-count=3" above.
283.59 - System.out.println("Done printing argument lists.");
283.60 - closeBuf();
283.61 - }
283.62 -
283.63 - @Test
283.64 - public void testInvokeDynamicPrintArgs() throws IOException {
283.65 - System.err.println(System.getProperties());
283.66 - String testClassPath = System.getProperty("build.test.classes.dir");
283.67 - if (testClassPath == null) throw new RuntimeException();
283.68 - String[] args = new String[]{
283.69 - "--verify-specifier-count=3", "--transitionalJSR292=false",
283.70 - "--expand-properties", "--classpath", testClassPath,
283.71 - "--java", "test.java.dyn.InvokeDynamicPrintArgs", "--check-output"
283.72 - };
283.73 - System.err.println("Indify: "+Arrays.toString(args));
283.74 - indify.Indify.main(args);
283.75 - }
283.76 -
283.77 - private static PrintStream oldOut;
283.78 - private static ByteArrayOutputStream buf;
283.79 - private static void openBuf() {
283.80 - oldOut = System.out;
283.81 - buf = new ByteArrayOutputStream();
283.82 - System.setOut(new PrintStream(buf));
283.83 - }
283.84 - private static void closeBuf() {
283.85 - if (buf == null) return;
283.86 - System.out.flush();
283.87 - System.setOut(oldOut);
283.88 - String[] haveLines = new String(buf.toByteArray()).split("[\n\r]+");
283.89 - for (String line : haveLines) System.out.println(line);
283.90 - Iterator<String> iter = Arrays.asList(haveLines).iterator();
283.91 - for (String want : EXPECT_OUTPUT) {
283.92 - String have = iter.hasNext() ? iter.next() : "[EOF]";
283.93 - if (want.equals(have)) continue;
283.94 - System.err.println("want line: "+want);
283.95 - System.err.println("have line: "+have);
283.96 - throw new AssertionError("unexpected output: "+have);
283.97 - }
283.98 - if (iter.hasNext())
283.99 - throw new AssertionError("unexpected output: "+iter.next());
283.100 - }
283.101 - private static final String[] EXPECT_OUTPUT = {
283.102 - "Printing some argument lists, starting with a empty one:",
283.103 - "[test.java.dyn.InvokeDynamicPrintArgs, nothing, ()void][]",
283.104 - "[test.java.dyn.InvokeDynamicPrintArgs, bar, (String,int)void, class java.lang.Void, void type!, 1, 234.5, 67.5, 89][bar arg, 1]",
283.105 - "[test.java.dyn.InvokeDynamicPrintArgs, bar2, (String,int)void, class java.lang.Void, void type!, 1, 234.5, 67.5, 89][bar2 arg, 222]",
283.106 - "[test.java.dyn.InvokeDynamicPrintArgs, baz, (String,int,double)void, 1234.5][baz arg, 2, 3.14]",
283.107 - "[test.java.dyn.InvokeDynamicPrintArgs, foo, (String)void][foo arg]",
283.108 - "Done printing argument lists."
283.109 - };
283.110 -
283.111 - private static void printArgs(Object bsmInfo, Object... args) {
283.112 - System.out.println(bsmInfo+Arrays.deepToString(args));
283.113 - }
283.114 - private static MethodHandle MH_printArgs() throws ReflectiveOperationException {
283.115 - shouldNotCallThis();
283.116 - return lookup().findStatic(lookup().lookupClass(),
283.117 - "printArgs", methodType(void.class, Object.class, Object[].class));
283.118 - }
283.119 -
283.120 - private static CallSite bsm(Lookup caller, String name, MethodType type) throws ReflectiveOperationException {
283.121 - // ignore caller and name, but match the type:
283.122 - Object bsmInfo = Arrays.asList(caller, name, type);
283.123 - return new ConstantCallSite(MH_printArgs().bindTo(bsmInfo).asCollector(Object[].class, type.parameterCount()).asType(type));
283.124 - }
283.125 - private static MethodType MT_bsm() {
283.126 - shouldNotCallThis();
283.127 - return methodType(CallSite.class, Lookup.class, String.class, MethodType.class);
283.128 - }
283.129 - private static MethodHandle MH_bsm() throws ReflectiveOperationException {
283.130 - shouldNotCallThis();
283.131 - return lookup().findStatic(lookup().lookupClass(), "bsm", MT_bsm());
283.132 - }
283.133 -
283.134 - private static CallSite bsm2(Lookup caller, String name, MethodType type, Object... arg) throws ReflectiveOperationException {
283.135 - // ignore caller and name, but match the type:
283.136 - List<Object> bsmInfo = new ArrayList<>(Arrays.asList(caller, name, type));
283.137 - bsmInfo.addAll(Arrays.asList((Object[])arg));
283.138 - return new ConstantCallSite(MH_printArgs().bindTo(bsmInfo).asCollector(Object[].class, type.parameterCount()).asType(type));
283.139 - }
283.140 - private static MethodType MT_bsm2() {
283.141 - shouldNotCallThis();
283.142 - return methodType(CallSite.class, Lookup.class, String.class, MethodType.class, Object[].class);
283.143 - }
283.144 - private static MethodHandle MH_bsm2() throws ReflectiveOperationException {
283.145 - shouldNotCallThis();
283.146 - return lookup().findStatic(lookup().lookupClass(), "bsm2", MT_bsm2());
283.147 - }
283.148 -
283.149 - private static MethodHandle INDY_nothing() throws Throwable {
283.150 - shouldNotCallThis();
283.151 - return ((CallSite) MH_bsm().invokeGeneric(lookup(),
283.152 - "nothing", methodType(void.class)
283.153 - )).dynamicInvoker();
283.154 - }
283.155 - private static MethodHandle INDY_foo() throws Throwable {
283.156 - shouldNotCallThis();
283.157 - return ((CallSite) MH_bsm().invokeGeneric(lookup(),
283.158 - "foo", methodType(void.class, String.class)
283.159 - )).dynamicInvoker();
283.160 - }
283.161 - private static MethodHandle INDY_bar() throws Throwable {
283.162 - shouldNotCallThis();
283.163 - return ((CallSite) MH_bsm2().invokeGeneric(lookup(),
283.164 - "bar", methodType(void.class, String.class, int.class)
283.165 - , new Object[] { Void.class, "void type!",
283.166 - 1, 234.5F, 67.5, (long)89 }
283.167 - )).dynamicInvoker();
283.168 - }
283.169 - private static MethodHandle INDY_bar2() throws Throwable {
283.170 - shouldNotCallThis();
283.171 - return ((CallSite) MH_bsm2().invokeGeneric(lookup(),
283.172 - "bar2", methodType(void.class, String.class, int.class)
283.173 - , new Object[] { Void.class, "void type!",
283.174 - 1, 234.5F, 67.5, (long)89 }
283.175 - )).dynamicInvoker();
283.176 - }
283.177 - private static MethodHandle INDY_baz() throws Throwable {
283.178 - shouldNotCallThis();
283.179 - return ((CallSite) MH_bsm2().invokeGeneric(lookup(),
283.180 - "baz", methodType(void.class, String.class, int.class, double.class)
283.181 - , 1234.5
283.182 - )).dynamicInvoker();
283.183 - }
283.184 -
283.185 - private static void shouldNotCallThis() {
283.186 - // if this gets called, the transformation has not taken place
283.187 - if (System.getProperty("InvokeDynamicPrintArgs.allow-untransformed") != null) return;
283.188 - throw new AssertionError("this code should be statically transformed away by Indify");
283.189 - }
283.190 -}
284.1 --- a/test/java/dyn/InvokeGenericTest.java Tue Mar 29 11:29:01 2011 -0700
284.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
284.3 @@ -1,484 +0,0 @@
284.4 -/*
284.5 - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
284.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
284.7 - *
284.8 - * This code is free software; you can redistribute it and/or modify it
284.9 - * under the terms of the GNU General Public License version 2 only, as
284.10 - * published by the Free Software Foundation. Oracle designates this
284.11 - * particular file as subject to the "Classpath" exception as provided
284.12 - * by Oracle in the LICENSE file that accompanied this code.
284.13 - *
284.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
284.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
284.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
284.17 - * version 2 for more details (a copy is included in the LICENSE file that
284.18 - * accompanied this code).
284.19 - *
284.20 - * You should have received a copy of the GNU General Public License version
284.21 - * 2 along with this work; if not, write to the Free Software Foundation,
284.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
284.23 - *
284.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
284.25 - * or visit www.oracle.com if you need additional information or have any
284.26 - * questions.
284.27 - */
284.28 -
284.29 -/* @test
284.30 - * @summary unit tests for java.dyn.MethodHandle.invokeGeneric
284.31 - * @compile -XDallowTransitionalJSR292=no -target 7 InvokeGenericTest.java
284.32 - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles test.java.dyn.InvokeGenericTest
284.33 - */
284.34 -
284.35 -package test.java.dyn;
284.36 -
284.37 -import java.dyn.*;
284.38 -import static java.dyn.MethodHandles.*;
284.39 -import static java.dyn.MethodType.*;
284.40 -import java.lang.reflect.*;
284.41 -import java.util.*;
284.42 -import org.junit.*;
284.43 -import static org.junit.Assert.*;
284.44 -import static org.junit.Assume.*;
284.45 -
284.46 -
284.47 -/**
284.48 - *
284.49 - * @author jrose
284.50 - */
284.51 -public class InvokeGenericTest {
284.52 - // How much output?
284.53 - static int verbosity = 0;
284.54 - static {
284.55 - String vstr = System.getProperty("test.java.dyn.InvokeGenericTest.verbosity");
284.56 - if (vstr != null) verbosity = Integer.parseInt(vstr);
284.57 - }
284.58 -
284.59 - @Test
284.60 - public void testFirst() throws Throwable {
284.61 - verbosity += 9; try {
284.62 - // left blank for debugging
284.63 - } finally { printCounts(); verbosity -= 9; }
284.64 - }
284.65 -
284.66 - public InvokeGenericTest() {
284.67 - }
284.68 -
284.69 - @Before
284.70 - public void checkImplementedPlatform() {
284.71 - boolean platformOK = false;
284.72 - Properties properties = System.getProperties();
284.73 - String vers = properties.getProperty("java.vm.version");
284.74 - String name = properties.getProperty("java.vm.name");
284.75 - String arch = properties.getProperty("os.arch");
284.76 - if ((arch.equals("amd64") || arch.equals("i386") || arch.equals("x86") ||
284.77 - arch.equals("sparc") || arch.equals("sparcv9")) &&
284.78 - (name.contains("Client") || name.contains("Server"))
284.79 - ) {
284.80 - platformOK = true;
284.81 - } else {
284.82 - System.err.println("Skipping tests for unsupported platform: "+Arrays.asList(vers, name, arch));
284.83 - }
284.84 - assumeTrue(platformOK);
284.85 - }
284.86 -
284.87 - String testName;
284.88 - static int allPosTests, allNegTests;
284.89 - int posTests, negTests;
284.90 - @After
284.91 - public void printCounts() {
284.92 - if (verbosity >= 2 && (posTests | negTests) != 0) {
284.93 - System.out.println();
284.94 - if (posTests != 0) System.out.println("=== "+testName+": "+posTests+" positive test cases run");
284.95 - if (negTests != 0) System.out.println("=== "+testName+": "+negTests+" negative test cases run");
284.96 - allPosTests += posTests;
284.97 - allNegTests += negTests;
284.98 - posTests = negTests = 0;
284.99 - }
284.100 - }
284.101 - void countTest(boolean positive) {
284.102 - if (positive) ++posTests;
284.103 - else ++negTests;
284.104 - }
284.105 - void countTest() { countTest(true); }
284.106 - void startTest(String name) {
284.107 - if (testName != null) printCounts();
284.108 - if (verbosity >= 1)
284.109 - System.out.println(name);
284.110 - posTests = negTests = 0;
284.111 - testName = name;
284.112 - }
284.113 -
284.114 - @BeforeClass
284.115 - public static void setUpClass() throws Exception {
284.116 - calledLog.clear();
284.117 - calledLog.add(null);
284.118 - nextArgVal = INITIAL_ARG_VAL;
284.119 - }
284.120 -
284.121 - @AfterClass
284.122 - public static void tearDownClass() throws Exception {
284.123 - int posTests = allPosTests, negTests = allNegTests;
284.124 - if (verbosity >= 2 && (posTests | negTests) != 0) {
284.125 - System.out.println();
284.126 - if (posTests != 0) System.out.println("=== "+posTests+" total positive test cases");
284.127 - if (negTests != 0) System.out.println("=== "+negTests+" total negative test cases");
284.128 - }
284.129 - }
284.130 -
284.131 - static List<Object> calledLog = new ArrayList<Object>();
284.132 - static Object logEntry(String name, Object... args) {
284.133 - return Arrays.asList(name, Arrays.asList(args));
284.134 - }
284.135 - static Object called(String name, Object... args) {
284.136 - Object entry = logEntry(name, args);
284.137 - calledLog.add(entry);
284.138 - return entry;
284.139 - }
284.140 - static void assertCalled(String name, Object... args) {
284.141 - Object expected = logEntry(name, args);
284.142 - Object actual = calledLog.get(calledLog.size() - 1);
284.143 - if (expected.equals(actual) && verbosity < 9) return;
284.144 - System.out.println("assertCalled "+name+":");
284.145 - System.out.println("expected: "+expected);
284.146 - System.out.println("actual: "+actual);
284.147 - System.out.println("ex. types: "+getClasses(expected));
284.148 - System.out.println("act. types: "+getClasses(actual));
284.149 - assertEquals("previous method call", expected, actual);
284.150 - }
284.151 - static void printCalled(MethodHandle target, String name, Object... args) {
284.152 - if (verbosity >= 3)
284.153 - System.out.println("calling MH="+target+" to "+name+Arrays.toString(args));
284.154 - }
284.155 -
284.156 - static Object castToWrapper(Object value, Class<?> dst) {
284.157 - Object wrap = null;
284.158 - if (value instanceof Number)
284.159 - wrap = castToWrapperOrNull(((Number)value).longValue(), dst);
284.160 - if (value instanceof Character)
284.161 - wrap = castToWrapperOrNull((char)(Character)value, dst);
284.162 - if (wrap != null) return wrap;
284.163 - return dst.cast(value);
284.164 - }
284.165 -
284.166 - static Object castToWrapperOrNull(long value, Class<?> dst) {
284.167 - if (dst == int.class || dst == Integer.class)
284.168 - return (int)(value);
284.169 - if (dst == long.class || dst == Long.class)
284.170 - return (long)(value);
284.171 - if (dst == char.class || dst == Character.class)
284.172 - return (char)(value);
284.173 - if (dst == short.class || dst == Short.class)
284.174 - return (short)(value);
284.175 - if (dst == float.class || dst == Float.class)
284.176 - return (float)(value);
284.177 - if (dst == double.class || dst == Double.class)
284.178 - return (double)(value);
284.179 - if (dst == byte.class || dst == Byte.class)
284.180 - return (byte)(value);
284.181 - if (dst == boolean.class || dst == boolean.class)
284.182 - return ((value % 29) & 1) == 0;
284.183 - return null;
284.184 - }
284.185 -
284.186 - static final int ONE_MILLION = (1000*1000), // first int value
284.187 - TEN_BILLION = (10*1000*1000*1000), // scale factor to reach upper 32 bits
284.188 - INITIAL_ARG_VAL = ONE_MILLION << 1; // <<1 makes space for sign bit;
284.189 - static long nextArgVal;
284.190 - static long nextArg(boolean moreBits) {
284.191 - long val = nextArgVal++;
284.192 - long sign = -(val & 1); // alternate signs
284.193 - val >>= 1;
284.194 - if (moreBits)
284.195 - // Guarantee some bits in the high word.
284.196 - // In any case keep the decimal representation simple-looking,
284.197 - // with lots of zeroes, so as not to make the printed decimal
284.198 - // strings unnecessarily noisy.
284.199 - val += (val % ONE_MILLION) * TEN_BILLION;
284.200 - return val ^ sign;
284.201 - }
284.202 - static int nextArg() {
284.203 - // Produce a 32-bit result something like ONE_MILLION+(smallint).
284.204 - // Example: 1_000_042.
284.205 - return (int) nextArg(false);
284.206 - }
284.207 - static long nextArg(Class<?> kind) {
284.208 - if (kind == long.class || kind == Long.class ||
284.209 - kind == double.class || kind == Double.class)
284.210 - // produce a 64-bit result something like
284.211 - // ((TEN_BILLION+1) * (ONE_MILLION+(smallint)))
284.212 - // Example: 10_000_420_001_000_042.
284.213 - return nextArg(true);
284.214 - return (long) nextArg();
284.215 - }
284.216 -
284.217 - static Object randomArg(Class<?> param) {
284.218 - Object wrap = castToWrapperOrNull(nextArg(param), param);
284.219 - if (wrap != null) {
284.220 - return wrap;
284.221 - }
284.222 -// import sun.dyn.util.Wrapper;
284.223 -// Wrapper wrap = Wrapper.forBasicType(dst);
284.224 -// if (wrap == Wrapper.OBJECT && Wrapper.isWrapperType(dst))
284.225 -// wrap = Wrapper.forWrapperType(dst);
284.226 -// if (wrap != Wrapper.OBJECT)
284.227 -// return wrap.wrap(nextArg++);
284.228 - if (param.isInterface()) {
284.229 - for (Class<?> c : param.getClasses()) {
284.230 - if (param.isAssignableFrom(c) && !c.isInterface())
284.231 - { param = c; break; }
284.232 - }
284.233 - }
284.234 - if (param.isInterface() || param.isAssignableFrom(String.class))
284.235 - return "#"+nextArg();
284.236 - else
284.237 - try {
284.238 - return param.newInstance();
284.239 - } catch (InstantiationException ex) {
284.240 - } catch (IllegalAccessException ex) {
284.241 - }
284.242 - return null; // random class not Object, String, Integer, etc.
284.243 - }
284.244 - static Object[] randomArgs(Class<?>... params) {
284.245 - Object[] args = new Object[params.length];
284.246 - for (int i = 0; i < args.length; i++)
284.247 - args[i] = randomArg(params[i]);
284.248 - return args;
284.249 - }
284.250 - static Object[] randomArgs(int nargs, Class<?> param) {
284.251 - Object[] args = new Object[nargs];
284.252 - for (int i = 0; i < args.length; i++)
284.253 - args[i] = randomArg(param);
284.254 - return args;
284.255 - }
284.256 -
284.257 - static final Object ANON_OBJ = new Object();
284.258 - static Object zeroArg(Class<?> param) {
284.259 - Object x = castToWrapperOrNull(0L, param);
284.260 - if (x != null) return x;
284.261 - if (param.isInterface() || param.isAssignableFrom(String.class)) return "\"\"";
284.262 - if (param == Object.class) return ANON_OBJ;
284.263 - if (param.getComponentType() != null) return Array.newInstance(param.getComponentType(), 0);
284.264 - return null;
284.265 - }
284.266 - static Object[] zeroArgs(Class<?>... params) {
284.267 - Object[] args = new Object[params.length];
284.268 - for (int i = 0; i < args.length; i++)
284.269 - args[i] = zeroArg(params[i]);
284.270 - return args;
284.271 - }
284.272 - static Object[] zeroArgs(List<Class<?>> params) {
284.273 - return zeroArgs(params.toArray(new Class<?>[0]));
284.274 - }
284.275 -
284.276 - static <T, E extends T> T[] array(Class<T[]> atype, E... a) {
284.277 - return Arrays.copyOf(a, a.length, atype);
284.278 - }
284.279 - static <T> T[] cat(T[] a, T... b) {
284.280 - int alen = a.length, blen = b.length;
284.281 - if (blen == 0) return a;
284.282 - T[] c = Arrays.copyOf(a, alen + blen);
284.283 - System.arraycopy(b, 0, c, alen, blen);
284.284 - return c;
284.285 - }
284.286 - static Integer[] boxAll(int... vx) {
284.287 - Integer[] res = new Integer[vx.length];
284.288 - for (int i = 0; i < res.length; i++) {
284.289 - res[i] = vx[i];
284.290 - }
284.291 - return res;
284.292 - }
284.293 - static Object getClasses(Object x) {
284.294 - if (x == null) return x;
284.295 - if (x instanceof String) return x; // keep the name
284.296 - if (x instanceof List) {
284.297 - // recursively report classes of the list elements
284.298 - Object[] xa = ((List)x).toArray();
284.299 - for (int i = 0; i < xa.length; i++)
284.300 - xa[i] = getClasses(xa[i]);
284.301 - return Arrays.asList(xa);
284.302 - }
284.303 - return x.getClass().getSimpleName();
284.304 - }
284.305 -
284.306 - static MethodHandle changeArgTypes(MethodHandle target, Class<?> argType) {
284.307 - return changeArgTypes(target, 0, 999, argType);
284.308 - }
284.309 - static MethodHandle changeArgTypes(MethodHandle target,
284.310 - int beg, int end, Class<?> argType) {
284.311 - MethodType targetType = target.type();
284.312 - end = Math.min(end, targetType.parameterCount());
284.313 - ArrayList<Class<?>> argTypes = new ArrayList<Class<?>>(targetType.parameterList());
284.314 - Collections.fill(argTypes.subList(beg, end), argType);
284.315 - MethodType ttype2 = MethodType.methodType(targetType.returnType(), argTypes);
284.316 - return MethodHandles.convertArguments(target, ttype2);
284.317 - }
284.318 -
284.319 - // This lookup is good for all members in and under InvokeGenericTest.
284.320 - static final Lookup LOOKUP = MethodHandles.lookup();
284.321 -
284.322 - Map<List<Class<?>>, MethodHandle> CALLABLES = new HashMap<List<Class<?>>, MethodHandle>();
284.323 - MethodHandle callable(List<Class<?>> params) {
284.324 - MethodHandle mh = CALLABLES.get(params);
284.325 - if (mh == null) {
284.326 - mh = collector_MH.asType(methodType(Object.class, params));
284.327 - CALLABLES.put(params, mh);
284.328 - }
284.329 - return mh;
284.330 - }
284.331 - MethodHandle callable(Class<?>... params) {
284.332 - return callable(Arrays.asList(params));
284.333 - }
284.334 - private static Object collector(Object... args) {
284.335 - return Arrays.asList(args);
284.336 - }
284.337 - private static final MethodHandle collector_MH;
284.338 - static {
284.339 - try {
284.340 - collector_MH
284.341 - = LOOKUP.findStatic(LOOKUP.lookupClass(),
284.342 - "collector",
284.343 - methodType(Object.class, Object[].class));
284.344 - } catch (ReflectiveOperationException ex) {
284.345 - throw new RuntimeException(ex);
284.346 - }
284.347 - }
284.348 -
284.349 - @Test
284.350 - public void testSimple() throws Throwable {
284.351 - startTest("testSimple");
284.352 - countTest();
284.353 - String[] args = { "one", "two" };
284.354 - MethodHandle mh = callable(Object.class, String.class);
284.355 - Object res; List resl;
284.356 - res = resl = (List) mh.invokeGeneric((String)args[0], (Object)args[1]);
284.357 - //System.out.println(res);
284.358 - assertEquals(Arrays.asList(args), res);
284.359 - }
284.360 -
284.361 - @Test
284.362 - public void testWrongArgumentCount() throws Throwable {
284.363 - startTest("testWrongArgumentCount");
284.364 - for (int i = 0; i <= 10; i++) {
284.365 - testWrongArgumentCount(Collections.<Class<?>>nCopies(i, Integer.class));
284.366 - if (i <= 4) {
284.367 - testWrongArgumentCount(Collections.<Class<?>>nCopies(i, int.class));
284.368 - testWrongArgumentCount(Collections.<Class<?>>nCopies(i, long.class));
284.369 - }
284.370 - }
284.371 - }
284.372 - public void testWrongArgumentCount(List<Class<?>> params) throws Throwable {
284.373 - int max = params.size();
284.374 - for (int i = 0; i < max; i++) {
284.375 - List<Class<?>> params2 = params.subList(0, i);
284.376 - for (int k = 0; k <= 2; k++) {
284.377 - if (k == 1) params = methodType(Object.class, params).generic().parameterList();
284.378 - if (k == 2) params2 = methodType(Object.class, params2).generic().parameterList();
284.379 - testWrongArgumentCount(params, params2);
284.380 - testWrongArgumentCount(params2, params);
284.381 - }
284.382 - }
284.383 - }
284.384 - public void testWrongArgumentCount(List<Class<?>> expect, List<Class<?>> observe) throws Throwable {
284.385 - countTest(false);
284.386 - if (expect.equals(observe))
284.387 - assert(false);
284.388 - MethodHandle target = callable(expect);
284.389 - Object[] args = zeroArgs(observe);
284.390 - Object junk;
284.391 - try {
284.392 - switch (args.length) {
284.393 - case 0:
284.394 - junk = target.invokeGeneric(); break;
284.395 - case 1:
284.396 - junk = target.invokeGeneric(args[0]); break;
284.397 - case 2:
284.398 - junk = target.invokeGeneric(args[0], args[1]); break;
284.399 - case 3:
284.400 - junk = target.invokeGeneric(args[0], args[1], args[2]); break;
284.401 - case 4:
284.402 - junk = target.invokeGeneric(args[0], args[1], args[2], args[3]); break;
284.403 - default:
284.404 - junk = target.invokeWithArguments(args); break;
284.405 - }
284.406 - } catch (WrongMethodTypeException ex) {
284.407 - return;
284.408 - } catch (Exception ex) {
284.409 - throw new RuntimeException("wrong exception calling "+target+target.type()+" on "+Arrays.asList(args)+" : "+ex);
284.410 - }
284.411 - throw new RuntimeException("bad success calling "+target+target.type()+" on "+Arrays.asList(args));
284.412 - }
284.413 -
284.414 - /** Make a list of all combinations of the given types, with the given arities.
284.415 - * A void return type is possible iff the first type is void.class.
284.416 - */
284.417 - static List<MethodType> allMethodTypes(int minargc, int maxargc, Class<?>... types) {
284.418 - ArrayList<MethodType> result = new ArrayList<MethodType>();
284.419 - if (types.length > 0) {
284.420 - ArrayList<MethodType> argcTypes = new ArrayList<MethodType>();
284.421 - // build arity-zero types first
284.422 - for (Class<?> rtype : types) {
284.423 - argcTypes.add(MethodType.methodType(rtype));
284.424 - }
284.425 - if (types[0] == void.class)
284.426 - // void is not an argument type
284.427 - types = Arrays.copyOfRange(types, 1, types.length);
284.428 - for (int argc = 0; argc <= maxargc; argc++) {
284.429 - if (argc >= minargc)
284.430 - result.addAll(argcTypes);
284.431 - if (argc >= maxargc)
284.432 - break;
284.433 - ArrayList<MethodType> prevTypes = argcTypes;
284.434 - argcTypes = new ArrayList<MethodType>();
284.435 - for (MethodType prevType : prevTypes) {
284.436 - for (Class<?> ptype : types) {
284.437 - argcTypes.add(prevType.insertParameterTypes(argc, ptype));
284.438 - }
284.439 - }
284.440 - }
284.441 - }
284.442 - return Collections.unmodifiableList(result);
284.443 - }
284.444 - static List<MethodType> allMethodTypes(int argc, Class<?>... types) {
284.445 - return allMethodTypes(argc, argc, types);
284.446 - }
284.447 -
284.448 - interface RandomInterface { }
284.449 -
284.450 - MethodHandle toString_MH;
284.451 -
284.452 - @Test
284.453 - public void testReferenceConversions() throws Throwable {
284.454 - startTest("testReferenceConversions");
284.455 - toString_MH = LOOKUP.
284.456 - findVirtual(Object.class, "toString", MethodType.methodType(String.class));
284.457 - String[] args = { "one", "two" };
284.458 - for (MethodType type : allMethodTypes(2, Object.class, String.class, RandomInterface.class)) {
284.459 - testReferenceConversions(type, args);
284.460 - }
284.461 - }
284.462 - public void testReferenceConversions(MethodType type, Object... args) throws Throwable {
284.463 - countTest();
284.464 - if (verbosity > 3) System.out.println("target type: "+type);
284.465 - MethodHandle mh = callable(type.parameterList());
284.466 - MethodHandle tsdrop = MethodHandles.dropArguments(toString_MH, 1, type.parameterList());
284.467 - mh = MethodHandles.foldArguments(tsdrop, mh);
284.468 - mh = mh.asType(type);
284.469 - Object res = mh.invokeGeneric((String)args[0], (Object)args[1]);
284.470 - //System.out.println(res);
284.471 - assertEquals(Arrays.asList(args).toString(), res);
284.472 - }
284.473 -
284.474 -
284.475 - @Test @Ignore("known failure pending 6939861")
284.476 - public void testBoxConversions() throws Throwable {
284.477 - startTest("testBoxConversions");
284.478 - countTest();
284.479 - Integer[] args = { 1, 2 };
284.480 - MethodHandle mh = callable(Object.class, int.class);
284.481 - Object res; List resl;
284.482 - res = resl = (List) mh.invokeGeneric((int)args[0], (Object)args[1]);
284.483 - //System.out.println(res);
284.484 - assertEquals(Arrays.asList(args), res);
284.485 - }
284.486 -
284.487 -}
285.1 --- a/test/java/dyn/JavaDocExamplesTest.java Tue Mar 29 11:29:01 2011 -0700
285.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
285.3 @@ -1,220 +0,0 @@
285.4 -/*
285.5 - * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
285.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
285.7 - *
285.8 - * This code is free software; you can redistribute it and/or modify it
285.9 - * under the terms of the GNU General Public License version 2 only, as
285.10 - * published by the Free Software Foundation. Oracle designates this
285.11 - * particular file as subject to the "Classpath" exception as provided
285.12 - * by Oracle in the LICENSE file that accompanied this code.
285.13 - *
285.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
285.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
285.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
285.17 - * version 2 for more details (a copy is included in the LICENSE file that
285.18 - * accompanied this code).
285.19 - *
285.20 - * You should have received a copy of the GNU General Public License version
285.21 - * 2 along with this work; if not, write to the Free Software Foundation,
285.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
285.23 - *
285.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
285.25 - * or visit www.oracle.com if you need additional information or have any
285.26 - * questions.
285.27 - */
285.28 -
285.29 -/* @test
285.30 - * @summary example code used in javadoc for java.dyn API
285.31 - * @compile -XDallowTransitionalJSR292=no JavaDocExamplesTest.java
285.32 - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles test.java.dyn.JavaDocExamplesTest
285.33 - */
285.34 -
285.35 -/*
285.36 ----- To run outside jtreg:
285.37 -$ $JAVA7X_HOME/bin/javac -cp $JUNIT4_JAR -d /tmp/Classes \
285.38 - $DAVINCI/sources/jdk/test/java/dyn/JavaDocExamplesTest.java
285.39 -$ $JAVA7X_HOME/bin/java -cp $JUNIT4_JAR:/tmp/Classes \
285.40 - -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles \
285.41 - -Dtest.java.dyn.JavaDocExamplesTest.verbosity=1 \
285.42 - test.java.dyn.JavaDocExamplesTest
285.43 -----
285.44 -*/
285.45 -
285.46 -package test.java.dyn;
285.47 -
285.48 -import java.dyn.*;
285.49 -import static java.dyn.MethodHandles.*;
285.50 -import static java.dyn.MethodType.*;
285.51 -
285.52 -import java.lang.reflect.*;
285.53 -import java.util.*;
285.54 -
285.55 -import org.junit.*;
285.56 -import static org.junit.Assert.*;
285.57 -import static org.junit.Assume.*;
285.58 -
285.59 -
285.60 -/**
285.61 - * @author jrose
285.62 - */
285.63 -public class JavaDocExamplesTest {
285.64 - /** Wrapper for running the JUnit tests in this module.
285.65 - * Put JUnit on the classpath!
285.66 - */
285.67 - public static void main(String... ignore) {
285.68 - org.junit.runner.JUnitCore.runClasses(JavaDocExamplesTest.class);
285.69 - }
285.70 - // How much output?
285.71 - static int verbosity = Integer.getInteger("test.java.dyn.JavaDocExamplesTest.verbosity", 0);
285.72 -
285.73 -{}
285.74 -static final private Lookup LOOKUP = lookup();
285.75 -// static final private MethodHandle CONCAT_1 = LOOKUP.findVirtual(String.class,
285.76 -// "concat", methodType(String.class, String.class));
285.77 -// static final private MethodHandle HASHCODE_1 = LOOKUP.findVirtual(Object.class,
285.78 -// "hashCode", methodType(int.class));
285.79 -
285.80 -// form required if ReflectiveOperationException is intercepted:
285.81 -static final private MethodHandle CONCAT_2, HASHCODE_2;
285.82 -static {
285.83 - try {
285.84 - CONCAT_2 = LOOKUP.findVirtual(String.class,
285.85 - "concat", methodType(String.class, String.class));
285.86 - HASHCODE_2 = LOOKUP.findVirtual(Object.class,
285.87 - "hashCode", methodType(int.class));
285.88 - } catch (ReflectiveOperationException ex) {
285.89 - throw new RuntimeException(ex);
285.90 - }
285.91 -}
285.92 -{}
285.93 -
285.94 - @Test public void testFindVirtual() throws Throwable {
285.95 -{}
285.96 -MethodHandle CONCAT_3 = LOOKUP.findVirtual(String.class,
285.97 - "concat", methodType(String.class, String.class));
285.98 -MethodHandle HASHCODE_3 = LOOKUP.findVirtual(Object.class,
285.99 - "hashCode", methodType(int.class));
285.100 -//assertEquals("xy", (String) CONCAT_1.invokeExact("x", "y"));
285.101 -assertEquals("xy", (String) CONCAT_2.invokeExact("x", "y"));
285.102 -assertEquals("xy", (String) CONCAT_3.invokeExact("x", "y"));
285.103 -//assertEquals("xy".hashCode(), (int) HASHCODE_1.invokeExact((Object)"xy"));
285.104 -assertEquals("xy".hashCode(), (int) HASHCODE_2.invokeExact((Object)"xy"));
285.105 -assertEquals("xy".hashCode(), (int) HASHCODE_3.invokeExact((Object)"xy"));
285.106 -{}
285.107 - }
285.108 - @Test public void testDropArguments() throws Throwable {
285.109 - {{
285.110 -{} /// JAVADOC
285.111 -MethodHandle cat = lookup().findVirtual(String.class,
285.112 - "concat", methodType(String.class, String.class));
285.113 -assertEquals("xy", (String) cat.invokeExact("x", "y"));
285.114 -MethodHandle d0 = dropArguments(cat, 0, String.class);
285.115 -assertEquals("yz", (String) d0.invokeExact("x", "y", "z"));
285.116 -MethodHandle d1 = dropArguments(cat, 1, String.class);
285.117 -assertEquals("xz", (String) d1.invokeExact("x", "y", "z"));
285.118 -MethodHandle d2 = dropArguments(cat, 2, String.class);
285.119 -assertEquals("xy", (String) d2.invokeExact("x", "y", "z"));
285.120 -MethodHandle d12 = dropArguments(cat, 1, int.class, boolean.class);
285.121 -assertEquals("xz", (String) d12.invokeExact("x", 12, true, "z"));
285.122 - }}
285.123 - }
285.124 -
285.125 - @Test public void testFilterArguments() throws Throwable {
285.126 - {{
285.127 -{} /// JAVADOC
285.128 -MethodHandle cat = lookup().findVirtual(String.class,
285.129 - "concat", methodType(String.class, String.class));
285.130 -MethodHandle upcase = lookup().findVirtual(String.class,
285.131 - "toUpperCase", methodType(String.class));
285.132 -assertEquals("xy", (String) cat.invokeExact("x", "y"));
285.133 -MethodHandle f0 = filterArguments(cat, 0, upcase);
285.134 -assertEquals("Xy", (String) f0.invokeExact("x", "y")); // Xy
285.135 -MethodHandle f1 = filterArguments(cat, 1, upcase);
285.136 -assertEquals("xY", (String) f1.invokeExact("x", "y")); // xY
285.137 -MethodHandle f2 = filterArguments(cat, 0, upcase, upcase);
285.138 -assertEquals("XY", (String) f2.invokeExact("x", "y")); // XY
285.139 - }}
285.140 - }
285.141 -
285.142 - static void assertEquals(Object exp, Object act) {
285.143 - if (verbosity > 0)
285.144 - System.out.println("result: "+act);
285.145 - Assert.assertEquals(exp, act);
285.146 - }
285.147 -
285.148 - @Test public void testMethodHandlesSummary() throws Throwable {
285.149 - {{
285.150 -{} /// JAVADOC
285.151 -Object x, y; String s; int i;
285.152 -MethodType mt; MethodHandle mh;
285.153 -MethodHandles.Lookup lookup = MethodHandles.lookup();
285.154 -// mt is (char,char)String
285.155 -mt = MethodType.methodType(String.class, char.class, char.class);
285.156 -mh = lookup.findVirtual(String.class, "replace", mt);
285.157 -s = (String) mh.invokeExact("daddy",'d','n');
285.158 -// invokeExact(Ljava/lang/String;CC)Ljava/lang/String;
285.159 -assert(s.equals("nanny"));
285.160 -// weakly typed invocation (using MHs.invoke)
285.161 -s = (String) mh.invokeWithArguments("sappy", 'p', 'v');
285.162 -assert(s.equals("savvy"));
285.163 -// mt is (Object[])List
285.164 -mt = MethodType.methodType(java.util.List.class, Object[].class);
285.165 -mh = lookup.findStatic(java.util.Arrays.class, "asList", mt);
285.166 -assert(mh.isVarargsCollector());
285.167 -x = mh.invokeGeneric("one", "two");
285.168 -// invokeGeneric(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;
285.169 -assert(x.equals(java.util.Arrays.asList("one","two")));
285.170 -// mt is (Object,Object,Object)Object
285.171 -mt = MethodType.genericMethodType(3);
285.172 -mh = mh.asType(mt);
285.173 -x = mh.invokeExact((Object)1, (Object)2, (Object)3);
285.174 -// invokeExact(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
285.175 -assert(x.equals(java.util.Arrays.asList(1,2,3)));
285.176 -// mt is { => int}
285.177 -mt = MethodType.methodType(int.class);
285.178 -mh = lookup.findVirtual(java.util.List.class, "size", mt);
285.179 -i = (int) mh.invokeExact(java.util.Arrays.asList(1,2,3));
285.180 -// invokeExact(Ljava/util/List;)I
285.181 -assert(i == 3);
285.182 -mt = MethodType.methodType(void.class, String.class);
285.183 -mh = lookup.findVirtual(java.io.PrintStream.class, "println", mt);
285.184 -mh.invokeExact(System.out, "Hello, world.");
285.185 -// invokeExact(Ljava/io/PrintStream;Ljava/lang/String;)V
285.186 -{}
285.187 - }}
285.188 - }
285.189 -
285.190 - @Test public void testAsVarargsCollector() throws Throwable {
285.191 - {{
285.192 -{} /// JAVADOC
285.193 -MethodHandle asList = publicLookup()
285.194 - .findStatic(Arrays.class, "asList", methodType(List.class, Object[].class))
285.195 - .asVarargsCollector(Object[].class);
285.196 -assertEquals("[]", asList.invokeGeneric().toString());
285.197 -assertEquals("[1]", asList.invokeGeneric(1).toString());
285.198 -assertEquals("[two, too]", asList.invokeGeneric("two", "too").toString());
285.199 -Object[] argv = { "three", "thee", "tee" };
285.200 -assertEquals("[three, thee, tee]", asList.invokeGeneric(argv).toString());
285.201 -List ls = (List) asList.invokeGeneric((Object)argv);
285.202 -assertEquals(1, ls.size());
285.203 -assertEquals("[three, thee, tee]", Arrays.toString((Object[])ls.get(0)));
285.204 - }}
285.205 - }
285.206 -
285.207 - @Test public void testVarargsCollectorSuppression() throws Throwable {
285.208 - {{
285.209 -{} /// JAVADOC
285.210 -MethodHandle vamh = publicLookup()
285.211 - .findStatic(Arrays.class, "asList", methodType(List.class, Object[].class))
285.212 - .asVarargsCollector(Object[].class);
285.213 -MethodHandle mh = MethodHandles.exactInvoker(vamh.type()).bindTo(vamh);
285.214 -assert(vamh.type().equals(mh.type()));
285.215 -assertEquals("[1, 2, 3]", vamh.invokeGeneric(1,2,3).toString());
285.216 -boolean failed = false;
285.217 -try { mh.invokeGeneric(1,2,3); }
285.218 -catch (WrongMethodTypeException ex) { failed = true; }
285.219 -assert(failed);
285.220 -{}
285.221 - }}
285.222 - }
285.223 -}
286.1 --- a/test/java/dyn/MethodHandlesTest.java Tue Mar 29 11:29:01 2011 -0700
286.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
286.3 @@ -1,2400 +0,0 @@
286.4 -/*
286.5 - * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
286.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
286.7 - *
286.8 - * This code is free software; you can redistribute it and/or modify it
286.9 - * under the terms of the GNU General Public License version 2 only, as
286.10 - * published by the Free Software Foundation. Oracle designates this
286.11 - * particular file as subject to the "Classpath" exception as provided
286.12 - * by Oracle in the LICENSE file that accompanied this code.
286.13 - *
286.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
286.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
286.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
286.17 - * version 2 for more details (a copy is included in the LICENSE file that
286.18 - * accompanied this code).
286.19 - *
286.20 - * You should have received a copy of the GNU General Public License version
286.21 - * 2 along with this work; if not, write to the Free Software Foundation,
286.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
286.23 - *
286.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
286.25 - * or visit www.oracle.com if you need additional information or have any
286.26 - * questions.
286.27 - */
286.28 -
286.29 -/* @test
286.30 - * @summary unit tests for java.dyn.MethodHandles
286.31 - * @compile -source 7 -target 7 -XDallowTransitionalJSR292=no MethodHandlesTest.java
286.32 - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles test.java.dyn.MethodHandlesTest
286.33 - */
286.34 -
286.35 -package test.java.dyn;
286.36 -
286.37 -import java.dyn.*;
286.38 -import java.dyn.MethodHandles.Lookup;
286.39 -import java.lang.reflect.*;
286.40 -import java.util.*;
286.41 -import org.junit.*;
286.42 -import static org.junit.Assert.*;
286.43 -import static org.junit.Assume.*;
286.44 -
286.45 -
286.46 -/**
286.47 - *
286.48 - * @author jrose
286.49 - */
286.50 -public class MethodHandlesTest {
286.51 - // How much output?
286.52 - static int verbosity = 0;
286.53 - static {
286.54 - String vstr = System.getProperty("test.java.dyn.MethodHandlesTest.verbosity");
286.55 - if (vstr != null) verbosity = Integer.parseInt(vstr);
286.56 - }
286.57 -
286.58 - // Set this true during development if you want to fast-forward to
286.59 - // a particular new, non-working test. Tests which are known to
286.60 - // work (or have recently worked) test this flag and return on true.
286.61 - static boolean CAN_SKIP_WORKING = false;
286.62 - //static { CAN_SKIP_WORKING = true; }
286.63 -
286.64 - // Set true to test more calls. If false, some tests are just
286.65 - // lookups, without exercising the actual method handle.
286.66 - static boolean DO_MORE_CALLS = true;
286.67 -
286.68 - @Test
286.69 - public void testFirst() throws Throwable {
286.70 - verbosity += 9; try {
286.71 - // left blank for debugging
286.72 - } finally { printCounts(); verbosity -= 9; }
286.73 - }
286.74 -
286.75 - // current failures
286.76 - @Test @Ignore("failure in call to makeRawRetypeOnly in ToGeneric")
286.77 - public void testFail_1() throws Throwable {
286.78 - // AMH.<init>: IllegalArgumentException: bad adapter (conversion=0xfffab300): adapter pushes too many parameters
286.79 - testSpreadArguments(int.class, 0, 6);
286.80 - }
286.81 - @Test @Ignore("failure in JVM when expanding the stack using asm stub for _adapter_spread_args")
286.82 - public void testFail_2() throws Throwable {
286.83 - // if CONV_OP_IMPLEMENTED_MASK includes OP_SPREAD_ARGS, this crashes:
286.84 - testSpreadArguments(Object.class, 0, 2);
286.85 - }
286.86 - @Test @Ignore("IllArgEx failure in call to ToGeneric.make")
286.87 - public void testFail_3() throws Throwable {
286.88 - // ToGeneric.<init>: UnsupportedOperationException: NYI: primitive parameters must follow references; entryType = (int,java.lang.Object)java.lang.Object
286.89 - testSpreadArguments(int.class, 1, 2);
286.90 - }
286.91 - @Test @Ignore("IllArgEx failure in call to ToGeneric.make")
286.92 - public void testFail_4() throws Throwable {
286.93 - // ToGeneric.<init>: UnsupportedOperationException: NYI: primitive parameters must follow references; entryType = (int,java.lang.Object)java.lang.Object
286.94 - testCollectArguments(int.class, 1, 2);
286.95 - }
286.96 - @Test @Ignore("cannot collect leading primitive types")
286.97 - public void testFail_5() throws Throwable {
286.98 - // ToGeneric.<init>: UnsupportedOperationException: NYI: primitive parameters must follow references; entryType = (int,java.lang.Object)java.lang.Object
286.99 - testInvokers(MethodType.genericMethodType(2).changeParameterType(0, int.class));
286.100 - }
286.101 - @Test @Ignore("should not insert arguments beyond MethodHandlePushLimit")
286.102 - public void testFail_6() throws Throwable {
286.103 - // ValueConversions.varargsArray: UnsupportedOperationException: NYI: cannot form a varargs array of length 13
286.104 - testInsertArguments(0, 0, MAX_ARG_INCREASE+10);
286.105 - }
286.106 - static final int MAX_ARG_INCREASE = 3;
286.107 -
286.108 - public MethodHandlesTest() {
286.109 - }
286.110 -
286.111 - @Before
286.112 - public void checkImplementedPlatform() {
286.113 - boolean platformOK = false;
286.114 - Properties properties = System.getProperties();
286.115 - String vers = properties.getProperty("java.vm.version");
286.116 - String name = properties.getProperty("java.vm.name");
286.117 - String arch = properties.getProperty("os.arch");
286.118 - if ((arch.equals("amd64") || arch.equals("i386") || arch.equals("x86") ||
286.119 - arch.equals("sparc") || arch.equals("sparcv9")) &&
286.120 - (name.contains("Client") || name.contains("Server"))
286.121 - ) {
286.122 - platformOK = true;
286.123 - } else {
286.124 - System.err.println("Skipping tests for unsupported platform: "+Arrays.asList(vers, name, arch));
286.125 - }
286.126 - assumeTrue(platformOK);
286.127 - }
286.128 -
286.129 - String testName;
286.130 - static int allPosTests, allNegTests;
286.131 - int posTests, negTests;
286.132 - @After
286.133 - public void printCounts() {
286.134 - if (verbosity >= 2 && (posTests | negTests) != 0) {
286.135 - System.out.println();
286.136 - if (posTests != 0) System.out.println("=== "+testName+": "+posTests+" positive test cases run");
286.137 - if (negTests != 0) System.out.println("=== "+testName+": "+negTests+" negative test cases run");
286.138 - allPosTests += posTests;
286.139 - allNegTests += negTests;
286.140 - posTests = negTests = 0;
286.141 - }
286.142 - }
286.143 - void countTest(boolean positive) {
286.144 - if (positive) ++posTests;
286.145 - else ++negTests;
286.146 - }
286.147 - void countTest() { countTest(true); }
286.148 - void startTest(String name) {
286.149 - if (testName != null) printCounts();
286.150 - if (verbosity >= 1)
286.151 - System.out.println(name);
286.152 - posTests = negTests = 0;
286.153 - testName = name;
286.154 - }
286.155 -
286.156 - @BeforeClass
286.157 - public static void setUpClass() throws Exception {
286.158 - calledLog.clear();
286.159 - calledLog.add(null);
286.160 - nextArgVal = INITIAL_ARG_VAL;
286.161 - }
286.162 -
286.163 - @AfterClass
286.164 - public static void tearDownClass() throws Exception {
286.165 - int posTests = allPosTests, negTests = allNegTests;
286.166 - if (verbosity >= 2 && (posTests | negTests) != 0) {
286.167 - System.out.println();
286.168 - if (posTests != 0) System.out.println("=== "+posTests+" total positive test cases");
286.169 - if (negTests != 0) System.out.println("=== "+negTests+" total negative test cases");
286.170 - }
286.171 - }
286.172 -
286.173 - static List<Object> calledLog = new ArrayList<Object>();
286.174 - static Object logEntry(String name, Object... args) {
286.175 - return Arrays.asList(name, Arrays.asList(args));
286.176 - }
286.177 - static Object called(String name, Object... args) {
286.178 - Object entry = logEntry(name, args);
286.179 - calledLog.add(entry);
286.180 - return entry;
286.181 - }
286.182 - static void assertCalled(String name, Object... args) {
286.183 - Object expected = logEntry(name, args);
286.184 - Object actual = calledLog.get(calledLog.size() - 1);
286.185 - if (expected.equals(actual) && verbosity < 9) return;
286.186 - System.out.println("assertCalled "+name+":");
286.187 - System.out.println("expected: "+expected);
286.188 - System.out.println("actual: "+actual);
286.189 - System.out.println("ex. types: "+getClasses(expected));
286.190 - System.out.println("act. types: "+getClasses(actual));
286.191 - assertEquals("previous method call", expected, actual);
286.192 - }
286.193 - static void printCalled(MethodHandle target, String name, Object... args) {
286.194 - if (verbosity >= 3)
286.195 - System.out.println("calling MH="+target+" to "+name+Arrays.toString(args));
286.196 - }
286.197 -
286.198 - static Object castToWrapper(Object value, Class<?> dst) {
286.199 - Object wrap = null;
286.200 - if (value instanceof Number)
286.201 - wrap = castToWrapperOrNull(((Number)value).longValue(), dst);
286.202 - if (value instanceof Character)
286.203 - wrap = castToWrapperOrNull((char)(Character)value, dst);
286.204 - if (wrap != null) return wrap;
286.205 - return dst.cast(value);
286.206 - }
286.207 -
286.208 - static Object castToWrapperOrNull(long value, Class<?> dst) {
286.209 - if (dst == int.class || dst == Integer.class)
286.210 - return (int)(value);
286.211 - if (dst == long.class || dst == Long.class)
286.212 - return (long)(value);
286.213 - if (dst == char.class || dst == Character.class)
286.214 - return (char)(value);
286.215 - if (dst == short.class || dst == Short.class)
286.216 - return (short)(value);
286.217 - if (dst == float.class || dst == Float.class)
286.218 - return (float)(value);
286.219 - if (dst == double.class || dst == Double.class)
286.220 - return (double)(value);
286.221 - if (dst == byte.class || dst == Byte.class)
286.222 - return (byte)(value);
286.223 - if (dst == boolean.class || dst == boolean.class)
286.224 - return ((value % 29) & 1) == 0;
286.225 - return null;
286.226 - }
286.227 -
286.228 - static final int ONE_MILLION = (1000*1000), // first int value
286.229 - TEN_BILLION = (10*1000*1000*1000), // scale factor to reach upper 32 bits
286.230 - INITIAL_ARG_VAL = ONE_MILLION << 1; // <<1 makes space for sign bit;
286.231 - static long nextArgVal;
286.232 - static long nextArg(boolean moreBits) {
286.233 - long val = nextArgVal++;
286.234 - long sign = -(val & 1); // alternate signs
286.235 - val >>= 1;
286.236 - if (moreBits)
286.237 - // Guarantee some bits in the high word.
286.238 - // In any case keep the decimal representation simple-looking,
286.239 - // with lots of zeroes, so as not to make the printed decimal
286.240 - // strings unnecessarily noisy.
286.241 - val += (val % ONE_MILLION) * TEN_BILLION;
286.242 - return val ^ sign;
286.243 - }
286.244 - static int nextArg() {
286.245 - // Produce a 32-bit result something like ONE_MILLION+(smallint).
286.246 - // Example: 1_000_042.
286.247 - return (int) nextArg(false);
286.248 - }
286.249 - static long nextArg(Class<?> kind) {
286.250 - if (kind == long.class || kind == Long.class ||
286.251 - kind == double.class || kind == Double.class)
286.252 - // produce a 64-bit result something like
286.253 - // ((TEN_BILLION+1) * (ONE_MILLION+(smallint)))
286.254 - // Example: 10_000_420_001_000_042.
286.255 - return nextArg(true);
286.256 - return (long) nextArg();
286.257 - }
286.258 -
286.259 - static Object randomArg(Class<?> param) {
286.260 - Object wrap = castToWrapperOrNull(nextArg(param), param);
286.261 - if (wrap != null) {
286.262 - return wrap;
286.263 - }
286.264 -// import sun.dyn.util.Wrapper;
286.265 -// Wrapper wrap = Wrapper.forBasicType(dst);
286.266 -// if (wrap == Wrapper.OBJECT && Wrapper.isWrapperType(dst))
286.267 -// wrap = Wrapper.forWrapperType(dst);
286.268 -// if (wrap != Wrapper.OBJECT)
286.269 -// return wrap.wrap(nextArg++);
286.270 - if (param.isInterface()) {
286.271 - for (Class<?> c : param.getClasses()) {
286.272 - if (param.isAssignableFrom(c) && !c.isInterface())
286.273 - { param = c; break; }
286.274 - }
286.275 - }
286.276 - if (param.isInterface() || param.isAssignableFrom(String.class))
286.277 - return "#"+nextArg();
286.278 - else
286.279 - try {
286.280 - return param.newInstance();
286.281 - } catch (InstantiationException ex) {
286.282 - } catch (IllegalAccessException ex) {
286.283 - }
286.284 - return null; // random class not Object, String, Integer, etc.
286.285 - }
286.286 - static Object[] randomArgs(Class<?>... params) {
286.287 - Object[] args = new Object[params.length];
286.288 - for (int i = 0; i < args.length; i++)
286.289 - args[i] = randomArg(params[i]);
286.290 - return args;
286.291 - }
286.292 - static Object[] randomArgs(int nargs, Class<?> param) {
286.293 - Object[] args = new Object[nargs];
286.294 - for (int i = 0; i < args.length; i++)
286.295 - args[i] = randomArg(param);
286.296 - return args;
286.297 - }
286.298 -
286.299 - static <T, E extends T> T[] array(Class<T[]> atype, E... a) {
286.300 - return Arrays.copyOf(a, a.length, atype);
286.301 - }
286.302 - static <T> T[] cat(T[] a, T... b) {
286.303 - int alen = a.length, blen = b.length;
286.304 - if (blen == 0) return a;
286.305 - T[] c = Arrays.copyOf(a, alen + blen);
286.306 - System.arraycopy(b, 0, c, alen, blen);
286.307 - return c;
286.308 - }
286.309 - static Integer[] boxAll(int... vx) {
286.310 - Integer[] res = new Integer[vx.length];
286.311 - for (int i = 0; i < res.length; i++) {
286.312 - res[i] = vx[i];
286.313 - }
286.314 - return res;
286.315 - }
286.316 - static Object getClasses(Object x) {
286.317 - if (x == null) return x;
286.318 - if (x instanceof String) return x; // keep the name
286.319 - if (x instanceof List) {
286.320 - // recursively report classes of the list elements
286.321 - Object[] xa = ((List)x).toArray();
286.322 - for (int i = 0; i < xa.length; i++)
286.323 - xa[i] = getClasses(xa[i]);
286.324 - return Arrays.asList(xa);
286.325 - }
286.326 - return x.getClass().getSimpleName();
286.327 - }
286.328 -
286.329 - /** Return lambda(arg...[arity]) { new Object[]{ arg... } } */
286.330 - static MethodHandle varargsList(int arity) {
286.331 - return ValueConversions.varargsList(arity);
286.332 - }
286.333 - /** Return lambda(arg...[arity]) { Arrays.asList(arg...) } */
286.334 - static MethodHandle varargsArray(int arity) {
286.335 - return ValueConversions.varargsArray(arity);
286.336 - }
286.337 - /** Variation of varargsList, but with the given rtype. */
286.338 - static MethodHandle varargsList(int arity, Class<?> rtype) {
286.339 - MethodHandle list = varargsList(arity);
286.340 - MethodType listType = list.type().changeReturnType(rtype);
286.341 - if (List.class.isAssignableFrom(rtype) || rtype == void.class || rtype == Object.class) {
286.342 - // OK
286.343 - } else if (rtype.isAssignableFrom(String.class)) {
286.344 - if (LIST_TO_STRING == null)
286.345 - try {
286.346 - LIST_TO_STRING = PRIVATE.findStatic(PRIVATE.lookupClass(), "listToString",
286.347 - MethodType.methodType(String.class, List.class));
286.348 - } catch (Exception ex) { throw new RuntimeException(ex); }
286.349 - list = MethodHandles.filterReturnValue(list, LIST_TO_STRING);
286.350 - } else if (rtype.isPrimitive()) {
286.351 - if (LIST_TO_INT == null)
286.352 - try {
286.353 - LIST_TO_INT = PRIVATE.findStatic(PRIVATE.lookupClass(), "listToInt",
286.354 - MethodType.methodType(int.class, List.class));
286.355 - } catch (Exception ex) { throw new RuntimeException(ex); }
286.356 - list = MethodHandles.filterReturnValue(list, LIST_TO_INT);
286.357 - list = MethodHandles.explicitCastArguments(list, listType);
286.358 - } else {
286.359 - throw new RuntimeException("varargsList: "+rtype);
286.360 - }
286.361 - return list.asType(listType);
286.362 - }
286.363 - private static MethodHandle LIST_TO_STRING, LIST_TO_INT;
286.364 - private static String listToString(List x) { return x.toString(); }
286.365 - private static int listToInt(List x) { return x.toString().hashCode(); }
286.366 -
286.367 - static MethodHandle changeArgTypes(MethodHandle target, Class<?> argType) {
286.368 - return changeArgTypes(target, 0, 999, argType);
286.369 - }
286.370 - static MethodHandle changeArgTypes(MethodHandle target,
286.371 - int beg, int end, Class<?> argType) {
286.372 - MethodType targetType = target.type();
286.373 - end = Math.min(end, targetType.parameterCount());
286.374 - ArrayList<Class<?>> argTypes = new ArrayList<Class<?>>(targetType.parameterList());
286.375 - Collections.fill(argTypes.subList(beg, end), argType);
286.376 - MethodType ttype2 = MethodType.methodType(targetType.returnType(), argTypes);
286.377 - return MethodHandles.convertArguments(target, ttype2);
286.378 - }
286.379 -
286.380 - // This lookup is good for all members in and under MethodHandlesTest.
286.381 - static final Lookup PRIVATE = MethodHandles.lookup();
286.382 - // This lookup is good for package-private members but not private ones.
286.383 - static final Lookup PACKAGE = PackageSibling.lookup();
286.384 - // This lookup is good only for public members.
286.385 - static final Lookup PUBLIC = MethodHandles.publicLookup();
286.386 -
286.387 - // Subject methods...
286.388 - static class Example implements IntExample {
286.389 - final String name;
286.390 - public Example() { name = "Example#"+nextArg(); }
286.391 - protected Example(String name) { this.name = name; }
286.392 - protected Example(int x) { this(); called("protected <init>", this, x); }
286.393 - @Override public String toString() { return name; }
286.394 -
286.395 - public void v0() { called("v0", this); }
286.396 - void pkg_v0() { called("pkg_v0", this); }
286.397 - private void pri_v0() { called("pri_v0", this); }
286.398 - public static void s0() { called("s0"); }
286.399 - static void pkg_s0() { called("pkg_s0"); }
286.400 - private static void pri_s0() { called("pri_s0"); }
286.401 -
286.402 - public Object v1(Object x) { return called("v1", this, x); }
286.403 - public Object v2(Object x, Object y) { return called("v2", this, x, y); }
286.404 - public Object v2(Object x, int y) { return called("v2", this, x, y); }
286.405 - public Object v2(int x, Object y) { return called("v2", this, x, y); }
286.406 - public Object v2(int x, int y) { return called("v2", this, x, y); }
286.407 - public static Object s1(Object x) { return called("s1", x); }
286.408 - public static Object s2(int x) { return called("s2", x); }
286.409 - public static Object s3(long x) { return called("s3", x); }
286.410 - public static Object s4(int x, int y) { return called("s4", x, y); }
286.411 - public static Object s5(long x, int y) { return called("s5", x, y); }
286.412 - public static Object s6(int x, long y) { return called("s6", x, y); }
286.413 - public static Object s7(float x, double y) { return called("s7", x, y); }
286.414 -
286.415 - static final Lookup EXAMPLE = MethodHandles.lookup(); // for testing findSpecial
286.416 - }
286.417 - static final Lookup EXAMPLE = Example.EXAMPLE;
286.418 - public static class PubExample extends Example {
286.419 - public PubExample() { super("PubExample#"+nextArg()); }
286.420 - }
286.421 - static class SubExample extends Example {
286.422 - @Override public void v0() { called("Sub/v0", this); }
286.423 - @Override void pkg_v0() { called("Sub/pkg_v0", this); }
286.424 - private SubExample(int x) { called("<init>", this, x); }
286.425 - public SubExample() { super("SubExample#"+nextArg()); }
286.426 - }
286.427 - public static interface IntExample {
286.428 - public void v0();
286.429 - public static class Impl implements IntExample {
286.430 - public void v0() { called("Int/v0", this); }
286.431 - final String name;
286.432 - public Impl() { name = "Impl#"+nextArg(); }
286.433 - @Override public String toString() { return name; }
286.434 - }
286.435 - }
286.436 -
286.437 - static final Object[][][] ACCESS_CASES = {
286.438 - { { false, PUBLIC }, { false, PACKAGE }, { false, PRIVATE }, { false, EXAMPLE } }, //[0]: all false
286.439 - { { false, PUBLIC }, { false, PACKAGE }, { true, PRIVATE }, { true, EXAMPLE } }, //[1]: only PRIVATE
286.440 - { { false, PUBLIC }, { true, PACKAGE }, { true, PRIVATE }, { true, EXAMPLE } }, //[2]: PUBLIC false
286.441 - { { true, PUBLIC }, { true, PACKAGE }, { true, PRIVATE }, { true, EXAMPLE } }, //[3]: all true
286.442 - };
286.443 -
286.444 - static Object[][] accessCases(Class<?> defc, String name, boolean isSpecial) {
286.445 - Object[][] cases;
286.446 - if (name.contains("pri_") || isSpecial) {
286.447 - cases = ACCESS_CASES[1]; // PRIVATE only
286.448 - } else if (name.contains("pkg_") || !Modifier.isPublic(defc.getModifiers())) {
286.449 - cases = ACCESS_CASES[2]; // not PUBLIC
286.450 - } else {
286.451 - assertTrue(name.indexOf('_') < 0);
286.452 - boolean pubc = Modifier.isPublic(defc.getModifiers());
286.453 - if (pubc)
286.454 - cases = ACCESS_CASES[3]; // all access levels
286.455 - else
286.456 - cases = ACCESS_CASES[2]; // PACKAGE but not PUBLIC
286.457 - }
286.458 - if (defc != Example.class && cases[cases.length-1][1] == EXAMPLE)
286.459 - cases = Arrays.copyOfRange(cases, 0, cases.length-1);
286.460 - return cases;
286.461 - }
286.462 - static Object[][] accessCases(Class<?> defc, String name) {
286.463 - return accessCases(defc, name, false);
286.464 - }
286.465 -
286.466 - @Test
286.467 - public void testFindStatic() throws Throwable {
286.468 - if (CAN_SKIP_WORKING) return;
286.469 - startTest("findStatic");
286.470 - testFindStatic(PubExample.class, void.class, "s0");
286.471 - testFindStatic(Example.class, void.class, "s0");
286.472 - testFindStatic(Example.class, void.class, "pkg_s0");
286.473 - testFindStatic(Example.class, void.class, "pri_s0");
286.474 -
286.475 - testFindStatic(Example.class, Object.class, "s1", Object.class);
286.476 - testFindStatic(Example.class, Object.class, "s2", int.class);
286.477 - testFindStatic(Example.class, Object.class, "s3", long.class);
286.478 - testFindStatic(Example.class, Object.class, "s4", int.class, int.class);
286.479 - testFindStatic(Example.class, Object.class, "s5", long.class, int.class);
286.480 - testFindStatic(Example.class, Object.class, "s6", int.class, long.class);
286.481 - testFindStatic(Example.class, Object.class, "s7", float.class, double.class);
286.482 -
286.483 - testFindStatic(false, PRIVATE, Example.class, void.class, "bogus");
286.484 - }
286.485 -
286.486 - void testFindStatic(Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
286.487 - for (Object[] ac : accessCases(defc, name)) {
286.488 - testFindStatic((Boolean)ac[0], (Lookup)ac[1], defc, ret, name, params);
286.489 - }
286.490 - }
286.491 - void testFindStatic(Lookup lookup, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
286.492 - testFindStatic(true, lookup, defc, ret, name, params);
286.493 - }
286.494 - void testFindStatic(boolean positive, Lookup lookup, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
286.495 - countTest(positive);
286.496 - MethodType type = MethodType.methodType(ret, params);
286.497 - MethodHandle target = null;
286.498 - Exception noAccess = null;
286.499 - try {
286.500 - if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
286.501 - target = lookup.in(defc).findStatic(defc, name, type);
286.502 - } catch (ReflectiveOperationException ex) {
286.503 - noAccess = ex;
286.504 - if (name.contains("bogus"))
286.505 - assertTrue(noAccess instanceof NoSuchMethodException);
286.506 - else
286.507 - assertTrue(noAccess instanceof IllegalAccessException);
286.508 - }
286.509 - if (verbosity >= 3)
286.510 - System.out.println("findStatic "+lookup+": "+defc.getName()+"."+name+"/"+type+" => "+target
286.511 - +(noAccess == null ? "" : " !! "+noAccess));
286.512 - if (positive && noAccess != null) throw noAccess;
286.513 - assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null);
286.514 - if (!positive) return; // negative test failed as expected
286.515 - assertEquals(type, target.type());
286.516 - assertNameStringContains(target, name);
286.517 - if (!DO_MORE_CALLS && lookup != PRIVATE) return;
286.518 - Object[] args = randomArgs(params);
286.519 - printCalled(target, name, args);
286.520 - target.invokeWithArguments(args);
286.521 - assertCalled(name, args);
286.522 - if (verbosity >= 1)
286.523 - System.out.print(':');
286.524 - }
286.525 -
286.526 - // rough check of name string
286.527 - static void assertNameStringContains(Object x, String s) {
286.528 - if (x.toString().contains(s)) return;
286.529 - assertEquals(s, x);
286.530 - }
286.531 -
286.532 - @Test
286.533 - public void testFindVirtual() throws Throwable {
286.534 - if (CAN_SKIP_WORKING) return;
286.535 - startTest("findVirtual");
286.536 - testFindVirtual(Example.class, void.class, "v0");
286.537 - testFindVirtual(Example.class, void.class, "pkg_v0");
286.538 - testFindVirtual(Example.class, void.class, "pri_v0");
286.539 - testFindVirtual(Example.class, Object.class, "v1", Object.class);
286.540 - testFindVirtual(Example.class, Object.class, "v2", Object.class, Object.class);
286.541 - testFindVirtual(Example.class, Object.class, "v2", Object.class, int.class);
286.542 - testFindVirtual(Example.class, Object.class, "v2", int.class, Object.class);
286.543 - testFindVirtual(Example.class, Object.class, "v2", int.class, int.class);
286.544 - testFindVirtual(false, PRIVATE, Example.class, Example.class, void.class, "bogus");
286.545 - // test dispatch
286.546 - testFindVirtual(SubExample.class, SubExample.class, void.class, "Sub/v0");
286.547 - testFindVirtual(SubExample.class, Example.class, void.class, "Sub/v0");
286.548 - testFindVirtual(SubExample.class, IntExample.class, void.class, "Sub/v0");
286.549 - testFindVirtual(SubExample.class, SubExample.class, void.class, "Sub/pkg_v0");
286.550 - testFindVirtual(SubExample.class, Example.class, void.class, "Sub/pkg_v0");
286.551 - testFindVirtual(Example.class, IntExample.class, void.class, "v0");
286.552 - testFindVirtual(IntExample.Impl.class, IntExample.class, void.class, "Int/v0");
286.553 - }
286.554 -
286.555 - void testFindVirtual(Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
286.556 - Class<?> rcvc = defc;
286.557 - testFindVirtual(rcvc, defc, ret, name, params);
286.558 - }
286.559 - void testFindVirtual(Class<?> rcvc, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
286.560 - for (Object[] ac : accessCases(defc, name)) {
286.561 - testFindVirtual((Boolean)ac[0], (Lookup)ac[1], rcvc, defc, ret, name, params);
286.562 - }
286.563 - }
286.564 - void testFindVirtual(Lookup lookup, Class<?> rcvc, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
286.565 - testFindVirtual(true, lookup, rcvc, defc, ret, name, params);
286.566 - }
286.567 - void testFindVirtual(boolean positive, Lookup lookup, Class<?> rcvc, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
286.568 - countTest(positive);
286.569 - String methodName = name.substring(1 + name.indexOf('/')); // foo/bar => foo
286.570 - MethodType type = MethodType.methodType(ret, params);
286.571 - MethodHandle target = null;
286.572 - Exception noAccess = null;
286.573 - try {
286.574 - if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
286.575 - target = lookup.in(defc).findVirtual(defc, methodName, type);
286.576 - } catch (ReflectiveOperationException ex) {
286.577 - noAccess = ex;
286.578 - if (name.contains("bogus"))
286.579 - assertTrue(noAccess instanceof NoSuchMethodException);
286.580 - else
286.581 - assertTrue(noAccess instanceof IllegalAccessException);
286.582 - }
286.583 - if (verbosity >= 3)
286.584 - System.out.println("findVirtual "+lookup+": "+defc.getName()+"."+name+"/"+type+" => "+target
286.585 - +(noAccess == null ? "" : " !! "+noAccess));
286.586 - if (positive && noAccess != null) throw noAccess;
286.587 - assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null);
286.588 - if (!positive) return; // negative test failed as expected
286.589 - Class<?>[] paramsWithSelf = cat(array(Class[].class, (Class)defc), params);
286.590 - MethodType typeWithSelf = MethodType.methodType(ret, paramsWithSelf);
286.591 - assertEquals(typeWithSelf, target.type());
286.592 - assertNameStringContains(target, methodName);
286.593 - if (!DO_MORE_CALLS && lookup != PRIVATE) return;
286.594 - Object[] argsWithSelf = randomArgs(paramsWithSelf);
286.595 - if (rcvc != defc) argsWithSelf[0] = randomArg(rcvc);
286.596 - printCalled(target, name, argsWithSelf);
286.597 - target.invokeWithArguments(argsWithSelf);
286.598 - assertCalled(name, argsWithSelf);
286.599 - if (verbosity >= 1)
286.600 - System.out.print(':');
286.601 - }
286.602 -
286.603 - @Test
286.604 - public void testFindSpecial() throws Throwable {
286.605 - if (CAN_SKIP_WORKING) return;
286.606 - startTest("findSpecial");
286.607 - testFindSpecial(SubExample.class, Example.class, void.class, "v0");
286.608 - testFindSpecial(SubExample.class, Example.class, void.class, "pkg_v0");
286.609 - // Do some negative testing:
286.610 - testFindSpecial(false, EXAMPLE, SubExample.class, Example.class, void.class, "bogus");
286.611 - testFindSpecial(false, PRIVATE, SubExample.class, Example.class, void.class, "bogus");
286.612 - for (Lookup lookup : new Lookup[]{ PRIVATE, EXAMPLE, PACKAGE, PUBLIC }) {
286.613 - testFindSpecial(false, lookup, Object.class, Example.class, void.class, "v0");
286.614 - testFindSpecial(false, lookup, SubExample.class, Example.class, void.class, "<init>", int.class);
286.615 - testFindSpecial(false, lookup, SubExample.class, Example.class, void.class, "s0");
286.616 - }
286.617 - }
286.618 -
286.619 - void testFindSpecial(Class<?> specialCaller,
286.620 - Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
286.621 - testFindSpecial(true, EXAMPLE, specialCaller, defc, ret, name, params);
286.622 - testFindSpecial(true, PRIVATE, specialCaller, defc, ret, name, params);
286.623 - testFindSpecial(false, PACKAGE, specialCaller, defc, ret, name, params);
286.624 - testFindSpecial(false, PUBLIC, specialCaller, defc, ret, name, params);
286.625 - }
286.626 - void testFindSpecial(boolean positive, Lookup lookup, Class<?> specialCaller,
286.627 - Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
286.628 - countTest(positive);
286.629 - MethodType type = MethodType.methodType(ret, params);
286.630 - MethodHandle target = null;
286.631 - Exception noAccess = null;
286.632 - try {
286.633 - if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
286.634 - if (verbosity >= 5) System.out.println(" lookup => "+lookup.in(specialCaller));
286.635 - target = lookup.in(specialCaller).findSpecial(defc, name, type, specialCaller);
286.636 - } catch (ReflectiveOperationException ex) {
286.637 - noAccess = ex;
286.638 - if (name.contains("bogus"))
286.639 - assertTrue(noAccess instanceof NoSuchMethodException);
286.640 - else
286.641 - assertTrue(noAccess instanceof IllegalAccessException);
286.642 - }
286.643 - if (verbosity >= 3)
286.644 - System.out.println("findSpecial from "+specialCaller.getName()+" to "+defc.getName()+"."+name+"/"+type+" => "+target
286.645 - +(target == null ? "" : target.type())
286.646 - +(noAccess == null ? "" : " !! "+noAccess));
286.647 - if (positive && noAccess != null) throw noAccess;
286.648 - assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null);
286.649 - if (!positive) return; // negative test failed as expected
286.650 - assertEquals(specialCaller, target.type().parameterType(0));
286.651 - assertEquals(type, target.type().dropParameterTypes(0,1));
286.652 - Class<?>[] paramsWithSelf = cat(array(Class[].class, (Class)specialCaller), params);
286.653 - MethodType typeWithSelf = MethodType.methodType(ret, paramsWithSelf);
286.654 - assertNameStringContains(target, name);
286.655 - if (!DO_MORE_CALLS && lookup != PRIVATE && lookup != EXAMPLE) return;
286.656 - Object[] args = randomArgs(paramsWithSelf);
286.657 - printCalled(target, name, args);
286.658 - target.invokeWithArguments(args);
286.659 - assertCalled(name, args);
286.660 - }
286.661 -
286.662 - @Test
286.663 - public void testBind() throws Throwable {
286.664 - if (CAN_SKIP_WORKING) return;
286.665 - startTest("bind");
286.666 - testBind(Example.class, void.class, "v0");
286.667 - testBind(Example.class, void.class, "pkg_v0");
286.668 - testBind(Example.class, void.class, "pri_v0");
286.669 - testBind(Example.class, Object.class, "v1", Object.class);
286.670 - testBind(Example.class, Object.class, "v2", Object.class, Object.class);
286.671 - testBind(Example.class, Object.class, "v2", Object.class, int.class);
286.672 - testBind(Example.class, Object.class, "v2", int.class, Object.class);
286.673 - testBind(Example.class, Object.class, "v2", int.class, int.class);
286.674 - testBind(false, PRIVATE, Example.class, void.class, "bogus");
286.675 - testBind(SubExample.class, void.class, "Sub/v0");
286.676 - testBind(SubExample.class, void.class, "Sub/pkg_v0");
286.677 - testBind(IntExample.Impl.class, void.class, "Int/v0");
286.678 - }
286.679 -
286.680 - void testBind(Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
286.681 - for (Object[] ac : accessCases(defc, name)) {
286.682 - testBind((Boolean)ac[0], (Lookup)ac[1], defc, ret, name, params);
286.683 - }
286.684 - }
286.685 -
286.686 - void testBind(boolean positive, Lookup lookup, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
286.687 - countTest(positive);
286.688 - String methodName = name.substring(1 + name.indexOf('/')); // foo/bar => foo
286.689 - MethodType type = MethodType.methodType(ret, params);
286.690 - Object receiver = randomArg(defc);
286.691 - MethodHandle target = null;
286.692 - Exception noAccess = null;
286.693 - try {
286.694 - if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
286.695 - target = lookup.in(defc).bind(receiver, methodName, type);
286.696 - } catch (ReflectiveOperationException ex) {
286.697 - noAccess = ex;
286.698 - if (name.contains("bogus"))
286.699 - assertTrue(noAccess instanceof NoSuchMethodException);
286.700 - else
286.701 - assertTrue(noAccess instanceof IllegalAccessException);
286.702 - }
286.703 - if (verbosity >= 3)
286.704 - System.out.println("bind "+receiver+"."+name+"/"+type+" => "+target
286.705 - +(noAccess == null ? "" : " !! "+noAccess));
286.706 - if (positive && noAccess != null) throw noAccess;
286.707 - assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null);
286.708 - if (!positive) return; // negative test failed as expected
286.709 - assertEquals(type, target.type());
286.710 - Object[] args = randomArgs(params);
286.711 - printCalled(target, name, args);
286.712 - target.invokeWithArguments(args);
286.713 - Object[] argsWithReceiver = cat(array(Object[].class, receiver), args);
286.714 - assertCalled(name, argsWithReceiver);
286.715 - if (verbosity >= 1)
286.716 - System.out.print(':');
286.717 - }
286.718 -
286.719 - @Test
286.720 - public void testUnreflect() throws Throwable {
286.721 - if (CAN_SKIP_WORKING) return;
286.722 - startTest("unreflect");
286.723 - testUnreflect(Example.class, true, void.class, "s0");
286.724 - testUnreflect(Example.class, true, void.class, "pkg_s0");
286.725 - testUnreflect(Example.class, true, void.class, "pri_s0");
286.726 -
286.727 - testUnreflect(Example.class, true, Object.class, "s1", Object.class);
286.728 - testUnreflect(Example.class, true, Object.class, "s2", int.class);
286.729 - testUnreflect(Example.class, true, Object.class, "s3", long.class);
286.730 - testUnreflect(Example.class, true, Object.class, "s4", int.class, int.class);
286.731 - testUnreflect(Example.class, true, Object.class, "s5", long.class, int.class);
286.732 - testUnreflect(Example.class, true, Object.class, "s6", int.class, long.class);
286.733 -
286.734 - testUnreflect(Example.class, false, void.class, "v0");
286.735 - testUnreflect(Example.class, false, void.class, "pkg_v0");
286.736 - testUnreflect(Example.class, false, void.class, "pri_v0");
286.737 - testUnreflect(Example.class, false, Object.class, "v1", Object.class);
286.738 - testUnreflect(Example.class, false, Object.class, "v2", Object.class, Object.class);
286.739 - testUnreflect(Example.class, false, Object.class, "v2", Object.class, int.class);
286.740 - testUnreflect(Example.class, false, Object.class, "v2", int.class, Object.class);
286.741 - testUnreflect(Example.class, false, Object.class, "v2", int.class, int.class);
286.742 - }
286.743 -
286.744 - void testUnreflect(Class<?> defc, boolean isStatic, Class<?> ret, String name, Class<?>... params) throws Throwable {
286.745 - for (Object[] ac : accessCases(defc, name)) {
286.746 - testUnreflectMaybeSpecial(null, (Boolean)ac[0], (Lookup)ac[1], defc, (isStatic ? null : defc), ret, name, params);
286.747 - }
286.748 - }
286.749 - void testUnreflect(Class<?> defc, Class<?> rcvc, Class<?> ret, String name, Class<?>... params) throws Throwable {
286.750 - for (Object[] ac : accessCases(defc, name)) {
286.751 - testUnreflectMaybeSpecial(null, (Boolean)ac[0], (Lookup)ac[1], defc, rcvc, ret, name, params);
286.752 - }
286.753 - }
286.754 - void testUnreflectMaybeSpecial(Class<?> specialCaller,
286.755 - boolean positive, Lookup lookup,
286.756 - Class<?> defc, Class<?> rcvc, Class<?> ret, String name, Class<?>... params) throws Throwable {
286.757 - countTest(positive);
286.758 - MethodType type = MethodType.methodType(ret, params);
286.759 - Method rmethod = defc.getDeclaredMethod(name, params);
286.760 - MethodHandle target = null;
286.761 - Exception noAccess = null;
286.762 - boolean isStatic = (rcvc == null);
286.763 - boolean isSpecial = (specialCaller != null);
286.764 - try {
286.765 - if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
286.766 - if (isSpecial)
286.767 - target = lookup.in(specialCaller).unreflectSpecial(rmethod, specialCaller);
286.768 - else
286.769 - target = lookup.in(defc).unreflect(rmethod);
286.770 - } catch (ReflectiveOperationException ex) {
286.771 - noAccess = ex;
286.772 - if (name.contains("bogus"))
286.773 - assertTrue(noAccess instanceof NoSuchMethodException);
286.774 - else
286.775 - assertTrue(noAccess instanceof IllegalAccessException);
286.776 - }
286.777 - if (verbosity >= 3)
286.778 - System.out.println("unreflect"+(isSpecial?"Special":"")+" "+defc.getName()+"."+name+"/"+type
286.779 - +(!isSpecial ? "" : " specialCaller="+specialCaller)
286.780 - +( isStatic ? "" : " receiver="+rcvc)
286.781 - +" => "+target
286.782 - +(noAccess == null ? "" : " !! "+noAccess));
286.783 - if (positive && noAccess != null) throw noAccess;
286.784 - assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null);
286.785 - if (!positive) return; // negative test failed as expected
286.786 - assertEquals(isStatic, Modifier.isStatic(rmethod.getModifiers()));
286.787 - Class<?>[] paramsMaybeWithSelf = params;
286.788 - if (!isStatic) {
286.789 - paramsMaybeWithSelf = cat(array(Class[].class, (Class)rcvc), params);
286.790 - }
286.791 - MethodType typeMaybeWithSelf = MethodType.methodType(ret, paramsMaybeWithSelf);
286.792 - if (isStatic) {
286.793 - assertEquals(typeMaybeWithSelf, target.type());
286.794 - } else {
286.795 - if (isSpecial)
286.796 - assertEquals(specialCaller, target.type().parameterType(0));
286.797 - else
286.798 - assertEquals(defc, target.type().parameterType(0));
286.799 - assertEquals(typeMaybeWithSelf, target.type().changeParameterType(0, rcvc));
286.800 - }
286.801 - Object[] argsMaybeWithSelf = randomArgs(paramsMaybeWithSelf);
286.802 - printCalled(target, name, argsMaybeWithSelf);
286.803 - target.invokeWithArguments(argsMaybeWithSelf);
286.804 - assertCalled(name, argsMaybeWithSelf);
286.805 - if (verbosity >= 1)
286.806 - System.out.print(':');
286.807 - }
286.808 -
286.809 - void testUnreflectSpecial(Class<?> defc, Class<?> rcvc, Class<?> ret, String name, Class<?>... params) throws Throwable {
286.810 - for (Object[] ac : accessCases(defc, name, true)) {
286.811 - Class<?> specialCaller = rcvc;
286.812 - testUnreflectMaybeSpecial(specialCaller, (Boolean)ac[0], (Lookup)ac[1], defc, rcvc, ret, name, params);
286.813 - }
286.814 - }
286.815 -
286.816 - @Test
286.817 - public void testUnreflectSpecial() throws Throwable {
286.818 - if (CAN_SKIP_WORKING) return;
286.819 - startTest("unreflectSpecial");
286.820 - testUnreflectSpecial(Example.class, Example.class, void.class, "v0");
286.821 - testUnreflectSpecial(Example.class, SubExample.class, void.class, "v0");
286.822 - testUnreflectSpecial(Example.class, Example.class, void.class, "pkg_v0");
286.823 - testUnreflectSpecial(Example.class, SubExample.class, void.class, "pkg_v0");
286.824 - testUnreflectSpecial(Example.class, Example.class, Object.class, "v2", int.class, int.class);
286.825 - testUnreflectSpecial(Example.class, SubExample.class, Object.class, "v2", int.class, int.class);
286.826 - testUnreflectMaybeSpecial(Example.class, false, PRIVATE, Example.class, Example.class, void.class, "s0");
286.827 - }
286.828 -
286.829 - public static class HasFields {
286.830 - boolean fZ = false;
286.831 - byte fB = (byte)'B';
286.832 - short fS = (short)'S';
286.833 - char fC = 'C';
286.834 - int fI = 'I';
286.835 - long fJ = 'J';
286.836 - float fF = 'F';
286.837 - double fD = 'D';
286.838 - static boolean sZ = true;
286.839 - static byte sB = 1+(byte)'B';
286.840 - static short sS = 1+(short)'S';
286.841 - static char sC = 1+'C';
286.842 - static int sI = 1+'I';
286.843 - static long sJ = 1+'J';
286.844 - static float sF = 1+'F';
286.845 - static double sD = 1+'D';
286.846 -
286.847 - Object fL = 'L';
286.848 - String fR = "R";
286.849 - static Object sL = 'M';
286.850 - static String sR = "S";
286.851 -
286.852 - static final Object[][] CASES;
286.853 - static {
286.854 - ArrayList<Object[]> cases = new ArrayList<Object[]>();
286.855 - Object types[][] = {
286.856 - {'L',Object.class}, {'R',String.class},
286.857 - {'I',int.class}, {'J',long.class},
286.858 - {'F',float.class}, {'D',double.class},
286.859 - {'Z',boolean.class}, {'B',byte.class},
286.860 - {'S',short.class}, {'C',char.class},
286.861 - };
286.862 - HasFields fields = new HasFields();
286.863 - for (Object[] t : types) {
286.864 - for (int kind = 0; kind <= 1; kind++) {
286.865 - boolean isStatic = (kind != 0);
286.866 - char btc = (Character)t[0];
286.867 - String name = (isStatic ? "s" : "f") + btc;
286.868 - Class<?> type = (Class<?>) t[1];
286.869 - Object value;
286.870 - Field field;
286.871 - try {
286.872 - field = HasFields.class.getDeclaredField(name);
286.873 - } catch (Exception ex) {
286.874 - throw new InternalError("no field HasFields."+name);
286.875 - }
286.876 - try {
286.877 - value = field.get(fields);
286.878 - } catch (Exception ex) {
286.879 - throw new InternalError("cannot fetch field HasFields."+name);
286.880 - }
286.881 - if (type == float.class) {
286.882 - float v = 'F';
286.883 - if (isStatic) v++;
286.884 - assertTrue(value.equals(v));
286.885 - }
286.886 - assertTrue(name.equals(field.getName()));
286.887 - assertTrue(type.equals(field.getType()));
286.888 - assertTrue(isStatic == (Modifier.isStatic(field.getModifiers())));
286.889 - cases.add(new Object[]{ field, value });
286.890 - }
286.891 - }
286.892 - cases.add(new Object[]{ new Object[]{ false, HasFields.class, "bogus_fD", double.class }, Error.class });
286.893 - cases.add(new Object[]{ new Object[]{ true, HasFields.class, "bogus_sL", Object.class }, Error.class });
286.894 - CASES = cases.toArray(new Object[0][]);
286.895 - }
286.896 - }
286.897 -
286.898 - static final int TEST_UNREFLECT = 1, TEST_FIND_FIELD = 2, TEST_FIND_STATIC = 3, TEST_SETTER = 0x10;
286.899 - static boolean testModeMatches(int testMode, boolean isStatic) {
286.900 - switch (testMode) {
286.901 - case TEST_FIND_STATIC: return isStatic;
286.902 - case TEST_FIND_FIELD: return !isStatic;
286.903 - case TEST_UNREFLECT: return true; // unreflect matches both
286.904 - }
286.905 - throw new InternalError("testMode="+testMode);
286.906 - }
286.907 -
286.908 - @Test
286.909 - public void testUnreflectGetter() throws Throwable {
286.910 - startTest("unreflectGetter");
286.911 - testGetter(TEST_UNREFLECT);
286.912 - }
286.913 - @Test
286.914 - public void testFindGetter() throws Throwable {
286.915 - startTest("findGetter");
286.916 - testGetter(TEST_FIND_FIELD);
286.917 - }
286.918 - @Test
286.919 - public void testFindStaticGetter() throws Throwable {
286.920 - startTest("findStaticGetter");
286.921 - testGetter(TEST_FIND_STATIC);
286.922 - }
286.923 - public void testGetter(int testMode) throws Throwable {
286.924 - Lookup lookup = PRIVATE; // FIXME: test more lookups than this one
286.925 - for (Object[] c : HasFields.CASES) {
286.926 - boolean positive = (c[1] != Error.class);
286.927 - testGetter(positive, lookup, c[0], c[1], testMode);
286.928 - }
286.929 - testGetter(true, lookup,
286.930 - new Object[]{ true, System.class, "out", java.io.PrintStream.class },
286.931 - System.out, testMode);
286.932 - for (int isStaticN = 0; isStaticN <= 1; isStaticN++) {
286.933 - testGetter(false, lookup,
286.934 - new Object[]{ (isStaticN != 0), System.class, "bogus", char.class },
286.935 - null, testMode);
286.936 - }
286.937 - }
286.938 - public void testGetter(boolean positive, MethodHandles.Lookup lookup,
286.939 - Object fieldRef, Object value, int testMode) throws Throwable {
286.940 - testAccessor(positive, lookup, fieldRef, value, testMode);
286.941 - }
286.942 -
286.943 - public void testAccessor(boolean positive, MethodHandles.Lookup lookup,
286.944 - Object fieldRef, Object value, int testMode0) throws Throwable {
286.945 - boolean isGetter = ((testMode0 & TEST_SETTER) == 0);
286.946 - int testMode = testMode0 & ~TEST_SETTER;
286.947 - boolean isStatic;
286.948 - Class<?> fclass;
286.949 - String fname;
286.950 - Class<?> ftype;
286.951 - Field f = (fieldRef instanceof Field ? (Field)fieldRef : null);
286.952 - if (f != null) {
286.953 - isStatic = Modifier.isStatic(f.getModifiers());
286.954 - fclass = f.getDeclaringClass();
286.955 - fname = f.getName();
286.956 - ftype = f.getType();
286.957 - } else {
286.958 - Object[] scnt = (Object[]) fieldRef;
286.959 - isStatic = (Boolean) scnt[0];
286.960 - fclass = (Class<?>) scnt[1];
286.961 - fname = (String) scnt[2];
286.962 - ftype = (Class<?>) scnt[3];
286.963 - try {
286.964 - f = fclass.getDeclaredField(fname);
286.965 - } catch (ReflectiveOperationException ex) {
286.966 - f = null;
286.967 - }
286.968 - }
286.969 - if (!testModeMatches(testMode, isStatic)) return;
286.970 - if (f == null && testMode == TEST_UNREFLECT) return;
286.971 - countTest(positive);
286.972 - MethodType expType;
286.973 - if (isGetter)
286.974 - expType = MethodType.methodType(ftype, HasFields.class);
286.975 - else
286.976 - expType = MethodType.methodType(void.class, HasFields.class, ftype);
286.977 - if (isStatic) expType = expType.dropParameterTypes(0, 1);
286.978 - Exception noAccess = null;
286.979 - MethodHandle mh;
286.980 - try {
286.981 - switch (testMode0) {
286.982 - case TEST_UNREFLECT: mh = lookup.unreflectGetter(f); break;
286.983 - case TEST_FIND_FIELD: mh = lookup.findGetter(fclass, fname, ftype); break;
286.984 - case TEST_FIND_STATIC: mh = lookup.findStaticGetter(fclass, fname, ftype); break;
286.985 - case TEST_SETTER|
286.986 - TEST_UNREFLECT: mh = lookup.unreflectSetter(f); break;
286.987 - case TEST_SETTER|
286.988 - TEST_FIND_FIELD: mh = lookup.findSetter(fclass, fname, ftype); break;
286.989 - case TEST_SETTER|
286.990 - TEST_FIND_STATIC: mh = lookup.findStaticSetter(fclass, fname, ftype); break;
286.991 - default:
286.992 - throw new InternalError("testMode="+testMode);
286.993 - }
286.994 - } catch (ReflectiveOperationException ex) {
286.995 - mh = null;
286.996 - noAccess = ex;
286.997 - if (fname.contains("bogus"))
286.998 - assertTrue(noAccess instanceof NoSuchFieldException);
286.999 - else
286.1000 - assertTrue(noAccess instanceof IllegalAccessException);
286.1001 - }
286.1002 - if (verbosity >= 3)
286.1003 - System.out.println("find"+(isStatic?"Static":"")+(isGetter?"Getter":"Setter")+" "+fclass.getName()+"."+fname+"/"+ftype
286.1004 - +" => "+mh
286.1005 - +(noAccess == null ? "" : " !! "+noAccess));
286.1006 - if (positive && noAccess != null) throw new RuntimeException(noAccess);
286.1007 - assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, mh != null);
286.1008 - if (!positive) return; // negative test failed as expected
286.1009 - assertEquals((isStatic ? 0 : 1)+(isGetter ? 0 : 1), mh.type().parameterCount());
286.1010 -
286.1011 -
286.1012 - assertSame(mh.type(), expType);
286.1013 - assertNameStringContains(mh, fname);
286.1014 - HasFields fields = new HasFields();
286.1015 - Object sawValue;
286.1016 - Class<?> vtype = ftype;
286.1017 - if (ftype != int.class) vtype = Object.class;
286.1018 - if (isGetter) {
286.1019 - mh = MethodHandles.convertArguments(mh, mh.type().generic()
286.1020 - .changeReturnType(vtype));
286.1021 - } else {
286.1022 - int last = mh.type().parameterCount() - 1;
286.1023 - mh = MethodHandles.convertArguments(mh, mh.type().generic()
286.1024 - .changeReturnType(void.class)
286.1025 - .changeParameterType(last, vtype));
286.1026 - }
286.1027 - if (f != null && f.getDeclaringClass() == HasFields.class) {
286.1028 - assertEquals(f.get(fields), value); // clean to start with
286.1029 - }
286.1030 - if (isGetter) {
286.1031 - Object expValue = value;
286.1032 - for (int i = 0; i <= 1; i++) {
286.1033 - if (isStatic) {
286.1034 - if (ftype == int.class)
286.1035 - sawValue = (int) mh.invokeExact(); // do these exactly
286.1036 - else
286.1037 - sawValue = mh.invokeExact();
286.1038 - } else {
286.1039 - if (ftype == int.class)
286.1040 - sawValue = (int) mh.invokeExact((Object) fields);
286.1041 - else
286.1042 - sawValue = mh.invokeExact((Object) fields);
286.1043 - }
286.1044 - assertEquals(sawValue, expValue);
286.1045 - if (f != null && f.getDeclaringClass() == HasFields.class
286.1046 - && !Modifier.isFinal(f.getModifiers())) {
286.1047 - Object random = randomArg(ftype);
286.1048 - f.set(fields, random);
286.1049 - expValue = random;
286.1050 - } else {
286.1051 - break;
286.1052 - }
286.1053 - }
286.1054 - } else {
286.1055 - for (int i = 0; i <= 1; i++) {
286.1056 - Object putValue = randomArg(ftype);
286.1057 - if (isStatic) {
286.1058 - if (ftype == int.class)
286.1059 - mh.invokeExact((int)putValue); // do these exactly
286.1060 - else
286.1061 - mh.invokeExact(putValue);
286.1062 - } else {
286.1063 - if (ftype == int.class)
286.1064 - mh.invokeExact((Object) fields, (int)putValue);
286.1065 - else
286.1066 - mh.invokeExact((Object) fields, putValue);
286.1067 - }
286.1068 - if (f != null && f.getDeclaringClass() == HasFields.class) {
286.1069 - assertEquals(f.get(fields), putValue);
286.1070 - }
286.1071 - }
286.1072 - }
286.1073 - if (f != null && f.getDeclaringClass() == HasFields.class) {
286.1074 - f.set(fields, value); // put it back
286.1075 - }
286.1076 - }
286.1077 -
286.1078 -
286.1079 - @Test
286.1080 - public void testUnreflectSetter() throws Throwable {
286.1081 - startTest("unreflectSetter");
286.1082 - testSetter(TEST_UNREFLECT);
286.1083 - }
286.1084 - @Test
286.1085 - public void testFindSetter() throws Throwable {
286.1086 - startTest("findSetter");
286.1087 - testSetter(TEST_FIND_FIELD);
286.1088 - }
286.1089 - @Test
286.1090 - public void testFindStaticSetter() throws Throwable {
286.1091 - startTest("findStaticSetter");
286.1092 - testSetter(TEST_FIND_STATIC);
286.1093 - }
286.1094 - public void testSetter(int testMode) throws Throwable {
286.1095 - Lookup lookup = PRIVATE; // FIXME: test more lookups than this one
286.1096 - startTest("unreflectSetter");
286.1097 - for (Object[] c : HasFields.CASES) {
286.1098 - boolean positive = (c[1] != Error.class);
286.1099 - testSetter(positive, lookup, c[0], c[1], testMode);
286.1100 - }
286.1101 - for (int isStaticN = 0; isStaticN <= 1; isStaticN++) {
286.1102 - testSetter(false, lookup,
286.1103 - new Object[]{ (isStaticN != 0), System.class, "bogus", char.class },
286.1104 - null, testMode);
286.1105 - }
286.1106 - }
286.1107 - public void testSetter(boolean positive, MethodHandles.Lookup lookup,
286.1108 - Object fieldRef, Object value, int testMode) throws Throwable {
286.1109 - testAccessor(positive, lookup, fieldRef, value, testMode | TEST_SETTER);
286.1110 - }
286.1111 -
286.1112 - @Test
286.1113 - public void testArrayElementGetter() throws Throwable {
286.1114 - startTest("arrayElementGetter");
286.1115 - testArrayElementGetterSetter(false);
286.1116 - }
286.1117 -
286.1118 - @Test
286.1119 - public void testArrayElementSetter() throws Throwable {
286.1120 - startTest("arrayElementSetter");
286.1121 - testArrayElementGetterSetter(true);
286.1122 - }
286.1123 -
286.1124 - public void testArrayElementGetterSetter(boolean testSetter) throws Throwable {
286.1125 - testArrayElementGetterSetter(new Object[10], testSetter);
286.1126 - testArrayElementGetterSetter(new String[10], testSetter);
286.1127 - testArrayElementGetterSetter(new boolean[10], testSetter);
286.1128 - testArrayElementGetterSetter(new byte[10], testSetter);
286.1129 - testArrayElementGetterSetter(new char[10], testSetter);
286.1130 - testArrayElementGetterSetter(new short[10], testSetter);
286.1131 - testArrayElementGetterSetter(new int[10], testSetter);
286.1132 - testArrayElementGetterSetter(new float[10], testSetter);
286.1133 - testArrayElementGetterSetter(new long[10], testSetter);
286.1134 - testArrayElementGetterSetter(new double[10], testSetter);
286.1135 - }
286.1136 -
286.1137 - public void testArrayElementGetterSetter(Object array, boolean testSetter) throws Throwable {
286.1138 - countTest(true);
286.1139 - if (verbosity >= 2) System.out.println("array type = "+array.getClass().getComponentType().getName()+"["+Array.getLength(array)+"]");
286.1140 - Class<?> arrayType = array.getClass();
286.1141 - Class<?> elemType = arrayType.getComponentType();
286.1142 - MethodType expType = !testSetter
286.1143 - ? MethodType.methodType(elemType, arrayType, int.class)
286.1144 - : MethodType.methodType(void.class, arrayType, int.class, elemType);
286.1145 - MethodHandle mh = !testSetter
286.1146 - ? MethodHandles.arrayElementGetter(arrayType)
286.1147 - : MethodHandles.arrayElementSetter(arrayType);
286.1148 - assertSame(mh.type(), expType);
286.1149 - if (elemType != int.class && elemType != boolean.class) {
286.1150 - MethodType gtype;
286.1151 - if (true) { // FIXME: remove this path (and remove <void> below in the mh.invokes)
286.1152 - gtype = mh.type().changeParameterType(0, Object.class);
286.1153 - if (testSetter)
286.1154 - gtype = gtype.changeParameterType(2, Object.class);
286.1155 - else
286.1156 - gtype = gtype.changeReturnType(Object.class);
286.1157 - } else
286.1158 - // FIXME: This simpler path hits a bug in convertArguments => ToGeneric
286.1159 - gtype = mh.type().generic().changeParameterType(1, int.class);
286.1160 - mh = MethodHandles.convertArguments(mh, gtype);
286.1161 - }
286.1162 - Object sawValue, expValue;
286.1163 - List<Object> model = array2list(array);
286.1164 - int length = Array.getLength(array);
286.1165 - for (int i = 0; i < length; i++) {
286.1166 - // update array element
286.1167 - Object random = randomArg(elemType);
286.1168 - model.set(i, random);
286.1169 - if (testSetter) {
286.1170 - if (elemType == int.class)
286.1171 - mh.invokeExact((int[]) array, i, (int)random);
286.1172 - else if (elemType == boolean.class)
286.1173 - mh.invokeExact((boolean[]) array, i, (boolean)random);
286.1174 - else
286.1175 - mh.invokeExact(array, i, random);
286.1176 - assertEquals(model, array2list(array));
286.1177 - } else {
286.1178 - Array.set(array, i, random);
286.1179 - }
286.1180 - if (verbosity >= 5) {
286.1181 - List<Object> array2list = array2list(array);
286.1182 - System.out.println("a["+i+"]="+random+" => "+array2list);
286.1183 - if (!array2list.equals(model))
286.1184 - System.out.println("*** != "+model);
286.1185 - }
286.1186 - // observe array element
286.1187 - sawValue = Array.get(array, i);
286.1188 - if (!testSetter) {
286.1189 - expValue = sawValue;
286.1190 - if (elemType == int.class)
286.1191 - sawValue = (int) mh.invokeExact((int[]) array, i);
286.1192 - else if (elemType == boolean.class)
286.1193 - sawValue = (boolean) mh.invokeExact((boolean[]) array, i);
286.1194 - else
286.1195 - sawValue = mh.invokeExact(array, i);
286.1196 - assertEquals(sawValue, expValue);
286.1197 - assertEquals(model, array2list(array));
286.1198 - }
286.1199 - }
286.1200 - }
286.1201 -
286.1202 - List<Object> array2list(Object array) {
286.1203 - int length = Array.getLength(array);
286.1204 - ArrayList<Object> model = new ArrayList<Object>(length);
286.1205 - for (int i = 0; i < length; i++)
286.1206 - model.add(Array.get(array, i));
286.1207 - return model;
286.1208 - }
286.1209 -
286.1210 - static class Callee {
286.1211 - static Object id() { return called("id"); }
286.1212 - static Object id(Object x) { return called("id", x); }
286.1213 - static Object id(Object x, Object y) { return called("id", x, y); }
286.1214 - static Object id(Object x, Object y, Object z) { return called("id", x, y, z); }
286.1215 - static Object id(Object... vx) { return called("id", vx); }
286.1216 - static MethodHandle ofType(int n) {
286.1217 - return ofType(Object.class, n);
286.1218 - }
286.1219 - static MethodHandle ofType(Class<?> rtype, int n) {
286.1220 - if (n == -1)
286.1221 - return ofType(MethodType.methodType(rtype, Object[].class));
286.1222 - return ofType(MethodType.genericMethodType(n).changeReturnType(rtype));
286.1223 - }
286.1224 - static MethodHandle ofType(Class<?> rtype, Class<?>... ptypes) {
286.1225 - return ofType(MethodType.methodType(rtype, ptypes));
286.1226 - }
286.1227 - static MethodHandle ofType(MethodType type) {
286.1228 - Class<?> rtype = type.returnType();
286.1229 - String pfx = "";
286.1230 - if (rtype != Object.class)
286.1231 - pfx = rtype.getSimpleName().substring(0, 1).toLowerCase();
286.1232 - String name = pfx+"id";
286.1233 - try {
286.1234 - return PRIVATE.findStatic(Callee.class, name, type);
286.1235 - } catch (Exception ex) {
286.1236 - throw new RuntimeException(ex);
286.1237 - }
286.1238 - }
286.1239 - }
286.1240 -
286.1241 - @Test
286.1242 - public void testConvertArguments() throws Throwable {
286.1243 - if (CAN_SKIP_WORKING) return;
286.1244 - startTest("convertArguments");
286.1245 - testConvert(Callee.ofType(1), null, "id", int.class);
286.1246 - testConvert(Callee.ofType(1), null, "id", String.class);
286.1247 - testConvert(Callee.ofType(1), null, "id", Integer.class);
286.1248 - testConvert(Callee.ofType(1), null, "id", short.class);
286.1249 - testConvert(Callee.ofType(1), null, "id", char.class);
286.1250 - testConvert(Callee.ofType(1), null, "id", byte.class);
286.1251 - }
286.1252 -
286.1253 - void testConvert(MethodHandle id, Class<?> rtype, String name, Class<?>... params) throws Throwable {
286.1254 - testConvert(true, false, id, rtype, name, params);
286.1255 - testConvert(true, true, id, rtype, name, params);
286.1256 - }
286.1257 -
286.1258 - void testConvert(boolean positive, boolean useAsType,
286.1259 - MethodHandle id, Class<?> rtype, String name, Class<?>... params) throws Throwable {
286.1260 - countTest(positive);
286.1261 - MethodType idType = id.type();
286.1262 - if (rtype == null) rtype = idType.returnType();
286.1263 - for (int i = 0; i < params.length; i++) {
286.1264 - if (params[i] == null) params[i] = idType.parameterType(i);
286.1265 - }
286.1266 - // simulate the pairwise conversion
286.1267 - MethodType newType = MethodType.methodType(rtype, params);
286.1268 - Object[] args = randomArgs(newType.parameterArray());
286.1269 - Object[] convArgs = args.clone();
286.1270 - for (int i = 0; i < args.length; i++) {
286.1271 - Class<?> src = newType.parameterType(i);
286.1272 - Class<?> dst = idType.parameterType(i);
286.1273 - if (src != dst)
286.1274 - convArgs[i] = castToWrapper(convArgs[i], dst);
286.1275 - }
286.1276 - Object convResult = id.invokeWithArguments(convArgs);
286.1277 - {
286.1278 - Class<?> dst = newType.returnType();
286.1279 - Class<?> src = idType.returnType();
286.1280 - if (src != dst)
286.1281 - convResult = castToWrapper(convResult, dst);
286.1282 - }
286.1283 - MethodHandle target = null;
286.1284 - RuntimeException error = null;
286.1285 - try {
286.1286 - if (useAsType)
286.1287 - target = id.asType(newType);
286.1288 - else
286.1289 - target = MethodHandles.convertArguments(id, newType);
286.1290 - } catch (RuntimeException ex) {
286.1291 - error = ex;
286.1292 - }
286.1293 - if (verbosity >= 3)
286.1294 - System.out.println("convert "+id+ " to "+newType+" => "+target
286.1295 - +(error == null ? "" : " !! "+error));
286.1296 - if (positive && error != null) throw error;
286.1297 - assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null);
286.1298 - if (!positive) return; // negative test failed as expected
286.1299 - assertEquals(newType, target.type());
286.1300 - printCalled(target, id.toString(), args);
286.1301 - Object result = target.invokeWithArguments(args);
286.1302 - assertCalled(name, convArgs);
286.1303 - assertEquals(convResult, result);
286.1304 - if (verbosity >= 1)
286.1305 - System.out.print(':');
286.1306 - }
286.1307 -
286.1308 - @Test
286.1309 - public void testVarargsCollector() throws Throwable {
286.1310 - MethodHandle vac0 = PRIVATE.findStatic(MethodHandlesTest.class, "called",
286.1311 - MethodType.methodType(Object.class, String.class, Object[].class));
286.1312 - vac0 = vac0.bindTo("vac");
286.1313 - MethodHandle vac = vac0.asVarargsCollector(Object[].class);
286.1314 - testConvert(true, true, vac.asType(MethodType.genericMethodType(0)), null, "vac");
286.1315 - testConvert(true, true, vac.asType(MethodType.genericMethodType(0)), null, "vac");
286.1316 - for (Class<?> at : new Class[] { Object.class, String.class, Integer.class }) {
286.1317 - testConvert(true, true, vac.asType(MethodType.genericMethodType(1)), null, "vac", at);
286.1318 - testConvert(true, true, vac.asType(MethodType.genericMethodType(2)), null, "vac", at, at);
286.1319 - }
286.1320 - }
286.1321 -
286.1322 - @Test
286.1323 - public void testPermuteArguments() throws Throwable {
286.1324 - if (CAN_SKIP_WORKING) return;
286.1325 - startTest("permuteArguments");
286.1326 - testPermuteArguments(4, Integer.class, 2, String.class, 0);
286.1327 - //testPermuteArguments(6, Integer.class, 0, null, 30);
286.1328 - //testPermuteArguments(4, Integer.class, 1, int.class, 6);
286.1329 - }
286.1330 - public void testPermuteArguments(int max, Class<?> type1, int t2c, Class<?> type2, int dilution) throws Throwable {
286.1331 - if (verbosity >= 2)
286.1332 - System.out.println("permuteArguments "+max+"*"+type1.getName()
286.1333 - +(t2c==0?"":"/"+t2c+"*"+type2.getName())
286.1334 - +(dilution > 0 ? " with dilution "+dilution : ""));
286.1335 - int t2pos = t2c == 0 ? 0 : 1;
286.1336 - for (int inargs = t2pos+1; inargs <= max; inargs++) {
286.1337 - Class<?>[] types = new Class<?>[inargs];
286.1338 - Arrays.fill(types, type1);
286.1339 - if (t2c != 0) {
286.1340 - // Fill in a middle range with type2:
286.1341 - Arrays.fill(types, t2pos, Math.min(t2pos+t2c, inargs), type2);
286.1342 - }
286.1343 - Object[] args = randomArgs(types);
286.1344 - int numcases = 1;
286.1345 - for (int outargs = 0; outargs <= max; outargs++) {
286.1346 - if (outargs - inargs >= MAX_ARG_INCREASE) continue;
286.1347 - int[] reorder = new int[outargs];
286.1348 - int casStep = dilution + 1;
286.1349 - // Avoid some common factors:
286.1350 - while ((casStep > 2 && casStep % 2 == 0 && inargs % 2 == 0) ||
286.1351 - (casStep > 3 && casStep % 3 == 0 && inargs % 3 == 0))
286.1352 - casStep++;
286.1353 - for (int cas = 0; cas < numcases; cas += casStep) {
286.1354 - for (int i = 0, c = cas; i < outargs; i++) {
286.1355 - reorder[i] = c % inargs;
286.1356 - c /= inargs;
286.1357 - }
286.1358 - testPermuteArguments(args, types, reorder);
286.1359 - }
286.1360 - numcases *= inargs;
286.1361 - if (dilution > 10 && outargs >= 4) {
286.1362 - // Do some special patterns, which we probably missed.
286.1363 - // Replication of a single argument or argument pair.
286.1364 - for (int i = 0; i < inargs; i++) {
286.1365 - Arrays.fill(reorder, i);
286.1366 - testPermuteArguments(args, types, reorder);
286.1367 - for (int d = 1; d <= 2; d++) {
286.1368 - if (i + d >= inargs) continue;
286.1369 - for (int j = 1; j < outargs; j += 2)
286.1370 - reorder[j] += 1;
286.1371 - testPermuteArguments(args, types, reorder);
286.1372 - testPermuteArguments(args, types, reverse(reorder));
286.1373 - }
286.1374 - }
286.1375 - // Repetition of a sequence of 3 or more arguments.
286.1376 - for (int i = 1; i < inargs; i++) {
286.1377 - for (int len = 3; len <= inargs; len++) {
286.1378 - for (int j = 0; j < outargs; j++)
286.1379 - reorder[j] = (i + (j % len)) % inargs;
286.1380 - testPermuteArguments(args, types, reorder);
286.1381 - testPermuteArguments(args, types, reverse(reorder));
286.1382 - }
286.1383 - }
286.1384 - }
286.1385 - }
286.1386 - }
286.1387 - }
286.1388 -
286.1389 - static int[] reverse(int[] reorder) {
286.1390 - reorder = reorder.clone();
286.1391 - for (int i = 0, imax = reorder.length / 2; i < imax; i++) {
286.1392 - int j = reorder.length - 1 - i;
286.1393 - int tem = reorder[i];
286.1394 - reorder[i] = reorder[j];
286.1395 - reorder[j] = tem;
286.1396 - }
286.1397 - return reorder;
286.1398 - }
286.1399 -
286.1400 - void testPermuteArguments(Object[] args, Class<?>[] types, int[] reorder) throws Throwable {
286.1401 - countTest();
286.1402 - if (args == null && types == null) {
286.1403 - int max = 0;
286.1404 - for (int j : reorder) {
286.1405 - if (max < j) max = j;
286.1406 - }
286.1407 - args = randomArgs(max+1, Integer.class);
286.1408 - }
286.1409 - if (args == null) {
286.1410 - args = randomArgs(types);
286.1411 - }
286.1412 - if (types == null) {
286.1413 - types = new Class<?>[args.length];
286.1414 - for (int i = 0; i < args.length; i++)
286.1415 - types[i] = args[i].getClass();
286.1416 - }
286.1417 - int inargs = args.length, outargs = reorder.length;
286.1418 - assertTrue(inargs == types.length);
286.1419 - if (verbosity >= 3)
286.1420 - System.out.println("permuteArguments "+Arrays.toString(reorder));
286.1421 - Object[] permArgs = new Object[outargs];
286.1422 - Class<?>[] permTypes = new Class<?>[outargs];
286.1423 - for (int i = 0; i < outargs; i++) {
286.1424 - permArgs[i] = args[reorder[i]];
286.1425 - permTypes[i] = types[reorder[i]];
286.1426 - }
286.1427 - if (verbosity >= 4) {
286.1428 - System.out.println("in args: "+Arrays.asList(args));
286.1429 - System.out.println("out args: "+Arrays.asList(permArgs));
286.1430 - System.out.println("in types: "+Arrays.asList(types));
286.1431 - System.out.println("out types: "+Arrays.asList(permTypes));
286.1432 - }
286.1433 - MethodType inType = MethodType.methodType(Object.class, types);
286.1434 - MethodType outType = MethodType.methodType(Object.class, permTypes);
286.1435 - MethodHandle target = MethodHandles.convertArguments(varargsList(outargs), outType);
286.1436 - MethodHandle newTarget = MethodHandles.permuteArguments(target, inType, reorder);
286.1437 - Object result = newTarget.invokeWithArguments(args);
286.1438 - Object expected = Arrays.asList(permArgs);
286.1439 - assertEquals(expected, result);
286.1440 - }
286.1441 -
286.1442 -
286.1443 - @Test
286.1444 - public void testSpreadArguments() throws Throwable {
286.1445 - if (CAN_SKIP_WORKING) return;
286.1446 - startTest("spreadArguments");
286.1447 - for (Class<?> argType : new Class[]{Object.class, Integer.class, int.class}) {
286.1448 - if (verbosity >= 3)
286.1449 - System.out.println("spreadArguments "+argType);
286.1450 - // FIXME: enable _adapter_spread_args and fix Fail_2
286.1451 - for (int nargs = 0; nargs < 10; nargs++) {
286.1452 - if (argType == int.class && nargs >= 6) continue; // FIXME Fail_1
286.1453 - for (int pos = 0; pos < nargs; pos++) {
286.1454 - if (argType == int.class && pos > 0) continue; // FIXME Fail_3
286.1455 - testSpreadArguments(argType, pos, nargs);
286.1456 - }
286.1457 - }
286.1458 - }
286.1459 - }
286.1460 - public void testSpreadArguments(Class<?> argType, int pos, int nargs) throws Throwable {
286.1461 - countTest();
286.1462 - MethodHandle target = varargsArray(nargs);
286.1463 - MethodHandle target2 = changeArgTypes(target, argType);
286.1464 - if (verbosity >= 3)
286.1465 - System.out.println("spread into "+target2+" ["+pos+".."+nargs+"]");
286.1466 - Object[] args = randomArgs(target2.type().parameterArray());
286.1467 - // make sure the target does what we think it does:
286.1468 - if (pos == 0 && nargs < 5) {
286.1469 - Object[] check = (Object[]) target.invokeWithArguments(args);
286.1470 - assertArrayEquals(args, check);
286.1471 - switch (nargs) {
286.1472 - case 0:
286.1473 - check = (Object[]) target.invokeExact();
286.1474 - assertArrayEquals(args, check);
286.1475 - break;
286.1476 - case 1:
286.1477 - check = (Object[]) target.invokeExact(args[0]);
286.1478 - assertArrayEquals(args, check);
286.1479 - break;
286.1480 - case 2:
286.1481 - check = (Object[]) target.invokeExact(args[0], args[1]);
286.1482 - assertArrayEquals(args, check);
286.1483 - break;
286.1484 - }
286.1485 - }
286.1486 - List<Class<?>> newParams = new ArrayList<Class<?>>(target2.type().parameterList());
286.1487 - { // modify newParams in place
286.1488 - List<Class<?>> spreadParams = newParams.subList(pos, nargs);
286.1489 - spreadParams.clear(); spreadParams.add(Object[].class);
286.1490 - }
286.1491 - MethodType newType = MethodType.methodType(Object.class, newParams);
286.1492 - MethodHandle result = target2.asSpreader(Object[].class, nargs-pos).asType(newType);
286.1493 - Object[] returnValue;
286.1494 - if (pos == 0) {
286.1495 - // In the following line, the first cast implies
286.1496 - // normal Object return value for the MH call (Object[])->Object,
286.1497 - // while the second cast dynamically converts to an Object array.
286.1498 - // Such a double cast is typical of MH.invokeExact.
286.1499 - returnValue = (Object[]) (Object) result.invokeExact(args);
286.1500 - } else {
286.1501 - Object[] args1 = Arrays.copyOfRange(args, 0, pos+1);
286.1502 - args1[pos] = Arrays.copyOfRange(args, pos, args.length);
286.1503 - returnValue = (Object[]) result.invokeWithArguments(args1);
286.1504 - }
286.1505 - assertArrayEquals(args, returnValue);
286.1506 - }
286.1507 -
286.1508 - @Test
286.1509 - public void testCollectArguments() throws Throwable {
286.1510 - if (CAN_SKIP_WORKING) return;
286.1511 - startTest("collectArguments");
286.1512 - for (Class<?> argType : new Class[]{Object.class, Integer.class, int.class}) {
286.1513 - if (verbosity >= 3)
286.1514 - System.out.println("collectArguments "+argType);
286.1515 - for (int nargs = 0; nargs < 10; nargs++) {
286.1516 - for (int pos = 0; pos < nargs; pos++) {
286.1517 - if (argType == int.class) continue; // FIXME Fail_4
286.1518 - testCollectArguments(argType, pos, nargs);
286.1519 - }
286.1520 - }
286.1521 - }
286.1522 - }
286.1523 - public void testCollectArguments(Class<?> argType, int pos, int nargs) throws Throwable {
286.1524 - countTest();
286.1525 - // fake up a MH with the same type as the desired adapter:
286.1526 - MethodHandle fake = varargsArray(nargs);
286.1527 - fake = changeArgTypes(fake, argType);
286.1528 - MethodType newType = fake.type();
286.1529 - Object[] args = randomArgs(newType.parameterArray());
286.1530 - // here is what should happen:
286.1531 - Object[] collectedArgs = Arrays.copyOfRange(args, 0, pos+1);
286.1532 - collectedArgs[pos] = Arrays.copyOfRange(args, pos, args.length);
286.1533 - // here is the MH which will witness the collected argument tail:
286.1534 - MethodHandle target = varargsArray(pos+1);
286.1535 - target = changeArgTypes(target, 0, pos, argType);
286.1536 - target = changeArgTypes(target, pos, pos+1, Object[].class);
286.1537 - if (verbosity >= 3)
286.1538 - System.out.println("collect from "+Arrays.asList(args)+" ["+pos+".."+nargs+"]");
286.1539 - MethodHandle result = target.asCollector(Object[].class, nargs-pos).asType(newType);
286.1540 - Object[] returnValue = (Object[]) result.invokeWithArguments(args);
286.1541 -// assertTrue(returnValue.length == pos+1 && returnValue[pos] instanceof Object[]);
286.1542 -// returnValue[pos] = Arrays.asList((Object[]) returnValue[pos]);
286.1543 -// collectedArgs[pos] = Arrays.asList((Object[]) collectedArgs[pos]);
286.1544 - assertArrayEquals(collectedArgs, returnValue);
286.1545 - }
286.1546 -
286.1547 - @Test
286.1548 - public void testInsertArguments() throws Throwable {
286.1549 - if (CAN_SKIP_WORKING) return;
286.1550 - startTest("insertArguments");
286.1551 - for (int nargs = 0; nargs <= 4; nargs++) {
286.1552 - for (int ins = 0; ins <= 4; ins++) {
286.1553 - if (ins > MAX_ARG_INCREASE) continue; // FIXME Fail_6
286.1554 - for (int pos = 0; pos <= nargs; pos++) {
286.1555 - testInsertArguments(nargs, pos, ins);
286.1556 - }
286.1557 - }
286.1558 - }
286.1559 - }
286.1560 -
286.1561 - void testInsertArguments(int nargs, int pos, int ins) throws Throwable {
286.1562 - countTest();
286.1563 - MethodHandle target = varargsArray(nargs + ins);
286.1564 - Object[] args = randomArgs(target.type().parameterArray());
286.1565 - List<Object> resList = Arrays.asList(args);
286.1566 - List<Object> argsToPass = new ArrayList<Object>(resList);
286.1567 - List<Object> argsToInsert = argsToPass.subList(pos, pos + ins);
286.1568 - if (verbosity >= 3)
286.1569 - System.out.println("insert: "+argsToInsert+" into "+target);
286.1570 - MethodHandle target2 = MethodHandles.insertArguments(target, pos,
286.1571 - (Object[]) argsToInsert.toArray());
286.1572 - argsToInsert.clear(); // remove from argsToInsert
286.1573 - Object res2 = target2.invokeWithArguments(argsToPass);
286.1574 - Object res2List = Arrays.asList((Object[])res2);
286.1575 - if (verbosity >= 3)
286.1576 - System.out.println("result: "+res2List);
286.1577 - //if (!resList.equals(res2List))
286.1578 - // System.out.println("*** fail at n/p/i = "+nargs+"/"+pos+"/"+ins+": "+resList+" => "+res2List);
286.1579 - assertEquals(resList, res2List);
286.1580 - }
286.1581 -
286.1582 - @Test
286.1583 - public void testFilterReturnValue() throws Throwable {
286.1584 - if (CAN_SKIP_WORKING) return;
286.1585 - startTest("filterReturnValue");
286.1586 - Class<?> classOfVCList = varargsList(1).invokeWithArguments(0).getClass();
286.1587 - assertTrue(List.class.isAssignableFrom(classOfVCList));
286.1588 - for (int nargs = 0; nargs <= 3; nargs++) {
286.1589 - for (Class<?> rtype : new Class[] { Object.class,
286.1590 - List.class,
286.1591 - int.class,
286.1592 - //byte.class, //FIXME: add this
286.1593 - //long.class, //FIXME: add this
286.1594 - CharSequence.class,
286.1595 - String.class }) {
286.1596 - testFilterReturnValue(nargs, rtype);
286.1597 - }
286.1598 - }
286.1599 - }
286.1600 -
286.1601 - void testFilterReturnValue(int nargs, Class<?> rtype) throws Throwable {
286.1602 - countTest();
286.1603 - MethodHandle target = varargsList(nargs, rtype);
286.1604 - MethodHandle filter;
286.1605 - if (List.class.isAssignableFrom(rtype) || rtype.isAssignableFrom(List.class))
286.1606 - filter = varargsList(1); // add another layer of list-ness
286.1607 - else
286.1608 - filter = MethodHandles.identity(rtype);
286.1609 - filter = filter.asType(MethodType.methodType(target.type().returnType(), rtype));
286.1610 - Object[] argsToPass = randomArgs(nargs, Object.class);
286.1611 - if (verbosity >= 3)
286.1612 - System.out.println("filter "+target+" to "+rtype.getSimpleName()+" with "+filter);
286.1613 - MethodHandle target2 = MethodHandles.filterReturnValue(target, filter);
286.1614 - if (verbosity >= 4)
286.1615 - System.out.println("filtered target: "+target2);
286.1616 - // Simulate expected effect of filter on return value:
286.1617 - Object unfiltered = target.invokeWithArguments(argsToPass);
286.1618 - Object expected = filter.invokeWithArguments(unfiltered);
286.1619 - if (verbosity >= 4)
286.1620 - System.out.println("unfiltered: "+unfiltered+" : "+unfiltered.getClass().getSimpleName());
286.1621 - if (verbosity >= 4)
286.1622 - System.out.println("expected: "+expected+" : "+expected.getClass().getSimpleName());
286.1623 - Object result = target2.invokeWithArguments(argsToPass);
286.1624 - if (verbosity >= 3)
286.1625 - System.out.println("result: "+result+" : "+result.getClass().getSimpleName());
286.1626 - if (!expected.equals(result))
286.1627 - System.out.println("*** fail at n/rt = "+nargs+"/"+rtype.getSimpleName()+": "+Arrays.asList(argsToPass)+" => "+result+" != "+expected);
286.1628 - assertEquals(expected, result);
286.1629 - }
286.1630 -
286.1631 - @Test
286.1632 - public void testFilterArguments() throws Throwable {
286.1633 - if (CAN_SKIP_WORKING) return;
286.1634 - startTest("filterArguments");
286.1635 - for (int nargs = 1; nargs <= 6; nargs++) {
286.1636 - for (int pos = 0; pos < nargs; pos++) {
286.1637 - testFilterArguments(nargs, pos);
286.1638 - }
286.1639 - }
286.1640 - }
286.1641 -
286.1642 - void testFilterArguments(int nargs, int pos) throws Throwable {
286.1643 - countTest();
286.1644 - MethodHandle target = varargsList(nargs);
286.1645 - MethodHandle filter = varargsList(1);
286.1646 - filter = MethodHandles.convertArguments(filter, filter.type().generic());
286.1647 - Object[] argsToPass = randomArgs(nargs, Object.class);
286.1648 - if (verbosity >= 3)
286.1649 - System.out.println("filter "+target+" at "+pos+" with "+filter);
286.1650 - MethodHandle target2 = MethodHandles.filterArguments(target, pos, filter);
286.1651 - // Simulate expected effect of filter on arglist:
286.1652 - Object[] filteredArgs = argsToPass.clone();
286.1653 - filteredArgs[pos] = filter.invokeExact(filteredArgs[pos]);
286.1654 - List<Object> expected = Arrays.asList(filteredArgs);
286.1655 - Object result = target2.invokeWithArguments(argsToPass);
286.1656 - if (verbosity >= 3)
286.1657 - System.out.println("result: "+result);
286.1658 - if (!expected.equals(result))
286.1659 - System.out.println("*** fail at n/p = "+nargs+"/"+pos+": "+Arrays.asList(argsToPass)+" => "+result+" != "+expected);
286.1660 - assertEquals(expected, result);
286.1661 - }
286.1662 -
286.1663 - @Test
286.1664 - public void testFoldArguments() throws Throwable {
286.1665 - if (CAN_SKIP_WORKING) return;
286.1666 - startTest("foldArguments");
286.1667 - for (int nargs = 0; nargs <= 4; nargs++) {
286.1668 - for (int fold = 0; fold <= nargs; fold++) {
286.1669 - for (int pos = 0; pos <= nargs; pos++) {
286.1670 - testFoldArguments(nargs, pos, fold);
286.1671 - }
286.1672 - }
286.1673 - }
286.1674 - }
286.1675 -
286.1676 - void testFoldArguments(int nargs, int pos, int fold) throws Throwable {
286.1677 - if (pos != 0) return; // can fold only at pos=0 for now
286.1678 - countTest();
286.1679 - MethodHandle target = varargsList(1 + nargs);
286.1680 - MethodHandle combine = varargsList(fold).asType(MethodType.genericMethodType(fold));
286.1681 - List<Object> argsToPass = Arrays.asList(randomArgs(nargs, Object.class));
286.1682 - if (verbosity >= 3)
286.1683 - System.out.println("fold "+target+" with "+combine);
286.1684 - MethodHandle target2 = MethodHandles.foldArguments(target, combine);
286.1685 - // Simulate expected effect of combiner on arglist:
286.1686 - List<Object> expected = new ArrayList<Object>(argsToPass);
286.1687 - List<Object> argsToFold = expected.subList(pos, pos + fold);
286.1688 - if (verbosity >= 3)
286.1689 - System.out.println("fold: "+argsToFold+" into "+target2);
286.1690 - Object foldedArgs = combine.invokeWithArguments(argsToFold);
286.1691 - argsToFold.add(0, foldedArgs);
286.1692 - Object result = target2.invokeWithArguments(argsToPass);
286.1693 - if (verbosity >= 3)
286.1694 - System.out.println("result: "+result);
286.1695 - if (!expected.equals(result))
286.1696 - System.out.println("*** fail at n/p/f = "+nargs+"/"+pos+"/"+fold+": "+argsToPass+" => "+result+" != "+expected);
286.1697 - assertEquals(expected, result);
286.1698 - }
286.1699 -
286.1700 - @Test
286.1701 - public void testDropArguments() throws Throwable {
286.1702 - if (CAN_SKIP_WORKING) return;
286.1703 - startTest("dropArguments");
286.1704 - for (int nargs = 0; nargs <= 4; nargs++) {
286.1705 - for (int drop = 1; drop <= 4; drop++) {
286.1706 - for (int pos = 0; pos <= nargs; pos++) {
286.1707 - testDropArguments(nargs, pos, drop);
286.1708 - }
286.1709 - }
286.1710 - }
286.1711 - }
286.1712 -
286.1713 - void testDropArguments(int nargs, int pos, int drop) throws Throwable {
286.1714 - countTest();
286.1715 - MethodHandle target = varargsArray(nargs);
286.1716 - Object[] args = randomArgs(target.type().parameterArray());
286.1717 - MethodHandle target2 = MethodHandles.dropArguments(target, pos,
286.1718 - Collections.nCopies(drop, Object.class).toArray(new Class[0]));
286.1719 - List<Object> resList = Arrays.asList(args);
286.1720 - List<Object> argsToDrop = new ArrayList<Object>(resList);
286.1721 - for (int i = drop; i > 0; i--) {
286.1722 - argsToDrop.add(pos, "blort#"+i);
286.1723 - }
286.1724 - Object res2 = target2.invokeWithArguments(argsToDrop);
286.1725 - Object res2List = Arrays.asList((Object[])res2);
286.1726 - //if (!resList.equals(res2List))
286.1727 - // System.out.println("*** fail at n/p/d = "+nargs+"/"+pos+"/"+drop+": "+argsToDrop+" => "+res2List);
286.1728 - assertEquals(resList, res2List);
286.1729 - }
286.1730 -
286.1731 - @Test
286.1732 - public void testInvokers() throws Throwable {
286.1733 - if (CAN_SKIP_WORKING) return;
286.1734 - startTest("exactInvoker, genericInvoker, varargsInvoker, dynamicInvoker");
286.1735 - // exactInvoker, genericInvoker, varargsInvoker[0..N], dynamicInvoker
286.1736 - Set<MethodType> done = new HashSet<MethodType>();
286.1737 - for (int i = 0; i <= 6; i++) {
286.1738 - MethodType gtype = MethodType.genericMethodType(i);
286.1739 - for (Class<?> argType : new Class[]{Object.class, Integer.class, int.class}) {
286.1740 - for (int j = -1; j < i; j++) {
286.1741 - MethodType type = gtype;
286.1742 - if (j < 0)
286.1743 - type = type.changeReturnType(argType);
286.1744 - else if (argType == void.class)
286.1745 - continue;
286.1746 - else
286.1747 - type = type.changeParameterType(j, argType);
286.1748 - if (argType.isPrimitive() && j != i-1) continue; // FIXME Fail_5
286.1749 - if (done.add(type))
286.1750 - testInvokers(type);
286.1751 - MethodType vtype = type.changeReturnType(void.class);
286.1752 - if (done.add(vtype))
286.1753 - testInvokers(vtype);
286.1754 - }
286.1755 - }
286.1756 - }
286.1757 - }
286.1758 -
286.1759 - public void testInvokers(MethodType type) throws Throwable {
286.1760 - if (verbosity >= 3)
286.1761 - System.out.println("test invokers for "+type);
286.1762 - int nargs = type.parameterCount();
286.1763 - boolean testRetCode = type.returnType() != void.class;
286.1764 - MethodHandle target = PRIVATE.findStatic(MethodHandlesTest.class, "invokee",
286.1765 - MethodType.genericMethodType(0, true));
286.1766 - assertTrue(target.isVarargsCollector());
286.1767 - target = target.asType(type);
286.1768 - Object[] args = randomArgs(type.parameterArray());
286.1769 - List<Object> targetPlusArgs = new ArrayList<Object>(Arrays.asList(args));
286.1770 - targetPlusArgs.add(0, target);
286.1771 - int code = (Integer) invokee(args);
286.1772 - Object log = logEntry("invokee", args);
286.1773 - assertEquals(log.hashCode(), code);
286.1774 - assertCalled("invokee", args);
286.1775 - MethodHandle inv;
286.1776 - Object result;
286.1777 - // exact invoker
286.1778 - countTest();
286.1779 - calledLog.clear();
286.1780 - inv = MethodHandles.exactInvoker(type);
286.1781 - result = inv.invokeWithArguments(targetPlusArgs);
286.1782 - if (testRetCode) assertEquals(code, result);
286.1783 - assertCalled("invokee", args);
286.1784 - // generic invoker
286.1785 - countTest();
286.1786 - inv = MethodHandles.genericInvoker(type);
286.1787 - if (nargs <= 3) {
286.1788 - calledLog.clear();
286.1789 - switch (nargs) {
286.1790 - case 0:
286.1791 - result = inv.invokeExact(target);
286.1792 - break;
286.1793 - case 1:
286.1794 - result = inv.invokeExact(target, args[0]);
286.1795 - break;
286.1796 - case 2:
286.1797 - result = inv.invokeExact(target, args[0], args[1]);
286.1798 - break;
286.1799 - case 3:
286.1800 - result = inv.invokeExact(target, args[0], args[1], args[2]);
286.1801 - break;
286.1802 - }
286.1803 - if (testRetCode) assertEquals(code, result);
286.1804 - assertCalled("invokee", args);
286.1805 - }
286.1806 - calledLog.clear();
286.1807 - result = inv.invokeWithArguments(targetPlusArgs);
286.1808 - if (testRetCode) assertEquals(code, result);
286.1809 - assertCalled("invokee", args);
286.1810 - // varargs invoker #0
286.1811 - calledLog.clear();
286.1812 - inv = MethodHandles.spreadInvoker(type, 0);
286.1813 - result = inv.invokeExact(target, args);
286.1814 - if (testRetCode) assertEquals(code, result);
286.1815 - assertCalled("invokee", args);
286.1816 - if (nargs >= 1) {
286.1817 - // varargs invoker #1
286.1818 - calledLog.clear();
286.1819 - inv = MethodHandles.spreadInvoker(type, 1);
286.1820 - result = inv.invokeExact(target, args[0], Arrays.copyOfRange(args, 1, nargs));
286.1821 - if (testRetCode) assertEquals(code, result);
286.1822 - assertCalled("invokee", args);
286.1823 - }
286.1824 - if (nargs >= 2) {
286.1825 - // varargs invoker #2
286.1826 - calledLog.clear();
286.1827 - inv = MethodHandles.spreadInvoker(type, 2);
286.1828 - result = inv.invokeExact(target, args[0], args[1], Arrays.copyOfRange(args, 2, nargs));
286.1829 - if (testRetCode) assertEquals(code, result);
286.1830 - assertCalled("invokee", args);
286.1831 - }
286.1832 - if (nargs >= 3) {
286.1833 - // varargs invoker #3
286.1834 - calledLog.clear();
286.1835 - inv = MethodHandles.spreadInvoker(type, 3);
286.1836 - result = inv.invokeExact(target, args[0], args[1], args[2], Arrays.copyOfRange(args, 3, nargs));
286.1837 - if (testRetCode) assertEquals(code, result);
286.1838 - assertCalled("invokee", args);
286.1839 - }
286.1840 - for (int k = 0; k <= nargs; k++) {
286.1841 - // varargs invoker #0..N
286.1842 - countTest();
286.1843 - calledLog.clear();
286.1844 - inv = MethodHandles.spreadInvoker(type, k);
286.1845 - List<Object> targetPlusVarArgs = new ArrayList<Object>(targetPlusArgs);
286.1846 - List<Object> tailList = targetPlusVarArgs.subList(1+k, 1+nargs);
286.1847 - Object[] tail = tailList.toArray();
286.1848 - tailList.clear(); tailList.add(tail);
286.1849 - result = inv.invokeWithArguments(targetPlusVarArgs);
286.1850 - if (testRetCode) assertEquals(code, result);
286.1851 - assertCalled("invokee", args);
286.1852 - }
286.1853 -
286.1854 - // dynamic invoker
286.1855 - countTest();
286.1856 - CallSite site = new MutableCallSite(type);
286.1857 - inv = site.dynamicInvoker();
286.1858 -
286.1859 - // see if we get the result of the original target:
286.1860 - try {
286.1861 - result = inv.invokeWithArguments(args);
286.1862 - assertTrue("should not reach here", false);
286.1863 - } catch (IllegalStateException ex) {
286.1864 - String msg = ex.getMessage();
286.1865 - assertTrue(msg, msg.contains("site"));
286.1866 - }
286.1867 -
286.1868 - // set new target after invoker is created, to make sure we track target
286.1869 - site.setTarget(target);
286.1870 - calledLog.clear();
286.1871 - result = inv.invokeWithArguments(args);
286.1872 - if (testRetCode) assertEquals(code, result);
286.1873 - assertCalled("invokee", args);
286.1874 - }
286.1875 -
286.1876 - static Object invokee(Object... args) {
286.1877 - return called("invokee", args).hashCode();
286.1878 - }
286.1879 -
286.1880 - private static final String MISSING_ARG = "missingArg";
286.1881 - static Object targetIfEquals() {
286.1882 - return called("targetIfEquals");
286.1883 - }
286.1884 - static Object fallbackIfNotEquals() {
286.1885 - return called("fallbackIfNotEquals");
286.1886 - }
286.1887 - static Object targetIfEquals(Object x) {
286.1888 - assertEquals(x, MISSING_ARG);
286.1889 - return called("targetIfEquals", x);
286.1890 - }
286.1891 - static Object fallbackIfNotEquals(Object x) {
286.1892 - assertFalse(x.toString(), x.equals(MISSING_ARG));
286.1893 - return called("fallbackIfNotEquals", x);
286.1894 - }
286.1895 - static Object targetIfEquals(Object x, Object y) {
286.1896 - assertEquals(x, y);
286.1897 - return called("targetIfEquals", x, y);
286.1898 - }
286.1899 - static Object fallbackIfNotEquals(Object x, Object y) {
286.1900 - assertFalse(x.toString(), x.equals(y));
286.1901 - return called("fallbackIfNotEquals", x, y);
286.1902 - }
286.1903 - static Object targetIfEquals(Object x, Object y, Object z) {
286.1904 - assertEquals(x, y);
286.1905 - return called("targetIfEquals", x, y, z);
286.1906 - }
286.1907 - static Object fallbackIfNotEquals(Object x, Object y, Object z) {
286.1908 - assertFalse(x.toString(), x.equals(y));
286.1909 - return called("fallbackIfNotEquals", x, y, z);
286.1910 - }
286.1911 -
286.1912 - @Test
286.1913 - public void testGuardWithTest() throws Throwable {
286.1914 - if (CAN_SKIP_WORKING) return;
286.1915 - startTest("guardWithTest");
286.1916 - for (int nargs = 0; nargs <= 3; nargs++) {
286.1917 - if (nargs != 2) continue; // FIXME: test more later
286.1918 - testGuardWithTest(nargs, Object.class);
286.1919 - testGuardWithTest(nargs, String.class);
286.1920 - }
286.1921 - }
286.1922 - void testGuardWithTest(int nargs, Class<?> argClass) throws Throwable {
286.1923 - countTest();
286.1924 - MethodHandle test = PRIVATE.findVirtual(Object.class, "equals", MethodType.methodType(boolean.class, Object.class));
286.1925 - MethodHandle target = PRIVATE.findStatic(MethodHandlesTest.class, "targetIfEquals", MethodType.genericMethodType(nargs));
286.1926 - MethodHandle fallback = PRIVATE.findStatic(MethodHandlesTest.class, "fallbackIfNotEquals", MethodType.genericMethodType(nargs));
286.1927 - while (test.type().parameterCount() < nargs)
286.1928 - test = MethodHandles.dropArguments(test, test.type().parameterCount()-1, Object.class);
286.1929 - while (test.type().parameterCount() > nargs)
286.1930 - test = MethodHandles.insertArguments(test, 0, MISSING_ARG);
286.1931 - if (argClass != Object.class) {
286.1932 - test = changeArgTypes(test, argClass);
286.1933 - target = changeArgTypes(target, argClass);
286.1934 - fallback = changeArgTypes(fallback, argClass);
286.1935 - }
286.1936 - MethodHandle mh = MethodHandles.guardWithTest(test, target, fallback);
286.1937 - assertEquals(target.type(), mh.type());
286.1938 - Object[][] argLists = {
286.1939 - { },
286.1940 - { "foo" }, { MISSING_ARG },
286.1941 - { "foo", "foo" }, { "foo", "bar" },
286.1942 - { "foo", "foo", "baz" }, { "foo", "bar", "baz" }
286.1943 - };
286.1944 - for (Object[] argList : argLists) {
286.1945 - if (argList.length != nargs) continue;
286.1946 - boolean equals;
286.1947 - switch (nargs) {
286.1948 - case 0: equals = true; break;
286.1949 - case 1: equals = MISSING_ARG.equals(argList[0]); break;
286.1950 - default: equals = argList[0].equals(argList[1]); break;
286.1951 - }
286.1952 - String willCall = (equals ? "targetIfEquals" : "fallbackIfNotEquals");
286.1953 - if (verbosity >= 3)
286.1954 - System.out.println(logEntry(willCall, argList));
286.1955 - Object result = mh.invokeWithArguments(argList);
286.1956 - assertCalled(willCall, argList);
286.1957 - }
286.1958 - }
286.1959 -
286.1960 - @Test
286.1961 - public void testCatchException() throws Throwable {
286.1962 - if (CAN_SKIP_WORKING) return;
286.1963 - startTest("catchException");
286.1964 - for (int nargs = 2; nargs <= 6; nargs++) {
286.1965 - for (int ti = 0; ti <= 1; ti++) {
286.1966 - boolean throwIt = (ti != 0);
286.1967 - testCatchException(int.class, new ClassCastException("testing"), throwIt, nargs);
286.1968 - testCatchException(void.class, new java.io.IOException("testing"), throwIt, nargs);
286.1969 - testCatchException(String.class, new LinkageError("testing"), throwIt, nargs);
286.1970 - }
286.1971 - }
286.1972 - }
286.1973 -
286.1974 - private static <T extends Throwable>
286.1975 - Object throwOrReturn(Object normal, T exception) throws T {
286.1976 - if (exception != null) throw exception;
286.1977 - return normal;
286.1978 - }
286.1979 -
286.1980 - void testCatchException(Class<?> returnType, Throwable thrown, boolean throwIt, int nargs) throws Throwable {
286.1981 - countTest();
286.1982 - if (verbosity >= 3)
286.1983 - System.out.println("catchException rt="+returnType+" throw="+throwIt+" nargs="+nargs);
286.1984 - Class<? extends Throwable> exType = thrown.getClass();
286.1985 - MethodHandle throwOrReturn
286.1986 - = PRIVATE.findStatic(MethodHandlesTest.class, "throwOrReturn",
286.1987 - MethodType.methodType(Object.class, Object.class, Throwable.class));
286.1988 - MethodHandle thrower = throwOrReturn.asType(MethodType.genericMethodType(2));
286.1989 - while (thrower.type().parameterCount() < nargs)
286.1990 - thrower = MethodHandles.dropArguments(thrower, thrower.type().parameterCount(), Object.class);
286.1991 - MethodHandle catcher = varargsList(1+nargs).asType(MethodType.genericMethodType(1+nargs));
286.1992 - MethodHandle target = MethodHandles.catchException(thrower,
286.1993 - thrown.getClass(), catcher);
286.1994 - assertEquals(thrower.type(), target.type());
286.1995 - //System.out.println("catching with "+target+" : "+throwOrReturn);
286.1996 - Object[] args = randomArgs(nargs, Object.class);
286.1997 - args[1] = (throwIt ? thrown : null);
286.1998 - Object returned = target.invokeWithArguments(args);
286.1999 - //System.out.println("return from "+target+" : "+returned);
286.2000 - if (!throwIt) {
286.2001 - assertSame(args[0], returned);
286.2002 - } else {
286.2003 - List<Object> catchArgs = new ArrayList<Object>(Arrays.asList(args));
286.2004 - catchArgs.add(0, thrown);
286.2005 - assertEquals(catchArgs, returned);
286.2006 - }
286.2007 - }
286.2008 -
286.2009 - @Test
286.2010 - public void testThrowException() throws Throwable {
286.2011 - if (CAN_SKIP_WORKING) return;
286.2012 - startTest("throwException");
286.2013 - testThrowException(int.class, new ClassCastException("testing"));
286.2014 - testThrowException(void.class, new java.io.IOException("testing"));
286.2015 - testThrowException(String.class, new LinkageError("testing"));
286.2016 - }
286.2017 -
286.2018 - void testThrowException(Class<?> returnType, Throwable thrown) throws Throwable {
286.2019 - countTest();
286.2020 - Class<? extends Throwable> exType = thrown.getClass();
286.2021 - MethodHandle target = MethodHandles.throwException(returnType, exType);
286.2022 - //System.out.println("throwing with "+target+" : "+thrown);
286.2023 - MethodType expectedType = MethodType.methodType(returnType, exType);
286.2024 - assertEquals(expectedType, target.type());
286.2025 - target = MethodHandles.convertArguments(target, target.type().generic());
286.2026 - Throwable caught = null;
286.2027 - try {
286.2028 - Object res = target.invokeExact((Object) thrown);
286.2029 - fail("got "+res+" instead of throwing "+thrown);
286.2030 - } catch (Throwable ex) {
286.2031 - if (ex != thrown) {
286.2032 - if (ex instanceof Error) throw (Error)ex;
286.2033 - if (ex instanceof RuntimeException) throw (RuntimeException)ex;
286.2034 - }
286.2035 - caught = ex;
286.2036 - }
286.2037 - assertSame(thrown, caught);
286.2038 - }
286.2039 -
286.2040 - @Test
286.2041 - public void testCastFailure() throws Throwable {
286.2042 - if (CAN_SKIP_WORKING) return;
286.2043 - startTest("testCastFailure");
286.2044 - testCastFailure("cast/argument", 11000);
286.2045 - testCastFailure("unbox/argument", 11000);
286.2046 - testCastFailure("cast/return", 11000);
286.2047 - testCastFailure("unbox/return", 11000);
286.2048 - }
286.2049 -
286.2050 - static class Surprise {
286.2051 - public MethodHandle asMethodHandle() {
286.2052 - return VALUE.bindTo(this);
286.2053 - }
286.2054 - Object value(Object x) {
286.2055 - trace("value", x);
286.2056 - if (boo != null) return boo;
286.2057 - return x;
286.2058 - }
286.2059 - Object boo;
286.2060 - void boo(Object x) { boo = x; }
286.2061 -
286.2062 - static void trace(String x, Object y) {
286.2063 - if (verbosity > 8) System.out.println(x+"="+y);
286.2064 - }
286.2065 - static Object refIdentity(Object x) { trace("ref.x", x); return x; }
286.2066 - static Integer boxIdentity(Integer x) { trace("box.x", x); return x; }
286.2067 - static int intIdentity(int x) { trace("int.x", x); return x; }
286.2068 - static MethodHandle VALUE, REF_IDENTITY, BOX_IDENTITY, INT_IDENTITY;
286.2069 - static {
286.2070 - try {
286.2071 - VALUE = PRIVATE.findVirtual(
286.2072 - Surprise.class, "value",
286.2073 - MethodType.methodType(Object.class, Object.class));
286.2074 - REF_IDENTITY = PRIVATE.findStatic(
286.2075 - Surprise.class, "refIdentity",
286.2076 - MethodType.methodType(Object.class, Object.class));
286.2077 - BOX_IDENTITY = PRIVATE.findStatic(
286.2078 - Surprise.class, "boxIdentity",
286.2079 - MethodType.methodType(Integer.class, Integer.class));
286.2080 - INT_IDENTITY = PRIVATE.findStatic(
286.2081 - Surprise.class, "intIdentity",
286.2082 - MethodType.methodType(int.class, int.class));
286.2083 - } catch (Exception ex) {
286.2084 - throw new RuntimeException(ex);
286.2085 - }
286.2086 - }
286.2087 - }
286.2088 -
286.2089 - void testCastFailure(String mode, int okCount) throws Throwable {
286.2090 - countTest(false);
286.2091 - if (verbosity > 2) System.out.println("mode="+mode);
286.2092 - Surprise boo = new Surprise();
286.2093 - MethodHandle identity = Surprise.REF_IDENTITY, surprise0 = boo.asMethodHandle(), surprise = surprise0;
286.2094 - if (mode.endsWith("/return")) {
286.2095 - if (mode.equals("unbox/return")) {
286.2096 - // fail on return to ((Integer)surprise).intValue
286.2097 - surprise = MethodHandles.convertArguments(surprise, MethodType.methodType(int.class, Object.class));
286.2098 - identity = MethodHandles.convertArguments(identity, MethodType.methodType(int.class, Object.class));
286.2099 - } else if (mode.equals("cast/return")) {
286.2100 - // fail on return to (Integer)surprise
286.2101 - surprise = MethodHandles.convertArguments(surprise, MethodType.methodType(Integer.class, Object.class));
286.2102 - identity = MethodHandles.convertArguments(identity, MethodType.methodType(Integer.class, Object.class));
286.2103 - }
286.2104 - } else if (mode.endsWith("/argument")) {
286.2105 - MethodHandle callee = null;
286.2106 - if (mode.equals("unbox/argument")) {
286.2107 - // fail on handing surprise to int argument
286.2108 - callee = Surprise.INT_IDENTITY;
286.2109 - } else if (mode.equals("cast/argument")) {
286.2110 - // fail on handing surprise to Integer argument
286.2111 - callee = Surprise.BOX_IDENTITY;
286.2112 - }
286.2113 - if (callee != null) {
286.2114 - callee = MethodHandles.convertArguments(callee, MethodType.genericMethodType(1));
286.2115 - surprise = MethodHandles.filterArguments(callee, 0, surprise);
286.2116 - identity = MethodHandles.filterArguments(callee, 0, identity);
286.2117 - }
286.2118 - }
286.2119 - assertNotSame(mode, surprise, surprise0);
286.2120 - identity = MethodHandles.convertArguments(identity, MethodType.genericMethodType(1));
286.2121 - surprise = MethodHandles.convertArguments(surprise, MethodType.genericMethodType(1));
286.2122 - Object x = 42;
286.2123 - for (int i = 0; i < okCount; i++) {
286.2124 - Object y = identity.invokeExact(x);
286.2125 - assertEquals(x, y);
286.2126 - Object z = surprise.invokeExact(x);
286.2127 - assertEquals(x, z);
286.2128 - }
286.2129 - boo.boo("Boo!");
286.2130 - Object y = identity.invokeExact(x);
286.2131 - assertEquals(x, y);
286.2132 - try {
286.2133 - Object z = surprise.invokeExact(x);
286.2134 - System.out.println("Failed to throw; got z="+z);
286.2135 - assertTrue(false);
286.2136 - } catch (Exception ex) {
286.2137 - if (verbosity > 2)
286.2138 - System.out.println("caught "+ex);
286.2139 - if (verbosity > 3)
286.2140 - ex.printStackTrace();
286.2141 - assertTrue(ex instanceof ClassCastException
286.2142 - // FIXME: accept only one of the two for any given unit test
286.2143 - || ex instanceof WrongMethodTypeException
286.2144 - );
286.2145 - }
286.2146 - }
286.2147 -
286.2148 - static Example userMethod(Object o, String s, int i) {
286.2149 - called("userMethod", o, s, i);
286.2150 - return null;
286.2151 - }
286.2152 -
286.2153 - @Test
286.2154 - public void testUserClassInSignature() throws Throwable {
286.2155 - if (CAN_SKIP_WORKING) return;
286.2156 - startTest("testUserClassInSignature");
286.2157 - Lookup lookup = MethodHandles.lookup();
286.2158 - String name; MethodType mt; MethodHandle mh;
286.2159 - Object[] args;
286.2160 -
286.2161 - // Try a static method.
286.2162 - name = "userMethod";
286.2163 - mt = MethodType.methodType(Example.class, Object.class, String.class, int.class);
286.2164 - mh = lookup.findStatic(lookup.lookupClass(), name, mt);
286.2165 - assertEquals(mt, mh.type());
286.2166 - assertEquals(Example.class, mh.type().returnType());
286.2167 - args = randomArgs(mh.type().parameterArray());
286.2168 - mh.invokeWithArguments(args);
286.2169 - assertCalled(name, args);
286.2170 -
286.2171 - // Try a virtual method.
286.2172 - name = "v2";
286.2173 - mt = MethodType.methodType(Object.class, Object.class, int.class);
286.2174 - mh = lookup.findVirtual(Example.class, name, mt);
286.2175 - assertEquals(mt, mh.type().dropParameterTypes(0,1));
286.2176 - assertTrue(mh.type().parameterList().contains(Example.class));
286.2177 - args = randomArgs(mh.type().parameterArray());
286.2178 - mh.invokeWithArguments(args);
286.2179 - assertCalled(name, args);
286.2180 - }
286.2181 -
286.2182 - static void runForRunnable() {
286.2183 - called("runForRunnable");
286.2184 - }
286.2185 - private interface Fooable {
286.2186 - Object foo(Fooable x, Object y);
286.2187 - // this is for randomArg:
286.2188 - public class Impl implements Fooable {
286.2189 - public Object foo(Fooable x, Object y) {
286.2190 - throw new RuntimeException("do not call");
286.2191 - }
286.2192 - final String name;
286.2193 - public Impl() { name = "Fooable#"+nextArg(); }
286.2194 - @Override public String toString() { return name; }
286.2195 - }
286.2196 - }
286.2197 - static Object fooForFooable(Fooable x, Object y) {
286.2198 - return called("fooForFooable", x, y);
286.2199 - }
286.2200 - private static class MyCheckedException extends Exception {
286.2201 - }
286.2202 - private interface WillThrow {
286.2203 - void willThrow() throws MyCheckedException;
286.2204 - }
286.2205 -
286.2206 - @Test
286.2207 - public void testAsInstance() throws Throwable {
286.2208 - if (CAN_SKIP_WORKING) return;
286.2209 - Lookup lookup = MethodHandles.lookup();
286.2210 - {
286.2211 - MethodType mt = MethodType.methodType(void.class);
286.2212 - MethodHandle mh = lookup.findStatic(MethodHandlesTest.class, "runForRunnable", mt);
286.2213 - Runnable proxy = MethodHandles.asInstance(mh, Runnable.class);
286.2214 - proxy.run();
286.2215 - assertCalled("runForRunnable");
286.2216 - }
286.2217 - {
286.2218 - MethodType mt = MethodType.methodType(Object.class, Fooable.class, Object.class);
286.2219 - MethodHandle mh = lookup.findStatic(MethodHandlesTest.class, "fooForFooable", mt);
286.2220 - Fooable proxy = MethodHandles.asInstance(mh, Fooable.class);
286.2221 - Object[] args = randomArgs(mt.parameterArray());
286.2222 - Object result = proxy.foo((Fooable) args[0], args[1]);
286.2223 - assertCalled("fooForFooable", args);
286.2224 - assertEquals(result, logEntry("fooForFooable", args));
286.2225 - }
286.2226 - for (Throwable ex : new Throwable[] { new NullPointerException("ok"),
286.2227 - new InternalError("ok"),
286.2228 - new Throwable("fail"),
286.2229 - new Exception("fail"),
286.2230 - new MyCheckedException()
286.2231 - }) {
286.2232 - MethodHandle mh = MethodHandles.throwException(void.class, Throwable.class);
286.2233 - mh = MethodHandles.insertArguments(mh, 0, ex);
286.2234 - WillThrow proxy = MethodHandles.asInstance(mh, WillThrow.class);
286.2235 - try {
286.2236 - proxy.willThrow();
286.2237 - System.out.println("Failed to throw: "+ex);
286.2238 - assertTrue(false);
286.2239 - } catch (Throwable ex1) {
286.2240 - if (verbosity > 2) {
286.2241 - System.out.println("throw "+ex);
286.2242 - System.out.println("catch "+(ex == ex1 ? "UNWRAPPED" : ex1));
286.2243 - }
286.2244 - if (ex instanceof RuntimeException ||
286.2245 - ex instanceof Error) {
286.2246 - assertSame("must pass unchecked exception out without wrapping", ex, ex1);
286.2247 - } else if (ex instanceof MyCheckedException) {
286.2248 - assertSame("must pass declared exception out without wrapping", ex, ex1);
286.2249 - } else {
286.2250 - assertNotSame("must pass undeclared checked exception with wrapping", ex, ex1);
286.2251 - UndeclaredThrowableException utex = (UndeclaredThrowableException) ex1;
286.2252 - assertSame(ex, utex.getCause());
286.2253 - }
286.2254 - }
286.2255 - }
286.2256 - // Test error checking:
286.2257 - for (Class<?> nonSAM : new Class[] { Object.class,
286.2258 - String.class,
286.2259 - CharSequence.class,
286.2260 - Example.class }) {
286.2261 - try {
286.2262 - MethodHandles.asInstance(varargsArray(0), nonSAM);
286.2263 - System.out.println("Failed to throw");
286.2264 - assertTrue(false);
286.2265 - } catch (IllegalArgumentException ex) {
286.2266 - }
286.2267 - }
286.2268 - }
286.2269 -}
286.2270 -// Local abbreviated copy of sun.dyn.util.ValueConversions
286.2271 -class ValueConversions {
286.2272 - private static final Lookup IMPL_LOOKUP = MethodHandles.lookup();
286.2273 - private static final Object[] NO_ARGS_ARRAY = {};
286.2274 - private static Object[] makeArray(Object... args) { return args; }
286.2275 - private static Object[] array() { return NO_ARGS_ARRAY; }
286.2276 - private static Object[] array(Object a0)
286.2277 - { return makeArray(a0); }
286.2278 - private static Object[] array(Object a0, Object a1)
286.2279 - { return makeArray(a0, a1); }
286.2280 - private static Object[] array(Object a0, Object a1, Object a2)
286.2281 - { return makeArray(a0, a1, a2); }
286.2282 - private static Object[] array(Object a0, Object a1, Object a2, Object a3)
286.2283 - { return makeArray(a0, a1, a2, a3); }
286.2284 - private static Object[] array(Object a0, Object a1, Object a2, Object a3,
286.2285 - Object a4)
286.2286 - { return makeArray(a0, a1, a2, a3, a4); }
286.2287 - private static Object[] array(Object a0, Object a1, Object a2, Object a3,
286.2288 - Object a4, Object a5)
286.2289 - { return makeArray(a0, a1, a2, a3, a4, a5); }
286.2290 - private static Object[] array(Object a0, Object a1, Object a2, Object a3,
286.2291 - Object a4, Object a5, Object a6)
286.2292 - { return makeArray(a0, a1, a2, a3, a4, a5, a6); }
286.2293 - private static Object[] array(Object a0, Object a1, Object a2, Object a3,
286.2294 - Object a4, Object a5, Object a6, Object a7)
286.2295 - { return makeArray(a0, a1, a2, a3, a4, a5, a6, a7); }
286.2296 - private static Object[] array(Object a0, Object a1, Object a2, Object a3,
286.2297 - Object a4, Object a5, Object a6, Object a7,
286.2298 - Object a8)
286.2299 - { return makeArray(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
286.2300 - private static Object[] array(Object a0, Object a1, Object a2, Object a3,
286.2301 - Object a4, Object a5, Object a6, Object a7,
286.2302 - Object a8, Object a9)
286.2303 - { return makeArray(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
286.2304 - static MethodHandle[] makeArrays() {
286.2305 - ArrayList<MethodHandle> arrays = new ArrayList<MethodHandle>();
286.2306 - MethodHandles.Lookup lookup = IMPL_LOOKUP;
286.2307 - for (;;) {
286.2308 - int nargs = arrays.size();
286.2309 - MethodType type = MethodType.genericMethodType(nargs).changeReturnType(Object[].class);
286.2310 - String name = "array";
286.2311 - MethodHandle array = null;
286.2312 - try {
286.2313 - array = lookup.findStatic(ValueConversions.class, name, type);
286.2314 - } catch (ReflectiveOperationException ex) {
286.2315 - // break from loop!
286.2316 - }
286.2317 - if (array == null) break;
286.2318 - arrays.add(array);
286.2319 - }
286.2320 - assertTrue(arrays.size() == 11); // current number of methods
286.2321 - return arrays.toArray(new MethodHandle[0]);
286.2322 - }
286.2323 - static final MethodHandle[] ARRAYS = makeArrays();
286.2324 -
286.2325 - /** Return a method handle that takes the indicated number of Object
286.2326 - * arguments and returns an Object array of them, as if for varargs.
286.2327 - */
286.2328 - public static MethodHandle varargsArray(int nargs) {
286.2329 - if (nargs < ARRAYS.length)
286.2330 - return ARRAYS[nargs];
286.2331 - // else need to spin bytecode or do something else fancy
286.2332 - throw new UnsupportedOperationException("NYI: cannot form a varargs array of length "+nargs);
286.2333 - }
286.2334 -
286.2335 - private static final List<Object> NO_ARGS_LIST = Arrays.asList(NO_ARGS_ARRAY);
286.2336 - private static List<Object> makeList(Object... args) { return Arrays.asList(args); }
286.2337 - private static List<Object> list() { return NO_ARGS_LIST; }
286.2338 - private static List<Object> list(Object a0)
286.2339 - { return makeList(a0); }
286.2340 - private static List<Object> list(Object a0, Object a1)
286.2341 - { return makeList(a0, a1); }
286.2342 - private static List<Object> list(Object a0, Object a1, Object a2)
286.2343 - { return makeList(a0, a1, a2); }
286.2344 - private static List<Object> list(Object a0, Object a1, Object a2, Object a3)
286.2345 - { return makeList(a0, a1, a2, a3); }
286.2346 - private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
286.2347 - Object a4)
286.2348 - { return makeList(a0, a1, a2, a3, a4); }
286.2349 - private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
286.2350 - Object a4, Object a5)
286.2351 - { return makeList(a0, a1, a2, a3, a4, a5); }
286.2352 - private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
286.2353 - Object a4, Object a5, Object a6)
286.2354 - { return makeList(a0, a1, a2, a3, a4, a5, a6); }
286.2355 - private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
286.2356 - Object a4, Object a5, Object a6, Object a7)
286.2357 - { return makeList(a0, a1, a2, a3, a4, a5, a6, a7); }
286.2358 - private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
286.2359 - Object a4, Object a5, Object a6, Object a7,
286.2360 - Object a8)
286.2361 - { return makeList(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
286.2362 - private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
286.2363 - Object a4, Object a5, Object a6, Object a7,
286.2364 - Object a8, Object a9)
286.2365 - { return makeList(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
286.2366 - static MethodHandle[] makeLists() {
286.2367 - ArrayList<MethodHandle> lists = new ArrayList<MethodHandle>();
286.2368 - MethodHandles.Lookup lookup = IMPL_LOOKUP;
286.2369 - for (;;) {
286.2370 - int nargs = lists.size();
286.2371 - MethodType type = MethodType.genericMethodType(nargs).changeReturnType(List.class);
286.2372 - String name = "list";
286.2373 - MethodHandle list = null;
286.2374 - try {
286.2375 - list = lookup.findStatic(ValueConversions.class, name, type);
286.2376 - } catch (ReflectiveOperationException ex) {
286.2377 - // break from loop!
286.2378 - }
286.2379 - if (list == null) break;
286.2380 - lists.add(list);
286.2381 - }
286.2382 - assertTrue(lists.size() == 11); // current number of methods
286.2383 - return lists.toArray(new MethodHandle[0]);
286.2384 - }
286.2385 - static final MethodHandle[] LISTS = makeLists();
286.2386 -
286.2387 - /** Return a method handle that takes the indicated number of Object
286.2388 - * arguments and returns List.
286.2389 - */
286.2390 - public static MethodHandle varargsList(int nargs) {
286.2391 - if (nargs < LISTS.length)
286.2392 - return LISTS[nargs];
286.2393 - // else need to spin bytecode or do something else fancy
286.2394 - throw new UnsupportedOperationException("NYI");
286.2395 - }
286.2396 -}
286.2397 -// This guy tests access from outside the same package member, but inside
286.2398 -// the package itself.
286.2399 -class PackageSibling {
286.2400 - static Lookup lookup() {
286.2401 - return MethodHandles.lookup();
286.2402 - }
286.2403 -}
287.1 --- a/test/java/dyn/MethodTypeTest.java Tue Mar 29 11:29:01 2011 -0700
287.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
287.3 @@ -1,542 +0,0 @@
287.4 -/*
287.5 - * Copyright 2008, 2011 Sun Microsystems, Inc. All Rights Reserved.
287.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
287.7 - *
287.8 - * This code is free software; you can redistribute it and/or modify it
287.9 - * under the terms of the GNU General Public License version 2 only, as
287.10 - * published by the Free Software Foundation. Sun designates this
287.11 - * particular file as subject to the "Classpath" exception as provided
287.12 - * by Sun in the LICENSE file that accompanied this code.
287.13 - *
287.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
287.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
287.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
287.17 - * version 2 for more details (a copy is included in the LICENSE file that
287.18 - * accompanied this code).
287.19 - *
287.20 - * You should have received a copy of the GNU General Public License version
287.21 - * 2 along with this work; if not, write to the Free Software Foundation,
287.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
287.23 - *
287.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
287.25 - * CA 95054 USA or visit www.sun.com if you need additional information or
287.26 - * have any questions.
287.27 - */
287.28 -
287.29 -/* @test
287.30 - * @summary unit tests for java.dyn.MethodType
287.31 - * @compile MethodTypeTest.java
287.32 - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles test.java.dyn.MethodTypeTest
287.33 - */
287.34 -
287.35 -package test.java.dyn;
287.36 -
287.37 -import sun.dyn.MemberName;
287.38 -import java.dyn.MethodType;
287.39 -import java.lang.reflect.Method;
287.40 -
287.41 -import java.util.*;
287.42 -import org.junit.*;
287.43 -import static org.junit.Assert.*;
287.44 -
287.45 -/**
287.46 - *
287.47 - * @author jrose
287.48 - */
287.49 -public class MethodTypeTest {
287.50 -
287.51 - private Class<?> rtype;
287.52 - private Class<?>[] ptypes;
287.53 - private MethodType mt_viS, mt_OO, mt_OO2, mt_vv, mt_Vv, mt_Ov;
287.54 - private MethodType mt_iSI, mt_ISi, mt_ISI, mt_iSi;
287.55 - private MethodType mt_viO, mt_iO2, mt_OOi, mt_iOi;
287.56 - private MethodType mt_VIO, mt_IO2, mt_OOI, mt_IOI, mt_VIS;
287.57 - private MethodType mt_vOiSzA, mt_OO99;
287.58 - private MethodType[] GALLERY;
287.59 - private Method compareTo;
287.60 -
287.61 - @Before
287.62 - public void setUp() throws Exception {
287.63 - rtype = void.class;
287.64 - ptypes = new Class<?>[] { int.class, String.class };
287.65 -
287.66 - mt_viS = MethodType.methodType(void.class, int.class, String.class);
287.67 - mt_OO = MethodType.methodType(Object.class, Object.class);
287.68 - mt_OO2 = MethodType.methodType(Object.class, Object.class, Object.class);
287.69 - mt_vv = MethodType.methodType(void.class);
287.70 - mt_Vv = MethodType.methodType(Void.class);
287.71 - mt_Ov = MethodType.methodType(Object.class);
287.72 - mt_iSI = MethodType.methodType(int.class, String.class, Integer.class);
287.73 - mt_ISi = MethodType.methodType(Integer.class, String.class, int.class);
287.74 - mt_ISI = MethodType.methodType(Integer.class, String.class, Integer.class);
287.75 - mt_iSi = MethodType.methodType(int.class, String.class, int.class);
287.76 -
287.77 - compareTo = String.class.getDeclaredMethod("compareTo", String.class);
287.78 -
287.79 - mt_viO = MethodType.methodType(void.class, int.class, Object.class);
287.80 - mt_iO2 = MethodType.methodType(int.class, Object.class, Object.class);
287.81 - mt_OOi = MethodType.methodType(Object.class, Object.class, int.class);
287.82 - mt_iOi = MethodType.methodType(int.class, Object.class, int.class);
287.83 -
287.84 - mt_VIO = MethodType.methodType(Void.class, Integer.class, Object.class);
287.85 - mt_IO2 = MethodType.methodType(Integer.class, Object.class, Object.class);
287.86 - mt_OOI = MethodType.methodType(Object.class, Object.class, Integer.class);
287.87 - mt_IOI = MethodType.methodType(Integer.class, Object.class, Integer.class);
287.88 - mt_VIS = MethodType.methodType(Void.class, Integer.class, String.class);
287.89 -
287.90 - mt_vOiSzA = MethodType.methodType(void.class, Object.class, int.class, String.class, boolean.class, Object[].class);
287.91 - mt_OO99 = MethodType.genericMethodType(99);
287.92 -
287.93 - GALLERY = new MethodType[] {
287.94 - mt_viS, mt_OO, mt_OO2, mt_vv, mt_Vv, mt_Ov,
287.95 - mt_iSI, mt_ISi, mt_ISI, mt_iSi,
287.96 - mt_viO, mt_iO2, mt_OOi, mt_iOi,
287.97 - mt_VIO, mt_IO2, mt_OOI, mt_IOI,
287.98 - mt_VIS, mt_vOiSzA, mt_OO99
287.99 - };
287.100 - }
287.101 -
287.102 - @After
287.103 - public void tearDown() throws Exception {
287.104 - }
287.105 -
287.106 - /** Make sure the method types are all distinct. */
287.107 - @Test
287.108 - public void testDistinct() {
287.109 - List<MethodType> gallery2 = new ArrayList<>();
287.110 - for (MethodType mt : GALLERY) {
287.111 - assertFalse(mt.toString(), gallery2.contains(mt));
287.112 - gallery2.add(mt);
287.113 - }
287.114 - // check self-equality also:
287.115 - assertEquals(Arrays.asList(GALLERY), gallery2);
287.116 - }
287.117 -
287.118 - /**
287.119 - * Test of make method, of class MethodType.
287.120 - */
287.121 - @Test
287.122 - public void testMake_Class_ClassArr() {
287.123 - System.out.println("make (from type array)");
287.124 - MethodType result = MethodType.methodType(rtype, ptypes);
287.125 - assertSame(mt_viS, result);
287.126 - }
287.127 -
287.128 - /**
287.129 - * Test of make method, of class MethodType.
287.130 - */
287.131 - @Test
287.132 - public void testMake_Class_List() {
287.133 - System.out.println("make (from type list)");
287.134 - MethodType result = MethodType.methodType(rtype, Arrays.asList(ptypes));
287.135 - assertSame(mt_viS, result);
287.136 - }
287.137 -
287.138 - /**
287.139 - * Test of make method, of class MethodType.
287.140 - */
287.141 - @Test
287.142 - public void testMake_3args() {
287.143 - System.out.println("make (from type with varargs)");
287.144 - MethodType result = MethodType.methodType(rtype, ptypes[0], ptypes[1]);
287.145 - assertSame(mt_viS, result);
287.146 - }
287.147 -
287.148 - /**
287.149 - * Test of make method, of class MethodType.
287.150 - */
287.151 - @Test
287.152 - public void testMake_Class() {
287.153 - System.out.println("make (from single type)");
287.154 - Class<?> rt = Integer.class;
287.155 - MethodType expResult = MethodType.methodType(rt, new Class<?>[0]);
287.156 - MethodType result = MethodType.methodType(rt);
287.157 - assertSame(expResult, result);
287.158 - }
287.159 -
287.160 - @Test
287.161 - public void testMakeGeneric() {
287.162 - System.out.println("makeGeneric");
287.163 - int objectArgCount = 2;
287.164 - MethodType expResult = mt_OO2;
287.165 - MethodType result = MethodType.genericMethodType(objectArgCount);
287.166 - assertSame(expResult, result);
287.167 - }
287.168 -
287.169 - /**
287.170 - * Test of make method, of class MethodType.
287.171 - */
287.172 - @Test
287.173 - public void testMake_Method() {
287.174 - System.out.println("make (via MemberName.getMethodType)");
287.175 - MethodType expResult = MethodType.methodType(int.class, String.class);
287.176 - MemberName name = new MemberName(compareTo);
287.177 - MethodType result = name.getMethodType();
287.178 - assertSame(expResult, result);
287.179 - }
287.180 -
287.181 - /**
287.182 - * Test of make method, of class MethodType.
287.183 - */
287.184 - @Test
287.185 - public void testMake_MethodType() {
287.186 - System.out.println("make (from rtype, MethodType)");
287.187 - MethodType expResult = mt_iO2;
287.188 - MethodType result = MethodType.methodType(int.class, mt_IO2);
287.189 - assertSame(expResult, result);
287.190 - }
287.191 -
287.192 - /**
287.193 - * Test of make method, of class MethodType.
287.194 - */
287.195 - @Test
287.196 - public void testMake_String_ClassLoader() {
287.197 - System.out.println("make (from bytecode signature)");
287.198 - ClassLoader loader = null;
287.199 - MethodType[] instances = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
287.200 - String obj = "Ljava/lang/Object;";
287.201 - assertEquals(obj, concat(Object.class));
287.202 - String[] expResults = {
287.203 - "(ILjava/lang/String;)V",
287.204 - concat("(", obj, 2, ")", Object.class),
287.205 - "()V", "()"+obj,
287.206 - concat("(", String.class, Integer.class, ")I"),
287.207 - concat("(", String.class, "I)", Integer.class),
287.208 - concat("(", String.class, Integer.class, ")", Integer.class),
287.209 - concat("(", String.class, "I)I")
287.210 - };
287.211 - for (int i = 0; i < instances.length; i++) {
287.212 - MethodType instance = instances[i];
287.213 - String result = instance.toMethodDescriptorString();
287.214 - assertEquals("#"+i, expResults[i], result);
287.215 - MethodType parsed = MethodType.fromMethodDescriptorString(result, loader);
287.216 - assertSame("--#"+i, instance, parsed);
287.217 - }
287.218 - }
287.219 - private static String concat(Object... parts) {
287.220 - StringBuilder sb = new StringBuilder();
287.221 - Object prevPart = "";
287.222 - for (Object part : parts) {
287.223 - if (part instanceof Class) {
287.224 - part = "L"+((Class)part).getName()+";";
287.225 - }
287.226 - if (part instanceof Integer) {
287.227 - for (int n = (Integer) part; n > 1; n--)
287.228 - sb.append(prevPart);
287.229 - part = "";
287.230 - }
287.231 - sb.append(part);
287.232 - prevPart = part;
287.233 - }
287.234 - return sb.toString().replace('.', '/');
287.235 - }
287.236 -
287.237 - @Test
287.238 - public void testHasPrimitives() {
287.239 - System.out.println("hasPrimitives");
287.240 - MethodType[] instances = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
287.241 - boolean[] expResults = {true, false, true, false, true, true, false, true};
287.242 - for (int i = 0; i < instances.length; i++) {
287.243 - boolean result = instances[i].hasPrimitives();
287.244 - assertEquals("#"+i, expResults[i], result);
287.245 - }
287.246 - }
287.247 -
287.248 - @Test
287.249 - public void testHasWrappers() {
287.250 - System.out.println("hasWrappers");
287.251 - MethodType[] instances = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
287.252 - boolean[] expResults = {false, false, false, false, true, true, true, false};
287.253 - for (int i = 0; i < instances.length; i++) {
287.254 - System.out.println(" hasWrappers "+instances[i]);
287.255 - boolean result = instances[i].hasWrappers();
287.256 - assertEquals("#"+i, expResults[i], result);
287.257 - }
287.258 - }
287.259 -
287.260 - @Test
287.261 - public void testErase() {
287.262 - System.out.println("erase");
287.263 - MethodType[] instances = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
287.264 - MethodType[] expResults = {mt_viO, mt_OO2, mt_vv, mt_Ov, mt_iO2, mt_OOi, mt_OO2, mt_iOi};
287.265 - for (int i = 0; i < instances.length; i++) {
287.266 - MethodType result = instances[i].erase();
287.267 - assertSame("#"+i, expResults[i], result);
287.268 - }
287.269 - }
287.270 -
287.271 - @Test
287.272 - public void testGeneric() {
287.273 - System.out.println("generic");
287.274 - MethodType[] instances = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
287.275 - MethodType[] expResults = {mt_OO2, mt_OO2, mt_Ov, mt_Ov, mt_OO2, mt_OO2, mt_OO2, mt_OO2};
287.276 - for (int i = 0; i < instances.length; i++) {
287.277 - MethodType result = instances[i].generic();
287.278 - assertSame("#"+i, expResults[i], result);
287.279 - }
287.280 - }
287.281 -
287.282 - @Test
287.283 - public void testWrap() {
287.284 - System.out.println("wrap");
287.285 - MethodType[] instances = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
287.286 - MethodType[] expResults = {mt_VIS, mt_OO2, mt_Vv, mt_Ov, mt_ISI, mt_ISI, mt_ISI, mt_ISI};
287.287 - for (int i = 0; i < instances.length; i++) {
287.288 - MethodType result = instances[i].wrap();
287.289 - assertSame("#"+i, expResults[i], result);
287.290 - }
287.291 - }
287.292 -
287.293 - @Test
287.294 - public void testUnwrap() {
287.295 - System.out.println("unwrap");
287.296 - MethodType[] instances = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
287.297 - MethodType[] expResults = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSi, mt_iSi, mt_iSi, mt_iSi};
287.298 - for (int i = 0; i < instances.length; i++) {
287.299 - MethodType result = instances[i].unwrap();
287.300 - assertSame("#"+i, expResults[i], result);
287.301 - }
287.302 - }
287.303 -
287.304 - /**
287.305 - * Test of parameterType method, of class MethodType.
287.306 - */
287.307 - @Test
287.308 - public void testParameterType() {
287.309 - System.out.println("parameterType");
287.310 - for (int num = 0; num < ptypes.length; num++) {
287.311 - MethodType instance = mt_viS;
287.312 - Class<?> expResult = ptypes[num];
287.313 - Class<?> result = instance.parameterType(num);
287.314 - assertSame(expResult, result);
287.315 - }
287.316 - }
287.317 -
287.318 - /**
287.319 - * Test of parameterCount method, of class MethodType.
287.320 - */
287.321 - @Test
287.322 - public void testParameterCount() {
287.323 - System.out.println("parameterCount");
287.324 - MethodType instance = mt_viS;
287.325 - int expResult = 2;
287.326 - int result = instance.parameterCount();
287.327 - assertEquals(expResult, result);
287.328 - }
287.329 -
287.330 - /**
287.331 - * Test of returnType method, of class MethodType.
287.332 - */
287.333 - @Test
287.334 - public void testReturnType() {
287.335 - System.out.println("returnType");
287.336 - MethodType instance = mt_viS;
287.337 - Class<?> expResult = void.class;
287.338 - Class<?> result = instance.returnType();
287.339 - assertSame(expResult, result);
287.340 - }
287.341 -
287.342 - /**
287.343 - * Test of parameterList method, of class MethodType.
287.344 - */
287.345 - @Test
287.346 - public void testParameterList() {
287.347 - System.out.println("parameterList");
287.348 - MethodType instance = mt_viS;
287.349 - List<Class<?>> expResult = Arrays.asList(ptypes);
287.350 - List<Class<?>> result = instance.parameterList();
287.351 - assertEquals(expResult, result);
287.352 - }
287.353 -
287.354 - /**
287.355 - * Test of parameterArray method, of class MethodType.
287.356 - */
287.357 - @Test
287.358 - public void testParameterArray() {
287.359 - System.out.println("parameterArray");
287.360 - MethodType instance = mt_viS;
287.361 - Class<?>[] expResult = ptypes;
287.362 - Class<?>[] result = instance.parameterArray();
287.363 - assertEquals(Arrays.asList(expResult), Arrays.asList(result));
287.364 - }
287.365 -
287.366 - /**
287.367 - * Test of equals method, of class MethodType.
287.368 - */
287.369 - @Test
287.370 - public void testEquals_Object() {
287.371 - System.out.println("equals");
287.372 - Object x = null;
287.373 - MethodType instance = mt_viS;
287.374 - boolean expResult = false;
287.375 - boolean result = instance.equals(x);
287.376 - assertEquals(expResult, result);
287.377 - }
287.378 -
287.379 - /**
287.380 - * Test of equals method, of class MethodType.
287.381 - */
287.382 - @Test
287.383 - public void testEquals_MethodType() {
287.384 - System.out.println("equals");
287.385 - MethodType that = mt_viS;
287.386 - MethodType instance = mt_viS;
287.387 - boolean expResult = true;
287.388 - boolean result = instance.equals(that);
287.389 - assertEquals(expResult, result);
287.390 - }
287.391 -
287.392 - /**
287.393 - * Test of hashCode method, of class MethodType.
287.394 - */
287.395 - @Test
287.396 - public void testHashCode() {
287.397 - System.out.println("hashCode");
287.398 - MethodType instance = mt_viS;
287.399 - ArrayList<Class<?>> types = new ArrayList<Class<?>>();
287.400 - types.add(instance.returnType());
287.401 - types.addAll(instance.parameterList());
287.402 - int expResult = types.hashCode();
287.403 - int result = instance.hashCode();
287.404 - assertEquals(expResult, result);
287.405 - }
287.406 -
287.407 - /**
287.408 - * Test of toString method, of class MethodType.
287.409 - */
287.410 - @Test
287.411 - public void testToString() {
287.412 - System.out.println("toString");
287.413 - MethodType[] instances = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
287.414 - //String expResult = "void[int, class java.lang.String]";
287.415 - String[] expResults = {
287.416 - "(int,String)void",
287.417 - "(Object,Object)Object",
287.418 - "()void",
287.419 - "()Object",
287.420 - "(String,Integer)int",
287.421 - "(String,int)Integer",
287.422 - "(String,Integer)Integer",
287.423 - "(String,int)int"
287.424 - };
287.425 - for (int i = 0; i < instances.length; i++) {
287.426 - MethodType instance = instances[i];
287.427 - String result = instance.toString();
287.428 - System.out.println("#"+i+":"+result);
287.429 - assertEquals("#"+i, expResults[i], result);
287.430 - }
287.431 - }
287.432 -
287.433 - private static byte[] writeSerial(Object x) throws java.io.IOException {
287.434 - try (java.io.ByteArrayOutputStream bout = new java.io.ByteArrayOutputStream();
287.435 - java.io.ObjectOutputStream out = new java.io.ObjectOutputStream(bout)
287.436 - ) {
287.437 - out.writeObject(x);
287.438 - out.flush();
287.439 - return bout.toByteArray();
287.440 - }
287.441 - }
287.442 - private static Object readSerial(byte[] wire) throws java.io.IOException, ClassNotFoundException {
287.443 - try (java.io.ByteArrayInputStream bin = new java.io.ByteArrayInputStream(wire);
287.444 - java.io.ObjectInputStream in = new java.io.ObjectInputStream(bin)) {
287.445 - return in.readObject();
287.446 - }
287.447 - }
287.448 - private static void testSerializedEquality(Object x) throws java.io.IOException, ClassNotFoundException {
287.449 - if (x instanceof Object[])
287.450 - x = Arrays.asList((Object[]) x); // has proper equals method
287.451 - byte[] wire = writeSerial(x);
287.452 - Object y = readSerial(wire);
287.453 - assertEquals(x, y);
287.454 - }
287.455 -
287.456 - /** Test (de-)serialization. */
287.457 - @Test
287.458 - public void testSerialization() throws Throwable {
287.459 - System.out.println("serialization");
287.460 - for (MethodType mt : GALLERY) {
287.461 - testSerializedEquality(mt);
287.462 - }
287.463 - testSerializedEquality(GALLERY);
287.464 -
287.465 - // Make a list of mixed objects:
287.466 - List<Object> stuff = new ArrayList<>();
287.467 - Collections.addAll(stuff, GALLERY); // copy #1
287.468 - Object[] triples = Arrays.copyOfRange(GALLERY, 0, GALLERY.length/2);
287.469 - Collections.addAll(stuff, triples); // copy #3 (partial)
287.470 - for (MethodType mt : GALLERY) {
287.471 - Collections.addAll(stuff, mt.parameterArray());
287.472 - }
287.473 - Collections.shuffle(stuff, new Random(292));
287.474 - Collections.addAll(stuff, GALLERY); // copy #2
287.475 - testSerializedEquality(stuff);
287.476 - }
287.477 -
287.478 - /** Test serialization formats. */
287.479 - @Test
287.480 - public void testPortableSerialFormat() throws Throwable {
287.481 - System.out.println("portable serial format");
287.482 - Object[][] cases = {
287.483 - { mt_vv, new byte[] { // ()void
287.484 - (byte)0xac, (byte)0xed, (byte)0x00, (byte)0x05, (byte)0x73, (byte)0x72, (byte)0x00, (byte)0x13,
287.485 - (byte)0x6a, (byte)0x61, (byte)0x76, (byte)0x61, (byte)0x2e, (byte)0x64, (byte)0x79, (byte)0x6e,
287.486 - (byte)0x2e, (byte)0x4d, (byte)0x65, (byte)0x74, (byte)0x68, (byte)0x6f, (byte)0x64, (byte)0x54,
287.487 - (byte)0x79, (byte)0x70, (byte)0x65, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
287.488 - (byte)0x00, (byte)0x01, (byte)0x24, (byte)0x03, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x70,
287.489 - (byte)0x76, (byte)0x72, (byte)0x00, (byte)0x04, (byte)0x76, (byte)0x6f, (byte)0x69, (byte)0x64,
287.490 - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
287.491 - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x70, (byte)0x75, (byte)0x72, (byte)0x00,
287.492 - (byte)0x12, (byte)0x5b, (byte)0x4c, (byte)0x6a, (byte)0x61, (byte)0x76, (byte)0x61, (byte)0x2e,
287.493 - (byte)0x6c, (byte)0x61, (byte)0x6e, (byte)0x67, (byte)0x2e, (byte)0x43, (byte)0x6c, (byte)0x61,
287.494 - (byte)0x73, (byte)0x73, (byte)0x3b, (byte)0xab, (byte)0x16, (byte)0xd7, (byte)0xae, (byte)0xcb,
287.495 - (byte)0xcd, (byte)0x5a, (byte)0x99, (byte)0x02, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x70,
287.496 - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x78,
287.497 - } },
287.498 - { mt_OO, new byte[] { // (Object)Object
287.499 - (byte)0xac, (byte)0xed, (byte)0x00, (byte)0x05, (byte)0x73, (byte)0x72, (byte)0x00, (byte)0x13,
287.500 - (byte)0x6a, (byte)0x61, (byte)0x76, (byte)0x61, (byte)0x2e, (byte)0x64, (byte)0x79, (byte)0x6e,
287.501 - (byte)0x2e, (byte)0x4d, (byte)0x65, (byte)0x74, (byte)0x68, (byte)0x6f, (byte)0x64, (byte)0x54,
287.502 - (byte)0x79, (byte)0x70, (byte)0x65, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
287.503 - (byte)0x00, (byte)0x01, (byte)0x24, (byte)0x03, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x70,
287.504 - (byte)0x76, (byte)0x72, (byte)0x00, (byte)0x10, (byte)0x6a, (byte)0x61, (byte)0x76, (byte)0x61,
287.505 - (byte)0x2e, (byte)0x6c, (byte)0x61, (byte)0x6e, (byte)0x67, (byte)0x2e, (byte)0x4f, (byte)0x62,
287.506 - (byte)0x6a, (byte)0x65, (byte)0x63, (byte)0x74, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
287.507 - (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x78,
287.508 - (byte)0x70, (byte)0x75, (byte)0x72, (byte)0x00, (byte)0x12, (byte)0x5b, (byte)0x4c, (byte)0x6a,
287.509 - (byte)0x61, (byte)0x76, (byte)0x61, (byte)0x2e, (byte)0x6c, (byte)0x61, (byte)0x6e, (byte)0x67,
287.510 - (byte)0x2e, (byte)0x43, (byte)0x6c, (byte)0x61, (byte)0x73, (byte)0x73, (byte)0x3b, (byte)0xab,
287.511 - (byte)0x16, (byte)0xd7, (byte)0xae, (byte)0xcb, (byte)0xcd, (byte)0x5a, (byte)0x99, (byte)0x02,
287.512 - (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x70, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01,
287.513 - (byte)0x71, (byte)0x00, (byte)0x7e, (byte)0x00, (byte)0x03, (byte)0x78,
287.514 - } },
287.515 - };
287.516 - boolean generateData = false;
287.517 - //generateData = true;
287.518 - for (Object[] c : cases) {
287.519 - MethodType mt = (MethodType) c[0];
287.520 - System.out.println("deserialize "+mt);
287.521 - byte[] wire = (byte[]) c[1];
287.522 - if (generateData) {
287.523 - wire = writeSerial(mt);
287.524 - final String INDENT = " ";
287.525 - System.out.print("{ // "+mt);
287.526 - for (int i = 0; i < wire.length; i++) {
287.527 - if (i % 8 == 0) { System.out.println(); System.out.print(INDENT+" "); }
287.528 - String hex = Integer.toHexString(wire[i] & 0xFF);
287.529 - if (hex.length() == 1) hex = "0"+hex;
287.530 - System.out.print(" (byte)0x"+hex+",");
287.531 - }
287.532 - System.out.println();
287.533 - System.out.println(INDENT+"}");
287.534 - System.out.flush();
287.535 - }
287.536 - Object decode;
287.537 - try {
287.538 - decode = readSerial(wire);
287.539 - } catch (Exception ex) {
287.540 - decode = ex; // oops!
287.541 - }
287.542 - assertEquals(mt, decode);
287.543 - }
287.544 - }
287.545 -}
288.1 --- a/test/java/dyn/indify/Indify.java Tue Mar 29 11:29:01 2011 -0700
288.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
288.3 @@ -1,1890 +0,0 @@
288.4 -/*
288.5 - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
288.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
288.7 - *
288.8 - * This code is free software; you can redistribute it and/or modify it
288.9 - * under the terms of the GNU General Public License version 2 only, as
288.10 - * published by the Free Software Foundation. Oracle designates this
288.11 - * particular file as subject to the "Classpath" exception as provided
288.12 - * by Oracle in the LICENSE file that accompanied this code.
288.13 - *
288.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
288.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
288.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
288.17 - * version 2 for more details (a copy is included in the LICENSE file that
288.18 - * accompanied this code).
288.19 - *
288.20 - * You should have received a copy of the GNU General Public License version
288.21 - * 2 along with this work; if not, write to the Free Software Foundation,
288.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
288.23 - *
288.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
288.25 - * or visit www.oracle.com if you need additional information or have any
288.26 - * questions.
288.27 - */
288.28 -
288.29 -package indify;
288.30 -
288.31 -import java.util.*;
288.32 -import java.io.*;
288.33 -import java.lang.reflect.Modifier;
288.34 -import java.util.regex.*;
288.35 -
288.36 -/**
288.37 - * Transform one or more class files to incorporate JSR 292 features,
288.38 - * such as {@code invokedynamic}.
288.39 - * <p>
288.40 - * This is a standalone program in a single source file.
288.41 - * In this form, it may be useful for test harnesses, small experiments, and javadoc examples.
288.42 - * Copies of this file may show up in multiple locations for standalone usage.
288.43 - * The primary maintained location of this file is as follows:
288.44 - * <a href="http://kenai.com/projects/ninja/sources/indify-repo/content/src/indify/Indify.java">
288.45 - * http://kenai.com/projects/ninja/sources/indify-repo/content/src/indify/Indify.java</a>
288.46 - * <p>
288.47 - * Static private methods named MH_x and MT_x (where x is arbitrary)
288.48 - * must be stereotyped generators of MethodHandle and MethodType
288.49 - * constants. All calls to them are transformed to {@code CONSTANT_MethodHandle}
288.50 - * and {@code CONSTANT_MethodType} "ldc" instructions.
288.51 - * The stereotyped code must create method types by calls to {@code methodType} or
288.52 - * {@code fromMethodDescriptorString}. The "lookup" argument must be created
288.53 - * by calls to {@code java.dyn.MethodHandles#lookup MethodHandles.lookup}.
288.54 - * The class and string arguments must be constant.
288.55 - * The following methods of {@code java.dyn.MethodHandle.Lookup Lookup} are
288.56 - * allowed for method handle creation: {@code findStatic}, {@code findVirtual},
288.57 - * {@code findConstructor}, {@code findSpecial},
288.58 - * {@code findGetter}, {@code findSetter},
288.59 - * {@code findStaticGetter}, or {@code findStaticSetter}.
288.60 - * The call to one of these methods must be followed immediately
288.61 - * by an {@code areturn} instruction.
288.62 - * The net result of the call to the MH_x or MT_x method must be
288.63 - * the creation of a constant method handle. Thus, replacing calls
288.64 - * to MH_x or MT_x methods by {@code ldc} instructions should leave
288.65 - * the meaning of the program unchanged.
288.66 - * <p>
288.67 - * Static private methods named INDY_x must be stereotyped generators
288.68 - * of {@code invokedynamic} call sites.
288.69 - * All calls to them must be immediately followed by
288.70 - * {@code invokeExact} calls.
288.71 - * All such pairs of calls are transformed to {@code invokedynamic}
288.72 - * instructions. Each INDY_x method must begin with a call to a
288.73 - * MH_x method, which is taken to be its bootstrap method.
288.74 - * The method must be immediately invoked (via {@code invokeGeneric}
288.75 - * on constant lookup, name, and type arguments. An object array of
288.76 - * constants may also be appended to the {@code invokeGeneric call}.
288.77 - * This call must be cast to {@code CallSite}, and the result must be
288.78 - * immediately followed by a call to {@code dynamicInvoker}, with the
288.79 - * resulting method handle returned.
288.80 - * <p>
288.81 - * The net result of all of these actions is equivalent to the JVM's
288.82 - * execution of an {@code invokedynamic} instruction in the unlinked state.
288.83 - * Running this code once should produce the same results as running
288.84 - * the corresponding {@code invokedynamic} instruction.
288.85 - * In order to model the caching behavior, the code of an INDY_x
288.86 - * method is allowed to begin with getstatic, aaload, and if_acmpne
288.87 - * instructions which load a static method handle value and return it
288.88 - * if the value is non-null.
288.89 - * <p>
288.90 - * Example usage:
288.91 - * <blockquote><pre>
288.92 -$ JAVA_HOME=(some recent OpenJDK 7 build)
288.93 -$ ant
288.94 -$ $JAVA_HOME/bin/java -cp build/classes indify.Indify --overwrite --dest build/testout build/classes/indify/Example.class
288.95 -$ $JAVA_HOME/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic -cp build/classes indify.Example
288.96 -MT = (java.lang.Object)java.lang.Object
288.97 -MH = adder(int,int)java.lang.Integer
288.98 -adder(1,2) = 3
288.99 -calling indy: 42
288.100 -$ $JAVA_HOME/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic -cp build/testout indify.Example
288.101 -(same output as above)
288.102 - * </pre></blockquote>
288.103 - * <p>
288.104 - * Before OpenJDK build b123, the format of {@code CONSTANT_InvokeDynamic} is in transition,
288.105 - * and the switch {@code --transitionalJSR292=yes} is recommended.
288.106 - * It is turned <em>off</em> by default, but users of earlier builds may need to turn it on.
288.107 - * <p>
288.108 - * A version of this transformation built on top of <a href="http://asm.ow2.org/">http://asm.ow2.org/</a> would be welcome.
288.109 - * @author John Rose
288.110 - */
288.111 -public class Indify {
288.112 - public static void main(String... av) throws IOException {
288.113 - new Indify().run(av);
288.114 - }
288.115 -
288.116 - public File dest;
288.117 - public String[] classpath = {"."};
288.118 - public boolean keepgoing = false;
288.119 - public boolean expandProperties = false;
288.120 - public boolean overwrite = false;
288.121 - public boolean quiet = false;
288.122 - public boolean verbose = false;
288.123 - public boolean transitionalJSR292 = false; // final version is distributed
288.124 - public boolean all = false;
288.125 - public int verifySpecifierCount = -1;
288.126 -
288.127 - public void run(String... av) throws IOException {
288.128 - List<String> avl = new ArrayList<>(Arrays.asList(av));
288.129 - parseOptions(avl);
288.130 - if (avl.isEmpty())
288.131 - throw new IllegalArgumentException("Usage: indify [--dest dir] [option...] file...");
288.132 - if ("--java".equals(avl.get(0))) {
288.133 - avl.remove(0);
288.134 - try {
288.135 - runApplication(avl.toArray(new String[0]));
288.136 - } catch (Exception ex) {
288.137 - if (ex instanceof RuntimeException) throw (RuntimeException) ex;
288.138 - throw new RuntimeException(ex);
288.139 - }
288.140 - return;
288.141 - }
288.142 - Exception err = null;
288.143 - for (String a : avl) {
288.144 - try {
288.145 - indify(a);
288.146 - } catch (Exception ex) {
288.147 - if (err == null) err = ex;
288.148 - System.err.println("failure on "+a);
288.149 - if (!keepgoing) break;
288.150 - }
288.151 - }
288.152 - if (err != null) {
288.153 - if (err instanceof IOException) throw (IOException) err;
288.154 - throw (RuntimeException) err;
288.155 - }
288.156 - }
288.157 -
288.158 - /** Execute the given application under a class loader which indifies all application classes. */
288.159 - public void runApplication(String... av) throws Exception {
288.160 - List<String> avl = new ArrayList<>(Arrays.asList(av));
288.161 - String mainClassName = avl.remove(0);
288.162 - av = avl.toArray(new String[0]);
288.163 - Class<?> mainClass = Class.forName(mainClassName, true, makeClassLoader());
288.164 - java.lang.reflect.Method main = mainClass.getMethod("main", String[].class);
288.165 - try { main.setAccessible(true); } catch (SecurityException ex) { }
288.166 - main.invoke(null, (Object) av);
288.167 - }
288.168 -
288.169 - public void parseOptions(List<String> av) throws IOException {
288.170 - for (; !av.isEmpty(); av.remove(0)) {
288.171 - String a = av.get(0);
288.172 - if (a.startsWith("-")) {
288.173 - String a2 = null;
288.174 - int eq = a.indexOf('=');
288.175 - if (eq > 0) {
288.176 - a2 = maybeExpandProperties(a.substring(eq+1));
288.177 - a = a.substring(0, eq+1);
288.178 - }
288.179 - switch (a) {
288.180 - case "--java":
288.181 - return; // keep this argument
288.182 - case "-d": case "--dest": case "-d=": case "--dest=":
288.183 - dest = new File(a2 != null ? a2 : maybeExpandProperties(av.remove(1)));
288.184 - break;
288.185 - case "-cp": case "--classpath":
288.186 - classpath = maybeExpandProperties(av.remove(1)).split("["+File.pathSeparatorChar+"]");
288.187 - break;
288.188 - case "-k": case "--keepgoing": case "--keepgoing=":
288.189 - keepgoing = booleanOption(a2); // print errors but keep going
288.190 - break;
288.191 - case "--expand-properties": case "--expand-properties=":
288.192 - expandProperties = booleanOption(a2); // expand property references in subsequent arguments
288.193 - break;
288.194 - case "--verify-specifier-count": case "--verify-specifier-count=":
288.195 - verifySpecifierCount = Integer.valueOf(a2);
288.196 - break;
288.197 - case "--overwrite": case "--overwrite=":
288.198 - overwrite = booleanOption(a2); // overwrite output files
288.199 - break;
288.200 - case "--all": case "--all=":
288.201 - all = booleanOption(a2); // copy all classes, even if no patterns
288.202 - break;
288.203 - case "-q": case "--quiet": case "--quiet=":
288.204 - quiet = booleanOption(a2); // less output
288.205 - break;
288.206 - case "-v": case "--verbose": case "--verbose=":
288.207 - verbose = booleanOption(a2); // more output
288.208 - break;
288.209 - case "--transitionalJSR292": case "--transitionalJSR292=":
288.210 - transitionalJSR292 = booleanOption(a2); // use older invokedynamic format
288.211 - break;
288.212 - default:
288.213 - throw new IllegalArgumentException("unrecognized flag: "+a);
288.214 - }
288.215 - continue;
288.216 - } else {
288.217 - break;
288.218 - }
288.219 - }
288.220 - if (dest == null && !overwrite)
288.221 - throw new RuntimeException("no output specified; need --dest d or --overwrite");
288.222 - if (expandProperties) {
288.223 - for (int i = 0; i < av.size(); i++)
288.224 - av.set(i, maybeExpandProperties(av.get(i)));
288.225 - }
288.226 - }
288.227 -
288.228 - private boolean booleanOption(String s) {
288.229 - if (s == null) return true;
288.230 - switch (s) {
288.231 - case "true": case "yes": case "on": case "1": return true;
288.232 - case "false": case "no": case "off": case "0": return false;
288.233 - }
288.234 - throw new IllegalArgumentException("unrecognized boolean flag="+s);
288.235 - }
288.236 -
288.237 - private String maybeExpandProperties(String s) {
288.238 - if (!expandProperties) return s;
288.239 - Set<String> propsDone = new HashSet<>();
288.240 - while (s.contains("${")) {
288.241 - int lbrk = s.indexOf("${");
288.242 - int rbrk = s.indexOf('}', lbrk);
288.243 - if (rbrk < 0) break;
288.244 - String prop = s.substring(lbrk+2, rbrk);
288.245 - if (!propsDone.add(prop)) break;
288.246 - String value = System.getProperty(prop);
288.247 - if (verbose) System.err.println("expanding ${"+prop+"} => "+value);
288.248 - if (value == null) break;
288.249 - s = s.substring(0, lbrk) + value + s.substring(rbrk+1);
288.250 - }
288.251 - return s;
288.252 - }
288.253 -
288.254 - public void indify(String a) throws IOException {
288.255 - File f = new File(a);
288.256 - String fn = f.getName();
288.257 - if (fn.endsWith(".class") && f.isFile())
288.258 - indifyFile(f, dest);
288.259 - else if (fn.endsWith(".jar") && f.isFile())
288.260 - indifyJar(f, dest);
288.261 - else if (f.isDirectory())
288.262 - indifyTree(f, dest);
288.263 - else if (!keepgoing)
288.264 - throw new RuntimeException("unrecognized file: "+a);
288.265 - }
288.266 -
288.267 - private void ensureDirectory(File dir) {
288.268 - if (dir.mkdirs() && !quiet)
288.269 - System.err.println("created "+dir);
288.270 - }
288.271 -
288.272 - public void indifyFile(File f, File dest) throws IOException {
288.273 - if (verbose) System.err.println("reading "+f);
288.274 - ClassFile cf = new ClassFile(f);
288.275 - Logic logic = new Logic(cf);
288.276 - boolean changed = logic.transform();
288.277 - logic.reportPatternMethods(quiet, keepgoing);
288.278 - if (changed || all) {
288.279 - File outfile;
288.280 - if (dest != null) {
288.281 - ensureDirectory(dest);
288.282 - outfile = classPathFile(dest, cf.nameString());
288.283 - } else {
288.284 - outfile = f; // overwrite input file, no matter where it is
288.285 - }
288.286 - cf.writeTo(outfile);
288.287 - if (!quiet) System.err.println("wrote "+outfile);
288.288 - }
288.289 - }
288.290 -
288.291 - File classPathFile(File pathDir, String className) {
288.292 - String qualname = className.replace('.','/')+".class";
288.293 - qualname = qualname.replace('/', File.separatorChar);
288.294 - return new File(pathDir, qualname);
288.295 - }
288.296 -
288.297 - public void indifyJar(File f, Object dest) throws IOException {
288.298 - throw new UnsupportedOperationException("Not yet implemented");
288.299 - }
288.300 -
288.301 - public void indifyTree(File f, File dest) throws IOException {
288.302 - if (verbose) System.err.println("reading directory: "+f);
288.303 - for (File f2 : f.listFiles(new FilenameFilter() {
288.304 - public boolean accept(File dir, String name) {
288.305 - if (name.endsWith(".class")) return true;
288.306 - if (name.contains(".")) return false;
288.307 - // return true if it might be a package name:
288.308 - return Character.isJavaIdentifierStart(name.charAt(0));
288.309 - }})) {
288.310 - if (f2.getName().endsWith(".class"))
288.311 - indifyFile(f2, dest);
288.312 - else if (f2.isDirectory())
288.313 - indifyTree(f2, dest);
288.314 - }
288.315 - }
288.316 -
288.317 - public ClassLoader makeClassLoader() {
288.318 - return new Loader();
288.319 - }
288.320 - private class Loader extends ClassLoader {
288.321 - Loader() {
288.322 - this(Indify.class.getClassLoader());
288.323 - }
288.324 - Loader(ClassLoader parent) {
288.325 - super(parent);
288.326 - }
288.327 - public Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
288.328 - File f = findClassInPath(name);
288.329 - if (f != null) {
288.330 - try {
288.331 - Class<?> c = transformAndLoadClass(f);
288.332 - if (c != null) {
288.333 - if (resolve) resolveClass(c);
288.334 - return c;
288.335 - }
288.336 - } catch (Exception ex) {
288.337 - if (ex instanceof IllegalArgumentException)
288.338 - // pass error from reportPatternMethods
288.339 - throw (IllegalArgumentException) ex;
288.340 - }
288.341 - }
288.342 - return super.loadClass(name, resolve);
288.343 - }
288.344 - private File findClassInPath(String name) {
288.345 - for (String s : classpath) {
288.346 - File f = classPathFile(new File(s), name);
288.347 - //System.out.println("Checking for "+f);
288.348 - if (f.exists() && f.canRead()) {
288.349 - return f;
288.350 - }
288.351 - }
288.352 - return null;
288.353 - }
288.354 - protected Class<?> findClass(String name) throws ClassNotFoundException {
288.355 - try {
288.356 - return transformAndLoadClass(findClassInPath(name));
288.357 - } catch (IOException ex) {
288.358 - throw new ClassNotFoundException("IO error", ex);
288.359 - }
288.360 - }
288.361 - private Class<?> transformAndLoadClass(File f) throws ClassNotFoundException, IOException {
288.362 - if (verbose) System.err.println("Loading class from "+f);
288.363 - ClassFile cf = new ClassFile(f);
288.364 - Logic logic = new Logic(cf);
288.365 - boolean changed = logic.transform();
288.366 - if (verbose && !changed) System.err.println("(no change)");
288.367 - logic.reportPatternMethods(!verbose, keepgoing);
288.368 - byte[] bytes = cf.toByteArray();
288.369 - return defineClass(null, bytes, 0, bytes.length);
288.370 - }
288.371 - }
288.372 -
288.373 - private class Logic {
288.374 - // Indify logic, per se.
288.375 - ClassFile cf;
288.376 - final char[] poolMarks;
288.377 - final Map<Method,Constant> constants = new HashMap<>();
288.378 - final Map<Method,String> indySignatures = new HashMap<>();
288.379 - Logic(ClassFile cf) {
288.380 - this.cf = cf;
288.381 - poolMarks = new char[cf.pool.size()];
288.382 - }
288.383 - boolean transform() {
288.384 - if (!initializeMarks()) return false;
288.385 - if (!findPatternMethods()) return false;
288.386 - Pool pool = cf.pool;
288.387 - //for (Constant c : cp) System.out.println(" # "+c);
288.388 - for (Method m : cf.methods) {
288.389 - if (constants.containsKey(m)) continue; // don't bother
288.390 - // Transform references.
288.391 - int blab = 0;
288.392 - for (Instruction i = m.instructions(); i != null; i = i.next()) {
288.393 - if (i.bc != opc_invokestatic) continue;
288.394 - int methi = i.u2At(1);
288.395 - if (poolMarks[methi] == 0) continue;
288.396 - Short[] ref = pool.getMemberRef((short)methi);
288.397 - Method conm = findMember(cf.methods, ref[1], ref[2]);
288.398 - if (conm == null) continue;
288.399 - Constant con = constants.get(conm);
288.400 - if (con == null) continue;
288.401 - if (blab++ == 0 && !quiet)
288.402 - System.err.println("patching "+cf.nameString()+"."+m);
288.403 - //if (blab == 1) { for (Instruction j = m.instructions(); j != null; j = j.next()) System.out.println(" |"+j); }
288.404 - if (con.tag == CONSTANT_InvokeDynamic ||
288.405 - con.tag == CONSTANT_InvokeDynamic_17) {
288.406 - // need to patch the following instruction too,
288.407 - // but there are usually intervening argument pushes too
288.408 - Instruction i2 = findPop(i);
288.409 - Short[] ref2 = null;
288.410 - short ref2i = 0;
288.411 - if (i2 != null && i2.bc == opc_invokevirtual &&
288.412 - poolMarks[(char)(ref2i = (short) i2.u2At(1))] == 'D')
288.413 - ref2 = pool.getMemberRef(ref2i);
288.414 - if (ref2 == null || !"invokeExact".equals(pool.getString(ref2[1]))) {
288.415 - System.err.println(m+": failed to create invokedynamic at "+i.pc);
288.416 - continue;
288.417 - }
288.418 - String invType = pool.getString(ref2[2]);
288.419 - String bsmType = indySignatures.get(conm);
288.420 - if (!invType.equals(bsmType)) {
288.421 - System.err.println(m+": warning: "+conm+" call type and local invoke type differ: "
288.422 - +bsmType+", "+invType);
288.423 - }
288.424 - assert(i.len == 3 || i2.len == 3);
288.425 - if (!quiet) System.err.println(i+" "+conm+";...; "+i2+" => invokedynamic "+con);
288.426 - int start = i.pc + 3, end = i2.pc;
288.427 - System.arraycopy(i.codeBase, start, i.codeBase, i.pc, end-start);
288.428 - i.forceNext(0); // force revisit of new instruction
288.429 - i2.u1AtPut(-3, opc_invokedynamic);
288.430 - i2.u2AtPut(-2, con.index);
288.431 - i2.u2AtPut(0, (short)0);
288.432 - i2.u1AtPut(2, opc_nop);
288.433 - //System.out.println(new Instruction(i.codeBase, i2.pc-3));
288.434 - } else {
288.435 - if (!quiet) System.err.println(i+" "+conm+" => ldc "+con);
288.436 - assert(i.len == 3);
288.437 - i.u1AtPut(0, opc_ldc_w);
288.438 - i.u2AtPut(1, con.index);
288.439 - }
288.440 - }
288.441 - //if (blab >= 1) { for (Instruction j = m.instructions(); j != null; j = j.next()) System.out.println(" |"+j); }
288.442 - }
288.443 - cf.methods.removeAll(constants.keySet());
288.444 - return true;
288.445 - }
288.446 -
288.447 - // Scan forward from the instruction to find where the stack p
288.448 - // below the current sp at the instruction.
288.449 - Instruction findPop(Instruction i) {
288.450 - //System.out.println("findPop from "+i);
288.451 - Pool pool = cf.pool;
288.452 - JVMState jvm = new JVMState();
288.453 - decode:
288.454 - for (i = i.clone().next(); i != null; i = i.next()) {
288.455 - String pops = INSTRUCTION_POPS[i.bc];
288.456 - //System.out.println(" "+i+" "+jvm.stack+" : "+pops.replace("$", " => "));
288.457 - if (pops == null) break;
288.458 - if (jvm.stackMotion(i.bc)) continue decode;
288.459 - if (pops.indexOf('Q') >= 0) {
288.460 - Short[] ref = pool.getMemberRef((short) i.u2At(1));
288.461 - String type = simplifyType(pool.getString(CONSTANT_Utf8, ref[2]));
288.462 - switch (i.bc) {
288.463 - case opc_getstatic:
288.464 - case opc_getfield:
288.465 - case opc_putstatic:
288.466 - case opc_putfield:
288.467 - pops = pops.replace("Q", type);
288.468 - break;
288.469 - default:
288.470 - if (!type.startsWith("("))
288.471 - throw new InternalError(i.toString());
288.472 - pops = pops.replace("Q$Q", type.substring(1).replace(")","$"));
288.473 - break;
288.474 - }
288.475 - //System.out.println("special type: "+type+" => "+pops);
288.476 - }
288.477 - int npops = pops.indexOf('$');
288.478 - if (npops < 0) throw new InternalError();
288.479 - if (npops > jvm.sp()) return i;
288.480 - List<Object> args = jvm.args(npops);
288.481 - int k = 0;
288.482 - for (Object x : args) {
288.483 - char have = (Character) x;
288.484 - char want = pops.charAt(k++);
288.485 - if (have == 'X' || want == 'X') continue;
288.486 - if (have != want) break decode;
288.487 - }
288.488 - if (pops.charAt(k++) != '$') break decode;
288.489 - args.clear();
288.490 - while (k < pops.length())
288.491 - args.add(pops.charAt(k++));
288.492 - }
288.493 - System.err.println("*** bailout on jvm: "+jvm.stack+" "+i);
288.494 - return null;
288.495 - }
288.496 -
288.497 - boolean findPatternMethods() {
288.498 - boolean found = false;
288.499 - for (char mark : "THI".toCharArray()) {
288.500 - for (Method m : cf.methods) {
288.501 - if (!Modifier.isPrivate(m.access)) continue;
288.502 - if (!Modifier.isStatic(m.access)) continue;
288.503 - if (nameAndTypeMark(m.name, m.type) == mark) {
288.504 - Constant con = scanPattern(m, mark);
288.505 - if (con == null) continue;
288.506 - constants.put(m, con);
288.507 - found = true;
288.508 - }
288.509 - }
288.510 - }
288.511 - return found;
288.512 - }
288.513 -
288.514 - void reportPatternMethods(boolean quietly, boolean allowMatchFailure) {
288.515 - if (!quietly && !constants.keySet().isEmpty())
288.516 - System.err.println("pattern methods removed: "+constants.keySet());
288.517 - for (Method m : cf.methods) {
288.518 - if (nameMark(cf.pool.getString(m.name)) != 0 &&
288.519 - constants.get(m) == null) {
288.520 - String failure = "method has special name but fails to match pattern: "+m;
288.521 - if (!allowMatchFailure)
288.522 - throw new IllegalArgumentException(failure);
288.523 - else if (!quietly)
288.524 - System.err.println("warning: "+failure);
288.525 - }
288.526 - }
288.527 - if (verifySpecifierCount >= 0) {
288.528 - List<Object[]> specs = bootstrapMethodSpecifiers(false);
288.529 - int specsLen = (specs == null ? 0 : specs.size());
288.530 - if (specsLen != verifySpecifierCount) {
288.531 - throw new IllegalArgumentException("BootstrapMethods length is "+specsLen+" but should be "+verifySpecifierCount);
288.532 - }
288.533 - }
288.534 - if (!quiet) System.err.flush();
288.535 - }
288.536 -
288.537 - // mark constant pool entries according to participation in patterns
288.538 - boolean initializeMarks() {
288.539 - boolean changed = false;
288.540 - for (;;) {
288.541 - boolean changed1 = false;
288.542 - int cpindex = -1;
288.543 - for (Constant e : cf.pool) {
288.544 - ++cpindex;
288.545 - if (e == null) continue;
288.546 - char mark = poolMarks[cpindex];
288.547 - if (mark != 0) continue;
288.548 - switch (e.tag) {
288.549 - case CONSTANT_Utf8:
288.550 - mark = nameMark(e.itemString()); break;
288.551 - case CONSTANT_NameAndType:
288.552 - mark = nameAndTypeMark(e.itemIndexes()); break;
288.553 - case CONSTANT_Class: {
288.554 - int n1 = e.itemIndex();
288.555 - char nmark = poolMarks[(char)n1];
288.556 - if ("DJ".indexOf(nmark) >= 0)
288.557 - mark = nmark;
288.558 - break;
288.559 - }
288.560 - case CONSTANT_Field:
288.561 - case CONSTANT_Method: {
288.562 - Short[] n12 = e.itemIndexes();
288.563 - short cl = n12[0];
288.564 - short nt = n12[1];
288.565 - char cmark = poolMarks[(char)cl];
288.566 - if (cmark != 0) {
288.567 - mark = cmark; // it is a java.dyn.* or java.lang.* method
288.568 - break;
288.569 - }
288.570 - String cls = cf.pool.getString(CONSTANT_Class, cl);
288.571 - if (cls.equals(cf.nameString())) {
288.572 - switch (poolMarks[(char)nt]) {
288.573 - // it is a private MH/MT/INDY method
288.574 - case 'T': case 'H': case 'I':
288.575 - mark = poolMarks[(char)nt];
288.576 - break;
288.577 - }
288.578 - }
288.579 - break;
288.580 - }
288.581 - default: break;
288.582 - }
288.583 - if (mark != 0) {
288.584 - poolMarks[cpindex] = mark;
288.585 - changed1 = true;
288.586 - }
288.587 - }
288.588 - if (!changed1)
288.589 - break;
288.590 - changed = true;
288.591 - }
288.592 - return changed;
288.593 - }
288.594 - char nameMark(String s) {
288.595 - if (s.startsWith("MT_")) return 'T';
288.596 - else if (s.startsWith("MH_")) return 'H';
288.597 - else if (s.startsWith("INDY_")) return 'I';
288.598 - else if (s.startsWith("java/dyn/")) return 'D';
288.599 - else if (s.startsWith("java/lang/")) return 'J';
288.600 - return 0;
288.601 - }
288.602 - char nameAndTypeMark(Short[] n12) {
288.603 - return nameAndTypeMark(n12[0], n12[1]);
288.604 - }
288.605 - char nameAndTypeMark(short n1, short n2) {
288.606 - char mark = poolMarks[(char)n1];
288.607 - if (mark == 0) return 0;
288.608 - String descr = cf.pool.getString(CONSTANT_Utf8, n2);
288.609 - String requiredType;
288.610 - switch (poolMarks[(char)n1]) {
288.611 - case 'H': requiredType = "()Ljava/dyn/MethodHandle;"; break;
288.612 - case 'T': requiredType = "()Ljava/dyn/MethodType;"; break;
288.613 - case 'I': requiredType = "()Ljava/dyn/MethodHandle;"; break;
288.614 - default: return 0;
288.615 - }
288.616 - if (descr.equals(requiredType)) return mark;
288.617 - return 0;
288.618 - }
288.619 -
288.620 - private class JVMState {
288.621 - final List<Object> stack = new ArrayList<>();
288.622 - int sp() { return stack.size(); }
288.623 - void push(Object x) { stack.add(x); }
288.624 - void push2(Object x) { stack.add(EMPTY_SLOT); stack.add(x); }
288.625 - void pushAt(int pos, Object x) { stack.add(stack.size()+pos, x); }
288.626 - Object pop() { return stack.remove(sp()-1); }
288.627 - Object top() { return stack.get(sp()-1); }
288.628 - List<Object> args(boolean hasRecv, String type) {
288.629 - return args(argsize(type) + (hasRecv ? 1 : 0));
288.630 - }
288.631 - List<Object> args(int argsize) {
288.632 - return stack.subList(sp()-argsize, sp());
288.633 - }
288.634 - boolean stackMotion(int bc) {
288.635 - switch (bc) {
288.636 - case opc_pop: pop(); break;
288.637 - case opc_pop2: pop(); pop(); break;
288.638 - case opc_swap: pushAt(-1, pop()); break;
288.639 - case opc_dup: push(top()); break;
288.640 - case opc_dup_x1: pushAt(-2, top()); break;
288.641 - case opc_dup_x2: pushAt(-3, top()); break;
288.642 - // ? also: dup2{,_x1,_x2}
288.643 - default: return false;
288.644 - }
288.645 - return true;
288.646 - }
288.647 - }
288.648 - private final String EMPTY_SLOT = "_";
288.649 - private void removeEmptyJVMSlots(List<Object> args) {
288.650 - for (;;) {
288.651 - int i = args.indexOf(EMPTY_SLOT);
288.652 - if (i >= 0 && i+1 < args.size()
288.653 - && (isConstant(args.get(i+1), CONSTANT_Long) ||
288.654 - isConstant(args.get(i+1), CONSTANT_Double)))
288.655 - args.remove(i);
288.656 - else break;
288.657 - }
288.658 - }
288.659 -
288.660 - private Constant scanPattern(Method m, char patternMark) {
288.661 - if (verbose) System.err.println("scan "+m+" for pattern="+patternMark);
288.662 - int wantTag;
288.663 - switch (patternMark) {
288.664 - case 'T': wantTag = CONSTANT_MethodType; break;
288.665 - case 'H': wantTag = CONSTANT_MethodHandle; break;
288.666 - case 'I': wantTag = CONSTANT_InvokeDynamic; break;
288.667 - default: throw new InternalError();
288.668 - }
288.669 - Instruction i = m.instructions();
288.670 - JVMState jvm = new JVMState();
288.671 - Pool pool = cf.pool;
288.672 - int branchCount = 0;
288.673 - Object arg;
288.674 - List<Object> args;
288.675 - List<Object> bsmArgs = null; // args to invokeGeneric
288.676 - decode:
288.677 - for (; i != null; i = i.next()) {
288.678 - //System.out.println(jvm.stack+" "+i);
288.679 - int bc = i.bc;
288.680 - switch (bc) {
288.681 - case opc_ldc: jvm.push(pool.get(i.u1At(1))); break;
288.682 - case opc_ldc_w: jvm.push(pool.get(i.u2At(1))); break;
288.683 - case opc_ldc2_w: jvm.push2(pool.get(i.u2At(1))); break;
288.684 - case opc_aconst_null: jvm.push(null); break;
288.685 - case opc_bipush: jvm.push((int)(byte) i.u1At(1)); break;
288.686 - case opc_sipush: jvm.push((int)(short)i.u2At(1)); break;
288.687 -
288.688 - // these support creation of a restarg array
288.689 - case opc_anewarray:
288.690 - arg = jvm.pop();
288.691 - if (!(arg instanceof Integer)) break decode;
288.692 - arg = Arrays.asList(new Object[(Integer)arg]);
288.693 - jvm.push(arg);
288.694 - break;
288.695 - case opc_dup:
288.696 - jvm.push(jvm.top()); break;
288.697 - case opc_aastore:
288.698 - args = jvm.args(3); // array, index, value
288.699 - if (args.get(0) instanceof List &&
288.700 - args.get(1) instanceof Integer) {
288.701 - ((List<Object>)args.get(0)).set( (Integer)args.get(1), args.get(2) );
288.702 - }
288.703 - args.clear();
288.704 - break;
288.705 -
288.706 - case opc_new:
288.707 - {
288.708 - String type = pool.getString(CONSTANT_Class, (short)i.u2At(1));
288.709 - //System.out.println("new "+type);
288.710 - switch (type) {
288.711 - case "java/lang/StringBuilder":
288.712 - jvm.push("StringBuilder");
288.713 - continue decode; // go to next instruction
288.714 - }
288.715 - break decode; // bail out
288.716 - }
288.717 -
288.718 - case opc_getstatic:
288.719 - {
288.720 - // int.class compiles to getstatic Integer.TYPE
288.721 - int fieldi = i.u2At(1);
288.722 - char mark = poolMarks[fieldi];
288.723 - //System.err.println("getstatic "+fieldi+Arrays.asList(pool.getStrings(pool.getMemberRef((short)fieldi)))+mark);
288.724 - if (mark == 'J') {
288.725 - Short[] ref = pool.getMemberRef((short) fieldi);
288.726 - String name = pool.getString(CONSTANT_Utf8, ref[1]);
288.727 - if ("TYPE".equals(name)) {
288.728 - String wrapperName = pool.getString(CONSTANT_Class, ref[0]).replace('/', '.');
288.729 - // a primitive type descriptor
288.730 - Class<?> primClass;
288.731 - try {
288.732 - primClass = (Class<?>) Class.forName(wrapperName).getField(name).get(null);
288.733 - } catch (Exception ex) {
288.734 - throw new InternalError("cannot load "+wrapperName+"."+name);
288.735 - }
288.736 - jvm.push(primClass);
288.737 - break;
288.738 - }
288.739 - }
288.740 - // unknown field; keep going...
288.741 - jvm.push(UNKNOWN_CON);
288.742 - break;
288.743 - }
288.744 - case opc_putstatic:
288.745 - {
288.746 - if (patternMark != 'I') break decode;
288.747 - jvm.pop();
288.748 - // unknown field; keep going...
288.749 - break;
288.750 - }
288.751 -
288.752 - case opc_invokestatic:
288.753 - case opc_invokevirtual:
288.754 - case opc_invokespecial:
288.755 - {
288.756 - boolean hasRecv = (bc != opc_invokestatic);
288.757 - int methi = i.u2At(1);
288.758 - char mark = poolMarks[methi];
288.759 - Short[] ref = pool.getMemberRef((short)methi);
288.760 - String type = pool.getString(CONSTANT_Utf8, ref[2]);
288.761 - //System.out.println("invoke "+pool.getString(CONSTANT_Utf8, ref[1])+" "+Arrays.asList(ref)+" : "+type);
288.762 - args = jvm.args(hasRecv, type);
288.763 - String intrinsic = null;
288.764 - Constant con;
288.765 - if (mark == 'D' || mark == 'J') {
288.766 - intrinsic = pool.getString(CONSTANT_Utf8, ref[1]);
288.767 - if (mark == 'J') {
288.768 - String cls = pool.getString(CONSTANT_Class, ref[0]);
288.769 - cls = cls.substring(1+cls.lastIndexOf('/'));
288.770 - intrinsic = cls+"."+intrinsic;
288.771 - }
288.772 - //System.out.println("recognized intrinsic "+intrinsic);
288.773 - byte refKind = -1;
288.774 - switch (intrinsic) {
288.775 - case "findGetter": refKind = REF_getField; break;
288.776 - case "findStaticGetter": refKind = REF_getStatic; break;
288.777 - case "findSetter": refKind = REF_putField; break;
288.778 - case "findStaticSetter": refKind = REF_putStatic; break;
288.779 - case "findVirtual": refKind = REF_invokeVirtual; break;
288.780 - case "findStatic": refKind = REF_invokeStatic; break;
288.781 - case "findSpecial": refKind = REF_invokeSpecial; break;
288.782 - case "findConstructor": refKind = REF_newInvokeSpecial; break;
288.783 - }
288.784 - if (refKind >= 0 && (con = parseMemberLookup(refKind, args)) != null) {
288.785 - args.clear(); args.add(con);
288.786 - continue;
288.787 - }
288.788 - }
288.789 - Method ownMethod = null;
288.790 - if (mark == 'T' || mark == 'H' || mark == 'I') {
288.791 - ownMethod = findMember(cf.methods, ref[1], ref[2]);
288.792 - }
288.793 - //if (intrinsic != null) System.out.println("intrinsic = "+intrinsic);
288.794 - switch (intrinsic == null ? "" : intrinsic) {
288.795 - case "fromMethodDescriptorString":
288.796 - con = makeMethodTypeCon(args.get(0));
288.797 - args.clear(); args.add(con);
288.798 - continue;
288.799 - case "methodType": {
288.800 - flattenVarargs(args); // there are several overloadings, some with varargs
288.801 - StringBuilder buf = new StringBuilder();
288.802 - String rtype = null;
288.803 - for (Object typeArg : args) {
288.804 - if (typeArg instanceof Class) {
288.805 - Class<?> argClass = (Class<?>) typeArg;
288.806 - if (argClass.isPrimitive()) {
288.807 - char tchar;
288.808 - switch (argClass.getName()) {
288.809 - case "void": tchar = 'V'; break;
288.810 - case "boolean": tchar = 'Z'; break;
288.811 - case "byte": tchar = 'B'; break;
288.812 - case "char": tchar = 'C'; break;
288.813 - case "short": tchar = 'S'; break;
288.814 - case "int": tchar = 'I'; break;
288.815 - case "long": tchar = 'J'; break;
288.816 - case "float": tchar = 'F'; break;
288.817 - case "double": tchar = 'D'; break;
288.818 - default: throw new InternalError(argClass.toString());
288.819 - }
288.820 - buf.append(tchar);
288.821 - } else {
288.822 - // should not happen, but...
288.823 - buf.append('L').append(argClass.getName().replace('.','/')).append(';');
288.824 - }
288.825 - } else if (typeArg instanceof Constant) {
288.826 - Constant argCon = (Constant) typeArg;
288.827 - if (argCon.tag == CONSTANT_Class) {
288.828 - String cn = pool.get(argCon.itemIndex()).itemString();
288.829 - if (cn.endsWith(";"))
288.830 - buf.append(cn);
288.831 - else
288.832 - buf.append('L').append(cn).append(';');
288.833 - } else {
288.834 - break decode;
288.835 - }
288.836 - } else {
288.837 - break decode;
288.838 - }
288.839 - if (rtype == null) {
288.840 - // first arg is treated differently
288.841 - rtype = buf.toString();
288.842 - buf.setLength(0);
288.843 - buf.append('(');
288.844 - }
288.845 - }
288.846 - buf.append(')').append(rtype);
288.847 - con = con = makeMethodTypeCon(buf.toString());
288.848 - args.clear(); args.add(con);
288.849 - continue;
288.850 - }
288.851 - case "lookup":
288.852 - case "dynamicInvoker":
288.853 - args.clear(); args.add(intrinsic);
288.854 - continue;
288.855 - case "lookupClass":
288.856 - if (args.equals(Arrays.asList("lookup"))) {
288.857 - // fold lookup().lookupClass() to the enclosing class
288.858 - args.clear(); args.add(pool.get(cf.thisc));
288.859 - continue;
288.860 - }
288.861 - break;
288.862 - case "invokeGeneric":
288.863 - case "invokeWithArguments":
288.864 - if (patternMark != 'I') break decode;
288.865 - if ("invokeWithArguments".equals(intrinsic))
288.866 - flattenVarargs(args);
288.867 - bsmArgs = new ArrayList(args);
288.868 - args.clear(); args.add("invokeGeneric");
288.869 - continue;
288.870 - case "Integer.valueOf":
288.871 - case "Float.valueOf":
288.872 - case "Long.valueOf":
288.873 - case "Double.valueOf":
288.874 - removeEmptyJVMSlots(args);
288.875 - if (args.size() == 1) {
288.876 - arg = args.remove(0);
288.877 - assert(3456 == (CONSTANT_Integer*1000 + CONSTANT_Float*100 + CONSTANT_Long*10 + CONSTANT_Double));
288.878 - if (isConstant(arg, CONSTANT_Integer + "IFLD".indexOf(intrinsic.charAt(0)))
288.879 - || arg instanceof Number) {
288.880 - args.add(arg); continue;
288.881 - }
288.882 - }
288.883 - break decode;
288.884 - case "StringBuilder.append":
288.885 - // allow calls like ("value = "+x)
288.886 - removeEmptyJVMSlots(args);
288.887 - args.subList(1, args.size()).clear();
288.888 - continue;
288.889 - case "StringBuilder.toString":
288.890 - args.clear();
288.891 - args.add(intrinsic);
288.892 - continue;
288.893 - }
288.894 - if (!hasRecv && ownMethod != null && patternMark != 0) {
288.895 - con = constants.get(ownMethod);
288.896 - if (con == null) break decode;
288.897 - args.clear(); args.add(con);
288.898 - continue;
288.899 - } else if (type.endsWith(")V")) {
288.900 - // allow calls like println("reached the pattern method")
288.901 - args.clear();
288.902 - continue;
288.903 - }
288.904 - break decode; // bail out for most calls
288.905 - }
288.906 - case opc_areturn:
288.907 - {
288.908 - ++branchCount;
288.909 - if (bsmArgs != null) {
288.910 - // parse bsmArgs as (MH, lookup, String, MT, [extra])
288.911 - Constant indyCon = makeInvokeDynamicCon(bsmArgs);
288.912 - if (indyCon != null) {
288.913 - Constant typeCon = (Constant) bsmArgs.get(3);
288.914 - indySignatures.put(m, pool.getString(typeCon.itemIndex()));
288.915 - return indyCon;
288.916 - }
288.917 - System.err.println(m+": inscrutable bsm arguments: "+bsmArgs);
288.918 - break decode; // bail out
288.919 - }
288.920 - arg = jvm.pop();
288.921 - if (branchCount == 2 && UNKNOWN_CON.equals(arg))
288.922 - break; // merge to next path
288.923 - if (isConstant(arg, wantTag))
288.924 - return (Constant) arg;
288.925 - break decode; // bail out
288.926 - }
288.927 - default:
288.928 - if (jvm.stackMotion(i.bc)) break;
288.929 - if (bc >= opc_nconst_MIN && bc <= opc_nconst_MAX)
288.930 - { jvm.push(INSTRUCTION_CONSTANTS[bc - opc_nconst_MIN]); break; }
288.931 - if (patternMark == 'I') {
288.932 - // these support caching paths in INDY_x methods
288.933 - if (bc == opc_aload || bc >= opc_aload_0 && bc <= opc_aload_MAX)
288.934 - { jvm.push(UNKNOWN_CON); break; }
288.935 - if (bc == opc_astore || bc >= opc_astore_0 && bc <= opc_astore_MAX)
288.936 - { jvm.pop(); break; }
288.937 - switch (bc) {
288.938 - case opc_getfield:
288.939 - case opc_aaload:
288.940 - jvm.push(UNKNOWN_CON); break;
288.941 - case opc_ifnull:
288.942 - case opc_ifnonnull:
288.943 - // ignore branch target
288.944 - if (++branchCount != 1) break decode;
288.945 - jvm.pop();
288.946 - break;
288.947 - case opc_checkcast:
288.948 - arg = jvm.top();
288.949 - if ("invokeWithArguments".equals(arg) ||
288.950 - "invokeGeneric".equals(arg))
288.951 - break; // assume it is a helpful cast
288.952 - break decode;
288.953 - default:
288.954 - break decode; // bail out
288.955 - }
288.956 - continue decode; // go to next instruction
288.957 - }
288.958 - break decode; // bail out
288.959 - } //end switch
288.960 - }
288.961 - System.err.println(m+": bailout on "+i+" jvm stack: "+jvm.stack);
288.962 - return null;
288.963 - }
288.964 - private final String UNKNOWN_CON = "<unknown>";
288.965 -
288.966 - private void flattenVarargs(List<Object> args) {
288.967 - int size = args.size();
288.968 - if (size > 0 && args.get(size-1) instanceof List)
288.969 - args.addAll((List<Object>) args.remove(size-1));
288.970 - }
288.971 -
288.972 - private boolean isConstant(Object x, int tag) {
288.973 - return x instanceof Constant && ((Constant)x).tag == tag;
288.974 - }
288.975 - private Constant makeMethodTypeCon(Object x) {
288.976 - short utfIndex;
288.977 - if (x instanceof String)
288.978 - utfIndex = (short) cf.pool.addConstant(CONSTANT_Utf8, x).index;
288.979 - else if (isConstant(x, CONSTANT_String))
288.980 - utfIndex = ((Constant)x).itemIndex();
288.981 - else return null;
288.982 - return cf.pool.addConstant(CONSTANT_MethodType, utfIndex);
288.983 - }
288.984 - private Constant parseMemberLookup(byte refKind, List<Object> args) {
288.985 - // E.g.: lookup().findStatic(Foo.class, "name", MethodType)
288.986 - if (args.size() != 4) return null;
288.987 - int argi = 0;
288.988 - if (!"lookup".equals(args.get(argi++))) return null;
288.989 - short refindex, cindex, ntindex, nindex, tindex;
288.990 - Object con;
288.991 - if (!isConstant(con = args.get(argi++), CONSTANT_Class)) return null;
288.992 - cindex = (short)((Constant)con).index;
288.993 - if (!isConstant(con = args.get(argi++), CONSTANT_String)) return null;
288.994 - nindex = ((Constant)con).itemIndex();
288.995 - if (isConstant(con = args.get(argi++), CONSTANT_MethodType) ||
288.996 - isConstant(con, CONSTANT_Class)) {
288.997 - tindex = ((Constant)con).itemIndex();
288.998 - } else return null;
288.999 - ntindex = (short) cf.pool.addConstant(CONSTANT_NameAndType,
288.1000 - new Short[]{ nindex, tindex }).index;
288.1001 - byte reftag = CONSTANT_Method;
288.1002 - if (refKind <= REF_putStatic)
288.1003 - reftag = CONSTANT_Field;
288.1004 - else if (refKind == REF_invokeInterface)
288.1005 - reftag = CONSTANT_InterfaceMethod;
288.1006 - Constant ref = cf.pool.addConstant(reftag, new Short[]{ cindex, ntindex });
288.1007 - return cf.pool.addConstant(CONSTANT_MethodHandle, new Object[]{ refKind, (short)ref.index });
288.1008 - }
288.1009 - private Constant makeInvokeDynamicCon(List<Object> args) {
288.1010 - // E.g.: MH_bsm.invokeGeneric(lookup(), "name", MethodType, "extraArg")
288.1011 - removeEmptyJVMSlots(args);
288.1012 - if (args.size() != 4 && args.size() != 5) return null;
288.1013 - int argi = 0;
288.1014 - short nindex, tindex, ntindex, bsmindex;
288.1015 - Object con;
288.1016 - if (!isConstant(con = args.get(argi++), CONSTANT_MethodHandle)) return null;
288.1017 - bsmindex = (short) ((Constant)con).index;
288.1018 - if (!"lookup".equals(args.get(argi++))) return null;
288.1019 - if (!isConstant(con = args.get(argi++), CONSTANT_String)) return null;
288.1020 - nindex = ((Constant)con).itemIndex();
288.1021 - if (!isConstant(con = args.get(argi++), CONSTANT_MethodType)) return null;
288.1022 - tindex = ((Constant)con).itemIndex();
288.1023 - ntindex = (short) cf.pool.addConstant(CONSTANT_NameAndType,
288.1024 - new Short[]{ nindex, tindex }).index;
288.1025 - if (transitionalJSR292) {
288.1026 - if (argi != args.size()) {
288.1027 - System.err.println("BSM specifier has extra arguments but transitionalJSR292=1");
288.1028 - return null;
288.1029 - }
288.1030 - return cf.pool.addConstant(CONSTANT_InvokeDynamic_17,
288.1031 - new Short[]{ bsmindex, ntindex });
288.1032 - }
288.1033 - List<Object> extraArgs = Collections.emptyList();
288.1034 - if (argi < args.size()) {
288.1035 - Object arg = args.get(argi);
288.1036 - if (arg instanceof List)
288.1037 - extraArgs = (List<Object>) arg;
288.1038 - else
288.1039 - extraArgs = Arrays.asList(arg);
288.1040 - removeEmptyJVMSlots(args);
288.1041 - }
288.1042 - List<Short> extraArgIndexes = new CountedList<>(Short.class);
288.1043 - for (Object x : extraArgs) {
288.1044 - if (x instanceof Number) {
288.1045 - Object num = null; byte numTag = 0;
288.1046 - if (x instanceof Integer) { num = x; numTag = CONSTANT_Integer; }
288.1047 - if (x instanceof Float) { num = Float.floatToRawIntBits((Float)x); numTag = CONSTANT_Float; }
288.1048 - if (x instanceof Long) { num = x; numTag = CONSTANT_Long; }
288.1049 - if (x instanceof Double) { num = Double.doubleToRawLongBits((Double)x); numTag = CONSTANT_Double; }
288.1050 - if (num != null) x = cf.pool.addConstant(numTag, x);
288.1051 - }
288.1052 - if (!(x instanceof Constant)) return null;
288.1053 - extraArgIndexes.add((short) ((Constant)x).index);
288.1054 - }
288.1055 - List<Object[]> specs = bootstrapMethodSpecifiers(true);
288.1056 - int specindex = -1;
288.1057 - Object[] spec = new Object[]{ bsmindex, extraArgIndexes };
288.1058 - for (Object[] spec1 : specs) {
288.1059 - if (Arrays.equals(spec1, spec)) {
288.1060 - specindex = specs.indexOf(spec1);
288.1061 - if (verbose) System.err.println("reusing BSM specifier: "+spec1[0]+spec1[1]);
288.1062 - break;
288.1063 - }
288.1064 - }
288.1065 - if (specindex == -1) {
288.1066 - specindex = (short) specs.size();
288.1067 - specs.add(spec);
288.1068 - if (verbose) System.err.println("adding BSM specifier: "+spec[0]+spec[1]);
288.1069 - }
288.1070 - return cf.pool.addConstant(CONSTANT_InvokeDynamic,
288.1071 - new Short[]{ (short)specindex, ntindex });
288.1072 - }
288.1073 -
288.1074 - List<Object[]> bootstrapMethodSpecifiers(boolean createIfNotFound) {
288.1075 - Attr bsms = cf.findAttr("BootstrapMethods");
288.1076 - if (bsms == null) {
288.1077 - if (!createIfNotFound) return null;
288.1078 - bsms = new Attr(cf, "BootstrapMethods", new byte[]{0,0});
288.1079 - assert(bsms == cf.findAttr("BootstrapMethods"));
288.1080 - }
288.1081 - if (bsms.item instanceof byte[]) {
288.1082 - // unflatten
288.1083 - List<Object[]> specs = new CountedList<>(Object[].class);
288.1084 - DataInputStream in = new DataInputStream(new ByteArrayInputStream((byte[]) bsms.item));
288.1085 - try {
288.1086 - int len = (char) in.readShort();
288.1087 - for (int i = 0; i < len; i++) {
288.1088 - short bsm = in.readShort();
288.1089 - int argc = (char) in.readShort();
288.1090 - List<Short> argv = new CountedList<>(Short.class);
288.1091 - for (int j = 0; j < argc; j++)
288.1092 - argv.add(in.readShort());
288.1093 - specs.add(new Object[]{ bsm, argv });
288.1094 - }
288.1095 - } catch (IOException ex) { throw new InternalError(); }
288.1096 - bsms.item = specs;
288.1097 - }
288.1098 - return (List<Object[]>) bsms.item;
288.1099 - }
288.1100 - }
288.1101 -
288.1102 - private DataInputStream openInput(File f) throws IOException {
288.1103 - return new DataInputStream(new BufferedInputStream(new FileInputStream(f)));
288.1104 - }
288.1105 -
288.1106 - private DataOutputStream openOutput(File f) throws IOException {
288.1107 - if (!overwrite && f.exists())
288.1108 - throw new IOException("file already exists: "+f);
288.1109 - ensureDirectory(f.getParentFile());
288.1110 - return new DataOutputStream(new BufferedOutputStream(new FileOutputStream(f)));
288.1111 - }
288.1112 -
288.1113 - static byte[] readRawBytes(DataInputStream in, int size) throws IOException {
288.1114 - byte[] bytes = new byte[size];
288.1115 - int nr = in.read(bytes);
288.1116 - if (nr != size)
288.1117 - throw new InternalError("wrong size: "+nr);
288.1118 - return bytes;
288.1119 - }
288.1120 -
288.1121 - private interface Chunk {
288.1122 - void readFrom(DataInputStream in) throws IOException;
288.1123 - void writeTo(DataOutputStream out) throws IOException;
288.1124 - }
288.1125 -
288.1126 - private static class CountedList<T> extends ArrayList<T> implements Chunk {
288.1127 - final Class<? extends T> itemClass;
288.1128 - final int rowlen;
288.1129 - CountedList(Class<? extends T> itemClass, int rowlen) {
288.1130 - this.itemClass = itemClass;
288.1131 - this.rowlen = rowlen;
288.1132 - }
288.1133 - CountedList(Class<? extends T> itemClass) { this(itemClass, -1); }
288.1134 - public void readFrom(DataInputStream in) throws IOException {
288.1135 - int count = in.readUnsignedShort();
288.1136 - while (size() < count) {
288.1137 - if (rowlen < 0) {
288.1138 - add(readInput(in, itemClass));
288.1139 - } else {
288.1140 - Class<?> elemClass = itemClass.getComponentType();
288.1141 - Object[] row = (Object[]) java.lang.reflect.Array.newInstance(elemClass, rowlen);
288.1142 - for (int i = 0; i < rowlen; i++)
288.1143 - row[i] = readInput(in, elemClass);
288.1144 - add(itemClass.cast(row));
288.1145 - }
288.1146 - }
288.1147 - }
288.1148 - public void writeTo(DataOutputStream out) throws IOException {
288.1149 - out.writeShort((short)size());
288.1150 - for (T item : this) {
288.1151 - writeOutput(out, item);
288.1152 - }
288.1153 - }
288.1154 - }
288.1155 -
288.1156 - private static <T> T readInput(DataInputStream in, Class<T> dataClass) throws IOException {
288.1157 - Object data;
288.1158 - if (dataClass == Integer.class) {
288.1159 - data = in.readInt();
288.1160 - } else if (dataClass == Short.class) {
288.1161 - data = in.readShort();
288.1162 - } else if (dataClass == Byte.class) {
288.1163 - data = in.readByte();
288.1164 - } else if (dataClass == String.class) {
288.1165 - data = in.readUTF();
288.1166 - } else if (Chunk.class.isAssignableFrom(dataClass)) {
288.1167 - T obj;
288.1168 - try { obj = dataClass.newInstance(); }
288.1169 - catch (Exception ex) { throw new RuntimeException(ex); }
288.1170 - ((Chunk)obj).readFrom(in);
288.1171 - data = obj;
288.1172 - } else {
288.1173 - throw new InternalError("bad input datum: "+dataClass);
288.1174 - }
288.1175 - return dataClass.cast(data);
288.1176 - }
288.1177 - private static <T> T readInput(byte[] bytes, Class<T> dataClass) {
288.1178 - try {
288.1179 - return readInput(new DataInputStream(new ByteArrayInputStream(bytes)), dataClass);
288.1180 - } catch (IOException ex) {
288.1181 - throw new InternalError();
288.1182 - }
288.1183 - }
288.1184 - private static void readInputs(DataInputStream in, Object... data) throws IOException {
288.1185 - for (Object x : data) ((Chunk)x).readFrom(in);
288.1186 - }
288.1187 -
288.1188 - private static void writeOutput(DataOutputStream out, Object data) throws IOException {
288.1189 - if (data == null) {
288.1190 - return;
288.1191 - } if (data instanceof Integer) {
288.1192 - out.writeInt((Integer)data);
288.1193 - } else if (data instanceof Long) {
288.1194 - out.writeLong((Long)data);
288.1195 - } else if (data instanceof Short) {
288.1196 - out.writeShort((Short)data);
288.1197 - } else if (data instanceof Byte) {
288.1198 - out.writeByte((Byte)data);
288.1199 - } else if (data instanceof String) {
288.1200 - out.writeUTF((String)data);
288.1201 - } else if (data instanceof byte[]) {
288.1202 - out.write((byte[])data);
288.1203 - } else if (data instanceof Object[]) {
288.1204 - for (Object x : (Object[]) data)
288.1205 - writeOutput(out, x);
288.1206 - } else if (data instanceof Chunk) {
288.1207 - Chunk x = (Chunk) data;
288.1208 - x.writeTo(out);
288.1209 - } else if (data instanceof List) {
288.1210 - for (Object x : (List<?>) data)
288.1211 - writeOutput(out, x);
288.1212 - } else {
288.1213 - throw new InternalError("bad output datum: "+data+" : "+data.getClass().getName());
288.1214 - }
288.1215 - }
288.1216 - private static void writeOutputs(DataOutputStream out, Object... data) throws IOException {
288.1217 - for (Object x : data) writeOutput(out, x);
288.1218 - }
288.1219 -
288.1220 - public static abstract class Outer {
288.1221 - public abstract List<? extends Inner> inners();
288.1222 - protected void linkInners() {
288.1223 - for (Inner i : inners()) {
288.1224 - i.linkOuter(this);
288.1225 - if (i instanceof Outer)
288.1226 - ((Outer)i).linkInners();
288.1227 - }
288.1228 - }
288.1229 - public <T extends Outer> T outer(Class<T> c) {
288.1230 - for (Outer walk = this;; walk = ((Inner)walk).outer()) {
288.1231 - if (c.isInstance(walk))
288.1232 - return c.cast(walk);
288.1233 - //if (!(walk instanceof Inner)) return null;
288.1234 - }
288.1235 - }
288.1236 -
288.1237 - public abstract List<Attr> attrs();
288.1238 - public Attr findAttr(String name) {
288.1239 - return findAttr(outer(ClassFile.class).pool.stringIndex(name, false));
288.1240 - }
288.1241 - public Attr findAttr(int name) {
288.1242 - if (name == 0) return null;
288.1243 - for (Attr a : attrs()) {
288.1244 - if (a.name == name) return a;
288.1245 - }
288.1246 - return null;
288.1247 - }
288.1248 - }
288.1249 - public interface Inner { Outer outer(); void linkOuter(Outer o); }
288.1250 - public static abstract class InnerOuter extends Outer implements Inner {
288.1251 - public Outer outer;
288.1252 - public Outer outer() { return outer; }
288.1253 - public void linkOuter(Outer o) { assert(outer == null); outer = o; }
288.1254 - }
288.1255 - public static class Constant<T> implements Chunk {
288.1256 - public final byte tag;
288.1257 - public final T item;
288.1258 - public final int index;
288.1259 - public Constant(int index, byte tag, T item) {
288.1260 - this.index = index;
288.1261 - this.tag = tag;
288.1262 - this.item = item;
288.1263 - }
288.1264 - public Constant checkTag(byte tag) {
288.1265 - if (this.tag != tag) throw new InternalError(this.toString());
288.1266 - return this;
288.1267 - }
288.1268 - public String itemString() { return (String)item; }
288.1269 - public Short itemIndex() { return (Short)item; }
288.1270 - public Short[] itemIndexes() { return (Short[])item; }
288.1271 - public void readFrom(DataInputStream in) throws IOException {
288.1272 - throw new InternalError("do not call");
288.1273 - }
288.1274 - public void writeTo(DataOutputStream out) throws IOException {
288.1275 - writeOutputs(out, tag, item);
288.1276 - }
288.1277 - public boolean equals(Object x) { return (x instanceof Constant && equals((Constant)x)); }
288.1278 - public boolean equals(Constant that) {
288.1279 - return (this.tag == that.tag && this.itemAsComparable().equals(that.itemAsComparable()));
288.1280 - }
288.1281 - public int hashCode() { return (tag * 31) + this.itemAsComparable().hashCode(); }
288.1282 - public Object itemAsComparable() {
288.1283 - switch (tag) {
288.1284 - case CONSTANT_Double: return Double.longBitsToDouble((Long)item);
288.1285 - case CONSTANT_Float: return Float.intBitsToFloat((Integer)item);
288.1286 - }
288.1287 - return (item instanceof Object[] ? Arrays.asList((Object[])item) : item);
288.1288 - }
288.1289 - public String toString() {
288.1290 - String itstr = String.valueOf(itemAsComparable());
288.1291 - return (index + ":" + tagName(tag) + (itstr.startsWith("[")?"":"=") + itstr);
288.1292 - }
288.1293 - private static String[] TAG_NAMES;
288.1294 - public static String tagName(byte tag) { // used for error messages
288.1295 - if (TAG_NAMES == null)
288.1296 - TAG_NAMES = ("None Utf8 Unicode Integer Float Long Double Class String"
288.1297 - +" Fieldref Methodref InterfaceMethodref NameAndType #13 #14"
288.1298 - +" MethodHandle MethodType InvokeDynamic#17 InvokeDynamic").split(" ");
288.1299 - if ((tag & 0xFF) >= TAG_NAMES.length) return "#"+(tag & 0xFF);
288.1300 - return TAG_NAMES[tag & 0xFF];
288.1301 - }
288.1302 - }
288.1303 -
288.1304 - public static class Pool extends CountedList<Constant> implements Chunk {
288.1305 - private Map<String,Short> strings = new TreeMap<>();
288.1306 -
288.1307 - public Pool() {
288.1308 - super(Constant.class);
288.1309 - }
288.1310 - public void readFrom(DataInputStream in) throws IOException {
288.1311 - int count = in.readUnsignedShort();
288.1312 - add(null); // always ignore first item
288.1313 - while (size() < count) {
288.1314 - readConstant(in);
288.1315 - }
288.1316 - }
288.1317 - public <T> Constant<T> addConstant(byte tag, T item) {
288.1318 - Constant<T> con = new Constant<>(size(), tag, item);
288.1319 - int idx = indexOf(con);
288.1320 - if (idx >= 0) return get(idx);
288.1321 - add(con);
288.1322 - if (tag == CONSTANT_Utf8) strings.put((String)item, (short) con.index);
288.1323 - return con;
288.1324 - }
288.1325 - private void readConstant(DataInputStream in) throws IOException {
288.1326 - byte tag = in.readByte();
288.1327 - int index = size();
288.1328 - Object arg;
288.1329 - switch (tag) {
288.1330 - case CONSTANT_Utf8:
288.1331 - arg = in.readUTF();
288.1332 - strings.put((String) arg, (short) size());
288.1333 - break;
288.1334 - case CONSTANT_Integer:
288.1335 - case CONSTANT_Float:
288.1336 - arg = in.readInt(); break;
288.1337 - case CONSTANT_Long:
288.1338 - case CONSTANT_Double:
288.1339 - add(new Constant(index, tag, in.readLong()));
288.1340 - add(null);
288.1341 - return;
288.1342 - case CONSTANT_Class:
288.1343 - case CONSTANT_String:
288.1344 - arg = in.readShort(); break;
288.1345 - case CONSTANT_Field:
288.1346 - case CONSTANT_Method:
288.1347 - case CONSTANT_InterfaceMethod:
288.1348 - case CONSTANT_NameAndType:
288.1349 - case CONSTANT_InvokeDynamic_17:
288.1350 - case CONSTANT_InvokeDynamic:
288.1351 - // read an ordered pair
288.1352 - arg = new Short[] { in.readShort(), in.readShort() };
288.1353 - break;
288.1354 - case CONSTANT_MethodHandle:
288.1355 - // read an ordered pair; first part is a u1 (not u2)
288.1356 - arg = new Object[] { in.readByte(), in.readShort() };
288.1357 - break;
288.1358 - case CONSTANT_MethodType:
288.1359 - arg = in.readShort(); break;
288.1360 - default:
288.1361 - throw new InternalError("bad CP tag "+tag);
288.1362 - }
288.1363 - add(new Constant(index, tag, arg));
288.1364 - }
288.1365 -
288.1366 - // Access:
288.1367 - public Constant get(int index) {
288.1368 - // extra 1-bits get into the shorts
288.1369 - return super.get((char) index);
288.1370 - }
288.1371 - String getString(byte tag, short index) {
288.1372 - get(index).checkTag(tag);
288.1373 - return getString(index);
288.1374 - }
288.1375 - String getString(short index) {
288.1376 - Object v = get(index).item;
288.1377 - if (v instanceof Short)
288.1378 - v = get((Short)v).checkTag(CONSTANT_Utf8).item;
288.1379 - return (String) v;
288.1380 - }
288.1381 - String[] getStrings(Short[] indexes) {
288.1382 - String[] res = new String[indexes.length];
288.1383 - for (int i = 0; i < indexes.length; i++)
288.1384 - res[i] = getString(indexes[i]);
288.1385 - return res;
288.1386 - }
288.1387 - int stringIndex(String name, boolean createIfNotFound) {
288.1388 - Short x = strings.get(name);
288.1389 - if (x != null) return (char)(int) x;
288.1390 - if (!createIfNotFound) return 0;
288.1391 - return addConstant(CONSTANT_Utf8, name).index;
288.1392 - }
288.1393 - Short[] getMemberRef(short index) {
288.1394 - Short[] cls_nnt = get(index).itemIndexes();
288.1395 - Short[] name_type = get(cls_nnt[1]).itemIndexes();
288.1396 - return new Short[]{ cls_nnt[0], name_type[0], name_type[1] };
288.1397 - }
288.1398 - }
288.1399 -
288.1400 - public class ClassFile extends Outer implements Chunk {
288.1401 - ClassFile(File f) throws IOException {
288.1402 - DataInputStream in = openInput(f);
288.1403 - try {
288.1404 - readFrom(in);
288.1405 - } finally {
288.1406 - if (in != null) in.close();
288.1407 - }
288.1408 - }
288.1409 -
288.1410 - public int magic, version; // <min:maj>
288.1411 - public final Pool pool = new Pool();
288.1412 - public short access, thisc, superc;
288.1413 - public final List<Short> interfaces = new CountedList<>(Short.class);
288.1414 - public final List<Field> fields = new CountedList<>(Field.class);
288.1415 - public final List<Method> methods = new CountedList<>(Method.class);
288.1416 - public final List<Attr> attrs = new CountedList<>(Attr.class);
288.1417 -
288.1418 - public final void readFrom(DataInputStream in) throws IOException {
288.1419 - magic = in.readInt(); version = in.readInt();
288.1420 - if (magic != 0xCAFEBABE) throw new IOException("bad magic number");
288.1421 - pool.readFrom(in);
288.1422 - Code_index = pool.stringIndex("Code", false);
288.1423 - access = in.readShort(); thisc = in.readShort(); superc = in.readShort();
288.1424 - readInputs(in, interfaces, fields, methods, attrs);
288.1425 - if (in.read() >= 0) throw new IOException("junk after end of file");
288.1426 - linkInners();
288.1427 - }
288.1428 -
288.1429 - void writeTo(File f) throws IOException {
288.1430 - DataOutputStream out = openOutput(f);
288.1431 - try {
288.1432 - writeTo(out);
288.1433 - } finally {
288.1434 - out.close();
288.1435 - }
288.1436 - }
288.1437 -
288.1438 - public void writeTo(DataOutputStream out) throws IOException {
288.1439 - writeOutputs(out, magic, version, pool,
288.1440 - access, thisc, superc, interfaces,
288.1441 - fields, methods, attrs);
288.1442 - }
288.1443 -
288.1444 - public byte[] toByteArray() {
288.1445 - try {
288.1446 - ByteArrayOutputStream buf = new ByteArrayOutputStream();
288.1447 - writeTo(new DataOutputStream(buf));
288.1448 - return buf.toByteArray();
288.1449 - } catch (IOException ex) {
288.1450 - throw new InternalError();
288.1451 - }
288.1452 - }
288.1453 -
288.1454 - public List<Inner> inners() {
288.1455 - List<Inner> inns = new ArrayList<>();
288.1456 - inns.addAll(fields); inns.addAll(methods); inns.addAll(attrs);
288.1457 - return inns;
288.1458 - }
288.1459 - public List<Attr> attrs() { return attrs; }
288.1460 -
288.1461 - // derived stuff:
288.1462 - public String nameString() { return pool.getString(CONSTANT_Class, thisc); }
288.1463 - int Code_index;
288.1464 - }
288.1465 -
288.1466 - private static <T extends Member> T findMember(List<T> mems, int name, int type) {
288.1467 - if (name == 0 || type == 0) return null;
288.1468 - for (T m : mems) {
288.1469 - if (m.name == name && m.type == type) return m;
288.1470 - }
288.1471 - return null;
288.1472 - }
288.1473 -
288.1474 - public static class Member extends InnerOuter implements Chunk {
288.1475 - public short access, name, type;
288.1476 - public final List<Attr> attrs = new CountedList<>(Attr.class);
288.1477 - public void readFrom(DataInputStream in) throws IOException {
288.1478 - access = in.readShort(); name = in.readShort(); type = in.readShort();
288.1479 - readInputs(in, attrs);
288.1480 - }
288.1481 - public void writeTo(DataOutputStream out) throws IOException {
288.1482 - writeOutputs(out, access, name, type, attrs);
288.1483 - }
288.1484 - public List<Attr> inners() { return attrs; }
288.1485 - public List<Attr> attrs() { return attrs; }
288.1486 - public ClassFile outer() { return (ClassFile) outer; }
288.1487 - public String nameString() { return outer().pool.getString(CONSTANT_Utf8, name); }
288.1488 - public String typeString() { return outer().pool.getString(CONSTANT_Utf8, type); }
288.1489 - public String toString() {
288.1490 - if (outer == null) return super.toString();
288.1491 - return nameString() + (this instanceof Method ? "" : ":")
288.1492 - + simplifyType(typeString());
288.1493 - }
288.1494 - }
288.1495 - public static class Field extends Member {
288.1496 - }
288.1497 - public static class Method extends Member {
288.1498 - public Code code() {
288.1499 - Attr a = findAttr("Code");
288.1500 - if (a == null) return null;
288.1501 - return (Code) a.item;
288.1502 - }
288.1503 - public Instruction instructions() {
288.1504 - Code code = code();
288.1505 - if (code == null) return null;
288.1506 - return code.instructions();
288.1507 - }
288.1508 - }
288.1509 -
288.1510 - public static class Attr extends InnerOuter implements Chunk {
288.1511 - public short name;
288.1512 - public int size = -1; // no pre-declared size
288.1513 - public Object item;
288.1514 -
288.1515 - public Attr() {}
288.1516 - public Attr(Outer outer, String name, Object item) {
288.1517 - ClassFile cf = outer.outer(ClassFile.class);
288.1518 - linkOuter(outer);
288.1519 - this.name = (short) cf.pool.stringIndex(name, true);
288.1520 - this.item = item;
288.1521 - outer.attrs().add(this);
288.1522 - }
288.1523 - public void readFrom(DataInputStream in) throws IOException {
288.1524 - name = in.readShort();
288.1525 - size = in.readInt();
288.1526 - item = readRawBytes(in, size);
288.1527 - }
288.1528 - public void writeTo(DataOutputStream out) throws IOException {
288.1529 - out.writeShort(name);
288.1530 - // write the 4-byte size header and then the contents:
288.1531 - byte[] bytes;
288.1532 - int trueSize;
288.1533 - if (item instanceof byte[]) {
288.1534 - bytes = (byte[]) item;
288.1535 - out.writeInt(trueSize = bytes.length);
288.1536 - out.write(bytes);
288.1537 - } else {
288.1538 - trueSize = flatten(out);
288.1539 - //if (!(item instanceof Code)) System.err.println("wrote complex attr name="+(int)(char)name+" size="+trueSize+" data="+Arrays.toString(flatten()));
288.1540 - }
288.1541 - if (trueSize != size && size >= 0)
288.1542 - System.err.println("warning: attribute size changed "+size+" to "+trueSize);
288.1543 - }
288.1544 - public void linkOuter(Outer o) {
288.1545 - super.linkOuter(o);
288.1546 - if (item instanceof byte[] &&
288.1547 - outer instanceof Method &&
288.1548 - ((Method)outer).outer().Code_index == name) {
288.1549 - item = readInput((byte[])item, Code.class);
288.1550 - }
288.1551 - }
288.1552 - public List<Inner> inners() {
288.1553 - if (item instanceof Inner)
288.1554 - return Collections.nCopies(1, (Inner)item);
288.1555 - return Collections.emptyList();
288.1556 - }
288.1557 - public List<Attr> attrs() { return null; } // Code overrides this
288.1558 - public byte[] flatten() {
288.1559 - ByteArrayOutputStream buf = new ByteArrayOutputStream(Math.max(20, size));
288.1560 - flatten(buf);
288.1561 - return buf.toByteArray();
288.1562 - }
288.1563 - public int flatten(DataOutputStream out) throws IOException {
288.1564 - ByteArrayOutputStream buf = new ByteArrayOutputStream(Math.max(20, size));
288.1565 - int trueSize = flatten(buf);
288.1566 - out.writeInt(trueSize);
288.1567 - buf.writeTo(out);
288.1568 - return trueSize;
288.1569 - }
288.1570 - private int flatten(ByteArrayOutputStream buf) {
288.1571 - try {
288.1572 - writeOutput(new DataOutputStream(buf), item);
288.1573 - return buf.size();
288.1574 - } catch (IOException ex) {
288.1575 - throw new InternalError();
288.1576 - }
288.1577 - }
288.1578 - public String nameString() {
288.1579 - ClassFile cf = outer(ClassFile.class);
288.1580 - if (cf == null) return "#"+name;
288.1581 - return cf.pool.getString(name);
288.1582 - }
288.1583 - public String toString() {
288.1584 - return nameString()+(size < 0 ? "=" : "["+size+"]=")+item;
288.1585 - }
288.1586 - }
288.1587 -
288.1588 - public static class Code extends InnerOuter implements Chunk {
288.1589 - public short stacks, locals;
288.1590 - public byte[] bytes;
288.1591 - public final List<Short[]> etable = new CountedList<>(Short[].class, 4);
288.1592 - public final List<Attr> attrs = new CountedList<>(Attr.class);
288.1593 - // etable[N] = (N)*{ startpc, endpc, handlerpc, catchtype }
288.1594 - public void readFrom(DataInputStream in) throws IOException {
288.1595 - stacks = in.readShort(); locals = in.readShort();
288.1596 - bytes = readRawBytes(in, in.readInt());
288.1597 - readInputs(in, etable, attrs);
288.1598 - }
288.1599 - public void writeTo(DataOutputStream out) throws IOException {
288.1600 - writeOutputs(out, stacks, locals, bytes.length, bytes, etable, attrs);
288.1601 - }
288.1602 - public List<Attr> inners() { return attrs; }
288.1603 - public List<Attr> attrs() { return attrs; }
288.1604 - public Instruction instructions() {
288.1605 - return new Instruction(bytes, 0);
288.1606 - }
288.1607 - }
288.1608 -
288.1609 - // lots of constants
288.1610 - private static final byte
288.1611 - CONSTANT_Utf8 = 1,
288.1612 - CONSTANT_Integer = 3,
288.1613 - CONSTANT_Float = 4,
288.1614 - CONSTANT_Long = 5,
288.1615 - CONSTANT_Double = 6,
288.1616 - CONSTANT_Class = 7,
288.1617 - CONSTANT_String = 8,
288.1618 - CONSTANT_Field = 9,
288.1619 - CONSTANT_Method = 10,
288.1620 - CONSTANT_InterfaceMethod = 11,
288.1621 - CONSTANT_NameAndType = 12,
288.1622 - CONSTANT_MethodHandle = 15, // JSR 292
288.1623 - CONSTANT_MethodType = 16, // JSR 292
288.1624 - CONSTANT_InvokeDynamic_17 = 17, // JSR 292, only occurs in old class files
288.1625 - CONSTANT_InvokeDynamic = 18; // JSR 292
288.1626 - private static final byte
288.1627 - REF_getField = 1,
288.1628 - REF_getStatic = 2,
288.1629 - REF_putField = 3,
288.1630 - REF_putStatic = 4,
288.1631 - REF_invokeVirtual = 5,
288.1632 - REF_invokeStatic = 6,
288.1633 - REF_invokeSpecial = 7,
288.1634 - REF_newInvokeSpecial = 8,
288.1635 - REF_invokeInterface = 9;
288.1636 -
288.1637 - private static final int
288.1638 - opc_nop = 0,
288.1639 - opc_aconst_null = 1,
288.1640 - opc_nconst_MIN = 2, // iconst_m1
288.1641 - opc_nconst_MAX = 15, // dconst_1
288.1642 - opc_bipush = 16,
288.1643 - opc_sipush = 17,
288.1644 - opc_ldc = 18,
288.1645 - opc_ldc_w = 19,
288.1646 - opc_ldc2_w = 20,
288.1647 - opc_aload = 25,
288.1648 - opc_aload_0 = 42,
288.1649 - opc_aload_MAX = 45,
288.1650 - opc_aaload = 50,
288.1651 - opc_astore = 58,
288.1652 - opc_astore_0 = 75,
288.1653 - opc_astore_MAX = 78,
288.1654 - opc_aastore = 83,
288.1655 - opc_pop = 87,
288.1656 - opc_pop2 = 88,
288.1657 - opc_dup = 89,
288.1658 - opc_dup_x1 = 90,
288.1659 - opc_dup_x2 = 91,
288.1660 - opc_dup2 = 92,
288.1661 - opc_dup2_x1 = 93,
288.1662 - opc_dup2_x2 = 94,
288.1663 - opc_swap = 95,
288.1664 - opc_tableswitch = 170,
288.1665 - opc_lookupswitch = 171,
288.1666 - opc_areturn = 176,
288.1667 - opc_getstatic = 178,
288.1668 - opc_putstatic = 179,
288.1669 - opc_getfield = 180,
288.1670 - opc_putfield = 181,
288.1671 - opc_invokevirtual = 182,
288.1672 - opc_invokespecial = 183,
288.1673 - opc_invokestatic = 184,
288.1674 - opc_invokeinterface = 185,
288.1675 - opc_invokedynamic = 186,
288.1676 - opc_new = 187,
288.1677 - opc_anewarray = 189,
288.1678 - opc_checkcast = 192,
288.1679 - opc_ifnull = 198,
288.1680 - opc_ifnonnull = 199,
288.1681 - opc_wide = 196;
288.1682 -
288.1683 - private static final Object[] INSTRUCTION_CONSTANTS = {
288.1684 - -1, 0, 1, 2, 3, 4, 5, 0L, 1L, 0.0F, 1.0F, 2.0F, 0.0D, 1.0D
288.1685 - };
288.1686 -
288.1687 - private static final String INSTRUCTION_FORMATS =
288.1688 - "nop$ aconst_null$L iconst_m1$I iconst_0$I iconst_1$I "+
288.1689 - "iconst_2$I iconst_3$I iconst_4$I iconst_5$I lconst_0$J_ "+
288.1690 - "lconst_1$J_ fconst_0$F fconst_1$F fconst_2$F dconst_0$D_ "+
288.1691 - "dconst_1$D_ bipush=bx$I sipush=bxx$I ldc=bk$X ldc_w=bkk$X "+
288.1692 - "ldc2_w=bkk$X_ iload=bl/wbll$I lload=bl/wbll$J_ fload=bl/wbll$F "+
288.1693 - "dload=bl/wbll$D_ aload=bl/wbll$L iload_0$I iload_1$I "+
288.1694 - "iload_2$I iload_3$I lload_0$J_ lload_1$J_ lload_2$J_ "+
288.1695 - "lload_3$J_ fload_0$F fload_1$F fload_2$F fload_3$F dload_0$D_ "+
288.1696 - "dload_1$D_ dload_2$D_ dload_3$D_ aload_0$L aload_1$L "+
288.1697 - "aload_2$L aload_3$L iaload$LI$I laload$LI$J_ faload$LI$F "+
288.1698 - "daload$LI$D_ aaload$LI$L baload$LI$I caload$LI$I saload$LI$I "+
288.1699 - "istore=bl/wbll$I$ lstore=bl/wbll$J_$ fstore=bl/wbll$F$ "+
288.1700 - "dstore=bl/wbll$D_$ astore=bl/wbll$L$ istore_0$I$ istore_1$I$ "+
288.1701 - "istore_2$I$ istore_3$I$ lstore_0$J_$ lstore_1$J_$ "+
288.1702 - "lstore_2$J_$ lstore_3$J_$ fstore_0$F$ fstore_1$F$ fstore_2$F$ "+
288.1703 - "fstore_3$F$ dstore_0$D_$ dstore_1$D_$ dstore_2$D_$ "+
288.1704 - "dstore_3$D_$ astore_0$L$ astore_1$L$ astore_2$L$ astore_3$L$ "+
288.1705 - "iastore$LII$ lastore$LIJ_$ fastore$LIF$ dastore$LID_$ "+
288.1706 - "aastore$LIL$ bastore$LII$ castore$LII$ sastore$LII$ pop$X$ "+
288.1707 - "pop2$XX$ dup$X$XX dup_x1$XX$XXX dup_x2$XXX$XXXX dup2$XX$XXXX "+
288.1708 - "dup2_x1$XXX$XXXXX dup2_x2$XXXX$XXXXXX swap$XX$XX "+
288.1709 - "iadd$II$I ladd$J_J_$J_ fadd$FF$F dadd$D_D_$D_ isub$II$I "+
288.1710 - "lsub$J_J_$J_ fsub$FF$F dsub$D_D_$D_ imul$II$I lmul$J_J_$J_ "+
288.1711 - "fmul$FF$F dmul$D_D_$D_ idiv$II$I ldiv$J_J_$J_ fdiv$FF$F "+
288.1712 - "ddiv$D_D_$D_ irem$II$I lrem$J_J_$J_ frem$FF$F drem$D_D_$D_ "+
288.1713 - "ineg$I$I lneg$J_$J_ fneg$F$F dneg$D_$D_ ishl$II$I lshl$J_I$J_ "+
288.1714 - "ishr$II$I lshr$J_I$J_ iushr$II$I lushr$J_I$J_ iand$II$I "+
288.1715 - "land$J_J_$J_ ior$II$I lor$J_J_$J_ ixor$II$I lxor$J_J_$J_ "+
288.1716 - "iinc=blx/wbllxx$ i2l$I$J_ i2f$I$F i2d$I$D_ l2i$J_$I l2f$J_$F "+
288.1717 - "l2d$J_$D_ f2i$F$I f2l$F$J_ f2d$F$D_ d2i$D_$I d2l$D_$J_ "+
288.1718 - "d2f$D_$F i2b$I$I i2c$I$I i2s$I$I lcmp fcmpl fcmpg dcmpl dcmpg "+
288.1719 - "ifeq=boo ifne=boo iflt=boo ifge=boo ifgt=boo ifle=boo "+
288.1720 - "if_icmpeq=boo if_icmpne=boo if_icmplt=boo if_icmpge=boo "+
288.1721 - "if_icmpgt=boo if_icmple=boo if_acmpeq=boo if_acmpne=boo "+
288.1722 - "goto=boo jsr=boo ret=bl/wbll tableswitch=* lookupswitch=* "+
288.1723 - "ireturn lreturn freturn dreturn areturn return "+
288.1724 - "getstatic=bkf$Q putstatic=bkf$Q$ getfield=bkf$L$Q "+
288.1725 - "putfield=bkf$LQ$ invokevirtual=bkm$LQ$Q "+
288.1726 - "invokespecial=bkm$LQ$Q invokestatic=bkm$Q$Q "+
288.1727 - "invokeinterface=bkixx$LQ$Q invokedynamic=bkd__$Q$Q new=bkc$L "+
288.1728 - "newarray=bx$I$L anewarray=bkc$I$L arraylength$L$I athrow "+
288.1729 - "checkcast=bkc$L$L instanceof=bkc$L$I monitorenter$L "+
288.1730 - "monitorexit$L wide=* multianewarray=bkcx ifnull=boo "+
288.1731 - "ifnonnull=boo goto_w=boooo jsr_w=boooo ";
288.1732 - private static final String[] INSTRUCTION_NAMES;
288.1733 - private static final String[] INSTRUCTION_POPS;
288.1734 - private static final int[] INSTRUCTION_INFO;
288.1735 - static {
288.1736 - String[] insns = INSTRUCTION_FORMATS.split(" ");
288.1737 - assert(insns[opc_lookupswitch].startsWith("lookupswitch"));
288.1738 - assert(insns[opc_tableswitch].startsWith("tableswitch"));
288.1739 - assert(insns[opc_wide].startsWith("wide"));
288.1740 - assert(insns[opc_invokedynamic].startsWith("invokedynamic"));
288.1741 - int[] info = new int[256];
288.1742 - String[] names = new String[256];
288.1743 - String[] pops = new String[256];
288.1744 - for (int i = 0; i < insns.length; i++) {
288.1745 - String insn = insns[i];
288.1746 - int dl = insn.indexOf('$');
288.1747 - if (dl > 0) {
288.1748 - String p = insn.substring(dl+1);
288.1749 - if (p.indexOf('$') < 0) p = "$" + p;
288.1750 - pops[i] = p;
288.1751 - insn = insn.substring(0, dl);
288.1752 - }
288.1753 - int eq = insn.indexOf('=');
288.1754 - if (eq < 0) {
288.1755 - info[i] = 1;
288.1756 - names[i] = insn;
288.1757 - continue;
288.1758 - }
288.1759 - names[i] = insn.substring(0, eq);
288.1760 - String fmt = insn.substring(eq+1);
288.1761 - if (fmt.equals("*")) {
288.1762 - info[i] = 0;
288.1763 - continue;
288.1764 - }
288.1765 - int sl = fmt.indexOf('/');
288.1766 - if (sl < 0) {
288.1767 - info[i] = (char) fmt.length();
288.1768 - } else {
288.1769 - String wfmt = fmt.substring(sl+1);
288.1770 - fmt = fmt.substring(0, sl);
288.1771 - info[i] = (char)( fmt.length() + (wfmt.length() * 16) );
288.1772 - }
288.1773 - }
288.1774 - INSTRUCTION_INFO = info;
288.1775 - INSTRUCTION_NAMES = names;
288.1776 - INSTRUCTION_POPS = pops;
288.1777 - }
288.1778 -
288.1779 - public static class Instruction implements Cloneable {
288.1780 - byte[] codeBase;
288.1781 - int pc;
288.1782 - int bc;
288.1783 - int info;
288.1784 - int wide;
288.1785 - int len;
288.1786 - Instruction(byte[] codeBase, int pc) {
288.1787 - this.codeBase = codeBase;
288.1788 - init(pc);
288.1789 - }
288.1790 - public Instruction clone() {
288.1791 - try {
288.1792 - return (Instruction) super.clone();
288.1793 - } catch (CloneNotSupportedException ex) {
288.1794 - throw new InternalError();
288.1795 - }
288.1796 - }
288.1797 - private Instruction init(int pc) {
288.1798 - this.pc = pc;
288.1799 - this.bc = codeBase[pc] & 0xFF;
288.1800 - this.info = INSTRUCTION_INFO[bc];
288.1801 - this.wide = 0;
288.1802 - this.len = (info & 0x0F);
288.1803 - if (len == 0)
288.1804 - computeLength();
288.1805 - return this;
288.1806 - }
288.1807 - Instruction next() {
288.1808 - if (len == 0 && bc != 0) throw new InternalError();
288.1809 - int npc = pc + len;
288.1810 - if (npc == codeBase.length)
288.1811 - return null;
288.1812 - return init(npc);
288.1813 - }
288.1814 - void forceNext(int newLen) {
288.1815 - bc = opc_nop;
288.1816 - len = newLen;
288.1817 - }
288.1818 -
288.1819 - public String toString() {
288.1820 - StringBuilder buf = new StringBuilder();
288.1821 - buf.append(pc).append(":").append(INSTRUCTION_NAMES[bc]);
288.1822 - switch (len) {
288.1823 - case 3: buf.append(" ").append(u2At(1)); break;
288.1824 - case 5: buf.append(" ").append(u2At(1)).append(" ").append(u2At(3)); break;
288.1825 - default: for (int i = 1; i < len; i++) buf.append(" ").append(u1At(1));
288.1826 - }
288.1827 - return buf.toString();
288.1828 - }
288.1829 -
288.1830 - // these are the hard parts
288.1831 - private void computeLength() {
288.1832 - int cases;
288.1833 - switch (bc) {
288.1834 - case opc_wide:
288.1835 - bc = codeBase[pc + 1];
288.1836 - info = INSTRUCTION_INFO[bc];
288.1837 - len = ((info >> 4) & 0x0F);
288.1838 - if (len == 0) throw new RuntimeException("misplaced wide bytecode: "+bc);
288.1839 - return;
288.1840 -
288.1841 - case opc_tableswitch:
288.1842 - cases = (u4At(alignedIntOffset(2)) - u4At(alignedIntOffset(1)) + 1);
288.1843 - len = alignedIntOffset(3 + cases*1);
288.1844 - return;
288.1845 -
288.1846 - case opc_lookupswitch:
288.1847 - cases = u4At(alignedIntOffset(1));
288.1848 - len = alignedIntOffset(2 + cases*2);
288.1849 - return;
288.1850 -
288.1851 - default:
288.1852 - throw new RuntimeException("unknown bytecode: "+bc);
288.1853 - }
288.1854 - }
288.1855 - // switch code
288.1856 - // clget the Nth int (where 0 is the first after the opcode itself)
288.1857 - public int alignedIntOffset(int n) {
288.1858 - int pos = pc + 1;
288.1859 - pos += ((-pos) & 0x03); // align it
288.1860 - pos += (n * 4);
288.1861 - return pos - pc;
288.1862 - }
288.1863 - public int u1At(int pos) {
288.1864 - return (codeBase[pc+pos] & 0xFF);
288.1865 - }
288.1866 - public int u2At(int pos) {
288.1867 - return (u1At(pos+0)<<8) + u1At(pos+1);
288.1868 - }
288.1869 - public int u4At(int pos) {
288.1870 - return (u2At(pos+0)<<16) + u2At(pos+2);
288.1871 - }
288.1872 - public void u1AtPut(int pos, int x) {
288.1873 - codeBase[pc+pos] = (byte)x;
288.1874 - }
288.1875 - public void u2AtPut(int pos, int x) {
288.1876 - codeBase[pc+pos+0] = (byte)(x >> 8);
288.1877 - codeBase[pc+pos+1] = (byte)(x >> 0);
288.1878 - }
288.1879 - }
288.1880 -
288.1881 - static String simplifyType(String type) {
288.1882 - String simpleType = OBJ_SIGNATURE.matcher(type).replaceAll("L");
288.1883 - assert(simpleType.matches("^\\([A-Z]*\\)[A-Z]$"));
288.1884 - // change (DD)D to (D_D_)D_
288.1885 - simpleType = WIDE_SIGNATURE.matcher(simpleType).replaceAll("\\0_");
288.1886 - return simpleType;
288.1887 - }
288.1888 - static int argsize(String type) {
288.1889 - return simplifyType(type).length()-3;
288.1890 - }
288.1891 - private static final Pattern OBJ_SIGNATURE = Pattern.compile("\\[*L[^;]*;|\\[+[A-Z]");
288.1892 - private static final Pattern WIDE_SIGNATURE = Pattern.compile("[JD]");
288.1893 -}
289.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
289.2 +++ b/test/java/lang/invoke/6987555/Test6987555.java Tue Mar 29 20:19:55 2011 -0700
289.3 @@ -0,0 +1,177 @@
289.4 +/*
289.5 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
289.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
289.7 + *
289.8 + * This code is free software; you can redistribute it and/or modify it
289.9 + * under the terms of the GNU General Public License version 2 only, as
289.10 + * published by the Free Software Foundation.
289.11 + *
289.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
289.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
289.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
289.15 + * version 2 for more details (a copy is included in the LICENSE file that
289.16 + * accompanied this code).
289.17 + *
289.18 + * You should have received a copy of the GNU General Public License version
289.19 + * 2 along with this work; if not, write to the Free Software Foundation,
289.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
289.21 + *
289.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
289.23 + * or visit www.oracle.com if you need additional information or have any
289.24 + * questions.
289.25 + *
289.26 + */
289.27 +
289.28 +/**
289.29 + * @test
289.30 + * @bug 6987555
289.31 + * @summary JSR 292 unboxing to a boolean value fails on big-endian SPARC
289.32 + *
289.33 + * @run main/othervm -Xint -ea -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles -XX:+EnableInvokeDynamic -XX:+UnlockDiagnosticVMOptions -XX:+VerifyMethodHandles Test6987555
289.34 + */
289.35 +
289.36 +import java.lang.invoke.*;
289.37 +
289.38 +public class Test6987555 {
289.39 + private static final Class CLASS = Test6987555.class;
289.40 + private static final String NAME = "foo";
289.41 + private static final boolean DEBUG = false;
289.42 +
289.43 + public static void main(String[] args) throws Throwable {
289.44 + testboolean();
289.45 + testbyte();
289.46 + testchar();
289.47 + testshort();
289.48 + testint();
289.49 + }
289.50 +
289.51 + // boolean
289.52 + static void testboolean() throws Throwable {
289.53 + doboolean(false);
289.54 + doboolean(true);
289.55 + }
289.56 + static void doboolean(boolean x) throws Throwable {
289.57 + if (DEBUG) System.out.println("boolean=" + x);
289.58 + MethodHandle mh1 = MethodHandles.lookup().findStatic(CLASS, NAME, MethodType.methodType(boolean.class, boolean.class));
289.59 + MethodHandle mh2 = mh1.asType(MethodType.methodType(boolean.class, Boolean.class));
289.60 + boolean a = (boolean) mh1.invokeExact(x);
289.61 + boolean b = (boolean) mh2.invokeExact(Boolean.valueOf(x));
289.62 + assert a == b : a + " != " + b;
289.63 + }
289.64 +
289.65 + // byte
289.66 + static void testbyte() throws Throwable {
289.67 + byte[] a = new byte[] {
289.68 + Byte.MIN_VALUE,
289.69 + Byte.MIN_VALUE + 1,
289.70 + -0x0F,
289.71 + -1,
289.72 + 0,
289.73 + 1,
289.74 + 0x0F,
289.75 + Byte.MAX_VALUE - 1,
289.76 + Byte.MAX_VALUE
289.77 + };
289.78 + for (int i = 0; i < a.length; i++) {
289.79 + dobyte(a[i]);
289.80 + }
289.81 + }
289.82 + static void dobyte(byte x) throws Throwable {
289.83 + if (DEBUG) System.out.println("byte=" + x);
289.84 + MethodHandle mh1 = MethodHandles.lookup().findStatic(CLASS, NAME, MethodType.methodType(byte.class, byte.class));
289.85 + MethodHandle mh2 = mh1.asType(MethodType.methodType(byte.class, Byte.class));
289.86 + byte a = (byte) mh1.invokeExact(x);
289.87 + byte b = (byte) mh2.invokeExact(Byte.valueOf(x));
289.88 + assert a == b : a + " != " + b;
289.89 + }
289.90 +
289.91 + // char
289.92 + static void testchar() throws Throwable {
289.93 + char[] a = new char[] {
289.94 + Character.MIN_VALUE,
289.95 + Character.MIN_VALUE + 1,
289.96 + 0x000F,
289.97 + 0x00FF,
289.98 + 0x0FFF,
289.99 + Character.MAX_VALUE - 1,
289.100 + Character.MAX_VALUE
289.101 + };
289.102 + for (int i = 0; i < a.length; i++) {
289.103 + dochar(a[i]);
289.104 + }
289.105 + }
289.106 + static void dochar(char x) throws Throwable {
289.107 + if (DEBUG) System.out.println("char=" + x);
289.108 + MethodHandle mh1 = MethodHandles.lookup().findStatic(CLASS, NAME, MethodType.methodType(char.class, char.class));
289.109 + MethodHandle mh2 = mh1.asType(MethodType.methodType(char.class, Character.class));
289.110 + char a = (char) mh1.invokeExact(x);
289.111 + char b = (char) mh2.invokeExact(Character.valueOf(x));
289.112 + assert a == b : a + " != " + b;
289.113 + }
289.114 +
289.115 + // short
289.116 + static void testshort() throws Throwable {
289.117 + short[] a = new short[] {
289.118 + Short.MIN_VALUE,
289.119 + Short.MIN_VALUE + 1,
289.120 + -0x0FFF,
289.121 + -0x00FF,
289.122 + -0x000F,
289.123 + -1,
289.124 + 0,
289.125 + 1,
289.126 + 0x000F,
289.127 + 0x00FF,
289.128 + 0x0FFF,
289.129 + Short.MAX_VALUE - 1,
289.130 + Short.MAX_VALUE
289.131 + };
289.132 + for (int i = 0; i < a.length; i++) {
289.133 + doshort(a[i]);
289.134 + }
289.135 + }
289.136 + static void doshort(short x) throws Throwable {
289.137 + if (DEBUG) System.out.println("short=" + x);
289.138 + MethodHandle mh1 = MethodHandles.lookup().findStatic(CLASS, NAME, MethodType.methodType(short.class, short.class));
289.139 + MethodHandle mh2 = mh1.asType(MethodType.methodType(short.class, Short.class));
289.140 + short a = (short) mh1.invokeExact(x);
289.141 + short b = (short) mh2.invokeExact(Short.valueOf(x));
289.142 + assert a == b : a + " != " + b;
289.143 + }
289.144 +
289.145 + // int
289.146 + static void testint() throws Throwable {
289.147 + int[] a = new int[] {
289.148 + Integer.MIN_VALUE,
289.149 + Integer.MIN_VALUE + 1,
289.150 + -0x00000FFF,
289.151 + -0x000000FF,
289.152 + -0x0000000F,
289.153 + -1,
289.154 + 0,
289.155 + 1,
289.156 + 0x0000000F,
289.157 + 0x000000FF,
289.158 + 0x00000FFF,
289.159 + Integer.MAX_VALUE - 1,
289.160 + Integer.MAX_VALUE
289.161 + };
289.162 + for (int i = 0; i < a.length; i++) {
289.163 + doint(a[i]);
289.164 + }
289.165 + }
289.166 + static void doint(int x) throws Throwable {
289.167 + if (DEBUG) System.out.println("int=" + x);
289.168 + MethodHandle mh1 = MethodHandles.lookup().findStatic(CLASS, NAME, MethodType.methodType(int.class, int.class));
289.169 + MethodHandle mh2 = mh1.asType(MethodType.methodType(int.class, Integer.class));
289.170 + int a = (int) mh1.invokeExact(x);
289.171 + int b = (int) mh2.invokeExact(Integer.valueOf(x));
289.172 + assert a == b : a + " != " + b;
289.173 + }
289.174 +
289.175 + public static boolean foo(boolean i) { return i; }
289.176 + public static byte foo(byte i) { return i; }
289.177 + public static char foo(char i) { return i; }
289.178 + public static short foo(short i) { return i; }
289.179 + public static int foo(int i) { return i; }
289.180 +}
290.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
290.2 +++ b/test/java/lang/invoke/6991596/Test6991596.java Tue Mar 29 20:19:55 2011 -0700
290.3 @@ -0,0 +1,465 @@
290.4 +/*
290.5 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
290.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
290.7 + *
290.8 + * This code is free software; you can redistribute it and/or modify it
290.9 + * under the terms of the GNU General Public License version 2 only, as
290.10 + * published by the Free Software Foundation.
290.11 + *
290.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
290.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
290.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
290.15 + * version 2 for more details (a copy is included in the LICENSE file that
290.16 + * accompanied this code).
290.17 + *
290.18 + * You should have received a copy of the GNU General Public License version
290.19 + * 2 along with this work; if not, write to the Free Software Foundation,
290.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
290.21 + *
290.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
290.23 + * or visit www.oracle.com if you need additional information or have any
290.24 + * questions.
290.25 + *
290.26 + */
290.27 +
290.28 +/**
290.29 + * @test
290.30 + * @bug 6991596
290.31 + * @summary JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
290.32 + *
290.33 + * @run main/othervm -ea -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles -XX:+EnableInvokeDynamic -XX:+UnlockDiagnosticVMOptions -XX:+VerifyMethodHandles Test6991596
290.34 + */
290.35 +
290.36 +import java.lang.invoke.*;
290.37 +
290.38 +public class Test6991596 {
290.39 + private static final Class CLASS = Test6991596.class;
290.40 + private static final String NAME = "foo";
290.41 + private static final boolean DEBUG = System.getProperty("DEBUG", "false").equals("true");
290.42 +
290.43 + public static void main(String[] args) throws Throwable {
290.44 + testboolean();
290.45 + testbyte();
290.46 + testchar();
290.47 + testshort();
290.48 + testint();
290.49 + testlong();
290.50 + }
290.51 +
290.52 + // Helpers to get various methods.
290.53 + static MethodHandle getmh1(Class ret, Class arg) throws ReflectiveOperationException {
290.54 + return MethodHandles.lookup().findStatic(CLASS, NAME, MethodType.methodType(ret, arg));
290.55 + }
290.56 + static MethodHandle getmh2(MethodHandle mh1, Class ret, Class arg) {
290.57 + return MethodHandles.convertArguments(mh1, MethodType.methodType(ret, arg));
290.58 + }
290.59 + static MethodHandle getmh3(MethodHandle mh1, Class ret, Class arg) {
290.60 + return MethodHandles.convertArguments(mh1, MethodType.methodType(ret, arg));
290.61 + }
290.62 +
290.63 + // test adapter_opt_i2i
290.64 + static void testboolean() throws Throwable {
290.65 + boolean[] a = new boolean[] {
290.66 + true,
290.67 + false
290.68 + };
290.69 + for (int i = 0; i < a.length; i++) {
290.70 + doboolean(a[i]);
290.71 + }
290.72 + }
290.73 + static void doboolean(boolean x) throws Throwable {
290.74 + if (DEBUG) System.out.println("boolean=" + x);
290.75 +
290.76 + // boolean
290.77 + {
290.78 + MethodHandle mh1 = getmh1( boolean.class, boolean.class);
290.79 + MethodHandle mh2 = getmh2(mh1, boolean.class, boolean.class);
290.80 + // TODO add this for all cases when the bugs are fixed.
290.81 + //MethodHandle mh3 = getmh3(mh1, boolean.class, boolean.class);
290.82 + boolean a = (boolean) mh1.invokeExact((boolean) x);
290.83 + boolean b = (boolean) mh2.invokeExact(x);
290.84 + //boolean c = mh3.<boolean>invokeExact((boolean) x);
290.85 + check(x, a, b);
290.86 + //check(x, c, x);
290.87 + }
290.88 +
290.89 + // byte
290.90 + {
290.91 + MethodHandle mh1 = getmh1( byte.class, byte.class );
290.92 + MethodHandle mh2 = getmh2(mh1, byte.class, boolean.class);
290.93 + byte a = (byte) mh1.invokeExact((byte) (x ? 1 : 0));
290.94 + byte b = (byte) mh2.invokeExact(x);
290.95 + check(x, a, b);
290.96 + }
290.97 +
290.98 + // char
290.99 + {
290.100 + MethodHandle mh1 = getmh1( char.class, char.class);
290.101 + MethodHandle mh2 = getmh2(mh1, char.class, boolean.class);
290.102 + char a = (char) mh1.invokeExact((char) (x ? 1 : 0));
290.103 + char b = (char) mh2.invokeExact(x);
290.104 + check(x, a, b);
290.105 + }
290.106 +
290.107 + // short
290.108 + {
290.109 + MethodHandle mh1 = getmh1( short.class, short.class);
290.110 + MethodHandle mh2 = getmh2(mh1, short.class, boolean.class);
290.111 + short a = (short) mh1.invokeExact((short) (x ? 1 : 0));
290.112 + short b = (short) mh2.invokeExact(x);
290.113 + check(x, a, b);
290.114 + }
290.115 + }
290.116 +
290.117 + static void testbyte() throws Throwable {
290.118 + byte[] a = new byte[] {
290.119 + Byte.MIN_VALUE,
290.120 + Byte.MIN_VALUE + 1,
290.121 + -0x0F,
290.122 + -1,
290.123 + 0,
290.124 + 1,
290.125 + 0x0F,
290.126 + Byte.MAX_VALUE - 1,
290.127 + Byte.MAX_VALUE
290.128 + };
290.129 + for (int i = 0; i < a.length; i++) {
290.130 + dobyte(a[i]);
290.131 + }
290.132 + }
290.133 + static void dobyte(byte x) throws Throwable {
290.134 + if (DEBUG) System.out.println("byte=" + x);
290.135 +
290.136 + // boolean
290.137 + {
290.138 + MethodHandle mh1 = getmh1( boolean.class, boolean.class);
290.139 + MethodHandle mh2 = getmh2(mh1, boolean.class, byte.class);
290.140 + boolean a = (boolean) mh1.invokeExact((x & 1) == 1);
290.141 + boolean b = (boolean) mh2.invokeExact(x);
290.142 + check(x, a, b);
290.143 + }
290.144 +
290.145 + // byte
290.146 + {
290.147 + MethodHandle mh1 = getmh1( byte.class, byte.class);
290.148 + MethodHandle mh2 = getmh2(mh1, byte.class, byte.class);
290.149 + byte a = (byte) mh1.invokeExact((byte) x);
290.150 + byte b = (byte) mh2.invokeExact(x);
290.151 + check(x, a, b);
290.152 + }
290.153 +
290.154 + // char
290.155 + {
290.156 + MethodHandle mh1 = getmh1( char.class, char.class);
290.157 + MethodHandle mh2 = getmh2(mh1, char.class, byte.class);
290.158 + char a = (char) mh1.invokeExact((char) x);
290.159 + char b = (char) mh2.invokeExact(x);
290.160 + check(x, a, b);
290.161 + }
290.162 +
290.163 + // short
290.164 + {
290.165 + MethodHandle mh1 = getmh1( short.class, short.class);
290.166 + MethodHandle mh2 = getmh2(mh1, short.class, byte.class);
290.167 + short a = (short) mh1.invokeExact((short) x);
290.168 + short b = (short) mh2.invokeExact(x);
290.169 + check(x, a, b);
290.170 + }
290.171 + }
290.172 +
290.173 + static void testchar() throws Throwable {
290.174 + char[] a = new char[] {
290.175 + Character.MIN_VALUE,
290.176 + Character.MIN_VALUE + 1,
290.177 + 0x000F,
290.178 + 0x00FF,
290.179 + 0x0FFF,
290.180 + Character.MAX_VALUE - 1,
290.181 + Character.MAX_VALUE
290.182 + };
290.183 + for (int i = 0; i < a.length; i++) {
290.184 + dochar(a[i]);
290.185 + }
290.186 + }
290.187 + static void dochar(char x) throws Throwable {
290.188 + if (DEBUG) System.out.println("char=" + x);
290.189 +
290.190 + // boolean
290.191 + {
290.192 + MethodHandle mh1 = getmh1( boolean.class, boolean.class);
290.193 + MethodHandle mh2 = getmh2(mh1, boolean.class, char.class);
290.194 + boolean a = (boolean) mh1.invokeExact((x & 1) == 1);
290.195 + boolean b = (boolean) mh2.invokeExact(x);
290.196 + check(x, a, b);
290.197 + }
290.198 +
290.199 + // byte
290.200 + {
290.201 + MethodHandle mh1 = getmh1( byte.class, byte.class);
290.202 + MethodHandle mh2 = getmh2(mh1, byte.class, char.class);
290.203 + byte a = (byte) mh1.invokeExact((byte) x);
290.204 + byte b = (byte) mh2.invokeExact(x);
290.205 + check(x, a, b);
290.206 + }
290.207 +
290.208 + // char
290.209 + {
290.210 + MethodHandle mh1 = getmh1( char.class, char.class);
290.211 + MethodHandle mh2 = getmh2(mh1, char.class, char.class);
290.212 + char a = (char) mh1.invokeExact((char) x);
290.213 + char b = (char) mh2.invokeExact(x);
290.214 + check(x, a, b);
290.215 + }
290.216 +
290.217 + // short
290.218 + {
290.219 + MethodHandle mh1 = getmh1( short.class, short.class);
290.220 + MethodHandle mh2 = getmh2(mh1, short.class, char.class);
290.221 + short a = (short) mh1.invokeExact((short) x);
290.222 + short b = (short) mh2.invokeExact(x);
290.223 + check(x, a, b);
290.224 + }
290.225 + }
290.226 +
290.227 + static void testshort() throws Throwable {
290.228 + short[] a = new short[] {
290.229 + Short.MIN_VALUE,
290.230 + Short.MIN_VALUE + 1,
290.231 + -0x0FFF,
290.232 + -0x00FF,
290.233 + -0x000F,
290.234 + -1,
290.235 + 0,
290.236 + 1,
290.237 + 0x000F,
290.238 + 0x00FF,
290.239 + 0x0FFF,
290.240 + Short.MAX_VALUE - 1,
290.241 + Short.MAX_VALUE
290.242 + };
290.243 + for (int i = 0; i < a.length; i++) {
290.244 + doshort(a[i]);
290.245 + }
290.246 + }
290.247 + static void doshort(short x) throws Throwable {
290.248 + if (DEBUG) System.out.println("short=" + x);
290.249 +
290.250 + // boolean
290.251 + {
290.252 + MethodHandle mh1 = getmh1( boolean.class, boolean.class);
290.253 + MethodHandle mh2 = getmh2(mh1, boolean.class, short.class);
290.254 + boolean a = (boolean) mh1.invokeExact((x & 1) == 1);
290.255 + boolean b = (boolean) mh2.invokeExact(x);
290.256 + check(x, a, b);
290.257 + }
290.258 +
290.259 + // byte
290.260 + {
290.261 + MethodHandle mh1 = getmh1( byte.class, byte.class);
290.262 + MethodHandle mh2 = getmh2(mh1, byte.class, short.class);
290.263 + byte a = (byte) mh1.invokeExact((byte) x);
290.264 + byte b = (byte) mh2.invokeExact(x);
290.265 + check(x, a, b);
290.266 + }
290.267 +
290.268 + // char
290.269 + {
290.270 + MethodHandle mh1 = getmh1( char.class, char.class);
290.271 + MethodHandle mh2 = getmh2(mh1, char.class, short.class);
290.272 + char a = (char) mh1.invokeExact((char) x);
290.273 + char b = (char) mh2.invokeExact(x);
290.274 + check(x, a, b);
290.275 + }
290.276 +
290.277 + // short
290.278 + {
290.279 + MethodHandle mh1 = getmh1( short.class, short.class);
290.280 + MethodHandle mh2 = getmh2(mh1, short.class, short.class);
290.281 + short a = (short) mh1.invokeExact((short) x);
290.282 + short b = (short) mh2.invokeExact(x);
290.283 + check(x, a, b);
290.284 + }
290.285 + }
290.286 +
290.287 + static void testint() throws Throwable {
290.288 + int[] a = new int[] {
290.289 + Integer.MIN_VALUE,
290.290 + Integer.MIN_VALUE + 1,
290.291 + -0x0FFFFFFF,
290.292 + -0x00FFFFFF,
290.293 + -0x000FFFFF,
290.294 + -0x0000FFFF,
290.295 + -0x00000FFF,
290.296 + -0x000000FF,
290.297 + -0x0000000F,
290.298 + -1,
290.299 + 0,
290.300 + 1,
290.301 + 0x0000000F,
290.302 + 0x000000FF,
290.303 + 0x00000FFF,
290.304 + 0x0000FFFF,
290.305 + 0x000FFFFF,
290.306 + 0x00FFFFFF,
290.307 + 0x0FFFFFFF,
290.308 + Integer.MAX_VALUE - 1,
290.309 + Integer.MAX_VALUE
290.310 + };
290.311 + for (int i = 0; i < a.length; i++) {
290.312 + doint(a[i]);
290.313 + }
290.314 + }
290.315 + static void doint(int x) throws Throwable {
290.316 + if (DEBUG) System.out.println("int=" + x);
290.317 +
290.318 + // boolean
290.319 + {
290.320 + MethodHandle mh1 = getmh1( boolean.class, boolean.class);
290.321 + MethodHandle mh2 = getmh2(mh1, boolean.class, int.class);
290.322 + boolean a = (boolean) mh1.invokeExact((x & 1) == 1);
290.323 + boolean b = (boolean) mh2.invokeExact(x);
290.324 + check(x, a, b);
290.325 + }
290.326 +
290.327 + // byte
290.328 + {
290.329 + MethodHandle mh1 = getmh1( byte.class, byte.class);
290.330 + MethodHandle mh2 = getmh2(mh1, byte.class, int.class);
290.331 + byte a = (byte) mh1.invokeExact((byte) x);
290.332 + byte b = (byte) mh2.invokeExact(x);
290.333 + check(x, a, b);
290.334 + }
290.335 +
290.336 + // char
290.337 + {
290.338 + MethodHandle mh1 = getmh1( char.class, char.class);
290.339 + MethodHandle mh2 = getmh2(mh1, char.class, int.class);
290.340 + char a = (char) mh1.invokeExact((char) x);
290.341 + char b = (char) mh2.invokeExact(x);
290.342 + check(x, a, b);
290.343 + }
290.344 +
290.345 + // short
290.346 + {
290.347 + MethodHandle mh1 = getmh1( short.class, short.class);
290.348 + MethodHandle mh2 = getmh2(mh1, short.class, int.class);
290.349 + short a = (short) mh1.invokeExact((short) x);
290.350 + short b = (short) mh2.invokeExact(x);
290.351 + assert a == b : a + " != " + b;
290.352 + check(x, a, b);
290.353 + }
290.354 +
290.355 + // int
290.356 + {
290.357 + MethodHandle mh1 = getmh1( int.class, int.class);
290.358 + MethodHandle mh2 = getmh2(mh1, int.class, int.class);
290.359 + int a = (int) mh1.invokeExact((int) x);
290.360 + int b = (int) mh2.invokeExact(x);
290.361 + check(x, a, b);
290.362 + }
290.363 + }
290.364 +
290.365 + // test adapter_opt_l2i
290.366 + static void testlong() throws Throwable {
290.367 + long[] a = new long[] {
290.368 + Long.MIN_VALUE,
290.369 + Long.MIN_VALUE + 1,
290.370 + -0x000000000FFFFFFFL,
290.371 + -0x0000000000FFFFFFL,
290.372 + -0x00000000000FFFFFL,
290.373 + -0x000000000000FFFFL,
290.374 + -0x0000000000000FFFL,
290.375 + -0x00000000000000FFL,
290.376 + -0x000000000000000FL,
290.377 + -1L,
290.378 + 0L,
290.379 + 1L,
290.380 + 0x000000000000000FL,
290.381 + 0x00000000000000FFL,
290.382 + 0x0000000000000FFFL,
290.383 + 0x0000000000000FFFL,
290.384 + 0x000000000000FFFFL,
290.385 + 0x00000000000FFFFFL,
290.386 + 0x0000000000FFFFFFL,
290.387 + 0x000000000FFFFFFFL,
290.388 + Long.MAX_VALUE - 1,
290.389 + Long.MAX_VALUE
290.390 + };
290.391 + for (int i = 0; i < a.length; i++) {
290.392 + dolong(a[i]);
290.393 + }
290.394 + }
290.395 + static void dolong(long x) throws Throwable {
290.396 + if (DEBUG) System.out.println("long=" + x);
290.397 +
290.398 + // boolean
290.399 + {
290.400 + MethodHandle mh1 = getmh1( boolean.class, boolean.class);
290.401 + MethodHandle mh2 = getmh2(mh1, boolean.class, long.class);
290.402 + boolean a = (boolean) mh1.invokeExact((x & 1L) == 1L);
290.403 + boolean b = (boolean) mh2.invokeExact(x);
290.404 + check(x, a, b);
290.405 + }
290.406 +
290.407 + // byte
290.408 + {
290.409 + MethodHandle mh1 = getmh1( byte.class, byte.class);
290.410 + MethodHandle mh2 = getmh2(mh1, byte.class, long.class);
290.411 + byte a = (byte) mh1.invokeExact((byte) x);
290.412 + byte b = (byte) mh2.invokeExact(x);
290.413 + check(x, a, b);
290.414 + }
290.415 +
290.416 + // char
290.417 + {
290.418 + MethodHandle mh1 = getmh1( char.class, char.class);
290.419 + MethodHandle mh2 = getmh2(mh1, char.class, long.class);
290.420 + char a = (char) mh1.invokeExact((char) x);
290.421 + char b = (char) mh2.invokeExact(x);
290.422 + check(x, a, b);
290.423 + }
290.424 +
290.425 + // short
290.426 + {
290.427 + MethodHandle mh1 = getmh1( short.class, short.class);
290.428 + MethodHandle mh2 = getmh2(mh1, short.class, long.class);
290.429 + short a = (short) mh1.invokeExact((short) x);
290.430 + short b = (short) mh2.invokeExact(x);
290.431 + check(x, a, b);
290.432 + }
290.433 +
290.434 + // int
290.435 + {
290.436 + MethodHandle mh1 = getmh1( int.class, int.class);
290.437 + MethodHandle mh2 = getmh2(mh1, int.class, long.class);
290.438 + int a = (int) mh1.invokeExact((int) x);
290.439 + int b = (int) mh2.invokeExact(x);
290.440 + check(x, a, b);
290.441 + }
290.442 + }
290.443 +
290.444 + static void check(boolean x, boolean e, boolean a) { p(z2h(x), z2h(e), z2h(a)); assert e == a : z2h(x) + ": " + z2h(e) + " != " + z2h(a); }
290.445 + static void check(boolean x, byte e, byte a) { p(z2h(x), i2h(e), i2h(a)); assert e == a : z2h(x) + ": " + i2h(e) + " != " + i2h(a); }
290.446 + static void check(boolean x, int e, int a) { p(z2h(x), i2h(e), i2h(a)); assert e == a : z2h(x) + ": " + i2h(e) + " != " + i2h(a); }
290.447 +
290.448 + static void check(int x, boolean e, boolean a) { p(i2h(x), z2h(e), z2h(a)); assert e == a : i2h(x) + ": " + z2h(e) + " != " + z2h(a); }
290.449 + static void check(int x, byte e, byte a) { p(i2h(x), i2h(e), i2h(a)); assert e == a : i2h(x) + ": " + i2h(e) + " != " + i2h(a); }
290.450 + static void check(int x, int e, int a) { p(i2h(x), i2h(e), i2h(a)); assert e == a : i2h(x) + ": " + i2h(e) + " != " + i2h(a); }
290.451 +
290.452 + static void check(long x, boolean e, boolean a) { p(l2h(x), z2h(e), z2h(a)); assert e == a : l2h(x) + ": " + z2h(e) + " != " + z2h(a); }
290.453 + static void check(long x, byte e, byte a) { p(l2h(x), i2h(e), i2h(a)); assert e == a : l2h(x) + ": " + i2h(e) + " != " + i2h(a); }
290.454 + static void check(long x, int e, int a) { p(l2h(x), i2h(e), i2h(a)); assert e == a : l2h(x) + ": " + i2h(e) + " != " + i2h(a); }
290.455 +
290.456 + static void p(String x, String e, String a) { if (DEBUG) System.out.println(x + ": expected: " + e + ", actual: " + a); }
290.457 +
290.458 + static String z2h(boolean x) { return x ? "1" : "0"; }
290.459 + static String i2h(int x) { return Integer.toHexString(x); }
290.460 + static String l2h(long x) { return Long.toHexString(x); }
290.461 +
290.462 + // to int
290.463 + public static boolean foo(boolean i) { return i; }
290.464 + public static byte foo(byte i) { return i; }
290.465 + public static char foo(char i) { return i; }
290.466 + public static short foo(short i) { return i; }
290.467 + public static int foo(int i) { return i; }
290.468 +}
291.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
291.2 +++ b/test/java/lang/invoke/ClassValueTest.java Tue Mar 29 20:19:55 2011 -0700
291.3 @@ -0,0 +1,165 @@
291.4 +/*
291.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
291.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
291.7 + *
291.8 + * This code is free software; you can redistribute it and/or modify it
291.9 + * under the terms of the GNU General Public License version 2 only, as
291.10 + * published by the Free Software Foundation. Oracle designates this
291.11 + * particular file as subject to the "Classpath" exception as provided
291.12 + * by Oracle in the LICENSE file that accompanied this code.
291.13 + *
291.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
291.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
291.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
291.17 + * version 2 for more details (a copy is included in the LICENSE file that
291.18 + * accompanied this code).
291.19 + *
291.20 + * You should have received a copy of the GNU General Public License version
291.21 + * 2 along with this work; if not, write to the Free Software Foundation,
291.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
291.23 + *
291.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
291.25 + * or visit www.oracle.com if you need additional information or have any
291.26 + * questions.
291.27 + */
291.28 +
291.29 +/* @test
291.30 + * @summary tests for class-specific values
291.31 + * @compile ClassValueTest.java
291.32 + * @run junit/othervm test.java.lang.invoke.ClassValueTest
291.33 + */
291.34 +
291.35 +/*
291.36 + Manually:
291.37 + $ $JAVA7X_HOME/bin/javac -d foo -cp $JUNIT4_JAR test/java/lang/invoke/ClassValueTest.java
291.38 + $ $JAVA7X_HOME/bin/java -cp foo:$JUNIT4_JAR org.junit.runner.JUnitCore test.java.lang.invoke.ClassValueTest
291.39 + Output: .testAdd => 1000 : Integer
291.40 + */
291.41 +
291.42 +package test.java.lang.invoke;
291.43 +
291.44 +import java.util.*;
291.45 +
291.46 +import java.lang.invoke.*;
291.47 +
291.48 +import org.junit.*;
291.49 +import static org.junit.Assert.*;
291.50 +
291.51 +/**
291.52 + * @author jrose
291.53 + */
291.54 +public class ClassValueTest {
291.55 + static String nameForCV1(Class<?> type) {
291.56 + return "CV1:" + type.getName();
291.57 + }
291.58 + static int countForCV1;
291.59 + static final ClassValue<String> CV1 = new CV1();
291.60 + private static class CV1 extends ClassValue<String> {
291.61 + protected String computeValue(Class<?> type) {
291.62 + countForCV1++;
291.63 + return nameForCV1(type);
291.64 + }
291.65 + }
291.66 +
291.67 + static final Class[] CLASSES = {
291.68 + String.class,
291.69 + Integer.class,
291.70 + int.class,
291.71 + boolean[].class,
291.72 + char[][].class,
291.73 + ClassValueTest.class
291.74 + };
291.75 +
291.76 + @Test
291.77 + public void testGet() {
291.78 + countForCV1 = 0;
291.79 + for (Class c : CLASSES) {
291.80 + assertEquals(nameForCV1(c), CV1.get(c));
291.81 + }
291.82 + assertEquals(CLASSES.length, countForCV1);
291.83 + for (Class c : CLASSES) {
291.84 + assertEquals(nameForCV1(c), CV1.get(c));
291.85 + }
291.86 + assertEquals(CLASSES.length, countForCV1);
291.87 + }
291.88 +
291.89 + @Test
291.90 + public void testRemove() {
291.91 + for (Class c : CLASSES) {
291.92 + CV1.get(c);
291.93 + }
291.94 + countForCV1 = 0;
291.95 + int REMCOUNT = 3;
291.96 + for (int i = 0; i < REMCOUNT; i++) {
291.97 + CV1.remove(CLASSES[i]);
291.98 + }
291.99 + assertEquals(0, countForCV1); // no change
291.100 + for (Class c : CLASSES) {
291.101 + assertEquals(nameForCV1(c), CV1.get(c));
291.102 + }
291.103 + assertEquals(REMCOUNT, countForCV1);
291.104 + }
291.105 +
291.106 + static String nameForCVN(Class<?> type, int n) {
291.107 + return "CV[" + n + "]" + type.getName();
291.108 + }
291.109 + static int countForCVN;
291.110 + static class CVN extends ClassValue<String> {
291.111 + final int n;
291.112 + CVN(int n) { this.n = n; }
291.113 + protected String computeValue(Class<?> type) {
291.114 + countForCVN++;
291.115 + return nameForCVN(type, n);
291.116 + }
291.117 + };
291.118 +
291.119 + @Test
291.120 + public void testGetMany() {
291.121 + int CVN_COUNT1 = 100, CVN_COUNT2 = 100;
291.122 + CVN cvns[] = new CVN[CVN_COUNT1 * CVN_COUNT2];
291.123 + for (int n = 0; n < cvns.length; n++) {
291.124 + cvns[n] = new CVN(n);
291.125 + }
291.126 + countForCVN = 0;
291.127 + for (int pass = 0; pass <= 2; pass++) {
291.128 + for (int i1 = 0; i1 < CVN_COUNT1; i1++) {
291.129 + eachClass:
291.130 + for (Class c : CLASSES) {
291.131 + for (int i2 = 0; i2 < CVN_COUNT2; i2++) {
291.132 + int n = i1*CVN_COUNT2 + i2;
291.133 + assertEquals(0, countForCVN);
291.134 + assertEquals(nameForCVN(c, n), cvns[n].get(c));
291.135 + cvns[n].get(c); //get it again
291.136 + //System.out.println("getting "+n+":"+cvns[n].get(c));
291.137 + boolean doremove = (((i1 + i2) & 3) == 0);
291.138 + switch (pass) {
291.139 + case 0:
291.140 + assertEquals(1, countForCVN);
291.141 + break;
291.142 + case 1:
291.143 + // remove on middle pass
291.144 + assertEquals(0, countForCVN);
291.145 + if (doremove) {
291.146 + //System.out.println("removing "+n+":"+cvns[n].get(c));
291.147 + cvns[n].remove(c);
291.148 + assertEquals(0, countForCVN);
291.149 + }
291.150 + break;
291.151 + case 2:
291.152 + assertEquals(doremove ? 1 : 0, countForCVN);
291.153 + break;
291.154 + }
291.155 + countForCVN = 0;
291.156 + if (i1 > i2 && i1 < i2+5) continue eachClass; // leave diagonal gap
291.157 + }
291.158 + }
291.159 + }
291.160 + }
291.161 + assertEquals(countForCVN, 0);
291.162 + for (int n = 0; n < cvns.length; n++) {
291.163 + for (Class c : CLASSES) {
291.164 + assertEquals(nameForCVN(c, n), cvns[n].get(c));
291.165 + }
291.166 + }
291.167 + }
291.168 +}
292.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
292.2 +++ b/test/java/lang/invoke/InvokeDynamicPrintArgs.java Tue Mar 29 20:19:55 2011 -0700
292.3 @@ -0,0 +1,187 @@
292.4 +/*
292.5 + * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
292.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
292.7 + *
292.8 + * This code is free software; you can redistribute it and/or modify it
292.9 + * under the terms of the GNU General Public License version 2 only, as
292.10 + * published by the Free Software Foundation.
292.11 + *
292.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
292.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
292.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
292.15 + * version 2 for more details (a copy is included in the LICENSE file that
292.16 + * accompanied this code).
292.17 + *
292.18 + * You should have received a copy of the GNU General Public License version
292.19 + * 2 along with this work; if not, write to the Free Software Foundation,
292.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
292.21 + *
292.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
292.23 + * or visit www.oracle.com if you need additional information or have any
292.24 + * questions.
292.25 + */
292.26 +
292.27 +/* @test
292.28 + * @summary smoke test for invokedynamic instructions
292.29 + * @build indify.Indify
292.30 + * @compile InvokeDynamicPrintArgs.java
292.31 + * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic
292.32 + * indify.Indify
292.33 + * --verify-specifier-count=3 --transitionalJSR292=false
292.34 + * --expand-properties --classpath ${test.classes}
292.35 + * --java test.java.lang.invoke.InvokeDynamicPrintArgs --check-output
292.36 + */
292.37 +
292.38 +package test.java.lang.invoke;
292.39 +
292.40 +import org.junit.Test;
292.41 +
292.42 +import java.util.*;
292.43 +import java.io.*;
292.44 +
292.45 +import java.lang.invoke.*;
292.46 +import static java.lang.invoke.MethodHandles.*;
292.47 +import static java.lang.invoke.MethodType.*;
292.48 +
292.49 +public class InvokeDynamicPrintArgs {
292.50 + public static void main(String... av) throws Throwable {
292.51 + if (av.length > 0) openBuf(); // --check-output mode
292.52 + System.out.println("Printing some argument lists, starting with a empty one:");
292.53 + INDY_nothing().invokeExact(); // BSM specifier #0 = {bsm}
292.54 + INDY_bar().invokeExact("bar arg", 1); // BSM specifier #1 = {bsm2, Void.class, "void type"}
292.55 + INDY_bar2().invokeExact("bar2 arg", 222); // BSM specifier #1 = (same)
292.56 + INDY_baz().invokeExact("baz arg", 2, 3.14); // BSM specifier #2 = {bsm2, 1234.5}
292.57 + INDY_foo().invokeExact("foo arg"); // BSM specifier #0 = (same)
292.58 + // Hence, BSM specifier count should be 3. See "--verify-specifier-count=3" above.
292.59 + System.out.println("Done printing argument lists.");
292.60 + closeBuf();
292.61 + }
292.62 +
292.63 + @Test
292.64 + public void testInvokeDynamicPrintArgs() throws IOException {
292.65 + System.err.println(System.getProperties());
292.66 + String testClassPath = System.getProperty("build.test.classes.dir");
292.67 + if (testClassPath == null) throw new RuntimeException();
292.68 + String[] args = new String[]{
292.69 + "--verify-specifier-count=3", "--transitionalJSR292=false",
292.70 + "--expand-properties", "--classpath", testClassPath,
292.71 + "--java", "test.java.lang.invoke.InvokeDynamicPrintArgs", "--check-output"
292.72 + };
292.73 + System.err.println("Indify: "+Arrays.toString(args));
292.74 + indify.Indify.main(args);
292.75 + }
292.76 +
292.77 + private static PrintStream oldOut;
292.78 + private static ByteArrayOutputStream buf;
292.79 + private static void openBuf() {
292.80 + oldOut = System.out;
292.81 + buf = new ByteArrayOutputStream();
292.82 + System.setOut(new PrintStream(buf));
292.83 + }
292.84 + private static void closeBuf() {
292.85 + if (buf == null) return;
292.86 + System.out.flush();
292.87 + System.setOut(oldOut);
292.88 + String[] haveLines = new String(buf.toByteArray()).split("[\n\r]+");
292.89 + for (String line : haveLines) System.out.println(line);
292.90 + Iterator<String> iter = Arrays.asList(haveLines).iterator();
292.91 + for (String want : EXPECT_OUTPUT) {
292.92 + String have = iter.hasNext() ? iter.next() : "[EOF]";
292.93 + if (want.equals(have)) continue;
292.94 + System.err.println("want line: "+want);
292.95 + System.err.println("have line: "+have);
292.96 + throw new AssertionError("unexpected output: "+have);
292.97 + }
292.98 + if (iter.hasNext())
292.99 + throw new AssertionError("unexpected output: "+iter.next());
292.100 + }
292.101 + private static final String[] EXPECT_OUTPUT = {
292.102 + "Printing some argument lists, starting with a empty one:",
292.103 + "[test.java.lang.invoke.InvokeDynamicPrintArgs, nothing, ()void][]",
292.104 + "[test.java.lang.invoke.InvokeDynamicPrintArgs, bar, (String,int)void, class java.lang.Void, void type!, 1, 234.5, 67.5, 89][bar arg, 1]",
292.105 + "[test.java.lang.invoke.InvokeDynamicPrintArgs, bar2, (String,int)void, class java.lang.Void, void type!, 1, 234.5, 67.5, 89][bar2 arg, 222]",
292.106 + "[test.java.lang.invoke.InvokeDynamicPrintArgs, baz, (String,int,double)void, 1234.5][baz arg, 2, 3.14]",
292.107 + "[test.java.lang.invoke.InvokeDynamicPrintArgs, foo, (String)void][foo arg]",
292.108 + "Done printing argument lists."
292.109 + };
292.110 +
292.111 + private static void printArgs(Object bsmInfo, Object... args) {
292.112 + System.out.println(bsmInfo+Arrays.deepToString(args));
292.113 + }
292.114 + private static MethodHandle MH_printArgs() throws ReflectiveOperationException {
292.115 + shouldNotCallThis();
292.116 + return lookup().findStatic(lookup().lookupClass(),
292.117 + "printArgs", methodType(void.class, Object.class, Object[].class));
292.118 + }
292.119 +
292.120 + private static CallSite bsm(Lookup caller, String name, MethodType type) throws ReflectiveOperationException {
292.121 + // ignore caller and name, but match the type:
292.122 + Object bsmInfo = Arrays.asList(caller, name, type);
292.123 + return new ConstantCallSite(MH_printArgs().bindTo(bsmInfo).asCollector(Object[].class, type.parameterCount()).asType(type));
292.124 + }
292.125 + private static MethodType MT_bsm() {
292.126 + shouldNotCallThis();
292.127 + return methodType(CallSite.class, Lookup.class, String.class, MethodType.class);
292.128 + }
292.129 + private static MethodHandle MH_bsm() throws ReflectiveOperationException {
292.130 + shouldNotCallThis();
292.131 + return lookup().findStatic(lookup().lookupClass(), "bsm", MT_bsm());
292.132 + }
292.133 +
292.134 + private static CallSite bsm2(Lookup caller, String name, MethodType type, Object... arg) throws ReflectiveOperationException {
292.135 + // ignore caller and name, but match the type:
292.136 + List<Object> bsmInfo = new ArrayList<>(Arrays.asList(caller, name, type));
292.137 + bsmInfo.addAll(Arrays.asList((Object[])arg));
292.138 + return new ConstantCallSite(MH_printArgs().bindTo(bsmInfo).asCollector(Object[].class, type.parameterCount()).asType(type));
292.139 + }
292.140 + private static MethodType MT_bsm2() {
292.141 + shouldNotCallThis();
292.142 + return methodType(CallSite.class, Lookup.class, String.class, MethodType.class, Object[].class);
292.143 + }
292.144 + private static MethodHandle MH_bsm2() throws ReflectiveOperationException {
292.145 + shouldNotCallThis();
292.146 + return lookup().findStatic(lookup().lookupClass(), "bsm2", MT_bsm2());
292.147 + }
292.148 +
292.149 + private static MethodHandle INDY_nothing() throws Throwable {
292.150 + shouldNotCallThis();
292.151 + return ((CallSite) MH_bsm().invokeGeneric(lookup(),
292.152 + "nothing", methodType(void.class)
292.153 + )).dynamicInvoker();
292.154 + }
292.155 + private static MethodHandle INDY_foo() throws Throwable {
292.156 + shouldNotCallThis();
292.157 + return ((CallSite) MH_bsm().invokeGeneric(lookup(),
292.158 + "foo", methodType(void.class, String.class)
292.159 + )).dynamicInvoker();
292.160 + }
292.161 + private static MethodHandle INDY_bar() throws Throwable {
292.162 + shouldNotCallThis();
292.163 + return ((CallSite) MH_bsm2().invokeGeneric(lookup(),
292.164 + "bar", methodType(void.class, String.class, int.class)
292.165 + , new Object[] { Void.class, "void type!",
292.166 + 1, 234.5F, 67.5, (long)89 }
292.167 + )).dynamicInvoker();
292.168 + }
292.169 + private static MethodHandle INDY_bar2() throws Throwable {
292.170 + shouldNotCallThis();
292.171 + return ((CallSite) MH_bsm2().invokeGeneric(lookup(),
292.172 + "bar2", methodType(void.class, String.class, int.class)
292.173 + , new Object[] { Void.class, "void type!",
292.174 + 1, 234.5F, 67.5, (long)89 }
292.175 + )).dynamicInvoker();
292.176 + }
292.177 + private static MethodHandle INDY_baz() throws Throwable {
292.178 + shouldNotCallThis();
292.179 + return ((CallSite) MH_bsm2().invokeGeneric(lookup(),
292.180 + "baz", methodType(void.class, String.class, int.class, double.class)
292.181 + , 1234.5
292.182 + )).dynamicInvoker();
292.183 + }
292.184 +
292.185 + private static void shouldNotCallThis() {
292.186 + // if this gets called, the transformation has not taken place
292.187 + if (System.getProperty("InvokeDynamicPrintArgs.allow-untransformed") != null) return;
292.188 + throw new AssertionError("this code should be statically transformed away by Indify");
292.189 + }
292.190 +}
293.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
293.2 +++ b/test/java/lang/invoke/InvokeGenericTest.java Tue Mar 29 20:19:55 2011 -0700
293.3 @@ -0,0 +1,484 @@
293.4 +/*
293.5 + * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
293.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
293.7 + *
293.8 + * This code is free software; you can redistribute it and/or modify it
293.9 + * under the terms of the GNU General Public License version 2 only, as
293.10 + * published by the Free Software Foundation. Oracle designates this
293.11 + * particular file as subject to the "Classpath" exception as provided
293.12 + * by Oracle in the LICENSE file that accompanied this code.
293.13 + *
293.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
293.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
293.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
293.17 + * version 2 for more details (a copy is included in the LICENSE file that
293.18 + * accompanied this code).
293.19 + *
293.20 + * You should have received a copy of the GNU General Public License version
293.21 + * 2 along with this work; if not, write to the Free Software Foundation,
293.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
293.23 + *
293.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
293.25 + * or visit www.oracle.com if you need additional information or have any
293.26 + * questions.
293.27 + */
293.28 +
293.29 +/* @test
293.30 + * @summary unit tests for java.lang.invoke.MethodHandle.invokeGeneric
293.31 + * @compile -XDallowTransitionalJSR292=no -target 7 InvokeGenericTest.java
293.32 + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles test.java.lang.invoke.InvokeGenericTest
293.33 + */
293.34 +
293.35 +package test.java.lang.invoke;
293.36 +
293.37 +import java.lang.invoke.*;
293.38 +import static java.lang.invoke.MethodHandles.*;
293.39 +import static java.lang.invoke.MethodType.*;
293.40 +import java.lang.reflect.*;
293.41 +import java.util.*;
293.42 +import org.junit.*;
293.43 +import static org.junit.Assert.*;
293.44 +import static org.junit.Assume.*;
293.45 +
293.46 +
293.47 +/**
293.48 + *
293.49 + * @author jrose
293.50 + */
293.51 +public class InvokeGenericTest {
293.52 + // How much output?
293.53 + static int verbosity = 0;
293.54 + static {
293.55 + String vstr = System.getProperty("test.java.lang.invoke.InvokeGenericTest.verbosity");
293.56 + if (vstr != null) verbosity = Integer.parseInt(vstr);
293.57 + }
293.58 +
293.59 + @Test
293.60 + public void testFirst() throws Throwable {
293.61 + verbosity += 9; try {
293.62 + // left blank for debugging
293.63 + } finally { printCounts(); verbosity -= 9; }
293.64 + }
293.65 +
293.66 + public InvokeGenericTest() {
293.67 + }
293.68 +
293.69 + @Before
293.70 + public void checkImplementedPlatform() {
293.71 + boolean platformOK = false;
293.72 + Properties properties = System.getProperties();
293.73 + String vers = properties.getProperty("java.vm.version");
293.74 + String name = properties.getProperty("java.vm.name");
293.75 + String arch = properties.getProperty("os.arch");
293.76 + if ((arch.equals("amd64") || arch.equals("i386") || arch.equals("x86") ||
293.77 + arch.equals("sparc") || arch.equals("sparcv9")) &&
293.78 + (name.contains("Client") || name.contains("Server"))
293.79 + ) {
293.80 + platformOK = true;
293.81 + } else {
293.82 + System.err.println("Skipping tests for unsupported platform: "+Arrays.asList(vers, name, arch));
293.83 + }
293.84 + assumeTrue(platformOK);
293.85 + }
293.86 +
293.87 + String testName;
293.88 + static int allPosTests, allNegTests;
293.89 + int posTests, negTests;
293.90 + @After
293.91 + public void printCounts() {
293.92 + if (verbosity >= 2 && (posTests | negTests) != 0) {
293.93 + System.out.println();
293.94 + if (posTests != 0) System.out.println("=== "+testName+": "+posTests+" positive test cases run");
293.95 + if (negTests != 0) System.out.println("=== "+testName+": "+negTests+" negative test cases run");
293.96 + allPosTests += posTests;
293.97 + allNegTests += negTests;
293.98 + posTests = negTests = 0;
293.99 + }
293.100 + }
293.101 + void countTest(boolean positive) {
293.102 + if (positive) ++posTests;
293.103 + else ++negTests;
293.104 + }
293.105 + void countTest() { countTest(true); }
293.106 + void startTest(String name) {
293.107 + if (testName != null) printCounts();
293.108 + if (verbosity >= 1)
293.109 + System.out.println(name);
293.110 + posTests = negTests = 0;
293.111 + testName = name;
293.112 + }
293.113 +
293.114 + @BeforeClass
293.115 + public static void setUpClass() throws Exception {
293.116 + calledLog.clear();
293.117 + calledLog.add(null);
293.118 + nextArgVal = INITIAL_ARG_VAL;
293.119 + }
293.120 +
293.121 + @AfterClass
293.122 + public static void tearDownClass() throws Exception {
293.123 + int posTests = allPosTests, negTests = allNegTests;
293.124 + if (verbosity >= 2 && (posTests | negTests) != 0) {
293.125 + System.out.println();
293.126 + if (posTests != 0) System.out.println("=== "+posTests+" total positive test cases");
293.127 + if (negTests != 0) System.out.println("=== "+negTests+" total negative test cases");
293.128 + }
293.129 + }
293.130 +
293.131 + static List<Object> calledLog = new ArrayList<Object>();
293.132 + static Object logEntry(String name, Object... args) {
293.133 + return Arrays.asList(name, Arrays.asList(args));
293.134 + }
293.135 + static Object called(String name, Object... args) {
293.136 + Object entry = logEntry(name, args);
293.137 + calledLog.add(entry);
293.138 + return entry;
293.139 + }
293.140 + static void assertCalled(String name, Object... args) {
293.141 + Object expected = logEntry(name, args);
293.142 + Object actual = calledLog.get(calledLog.size() - 1);
293.143 + if (expected.equals(actual) && verbosity < 9) return;
293.144 + System.out.println("assertCalled "+name+":");
293.145 + System.out.println("expected: "+expected);
293.146 + System.out.println("actual: "+actual);
293.147 + System.out.println("ex. types: "+getClasses(expected));
293.148 + System.out.println("act. types: "+getClasses(actual));
293.149 + assertEquals("previous method call", expected, actual);
293.150 + }
293.151 + static void printCalled(MethodHandle target, String name, Object... args) {
293.152 + if (verbosity >= 3)
293.153 + System.out.println("calling MH="+target+" to "+name+Arrays.toString(args));
293.154 + }
293.155 +
293.156 + static Object castToWrapper(Object value, Class<?> dst) {
293.157 + Object wrap = null;
293.158 + if (value instanceof Number)
293.159 + wrap = castToWrapperOrNull(((Number)value).longValue(), dst);
293.160 + if (value instanceof Character)
293.161 + wrap = castToWrapperOrNull((char)(Character)value, dst);
293.162 + if (wrap != null) return wrap;
293.163 + return dst.cast(value);
293.164 + }
293.165 +
293.166 + static Object castToWrapperOrNull(long value, Class<?> dst) {
293.167 + if (dst == int.class || dst == Integer.class)
293.168 + return (int)(value);
293.169 + if (dst == long.class || dst == Long.class)
293.170 + return (long)(value);
293.171 + if (dst == char.class || dst == Character.class)
293.172 + return (char)(value);
293.173 + if (dst == short.class || dst == Short.class)
293.174 + return (short)(value);
293.175 + if (dst == float.class || dst == Float.class)
293.176 + return (float)(value);
293.177 + if (dst == double.class || dst == Double.class)
293.178 + return (double)(value);
293.179 + if (dst == byte.class || dst == Byte.class)
293.180 + return (byte)(value);
293.181 + if (dst == boolean.class || dst == boolean.class)
293.182 + return ((value % 29) & 1) == 0;
293.183 + return null;
293.184 + }
293.185 +
293.186 + static final int ONE_MILLION = (1000*1000), // first int value
293.187 + TEN_BILLION = (10*1000*1000*1000), // scale factor to reach upper 32 bits
293.188 + INITIAL_ARG_VAL = ONE_MILLION << 1; // <<1 makes space for sign bit;
293.189 + static long nextArgVal;
293.190 + static long nextArg(boolean moreBits) {
293.191 + long val = nextArgVal++;
293.192 + long sign = -(val & 1); // alternate signs
293.193 + val >>= 1;
293.194 + if (moreBits)
293.195 + // Guarantee some bits in the high word.
293.196 + // In any case keep the decimal representation simple-looking,
293.197 + // with lots of zeroes, so as not to make the printed decimal
293.198 + // strings unnecessarily noisy.
293.199 + val += (val % ONE_MILLION) * TEN_BILLION;
293.200 + return val ^ sign;
293.201 + }
293.202 + static int nextArg() {
293.203 + // Produce a 32-bit result something like ONE_MILLION+(smallint).
293.204 + // Example: 1_000_042.
293.205 + return (int) nextArg(false);
293.206 + }
293.207 + static long nextArg(Class<?> kind) {
293.208 + if (kind == long.class || kind == Long.class ||
293.209 + kind == double.class || kind == Double.class)
293.210 + // produce a 64-bit result something like
293.211 + // ((TEN_BILLION+1) * (ONE_MILLION+(smallint)))
293.212 + // Example: 10_000_420_001_000_042.
293.213 + return nextArg(true);
293.214 + return (long) nextArg();
293.215 + }
293.216 +
293.217 + static Object randomArg(Class<?> param) {
293.218 + Object wrap = castToWrapperOrNull(nextArg(param), param);
293.219 + if (wrap != null) {
293.220 + return wrap;
293.221 + }
293.222 +// import sun.invoke.util.Wrapper;
293.223 +// Wrapper wrap = Wrapper.forBasicType(dst);
293.224 +// if (wrap == Wrapper.OBJECT && Wrapper.isWrapperType(dst))
293.225 +// wrap = Wrapper.forWrapperType(dst);
293.226 +// if (wrap != Wrapper.OBJECT)
293.227 +// return wrap.wrap(nextArg++);
293.228 + if (param.isInterface()) {
293.229 + for (Class<?> c : param.getClasses()) {
293.230 + if (param.isAssignableFrom(c) && !c.isInterface())
293.231 + { param = c; break; }
293.232 + }
293.233 + }
293.234 + if (param.isInterface() || param.isAssignableFrom(String.class))
293.235 + return "#"+nextArg();
293.236 + else
293.237 + try {
293.238 + return param.newInstance();
293.239 + } catch (InstantiationException ex) {
293.240 + } catch (IllegalAccessException ex) {
293.241 + }
293.242 + return null; // random class not Object, String, Integer, etc.
293.243 + }
293.244 + static Object[] randomArgs(Class<?>... params) {
293.245 + Object[] args = new Object[params.length];
293.246 + for (int i = 0; i < args.length; i++)
293.247 + args[i] = randomArg(params[i]);
293.248 + return args;
293.249 + }
293.250 + static Object[] randomArgs(int nargs, Class<?> param) {
293.251 + Object[] args = new Object[nargs];
293.252 + for (int i = 0; i < args.length; i++)
293.253 + args[i] = randomArg(param);
293.254 + return args;
293.255 + }
293.256 +
293.257 + static final Object ANON_OBJ = new Object();
293.258 + static Object zeroArg(Class<?> param) {
293.259 + Object x = castToWrapperOrNull(0L, param);
293.260 + if (x != null) return x;
293.261 + if (param.isInterface() || param.isAssignableFrom(String.class)) return "\"\"";
293.262 + if (param == Object.class) return ANON_OBJ;
293.263 + if (param.getComponentType() != null) return Array.newInstance(param.getComponentType(), 0);
293.264 + return null;
293.265 + }
293.266 + static Object[] zeroArgs(Class<?>... params) {
293.267 + Object[] args = new Object[params.length];
293.268 + for (int i = 0; i < args.length; i++)
293.269 + args[i] = zeroArg(params[i]);
293.270 + return args;
293.271 + }
293.272 + static Object[] zeroArgs(List<Class<?>> params) {
293.273 + return zeroArgs(params.toArray(new Class<?>[0]));
293.274 + }
293.275 +
293.276 + static <T, E extends T> T[] array(Class<T[]> atype, E... a) {
293.277 + return Arrays.copyOf(a, a.length, atype);
293.278 + }
293.279 + static <T> T[] cat(T[] a, T... b) {
293.280 + int alen = a.length, blen = b.length;
293.281 + if (blen == 0) return a;
293.282 + T[] c = Arrays.copyOf(a, alen + blen);
293.283 + System.arraycopy(b, 0, c, alen, blen);
293.284 + return c;
293.285 + }
293.286 + static Integer[] boxAll(int... vx) {
293.287 + Integer[] res = new Integer[vx.length];
293.288 + for (int i = 0; i < res.length; i++) {
293.289 + res[i] = vx[i];
293.290 + }
293.291 + return res;
293.292 + }
293.293 + static Object getClasses(Object x) {
293.294 + if (x == null) return x;
293.295 + if (x instanceof String) return x; // keep the name
293.296 + if (x instanceof List) {
293.297 + // recursively report classes of the list elements
293.298 + Object[] xa = ((List)x).toArray();
293.299 + for (int i = 0; i < xa.length; i++)
293.300 + xa[i] = getClasses(xa[i]);
293.301 + return Arrays.asList(xa);
293.302 + }
293.303 + return x.getClass().getSimpleName();
293.304 + }
293.305 +
293.306 + static MethodHandle changeArgTypes(MethodHandle target, Class<?> argType) {
293.307 + return changeArgTypes(target, 0, 999, argType);
293.308 + }
293.309 + static MethodHandle changeArgTypes(MethodHandle target,
293.310 + int beg, int end, Class<?> argType) {
293.311 + MethodType targetType = target.type();
293.312 + end = Math.min(end, targetType.parameterCount());
293.313 + ArrayList<Class<?>> argTypes = new ArrayList<Class<?>>(targetType.parameterList());
293.314 + Collections.fill(argTypes.subList(beg, end), argType);
293.315 + MethodType ttype2 = MethodType.methodType(targetType.returnType(), argTypes);
293.316 + return MethodHandles.convertArguments(target, ttype2);
293.317 + }
293.318 +
293.319 + // This lookup is good for all members in and under InvokeGenericTest.
293.320 + static final Lookup LOOKUP = MethodHandles.lookup();
293.321 +
293.322 + Map<List<Class<?>>, MethodHandle> CALLABLES = new HashMap<List<Class<?>>, MethodHandle>();
293.323 + MethodHandle callable(List<Class<?>> params) {
293.324 + MethodHandle mh = CALLABLES.get(params);
293.325 + if (mh == null) {
293.326 + mh = collector_MH.asType(methodType(Object.class, params));
293.327 + CALLABLES.put(params, mh);
293.328 + }
293.329 + return mh;
293.330 + }
293.331 + MethodHandle callable(Class<?>... params) {
293.332 + return callable(Arrays.asList(params));
293.333 + }
293.334 + private static Object collector(Object... args) {
293.335 + return Arrays.asList(args);
293.336 + }
293.337 + private static final MethodHandle collector_MH;
293.338 + static {
293.339 + try {
293.340 + collector_MH
293.341 + = LOOKUP.findStatic(LOOKUP.lookupClass(),
293.342 + "collector",
293.343 + methodType(Object.class, Object[].class));
293.344 + } catch (ReflectiveOperationException ex) {
293.345 + throw new RuntimeException(ex);
293.346 + }
293.347 + }
293.348 +
293.349 + @Test
293.350 + public void testSimple() throws Throwable {
293.351 + startTest("testSimple");
293.352 + countTest();
293.353 + String[] args = { "one", "two" };
293.354 + MethodHandle mh = callable(Object.class, String.class);
293.355 + Object res; List resl;
293.356 + res = resl = (List) mh.invokeGeneric((String)args[0], (Object)args[1]);
293.357 + //System.out.println(res);
293.358 + assertEquals(Arrays.asList(args), res);
293.359 + }
293.360 +
293.361 + @Test
293.362 + public void testWrongArgumentCount() throws Throwable {
293.363 + startTest("testWrongArgumentCount");
293.364 + for (int i = 0; i <= 10; i++) {
293.365 + testWrongArgumentCount(Collections.<Class<?>>nCopies(i, Integer.class));
293.366 + if (i <= 4) {
293.367 + testWrongArgumentCount(Collections.<Class<?>>nCopies(i, int.class));
293.368 + testWrongArgumentCount(Collections.<Class<?>>nCopies(i, long.class));
293.369 + }
293.370 + }
293.371 + }
293.372 + public void testWrongArgumentCount(List<Class<?>> params) throws Throwable {
293.373 + int max = params.size();
293.374 + for (int i = 0; i < max; i++) {
293.375 + List<Class<?>> params2 = params.subList(0, i);
293.376 + for (int k = 0; k <= 2; k++) {
293.377 + if (k == 1) params = methodType(Object.class, params).generic().parameterList();
293.378 + if (k == 2) params2 = methodType(Object.class, params2).generic().parameterList();
293.379 + testWrongArgumentCount(params, params2);
293.380 + testWrongArgumentCount(params2, params);
293.381 + }
293.382 + }
293.383 + }
293.384 + public void testWrongArgumentCount(List<Class<?>> expect, List<Class<?>> observe) throws Throwable {
293.385 + countTest(false);
293.386 + if (expect.equals(observe))
293.387 + assert(false);
293.388 + MethodHandle target = callable(expect);
293.389 + Object[] args = zeroArgs(observe);
293.390 + Object junk;
293.391 + try {
293.392 + switch (args.length) {
293.393 + case 0:
293.394 + junk = target.invokeGeneric(); break;
293.395 + case 1:
293.396 + junk = target.invokeGeneric(args[0]); break;
293.397 + case 2:
293.398 + junk = target.invokeGeneric(args[0], args[1]); break;
293.399 + case 3:
293.400 + junk = target.invokeGeneric(args[0], args[1], args[2]); break;
293.401 + case 4:
293.402 + junk = target.invokeGeneric(args[0], args[1], args[2], args[3]); break;
293.403 + default:
293.404 + junk = target.invokeWithArguments(args); break;
293.405 + }
293.406 + } catch (WrongMethodTypeException ex) {
293.407 + return;
293.408 + } catch (Exception ex) {
293.409 + throw new RuntimeException("wrong exception calling "+target+target.type()+" on "+Arrays.asList(args)+" : "+ex);
293.410 + }
293.411 + throw new RuntimeException("bad success calling "+target+target.type()+" on "+Arrays.asList(args));
293.412 + }
293.413 +
293.414 + /** Make a list of all combinations of the given types, with the given arities.
293.415 + * A void return type is possible iff the first type is void.class.
293.416 + */
293.417 + static List<MethodType> allMethodTypes(int minargc, int maxargc, Class<?>... types) {
293.418 + ArrayList<MethodType> result = new ArrayList<MethodType>();
293.419 + if (types.length > 0) {
293.420 + ArrayList<MethodType> argcTypes = new ArrayList<MethodType>();
293.421 + // build arity-zero types first
293.422 + for (Class<?> rtype : types) {
293.423 + argcTypes.add(MethodType.methodType(rtype));
293.424 + }
293.425 + if (types[0] == void.class)
293.426 + // void is not an argument type
293.427 + types = Arrays.copyOfRange(types, 1, types.length);
293.428 + for (int argc = 0; argc <= maxargc; argc++) {
293.429 + if (argc >= minargc)
293.430 + result.addAll(argcTypes);
293.431 + if (argc >= maxargc)
293.432 + break;
293.433 + ArrayList<MethodType> prevTypes = argcTypes;
293.434 + argcTypes = new ArrayList<MethodType>();
293.435 + for (MethodType prevType : prevTypes) {
293.436 + for (Class<?> ptype : types) {
293.437 + argcTypes.add(prevType.insertParameterTypes(argc, ptype));
293.438 + }
293.439 + }
293.440 + }
293.441 + }
293.442 + return Collections.unmodifiableList(result);
293.443 + }
293.444 + static List<MethodType> allMethodTypes(int argc, Class<?>... types) {
293.445 + return allMethodTypes(argc, argc, types);
293.446 + }
293.447 +
293.448 + interface RandomInterface { }
293.449 +
293.450 + MethodHandle toString_MH;
293.451 +
293.452 + @Test
293.453 + public void testReferenceConversions() throws Throwable {
293.454 + startTest("testReferenceConversions");
293.455 + toString_MH = LOOKUP.
293.456 + findVirtual(Object.class, "toString", MethodType.methodType(String.class));
293.457 + String[] args = { "one", "two" };
293.458 + for (MethodType type : allMethodTypes(2, Object.class, String.class, RandomInterface.class)) {
293.459 + testReferenceConversions(type, args);
293.460 + }
293.461 + }
293.462 + public void testReferenceConversions(MethodType type, Object... args) throws Throwable {
293.463 + countTest();
293.464 + if (verbosity > 3) System.out.println("target type: "+type);
293.465 + MethodHandle mh = callable(type.parameterList());
293.466 + MethodHandle tsdrop = MethodHandles.dropArguments(toString_MH, 1, type.parameterList());
293.467 + mh = MethodHandles.foldArguments(tsdrop, mh);
293.468 + mh = mh.asType(type);
293.469 + Object res = mh.invokeGeneric((String)args[0], (Object)args[1]);
293.470 + //System.out.println(res);
293.471 + assertEquals(Arrays.asList(args).toString(), res);
293.472 + }
293.473 +
293.474 +
293.475 + @Test @Ignore("known failure pending 6939861")
293.476 + public void testBoxConversions() throws Throwable {
293.477 + startTest("testBoxConversions");
293.478 + countTest();
293.479 + Integer[] args = { 1, 2 };
293.480 + MethodHandle mh = callable(Object.class, int.class);
293.481 + Object res; List resl;
293.482 + res = resl = (List) mh.invokeGeneric((int)args[0], (Object)args[1]);
293.483 + //System.out.println(res);
293.484 + assertEquals(Arrays.asList(args), res);
293.485 + }
293.486 +
293.487 +}
294.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
294.2 +++ b/test/java/lang/invoke/JavaDocExamplesTest.java Tue Mar 29 20:19:55 2011 -0700
294.3 @@ -0,0 +1,230 @@
294.4 +/*
294.5 + * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
294.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
294.7 + *
294.8 + * This code is free software; you can redistribute it and/or modify it
294.9 + * under the terms of the GNU General Public License version 2 only, as
294.10 + * published by the Free Software Foundation. Oracle designates this
294.11 + * particular file as subject to the "Classpath" exception as provided
294.12 + * by Oracle in the LICENSE file that accompanied this code.
294.13 + *
294.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
294.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
294.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
294.17 + * version 2 for more details (a copy is included in the LICENSE file that
294.18 + * accompanied this code).
294.19 + *
294.20 + * You should have received a copy of the GNU General Public License version
294.21 + * 2 along with this work; if not, write to the Free Software Foundation,
294.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
294.23 + *
294.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
294.25 + * or visit www.oracle.com if you need additional information or have any
294.26 + * questions.
294.27 + */
294.28 +
294.29 +/* @test
294.30 + * @summary example code used in javadoc for java.lang.invoke API
294.31 + * @compile -XDallowTransitionalJSR292=no JavaDocExamplesTest.java
294.32 + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles test.java.lang.invoke.JavaDocExamplesTest
294.33 + */
294.34 +
294.35 +/*
294.36 +---- To run outside jtreg:
294.37 +$ $JAVA7X_HOME/bin/javac -cp $JUNIT4_JAR -d /tmp/Classes \
294.38 + $DAVINCI/sources/jdk/test/java/lang/invoke/JavaDocExamplesTest.java
294.39 +$ $JAVA7X_HOME/bin/java -cp $JUNIT4_JAR:/tmp/Classes \
294.40 + -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles \
294.41 + -Dtest.java.lang.invoke.JavaDocExamplesTest.verbosity=1 \
294.42 + test.java.lang.invoke.JavaDocExamplesTest
294.43 +----
294.44 +*/
294.45 +
294.46 +package test.java.lang.invoke;
294.47 +
294.48 +import java.lang.invoke.*;
294.49 +import static java.lang.invoke.MethodHandles.*;
294.50 +import static java.lang.invoke.MethodType.*;
294.51 +
294.52 +import java.lang.reflect.*;
294.53 +import java.util.*;
294.54 +
294.55 +import org.junit.*;
294.56 +import static org.junit.Assert.*;
294.57 +import static org.junit.Assume.*;
294.58 +
294.59 +
294.60 +/**
294.61 + * @author jrose
294.62 + */
294.63 +public class JavaDocExamplesTest {
294.64 + /** Wrapper for running the JUnit tests in this module.
294.65 + * Put JUnit on the classpath!
294.66 + */
294.67 + public static void main(String... ignore) {
294.68 + org.junit.runner.JUnitCore.runClasses(JavaDocExamplesTest.class);
294.69 + }
294.70 + // How much output?
294.71 + static int verbosity = Integer.getInteger("test.java.lang.invoke.JavaDocExamplesTest.verbosity", 0);
294.72 +
294.73 +{}
294.74 +static final private Lookup LOOKUP = lookup();
294.75 +// static final private MethodHandle CONCAT_1 = LOOKUP.findVirtual(String.class,
294.76 +// "concat", methodType(String.class, String.class));
294.77 +// static final private MethodHandle HASHCODE_1 = LOOKUP.findVirtual(Object.class,
294.78 +// "hashCode", methodType(int.class));
294.79 +
294.80 +// form required if ReflectiveOperationException is intercepted:
294.81 +static final private MethodHandle CONCAT_2, HASHCODE_2;
294.82 +static {
294.83 + try {
294.84 + CONCAT_2 = LOOKUP.findVirtual(String.class,
294.85 + "concat", methodType(String.class, String.class));
294.86 + HASHCODE_2 = LOOKUP.findVirtual(Object.class,
294.87 + "hashCode", methodType(int.class));
294.88 + } catch (ReflectiveOperationException ex) {
294.89 + throw new RuntimeException(ex);
294.90 + }
294.91 +}
294.92 +{}
294.93 +
294.94 + @Test public void testFindVirtual() throws Throwable {
294.95 +{}
294.96 +MethodHandle CONCAT_3 = LOOKUP.findVirtual(String.class,
294.97 + "concat", methodType(String.class, String.class));
294.98 +MethodHandle HASHCODE_3 = LOOKUP.findVirtual(Object.class,
294.99 + "hashCode", methodType(int.class));
294.100 +//assertEquals("xy", (String) CONCAT_1.invokeExact("x", "y"));
294.101 +assertEquals("xy", (String) CONCAT_2.invokeExact("x", "y"));
294.102 +assertEquals("xy", (String) CONCAT_3.invokeExact("x", "y"));
294.103 +//assertEquals("xy".hashCode(), (int) HASHCODE_1.invokeExact((Object)"xy"));
294.104 +assertEquals("xy".hashCode(), (int) HASHCODE_2.invokeExact((Object)"xy"));
294.105 +assertEquals("xy".hashCode(), (int) HASHCODE_3.invokeExact((Object)"xy"));
294.106 +{}
294.107 + }
294.108 + @Test public void testDropArguments() throws Throwable {
294.109 + {{
294.110 +{} /// JAVADOC
294.111 +MethodHandle cat = lookup().findVirtual(String.class,
294.112 + "concat", methodType(String.class, String.class));
294.113 +assertEquals("xy", (String) cat.invokeExact("x", "y"));
294.114 +MethodType bigType = cat.type().insertParameterTypes(0, int.class, String.class);
294.115 +MethodHandle d0 = dropArguments(cat, 0, bigType.parameterList().subList(0,2));
294.116 +assertEquals(bigType, d0.type());
294.117 +assertEquals("yz", (String) d0.invokeExact(123, "x", "y", "z"));
294.118 + }}
294.119 + {{
294.120 +{} /// JAVADOC
294.121 +MethodHandle cat = lookup().findVirtual(String.class,
294.122 + "concat", methodType(String.class, String.class));
294.123 +assertEquals("xy", (String) cat.invokeExact("x", "y"));
294.124 +MethodHandle d0 = dropArguments(cat, 0, String.class);
294.125 +assertEquals("yz", (String) d0.invokeExact("x", "y", "z"));
294.126 +MethodHandle d1 = dropArguments(cat, 1, String.class);
294.127 +assertEquals("xz", (String) d1.invokeExact("x", "y", "z"));
294.128 +MethodHandle d2 = dropArguments(cat, 2, String.class);
294.129 +assertEquals("xy", (String) d2.invokeExact("x", "y", "z"));
294.130 +MethodHandle d12 = dropArguments(cat, 1, int.class, boolean.class);
294.131 +assertEquals("xz", (String) d12.invokeExact("x", 12, true, "z"));
294.132 + }}
294.133 + }
294.134 +
294.135 + @Test public void testFilterArguments() throws Throwable {
294.136 + {{
294.137 +{} /// JAVADOC
294.138 +MethodHandle cat = lookup().findVirtual(String.class,
294.139 + "concat", methodType(String.class, String.class));
294.140 +MethodHandle upcase = lookup().findVirtual(String.class,
294.141 + "toUpperCase", methodType(String.class));
294.142 +assertEquals("xy", (String) cat.invokeExact("x", "y"));
294.143 +MethodHandle f0 = filterArguments(cat, 0, upcase);
294.144 +assertEquals("Xy", (String) f0.invokeExact("x", "y")); // Xy
294.145 +MethodHandle f1 = filterArguments(cat, 1, upcase);
294.146 +assertEquals("xY", (String) f1.invokeExact("x", "y")); // xY
294.147 +MethodHandle f2 = filterArguments(cat, 0, upcase, upcase);
294.148 +assertEquals("XY", (String) f2.invokeExact("x", "y")); // XY
294.149 + }}
294.150 + }
294.151 +
294.152 + static void assertEquals(Object exp, Object act) {
294.153 + if (verbosity > 0)
294.154 + System.out.println("result: "+act);
294.155 + Assert.assertEquals(exp, act);
294.156 + }
294.157 +
294.158 + @Test public void testMethodHandlesSummary() throws Throwable {
294.159 + {{
294.160 +{} /// JAVADOC
294.161 +Object x, y; String s; int i;
294.162 +MethodType mt; MethodHandle mh;
294.163 +MethodHandles.Lookup lookup = MethodHandles.lookup();
294.164 +// mt is (char,char)String
294.165 +mt = MethodType.methodType(String.class, char.class, char.class);
294.166 +mh = lookup.findVirtual(String.class, "replace", mt);
294.167 +s = (String) mh.invokeExact("daddy",'d','n');
294.168 +// invokeExact(Ljava/lang/String;CC)Ljava/lang/String;
294.169 +assert(s.equals("nanny"));
294.170 +// weakly typed invocation (using MHs.invoke)
294.171 +s = (String) mh.invokeWithArguments("sappy", 'p', 'v');
294.172 +assert(s.equals("savvy"));
294.173 +// mt is (Object[])List
294.174 +mt = MethodType.methodType(java.util.List.class, Object[].class);
294.175 +mh = lookup.findStatic(java.util.Arrays.class, "asList", mt);
294.176 +assert(mh.isVarargsCollector());
294.177 +x = mh.invokeGeneric("one", "two");
294.178 +// invokeGeneric(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;
294.179 +assert(x.equals(java.util.Arrays.asList("one","two")));
294.180 +// mt is (Object,Object,Object)Object
294.181 +mt = MethodType.genericMethodType(3);
294.182 +mh = mh.asType(mt);
294.183 +x = mh.invokeExact((Object)1, (Object)2, (Object)3);
294.184 +// invokeExact(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
294.185 +assert(x.equals(java.util.Arrays.asList(1,2,3)));
294.186 +// mt is { => int}
294.187 +mt = MethodType.methodType(int.class);
294.188 +mh = lookup.findVirtual(java.util.List.class, "size", mt);
294.189 +i = (int) mh.invokeExact(java.util.Arrays.asList(1,2,3));
294.190 +// invokeExact(Ljava/util/List;)I
294.191 +assert(i == 3);
294.192 +mt = MethodType.methodType(void.class, String.class);
294.193 +mh = lookup.findVirtual(java.io.PrintStream.class, "println", mt);
294.194 +mh.invokeExact(System.out, "Hello, world.");
294.195 +// invokeExact(Ljava/io/PrintStream;Ljava/lang/String;)V
294.196 +{}
294.197 + }}
294.198 + }
294.199 +
294.200 + @Test public void testAsVarargsCollector() throws Throwable {
294.201 + {{
294.202 +{} /// JAVADOC
294.203 +MethodHandle asList = publicLookup()
294.204 + .findStatic(Arrays.class, "asList", methodType(List.class, Object[].class))
294.205 + .asVarargsCollector(Object[].class);
294.206 +assertEquals("[]", asList.invokeGeneric().toString());
294.207 +assertEquals("[1]", asList.invokeGeneric(1).toString());
294.208 +assertEquals("[two, too]", asList.invokeGeneric("two", "too").toString());
294.209 +Object[] argv = { "three", "thee", "tee" };
294.210 +assertEquals("[three, thee, tee]", asList.invokeGeneric(argv).toString());
294.211 +List ls = (List) asList.invokeGeneric((Object)argv);
294.212 +assertEquals(1, ls.size());
294.213 +assertEquals("[three, thee, tee]", Arrays.toString((Object[])ls.get(0)));
294.214 + }}
294.215 + }
294.216 +
294.217 + @Test public void testVarargsCollectorSuppression() throws Throwable {
294.218 + {{
294.219 +{} /// JAVADOC
294.220 +MethodHandle vamh = publicLookup()
294.221 + .findStatic(Arrays.class, "asList", methodType(List.class, Object[].class))
294.222 + .asVarargsCollector(Object[].class);
294.223 +MethodHandle mh = MethodHandles.exactInvoker(vamh.type()).bindTo(vamh);
294.224 +assert(vamh.type().equals(mh.type()));
294.225 +assertEquals("[1, 2, 3]", vamh.invokeGeneric(1,2,3).toString());
294.226 +boolean failed = false;
294.227 +try { mh.invokeGeneric(1,2,3); }
294.228 +catch (WrongMethodTypeException ex) { failed = true; }
294.229 +assert(failed);
294.230 +{}
294.231 + }}
294.232 + }
294.233 +}
295.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
295.2 +++ b/test/java/lang/invoke/MethodHandlesTest.java Tue Mar 29 20:19:55 2011 -0700
295.3 @@ -0,0 +1,2400 @@
295.4 +/*
295.5 + * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
295.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
295.7 + *
295.8 + * This code is free software; you can redistribute it and/or modify it
295.9 + * under the terms of the GNU General Public License version 2 only, as
295.10 + * published by the Free Software Foundation. Oracle designates this
295.11 + * particular file as subject to the "Classpath" exception as provided
295.12 + * by Oracle in the LICENSE file that accompanied this code.
295.13 + *
295.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
295.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
295.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
295.17 + * version 2 for more details (a copy is included in the LICENSE file that
295.18 + * accompanied this code).
295.19 + *
295.20 + * You should have received a copy of the GNU General Public License version
295.21 + * 2 along with this work; if not, write to the Free Software Foundation,
295.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
295.23 + *
295.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
295.25 + * or visit www.oracle.com if you need additional information or have any
295.26 + * questions.
295.27 + */
295.28 +
295.29 +/* @test
295.30 + * @summary unit tests for java.lang.invoke.MethodHandles
295.31 + * @compile -source 7 -target 7 -XDallowTransitionalJSR292=no MethodHandlesTest.java
295.32 + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles test.java.lang.invoke.MethodHandlesTest
295.33 + */
295.34 +
295.35 +package test.java.lang.invoke;
295.36 +
295.37 +import java.lang.invoke.*;
295.38 +import java.lang.invoke.MethodHandles.Lookup;
295.39 +import java.lang.reflect.*;
295.40 +import java.util.*;
295.41 +import org.junit.*;
295.42 +import static org.junit.Assert.*;
295.43 +import static org.junit.Assume.*;
295.44 +
295.45 +
295.46 +/**
295.47 + *
295.48 + * @author jrose
295.49 + */
295.50 +public class MethodHandlesTest {
295.51 + // How much output?
295.52 + static int verbosity = 0;
295.53 + static {
295.54 + String vstr = System.getProperty("test.java.lang.invoke.MethodHandlesTest.verbosity");
295.55 + if (vstr != null) verbosity = Integer.parseInt(vstr);
295.56 + }
295.57 +
295.58 + // Set this true during development if you want to fast-forward to
295.59 + // a particular new, non-working test. Tests which are known to
295.60 + // work (or have recently worked) test this flag and return on true.
295.61 + static boolean CAN_SKIP_WORKING = false;
295.62 + //static { CAN_SKIP_WORKING = true; }
295.63 +
295.64 + // Set true to test more calls. If false, some tests are just
295.65 + // lookups, without exercising the actual method handle.
295.66 + static boolean DO_MORE_CALLS = true;
295.67 +
295.68 + @Test
295.69 + public void testFirst() throws Throwable {
295.70 + verbosity += 9; try {
295.71 + // left blank for debugging
295.72 + } finally { printCounts(); verbosity -= 9; }
295.73 + }
295.74 +
295.75 + // current failures
295.76 + @Test @Ignore("failure in call to makeRawRetypeOnly in ToGeneric")
295.77 + public void testFail_1() throws Throwable {
295.78 + // AMH.<init>: IllegalArgumentException: bad adapter (conversion=0xfffab300): adapter pushes too many parameters
295.79 + testSpreadArguments(int.class, 0, 6);
295.80 + }
295.81 + @Test @Ignore("failure in JVM when expanding the stack using asm stub for _adapter_spread_args")
295.82 + public void testFail_2() throws Throwable {
295.83 + // if CONV_OP_IMPLEMENTED_MASK includes OP_SPREAD_ARGS, this crashes:
295.84 + testSpreadArguments(Object.class, 0, 2);
295.85 + }
295.86 + @Test @Ignore("IllArgEx failure in call to ToGeneric.make")
295.87 + public void testFail_3() throws Throwable {
295.88 + // ToGeneric.<init>: UnsupportedOperationException: NYI: primitive parameters must follow references; entryType = (int,java.lang.Object)java.lang.Object
295.89 + testSpreadArguments(int.class, 1, 2);
295.90 + }
295.91 + @Test @Ignore("IllArgEx failure in call to ToGeneric.make")
295.92 + public void testFail_4() throws Throwable {
295.93 + // ToGeneric.<init>: UnsupportedOperationException: NYI: primitive parameters must follow references; entryType = (int,java.lang.Object)java.lang.Object
295.94 + testCollectArguments(int.class, 1, 2);
295.95 + }
295.96 + @Test @Ignore("cannot collect leading primitive types")
295.97 + public void testFail_5() throws Throwable {
295.98 + // ToGeneric.<init>: UnsupportedOperationException: NYI: primitive parameters must follow references; entryType = (int,java.lang.Object)java.lang.Object
295.99 + testInvokers(MethodType.genericMethodType(2).changeParameterType(0, int.class));
295.100 + }
295.101 + @Test @Ignore("should not insert arguments beyond MethodHandlePushLimit")
295.102 + public void testFail_6() throws Throwable {
295.103 + // ValueConversions.varargsArray: UnsupportedOperationException: NYI: cannot form a varargs array of length 13
295.104 + testInsertArguments(0, 0, MAX_ARG_INCREASE+10);
295.105 + }
295.106 + static final int MAX_ARG_INCREASE = 3;
295.107 +
295.108 + public MethodHandlesTest() {
295.109 + }
295.110 +
295.111 + @Before
295.112 + public void checkImplementedPlatform() {
295.113 + boolean platformOK = false;
295.114 + Properties properties = System.getProperties();
295.115 + String vers = properties.getProperty("java.vm.version");
295.116 + String name = properties.getProperty("java.vm.name");
295.117 + String arch = properties.getProperty("os.arch");
295.118 + if ((arch.equals("amd64") || arch.equals("i386") || arch.equals("x86") ||
295.119 + arch.equals("sparc") || arch.equals("sparcv9")) &&
295.120 + (name.contains("Client") || name.contains("Server"))
295.121 + ) {
295.122 + platformOK = true;
295.123 + } else {
295.124 + System.err.println("Skipping tests for unsupported platform: "+Arrays.asList(vers, name, arch));
295.125 + }
295.126 + assumeTrue(platformOK);
295.127 + }
295.128 +
295.129 + String testName;
295.130 + static int allPosTests, allNegTests;
295.131 + int posTests, negTests;
295.132 + @After
295.133 + public void printCounts() {
295.134 + if (verbosity >= 2 && (posTests | negTests) != 0) {
295.135 + System.out.println();
295.136 + if (posTests != 0) System.out.println("=== "+testName+": "+posTests+" positive test cases run");
295.137 + if (negTests != 0) System.out.println("=== "+testName+": "+negTests+" negative test cases run");
295.138 + allPosTests += posTests;
295.139 + allNegTests += negTests;
295.140 + posTests = negTests = 0;
295.141 + }
295.142 + }
295.143 + void countTest(boolean positive) {
295.144 + if (positive) ++posTests;
295.145 + else ++negTests;
295.146 + }
295.147 + void countTest() { countTest(true); }
295.148 + void startTest(String name) {
295.149 + if (testName != null) printCounts();
295.150 + if (verbosity >= 1)
295.151 + System.out.println(name);
295.152 + posTests = negTests = 0;
295.153 + testName = name;
295.154 + }
295.155 +
295.156 + @BeforeClass
295.157 + public static void setUpClass() throws Exception {
295.158 + calledLog.clear();
295.159 + calledLog.add(null);
295.160 + nextArgVal = INITIAL_ARG_VAL;
295.161 + }
295.162 +
295.163 + @AfterClass
295.164 + public static void tearDownClass() throws Exception {
295.165 + int posTests = allPosTests, negTests = allNegTests;
295.166 + if (verbosity >= 2 && (posTests | negTests) != 0) {
295.167 + System.out.println();
295.168 + if (posTests != 0) System.out.println("=== "+posTests+" total positive test cases");
295.169 + if (negTests != 0) System.out.println("=== "+negTests+" total negative test cases");
295.170 + }
295.171 + }
295.172 +
295.173 + static List<Object> calledLog = new ArrayList<Object>();
295.174 + static Object logEntry(String name, Object... args) {
295.175 + return Arrays.asList(name, Arrays.asList(args));
295.176 + }
295.177 + static Object called(String name, Object... args) {
295.178 + Object entry = logEntry(name, args);
295.179 + calledLog.add(entry);
295.180 + return entry;
295.181 + }
295.182 + static void assertCalled(String name, Object... args) {
295.183 + Object expected = logEntry(name, args);
295.184 + Object actual = calledLog.get(calledLog.size() - 1);
295.185 + if (expected.equals(actual) && verbosity < 9) return;
295.186 + System.out.println("assertCalled "+name+":");
295.187 + System.out.println("expected: "+expected);
295.188 + System.out.println("actual: "+actual);
295.189 + System.out.println("ex. types: "+getClasses(expected));
295.190 + System.out.println("act. types: "+getClasses(actual));
295.191 + assertEquals("previous method call", expected, actual);
295.192 + }
295.193 + static void printCalled(MethodHandle target, String name, Object... args) {
295.194 + if (verbosity >= 3)
295.195 + System.out.println("calling MH="+target+" to "+name+Arrays.toString(args));
295.196 + }
295.197 +
295.198 + static Object castToWrapper(Object value, Class<?> dst) {
295.199 + Object wrap = null;
295.200 + if (value instanceof Number)
295.201 + wrap = castToWrapperOrNull(((Number)value).longValue(), dst);
295.202 + if (value instanceof Character)
295.203 + wrap = castToWrapperOrNull((char)(Character)value, dst);
295.204 + if (wrap != null) return wrap;
295.205 + return dst.cast(value);
295.206 + }
295.207 +
295.208 + static Object castToWrapperOrNull(long value, Class<?> dst) {
295.209 + if (dst == int.class || dst == Integer.class)
295.210 + return (int)(value);
295.211 + if (dst == long.class || dst == Long.class)
295.212 + return (long)(value);
295.213 + if (dst == char.class || dst == Character.class)
295.214 + return (char)(value);
295.215 + if (dst == short.class || dst == Short.class)
295.216 + return (short)(value);
295.217 + if (dst == float.class || dst == Float.class)
295.218 + return (float)(value);
295.219 + if (dst == double.class || dst == Double.class)
295.220 + return (double)(value);
295.221 + if (dst == byte.class || dst == Byte.class)
295.222 + return (byte)(value);
295.223 + if (dst == boolean.class || dst == boolean.class)
295.224 + return ((value % 29) & 1) == 0;
295.225 + return null;
295.226 + }
295.227 +
295.228 + static final int ONE_MILLION = (1000*1000), // first int value
295.229 + TEN_BILLION = (10*1000*1000*1000), // scale factor to reach upper 32 bits
295.230 + INITIAL_ARG_VAL = ONE_MILLION << 1; // <<1 makes space for sign bit;
295.231 + static long nextArgVal;
295.232 + static long nextArg(boolean moreBits) {
295.233 + long val = nextArgVal++;
295.234 + long sign = -(val & 1); // alternate signs
295.235 + val >>= 1;
295.236 + if (moreBits)
295.237 + // Guarantee some bits in the high word.
295.238 + // In any case keep the decimal representation simple-looking,
295.239 + // with lots of zeroes, so as not to make the printed decimal
295.240 + // strings unnecessarily noisy.
295.241 + val += (val % ONE_MILLION) * TEN_BILLION;
295.242 + return val ^ sign;
295.243 + }
295.244 + static int nextArg() {
295.245 + // Produce a 32-bit result something like ONE_MILLION+(smallint).
295.246 + // Example: 1_000_042.
295.247 + return (int) nextArg(false);
295.248 + }
295.249 + static long nextArg(Class<?> kind) {
295.250 + if (kind == long.class || kind == Long.class ||
295.251 + kind == double.class || kind == Double.class)
295.252 + // produce a 64-bit result something like
295.253 + // ((TEN_BILLION+1) * (ONE_MILLION+(smallint)))
295.254 + // Example: 10_000_420_001_000_042.
295.255 + return nextArg(true);
295.256 + return (long) nextArg();
295.257 + }
295.258 +
295.259 + static Object randomArg(Class<?> param) {
295.260 + Object wrap = castToWrapperOrNull(nextArg(param), param);
295.261 + if (wrap != null) {
295.262 + return wrap;
295.263 + }
295.264 +// import sun.invoke.util.Wrapper;
295.265 +// Wrapper wrap = Wrapper.forBasicType(dst);
295.266 +// if (wrap == Wrapper.OBJECT && Wrapper.isWrapperType(dst))
295.267 +// wrap = Wrapper.forWrapperType(dst);
295.268 +// if (wrap != Wrapper.OBJECT)
295.269 +// return wrap.wrap(nextArg++);
295.270 + if (param.isInterface()) {
295.271 + for (Class<?> c : param.getClasses()) {
295.272 + if (param.isAssignableFrom(c) && !c.isInterface())
295.273 + { param = c; break; }
295.274 + }
295.275 + }
295.276 + if (param.isInterface() || param.isAssignableFrom(String.class))
295.277 + return "#"+nextArg();
295.278 + else
295.279 + try {
295.280 + return param.newInstance();
295.281 + } catch (InstantiationException ex) {
295.282 + } catch (IllegalAccessException ex) {
295.283 + }
295.284 + return null; // random class not Object, String, Integer, etc.
295.285 + }
295.286 + static Object[] randomArgs(Class<?>... params) {
295.287 + Object[] args = new Object[params.length];
295.288 + for (int i = 0; i < args.length; i++)
295.289 + args[i] = randomArg(params[i]);
295.290 + return args;
295.291 + }
295.292 + static Object[] randomArgs(int nargs, Class<?> param) {
295.293 + Object[] args = new Object[nargs];
295.294 + for (int i = 0; i < args.length; i++)
295.295 + args[i] = randomArg(param);
295.296 + return args;
295.297 + }
295.298 +
295.299 + static <T, E extends T> T[] array(Class<T[]> atype, E... a) {
295.300 + return Arrays.copyOf(a, a.length, atype);
295.301 + }
295.302 + static <T> T[] cat(T[] a, T... b) {
295.303 + int alen = a.length, blen = b.length;
295.304 + if (blen == 0) return a;
295.305 + T[] c = Arrays.copyOf(a, alen + blen);
295.306 + System.arraycopy(b, 0, c, alen, blen);
295.307 + return c;
295.308 + }
295.309 + static Integer[] boxAll(int... vx) {
295.310 + Integer[] res = new Integer[vx.length];
295.311 + for (int i = 0; i < res.length; i++) {
295.312 + res[i] = vx[i];
295.313 + }
295.314 + return res;
295.315 + }
295.316 + static Object getClasses(Object x) {
295.317 + if (x == null) return x;
295.318 + if (x instanceof String) return x; // keep the name
295.319 + if (x instanceof List) {
295.320 + // recursively report classes of the list elements
295.321 + Object[] xa = ((List)x).toArray();
295.322 + for (int i = 0; i < xa.length; i++)
295.323 + xa[i] = getClasses(xa[i]);
295.324 + return Arrays.asList(xa);
295.325 + }
295.326 + return x.getClass().getSimpleName();
295.327 + }
295.328 +
295.329 + /** Return lambda(arg...[arity]) { new Object[]{ arg... } } */
295.330 + static MethodHandle varargsList(int arity) {
295.331 + return ValueConversions.varargsList(arity);
295.332 + }
295.333 + /** Return lambda(arg...[arity]) { Arrays.asList(arg...) } */
295.334 + static MethodHandle varargsArray(int arity) {
295.335 + return ValueConversions.varargsArray(arity);
295.336 + }
295.337 + /** Variation of varargsList, but with the given rtype. */
295.338 + static MethodHandle varargsList(int arity, Class<?> rtype) {
295.339 + MethodHandle list = varargsList(arity);
295.340 + MethodType listType = list.type().changeReturnType(rtype);
295.341 + if (List.class.isAssignableFrom(rtype) || rtype == void.class || rtype == Object.class) {
295.342 + // OK
295.343 + } else if (rtype.isAssignableFrom(String.class)) {
295.344 + if (LIST_TO_STRING == null)
295.345 + try {
295.346 + LIST_TO_STRING = PRIVATE.findStatic(PRIVATE.lookupClass(), "listToString",
295.347 + MethodType.methodType(String.class, List.class));
295.348 + } catch (Exception ex) { throw new RuntimeException(ex); }
295.349 + list = MethodHandles.filterReturnValue(list, LIST_TO_STRING);
295.350 + } else if (rtype.isPrimitive()) {
295.351 + if (LIST_TO_INT == null)
295.352 + try {
295.353 + LIST_TO_INT = PRIVATE.findStatic(PRIVATE.lookupClass(), "listToInt",
295.354 + MethodType.methodType(int.class, List.class));
295.355 + } catch (Exception ex) { throw new RuntimeException(ex); }
295.356 + list = MethodHandles.filterReturnValue(list, LIST_TO_INT);
295.357 + list = MethodHandles.explicitCastArguments(list, listType);
295.358 + } else {
295.359 + throw new RuntimeException("varargsList: "+rtype);
295.360 + }
295.361 + return list.asType(listType);
295.362 + }
295.363 + private static MethodHandle LIST_TO_STRING, LIST_TO_INT;
295.364 + private static String listToString(List x) { return x.toString(); }
295.365 + private static int listToInt(List x) { return x.toString().hashCode(); }
295.366 +
295.367 + static MethodHandle changeArgTypes(MethodHandle target, Class<?> argType) {
295.368 + return changeArgTypes(target, 0, 999, argType);
295.369 + }
295.370 + static MethodHandle changeArgTypes(MethodHandle target,
295.371 + int beg, int end, Class<?> argType) {
295.372 + MethodType targetType = target.type();
295.373 + end = Math.min(end, targetType.parameterCount());
295.374 + ArrayList<Class<?>> argTypes = new ArrayList<Class<?>>(targetType.parameterList());
295.375 + Collections.fill(argTypes.subList(beg, end), argType);
295.376 + MethodType ttype2 = MethodType.methodType(targetType.returnType(), argTypes);
295.377 + return MethodHandles.convertArguments(target, ttype2);
295.378 + }
295.379 +
295.380 + // This lookup is good for all members in and under MethodHandlesTest.
295.381 + static final Lookup PRIVATE = MethodHandles.lookup();
295.382 + // This lookup is good for package-private members but not private ones.
295.383 + static final Lookup PACKAGE = PackageSibling.lookup();
295.384 + // This lookup is good only for public members.
295.385 + static final Lookup PUBLIC = MethodHandles.publicLookup();
295.386 +
295.387 + // Subject methods...
295.388 + static class Example implements IntExample {
295.389 + final String name;
295.390 + public Example() { name = "Example#"+nextArg(); }
295.391 + protected Example(String name) { this.name = name; }
295.392 + protected Example(int x) { this(); called("protected <init>", this, x); }
295.393 + @Override public String toString() { return name; }
295.394 +
295.395 + public void v0() { called("v0", this); }
295.396 + void pkg_v0() { called("pkg_v0", this); }
295.397 + private void pri_v0() { called("pri_v0", this); }
295.398 + public static void s0() { called("s0"); }
295.399 + static void pkg_s0() { called("pkg_s0"); }
295.400 + private static void pri_s0() { called("pri_s0"); }
295.401 +
295.402 + public Object v1(Object x) { return called("v1", this, x); }
295.403 + public Object v2(Object x, Object y) { return called("v2", this, x, y); }
295.404 + public Object v2(Object x, int y) { return called("v2", this, x, y); }
295.405 + public Object v2(int x, Object y) { return called("v2", this, x, y); }
295.406 + public Object v2(int x, int y) { return called("v2", this, x, y); }
295.407 + public static Object s1(Object x) { return called("s1", x); }
295.408 + public static Object s2(int x) { return called("s2", x); }
295.409 + public static Object s3(long x) { return called("s3", x); }
295.410 + public static Object s4(int x, int y) { return called("s4", x, y); }
295.411 + public static Object s5(long x, int y) { return called("s5", x, y); }
295.412 + public static Object s6(int x, long y) { return called("s6", x, y); }
295.413 + public static Object s7(float x, double y) { return called("s7", x, y); }
295.414 +
295.415 + static final Lookup EXAMPLE = MethodHandles.lookup(); // for testing findSpecial
295.416 + }
295.417 + static final Lookup EXAMPLE = Example.EXAMPLE;
295.418 + public static class PubExample extends Example {
295.419 + public PubExample() { super("PubExample#"+nextArg()); }
295.420 + }
295.421 + static class SubExample extends Example {
295.422 + @Override public void v0() { called("Sub/v0", this); }
295.423 + @Override void pkg_v0() { called("Sub/pkg_v0", this); }
295.424 + private SubExample(int x) { called("<init>", this, x); }
295.425 + public SubExample() { super("SubExample#"+nextArg()); }
295.426 + }
295.427 + public static interface IntExample {
295.428 + public void v0();
295.429 + public static class Impl implements IntExample {
295.430 + public void v0() { called("Int/v0", this); }
295.431 + final String name;
295.432 + public Impl() { name = "Impl#"+nextArg(); }
295.433 + @Override public String toString() { return name; }
295.434 + }
295.435 + }
295.436 +
295.437 + static final Object[][][] ACCESS_CASES = {
295.438 + { { false, PUBLIC }, { false, PACKAGE }, { false, PRIVATE }, { false, EXAMPLE } }, //[0]: all false
295.439 + { { false, PUBLIC }, { false, PACKAGE }, { true, PRIVATE }, { true, EXAMPLE } }, //[1]: only PRIVATE
295.440 + { { false, PUBLIC }, { true, PACKAGE }, { true, PRIVATE }, { true, EXAMPLE } }, //[2]: PUBLIC false
295.441 + { { true, PUBLIC }, { true, PACKAGE }, { true, PRIVATE }, { true, EXAMPLE } }, //[3]: all true
295.442 + };
295.443 +
295.444 + static Object[][] accessCases(Class<?> defc, String name, boolean isSpecial) {
295.445 + Object[][] cases;
295.446 + if (name.contains("pri_") || isSpecial) {
295.447 + cases = ACCESS_CASES[1]; // PRIVATE only
295.448 + } else if (name.contains("pkg_") || !Modifier.isPublic(defc.getModifiers())) {
295.449 + cases = ACCESS_CASES[2]; // not PUBLIC
295.450 + } else {
295.451 + assertTrue(name.indexOf('_') < 0);
295.452 + boolean pubc = Modifier.isPublic(defc.getModifiers());
295.453 + if (pubc)
295.454 + cases = ACCESS_CASES[3]; // all access levels
295.455 + else
295.456 + cases = ACCESS_CASES[2]; // PACKAGE but not PUBLIC
295.457 + }
295.458 + if (defc != Example.class && cases[cases.length-1][1] == EXAMPLE)
295.459 + cases = Arrays.copyOfRange(cases, 0, cases.length-1);
295.460 + return cases;
295.461 + }
295.462 + static Object[][] accessCases(Class<?> defc, String name) {
295.463 + return accessCases(defc, name, false);
295.464 + }
295.465 +
295.466 + @Test
295.467 + public void testFindStatic() throws Throwable {
295.468 + if (CAN_SKIP_WORKING) return;
295.469 + startTest("findStatic");
295.470 + testFindStatic(PubExample.class, void.class, "s0");
295.471 + testFindStatic(Example.class, void.class, "s0");
295.472 + testFindStatic(Example.class, void.class, "pkg_s0");
295.473 + testFindStatic(Example.class, void.class, "pri_s0");
295.474 +
295.475 + testFindStatic(Example.class, Object.class, "s1", Object.class);
295.476 + testFindStatic(Example.class, Object.class, "s2", int.class);
295.477 + testFindStatic(Example.class, Object.class, "s3", long.class);
295.478 + testFindStatic(Example.class, Object.class, "s4", int.class, int.class);
295.479 + testFindStatic(Example.class, Object.class, "s5", long.class, int.class);
295.480 + testFindStatic(Example.class, Object.class, "s6", int.class, long.class);
295.481 + testFindStatic(Example.class, Object.class, "s7", float.class, double.class);
295.482 +
295.483 + testFindStatic(false, PRIVATE, Example.class, void.class, "bogus");
295.484 + }
295.485 +
295.486 + void testFindStatic(Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
295.487 + for (Object[] ac : accessCases(defc, name)) {
295.488 + testFindStatic((Boolean)ac[0], (Lookup)ac[1], defc, ret, name, params);
295.489 + }
295.490 + }
295.491 + void testFindStatic(Lookup lookup, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
295.492 + testFindStatic(true, lookup, defc, ret, name, params);
295.493 + }
295.494 + void testFindStatic(boolean positive, Lookup lookup, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
295.495 + countTest(positive);
295.496 + MethodType type = MethodType.methodType(ret, params);
295.497 + MethodHandle target = null;
295.498 + Exception noAccess = null;
295.499 + try {
295.500 + if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
295.501 + target = lookup.in(defc).findStatic(defc, name, type);
295.502 + } catch (ReflectiveOperationException ex) {
295.503 + noAccess = ex;
295.504 + if (name.contains("bogus"))
295.505 + assertTrue(noAccess instanceof NoSuchMethodException);
295.506 + else
295.507 + assertTrue(noAccess instanceof IllegalAccessException);
295.508 + }
295.509 + if (verbosity >= 3)
295.510 + System.out.println("findStatic "+lookup+": "+defc.getName()+"."+name+"/"+type+" => "+target
295.511 + +(noAccess == null ? "" : " !! "+noAccess));
295.512 + if (positive && noAccess != null) throw noAccess;
295.513 + assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null);
295.514 + if (!positive) return; // negative test failed as expected
295.515 + assertEquals(type, target.type());
295.516 + assertNameStringContains(target, name);
295.517 + if (!DO_MORE_CALLS && lookup != PRIVATE) return;
295.518 + Object[] args = randomArgs(params);
295.519 + printCalled(target, name, args);
295.520 + target.invokeWithArguments(args);
295.521 + assertCalled(name, args);
295.522 + if (verbosity >= 1)
295.523 + System.out.print(':');
295.524 + }
295.525 +
295.526 + // rough check of name string
295.527 + static void assertNameStringContains(Object x, String s) {
295.528 + if (x.toString().contains(s)) return;
295.529 + assertEquals(s, x);
295.530 + }
295.531 +
295.532 + @Test
295.533 + public void testFindVirtual() throws Throwable {
295.534 + if (CAN_SKIP_WORKING) return;
295.535 + startTest("findVirtual");
295.536 + testFindVirtual(Example.class, void.class, "v0");
295.537 + testFindVirtual(Example.class, void.class, "pkg_v0");
295.538 + testFindVirtual(Example.class, void.class, "pri_v0");
295.539 + testFindVirtual(Example.class, Object.class, "v1", Object.class);
295.540 + testFindVirtual(Example.class, Object.class, "v2", Object.class, Object.class);
295.541 + testFindVirtual(Example.class, Object.class, "v2", Object.class, int.class);
295.542 + testFindVirtual(Example.class, Object.class, "v2", int.class, Object.class);
295.543 + testFindVirtual(Example.class, Object.class, "v2", int.class, int.class);
295.544 + testFindVirtual(false, PRIVATE, Example.class, Example.class, void.class, "bogus");
295.545 + // test dispatch
295.546 + testFindVirtual(SubExample.class, SubExample.class, void.class, "Sub/v0");
295.547 + testFindVirtual(SubExample.class, Example.class, void.class, "Sub/v0");
295.548 + testFindVirtual(SubExample.class, IntExample.class, void.class, "Sub/v0");
295.549 + testFindVirtual(SubExample.class, SubExample.class, void.class, "Sub/pkg_v0");
295.550 + testFindVirtual(SubExample.class, Example.class, void.class, "Sub/pkg_v0");
295.551 + testFindVirtual(Example.class, IntExample.class, void.class, "v0");
295.552 + testFindVirtual(IntExample.Impl.class, IntExample.class, void.class, "Int/v0");
295.553 + }
295.554 +
295.555 + void testFindVirtual(Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
295.556 + Class<?> rcvc = defc;
295.557 + testFindVirtual(rcvc, defc, ret, name, params);
295.558 + }
295.559 + void testFindVirtual(Class<?> rcvc, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
295.560 + for (Object[] ac : accessCases(defc, name)) {
295.561 + testFindVirtual((Boolean)ac[0], (Lookup)ac[1], rcvc, defc, ret, name, params);
295.562 + }
295.563 + }
295.564 + void testFindVirtual(Lookup lookup, Class<?> rcvc, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
295.565 + testFindVirtual(true, lookup, rcvc, defc, ret, name, params);
295.566 + }
295.567 + void testFindVirtual(boolean positive, Lookup lookup, Class<?> rcvc, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
295.568 + countTest(positive);
295.569 + String methodName = name.substring(1 + name.indexOf('/')); // foo/bar => foo
295.570 + MethodType type = MethodType.methodType(ret, params);
295.571 + MethodHandle target = null;
295.572 + Exception noAccess = null;
295.573 + try {
295.574 + if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
295.575 + target = lookup.in(defc).findVirtual(defc, methodName, type);
295.576 + } catch (ReflectiveOperationException ex) {
295.577 + noAccess = ex;
295.578 + if (name.contains("bogus"))
295.579 + assertTrue(noAccess instanceof NoSuchMethodException);
295.580 + else
295.581 + assertTrue(noAccess instanceof IllegalAccessException);
295.582 + }
295.583 + if (verbosity >= 3)
295.584 + System.out.println("findVirtual "+lookup+": "+defc.getName()+"."+name+"/"+type+" => "+target
295.585 + +(noAccess == null ? "" : " !! "+noAccess));
295.586 + if (positive && noAccess != null) throw noAccess;
295.587 + assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null);
295.588 + if (!positive) return; // negative test failed as expected
295.589 + Class<?>[] paramsWithSelf = cat(array(Class[].class, (Class)defc), params);
295.590 + MethodType typeWithSelf = MethodType.methodType(ret, paramsWithSelf);
295.591 + assertEquals(typeWithSelf, target.type());
295.592 + assertNameStringContains(target, methodName);
295.593 + if (!DO_MORE_CALLS && lookup != PRIVATE) return;
295.594 + Object[] argsWithSelf = randomArgs(paramsWithSelf);
295.595 + if (rcvc != defc) argsWithSelf[0] = randomArg(rcvc);
295.596 + printCalled(target, name, argsWithSelf);
295.597 + target.invokeWithArguments(argsWithSelf);
295.598 + assertCalled(name, argsWithSelf);
295.599 + if (verbosity >= 1)
295.600 + System.out.print(':');
295.601 + }
295.602 +
295.603 + @Test
295.604 + public void testFindSpecial() throws Throwable {
295.605 + if (CAN_SKIP_WORKING) return;
295.606 + startTest("findSpecial");
295.607 + testFindSpecial(SubExample.class, Example.class, void.class, "v0");
295.608 + testFindSpecial(SubExample.class, Example.class, void.class, "pkg_v0");
295.609 + // Do some negative testing:
295.610 + testFindSpecial(false, EXAMPLE, SubExample.class, Example.class, void.class, "bogus");
295.611 + testFindSpecial(false, PRIVATE, SubExample.class, Example.class, void.class, "bogus");
295.612 + for (Lookup lookup : new Lookup[]{ PRIVATE, EXAMPLE, PACKAGE, PUBLIC }) {
295.613 + testFindSpecial(false, lookup, Object.class, Example.class, void.class, "v0");
295.614 + testFindSpecial(false, lookup, SubExample.class, Example.class, void.class, "<init>", int.class);
295.615 + testFindSpecial(false, lookup, SubExample.class, Example.class, void.class, "s0");
295.616 + }
295.617 + }
295.618 +
295.619 + void testFindSpecial(Class<?> specialCaller,
295.620 + Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
295.621 + testFindSpecial(true, EXAMPLE, specialCaller, defc, ret, name, params);
295.622 + testFindSpecial(true, PRIVATE, specialCaller, defc, ret, name, params);
295.623 + testFindSpecial(false, PACKAGE, specialCaller, defc, ret, name, params);
295.624 + testFindSpecial(false, PUBLIC, specialCaller, defc, ret, name, params);
295.625 + }
295.626 + void testFindSpecial(boolean positive, Lookup lookup, Class<?> specialCaller,
295.627 + Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
295.628 + countTest(positive);
295.629 + MethodType type = MethodType.methodType(ret, params);
295.630 + MethodHandle target = null;
295.631 + Exception noAccess = null;
295.632 + try {
295.633 + if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
295.634 + if (verbosity >= 5) System.out.println(" lookup => "+lookup.in(specialCaller));
295.635 + target = lookup.in(specialCaller).findSpecial(defc, name, type, specialCaller);
295.636 + } catch (ReflectiveOperationException ex) {
295.637 + noAccess = ex;
295.638 + if (name.contains("bogus"))
295.639 + assertTrue(noAccess instanceof NoSuchMethodException);
295.640 + else
295.641 + assertTrue(noAccess instanceof IllegalAccessException);
295.642 + }
295.643 + if (verbosity >= 3)
295.644 + System.out.println("findSpecial from "+specialCaller.getName()+" to "+defc.getName()+"."+name+"/"+type+" => "+target
295.645 + +(target == null ? "" : target.type())
295.646 + +(noAccess == null ? "" : " !! "+noAccess));
295.647 + if (positive && noAccess != null) throw noAccess;
295.648 + assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null);
295.649 + if (!positive) return; // negative test failed as expected
295.650 + assertEquals(specialCaller, target.type().parameterType(0));
295.651 + assertEquals(type, target.type().dropParameterTypes(0,1));
295.652 + Class<?>[] paramsWithSelf = cat(array(Class[].class, (Class)specialCaller), params);
295.653 + MethodType typeWithSelf = MethodType.methodType(ret, paramsWithSelf);
295.654 + assertNameStringContains(target, name);
295.655 + if (!DO_MORE_CALLS && lookup != PRIVATE && lookup != EXAMPLE) return;
295.656 + Object[] args = randomArgs(paramsWithSelf);
295.657 + printCalled(target, name, args);
295.658 + target.invokeWithArguments(args);
295.659 + assertCalled(name, args);
295.660 + }
295.661 +
295.662 + @Test
295.663 + public void testBind() throws Throwable {
295.664 + if (CAN_SKIP_WORKING) return;
295.665 + startTest("bind");
295.666 + testBind(Example.class, void.class, "v0");
295.667 + testBind(Example.class, void.class, "pkg_v0");
295.668 + testBind(Example.class, void.class, "pri_v0");
295.669 + testBind(Example.class, Object.class, "v1", Object.class);
295.670 + testBind(Example.class, Object.class, "v2", Object.class, Object.class);
295.671 + testBind(Example.class, Object.class, "v2", Object.class, int.class);
295.672 + testBind(Example.class, Object.class, "v2", int.class, Object.class);
295.673 + testBind(Example.class, Object.class, "v2", int.class, int.class);
295.674 + testBind(false, PRIVATE, Example.class, void.class, "bogus");
295.675 + testBind(SubExample.class, void.class, "Sub/v0");
295.676 + testBind(SubExample.class, void.class, "Sub/pkg_v0");
295.677 + testBind(IntExample.Impl.class, void.class, "Int/v0");
295.678 + }
295.679 +
295.680 + void testBind(Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
295.681 + for (Object[] ac : accessCases(defc, name)) {
295.682 + testBind((Boolean)ac[0], (Lookup)ac[1], defc, ret, name, params);
295.683 + }
295.684 + }
295.685 +
295.686 + void testBind(boolean positive, Lookup lookup, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
295.687 + countTest(positive);
295.688 + String methodName = name.substring(1 + name.indexOf('/')); // foo/bar => foo
295.689 + MethodType type = MethodType.methodType(ret, params);
295.690 + Object receiver = randomArg(defc);
295.691 + MethodHandle target = null;
295.692 + Exception noAccess = null;
295.693 + try {
295.694 + if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
295.695 + target = lookup.in(defc).bind(receiver, methodName, type);
295.696 + } catch (ReflectiveOperationException ex) {
295.697 + noAccess = ex;
295.698 + if (name.contains("bogus"))
295.699 + assertTrue(noAccess instanceof NoSuchMethodException);
295.700 + else
295.701 + assertTrue(noAccess instanceof IllegalAccessException);
295.702 + }
295.703 + if (verbosity >= 3)
295.704 + System.out.println("bind "+receiver+"."+name+"/"+type+" => "+target
295.705 + +(noAccess == null ? "" : " !! "+noAccess));
295.706 + if (positive && noAccess != null) throw noAccess;
295.707 + assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null);
295.708 + if (!positive) return; // negative test failed as expected
295.709 + assertEquals(type, target.type());
295.710 + Object[] args = randomArgs(params);
295.711 + printCalled(target, name, args);
295.712 + target.invokeWithArguments(args);
295.713 + Object[] argsWithReceiver = cat(array(Object[].class, receiver), args);
295.714 + assertCalled(name, argsWithReceiver);
295.715 + if (verbosity >= 1)
295.716 + System.out.print(':');
295.717 + }
295.718 +
295.719 + @Test
295.720 + public void testUnreflect() throws Throwable {
295.721 + if (CAN_SKIP_WORKING) return;
295.722 + startTest("unreflect");
295.723 + testUnreflect(Example.class, true, void.class, "s0");
295.724 + testUnreflect(Example.class, true, void.class, "pkg_s0");
295.725 + testUnreflect(Example.class, true, void.class, "pri_s0");
295.726 +
295.727 + testUnreflect(Example.class, true, Object.class, "s1", Object.class);
295.728 + testUnreflect(Example.class, true, Object.class, "s2", int.class);
295.729 + testUnreflect(Example.class, true, Object.class, "s3", long.class);
295.730 + testUnreflect(Example.class, true, Object.class, "s4", int.class, int.class);
295.731 + testUnreflect(Example.class, true, Object.class, "s5", long.class, int.class);
295.732 + testUnreflect(Example.class, true, Object.class, "s6", int.class, long.class);
295.733 +
295.734 + testUnreflect(Example.class, false, void.class, "v0");
295.735 + testUnreflect(Example.class, false, void.class, "pkg_v0");
295.736 + testUnreflect(Example.class, false, void.class, "pri_v0");
295.737 + testUnreflect(Example.class, false, Object.class, "v1", Object.class);
295.738 + testUnreflect(Example.class, false, Object.class, "v2", Object.class, Object.class);
295.739 + testUnreflect(Example.class, false, Object.class, "v2", Object.class, int.class);
295.740 + testUnreflect(Example.class, false, Object.class, "v2", int.class, Object.class);
295.741 + testUnreflect(Example.class, false, Object.class, "v2", int.class, int.class);
295.742 + }
295.743 +
295.744 + void testUnreflect(Class<?> defc, boolean isStatic, Class<?> ret, String name, Class<?>... params) throws Throwable {
295.745 + for (Object[] ac : accessCases(defc, name)) {
295.746 + testUnreflectMaybeSpecial(null, (Boolean)ac[0], (Lookup)ac[1], defc, (isStatic ? null : defc), ret, name, params);
295.747 + }
295.748 + }
295.749 + void testUnreflect(Class<?> defc, Class<?> rcvc, Class<?> ret, String name, Class<?>... params) throws Throwable {
295.750 + for (Object[] ac : accessCases(defc, name)) {
295.751 + testUnreflectMaybeSpecial(null, (Boolean)ac[0], (Lookup)ac[1], defc, rcvc, ret, name, params);
295.752 + }
295.753 + }
295.754 + void testUnreflectMaybeSpecial(Class<?> specialCaller,
295.755 + boolean positive, Lookup lookup,
295.756 + Class<?> defc, Class<?> rcvc, Class<?> ret, String name, Class<?>... params) throws Throwable {
295.757 + countTest(positive);
295.758 + MethodType type = MethodType.methodType(ret, params);
295.759 + Method rmethod = defc.getDeclaredMethod(name, params);
295.760 + MethodHandle target = null;
295.761 + Exception noAccess = null;
295.762 + boolean isStatic = (rcvc == null);
295.763 + boolean isSpecial = (specialCaller != null);
295.764 + try {
295.765 + if (verbosity >= 4) System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
295.766 + if (isSpecial)
295.767 + target = lookup.in(specialCaller).unreflectSpecial(rmethod, specialCaller);
295.768 + else
295.769 + target = lookup.in(defc).unreflect(rmethod);
295.770 + } catch (ReflectiveOperationException ex) {
295.771 + noAccess = ex;
295.772 + if (name.contains("bogus"))
295.773 + assertTrue(noAccess instanceof NoSuchMethodException);
295.774 + else
295.775 + assertTrue(noAccess instanceof IllegalAccessException);
295.776 + }
295.777 + if (verbosity >= 3)
295.778 + System.out.println("unreflect"+(isSpecial?"Special":"")+" "+defc.getName()+"."+name+"/"+type
295.779 + +(!isSpecial ? "" : " specialCaller="+specialCaller)
295.780 + +( isStatic ? "" : " receiver="+rcvc)
295.781 + +" => "+target
295.782 + +(noAccess == null ? "" : " !! "+noAccess));
295.783 + if (positive && noAccess != null) throw noAccess;
295.784 + assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null);
295.785 + if (!positive) return; // negative test failed as expected
295.786 + assertEquals(isStatic, Modifier.isStatic(rmethod.getModifiers()));
295.787 + Class<?>[] paramsMaybeWithSelf = params;
295.788 + if (!isStatic) {
295.789 + paramsMaybeWithSelf = cat(array(Class[].class, (Class)rcvc), params);
295.790 + }
295.791 + MethodType typeMaybeWithSelf = MethodType.methodType(ret, paramsMaybeWithSelf);
295.792 + if (isStatic) {
295.793 + assertEquals(typeMaybeWithSelf, target.type());
295.794 + } else {
295.795 + if (isSpecial)
295.796 + assertEquals(specialCaller, target.type().parameterType(0));
295.797 + else
295.798 + assertEquals(defc, target.type().parameterType(0));
295.799 + assertEquals(typeMaybeWithSelf, target.type().changeParameterType(0, rcvc));
295.800 + }
295.801 + Object[] argsMaybeWithSelf = randomArgs(paramsMaybeWithSelf);
295.802 + printCalled(target, name, argsMaybeWithSelf);
295.803 + target.invokeWithArguments(argsMaybeWithSelf);
295.804 + assertCalled(name, argsMaybeWithSelf);
295.805 + if (verbosity >= 1)
295.806 + System.out.print(':');
295.807 + }
295.808 +
295.809 + void testUnreflectSpecial(Class<?> defc, Class<?> rcvc, Class<?> ret, String name, Class<?>... params) throws Throwable {
295.810 + for (Object[] ac : accessCases(defc, name, true)) {
295.811 + Class<?> specialCaller = rcvc;
295.812 + testUnreflectMaybeSpecial(specialCaller, (Boolean)ac[0], (Lookup)ac[1], defc, rcvc, ret, name, params);
295.813 + }
295.814 + }
295.815 +
295.816 + @Test
295.817 + public void testUnreflectSpecial() throws Throwable {
295.818 + if (CAN_SKIP_WORKING) return;
295.819 + startTest("unreflectSpecial");
295.820 + testUnreflectSpecial(Example.class, Example.class, void.class, "v0");
295.821 + testUnreflectSpecial(Example.class, SubExample.class, void.class, "v0");
295.822 + testUnreflectSpecial(Example.class, Example.class, void.class, "pkg_v0");
295.823 + testUnreflectSpecial(Example.class, SubExample.class, void.class, "pkg_v0");
295.824 + testUnreflectSpecial(Example.class, Example.class, Object.class, "v2", int.class, int.class);
295.825 + testUnreflectSpecial(Example.class, SubExample.class, Object.class, "v2", int.class, int.class);
295.826 + testUnreflectMaybeSpecial(Example.class, false, PRIVATE, Example.class, Example.class, void.class, "s0");
295.827 + }
295.828 +
295.829 + public static class HasFields {
295.830 + boolean fZ = false;
295.831 + byte fB = (byte)'B';
295.832 + short fS = (short)'S';
295.833 + char fC = 'C';
295.834 + int fI = 'I';
295.835 + long fJ = 'J';
295.836 + float fF = 'F';
295.837 + double fD = 'D';
295.838 + static boolean sZ = true;
295.839 + static byte sB = 1+(byte)'B';
295.840 + static short sS = 1+(short)'S';
295.841 + static char sC = 1+'C';
295.842 + static int sI = 1+'I';
295.843 + static long sJ = 1+'J';
295.844 + static float sF = 1+'F';
295.845 + static double sD = 1+'D';
295.846 +
295.847 + Object fL = 'L';
295.848 + String fR = "R";
295.849 + static Object sL = 'M';
295.850 + static String sR = "S";
295.851 +
295.852 + static final Object[][] CASES;
295.853 + static {
295.854 + ArrayList<Object[]> cases = new ArrayList<Object[]>();
295.855 + Object types[][] = {
295.856 + {'L',Object.class}, {'R',String.class},
295.857 + {'I',int.class}, {'J',long.class},
295.858 + {'F',float.class}, {'D',double.class},
295.859 + {'Z',boolean.class}, {'B',byte.class},
295.860 + {'S',short.class}, {'C',char.class},
295.861 + };
295.862 + HasFields fields = new HasFields();
295.863 + for (Object[] t : types) {
295.864 + for (int kind = 0; kind <= 1; kind++) {
295.865 + boolean isStatic = (kind != 0);
295.866 + char btc = (Character)t[0];
295.867 + String name = (isStatic ? "s" : "f") + btc;
295.868 + Class<?> type = (Class<?>) t[1];
295.869 + Object value;
295.870 + Field field;
295.871 + try {
295.872 + field = HasFields.class.getDeclaredField(name);
295.873 + } catch (Exception ex) {
295.874 + throw new InternalError("no field HasFields."+name);
295.875 + }
295.876 + try {
295.877 + value = field.get(fields);
295.878 + } catch (Exception ex) {
295.879 + throw new InternalError("cannot fetch field HasFields."+name);
295.880 + }
295.881 + if (type == float.class) {
295.882 + float v = 'F';
295.883 + if (isStatic) v++;
295.884 + assertTrue(value.equals(v));
295.885 + }
295.886 + assertTrue(name.equals(field.getName()));
295.887 + assertTrue(type.equals(field.getType()));
295.888 + assertTrue(isStatic == (Modifier.isStatic(field.getModifiers())));
295.889 + cases.add(new Object[]{ field, value });
295.890 + }
295.891 + }
295.892 + cases.add(new Object[]{ new Object[]{ false, HasFields.class, "bogus_fD", double.class }, Error.class });
295.893 + cases.add(new Object[]{ new Object[]{ true, HasFields.class, "bogus_sL", Object.class }, Error.class });
295.894 + CASES = cases.toArray(new Object[0][]);
295.895 + }
295.896 + }
295.897 +
295.898 + static final int TEST_UNREFLECT = 1, TEST_FIND_FIELD = 2, TEST_FIND_STATIC = 3, TEST_SETTER = 0x10;
295.899 + static boolean testModeMatches(int testMode, boolean isStatic) {
295.900 + switch (testMode) {
295.901 + case TEST_FIND_STATIC: return isStatic;
295.902 + case TEST_FIND_FIELD: return !isStatic;
295.903 + case TEST_UNREFLECT: return true; // unreflect matches both
295.904 + }
295.905 + throw new InternalError("testMode="+testMode);
295.906 + }
295.907 +
295.908 + @Test
295.909 + public void testUnreflectGetter() throws Throwable {
295.910 + startTest("unreflectGetter");
295.911 + testGetter(TEST_UNREFLECT);
295.912 + }
295.913 + @Test
295.914 + public void testFindGetter() throws Throwable {
295.915 + startTest("findGetter");
295.916 + testGetter(TEST_FIND_FIELD);
295.917 + }
295.918 + @Test
295.919 + public void testFindStaticGetter() throws Throwable {
295.920 + startTest("findStaticGetter");
295.921 + testGetter(TEST_FIND_STATIC);
295.922 + }
295.923 + public void testGetter(int testMode) throws Throwable {
295.924 + Lookup lookup = PRIVATE; // FIXME: test more lookups than this one
295.925 + for (Object[] c : HasFields.CASES) {
295.926 + boolean positive = (c[1] != Error.class);
295.927 + testGetter(positive, lookup, c[0], c[1], testMode);
295.928 + }
295.929 + testGetter(true, lookup,
295.930 + new Object[]{ true, System.class, "out", java.io.PrintStream.class },
295.931 + System.out, testMode);
295.932 + for (int isStaticN = 0; isStaticN <= 1; isStaticN++) {
295.933 + testGetter(false, lookup,
295.934 + new Object[]{ (isStaticN != 0), System.class, "bogus", char.class },
295.935 + null, testMode);
295.936 + }
295.937 + }
295.938 + public void testGetter(boolean positive, MethodHandles.Lookup lookup,
295.939 + Object fieldRef, Object value, int testMode) throws Throwable {
295.940 + testAccessor(positive, lookup, fieldRef, value, testMode);
295.941 + }
295.942 +
295.943 + public void testAccessor(boolean positive, MethodHandles.Lookup lookup,
295.944 + Object fieldRef, Object value, int testMode0) throws Throwable {
295.945 + boolean isGetter = ((testMode0 & TEST_SETTER) == 0);
295.946 + int testMode = testMode0 & ~TEST_SETTER;
295.947 + boolean isStatic;
295.948 + Class<?> fclass;
295.949 + String fname;
295.950 + Class<?> ftype;
295.951 + Field f = (fieldRef instanceof Field ? (Field)fieldRef : null);
295.952 + if (f != null) {
295.953 + isStatic = Modifier.isStatic(f.getModifiers());
295.954 + fclass = f.getDeclaringClass();
295.955 + fname = f.getName();
295.956 + ftype = f.getType();
295.957 + } else {
295.958 + Object[] scnt = (Object[]) fieldRef;
295.959 + isStatic = (Boolean) scnt[0];
295.960 + fclass = (Class<?>) scnt[1];
295.961 + fname = (String) scnt[2];
295.962 + ftype = (Class<?>) scnt[3];
295.963 + try {
295.964 + f = fclass.getDeclaredField(fname);
295.965 + } catch (ReflectiveOperationException ex) {
295.966 + f = null;
295.967 + }
295.968 + }
295.969 + if (!testModeMatches(testMode, isStatic)) return;
295.970 + if (f == null && testMode == TEST_UNREFLECT) return;
295.971 + countTest(positive);
295.972 + MethodType expType;
295.973 + if (isGetter)
295.974 + expType = MethodType.methodType(ftype, HasFields.class);
295.975 + else
295.976 + expType = MethodType.methodType(void.class, HasFields.class, ftype);
295.977 + if (isStatic) expType = expType.dropParameterTypes(0, 1);
295.978 + Exception noAccess = null;
295.979 + MethodHandle mh;
295.980 + try {
295.981 + switch (testMode0) {
295.982 + case TEST_UNREFLECT: mh = lookup.unreflectGetter(f); break;
295.983 + case TEST_FIND_FIELD: mh = lookup.findGetter(fclass, fname, ftype); break;
295.984 + case TEST_FIND_STATIC: mh = lookup.findStaticGetter(fclass, fname, ftype); break;
295.985 + case TEST_SETTER|
295.986 + TEST_UNREFLECT: mh = lookup.unreflectSetter(f); break;
295.987 + case TEST_SETTER|
295.988 + TEST_FIND_FIELD: mh = lookup.findSetter(fclass, fname, ftype); break;
295.989 + case TEST_SETTER|
295.990 + TEST_FIND_STATIC: mh = lookup.findStaticSetter(fclass, fname, ftype); break;
295.991 + default:
295.992 + throw new InternalError("testMode="+testMode);
295.993 + }
295.994 + } catch (ReflectiveOperationException ex) {
295.995 + mh = null;
295.996 + noAccess = ex;
295.997 + if (fname.contains("bogus"))
295.998 + assertTrue(noAccess instanceof NoSuchFieldException);
295.999 + else
295.1000 + assertTrue(noAccess instanceof IllegalAccessException);
295.1001 + }
295.1002 + if (verbosity >= 3)
295.1003 + System.out.println("find"+(isStatic?"Static":"")+(isGetter?"Getter":"Setter")+" "+fclass.getName()+"."+fname+"/"+ftype
295.1004 + +" => "+mh
295.1005 + +(noAccess == null ? "" : " !! "+noAccess));
295.1006 + if (positive && noAccess != null) throw new RuntimeException(noAccess);
295.1007 + assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, mh != null);
295.1008 + if (!positive) return; // negative test failed as expected
295.1009 + assertEquals((isStatic ? 0 : 1)+(isGetter ? 0 : 1), mh.type().parameterCount());
295.1010 +
295.1011 +
295.1012 + assertSame(mh.type(), expType);
295.1013 + assertNameStringContains(mh, fname);
295.1014 + HasFields fields = new HasFields();
295.1015 + Object sawValue;
295.1016 + Class<?> vtype = ftype;
295.1017 + if (ftype != int.class) vtype = Object.class;
295.1018 + if (isGetter) {
295.1019 + mh = MethodHandles.convertArguments(mh, mh.type().generic()
295.1020 + .changeReturnType(vtype));
295.1021 + } else {
295.1022 + int last = mh.type().parameterCount() - 1;
295.1023 + mh = MethodHandles.convertArguments(mh, mh.type().generic()
295.1024 + .changeReturnType(void.class)
295.1025 + .changeParameterType(last, vtype));
295.1026 + }
295.1027 + if (f != null && f.getDeclaringClass() == HasFields.class) {
295.1028 + assertEquals(f.get(fields), value); // clean to start with
295.1029 + }
295.1030 + if (isGetter) {
295.1031 + Object expValue = value;
295.1032 + for (int i = 0; i <= 1; i++) {
295.1033 + if (isStatic) {
295.1034 + if (ftype == int.class)
295.1035 + sawValue = (int) mh.invokeExact(); // do these exactly
295.1036 + else
295.1037 + sawValue = mh.invokeExact();
295.1038 + } else {
295.1039 + if (ftype == int.class)
295.1040 + sawValue = (int) mh.invokeExact((Object) fields);
295.1041 + else
295.1042 + sawValue = mh.invokeExact((Object) fields);
295.1043 + }
295.1044 + assertEquals(sawValue, expValue);
295.1045 + if (f != null && f.getDeclaringClass() == HasFields.class
295.1046 + && !Modifier.isFinal(f.getModifiers())) {
295.1047 + Object random = randomArg(ftype);
295.1048 + f.set(fields, random);
295.1049 + expValue = random;
295.1050 + } else {
295.1051 + break;
295.1052 + }
295.1053 + }
295.1054 + } else {
295.1055 + for (int i = 0; i <= 1; i++) {
295.1056 + Object putValue = randomArg(ftype);
295.1057 + if (isStatic) {
295.1058 + if (ftype == int.class)
295.1059 + mh.invokeExact((int)putValue); // do these exactly
295.1060 + else
295.1061 + mh.invokeExact(putValue);
295.1062 + } else {
295.1063 + if (ftype == int.class)
295.1064 + mh.invokeExact((Object) fields, (int)putValue);
295.1065 + else
295.1066 + mh.invokeExact((Object) fields, putValue);
295.1067 + }
295.1068 + if (f != null && f.getDeclaringClass() == HasFields.class) {
295.1069 + assertEquals(f.get(fields), putValue);
295.1070 + }
295.1071 + }
295.1072 + }
295.1073 + if (f != null && f.getDeclaringClass() == HasFields.class) {
295.1074 + f.set(fields, value); // put it back
295.1075 + }
295.1076 + }
295.1077 +
295.1078 +
295.1079 + @Test
295.1080 + public void testUnreflectSetter() throws Throwable {
295.1081 + startTest("unreflectSetter");
295.1082 + testSetter(TEST_UNREFLECT);
295.1083 + }
295.1084 + @Test
295.1085 + public void testFindSetter() throws Throwable {
295.1086 + startTest("findSetter");
295.1087 + testSetter(TEST_FIND_FIELD);
295.1088 + }
295.1089 + @Test
295.1090 + public void testFindStaticSetter() throws Throwable {
295.1091 + startTest("findStaticSetter");
295.1092 + testSetter(TEST_FIND_STATIC);
295.1093 + }
295.1094 + public void testSetter(int testMode) throws Throwable {
295.1095 + Lookup lookup = PRIVATE; // FIXME: test more lookups than this one
295.1096 + startTest("unreflectSetter");
295.1097 + for (Object[] c : HasFields.CASES) {
295.1098 + boolean positive = (c[1] != Error.class);
295.1099 + testSetter(positive, lookup, c[0], c[1], testMode);
295.1100 + }
295.1101 + for (int isStaticN = 0; isStaticN <= 1; isStaticN++) {
295.1102 + testSetter(false, lookup,
295.1103 + new Object[]{ (isStaticN != 0), System.class, "bogus", char.class },
295.1104 + null, testMode);
295.1105 + }
295.1106 + }
295.1107 + public void testSetter(boolean positive, MethodHandles.Lookup lookup,
295.1108 + Object fieldRef, Object value, int testMode) throws Throwable {
295.1109 + testAccessor(positive, lookup, fieldRef, value, testMode | TEST_SETTER);
295.1110 + }
295.1111 +
295.1112 + @Test
295.1113 + public void testArrayElementGetter() throws Throwable {
295.1114 + startTest("arrayElementGetter");
295.1115 + testArrayElementGetterSetter(false);
295.1116 + }
295.1117 +
295.1118 + @Test
295.1119 + public void testArrayElementSetter() throws Throwable {
295.1120 + startTest("arrayElementSetter");
295.1121 + testArrayElementGetterSetter(true);
295.1122 + }
295.1123 +
295.1124 + public void testArrayElementGetterSetter(boolean testSetter) throws Throwable {
295.1125 + testArrayElementGetterSetter(new Object[10], testSetter);
295.1126 + testArrayElementGetterSetter(new String[10], testSetter);
295.1127 + testArrayElementGetterSetter(new boolean[10], testSetter);
295.1128 + testArrayElementGetterSetter(new byte[10], testSetter);
295.1129 + testArrayElementGetterSetter(new char[10], testSetter);
295.1130 + testArrayElementGetterSetter(new short[10], testSetter);
295.1131 + testArrayElementGetterSetter(new int[10], testSetter);
295.1132 + testArrayElementGetterSetter(new float[10], testSetter);
295.1133 + testArrayElementGetterSetter(new long[10], testSetter);
295.1134 + testArrayElementGetterSetter(new double[10], testSetter);
295.1135 + }
295.1136 +
295.1137 + public void testArrayElementGetterSetter(Object array, boolean testSetter) throws Throwable {
295.1138 + countTest(true);
295.1139 + if (verbosity >= 2) System.out.println("array type = "+array.getClass().getComponentType().getName()+"["+Array.getLength(array)+"]");
295.1140 + Class<?> arrayType = array.getClass();
295.1141 + Class<?> elemType = arrayType.getComponentType();
295.1142 + MethodType expType = !testSetter
295.1143 + ? MethodType.methodType(elemType, arrayType, int.class)
295.1144 + : MethodType.methodType(void.class, arrayType, int.class, elemType);
295.1145 + MethodHandle mh = !testSetter
295.1146 + ? MethodHandles.arrayElementGetter(arrayType)
295.1147 + : MethodHandles.arrayElementSetter(arrayType);
295.1148 + assertSame(mh.type(), expType);
295.1149 + if (elemType != int.class && elemType != boolean.class) {
295.1150 + MethodType gtype;
295.1151 + if (true) { // FIXME: remove this path (and remove <void> below in the mh.invokes)
295.1152 + gtype = mh.type().changeParameterType(0, Object.class);
295.1153 + if (testSetter)
295.1154 + gtype = gtype.changeParameterType(2, Object.class);
295.1155 + else
295.1156 + gtype = gtype.changeReturnType(Object.class);
295.1157 + } else
295.1158 + // FIXME: This simpler path hits a bug in convertArguments => ToGeneric
295.1159 + gtype = mh.type().generic().changeParameterType(1, int.class);
295.1160 + mh = MethodHandles.convertArguments(mh, gtype);
295.1161 + }
295.1162 + Object sawValue, expValue;
295.1163 + List<Object> model = array2list(array);
295.1164 + int length = Array.getLength(array);
295.1165 + for (int i = 0; i < length; i++) {
295.1166 + // update array element
295.1167 + Object random = randomArg(elemType);
295.1168 + model.set(i, random);
295.1169 + if (testSetter) {
295.1170 + if (elemType == int.class)
295.1171 + mh.invokeExact((int[]) array, i, (int)random);
295.1172 + else if (elemType == boolean.class)
295.1173 + mh.invokeExact((boolean[]) array, i, (boolean)random);
295.1174 + else
295.1175 + mh.invokeExact(array, i, random);
295.1176 + assertEquals(model, array2list(array));
295.1177 + } else {
295.1178 + Array.set(array, i, random);
295.1179 + }
295.1180 + if (verbosity >= 5) {
295.1181 + List<Object> array2list = array2list(array);
295.1182 + System.out.println("a["+i+"]="+random+" => "+array2list);
295.1183 + if (!array2list.equals(model))
295.1184 + System.out.println("*** != "+model);
295.1185 + }
295.1186 + // observe array element
295.1187 + sawValue = Array.get(array, i);
295.1188 + if (!testSetter) {
295.1189 + expValue = sawValue;
295.1190 + if (elemType == int.class)
295.1191 + sawValue = (int) mh.invokeExact((int[]) array, i);
295.1192 + else if (elemType == boolean.class)
295.1193 + sawValue = (boolean) mh.invokeExact((boolean[]) array, i);
295.1194 + else
295.1195 + sawValue = mh.invokeExact(array, i);
295.1196 + assertEquals(sawValue, expValue);
295.1197 + assertEquals(model, array2list(array));
295.1198 + }
295.1199 + }
295.1200 + }
295.1201 +
295.1202 + List<Object> array2list(Object array) {
295.1203 + int length = Array.getLength(array);
295.1204 + ArrayList<Object> model = new ArrayList<Object>(length);
295.1205 + for (int i = 0; i < length; i++)
295.1206 + model.add(Array.get(array, i));
295.1207 + return model;
295.1208 + }
295.1209 +
295.1210 + static class Callee {
295.1211 + static Object id() { return called("id"); }
295.1212 + static Object id(Object x) { return called("id", x); }
295.1213 + static Object id(Object x, Object y) { return called("id", x, y); }
295.1214 + static Object id(Object x, Object y, Object z) { return called("id", x, y, z); }
295.1215 + static Object id(Object... vx) { return called("id", vx); }
295.1216 + static MethodHandle ofType(int n) {
295.1217 + return ofType(Object.class, n);
295.1218 + }
295.1219 + static MethodHandle ofType(Class<?> rtype, int n) {
295.1220 + if (n == -1)
295.1221 + return ofType(MethodType.methodType(rtype, Object[].class));
295.1222 + return ofType(MethodType.genericMethodType(n).changeReturnType(rtype));
295.1223 + }
295.1224 + static MethodHandle ofType(Class<?> rtype, Class<?>... ptypes) {
295.1225 + return ofType(MethodType.methodType(rtype, ptypes));
295.1226 + }
295.1227 + static MethodHandle ofType(MethodType type) {
295.1228 + Class<?> rtype = type.returnType();
295.1229 + String pfx = "";
295.1230 + if (rtype != Object.class)
295.1231 + pfx = rtype.getSimpleName().substring(0, 1).toLowerCase();
295.1232 + String name = pfx+"id";
295.1233 + try {
295.1234 + return PRIVATE.findStatic(Callee.class, name, type);
295.1235 + } catch (Exception ex) {
295.1236 + throw new RuntimeException(ex);
295.1237 + }
295.1238 + }
295.1239 + }
295.1240 +
295.1241 + @Test
295.1242 + public void testConvertArguments() throws Throwable {
295.1243 + if (CAN_SKIP_WORKING) return;
295.1244 + startTest("convertArguments");
295.1245 + testConvert(Callee.ofType(1), null, "id", int.class);
295.1246 + testConvert(Callee.ofType(1), null, "id", String.class);
295.1247 + testConvert(Callee.ofType(1), null, "id", Integer.class);
295.1248 + testConvert(Callee.ofType(1), null, "id", short.class);
295.1249 + testConvert(Callee.ofType(1), null, "id", char.class);
295.1250 + testConvert(Callee.ofType(1), null, "id", byte.class);
295.1251 + }
295.1252 +
295.1253 + void testConvert(MethodHandle id, Class<?> rtype, String name, Class<?>... params) throws Throwable {
295.1254 + testConvert(true, false, id, rtype, name, params);
295.1255 + testConvert(true, true, id, rtype, name, params);
295.1256 + }
295.1257 +
295.1258 + void testConvert(boolean positive, boolean useAsType,
295.1259 + MethodHandle id, Class<?> rtype, String name, Class<?>... params) throws Throwable {
295.1260 + countTest(positive);
295.1261 + MethodType idType = id.type();
295.1262 + if (rtype == null) rtype = idType.returnType();
295.1263 + for (int i = 0; i < params.length; i++) {
295.1264 + if (params[i] == null) params[i] = idType.parameterType(i);
295.1265 + }
295.1266 + // simulate the pairwise conversion
295.1267 + MethodType newType = MethodType.methodType(rtype, params);
295.1268 + Object[] args = randomArgs(newType.parameterArray());
295.1269 + Object[] convArgs = args.clone();
295.1270 + for (int i = 0; i < args.length; i++) {
295.1271 + Class<?> src = newType.parameterType(i);
295.1272 + Class<?> dst = idType.parameterType(i);
295.1273 + if (src != dst)
295.1274 + convArgs[i] = castToWrapper(convArgs[i], dst);
295.1275 + }
295.1276 + Object convResult = id.invokeWithArguments(convArgs);
295.1277 + {
295.1278 + Class<?> dst = newType.returnType();
295.1279 + Class<?> src = idType.returnType();
295.1280 + if (src != dst)
295.1281 + convResult = castToWrapper(convResult, dst);
295.1282 + }
295.1283 + MethodHandle target = null;
295.1284 + RuntimeException error = null;
295.1285 + try {
295.1286 + if (useAsType)
295.1287 + target = id.asType(newType);
295.1288 + else
295.1289 + target = MethodHandles.convertArguments(id, newType);
295.1290 + } catch (RuntimeException ex) {
295.1291 + error = ex;
295.1292 + }
295.1293 + if (verbosity >= 3)
295.1294 + System.out.println("convert "+id+ " to "+newType+" => "+target
295.1295 + +(error == null ? "" : " !! "+error));
295.1296 + if (positive && error != null) throw error;
295.1297 + assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null);
295.1298 + if (!positive) return; // negative test failed as expected
295.1299 + assertEquals(newType, target.type());
295.1300 + printCalled(target, id.toString(), args);
295.1301 + Object result = target.invokeWithArguments(args);
295.1302 + assertCalled(name, convArgs);
295.1303 + assertEquals(convResult, result);
295.1304 + if (verbosity >= 1)
295.1305 + System.out.print(':');
295.1306 + }
295.1307 +
295.1308 + @Test
295.1309 + public void testVarargsCollector() throws Throwable {
295.1310 + MethodHandle vac0 = PRIVATE.findStatic(MethodHandlesTest.class, "called",
295.1311 + MethodType.methodType(Object.class, String.class, Object[].class));
295.1312 + vac0 = vac0.bindTo("vac");
295.1313 + MethodHandle vac = vac0.asVarargsCollector(Object[].class);
295.1314 + testConvert(true, true, vac.asType(MethodType.genericMethodType(0)), null, "vac");
295.1315 + testConvert(true, true, vac.asType(MethodType.genericMethodType(0)), null, "vac");
295.1316 + for (Class<?> at : new Class[] { Object.class, String.class, Integer.class }) {
295.1317 + testConvert(true, true, vac.asType(MethodType.genericMethodType(1)), null, "vac", at);
295.1318 + testConvert(true, true, vac.asType(MethodType.genericMethodType(2)), null, "vac", at, at);
295.1319 + }
295.1320 + }
295.1321 +
295.1322 + @Test
295.1323 + public void testPermuteArguments() throws Throwable {
295.1324 + if (CAN_SKIP_WORKING) return;
295.1325 + startTest("permuteArguments");
295.1326 + testPermuteArguments(4, Integer.class, 2, String.class, 0);
295.1327 + //testPermuteArguments(6, Integer.class, 0, null, 30);
295.1328 + //testPermuteArguments(4, Integer.class, 1, int.class, 6);
295.1329 + }
295.1330 + public void testPermuteArguments(int max, Class<?> type1, int t2c, Class<?> type2, int dilution) throws Throwable {
295.1331 + if (verbosity >= 2)
295.1332 + System.out.println("permuteArguments "+max+"*"+type1.getName()
295.1333 + +(t2c==0?"":"/"+t2c+"*"+type2.getName())
295.1334 + +(dilution > 0 ? " with dilution "+dilution : ""));
295.1335 + int t2pos = t2c == 0 ? 0 : 1;
295.1336 + for (int inargs = t2pos+1; inargs <= max; inargs++) {
295.1337 + Class<?>[] types = new Class<?>[inargs];
295.1338 + Arrays.fill(types, type1);
295.1339 + if (t2c != 0) {
295.1340 + // Fill in a middle range with type2:
295.1341 + Arrays.fill(types, t2pos, Math.min(t2pos+t2c, inargs), type2);
295.1342 + }
295.1343 + Object[] args = randomArgs(types);
295.1344 + int numcases = 1;
295.1345 + for (int outargs = 0; outargs <= max; outargs++) {
295.1346 + if (outargs - inargs >= MAX_ARG_INCREASE) continue;
295.1347 + int[] reorder = new int[outargs];
295.1348 + int casStep = dilution + 1;
295.1349 + // Avoid some common factors:
295.1350 + while ((casStep > 2 && casStep % 2 == 0 && inargs % 2 == 0) ||
295.1351 + (casStep > 3 && casStep % 3 == 0 && inargs % 3 == 0))
295.1352 + casStep++;
295.1353 + for (int cas = 0; cas < numcases; cas += casStep) {
295.1354 + for (int i = 0, c = cas; i < outargs; i++) {
295.1355 + reorder[i] = c % inargs;
295.1356 + c /= inargs;
295.1357 + }
295.1358 + testPermuteArguments(args, types, reorder);
295.1359 + }
295.1360 + numcases *= inargs;
295.1361 + if (dilution > 10 && outargs >= 4) {
295.1362 + // Do some special patterns, which we probably missed.
295.1363 + // Replication of a single argument or argument pair.
295.1364 + for (int i = 0; i < inargs; i++) {
295.1365 + Arrays.fill(reorder, i);
295.1366 + testPermuteArguments(args, types, reorder);
295.1367 + for (int d = 1; d <= 2; d++) {
295.1368 + if (i + d >= inargs) continue;
295.1369 + for (int j = 1; j < outargs; j += 2)
295.1370 + reorder[j] += 1;
295.1371 + testPermuteArguments(args, types, reorder);
295.1372 + testPermuteArguments(args, types, reverse(reorder));
295.1373 + }
295.1374 + }
295.1375 + // Repetition of a sequence of 3 or more arguments.
295.1376 + for (int i = 1; i < inargs; i++) {
295.1377 + for (int len = 3; len <= inargs; len++) {
295.1378 + for (int j = 0; j < outargs; j++)
295.1379 + reorder[j] = (i + (j % len)) % inargs;
295.1380 + testPermuteArguments(args, types, reorder);
295.1381 + testPermuteArguments(args, types, reverse(reorder));
295.1382 + }
295.1383 + }
295.1384 + }
295.1385 + }
295.1386 + }
295.1387 + }
295.1388 +
295.1389 + static int[] reverse(int[] reorder) {
295.1390 + reorder = reorder.clone();
295.1391 + for (int i = 0, imax = reorder.length / 2; i < imax; i++) {
295.1392 + int j = reorder.length - 1 - i;
295.1393 + int tem = reorder[i];
295.1394 + reorder[i] = reorder[j];
295.1395 + reorder[j] = tem;
295.1396 + }
295.1397 + return reorder;
295.1398 + }
295.1399 +
295.1400 + void testPermuteArguments(Object[] args, Class<?>[] types, int[] reorder) throws Throwable {
295.1401 + countTest();
295.1402 + if (args == null && types == null) {
295.1403 + int max = 0;
295.1404 + for (int j : reorder) {
295.1405 + if (max < j) max = j;
295.1406 + }
295.1407 + args = randomArgs(max+1, Integer.class);
295.1408 + }
295.1409 + if (args == null) {
295.1410 + args = randomArgs(types);
295.1411 + }
295.1412 + if (types == null) {
295.1413 + types = new Class<?>[args.length];
295.1414 + for (int i = 0; i < args.length; i++)
295.1415 + types[i] = args[i].getClass();
295.1416 + }
295.1417 + int inargs = args.length, outargs = reorder.length;
295.1418 + assertTrue(inargs == types.length);
295.1419 + if (verbosity >= 3)
295.1420 + System.out.println("permuteArguments "+Arrays.toString(reorder));
295.1421 + Object[] permArgs = new Object[outargs];
295.1422 + Class<?>[] permTypes = new Class<?>[outargs];
295.1423 + for (int i = 0; i < outargs; i++) {
295.1424 + permArgs[i] = args[reorder[i]];
295.1425 + permTypes[i] = types[reorder[i]];
295.1426 + }
295.1427 + if (verbosity >= 4) {
295.1428 + System.out.println("in args: "+Arrays.asList(args));
295.1429 + System.out.println("out args: "+Arrays.asList(permArgs));
295.1430 + System.out.println("in types: "+Arrays.asList(types));
295.1431 + System.out.println("out types: "+Arrays.asList(permTypes));
295.1432 + }
295.1433 + MethodType inType = MethodType.methodType(Object.class, types);
295.1434 + MethodType outType = MethodType.methodType(Object.class, permTypes);
295.1435 + MethodHandle target = MethodHandles.convertArguments(varargsList(outargs), outType);
295.1436 + MethodHandle newTarget = MethodHandles.permuteArguments(target, inType, reorder);
295.1437 + Object result = newTarget.invokeWithArguments(args);
295.1438 + Object expected = Arrays.asList(permArgs);
295.1439 + assertEquals(expected, result);
295.1440 + }
295.1441 +
295.1442 +
295.1443 + @Test
295.1444 + public void testSpreadArguments() throws Throwable {
295.1445 + if (CAN_SKIP_WORKING) return;
295.1446 + startTest("spreadArguments");
295.1447 + for (Class<?> argType : new Class[]{Object.class, Integer.class, int.class}) {
295.1448 + if (verbosity >= 3)
295.1449 + System.out.println("spreadArguments "+argType);
295.1450 + // FIXME: enable _adapter_spread_args and fix Fail_2
295.1451 + for (int nargs = 0; nargs < 10; nargs++) {
295.1452 + if (argType == int.class && nargs >= 6) continue; // FIXME Fail_1
295.1453 + for (int pos = 0; pos < nargs; pos++) {
295.1454 + if (argType == int.class && pos > 0) continue; // FIXME Fail_3
295.1455 + testSpreadArguments(argType, pos, nargs);
295.1456 + }
295.1457 + }
295.1458 + }
295.1459 + }
295.1460 + public void testSpreadArguments(Class<?> argType, int pos, int nargs) throws Throwable {
295.1461 + countTest();
295.1462 + MethodHandle target = varargsArray(nargs);
295.1463 + MethodHandle target2 = changeArgTypes(target, argType);
295.1464 + if (verbosity >= 3)
295.1465 + System.out.println("spread into "+target2+" ["+pos+".."+nargs+"]");
295.1466 + Object[] args = randomArgs(target2.type().parameterArray());
295.1467 + // make sure the target does what we think it does:
295.1468 + if (pos == 0 && nargs < 5) {
295.1469 + Object[] check = (Object[]) target.invokeWithArguments(args);
295.1470 + assertArrayEquals(args, check);
295.1471 + switch (nargs) {
295.1472 + case 0:
295.1473 + check = (Object[]) target.invokeExact();
295.1474 + assertArrayEquals(args, check);
295.1475 + break;
295.1476 + case 1:
295.1477 + check = (Object[]) target.invokeExact(args[0]);
295.1478 + assertArrayEquals(args, check);
295.1479 + break;
295.1480 + case 2:
295.1481 + check = (Object[]) target.invokeExact(args[0], args[1]);
295.1482 + assertArrayEquals(args, check);
295.1483 + break;
295.1484 + }
295.1485 + }
295.1486 + List<Class<?>> newParams = new ArrayList<Class<?>>(target2.type().parameterList());
295.1487 + { // modify newParams in place
295.1488 + List<Class<?>> spreadParams = newParams.subList(pos, nargs);
295.1489 + spreadParams.clear(); spreadParams.add(Object[].class);
295.1490 + }
295.1491 + MethodType newType = MethodType.methodType(Object.class, newParams);
295.1492 + MethodHandle result = target2.asSpreader(Object[].class, nargs-pos).asType(newType);
295.1493 + Object[] returnValue;
295.1494 + if (pos == 0) {
295.1495 + // In the following line, the first cast implies
295.1496 + // normal Object return value for the MH call (Object[])->Object,
295.1497 + // while the second cast dynamically converts to an Object array.
295.1498 + // Such a double cast is typical of MH.invokeExact.
295.1499 + returnValue = (Object[]) (Object) result.invokeExact(args);
295.1500 + } else {
295.1501 + Object[] args1 = Arrays.copyOfRange(args, 0, pos+1);
295.1502 + args1[pos] = Arrays.copyOfRange(args, pos, args.length);
295.1503 + returnValue = (Object[]) result.invokeWithArguments(args1);
295.1504 + }
295.1505 + assertArrayEquals(args, returnValue);
295.1506 + }
295.1507 +
295.1508 + @Test
295.1509 + public void testCollectArguments() throws Throwable {
295.1510 + if (CAN_SKIP_WORKING) return;
295.1511 + startTest("collectArguments");
295.1512 + for (Class<?> argType : new Class[]{Object.class, Integer.class, int.class}) {
295.1513 + if (verbosity >= 3)
295.1514 + System.out.println("collectArguments "+argType);
295.1515 + for (int nargs = 0; nargs < 10; nargs++) {
295.1516 + for (int pos = 0; pos < nargs; pos++) {
295.1517 + if (argType == int.class) continue; // FIXME Fail_4
295.1518 + testCollectArguments(argType, pos, nargs);
295.1519 + }
295.1520 + }
295.1521 + }
295.1522 + }
295.1523 + public void testCollectArguments(Class<?> argType, int pos, int nargs) throws Throwable {
295.1524 + countTest();
295.1525 + // fake up a MH with the same type as the desired adapter:
295.1526 + MethodHandle fake = varargsArray(nargs);
295.1527 + fake = changeArgTypes(fake, argType);
295.1528 + MethodType newType = fake.type();
295.1529 + Object[] args = randomArgs(newType.parameterArray());
295.1530 + // here is what should happen:
295.1531 + Object[] collectedArgs = Arrays.copyOfRange(args, 0, pos+1);
295.1532 + collectedArgs[pos] = Arrays.copyOfRange(args, pos, args.length);
295.1533 + // here is the MH which will witness the collected argument tail:
295.1534 + MethodHandle target = varargsArray(pos+1);
295.1535 + target = changeArgTypes(target, 0, pos, argType);
295.1536 + target = changeArgTypes(target, pos, pos+1, Object[].class);
295.1537 + if (verbosity >= 3)
295.1538 + System.out.println("collect from "+Arrays.asList(args)+" ["+pos+".."+nargs+"]");
295.1539 + MethodHandle result = target.asCollector(Object[].class, nargs-pos).asType(newType);
295.1540 + Object[] returnValue = (Object[]) result.invokeWithArguments(args);
295.1541 +// assertTrue(returnValue.length == pos+1 && returnValue[pos] instanceof Object[]);
295.1542 +// returnValue[pos] = Arrays.asList((Object[]) returnValue[pos]);
295.1543 +// collectedArgs[pos] = Arrays.asList((Object[]) collectedArgs[pos]);
295.1544 + assertArrayEquals(collectedArgs, returnValue);
295.1545 + }
295.1546 +
295.1547 + @Test
295.1548 + public void testInsertArguments() throws Throwable {
295.1549 + if (CAN_SKIP_WORKING) return;
295.1550 + startTest("insertArguments");
295.1551 + for (int nargs = 0; nargs <= 4; nargs++) {
295.1552 + for (int ins = 0; ins <= 4; ins++) {
295.1553 + if (ins > MAX_ARG_INCREASE) continue; // FIXME Fail_6
295.1554 + for (int pos = 0; pos <= nargs; pos++) {
295.1555 + testInsertArguments(nargs, pos, ins);
295.1556 + }
295.1557 + }
295.1558 + }
295.1559 + }
295.1560 +
295.1561 + void testInsertArguments(int nargs, int pos, int ins) throws Throwable {
295.1562 + countTest();
295.1563 + MethodHandle target = varargsArray(nargs + ins);
295.1564 + Object[] args = randomArgs(target.type().parameterArray());
295.1565 + List<Object> resList = Arrays.asList(args);
295.1566 + List<Object> argsToPass = new ArrayList<Object>(resList);
295.1567 + List<Object> argsToInsert = argsToPass.subList(pos, pos + ins);
295.1568 + if (verbosity >= 3)
295.1569 + System.out.println("insert: "+argsToInsert+" into "+target);
295.1570 + MethodHandle target2 = MethodHandles.insertArguments(target, pos,
295.1571 + (Object[]) argsToInsert.toArray());
295.1572 + argsToInsert.clear(); // remove from argsToInsert
295.1573 + Object res2 = target2.invokeWithArguments(argsToPass);
295.1574 + Object res2List = Arrays.asList((Object[])res2);
295.1575 + if (verbosity >= 3)
295.1576 + System.out.println("result: "+res2List);
295.1577 + //if (!resList.equals(res2List))
295.1578 + // System.out.println("*** fail at n/p/i = "+nargs+"/"+pos+"/"+ins+": "+resList+" => "+res2List);
295.1579 + assertEquals(resList, res2List);
295.1580 + }
295.1581 +
295.1582 + @Test
295.1583 + public void testFilterReturnValue() throws Throwable {
295.1584 + if (CAN_SKIP_WORKING) return;
295.1585 + startTest("filterReturnValue");
295.1586 + Class<?> classOfVCList = varargsList(1).invokeWithArguments(0).getClass();
295.1587 + assertTrue(List.class.isAssignableFrom(classOfVCList));
295.1588 + for (int nargs = 0; nargs <= 3; nargs++) {
295.1589 + for (Class<?> rtype : new Class[] { Object.class,
295.1590 + List.class,
295.1591 + int.class,
295.1592 + //byte.class, //FIXME: add this
295.1593 + //long.class, //FIXME: add this
295.1594 + CharSequence.class,
295.1595 + String.class }) {
295.1596 + testFilterReturnValue(nargs, rtype);
295.1597 + }
295.1598 + }
295.1599 + }
295.1600 +
295.1601 + void testFilterReturnValue(int nargs, Class<?> rtype) throws Throwable {
295.1602 + countTest();
295.1603 + MethodHandle target = varargsList(nargs, rtype);
295.1604 + MethodHandle filter;
295.1605 + if (List.class.isAssignableFrom(rtype) || rtype.isAssignableFrom(List.class))
295.1606 + filter = varargsList(1); // add another layer of list-ness
295.1607 + else
295.1608 + filter = MethodHandles.identity(rtype);
295.1609 + filter = filter.asType(MethodType.methodType(target.type().returnType(), rtype));
295.1610 + Object[] argsToPass = randomArgs(nargs, Object.class);
295.1611 + if (verbosity >= 3)
295.1612 + System.out.println("filter "+target+" to "+rtype.getSimpleName()+" with "+filter);
295.1613 + MethodHandle target2 = MethodHandles.filterReturnValue(target, filter);
295.1614 + if (verbosity >= 4)
295.1615 + System.out.println("filtered target: "+target2);
295.1616 + // Simulate expected effect of filter on return value:
295.1617 + Object unfiltered = target.invokeWithArguments(argsToPass);
295.1618 + Object expected = filter.invokeWithArguments(unfiltered);
295.1619 + if (verbosity >= 4)
295.1620 + System.out.println("unfiltered: "+unfiltered+" : "+unfiltered.getClass().getSimpleName());
295.1621 + if (verbosity >= 4)
295.1622 + System.out.println("expected: "+expected+" : "+expected.getClass().getSimpleName());
295.1623 + Object result = target2.invokeWithArguments(argsToPass);
295.1624 + if (verbosity >= 3)
295.1625 + System.out.println("result: "+result+" : "+result.getClass().getSimpleName());
295.1626 + if (!expected.equals(result))
295.1627 + System.out.println("*** fail at n/rt = "+nargs+"/"+rtype.getSimpleName()+": "+Arrays.asList(argsToPass)+" => "+result+" != "+expected);
295.1628 + assertEquals(expected, result);
295.1629 + }
295.1630 +
295.1631 + @Test
295.1632 + public void testFilterArguments() throws Throwable {
295.1633 + if (CAN_SKIP_WORKING) return;
295.1634 + startTest("filterArguments");
295.1635 + for (int nargs = 1; nargs <= 6; nargs++) {
295.1636 + for (int pos = 0; pos < nargs; pos++) {
295.1637 + testFilterArguments(nargs, pos);
295.1638 + }
295.1639 + }
295.1640 + }
295.1641 +
295.1642 + void testFilterArguments(int nargs, int pos) throws Throwable {
295.1643 + countTest();
295.1644 + MethodHandle target = varargsList(nargs);
295.1645 + MethodHandle filter = varargsList(1);
295.1646 + filter = MethodHandles.convertArguments(filter, filter.type().generic());
295.1647 + Object[] argsToPass = randomArgs(nargs, Object.class);
295.1648 + if (verbosity >= 3)
295.1649 + System.out.println("filter "+target+" at "+pos+" with "+filter);
295.1650 + MethodHandle target2 = MethodHandles.filterArguments(target, pos, filter);
295.1651 + // Simulate expected effect of filter on arglist:
295.1652 + Object[] filteredArgs = argsToPass.clone();
295.1653 + filteredArgs[pos] = filter.invokeExact(filteredArgs[pos]);
295.1654 + List<Object> expected = Arrays.asList(filteredArgs);
295.1655 + Object result = target2.invokeWithArguments(argsToPass);
295.1656 + if (verbosity >= 3)
295.1657 + System.out.println("result: "+result);
295.1658 + if (!expected.equals(result))
295.1659 + System.out.println("*** fail at n/p = "+nargs+"/"+pos+": "+Arrays.asList(argsToPass)+" => "+result+" != "+expected);
295.1660 + assertEquals(expected, result);
295.1661 + }
295.1662 +
295.1663 + @Test
295.1664 + public void testFoldArguments() throws Throwable {
295.1665 + if (CAN_SKIP_WORKING) return;
295.1666 + startTest("foldArguments");
295.1667 + for (int nargs = 0; nargs <= 4; nargs++) {
295.1668 + for (int fold = 0; fold <= nargs; fold++) {
295.1669 + for (int pos = 0; pos <= nargs; pos++) {
295.1670 + testFoldArguments(nargs, pos, fold);
295.1671 + }
295.1672 + }
295.1673 + }
295.1674 + }
295.1675 +
295.1676 + void testFoldArguments(int nargs, int pos, int fold) throws Throwable {
295.1677 + if (pos != 0) return; // can fold only at pos=0 for now
295.1678 + countTest();
295.1679 + MethodHandle target = varargsList(1 + nargs);
295.1680 + MethodHandle combine = varargsList(fold).asType(MethodType.genericMethodType(fold));
295.1681 + List<Object> argsToPass = Arrays.asList(randomArgs(nargs, Object.class));
295.1682 + if (verbosity >= 3)
295.1683 + System.out.println("fold "+target+" with "+combine);
295.1684 + MethodHandle target2 = MethodHandles.foldArguments(target, combine);
295.1685 + // Simulate expected effect of combiner on arglist:
295.1686 + List<Object> expected = new ArrayList<Object>(argsToPass);
295.1687 + List<Object> argsToFold = expected.subList(pos, pos + fold);
295.1688 + if (verbosity >= 3)
295.1689 + System.out.println("fold: "+argsToFold+" into "+target2);
295.1690 + Object foldedArgs = combine.invokeWithArguments(argsToFold);
295.1691 + argsToFold.add(0, foldedArgs);
295.1692 + Object result = target2.invokeWithArguments(argsToPass);
295.1693 + if (verbosity >= 3)
295.1694 + System.out.println("result: "+result);
295.1695 + if (!expected.equals(result))
295.1696 + System.out.println("*** fail at n/p/f = "+nargs+"/"+pos+"/"+fold+": "+argsToPass+" => "+result+" != "+expected);
295.1697 + assertEquals(expected, result);
295.1698 + }
295.1699 +
295.1700 + @Test
295.1701 + public void testDropArguments() throws Throwable {
295.1702 + if (CAN_SKIP_WORKING) return;
295.1703 + startTest("dropArguments");
295.1704 + for (int nargs = 0; nargs <= 4; nargs++) {
295.1705 + for (int drop = 1; drop <= 4; drop++) {
295.1706 + for (int pos = 0; pos <= nargs; pos++) {
295.1707 + testDropArguments(nargs, pos, drop);
295.1708 + }
295.1709 + }
295.1710 + }
295.1711 + }
295.1712 +
295.1713 + void testDropArguments(int nargs, int pos, int drop) throws Throwable {
295.1714 + countTest();
295.1715 + MethodHandle target = varargsArray(nargs);
295.1716 + Object[] args = randomArgs(target.type().parameterArray());
295.1717 + MethodHandle target2 = MethodHandles.dropArguments(target, pos,
295.1718 + Collections.nCopies(drop, Object.class).toArray(new Class[0]));
295.1719 + List<Object> resList = Arrays.asList(args);
295.1720 + List<Object> argsToDrop = new ArrayList<Object>(resList);
295.1721 + for (int i = drop; i > 0; i--) {
295.1722 + argsToDrop.add(pos, "blort#"+i);
295.1723 + }
295.1724 + Object res2 = target2.invokeWithArguments(argsToDrop);
295.1725 + Object res2List = Arrays.asList((Object[])res2);
295.1726 + //if (!resList.equals(res2List))
295.1727 + // System.out.println("*** fail at n/p/d = "+nargs+"/"+pos+"/"+drop+": "+argsToDrop+" => "+res2List);
295.1728 + assertEquals(resList, res2List);
295.1729 + }
295.1730 +
295.1731 + @Test
295.1732 + public void testInvokers() throws Throwable {
295.1733 + if (CAN_SKIP_WORKING) return;
295.1734 + startTest("exactInvoker, genericInvoker, varargsInvoker, dynamicInvoker");
295.1735 + // exactInvoker, genericInvoker, varargsInvoker[0..N], dynamicInvoker
295.1736 + Set<MethodType> done = new HashSet<MethodType>();
295.1737 + for (int i = 0; i <= 6; i++) {
295.1738 + MethodType gtype = MethodType.genericMethodType(i);
295.1739 + for (Class<?> argType : new Class[]{Object.class, Integer.class, int.class}) {
295.1740 + for (int j = -1; j < i; j++) {
295.1741 + MethodType type = gtype;
295.1742 + if (j < 0)
295.1743 + type = type.changeReturnType(argType);
295.1744 + else if (argType == void.class)
295.1745 + continue;
295.1746 + else
295.1747 + type = type.changeParameterType(j, argType);
295.1748 + if (argType.isPrimitive() && j != i-1) continue; // FIXME Fail_5
295.1749 + if (done.add(type))
295.1750 + testInvokers(type);
295.1751 + MethodType vtype = type.changeReturnType(void.class);
295.1752 + if (done.add(vtype))
295.1753 + testInvokers(vtype);
295.1754 + }
295.1755 + }
295.1756 + }
295.1757 + }
295.1758 +
295.1759 + public void testInvokers(MethodType type) throws Throwable {
295.1760 + if (verbosity >= 3)
295.1761 + System.out.println("test invokers for "+type);
295.1762 + int nargs = type.parameterCount();
295.1763 + boolean testRetCode = type.returnType() != void.class;
295.1764 + MethodHandle target = PRIVATE.findStatic(MethodHandlesTest.class, "invokee",
295.1765 + MethodType.genericMethodType(0, true));
295.1766 + assertTrue(target.isVarargsCollector());
295.1767 + target = target.asType(type);
295.1768 + Object[] args = randomArgs(type.parameterArray());
295.1769 + List<Object> targetPlusArgs = new ArrayList<Object>(Arrays.asList(args));
295.1770 + targetPlusArgs.add(0, target);
295.1771 + int code = (Integer) invokee(args);
295.1772 + Object log = logEntry("invokee", args);
295.1773 + assertEquals(log.hashCode(), code);
295.1774 + assertCalled("invokee", args);
295.1775 + MethodHandle inv;
295.1776 + Object result;
295.1777 + // exact invoker
295.1778 + countTest();
295.1779 + calledLog.clear();
295.1780 + inv = MethodHandles.exactInvoker(type);
295.1781 + result = inv.invokeWithArguments(targetPlusArgs);
295.1782 + if (testRetCode) assertEquals(code, result);
295.1783 + assertCalled("invokee", args);
295.1784 + // generic invoker
295.1785 + countTest();
295.1786 + inv = MethodHandles.genericInvoker(type);
295.1787 + if (nargs <= 3) {
295.1788 + calledLog.clear();
295.1789 + switch (nargs) {
295.1790 + case 0:
295.1791 + result = inv.invokeExact(target);
295.1792 + break;
295.1793 + case 1:
295.1794 + result = inv.invokeExact(target, args[0]);
295.1795 + break;
295.1796 + case 2:
295.1797 + result = inv.invokeExact(target, args[0], args[1]);
295.1798 + break;
295.1799 + case 3:
295.1800 + result = inv.invokeExact(target, args[0], args[1], args[2]);
295.1801 + break;
295.1802 + }
295.1803 + if (testRetCode) assertEquals(code, result);
295.1804 + assertCalled("invokee", args);
295.1805 + }
295.1806 + calledLog.clear();
295.1807 + result = inv.invokeWithArguments(targetPlusArgs);
295.1808 + if (testRetCode) assertEquals(code, result);
295.1809 + assertCalled("invokee", args);
295.1810 + // varargs invoker #0
295.1811 + calledLog.clear();
295.1812 + inv = MethodHandles.spreadInvoker(type, 0);
295.1813 + result = inv.invokeExact(target, args);
295.1814 + if (testRetCode) assertEquals(code, result);
295.1815 + assertCalled("invokee", args);
295.1816 + if (nargs >= 1) {
295.1817 + // varargs invoker #1
295.1818 + calledLog.clear();
295.1819 + inv = MethodHandles.spreadInvoker(type, 1);
295.1820 + result = inv.invokeExact(target, args[0], Arrays.copyOfRange(args, 1, nargs));
295.1821 + if (testRetCode) assertEquals(code, result);
295.1822 + assertCalled("invokee", args);
295.1823 + }
295.1824 + if (nargs >= 2) {
295.1825 + // varargs invoker #2
295.1826 + calledLog.clear();
295.1827 + inv = MethodHandles.spreadInvoker(type, 2);
295.1828 + result = inv.invokeExact(target, args[0], args[1], Arrays.copyOfRange(args, 2, nargs));
295.1829 + if (testRetCode) assertEquals(code, result);
295.1830 + assertCalled("invokee", args);
295.1831 + }
295.1832 + if (nargs >= 3) {
295.1833 + // varargs invoker #3
295.1834 + calledLog.clear();
295.1835 + inv = MethodHandles.spreadInvoker(type, 3);
295.1836 + result = inv.invokeExact(target, args[0], args[1], args[2], Arrays.copyOfRange(args, 3, nargs));
295.1837 + if (testRetCode) assertEquals(code, result);
295.1838 + assertCalled("invokee", args);
295.1839 + }
295.1840 + for (int k = 0; k <= nargs; k++) {
295.1841 + // varargs invoker #0..N
295.1842 + countTest();
295.1843 + calledLog.clear();
295.1844 + inv = MethodHandles.spreadInvoker(type, k);
295.1845 + List<Object> targetPlusVarArgs = new ArrayList<Object>(targetPlusArgs);
295.1846 + List<Object> tailList = targetPlusVarArgs.subList(1+k, 1+nargs);
295.1847 + Object[] tail = tailList.toArray();
295.1848 + tailList.clear(); tailList.add(tail);
295.1849 + result = inv.invokeWithArguments(targetPlusVarArgs);
295.1850 + if (testRetCode) assertEquals(code, result);
295.1851 + assertCalled("invokee", args);
295.1852 + }
295.1853 +
295.1854 + // dynamic invoker
295.1855 + countTest();
295.1856 + CallSite site = new MutableCallSite(type);
295.1857 + inv = site.dynamicInvoker();
295.1858 +
295.1859 + // see if we get the result of the original target:
295.1860 + try {
295.1861 + result = inv.invokeWithArguments(args);
295.1862 + assertTrue("should not reach here", false);
295.1863 + } catch (IllegalStateException ex) {
295.1864 + String msg = ex.getMessage();
295.1865 + assertTrue(msg, msg.contains("site"));
295.1866 + }
295.1867 +
295.1868 + // set new target after invoker is created, to make sure we track target
295.1869 + site.setTarget(target);
295.1870 + calledLog.clear();
295.1871 + result = inv.invokeWithArguments(args);
295.1872 + if (testRetCode) assertEquals(code, result);
295.1873 + assertCalled("invokee", args);
295.1874 + }
295.1875 +
295.1876 + static Object invokee(Object... args) {
295.1877 + return called("invokee", args).hashCode();
295.1878 + }
295.1879 +
295.1880 + private static final String MISSING_ARG = "missingArg";
295.1881 + static Object targetIfEquals() {
295.1882 + return called("targetIfEquals");
295.1883 + }
295.1884 + static Object fallbackIfNotEquals() {
295.1885 + return called("fallbackIfNotEquals");
295.1886 + }
295.1887 + static Object targetIfEquals(Object x) {
295.1888 + assertEquals(x, MISSING_ARG);
295.1889 + return called("targetIfEquals", x);
295.1890 + }
295.1891 + static Object fallbackIfNotEquals(Object x) {
295.1892 + assertFalse(x.toString(), x.equals(MISSING_ARG));
295.1893 + return called("fallbackIfNotEquals", x);
295.1894 + }
295.1895 + static Object targetIfEquals(Object x, Object y) {
295.1896 + assertEquals(x, y);
295.1897 + return called("targetIfEquals", x, y);
295.1898 + }
295.1899 + static Object fallbackIfNotEquals(Object x, Object y) {
295.1900 + assertFalse(x.toString(), x.equals(y));
295.1901 + return called("fallbackIfNotEquals", x, y);
295.1902 + }
295.1903 + static Object targetIfEquals(Object x, Object y, Object z) {
295.1904 + assertEquals(x, y);
295.1905 + return called("targetIfEquals", x, y, z);
295.1906 + }
295.1907 + static Object fallbackIfNotEquals(Object x, Object y, Object z) {
295.1908 + assertFalse(x.toString(), x.equals(y));
295.1909 + return called("fallbackIfNotEquals", x, y, z);
295.1910 + }
295.1911 +
295.1912 + @Test
295.1913 + public void testGuardWithTest() throws Throwable {
295.1914 + if (CAN_SKIP_WORKING) return;
295.1915 + startTest("guardWithTest");
295.1916 + for (int nargs = 0; nargs <= 3; nargs++) {
295.1917 + if (nargs != 2) continue; // FIXME: test more later
295.1918 + testGuardWithTest(nargs, Object.class);
295.1919 + testGuardWithTest(nargs, String.class);
295.1920 + }
295.1921 + }
295.1922 + void testGuardWithTest(int nargs, Class<?> argClass) throws Throwable {
295.1923 + countTest();
295.1924 + MethodHandle test = PRIVATE.findVirtual(Object.class, "equals", MethodType.methodType(boolean.class, Object.class));
295.1925 + MethodHandle target = PRIVATE.findStatic(MethodHandlesTest.class, "targetIfEquals", MethodType.genericMethodType(nargs));
295.1926 + MethodHandle fallback = PRIVATE.findStatic(MethodHandlesTest.class, "fallbackIfNotEquals", MethodType.genericMethodType(nargs));
295.1927 + while (test.type().parameterCount() < nargs)
295.1928 + test = MethodHandles.dropArguments(test, test.type().parameterCount()-1, Object.class);
295.1929 + while (test.type().parameterCount() > nargs)
295.1930 + test = MethodHandles.insertArguments(test, 0, MISSING_ARG);
295.1931 + if (argClass != Object.class) {
295.1932 + test = changeArgTypes(test, argClass);
295.1933 + target = changeArgTypes(target, argClass);
295.1934 + fallback = changeArgTypes(fallback, argClass);
295.1935 + }
295.1936 + MethodHandle mh = MethodHandles.guardWithTest(test, target, fallback);
295.1937 + assertEquals(target.type(), mh.type());
295.1938 + Object[][] argLists = {
295.1939 + { },
295.1940 + { "foo" }, { MISSING_ARG },
295.1941 + { "foo", "foo" }, { "foo", "bar" },
295.1942 + { "foo", "foo", "baz" }, { "foo", "bar", "baz" }
295.1943 + };
295.1944 + for (Object[] argList : argLists) {
295.1945 + if (argList.length != nargs) continue;
295.1946 + boolean equals;
295.1947 + switch (nargs) {
295.1948 + case 0: equals = true; break;
295.1949 + case 1: equals = MISSING_ARG.equals(argList[0]); break;
295.1950 + default: equals = argList[0].equals(argList[1]); break;
295.1951 + }
295.1952 + String willCall = (equals ? "targetIfEquals" : "fallbackIfNotEquals");
295.1953 + if (verbosity >= 3)
295.1954 + System.out.println(logEntry(willCall, argList));
295.1955 + Object result = mh.invokeWithArguments(argList);
295.1956 + assertCalled(willCall, argList);
295.1957 + }
295.1958 + }
295.1959 +
295.1960 + @Test
295.1961 + public void testCatchException() throws Throwable {
295.1962 + if (CAN_SKIP_WORKING) return;
295.1963 + startTest("catchException");
295.1964 + for (int nargs = 2; nargs <= 6; nargs++) {
295.1965 + for (int ti = 0; ti <= 1; ti++) {
295.1966 + boolean throwIt = (ti != 0);
295.1967 + testCatchException(int.class, new ClassCastException("testing"), throwIt, nargs);
295.1968 + testCatchException(void.class, new java.io.IOException("testing"), throwIt, nargs);
295.1969 + testCatchException(String.class, new LinkageError("testing"), throwIt, nargs);
295.1970 + }
295.1971 + }
295.1972 + }
295.1973 +
295.1974 + private static <T extends Throwable>
295.1975 + Object throwOrReturn(Object normal, T exception) throws T {
295.1976 + if (exception != null) throw exception;
295.1977 + return normal;
295.1978 + }
295.1979 +
295.1980 + void testCatchException(Class<?> returnType, Throwable thrown, boolean throwIt, int nargs) throws Throwable {
295.1981 + countTest();
295.1982 + if (verbosity >= 3)
295.1983 + System.out.println("catchException rt="+returnType+" throw="+throwIt+" nargs="+nargs);
295.1984 + Class<? extends Throwable> exType = thrown.getClass();
295.1985 + MethodHandle throwOrReturn
295.1986 + = PRIVATE.findStatic(MethodHandlesTest.class, "throwOrReturn",
295.1987 + MethodType.methodType(Object.class, Object.class, Throwable.class));
295.1988 + MethodHandle thrower = throwOrReturn.asType(MethodType.genericMethodType(2));
295.1989 + while (thrower.type().parameterCount() < nargs)
295.1990 + thrower = MethodHandles.dropArguments(thrower, thrower.type().parameterCount(), Object.class);
295.1991 + MethodHandle catcher = varargsList(1+nargs).asType(MethodType.genericMethodType(1+nargs));
295.1992 + MethodHandle target = MethodHandles.catchException(thrower,
295.1993 + thrown.getClass(), catcher);
295.1994 + assertEquals(thrower.type(), target.type());
295.1995 + //System.out.println("catching with "+target+" : "+throwOrReturn);
295.1996 + Object[] args = randomArgs(nargs, Object.class);
295.1997 + args[1] = (throwIt ? thrown : null);
295.1998 + Object returned = target.invokeWithArguments(args);
295.1999 + //System.out.println("return from "+target+" : "+returned);
295.2000 + if (!throwIt) {
295.2001 + assertSame(args[0], returned);
295.2002 + } else {
295.2003 + List<Object> catchArgs = new ArrayList<Object>(Arrays.asList(args));
295.2004 + catchArgs.add(0, thrown);
295.2005 + assertEquals(catchArgs, returned);
295.2006 + }
295.2007 + }
295.2008 +
295.2009 + @Test
295.2010 + public void testThrowException() throws Throwable {
295.2011 + if (CAN_SKIP_WORKING) return;
295.2012 + startTest("throwException");
295.2013 + testThrowException(int.class, new ClassCastException("testing"));
295.2014 + testThrowException(void.class, new java.io.IOException("testing"));
295.2015 + testThrowException(String.class, new LinkageError("testing"));
295.2016 + }
295.2017 +
295.2018 + void testThrowException(Class<?> returnType, Throwable thrown) throws Throwable {
295.2019 + countTest();
295.2020 + Class<? extends Throwable> exType = thrown.getClass();
295.2021 + MethodHandle target = MethodHandles.throwException(returnType, exType);
295.2022 + //System.out.println("throwing with "+target+" : "+thrown);
295.2023 + MethodType expectedType = MethodType.methodType(returnType, exType);
295.2024 + assertEquals(expectedType, target.type());
295.2025 + target = MethodHandles.convertArguments(target, target.type().generic());
295.2026 + Throwable caught = null;
295.2027 + try {
295.2028 + Object res = target.invokeExact((Object) thrown);
295.2029 + fail("got "+res+" instead of throwing "+thrown);
295.2030 + } catch (Throwable ex) {
295.2031 + if (ex != thrown) {
295.2032 + if (ex instanceof Error) throw (Error)ex;
295.2033 + if (ex instanceof RuntimeException) throw (RuntimeException)ex;
295.2034 + }
295.2035 + caught = ex;
295.2036 + }
295.2037 + assertSame(thrown, caught);
295.2038 + }
295.2039 +
295.2040 + @Test
295.2041 + public void testCastFailure() throws Throwable {
295.2042 + if (CAN_SKIP_WORKING) return;
295.2043 + startTest("testCastFailure");
295.2044 + testCastFailure("cast/argument", 11000);
295.2045 + testCastFailure("unbox/argument", 11000);
295.2046 + testCastFailure("cast/return", 11000);
295.2047 + testCastFailure("unbox/return", 11000);
295.2048 + }
295.2049 +
295.2050 + static class Surprise {
295.2051 + public MethodHandle asMethodHandle() {
295.2052 + return VALUE.bindTo(this);
295.2053 + }
295.2054 + Object value(Object x) {
295.2055 + trace("value", x);
295.2056 + if (boo != null) return boo;
295.2057 + return x;
295.2058 + }
295.2059 + Object boo;
295.2060 + void boo(Object x) { boo = x; }
295.2061 +
295.2062 + static void trace(String x, Object y) {
295.2063 + if (verbosity > 8) System.out.println(x+"="+y);
295.2064 + }
295.2065 + static Object refIdentity(Object x) { trace("ref.x", x); return x; }
295.2066 + static Integer boxIdentity(Integer x) { trace("box.x", x); return x; }
295.2067 + static int intIdentity(int x) { trace("int.x", x); return x; }
295.2068 + static MethodHandle VALUE, REF_IDENTITY, BOX_IDENTITY, INT_IDENTITY;
295.2069 + static {
295.2070 + try {
295.2071 + VALUE = PRIVATE.findVirtual(
295.2072 + Surprise.class, "value",
295.2073 + MethodType.methodType(Object.class, Object.class));
295.2074 + REF_IDENTITY = PRIVATE.findStatic(
295.2075 + Surprise.class, "refIdentity",
295.2076 + MethodType.methodType(Object.class, Object.class));
295.2077 + BOX_IDENTITY = PRIVATE.findStatic(
295.2078 + Surprise.class, "boxIdentity",
295.2079 + MethodType.methodType(Integer.class, Integer.class));
295.2080 + INT_IDENTITY = PRIVATE.findStatic(
295.2081 + Surprise.class, "intIdentity",
295.2082 + MethodType.methodType(int.class, int.class));
295.2083 + } catch (Exception ex) {
295.2084 + throw new RuntimeException(ex);
295.2085 + }
295.2086 + }
295.2087 + }
295.2088 +
295.2089 + void testCastFailure(String mode, int okCount) throws Throwable {
295.2090 + countTest(false);
295.2091 + if (verbosity > 2) System.out.println("mode="+mode);
295.2092 + Surprise boo = new Surprise();
295.2093 + MethodHandle identity = Surprise.REF_IDENTITY, surprise0 = boo.asMethodHandle(), surprise = surprise0;
295.2094 + if (mode.endsWith("/return")) {
295.2095 + if (mode.equals("unbox/return")) {
295.2096 + // fail on return to ((Integer)surprise).intValue
295.2097 + surprise = MethodHandles.convertArguments(surprise, MethodType.methodType(int.class, Object.class));
295.2098 + identity = MethodHandles.convertArguments(identity, MethodType.methodType(int.class, Object.class));
295.2099 + } else if (mode.equals("cast/return")) {
295.2100 + // fail on return to (Integer)surprise
295.2101 + surprise = MethodHandles.convertArguments(surprise, MethodType.methodType(Integer.class, Object.class));
295.2102 + identity = MethodHandles.convertArguments(identity, MethodType.methodType(Integer.class, Object.class));
295.2103 + }
295.2104 + } else if (mode.endsWith("/argument")) {
295.2105 + MethodHandle callee = null;
295.2106 + if (mode.equals("unbox/argument")) {
295.2107 + // fail on handing surprise to int argument
295.2108 + callee = Surprise.INT_IDENTITY;
295.2109 + } else if (mode.equals("cast/argument")) {
295.2110 + // fail on handing surprise to Integer argument
295.2111 + callee = Surprise.BOX_IDENTITY;
295.2112 + }
295.2113 + if (callee != null) {
295.2114 + callee = MethodHandles.convertArguments(callee, MethodType.genericMethodType(1));
295.2115 + surprise = MethodHandles.filterArguments(callee, 0, surprise);
295.2116 + identity = MethodHandles.filterArguments(callee, 0, identity);
295.2117 + }
295.2118 + }
295.2119 + assertNotSame(mode, surprise, surprise0);
295.2120 + identity = MethodHandles.convertArguments(identity, MethodType.genericMethodType(1));
295.2121 + surprise = MethodHandles.convertArguments(surprise, MethodType.genericMethodType(1));
295.2122 + Object x = 42;
295.2123 + for (int i = 0; i < okCount; i++) {
295.2124 + Object y = identity.invokeExact(x);
295.2125 + assertEquals(x, y);
295.2126 + Object z = surprise.invokeExact(x);
295.2127 + assertEquals(x, z);
295.2128 + }
295.2129 + boo.boo("Boo!");
295.2130 + Object y = identity.invokeExact(x);
295.2131 + assertEquals(x, y);
295.2132 + try {
295.2133 + Object z = surprise.invokeExact(x);
295.2134 + System.out.println("Failed to throw; got z="+z);
295.2135 + assertTrue(false);
295.2136 + } catch (Exception ex) {
295.2137 + if (verbosity > 2)
295.2138 + System.out.println("caught "+ex);
295.2139 + if (verbosity > 3)
295.2140 + ex.printStackTrace();
295.2141 + assertTrue(ex instanceof ClassCastException
295.2142 + // FIXME: accept only one of the two for any given unit test
295.2143 + || ex instanceof WrongMethodTypeException
295.2144 + );
295.2145 + }
295.2146 + }
295.2147 +
295.2148 + static Example userMethod(Object o, String s, int i) {
295.2149 + called("userMethod", o, s, i);
295.2150 + return null;
295.2151 + }
295.2152 +
295.2153 + @Test
295.2154 + public void testUserClassInSignature() throws Throwable {
295.2155 + if (CAN_SKIP_WORKING) return;
295.2156 + startTest("testUserClassInSignature");
295.2157 + Lookup lookup = MethodHandles.lookup();
295.2158 + String name; MethodType mt; MethodHandle mh;
295.2159 + Object[] args;
295.2160 +
295.2161 + // Try a static method.
295.2162 + name = "userMethod";
295.2163 + mt = MethodType.methodType(Example.class, Object.class, String.class, int.class);
295.2164 + mh = lookup.findStatic(lookup.lookupClass(), name, mt);
295.2165 + assertEquals(mt, mh.type());
295.2166 + assertEquals(Example.class, mh.type().returnType());
295.2167 + args = randomArgs(mh.type().parameterArray());
295.2168 + mh.invokeWithArguments(args);
295.2169 + assertCalled(name, args);
295.2170 +
295.2171 + // Try a virtual method.
295.2172 + name = "v2";
295.2173 + mt = MethodType.methodType(Object.class, Object.class, int.class);
295.2174 + mh = lookup.findVirtual(Example.class, name, mt);
295.2175 + assertEquals(mt, mh.type().dropParameterTypes(0,1));
295.2176 + assertTrue(mh.type().parameterList().contains(Example.class));
295.2177 + args = randomArgs(mh.type().parameterArray());
295.2178 + mh.invokeWithArguments(args);
295.2179 + assertCalled(name, args);
295.2180 + }
295.2181 +
295.2182 + static void runForRunnable() {
295.2183 + called("runForRunnable");
295.2184 + }
295.2185 + private interface Fooable {
295.2186 + Object foo(Fooable x, Object y);
295.2187 + // this is for randomArg:
295.2188 + public class Impl implements Fooable {
295.2189 + public Object foo(Fooable x, Object y) {
295.2190 + throw new RuntimeException("do not call");
295.2191 + }
295.2192 + final String name;
295.2193 + public Impl() { name = "Fooable#"+nextArg(); }
295.2194 + @Override public String toString() { return name; }
295.2195 + }
295.2196 + }
295.2197 + static Object fooForFooable(Fooable x, Object y) {
295.2198 + return called("fooForFooable", x, y);
295.2199 + }
295.2200 + private static class MyCheckedException extends Exception {
295.2201 + }
295.2202 + private interface WillThrow {
295.2203 + void willThrow() throws MyCheckedException;
295.2204 + }
295.2205 +
295.2206 + @Test
295.2207 + public void testAsInstance() throws Throwable {
295.2208 + if (CAN_SKIP_WORKING) return;
295.2209 + Lookup lookup = MethodHandles.lookup();
295.2210 + {
295.2211 + MethodType mt = MethodType.methodType(void.class);
295.2212 + MethodHandle mh = lookup.findStatic(MethodHandlesTest.class, "runForRunnable", mt);
295.2213 + Runnable proxy = MethodHandles.asInstance(mh, Runnable.class);
295.2214 + proxy.run();
295.2215 + assertCalled("runForRunnable");
295.2216 + }
295.2217 + {
295.2218 + MethodType mt = MethodType.methodType(Object.class, Fooable.class, Object.class);
295.2219 + MethodHandle mh = lookup.findStatic(MethodHandlesTest.class, "fooForFooable", mt);
295.2220 + Fooable proxy = MethodHandles.asInstance(mh, Fooable.class);
295.2221 + Object[] args = randomArgs(mt.parameterArray());
295.2222 + Object result = proxy.foo((Fooable) args[0], args[1]);
295.2223 + assertCalled("fooForFooable", args);
295.2224 + assertEquals(result, logEntry("fooForFooable", args));
295.2225 + }
295.2226 + for (Throwable ex : new Throwable[] { new NullPointerException("ok"),
295.2227 + new InternalError("ok"),
295.2228 + new Throwable("fail"),
295.2229 + new Exception("fail"),
295.2230 + new MyCheckedException()
295.2231 + }) {
295.2232 + MethodHandle mh = MethodHandles.throwException(void.class, Throwable.class);
295.2233 + mh = MethodHandles.insertArguments(mh, 0, ex);
295.2234 + WillThrow proxy = MethodHandles.asInstance(mh, WillThrow.class);
295.2235 + try {
295.2236 + proxy.willThrow();
295.2237 + System.out.println("Failed to throw: "+ex);
295.2238 + assertTrue(false);
295.2239 + } catch (Throwable ex1) {
295.2240 + if (verbosity > 2) {
295.2241 + System.out.println("throw "+ex);
295.2242 + System.out.println("catch "+(ex == ex1 ? "UNWRAPPED" : ex1));
295.2243 + }
295.2244 + if (ex instanceof RuntimeException ||
295.2245 + ex instanceof Error) {
295.2246 + assertSame("must pass unchecked exception out without wrapping", ex, ex1);
295.2247 + } else if (ex instanceof MyCheckedException) {
295.2248 + assertSame("must pass declared exception out without wrapping", ex, ex1);
295.2249 + } else {
295.2250 + assertNotSame("must pass undeclared checked exception with wrapping", ex, ex1);
295.2251 + UndeclaredThrowableException utex = (UndeclaredThrowableException) ex1;
295.2252 + assertSame(ex, utex.getCause());
295.2253 + }
295.2254 + }
295.2255 + }
295.2256 + // Test error checking:
295.2257 + for (Class<?> nonSAM : new Class[] { Object.class,
295.2258 + String.class,
295.2259 + CharSequence.class,
295.2260 + Example.class }) {
295.2261 + try {
295.2262 + MethodHandles.asInstance(varargsArray(0), nonSAM);
295.2263 + System.out.println("Failed to throw");
295.2264 + assertTrue(false);
295.2265 + } catch (IllegalArgumentException ex) {
295.2266 + }
295.2267 + }
295.2268 + }
295.2269 +}
295.2270 +// Local abbreviated copy of sun.invoke.util.ValueConversions
295.2271 +class ValueConversions {
295.2272 + private static final Lookup IMPL_LOOKUP = MethodHandles.lookup();
295.2273 + private static final Object[] NO_ARGS_ARRAY = {};
295.2274 + private static Object[] makeArray(Object... args) { return args; }
295.2275 + private static Object[] array() { return NO_ARGS_ARRAY; }
295.2276 + private static Object[] array(Object a0)
295.2277 + { return makeArray(a0); }
295.2278 + private static Object[] array(Object a0, Object a1)
295.2279 + { return makeArray(a0, a1); }
295.2280 + private static Object[] array(Object a0, Object a1, Object a2)
295.2281 + { return makeArray(a0, a1, a2); }
295.2282 + private static Object[] array(Object a0, Object a1, Object a2, Object a3)
295.2283 + { return makeArray(a0, a1, a2, a3); }
295.2284 + private static Object[] array(Object a0, Object a1, Object a2, Object a3,
295.2285 + Object a4)
295.2286 + { return makeArray(a0, a1, a2, a3, a4); }
295.2287 + private static Object[] array(Object a0, Object a1, Object a2, Object a3,
295.2288 + Object a4, Object a5)
295.2289 + { return makeArray(a0, a1, a2, a3, a4, a5); }
295.2290 + private static Object[] array(Object a0, Object a1, Object a2, Object a3,
295.2291 + Object a4, Object a5, Object a6)
295.2292 + { return makeArray(a0, a1, a2, a3, a4, a5, a6); }
295.2293 + private static Object[] array(Object a0, Object a1, Object a2, Object a3,
295.2294 + Object a4, Object a5, Object a6, Object a7)
295.2295 + { return makeArray(a0, a1, a2, a3, a4, a5, a6, a7); }
295.2296 + private static Object[] array(Object a0, Object a1, Object a2, Object a3,
295.2297 + Object a4, Object a5, Object a6, Object a7,
295.2298 + Object a8)
295.2299 + { return makeArray(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
295.2300 + private static Object[] array(Object a0, Object a1, Object a2, Object a3,
295.2301 + Object a4, Object a5, Object a6, Object a7,
295.2302 + Object a8, Object a9)
295.2303 + { return makeArray(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
295.2304 + static MethodHandle[] makeArrays() {
295.2305 + ArrayList<MethodHandle> arrays = new ArrayList<MethodHandle>();
295.2306 + MethodHandles.Lookup lookup = IMPL_LOOKUP;
295.2307 + for (;;) {
295.2308 + int nargs = arrays.size();
295.2309 + MethodType type = MethodType.genericMethodType(nargs).changeReturnType(Object[].class);
295.2310 + String name = "array";
295.2311 + MethodHandle array = null;
295.2312 + try {
295.2313 + array = lookup.findStatic(ValueConversions.class, name, type);
295.2314 + } catch (ReflectiveOperationException ex) {
295.2315 + // break from loop!
295.2316 + }
295.2317 + if (array == null) break;
295.2318 + arrays.add(array);
295.2319 + }
295.2320 + assertTrue(arrays.size() == 11); // current number of methods
295.2321 + return arrays.toArray(new MethodHandle[0]);
295.2322 + }
295.2323 + static final MethodHandle[] ARRAYS = makeArrays();
295.2324 +
295.2325 + /** Return a method handle that takes the indicated number of Object
295.2326 + * arguments and returns an Object array of them, as if for varargs.
295.2327 + */
295.2328 + public static MethodHandle varargsArray(int nargs) {
295.2329 + if (nargs < ARRAYS.length)
295.2330 + return ARRAYS[nargs];
295.2331 + // else need to spin bytecode or do something else fancy
295.2332 + throw new UnsupportedOperationException("NYI: cannot form a varargs array of length "+nargs);
295.2333 + }
295.2334 +
295.2335 + private static final List<Object> NO_ARGS_LIST = Arrays.asList(NO_ARGS_ARRAY);
295.2336 + private static List<Object> makeList(Object... args) { return Arrays.asList(args); }
295.2337 + private static List<Object> list() { return NO_ARGS_LIST; }
295.2338 + private static List<Object> list(Object a0)
295.2339 + { return makeList(a0); }
295.2340 + private static List<Object> list(Object a0, Object a1)
295.2341 + { return makeList(a0, a1); }
295.2342 + private static List<Object> list(Object a0, Object a1, Object a2)
295.2343 + { return makeList(a0, a1, a2); }
295.2344 + private static List<Object> list(Object a0, Object a1, Object a2, Object a3)
295.2345 + { return makeList(a0, a1, a2, a3); }
295.2346 + private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
295.2347 + Object a4)
295.2348 + { return makeList(a0, a1, a2, a3, a4); }
295.2349 + private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
295.2350 + Object a4, Object a5)
295.2351 + { return makeList(a0, a1, a2, a3, a4, a5); }
295.2352 + private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
295.2353 + Object a4, Object a5, Object a6)
295.2354 + { return makeList(a0, a1, a2, a3, a4, a5, a6); }
295.2355 + private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
295.2356 + Object a4, Object a5, Object a6, Object a7)
295.2357 + { return makeList(a0, a1, a2, a3, a4, a5, a6, a7); }
295.2358 + private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
295.2359 + Object a4, Object a5, Object a6, Object a7,
295.2360 + Object a8)
295.2361 + { return makeList(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
295.2362 + private static List<Object> list(Object a0, Object a1, Object a2, Object a3,
295.2363 + Object a4, Object a5, Object a6, Object a7,
295.2364 + Object a8, Object a9)
295.2365 + { return makeList(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
295.2366 + static MethodHandle[] makeLists() {
295.2367 + ArrayList<MethodHandle> lists = new ArrayList<MethodHandle>();
295.2368 + MethodHandles.Lookup lookup = IMPL_LOOKUP;
295.2369 + for (;;) {
295.2370 + int nargs = lists.size();
295.2371 + MethodType type = MethodType.genericMethodType(nargs).changeReturnType(List.class);
295.2372 + String name = "list";
295.2373 + MethodHandle list = null;
295.2374 + try {
295.2375 + list = lookup.findStatic(ValueConversions.class, name, type);
295.2376 + } catch (ReflectiveOperationException ex) {
295.2377 + // break from loop!
295.2378 + }
295.2379 + if (list == null) break;
295.2380 + lists.add(list);
295.2381 + }
295.2382 + assertTrue(lists.size() == 11); // current number of methods
295.2383 + return lists.toArray(new MethodHandle[0]);
295.2384 + }
295.2385 + static final MethodHandle[] LISTS = makeLists();
295.2386 +
295.2387 + /** Return a method handle that takes the indicated number of Object
295.2388 + * arguments and returns List.
295.2389 + */
295.2390 + public static MethodHandle varargsList(int nargs) {
295.2391 + if (nargs < LISTS.length)
295.2392 + return LISTS[nargs];
295.2393 + // else need to spin bytecode or do something else fancy
295.2394 + throw new UnsupportedOperationException("NYI");
295.2395 + }
295.2396 +}
295.2397 +// This guy tests access from outside the same package member, but inside
295.2398 +// the package itself.
295.2399 +class PackageSibling {
295.2400 + static Lookup lookup() {
295.2401 + return MethodHandles.lookup();
295.2402 + }
295.2403 +}
296.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
296.2 +++ b/test/java/lang/invoke/MethodTypeTest.java Tue Mar 29 20:19:55 2011 -0700
296.3 @@ -0,0 +1,567 @@
296.4 +/*
296.5 + * Copyright 2008, 2011 Sun Microsystems, Inc. All Rights Reserved.
296.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
296.7 + *
296.8 + * This code is free software; you can redistribute it and/or modify it
296.9 + * under the terms of the GNU General Public License version 2 only, as
296.10 + * published by the Free Software Foundation. Sun designates this
296.11 + * particular file as subject to the "Classpath" exception as provided
296.12 + * by Sun in the LICENSE file that accompanied this code.
296.13 + *
296.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
296.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
296.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
296.17 + * version 2 for more details (a copy is included in the LICENSE file that
296.18 + * accompanied this code).
296.19 + *
296.20 + * You should have received a copy of the GNU General Public License version
296.21 + * 2 along with this work; if not, write to the Free Software Foundation,
296.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
296.23 + *
296.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
296.25 + * CA 95054 USA or visit www.sun.com if you need additional information or
296.26 + * have any questions.
296.27 + */
296.28 +
296.29 +/* @test
296.30 + * @summary unit tests for java.lang.invoke.MethodType
296.31 + * @compile MethodTypeTest.java
296.32 + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles test.java.lang.invoke.MethodTypeTest
296.33 + */
296.34 +
296.35 +package test.java.lang.invoke;
296.36 +
296.37 +import java.lang.invoke.MethodType;
296.38 +import java.lang.reflect.Method;
296.39 +
296.40 +import java.util.*;
296.41 +import org.junit.*;
296.42 +import static org.junit.Assert.*;
296.43 +
296.44 +/**
296.45 + *
296.46 + * @author jrose
296.47 + */
296.48 +public class MethodTypeTest {
296.49 +
296.50 + private Class<?> rtype;
296.51 + private Class<?>[] ptypes;
296.52 + private MethodType mt_viS, mt_OO, mt_OO2, mt_vv, mt_Vv, mt_Ov;
296.53 + private MethodType mt_iSI, mt_ISi, mt_ISI, mt_iSi;
296.54 + private MethodType mt_viO, mt_iO2, mt_OOi, mt_iOi;
296.55 + private MethodType mt_VIO, mt_IO2, mt_OOI, mt_IOI, mt_VIS;
296.56 + private MethodType mt_vOiSzA, mt_OO99;
296.57 + private MethodType[] GALLERY;
296.58 + private Method compareTo;
296.59 +
296.60 + @Before
296.61 + public void setUp() throws Exception {
296.62 + rtype = void.class;
296.63 + ptypes = new Class<?>[] { int.class, String.class };
296.64 +
296.65 + mt_viS = MethodType.methodType(void.class, int.class, String.class);
296.66 + mt_OO = MethodType.methodType(Object.class, Object.class);
296.67 + mt_OO2 = MethodType.methodType(Object.class, Object.class, Object.class);
296.68 + mt_vv = MethodType.methodType(void.class);
296.69 + mt_Vv = MethodType.methodType(Void.class);
296.70 + mt_Ov = MethodType.methodType(Object.class);
296.71 + mt_iSI = MethodType.methodType(int.class, String.class, Integer.class);
296.72 + mt_ISi = MethodType.methodType(Integer.class, String.class, int.class);
296.73 + mt_ISI = MethodType.methodType(Integer.class, String.class, Integer.class);
296.74 + mt_iSi = MethodType.methodType(int.class, String.class, int.class);
296.75 +
296.76 + compareTo = String.class.getDeclaredMethod("compareTo", String.class);
296.77 +
296.78 + mt_viO = MethodType.methodType(void.class, int.class, Object.class);
296.79 + mt_iO2 = MethodType.methodType(int.class, Object.class, Object.class);
296.80 + mt_OOi = MethodType.methodType(Object.class, Object.class, int.class);
296.81 + mt_iOi = MethodType.methodType(int.class, Object.class, int.class);
296.82 +
296.83 + mt_VIO = MethodType.methodType(Void.class, Integer.class, Object.class);
296.84 + mt_IO2 = MethodType.methodType(Integer.class, Object.class, Object.class);
296.85 + mt_OOI = MethodType.methodType(Object.class, Object.class, Integer.class);
296.86 + mt_IOI = MethodType.methodType(Integer.class, Object.class, Integer.class);
296.87 + mt_VIS = MethodType.methodType(Void.class, Integer.class, String.class);
296.88 +
296.89 + mt_vOiSzA = MethodType.methodType(void.class, Object.class, int.class, String.class, boolean.class, Object[].class);
296.90 + mt_OO99 = MethodType.genericMethodType(99);
296.91 +
296.92 + GALLERY = new MethodType[] {
296.93 + mt_viS, mt_OO, mt_OO2, mt_vv, mt_Vv, mt_Ov,
296.94 + mt_iSI, mt_ISi, mt_ISI, mt_iSi,
296.95 + mt_viO, mt_iO2, mt_OOi, mt_iOi,
296.96 + mt_VIO, mt_IO2, mt_OOI, mt_IOI,
296.97 + mt_VIS, mt_vOiSzA, mt_OO99
296.98 + };
296.99 + }
296.100 +
296.101 + @After
296.102 + public void tearDown() throws Exception {
296.103 + }
296.104 +
296.105 + /** Make sure the method types are all distinct. */
296.106 + @Test
296.107 + public void testDistinct() {
296.108 + List<MethodType> gallery2 = new ArrayList<>();
296.109 + for (MethodType mt : GALLERY) {
296.110 + assertFalse(mt.toString(), gallery2.contains(mt));
296.111 + gallery2.add(mt);
296.112 + }
296.113 + // check self-equality also:
296.114 + assertEquals(Arrays.asList(GALLERY), gallery2);
296.115 + }
296.116 +
296.117 + /**
296.118 + * Test of make method, of class MethodType.
296.119 + */
296.120 + @Test
296.121 + public void testMake_Class_ClassArr() {
296.122 + System.out.println("make (from type array)");
296.123 + MethodType result = MethodType.methodType(rtype, ptypes);
296.124 + assertSame(mt_viS, result);
296.125 + }
296.126 +
296.127 + /**
296.128 + * Test of make method, of class MethodType.
296.129 + */
296.130 + @Test
296.131 + public void testMake_Class_List() {
296.132 + System.out.println("make (from type list)");
296.133 + MethodType result = MethodType.methodType(rtype, Arrays.asList(ptypes));
296.134 + assertSame(mt_viS, result);
296.135 + }
296.136 +
296.137 + /**
296.138 + * Test of make method, of class MethodType.
296.139 + */
296.140 + @Test
296.141 + public void testMake_3args() {
296.142 + System.out.println("make (from type with varargs)");
296.143 + MethodType result = MethodType.methodType(rtype, ptypes[0], ptypes[1]);
296.144 + assertSame(mt_viS, result);
296.145 + }
296.146 +
296.147 + /**
296.148 + * Test of make method, of class MethodType.
296.149 + */
296.150 + @Test
296.151 + public void testMake_Class() {
296.152 + System.out.println("make (from single type)");
296.153 + Class<?> rt = Integer.class;
296.154 + MethodType expResult = MethodType.methodType(rt, new Class<?>[0]);
296.155 + MethodType result = MethodType.methodType(rt);
296.156 + assertSame(expResult, result);
296.157 + }
296.158 +
296.159 + @Test
296.160 + public void testMakeGeneric() {
296.161 + System.out.println("makeGeneric");
296.162 + int objectArgCount = 2;
296.163 + MethodType expResult = mt_OO2;
296.164 + MethodType result = MethodType.genericMethodType(objectArgCount);
296.165 + assertSame(expResult, result);
296.166 + }
296.167 +
296.168 + /**
296.169 + * Test of make method, of class MethodType.
296.170 + */
296.171 + @Test
296.172 + public void testMake_MethodType() {
296.173 + System.out.println("make (from rtype, MethodType)");
296.174 + MethodType expResult = mt_iO2;
296.175 + MethodType result = MethodType.methodType(int.class, mt_IO2);
296.176 + assertSame(expResult, result);
296.177 + }
296.178 +
296.179 + /**
296.180 + * Test of make method, of class MethodType.
296.181 + */
296.182 + @Test
296.183 + public void testMake_String_ClassLoader() {
296.184 + System.out.println("make (from bytecode signature)");
296.185 + ClassLoader loader = null;
296.186 + MethodType[] instances = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
296.187 + String obj = "Ljava/lang/Object;";
296.188 + assertEquals(obj, concat(Object.class));
296.189 + String[] expResults = {
296.190 + "(ILjava/lang/String;)V",
296.191 + concat("(", obj, 2, ")", Object.class),
296.192 + "()V", "()"+obj,
296.193 + concat("(", String.class, Integer.class, ")I"),
296.194 + concat("(", String.class, "I)", Integer.class),
296.195 + concat("(", String.class, Integer.class, ")", Integer.class),
296.196 + concat("(", String.class, "I)I")
296.197 + };
296.198 + for (int i = 0; i < instances.length; i++) {
296.199 + MethodType instance = instances[i];
296.200 + String result = instance.toMethodDescriptorString();
296.201 + assertEquals("#"+i, expResults[i], result);
296.202 + MethodType parsed = MethodType.fromMethodDescriptorString(result, loader);
296.203 + assertSame("--#"+i, instance, parsed);
296.204 + }
296.205 + }
296.206 + private static String concat(Object... parts) {
296.207 + StringBuilder sb = new StringBuilder();
296.208 + Object prevPart = "";
296.209 + for (Object part : parts) {
296.210 + if (part instanceof Class) {
296.211 + part = "L"+((Class)part).getName()+";";
296.212 + }
296.213 + if (part instanceof Integer) {
296.214 + for (int n = (Integer) part; n > 1; n--)
296.215 + sb.append(prevPart);
296.216 + part = "";
296.217 + }
296.218 + sb.append(part);
296.219 + prevPart = part;
296.220 + }
296.221 + return sb.toString().replace('.', '/');
296.222 + }
296.223 +
296.224 + @Test
296.225 + public void testHasPrimitives() {
296.226 + System.out.println("hasPrimitives");
296.227 + MethodType[] instances = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
296.228 + boolean[] expResults = {true, false, true, false, true, true, false, true};
296.229 + for (int i = 0; i < instances.length; i++) {
296.230 + boolean result = instances[i].hasPrimitives();
296.231 + assertEquals("#"+i, expResults[i], result);
296.232 + }
296.233 + }
296.234 +
296.235 + @Test
296.236 + public void testHasWrappers() {
296.237 + System.out.println("hasWrappers");
296.238 + MethodType[] instances = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
296.239 + boolean[] expResults = {false, false, false, false, true, true, true, false};
296.240 + for (int i = 0; i < instances.length; i++) {
296.241 + System.out.println(" hasWrappers "+instances[i]);
296.242 + boolean result = instances[i].hasWrappers();
296.243 + assertEquals("#"+i, expResults[i], result);
296.244 + }
296.245 + }
296.246 +
296.247 + @Test
296.248 + public void testErase() {
296.249 + System.out.println("erase");
296.250 + MethodType[] instances = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
296.251 + MethodType[] expResults = {mt_viO, mt_OO2, mt_vv, mt_Ov, mt_iO2, mt_OOi, mt_OO2, mt_iOi};
296.252 + for (int i = 0; i < instances.length; i++) {
296.253 + MethodType result = instances[i].erase();
296.254 + assertSame("#"+i, expResults[i], result);
296.255 + }
296.256 + }
296.257 +
296.258 + @Test
296.259 + public void testGeneric() {
296.260 + System.out.println("generic");
296.261 + MethodType[] instances = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
296.262 + MethodType[] expResults = {mt_OO2, mt_OO2, mt_Ov, mt_Ov, mt_OO2, mt_OO2, mt_OO2, mt_OO2};
296.263 + for (int i = 0; i < instances.length; i++) {
296.264 + MethodType result = instances[i].generic();
296.265 + assertSame("#"+i, expResults[i], result);
296.266 + }
296.267 + }
296.268 +
296.269 + @Test
296.270 + public void testWrap() {
296.271 + System.out.println("wrap");
296.272 + MethodType[] instances = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
296.273 + MethodType[] expResults = {mt_VIS, mt_OO2, mt_Vv, mt_Ov, mt_ISI, mt_ISI, mt_ISI, mt_ISI};
296.274 + for (int i = 0; i < instances.length; i++) {
296.275 + MethodType result = instances[i].wrap();
296.276 + assertSame("#"+i, expResults[i], result);
296.277 + }
296.278 + }
296.279 +
296.280 + @Test
296.281 + public void testUnwrap() {
296.282 + System.out.println("unwrap");
296.283 + MethodType[] instances = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
296.284 + MethodType[] expResults = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSi, mt_iSi, mt_iSi, mt_iSi};
296.285 + for (int i = 0; i < instances.length; i++) {
296.286 + MethodType result = instances[i].unwrap();
296.287 + assertSame("#"+i, expResults[i], result);
296.288 + }
296.289 + }
296.290 +
296.291 + /**
296.292 + * Test of parameterType method, of class MethodType.
296.293 + */
296.294 + @Test
296.295 + public void testParameterType() {
296.296 + System.out.println("parameterType");
296.297 + for (int num = 0; num < ptypes.length; num++) {
296.298 + MethodType instance = mt_viS;
296.299 + Class<?> expResult = ptypes[num];
296.300 + Class<?> result = instance.parameterType(num);
296.301 + assertSame(expResult, result);
296.302 + }
296.303 + }
296.304 +
296.305 + /**
296.306 + * Test of parameterCount method, of class MethodType.
296.307 + */
296.308 + @Test
296.309 + public void testParameterCount() {
296.310 + System.out.println("parameterCount");
296.311 + MethodType instance = mt_viS;
296.312 + int expResult = 2;
296.313 + int result = instance.parameterCount();
296.314 + assertEquals(expResult, result);
296.315 + }
296.316 +
296.317 + /**
296.318 + * Test of returnType method, of class MethodType.
296.319 + */
296.320 + @Test
296.321 + public void testReturnType() {
296.322 + System.out.println("returnType");
296.323 + MethodType instance = mt_viS;
296.324 + Class<?> expResult = void.class;
296.325 + Class<?> result = instance.returnType();
296.326 + assertSame(expResult, result);
296.327 + }
296.328 +
296.329 + /**
296.330 + * Test of parameterList method, of class MethodType.
296.331 + */
296.332 + @Test
296.333 + public void testParameterList() {
296.334 + System.out.println("parameterList");
296.335 + MethodType instance = mt_viS;
296.336 + List<Class<?>> expResult = Arrays.asList(ptypes);
296.337 + List<Class<?>> result = instance.parameterList();
296.338 + assertEquals(expResult, result);
296.339 + }
296.340 +
296.341 + /**
296.342 + * Test of parameterArray method, of class MethodType.
296.343 + */
296.344 + @Test
296.345 + public void testParameterArray() {
296.346 + System.out.println("parameterArray");
296.347 + MethodType instance = mt_viS;
296.348 + Class<?>[] expResult = ptypes;
296.349 + Class<?>[] result = instance.parameterArray();
296.350 + assertEquals(Arrays.asList(expResult), Arrays.asList(result));
296.351 + }
296.352 +
296.353 + /**
296.354 + * Test of equals method, of class MethodType.
296.355 + */
296.356 + @Test
296.357 + public void testEquals_Object() {
296.358 + System.out.println("equals");
296.359 + Object x = null;
296.360 + MethodType instance = mt_viS;
296.361 + boolean expResult = false;
296.362 + boolean result = instance.equals(x);
296.363 + assertEquals(expResult, result);
296.364 + }
296.365 +
296.366 + /**
296.367 + * Test of equals method, of class MethodType.
296.368 + */
296.369 + @Test
296.370 + public void testEquals_MethodType() {
296.371 + System.out.println("equals");
296.372 + MethodType that = mt_viS;
296.373 + MethodType instance = mt_viS;
296.374 + boolean expResult = true;
296.375 + boolean result = instance.equals(that);
296.376 + assertEquals(expResult, result);
296.377 + }
296.378 +
296.379 + /**
296.380 + * Test of hashCode method, of class MethodType.
296.381 + */
296.382 + @Test
296.383 + public void testHashCode() {
296.384 + System.out.println("hashCode");
296.385 + MethodType instance = mt_viS;
296.386 + ArrayList<Class<?>> types = new ArrayList<Class<?>>();
296.387 + types.add(instance.returnType());
296.388 + types.addAll(instance.parameterList());
296.389 + int expResult = types.hashCode();
296.390 + int result = instance.hashCode();
296.391 + assertEquals(expResult, result);
296.392 + }
296.393 +
296.394 + /**
296.395 + * Test of toString method, of class MethodType.
296.396 + */
296.397 + @Test
296.398 + public void testToString() {
296.399 + System.out.println("toString");
296.400 + MethodType[] instances = {mt_viS, mt_OO2, mt_vv, mt_Ov, mt_iSI, mt_ISi, mt_ISI, mt_iSi};
296.401 + //String expResult = "void[int, class java.lang.String]";
296.402 + String[] expResults = {
296.403 + "(int,String)void",
296.404 + "(Object,Object)Object",
296.405 + "()void",
296.406 + "()Object",
296.407 + "(String,Integer)int",
296.408 + "(String,int)Integer",
296.409 + "(String,Integer)Integer",
296.410 + "(String,int)int"
296.411 + };
296.412 + for (int i = 0; i < instances.length; i++) {
296.413 + MethodType instance = instances[i];
296.414 + String result = instance.toString();
296.415 + System.out.println("#"+i+":"+result);
296.416 + assertEquals("#"+i, expResults[i], result);
296.417 + }
296.418 + }
296.419 +
296.420 + private static byte[] writeSerial(Object x) throws java.io.IOException {
296.421 + try (java.io.ByteArrayOutputStream bout = new java.io.ByteArrayOutputStream();
296.422 + java.io.ObjectOutputStream out = new java.io.ObjectOutputStream(bout)
296.423 + ) {
296.424 + out.writeObject(x);
296.425 + out.flush();
296.426 + return bout.toByteArray();
296.427 + }
296.428 + }
296.429 + private static Object readSerial(byte[] wire) throws java.io.IOException, ClassNotFoundException {
296.430 + try (java.io.ByteArrayInputStream bin = new java.io.ByteArrayInputStream(wire);
296.431 + java.io.ObjectInputStream in = new java.io.ObjectInputStream(bin)) {
296.432 + return in.readObject();
296.433 + }
296.434 + }
296.435 + private static void testSerializedEquality(Object x) throws java.io.IOException, ClassNotFoundException {
296.436 + if (x instanceof Object[])
296.437 + x = Arrays.asList((Object[]) x); // has proper equals method
296.438 + byte[] wire = writeSerial(x);
296.439 + Object y = readSerial(wire);
296.440 + assertEquals(x, y);
296.441 + }
296.442 +
296.443 + /** Test (de-)serialization. */
296.444 + @Test
296.445 + public void testSerialization() throws Throwable {
296.446 + System.out.println("serialization");
296.447 + for (MethodType mt : GALLERY) {
296.448 + testSerializedEquality(mt);
296.449 + }
296.450 + testSerializedEquality(GALLERY);
296.451 +
296.452 + // Make a list of mixed objects:
296.453 + List<Object> stuff = new ArrayList<>();
296.454 + Collections.addAll(stuff, GALLERY); // copy #1
296.455 + Object[] triples = Arrays.copyOfRange(GALLERY, 0, GALLERY.length/2);
296.456 + Collections.addAll(stuff, triples); // copy #3 (partial)
296.457 + for (MethodType mt : GALLERY) {
296.458 + Collections.addAll(stuff, mt.parameterArray());
296.459 + }
296.460 + Collections.shuffle(stuff, new Random(292));
296.461 + Collections.addAll(stuff, GALLERY); // copy #2
296.462 + testSerializedEquality(stuff);
296.463 + }
296.464 +
296.465 + /** Test serialization formats. */
296.466 + @Test
296.467 + public void testPortableSerialFormat() throws Throwable {
296.468 + System.out.println("portable serial format");
296.469 + boolean generateData = false;
296.470 + //generateData = true; // set this true to generate the following input data:
296.471 + Object[][] cases = {
296.472 + { mt_vv, new byte[] { // ()void
296.473 + (byte)0xac, (byte)0xed, (byte)0x00, (byte)0x05, (byte)0x73, (byte)0x72, (byte)0x00, (byte)0x1b,
296.474 + (byte)0x6a, (byte)0x61, (byte)0x76, (byte)0x61, (byte)0x2e, (byte)0x6c, (byte)0x61, (byte)0x6e,
296.475 + (byte)0x67, (byte)0x2e, (byte)0x69, (byte)0x6e, (byte)0x76, (byte)0x6f, (byte)0x6b, (byte)0x65,
296.476 + (byte)0x2e, (byte)0x4d, (byte)0x65, (byte)0x74, (byte)0x68, (byte)0x6f, (byte)0x64, (byte)0x54,
296.477 + (byte)0x79, (byte)0x70, (byte)0x65, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
296.478 + (byte)0x00, (byte)0x01, (byte)0x24, (byte)0x03, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x70,
296.479 + (byte)0x76, (byte)0x72, (byte)0x00, (byte)0x04, (byte)0x76, (byte)0x6f, (byte)0x69, (byte)0x64,
296.480 + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
296.481 + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x70, (byte)0x75, (byte)0x72, (byte)0x00,
296.482 + (byte)0x12, (byte)0x5b, (byte)0x4c, (byte)0x6a, (byte)0x61, (byte)0x76, (byte)0x61, (byte)0x2e,
296.483 + (byte)0x6c, (byte)0x61, (byte)0x6e, (byte)0x67, (byte)0x2e, (byte)0x43, (byte)0x6c, (byte)0x61,
296.484 + (byte)0x73, (byte)0x73, (byte)0x3b, (byte)0xab, (byte)0x16, (byte)0xd7, (byte)0xae, (byte)0xcb,
296.485 + (byte)0xcd, (byte)0x5a, (byte)0x99, (byte)0x02, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x70,
296.486 + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x78,
296.487 + } },
296.488 + { mt_OO, new byte[] { // (Object)Object
296.489 + (byte)0xac, (byte)0xed, (byte)0x00, (byte)0x05, (byte)0x73, (byte)0x72, (byte)0x00, (byte)0x1b,
296.490 + (byte)0x6a, (byte)0x61, (byte)0x76, (byte)0x61, (byte)0x2e, (byte)0x6c, (byte)0x61, (byte)0x6e,
296.491 + (byte)0x67, (byte)0x2e, (byte)0x69, (byte)0x6e, (byte)0x76, (byte)0x6f, (byte)0x6b, (byte)0x65,
296.492 + (byte)0x2e, (byte)0x4d, (byte)0x65, (byte)0x74, (byte)0x68, (byte)0x6f, (byte)0x64, (byte)0x54,
296.493 + (byte)0x79, (byte)0x70, (byte)0x65, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
296.494 + (byte)0x00, (byte)0x01, (byte)0x24, (byte)0x03, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x70,
296.495 + (byte)0x76, (byte)0x72, (byte)0x00, (byte)0x10, (byte)0x6a, (byte)0x61, (byte)0x76, (byte)0x61,
296.496 + (byte)0x2e, (byte)0x6c, (byte)0x61, (byte)0x6e, (byte)0x67, (byte)0x2e, (byte)0x4f, (byte)0x62,
296.497 + (byte)0x6a, (byte)0x65, (byte)0x63, (byte)0x74, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
296.498 + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x78,
296.499 + (byte)0x70, (byte)0x75, (byte)0x72, (byte)0x00, (byte)0x12, (byte)0x5b, (byte)0x4c, (byte)0x6a,
296.500 + (byte)0x61, (byte)0x76, (byte)0x61, (byte)0x2e, (byte)0x6c, (byte)0x61, (byte)0x6e, (byte)0x67,
296.501 + (byte)0x2e, (byte)0x43, (byte)0x6c, (byte)0x61, (byte)0x73, (byte)0x73, (byte)0x3b, (byte)0xab,
296.502 + (byte)0x16, (byte)0xd7, (byte)0xae, (byte)0xcb, (byte)0xcd, (byte)0x5a, (byte)0x99, (byte)0x02,
296.503 + (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x70, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01,
296.504 + (byte)0x71, (byte)0x00, (byte)0x7e, (byte)0x00, (byte)0x03, (byte)0x78,
296.505 + } },
296.506 + { mt_vOiSzA, new byte[] { // (Object,int,String,boolean,Object[])void
296.507 + (byte)0xac, (byte)0xed, (byte)0x00, (byte)0x05, (byte)0x73, (byte)0x72, (byte)0x00, (byte)0x1b,
296.508 + (byte)0x6a, (byte)0x61, (byte)0x76, (byte)0x61, (byte)0x2e, (byte)0x6c, (byte)0x61, (byte)0x6e,
296.509 + (byte)0x67, (byte)0x2e, (byte)0x69, (byte)0x6e, (byte)0x76, (byte)0x6f, (byte)0x6b, (byte)0x65,
296.510 + (byte)0x2e, (byte)0x4d, (byte)0x65, (byte)0x74, (byte)0x68, (byte)0x6f, (byte)0x64, (byte)0x54,
296.511 + (byte)0x79, (byte)0x70, (byte)0x65, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
296.512 + (byte)0x00, (byte)0x01, (byte)0x24, (byte)0x03, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x70,
296.513 + (byte)0x76, (byte)0x72, (byte)0x00, (byte)0x04, (byte)0x76, (byte)0x6f, (byte)0x69, (byte)0x64,
296.514 + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
296.515 + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x70, (byte)0x75, (byte)0x72, (byte)0x00,
296.516 + (byte)0x12, (byte)0x5b, (byte)0x4c, (byte)0x6a, (byte)0x61, (byte)0x76, (byte)0x61, (byte)0x2e,
296.517 + (byte)0x6c, (byte)0x61, (byte)0x6e, (byte)0x67, (byte)0x2e, (byte)0x43, (byte)0x6c, (byte)0x61,
296.518 + (byte)0x73, (byte)0x73, (byte)0x3b, (byte)0xab, (byte)0x16, (byte)0xd7, (byte)0xae, (byte)0xcb,
296.519 + (byte)0xcd, (byte)0x5a, (byte)0x99, (byte)0x02, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x70,
296.520 + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x05, (byte)0x76, (byte)0x72, (byte)0x00, (byte)0x10,
296.521 + (byte)0x6a, (byte)0x61, (byte)0x76, (byte)0x61, (byte)0x2e, (byte)0x6c, (byte)0x61, (byte)0x6e,
296.522 + (byte)0x67, (byte)0x2e, (byte)0x4f, (byte)0x62, (byte)0x6a, (byte)0x65, (byte)0x63, (byte)0x74,
296.523 + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
296.524 + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x70, (byte)0x76, (byte)0x72, (byte)0x00,
296.525 + (byte)0x03, (byte)0x69, (byte)0x6e, (byte)0x74, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
296.526 + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x78,
296.527 + (byte)0x70, (byte)0x76, (byte)0x72, (byte)0x00, (byte)0x10, (byte)0x6a, (byte)0x61, (byte)0x76,
296.528 + (byte)0x61, (byte)0x2e, (byte)0x6c, (byte)0x61, (byte)0x6e, (byte)0x67, (byte)0x2e, (byte)0x53,
296.529 + (byte)0x74, (byte)0x72, (byte)0x69, (byte)0x6e, (byte)0x67, (byte)0xa0, (byte)0xf0, (byte)0xa4,
296.530 + (byte)0x38, (byte)0x7a, (byte)0x3b, (byte)0xb3, (byte)0x42, (byte)0x02, (byte)0x00, (byte)0x00,
296.531 + (byte)0x78, (byte)0x70, (byte)0x76, (byte)0x72, (byte)0x00, (byte)0x07, (byte)0x62, (byte)0x6f,
296.532 + (byte)0x6f, (byte)0x6c, (byte)0x65, (byte)0x61, (byte)0x6e, (byte)0x00, (byte)0x00, (byte)0x00,
296.533 + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
296.534 + (byte)0x78, (byte)0x70, (byte)0x76, (byte)0x72, (byte)0x00, (byte)0x13, (byte)0x5b, (byte)0x4c,
296.535 + (byte)0x6a, (byte)0x61, (byte)0x76, (byte)0x61, (byte)0x2e, (byte)0x6c, (byte)0x61, (byte)0x6e,
296.536 + (byte)0x67, (byte)0x2e, (byte)0x4f, (byte)0x62, (byte)0x6a, (byte)0x65, (byte)0x63, (byte)0x74,
296.537 + (byte)0x3b, (byte)0x90, (byte)0xce, (byte)0x58, (byte)0x9f, (byte)0x10, (byte)0x73, (byte)0x29,
296.538 + (byte)0x6c, (byte)0x02, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x70, (byte)0x78,
296.539 + } },
296.540 + };
296.541 + for (Object[] c : cases) {
296.542 + MethodType mt = (MethodType) c[0];
296.543 + System.out.println("deserialize "+mt);
296.544 + byte[] wire = (byte[]) c[1];
296.545 + if (generateData) {
296.546 + System.out.println("<generateData>");
296.547 + wire = writeSerial(mt);
296.548 + final String INDENT = " ";
296.549 + System.out.print("{ // "+mt);
296.550 + for (int i = 0; i < wire.length; i++) {
296.551 + if (i % 8 == 0) { System.out.println(); System.out.print(INDENT+" "); }
296.552 + String hex = Integer.toHexString(wire[i] & 0xFF);
296.553 + if (hex.length() == 1) hex = "0"+hex;
296.554 + System.out.print(" (byte)0x"+hex+",");
296.555 + }
296.556 + System.out.println();
296.557 + System.out.println(INDENT+"}");
296.558 + System.out.println("</generateData>");
296.559 + System.out.flush();
296.560 + }
296.561 + Object decode;
296.562 + try {
296.563 + decode = readSerial(wire);
296.564 + } catch (Exception ex) {
296.565 + decode = ex; // oops!
296.566 + }
296.567 + assertEquals(mt, decode);
296.568 + }
296.569 + }
296.570 +}
297.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
297.2 +++ b/test/java/lang/invoke/indify/Indify.java Tue Mar 29 20:19:55 2011 -0700
297.3 @@ -0,0 +1,1906 @@
297.4 +/*
297.5 + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
297.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
297.7 + *
297.8 + * This code is free software; you can redistribute it and/or modify it
297.9 + * under the terms of the GNU General Public License version 2 only, as
297.10 + * published by the Free Software Foundation. Oracle designates this
297.11 + * particular file as subject to the "Classpath" exception as provided
297.12 + * by Oracle in the LICENSE file that accompanied this code.
297.13 + *
297.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
297.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
297.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
297.17 + * version 2 for more details (a copy is included in the LICENSE file that
297.18 + * accompanied this code).
297.19 + *
297.20 + * You should have received a copy of the GNU General Public License version
297.21 + * 2 along with this work; if not, write to the Free Software Foundation,
297.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
297.23 + *
297.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
297.25 + * or visit www.oracle.com if you need additional information or have any
297.26 + * questions.
297.27 + */
297.28 +
297.29 +package indify;
297.30 +
297.31 +import java.util.*;
297.32 +import java.io.*;
297.33 +import java.lang.reflect.Modifier;
297.34 +import java.util.regex.*;
297.35 +
297.36 +/**
297.37 + * Transform one or more class files to incorporate JSR 292 features,
297.38 + * such as {@code invokedynamic}.
297.39 + * <p>
297.40 + * This is a standalone program in a single source file.
297.41 + * In this form, it may be useful for test harnesses, small experiments, and javadoc examples.
297.42 + * Copies of this file may show up in multiple locations for standalone usage.
297.43 + * The primary maintained location of this file is as follows:
297.44 + * <a href="http://kenai.com/projects/ninja/sources/indify-repo/content/src/indify/Indify.java">
297.45 + * http://kenai.com/projects/ninja/sources/indify-repo/content/src/indify/Indify.java</a>
297.46 + * <p>
297.47 + * Static private methods named MH_x and MT_x (where x is arbitrary)
297.48 + * must be stereotyped generators of MethodHandle and MethodType
297.49 + * constants. All calls to them are transformed to {@code CONSTANT_MethodHandle}
297.50 + * and {@code CONSTANT_MethodType} "ldc" instructions.
297.51 + * The stereotyped code must create method types by calls to {@code methodType} or
297.52 + * {@code fromMethodDescriptorString}. The "lookup" argument must be created
297.53 + * by calls to {@code java.lang.invoke.MethodHandles#lookup MethodHandles.lookup}.
297.54 + * The class and string arguments must be constant.
297.55 + * The following methods of {@code java.lang.invoke.MethodHandle.Lookup Lookup} are
297.56 + * allowed for method handle creation: {@code findStatic}, {@code findVirtual},
297.57 + * {@code findConstructor}, {@code findSpecial},
297.58 + * {@code findGetter}, {@code findSetter},
297.59 + * {@code findStaticGetter}, or {@code findStaticSetter}.
297.60 + * The call to one of these methods must be followed immediately
297.61 + * by an {@code areturn} instruction.
297.62 + * The net result of the call to the MH_x or MT_x method must be
297.63 + * the creation of a constant method handle. Thus, replacing calls
297.64 + * to MH_x or MT_x methods by {@code ldc} instructions should leave
297.65 + * the meaning of the program unchanged.
297.66 + * <p>
297.67 + * Static private methods named INDY_x must be stereotyped generators
297.68 + * of {@code invokedynamic} call sites.
297.69 + * All calls to them must be immediately followed by
297.70 + * {@code invokeExact} calls.
297.71 + * All such pairs of calls are transformed to {@code invokedynamic}
297.72 + * instructions. Each INDY_x method must begin with a call to a
297.73 + * MH_x method, which is taken to be its bootstrap method.
297.74 + * The method must be immediately invoked (via {@code invokeGeneric}
297.75 + * on constant lookup, name, and type arguments. An object array of
297.76 + * constants may also be appended to the {@code invokeGeneric call}.
297.77 + * This call must be cast to {@code CallSite}, and the result must be
297.78 + * immediately followed by a call to {@code dynamicInvoker}, with the
297.79 + * resulting method handle returned.
297.80 + * <p>
297.81 + * The net result of all of these actions is equivalent to the JVM's
297.82 + * execution of an {@code invokedynamic} instruction in the unlinked state.
297.83 + * Running this code once should produce the same results as running
297.84 + * the corresponding {@code invokedynamic} instruction.
297.85 + * In order to model the caching behavior, the code of an INDY_x
297.86 + * method is allowed to begin with getstatic, aaload, and if_acmpne
297.87 + * instructions which load a static method handle value and return it
297.88 + * if the value is non-null.
297.89 + * <p>
297.90 + * Example usage:
297.91 + * <blockquote><pre>
297.92 +$ JAVA_HOME=(some recent OpenJDK 7 build)
297.93 +$ ant
297.94 +$ $JAVA_HOME/bin/java -cp build/classes indify.Indify --overwrite --dest build/testout build/classes/indify/Example.class
297.95 +$ $JAVA_HOME/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic -cp build/classes indify.Example
297.96 +MT = (java.lang.Object)java.lang.Object
297.97 +MH = adder(int,int)java.lang.Integer
297.98 +adder(1,2) = 3
297.99 +calling indy: 42
297.100 +$ $JAVA_HOME/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic -cp build/testout indify.Example
297.101 +(same output as above)
297.102 + * </pre></blockquote>
297.103 + * <p>
297.104 + * Before OpenJDK build b123, the format of {@code CONSTANT_InvokeDynamic} is in transition,
297.105 + * and the switch {@code --transitionalJSR292=yes} is recommended.
297.106 + * It is turned <em>off</em> by default, but users of earlier builds may need to turn it on.
297.107 + * <p>
297.108 + * A version of this transformation built on top of <a href="http://asm.ow2.org/">http://asm.ow2.org/</a> would be welcome.
297.109 + * @author John Rose
297.110 + */
297.111 +public class Indify {
297.112 + public static void main(String... av) throws IOException {
297.113 + new Indify().run(av);
297.114 + }
297.115 +
297.116 + public File dest;
297.117 + public String[] classpath = {"."};
297.118 + public boolean keepgoing = false;
297.119 + public boolean expandProperties = false;
297.120 + public boolean overwrite = false;
297.121 + public boolean quiet = false;
297.122 + public boolean verbose = false;
297.123 + public boolean transitionalJSR292 = false; // final version is distributed
297.124 + public boolean all = false;
297.125 + public int verifySpecifierCount = -1;
297.126 +
297.127 + public void run(String... av) throws IOException {
297.128 + List<String> avl = new ArrayList<>(Arrays.asList(av));
297.129 + parseOptions(avl);
297.130 + if (avl.isEmpty())
297.131 + throw new IllegalArgumentException("Usage: indify [--dest dir] [option...] file...");
297.132 + if ("--java".equals(avl.get(0))) {
297.133 + avl.remove(0);
297.134 + try {
297.135 + runApplication(avl.toArray(new String[0]));
297.136 + } catch (Exception ex) {
297.137 + if (ex instanceof RuntimeException) throw (RuntimeException) ex;
297.138 + throw new RuntimeException(ex);
297.139 + }
297.140 + return;
297.141 + }
297.142 + Exception err = null;
297.143 + for (String a : avl) {
297.144 + try {
297.145 + indify(a);
297.146 + } catch (Exception ex) {
297.147 + if (err == null) err = ex;
297.148 + System.err.println("failure on "+a);
297.149 + if (!keepgoing) break;
297.150 + }
297.151 + }
297.152 + if (err != null) {
297.153 + if (err instanceof IOException) throw (IOException) err;
297.154 + throw (RuntimeException) err;
297.155 + }
297.156 + }
297.157 +
297.158 + /** Execute the given application under a class loader which indifies all application classes. */
297.159 + public void runApplication(String... av) throws Exception {
297.160 + List<String> avl = new ArrayList<>(Arrays.asList(av));
297.161 + String mainClassName = avl.remove(0);
297.162 + av = avl.toArray(new String[0]);
297.163 + Class<?> mainClass = Class.forName(mainClassName, true, makeClassLoader());
297.164 + java.lang.reflect.Method main = mainClass.getMethod("main", String[].class);
297.165 + try { main.setAccessible(true); } catch (SecurityException ex) { }
297.166 + main.invoke(null, (Object) av);
297.167 + }
297.168 +
297.169 + public void parseOptions(List<String> av) throws IOException {
297.170 + for (; !av.isEmpty(); av.remove(0)) {
297.171 + String a = av.get(0);
297.172 + if (a.startsWith("-")) {
297.173 + String a2 = null;
297.174 + int eq = a.indexOf('=');
297.175 + if (eq > 0) {
297.176 + a2 = maybeExpandProperties(a.substring(eq+1));
297.177 + a = a.substring(0, eq+1);
297.178 + }
297.179 + switch (a) {
297.180 + case "--java":
297.181 + return; // keep this argument
297.182 + case "-d": case "--dest": case "-d=": case "--dest=":
297.183 + dest = new File(a2 != null ? a2 : maybeExpandProperties(av.remove(1)));
297.184 + break;
297.185 + case "-cp": case "--classpath":
297.186 + classpath = maybeExpandProperties(av.remove(1)).split("["+File.pathSeparatorChar+"]");
297.187 + break;
297.188 + case "-k": case "--keepgoing": case "--keepgoing=":
297.189 + keepgoing = booleanOption(a2); // print errors but keep going
297.190 + break;
297.191 + case "--expand-properties": case "--expand-properties=":
297.192 + expandProperties = booleanOption(a2); // expand property references in subsequent arguments
297.193 + break;
297.194 + case "--verify-specifier-count": case "--verify-specifier-count=":
297.195 + verifySpecifierCount = Integer.valueOf(a2);
297.196 + break;
297.197 + case "--overwrite": case "--overwrite=":
297.198 + overwrite = booleanOption(a2); // overwrite output files
297.199 + break;
297.200 + case "--all": case "--all=":
297.201 + all = booleanOption(a2); // copy all classes, even if no patterns
297.202 + break;
297.203 + case "-q": case "--quiet": case "--quiet=":
297.204 + quiet = booleanOption(a2); // less output
297.205 + break;
297.206 + case "-v": case "--verbose": case "--verbose=":
297.207 + verbose = booleanOption(a2); // more output
297.208 + break;
297.209 + case "--transitionalJSR292": case "--transitionalJSR292=":
297.210 + transitionalJSR292 = booleanOption(a2); // use older invokedynamic format
297.211 + break;
297.212 + default:
297.213 + throw new IllegalArgumentException("unrecognized flag: "+a);
297.214 + }
297.215 + continue;
297.216 + } else {
297.217 + break;
297.218 + }
297.219 + }
297.220 + if (dest == null && !overwrite)
297.221 + throw new RuntimeException("no output specified; need --dest d or --overwrite");
297.222 + if (expandProperties) {
297.223 + for (int i = 0; i < av.size(); i++)
297.224 + av.set(i, maybeExpandProperties(av.get(i)));
297.225 + }
297.226 + }
297.227 +
297.228 + private boolean booleanOption(String s) {
297.229 + if (s == null) return true;
297.230 + switch (s) {
297.231 + case "true": case "yes": case "on": case "1": return true;
297.232 + case "false": case "no": case "off": case "0": return false;
297.233 + }
297.234 + throw new IllegalArgumentException("unrecognized boolean flag="+s);
297.235 + }
297.236 +
297.237 + private String maybeExpandProperties(String s) {
297.238 + if (!expandProperties) return s;
297.239 + Set<String> propsDone = new HashSet<>();
297.240 + while (s.contains("${")) {
297.241 + int lbrk = s.indexOf("${");
297.242 + int rbrk = s.indexOf('}', lbrk);
297.243 + if (rbrk < 0) break;
297.244 + String prop = s.substring(lbrk+2, rbrk);
297.245 + if (!propsDone.add(prop)) break;
297.246 + String value = System.getProperty(prop);
297.247 + if (verbose) System.err.println("expanding ${"+prop+"} => "+value);
297.248 + if (value == null) break;
297.249 + s = s.substring(0, lbrk) + value + s.substring(rbrk+1);
297.250 + }
297.251 + return s;
297.252 + }
297.253 +
297.254 + public void indify(String a) throws IOException {
297.255 + File f = new File(a);
297.256 + String fn = f.getName();
297.257 + if (fn.endsWith(".class") && f.isFile())
297.258 + indifyFile(f, dest);
297.259 + else if (fn.endsWith(".jar") && f.isFile())
297.260 + indifyJar(f, dest);
297.261 + else if (f.isDirectory())
297.262 + indifyTree(f, dest);
297.263 + else if (!keepgoing)
297.264 + throw new RuntimeException("unrecognized file: "+a);
297.265 + }
297.266 +
297.267 + private void ensureDirectory(File dir) {
297.268 + if (dir.mkdirs() && !quiet)
297.269 + System.err.println("created "+dir);
297.270 + }
297.271 +
297.272 + public void indifyFile(File f, File dest) throws IOException {
297.273 + if (verbose) System.err.println("reading "+f);
297.274 + ClassFile cf = new ClassFile(f);
297.275 + Logic logic = new Logic(cf);
297.276 + boolean changed = logic.transform();
297.277 + logic.reportPatternMethods(quiet, keepgoing);
297.278 + if (changed || all) {
297.279 + File outfile;
297.280 + if (dest != null) {
297.281 + ensureDirectory(dest);
297.282 + outfile = classPathFile(dest, cf.nameString());
297.283 + } else {
297.284 + outfile = f; // overwrite input file, no matter where it is
297.285 + }
297.286 + cf.writeTo(outfile);
297.287 + if (!quiet) System.err.println("wrote "+outfile);
297.288 + }
297.289 + }
297.290 +
297.291 + File classPathFile(File pathDir, String className) {
297.292 + String qualname = className.replace('.','/')+".class";
297.293 + qualname = qualname.replace('/', File.separatorChar);
297.294 + return new File(pathDir, qualname);
297.295 + }
297.296 +
297.297 + public void indifyJar(File f, Object dest) throws IOException {
297.298 + throw new UnsupportedOperationException("Not yet implemented");
297.299 + }
297.300 +
297.301 + public void indifyTree(File f, File dest) throws IOException {
297.302 + if (verbose) System.err.println("reading directory: "+f);
297.303 + for (File f2 : f.listFiles(new FilenameFilter() {
297.304 + public boolean accept(File dir, String name) {
297.305 + if (name.endsWith(".class")) return true;
297.306 + if (name.contains(".")) return false;
297.307 + // return true if it might be a package name:
297.308 + return Character.isJavaIdentifierStart(name.charAt(0));
297.309 + }})) {
297.310 + if (f2.getName().endsWith(".class"))
297.311 + indifyFile(f2, dest);
297.312 + else if (f2.isDirectory())
297.313 + indifyTree(f2, dest);
297.314 + }
297.315 + }
297.316 +
297.317 + public ClassLoader makeClassLoader() {
297.318 + return new Loader();
297.319 + }
297.320 + private class Loader extends ClassLoader {
297.321 + Loader() {
297.322 + this(Indify.class.getClassLoader());
297.323 + }
297.324 + Loader(ClassLoader parent) {
297.325 + super(parent);
297.326 + }
297.327 + public Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
297.328 + File f = findClassInPath(name);
297.329 + if (f != null) {
297.330 + try {
297.331 + Class<?> c = transformAndLoadClass(f);
297.332 + if (c != null) {
297.333 + if (resolve) resolveClass(c);
297.334 + return c;
297.335 + }
297.336 + } catch (Exception ex) {
297.337 + if (ex instanceof IllegalArgumentException)
297.338 + // pass error from reportPatternMethods
297.339 + throw (IllegalArgumentException) ex;
297.340 + }
297.341 + }
297.342 + return super.loadClass(name, resolve);
297.343 + }
297.344 + private File findClassInPath(String name) {
297.345 + for (String s : classpath) {
297.346 + File f = classPathFile(new File(s), name);
297.347 + //System.out.println("Checking for "+f);
297.348 + if (f.exists() && f.canRead()) {
297.349 + return f;
297.350 + }
297.351 + }
297.352 + return null;
297.353 + }
297.354 + protected Class<?> findClass(String name) throws ClassNotFoundException {
297.355 + try {
297.356 + File f = findClassInPath(name);
297.357 + if (f != null) {
297.358 + Class<?> c = transformAndLoadClass(f);
297.359 + if (c != null) return c;
297.360 + }
297.361 + } catch (IOException ex) {
297.362 + throw new ClassNotFoundException("IO error", ex);
297.363 + }
297.364 + throw new ClassNotFoundException();
297.365 + }
297.366 + private Class<?> transformAndLoadClass(File f) throws ClassNotFoundException, IOException {
297.367 + if (verbose) System.err.println("Loading class from "+f);
297.368 + ClassFile cf = new ClassFile(f);
297.369 + Logic logic = new Logic(cf);
297.370 + boolean changed = logic.transform();
297.371 + if (verbose && !changed) System.err.println("(no change)");
297.372 + logic.reportPatternMethods(!verbose, keepgoing);
297.373 + byte[] bytes = cf.toByteArray();
297.374 + return defineClass(null, bytes, 0, bytes.length);
297.375 + }
297.376 + }
297.377 +
297.378 + private class Logic {
297.379 + // Indify logic, per se.
297.380 + ClassFile cf;
297.381 + final char[] poolMarks;
297.382 + final Map<Method,Constant> constants = new HashMap<>();
297.383 + final Map<Method,String> indySignatures = new HashMap<>();
297.384 + Logic(ClassFile cf) {
297.385 + this.cf = cf;
297.386 + poolMarks = new char[cf.pool.size()];
297.387 + }
297.388 + boolean transform() {
297.389 + if (!initializeMarks()) return false;
297.390 + if (!findPatternMethods()) return false;
297.391 + Pool pool = cf.pool;
297.392 + //for (Constant c : cp) System.out.println(" # "+c);
297.393 + for (Method m : cf.methods) {
297.394 + if (constants.containsKey(m)) continue; // don't bother
297.395 + // Transform references.
297.396 + int blab = 0;
297.397 + for (Instruction i = m.instructions(); i != null; i = i.next()) {
297.398 + if (i.bc != opc_invokestatic) continue;
297.399 + int methi = i.u2At(1);
297.400 + if (poolMarks[methi] == 0) continue;
297.401 + Short[] ref = pool.getMemberRef((short)methi);
297.402 + Method conm = findMember(cf.methods, ref[1], ref[2]);
297.403 + if (conm == null) continue;
297.404 + Constant con = constants.get(conm);
297.405 + if (con == null) continue;
297.406 + if (blab++ == 0 && !quiet)
297.407 + System.err.println("patching "+cf.nameString()+"."+m);
297.408 + //if (blab == 1) { for (Instruction j = m.instructions(); j != null; j = j.next()) System.out.println(" |"+j); }
297.409 + if (con.tag == CONSTANT_InvokeDynamic ||
297.410 + con.tag == CONSTANT_InvokeDynamic_17) {
297.411 + // need to patch the following instruction too,
297.412 + // but there are usually intervening argument pushes too
297.413 + Instruction i2 = findPop(i);
297.414 + Short[] ref2 = null;
297.415 + short ref2i = 0;
297.416 + if (i2 != null && i2.bc == opc_invokevirtual &&
297.417 + poolMarks[(char)(ref2i = (short) i2.u2At(1))] == 'D')
297.418 + ref2 = pool.getMemberRef(ref2i);
297.419 + if (ref2 == null || !"invokeExact".equals(pool.getString(ref2[1]))) {
297.420 + System.err.println(m+": failed to create invokedynamic at "+i.pc);
297.421 + continue;
297.422 + }
297.423 + String invType = pool.getString(ref2[2]);
297.424 + String bsmType = indySignatures.get(conm);
297.425 + if (!invType.equals(bsmType)) {
297.426 + System.err.println(m+": warning: "+conm+" call type and local invoke type differ: "
297.427 + +bsmType+", "+invType);
297.428 + }
297.429 + assert(i.len == 3 || i2.len == 3);
297.430 + if (!quiet) System.err.println(i+" "+conm+";...; "+i2+" => invokedynamic "+con);
297.431 + int start = i.pc + 3, end = i2.pc;
297.432 + System.arraycopy(i.codeBase, start, i.codeBase, i.pc, end-start);
297.433 + i.forceNext(0); // force revisit of new instruction
297.434 + i2.u1AtPut(-3, opc_invokedynamic);
297.435 + i2.u2AtPut(-2, con.index);
297.436 + i2.u2AtPut(0, (short)0);
297.437 + i2.u1AtPut(2, opc_nop);
297.438 + //System.out.println(new Instruction(i.codeBase, i2.pc-3));
297.439 + } else {
297.440 + if (!quiet) System.err.println(i+" "+conm+" => ldc "+con);
297.441 + assert(i.len == 3);
297.442 + i.u1AtPut(0, opc_ldc_w);
297.443 + i.u2AtPut(1, con.index);
297.444 + }
297.445 + }
297.446 + //if (blab >= 1) { for (Instruction j = m.instructions(); j != null; j = j.next()) System.out.println(" |"+j); }
297.447 + }
297.448 + cf.methods.removeAll(constants.keySet());
297.449 + return true;
297.450 + }
297.451 +
297.452 + // Scan forward from the instruction to find where the stack p
297.453 + // below the current sp at the instruction.
297.454 + Instruction findPop(Instruction i) {
297.455 + //System.out.println("findPop from "+i);
297.456 + Pool pool = cf.pool;
297.457 + JVMState jvm = new JVMState();
297.458 + decode:
297.459 + for (i = i.clone().next(); i != null; i = i.next()) {
297.460 + String pops = INSTRUCTION_POPS[i.bc];
297.461 + //System.out.println(" "+i+" "+jvm.stack+" : "+pops.replace("$", " => "));
297.462 + if (pops == null) break;
297.463 + if (jvm.stackMotion(i.bc)) continue decode;
297.464 + if (pops.indexOf('Q') >= 0) {
297.465 + Short[] ref = pool.getMemberRef((short) i.u2At(1));
297.466 + String type = simplifyType(pool.getString(CONSTANT_Utf8, ref[2]));
297.467 + switch (i.bc) {
297.468 + case opc_getstatic:
297.469 + case opc_getfield:
297.470 + case opc_putstatic:
297.471 + case opc_putfield:
297.472 + pops = pops.replace("Q", type);
297.473 + break;
297.474 + default:
297.475 + if (!type.startsWith("("))
297.476 + throw new InternalError(i.toString());
297.477 + pops = pops.replace("Q$Q", type.substring(1).replace(")","$"));
297.478 + break;
297.479 + }
297.480 + //System.out.println("special type: "+type+" => "+pops);
297.481 + }
297.482 + int npops = pops.indexOf('$');
297.483 + if (npops < 0) throw new InternalError();
297.484 + if (npops > jvm.sp()) return i;
297.485 + List<Object> args = jvm.args(npops);
297.486 + int k = 0;
297.487 + for (Object x : args) {
297.488 + char have = (Character) x;
297.489 + char want = pops.charAt(k++);
297.490 + if (have == 'X' || want == 'X') continue;
297.491 + if (have != want) break decode;
297.492 + }
297.493 + if (pops.charAt(k++) != '$') break decode;
297.494 + args.clear();
297.495 + while (k < pops.length())
297.496 + args.add(pops.charAt(k++));
297.497 + }
297.498 + System.err.println("*** bailout on jvm: "+jvm.stack+" "+i);
297.499 + return null;
297.500 + }
297.501 +
297.502 + boolean findPatternMethods() {
297.503 + boolean found = false;
297.504 + for (char mark : "THI".toCharArray()) {
297.505 + for (Method m : cf.methods) {
297.506 + if (!Modifier.isPrivate(m.access)) continue;
297.507 + if (!Modifier.isStatic(m.access)) continue;
297.508 + if (nameAndTypeMark(m.name, m.type) == mark) {
297.509 + Constant con = scanPattern(m, mark);
297.510 + if (con == null) continue;
297.511 + constants.put(m, con);
297.512 + found = true;
297.513 + }
297.514 + }
297.515 + }
297.516 + return found;
297.517 + }
297.518 +
297.519 + void reportPatternMethods(boolean quietly, boolean allowMatchFailure) {
297.520 + if (!quietly && !constants.keySet().isEmpty())
297.521 + System.err.println("pattern methods removed: "+constants.keySet());
297.522 + for (Method m : cf.methods) {
297.523 + if (nameMark(cf.pool.getString(m.name)) != 0 &&
297.524 + constants.get(m) == null) {
297.525 + String failure = "method has special name but fails to match pattern: "+m;
297.526 + if (!allowMatchFailure)
297.527 + throw new IllegalArgumentException(failure);
297.528 + else if (!quietly)
297.529 + System.err.println("warning: "+failure);
297.530 + }
297.531 + }
297.532 + if (verifySpecifierCount >= 0) {
297.533 + List<Object[]> specs = bootstrapMethodSpecifiers(false);
297.534 + int specsLen = (specs == null ? 0 : specs.size());
297.535 + if (specsLen != verifySpecifierCount) {
297.536 + throw new IllegalArgumentException("BootstrapMethods length is "+specsLen+" but should be "+verifySpecifierCount);
297.537 + }
297.538 + }
297.539 + if (!quiet) System.err.flush();
297.540 + }
297.541 +
297.542 + // mark constant pool entries according to participation in patterns
297.543 + boolean initializeMarks() {
297.544 + boolean changed = false;
297.545 + for (;;) {
297.546 + boolean changed1 = false;
297.547 + int cpindex = -1;
297.548 + for (Constant e : cf.pool) {
297.549 + ++cpindex;
297.550 + if (e == null) continue;
297.551 + char mark = poolMarks[cpindex];
297.552 + if (mark != 0) continue;
297.553 + switch (e.tag) {
297.554 + case CONSTANT_Utf8:
297.555 + mark = nameMark(e.itemString()); break;
297.556 + case CONSTANT_NameAndType:
297.557 + mark = nameAndTypeMark(e.itemIndexes()); break;
297.558 + case CONSTANT_Class: {
297.559 + int n1 = e.itemIndex();
297.560 + char nmark = poolMarks[(char)n1];
297.561 + if ("DJ".indexOf(nmark) >= 0)
297.562 + mark = nmark;
297.563 + break;
297.564 + }
297.565 + case CONSTANT_Field:
297.566 + case CONSTANT_Method: {
297.567 + Short[] n12 = e.itemIndexes();
297.568 + short cl = n12[0];
297.569 + short nt = n12[1];
297.570 + char cmark = poolMarks[(char)cl];
297.571 + if (cmark != 0) {
297.572 + mark = cmark; // it is a java.dyn.* or java.lang.* method
297.573 + break;
297.574 + }
297.575 + String cls = cf.pool.getString(CONSTANT_Class, cl);
297.576 + if (cls.equals(cf.nameString())) {
297.577 + switch (poolMarks[(char)nt]) {
297.578 + // it is a private MH/MT/INDY method
297.579 + case 'T': case 'H': case 'I':
297.580 + mark = poolMarks[(char)nt];
297.581 + break;
297.582 + }
297.583 + }
297.584 + break;
297.585 + }
297.586 + default: break;
297.587 + }
297.588 + if (mark != 0) {
297.589 + poolMarks[cpindex] = mark;
297.590 + changed1 = true;
297.591 + }
297.592 + }
297.593 + if (!changed1)
297.594 + break;
297.595 + changed = true;
297.596 + }
297.597 + return changed;
297.598 + }
297.599 + char nameMark(String s) {
297.600 + if (s.startsWith("MT_")) return 'T';
297.601 + else if (s.startsWith("MH_")) return 'H';
297.602 + else if (s.startsWith("INDY_")) return 'I';
297.603 + else if (transitionalJSR292 &&
297.604 + s.startsWith("java/dyn/")) return 'D';
297.605 + else if (s.startsWith("java/lang/invoke/")) return 'D';
297.606 + else if (s.startsWith("java/lang/")) return 'J';
297.607 + return 0;
297.608 + }
297.609 + char nameAndTypeMark(Short[] n12) {
297.610 + return nameAndTypeMark(n12[0], n12[1]);
297.611 + }
297.612 + char nameAndTypeMark(short n1, short n2) {
297.613 + char mark = poolMarks[(char)n1];
297.614 + if (mark == 0) return 0;
297.615 + String descr = cf.pool.getString(CONSTANT_Utf8, n2);
297.616 + String requiredType;
297.617 + switch (poolMarks[(char)n1]) {
297.618 + case 'H': requiredType = "()Ljava/lang/invoke/MethodHandle;"; break;
297.619 + case 'T': requiredType = "()Ljava/lang/invoke/MethodType;"; break;
297.620 + case 'I': requiredType = "()Ljava/lang/invoke/MethodHandle;"; break;
297.621 + default: return 0;
297.622 + }
297.623 + if (matchType(descr, requiredType)) return mark;
297.624 + return 0;
297.625 + }
297.626 +
297.627 + boolean matchType(String descr, String requiredType) {
297.628 + if (descr.equals(requiredType)) return true;
297.629 + if (transitionalJSR292) {
297.630 + String oldType = requiredType.replace("Ljava/lang/invoke/", "Ljava/dyn/");
297.631 + if (descr.equals(oldType)) return true;
297.632 + }
297.633 + return false;
297.634 + }
297.635 +
297.636 + private class JVMState {
297.637 + final List<Object> stack = new ArrayList<>();
297.638 + int sp() { return stack.size(); }
297.639 + void push(Object x) { stack.add(x); }
297.640 + void push2(Object x) { stack.add(EMPTY_SLOT); stack.add(x); }
297.641 + void pushAt(int pos, Object x) { stack.add(stack.size()+pos, x); }
297.642 + Object pop() { return stack.remove(sp()-1); }
297.643 + Object top() { return stack.get(sp()-1); }
297.644 + List<Object> args(boolean hasRecv, String type) {
297.645 + return args(argsize(type) + (hasRecv ? 1 : 0));
297.646 + }
297.647 + List<Object> args(int argsize) {
297.648 + return stack.subList(sp()-argsize, sp());
297.649 + }
297.650 + boolean stackMotion(int bc) {
297.651 + switch (bc) {
297.652 + case opc_pop: pop(); break;
297.653 + case opc_pop2: pop(); pop(); break;
297.654 + case opc_swap: pushAt(-1, pop()); break;
297.655 + case opc_dup: push(top()); break;
297.656 + case opc_dup_x1: pushAt(-2, top()); break;
297.657 + case opc_dup_x2: pushAt(-3, top()); break;
297.658 + // ? also: dup2{,_x1,_x2}
297.659 + default: return false;
297.660 + }
297.661 + return true;
297.662 + }
297.663 + }
297.664 + private final String EMPTY_SLOT = "_";
297.665 + private void removeEmptyJVMSlots(List<Object> args) {
297.666 + for (;;) {
297.667 + int i = args.indexOf(EMPTY_SLOT);
297.668 + if (i >= 0 && i+1 < args.size()
297.669 + && (isConstant(args.get(i+1), CONSTANT_Long) ||
297.670 + isConstant(args.get(i+1), CONSTANT_Double)))
297.671 + args.remove(i);
297.672 + else break;
297.673 + }
297.674 + }
297.675 +
297.676 + private Constant scanPattern(Method m, char patternMark) {
297.677 + if (verbose) System.err.println("scan "+m+" for pattern="+patternMark);
297.678 + int wantTag;
297.679 + switch (patternMark) {
297.680 + case 'T': wantTag = CONSTANT_MethodType; break;
297.681 + case 'H': wantTag = CONSTANT_MethodHandle; break;
297.682 + case 'I': wantTag = CONSTANT_InvokeDynamic; break;
297.683 + default: throw new InternalError();
297.684 + }
297.685 + Instruction i = m.instructions();
297.686 + JVMState jvm = new JVMState();
297.687 + Pool pool = cf.pool;
297.688 + int branchCount = 0;
297.689 + Object arg;
297.690 + List<Object> args;
297.691 + List<Object> bsmArgs = null; // args to invokeGeneric
297.692 + decode:
297.693 + for (; i != null; i = i.next()) {
297.694 + //System.out.println(jvm.stack+" "+i);
297.695 + int bc = i.bc;
297.696 + switch (bc) {
297.697 + case opc_ldc: jvm.push(pool.get(i.u1At(1))); break;
297.698 + case opc_ldc_w: jvm.push(pool.get(i.u2At(1))); break;
297.699 + case opc_ldc2_w: jvm.push2(pool.get(i.u2At(1))); break;
297.700 + case opc_aconst_null: jvm.push(null); break;
297.701 + case opc_bipush: jvm.push((int)(byte) i.u1At(1)); break;
297.702 + case opc_sipush: jvm.push((int)(short)i.u2At(1)); break;
297.703 +
297.704 + // these support creation of a restarg array
297.705 + case opc_anewarray:
297.706 + arg = jvm.pop();
297.707 + if (!(arg instanceof Integer)) break decode;
297.708 + arg = Arrays.asList(new Object[(Integer)arg]);
297.709 + jvm.push(arg);
297.710 + break;
297.711 + case opc_dup:
297.712 + jvm.push(jvm.top()); break;
297.713 + case opc_aastore:
297.714 + args = jvm.args(3); // array, index, value
297.715 + if (args.get(0) instanceof List &&
297.716 + args.get(1) instanceof Integer) {
297.717 + ((List<Object>)args.get(0)).set( (Integer)args.get(1), args.get(2) );
297.718 + }
297.719 + args.clear();
297.720 + break;
297.721 +
297.722 + case opc_new:
297.723 + {
297.724 + String type = pool.getString(CONSTANT_Class, (short)i.u2At(1));
297.725 + //System.out.println("new "+type);
297.726 + switch (type) {
297.727 + case "java/lang/StringBuilder":
297.728 + jvm.push("StringBuilder");
297.729 + continue decode; // go to next instruction
297.730 + }
297.731 + break decode; // bail out
297.732 + }
297.733 +
297.734 + case opc_getstatic:
297.735 + {
297.736 + // int.class compiles to getstatic Integer.TYPE
297.737 + int fieldi = i.u2At(1);
297.738 + char mark = poolMarks[fieldi];
297.739 + //System.err.println("getstatic "+fieldi+Arrays.asList(pool.getStrings(pool.getMemberRef((short)fieldi)))+mark);
297.740 + if (mark == 'J') {
297.741 + Short[] ref = pool.getMemberRef((short) fieldi);
297.742 + String name = pool.getString(CONSTANT_Utf8, ref[1]);
297.743 + if ("TYPE".equals(name)) {
297.744 + String wrapperName = pool.getString(CONSTANT_Class, ref[0]).replace('/', '.');
297.745 + // a primitive type descriptor
297.746 + Class<?> primClass;
297.747 + try {
297.748 + primClass = (Class<?>) Class.forName(wrapperName).getField(name).get(null);
297.749 + } catch (Exception ex) {
297.750 + throw new InternalError("cannot load "+wrapperName+"."+name);
297.751 + }
297.752 + jvm.push(primClass);
297.753 + break;
297.754 + }
297.755 + }
297.756 + // unknown field; keep going...
297.757 + jvm.push(UNKNOWN_CON);
297.758 + break;
297.759 + }
297.760 + case opc_putstatic:
297.761 + {
297.762 + if (patternMark != 'I') break decode;
297.763 + jvm.pop();
297.764 + // unknown field; keep going...
297.765 + break;
297.766 + }
297.767 +
297.768 + case opc_invokestatic:
297.769 + case opc_invokevirtual:
297.770 + case opc_invokespecial:
297.771 + {
297.772 + boolean hasRecv = (bc != opc_invokestatic);
297.773 + int methi = i.u2At(1);
297.774 + char mark = poolMarks[methi];
297.775 + Short[] ref = pool.getMemberRef((short)methi);
297.776 + String type = pool.getString(CONSTANT_Utf8, ref[2]);
297.777 + //System.out.println("invoke "+pool.getString(CONSTANT_Utf8, ref[1])+" "+Arrays.asList(ref)+" : "+type);
297.778 + args = jvm.args(hasRecv, type);
297.779 + String intrinsic = null;
297.780 + Constant con;
297.781 + if (mark == 'D' || mark == 'J') {
297.782 + intrinsic = pool.getString(CONSTANT_Utf8, ref[1]);
297.783 + if (mark == 'J') {
297.784 + String cls = pool.getString(CONSTANT_Class, ref[0]);
297.785 + cls = cls.substring(1+cls.lastIndexOf('/'));
297.786 + intrinsic = cls+"."+intrinsic;
297.787 + }
297.788 + //System.out.println("recognized intrinsic "+intrinsic);
297.789 + byte refKind = -1;
297.790 + switch (intrinsic) {
297.791 + case "findGetter": refKind = REF_getField; break;
297.792 + case "findStaticGetter": refKind = REF_getStatic; break;
297.793 + case "findSetter": refKind = REF_putField; break;
297.794 + case "findStaticSetter": refKind = REF_putStatic; break;
297.795 + case "findVirtual": refKind = REF_invokeVirtual; break;
297.796 + case "findStatic": refKind = REF_invokeStatic; break;
297.797 + case "findSpecial": refKind = REF_invokeSpecial; break;
297.798 + case "findConstructor": refKind = REF_newInvokeSpecial; break;
297.799 + }
297.800 + if (refKind >= 0 && (con = parseMemberLookup(refKind, args)) != null) {
297.801 + args.clear(); args.add(con);
297.802 + continue;
297.803 + }
297.804 + }
297.805 + Method ownMethod = null;
297.806 + if (mark == 'T' || mark == 'H' || mark == 'I') {
297.807 + ownMethod = findMember(cf.methods, ref[1], ref[2]);
297.808 + }
297.809 + //if (intrinsic != null) System.out.println("intrinsic = "+intrinsic);
297.810 + switch (intrinsic == null ? "" : intrinsic) {
297.811 + case "fromMethodDescriptorString":
297.812 + con = makeMethodTypeCon(args.get(0));
297.813 + args.clear(); args.add(con);
297.814 + continue;
297.815 + case "methodType": {
297.816 + flattenVarargs(args); // there are several overloadings, some with varargs
297.817 + StringBuilder buf = new StringBuilder();
297.818 + String rtype = null;
297.819 + for (Object typeArg : args) {
297.820 + if (typeArg instanceof Class) {
297.821 + Class<?> argClass = (Class<?>) typeArg;
297.822 + if (argClass.isPrimitive()) {
297.823 + char tchar;
297.824 + switch (argClass.getName()) {
297.825 + case "void": tchar = 'V'; break;
297.826 + case "boolean": tchar = 'Z'; break;
297.827 + case "byte": tchar = 'B'; break;
297.828 + case "char": tchar = 'C'; break;
297.829 + case "short": tchar = 'S'; break;
297.830 + case "int": tchar = 'I'; break;
297.831 + case "long": tchar = 'J'; break;
297.832 + case "float": tchar = 'F'; break;
297.833 + case "double": tchar = 'D'; break;
297.834 + default: throw new InternalError(argClass.toString());
297.835 + }
297.836 + buf.append(tchar);
297.837 + } else {
297.838 + // should not happen, but...
297.839 + buf.append('L').append(argClass.getName().replace('.','/')).append(';');
297.840 + }
297.841 + } else if (typeArg instanceof Constant) {
297.842 + Constant argCon = (Constant) typeArg;
297.843 + if (argCon.tag == CONSTANT_Class) {
297.844 + String cn = pool.get(argCon.itemIndex()).itemString();
297.845 + if (cn.endsWith(";"))
297.846 + buf.append(cn);
297.847 + else
297.848 + buf.append('L').append(cn).append(';');
297.849 + } else {
297.850 + break decode;
297.851 + }
297.852 + } else {
297.853 + break decode;
297.854 + }
297.855 + if (rtype == null) {
297.856 + // first arg is treated differently
297.857 + rtype = buf.toString();
297.858 + buf.setLength(0);
297.859 + buf.append('(');
297.860 + }
297.861 + }
297.862 + buf.append(')').append(rtype);
297.863 + con = con = makeMethodTypeCon(buf.toString());
297.864 + args.clear(); args.add(con);
297.865 + continue;
297.866 + }
297.867 + case "lookup":
297.868 + case "dynamicInvoker":
297.869 + args.clear(); args.add(intrinsic);
297.870 + continue;
297.871 + case "lookupClass":
297.872 + if (args.equals(Arrays.asList("lookup"))) {
297.873 + // fold lookup().lookupClass() to the enclosing class
297.874 + args.clear(); args.add(pool.get(cf.thisc));
297.875 + continue;
297.876 + }
297.877 + break;
297.878 + case "invokeGeneric":
297.879 + case "invokeWithArguments":
297.880 + if (patternMark != 'I') break decode;
297.881 + if ("invokeWithArguments".equals(intrinsic))
297.882 + flattenVarargs(args);
297.883 + bsmArgs = new ArrayList(args);
297.884 + args.clear(); args.add("invokeGeneric");
297.885 + continue;
297.886 + case "Integer.valueOf":
297.887 + case "Float.valueOf":
297.888 + case "Long.valueOf":
297.889 + case "Double.valueOf":
297.890 + removeEmptyJVMSlots(args);
297.891 + if (args.size() == 1) {
297.892 + arg = args.remove(0);
297.893 + assert(3456 == (CONSTANT_Integer*1000 + CONSTANT_Float*100 + CONSTANT_Long*10 + CONSTANT_Double));
297.894 + if (isConstant(arg, CONSTANT_Integer + "IFLD".indexOf(intrinsic.charAt(0)))
297.895 + || arg instanceof Number) {
297.896 + args.add(arg); continue;
297.897 + }
297.898 + }
297.899 + break decode;
297.900 + case "StringBuilder.append":
297.901 + // allow calls like ("value = "+x)
297.902 + removeEmptyJVMSlots(args);
297.903 + args.subList(1, args.size()).clear();
297.904 + continue;
297.905 + case "StringBuilder.toString":
297.906 + args.clear();
297.907 + args.add(intrinsic);
297.908 + continue;
297.909 + }
297.910 + if (!hasRecv && ownMethod != null && patternMark != 0) {
297.911 + con = constants.get(ownMethod);
297.912 + if (con == null) break decode;
297.913 + args.clear(); args.add(con);
297.914 + continue;
297.915 + } else if (type.endsWith(")V")) {
297.916 + // allow calls like println("reached the pattern method")
297.917 + args.clear();
297.918 + continue;
297.919 + }
297.920 + break decode; // bail out for most calls
297.921 + }
297.922 + case opc_areturn:
297.923 + {
297.924 + ++branchCount;
297.925 + if (bsmArgs != null) {
297.926 + // parse bsmArgs as (MH, lookup, String, MT, [extra])
297.927 + Constant indyCon = makeInvokeDynamicCon(bsmArgs);
297.928 + if (indyCon != null) {
297.929 + Constant typeCon = (Constant) bsmArgs.get(3);
297.930 + indySignatures.put(m, pool.getString(typeCon.itemIndex()));
297.931 + return indyCon;
297.932 + }
297.933 + System.err.println(m+": inscrutable bsm arguments: "+bsmArgs);
297.934 + break decode; // bail out
297.935 + }
297.936 + arg = jvm.pop();
297.937 + if (branchCount == 2 && UNKNOWN_CON.equals(arg))
297.938 + break; // merge to next path
297.939 + if (isConstant(arg, wantTag))
297.940 + return (Constant) arg;
297.941 + break decode; // bail out
297.942 + }
297.943 + default:
297.944 + if (jvm.stackMotion(i.bc)) break;
297.945 + if (bc >= opc_nconst_MIN && bc <= opc_nconst_MAX)
297.946 + { jvm.push(INSTRUCTION_CONSTANTS[bc - opc_nconst_MIN]); break; }
297.947 + if (patternMark == 'I') {
297.948 + // these support caching paths in INDY_x methods
297.949 + if (bc == opc_aload || bc >= opc_aload_0 && bc <= opc_aload_MAX)
297.950 + { jvm.push(UNKNOWN_CON); break; }
297.951 + if (bc == opc_astore || bc >= opc_astore_0 && bc <= opc_astore_MAX)
297.952 + { jvm.pop(); break; }
297.953 + switch (bc) {
297.954 + case opc_getfield:
297.955 + case opc_aaload:
297.956 + jvm.push(UNKNOWN_CON); break;
297.957 + case opc_ifnull:
297.958 + case opc_ifnonnull:
297.959 + // ignore branch target
297.960 + if (++branchCount != 1) break decode;
297.961 + jvm.pop();
297.962 + break;
297.963 + case opc_checkcast:
297.964 + arg = jvm.top();
297.965 + if ("invokeWithArguments".equals(arg) ||
297.966 + "invokeGeneric".equals(arg))
297.967 + break; // assume it is a helpful cast
297.968 + break decode;
297.969 + default:
297.970 + break decode; // bail out
297.971 + }
297.972 + continue decode; // go to next instruction
297.973 + }
297.974 + break decode; // bail out
297.975 + } //end switch
297.976 + }
297.977 + System.err.println(m+": bailout on "+i+" jvm stack: "+jvm.stack);
297.978 + return null;
297.979 + }
297.980 + private final String UNKNOWN_CON = "<unknown>";
297.981 +
297.982 + private void flattenVarargs(List<Object> args) {
297.983 + int size = args.size();
297.984 + if (size > 0 && args.get(size-1) instanceof List)
297.985 + args.addAll((List<Object>) args.remove(size-1));
297.986 + }
297.987 +
297.988 + private boolean isConstant(Object x, int tag) {
297.989 + return x instanceof Constant && ((Constant)x).tag == tag;
297.990 + }
297.991 + private Constant makeMethodTypeCon(Object x) {
297.992 + short utfIndex;
297.993 + if (x instanceof String)
297.994 + utfIndex = (short) cf.pool.addConstant(CONSTANT_Utf8, x).index;
297.995 + else if (isConstant(x, CONSTANT_String))
297.996 + utfIndex = ((Constant)x).itemIndex();
297.997 + else return null;
297.998 + return cf.pool.addConstant(CONSTANT_MethodType, utfIndex);
297.999 + }
297.1000 + private Constant parseMemberLookup(byte refKind, List<Object> args) {
297.1001 + // E.g.: lookup().findStatic(Foo.class, "name", MethodType)
297.1002 + if (args.size() != 4) return null;
297.1003 + int argi = 0;
297.1004 + if (!"lookup".equals(args.get(argi++))) return null;
297.1005 + short refindex, cindex, ntindex, nindex, tindex;
297.1006 + Object con;
297.1007 + if (!isConstant(con = args.get(argi++), CONSTANT_Class)) return null;
297.1008 + cindex = (short)((Constant)con).index;
297.1009 + if (!isConstant(con = args.get(argi++), CONSTANT_String)) return null;
297.1010 + nindex = ((Constant)con).itemIndex();
297.1011 + if (isConstant(con = args.get(argi++), CONSTANT_MethodType) ||
297.1012 + isConstant(con, CONSTANT_Class)) {
297.1013 + tindex = ((Constant)con).itemIndex();
297.1014 + } else return null;
297.1015 + ntindex = (short) cf.pool.addConstant(CONSTANT_NameAndType,
297.1016 + new Short[]{ nindex, tindex }).index;
297.1017 + byte reftag = CONSTANT_Method;
297.1018 + if (refKind <= REF_putStatic)
297.1019 + reftag = CONSTANT_Field;
297.1020 + else if (refKind == REF_invokeInterface)
297.1021 + reftag = CONSTANT_InterfaceMethod;
297.1022 + Constant ref = cf.pool.addConstant(reftag, new Short[]{ cindex, ntindex });
297.1023 + return cf.pool.addConstant(CONSTANT_MethodHandle, new Object[]{ refKind, (short)ref.index });
297.1024 + }
297.1025 + private Constant makeInvokeDynamicCon(List<Object> args) {
297.1026 + // E.g.: MH_bsm.invokeGeneric(lookup(), "name", MethodType, "extraArg")
297.1027 + removeEmptyJVMSlots(args);
297.1028 + if (args.size() != 4 && args.size() != 5) return null;
297.1029 + int argi = 0;
297.1030 + short nindex, tindex, ntindex, bsmindex;
297.1031 + Object con;
297.1032 + if (!isConstant(con = args.get(argi++), CONSTANT_MethodHandle)) return null;
297.1033 + bsmindex = (short) ((Constant)con).index;
297.1034 + if (!"lookup".equals(args.get(argi++))) return null;
297.1035 + if (!isConstant(con = args.get(argi++), CONSTANT_String)) return null;
297.1036 + nindex = ((Constant)con).itemIndex();
297.1037 + if (!isConstant(con = args.get(argi++), CONSTANT_MethodType)) return null;
297.1038 + tindex = ((Constant)con).itemIndex();
297.1039 + ntindex = (short) cf.pool.addConstant(CONSTANT_NameAndType,
297.1040 + new Short[]{ nindex, tindex }).index;
297.1041 + if (transitionalJSR292) {
297.1042 + if (argi != args.size()) {
297.1043 + System.err.println("BSM specifier has extra arguments but transitionalJSR292=1");
297.1044 + return null;
297.1045 + }
297.1046 + return cf.pool.addConstant(CONSTANT_InvokeDynamic_17,
297.1047 + new Short[]{ bsmindex, ntindex });
297.1048 + }
297.1049 + List<Object> extraArgs = Collections.emptyList();
297.1050 + if (argi < args.size()) {
297.1051 + Object arg = args.get(argi);
297.1052 + if (arg instanceof List)
297.1053 + extraArgs = (List<Object>) arg;
297.1054 + else
297.1055 + extraArgs = Arrays.asList(arg);
297.1056 + removeEmptyJVMSlots(args);
297.1057 + }
297.1058 + List<Short> extraArgIndexes = new CountedList<>(Short.class);
297.1059 + for (Object x : extraArgs) {
297.1060 + if (x instanceof Number) {
297.1061 + Object num = null; byte numTag = 0;
297.1062 + if (x instanceof Integer) { num = x; numTag = CONSTANT_Integer; }
297.1063 + if (x instanceof Float) { num = Float.floatToRawIntBits((Float)x); numTag = CONSTANT_Float; }
297.1064 + if (x instanceof Long) { num = x; numTag = CONSTANT_Long; }
297.1065 + if (x instanceof Double) { num = Double.doubleToRawLongBits((Double)x); numTag = CONSTANT_Double; }
297.1066 + if (num != null) x = cf.pool.addConstant(numTag, x);
297.1067 + }
297.1068 + if (!(x instanceof Constant)) return null;
297.1069 + extraArgIndexes.add((short) ((Constant)x).index);
297.1070 + }
297.1071 + List<Object[]> specs = bootstrapMethodSpecifiers(true);
297.1072 + int specindex = -1;
297.1073 + Object[] spec = new Object[]{ bsmindex, extraArgIndexes };
297.1074 + for (Object[] spec1 : specs) {
297.1075 + if (Arrays.equals(spec1, spec)) {
297.1076 + specindex = specs.indexOf(spec1);
297.1077 + if (verbose) System.err.println("reusing BSM specifier: "+spec1[0]+spec1[1]);
297.1078 + break;
297.1079 + }
297.1080 + }
297.1081 + if (specindex == -1) {
297.1082 + specindex = (short) specs.size();
297.1083 + specs.add(spec);
297.1084 + if (verbose) System.err.println("adding BSM specifier: "+spec[0]+spec[1]);
297.1085 + }
297.1086 + return cf.pool.addConstant(CONSTANT_InvokeDynamic,
297.1087 + new Short[]{ (short)specindex, ntindex });
297.1088 + }
297.1089 +
297.1090 + List<Object[]> bootstrapMethodSpecifiers(boolean createIfNotFound) {
297.1091 + Attr bsms = cf.findAttr("BootstrapMethods");
297.1092 + if (bsms == null) {
297.1093 + if (!createIfNotFound) return null;
297.1094 + bsms = new Attr(cf, "BootstrapMethods", new byte[]{0,0});
297.1095 + assert(bsms == cf.findAttr("BootstrapMethods"));
297.1096 + }
297.1097 + if (bsms.item instanceof byte[]) {
297.1098 + // unflatten
297.1099 + List<Object[]> specs = new CountedList<>(Object[].class);
297.1100 + DataInputStream in = new DataInputStream(new ByteArrayInputStream((byte[]) bsms.item));
297.1101 + try {
297.1102 + int len = (char) in.readShort();
297.1103 + for (int i = 0; i < len; i++) {
297.1104 + short bsm = in.readShort();
297.1105 + int argc = (char) in.readShort();
297.1106 + List<Short> argv = new CountedList<>(Short.class);
297.1107 + for (int j = 0; j < argc; j++)
297.1108 + argv.add(in.readShort());
297.1109 + specs.add(new Object[]{ bsm, argv });
297.1110 + }
297.1111 + } catch (IOException ex) { throw new InternalError(); }
297.1112 + bsms.item = specs;
297.1113 + }
297.1114 + return (List<Object[]>) bsms.item;
297.1115 + }
297.1116 + }
297.1117 +
297.1118 + private DataInputStream openInput(File f) throws IOException {
297.1119 + return new DataInputStream(new BufferedInputStream(new FileInputStream(f)));
297.1120 + }
297.1121 +
297.1122 + private DataOutputStream openOutput(File f) throws IOException {
297.1123 + if (!overwrite && f.exists())
297.1124 + throw new IOException("file already exists: "+f);
297.1125 + ensureDirectory(f.getParentFile());
297.1126 + return new DataOutputStream(new BufferedOutputStream(new FileOutputStream(f)));
297.1127 + }
297.1128 +
297.1129 + static byte[] readRawBytes(DataInputStream in, int size) throws IOException {
297.1130 + byte[] bytes = new byte[size];
297.1131 + int nr = in.read(bytes);
297.1132 + if (nr != size)
297.1133 + throw new InternalError("wrong size: "+nr);
297.1134 + return bytes;
297.1135 + }
297.1136 +
297.1137 + private interface Chunk {
297.1138 + void readFrom(DataInputStream in) throws IOException;
297.1139 + void writeTo(DataOutputStream out) throws IOException;
297.1140 + }
297.1141 +
297.1142 + private static class CountedList<T> extends ArrayList<T> implements Chunk {
297.1143 + final Class<? extends T> itemClass;
297.1144 + final int rowlen;
297.1145 + CountedList(Class<? extends T> itemClass, int rowlen) {
297.1146 + this.itemClass = itemClass;
297.1147 + this.rowlen = rowlen;
297.1148 + }
297.1149 + CountedList(Class<? extends T> itemClass) { this(itemClass, -1); }
297.1150 + public void readFrom(DataInputStream in) throws IOException {
297.1151 + int count = in.readUnsignedShort();
297.1152 + while (size() < count) {
297.1153 + if (rowlen < 0) {
297.1154 + add(readInput(in, itemClass));
297.1155 + } else {
297.1156 + Class<?> elemClass = itemClass.getComponentType();
297.1157 + Object[] row = (Object[]) java.lang.reflect.Array.newInstance(elemClass, rowlen);
297.1158 + for (int i = 0; i < rowlen; i++)
297.1159 + row[i] = readInput(in, elemClass);
297.1160 + add(itemClass.cast(row));
297.1161 + }
297.1162 + }
297.1163 + }
297.1164 + public void writeTo(DataOutputStream out) throws IOException {
297.1165 + out.writeShort((short)size());
297.1166 + for (T item : this) {
297.1167 + writeOutput(out, item);
297.1168 + }
297.1169 + }
297.1170 + }
297.1171 +
297.1172 + private static <T> T readInput(DataInputStream in, Class<T> dataClass) throws IOException {
297.1173 + Object data;
297.1174 + if (dataClass == Integer.class) {
297.1175 + data = in.readInt();
297.1176 + } else if (dataClass == Short.class) {
297.1177 + data = in.readShort();
297.1178 + } else if (dataClass == Byte.class) {
297.1179 + data = in.readByte();
297.1180 + } else if (dataClass == String.class) {
297.1181 + data = in.readUTF();
297.1182 + } else if (Chunk.class.isAssignableFrom(dataClass)) {
297.1183 + T obj;
297.1184 + try { obj = dataClass.newInstance(); }
297.1185 + catch (Exception ex) { throw new RuntimeException(ex); }
297.1186 + ((Chunk)obj).readFrom(in);
297.1187 + data = obj;
297.1188 + } else {
297.1189 + throw new InternalError("bad input datum: "+dataClass);
297.1190 + }
297.1191 + return dataClass.cast(data);
297.1192 + }
297.1193 + private static <T> T readInput(byte[] bytes, Class<T> dataClass) {
297.1194 + try {
297.1195 + return readInput(new DataInputStream(new ByteArrayInputStream(bytes)), dataClass);
297.1196 + } catch (IOException ex) {
297.1197 + throw new InternalError();
297.1198 + }
297.1199 + }
297.1200 + private static void readInputs(DataInputStream in, Object... data) throws IOException {
297.1201 + for (Object x : data) ((Chunk)x).readFrom(in);
297.1202 + }
297.1203 +
297.1204 + private static void writeOutput(DataOutputStream out, Object data) throws IOException {
297.1205 + if (data == null) {
297.1206 + return;
297.1207 + } if (data instanceof Integer) {
297.1208 + out.writeInt((Integer)data);
297.1209 + } else if (data instanceof Long) {
297.1210 + out.writeLong((Long)data);
297.1211 + } else if (data instanceof Short) {
297.1212 + out.writeShort((Short)data);
297.1213 + } else if (data instanceof Byte) {
297.1214 + out.writeByte((Byte)data);
297.1215 + } else if (data instanceof String) {
297.1216 + out.writeUTF((String)data);
297.1217 + } else if (data instanceof byte[]) {
297.1218 + out.write((byte[])data);
297.1219 + } else if (data instanceof Object[]) {
297.1220 + for (Object x : (Object[]) data)
297.1221 + writeOutput(out, x);
297.1222 + } else if (data instanceof Chunk) {
297.1223 + Chunk x = (Chunk) data;
297.1224 + x.writeTo(out);
297.1225 + } else if (data instanceof List) {
297.1226 + for (Object x : (List<?>) data)
297.1227 + writeOutput(out, x);
297.1228 + } else {
297.1229 + throw new InternalError("bad output datum: "+data+" : "+data.getClass().getName());
297.1230 + }
297.1231 + }
297.1232 + private static void writeOutputs(DataOutputStream out, Object... data) throws IOException {
297.1233 + for (Object x : data) writeOutput(out, x);
297.1234 + }
297.1235 +
297.1236 + public static abstract class Outer {
297.1237 + public abstract List<? extends Inner> inners();
297.1238 + protected void linkInners() {
297.1239 + for (Inner i : inners()) {
297.1240 + i.linkOuter(this);
297.1241 + if (i instanceof Outer)
297.1242 + ((Outer)i).linkInners();
297.1243 + }
297.1244 + }
297.1245 + public <T extends Outer> T outer(Class<T> c) {
297.1246 + for (Outer walk = this;; walk = ((Inner)walk).outer()) {
297.1247 + if (c.isInstance(walk))
297.1248 + return c.cast(walk);
297.1249 + //if (!(walk instanceof Inner)) return null;
297.1250 + }
297.1251 + }
297.1252 +
297.1253 + public abstract List<Attr> attrs();
297.1254 + public Attr findAttr(String name) {
297.1255 + return findAttr(outer(ClassFile.class).pool.stringIndex(name, false));
297.1256 + }
297.1257 + public Attr findAttr(int name) {
297.1258 + if (name == 0) return null;
297.1259 + for (Attr a : attrs()) {
297.1260 + if (a.name == name) return a;
297.1261 + }
297.1262 + return null;
297.1263 + }
297.1264 + }
297.1265 + public interface Inner { Outer outer(); void linkOuter(Outer o); }
297.1266 + public static abstract class InnerOuter extends Outer implements Inner {
297.1267 + public Outer outer;
297.1268 + public Outer outer() { return outer; }
297.1269 + public void linkOuter(Outer o) { assert(outer == null); outer = o; }
297.1270 + }
297.1271 + public static class Constant<T> implements Chunk {
297.1272 + public final byte tag;
297.1273 + public final T item;
297.1274 + public final int index;
297.1275 + public Constant(int index, byte tag, T item) {
297.1276 + this.index = index;
297.1277 + this.tag = tag;
297.1278 + this.item = item;
297.1279 + }
297.1280 + public Constant checkTag(byte tag) {
297.1281 + if (this.tag != tag) throw new InternalError(this.toString());
297.1282 + return this;
297.1283 + }
297.1284 + public String itemString() { return (String)item; }
297.1285 + public Short itemIndex() { return (Short)item; }
297.1286 + public Short[] itemIndexes() { return (Short[])item; }
297.1287 + public void readFrom(DataInputStream in) throws IOException {
297.1288 + throw new InternalError("do not call");
297.1289 + }
297.1290 + public void writeTo(DataOutputStream out) throws IOException {
297.1291 + writeOutputs(out, tag, item);
297.1292 + }
297.1293 + public boolean equals(Object x) { return (x instanceof Constant && equals((Constant)x)); }
297.1294 + public boolean equals(Constant that) {
297.1295 + return (this.tag == that.tag && this.itemAsComparable().equals(that.itemAsComparable()));
297.1296 + }
297.1297 + public int hashCode() { return (tag * 31) + this.itemAsComparable().hashCode(); }
297.1298 + public Object itemAsComparable() {
297.1299 + switch (tag) {
297.1300 + case CONSTANT_Double: return Double.longBitsToDouble((Long)item);
297.1301 + case CONSTANT_Float: return Float.intBitsToFloat((Integer)item);
297.1302 + }
297.1303 + return (item instanceof Object[] ? Arrays.asList((Object[])item) : item);
297.1304 + }
297.1305 + public String toString() {
297.1306 + String itstr = String.valueOf(itemAsComparable());
297.1307 + return (index + ":" + tagName(tag) + (itstr.startsWith("[")?"":"=") + itstr);
297.1308 + }
297.1309 + private static String[] TAG_NAMES;
297.1310 + public static String tagName(byte tag) { // used for error messages
297.1311 + if (TAG_NAMES == null)
297.1312 + TAG_NAMES = ("None Utf8 Unicode Integer Float Long Double Class String"
297.1313 + +" Fieldref Methodref InterfaceMethodref NameAndType #13 #14"
297.1314 + +" MethodHandle MethodType InvokeDynamic#17 InvokeDynamic").split(" ");
297.1315 + if ((tag & 0xFF) >= TAG_NAMES.length) return "#"+(tag & 0xFF);
297.1316 + return TAG_NAMES[tag & 0xFF];
297.1317 + }
297.1318 + }
297.1319 +
297.1320 + public static class Pool extends CountedList<Constant> implements Chunk {
297.1321 + private Map<String,Short> strings = new TreeMap<>();
297.1322 +
297.1323 + public Pool() {
297.1324 + super(Constant.class);
297.1325 + }
297.1326 + public void readFrom(DataInputStream in) throws IOException {
297.1327 + int count = in.readUnsignedShort();
297.1328 + add(null); // always ignore first item
297.1329 + while (size() < count) {
297.1330 + readConstant(in);
297.1331 + }
297.1332 + }
297.1333 + public <T> Constant<T> addConstant(byte tag, T item) {
297.1334 + Constant<T> con = new Constant<>(size(), tag, item);
297.1335 + int idx = indexOf(con);
297.1336 + if (idx >= 0) return get(idx);
297.1337 + add(con);
297.1338 + if (tag == CONSTANT_Utf8) strings.put((String)item, (short) con.index);
297.1339 + return con;
297.1340 + }
297.1341 + private void readConstant(DataInputStream in) throws IOException {
297.1342 + byte tag = in.readByte();
297.1343 + int index = size();
297.1344 + Object arg;
297.1345 + switch (tag) {
297.1346 + case CONSTANT_Utf8:
297.1347 + arg = in.readUTF();
297.1348 + strings.put((String) arg, (short) size());
297.1349 + break;
297.1350 + case CONSTANT_Integer:
297.1351 + case CONSTANT_Float:
297.1352 + arg = in.readInt(); break;
297.1353 + case CONSTANT_Long:
297.1354 + case CONSTANT_Double:
297.1355 + add(new Constant(index, tag, in.readLong()));
297.1356 + add(null);
297.1357 + return;
297.1358 + case CONSTANT_Class:
297.1359 + case CONSTANT_String:
297.1360 + arg = in.readShort(); break;
297.1361 + case CONSTANT_Field:
297.1362 + case CONSTANT_Method:
297.1363 + case CONSTANT_InterfaceMethod:
297.1364 + case CONSTANT_NameAndType:
297.1365 + case CONSTANT_InvokeDynamic_17:
297.1366 + case CONSTANT_InvokeDynamic:
297.1367 + // read an ordered pair
297.1368 + arg = new Short[] { in.readShort(), in.readShort() };
297.1369 + break;
297.1370 + case CONSTANT_MethodHandle:
297.1371 + // read an ordered pair; first part is a u1 (not u2)
297.1372 + arg = new Object[] { in.readByte(), in.readShort() };
297.1373 + break;
297.1374 + case CONSTANT_MethodType:
297.1375 + arg = in.readShort(); break;
297.1376 + default:
297.1377 + throw new InternalError("bad CP tag "+tag);
297.1378 + }
297.1379 + add(new Constant(index, tag, arg));
297.1380 + }
297.1381 +
297.1382 + // Access:
297.1383 + public Constant get(int index) {
297.1384 + // extra 1-bits get into the shorts
297.1385 + return super.get((char) index);
297.1386 + }
297.1387 + String getString(byte tag, short index) {
297.1388 + get(index).checkTag(tag);
297.1389 + return getString(index);
297.1390 + }
297.1391 + String getString(short index) {
297.1392 + Object v = get(index).item;
297.1393 + if (v instanceof Short)
297.1394 + v = get((Short)v).checkTag(CONSTANT_Utf8).item;
297.1395 + return (String) v;
297.1396 + }
297.1397 + String[] getStrings(Short[] indexes) {
297.1398 + String[] res = new String[indexes.length];
297.1399 + for (int i = 0; i < indexes.length; i++)
297.1400 + res[i] = getString(indexes[i]);
297.1401 + return res;
297.1402 + }
297.1403 + int stringIndex(String name, boolean createIfNotFound) {
297.1404 + Short x = strings.get(name);
297.1405 + if (x != null) return (char)(int) x;
297.1406 + if (!createIfNotFound) return 0;
297.1407 + return addConstant(CONSTANT_Utf8, name).index;
297.1408 + }
297.1409 + Short[] getMemberRef(short index) {
297.1410 + Short[] cls_nnt = get(index).itemIndexes();
297.1411 + Short[] name_type = get(cls_nnt[1]).itemIndexes();
297.1412 + return new Short[]{ cls_nnt[0], name_type[0], name_type[1] };
297.1413 + }
297.1414 + }
297.1415 +
297.1416 + public class ClassFile extends Outer implements Chunk {
297.1417 + ClassFile(File f) throws IOException {
297.1418 + DataInputStream in = openInput(f);
297.1419 + try {
297.1420 + readFrom(in);
297.1421 + } finally {
297.1422 + if (in != null) in.close();
297.1423 + }
297.1424 + }
297.1425 +
297.1426 + public int magic, version; // <min:maj>
297.1427 + public final Pool pool = new Pool();
297.1428 + public short access, thisc, superc;
297.1429 + public final List<Short> interfaces = new CountedList<>(Short.class);
297.1430 + public final List<Field> fields = new CountedList<>(Field.class);
297.1431 + public final List<Method> methods = new CountedList<>(Method.class);
297.1432 + public final List<Attr> attrs = new CountedList<>(Attr.class);
297.1433 +
297.1434 + public final void readFrom(DataInputStream in) throws IOException {
297.1435 + magic = in.readInt(); version = in.readInt();
297.1436 + if (magic != 0xCAFEBABE) throw new IOException("bad magic number");
297.1437 + pool.readFrom(in);
297.1438 + Code_index = pool.stringIndex("Code", false);
297.1439 + access = in.readShort(); thisc = in.readShort(); superc = in.readShort();
297.1440 + readInputs(in, interfaces, fields, methods, attrs);
297.1441 + if (in.read() >= 0) throw new IOException("junk after end of file");
297.1442 + linkInners();
297.1443 + }
297.1444 +
297.1445 + void writeTo(File f) throws IOException {
297.1446 + DataOutputStream out = openOutput(f);
297.1447 + try {
297.1448 + writeTo(out);
297.1449 + } finally {
297.1450 + out.close();
297.1451 + }
297.1452 + }
297.1453 +
297.1454 + public void writeTo(DataOutputStream out) throws IOException {
297.1455 + writeOutputs(out, magic, version, pool,
297.1456 + access, thisc, superc, interfaces,
297.1457 + fields, methods, attrs);
297.1458 + }
297.1459 +
297.1460 + public byte[] toByteArray() {
297.1461 + try {
297.1462 + ByteArrayOutputStream buf = new ByteArrayOutputStream();
297.1463 + writeTo(new DataOutputStream(buf));
297.1464 + return buf.toByteArray();
297.1465 + } catch (IOException ex) {
297.1466 + throw new InternalError();
297.1467 + }
297.1468 + }
297.1469 +
297.1470 + public List<Inner> inners() {
297.1471 + List<Inner> inns = new ArrayList<>();
297.1472 + inns.addAll(fields); inns.addAll(methods); inns.addAll(attrs);
297.1473 + return inns;
297.1474 + }
297.1475 + public List<Attr> attrs() { return attrs; }
297.1476 +
297.1477 + // derived stuff:
297.1478 + public String nameString() { return pool.getString(CONSTANT_Class, thisc); }
297.1479 + int Code_index;
297.1480 + }
297.1481 +
297.1482 + private static <T extends Member> T findMember(List<T> mems, int name, int type) {
297.1483 + if (name == 0 || type == 0) return null;
297.1484 + for (T m : mems) {
297.1485 + if (m.name == name && m.type == type) return m;
297.1486 + }
297.1487 + return null;
297.1488 + }
297.1489 +
297.1490 + public static class Member extends InnerOuter implements Chunk {
297.1491 + public short access, name, type;
297.1492 + public final List<Attr> attrs = new CountedList<>(Attr.class);
297.1493 + public void readFrom(DataInputStream in) throws IOException {
297.1494 + access = in.readShort(); name = in.readShort(); type = in.readShort();
297.1495 + readInputs(in, attrs);
297.1496 + }
297.1497 + public void writeTo(DataOutputStream out) throws IOException {
297.1498 + writeOutputs(out, access, name, type, attrs);
297.1499 + }
297.1500 + public List<Attr> inners() { return attrs; }
297.1501 + public List<Attr> attrs() { return attrs; }
297.1502 + public ClassFile outer() { return (ClassFile) outer; }
297.1503 + public String nameString() { return outer().pool.getString(CONSTANT_Utf8, name); }
297.1504 + public String typeString() { return outer().pool.getString(CONSTANT_Utf8, type); }
297.1505 + public String toString() {
297.1506 + if (outer == null) return super.toString();
297.1507 + return nameString() + (this instanceof Method ? "" : ":")
297.1508 + + simplifyType(typeString());
297.1509 + }
297.1510 + }
297.1511 + public static class Field extends Member {
297.1512 + }
297.1513 + public static class Method extends Member {
297.1514 + public Code code() {
297.1515 + Attr a = findAttr("Code");
297.1516 + if (a == null) return null;
297.1517 + return (Code) a.item;
297.1518 + }
297.1519 + public Instruction instructions() {
297.1520 + Code code = code();
297.1521 + if (code == null) return null;
297.1522 + return code.instructions();
297.1523 + }
297.1524 + }
297.1525 +
297.1526 + public static class Attr extends InnerOuter implements Chunk {
297.1527 + public short name;
297.1528 + public int size = -1; // no pre-declared size
297.1529 + public Object item;
297.1530 +
297.1531 + public Attr() {}
297.1532 + public Attr(Outer outer, String name, Object item) {
297.1533 + ClassFile cf = outer.outer(ClassFile.class);
297.1534 + linkOuter(outer);
297.1535 + this.name = (short) cf.pool.stringIndex(name, true);
297.1536 + this.item = item;
297.1537 + outer.attrs().add(this);
297.1538 + }
297.1539 + public void readFrom(DataInputStream in) throws IOException {
297.1540 + name = in.readShort();
297.1541 + size = in.readInt();
297.1542 + item = readRawBytes(in, size);
297.1543 + }
297.1544 + public void writeTo(DataOutputStream out) throws IOException {
297.1545 + out.writeShort(name);
297.1546 + // write the 4-byte size header and then the contents:
297.1547 + byte[] bytes;
297.1548 + int trueSize;
297.1549 + if (item instanceof byte[]) {
297.1550 + bytes = (byte[]) item;
297.1551 + out.writeInt(trueSize = bytes.length);
297.1552 + out.write(bytes);
297.1553 + } else {
297.1554 + trueSize = flatten(out);
297.1555 + //if (!(item instanceof Code)) System.err.println("wrote complex attr name="+(int)(char)name+" size="+trueSize+" data="+Arrays.toString(flatten()));
297.1556 + }
297.1557 + if (trueSize != size && size >= 0)
297.1558 + System.err.println("warning: attribute size changed "+size+" to "+trueSize);
297.1559 + }
297.1560 + public void linkOuter(Outer o) {
297.1561 + super.linkOuter(o);
297.1562 + if (item instanceof byte[] &&
297.1563 + outer instanceof Method &&
297.1564 + ((Method)outer).outer().Code_index == name) {
297.1565 + item = readInput((byte[])item, Code.class);
297.1566 + }
297.1567 + }
297.1568 + public List<Inner> inners() {
297.1569 + if (item instanceof Inner)
297.1570 + return Collections.nCopies(1, (Inner)item);
297.1571 + return Collections.emptyList();
297.1572 + }
297.1573 + public List<Attr> attrs() { return null; } // Code overrides this
297.1574 + public byte[] flatten() {
297.1575 + ByteArrayOutputStream buf = new ByteArrayOutputStream(Math.max(20, size));
297.1576 + flatten(buf);
297.1577 + return buf.toByteArray();
297.1578 + }
297.1579 + public int flatten(DataOutputStream out) throws IOException {
297.1580 + ByteArrayOutputStream buf = new ByteArrayOutputStream(Math.max(20, size));
297.1581 + int trueSize = flatten(buf);
297.1582 + out.writeInt(trueSize);
297.1583 + buf.writeTo(out);
297.1584 + return trueSize;
297.1585 + }
297.1586 + private int flatten(ByteArrayOutputStream buf) {
297.1587 + try {
297.1588 + writeOutput(new DataOutputStream(buf), item);
297.1589 + return buf.size();
297.1590 + } catch (IOException ex) {
297.1591 + throw new InternalError();
297.1592 + }
297.1593 + }
297.1594 + public String nameString() {
297.1595 + ClassFile cf = outer(ClassFile.class);
297.1596 + if (cf == null) return "#"+name;
297.1597 + return cf.pool.getString(name);
297.1598 + }
297.1599 + public String toString() {
297.1600 + return nameString()+(size < 0 ? "=" : "["+size+"]=")+item;
297.1601 + }
297.1602 + }
297.1603 +
297.1604 + public static class Code extends InnerOuter implements Chunk {
297.1605 + public short stacks, locals;
297.1606 + public byte[] bytes;
297.1607 + public final List<Short[]> etable = new CountedList<>(Short[].class, 4);
297.1608 + public final List<Attr> attrs = new CountedList<>(Attr.class);
297.1609 + // etable[N] = (N)*{ startpc, endpc, handlerpc, catchtype }
297.1610 + public void readFrom(DataInputStream in) throws IOException {
297.1611 + stacks = in.readShort(); locals = in.readShort();
297.1612 + bytes = readRawBytes(in, in.readInt());
297.1613 + readInputs(in, etable, attrs);
297.1614 + }
297.1615 + public void writeTo(DataOutputStream out) throws IOException {
297.1616 + writeOutputs(out, stacks, locals, bytes.length, bytes, etable, attrs);
297.1617 + }
297.1618 + public List<Attr> inners() { return attrs; }
297.1619 + public List<Attr> attrs() { return attrs; }
297.1620 + public Instruction instructions() {
297.1621 + return new Instruction(bytes, 0);
297.1622 + }
297.1623 + }
297.1624 +
297.1625 + // lots of constants
297.1626 + private static final byte
297.1627 + CONSTANT_Utf8 = 1,
297.1628 + CONSTANT_Integer = 3,
297.1629 + CONSTANT_Float = 4,
297.1630 + CONSTANT_Long = 5,
297.1631 + CONSTANT_Double = 6,
297.1632 + CONSTANT_Class = 7,
297.1633 + CONSTANT_String = 8,
297.1634 + CONSTANT_Field = 9,
297.1635 + CONSTANT_Method = 10,
297.1636 + CONSTANT_InterfaceMethod = 11,
297.1637 + CONSTANT_NameAndType = 12,
297.1638 + CONSTANT_MethodHandle = 15, // JSR 292
297.1639 + CONSTANT_MethodType = 16, // JSR 292
297.1640 + CONSTANT_InvokeDynamic_17 = 17, // JSR 292, only occurs in old class files
297.1641 + CONSTANT_InvokeDynamic = 18; // JSR 292
297.1642 + private static final byte
297.1643 + REF_getField = 1,
297.1644 + REF_getStatic = 2,
297.1645 + REF_putField = 3,
297.1646 + REF_putStatic = 4,
297.1647 + REF_invokeVirtual = 5,
297.1648 + REF_invokeStatic = 6,
297.1649 + REF_invokeSpecial = 7,
297.1650 + REF_newInvokeSpecial = 8,
297.1651 + REF_invokeInterface = 9;
297.1652 +
297.1653 + private static final int
297.1654 + opc_nop = 0,
297.1655 + opc_aconst_null = 1,
297.1656 + opc_nconst_MIN = 2, // iconst_m1
297.1657 + opc_nconst_MAX = 15, // dconst_1
297.1658 + opc_bipush = 16,
297.1659 + opc_sipush = 17,
297.1660 + opc_ldc = 18,
297.1661 + opc_ldc_w = 19,
297.1662 + opc_ldc2_w = 20,
297.1663 + opc_aload = 25,
297.1664 + opc_aload_0 = 42,
297.1665 + opc_aload_MAX = 45,
297.1666 + opc_aaload = 50,
297.1667 + opc_astore = 58,
297.1668 + opc_astore_0 = 75,
297.1669 + opc_astore_MAX = 78,
297.1670 + opc_aastore = 83,
297.1671 + opc_pop = 87,
297.1672 + opc_pop2 = 88,
297.1673 + opc_dup = 89,
297.1674 + opc_dup_x1 = 90,
297.1675 + opc_dup_x2 = 91,
297.1676 + opc_dup2 = 92,
297.1677 + opc_dup2_x1 = 93,
297.1678 + opc_dup2_x2 = 94,
297.1679 + opc_swap = 95,
297.1680 + opc_tableswitch = 170,
297.1681 + opc_lookupswitch = 171,
297.1682 + opc_areturn = 176,
297.1683 + opc_getstatic = 178,
297.1684 + opc_putstatic = 179,
297.1685 + opc_getfield = 180,
297.1686 + opc_putfield = 181,
297.1687 + opc_invokevirtual = 182,
297.1688 + opc_invokespecial = 183,
297.1689 + opc_invokestatic = 184,
297.1690 + opc_invokeinterface = 185,
297.1691 + opc_invokedynamic = 186,
297.1692 + opc_new = 187,
297.1693 + opc_anewarray = 189,
297.1694 + opc_checkcast = 192,
297.1695 + opc_ifnull = 198,
297.1696 + opc_ifnonnull = 199,
297.1697 + opc_wide = 196;
297.1698 +
297.1699 + private static final Object[] INSTRUCTION_CONSTANTS = {
297.1700 + -1, 0, 1, 2, 3, 4, 5, 0L, 1L, 0.0F, 1.0F, 2.0F, 0.0D, 1.0D
297.1701 + };
297.1702 +
297.1703 + private static final String INSTRUCTION_FORMATS =
297.1704 + "nop$ aconst_null$L iconst_m1$I iconst_0$I iconst_1$I "+
297.1705 + "iconst_2$I iconst_3$I iconst_4$I iconst_5$I lconst_0$J_ "+
297.1706 + "lconst_1$J_ fconst_0$F fconst_1$F fconst_2$F dconst_0$D_ "+
297.1707 + "dconst_1$D_ bipush=bx$I sipush=bxx$I ldc=bk$X ldc_w=bkk$X "+
297.1708 + "ldc2_w=bkk$X_ iload=bl/wbll$I lload=bl/wbll$J_ fload=bl/wbll$F "+
297.1709 + "dload=bl/wbll$D_ aload=bl/wbll$L iload_0$I iload_1$I "+
297.1710 + "iload_2$I iload_3$I lload_0$J_ lload_1$J_ lload_2$J_ "+
297.1711 + "lload_3$J_ fload_0$F fload_1$F fload_2$F fload_3$F dload_0$D_ "+
297.1712 + "dload_1$D_ dload_2$D_ dload_3$D_ aload_0$L aload_1$L "+
297.1713 + "aload_2$L aload_3$L iaload$LI$I laload$LI$J_ faload$LI$F "+
297.1714 + "daload$LI$D_ aaload$LI$L baload$LI$I caload$LI$I saload$LI$I "+
297.1715 + "istore=bl/wbll$I$ lstore=bl/wbll$J_$ fstore=bl/wbll$F$ "+
297.1716 + "dstore=bl/wbll$D_$ astore=bl/wbll$L$ istore_0$I$ istore_1$I$ "+
297.1717 + "istore_2$I$ istore_3$I$ lstore_0$J_$ lstore_1$J_$ "+
297.1718 + "lstore_2$J_$ lstore_3$J_$ fstore_0$F$ fstore_1$F$ fstore_2$F$ "+
297.1719 + "fstore_3$F$ dstore_0$D_$ dstore_1$D_$ dstore_2$D_$ "+
297.1720 + "dstore_3$D_$ astore_0$L$ astore_1$L$ astore_2$L$ astore_3$L$ "+
297.1721 + "iastore$LII$ lastore$LIJ_$ fastore$LIF$ dastore$LID_$ "+
297.1722 + "aastore$LIL$ bastore$LII$ castore$LII$ sastore$LII$ pop$X$ "+
297.1723 + "pop2$XX$ dup$X$XX dup_x1$XX$XXX dup_x2$XXX$XXXX dup2$XX$XXXX "+
297.1724 + "dup2_x1$XXX$XXXXX dup2_x2$XXXX$XXXXXX swap$XX$XX "+
297.1725 + "iadd$II$I ladd$J_J_$J_ fadd$FF$F dadd$D_D_$D_ isub$II$I "+
297.1726 + "lsub$J_J_$J_ fsub$FF$F dsub$D_D_$D_ imul$II$I lmul$J_J_$J_ "+
297.1727 + "fmul$FF$F dmul$D_D_$D_ idiv$II$I ldiv$J_J_$J_ fdiv$FF$F "+
297.1728 + "ddiv$D_D_$D_ irem$II$I lrem$J_J_$J_ frem$FF$F drem$D_D_$D_ "+
297.1729 + "ineg$I$I lneg$J_$J_ fneg$F$F dneg$D_$D_ ishl$II$I lshl$J_I$J_ "+
297.1730 + "ishr$II$I lshr$J_I$J_ iushr$II$I lushr$J_I$J_ iand$II$I "+
297.1731 + "land$J_J_$J_ ior$II$I lor$J_J_$J_ ixor$II$I lxor$J_J_$J_ "+
297.1732 + "iinc=blx/wbllxx$ i2l$I$J_ i2f$I$F i2d$I$D_ l2i$J_$I l2f$J_$F "+
297.1733 + "l2d$J_$D_ f2i$F$I f2l$F$J_ f2d$F$D_ d2i$D_$I d2l$D_$J_ "+
297.1734 + "d2f$D_$F i2b$I$I i2c$I$I i2s$I$I lcmp fcmpl fcmpg dcmpl dcmpg "+
297.1735 + "ifeq=boo ifne=boo iflt=boo ifge=boo ifgt=boo ifle=boo "+
297.1736 + "if_icmpeq=boo if_icmpne=boo if_icmplt=boo if_icmpge=boo "+
297.1737 + "if_icmpgt=boo if_icmple=boo if_acmpeq=boo if_acmpne=boo "+
297.1738 + "goto=boo jsr=boo ret=bl/wbll tableswitch=* lookupswitch=* "+
297.1739 + "ireturn lreturn freturn dreturn areturn return "+
297.1740 + "getstatic=bkf$Q putstatic=bkf$Q$ getfield=bkf$L$Q "+
297.1741 + "putfield=bkf$LQ$ invokevirtual=bkm$LQ$Q "+
297.1742 + "invokespecial=bkm$LQ$Q invokestatic=bkm$Q$Q "+
297.1743 + "invokeinterface=bkixx$LQ$Q invokedynamic=bkd__$Q$Q new=bkc$L "+
297.1744 + "newarray=bx$I$L anewarray=bkc$I$L arraylength$L$I athrow "+
297.1745 + "checkcast=bkc$L$L instanceof=bkc$L$I monitorenter$L "+
297.1746 + "monitorexit$L wide=* multianewarray=bkcx ifnull=boo "+
297.1747 + "ifnonnull=boo goto_w=boooo jsr_w=boooo ";
297.1748 + private static final String[] INSTRUCTION_NAMES;
297.1749 + private static final String[] INSTRUCTION_POPS;
297.1750 + private static final int[] INSTRUCTION_INFO;
297.1751 + static {
297.1752 + String[] insns = INSTRUCTION_FORMATS.split(" ");
297.1753 + assert(insns[opc_lookupswitch].startsWith("lookupswitch"));
297.1754 + assert(insns[opc_tableswitch].startsWith("tableswitch"));
297.1755 + assert(insns[opc_wide].startsWith("wide"));
297.1756 + assert(insns[opc_invokedynamic].startsWith("invokedynamic"));
297.1757 + int[] info = new int[256];
297.1758 + String[] names = new String[256];
297.1759 + String[] pops = new String[256];
297.1760 + for (int i = 0; i < insns.length; i++) {
297.1761 + String insn = insns[i];
297.1762 + int dl = insn.indexOf('$');
297.1763 + if (dl > 0) {
297.1764 + String p = insn.substring(dl+1);
297.1765 + if (p.indexOf('$') < 0) p = "$" + p;
297.1766 + pops[i] = p;
297.1767 + insn = insn.substring(0, dl);
297.1768 + }
297.1769 + int eq = insn.indexOf('=');
297.1770 + if (eq < 0) {
297.1771 + info[i] = 1;
297.1772 + names[i] = insn;
297.1773 + continue;
297.1774 + }
297.1775 + names[i] = insn.substring(0, eq);
297.1776 + String fmt = insn.substring(eq+1);
297.1777 + if (fmt.equals("*")) {
297.1778 + info[i] = 0;
297.1779 + continue;
297.1780 + }
297.1781 + int sl = fmt.indexOf('/');
297.1782 + if (sl < 0) {
297.1783 + info[i] = (char) fmt.length();
297.1784 + } else {
297.1785 + String wfmt = fmt.substring(sl+1);
297.1786 + fmt = fmt.substring(0, sl);
297.1787 + info[i] = (char)( fmt.length() + (wfmt.length() * 16) );
297.1788 + }
297.1789 + }
297.1790 + INSTRUCTION_INFO = info;
297.1791 + INSTRUCTION_NAMES = names;
297.1792 + INSTRUCTION_POPS = pops;
297.1793 + }
297.1794 +
297.1795 + public static class Instruction implements Cloneable {
297.1796 + byte[] codeBase;
297.1797 + int pc;
297.1798 + int bc;
297.1799 + int info;
297.1800 + int wide;
297.1801 + int len;
297.1802 + Instruction(byte[] codeBase, int pc) {
297.1803 + this.codeBase = codeBase;
297.1804 + init(pc);
297.1805 + }
297.1806 + public Instruction clone() {
297.1807 + try {
297.1808 + return (Instruction) super.clone();
297.1809 + } catch (CloneNotSupportedException ex) {
297.1810 + throw new InternalError();
297.1811 + }
297.1812 + }
297.1813 + private Instruction init(int pc) {
297.1814 + this.pc = pc;
297.1815 + this.bc = codeBase[pc] & 0xFF;
297.1816 + this.info = INSTRUCTION_INFO[bc];
297.1817 + this.wide = 0;
297.1818 + this.len = (info & 0x0F);
297.1819 + if (len == 0)
297.1820 + computeLength();
297.1821 + return this;
297.1822 + }
297.1823 + Instruction next() {
297.1824 + if (len == 0 && bc != 0) throw new InternalError();
297.1825 + int npc = pc + len;
297.1826 + if (npc == codeBase.length)
297.1827 + return null;
297.1828 + return init(npc);
297.1829 + }
297.1830 + void forceNext(int newLen) {
297.1831 + bc = opc_nop;
297.1832 + len = newLen;
297.1833 + }
297.1834 +
297.1835 + public String toString() {
297.1836 + StringBuilder buf = new StringBuilder();
297.1837 + buf.append(pc).append(":").append(INSTRUCTION_NAMES[bc]);
297.1838 + switch (len) {
297.1839 + case 3: buf.append(" ").append(u2At(1)); break;
297.1840 + case 5: buf.append(" ").append(u2At(1)).append(" ").append(u2At(3)); break;
297.1841 + default: for (int i = 1; i < len; i++) buf.append(" ").append(u1At(1));
297.1842 + }
297.1843 + return buf.toString();
297.1844 + }
297.1845 +
297.1846 + // these are the hard parts
297.1847 + private void computeLength() {
297.1848 + int cases;
297.1849 + switch (bc) {
297.1850 + case opc_wide:
297.1851 + bc = codeBase[pc + 1];
297.1852 + info = INSTRUCTION_INFO[bc];
297.1853 + len = ((info >> 4) & 0x0F);
297.1854 + if (len == 0) throw new RuntimeException("misplaced wide bytecode: "+bc);
297.1855 + return;
297.1856 +
297.1857 + case opc_tableswitch:
297.1858 + cases = (u4At(alignedIntOffset(2)) - u4At(alignedIntOffset(1)) + 1);
297.1859 + len = alignedIntOffset(3 + cases*1);
297.1860 + return;
297.1861 +
297.1862 + case opc_lookupswitch:
297.1863 + cases = u4At(alignedIntOffset(1));
297.1864 + len = alignedIntOffset(2 + cases*2);
297.1865 + return;
297.1866 +
297.1867 + default:
297.1868 + throw new RuntimeException("unknown bytecode: "+bc);
297.1869 + }
297.1870 + }
297.1871 + // switch code
297.1872 + // clget the Nth int (where 0 is the first after the opcode itself)
297.1873 + public int alignedIntOffset(int n) {
297.1874 + int pos = pc + 1;
297.1875 + pos += ((-pos) & 0x03); // align it
297.1876 + pos += (n * 4);
297.1877 + return pos - pc;
297.1878 + }
297.1879 + public int u1At(int pos) {
297.1880 + return (codeBase[pc+pos] & 0xFF);
297.1881 + }
297.1882 + public int u2At(int pos) {
297.1883 + return (u1At(pos+0)<<8) + u1At(pos+1);
297.1884 + }
297.1885 + public int u4At(int pos) {
297.1886 + return (u2At(pos+0)<<16) + u2At(pos+2);
297.1887 + }
297.1888 + public void u1AtPut(int pos, int x) {
297.1889 + codeBase[pc+pos] = (byte)x;
297.1890 + }
297.1891 + public void u2AtPut(int pos, int x) {
297.1892 + codeBase[pc+pos+0] = (byte)(x >> 8);
297.1893 + codeBase[pc+pos+1] = (byte)(x >> 0);
297.1894 + }
297.1895 + }
297.1896 +
297.1897 + static String simplifyType(String type) {
297.1898 + String simpleType = OBJ_SIGNATURE.matcher(type).replaceAll("L");
297.1899 + assert(simpleType.matches("^\\([A-Z]*\\)[A-Z]$"));
297.1900 + // change (DD)D to (D_D_)D_
297.1901 + simpleType = WIDE_SIGNATURE.matcher(simpleType).replaceAll("\\0_");
297.1902 + return simpleType;
297.1903 + }
297.1904 + static int argsize(String type) {
297.1905 + return simplifyType(type).length()-3;
297.1906 + }
297.1907 + private static final Pattern OBJ_SIGNATURE = Pattern.compile("\\[*L[^;]*;|\\[+[A-Z]");
297.1908 + private static final Pattern WIDE_SIGNATURE = Pattern.compile("[JD]");
297.1909 +}
298.1 --- a/test/java/net/URI/Test.java Tue Mar 29 11:29:01 2011 -0700
298.2 +++ b/test/java/net/URI/Test.java Tue Mar 29 20:19:55 2011 -0700
298.3 @@ -23,7 +23,7 @@
298.4
298.5 /* @test
298.6 * @summary Unit test for java.net.URI
298.7 - * @bug 4464135 4505046 4503239 4438319 4991359 4866303
298.8 + * @bug 4464135 4505046 4503239 4438319 4991359 4866303 7023363
298.9 * @author Mark Reinhold
298.10 */
298.11
298.12 @@ -1050,6 +1050,13 @@
298.13 test("http://1.2.3.4.5").psa().x().z();
298.14 test("http://[1.2.3.4:5]").x().z();
298.15 test("http://1:2:3:4:5:6:7:8").psa().x().z();
298.16 + test("http://[1.2.3.4]/").x().z();
298.17 + test("http://[1.2.3.4/").x().z();
298.18 + test("http://[foo]/").x().z();
298.19 + test("http://[foo/").x().z();
298.20 + test("s", "[foo]", "/", null, null).x().z();
298.21 + test("s", "[foo", "/", null, null).x().z();
298.22 + test("s", "[::foo", "/", null, null).x().z();
298.23
298.24 // Test hostnames that might initially look like IPv4 addresses
298.25
299.1 --- a/test/java/net/URLConnection/GetXmlContentType.java Tue Mar 29 11:29:01 2011 -0700
299.2 +++ b/test/java/net/URLConnection/GetXmlContentType.java Tue Mar 29 20:19:55 2011 -0700
299.3 @@ -1,5 +1,5 @@
299.4 /*
299.5 - * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
299.6 + * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
299.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
299.8 *
299.9 * This code is free software; you can redistribute it and/or modify it
299.10 @@ -23,8 +23,8 @@
299.11
299.12 /*
299.13 * @test
299.14 - * @bug 4160195
299.15 - * @summary Check for correct detection of XML content type
299.16 + * @bug 4160195 7026346
299.17 + * @summary Check for correct detection of XML content type, including BOM streams
299.18 */
299.19
299.20 import java.io.*;
299.21 @@ -34,6 +34,8 @@
299.22 public class GetXmlContentType {
299.23
299.24 static final String XML_MIME_TYPE = "application/xml";
299.25 + static final String XML_HEADER = "<?xml";
299.26 + static int passed, failed;
299.27
299.28 // guess type from content and filename
299.29 static final String goodFiles [] = {
299.30 @@ -50,52 +52,91 @@
299.31 };
299.32
299.33 public static void main(String[] args) throws Exception {
299.34 - boolean sawError = false;
299.35 + contentTypeFromFile();
299.36 + contentTypeFromBOMStream();
299.37
299.38 - //
299.39 + if (failed > 0)
299.40 + throw new RuntimeException (
299.41 + "Test failed; passed = " + passed + ", failed = " + failed);
299.42 + }
299.43 +
299.44 + static void contentTypeFromFile() throws Exception {
299.45 // POSITIVE tests: good data --> good result
299.46 - //
299.47 - for (int i = 0; i < goodFiles.length; i++) {
299.48 - String result = getUrlContentType (goodFiles [i]);
299.49
299.50 - if (!XML_MIME_TYPE.equals (result)) {
299.51 - System.out.println ("Wrong MIME type: "
299.52 - + goodFiles [i]
299.53 - + " --> " + result
299.54 - );
299.55 - sawError = true;
299.56 + for (String goodFile : goodFiles) {
299.57 + String result = getUrlContentType(goodFile);
299.58 +
299.59 + if (!XML_MIME_TYPE.equals(result)) {
299.60 + System.out.println("Wrong MIME type: " + goodFile + " --> " + result);
299.61 + failed++;
299.62 + } else {
299.63 + passed++;
299.64 }
299.65 }
299.66
299.67 - //
299.68 // NEGATIVE tests: bad data --> correct diagnostic
299.69 - //
299.70 - for (int i = 0; i < badFiles.length; i++) {
299.71 - String result = getUrlContentType (badFiles [i]);
299.72 + for (String badFile : badFiles) {
299.73 + String result = getUrlContentType(badFile);
299.74
299.75 - if (XML_MIME_TYPE.equals (result)) {
299.76 - System.out.println ("Wrong MIME type: "
299.77 - + badFiles [i]
299.78 - + " --> " + result
299.79 - );
299.80 - sawError = true;
299.81 + if (XML_MIME_TYPE.equals(result)) {
299.82 + System.out.println("Wrong MIME type: " + badFile + " --> " + result);
299.83 + failed++;
299.84 + } else {
299.85 + passed++;
299.86 }
299.87 }
299.88 -
299.89 - if (sawError)
299.90 - throw new Exception (
299.91 - "GetXmlContentType Test failed; see diagnostics.");
299.92 }
299.93
299.94 - static String getUrlContentType (String name) throws IOException {
299.95 - File file = new File(System.getProperty("test.src", "."), "xml");
299.96 - URL u = new URL ("file:"
299.97 - + file.getCanonicalPath()
299.98 - + file.separator
299.99 - + name);
299.100 - URLConnection conn = u.openConnection ();
299.101 + static String getUrlContentType(String name) throws IOException {
299.102 + File file = new File(System.getProperty("test.src", "."), "xml");
299.103 + URL u = new URL("file:"
299.104 + + file.getCanonicalPath()
299.105 + + file.separator
299.106 + + name);
299.107 + URLConnection conn = u.openConnection();
299.108
299.109 - return conn.getContentType ();
299.110 + return conn.getContentType();
299.111 }
299.112
299.113 + static void contentTypeFromBOMStream() throws Exception {
299.114 + final String[] encodings = new String[]
299.115 + {"UTF-8", "UTF-16BE", "UTF-16LE", "UTF-32BE", "UTF-32LE"};
299.116 + for (String encoding : encodings) {
299.117 + try (InputStream is = new ByteArrayInputStream(toBOMBytes(encoding))) {
299.118 + String mime = URLConnection.guessContentTypeFromStream(is);
299.119 + if ( !XML_MIME_TYPE.equals(mime) ) {
299.120 + System.out.println("Wrong MIME type: " + encoding + " --> " + mime);
299.121 + failed++;
299.122 + } else {
299.123 + passed++;
299.124 + }
299.125 + }
299.126 + }
299.127 + }
299.128 +
299.129 + static byte[] toBOMBytes(String encoding) throws Exception {
299.130 + ByteArrayOutputStream bos = new ByteArrayOutputStream();
299.131 +
299.132 + switch (encoding) {
299.133 + case "UTF-8" :
299.134 + bos.write(new byte[] { (byte) 0xEF, (byte) 0xBB, (byte) 0xBF });
299.135 + break;
299.136 + case "UTF-16BE" :
299.137 + bos.write(new byte[] { (byte) 0xFE, (byte) 0xFF });
299.138 + break;
299.139 + case "UTF-16LE" :
299.140 + bos.write(new byte[] { (byte) 0xFF, (byte) 0xFE });
299.141 + break;
299.142 + case "UTF-32BE" :
299.143 + bos.write(new byte[] { (byte) 0x00, (byte) 0x00,
299.144 + (byte) 0xFE, (byte) 0xFF });
299.145 + break;
299.146 + case "UTF-32LE" :
299.147 + bos.write(new byte[] { (byte) 0xFF, (byte) 0xFE,
299.148 + (byte) 0x00, (byte) 0x00 });
299.149 + }
299.150 +
299.151 + bos.write(XML_HEADER.getBytes(encoding));
299.152 + return bos.toByteArray();
299.153 + }
299.154 }
300.1 --- a/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java Tue Mar 29 11:29:01 2011 -0700
300.2 +++ b/test/java/nio/channels/DatagramChannel/MulticastSendReceiveTests.java Tue Mar 29 20:19:55 2011 -0700
300.3 @@ -22,7 +22,7 @@
300.4 */
300.5
300.6 /* @test
300.7 - * @bug 4527345
300.8 + * @bug 4527345 7026376
300.9 * @summary Unit test for DatagramChannel's multicast support
300.10 * @build MulticastSendReceiveTests NetworkConfiguration
300.11 * @run main MulticastSendReceiveTests
300.12 @@ -31,12 +31,19 @@
300.13 import java.nio.ByteBuffer;
300.14 import java.nio.channels.*;
300.15 import java.net.*;
300.16 +import static java.net.StandardProtocolFamily.*;
300.17 import java.util.*;
300.18 import java.io.IOException;
300.19
300.20 public class MulticastSendReceiveTests {
300.21
300.22 - static Random rand = new Random();
300.23 + static final Random rand = new Random();
300.24 +
300.25 + static final ProtocolFamily UNSPEC = new ProtocolFamily() {
300.26 + public String name() {
300.27 + return "UNSPEC";
300.28 + }
300.29 + };
300.30
300.31 /**
300.32 * Send datagram from given local address to given multicast
300.33 @@ -130,75 +137,84 @@
300.34 /**
300.35 * Exercise multicast send/receive on given group/interface
300.36 */
300.37 - static void test(NetworkInterface nif, InetAddress group, InetAddress source)
300.38 + static void test(ProtocolFamily family,
300.39 + NetworkInterface nif,
300.40 + InetAddress group,
300.41 + InetAddress source)
300.42 throws IOException
300.43 {
300.44 - ProtocolFamily family = (group instanceof Inet6Address) ?
300.45 - StandardProtocolFamily.INET6 : StandardProtocolFamily.INET;
300.46 - System.out.format("create channel to %s socket\n", family.name());
300.47 - DatagramChannel dc = DatagramChannel.open(family)
300.48 - .setOption(StandardSocketOption.SO_REUSEADDR, true)
300.49 - .bind(new InetSocketAddress(0));
300.50 + System.out.format("\nTest DatagramChannel to %s socket\n", family.name());
300.51 + try (DatagramChannel dc = (family == UNSPEC) ?
300.52 + DatagramChannel.open() : DatagramChannel.open(family)) {
300.53 + dc.setOption(StandardSocketOption.SO_REUSEADDR, true)
300.54 + .bind(new InetSocketAddress(0));
300.55
300.56 - // join group
300.57 - System.out.format("join %s @ %s\n", group.getHostAddress(),
300.58 - nif.getName());
300.59 - MembershipKey key = dc.join(group, nif);
300.60 + // join group
300.61 + System.out.format("join %s @ %s\n", group.getHostAddress(),
300.62 + nif.getName());
300.63 + MembershipKey key;
300.64 + try {
300.65 + key = dc.join(group, nif);
300.66 + } catch (IllegalArgumentException iae) {
300.67 + if (family == UNSPEC) {
300.68 + System.out.println("Not supported");
300.69 + return;
300.70 + }
300.71 + throw iae;
300.72 + }
300.73
300.74 - // send message to group
300.75 - int port = ((InetSocketAddress)dc.getLocalAddress()).getPort();
300.76 - int id = sendDatagram(source, nif, group, port);
300.77 + // send message to group
300.78 + int port = ((InetSocketAddress)dc.getLocalAddress()).getPort();
300.79 + int id = sendDatagram(source, nif, group, port);
300.80
300.81 - // receive message and check id matches
300.82 - receiveDatagram(dc, source, id);
300.83 + // receive message and check id matches
300.84 + receiveDatagram(dc, source, id);
300.85
300.86 - // exclude-mode filtering
300.87 + // exclude-mode filtering
300.88
300.89 - try {
300.90 - System.out.format("block %s\n", source.getHostAddress());
300.91 + try {
300.92 + System.out.format("block %s\n", source.getHostAddress());
300.93
300.94 - // may throw UOE
300.95 - key.block(source);
300.96 - id = sendDatagram(source, nif, group, port);
300.97 - receiveDatagram(dc, null, id);
300.98 + // may throw UOE
300.99 + key.block(source);
300.100 + id = sendDatagram(source, nif, group, port);
300.101 + receiveDatagram(dc, null, id);
300.102
300.103 - // unblock source, send message, message should be received
300.104 - System.out.format("unblock %s\n", source.getHostAddress());
300.105 - key.unblock(source);
300.106 - id = sendDatagram(source, nif, group, port);
300.107 - receiveDatagram(dc, source, id);
300.108 - } catch (UnsupportedOperationException x) {
300.109 - System.out.println("Exclude-mode filtering not supported!");
300.110 + // unblock source, send message, message should be received
300.111 + System.out.format("unblock %s\n", source.getHostAddress());
300.112 + key.unblock(source);
300.113 + id = sendDatagram(source, nif, group, port);
300.114 + receiveDatagram(dc, source, id);
300.115 + } catch (UnsupportedOperationException x) {
300.116 + System.out.println("Exclude-mode filtering not supported!");
300.117 + }
300.118 +
300.119 + key.drop();
300.120 +
300.121 + // include-mode filtering
300.122 +
300.123 + InetAddress bogus = (group instanceof Inet6Address) ?
300.124 + InetAddress.getByName("fe80::1234") :
300.125 + InetAddress.getByName("1.2.3.4");
300.126 + System.out.format("join %s @ %s only-source %s\n", group.getHostAddress(),
300.127 + nif.getName(), bogus.getHostAddress());
300.128 + try {
300.129 + // may throw UOE
300.130 + key = dc.join(group, nif, bogus);
300.131 +
300.132 + id = sendDatagram(source, nif, group, port);
300.133 + receiveDatagram(dc, null, id);
300.134 +
300.135 + System.out.format("join %s @ %s only-source %s\n", group.getHostAddress(),
300.136 + nif.getName(), source.getHostAddress());
300.137 + key = dc.join(group, nif, source);
300.138 +
300.139 + id = sendDatagram(source, nif, group, port);
300.140 + receiveDatagram(dc, source, id);
300.141 + } catch (UnsupportedOperationException x) {
300.142 + System.out.println("Include-mode filtering not supported!");
300.143 + }
300.144 }
300.145 -
300.146 - key.drop();
300.147 -
300.148 - // include-mode filtering
300.149 -
300.150 - InetAddress bogus = (group instanceof Inet6Address) ?
300.151 - InetAddress.getByName("fe80::1234") :
300.152 - InetAddress.getByName("1.2.3.4");
300.153 - System.out.format("join %s @ %s only-source %s\n", group.getHostAddress(),
300.154 - nif.getName(), bogus.getHostAddress());
300.155 - try {
300.156 - // may throw UOE
300.157 - key = dc.join(group, nif, bogus);
300.158 -
300.159 - id = sendDatagram(source, nif, group, port);
300.160 - receiveDatagram(dc, null, id);
300.161 -
300.162 - System.out.format("join %s @ %s only-source %s\n", group.getHostAddress(),
300.163 - nif.getName(), source.getHostAddress());
300.164 - key = dc.join(group, nif, source);
300.165 -
300.166 - id = sendDatagram(source, nif, group, port);
300.167 - receiveDatagram(dc, source, id);
300.168 - } catch (UnsupportedOperationException x) {
300.169 - System.out.println("Include-mode filtering not supported!");
300.170 - }
300.171 -
300.172 - // done
300.173 - dc.close();
300.174 }
300.175
300.176 public static void main(String[] args) throws IOException {
300.177 @@ -210,12 +226,14 @@
300.178
300.179 for (NetworkInterface nif: config.ip4Interfaces()) {
300.180 InetAddress source = config.ip4Addresses(nif).iterator().next();
300.181 - test(nif, ip4Group, source);
300.182 + test(INET, nif, ip4Group, source);
300.183 + test(UNSPEC, nif, ip4Group, source);
300.184 }
300.185
300.186 for (NetworkInterface nif: config.ip6Interfaces()) {
300.187 InetAddress source = config.ip6Addresses(nif).iterator().next();
300.188 - test(nif, ip6Group, source);
300.189 + test(INET6, nif, ip6Group, source);
300.190 + test(UNSPEC, nif, ip6Group, source);
300.191 }
300.192 }
300.193 }
301.1 --- a/test/java/nio/file/Files/FileAttributes.java Tue Mar 29 11:29:01 2011 -0700
301.2 +++ b/test/java/nio/file/Files/FileAttributes.java Tue Mar 29 20:19:55 2011 -0700
301.3 @@ -22,7 +22,7 @@
301.4 */
301.5
301.6 /* @test
301.7 - * @bug 4313887 6838333
301.8 + * @bug 4313887 6838333 7017446
301.9 * @summary Unit test for java.nio.file.Files
301.10 * @library ..
301.11 */
301.12 @@ -94,12 +94,6 @@
301.13 assertTrue(map.size() == 2);
301.14 checkEqual(attrs.size(), map.get("size"));
301.15 checkEqual(attrs.lastModifiedTime(), map.get("lastModifiedTime"));
301.16 -
301.17 - map = Files.readAttributes(file,
301.18 - "basic:lastModifiedTime,lastAccessTime,ShouldNotExist");
301.19 - assertTrue(map.size() == 2);
301.20 - checkEqual(attrs.lastModifiedTime(), map.get("lastModifiedTime"));
301.21 - checkEqual(attrs.lastAccessTime(), map.get("lastAccessTime"));
301.22 }
301.23
301.24 // Exercise getAttribute/setAttribute/readAttributes on posix attributes
301.25 @@ -132,7 +126,7 @@
301.26 assertTrue(map.size() >= 12);
301.27 checkEqual(attrs.permissions(), map.get("permissions")); // check one
301.28
301.29 - map = Files.readAttributes(file, "posix:size,owner,ShouldNotExist");
301.30 + map = Files.readAttributes(file, "posix:size,owner");
301.31 assertTrue(map.size() == 2);
301.32 checkEqual(attrs.size(), map.get("size"));
301.33 checkEqual(attrs.owner(), map.get("owner"));
301.34 @@ -155,7 +149,7 @@
301.35 map = Files.readAttributes(file, "unix:*");
301.36 assertTrue(map.size() >= 20);
301.37
301.38 - map = Files.readAttributes(file, "unix:size,uid,gid,ShouldNotExist");
301.39 + map = Files.readAttributes(file, "unix:size,uid,gid");
301.40 assertTrue(map.size() == 3);
301.41 checkEqual(map.get("size"),
301.42 Files.readAttributes(file, BasicFileAttributes.class).size());
301.43 @@ -206,14 +200,65 @@
301.44 assertTrue(map.size() >= 13);
301.45 checkEqual(attrs.isReadOnly(), map.get("readonly")); // check one
301.46
301.47 - map = Files.readAttributes(file, "dos:size,hidden,ShouldNotExist");
301.48 + map = Files.readAttributes(file, "dos:size,hidden");
301.49 assertTrue(map.size() == 2);
301.50 checkEqual(attrs.size(), map.get("size"));
301.51 checkEqual(attrs.isHidden(), map.get("hidden"));
301.52 }
301.53
301.54 + static void checkBadSet(Path file, String attribute, Object value)
301.55 + throws IOException
301.56 + {
301.57 + try {
301.58 + Files.setAttribute(file, attribute, 0);
301.59 + throw new RuntimeException("IllegalArgumentException expected");
301.60 + } catch (IllegalArgumentException ignore) { }
301.61 + }
301.62 +
301.63 + static void checkBadGet(Path file, String attribute) throws IOException {
301.64 + try {
301.65 + Files.getAttribute(file, attribute);
301.66 + throw new RuntimeException("IllegalArgumentException expected");
301.67 + } catch (IllegalArgumentException ignore) { }
301.68 + }
301.69 +
301.70 + static void checkBadRead(Path file, String attribute) throws IOException {
301.71 + try {
301.72 + Files.readAttributes(file, attribute);
301.73 + throw new RuntimeException("IllegalArgumentException expected");
301.74 + } catch (IllegalArgumentException ignore) { }
301.75 + }
301.76 +
301.77 static void miscTests(Path file) throws IOException {
301.78 - // NPE tests
301.79 + // unsupported views
301.80 + try {
301.81 + Files.setAttribute(file, "foo:bar", 0);
301.82 + throw new RuntimeException("UnsupportedOperationException expected");
301.83 + } catch (UnsupportedOperationException ignore) { }
301.84 + try {
301.85 + Files.getAttribute(file, "foo:bar");
301.86 + throw new RuntimeException("UnsupportedOperationException expected");
301.87 + } catch (UnsupportedOperationException ignore) { }
301.88 + try {
301.89 + Files.readAttributes(file, "foo:*");
301.90 + throw new RuntimeException("UnsupportedOperationException expected");
301.91 + } catch (UnsupportedOperationException ignore) { }
301.92 +
301.93 + // bad args
301.94 + checkBadSet(file, "", 0);
301.95 + checkBadSet(file, "basic:", 0);
301.96 + checkBadSet(file, "basic:foobar", 0);
301.97 + checkBadGet(file, "");
301.98 + checkBadGet(file, "basic:");
301.99 + checkBadGet(file, "basic:foobar");
301.100 + checkBadGet(file, "basic:size,lastModifiedTime");
301.101 + checkBadGet(file, "basic:*");
301.102 + checkBadRead(file, "");
301.103 + checkBadRead(file, "basic:");
301.104 + checkBadRead(file, "basic:foobar");
301.105 + checkBadRead(file, "basic:size,foobar");
301.106 +
301.107 + // nulls
301.108 try {
301.109 Files.getAttribute(file, null);
301.110 throw new RuntimeException("NullPointerException expected");
302.1 --- a/test/java/nio/file/WatchService/Basic.java Tue Mar 29 11:29:01 2011 -0700
302.2 +++ b/test/java/nio/file/WatchService/Basic.java Tue Mar 29 20:19:55 2011 -0700
302.3 @@ -22,7 +22,7 @@
302.4 */
302.5
302.6 /* @test
302.7 - * @bug 4313887 6838333
302.8 + * @bug 4313887 6838333 7017446
302.9 * @summary Unit test for java.nio.file.WatchService
302.10 * @library ..
302.11 * @run main/timeout=120 Basic
302.12 @@ -44,6 +44,8 @@
302.13 static void checkKey(WatchKey key, Path dir) {
302.14 if (!key.isValid())
302.15 throw new RuntimeException("Key is not valid");
302.16 + if (key.watchable() != dir)
302.17 + throw new RuntimeException("Unexpected watchable");
302.18 }
302.19
302.20 static void takeExpectedKey(WatchService watcher, WatchKey expected) {
303.1 --- a/test/java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java Tue Mar 29 11:29:01 2011 -0700
303.2 +++ b/test/java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java Tue Mar 29 20:19:55 2011 -0700
303.3 @@ -141,9 +141,6 @@
303.4 map = Files.readAttributes(file, "user:*");
303.5 if (!Arrays.equals(valueAsBytes, (byte[])map.get(ATTR_NAME)))
303.6 throw new RuntimeException("Unexpected attribute value");
303.7 - map = Files.readAttributes(file, "user:DoesNotExist");
303.8 - if (!map.isEmpty())
303.9 - throw new RuntimeException("Map expected to be empty");
303.10 }
303.11
303.12 static void miscTests(final Path file) throws IOException {
304.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
304.2 +++ b/test/java/util/EnumSet/LargeEnumIteratorRemoveResilience.java Tue Mar 29 20:19:55 2011 -0700
304.3 @@ -0,0 +1,96 @@
304.4 +/*
304.5 + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
304.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
304.7 + *
304.8 + * This code is free software; you can redistribute it and/or modify it
304.9 + * under the terms of the GNU General Public License version 2 only, as
304.10 + * published by the Free Software Foundation.
304.11 + *
304.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
304.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
304.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
304.15 + * version 2 for more details (a copy is included in the LICENSE file that
304.16 + * accompanied this code).
304.17 + *
304.18 + * You should have received a copy of the GNU General Public License version
304.19 + * 2 along with this work; if not, write to the Free Software Foundation,
304.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
304.21 + *
304.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
304.23 + * or visit www.oracle.com if you need additional information or have any
304.24 + * questions.
304.25 + */
304.26 +
304.27 +/*
304.28 + * Portions Copyright (c) 2011 IBM Corporation
304.29 + */
304.30 +
304.31 +/*
304.32 + * @test
304.33 + * @bug 7014637
304.34 + * @summary EnumSet's iterator.remove() can be resilient to set's modification.
304.35 + * @author Neil Richards <neil.richards@ngmr.net>, <neil_richards@uk.ibm.com>
304.36 + */
304.37 +
304.38 +import java.util.EnumSet;
304.39 +import java.util.Iterator;
304.40 +import java.util.Set;
304.41 +
304.42 +public class LargeEnumIteratorRemoveResilience {
304.43 + // enum with more than 64 values
304.44 + private static enum LargeEnum {
304.45 + e00, e01, e02, e03, e04, e05, e06, e07,
304.46 + e08, e09, e0A, e0B, e0C, e0D, e0E, e0F,
304.47 + e10, e11, e12, e13, e14, e15, e16, e17,
304.48 + e18, e19, e1A, e1B, e1C, e1D, e1E, e1F,
304.49 + e20, e21, e22, e23, e24, e25, e26, e27,
304.50 + e28, e29, e2A, e2B, e2C, e2D, e2E, e2F,
304.51 + e30, e31, e32, e33, e34, e35, e36, e37,
304.52 + e38, e39, e3A, e3B, e3C, e3D, e3E, e3F,
304.53 + e40, e41, e42, e43, e44, e45, e46, e47,
304.54 + e48, e49, e4A, e4B, e4C, e4D, e4E, e4F,
304.55 + }
304.56 +
304.57 + public static void main(final String[] args) throws Exception {
304.58 + final Set<LargeEnum> set = EnumSet.noneOf(LargeEnum.class);
304.59 +
304.60 + set.add(LargeEnum.e2D);
304.61 + set.add(LargeEnum.e42);
304.62 +
304.63 + final Iterator<LargeEnum> iterator = set.iterator();
304.64 +
304.65 + int size = set.size();
304.66 + LargeEnum element = iterator.next();
304.67 +
304.68 + iterator.remove();
304.69 + checkSetAfterRemoval(set, size, element);
304.70 +
304.71 + size = set.size();
304.72 + element = iterator.next();
304.73 +
304.74 + set.remove(element);
304.75 + checkSetAfterRemoval(set, size, element);
304.76 +
304.77 + // The Java API declares that the behaviour here - to call
304.78 + // iterator.remove() after the underlying collection has been
304.79 + // modified - is "unspecified".
304.80 + // However, in the case of iterators for EnumSet, it is easy to
304.81 + // implement their remove() operation such that the set is
304.82 + // unmodified if it is called for an element that has already been
304.83 + // removed from the set - this being the naturally "resilient"
304.84 + // behaviour.
304.85 + iterator.remove();
304.86 + checkSetAfterRemoval(set, size, element);
304.87 + }
304.88 +
304.89 + private static void checkSetAfterRemoval(final Set<LargeEnum> set,
304.90 + final int origSize, final LargeEnum removedElement)
304.91 + throws Exception {
304.92 + if (set.size() != (origSize - 1)) {
304.93 + throw new Exception("Test FAILED: Unexpected set size after removal; expected '" + (origSize - 1) + "' but found '" + set.size() + "'");
304.94 + }
304.95 + if (set.contains(removedElement)) {
304.96 + throw new Exception("Test FAILED: Element returned from iterator unexpectedly still in set after removal.");
304.97 + }
304.98 + }
304.99 +}
305.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
305.2 +++ b/test/java/util/EnumSet/SmallEnumIteratorRemoveResilience.java Tue Mar 29 20:19:55 2011 -0700
305.3 @@ -0,0 +1,85 @@
305.4 +/*
305.5 + * Copyright (c) 2011 Oracle and/or its affiliates. All rights reserved.
305.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
305.7 + *
305.8 + * This code is free software; you can redistribute it and/or modify it
305.9 + * under the terms of the GNU General Public License version 2 only, as
305.10 + * published by the Free Software Foundation.
305.11 + *
305.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
305.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
305.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
305.15 + * version 2 for more details (a copy is included in the LICENSE file that
305.16 + * accompanied this code).
305.17 + *
305.18 + * You should have received a copy of the GNU General Public License version
305.19 + * 2 along with this work; if not, write to the Free Software Foundation,
305.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
305.21 + *
305.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
305.23 + * or visit www.oracle.com if you need additional information or have any
305.24 + * questions.
305.25 + */
305.26 +
305.27 +/*
305.28 + * Portions Copyright (c) 2011 IBM Corporation
305.29 + */
305.30 +
305.31 +/*
305.32 + * @test
305.33 + * @bug 7014637
305.34 + * @summary EnumSet's iterator.remove() can be resilient to set's modification.
305.35 + * @author Neil Richards <neil.richards@ngmr.net>, <neil_richards@uk.ibm.com>
305.36 + */
305.37 +
305.38 +import java.util.EnumSet;
305.39 +import java.util.Iterator;
305.40 +import java.util.Set;
305.41 +
305.42 +public class SmallEnumIteratorRemoveResilience {
305.43 + // enum with less than 64 values
305.44 + private static enum SmallEnum { e0, e1, e2 }
305.45 +
305.46 + public static void main(final String[] args) throws Exception {
305.47 + final Set<SmallEnum> set = EnumSet.noneOf(SmallEnum.class);
305.48 +
305.49 + set.add(SmallEnum.e0);
305.50 + set.add(SmallEnum.e1);
305.51 +
305.52 + final Iterator<SmallEnum> iterator = set.iterator();
305.53 +
305.54 + int size = set.size();
305.55 + SmallEnum element = iterator.next();
305.56 +
305.57 + iterator.remove();
305.58 + checkSetAfterRemoval(set, size, element);
305.59 +
305.60 + size = set.size();
305.61 + element = iterator.next();
305.62 +
305.63 + set.remove(element);
305.64 + checkSetAfterRemoval(set, size, element);
305.65 +
305.66 + // The Java API declares that the behaviour here - to call
305.67 + // iterator.remove() after the underlying collection has been
305.68 + // modified - is "unspecified".
305.69 + // However, in the case of iterators for EnumSet, it is easy to
305.70 + // implement their remove() operation such that the set is
305.71 + // unmodified if it is called for an element that has already been
305.72 + // removed from the set - this being the naturally "resilient"
305.73 + // behaviour.
305.74 + iterator.remove();
305.75 + checkSetAfterRemoval(set, size, element);
305.76 + }
305.77 +
305.78 + private static void checkSetAfterRemoval(final Set<SmallEnum> set,
305.79 + final int origSize, final SmallEnum removedElement)
305.80 + throws Exception {
305.81 + if (set.size() != (origSize - 1)) {
305.82 + throw new Exception("Test FAILED: Unexpected set size after removal; expected '" + (origSize - 1) + "' but found '" + set.size() + "'");
305.83 + }
305.84 + if (set.contains(removedElement)) {
305.85 + throw new Exception("Test FAILED: Element returned from iterator unexpectedly still in set after removal.");
305.86 + }
305.87 + }
305.88 +}
306.1 --- a/test/java/util/Locale/LocaleEnhanceTest.java Tue Mar 29 11:29:01 2011 -0700
306.2 +++ b/test/java/util/Locale/LocaleEnhanceTest.java Tue Mar 29 20:19:55 2011 -0700
306.3 @@ -43,7 +43,7 @@
306.4
306.5 /**
306.6 * @test
306.7 - * @bug 6875847
306.8 + * @bug 6875847 6992272 7002320 7015500 7023613
306.9 * @summary test API changes to Locale
306.10 */
306.11 public class LocaleEnhanceTest extends LocaleTestFmwk {
306.12 @@ -83,7 +83,7 @@
306.13 "en-Latn-US-NewYork", "en_US_NewYork_#Latn",
306.14 "en-Latn-US", "en_US_#Latn",
306.15 "en-Latn-NewYork", "en__NewYork_#Latn", // double underscore
306.16 - "en-Latn", "en_#Latn",
306.17 + "en-Latn", "en__#Latn", // double underscore
306.18 "en-US-NewYork", "en_US_NewYork",
306.19 "en-US", "en_US",
306.20 "en-NewYork", "en__NewYork", // double underscore
306.21 @@ -1259,6 +1259,22 @@
306.22 }
306.23 }
306.24
306.25 + public void testBug7023613() {
306.26 + String[][] testdata = {
306.27 + {"en-Latn", "en__#Latn"},
306.28 + {"en-u-ca-japanese", "en__#u-ca-japanese"},
306.29 + };
306.30 +
306.31 + for (String[] data : testdata) {
306.32 + String in = data[0];
306.33 + String expected = (data.length == 1) ? data[0] : data[1];
306.34 +
306.35 + Locale loc = Locale.forLanguageTag(in);
306.36 + String out = loc.toString();
306.37 + assertEquals("Empty country field with non-empty script/extension with input: " + in, expected, out);
306.38 + }
306.39 + }
306.40 +
306.41 ///
306.42 /// utility asserts
306.43 ///
307.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
307.2 +++ b/test/java/util/TreeMap/EmptyMapAndNulls.java Tue Mar 29 20:19:55 2011 -0700
307.3 @@ -0,0 +1,120 @@
307.4 +/*
307.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
307.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
307.7 + *
307.8 + * This code is free software; you can redistribute it and/or modify it
307.9 + * under the terms of the GNU General Public License version 2 only, as
307.10 + * published by the Free Software Foundation.
307.11 + *
307.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
307.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
307.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
307.15 + * version 2 for more details (a copy is included in the LICENSE file that
307.16 + * accompanied this code).
307.17 + *
307.18 + * You should have received a copy of the GNU General Public License version
307.19 + * 2 along with this work; if not, write to the Free Software Foundation,
307.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
307.21 + *
307.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
307.23 + * or visit www.oracle.com if you need additional information or have any
307.24 + * questions.
307.25 + */
307.26 +
307.27 +/*
307.28 + * @test
307.29 + * @bug 5045147
307.30 + * @summary Test handling of null with empty Map
307.31 + * @author Mike Duigou
307.32 + */
307.33 +
307.34 +import java.util.*;
307.35 +import java.util.concurrent.*;
307.36 +import java.util.concurrent.atomic.*;
307.37 +import java.lang.reflect.*;
307.38 +
307.39 +public class EmptyMapAndNulls {
307.40 +
307.41 + @SuppressWarnings("rawtypes")
307.42 + static void realMain(String[] args) throws Throwable {
307.43 + // No comparator
307.44 + Map<String,String> comparable = new TreeMap<>();
307.45 +
307.46 + // insert null into empty map (5045147 failure)
307.47 + try {
307.48 + comparable.put(null, "anything");
307.49 + fail("null shouldn't be accepted");
307.50 + } catch (NullPointerException failed) {
307.51 + pass();
307.52 + }
307.53 +
307.54 + // insert non-null into empty map
307.55 + try {
307.56 + comparable.put("test", "anything");
307.57 + pass();
307.58 + } catch (NullPointerException failed) {
307.59 + fail();
307.60 + }
307.61 +
307.62 + // insert null into non-empty map
307.63 + try {
307.64 + comparable.put(null, "anything");
307.65 + fail("null shouldn't be accepted");
307.66 + } catch (NullPointerException failed) {
307.67 + pass();
307.68 + }
307.69 +
307.70 + // Comparator (String.CASE_INSENSITIVE_ORDER). Intentionally a raw type.
307.71 + Map comparator = new TreeMap(String.CASE_INSENSITIVE_ORDER);
307.72 +
307.73 + // insert null into empty map (5045147 failure)
307.74 + try {
307.75 + comparator.put(null, "anything");
307.76 + fail("null shouldn't be accepted");
307.77 + } catch (NullPointerException failed) {
307.78 + pass();
307.79 + }
307.80 +
307.81 + // insert non-null into empty map
307.82 + try {
307.83 + comparator.put("test", "anything");
307.84 + pass();
307.85 + } catch (NullPointerException failed) {
307.86 + fail();
307.87 + }
307.88 +
307.89 + // insert null into non-empty map
307.90 + try {
307.91 + comparator.put(null, "anything");
307.92 + fail("null shouldn't be accepted");
307.93 + } catch (NullPointerException failed) {
307.94 + pass();
307.95 + }
307.96 +
307.97 + comparator.clear();
307.98 +
307.99 + // insert non-String into empty map (5045147 failure)
307.100 + try {
307.101 + comparator.put(new Object(), "anything");
307.102 + fail("Object shouldn't be accepted");
307.103 + } catch (ClassCastException failed) {
307.104 + pass();
307.105 + }
307.106 +
307.107 + }
307.108 +
307.109 + //--------------------- Infrastructure ---------------------------
307.110 + static volatile int passed = 0, failed = 0;
307.111 + static void pass() {passed++;}
307.112 + static void fail() {failed++; Thread.dumpStack();}
307.113 + static void fail(String msg) {System.out.println(msg); fail();}
307.114 + static void unexpected(Throwable t) {failed++; t.printStackTrace();}
307.115 + static void check(boolean cond) {if (cond) pass(); else fail();}
307.116 + static void equal(Object x, Object y) {
307.117 + if (x == null ? y == null : x.equals(y)) pass();
307.118 + else fail(x + " not equal to " + y);}
307.119 + public static void main(String[] args) throws Throwable {
307.120 + try {realMain(args);} catch (Throwable t) {unexpected(t);}
307.121 + System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
307.122 + if (failed > 0) throw new AssertionError("Some tests failed");}
307.123 +}
308.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
308.2 +++ b/test/javax/script/GetInterfaceTest.java Tue Mar 29 20:19:55 2011 -0700
308.3 @@ -0,0 +1,77 @@
308.4 +/*
308.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
308.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
308.7 + *
308.8 + * This code is free software; you can redistribute it and/or modify it
308.9 + * under the terms of the GNU General Public License version 2 only, as
308.10 + * published by the Free Software Foundation.
308.11 + *
308.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
308.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
308.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
308.15 + * version 2 for more details (a copy is included in the LICENSE file that
308.16 + * accompanied this code).
308.17 + *
308.18 + * You should have received a copy of the GNU General Public License version
308.19 + * 2 along with this work; if not, write to the Free Software Foundation,
308.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
308.21 + *
308.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
308.23 + * or visit www.oracle.com if you need additional information or have any
308.24 + * questions.
308.25 + */
308.26 +
308.27 +/*
308.28 + * @test
308.29 + * @bug 6960211
308.30 + * @summary JavaScript engine allows creation of interface although methods not available.
308.31 + */
308.32 +
308.33 +import javax.script.*;
308.34 +
308.35 +public class GetInterfaceTest {
308.36 + public static void main(String[] args) throws Exception {
308.37 + ScriptEngineManager manager = new ScriptEngineManager();
308.38 + ScriptEngine engine = manager.getEngineByName("js");
308.39 +
308.40 + if (engine == null) {
308.41 + System.out.println("Warning: No engine engine found; test vacuously passes.");
308.42 + return;
308.43 + }
308.44 +
308.45 + // don't define any function.
308.46 + engine.eval("");
308.47 +
308.48 + Runnable runnable = ((Invocable)engine).getInterface(Runnable.class);
308.49 + if (runnable != null) {
308.50 + throw new RuntimeException("runnable is not null!");
308.51 + }
308.52 +
308.53 + // now define "run"
308.54 + engine.eval("function run() { println('this is run function'); }");
308.55 + runnable = ((Invocable)engine).getInterface(Runnable.class);
308.56 + // should not return null now!
308.57 + runnable.run();
308.58 +
308.59 + // define only one method of "Foo2"
308.60 + engine.eval("function bar() { println('bar function'); }");
308.61 + Foo2 foo2 = ((Invocable)engine).getInterface(Foo2.class);
308.62 + if (foo2 != null) {
308.63 + throw new RuntimeException("foo2 is not null!");
308.64 + }
308.65 +
308.66 + // now define other method of "Foo2"
308.67 + engine.eval("function bar2() { println('bar2 function'); }");
308.68 + foo2 = ((Invocable)engine).getInterface(Foo2.class);
308.69 + foo2.bar();
308.70 + foo2.bar2();
308.71 + }
308.72 +
308.73 + interface Foo {
308.74 + public void bar();
308.75 + }
308.76 +
308.77 + interface Foo2 extends Foo {
308.78 + public void bar2();
308.79 + }
308.80 +}
309.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
309.2 +++ b/test/javax/swing/JOptionPane/6464022/bug6464022.java Tue Mar 29 20:19:55 2011 -0700
309.3 @@ -0,0 +1,83 @@
309.4 +/*
309.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
309.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
309.7 + *
309.8 + * This code is free software; you can redistribute it and/or modify it
309.9 + * under the terms of the GNU General Public License version 2 only, as
309.10 + * published by the Free Software Foundation.
309.11 + *
309.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
309.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
309.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
309.15 + * version 2 for more details (a copy is included in the LICENSE file that
309.16 + * accompanied this code).
309.17 + *
309.18 + * You should have received a copy of the GNU General Public License version
309.19 + * 2 along with this work; if not, write to the Free Software Foundation,
309.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
309.21 + *
309.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
309.23 + * or visit www.oracle.com if you need additional information or have any
309.24 + * questions.
309.25 + */
309.26 +
309.27 +/*
309.28 + * @test
309.29 + * @bug 6464022
309.30 + * @summary Memory leak in JOptionPane.createDialog
309.31 + * @author Pavel Porvatov
309.32 + * @library ../../regtesthelpers
309.33 + * @build Util
309.34 + * @run main bug6464022
309.35 + */
309.36 +
309.37 +import javax.swing.*;
309.38 +import java.lang.ref.WeakReference;
309.39 +import java.util.ArrayList;
309.40 +import java.util.List;
309.41 +
309.42 +public class bug6464022 {
309.43 + private static JOptionPane pane;
309.44 +
309.45 + public static void main(String[] args) throws Exception {
309.46 + final List<WeakReference<JDialog>> references = new ArrayList<WeakReference<JDialog>>();
309.47 +
309.48 + SwingUtilities.invokeAndWait(new Runnable() {
309.49 + public void run() {
309.50 + pane = new JOptionPane(null, JOptionPane.UNDEFINED_CONDITION);
309.51 +
309.52 + for (int i = 0; i < 10; i++) {
309.53 + JDialog dialog = pane.createDialog(null, "Test " + i);
309.54 +
309.55 + references.add(new WeakReference<JDialog>(dialog));
309.56 +
309.57 + dialog.dispose();
309.58 +
309.59 + System.out.println("Disposing Dialog:" + dialog.hashCode());
309.60 + }
309.61 + }
309.62 + });
309.63 +
309.64 + Util.generateOOME();
309.65 +
309.66 + SwingUtilities.invokeAndWait(new Runnable() {
309.67 + public void run() {
309.68 + int allocatedCount = 0;
309.69 +
309.70 + for (WeakReference<JDialog> ref : references) {
309.71 + if (ref.get() != null) {
309.72 + allocatedCount++;
309.73 +
309.74 + System.out.println(ref.get().hashCode() + " is still allocated");
309.75 + }
309.76 + }
309.77 +
309.78 + if (allocatedCount > 0) {
309.79 + throw new RuntimeException("Some dialogs still exist in memory. Test failed");
309.80 + } else {
309.81 + System.out.println("All dialogs were GCed. Test passed.");
309.82 + }
309.83 + }
309.84 + });
309.85 + }
309.86 +}
310.1 --- a/test/javax/swing/UIDefaults/6795356/bug6795356.java Tue Mar 29 11:29:01 2011 -0700
310.2 +++ b/test/javax/swing/UIDefaults/6795356/bug6795356.java Tue Mar 29 20:19:55 2011 -0700
310.3 @@ -26,6 +26,8 @@
310.4 * @bug 6795356
310.5 * @summary Leak caused by javax.swing.UIDefaults.ProxyLazyValue.acc
310.6 * @author Alexander Potochkin
310.7 + * @library ../../regtesthelpers
310.8 + * @build Util
310.9 * @run main bug6795356
310.10 */
310.11
310.12 @@ -58,43 +60,11 @@
310.13 weakRef = new WeakReference<ProtectionDomain>(domain);
310.14 domain = null;
310.15
310.16 - // Generate OutOfMemory and check the weak ref
310.17 - generateOOME();
310.18 + Util.generateOOME();
310.19
310.20 if (weakRef.get() != null) {
310.21 throw new RuntimeException("Memory leak found!");
310.22 }
310.23 System.out.println("Test passed");
310.24 }
310.25 -
310.26 - static void generateOOME() {
310.27 - List<Object> bigLeak = new LinkedList<Object>();
310.28 - boolean oome = false;
310.29 - System.out.print("Filling the heap");
310.30 - try {
310.31 - for(int i = 0; true ; i++) {
310.32 - // Now, use up all RAM
310.33 - bigLeak.add(new byte[1024 * 1024]);
310.34 - System.out.print(".");
310.35 -
310.36 - // Give the GC a change at that weakref
310.37 - if (i % 10 == 0) {
310.38 - System.gc();
310.39 - try {
310.40 - Thread.sleep(100);
310.41 - } catch (InterruptedException e) {
310.42 - e.printStackTrace();
310.43 - }
310.44 - }
310.45 - }
310.46 - } catch (OutOfMemoryError e) {
310.47 - bigLeak = null;
310.48 - oome = true;
310.49 - }
310.50 - System.out.println("");
310.51 - if (!oome) {
310.52 - throw new RuntimeException("Problem with test case - never got OOME");
310.53 - }
310.54 - System.out.println("Got OOME");
310.55 - }
310.56 }
311.1 --- a/test/javax/swing/regtesthelpers/Util.java Tue Mar 29 11:29:01 2011 -0700
311.2 +++ b/test/javax/swing/regtesthelpers/Util.java Tue Mar 29 20:19:55 2011 -0700
311.3 @@ -24,6 +24,8 @@
311.4 import javax.swing.*;
311.5 import java.awt.*;
311.6 import java.awt.image.BufferedImage;
311.7 +import java.util.LinkedList;
311.8 +import java.util.List;
311.9
311.10 /**
311.11 * <p>This class contains utilities useful for regression testing.
311.12 @@ -72,4 +74,46 @@
311.13
311.14 return true;
311.15 }
311.16 +
311.17 + /**
311.18 + * Fills the heap until OutOfMemoryError occurs. This method is useful for
311.19 + * WeakReferences removing.
311.20 + */
311.21 + public static void generateOOME() {
311.22 + List<Object> bigLeak = new LinkedList<Object>();
311.23 +
311.24 + boolean oome = false;
311.25 +
311.26 + System.out.print("Filling the heap");
311.27 +
311.28 + try {
311.29 + for(int i = 0; true ; i++) {
311.30 + // Now, use up all RAM
311.31 + bigLeak.add(new byte[1024 * 1024]);
311.32 +
311.33 + System.out.print(".");
311.34 +
311.35 + // Give the GC a change at that weakref
311.36 + if (i % 10 == 0) {
311.37 + System.gc();
311.38 + try {
311.39 + Thread.sleep(100);
311.40 + } catch (InterruptedException e) {
311.41 + e.printStackTrace();
311.42 + }
311.43 + }
311.44 + }
311.45 + } catch (OutOfMemoryError e) {
311.46 + bigLeak = null;
311.47 + oome = true;
311.48 + }
311.49 +
311.50 + System.out.println("");
311.51 +
311.52 + if (!oome) {
311.53 + throw new RuntimeException("Problem with test case - never got OOME");
311.54 + }
311.55 +
311.56 + System.out.println("Got OOME");
311.57 + }
311.58 }
312.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
312.2 +++ b/test/sun/java2d/pipe/Test7027667.java Tue Mar 29 20:19:55 2011 -0700
312.3 @@ -0,0 +1,49 @@
312.4 +/*
312.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
312.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
312.7 + *
312.8 + * This code is free software; you can redistribute it and/or modify it
312.9 + * under the terms of the GNU General Public License version 2 only, as
312.10 + * published by the Free Software Foundation.
312.11 + *
312.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
312.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
312.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
312.15 + * version 2 for more details (a copy is included in the LICENSE file that
312.16 + * accompanied this code).
312.17 + *
312.18 + * You should have received a copy of the GNU General Public License version
312.19 + * 2 along with this work; if not, write to the Free Software Foundation,
312.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
312.21 + *
312.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
312.23 + * or visit www.oracle.com if you need additional information or have any
312.24 + * questions.
312.25 + */
312.26 +
312.27 +/**
312.28 + * @test
312.29 + * @bug 7027667, 7023591
312.30 + *
312.31 + * @summary Verifies that aa clipped rectangles are drawn, not filled.
312.32 + *
312.33 + * @run main Test7027667
312.34 + */
312.35 +
312.36 +import java.awt.*;
312.37 +import java.awt.geom.*;
312.38 +import java.awt.image.*;
312.39 +import static java.awt.RenderingHints.*;
312.40 +
312.41 +public class Test7027667 {
312.42 + public static void main(String[] args) throws Exception {
312.43 + BufferedImage bImg = new BufferedImage(512, 512, BufferedImage.TYPE_INT_RGB);
312.44 + Graphics2D g2d = (Graphics2D) bImg.getGraphics();
312.45 + g2d.setRenderingHint(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON);
312.46 + g2d.setClip(new Ellipse2D.Double(0, 0, 100, 100));
312.47 + g2d.drawRect(10, 10, 100, 100);
312.48 + if (new Color(bImg.getRGB(50, 50)).equals(Color.white)) {
312.49 + throw new Exception("Rectangle should be drawn, not filled");
312.50 + }
312.51 + }
312.52 +}
313.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
313.2 +++ b/test/sun/java2d/pisces/Renderer/Test7019861.java Tue Mar 29 20:19:55 2011 -0700
313.3 @@ -0,0 +1,76 @@
313.4 +/*
313.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
313.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
313.7 + *
313.8 + * This code is free software; you can redistribute it and/or modify it
313.9 + * under the terms of the GNU General Public License version 2 only, as
313.10 + * published by the Free Software Foundation.
313.11 + *
313.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
313.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
313.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
313.15 + * version 2 for more details (a copy is included in the LICENSE file that
313.16 + * accompanied this code).
313.17 + *
313.18 + * You should have received a copy of the GNU General Public License version
313.19 + * 2 along with this work; if not, write to the Free Software Foundation,
313.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
313.21 + *
313.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
313.23 + * or visit www.oracle.com if you need additional information or have any
313.24 + * questions.
313.25 + */
313.26 +
313.27 +/**
313.28 + * @test
313.29 + * @bug 7019861
313.30 + *
313.31 + * @summary Verifies that the last scanline isn't skipped when doing
313.32 + * antialiased rendering.
313.33 + *
313.34 + * @run main Test7019861
313.35 + */
313.36 +
313.37 +import java.awt.BasicStroke;
313.38 +import java.awt.Color;
313.39 +import java.awt.Graphics2D;
313.40 +import java.awt.geom.Path2D;
313.41 +import java.awt.image.BufferedImage;
313.42 +import java.util.Arrays;
313.43 +
313.44 +import static java.awt.RenderingHints.*;
313.45 +
313.46 +public class Test7019861 {
313.47 +
313.48 + public static void main(String[] argv) throws Exception {
313.49 + BufferedImage im = getWhiteImage(30, 30);
313.50 + Graphics2D g2 = (Graphics2D)im.getGraphics();
313.51 + g2.setRenderingHint(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON);
313.52 + g2.setRenderingHint(KEY_STROKE_CONTROL, VALUE_STROKE_PURE);
313.53 + g2.setStroke(new BasicStroke(10, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));
313.54 + g2.setBackground(Color.white);
313.55 + g2.setColor(Color.black);
313.56 +
313.57 + Path2D p = getPath(0, 0, 20);
313.58 + g2.draw(p);
313.59 +
313.60 + if (!(new Color(im.getRGB(20, 19))).equals(Color.black)) {
313.61 + throw new Exception("This pixel should be black");
313.62 + }
313.63 + }
313.64 +
313.65 + private static Path2D getPath(int x, int y, int len) {
313.66 + Path2D p = new Path2D.Double();
313.67 + p.moveTo(x, y);
313.68 + p.quadTo(x + len, y, x + len, y + len);
313.69 + return p;
313.70 + }
313.71 +
313.72 + private static BufferedImage getWhiteImage(int w, int h) {
313.73 + BufferedImage ret = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
313.74 + final int[] white = new int[w * h];
313.75 + Arrays.fill(white, 0xffffff);
313.76 + ret.setRGB(0, 0, w, h, white, 0, w);
313.77 + return ret;
313.78 + }
313.79 +}
314.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
314.2 +++ b/test/sun/nio/cs/TestIBM1364.java Tue Mar 29 20:19:55 2011 -0700
314.3 @@ -0,0 +1,209 @@
314.4 +/*
314.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
314.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
314.7 + *
314.8 + * This code is free software; you can redistribute it and/or modify it
314.9 + * under the terms of the GNU General Public License version 2 only, as
314.10 + * published by the Free Software Foundation.
314.11 + *
314.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
314.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
314.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
314.15 + * version 2 for more details (a copy is included in the LICENSE file that
314.16 + * accompanied this code).
314.17 + *
314.18 + * You should have received a copy of the GNU General Public License version
314.19 + * 2 along with this work; if not, write to the Free Software Foundation,
314.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
314.21 + *
314.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
314.23 + * or visit www.oracle.com if you need additional information or have any
314.24 + * questions.
314.25 + */
314.26 +
314.27 +
314.28 +/* @test
314.29 + @bug 6803681
314.30 + @summary Test IBM1364
314.31 + */
314.32 +
314.33 +import java.util.Arrays;
314.34 +import java.nio.*;
314.35 +import java.nio.charset.*;
314.36 +
314.37 +public class TestIBM1364 {
314.38 + private static String c2bNRStr = "\u00AD\u00B7\u2015\u223C\u2299\uFF5E";
314.39 + private static byte[] c2bNRBytes = new byte[] {
314.40 + (byte)0x0e,
314.41 + (byte)0x41, (byte)0x48,
314.42 + (byte)0x41, (byte)0x43,
314.43 + (byte)0x41, (byte)0x49,
314.44 + (byte)0x42, (byte)0xa1,
314.45 + (byte)0x49, (byte)0x6f,
314.46 + (byte)0x49, (byte)0x54,
314.47 + (byte)0x0f };
314.48 +
314.49 + // end at SO
314.50 + private static String mixedStr = "\u008d\u008e\u0020\u3000\u3001\u71ba\u3164\u0088\ue757";
314.51 + private static byte[] mixedBytes = new byte[] {
314.52 + (byte)0x09,
314.53 + (byte)0x0a,
314.54 + (byte)0x40,
314.55 + (byte)0x0e,
314.56 + (byte)0x40, (byte)0x40,
314.57 + (byte)0x41, (byte)0x41,
314.58 + (byte)0x6c, (byte)0x45,
314.59 + (byte)0x84, (byte)0x41,
314.60 + (byte)0x0f,
314.61 + (byte)0x28,
314.62 + (byte)0x0e,
314.63 + (byte)0xdd, (byte)0xfd,
314.64 + (byte)0x0f };
314.65 +
314.66 + // end at SI
314.67 + private static String mixedStr2 = "\u008d\u008e\u0020\u3000\u3001\u71ba\u3164\u0088";
314.68 + private static byte[] mixedBytes2 = new byte[] {
314.69 + (byte)0x09,
314.70 + (byte)0x0a,
314.71 + (byte)0x40,
314.72 + (byte)0x0e,
314.73 + (byte)0x40, (byte)0x40,
314.74 + (byte)0x41, (byte)0x41,
314.75 + (byte)0x6c, (byte)0x45,
314.76 + (byte)0x84, (byte)0x41,
314.77 + (byte)0x0f,
314.78 + (byte)0x28 };
314.79 +
314.80 + private static byte[][] malformedBytes = {
314.81 + { (byte)0x0e,
314.82 + (byte)0x039, (byte)0x40,
314.83 + (byte)0x0f
314.84 + },
314.85 + { (byte)0x0e,
314.86 + (byte)0x039, (byte)0x42,
314.87 + (byte)0x0f
314.88 + },
314.89 + { (byte)0x0e,
314.90 + (byte)0x040, (byte)0x41,
314.91 + (byte)0x0f
314.92 + },
314.93 + { (byte)0x0e,
314.94 + (byte)0x040, (byte)0xee,
314.95 + (byte)0x0f
314.96 + },
314.97 + { (byte)0x0e,
314.98 + (byte)0x0ef, (byte)0x30,
314.99 + (byte)0x0f
314.100 + },
314.101 + { (byte)0x0e,
314.102 + (byte)0x0ff, (byte)0x41,
314.103 + (byte)0x0f
314.104 + }
314.105 + };
314.106 +
314.107 + private static byte[][] unmappedBytes = {
314.108 + { (byte)0x0e,
314.109 + (byte)0x06c, (byte)0x46,
314.110 + (byte)0x0f,
314.111 + },
314.112 + { (byte)0x0e,
314.113 + (byte)0x078, (byte)0x46,
314.114 + (byte)0x0f,
314.115 + },
314.116 + { (byte)0x0e,
314.117 + (byte)0x083, (byte)0xfe,
314.118 + (byte)0x0f,
314.119 + },
314.120 + { (byte)0xfa },
314.121 + { (byte)0xfe },
314.122 + };
314.123 +
314.124 + public static void main(String[] args) throws Exception {
314.125 + if (!(Arrays.equals(mixedStr.getBytes("cp1364"), mixedBytes)) ||
314.126 + !mixedStr.equals(new String(mixedBytes, "cp1364")))
314.127 + throw new RuntimeException("cp1364 failed on mixed!");
314.128 +
314.129 + if (!(Arrays.equals(mixedStr2.getBytes("cp1364"), mixedBytes2)) ||
314.130 + !mixedStr2.equals(new String(mixedBytes2, "cp1364")))
314.131 + throw new RuntimeException("cp1364 failed on mixed!");
314.132 +
314.133 + if (!(Arrays.equals(c2bNRStr.getBytes("cp1364"), c2bNRBytes)) ||
314.134 + c2bNRStr.equals(new String(c2bNRBytes, "cp1364")))
314.135 + throw new RuntimeException("cp1364 failed on c2bNR!");
314.136 +
314.137 + ByteBuffer bb = ByteBuffer.allocateDirect(mixedBytes.length);
314.138 + bb.put(mixedBytes).flip();
314.139 + CharBuffer cb = Charset.forName("ibm1364").decode(bb);
314.140 + if (!mixedStr.equals(new String(cb.toString())))
314.141 + throw new RuntimeException("cp1364 failed on direct decod()!");
314.142 +
314.143 + bb = ByteBuffer.allocateDirect(mixedBytes2.length);
314.144 + bb.put(mixedBytes2).flip();
314.145 + cb = Charset.forName("ibm1364").decode(bb);
314.146 + if (!mixedStr2.equals(new String(cb.toString())))
314.147 + throw new RuntimeException("cp1364 failed on direct decod()!");
314.148 +
314.149 + cb = ByteBuffer.allocateDirect(mixedStr.length() * 2).asCharBuffer();
314.150 + cb.put(mixedStr.toCharArray()).flip();
314.151 + bb = Charset.forName("x-ibm1364").encode(cb);
314.152 + if (!(Arrays.equals(Arrays.copyOf(bb.array(), bb.limit()), mixedBytes)))
314.153 + throw new RuntimeException("cp1364 failed on direct encode()!");
314.154 +
314.155 + cb = ByteBuffer.allocateDirect(mixedStr2.length() * 2).asCharBuffer();
314.156 + cb.put(mixedStr2.toCharArray()).flip();
314.157 + bb = Charset.forName("x-ibm1364").encode(cb);
314.158 + if (!(Arrays.equals(Arrays.copyOf(bb.array(), bb.limit()), mixedBytes2)))
314.159 + throw new RuntimeException("cp1364 failed on direct encode()!");
314.160 +
314.161 + // malformed
314.162 + cb = CharBuffer.allocate(1024);
314.163 + CharBuffer cbd = ByteBuffer.allocateDirect(1024).asCharBuffer();
314.164 + CharsetDecoder dec = Charset.forName("x-ibm1364").newDecoder();
314.165 + for (byte[] ba:malformedBytes) {
314.166 + cb.clear();
314.167 + dec.reset();
314.168 + if (!dec.reset().decode(ByteBuffer.wrap(ba), cb, true).isMalformed() ||
314.169 + !dec.reset().decode(ByteBuffer.wrap(ba), cbd, true).isMalformed())
314.170 + throw new RuntimeException("cp1364 failed on decode()/malformed!");
314.171 + }
314.172 +
314.173 + //unmappable
314.174 + for (byte[] ba:unmappedBytes) {
314.175 + cb.clear();
314.176 + dec.reset();
314.177 + if (!dec.reset().decode(ByteBuffer.wrap(ba), cb, true).isUnmappable() ||
314.178 + !dec.reset().decode(ByteBuffer.wrap(ba), cbd, true).isUnmappable())
314.179 + throw new RuntimeException("cp1364 failed on decode()/unmappable!");
314.180 + }
314.181 +
314.182 + //overflow
314.183 + cb.limit(mixedStr.length() - 1);
314.184 + cbd.limit(mixedStr.length() - 1);
314.185 + if (!dec.reset().decode(ByteBuffer.wrap(mixedBytes), cb, true).isOverflow() ||
314.186 + !dec.reset().decode(ByteBuffer.wrap(mixedBytes), cbd, true).isOverflow())
314.187 + throw new RuntimeException("cp1364 failed on decode()/overflow!");
314.188 +
314.189 + CharsetEncoder enc = Charset.forName("x-ibm1364").newEncoder();
314.190 + // last "0x0f" is from flush()
314.191 + bb = ByteBuffer.allocate(mixedBytes.length - 2);
314.192 + ByteBuffer bbd = ByteBuffer.allocateDirect(mixedBytes.length - 2);
314.193 + if (!enc.reset()
314.194 + .encode(CharBuffer.wrap(mixedStr.toCharArray()), bb, true)
314.195 + .isOverflow() ||
314.196 + !enc.reset()
314.197 + .encode(CharBuffer.wrap(mixedStr.toCharArray()), bbd, true)
314.198 + .isOverflow())
314.199 + throw new RuntimeException("cp1364 failed on encode()/overflow!");
314.200 +
314.201 + // flush() overflow
314.202 + bb = ByteBuffer.allocate(mixedBytes.length - 1);
314.203 + bbd = ByteBuffer.allocateDirect(mixedBytes.length - 1);
314.204 +
314.205 + enc.reset().encode(CharBuffer.wrap(mixedStr.toCharArray()), bb, true);
314.206 + enc.reset().encode(CharBuffer.wrap(mixedStr.toCharArray()), bbd, true);
314.207 +
314.208 + if (!enc.flush(bb).isOverflow() ||
314.209 + !enc.flush(bbd).isOverflow())
314.210 + throw new RuntimeException("cp1364 failed on encode()/flush()/overflow!");
314.211 + }
314.212 +}
315.1 --- a/test/sun/security/mscapi/access.policy Tue Mar 29 11:29:01 2011 -0700
315.2 +++ b/test/sun/security/mscapi/access.policy Tue Mar 29 20:19:55 2011 -0700
315.3 @@ -3,7 +3,7 @@
315.4 permission java.lang.RuntimePermission
315.5 "accessClassInPackage.sun.*";
315.6
315.7 - permission java.lang.RuntimePermission "loadLibrary.sunmscapi";
315.8 + permission java.lang.RuntimePermission "loadLibrary.*";
315.9
315.10 permission java.util.PropertyPermission "os.arch", "read";
315.11
316.1 --- a/test/sun/security/mscapi/noaccess.policy Tue Mar 29 11:29:01 2011 -0700
316.2 +++ b/test/sun/security/mscapi/noaccess.policy Tue Mar 29 20:19:55 2011 -0700
316.3 @@ -3,7 +3,7 @@
316.4 permission java.lang.RuntimePermission
316.5 "accessClassInPackage.sun.*";
316.6
316.7 - permission java.lang.RuntimePermission "loadLibrary.sunmscapi";
316.8 + permission java.lang.RuntimePermission "loadLibrary.*";
316.9
316.10 permission java.util.PropertyPermission "os.arch", "read";
316.11
317.1 --- a/test/sun/security/ssl/javax/net/ssl/GetInstance.java Tue Mar 29 11:29:01 2011 -0700
317.2 +++ b/test/sun/security/ssl/javax/net/ssl/GetInstance.java Tue Mar 29 20:19:55 2011 -0700
317.3 @@ -1,5 +1,5 @@
317.4 /*
317.5 - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
317.6 + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
317.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
317.8 *
317.9 * This code is free software; you can redistribute it and/or modify it
317.10 @@ -23,8 +23,9 @@
317.11
317.12 /*
317.13 * @test
317.14 - * @bug 4898428
317.15 + * @bug 4898428 7022855
317.16 * @summary verify getInstance() works using Provider.getService()
317.17 + * Export "PKIX" as the standard algorithm name of KeyManagerFactory
317.18 * @author Andreas Sterbenz
317.19 */
317.20
317.21 @@ -61,6 +62,20 @@
317.22 kmf = KeyManagerFactory.getInstance("SunX509", p);
317.23 same(p, kmf.getProvider());
317.24
317.25 + kmf = KeyManagerFactory.getInstance("NewSunX509");
317.26 + same(p, kmf.getProvider());
317.27 + kmf = KeyManagerFactory.getInstance("NewSunX509", "SunJSSE");
317.28 + same(p, kmf.getProvider());
317.29 + kmf = KeyManagerFactory.getInstance("NewSunX509", p);
317.30 + same(p, kmf.getProvider());
317.31 +
317.32 + kmf = KeyManagerFactory.getInstance("PKIX");
317.33 + same(p, kmf.getProvider());
317.34 + kmf = KeyManagerFactory.getInstance("PKIX", "SunJSSE");
317.35 + same(p, kmf.getProvider());
317.36 + kmf = KeyManagerFactory.getInstance("PKIX", p);
317.37 + same(p, kmf.getProvider());
317.38 +
317.39 TrustManagerFactory tmf;
317.40 tmf = TrustManagerFactory.getInstance("SunX509");
317.41 same(p, tmf.getProvider());
317.42 @@ -69,6 +84,34 @@
317.43 tmf = TrustManagerFactory.getInstance("SunX509", p);
317.44 same(p, tmf.getProvider());
317.45
317.46 + tmf = TrustManagerFactory.getInstance("PKIX");
317.47 + same(p, tmf.getProvider());
317.48 + tmf = TrustManagerFactory.getInstance("PKIX", "SunJSSE");
317.49 + same(p, tmf.getProvider());
317.50 + tmf = TrustManagerFactory.getInstance("PKIX", p);
317.51 + same(p, tmf.getProvider());
317.52 +
317.53 + tmf = TrustManagerFactory.getInstance("SunPKIX");
317.54 + same(p, tmf.getProvider());
317.55 + tmf = TrustManagerFactory.getInstance("SunPKIX", "SunJSSE");
317.56 + same(p, tmf.getProvider());
317.57 + tmf = TrustManagerFactory.getInstance("SunPKIX", p);
317.58 + same(p, tmf.getProvider());
317.59 +
317.60 + tmf = TrustManagerFactory.getInstance("X509");
317.61 + same(p, tmf.getProvider());
317.62 + tmf = TrustManagerFactory.getInstance("X509", "SunJSSE");
317.63 + same(p, tmf.getProvider());
317.64 + tmf = TrustManagerFactory.getInstance("X509", p);
317.65 + same(p, tmf.getProvider());
317.66 +
317.67 + tmf = TrustManagerFactory.getInstance("X.509");
317.68 + same(p, tmf.getProvider());
317.69 + tmf = TrustManagerFactory.getInstance("X.509", "SunJSSE");
317.70 + same(p, tmf.getProvider());
317.71 + tmf = TrustManagerFactory.getInstance("X.509", p);
317.72 + same(p, tmf.getProvider());
317.73 +
317.74 testComSun();
317.75
317.76 long stop = System.currentTimeMillis();
318.1 --- a/test/tools/launcher/MiscTests.java Tue Mar 29 11:29:01 2011 -0700
318.2 +++ b/test/tools/launcher/MiscTests.java Tue Mar 29 20:19:55 2011 -0700
318.3 @@ -23,8 +23,8 @@
318.4
318.5 /*
318.6 * @test
318.7 - * @bug 6856415 6981001
318.8 - * @summary Miscellaneous tests, Exceptions, EnsureJRE etc.
318.9 + * @bug 6856415
318.10 + * @summary Miscellaneous tests, Exceptions
318.11 * @compile -XDignore.symbol.file MiscTests.java TestHelper.java
318.12 * @run main MiscTests
318.13 */
318.14 @@ -32,9 +32,6 @@
318.15
318.16 import java.io.File;
318.17 import java.io.FileNotFoundException;
318.18 -import java.util.HashMap;
318.19 -import java.util.Map;
318.20 -
318.21
318.22 public class MiscTests {
318.23
318.24 @@ -67,22 +64,9 @@
318.25 System.out.println(tr.status);
318.26 }
318.27 }
318.28 - // 6981001 : Check EnsureJreInstallation is ok, note we cannot
318.29 - // thoroughly test this function, we simply do our best.
318.30 - static void test6981001() {
318.31 - if (TestHelper.is64Bit || !TestHelper.isWindows) {
318.32 - return;
318.33 - }
318.34 - Map<String, String> env = new HashMap<String, String>();
318.35 - env.put("_JAVA_LAUNCHER_DEBUG", "true");
318.36 - TestHelper.TestResult tr = TestHelper.doExec(env, TestHelper.javaCmd);
318.37 - if (!tr.contains(TestHelper.JAVAHOME + "\\lib\\bundles")) {
318.38 - System.out.println(tr.status);
318.39 - }
318.40 - }
318.41 +
318.42 public static void main(String... args) {
318.43 test6856415();
318.44 - test6981001();
318.45 if (TestHelper.testExitValue != 0) {
318.46 throw new Error(TestHelper.testExitValue + " tests failed");
318.47 }