diff --git a/.hgignore b/.hgignore index ca1b0b21ee2..0092bd4ff5a 100644 --- a/.hgignore +++ b/.hgignore @@ -1,3 +1,3 @@ ^build/ ^dist/ -^nbproject/private/ +/nbproject/private/ diff --git a/.hgtags b/.hgtags index af6c6de7c88..1c618d15e24 100644 --- a/.hgtags +++ b/.hgtags @@ -50,3 +50,13 @@ df4bcd06e1d0ab306efa5a44f24a409dc0c0c742 jdk7-b72 ce74bd35ce948d629a356e168797f44b593b1578 jdk7-b73 4e7661eaa211e186674f6cbefec4aef1144ac2a0 jdk7-b74 946518568340c4e511549318f19f47f06b7f5f9b jdk7-b75 +09e0b33177af2b98a03c9ca19eedf61440bd1cf6 jdk7-b76 +1d0121b741f029dc4b828e4b36ba6fda92907dd7 jdk7-b77 +4061c66ba1af1a2e27c2c839ba887407dd3ce050 jdk7-b78 +e9c98378f6b9256c0595ef2985ca5899f0c0e274 jdk7-b79 +e6abd38682d237306d6c147c17538ec9e7f8e3a7 jdk7-b80 +dcc938ac40cc45f1ef454d76020b5db5d943001c jdk7-b81 +a30062be6d9ca1d48579826f870f85974300004e jdk7-b82 +34c8199936a1682aa8587857f44cfaf37c2b6381 jdk7-b83 +b1e55627a6980b9508854ed0c0f21d4f981b4494 jdk7-b84 +b6f633a93ae0ec4555ff4bf756f5e2150c9bdede jdk7-b85 diff --git a/.hgtags-top-repo b/.hgtags-top-repo index a3ac772f914..894a468ad2c 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -50,3 +50,13 @@ e1b972ff53cd58f825791f8ed9b2deffd16e768c jdk7-b68 3ac6dcf7823205546fbbc3d4ea59f37358d0b0d4 jdk7-b73 2c88089b6e1c053597418099a14232182c387edc jdk7-b74 d1516b9f23954b29b8e76e6f4efc467c08c78133 jdk7-b75 +c8b63075403d53a208104a8a6ea5072c1cb66aab jdk7-b76 +1f17ca8353babb13f4908c1f87d11508232518c8 jdk7-b77 +ab4ae8f4514693a9fe17ca2fec0239d8f8450d2c jdk7-b78 +20aeeb51713990dbea6929a2e100a8bbf5df70d4 jdk7-b79 +a3242906c7747b5d9bcc3d118c7c3c69aa40f4b7 jdk7-b80 +8403096d1fe7ff5318df9708cfec84a3fd3e1cf9 jdk7-b81 +e1176f86805fe07fd9fb9da065dc51b47712ce76 jdk7-b82 +6880a3af9addb41541e80ebe8cde6f79ec402a58 jdk7-b83 +2f3ea057d1ad56cf3b269cdc4de2741411151982 jdk7-b84 +cf26288a114be67c39f2758959ce50b60f5ae330 jdk7-b85 diff --git a/Makefile b/Makefile index a0b2dc384f9..1131c8b251a 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ endif # For start and finish echo lines TITLE_TEXT = Control $(PLATFORM) $(ARCH) $(RELEASE) -DAYE_STAMP = `$(DATE) '+%y-%m-%d %H:%M'` +DATE_STAMP = `$(DATE) '+%y-%m-%d %H:%M'` START_ECHO = echo "$(TITLE_TEXT) $@ build started: $(DATE_STAMP)" FINISH_ECHO = echo "$(TITLE_TEXT) $@ build finished: $(DATE_STAMP)" @@ -188,7 +188,7 @@ FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME)/j2sdk-image create_fresh_product_bootdir: FRC @$(START_ECHO) $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ - NO_DOCS=true \ + GENERATE_DOCS=false \ BOOT_CYCLE_SETTINGS= \ build_product_image @$(FINISH_ECHO) @@ -196,7 +196,7 @@ create_fresh_product_bootdir: FRC create_fresh_debug_bootdir: FRC @$(START_ECHO) $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ - NO_DOCS=true \ + GENERATE_DOCS=false \ BOOT_CYCLE_DEBUG_SETTINGS= \ build_debug_image @$(FINISH_ECHO) @@ -204,7 +204,7 @@ create_fresh_debug_bootdir: FRC create_fresh_fastdebug_bootdir: FRC @$(START_ECHO) $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ - NO_DOCS=true \ + GENERATE_DOCS=false \ BOOT_CYCLE_DEBUG_SETTINGS= \ build_fastdebug_image @$(FINISH_ECHO) @@ -253,7 +253,7 @@ generic_debug_build: $(MAKE) \ ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)-$(DEBUG_NAME) \ DEBUG_NAME=$(DEBUG_NAME) \ - NO_DOCS=true \ + GENERATE_DOCS=false \ $(BOOT_CYCLE_DEBUG_SETTINGS) \ generic_build_repo_series @$(FINISH_ECHO) @@ -323,7 +323,7 @@ openjdk_build: $(MKDIR) -p $(OPENJDK_OUTPUTDIR) ($(CD) $(OPENJDK_BUILDDIR) && $(MAKE) \ OPENJDK=true \ - NO_DOCS=true \ + GENERATE_DOCS=false \ ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR) \ ALT_OUTPUTDIR=$(OPENJDK_OUTPUTDIR) \ ALT_BINARY_PLUGS_PATH=$(OPENJDK_PLUGS) \ diff --git a/corba/.hgignore b/corba/.hgignore index ca1b0b21ee2..0092bd4ff5a 100644 --- a/corba/.hgignore +++ b/corba/.hgignore @@ -1,3 +1,3 @@ ^build/ ^dist/ -^nbproject/private/ +/nbproject/private/ diff --git a/corba/.hgtags b/corba/.hgtags index 98a13b65b6a..b09aa2cc345 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -50,3 +50,13 @@ c793a31209263fbb867c23c752599d85c21abb73 jdk7-b72 b751c528c55560cf2adeaeef24b39ca1f4d1cbf7 jdk7-b73 5d0cf59a3203b9f57aceebc33ae656b884987955 jdk7-b74 0fb137085952c8e47878e240d1cb40f14de463c4 jdk7-b75 +937144222e2219939101b0129d26a872a7956b13 jdk7-b76 +6881f0383f623394b5ec73f27a5f329ff55d0467 jdk7-b77 +a7f7276b48cd74d8eb1baa83fbf3d1ef4a2603c8 jdk7-b78 +ec0421b5703b677e2226cf4bf7ae4eaafd8061c5 jdk7-b79 +0336e70ca0aeabc783cc01658f36cb6e27ea7934 jdk7-b80 +e08a42a2a94d97ea8eedb187a94dbff822c8fbba jdk7-b81 +1e8c1bfad1abb4b81407a0f2645e0fb85764ca48 jdk7-b82 +fde0df7a2384f7fe33204a79678989807d9c2b98 jdk7-b83 +68c8961a82e4a3ad2a67991e5d834192a81eb4cd jdk7-b84 +c67a9df7bc0ca291f08f9a9cc05cb78ea15d25e6 jdk7-b85 diff --git a/corba/make/common/shared/Platform.gmk b/corba/make/common/shared/Platform.gmk index c444d06f802..b0474d82e16 100644 --- a/corba/make/common/shared/Platform.gmk +++ b/corba/make/common/shared/Platform.gmk @@ -187,6 +187,9 @@ ifeq ($(SYSTEM_UNAME), Linux) sparc*) \ echo sparc \ ;; \ + arm*) \ + echo arm \ + ;; \ *) \ echo $(mach) \ ;; \ diff --git a/corba/src/share/classes/com/sun/tools/corba/se/idl/constExpr/Expression.java b/corba/src/share/classes/com/sun/tools/corba/se/idl/constExpr/Expression.java index 1dc4583e568..99d41510b02 100644 --- a/corba/src/share/classes/com/sun/tools/corba/se/idl/constExpr/Expression.java +++ b/corba/src/share/classes/com/sun/tools/corba/se/idl/constExpr/Expression.java @@ -123,7 +123,7 @@ public abstract class Expression /** * Coerces a number to the target type of this expression. - * @parm number The number to coerce. + * @param obj The number to coerce. * @return the value of number coerced to the (target) type of * this expression. **/ @@ -142,7 +142,7 @@ public abstract class Expression /** * Coerces an integral value (BigInteger) to its corresponding unsigned * representation, if the target type of this expression is unsigned. - * @parm b The BigInteger to be coerced. + * @param b The BigInteger to be coerced. * @return the value of an integral type coerced to its corresponding * unsigned integral type, if the target type of this expression is * unsigned. @@ -170,7 +170,7 @@ public abstract class Expression /** * Coerces an integral value (BigInteger) to its corresponding signed * representation, if the target type of this expression is signed. - * @parm b The BigInteger to be coerced. + * @param b The BigInteger to be coerced. * @return the value of an integral type coerced to its corresponding * signed integral type, if the target type of this expression is * signed. diff --git a/corba/src/share/classes/javax/rmi/PortableRemoteObject.java b/corba/src/share/classes/javax/rmi/PortableRemoteObject.java index 432eb4a6fc8..10c3b95200e 100644 --- a/corba/src/share/classes/javax/rmi/PortableRemoteObject.java +++ b/corba/src/share/classes/javax/rmi/PortableRemoteObject.java @@ -161,7 +161,7 @@ public class PortableRemoteObject { * happens implicitly when the object is sent or received as an argument * on a remote method call, but in some circumstances it is useful to * perform this action by making an explicit call. See the - * {@link Stub#connect} method for more information. + * {@link javax.rmi.CORBA.Stub#connect} method for more information. * @param target the object to connect. * @param source a previously connected object. * @throws RemoteException if source is not connected diff --git a/corba/src/share/classes/org/omg/CORBA/SetOverrideType.java b/corba/src/share/classes/org/omg/CORBA/SetOverrideType.java index acf946871ee..a1e1acc595f 100644 --- a/corba/src/share/classes/org/omg/CORBA/SetOverrideType.java +++ b/corba/src/share/classes/org/omg/CORBA/SetOverrideType.java @@ -31,7 +31,7 @@ package org.omg.CORBA; * indicate whether policies should replace the * existing policies of an Object or be added to them. *

- * The method {@link omg.org.CORBA.Object._set_policy_override} takes + * The method {@link org.omg.CORBA.Object#_set_policy_override} takes * either SetOverrideType.SET_OVERRIDE or * SetOverrideType.ADD_OVERRIDE as its second argument. * The method _set_policy_override diff --git a/corba/src/share/classes/org/omg/CORBA/TCKind.java b/corba/src/share/classes/org/omg/CORBA/TCKind.java index bb3a748f26a..8aa33032da7 100644 --- a/corba/src/share/classes/org/omg/CORBA/TCKind.java +++ b/corba/src/share/classes/org/omg/CORBA/TCKind.java @@ -545,8 +545,6 @@ public class TCKind { * @param _value the int to convert. It must be one of * the int constants in the class * TCKind. - * @return a new TCKind instance whose value - * field matches the given int */ @Deprecated protected TCKind(int _value){ diff --git a/corba/src/share/classes/org/omg/CORBA/UnknownUserException.java b/corba/src/share/classes/org/omg/CORBA/UnknownUserException.java index 8509b2d5146..c66bbc99f1d 100644 --- a/corba/src/share/classes/org/omg/CORBA/UnknownUserException.java +++ b/corba/src/share/classes/org/omg/CORBA/UnknownUserException.java @@ -56,7 +56,7 @@ public final class UnknownUserException extends UserException { * Constructs an UnknownUserException object that contains the given * Any object. * - * @ param a an Any object that contains a user exception returned + * @param a an Any object that contains a user exception returned * by the server */ public UnknownUserException(Any a) { diff --git a/corba/src/share/classes/org/omg/CORBA/portable/ServantObject.java b/corba/src/share/classes/org/omg/CORBA/portable/ServantObject.java index c2c04e11cab..dd1ed8d0e26 100644 --- a/corba/src/share/classes/org/omg/CORBA/portable/ServantObject.java +++ b/corba/src/share/classes/org/omg/CORBA/portable/ServantObject.java @@ -43,7 +43,6 @@ public class ServantObject /** The real servant. The local stub may cast this field to the expected type, and then * invoke the operation directly. Note, the object may or may not be the actual servant * instance. - * @return The real servant */ public java.lang.Object servant; } diff --git a/corba/src/share/classes/org/omg/CosNaming/nameservice.idl b/corba/src/share/classes/org/omg/CosNaming/nameservice.idl index 226454d0fbd..7543484b0ed 100644 --- a/corba/src/share/classes/org/omg/CosNaming/nameservice.idl +++ b/corba/src/share/classes/org/omg/CosNaming/nameservice.idl @@ -256,7 +256,7 @@ module CosNaming * * @param n Name of the object

* - * @parm obj The Object to rebind with the given name

+ * @param obj The Object to rebind with the given name

* * @exception org.omg.CosNaming.NamingContextPackage.NotFound Indicates the name does not identify a binding.

* diff --git a/corba/src/share/classes/org/omg/PortableInterceptor/Interceptors.idl b/corba/src/share/classes/org/omg/PortableInterceptor/Interceptors.idl index ba94343d73d..8edefdf16ae 100644 --- a/corba/src/share/classes/org/omg/PortableInterceptor/Interceptors.idl +++ b/corba/src/share/classes/org/omg/PortableInterceptor/Interceptors.idl @@ -1730,7 +1730,7 @@ module PortableInterceptor { *

* Any number of components may exist with the same component ID. * - * @param a_component The IOP.TaggedComponent to add. + * @param tagged_component The IOP.TaggedComponent to add. */ void add_ior_component (in IOP::TaggedComponent tagged_component); @@ -1744,7 +1744,7 @@ module PortableInterceptor { *

* Any number of components may exist with the same component ID. * - * @param a_component The IOP.TaggedComponent to add. + * @param tagged_component The IOP.TaggedComponent to add. * @param profile_id The profile id of the profile to * which this component will be added. * @exception BAD_PARAM thrown, with a standard minor code of 29, if the diff --git a/hotspot/.hgignore b/hotspot/.hgignore index fec499bf63f..9818ff1af6e 100644 --- a/hotspot/.hgignore +++ b/hotspot/.hgignore @@ -1,6 +1,6 @@ ^build/ ^dist/ -^nbproject/private/ +/nbproject/private/ ^src/share/tools/hsdis/build/ ^src/share/tools/IdealGraphVisualizer/[a-zA-Z0-9]*/build/ ^src/share/tools/IdealGraphVisualizer/build/ diff --git a/hotspot/.hgtags b/hotspot/.hgtags index b8ce5272692..57a200e545a 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -50,3 +50,36 @@ a94714c550658fd6741793ef036cb9625dc2ab1a jdk7-b72 faf94d94786b621f8e13cbcc941ca69c6d967c3f jdk7-b73 f4b900403d6e4b0af51447bd13bbe23fe3a1dac7 jdk7-b74 d8dd291a362acb656026a9c0a9da48501505a1e7 jdk7-b75 +9174bb32e934965288121f75394874eeb1fcb649 jdk7-b76 +455105fc81d941482f8f8056afaa7aa0949c9300 jdk7-b77 +e703499b4b51e3af756ae77c3d5e8b3058a14e4e jdk7-b78 +a5a6adfca6ecefb5894a848debabfe442ff50e25 jdk7-b79 +3003ddd1d4330b06cb4691ae74d600d3685899eb jdk7-b80 +1f9b07674480c224828852ffe137beea36b3cab5 jdk7-b81 +1999f5b12482d66c8b0daf6709daea4f51893a04 jdk7-b82 +a94714c550658fd6741793ef036cb9625dc2ab1a hs17-b01 +faf94d94786b621f8e13cbcc941ca69c6d967c3f hs17-b02 +f4b900403d6e4b0af51447bd13bbe23fe3a1dac7 hs17-b03 +d8dd291a362acb656026a9c0a9da48501505a1e7 hs17-b04 +9174bb32e934965288121f75394874eeb1fcb649 hs17-b05 +a5a6adfca6ecefb5894a848debabfe442ff50e25 hs17-b06 +3003ddd1d4330b06cb4691ae74d600d3685899eb hs17-b07 +1f9b07674480c224828852ffe137beea36b3cab5 hs17-b08 +ff3232b68fbb35185b338d7ff4695b52460243f3 hs17-b09 +981375ca07b7f0605f92f57aad95122e8c385a4d hs16-b01 +f4cbf78110c726919f46b59a3b054c54c7e889b4 hs16-b02 +07c1c01e031513bfe6a7d17c6cf30d2752824ae9 hs16-b03 +08f86fa55a31113df626a75c8a626e66a543a1bd hs16-b04 +32c83fb84370a35344676991a48440378e6b6c8a hs16-b05 +ba313800759b678979434d6da8ed3bf49eb8bea4 hs16-b06 +3c0f729815607e1678bd0c41ae68494c700dcc71 hs16-b07 +ac59d4e6dae51ac5fc31a9a4940d1857f91161b1 hs16-b08 +3f844a28c5f4912bd04043b44f21b25b0805ffc2 hs15-b01 +1605bb4eb5a7a1703b13d5b077a22cc665fe45f7 hs15-b02 +2581d90c6c9b2012da930eb4742add94a03069a0 hs15-b03 +9ab385cb0c42997e16a7761ebcd25c90560a2714 hs15-b04 +fafab5d5349c7c066d677538db67a1ee0fb33bd2 hs15-b05 +3f370a32906eb5ba993fabd7b4279be7f31052b9 jdk7-b83 +ffc8d176b84bcfb5ac21302b4feb3b0c0d69b97c jdk7-b84 +6c9796468b91dcbb39e09dfa1baf9779ac45eb66 jdk7-b85 +418bc80ce13995149eadc9eecbba21d7a9fa02ae hs17-b10 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java index 629d23c54bd..0a157356207 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java @@ -63,12 +63,12 @@ public class SystemDictionary { javaSystemLoaderField = type.getOopField("_java_system_loader"); nofBuckets = db.lookupIntConstant("SystemDictionary::_nof_buckets").intValue(); - objectKlassField = type.getOopField(WK_KLASS("object_klass")); - classLoaderKlassField = type.getOopField(WK_KLASS("classloader_klass")); - stringKlassField = type.getOopField(WK_KLASS("string_klass")); - systemKlassField = type.getOopField(WK_KLASS("system_klass")); - threadKlassField = type.getOopField(WK_KLASS("thread_klass")); - threadGroupKlassField = type.getOopField(WK_KLASS("threadGroup_klass")); + objectKlassField = type.getOopField(WK_KLASS("Object_klass")); + classLoaderKlassField = type.getOopField(WK_KLASS("ClassLoader_klass")); + stringKlassField = type.getOopField(WK_KLASS("String_klass")); + systemKlassField = type.getOopField(WK_KLASS("System_klass")); + threadKlassField = type.getOopField(WK_KLASS("Thread_klass")); + threadGroupKlassField = type.getOopField(WK_KLASS("ThreadGroup_klass")); } // This WK functions must follow the definitions in systemDictionary.hpp: diff --git a/hotspot/make/Makefile b/hotspot/make/Makefile index 6186b3fead8..e3e86cff545 100644 --- a/hotspot/make/Makefile +++ b/hotspot/make/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-2010 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -312,10 +312,13 @@ endif $(EXPORT_LIB_DIR)/%.jar: $(GEN_DIR)/%.jar $(install-file) -# Include files (jvmti.h, jni.h, $(JDK_INCLUDE_SUBDIR)/jni_md.h, jmm.h) +# Include files (jvmti.h, jvmticmlr.h, jni.h, $(JDK_INCLUDE_SUBDIR)/jni_md.h, jmm.h) $(EXPORT_INCLUDE_DIR)/%: $(GEN_DIR)/jvmtifiles/% $(install-file) +$(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/code/% + $(install-file) + $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/prims/% $(install-file) diff --git a/hotspot/make/defs.make b/hotspot/make/defs.make index 83ddd1a9678..2f039203de4 100644 --- a/hotspot/make/defs.make +++ b/hotspot/make/defs.make @@ -1,5 +1,5 @@ # -# Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-2010 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -261,6 +261,7 @@ EXPORT_JRE_LIB_ARCH_DIR = $(EXPORT_JRE_LIB_DIR)/$(LIBARCH) # Common export list of files EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jvmti.h +EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jvmticmlr.h EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jni.h EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jmm.h diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version index 5da770b9f1e..b6f0792ede5 100644 --- a/hotspot/make/hotspot_version +++ b/hotspot/make/hotspot_version @@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2009 HS_MAJOR_VER=17 HS_MINOR_VER=0 -HS_BUILD_NUMBER=05 +HS_BUILD_NUMBER=10 JDK_MAJOR_VER=1 JDK_MINOR_VER=7 diff --git a/hotspot/make/linux/makefiles/debug.make b/hotspot/make/linux/makefiles/debug.make index 4743745228d..1837d97311f 100644 --- a/hotspot/make/linux/makefiles/debug.make +++ b/hotspot/make/linux/makefiles/debug.make @@ -38,7 +38,7 @@ _JUNK_ := $(shell echo -e >&2 ""\ "Please use 'make jvmg' to build debug JVM. \n" \ "----------------------------------------------------------------------\n") -G_SUFFIX = +G_SUFFIX = _g VERSION = debug SYSDEFS += -DASSERT -DDEBUG PICFLAGS = DEFAULT diff --git a/hotspot/make/linux/makefiles/fastdebug.make b/hotspot/make/linux/makefiles/fastdebug.make index 740b7584364..c875123ea88 100644 --- a/hotspot/make/linux/makefiles/fastdebug.make +++ b/hotspot/make/linux/makefiles/fastdebug.make @@ -58,7 +58,7 @@ CFLAGS$(HOTSPARC_GENERIC) += $(OPT_CFLAGS/BYFILE) # Linker mapfile MAPFILE = $(GAMMADIR)/make/linux/makefiles/mapfile-vers-debug -G_SUFFIX = +G_SUFFIX = _g VERSION = optimized SYSDEFS += -DASSERT -DFASTDEBUG PICFLAGS = DEFAULT diff --git a/hotspot/make/linux/makefiles/jsig.make b/hotspot/make/linux/makefiles/jsig.make index 6dcff6aa72a..611793967d8 100644 --- a/hotspot/make/linux/makefiles/jsig.make +++ b/hotspot/make/linux/makefiles/jsig.make @@ -25,9 +25,12 @@ # Rules to build signal interposition library, used by vm.make # libjsig[_g].so: signal interposition library -JSIG = jsig$(G_SUFFIX) +JSIG = jsig LIBJSIG = lib$(JSIG).so +JSIG_G = $(JSIG)$(G_SUFFIX) +LIBJSIG_G = lib$(JSIG_G).so + JSIGSRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/vm DEST_JSIG = $(JDK_LIBDIR)/$(LIBJSIG) @@ -50,6 +53,7 @@ $(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE) @echo Making signal interposition lib... $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \ $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) -o $@ $< -ldl + $(QUIETLY) [ -f $(LIBJSIG_G) ] || { ln -s $@ $(LIBJSIG_G); } install_jsig: $(LIBJSIG) @echo "Copying $(LIBJSIG) to $(DEST_JSIG)" diff --git a/hotspot/make/linux/makefiles/jvmg.make b/hotspot/make/linux/makefiles/jvmg.make index 4b09db64d21..edd0d9c5476 100644 --- a/hotspot/make/linux/makefiles/jvmg.make +++ b/hotspot/make/linux/makefiles/jvmg.make @@ -35,7 +35,7 @@ CFLAGS += $(DEBUG_CFLAGS/BYFILE) # Linker mapfile MAPFILE = $(GAMMADIR)/make/linux/makefiles/mapfile-vers-debug -G_SUFFIX = +G_SUFFIX = _g VERSION = debug SYSDEFS += -DASSERT -DDEBUG PICFLAGS = DEFAULT diff --git a/hotspot/make/linux/makefiles/launcher.make b/hotspot/make/linux/makefiles/launcher.make index e367409f00e..e7f813c2df6 100644 --- a/hotspot/make/linux/makefiles/launcher.make +++ b/hotspot/make/linux/makefiles/launcher.make @@ -25,7 +25,9 @@ # Rules to build gamma launcher, used by vm.make # gamma[_g]: launcher -LAUNCHER = gamma$(G_SUFFIX) + +LAUNCHER = gamma +LAUNCHER_G = $(LAUNCHER)$(G_SUFFIX) LAUNCHERDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/launcher LAUNCHERFLAGS = $(ARCHFLAG) \ @@ -70,4 +72,5 @@ $(LAUNCHER): $(LAUNCHER.o) $(LIBJVM) $(LAUNCHER_MAPFILE) $(LINK_LAUNCHER/PRE_HOOK) \ $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(LAUNCHER.o) $(LIBS_LAUNCHER); \ $(LINK_LAUNCHER/POST_HOOK) \ + [ -f $(LAUNCHER_G) ] || { ln -s $@ $(LAUNCHER_G); }; \ } diff --git a/hotspot/make/linux/makefiles/saproc.make b/hotspot/make/linux/makefiles/saproc.make index 696157969ea..4cbd9cb9b2b 100644 --- a/hotspot/make/linux/makefiles/saproc.make +++ b/hotspot/make/linux/makefiles/saproc.make @@ -25,9 +25,13 @@ # Rules to build serviceability agent library, used by vm.make # libsaproc[_g].so: serviceability agent -SAPROC = saproc$(G_SUFFIX) + +SAPROC = saproc LIBSAPROC = lib$(SAPROC).so +SAPROC_G = $(SAPROC)$(G_SUFFIX) +LIBSAPROC_G = lib$(SAPROC_G).so + AGENT_DIR = $(GAMMADIR)/agent SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family) @@ -75,6 +79,7 @@ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) $(SA_DEBUG_CFLAGS) \ -o $@ \ -lthread_db + $(QUIETLY) [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); } install_saproc: checkAndBuildSA $(QUIETLY) if [ -e $(LIBSAPROC) ] ; then \ diff --git a/hotspot/make/linux/makefiles/vm.make b/hotspot/make/linux/makefiles/vm.make index 641d0d79514..fb847e31922 100644 --- a/hotspot/make/linux/makefiles/vm.make +++ b/hotspot/make/linux/makefiles/vm.make @@ -113,8 +113,9 @@ include $(MAKEFILES_DIR)/dtrace.make #---------------------------------------------------------------------- # JVM -JVM = jvm$(G_SUFFIX) -LIBJVM = lib$(JVM).so +JVM = jvm +LIBJVM = lib$(JVM).so +LIBJVM_G = lib$(JVM)$(G_SUFFIX).so JVM_OBJ_FILES = $(Obj_Files) @@ -201,6 +202,7 @@ $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT) $(LFLAGS_VM) -o $@ $(LIBJVM.o) $(LIBS_VM); \ $(LINK_LIB.CC/POST_HOOK) \ rm -f $@.1; ln -s $@ $@.1; \ + [ -f $(LIBJVM_G) ] || { ln -s $@ $(LIBJVM_G); ln -s $@.1 $(LIBJVM_G).1; }; \ if [ -x /usr/sbin/selinuxenabled ] ; then \ /usr/sbin/selinuxenabled; \ if [ $$? = 0 ] ; then \ diff --git a/hotspot/make/solaris/makefiles/debug.make b/hotspot/make/solaris/makefiles/debug.make index 4fdf4a7463e..ba312ffeb99 100644 --- a/hotspot/make/solaris/makefiles/debug.make +++ b/hotspot/make/solaris/makefiles/debug.make @@ -54,7 +54,7 @@ _JUNK_ := $(shell echo >&2 ""\ "Please use 'gnumake jvmg' to build debug JVM. \n" \ "-------------------------------------------------------------------------\n") -G_SUFFIX = +G_SUFFIX = _g VERSION = debug SYSDEFS += -DASSERT -DDEBUG PICFLAGS = DEFAULT diff --git a/hotspot/make/solaris/makefiles/dtrace.make b/hotspot/make/solaris/makefiles/dtrace.make index 0ba875dc58e..4482f26fffa 100644 --- a/hotspot/make/solaris/makefiles/dtrace.make +++ b/hotspot/make/solaris/makefiles/dtrace.make @@ -24,8 +24,8 @@ # Rules to build jvm_db/dtrace, used by vm.make -# we build libjvm_dtrace/libjvm_db/dtrace for COMPILER1 and COMPILER2 -# but not for CORE configuration +# We build libjvm_dtrace/libjvm_db/dtrace for COMPILER1 and COMPILER2 +# but not for CORE or KERNEL configurations. ifneq ("${TYPE}", "CORE") ifneq ("${TYPE}", "KERNEL") @@ -37,12 +37,13 @@ dtraceCheck: else - JVM_DB = libjvm_db -LIBJVM_DB = libjvm$(G_SUFFIX)_db.so +LIBJVM_DB = libjvm_db.so +LIBJVM_DB_G = libjvm$(G_SUFFIX)_db.so JVM_DTRACE = jvm_dtrace -LIBJVM_DTRACE = libjvm$(G_SUFFIX)_dtrace.so +LIBJVM_DTRACE = libjvm_dtrace.so +LIBJVM_DTRACE_G = libjvm$(G_SUFFIX)_dtrace.so JVMOFFS = JvmOffsets JVMOFFS.o = $(JVMOFFS).o @@ -77,7 +78,7 @@ LFLAGS_JVM_DB += -D_REENTRANT $(PICFLAG) LFLAGS_JVM_DTRACE += -D_REENTRANT $(PICFLAG) else LFLAGS_JVM_DB += -mt $(PICFLAG) -xnolib -LFLAGS_JVM_DTRACE += -mt $(PICFLAG) -xnolib +LFLAGS_JVM_DTRACE += -mt $(PICFLAG) -xnolib -ldl endif ISA = $(subst i386,i486,$(shell isainfo -n)) @@ -86,18 +87,24 @@ ISA = $(subst i386,i486,$(shell isainfo -n)) ifneq ("${ISA}","${BUILDARCH}") XLIBJVM_DB = 64/$(LIBJVM_DB) +XLIBJVM_DB_G = 64/$(LIBJVM_DB_G) XLIBJVM_DTRACE = 64/$(LIBJVM_DTRACE) +XLIBJVM_DTRACE_G = 64/$(LIBJVM_DTRACE_G) $(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE) @echo Making $@ $(QUIETLY) mkdir -p 64/ ; \ $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \ $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc + [ -f $(XLIBJVM_DB_G) ] || { ln -s $(LIBJVM_DB) $(XLIBJVM_DB_G); } + $(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) @echo Making $@ $(QUIETLY) mkdir -p 64/ ; \ $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \ $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor + [ -f $(XLIBJVM_DTRACE_G) ] || { ln -s $(LIBJVM_DTRACE) $(XLIBJVM_DTRACE_G); } + endif # ifneq ("${ISA}","${BUILDARCH}") ifdef USE_GCC @@ -142,11 +149,13 @@ $(LIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_D @echo Making $@ $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \ $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc + [ -f $(LIBJVM_DB_G) ] || { ln -s $@ $(LIBJVM_DB_G); } $(LIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) @echo Making $@ $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. \ $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor + [ -f $(LIBJVM_DTRACE_G) ] || { ln -s $@ $(LIBJVM_DTRACE_G); } $(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \ $(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d diff --git a/hotspot/make/solaris/makefiles/fastdebug.make b/hotspot/make/solaris/makefiles/fastdebug.make index 084814d6758..4edeb373f9e 100644 --- a/hotspot/make/solaris/makefiles/fastdebug.make +++ b/hotspot/make/solaris/makefiles/fastdebug.make @@ -90,7 +90,6 @@ endif # Platform_compiler == sparcWorks # for this method for now. (fix this when dtrace bug 6258412 is fixed) OPT_CFLAGS/ciEnv.o = $(OPT_CFLAGS) -xinline=no%__1cFciEnvbFpost_compiled_method_load_event6MpnHnmethod__v_ - # (OPT_CFLAGS/SLOWER is also available, to alter compilation of buggy files) # If you set HOTSPARC_GENERIC=yes, you disable all OPT_CFLAGS settings @@ -115,8 +114,7 @@ MAPFILE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers \ # and mustn't be otherwise. MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE) - -G_SUFFIX = +G_SUFFIX = _g VERSION = optimized SYSDEFS += -DASSERT -DFASTDEBUG -DCHECK_UNHANDLED_OOPS PICFLAGS = DEFAULT diff --git a/hotspot/make/solaris/makefiles/jsig.make b/hotspot/make/solaris/makefiles/jsig.make index e4a4aef771a..81497767202 100644 --- a/hotspot/make/solaris/makefiles/jsig.make +++ b/hotspot/make/solaris/makefiles/jsig.make @@ -25,8 +25,11 @@ # Rules to build signal interposition library, used by vm.make # libjsig[_g].so: signal interposition library -JSIG = jsig$(G_SUFFIX) -LIBJSIG = lib$(JSIG).so +JSIG = jsig +LIBJSIG = lib$(JSIG).so + +JSIG_G = $(JSIG)$(G_SUFFIX) +LIBJSIG_G = lib$(JSIG_G).so JSIGSRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/vm @@ -46,6 +49,7 @@ $(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE) @echo Making signal interposition lib... $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \ $(LFLAGS_JSIG) -o $@ $< -ldl + [ -f $(LIBJSIG_G) ] || { ln -s $@ $(LIBJSIG_G); } install_jsig: $(LIBJSIG) @echo "Copying $(LIBJSIG) to $(DEST_JSIG)" diff --git a/hotspot/make/solaris/makefiles/jvmg.make b/hotspot/make/solaris/makefiles/jvmg.make index e6603005fdd..160ea5df1d8 100644 --- a/hotspot/make/solaris/makefiles/jvmg.make +++ b/hotspot/make/solaris/makefiles/jvmg.make @@ -51,7 +51,7 @@ MAPFILE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers \ # and mustn't be otherwise. MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE) -G_SUFFIX = +G_SUFFIX = _g VERSION = debug SYSDEFS += -DASSERT -DDEBUG PICFLAGS = DEFAULT diff --git a/hotspot/make/solaris/makefiles/launcher.make b/hotspot/make/solaris/makefiles/launcher.make index 2224d58017d..bf32444c5c3 100644 --- a/hotspot/make/solaris/makefiles/launcher.make +++ b/hotspot/make/solaris/makefiles/launcher.make @@ -25,7 +25,8 @@ # Rules to build gamma launcher, used by vm.make # gamma[_g]: launcher -LAUNCHER = gamma$(G_SUFFIX) +LAUNCHER = gamma +LAUNCHER_G = $(LAUNCHER)$(G_SUFFIX) LAUNCHERDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/launcher LAUNCHERFLAGS = $(ARCHFLAG) \ @@ -88,5 +89,6 @@ $(LAUNCHER): $(LAUNCHER.o) $(LIBJVM) $(LAUNCHER_MAPFILE) $(LINK_LAUNCHER/PRE_HOOK) \ $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(LAUNCHER.o) $(LIBS_LAUNCHER); \ $(LINK_LAUNCHER/POST_HOOK) \ + [ -f $(LAUNCHER_G) ] || { ln -s $@ $(LAUNCHER_G); }; \ ;; \ esac diff --git a/hotspot/make/solaris/makefiles/saproc.make b/hotspot/make/solaris/makefiles/saproc.make index 906cd9d998e..38751e8f1bf 100644 --- a/hotspot/make/solaris/makefiles/saproc.make +++ b/hotspot/make/solaris/makefiles/saproc.make @@ -25,9 +25,13 @@ # Rules to build serviceability agent library, used by vm.make # libsaproc[_g].so: serviceability agent -SAPROC = saproc$(G_SUFFIX) + +SAPROC = saproc LIBSAPROC = lib$(SAPROC).so +SAPROC_G = $(SAPROC)$(G_SUFFIX) +LIBSAPROC_G = lib$(SAPROC_G).so + AGENT_DIR = $(GAMMADIR)/agent SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family)/proc @@ -69,6 +73,7 @@ $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) $(SA_LFLAGS) \ -o $@ \ -ldl -ldemangle -lthread -lc + [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); } install_saproc: checkAndBuildSA $(QUIETLY) if [ -f $(LIBSAPROC) ] ; then \ diff --git a/hotspot/make/solaris/makefiles/sparcWorks.make b/hotspot/make/solaris/makefiles/sparcWorks.make index d1648383857..acab5192183 100644 --- a/hotspot/make/solaris/makefiles/sparcWorks.make +++ b/hotspot/make/solaris/makefiles/sparcWorks.make @@ -281,8 +281,6 @@ else OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS) endif -CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_sparc/vm/solaris_sparc.il - endif # sparc ifeq ("${Platform_arch_model}", "x86_32") @@ -293,13 +291,14 @@ OPT_CFLAGS=-xtarget=pentium $(EXTRA_OPT_CFLAGS) # [phh] Is this still true for 6.1? OPT_CFLAGS+=-xO3 -CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_x86/vm/solaris_x86_32.il - endif # 32bit x86 # no more exceptions CFLAGS/NOEX=-noex +# Inline functions +CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_${Platform_arch}/vm/solaris_${Platform_arch_model}.il + # Reduce code bloat by reverting back to 5.0 behavior for static initializers CFLAGS += -Qoption ccfe -one_static_init @@ -312,6 +311,15 @@ PICFLAG/DEFAULT = $(PICFLAG) PICFLAG/BETTER = $(PICFLAG/DEFAULT) PICFLAG/BYFILE = $(PICFLAG/$@)$(PICFLAG/DEFAULT$(PICFLAG/$@)) +# Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file. +MAPFLAG = -M FILENAME + +# Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj +SONAMEFLAG = -h SONAME + +# Build shared library +SHARED_FLAG = -G + # Would be better if these weren't needed, since we link with CC, but # at present removing them causes run-time errors LFLAGS += -library=Crun diff --git a/hotspot/make/solaris/makefiles/vm.make b/hotspot/make/solaris/makefiles/vm.make index 32850b18bbd..058bb6bd7e4 100644 --- a/hotspot/make/solaris/makefiles/vm.make +++ b/hotspot/make/solaris/makefiles/vm.make @@ -108,11 +108,16 @@ ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 505), 1) # older libm before libCrun, just to make sure it's found and used first. LIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc else +ifeq ($(COMPILER_REV_NUMERIC), 502) +# SC6.1 has it's own libm.so: specifying anything else provokes a name conflict. +LIBS += -ldl -lthread -lsocket -lm -lsched -ldoor +else LIBS += -ldl -lthread -lsocket $(LIBM) -lsched -ldoor -endif +endif # 502 +endif # 505 else LIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc -endif +endif # sparcWorks # By default, link the *.o into the library, not the executable. LINK_INTO$(LINK_INTO) = LIBJVM @@ -126,8 +131,9 @@ include $(MAKEFILES_DIR)/dtrace.make #---------------------------------------------------------------------- # JVM -JVM = jvm$(G_SUFFIX) -LIBJVM = lib$(JVM).so +JVM = jvm +LIBJVM = lib$(JVM).so +LIBJVM_G = lib$(JVM)$(G_SUFFIX).so JVM_OBJ_FILES = $(Obj_Files) $(DTRACE_OBJS) @@ -173,11 +179,12 @@ $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) -sbfast|-xsbfast) \ ;; \ *) \ - echo Linking vm...; \ - $(LINK_LIB.CC/PRE_HOOK) \ - $(LINK_VM) $(LFLAGS_VM) -o $@ $(LIBJVM.o) $(LIBS_VM); \ - $(LINK_LIB.CC/POST_HOOK) \ - rm -f $@.1; ln -s $@ $@.1; \ + echo Linking vm...; \ + $(LINK_LIB.CC/PRE_HOOK) \ + $(LINK_VM) $(LFLAGS_VM) -o $@ $(LIBJVM.o) $(LIBS_VM); \ + $(LINK_LIB.CC/POST_HOOK) \ + rm -f $@.1; ln -s $@ $@.1; \ + [ -f $(LIBJVM_G) ] || { ln -s $@ $(LIBJVM_G); ln -s $@.1 $(LIBJVM_G).1; }; \ ;; \ esac diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp index 2583f7cee23..315e90019c6 100644 --- a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -189,14 +189,17 @@ void LIR_Assembler::osr_entry() { Register OSR_buf = osrBufferPointer()->as_register(); { assert(frame::interpreter_frame_monitor_size() == BasicObjectLock::size(), "adjust code below"); int monitor_offset = BytesPerWord * method()->max_locals() + - (BasicObjectLock::size() * BytesPerWord) * (number_of_locks - 1); + (2 * BytesPerWord) * (number_of_locks - 1); + // SharedRuntime::OSR_migration_begin() packs BasicObjectLocks in + // the OSR buffer using 2 word entries: first the lock and then + // the oop. for (int i = 0; i < number_of_locks; i++) { - int slot_offset = monitor_offset - ((i * BasicObjectLock::size()) * BytesPerWord); + int slot_offset = monitor_offset - ((i * 2) * BytesPerWord); #ifdef ASSERT // verify the interpreter's monitor has a non-null object { Label L; - __ ld_ptr(OSR_buf, slot_offset + BasicObjectLock::obj_offset_in_bytes(), O7); + __ ld_ptr(OSR_buf, slot_offset + 1*BytesPerWord, O7); __ cmp(G0, O7); __ br(Assembler::notEqual, false, Assembler::pt, L); __ delayed()->nop(); @@ -205,9 +208,9 @@ void LIR_Assembler::osr_entry() { } #endif // ASSERT // Copy the lock field into the compiled activation. - __ ld_ptr(OSR_buf, slot_offset + BasicObjectLock::lock_offset_in_bytes(), O7); + __ ld_ptr(OSR_buf, slot_offset + 0, O7); __ st_ptr(O7, frame_map()->address_for_monitor_lock(i)); - __ ld_ptr(OSR_buf, slot_offset + BasicObjectLock::obj_offset_in_bytes(), O7); + __ ld_ptr(OSR_buf, slot_offset + 1*BytesPerWord, O7); __ st_ptr(O7, frame_map()->address_for_monitor_object(i)); } } @@ -354,7 +357,7 @@ void LIR_Assembler::monitorexit(LIR_Opr obj_opr, LIR_Opr lock_opr, Register hdr, } -void LIR_Assembler::emit_exception_handler() { +int LIR_Assembler::emit_exception_handler() { // if the last instruction is a call (typically to do a throw which // is coming at the end after block reordering) the return address // must still point into the code area in order to avoid assertion @@ -370,15 +373,12 @@ void LIR_Assembler::emit_exception_handler() { if (handler_base == NULL) { // not enough space left for the handler bailout("exception handler overflow"); - return; + return -1; } -#ifdef ASSERT + int offset = code_offset(); -#endif // ASSERT - compilation()->offsets()->set_value(CodeOffsets::Exceptions, code_offset()); - - if (compilation()->has_exception_handlers() || compilation()->env()->jvmti_can_post_exceptions()) { + if (compilation()->has_exception_handlers() || compilation()->env()->jvmti_can_post_on_exceptions()) { __ call(Runtime1::entry_for(Runtime1::handle_exception_id), relocInfo::runtime_call_type); __ delayed()->nop(); } @@ -387,11 +387,13 @@ void LIR_Assembler::emit_exception_handler() { __ delayed()->nop(); debug_only(__ stop("should have gone to the caller");) assert(code_offset() - offset <= exception_handler_size, "overflow"); - __ end_a_stub(); + + return offset; } -void LIR_Assembler::emit_deopt_handler() { + +int LIR_Assembler::emit_deopt_handler() { // if the last instruction is a call (typically to do a throw which // is coming at the end after block reordering) the return address // must still point into the code area in order to avoid assertion @@ -405,23 +407,18 @@ void LIR_Assembler::emit_deopt_handler() { if (handler_base == NULL) { // not enough space left for the handler bailout("deopt handler overflow"); - return; + return -1; } -#ifdef ASSERT + int offset = code_offset(); -#endif // ASSERT - compilation()->offsets()->set_value(CodeOffsets::Deopt, code_offset()); - AddressLiteral deopt_blob(SharedRuntime::deopt_blob()->unpack()); - __ JUMP(deopt_blob, G3_scratch, 0); // sethi;jmp __ delayed()->nop(); - assert(code_offset() - offset <= deopt_handler_size, "overflow"); - debug_only(__ stop("should have gone to the caller");) - __ end_a_stub(); + + return offset; } @@ -953,9 +950,11 @@ int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType typ } else { #ifdef _LP64 assert(base != to_reg->as_register_lo(), "can't handle this"); + assert(O7 != to_reg->as_register_lo(), "can't handle this"); __ ld(base, offset + hi_word_offset_in_bytes, to_reg->as_register_lo()); + __ lduw(base, offset + lo_word_offset_in_bytes, O7); // in case O7 is base or offset, use it last __ sllx(to_reg->as_register_lo(), 32, to_reg->as_register_lo()); - __ ld(base, offset + lo_word_offset_in_bytes, to_reg->as_register_lo()); + __ or3(to_reg->as_register_lo(), O7, to_reg->as_register_lo()); #else if (base == to_reg->as_register_lo()) { __ ld(base, offset + hi_word_offset_in_bytes, to_reg->as_register_hi()); @@ -976,8 +975,8 @@ int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType typ FloatRegister reg = to_reg->as_double_reg(); // split unaligned loads if (unaligned || PatchALot) { - __ ldf(FloatRegisterImpl::S, base, offset + BytesPerWord, reg->successor()); - __ ldf(FloatRegisterImpl::S, base, offset, reg); + __ ldf(FloatRegisterImpl::S, base, offset + 4, reg->successor()); + __ ldf(FloatRegisterImpl::S, base, offset, reg); } else { __ ldf(FloatRegisterImpl::D, base, offset, to_reg->as_double_reg()); } @@ -2200,6 +2199,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) { Register len = O2; __ add(src, arrayOopDesc::base_offset_in_bytes(basic_type), src_ptr); + LP64_ONLY(__ sra(src_pos, 0, src_pos);) //higher 32bits must be null if (shift == 0) { __ add(src_ptr, src_pos, src_ptr); } else { @@ -2208,6 +2208,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) { } __ add(dst, arrayOopDesc::base_offset_in_bytes(basic_type), dst_ptr); + LP64_ONLY(__ sra(dst_pos, 0, dst_pos);) //higher 32bits must be null if (shift == 0) { __ add(dst_ptr, dst_pos, dst_ptr); } else { @@ -2729,9 +2730,6 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { } Address counter_addr(mdo, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias); - __ lduw(counter_addr, tmp1); - __ add(tmp1, DataLayout::counter_increment, tmp1); - __ stw(tmp1, counter_addr); Bytecodes::Code bc = method->java_code_at_bci(bci); // Perform additional virtual call profiling for invokevirtual and // invokeinterface bytecodes @@ -2821,15 +2819,23 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { __ set(DataLayout::counter_increment, tmp1); __ st_ptr(tmp1, mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) - mdo_offset_bias); - if (i < (VirtualCallData::row_limit() - 1)) { - __ br(Assembler::always, false, Assembler::pt, update_done); - __ delayed()->nop(); - } + __ br(Assembler::always, false, Assembler::pt, update_done); + __ delayed()->nop(); __ bind(next_test); } + // Receiver did not match any saved receiver and there is no empty row for it. + // Increment total counter to indicate polymorphic case. + __ lduw(counter_addr, tmp1); + __ add(tmp1, DataLayout::counter_increment, tmp1); + __ stw(tmp1, counter_addr); __ bind(update_done); } + } else { + // Static call + __ lduw(counter_addr, tmp1); + __ add(tmp1, DataLayout::counter_increment, tmp1); + __ stw(tmp1, counter_addr); } } diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp index 2a69ade2156..87b47124352 100644 --- a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp @@ -144,17 +144,17 @@ LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index, if (index->is_register()) { // apply the shift and accumulate the displacement if (shift > 0) { - LIR_Opr tmp = new_register(T_INT); + LIR_Opr tmp = new_pointer_register(); __ shift_left(index, shift, tmp); index = tmp; } if (disp != 0) { - LIR_Opr tmp = new_register(T_INT); + LIR_Opr tmp = new_pointer_register(); if (Assembler::is_simm13(disp)) { - __ add(tmp, LIR_OprFact::intConst(disp), tmp); + __ add(tmp, LIR_OprFact::intptrConst(disp), tmp); index = tmp; } else { - __ move(LIR_OprFact::intConst(disp), tmp); + __ move(LIR_OprFact::intptrConst(disp), tmp); __ add(tmp, index, tmp); index = tmp; } @@ -162,8 +162,8 @@ LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index, } } else if (disp != 0 && !Assembler::is_simm13(disp)) { // index is illegal so replace it with the displacement loaded into a register - index = new_register(T_INT); - __ move(LIR_OprFact::intConst(disp), index); + index = new_pointer_register(); + __ move(LIR_OprFact::intptrConst(disp), index); disp = 0; } diff --git a/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp index cb2bab6ea93..d47f7ce41d5 100644 --- a/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp @@ -22,10 +22,9 @@ * */ -// // Sets the default values for platform dependent flags used by the client compiler. // (see c1_globals.hpp) -// + #ifndef TIERED define_pd_global(bool, BackgroundCompilation, true ); define_pd_global(bool, CICompileOSR, true ); @@ -48,27 +47,24 @@ define_pd_global(intx, OnStackReplacePercentage, 1400 ); define_pd_global(bool, UseTLAB, true ); define_pd_global(bool, ProfileInterpreter, false); define_pd_global(intx, FreqInlineSize, 325 ); -define_pd_global(intx, NewRatio, 8 ); // Design center runs on 1.3.1 define_pd_global(bool, ResizeTLAB, true ); define_pd_global(intx, ReservedCodeCacheSize, 32*M ); define_pd_global(intx, CodeCacheExpansionSize, 32*K ); define_pd_global(uintx,CodeCacheMinBlockLength, 1); -define_pd_global(uintx, PermSize, 12*M ); -define_pd_global(uintx, MaxPermSize, 64*M ); -define_pd_global(bool, NeverActAsServerClassMachine, true); +define_pd_global(uintx,PermSize, 12*M ); +define_pd_global(uintx,MaxPermSize, 64*M ); +define_pd_global(bool, NeverActAsServerClassMachine, true ); define_pd_global(intx, NewSizeThreadIncrease, 16*K ); -define_pd_global(uintx, DefaultMaxRAM, 1*G); +define_pd_global(uint64_t,MaxRAM, 1ULL*G); define_pd_global(intx, InitialCodeCacheSize, 160*K); -#endif // TIERED +#endif // !TIERED define_pd_global(bool, UseTypeProfile, false); define_pd_global(bool, RoundFPResults, false); - -define_pd_global(bool, LIRFillDelaySlots, true); +define_pd_global(bool, LIRFillDelaySlots, true ); define_pd_global(bool, OptimizeSinglePrecision, false); -define_pd_global(bool, CSEArrayLength, true); +define_pd_global(bool, CSEArrayLength, true ); define_pd_global(bool, TwoOperandLIRForm, false); - -define_pd_global(intx, SafepointPollOffset, 0); +define_pd_global(intx, SafepointPollOffset, 0 ); diff --git a/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp index 92f69be26bb..2df4dbd8ede 100644 --- a/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp @@ -59,7 +59,6 @@ define_pd_global(intx, FLOATPRESSURE, 52); // C2 on V9 gets to u define_pd_global(intx, FreqInlineSize, 175); define_pd_global(intx, INTPRESSURE, 48); // large register set define_pd_global(intx, InteriorEntryAlignment, 16); // = CodeEntryAlignment -define_pd_global(intx, NewRatio, 2); define_pd_global(intx, NewSizeThreadIncrease, ScaleForWordSize(4*K)); // The default setting 16/16 seems to work best. // (For _228_jack 16/16 is 2% better than 4/4, 16/4, 32/32, 32/16, or 16/32.) @@ -83,25 +82,25 @@ define_pd_global(bool, OptoScheduling, true); // sequence of instructions to load a 64 bit pointer. // // InitialCodeCacheSize derived from specjbb2000 run. -define_pd_global(intx, InitialCodeCacheSize, 2048*K); // Integral multiple of CodeCacheExpansionSize -define_pd_global(intx, ReservedCodeCacheSize, 48*M); -define_pd_global(intx, CodeCacheExpansionSize, 64*K); +define_pd_global(intx, InitialCodeCacheSize, 2048*K); // Integral multiple of CodeCacheExpansionSize +define_pd_global(intx, ReservedCodeCacheSize, 48*M); +define_pd_global(intx, CodeCacheExpansionSize, 64*K); // Ergonomics related flags -define_pd_global(uintx, DefaultMaxRAM, 32*G); +define_pd_global(uint64_t,MaxRAM, 128ULL*G); #else // InitialCodeCacheSize derived from specjbb2000 run. -define_pd_global(intx, InitialCodeCacheSize, 1536*K); // Integral multiple of CodeCacheExpansionSize -define_pd_global(intx, ReservedCodeCacheSize, 32*M); -define_pd_global(intx, CodeCacheExpansionSize, 32*K); +define_pd_global(intx, InitialCodeCacheSize, 1536*K); // Integral multiple of CodeCacheExpansionSize +define_pd_global(intx, ReservedCodeCacheSize, 32*M); +define_pd_global(intx, CodeCacheExpansionSize, 32*K); // Ergonomics related flags -define_pd_global(uintx, DefaultMaxRAM, 1*G); +define_pd_global(uint64_t,MaxRAM, 4ULL*G); #endif -define_pd_global(uintx,CodeCacheMinBlockLength, 4); +define_pd_global(uintx,CodeCacheMinBlockLength, 4); // Heap related flags -define_pd_global(uintx, PermSize, ScaleForWordSize(16*M)); -define_pd_global(uintx, MaxPermSize, ScaleForWordSize(64*M)); +define_pd_global(uintx,PermSize, ScaleForWordSize(16*M)); +define_pd_global(uintx,MaxPermSize, ScaleForWordSize(64*M)); // Ergonomics related flags define_pd_global(bool, NeverActAsServerClassMachine, false); diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp index 13626f0700e..64b652376eb 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -366,8 +366,9 @@ frame::frame(intptr_t* sp, intptr_t* younger_sp, bool younger_frame_adjusted_sta // as get_original_pc() needs correct value for unextended_sp() if (_pc != NULL) { _cb = CodeCache::find_blob(_pc); - if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) { - _pc = ((nmethod*)_cb)->get_original_pc(this); + address original_pc = nmethod::get_deopt_original_pc(this); + if (original_pc != NULL) { + _pc = original_pc; _deopt_state = is_deoptimized; } else { _deopt_state = not_deoptimized; @@ -519,9 +520,9 @@ void frame::patch_pc(Thread* thread, address pc) { _cb = CodeCache::find_blob(pc); *O7_addr() = pc - pc_return_offset; _cb = CodeCache::find_blob(_pc); - if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) { - address orig = ((nmethod*)_cb)->get_original_pc(this); - assert(orig == _pc, "expected original to be stored before patching"); + address original_pc = nmethod::get_deopt_original_pc(this); + if (original_pc != NULL) { + assert(original_pc == _pc, "expected original to be stored before patching"); _deopt_state = is_deoptimized; } else { _deopt_state = not_deoptimized; diff --git a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp index ff28c96cfc7..e115ef2a9e0 100644 --- a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp @@ -22,10 +22,8 @@ * */ -// // Sets the default values for platform dependent flags used by the runtime system. // (see globals.hpp) -// // For sparc we do not do call backs when a thread is in the interpreter, because the // interpreter dispatch needs at least two instructions - first to load the dispatch address @@ -41,26 +39,23 @@ define_pd_global(bool, NeedsDeoptSuspend, true); // register window ma define_pd_global(bool, ImplicitNullChecks, true); // Generate code for implicit null checks define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap NULLs past to check cast -define_pd_global(intx, CodeEntryAlignment, 32); -define_pd_global(uintx, TLABSize, 0); -define_pd_global(uintx, NewSize, ScaleForWordSize((2048 * K) + (2 * (64 * K)))); -define_pd_global(intx, SurvivorRatio, 8); -define_pd_global(intx, InlineFrequencyCount, 50); // we can use more inlining on the SPARC -define_pd_global(intx, InlineSmallCode, 1500); +define_pd_global(intx, CodeEntryAlignment, 32); +define_pd_global(intx, InlineFrequencyCount, 50); // we can use more inlining on the SPARC +define_pd_global(intx, InlineSmallCode, 1500); #ifdef _LP64 // Stack slots are 2X larger in LP64 than in the 32 bit VM. -define_pd_global(intx, ThreadStackSize, 1024); -define_pd_global(intx, VMThreadStackSize, 1024); +define_pd_global(intx, ThreadStackSize, 1024); +define_pd_global(intx, VMThreadStackSize, 1024); #else -define_pd_global(intx, ThreadStackSize, 512); -define_pd_global(intx, VMThreadStackSize, 512); +define_pd_global(intx, ThreadStackSize, 512); +define_pd_global(intx, VMThreadStackSize, 512); #endif define_pd_global(intx, StackYellowPages, 2); define_pd_global(intx, StackRedPages, 1); define_pd_global(intx, StackShadowPages, 3 DEBUG_ONLY(+1)); -define_pd_global(intx, PreInflateSpin, 40); // Determined by running design center +define_pd_global(intx, PreInflateSpin, 40); // Determined by running design center define_pd_global(bool, RewriteBytecodes, true); define_pd_global(bool, RewriteFrequentPairs, true); diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp index 1db51a19cb7..604c2b9e4e4 100644 --- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1681,11 +1681,8 @@ void InterpreterMacroAssembler::profile_virtual_call(Register receiver, // If no method data exists, go to profile_continue. test_method_data_pointer(profile_continue); - // We are making a call. Increment the count. - increment_mdp_data_at(in_bytes(CounterData::count_offset()), scratch); - // Record the receiver type. - record_klass_in_profile(receiver, scratch); + record_klass_in_profile(receiver, scratch, true); // The method data pointer needs to be updated to reflect the new target. update_mdp_by_constant(in_bytes(VirtualCallData::virtual_call_data_size())); @@ -1695,9 +1692,13 @@ void InterpreterMacroAssembler::profile_virtual_call(Register receiver, void InterpreterMacroAssembler::record_klass_in_profile_helper( Register receiver, Register scratch, - int start_row, Label& done) { - if (TypeProfileWidth == 0) + int start_row, Label& done, bool is_virtual_call) { + if (TypeProfileWidth == 0) { + if (is_virtual_call) { + increment_mdp_data_at(in_bytes(CounterData::count_offset()), scratch); + } return; + } int last_row = VirtualCallData::row_limit() - 1; assert(start_row <= last_row, "must be work left to do"); @@ -1714,6 +1715,7 @@ void InterpreterMacroAssembler::record_klass_in_profile_helper( // See if the receiver is receiver[n]. int recvr_offset = in_bytes(VirtualCallData::receiver_offset(row)); test_mdp_data_at(recvr_offset, receiver, next_test, scratch); + // delayed()->tst(scratch); // The receiver is receiver[n]. Increment count[n]. int count_offset = in_bytes(VirtualCallData::receiver_count_offset(row)); @@ -1723,20 +1725,31 @@ void InterpreterMacroAssembler::record_klass_in_profile_helper( bind(next_test); if (test_for_null_also) { + Label found_null; // Failed the equality check on receiver[n]... Test for null. if (start_row == last_row) { // The only thing left to do is handle the null case. - brx(Assembler::notZero, false, Assembler::pt, done); - delayed()->nop(); + if (is_virtual_call) { + brx(Assembler::zero, false, Assembler::pn, found_null); + delayed()->nop(); + // Receiver did not match any saved receiver and there is no empty row for it. + // Increment total counter to indicate polymorphic case. + increment_mdp_data_at(in_bytes(CounterData::count_offset()), scratch); + ba(false, done); + delayed()->nop(); + bind(found_null); + } else { + brx(Assembler::notZero, false, Assembler::pt, done); + delayed()->nop(); + } break; } // Since null is rare, make it be the branch-taken case. - Label found_null; brx(Assembler::zero, false, Assembler::pn, found_null); delayed()->nop(); // Put all the "Case 3" tests here. - record_klass_in_profile_helper(receiver, scratch, start_row + 1, done); + record_klass_in_profile_helper(receiver, scratch, start_row + 1, done, is_virtual_call); // Found a null. Keep searching for a matching receiver, // but remember that this is an empty (unused) slot. @@ -1753,16 +1766,18 @@ void InterpreterMacroAssembler::record_klass_in_profile_helper( int count_offset = in_bytes(VirtualCallData::receiver_count_offset(start_row)); mov(DataLayout::counter_increment, scratch); set_mdp_data_at(count_offset, scratch); - ba(false, done); - delayed()->nop(); + if (start_row > 0) { + ba(false, done); + delayed()->nop(); + } } void InterpreterMacroAssembler::record_klass_in_profile(Register receiver, - Register scratch) { + Register scratch, bool is_virtual_call) { assert(ProfileInterpreter, "must be profiling"); Label done; - record_klass_in_profile_helper(receiver, scratch, 0, done); + record_klass_in_profile_helper(receiver, scratch, 0, done, is_virtual_call); bind (done); } @@ -1840,7 +1855,7 @@ void InterpreterMacroAssembler::profile_typecheck(Register klass, mdp_delta = in_bytes(VirtualCallData::virtual_call_data_size()); // Record the object type. - record_klass_in_profile(klass, scratch); + record_klass_in_profile(klass, scratch, false); } // The method data pointer needs to be updated. diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp index 674611dad60..61d6a528d7c 100644 --- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp @@ -290,9 +290,9 @@ class InterpreterMacroAssembler: public MacroAssembler { void test_mdp_data_at(int offset, Register value, Label& not_equal_continue, Register scratch); - void record_klass_in_profile(Register receiver, Register scratch); + void record_klass_in_profile(Register receiver, Register scratch, bool is_virtual_call); void record_klass_in_profile_helper(Register receiver, Register scratch, - int start_row, Label& done); + int start_row, Label& done, bool is_virtual_call); void update_mdp_by_offset(int offset_of_disp, Register scratch); void update_mdp_by_offset(Register reg, int offset_of_disp, diff --git a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp index 9f0dd7166fd..d68d2b7702c 100644 --- a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -394,6 +394,11 @@ address AbstractInterpreterGenerator::generate_method_entry(AbstractInterpreter: } +bool AbstractInterpreter::can_be_compiled(methodHandle m) { + // No special entry points that preclude compilation + return true; +} + // This method tells the deoptimizer how big an interpreted frame must be: int AbstractInterpreter::size_activation(methodOop method, int tempcount, diff --git a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp index 19cd413d043..50a5b6de13b 100644 --- a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -851,10 +851,10 @@ void AdapterGenerator::gen_c2i_adapter( __ set(reg2offset(r_1) + extraspace + bias, ld_off); #else int ld_off = reg2offset(r_1) + extraspace + bias; +#endif // _LP64 #ifdef ASSERT G1_forced = true; #endif // ASSERT -#endif // _LP64 r_1 = G1_scratch->as_VMReg();// as part of the load/store shuffle if (!r_2->is_valid()) __ ld (base, ld_off, G1_scratch); else __ ldx(base, ld_off, G1_scratch); @@ -865,9 +865,11 @@ void AdapterGenerator::gen_c2i_adapter( if (sig_bt[i] == T_OBJECT || sig_bt[i] == T_ARRAY) { store_c2i_object(r, base, st_off); } else if (sig_bt[i] == T_LONG || sig_bt[i] == T_DOUBLE) { +#ifndef _LP64 if (TieredCompilation) { assert(G1_forced || sig_bt[i] != T_LONG, "should not use register args for longs"); } +#endif // _LP64 store_c2i_long(r, base, st_off, r_2->is_stack()); } else { store_c2i_int(r, base, st_off); @@ -1189,7 +1191,8 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm // VMReg max_arg, int comp_args_on_stack, // VMRegStackSlots const BasicType *sig_bt, - const VMRegPair *regs) { + const VMRegPair *regs, + AdapterFingerPrint* fingerprint) { address i2c_entry = __ pc(); AdapterGenerator agen(masm); @@ -1258,7 +1261,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm agen.gen_c2i_adapter(total_args_passed, comp_args_on_stack, sig_bt, regs, skip_fixup); __ flush(); - return new AdapterHandlerEntry(i2c_entry, c2i_entry, c2i_unverified_entry); + return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry); } diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad index 2c56575e09f..73e94021152 100644 --- a/hotspot/src/cpu/sparc/vm/sparc.ad +++ b/hotspot/src/cpu/sparc/vm/sparc.ad @@ -1,5 +1,5 @@ // -// Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. +// Copyright 1998-2010 Sun Microsystems, Inc. All Rights Reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it @@ -1885,6 +1885,10 @@ RegMask Matcher::modL_proj_mask() { return RegMask(); } +const RegMask Matcher::method_handle_invoke_SP_save_mask() { + return RegMask(); +} + %} @@ -6664,7 +6668,7 @@ instruct cmovII_imm(cmpOp cmp, flagsReg icc, iRegI dst, immI11 src) %{ ins_pipe(ialu_imm); %} -instruct cmovII_U_reg(cmpOpU cmp, flagsRegU icc, iRegI dst, iRegI src) %{ +instruct cmovIIu_reg(cmpOpU cmp, flagsRegU icc, iRegI dst, iRegI src) %{ match(Set dst (CMoveI (Binary cmp icc) (Binary dst src))); ins_cost(150); size(4); @@ -6673,7 +6677,7 @@ instruct cmovII_U_reg(cmpOpU cmp, flagsRegU icc, iRegI dst, iRegI src) %{ ins_pipe(ialu_reg); %} -instruct cmovII_U_imm(cmpOpU cmp, flagsRegU icc, iRegI dst, immI11 src) %{ +instruct cmovIIu_imm(cmpOpU cmp, flagsRegU icc, iRegI dst, immI11 src) %{ match(Set dst (CMoveI (Binary cmp icc) (Binary dst src))); ins_cost(140); size(4); @@ -6719,6 +6723,16 @@ instruct cmovNI_reg(cmpOp cmp, flagsReg icc, iRegN dst, iRegN src) %{ ins_pipe(ialu_reg); %} +// This instruction also works with CmpN so we don't need cmovNN_reg. +instruct cmovNIu_reg(cmpOpU cmp, flagsRegU icc, iRegN dst, iRegN src) %{ + match(Set dst (CMoveN (Binary cmp icc) (Binary dst src))); + ins_cost(150); + size(4); + format %{ "MOV$cmp $icc,$src,$dst" %} + ins_encode( enc_cmov_reg(cmp,dst,src, (Assembler::icc)) ); + ins_pipe(ialu_reg); +%} + instruct cmovNF_reg(cmpOpF cmp, flagsRegF fcc, iRegN dst, iRegN src) %{ match(Set dst (CMoveN (Binary cmp fcc) (Binary dst src))); ins_cost(150); @@ -6756,6 +6770,16 @@ instruct cmovPI_reg(cmpOp cmp, flagsReg icc, iRegP dst, iRegP src) %{ ins_pipe(ialu_reg); %} +instruct cmovPIu_reg(cmpOpU cmp, flagsRegU icc, iRegP dst, iRegP src) %{ + match(Set dst (CMoveP (Binary cmp icc) (Binary dst src))); + ins_cost(150); + + size(4); + format %{ "MOV$cmp $icc,$src,$dst\t! ptr" %} + ins_encode( enc_cmov_reg(cmp,dst,src, (Assembler::icc)) ); + ins_pipe(ialu_reg); +%} + instruct cmovPI_imm(cmpOp cmp, flagsReg icc, iRegP dst, immP0 src) %{ match(Set dst (CMoveP (Binary cmp icc) (Binary dst src))); ins_cost(140); @@ -6766,6 +6790,16 @@ instruct cmovPI_imm(cmpOp cmp, flagsReg icc, iRegP dst, immP0 src) %{ ins_pipe(ialu_imm); %} +instruct cmovPIu_imm(cmpOpU cmp, flagsRegU icc, iRegP dst, immP0 src) %{ + match(Set dst (CMoveP (Binary cmp icc) (Binary dst src))); + ins_cost(140); + + size(4); + format %{ "MOV$cmp $icc,$src,$dst\t! ptr" %} + ins_encode( enc_cmov_imm(cmp,dst,src, (Assembler::icc)) ); + ins_pipe(ialu_imm); +%} + instruct cmovPF_reg(cmpOpF cmp, flagsRegF fcc, iRegP dst, iRegP src) %{ match(Set dst (CMoveP (Binary cmp fcc) (Binary dst src))); ins_cost(150); @@ -6805,6 +6839,17 @@ instruct cmovFI_reg(cmpOp cmp, flagsReg icc, regF dst, regF src) %{ ins_pipe(int_conditional_float_move); %} +instruct cmovFIu_reg(cmpOpU cmp, flagsRegU icc, regF dst, regF src) %{ + match(Set dst (CMoveF (Binary cmp icc) (Binary dst src))); + ins_cost(150); + + size(4); + format %{ "FMOVS$cmp $icc,$src,$dst" %} + opcode(0x101); + ins_encode( enc_cmovf_reg(cmp,dst,src, (Assembler::icc)) ); + ins_pipe(int_conditional_float_move); +%} + // Conditional move, instruct cmovFF_reg(cmpOpF cmp, flagsRegF fcc, regF dst, regF src) %{ match(Set dst (CMoveF (Binary cmp fcc) (Binary dst src))); @@ -6838,6 +6883,17 @@ instruct cmovDI_reg(cmpOp cmp, flagsReg icc, regD dst, regD src) %{ ins_pipe(int_conditional_double_move); %} +instruct cmovDIu_reg(cmpOpU cmp, flagsRegU icc, regD dst, regD src) %{ + match(Set dst (CMoveD (Binary cmp icc) (Binary dst src))); + ins_cost(150); + + size(4); + format %{ "FMOVD$cmp $icc,$src,$dst" %} + opcode(0x102); + ins_encode( enc_cmovf_reg(cmp,dst,src, (Assembler::icc)) ); + ins_pipe(int_conditional_double_move); +%} + // Conditional move, instruct cmovDF_reg(cmpOpF cmp, flagsRegF fcc, regD dst, regD src) %{ match(Set dst (CMoveD (Binary cmp fcc) (Binary dst src))); @@ -6877,6 +6933,17 @@ instruct cmovLI_reg(cmpOp cmp, flagsReg icc, iRegL dst, iRegL src) %{ %} +instruct cmovLIu_reg(cmpOpU cmp, flagsRegU icc, iRegL dst, iRegL src) %{ + match(Set dst (CMoveL (Binary cmp icc) (Binary dst src))); + ins_cost(150); + + size(4); + format %{ "MOV$cmp $icc,$src,$dst\t! long" %} + ins_encode( enc_cmov_reg(cmp,dst,src, (Assembler::icc)) ); + ins_pipe(ialu_reg); +%} + + instruct cmovLF_reg(cmpOpF cmp, flagsRegF fcc, iRegL dst, iRegL src) %{ match(Set dst (CMoveL (Binary cmp fcc) (Binary dst src))); ins_cost(150); diff --git a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp index a2dc1501462..66c5a218dcc 100644 --- a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2862,6 +2862,9 @@ class StubGenerator: public StubCodeGenerator { // arraycopy stubs used by compilers generate_arraycopy_stubs(); + + // Don't initialize the platform math functions since sparc + // doesn't have intrinsics for these operations. } diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp index b83ed82cf13..ada795d7ea1 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp @@ -150,8 +150,7 @@ address TemplateInterpreterGenerator::generate_StackOverflowError_handler() { } -address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, bool unbox) { - assert(!unbox, "NYI");//6815692// +address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { address compiled_entry = __ pc(); Label cont; diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.cpp b/hotspot/src/cpu/x86/vm/assembler_x86.cpp index aa93bc8f23c..c22a8c1d01a 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp @@ -2251,6 +2251,7 @@ void Assembler::popf() { emit_byte(0x9D); } +#ifndef _LP64 // no 32bit push/pop on amd64 void Assembler::popl(Address dst) { // NOTE: this will adjust stack by 8byte on 64bits InstructionMark im(this); @@ -2258,6 +2259,7 @@ void Assembler::popl(Address dst) { emit_byte(0x8F); emit_operand(rax, dst); } +#endif void Assembler::prefetch_prefix(Address src) { prefix(src); @@ -2428,6 +2430,7 @@ void Assembler::pushf() { emit_byte(0x9C); } +#ifndef _LP64 // no 32bit push/pop on amd64 void Assembler::pushl(Address src) { // Note this will push 64bit on 64bit InstructionMark im(this); @@ -2435,6 +2438,7 @@ void Assembler::pushl(Address src) { emit_byte(0xFF); emit_operand(rsi, src); } +#endif void Assembler::pxor(XMMRegister dst, Address src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); @@ -5591,7 +5595,12 @@ void MacroAssembler::align(int modulus) { } void MacroAssembler::andpd(XMMRegister dst, AddressLiteral src) { - andpd(dst, as_Address(src)); + if (reachable(src)) { + andpd(dst, as_Address(src)); + } else { + lea(rscratch1, src); + andpd(dst, Address(rscratch1, 0)); + } } void MacroAssembler::andptr(Register dst, int32_t imm32) { @@ -6078,11 +6087,21 @@ void MacroAssembler::cmpxchgptr(Register reg, Address adr) { } void MacroAssembler::comisd(XMMRegister dst, AddressLiteral src) { - comisd(dst, as_Address(src)); + if (reachable(src)) { + comisd(dst, as_Address(src)); + } else { + lea(rscratch1, src); + comisd(dst, Address(rscratch1, 0)); + } } void MacroAssembler::comiss(XMMRegister dst, AddressLiteral src) { - comiss(dst, as_Address(src)); + if (reachable(src)) { + comiss(dst, as_Address(src)); + } else { + lea(rscratch1, src); + comiss(dst, Address(rscratch1, 0)); + } } @@ -7647,7 +7666,7 @@ RegisterOrConstant MacroAssembler::delayed_value_impl(intptr_t* delayed_value_ad #ifdef ASSERT Label L; - testl(tmp, tmp); + testptr(tmp, tmp); jccb(Assembler::notZero, L); hlt(); bind(L); diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.hpp b/hotspot/src/cpu/x86/vm/assembler_x86.hpp index 7aa0d0877a4..f44ae2dde48 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.hpp @@ -1244,7 +1244,9 @@ private: void pcmpestri(XMMRegister xmm1, XMMRegister xmm2, int imm8); void pcmpestri(XMMRegister xmm1, Address src, int imm8); +#ifndef _LP64 // no 32bit push/pop on amd64 void popl(Address dst); +#endif #ifdef _LP64 void popq(Address dst); @@ -1285,7 +1287,9 @@ private: // Interleave Low Bytes void punpcklbw(XMMRegister dst, XMMRegister src); +#ifndef _LP64 // no 32bit push/pop on amd64 void pushl(Address src); +#endif void pushq(Address src); diff --git a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp index f8cdb23ee82..85f370a4c61 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -301,22 +301,25 @@ void LIR_Assembler::osr_entry() { Register OSR_buf = osrBufferPointer()->as_pointer_register(); { assert(frame::interpreter_frame_monitor_size() == BasicObjectLock::size(), "adjust code below"); int monitor_offset = BytesPerWord * method()->max_locals() + - (BasicObjectLock::size() * BytesPerWord) * (number_of_locks - 1); + (2 * BytesPerWord) * (number_of_locks - 1); + // SharedRuntime::OSR_migration_begin() packs BasicObjectLocks in + // the OSR buffer using 2 word entries: first the lock and then + // the oop. for (int i = 0; i < number_of_locks; i++) { - int slot_offset = monitor_offset - ((i * BasicObjectLock::size()) * BytesPerWord); + int slot_offset = monitor_offset - ((i * 2) * BytesPerWord); #ifdef ASSERT // verify the interpreter's monitor has a non-null object { Label L; - __ cmpptr(Address(OSR_buf, slot_offset + BasicObjectLock::obj_offset_in_bytes()), (int32_t)NULL_WORD); + __ cmpptr(Address(OSR_buf, slot_offset + 1*BytesPerWord), (int32_t)NULL_WORD); __ jcc(Assembler::notZero, L); __ stop("locked object is NULL"); __ bind(L); } #endif - __ movptr(rbx, Address(OSR_buf, slot_offset + BasicObjectLock::lock_offset_in_bytes())); + __ movptr(rbx, Address(OSR_buf, slot_offset + 0)); __ movptr(frame_map()->address_for_monitor_lock(i), rbx); - __ movptr(rbx, Address(OSR_buf, slot_offset + BasicObjectLock::obj_offset_in_bytes())); + __ movptr(rbx, Address(OSR_buf, slot_offset + 1*BytesPerWord)); __ movptr(frame_map()->address_for_monitor_object(i), rbx); } } @@ -415,13 +418,12 @@ int LIR_Assembler::initial_frame_size_in_bytes() { } -void LIR_Assembler::emit_exception_handler() { +int LIR_Assembler::emit_exception_handler() { // if the last instruction is a call (typically to do a throw which // is coming at the end after block reordering) the return address // must still point into the code area in order to avoid assertion // failures when searching for the corresponding bci => add a nop // (was bug 5/14/1999 - gri) - __ nop(); // generate code for exception handler @@ -429,17 +431,14 @@ void LIR_Assembler::emit_exception_handler() { if (handler_base == NULL) { // not enough space left for the handler bailout("exception handler overflow"); - return; + return -1; } -#ifdef ASSERT - int offset = code_offset(); -#endif // ASSERT - compilation()->offsets()->set_value(CodeOffsets::Exceptions, code_offset()); + int offset = code_offset(); // if the method does not have an exception handler, then there is // no reason to search for one - if (compilation()->has_exception_handlers() || compilation()->env()->jvmti_can_post_exceptions()) { + if (compilation()->has_exception_handlers() || compilation()->env()->jvmti_can_post_on_exceptions()) { // the exception oop and pc are in rax, and rdx // no other registers need to be preserved, so invalidate them __ invalidate_registers(false, true, true, false, true, true); @@ -471,19 +470,19 @@ void LIR_Assembler::emit_exception_handler() { // unwind activation and forward exception to caller // rax,: exception __ jump(RuntimeAddress(Runtime1::entry_for(Runtime1::unwind_exception_id))); - assert(code_offset() - offset <= exception_handler_size, "overflow"); - __ end_a_stub(); + + return offset; } -void LIR_Assembler::emit_deopt_handler() { + +int LIR_Assembler::emit_deopt_handler() { // if the last instruction is a call (typically to do a throw which // is coming at the end after block reordering) the return address // must still point into the code area in order to avoid assertion // failures when searching for the corresponding bci => add a nop // (was bug 5/14/1999 - gri) - __ nop(); // generate code for exception handler @@ -491,23 +490,17 @@ void LIR_Assembler::emit_deopt_handler() { if (handler_base == NULL) { // not enough space left for the handler bailout("deopt handler overflow"); - return; + return -1; } -#ifdef ASSERT + int offset = code_offset(); -#endif // ASSERT - - compilation()->offsets()->set_value(CodeOffsets::Deopt, code_offset()); - InternalAddress here(__ pc()); __ pushptr(here.addr()); - __ jump(RuntimeAddress(SharedRuntime::deopt_blob()->unpack())); - assert(code_offset() - offset <= deopt_handler_size, "overflow"); - __ end_a_stub(); + return offset; } @@ -785,7 +778,13 @@ void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmi ShouldNotReachHere(); __ movoop(as_Address(addr, noreg), c->as_jobject()); } else { +#ifdef _LP64 + __ movoop(rscratch1, c->as_jobject()); + null_check_here = code_offset(); + __ movptr(as_Address_lo(addr), rscratch1); +#else __ movoop(as_Address(addr), c->as_jobject()); +#endif } } break; @@ -1118,8 +1117,14 @@ void LIR_Assembler::stack2stack(LIR_Opr src, LIR_Opr dest, BasicType type) { __ pushptr(frame_map()->address_for_slot(src ->single_stack_ix())); __ popptr (frame_map()->address_for_slot(dest->single_stack_ix())); } else { +#ifndef _LP64 __ pushl(frame_map()->address_for_slot(src ->single_stack_ix())); __ popl (frame_map()->address_for_slot(dest->single_stack_ix())); +#else + //no pushl on 64bits + __ movl(rscratch1, frame_map()->address_for_slot(src ->single_stack_ix())); + __ movl(frame_map()->address_for_slot(dest->single_stack_ix()), rscratch1); +#endif } } else if (src->is_double_stack()) { @@ -3136,8 +3141,10 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) { #ifdef _LP64 assert_different_registers(c_rarg0, dst, dst_pos, length); + __ movl2ptr(src_pos, src_pos); //higher 32bits must be null __ lea(c_rarg0, Address(src, src_pos, scale, arrayOopDesc::base_offset_in_bytes(basic_type))); assert_different_registers(c_rarg1, length); + __ movl2ptr(dst_pos, dst_pos); //higher 32bits must be null __ lea(c_rarg1, Address(dst, dst_pos, scale, arrayOopDesc::base_offset_in_bytes(basic_type))); __ mov(c_rarg2, length); @@ -3202,7 +3209,6 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { Register mdo = op->mdo()->as_register(); __ movoop(mdo, md->constant_encoding()); Address counter_addr(mdo, md->byte_offset_of_slot(data, CounterData::count_offset())); - __ addl(counter_addr, DataLayout::counter_increment); Bytecodes::Code bc = method->java_code_at_bci(bci); // Perform additional virtual call profiling for invokevirtual and // invokeinterface bytecodes @@ -3269,14 +3275,18 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { __ jcc(Assembler::notEqual, next_test); __ movptr(recv_addr, recv); __ movl(Address(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i))), DataLayout::counter_increment); - if (i < (VirtualCallData::row_limit() - 1)) { - __ jmp(update_done); - } + __ jmp(update_done); __ bind(next_test); } + // Receiver did not match any saved receiver and there is no empty row for it. + // Increment total counter to indicate polymorphic case. + __ addl(counter_addr, DataLayout::counter_increment); __ bind(update_done); } + } else { + // Static call + __ addl(counter_addr, DataLayout::counter_increment); } } diff --git a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp index 2e2c1364717..f98bfaa8ea3 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp @@ -755,8 +755,19 @@ void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) { } LIR_Opr addr = new_pointer_register(); - __ move(obj.result(), addr); - __ add(addr, offset.result(), addr); + LIR_Address* a; + if(offset.result()->is_constant()) { + a = new LIR_Address(obj.result(), + NOT_LP64(offset.result()->as_constant_ptr()->as_jint()) LP64_ONLY((int)offset.result()->as_constant_ptr()->as_jlong()), + as_BasicType(type)); + } else { + a = new LIR_Address(obj.result(), + offset.result(), + LIR_Address::times_1, + 0, + as_BasicType(type)); + } + __ leal(LIR_OprFact::address(a), addr); if (type == objectType) { // Write-barrier needed for Object fields. // Do the pre-write barrier, if any. diff --git a/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp b/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp index 659dcca4732..bbf96cba1f2 100644 --- a/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c1_globals_x86.hpp @@ -22,10 +22,8 @@ * */ -// // Sets the default values for platform dependent flags used by the client compiler. // (see c1_globals.hpp) -// #ifndef TIERED define_pd_global(bool, BackgroundCompilation, true ); @@ -48,27 +46,24 @@ define_pd_global(intx, Tier4BackEdgeThreshold, 100000); define_pd_global(intx, OnStackReplacePercentage, 933 ); define_pd_global(intx, FreqInlineSize, 325 ); -define_pd_global(intx, NewRatio, 12 ); define_pd_global(intx, NewSizeThreadIncrease, 4*K ); define_pd_global(intx, InitialCodeCacheSize, 160*K); define_pd_global(intx, ReservedCodeCacheSize, 32*M ); define_pd_global(bool, ProfileInterpreter, false); define_pd_global(intx, CodeCacheExpansionSize, 32*K ); define_pd_global(uintx,CodeCacheMinBlockLength, 1); -define_pd_global(uintx, PermSize, 12*M ); -define_pd_global(uintx, MaxPermSize, 64*M ); -define_pd_global(bool, NeverActAsServerClassMachine, true); -define_pd_global(uintx, DefaultMaxRAM, 1*G); +define_pd_global(uintx,PermSize, 12*M ); +define_pd_global(uintx,MaxPermSize, 64*M ); +define_pd_global(bool, NeverActAsServerClassMachine, true ); +define_pd_global(uint64_t,MaxRAM, 1ULL*G); define_pd_global(bool, CICompileOSR, true ); -#endif // TIERED +#endif // !TIERED define_pd_global(bool, UseTypeProfile, false); define_pd_global(bool, RoundFPResults, true ); - define_pd_global(bool, LIRFillDelaySlots, false); -define_pd_global(bool, OptimizeSinglePrecision, true); +define_pd_global(bool, OptimizeSinglePrecision, true ); define_pd_global(bool, CSEArrayLength, false); -define_pd_global(bool, TwoOperandLIRForm, true); +define_pd_global(bool, TwoOperandLIRForm, true ); - -define_pd_global(intx, SafepointPollOffset, 256); +define_pd_global(intx, SafepointPollOffset, 256 ); diff --git a/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp b/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp index 6b3d7250442..b299e5a5480 100644 --- a/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp @@ -22,7 +22,6 @@ * */ -// // Sets the default values for platform dependent flags used by the server compiler. // (see c2_globals.hpp). Alpha-sorted. @@ -46,8 +45,8 @@ define_pd_global(intx, CompileThreshold, 1000); define_pd_global(intx, CompileThreshold, 10000); #endif // TIERED define_pd_global(intx, Tier2CompileThreshold, 10000); -define_pd_global(intx, Tier3CompileThreshold, 20000 ); -define_pd_global(intx, Tier4CompileThreshold, 40000 ); +define_pd_global(intx, Tier3CompileThreshold, 20000); +define_pd_global(intx, Tier4CompileThreshold, 40000); define_pd_global(intx, BackEdgeThreshold, 100000); define_pd_global(intx, Tier2BackEdgeThreshold, 100000); @@ -61,7 +60,6 @@ define_pd_global(intx, FreqInlineSize, 325); #ifdef AMD64 define_pd_global(intx, INTPRESSURE, 13); define_pd_global(intx, InteriorEntryAlignment, 16); -define_pd_global(intx, NewRatio, 2); define_pd_global(intx, NewSizeThreadIncrease, ScaleForWordSize(4*K)); define_pd_global(intx, LoopUnrollLimit, 60); // InitialCodeCacheSize derived from specjbb2000 run. @@ -69,19 +67,18 @@ define_pd_global(intx, InitialCodeCacheSize, 2496*K); // Integral multip define_pd_global(intx, CodeCacheExpansionSize, 64*K); // Ergonomics related flags -define_pd_global(uintx, DefaultMaxRAM, 32*G); +define_pd_global(uint64_t,MaxRAM, 128ULL*G); #else define_pd_global(intx, INTPRESSURE, 6); define_pd_global(intx, InteriorEntryAlignment, 4); -define_pd_global(intx, NewRatio, 8); // Design center runs on 1.3.1 define_pd_global(intx, NewSizeThreadIncrease, 4*K); -define_pd_global(intx, LoopUnrollLimit, 50); // Design center runs on 1.3.1 +define_pd_global(intx, LoopUnrollLimit, 50); // Design center runs on 1.3.1 // InitialCodeCacheSize derived from specjbb2000 run. define_pd_global(intx, InitialCodeCacheSize, 2304*K); // Integral multiple of CodeCacheExpansionSize define_pd_global(intx, CodeCacheExpansionSize, 32*K); // Ergonomics related flags -define_pd_global(uintx, DefaultMaxRAM, 1*G); +define_pd_global(uint64_t,MaxRAM, 4ULL*G); #endif // AMD64 define_pd_global(intx, OptoLoopAlignment, 16); define_pd_global(intx, RegisterCostAreaRatio, 16000); @@ -97,8 +94,8 @@ define_pd_global(intx, ReservedCodeCacheSize, 48*M); define_pd_global(uintx,CodeCacheMinBlockLength, 4); // Heap related flags -define_pd_global(uintx, PermSize, ScaleForWordSize(16*M)); -define_pd_global(uintx, MaxPermSize, ScaleForWordSize(64*M)); +define_pd_global(uintx,PermSize, ScaleForWordSize(16*M)); +define_pd_global(uintx,MaxPermSize, ScaleForWordSize(64*M)); // Ergonomics related flags define_pd_global(bool, NeverActAsServerClassMachine, false); diff --git a/hotspot/src/cpu/x86/vm/frame_x86.cpp b/hotspot/src/cpu/x86/vm/frame_x86.cpp index 8ec4ba76295..01f49e3dba8 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.cpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -222,9 +222,9 @@ void frame::patch_pc(Thread* thread, address pc) { } ((address *)sp())[-1] = pc; _cb = CodeCache::find_blob(pc); - if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) { - address orig = (((nmethod*)_cb)->get_original_pc(this)); - assert(orig == _pc, "expected original to be stored before patching"); + address original_pc = nmethod::get_deopt_original_pc(this); + if (original_pc != NULL) { + assert(original_pc == _pc, "expected original PC to be stored before patching"); _deopt_state = is_deoptimized; // leave _pc as is } else { @@ -323,13 +323,63 @@ frame frame::sender_for_entry_frame(RegisterMap* map) const { return fr; } + +//------------------------------------------------------------------------------ +// frame::verify_deopt_original_pc +// +// Verifies the calculated original PC of a deoptimization PC for the +// given unextended SP. The unextended SP might also be the saved SP +// for MethodHandle call sites. +#if ASSERT +void frame::verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp, bool is_method_handle_return) { + frame fr; + + // This is ugly but it's better than to change {get,set}_original_pc + // to take an SP value as argument. And it's only a debugging + // method anyway. + fr._unextended_sp = unextended_sp; + + address original_pc = nm->get_original_pc(&fr); + assert(nm->code_contains(original_pc), "original PC must be in nmethod"); + assert(nm->is_method_handle_return(original_pc) == is_method_handle_return, "must be"); +} +#endif + + +//------------------------------------------------------------------------------ +// frame::sender_for_interpreter_frame frame frame::sender_for_interpreter_frame(RegisterMap* map) const { - // sp is the raw sp from the sender after adapter or interpreter extension - intptr_t* sp = (intptr_t*) addr_at(sender_sp_offset); + // SP is the raw SP from the sender after adapter or interpreter + // extension. + intptr_t* sender_sp = this->sender_sp(); // This is the sp before any possible extension (adapter/locals). intptr_t* unextended_sp = interpreter_frame_sender_sp(); + // Stored FP. + intptr_t* saved_fp = link(); + + address sender_pc = this->sender_pc(); + CodeBlob* sender_cb = CodeCache::find_blob_unsafe(sender_pc); + assert(sender_cb, "sanity"); + nmethod* sender_nm = sender_cb->as_nmethod_or_null(); + + if (sender_nm != NULL) { + // If the sender PC is a deoptimization point, get the original + // PC. For MethodHandle call site the unextended_sp is stored in + // saved_fp. + if (sender_nm->is_deopt_mh_entry(sender_pc)) { + DEBUG_ONLY(verify_deopt_mh_original_pc(sender_nm, saved_fp)); + unextended_sp = saved_fp; + } + else if (sender_nm->is_deopt_entry(sender_pc)) { + DEBUG_ONLY(verify_deopt_original_pc(sender_nm, unextended_sp)); + } + else if (sender_nm->is_method_handle_return(sender_pc)) { + unextended_sp = saved_fp; + } + } + // The interpreter and compiler(s) always save EBP/RBP in a known // location on entry. We must record where that location is // so this if EBP/RBP was live on callout from c2 we can find @@ -351,29 +401,52 @@ frame frame::sender_for_interpreter_frame(RegisterMap* map) const { } #endif // AMD64 } -#endif /* COMPILER2 */ - return frame(sp, unextended_sp, link(), sender_pc()); +#endif // COMPILER2 + + return frame(sender_sp, unextended_sp, saved_fp, sender_pc); } -//------------------------------sender_for_compiled_frame----------------------- +//------------------------------------------------------------------------------ +// frame::sender_for_compiled_frame frame frame::sender_for_compiled_frame(RegisterMap* map) const { assert(map != NULL, "map must be set"); - const bool c1_compiled = _cb->is_compiled_by_c1(); // frame owned by optimizing compiler - intptr_t* sender_sp = NULL; - assert(_cb->frame_size() >= 0, "must have non-zero frame size"); - sender_sp = unextended_sp() + _cb->frame_size(); + intptr_t* sender_sp = unextended_sp() + _cb->frame_size(); + intptr_t* unextended_sp = sender_sp; // On Intel the return_address is always the word on the stack address sender_pc = (address) *(sender_sp-1); - // This is the saved value of ebp which may or may not really be an fp. - // it is only an fp if the sender is an interpreter frame (or c1?) + // This is the saved value of EBP which may or may not really be an FP. + // It is only an FP if the sender is an interpreter frame (or C1?). + intptr_t* saved_fp = (intptr_t*) *(sender_sp - frame::sender_sp_offset); - intptr_t *saved_fp = (intptr_t*)*(sender_sp - frame::sender_sp_offset); + // If we are returning to a compiled MethodHandle call site, the + // saved_fp will in fact be a saved value of the unextended SP. The + // simplest way to tell whether we are returning to such a call site + // is as follows: + CodeBlob* sender_cb = CodeCache::find_blob_unsafe(sender_pc); + assert(sender_cb, "sanity"); + nmethod* sender_nm = sender_cb->as_nmethod_or_null(); + + if (sender_nm != NULL) { + // If the sender PC is a deoptimization point, get the original + // PC. For MethodHandle call site the unextended_sp is stored in + // saved_fp. + if (sender_nm->is_deopt_mh_entry(sender_pc)) { + DEBUG_ONLY(verify_deopt_mh_original_pc(sender_nm, saved_fp)); + unextended_sp = saved_fp; + } + else if (sender_nm->is_deopt_entry(sender_pc)) { + DEBUG_ONLY(verify_deopt_original_pc(sender_nm, unextended_sp)); + } + else if (sender_nm->is_method_handle_return(sender_pc)) { + unextended_sp = saved_fp; + } + } if (map->update_map()) { // Tell GC to use argument oopmaps for some runtime stubs that need it. @@ -383,7 +456,7 @@ frame frame::sender_for_compiled_frame(RegisterMap* map) const { if (_cb->oop_maps() != NULL) { OopMapSet::update_register_map(this, map); } - // Since the prolog does the save and restore of epb there is no oopmap + // Since the prolog does the save and restore of EBP there is no oopmap // for it so we must fill in its location as if there was an oopmap entry // since if our caller was compiled code there could be live jvm state in it. map->set_location(rbp->as_VMReg(), (address) (sender_sp - frame::sender_sp_offset)); @@ -399,9 +472,12 @@ frame frame::sender_for_compiled_frame(RegisterMap* map) const { } assert(sender_sp != sp(), "must have changed"); - return frame(sender_sp, saved_fp, sender_pc); + return frame(sender_sp, unextended_sp, saved_fp, sender_pc); } + +//------------------------------------------------------------------------------ +// frame::sender frame frame::sender(RegisterMap* map) const { // Default is we done have to follow them. The sender_for_xxx will // update it accordingly diff --git a/hotspot/src/cpu/x86/vm/frame_x86.hpp b/hotspot/src/cpu/x86/vm/frame_x86.hpp index 3668f2da295..b21449f8475 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.hpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.hpp @@ -163,6 +163,14 @@ return (intptr_t*) addr_at(offset); } +#if ASSERT + // Used in frame::sender_for_{interpreter,compiled}_frame + static void verify_deopt_original_pc( nmethod* nm, intptr_t* unextended_sp, bool is_method_handle_return = false); + static void verify_deopt_mh_original_pc(nmethod* nm, intptr_t* unextended_sp) { + verify_deopt_original_pc(nm, unextended_sp, true); + } +#endif + public: // Constructors diff --git a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp index c3bfdae6d01..bf68ce9270f 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,32 +35,35 @@ inline frame::frame() { _deopt_state = unknown; } -inline frame:: frame(intptr_t* sp, intptr_t* fp, address pc) { +inline frame::frame(intptr_t* sp, intptr_t* fp, address pc) { _sp = sp; _unextended_sp = sp; _fp = fp; _pc = pc; assert(pc != NULL, "no pc?"); _cb = CodeCache::find_blob(pc); - _deopt_state = not_deoptimized; - if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) { - _pc = (((nmethod*)_cb)->get_original_pc(this)); + + address original_pc = nmethod::get_deopt_original_pc(this); + if (original_pc != NULL) { + _pc = original_pc; _deopt_state = is_deoptimized; } else { _deopt_state = not_deoptimized; } } -inline frame:: frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc) { +inline frame::frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc) { _sp = sp; _unextended_sp = unextended_sp; _fp = fp; _pc = pc; assert(pc != NULL, "no pc?"); _cb = CodeCache::find_blob(pc); - _deopt_state = not_deoptimized; - if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) { - _pc = (((nmethod*)_cb)->get_original_pc(this)); + + address original_pc = nmethod::get_deopt_original_pc(this); + if (original_pc != NULL) { + _pc = original_pc; + assert(((nmethod*)_cb)->code_contains(_pc), "original PC must be in nmethod"); _deopt_state = is_deoptimized; } else { _deopt_state = not_deoptimized; @@ -86,9 +89,9 @@ inline frame::frame(intptr_t* sp, intptr_t* fp) { _cb = CodeCache::find_blob(_pc); - _deopt_state = not_deoptimized; - if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) { - _pc = (((nmethod*)_cb)->get_original_pc(this)); + address original_pc = nmethod::get_deopt_original_pc(this); + if (original_pc != NULL) { + _pc = original_pc; _deopt_state = is_deoptimized; } else { _deopt_state = not_deoptimized; @@ -225,11 +228,13 @@ inline methodOop* frame::interpreter_frame_method_addr() const { // top of expression stack inline intptr_t* frame::interpreter_frame_tos_address() const { intptr_t* last_sp = interpreter_frame_last_sp(); - if (last_sp == NULL ) { + if (last_sp == NULL) { return sp(); } else { - // sp() may have been extended by an adapter - assert(last_sp < fp() && last_sp >= sp(), "bad tos"); + // sp() may have been extended or shrunk by an adapter. At least + // check that we don't fall behind the legal region. + // For top deoptimized frame last_sp == interpreter_frame_monitor_end. + assert(last_sp <= (intptr_t*) interpreter_frame_monitor_end(), "bad tos"); return last_sp; } } diff --git a/hotspot/src/cpu/x86/vm/globals_x86.hpp b/hotspot/src/cpu/x86/vm/globals_x86.hpp index f5586c1ee56..764e7ef284a 100644 --- a/hotspot/src/cpu/x86/vm/globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp @@ -22,17 +22,16 @@ * */ -// // Sets the default values for platform dependent flags used by the runtime system. // (see globals.hpp) -// -define_pd_global(bool, ConvertSleepToYield, true); -define_pd_global(bool, ShareVtableStubs, true); -define_pd_global(bool, CountInterpCalls, true); +define_pd_global(bool, ConvertSleepToYield, true); +define_pd_global(bool, ShareVtableStubs, true); +define_pd_global(bool, CountInterpCalls, true); +define_pd_global(bool, NeedsDeoptSuspend, false); // only register window machines need this -define_pd_global(bool, ImplicitNullChecks, true); // Generate code for implicit null checks -define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap NULLs past to check cast +define_pd_global(bool, ImplicitNullChecks, true); // Generate code for implicit null checks +define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap NULLs past to check cast // See 4827828 for this change. There is no globals_core_i486.hpp. I can't // assign a different value for C2 without touching a number of files. Use @@ -42,29 +41,24 @@ define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap NUL // the uep and the vep doesn't get real alignment but just slops on by // only assured that the entry instruction meets the 5 byte size requirement. #ifdef COMPILER2 -define_pd_global(intx, CodeEntryAlignment, 32); +define_pd_global(intx, CodeEntryAlignment, 32); #else -define_pd_global(intx, CodeEntryAlignment, 16); +define_pd_global(intx, CodeEntryAlignment, 16); #endif // COMPILER2 +define_pd_global(intx, InlineFrequencyCount, 100); +define_pd_global(intx, InlineSmallCode, 1000); -define_pd_global(bool, NeedsDeoptSuspend, false); // only register window machines need this - -define_pd_global(uintx, TLABSize, 0); +define_pd_global(intx, StackYellowPages, 2); +define_pd_global(intx, StackRedPages, 1); #ifdef AMD64 -define_pd_global(uintx, NewSize, ScaleForWordSize(2048 * K)); // Very large C++ stack frames using solaris-amd64 optimized builds // due to lack of optimization caused by C++ compiler bugs define_pd_global(intx, StackShadowPages, SOLARIS_ONLY(20) NOT_SOLARIS(6) DEBUG_ONLY(+2)); #else -define_pd_global(uintx, NewSize, 1024 * K); define_pd_global(intx, StackShadowPages, 3 DEBUG_ONLY(+1)); #endif // AMD64 -define_pd_global(intx, InlineFrequencyCount, 100); -define_pd_global(intx, InlineSmallCode, 1000); -define_pd_global(intx, PreInflateSpin, 10); -define_pd_global(intx, StackYellowPages, 2); -define_pd_global(intx, StackRedPages, 1); +define_pd_global(intx, PreInflateSpin, 10); define_pd_global(bool, RewriteBytecodes, true); define_pd_global(bool, RewriteFrequentPairs, true); diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp index e06e423a43a..205e5d80de5 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -196,6 +196,9 @@ void InterpreterMacroAssembler::get_cache_index_at_bcp(Register reg, int bcp_off } else { assert(EnableInvokeDynamic, "giant index used only for EnableInvokeDynamic"); movl(reg, Address(rsi, bcp_offset)); + // Check if the secondary index definition is still ~x, otherwise + // we have to change the following assembler code to calculate the + // plain index. assert(constantPoolCacheOopDesc::decode_secondary_index(~123) == 123, "else change next line"); notl(reg); // convert to plain index } @@ -1236,17 +1239,19 @@ void InterpreterMacroAssembler::profile_virtual_call(Register receiver, Register // If no method data exists, go to profile_continue. test_method_data_pointer(mdp, profile_continue); - // We are making a call. Increment the count. - increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset())); - Label skip_receiver_profile; if (receiver_can_be_null) { + Label not_null; testptr(receiver, receiver); - jcc(Assembler::zero, skip_receiver_profile); + jccb(Assembler::notZero, not_null); + // We are making a call. Increment the count for null receiver. + increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset())); + jmp(skip_receiver_profile); + bind(not_null); } // Record the receiver type. - record_klass_in_profile(receiver, mdp, reg2); + record_klass_in_profile(receiver, mdp, reg2, true); bind(skip_receiver_profile); // The method data pointer needs to be updated to reflect the new target. @@ -1260,10 +1265,14 @@ void InterpreterMacroAssembler::profile_virtual_call(Register receiver, Register void InterpreterMacroAssembler::record_klass_in_profile_helper( Register receiver, Register mdp, - Register reg2, - int start_row, Label& done) { - if (TypeProfileWidth == 0) + Register reg2, int start_row, + Label& done, bool is_virtual_call) { + if (TypeProfileWidth == 0) { + if (is_virtual_call) { + increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset())); + } return; + } int last_row = VirtualCallData::row_limit() - 1; assert(start_row <= last_row, "must be work left to do"); @@ -1291,19 +1300,28 @@ void InterpreterMacroAssembler::record_klass_in_profile_helper( bind(next_test); if (row == start_row) { + Label found_null; // Failed the equality check on receiver[n]... Test for null. testptr(reg2, reg2); if (start_row == last_row) { // The only thing left to do is handle the null case. - jcc(Assembler::notZero, done); + if (is_virtual_call) { + jccb(Assembler::zero, found_null); + // Receiver did not match any saved receiver and there is no empty row for it. + // Increment total counter to indicate polymorphic case. + increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset())); + jmp(done); + bind(found_null); + } else { + jcc(Assembler::notZero, done); + } break; } // Since null is rare, make it be the branch-taken case. - Label found_null; jcc(Assembler::zero, found_null); // Put all the "Case 3" tests here. - record_klass_in_profile_helper(receiver, mdp, reg2, start_row + 1, done); + record_klass_in_profile_helper(receiver, mdp, reg2, start_row + 1, done, is_virtual_call); // Found a null. Keep searching for a matching receiver, // but remember that this is an empty (unused) slot. @@ -1320,16 +1338,18 @@ void InterpreterMacroAssembler::record_klass_in_profile_helper( int count_offset = in_bytes(VirtualCallData::receiver_count_offset(start_row)); movptr(reg2, (int32_t)DataLayout::counter_increment); set_mdp_data_at(mdp, count_offset, reg2); - jmp(done); + if (start_row > 0) { + jmp(done); + } } void InterpreterMacroAssembler::record_klass_in_profile(Register receiver, - Register mdp, - Register reg2) { + Register mdp, Register reg2, + bool is_virtual_call) { assert(ProfileInterpreter, "must be profiling"); Label done; - record_klass_in_profile_helper(receiver, mdp, reg2, 0, done); + record_klass_in_profile_helper(receiver, mdp, reg2, 0, done, is_virtual_call); bind (done); } @@ -1422,7 +1442,7 @@ void InterpreterMacroAssembler::profile_typecheck(Register mdp, Register klass, mdp_delta = in_bytes(VirtualCallData::virtual_call_data_size()); // Record the object type. - record_klass_in_profile(klass, mdp, reg2); + record_klass_in_profile(klass, mdp, reg2, false); assert(reg2 == rdi, "we know how to fix this blown reg"); restore_locals(); // Restore EDI } diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp index 23bca4108fa..f7d17a9fd80 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp @@ -213,10 +213,10 @@ class InterpreterMacroAssembler: public MacroAssembler { Label& not_equal_continue); void record_klass_in_profile(Register receiver, Register mdp, - Register reg2); + Register reg2, bool is_virtual_call); void record_klass_in_profile_helper(Register receiver, Register mdp, - Register reg2, - int start_row, Label& done); + Register reg2, int start_row, + Label& done, bool is_virtual_call); void update_mdp_by_offset(Register mdp_in, int offset_of_offset); void update_mdp_by_offset(Register mdp_in, Register reg, int offset_of_disp); diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp index ad449c8bdd2..62acfa226fb 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -185,12 +185,30 @@ void InterpreterMacroAssembler::get_unsigned_2_byte_index_at_bcp( } +void InterpreterMacroAssembler::get_cache_index_at_bcp(Register index, + int bcp_offset, + bool giant_index) { + assert(bcp_offset > 0, "bcp is still pointing to start of bytecode"); + if (!giant_index) { + load_unsigned_short(index, Address(r13, bcp_offset)); + } else { + assert(EnableInvokeDynamic, "giant index used only for EnableInvokeDynamic"); + movl(index, Address(r13, bcp_offset)); + // Check if the secondary index definition is still ~x, otherwise + // we have to change the following assembler code to calculate the + // plain index. + assert(constantPoolCacheOopDesc::decode_secondary_index(~123) == 123, "else change next line"); + notl(index); // convert to plain index + } +} + + void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Register index, - int bcp_offset) { - assert(bcp_offset > 0, "bcp is still pointing to start of bytecode"); + int bcp_offset, + bool giant_index) { assert(cache != index, "must use different registers"); - load_unsigned_short(index, Address(r13, bcp_offset)); + get_cache_index_at_bcp(index, bcp_offset, giant_index); movptr(cache, Address(rbp, frame::interpreter_frame_cache_offset * wordSize)); assert(sizeof(ConstantPoolCacheEntry) == 4 * wordSize, "adjust code below"); // convert from field index to ConstantPoolCacheEntry index @@ -200,10 +218,10 @@ void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register tmp, - int bcp_offset) { - assert(bcp_offset > 0, "bcp is still pointing to start of bytecode"); + int bcp_offset, + bool giant_index) { assert(cache != tmp, "must use different register"); - load_unsigned_short(tmp, Address(r13, bcp_offset)); + get_cache_index_at_bcp(tmp, bcp_offset, giant_index); assert(sizeof(ConstantPoolCacheEntry) == 4 * wordSize, "adjust code below"); // convert from field index to ConstantPoolCacheEntry index // and from word offset to byte offset @@ -1236,18 +1254,28 @@ void InterpreterMacroAssembler::profile_final_call(Register mdp) { void InterpreterMacroAssembler::profile_virtual_call(Register receiver, Register mdp, - Register reg2) { + Register reg2, + bool receiver_can_be_null) { if (ProfileInterpreter) { Label profile_continue; // If no method data exists, go to profile_continue. test_method_data_pointer(mdp, profile_continue); - // We are making a call. Increment the count. - increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset())); + Label skip_receiver_profile; + if (receiver_can_be_null) { + Label not_null; + testptr(receiver, receiver); + jccb(Assembler::notZero, not_null); + // We are making a call. Increment the count for null receiver. + increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset())); + jmp(skip_receiver_profile); + bind(not_null); + } // Record the receiver type. - record_klass_in_profile(receiver, mdp, reg2); + record_klass_in_profile(receiver, mdp, reg2, true); + bind(skip_receiver_profile); // The method data pointer needs to be updated to reflect the new target. update_mdp_by_constant(mdp, @@ -1270,10 +1298,14 @@ void InterpreterMacroAssembler::profile_virtual_call(Register receiver, // See below for example code. void InterpreterMacroAssembler::record_klass_in_profile_helper( Register receiver, Register mdp, - Register reg2, - int start_row, Label& done) { - if (TypeProfileWidth == 0) + Register reg2, int start_row, + Label& done, bool is_virtual_call) { + if (TypeProfileWidth == 0) { + if (is_virtual_call) { + increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset())); + } return; + } int last_row = VirtualCallData::row_limit() - 1; assert(start_row <= last_row, "must be work left to do"); @@ -1301,19 +1333,28 @@ void InterpreterMacroAssembler::record_klass_in_profile_helper( bind(next_test); if (test_for_null_also) { + Label found_null; // Failed the equality check on receiver[n]... Test for null. testptr(reg2, reg2); if (start_row == last_row) { // The only thing left to do is handle the null case. - jcc(Assembler::notZero, done); + if (is_virtual_call) { + jccb(Assembler::zero, found_null); + // Receiver did not match any saved receiver and there is no empty row for it. + // Increment total counter to indicate polymorphic case. + increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset())); + jmp(done); + bind(found_null); + } else { + jcc(Assembler::notZero, done); + } break; } // Since null is rare, make it be the branch-taken case. - Label found_null; jcc(Assembler::zero, found_null); // Put all the "Case 3" tests here. - record_klass_in_profile_helper(receiver, mdp, reg2, start_row + 1, done); + record_klass_in_profile_helper(receiver, mdp, reg2, start_row + 1, done, is_virtual_call); // Found a null. Keep searching for a matching receiver, // but remember that this is an empty (unused) slot. @@ -1330,7 +1371,9 @@ void InterpreterMacroAssembler::record_klass_in_profile_helper( int count_offset = in_bytes(VirtualCallData::receiver_count_offset(start_row)); movl(reg2, DataLayout::counter_increment); set_mdp_data_at(mdp, count_offset, reg2); - jmp(done); + if (start_row > 0) { + jmp(done); + } } // Example state machine code for three profile rows: @@ -1342,7 +1385,7 @@ void InterpreterMacroAssembler::record_klass_in_profile_helper( // if (row[1].rec != NULL) { // // degenerate decision tree, rooted at row[2] // if (row[2].rec == rec) { row[2].incr(); goto done; } -// if (row[2].rec != NULL) { goto done; } // overflow +// if (row[2].rec != NULL) { count.incr(); goto done; } // overflow // row[2].init(rec); goto done; // } else { // // remember row[1] is empty @@ -1355,14 +1398,15 @@ void InterpreterMacroAssembler::record_klass_in_profile_helper( // if (row[2].rec == rec) { row[2].incr(); goto done; } // row[0].init(rec); goto done; // } +// done: void InterpreterMacroAssembler::record_klass_in_profile(Register receiver, - Register mdp, - Register reg2) { + Register mdp, Register reg2, + bool is_virtual_call) { assert(ProfileInterpreter, "must be profiling"); Label done; - record_klass_in_profile_helper(receiver, mdp, reg2, 0, done); + record_klass_in_profile_helper(receiver, mdp, reg2, 0, done, is_virtual_call); bind (done); } @@ -1458,7 +1502,7 @@ void InterpreterMacroAssembler::profile_typecheck(Register mdp, Register klass, mdp_delta = in_bytes(VirtualCallData::virtual_call_data_size()); // Record the object type. - record_klass_in_profile(klass, mdp, reg2); + record_klass_in_profile(klass, mdp, reg2, false); } update_mdp_by_constant(mdp, mdp_delta); diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp index c35cb3a1940..fd935f1ed8b 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp @@ -95,9 +95,10 @@ class InterpreterMacroAssembler: public MacroAssembler { void get_unsigned_2_byte_index_at_bcp(Register reg, int bcp_offset); void get_cache_and_index_at_bcp(Register cache, Register index, - int bcp_offset); + int bcp_offset, bool giant_index = false); void get_cache_entry_pointer_at_bcp(Register cache, Register tmp, - int bcp_offset); + int bcp_offset, bool giant_index = false); + void get_cache_index_at_bcp(Register index, int bcp_offset, bool giant_index = false); void pop_ptr(Register r = rax); @@ -221,10 +222,10 @@ class InterpreterMacroAssembler: public MacroAssembler { Label& not_equal_continue); void record_klass_in_profile(Register receiver, Register mdp, - Register reg2); + Register reg2, bool is_virtual_call); void record_klass_in_profile_helper(Register receiver, Register mdp, - Register reg2, - int start_row, Label& done); + Register reg2, int start_row, + Label& done, bool is_virtual_call); void update_mdp_by_offset(Register mdp_in, int offset_of_offset); void update_mdp_by_offset(Register mdp_in, Register reg, int offset_of_disp); @@ -236,7 +237,8 @@ class InterpreterMacroAssembler: public MacroAssembler { void profile_call(Register mdp); void profile_final_call(Register mdp); void profile_virtual_call(Register receiver, Register mdp, - Register scratch2); + Register scratch2, + bool receiver_can_be_null = false); void profile_ret(Register return_bci, Register mdp); void profile_null_seen(Register mdp); void profile_typecheck(Register mdp, Register klass, Register scratch); diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp index c3cbf56cab8..6c234a33a18 100644 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp @@ -277,12 +277,11 @@ address InterpreterGenerator::generate_abstract_entry(void) { address entry_point = __ pc(); // abstract method entry - // remove return address. Not really needed, since exception - // handling throws away expression stack - __ pop(rbx); - // adjust stack to what a normal return would do - __ mov(rsp, r13); + // pop return address, reset last_sp to NULL + __ empty_expression_stack(); + __ restore_bcp(); // rsi must be correct for exception handler (was destroyed) + __ restore_locals(); // make sure locals pointer is correct as well (was destroyed) // throw exception __ call_VM(noreg, CAST_FROM_FN_PTR(address, @@ -300,7 +299,10 @@ address InterpreterGenerator::generate_method_handle_entry(void) { if (!EnableMethodHandles) { return generate_abstract_entry(); } - return generate_abstract_entry(); //6815692// + + address entry_point = MethodHandles::generate_method_handle_interpreter_entry(_masm); + + return entry_point; } diff --git a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp index a682a81b833..fc11240e030 100644 --- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp +++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp @@ -65,9 +65,9 @@ static void verify_argslot(MacroAssembler* _masm, Register rax_argslot, // Verify that argslot lies within (rsp, rbp]. Label L_ok, L_bad; __ cmpptr(rax_argslot, rbp); - __ jcc(Assembler::above, L_bad); + __ jccb(Assembler::above, L_bad); __ cmpptr(rsp, rax_argslot); - __ jcc(Assembler::below, L_ok); + __ jccb(Assembler::below, L_ok); __ bind(L_bad); __ stop(error_message); __ bind(L_ok); @@ -136,9 +136,9 @@ void MethodHandles::insert_arg_slots(MacroAssembler* _masm, if (arg_slots.is_register()) { Label L_ok, L_bad; __ cmpptr(arg_slots.as_register(), (int32_t) NULL_WORD); - __ jcc(Assembler::greater, L_bad); + __ jccb(Assembler::greater, L_bad); __ testl(arg_slots.as_register(), -stack_move_unit() - 1); - __ jcc(Assembler::zero, L_ok); + __ jccb(Assembler::zero, L_ok); __ bind(L_bad); __ stop("assert arg_slots <= 0 and clear low bits"); __ bind(L_ok); @@ -173,7 +173,7 @@ void MethodHandles::insert_arg_slots(MacroAssembler* _masm, __ movptr(Address(rdx_temp, arg_slots, Address::times_ptr), rbx_temp); __ addptr(rdx_temp, wordSize); __ cmpptr(rdx_temp, rax_argslot); - __ jcc(Assembler::less, loop); + __ jccb(Assembler::less, loop); } // Now move the argslot down, to point to the opened-up space. @@ -211,9 +211,9 @@ void MethodHandles::remove_arg_slots(MacroAssembler* _masm, Label L_ok, L_bad; __ lea(rbx_temp, Address(rax_argslot, arg_slots, Address::times_ptr)); __ cmpptr(rbx_temp, rbp); - __ jcc(Assembler::above, L_bad); + __ jccb(Assembler::above, L_bad); __ cmpptr(rsp, rax_argslot); - __ jcc(Assembler::below, L_ok); + __ jccb(Assembler::below, L_ok); __ bind(L_bad); __ stop("deleted argument(s) must fall within current frame"); __ bind(L_ok); @@ -221,9 +221,9 @@ void MethodHandles::remove_arg_slots(MacroAssembler* _masm, if (arg_slots.is_register()) { Label L_ok, L_bad; __ cmpptr(arg_slots.as_register(), (int32_t) NULL_WORD); - __ jcc(Assembler::less, L_bad); + __ jccb(Assembler::less, L_bad); __ testl(arg_slots.as_register(), -stack_move_unit() - 1); - __ jcc(Assembler::zero, L_ok); + __ jccb(Assembler::zero, L_ok); __ bind(L_bad); __ stop("assert arg_slots >= 0 and clear low bits"); __ bind(L_ok); @@ -258,7 +258,7 @@ void MethodHandles::remove_arg_slots(MacroAssembler* _masm, __ movptr(Address(rdx_temp, arg_slots, Address::times_ptr), rbx_temp); __ addptr(rdx_temp, -wordSize); __ cmpptr(rdx_temp, rsp); - __ jcc(Assembler::greaterEqual, loop); + __ jccb(Assembler::greaterEqual, loop); } // Now move the argslot up, to point to the just-copied block. @@ -268,8 +268,9 @@ void MethodHandles::remove_arg_slots(MacroAssembler* _masm, } #ifndef PRODUCT +extern "C" void print_method_handle(oop mh); void trace_method_handle_stub(const char* adaptername, - oopDesc* mh, + oop mh, intptr_t* entry_sp, intptr_t* saved_sp, intptr_t* saved_bp) { @@ -280,6 +281,7 @@ void trace_method_handle_stub(const char* adaptername, adaptername, (intptr_t)mh, (intptr_t)entry_sp, (intptr_t)(saved_sp - entry_sp), (intptr_t)(base_sp - last_sp), (intptr_t)saved_bp); if (last_sp != saved_sp) printf("*** last_sp="INTPTR_FORMAT"\n", (intptr_t)last_sp); + if (Verbose) print_method_handle(mh); } #endif //PRODUCT @@ -382,11 +384,11 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan // FIXME: fill in _raise_exception_method with a suitable sun.dyn method __ movptr(rbx_method, ExternalAddress((address) &_raise_exception_method)); __ testptr(rbx_method, rbx_method); - __ jcc(Assembler::zero, no_method); + __ jccb(Assembler::zero, no_method); int jobject_oop_offset = 0; __ movptr(rbx_method, Address(rbx_method, jobject_oop_offset)); // dereference the jobject __ testptr(rbx_method, rbx_method); - __ jcc(Assembler::zero, no_method); + __ jccb(Assembler::zero, no_method); __ verify_oop(rbx_method); __ push(rdi_pc); // and restore caller PC __ jmp(rbx_method_fie); @@ -448,7 +450,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan rbx_index, Address::times_ptr, base + vtableEntry::method_offset_in_bytes()); Register rbx_method = rbx_temp; - __ movl(rbx_method, vtable_entry_addr); + __ movptr(rbx_method, vtable_entry_addr); __ verify_oop(rbx_method); __ jmp(rbx_method_fie); @@ -533,16 +535,15 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan if (arg_type == T_OBJECT) { __ movptr(Address(rax_argslot, 0), rbx_temp); } else { - __ load_sized_value(rbx_temp, prim_value_addr, + __ load_sized_value(rdx_temp, prim_value_addr, type2aelembytes(arg_type), is_signed_subword_type(arg_type)); - __ movptr(Address(rax_argslot, 0), rbx_temp); + __ movptr(Address(rax_argslot, 0), rdx_temp); #ifndef _LP64 if (arg_slots == 2) { - __ movl(rbx_temp, prim_value_addr.plus_disp(wordSize)); - __ movl(Address(rax_argslot, Interpreter::stackElementSize()), rbx_temp); + __ movl(rdx_temp, prim_value_addr.plus_disp(wordSize)); + __ movl(Address(rax_argslot, Interpreter::stackElementSize()), rdx_temp); } #endif //_LP64 - break; } if (direct_to_method) { @@ -584,7 +585,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan Label done; __ movptr(rdx_temp, vmarg); __ testl(rdx_temp, rdx_temp); - __ jcc(Assembler::zero, done); // no cast if null + __ jccb(Assembler::zero, done); // no cast if null __ load_klass(rdx_temp, rdx_temp); // live at this point: @@ -675,24 +676,24 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan // (now we are done with the old MH) // original 32-bit vmdata word must be of this form: - // | MBZ:16 | signBitCount:8 | srcDstTypes:8 | conversionOp:8 | - __ xchgl(rcx, rbx_vminfo); // free rcx for shifts + // | MBZ:6 | signBitCount:8 | srcDstTypes:8 | conversionOp:8 | + __ xchgptr(rcx, rbx_vminfo); // free rcx for shifts __ shll(rdx_temp /*, rcx*/); Label zero_extend, done; __ testl(rcx, CONV_VMINFO_SIGN_FLAG); - __ jcc(Assembler::zero, zero_extend); + __ jccb(Assembler::zero, zero_extend); // this path is taken for int->byte, int->short __ sarl(rdx_temp /*, rcx*/); - __ jmp(done); + __ jmpb(done); __ bind(zero_extend); // this is taken for int->char __ shrl(rdx_temp /*, rcx*/); __ bind(done); - __ movptr(vmarg, rdx_temp); - __ xchgl(rcx, rbx_vminfo); // restore rcx_recv + __ movl(vmarg, rdx_temp); + __ xchgptr(rcx, rbx_vminfo); // restore rcx_recv __ jump_to_method_handle_entry(rcx_recv, rdx_temp); } @@ -861,7 +862,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan // Verify that argslot > destslot, by at least swap_bytes. Label L_ok; __ cmpptr(rax_argslot, rbx_destslot); - __ jcc(Assembler::aboveEqual, L_ok); + __ jccb(Assembler::aboveEqual, L_ok); __ stop("source must be above destination (upward rotation)"); __ bind(L_ok); } @@ -877,7 +878,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan __ movptr(Address(rax_argslot, swap_bytes), rdx_temp); __ addptr(rax_argslot, -wordSize); __ cmpptr(rax_argslot, rbx_destslot); - __ jcc(Assembler::aboveEqual, loop); + __ jccb(Assembler::aboveEqual, loop); } else { __ addptr(rax_argslot, swap_bytes); #ifdef ASSERT @@ -885,7 +886,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan // Verify that argslot < destslot, by at least swap_bytes. Label L_ok; __ cmpptr(rax_argslot, rbx_destslot); - __ jcc(Assembler::belowEqual, L_ok); + __ jccb(Assembler::belowEqual, L_ok); __ stop("source must be below destination (downward rotation)"); __ bind(L_ok); } @@ -901,7 +902,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan __ movptr(Address(rax_argslot, -swap_bytes), rdx_temp); __ addptr(rax_argslot, wordSize); __ cmpptr(rax_argslot, rbx_destslot); - __ jcc(Assembler::belowEqual, loop); + __ jccb(Assembler::belowEqual, loop); } // pop the original first chunk into the destination slot, now free @@ -967,7 +968,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan __ addptr(rax_argslot, wordSize); __ addptr(rdx_newarg, wordSize); __ cmpptr(rdx_newarg, rbx_oldarg); - __ jcc(Assembler::less, loop); + __ jccb(Assembler::less, loop); __ pop(rdi); // restore temp @@ -1119,7 +1120,7 @@ void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHan } __ addptr(rax_argslot, Interpreter::stackElementSize()); __ cmpptr(rax_argslot, rdx_argslot_limit); - __ jcc(Assembler::less, loop); + __ jccb(Assembler::less, loop); } else if (length_constant == 0) { __ bind(skip_array_check); // nothing to copy diff --git a/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp b/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp index 5a0de22f475..428d239d494 100644 --- a/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/runtime_x86_32.cpp @@ -43,11 +43,11 @@ ExceptionBlob* OptoRuntime::_exception_blob; // This code is entered with a jmp. // // Arguments: -// rax,: exception oop +// rax: exception oop // rdx: exception pc // // Results: -// rax,: exception oop +// rax: exception oop // rdx: exception pc in caller or ??? // destination: exception handler of caller // @@ -113,17 +113,17 @@ void OptoRuntime::generate_exception_blob() { __ addptr(rsp, return_off * wordSize); // Epilog! __ pop(rdx); // Exception pc + // rax: exception handler for given - // rax,: exception handler for given + // Restore SP from BP if the exception PC is a MethodHandle call. + __ cmpl(Address(rcx, JavaThread::is_method_handle_exception_offset()), 0); + __ cmovptr(Assembler::notEqual, rsp, rbp); // We have a handler in rax, (could be deopt blob) // rdx - throwing pc, deopt blob will need it. __ push(rax); - // rcx contains handler address - - __ get_thread(rcx); // TLS // Get the exception __ movptr(rax, Address(rcx, JavaThread::exception_oop_offset())); // Get the exception pc in case we are deoptimized @@ -137,7 +137,7 @@ void OptoRuntime::generate_exception_blob() { __ pop(rcx); - // rax,: exception oop + // rax: exception oop // rcx: exception handler // rdx: exception pc __ jmp (rcx); diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp index da845f9bd1c..886aa61214c 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -907,7 +907,8 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm int total_args_passed, int comp_args_on_stack, const BasicType *sig_bt, - const VMRegPair *regs) { + const VMRegPair *regs, + AdapterFingerPrint* fingerprint) { address i2c_entry = __ pc(); gen_i2c_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs); @@ -954,7 +955,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm gen_c2i_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs, skip_fixup); __ flush(); - return new AdapterHandlerEntry(i2c_entry, c2i_entry, c2i_unverified_entry); + return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry); } int SharedRuntime::c_calling_convention(const BasicType *sig_bt, diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp index 68cb61979db..e09b91d387d 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -638,6 +638,10 @@ static void gen_i2c_adapter(MacroAssembler *masm, __ movptr(rax, Address(rsp, 0)); + // Must preserve original SP for loading incoming arguments because + // we need to align the outgoing SP for compiled code. + __ movptr(r11, rsp); + // Cut-out for having no stack args. Since up to 2 int/oop args are passed // in registers, we will occasionally have no stack args. int comp_words_on_stack = 0; @@ -661,6 +665,10 @@ static void gen_i2c_adapter(MacroAssembler *masm, // as far as the placement of the call instruction __ push(rax); + // Put saved SP in another register + const Register saved_sp = rax; + __ movptr(saved_sp, r11); + // Will jump to the compiled code just as if compiled code was doing it. // Pre-load the register-jump target early, to schedule it better. __ movptr(r11, Address(rbx, in_bytes(methodOopDesc::from_compiled_offset()))); @@ -680,11 +688,7 @@ static void gen_i2c_adapter(MacroAssembler *masm, assert(!regs[i].second()->is_valid() || regs[i].first()->next() == regs[i].second(), "scrambled load targets?"); // Load in argument order going down. - // int ld_off = (total_args_passed + comp_words_on_stack -i)*wordSize; - // base ld_off on r13 (sender_sp) as the stack alignment makes offsets from rsp - // unpredictable - int ld_off = ((total_args_passed - 1) - i)*Interpreter::stackElementSize(); - + int ld_off = (total_args_passed - i)*Interpreter::stackElementSize() + Interpreter::value_offset_in_bytes(); // Point to interpreter value (vs. tag) int next_off = ld_off - Interpreter::stackElementSize(); // @@ -699,10 +703,14 @@ static void gen_i2c_adapter(MacroAssembler *masm, if (r_1->is_stack()) { // Convert stack slot to an SP offset (+ wordSize to account for return address ) int st_off = regs[i].first()->reg2stack()*VMRegImpl::stack_slot_size + wordSize; + + // We can use r13 as a temp here because compiled code doesn't need r13 as an input + // and if we end up going thru a c2i because of a miss a reasonable value of r13 + // will be generated. if (!r_2->is_valid()) { // sign extend??? - __ movl(rax, Address(r13, ld_off)); - __ movptr(Address(rsp, st_off), rax); + __ movl(r13, Address(saved_sp, ld_off)); + __ movptr(Address(rsp, st_off), r13); } else { // // We are using two optoregs. This can be either T_OBJECT, T_ADDRESS, T_LONG, or T_DOUBLE @@ -715,9 +723,9 @@ static void gen_i2c_adapter(MacroAssembler *masm, // ld_off is MSW so get LSW const int offset = (sig_bt[i]==T_LONG||sig_bt[i]==T_DOUBLE)? next_off : ld_off; - __ movq(rax, Address(r13, offset)); + __ movq(r13, Address(saved_sp, offset)); // st_off is LSW (i.e. reg.first()) - __ movq(Address(rsp, st_off), rax); + __ movq(Address(rsp, st_off), r13); } } else if (r_1->is_Register()) { // Register argument Register r = r_1->as_Register(); @@ -732,16 +740,16 @@ static void gen_i2c_adapter(MacroAssembler *masm, next_off : ld_off; // this can be a misaligned move - __ movq(r, Address(r13, offset)); + __ movq(r, Address(saved_sp, offset)); } else { // sign extend and use a full word? - __ movl(r, Address(r13, ld_off)); + __ movl(r, Address(saved_sp, ld_off)); } } else { if (!r_2->is_valid()) { - __ movflt(r_1->as_XMMRegister(), Address(r13, ld_off)); + __ movflt(r_1->as_XMMRegister(), Address(saved_sp, ld_off)); } else { - __ movdbl(r_1->as_XMMRegister(), Address(r13, next_off)); + __ movdbl(r_1->as_XMMRegister(), Address(saved_sp, next_off)); } } } @@ -770,7 +778,8 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm int total_args_passed, int comp_args_on_stack, const BasicType *sig_bt, - const VMRegPair *regs) { + const VMRegPair *regs, + AdapterFingerPrint* fingerprint) { address i2c_entry = __ pc(); gen_i2c_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs); @@ -816,7 +825,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm gen_c2i_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs, skip_fixup); __ flush(); - return new AdapterHandlerEntry(i2c_entry, c2i_entry, c2i_unverified_entry); + return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry); } int SharedRuntime::c_calling_convention(const BasicType *sig_bt, @@ -3319,6 +3328,10 @@ void OptoRuntime::generate_exception_blob() { // rax: exception handler + // Restore SP from BP if the exception PC is a MethodHandle call. + __ cmpl(Address(r15_thread, JavaThread::is_method_handle_exception_offset()), 0); + __ cmovptr(Assembler::notEqual, rsp, rbp); + // We have a handler in rax (could be deopt blob). __ mov(r8, rax); diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp index 3d6ca91a0ea..18f2fb7bcc7 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -718,10 +718,8 @@ class StubGenerator: public StubCodeGenerator { case BarrierSet::G1SATBCTLogging: { __ pusha(); // push registers - __ push(count); - __ push(start); - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre))); - __ addptr(rsp, 2*wordSize); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre), + start, count); __ popa(); } break; @@ -752,10 +750,8 @@ class StubGenerator: public StubCodeGenerator { case BarrierSet::G1SATBCTLogging: { __ pusha(); // push registers - __ push(count); - __ push(start); - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post))); - __ addptr(rsp, 2*wordSize); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post), + start, count); __ popa(); } break; @@ -2030,6 +2026,54 @@ class StubGenerator: public StubCodeGenerator { entry_checkcast_arraycopy); } + void generate_math_stubs() { + { + StubCodeMark mark(this, "StubRoutines", "log"); + StubRoutines::_intrinsic_log = (double (*)(double)) __ pc(); + + __ fld_d(Address(rsp, 4)); + __ flog(); + __ ret(0); + } + { + StubCodeMark mark(this, "StubRoutines", "log10"); + StubRoutines::_intrinsic_log10 = (double (*)(double)) __ pc(); + + __ fld_d(Address(rsp, 4)); + __ flog10(); + __ ret(0); + } + { + StubCodeMark mark(this, "StubRoutines", "sin"); + StubRoutines::_intrinsic_sin = (double (*)(double)) __ pc(); + + __ fld_d(Address(rsp, 4)); + __ trigfunc('s'); + __ ret(0); + } + { + StubCodeMark mark(this, "StubRoutines", "cos"); + StubRoutines::_intrinsic_cos = (double (*)(double)) __ pc(); + + __ fld_d(Address(rsp, 4)); + __ trigfunc('c'); + __ ret(0); + } + { + StubCodeMark mark(this, "StubRoutines", "tan"); + StubRoutines::_intrinsic_tan = (double (*)(double)) __ pc(); + + __ fld_d(Address(rsp, 4)); + __ trigfunc('t'); + __ ret(0); + } + + // The intrinsic version of these seem to return the same value as + // the strict version. + StubRoutines::_intrinsic_exp = SharedRuntime::dexp; + StubRoutines::_intrinsic_pow = SharedRuntime::dpow; + } + public: // Information about frame layout at time of blocking runtime call. // Note that we only have to preserve callee-saved registers since @@ -2228,6 +2272,8 @@ class StubGenerator: public StubCodeGenerator { MethodHandles::generate_method_handle_stub(_masm, ek); } } + + generate_math_stubs(); } diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp index 6b0731490fd..9415241f11d 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1172,7 +1172,7 @@ class StubGenerator: public StubCodeGenerator { __ movptr(c_rarg0, addr); __ movptr(c_rarg1, count); } - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre))); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre), 2); __ popa(); } break; @@ -1212,7 +1212,7 @@ class StubGenerator: public StubCodeGenerator { __ shrptr(scratch, LogBytesPerHeapOop); // convert to element count __ mov(c_rarg0, start); __ mov(c_rarg1, scratch); - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post))); + __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post), 2); __ popa(); } break; @@ -2731,6 +2731,79 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::_arrayof_oop_arraycopy = StubRoutines::_oop_arraycopy; } + void generate_math_stubs() { + { + StubCodeMark mark(this, "StubRoutines", "log"); + StubRoutines::_intrinsic_log = (double (*)(double)) __ pc(); + + __ subq(rsp, 8); + __ movdbl(Address(rsp, 0), xmm0); + __ fld_d(Address(rsp, 0)); + __ flog(); + __ fstp_d(Address(rsp, 0)); + __ movdbl(xmm0, Address(rsp, 0)); + __ addq(rsp, 8); + __ ret(0); + } + { + StubCodeMark mark(this, "StubRoutines", "log10"); + StubRoutines::_intrinsic_log10 = (double (*)(double)) __ pc(); + + __ subq(rsp, 8); + __ movdbl(Address(rsp, 0), xmm0); + __ fld_d(Address(rsp, 0)); + __ flog10(); + __ fstp_d(Address(rsp, 0)); + __ movdbl(xmm0, Address(rsp, 0)); + __ addq(rsp, 8); + __ ret(0); + } + { + StubCodeMark mark(this, "StubRoutines", "sin"); + StubRoutines::_intrinsic_sin = (double (*)(double)) __ pc(); + + __ subq(rsp, 8); + __ movdbl(Address(rsp, 0), xmm0); + __ fld_d(Address(rsp, 0)); + __ trigfunc('s'); + __ fstp_d(Address(rsp, 0)); + __ movdbl(xmm0, Address(rsp, 0)); + __ addq(rsp, 8); + __ ret(0); + } + { + StubCodeMark mark(this, "StubRoutines", "cos"); + StubRoutines::_intrinsic_cos = (double (*)(double)) __ pc(); + + __ subq(rsp, 8); + __ movdbl(Address(rsp, 0), xmm0); + __ fld_d(Address(rsp, 0)); + __ trigfunc('c'); + __ fstp_d(Address(rsp, 0)); + __ movdbl(xmm0, Address(rsp, 0)); + __ addq(rsp, 8); + __ ret(0); + } + { + StubCodeMark mark(this, "StubRoutines", "tan"); + StubRoutines::_intrinsic_tan = (double (*)(double)) __ pc(); + + __ subq(rsp, 8); + __ movdbl(Address(rsp, 0), xmm0); + __ fld_d(Address(rsp, 0)); + __ trigfunc('t'); + __ fstp_d(Address(rsp, 0)); + __ movdbl(xmm0, Address(rsp, 0)); + __ addq(rsp, 8); + __ ret(0); + } + + // The intrinsic version of these seem to return the same value as + // the strict version. + StubRoutines::_intrinsic_exp = SharedRuntime::dexp; + StubRoutines::_intrinsic_pow = SharedRuntime::dpow; + } + #undef __ #define __ masm-> @@ -2935,6 +3008,18 @@ class StubGenerator: public StubCodeGenerator { // arraycopy stubs used by compilers generate_arraycopy_stubs(); + + // generic method handle stubs + if (EnableMethodHandles && SystemDictionary::MethodHandle_klass() != NULL) { + for (MethodHandles::EntryKind ek = MethodHandles::_EK_FIRST; + ek < MethodHandles::_EK_LIMIT; + ek = MethodHandles::EntryKind(1 + (int)ek)) { + StubCodeMark mark(this, "MethodHandle", MethodHandles::entry_name(ek)); + MethodHandles::generate_method_handle_stub(_masm, ek); + } + } + + generate_math_stubs(); } public: diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp index b78f0e2a066..eecfb3fd114 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -155,15 +155,8 @@ address TemplateInterpreterGenerator::generate_continuation_for(TosState state) } -address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, bool unbox) { +address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { TosState incoming_state = state; - if (EnableInvokeDynamic) { - if (unbox) { - incoming_state = atos; - } - } else { - assert(!unbox, "old behavior"); - } Label interpreter_entry; address compiled_entry = __ pc(); @@ -216,46 +209,6 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, __ restore_bcp(); __ restore_locals(); - Label L_fail; - - if (unbox && state != atos) { - // cast and unbox - BasicType type = as_BasicType(state); - if (type == T_BYTE) type = T_BOOLEAN; // FIXME - KlassHandle boxk = SystemDictionaryHandles::box_klass(type); - __ mov32(rbx, ExternalAddress((address) boxk.raw_value())); - __ testl(rax, rax); - Label L_got_value, L_get_value; - // convert nulls to zeroes (avoid NPEs here) - if (!(type == T_FLOAT || type == T_DOUBLE)) { - // if rax already contains zero bits, forge ahead - __ jcc(Assembler::zero, L_got_value); - } else { - __ jcc(Assembler::notZero, L_get_value); - __ fldz(); - __ jmp(L_got_value); - } - __ bind(L_get_value); - __ cmp32(rbx, Address(rax, oopDesc::klass_offset_in_bytes())); - __ jcc(Assembler::notEqual, L_fail); - int offset = java_lang_boxing_object::value_offset_in_bytes(type); - // Cf. TemplateTable::getfield_or_static - switch (type) { - case T_BYTE: // fall through: - case T_BOOLEAN: __ load_signed_byte(rax, Address(rax, offset)); break; - case T_CHAR: __ load_unsigned_short(rax, Address(rax, offset)); break; - case T_SHORT: __ load_signed_short(rax, Address(rax, offset)); break; - case T_INT: __ movl(rax, Address(rax, offset)); break; - case T_FLOAT: __ fld_s(Address(rax, offset)); break; - case T_DOUBLE: __ fld_d(Address(rax, offset)); break; - // Access to java.lang.Double.value does not need to be atomic: - case T_LONG: { __ movl(rdx, Address(rax, offset + 4)); - __ movl(rax, Address(rax, offset + 0)); } break; - default: ShouldNotReachHere(); - } - __ bind(L_got_value); - } - Label L_got_cache, L_giant_index; if (EnableInvokeDynamic) { __ cmpb(Address(rsi, 0), Bytecodes::_invokedynamic); @@ -263,32 +216,6 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, } __ get_cache_and_index_at_bcp(rbx, rcx, 1, false); __ bind(L_got_cache); - if (unbox && state == atos) { - // insert a casting conversion, to keep verifier sane - Label L_ok, L_ok_pops; - __ testl(rax, rax); - __ jcc(Assembler::zero, L_ok); - __ push(rax); // save the object to check - __ push(rbx); // save CP cache reference - __ movl(rdx, Address(rax, oopDesc::klass_offset_in_bytes())); - __ movl(rbx, Address(rbx, rcx, - Address::times_4, constantPoolCacheOopDesc::base_offset() + - ConstantPoolCacheEntry::f1_offset())); - __ movl(rbx, Address(rbx, __ delayed_value(sun_dyn_CallSiteImpl::type_offset_in_bytes, rcx))); - __ movl(rbx, Address(rbx, __ delayed_value(java_dyn_MethodType::rtype_offset_in_bytes, rcx))); - __ movl(rax, Address(rbx, __ delayed_value(java_lang_Class::klass_offset_in_bytes, rcx))); - __ check_klass_subtype(rdx, rax, rbx, L_ok_pops); - __ pop(rcx); // pop and discard CP cache - __ mov(rbx, rax); // target supertype into rbx for L_fail - __ pop(rax); // failed object into rax for L_fail - __ jmp(L_fail); - - __ bind(L_ok_pops); - // restore pushed temp regs: - __ pop(rbx); - __ pop(rax); - __ bind(L_ok); - } __ movl(rbx, Address(rbx, rcx, Address::times_ptr, constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::flags_offset())); @@ -301,14 +228,6 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, __ bind(L_giant_index); __ get_cache_and_index_at_bcp(rbx, rcx, 1, true); __ jmp(L_got_cache); - - if (unbox) { - __ bind(L_fail); - __ push(rbx); // missed klass (required) - __ push(rax); // bad object (actual) - __ movptr(rdx, ExternalAddress((address) &Interpreter::_throw_WrongMethodType_entry)); - __ call(rdx); - } } return entry; @@ -1512,6 +1431,23 @@ address AbstractInterpreterGenerator::generate_method_entry(AbstractInterpreter: } +// These should never be compiled since the interpreter will prefer +// the compiled version to the intrinsic version. +bool AbstractInterpreter::can_be_compiled(methodHandle m) { + switch (method_kind(m)) { + case Interpreter::java_lang_math_sin : // fall thru + case Interpreter::java_lang_math_cos : // fall thru + case Interpreter::java_lang_math_tan : // fall thru + case Interpreter::java_lang_math_abs : // fall thru + case Interpreter::java_lang_math_log : // fall thru + case Interpreter::java_lang_math_log10 : // fall thru + case Interpreter::java_lang_math_sqrt : + return false; + default: + return true; + } +} + // How much stack a method activation needs in words. int AbstractInterpreter::size_top_interpreter_activation(methodOop method) { @@ -1569,7 +1505,10 @@ int AbstractInterpreter::layout_activation(methodOop method, if (interpreter_frame != NULL) { #ifdef ASSERT - assert(caller->unextended_sp() == interpreter_frame->interpreter_frame_sender_sp(), "Frame not properly walkable"); + if (!EnableMethodHandles) + // @@@ FIXME: Should we correct interpreter_frame_sender_sp in the calling sequences? + // Probably, since deoptimization doesn't work yet. + assert(caller->unextended_sp() == interpreter_frame->interpreter_frame_sender_sp(), "Frame not properly walkable"); assert(caller->sp() == interpreter_frame->sender_sp(), "Frame not properly walkable(2)"); #endif diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp index 4f0c3c9f779..44225441635 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -100,21 +100,26 @@ address TemplateInterpreterGenerator::generate_ClassCastException_handler() { return entry; } -// Arguments are: required type in rarg1, failing object (or NULL) in rarg2 +// Arguments are: required type at TOS+8, failing object (or NULL) at TOS+4. address TemplateInterpreterGenerator::generate_WrongMethodType_handler() { address entry = __ pc(); __ pop(c_rarg2); // failing object is at TOS __ pop(c_rarg1); // required type is at TOS+8 - // expression stack must be empty before entering the VM if an - // exception happened + __ verify_oop(c_rarg1); + __ verify_oop(c_rarg2); + + // Various method handle types use interpreter registers as temps. + __ restore_bcp(); + __ restore_locals(); + + // Expression stack must be empty before entering the VM for an exception. __ empty_expression_stack(); __ call_VM(noreg, CAST_FROM_FN_PTR(address, - InterpreterRuntime:: - throw_WrongMethodTypeException), + InterpreterRuntime::throw_WrongMethodTypeException), // pass required type, failing object (or NULL) c_rarg1, c_rarg2); return entry; @@ -166,8 +171,7 @@ address TemplateInterpreterGenerator::generate_continuation_for(TosState state) address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, - int step, bool unbox) { - assert(!unbox, "NYI");//6815692// + int step) { // amd64 doesn't need to do anything special about compiled returns // to the interpreter so the code that exists on x86 to place a sentinel @@ -183,15 +187,29 @@ address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, __ restore_bcp(); __ restore_locals(); - __ get_cache_and_index_at_bcp(rbx, rcx, 1); + Label L_got_cache, L_giant_index; + if (EnableInvokeDynamic) { + __ cmpb(Address(r13, 0), Bytecodes::_invokedynamic); + __ jcc(Assembler::equal, L_giant_index); + } + __ get_cache_and_index_at_bcp(rbx, rcx, 1, false); + __ bind(L_got_cache); __ movl(rbx, Address(rbx, rcx, - Address::times_8, + Address::times_ptr, in_bytes(constantPoolCacheOopDesc::base_offset()) + 3 * wordSize)); __ andl(rbx, 0xFF); if (TaggedStackInterpreter) __ shll(rbx, 1); // 2 slots per parameter. __ lea(rsp, Address(rsp, rbx, Address::times_8)); __ dispatch_next(state, step); + + // out of the main line of code... + if (EnableInvokeDynamic) { + __ bind(L_giant_index); + __ get_cache_and_index_at_bcp(rbx, rcx, 1, true); + __ jmp(L_got_cache); + } + return entry; } @@ -431,8 +449,12 @@ void InterpreterGenerator::generate_stack_overflow_check(void) { __ addptr(rax, stack_base); __ subptr(rax, stack_size); + // Use the maximum number of pages we might bang. + const int max_pages = StackShadowPages > (StackRedPages+StackYellowPages) ? StackShadowPages : + (StackRedPages+StackYellowPages); + // add in the red and yellow zone sizes - __ addptr(rax, (StackRedPages + StackYellowPages) * page_size); + __ addptr(rax, max_pages * page_size); // check against the current stack bottom __ cmpptr(rsp, rax); @@ -1434,6 +1456,23 @@ address AbstractInterpreterGenerator::generate_method_entry( generate_normal_entry(synchronized); } +// These should never be compiled since the interpreter will prefer +// the compiled version to the intrinsic version. +bool AbstractInterpreter::can_be_compiled(methodHandle m) { + switch (method_kind(m)) { + case Interpreter::java_lang_math_sin : // fall thru + case Interpreter::java_lang_math_cos : // fall thru + case Interpreter::java_lang_math_tan : // fall thru + case Interpreter::java_lang_math_abs : // fall thru + case Interpreter::java_lang_math_log : // fall thru + case Interpreter::java_lang_math_log10 : // fall thru + case Interpreter::java_lang_math_sqrt : + return false; + default: + return true; + } +} + // How much stack a method activation needs in words. int AbstractInterpreter::size_top_interpreter_activation(methodOop method) { const int entry_size = frame::interpreter_frame_monitor_size(); @@ -1484,8 +1523,10 @@ int AbstractInterpreter::layout_activation(methodOop method, tempcount* Interpreter::stackElementWords() + popframe_extra_args; if (interpreter_frame != NULL) { #ifdef ASSERT - assert(caller->unextended_sp() == interpreter_frame->interpreter_frame_sender_sp(), - "Frame not properly walkable"); + if (!EnableMethodHandles) + // @@@ FIXME: Should we correct interpreter_frame_sender_sp in the calling sequences? + // Probably, since deoptimization doesn't work yet. + assert(caller->unextended_sp() == interpreter_frame->interpreter_frame_sender_sp(), "Frame not properly walkable"); assert(caller->sp() == interpreter_frame->sender_sp(), "Frame not properly walkable(2)"); #endif diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp index 50ae3190953..8959b341023 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp @@ -2890,9 +2890,6 @@ void TemplateTable::count_calls(Register method, Register temp) { void TemplateTable::prepare_invoke(Register method, Register index, int byte_no) { - bool is_invdyn_bootstrap = (byte_no < 0); - if (is_invdyn_bootstrap) byte_no = -byte_no; - // determine flags Bytecodes::Code code = bytecode(); const bool is_invokeinterface = code == Bytecodes::_invokeinterface; @@ -2907,8 +2904,6 @@ void TemplateTable::prepare_invoke(Register method, Register index, int byte_no) const Register flags = rdx; assert_different_registers(method, index, recv, flags); - assert(!is_invdyn_bootstrap || is_invokedynamic, "byte_no<0 hack only for invdyn"); - // save 'interpreter return address' __ save_bcp(); @@ -2944,9 +2939,7 @@ void TemplateTable::prepare_invoke(Register method, Register index, int byte_no) // load return address { address table_addr; - if (is_invdyn_bootstrap) - table_addr = (address)Interpreter::return_5_unbox_addrs_by_index_table(); - else if (is_invokeinterface || is_invokedynamic) + if (is_invokeinterface || is_invokedynamic) table_addr = (address)Interpreter::return_5_addrs_by_index_table(); else table_addr = (address)Interpreter::return_3_addrs_by_index_table(); @@ -3153,54 +3146,10 @@ void TemplateTable::invokedynamic(int byte_no) { __ profile_call(rsi); } - Label handle_unlinked_site; - __ movptr(rcx, Address(rax, __ delayed_value(sun_dyn_CallSiteImpl::target_offset_in_bytes, rcx))); - __ testptr(rcx, rcx); - __ jcc(Assembler::zero, handle_unlinked_site); - + __ movptr(rcx, Address(rax, __ delayed_value(java_dyn_CallSite::target_offset_in_bytes, rcx))); + __ null_check(rcx); __ prepare_to_jump_from_interpreted(); __ jump_to_method_handle_entry(rcx, rdx); - - // Initial calls come here... - __ bind(handle_unlinked_site); - __ pop(rcx); // remove return address pushed by prepare_invoke - - // box stacked arguments into an array for the bootstrap method - address entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::bootstrap_invokedynamic); - __ restore_bcp(); // rsi must be correct for call_VM - __ call_VM(rax, entry, rax); - __ movl(rdi, rax); // protect bootstrap MH from prepare_invoke - - // recompute return address - __ restore_bcp(); // rsi must be correct for prepare_invoke - prepare_invoke(rax, rbx, -byte_no); // smashes rcx, rdx - // rax: CallSite object (f1) - // rbx: unused (f2) - // rdi: bootstrap MH - // rdx: flags - - // now load up the arglist, which has been neatly boxed - __ get_thread(rcx); - __ movptr(rdx, Address(rcx, JavaThread::vm_result_2_offset())); - __ movptr(Address(rcx, JavaThread::vm_result_2_offset()), NULL_WORD); - __ verify_oop(rdx); - // rdx = arglist - - // save SP now, before we add the bootstrap call to the stack - // We must preserve a fiction that the original arguments are outgoing, - // because the return sequence will reset the stack to this point - // and then pop all those arguments. It seems error-prone to use - // a different argument list size just for bootstrapping. - __ prepare_to_jump_from_interpreted(); - - // Now let's play adapter, pushing the real arguments on the stack. - __ pop(rbx); // return PC - __ push(rdi); // boot MH - __ push(rax); // call site - __ push(rdx); // arglist - __ push(rbx); // return PC, again - __ mov(rcx, rdi); - __ jump_to_method_handle_entry(rcx, rdx); } //---------------------------------------------------------------------------------------------------- diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp index 1180227b59f..fdd492a7495 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp @@ -203,18 +203,15 @@ void TemplateTable::patch_bytecode(Bytecodes::Code bytecode, Register bc, __ jcc(Assembler::notEqual, fast_patch); __ get_method(scratch); // Let breakpoint table handling rewrite to quicker bytecode - __ call_VM(noreg, - CAST_FROM_FN_PTR(address, - InterpreterRuntime::set_original_bytecode_at), - scratch, r13, bc); + __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::set_original_bytecode_at), scratch, r13, bc); #ifndef ASSERT __ jmpb(patch_done); - __ bind(fast_patch); - } #else __ jmp(patch_done); +#endif __ bind(fast_patch); } +#ifdef ASSERT Label okay; __ load_unsigned_byte(scratch, at_bcp(0)); __ cmpl(scratch, (int) Bytecodes::java_code(bytecode)); @@ -2054,26 +2051,28 @@ void TemplateTable::volatile_barrier(Assembler::Membar_mask_bits } } -void TemplateTable::resolve_cache_and_index(int byte_no, - Register Rcache, - Register index) { +void TemplateTable::resolve_cache_and_index(int byte_no, Register Rcache, Register index) { assert(byte_no == 1 || byte_no == 2, "byte_no out of range"); + bool is_invokedynamic = (bytecode() == Bytecodes::_invokedynamic); const Register temp = rbx; assert_different_registers(Rcache, index, temp); const int shift_count = (1 + byte_no) * BitsPerByte; Label resolved; - __ get_cache_and_index_at_bcp(Rcache, index, 1); - __ movl(temp, Address(Rcache, - index, Address::times_8, - constantPoolCacheOopDesc::base_offset() + - ConstantPoolCacheEntry::indices_offset())); - __ shrl(temp, shift_count); - // have we resolved this bytecode? - __ andl(temp, 0xFF); - __ cmpl(temp, (int) bytecode()); - __ jcc(Assembler::equal, resolved); + __ get_cache_and_index_at_bcp(Rcache, index, 1, is_invokedynamic); + if (is_invokedynamic) { + // we are resolved if the f1 field contains a non-null CallSite object + __ cmpptr(Address(Rcache, index, Address::times_ptr, constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::f1_offset()), (int32_t) NULL_WORD); + __ jcc(Assembler::notEqual, resolved); + } else { + __ movl(temp, Address(Rcache, index, Address::times_ptr, constantPoolCacheOopDesc::base_offset() + ConstantPoolCacheEntry::indices_offset())); + __ shrl(temp, shift_count); + // have we resolved this bytecode? + __ andl(temp, 0xFF); + __ cmpl(temp, (int) bytecode()); + __ jcc(Assembler::equal, resolved); + } // resolve first time through address entry; @@ -2090,6 +2089,9 @@ void TemplateTable::resolve_cache_and_index(int byte_no, case Bytecodes::_invokeinterface: entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invoke); break; + case Bytecodes::_invokedynamic: + entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invokedynamic); + break; default: ShouldNotReachHere(); break; @@ -2098,7 +2100,7 @@ void TemplateTable::resolve_cache_and_index(int byte_no, __ call_VM(noreg, entry, temp); // Update registers with resolved info - __ get_cache_and_index_at_bcp(Rcache, index, 1); + __ get_cache_and_index_at_bcp(Rcache, index, 1, is_invokedynamic); __ bind(resolved); } @@ -2832,15 +2834,14 @@ void TemplateTable::count_calls(Register method, Register temp) { ShouldNotReachHere(); } -void TemplateTable::prepare_invoke(Register method, - Register index, - int byte_no, - Bytecodes::Code code) { +void TemplateTable::prepare_invoke(Register method, Register index, int byte_no) { // determine flags + Bytecodes::Code code = bytecode(); const bool is_invokeinterface = code == Bytecodes::_invokeinterface; + const bool is_invokedynamic = code == Bytecodes::_invokedynamic; const bool is_invokevirtual = code == Bytecodes::_invokevirtual; const bool is_invokespecial = code == Bytecodes::_invokespecial; - const bool load_receiver = code != Bytecodes::_invokestatic; + const bool load_receiver = (code != Bytecodes::_invokestatic && code != Bytecodes::_invokedynamic); const bool receiver_null_check = is_invokespecial; const bool save_flags = is_invokeinterface || is_invokevirtual; // setup registers & access constant pool cache @@ -2858,9 +2859,13 @@ void TemplateTable::prepare_invoke(Register method, __ movl(recv, flags); __ andl(recv, 0xFF); if (TaggedStackInterpreter) __ shll(recv, 1); // index*2 - __ movptr(recv, Address(rsp, recv, Address::times_8, - -Interpreter::expr_offset_in_bytes(1))); - __ verify_oop(recv); + Address recv_addr(rsp, recv, Address::times_8, -Interpreter::expr_offset_in_bytes(1)); + if (is_invokedynamic) { + __ lea(recv, recv_addr); + } else { + __ movptr(recv, recv_addr); + __ verify_oop(recv); + } } // do null check if needed @@ -2878,10 +2883,14 @@ void TemplateTable::prepare_invoke(Register method, ConstantPoolCacheEntry::verify_tosBits(); // load return address { - ExternalAddress return_5((address)Interpreter::return_5_addrs_by_index_table()); - ExternalAddress return_3((address)Interpreter::return_3_addrs_by_index_table()); - __ lea(rscratch1, (is_invokeinterface ? return_5 : return_3)); - __ movptr(flags, Address(rscratch1, flags, Address::times_8)); + address table_addr; + if (is_invokeinterface || is_invokedynamic) + table_addr = (address)Interpreter::return_5_addrs_by_index_table(); + else + table_addr = (address)Interpreter::return_3_addrs_by_index_table(); + ExternalAddress table(table_addr); + __ lea(rscratch1, table); + __ movptr(flags, Address(rscratch1, flags, Address::times_ptr)); } // push return address @@ -2947,7 +2956,7 @@ void TemplateTable::invokevirtual_helper(Register index, void TemplateTable::invokevirtual(int byte_no) { transition(vtos, vtos); - prepare_invoke(rbx, noreg, byte_no, bytecode()); + prepare_invoke(rbx, noreg, byte_no); // rbx: index // rcx: receiver @@ -2959,7 +2968,7 @@ void TemplateTable::invokevirtual(int byte_no) { void TemplateTable::invokespecial(int byte_no) { transition(vtos, vtos); - prepare_invoke(rbx, noreg, byte_no, bytecode()); + prepare_invoke(rbx, noreg, byte_no); // do the call __ verify_oop(rbx); __ profile_call(rax); @@ -2969,7 +2978,7 @@ void TemplateTable::invokespecial(int byte_no) { void TemplateTable::invokestatic(int byte_no) { transition(vtos, vtos); - prepare_invoke(rbx, noreg, byte_no, bytecode()); + prepare_invoke(rbx, noreg, byte_no); // do the call __ verify_oop(rbx); __ profile_call(rax); @@ -2983,7 +2992,7 @@ void TemplateTable::fast_invokevfinal(int byte_no) { void TemplateTable::invokeinterface(int byte_no) { transition(vtos, vtos); - prepare_invoke(rax, rbx, byte_no, bytecode()); + prepare_invoke(rax, rbx, byte_no); // rax: Interface // rbx: index @@ -3072,7 +3081,24 @@ void TemplateTable::invokedynamic(int byte_no) { return; } - __ stop("invokedynamic NYI");//6815692// + prepare_invoke(rax, rbx, byte_no); + + // rax: CallSite object (f1) + // rbx: unused (f2) + // rcx: receiver address + // rdx: flags (unused) + + if (ProfileInterpreter) { + Label L; + // %%% should make a type profile for any invokedynamic that takes a ref argument + // profile this call + __ profile_call(r13); + } + + __ movptr(rcx, Address(rax, __ delayed_value(java_dyn_CallSite::target_offset_in_bytes, rcx))); + __ null_check(rcx); + __ prepare_to_jump_from_interpreted(); + __ jump_to_method_handle_entry(rcx, rdx); } @@ -3212,17 +3238,19 @@ void TemplateTable::_new() { __ xorl(rcx, rcx); // use zero reg to clear memory (shorter code) __ store_klass_gap(rax, rcx); // zero klass gap for compressed oops __ store_klass(rax, rsi); // store klass last + + { + SkipIfEqual skip(_masm, &DTraceAllocProbes, false); + // Trigger dtrace event for fastpath + __ push(atos); // save the return value + __ call_VM_leaf( + CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc), rax); + __ pop(atos); // restore the return value + + } __ jmp(done); } - { - SkipIfEqual skip(_masm, &DTraceAllocProbes, false); - // Trigger dtrace event for fastpath - __ push(atos); // save the return value - __ call_VM_leaf( - CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc), rax); - __ pop(atos); // restore the return value - } // slow case __ bind(slow_case); diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp index ec531a7bc1a..6a9fdf9ed90 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp @@ -22,8 +22,7 @@ * */ - static void prepare_invoke(Register method, Register index, int byte_no, - Bytecodes::Code code); + static void prepare_invoke(Register method, Register index, int byte_no); static void invokevirtual_helper(Register index, Register recv, Register flags); static void volatile_barrier(Assembler::Membar_mask_bits order_constraint); diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp index ae8efb86939..5965fd3ead8 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp @@ -255,6 +255,8 @@ void VM_Version::get_processor_features() { if (!VM_Version::supports_sse2()) { vm_exit_during_initialization("Unknown x64 processor: SSE2 not supported"); } + // in 64 bit the use of SSE2 is the minimum + if (UseSSE < 2) UseSSE = 2; #endif // If the OS doesn't support SSE, we can't use this feature even if the HW does diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad index 71657a809bf..4fe1fd22df3 100644 --- a/hotspot/src/cpu/x86/vm/x86_32.ad +++ b/hotspot/src/cpu/x86/vm/x86_32.ad @@ -235,6 +235,11 @@ reg_class xdb_reg7( XMM7a,XMM7b ); //----------SOURCE BLOCK------------------------------------------------------- // This is a block of C++ code which provides values, functions, and // definitions necessary in the rest of the architecture description +source_hpp %{ +// Must be visible to the DFA in dfa_x86_32.cpp +extern bool is_operand_hi32_zero(Node* n); +%} + source %{ #define RELOC_IMM32 Assembler::imm_operand #define RELOC_DISP32 Assembler::disp32_operand @@ -268,22 +273,36 @@ static jlong *double_signmask_pool = double_quadword(&fp_signmask_pool[2*2], CON static jlong *float_signflip_pool = double_quadword(&fp_signmask_pool[3*2], CONST64(0x8000000080000000), CONST64(0x8000000080000000)); static jlong *double_signflip_pool = double_quadword(&fp_signmask_pool[4*2], CONST64(0x8000000000000000), CONST64(0x8000000000000000)); +// Offset hacking within calls. +static int pre_call_FPU_size() { + if (Compile::current()->in_24_bit_fp_mode()) + return 6; // fldcw + return 0; +} + +static int preserve_SP_size() { + return LP64_ONLY(1 +) 2; // [rex,] op, rm(reg/reg) +} + // !!!!! Special hack to get all type of calls to specify the byte offset // from the start of the call to the point where the return address // will point. int MachCallStaticJavaNode::ret_addr_offset() { - return 5 + (Compile::current()->in_24_bit_fp_mode() ? 6 : 0); // 5 bytes from start of call to where return address points + int offset = 5 + pre_call_FPU_size(); // 5 bytes from start of call to where return address points + if (_method_handle_invoke) + offset += preserve_SP_size(); + return offset; } int MachCallDynamicJavaNode::ret_addr_offset() { - return 10 + (Compile::current()->in_24_bit_fp_mode() ? 6 : 0); // 10 bytes from start of call to where return address points + return 10 + pre_call_FPU_size(); // 10 bytes from start of call to where return address points } static int sizeof_FFree_Float_Stack_All = -1; int MachCallRuntimeNode::ret_addr_offset() { assert(sizeof_FFree_Float_Stack_All != -1, "must have been emitted already"); - return sizeof_FFree_Float_Stack_All + 5 + (Compile::current()->in_24_bit_fp_mode() ? 6 : 0); + return sizeof_FFree_Float_Stack_All + 5 + pre_call_FPU_size(); } // Indicate if the safepoint node needs the polling page as an input. @@ -299,8 +318,16 @@ bool SafePointNode::needs_polling_address_input() { // The address of the call instruction needs to be 4-byte aligned to // ensure that it does not span a cache line so that it can be patched. int CallStaticJavaDirectNode::compute_padding(int current_offset) const { - if (Compile::current()->in_24_bit_fp_mode()) - current_offset += 6; // skip fldcw in pre_call_FPU, if any + current_offset += pre_call_FPU_size(); // skip fldcw, if any + current_offset += 1; // skip call opcode byte + return round_to(current_offset, alignment_required()) - current_offset; +} + +// The address of the call instruction needs to be 4-byte aligned to +// ensure that it does not span a cache line so that it can be patched. +int CallStaticJavaHandleNode::compute_padding(int current_offset) const { + current_offset += pre_call_FPU_size(); // skip fldcw, if any + current_offset += preserve_SP_size(); // skip mov rbp, rsp current_offset += 1; // skip call opcode byte return round_to(current_offset, alignment_required()) - current_offset; } @@ -308,8 +335,7 @@ int CallStaticJavaDirectNode::compute_padding(int current_offset) const { // The address of the call instruction needs to be 4-byte aligned to // ensure that it does not span a cache line so that it can be patched. int CallDynamicJavaDirectNode::compute_padding(int current_offset) const { - if (Compile::current()->in_24_bit_fp_mode()) - current_offset += 6; // skip fldcw in pre_call_FPU, if any + current_offset += pre_call_FPU_size(); // skip fldcw, if any current_offset += 5; // skip MOV instruction current_offset += 1; // skip call opcode byte return round_to(current_offset, alignment_required()) - current_offset; @@ -1460,6 +1486,25 @@ RegMask Matcher::modL_proj_mask() { return RegMask(); } +const RegMask Matcher::method_handle_invoke_SP_save_mask() { + return EBP_REG_mask; +} + +// Returns true if the high 32 bits of the value is known to be zero. +bool is_operand_hi32_zero(Node* n) { + int opc = n->Opcode(); + if (opc == Op_LoadUI2L) { + return true; + } + if (opc == Op_AndL) { + Node* o2 = n->in(2); + if (o2->is_Con() && (o2->get_long() & 0xFFFFFFFF00000000LL) == 0LL) { + return true; + } + } + return false; +} + %} //----------ENCODING BLOCK----------------------------------------------------- @@ -1772,10 +1817,13 @@ encode %{ enc_class pre_call_FPU %{ // If method sets FPU control word restore it here + debug_only(int off0 = cbuf.code_size()); if( Compile::current()->in_24_bit_fp_mode() ) { MacroAssembler masm(&cbuf); masm.fldcw(ExternalAddress(StubRoutines::addr_fpu_cntrl_wrd_std())); } + debug_only(int off1 = cbuf.code_size()); + assert(off1 - off0 == pre_call_FPU_size(), "correct size prediction"); %} enc_class post_call_FPU %{ @@ -1786,6 +1834,21 @@ encode %{ } %} + enc_class preserve_SP %{ + debug_only(int off0 = cbuf.code_size()); + MacroAssembler _masm(&cbuf); + // RBP is preserved across all calls, even compiled calls. + // Use it to preserve RSP in places where the callee might change the SP. + __ movptr(rbp, rsp); + debug_only(int off1 = cbuf.code_size()); + assert(off1 - off0 == preserve_SP_size(), "correct size prediction"); + %} + + enc_class restore_SP %{ + MacroAssembler _masm(&cbuf); + __ movptr(rsp, rbp); + %} + enc_class Java_Static_Call (method meth) %{ // JAVA STATIC CALL // CALL to fixup routine. Fixup routine uses ScopeDesc info to determine // who we intended to call. @@ -8556,6 +8619,63 @@ instruct mulL_eReg(eADXRegL dst, eRegL src, eRegI tmp, eFlagsReg cr) %{ ins_pipe( pipe_slow ); %} +// Multiply Register Long where the left operand's high 32 bits are zero +instruct mulL_eReg_lhi0(eADXRegL dst, eRegL src, eRegI tmp, eFlagsReg cr) %{ + predicate(is_operand_hi32_zero(n->in(1))); + match(Set dst (MulL dst src)); + effect(KILL cr, TEMP tmp); + ins_cost(2*100+2*400); +// Basic idea: lo(result) = lo(x_lo * y_lo) +// hi(result) = hi(x_lo * y_lo) + lo(x_lo * y_hi) where lo(x_hi * y_lo) = 0 because x_hi = 0 + format %{ "MOV $tmp,$src.hi\n\t" + "IMUL $tmp,EAX\n\t" + "MUL EDX:EAX,$src.lo\n\t" + "ADD EDX,$tmp" %} + ins_encode %{ + __ movl($tmp$$Register, HIGH_FROM_LOW($src$$Register)); + __ imull($tmp$$Register, rax); + __ mull($src$$Register); + __ addl(rdx, $tmp$$Register); + %} + ins_pipe( pipe_slow ); +%} + +// Multiply Register Long where the right operand's high 32 bits are zero +instruct mulL_eReg_rhi0(eADXRegL dst, eRegL src, eRegI tmp, eFlagsReg cr) %{ + predicate(is_operand_hi32_zero(n->in(2))); + match(Set dst (MulL dst src)); + effect(KILL cr, TEMP tmp); + ins_cost(2*100+2*400); +// Basic idea: lo(result) = lo(x_lo * y_lo) +// hi(result) = hi(x_lo * y_lo) + lo(x_hi * y_lo) where lo(x_lo * y_hi) = 0 because y_hi = 0 + format %{ "MOV $tmp,$src.lo\n\t" + "IMUL $tmp,EDX\n\t" + "MUL EDX:EAX,$src.lo\n\t" + "ADD EDX,$tmp" %} + ins_encode %{ + __ movl($tmp$$Register, $src$$Register); + __ imull($tmp$$Register, rdx); + __ mull($src$$Register); + __ addl(rdx, $tmp$$Register); + %} + ins_pipe( pipe_slow ); +%} + +// Multiply Register Long where the left and the right operands' high 32 bits are zero +instruct mulL_eReg_hi0(eADXRegL dst, eRegL src, eFlagsReg cr) %{ + predicate(is_operand_hi32_zero(n->in(1)) && is_operand_hi32_zero(n->in(2))); + match(Set dst (MulL dst src)); + effect(KILL cr); + ins_cost(1*400); +// Basic idea: lo(result) = lo(x_lo * y_lo) +// hi(result) = hi(x_lo * y_lo) where lo(x_hi * y_lo) = 0 and lo(x_lo * y_hi) = 0 because x_hi = 0 and y_hi = 0 + format %{ "MUL EDX:EAX,$src.lo\n\t" %} + ins_encode %{ + __ mull($src$$Register); + %} + ins_pipe( pipe_slow ); +%} + // Multiply Register Long by small constant instruct mulL_eReg_con(eADXRegL dst, immL_127 src, eRegI tmp, eFlagsReg cr) %{ match(Set dst (MulL dst src)); @@ -13406,6 +13526,7 @@ instruct cmovXX_reg_LEGT(cmpOp_commute cmp, flagsReg_long_LEGT flags, regX dst, // compute_padding() functions will have to be adjusted. instruct CallStaticJavaDirect(method meth) %{ match(CallStaticJava); + predicate(! ((CallStaticJavaNode*)n)->is_method_handle_invoke()); effect(USE meth); ins_cost(300); @@ -13420,6 +13541,30 @@ instruct CallStaticJavaDirect(method meth) %{ ins_alignment(4); %} +// Call Java Static Instruction (method handle version) +// Note: If this code changes, the corresponding ret_addr_offset() and +// compute_padding() functions will have to be adjusted. +instruct CallStaticJavaHandle(method meth, eBPRegP ebp) %{ + match(CallStaticJava); + predicate(((CallStaticJavaNode*)n)->is_method_handle_invoke()); + effect(USE meth); + // EBP is saved by all callees (for interpreter stack correction). + // We use it here for a similar purpose, in {preserve,restore}_SP. + + ins_cost(300); + format %{ "CALL,static/MethodHandle " %} + opcode(0xE8); /* E8 cd */ + ins_encode( pre_call_FPU, + preserve_SP, + Java_Static_Call( meth ), + restore_SP, + call_epilog, + post_call_FPU ); + ins_pipe( pipe_slow ); + ins_pc_relative(1); + ins_alignment(4); +%} + // Call Java Dynamic Instruction // Note: If this code changes, the corresponding ret_addr_offset() and // compute_padding() functions will have to be adjusted. diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad index 5927b5081a7..86e28eed7ea 100644 --- a/hotspot/src/cpu/x86/vm/x86_64.ad +++ b/hotspot/src/cpu/x86/vm/x86_64.ad @@ -551,12 +551,19 @@ source %{ #define __ _masm. +static int preserve_SP_size() { + return LP64_ONLY(1 +) 2; // [rex,] op, rm(reg/reg) +} + // !!!!! Special hack to get all types of calls to specify the byte offset // from the start of the call to the point where the return address // will point. int MachCallStaticJavaNode::ret_addr_offset() { - return 5; // 5 bytes from start of call to where return address points + int offset = 5; // 5 bytes from start of call to where return address points + if (_method_handle_invoke) + offset += preserve_SP_size(); + return offset; } int MachCallDynamicJavaNode::ret_addr_offset() @@ -587,6 +594,15 @@ int CallStaticJavaDirectNode::compute_padding(int current_offset) const return round_to(current_offset, alignment_required()) - current_offset; } +// The address of the call instruction needs to be 4-byte aligned to +// ensure that it does not span a cache line so that it can be patched. +int CallStaticJavaHandleNode::compute_padding(int current_offset) const +{ + current_offset += preserve_SP_size(); // skip mov rbp, rsp + current_offset += 1; // skip call opcode byte + return round_to(current_offset, alignment_required()) - current_offset; +} + // The address of the call instruction needs to be 4-byte aligned to // ensure that it does not span a cache line so that it can be patched. int CallDynamicJavaDirectNode::compute_padding(int current_offset) const @@ -2113,6 +2129,10 @@ RegMask Matcher::modL_proj_mask() { return LONG_RDX_REG_mask; } +const RegMask Matcher::method_handle_invoke_SP_save_mask() { + return PTR_RBP_REG_mask; +} + static Address build_address(int b, int i, int s, int d) { Register index = as_Register(i); Address::ScaleFactor scale = (Address::ScaleFactor)s; @@ -2608,6 +2628,21 @@ encode %{ RELOC_DISP32); %} + enc_class preserve_SP %{ + debug_only(int off0 = cbuf.code_size()); + MacroAssembler _masm(&cbuf); + // RBP is preserved across all calls, even compiled calls. + // Use it to preserve RSP in places where the callee might change the SP. + __ movptr(rbp, rsp); + debug_only(int off1 = cbuf.code_size()); + assert(off1 - off0 == preserve_SP_size(), "correct size prediction"); + %} + + enc_class restore_SP %{ + MacroAssembler _masm(&cbuf); + __ movptr(rsp, rbp); + %} + enc_class Java_Static_Call(method meth) %{ // JAVA STATIC CALL @@ -12526,9 +12561,9 @@ instruct safePoint_poll(rFlagsReg cr) // Call Java Static Instruction // Note: If this code changes, the corresponding ret_addr_offset() and // compute_padding() functions will have to be adjusted. -instruct CallStaticJavaDirect(method meth) -%{ +instruct CallStaticJavaDirect(method meth) %{ match(CallStaticJava); + predicate(!((CallStaticJavaNode*) n)->is_method_handle_invoke()); effect(USE meth); ins_cost(300); @@ -12540,6 +12575,28 @@ instruct CallStaticJavaDirect(method meth) ins_alignment(4); %} +// Call Java Static Instruction (method handle version) +// Note: If this code changes, the corresponding ret_addr_offset() and +// compute_padding() functions will have to be adjusted. +instruct CallStaticJavaHandle(method meth, rbp_RegP rbp) %{ + match(CallStaticJava); + predicate(((CallStaticJavaNode*) n)->is_method_handle_invoke()); + effect(USE meth); + // RBP is saved by all callees (for interpreter stack correction). + // We use it here for a similar purpose, in {preserve,restore}_SP. + + ins_cost(300); + format %{ "call,static/MethodHandle " %} + opcode(0xE8); /* E8 cd */ + ins_encode(preserve_SP, + Java_Static_Call(meth), + restore_SP, + call_epilog); + ins_pipe(pipe_slow); + ins_pc_relative(1); + ins_alignment(4); +%} + // Call Java Dynamic Instruction // Note: If this code changes, the corresponding ret_addr_offset() and // compute_padding() functions will have to be adjusted. diff --git a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp index 8c99fbf4556..4f94d8851c4 100644 --- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp @@ -1,6 +1,6 @@ /* * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2007, 2008, 2009 Red Hat, Inc. + * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -145,7 +145,7 @@ void CppInterpreter::main_loop(int recurse, TRAPS) { } else if (istate->msg() == BytecodeInterpreter::return_from_method) { // Copy the result into the caller's frame - result_slots = type2size[method->result_type()]; + result_slots = type2size[result_type_of(method)]; assert(result_slots >= 0 && result_slots <= 2, "what?"); result = istate->stack() + result_slots; break; @@ -204,6 +204,20 @@ void CppInterpreter::native_entry(methodOop method, intptr_t UNUSED, TRAPS) { goto unwind_and_return; } + // Update the invocation counter + if ((UseCompiler || CountCompiledCalls) && !method->is_synchronized()) { + thread->set_do_not_unlock(); + InvocationCounter *counter = method->invocation_counter(); + counter->increment(); + if (counter->reached_InvocationLimit()) { + CALL_VM_NOCHECK( + InterpreterRuntime::frequency_counter_overflow(thread, NULL)); + if (HAS_PENDING_EXCEPTION) + goto unwind_and_return; + } + thread->clr_do_not_unlock(); + } + // Lock if necessary BasicObjectLock *monitor; monitor = NULL; @@ -231,7 +245,7 @@ void CppInterpreter::native_entry(methodOop method, intptr_t UNUSED, TRAPS) { if (handlerAddr == NULL) { CALL_VM_NOCHECK(InterpreterRuntime::prepare_native_call(thread, method)); if (HAS_PENDING_EXCEPTION) - goto unwind_and_return; + goto unlock_unwind_and_return; handlerAddr = method->signature_handler(); assert(handlerAddr != NULL, "eh?"); @@ -240,7 +254,7 @@ void CppInterpreter::native_entry(methodOop method, intptr_t UNUSED, TRAPS) { CALL_VM_NOCHECK(handlerAddr = InterpreterRuntime::slow_signature_handler(thread, method, NULL,NULL)); if (HAS_PENDING_EXCEPTION) - goto unwind_and_return; + goto unlock_unwind_and_return; } handler = \ InterpreterRuntime::SignatureHandler::from_handlerAddr(handlerAddr); @@ -351,10 +365,10 @@ void CppInterpreter::native_entry(methodOop method, intptr_t UNUSED, TRAPS) { // Reset handle block thread->active_handles()->clear(); - // Unlock if necessary. It seems totally wrong that this - // is skipped in the event of an exception but apparently - // the template interpreter does this so we do too. - if (monitor && !HAS_PENDING_EXCEPTION) { + unlock_unwind_and_return: + + // Unlock if necessary + if (monitor) { BasicLock *lock = monitor->lock(); markOop header = lock->displaced_header(); oop rcvr = monitor->obj(); @@ -380,9 +394,10 @@ void CppInterpreter::native_entry(methodOop method, intptr_t UNUSED, TRAPS) { // Push our result if (!HAS_PENDING_EXCEPTION) { - stack->set_sp(stack->sp() - type2size[method->result_type()]); + BasicType type = result_type_of(method); + stack->set_sp(stack->sp() - type2size[type]); - switch (method->result_type()) { + switch (type) { case T_VOID: break; @@ -693,6 +708,26 @@ int AbstractInterpreter::BasicType_as_index(BasicType type) { return i; } +BasicType CppInterpreter::result_type_of(methodOop method) { + BasicType t; + switch (method->result_index()) { + case 0 : t = T_BOOLEAN; break; + case 1 : t = T_CHAR; break; + case 2 : t = T_BYTE; break; + case 3 : t = T_SHORT; break; + case 4 : t = T_INT; break; + case 5 : t = T_LONG; break; + case 6 : t = T_VOID; break; + case 7 : t = T_FLOAT; break; + case 8 : t = T_DOUBLE; break; + case 9 : t = T_OBJECT; break; + default: ShouldNotReachHere(); + } + assert(AbstractInterpreter::BasicType_as_index(t) == method->result_index(), + "out of step with AbstractInterpreter::BasicType_as_index"); + return t; +} + address InterpreterGenerator::generate_empty_entry() { if (!UseFastEmptyMethods) return NULL; diff --git a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp index 18b9891e937..24c698c7ce5 100644 --- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp +++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp @@ -1,6 +1,6 @@ /* * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2007, 2008 Red Hat, Inc. + * Copyright 2007, 2008, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,3 +41,7 @@ private: // Stack overflow checks static bool stack_overflow_imminent(JavaThread *thread); + + private: + // Fast result type determination + static BasicType result_type_of(methodOop method); diff --git a/hotspot/src/cpu/zero/vm/frame_zero.cpp b/hotspot/src/cpu/zero/vm/frame_zero.cpp index 1b3cafdc589..323912e1cb3 100644 --- a/hotspot/src/cpu/zero/vm/frame_zero.cpp +++ b/hotspot/src/cpu/zero/vm/frame_zero.cpp @@ -36,11 +36,8 @@ bool frame::is_interpreted_frame() const { return zeroframe()->is_interpreter_frame(); } -bool frame::is_fake_stub_frame() const { - return zeroframe()->is_fake_stub_frame(); -} - frame frame::sender_for_entry_frame(RegisterMap *map) const { + assert(zeroframe()->is_entry_frame(), "wrong type of frame"); assert(map != NULL, "map must be set"); assert(!entry_frame_is_first(), "next Java fp must be non zero"); assert(entry_frame_call_wrapper()->anchor()->last_Java_sp() == sender_sp(), @@ -50,15 +47,10 @@ frame frame::sender_for_entry_frame(RegisterMap *map) const { return frame(sender_sp(), sp() + 1); } -frame frame::sender_for_interpreter_frame(RegisterMap *map) const { - return frame(sender_sp(), sp() + 1); -} - -frame frame::sender_for_compiled_frame(RegisterMap *map) const { - return frame(sender_sp(), sp() + 1); -} - -frame frame::sender_for_fake_stub_frame(RegisterMap *map) const { +frame frame::sender_for_nonentry_frame(RegisterMap *map) const { + assert(zeroframe()->is_interpreter_frame() || + zeroframe()->is_shark_frame() || + zeroframe()->is_fake_stub_frame(), "wrong type of frame"); return frame(sender_sp(), sp() + 1); } @@ -69,17 +61,8 @@ frame frame::sender(RegisterMap* map) const { if (is_entry_frame()) return sender_for_entry_frame(map); - - if (is_interpreted_frame()) - return sender_for_interpreter_frame(map); - - if (is_compiled_frame()) - return sender_for_compiled_frame(map); - - if (is_fake_stub_frame()) - return sender_for_fake_stub_frame(map); - - ShouldNotReachHere(); + else + return sender_for_nonentry_frame(map); } #ifdef CC_INTERP diff --git a/hotspot/src/cpu/zero/vm/frame_zero.hpp b/hotspot/src/cpu/zero/vm/frame_zero.hpp index 81b6314571d..84d248fe0c4 100644 --- a/hotspot/src/cpu/zero/vm/frame_zero.hpp +++ b/hotspot/src/cpu/zero/vm/frame_zero.hpp @@ -65,10 +65,7 @@ } public: - bool is_fake_stub_frame() const; - - public: - frame sender_for_fake_stub_frame(RegisterMap* map) const; + frame sender_for_nonentry_frame(RegisterMap* map) const; public: void zero_print_on_error(int index, diff --git a/hotspot/src/cpu/zero/vm/globals_zero.hpp b/hotspot/src/cpu/zero/vm/globals_zero.hpp index 89cf7077dee..e50df6f3dd1 100644 --- a/hotspot/src/cpu/zero/vm/globals_zero.hpp +++ b/hotspot/src/cpu/zero/vm/globals_zero.hpp @@ -1,6 +1,6 @@ /* * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2007, 2008, 2009 Red Hat, Inc. + * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,10 +23,8 @@ * */ -// // Set the default values for platform dependent flags used by the // runtime system. See globals.hpp for details of what they do. -// define_pd_global(bool, ConvertSleepToYield, true); define_pd_global(bool, ShareVtableStubs, true); @@ -37,19 +35,12 @@ define_pd_global(bool, ImplicitNullChecks, true); define_pd_global(bool, UncommonNullCast, true); define_pd_global(intx, CodeEntryAlignment, 32); -define_pd_global(uintx, TLABSize, 0); -#ifdef _LP64 -define_pd_global(uintx, NewSize, ScaleForWordSize(2048 * K)); -#else -define_pd_global(uintx, NewSize, ScaleForWordSize(1024 * K)); -#endif // _LP64 define_pd_global(intx, InlineFrequencyCount, 100); -define_pd_global(intx, InlineSmallCode, 1000); define_pd_global(intx, PreInflateSpin, 10); define_pd_global(intx, StackYellowPages, 2); define_pd_global(intx, StackRedPages, 1); -define_pd_global(intx, StackShadowPages, 3 LP64_ONLY(+3) DEBUG_ONLY(+3)); +define_pd_global(intx, StackShadowPages, 5 LP64_ONLY(+1) DEBUG_ONLY(+3)); define_pd_global(bool, RewriteBytecodes, true); define_pd_global(bool, RewriteFrequentPairs, true); diff --git a/hotspot/src/cpu/zero/vm/interpreter_zero.cpp b/hotspot/src/cpu/zero/vm/interpreter_zero.cpp index 1ece7bbdffe..903d8060183 100644 --- a/hotspot/src/cpu/zero/vm/interpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/interpreter_zero.cpp @@ -1,6 +1,6 @@ /* * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2007, 2008 Red Hat, Inc. + * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,6 +47,10 @@ address InterpreterGenerator::generate_method_handle_entry() { return ShouldNotCallThisEntry(); } +bool AbstractInterpreter::can_be_compiled(methodHandle m) { + return true; +} + int AbstractInterpreter::size_activation(methodOop method, int tempcount, int popframe_extra_args, diff --git a/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp b/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp index 7bb4614980f..57515a76587 100644 --- a/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp +++ b/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp @@ -1,6 +1,6 @@ /* * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2007, 2008 Red Hat, Inc. + * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,8 +47,10 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters( int total_args_passed, int comp_args_on_stack, const BasicType *sig_bt, - const VMRegPair *regs) { - return new AdapterHandlerEntry( + const VMRegPair *regs, + AdapterFingerPrint *fingerprint) { + return AdapterHandlerLibrary::new_entry( + fingerprint, ShouldNotCallThisStub(), ShouldNotCallThisStub(), ShouldNotCallThisStub()); @@ -61,7 +63,14 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm, BasicType *in_sig_bt, VMRegPair *in_regs, BasicType ret_type) { +#ifdef SHARK + return SharkCompiler::compiler()->generate_native_wrapper(masm, + method, + in_sig_bt, + ret_type); +#else ShouldNotCallThis(); +#endif // SHARK } int Deoptimization::last_frame_adjust(int callee_parameters, diff --git a/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp b/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp index 3337219a370..2473ebf7ae6 100644 --- a/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp +++ b/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp @@ -1,6 +1,6 @@ /* * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2008 Red Hat, Inc. + * Copyright 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ // | ... | class SharkFrame : public ZeroFrame { - friend class SharkFunction; + friend class SharkStack; private: SharkFrame() : ZeroFrame() { diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index 281e81c264f..a4c54456504 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -223,8 +223,8 @@ static const char *unstable_chroot_error = "/proc file system not found.\n" "environment on Linux when /proc filesystem is not mounted."; void os::Linux::initialize_system_info() { - _processor_count = sysconf(_SC_NPROCESSORS_CONF); - if (_processor_count == 1) { + set_processor_count(sysconf(_SC_NPROCESSORS_CONF)); + if (processor_count() == 1) { pid_t pid = os::Linux::gettid(); char fname[32]; jio_snprintf(fname, sizeof(fname), "/proc/%d", pid); @@ -236,7 +236,7 @@ void os::Linux::initialize_system_info() { } } _physical_memory = (julong)sysconf(_SC_PHYS_PAGES) * (julong)sysconf(_SC_PAGESIZE); - assert(_processor_count > 0, "linux error"); + assert(processor_count() > 0, "linux error"); } void os::init_system_properties_values() { @@ -4683,6 +4683,7 @@ void Parker::park(bool isAbsolute, jlong time) { // Return immediately if a permit is available. if (_counter > 0) { _counter = 0 ; + OrderAccess::fence(); return ; } @@ -4725,6 +4726,7 @@ void Parker::park(bool isAbsolute, jlong time) { _counter = 0; status = pthread_mutex_unlock(_mutex); assert (status == 0, "invariant") ; + OrderAccess::fence(); return; } @@ -4765,6 +4767,7 @@ void Parker::park(bool isAbsolute, jlong time) { jt->java_suspend_self(); } + OrderAccess::fence(); } void Parker::unpark() { diff --git a/hotspot/src/os/solaris/dtrace/libjvm_db.c b/hotspot/src/os/solaris/dtrace/libjvm_db.c index b162f057b5b..7db194a517e 100644 --- a/hotspot/src/os/solaris/dtrace/libjvm_db.c +++ b/hotspot/src/os/solaris/dtrace/libjvm_db.c @@ -937,54 +937,56 @@ scope_desc_at(Nmethod_t *N, int32_t decode_offset, Vframe_t *vf) return err; } -static int -scopeDesc_chain(Nmethod_t *N) -{ +static int scopeDesc_chain(Nmethod_t *N) { int32_t decode_offset = 0; int32_t err; - if (debug > 2) - fprintf(stderr, "\t scopeDesc_chain: BEGIN\n"); + if (debug > 2) { + fprintf(stderr, "\t scopeDesc_chain: BEGIN\n"); + } err = ps_pread(N->J->P, N->pc_desc + OFFSET_PcDesc_scope_decode_offset, &decode_offset, SZ32); CHECK_FAIL(err); while (decode_offset > 0) { - if (debug > 2) - fprintf(stderr, "\t scopeDesc_chain: decode_offset: %#x\n", decode_offset); + Vframe_t *vf = &N->vframes[N->vf_cnt]; - Vframe_t *vf = &N->vframes[N->vf_cnt]; + if (debug > 2) { + fprintf(stderr, "\t scopeDesc_chain: decode_offset: %#x\n", decode_offset); + } - err = scope_desc_at(N, decode_offset, vf); + err = scope_desc_at(N, decode_offset, vf); + CHECK_FAIL(err); + + if (vf->methodIdx > N->oops_len) { + fprintf(stderr, "\t scopeDesc_chain: (methodIdx > oops_len) !\n"); + return -1; + } + err = read_pointer(N->J, N->nm + N->oops_beg + (vf->methodIdx-1)*POINTER_SIZE, + &vf->methodOop); + CHECK_FAIL(err); + + if (vf->methodOop) { + N->vf_cnt++; + err = line_number_from_bci(N->J, vf); CHECK_FAIL(err); - - if (vf->methodIdx > N->oops_len) { - fprintf(stderr, "\t scopeDesc_chain: (methodIdx > oops_len) !\n"); - return -1; + if (debug > 2) { + fprintf(stderr, "\t scopeDesc_chain: methodOop: %#8llx, line: %ld\n", + vf->methodOop, vf->line); } - err = read_pointer(N->J, N->nm + N->oops_beg + (vf->methodIdx-1)*POINTER_SIZE, - &vf->methodOop); - CHECK_FAIL(err); - - if (vf->methodOop) { - N->vf_cnt++; - err = line_number_from_bci(N->J, vf); - CHECK_FAIL(err); - if (debug > 2) { - fprintf(stderr, "\t scopeDesc_chain: methodOop: %#8llx, line: %ld\n", - vf->methodOop, vf->line); - } - } - decode_offset = vf->sender_decode_offset; + } + decode_offset = vf->sender_decode_offset; + } + if (debug > 2) { + fprintf(stderr, "\t scopeDesc_chain: END \n\n"); } - if (debug > 2) - fprintf(stderr, "\t scopeDesc_chain: END \n\n"); return PS_OK; fail: - if (debug) - fprintf(stderr, "\t scopeDesc_chain: FAIL \n\n"); + if (debug) { + fprintf(stderr, "\t scopeDesc_chain: FAIL \n\n"); + } return err; } diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 13abbf9d4b9..2ef21349881 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -457,7 +457,7 @@ static volatile int max_hrtime_lock = LOCK_FREE; // Update counter with LSB void os::Solaris::initialize_system_info() { - _processor_count = sysconf(_SC_NPROCESSORS_CONF); + set_processor_count(sysconf(_SC_NPROCESSORS_CONF)); _processors_online = sysconf (_SC_NPROCESSORS_ONLN); _physical_memory = (julong)sysconf(_SC_PHYS_PAGES) * (julong)sysconf(_SC_PAGESIZE); } @@ -5803,6 +5803,7 @@ void Parker::park(bool isAbsolute, jlong time) { // Return immediately if a permit is available. if (_counter > 0) { _counter = 0 ; + OrderAccess::fence(); return ; } @@ -5846,6 +5847,7 @@ void Parker::park(bool isAbsolute, jlong time) { _counter = 0; status = os::Solaris::mutex_unlock(_mutex); assert (status == 0, "invariant") ; + OrderAccess::fence(); return; } @@ -5892,6 +5894,7 @@ void Parker::park(bool isAbsolute, jlong time) { jt->java_suspend_self(); } + OrderAccess::fence(); } void Parker::unpark() { diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index 0c941d66db9..6314294e085 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -142,6 +142,9 @@ void os::run_periodic_checks() { } #ifndef _WIN64 +// previous UnhandledExceptionFilter, if there is one +static LPTOP_LEVEL_EXCEPTION_FILTER prev_uef_handler = NULL; + LONG WINAPI Handle_FLT_Exception(struct _EXCEPTION_POINTERS* exceptionInfo); #endif void os::init_system_properties_values() { @@ -260,7 +263,8 @@ void os::init_system_properties_values() { } #ifndef _WIN64 - SetUnhandledExceptionFilter(Handle_FLT_Exception); + // set our UnhandledExceptionFilter and save any previous one + prev_uef_handler = SetUnhandledExceptionFilter(Handle_FLT_Exception); #endif // Done @@ -1969,7 +1973,7 @@ LONG Handle_IDiv_Exception(struct _EXCEPTION_POINTERS* exceptionInfo) { #ifndef _WIN64 //----------------------------------------------------------------------------- LONG WINAPI Handle_FLT_Exception(struct _EXCEPTION_POINTERS* exceptionInfo) { - // handle exception caused by native mothod modifying control word + // handle exception caused by native method modifying control word PCONTEXT ctx = exceptionInfo->ContextRecord; DWORD exception_code = exceptionInfo->ExceptionRecord->ExceptionCode; @@ -1990,6 +1994,13 @@ LONG WINAPI Handle_FLT_Exception(struct _EXCEPTION_POINTERS* exceptionInfo) { return EXCEPTION_CONTINUE_EXECUTION; } } + + if (prev_uef_handler != NULL) { + // We didn't handle this exception so pass it to the previous + // UnhandledExceptionFilter. + return (prev_uef_handler)(exceptionInfo); + } + return EXCEPTION_CONTINUE_SEARCH; } #else //_WIN64 @@ -3150,7 +3161,7 @@ void os::win32::initialize_system_info() { _vm_allocation_granularity = si.dwAllocationGranularity; _processor_type = si.dwProcessorType; _processor_level = si.wProcessorLevel; - _processor_count = si.dwNumberOfProcessors; + set_processor_count(si.dwNumberOfProcessors); MEMORYSTATUSEX ms; ms.dwLength = sizeof(ms); diff --git a/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp b/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp index a1cb9732ace..708cc3e085c 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp @@ -22,10 +22,9 @@ * */ -// // Sets the default values for platform dependent flags used by the runtime system. // (see globals.hpp) -// + define_pd_global(bool, DontYieldALot, false); #ifdef AMD64 define_pd_global(intx, ThreadStackSize, 1024); // 0 => use system default @@ -39,11 +38,10 @@ define_pd_global(intx, VMThreadStackSize, 512); #endif // AMD64 define_pd_global(intx, CompilerThreadStackSize, 0); -define_pd_global(intx, SurvivorRatio, 8); -define_pd_global(uintx, JVMInvokeMethodSlack, 8192); +define_pd_global(uintx,JVMInvokeMethodSlack, 8192); // Only used on 64 bit platforms -define_pd_global(uintx, HeapBaseMinAddress, 2*G); +define_pd_global(uintx,HeapBaseMinAddress, 2*G); // Only used on 64 bit Windows platforms define_pd_global(bool, UseVectoredExceptions, false); diff --git a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp index 572702e7d6d..b9a140a5136 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp +++ b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp @@ -1,6 +1,6 @@ /* * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2007, 2008 Red Hat, Inc. + * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -239,7 +239,21 @@ void os::Linux::set_fpu_control_word(int fpu) { } bool os::is_allocatable(size_t bytes) { - ShouldNotCallThis(); +#ifdef _LP64 + return true; +#else + if (bytes < 2 * G) { + return true; + } + + char* addr = reserve_memory(bytes, NULL); + + if (addr != NULL) { + release_memory(addr, bytes); + } + + return addr != NULL; +#endif // _LP64 } /////////////////////////////////////////////////////////////////////////////// diff --git a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp index d226d5ca726..86d356269ae 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp +++ b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp @@ -1,6 +1,6 @@ /* * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2007, 2008 Red Hat, Inc. + * Copyright 2007, 2008, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,13 @@ "stfd %0, 0(%2)\n" : "=f"(tmp) : "b"(src), "b"(dst)); +#elif defined(S390) && !defined(_LP64) + double tmp; + asm volatile ("ld %0, 0(%1)\n" + "std %0, 0(%2)\n" + : "=r"(tmp) + : "a"(src), "a"(dst)); #else *(jlong *) dst = *(jlong *) src; -#endif // PPC && !_LP64 +#endif } diff --git a/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp b/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp index 4b51eef5ee0..4b2749bc193 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp @@ -22,31 +22,25 @@ * */ -// // Sets the default values for platform dependent flags used by the runtime system. // (see globals.hpp) -// + define_pd_global(bool, DontYieldALot, true); // Determined in the design center #ifdef AMD64 define_pd_global(intx, ThreadStackSize, 1024); // 0 => use system default define_pd_global(intx, VMThreadStackSize, 1024); -define_pd_global(intx, SurvivorRatio, 6); -define_pd_global(uintx, JVMInvokeMethodSlack, 8*K); +define_pd_global(uintx,JVMInvokeMethodSlack, 8*K); #else -// UseStackBanging is not pd -// define_pd_global(bool, UseStackBanging, true); - // ThreadStackSize 320 allows TaggedStackInterpreter and a couple of test cases // to run while keeping the number of threads that can be created high. define_pd_global(intx, ThreadStackSize, 320); define_pd_global(intx, VMThreadStackSize, 512); -define_pd_global(intx, SurvivorRatio, 8); -define_pd_global(uintx, JVMInvokeMethodSlack, 10*K); +define_pd_global(uintx,JVMInvokeMethodSlack, 10*K); #endif // AMD64 define_pd_global(intx, CompilerThreadStackSize, 0); // Only used on 64 bit platforms -define_pd_global(uintx, HeapBaseMinAddress, 256*M); +define_pd_global(uintx,HeapBaseMinAddress, 256*M); // Only used on 64 bit Windows platforms define_pd_global(bool, UseVectoredExceptions, false); diff --git a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp index 59ed458b23f..a11901ed6d4 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -730,11 +730,12 @@ void os::print_context(outputStream *st, void *context) { st->print(", RSI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSI]); st->print(", RDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDI]); st->cr(); - st->print(", R8=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R8]); + st->print( "R8=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R8]); st->print(", R9=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R9]); st->print(", R10=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R10]); st->print(", R11=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R11]); - st->print(", R12=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R12]); + st->cr(); + st->print( "R12=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R12]); st->print(", R13=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R13]); st->print(", R14=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R14]); st->print(", R15=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R15]); diff --git a/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp index 300541e0e96..e5cf1dfe371 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp @@ -22,10 +22,9 @@ * */ -// // Sets the default values for platform dependent flags used by the runtime system. // (see globals.hpp) -// + define_pd_global(bool, DontYieldALot, false); // Default stack size on Windows is determined by the executable (java.exe @@ -35,8 +34,6 @@ define_pd_global(bool, DontYieldALot, false); define_pd_global(intx, ThreadStackSize, 0); // 0 => use system default define_pd_global(intx, VMThreadStackSize, 0); // 0 => use system default -define_pd_global(intx, SurvivorRatio, 8); - #ifdef ASSERT define_pd_global(intx, CompilerThreadStackSize, 1024); #else diff --git a/hotspot/src/share/vm/adlc/output_c.cpp b/hotspot/src/share/vm/adlc/output_c.cpp index e32af7ea4e2..1e9fd56ff3a 100644 --- a/hotspot/src/share/vm/adlc/output_c.cpp +++ b/hotspot/src/share/vm/adlc/output_c.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1496,7 +1496,7 @@ void ArchDesc::defineExpand(FILE *fp, InstructForm *node) { unsigned i; // Generate Expand function header - fprintf(fp,"MachNode *%sNode::Expand(State *state, Node_List &proj_list) {\n", node->_ident); + fprintf(fp,"MachNode *%sNode::Expand(State *state, Node_List &proj_list, Node* mem) {\n", node->_ident); fprintf(fp,"Compile* C = Compile::current();\n"); // Generate expand code if( node->expands() ) { @@ -1546,15 +1546,16 @@ void ArchDesc::defineExpand(FILE *fp, InstructForm *node) { // Build a mapping from operand index to input edges fprintf(fp," unsigned idx0 = oper_input_base();\n"); - // The order in which inputs are added to a node is very + // The order in which the memory input is added to a node is very // strange. Store nodes get a memory input before Expand is - // called and all other nodes get it afterwards so - // oper_input_base is wrong during expansion. This code adjusts - // is so that expansion will work correctly. - bool missing_memory_edge = node->_matrule->needs_ideal_memory_edge(_globalNames) && - node->is_ideal_store() == Form::none; - if (missing_memory_edge) { - fprintf(fp," idx0--; // Adjust base because memory edge hasn't been inserted yet\n"); + // called and other nodes get it afterwards or before depending on + // match order so oper_input_base is wrong during expansion. This + // code adjusts it so that expansion will work correctly. + int has_memory_edge = node->_matrule->needs_ideal_memory_edge(_globalNames); + if (has_memory_edge) { + fprintf(fp," if (mem == (Node*)1) {\n"); + fprintf(fp," idx0--; // Adjust base because memory edge hasn't been inserted yet\n"); + fprintf(fp," }\n"); } for( i = 0; i < node->num_opnds(); i++ ) { @@ -1611,9 +1612,11 @@ void ArchDesc::defineExpand(FILE *fp, InstructForm *node) { int node_mem_op = node->memory_operand(_globalNames); assert( node_mem_op != InstructForm::NO_MEMORY_OPERAND, "expand rule member needs memory but top-level inst doesn't have any" ); - if (!missing_memory_edge) { + if (has_memory_edge) { // Copy memory edge - fprintf(fp," n%d->add_req(_in[1]);\t// Add memory edge\n", cnt); + fprintf(fp," if (mem != (Node*)1) {\n"); + fprintf(fp," n%d->add_req(_in[1]);\t// Add memory edge\n", cnt); + fprintf(fp," }\n"); } } @@ -1689,7 +1692,7 @@ void ArchDesc::defineExpand(FILE *fp, InstructForm *node) { } // done iterating over a new instruction's operands // Invoke Expand() for the newly created instruction. - fprintf(fp," result = n%d->Expand( state, proj_list );\n", cnt); + fprintf(fp," result = n%d->Expand( state, proj_list, mem );\n", cnt); assert( !new_inst->expands(), "Do not have complete support for recursive expansion"); } // done iterating over new instructions fprintf(fp,"\n"); diff --git a/hotspot/src/share/vm/adlc/output_h.cpp b/hotspot/src/share/vm/adlc/output_h.cpp index 23f0827b2e8..2e27f706c93 100644 --- a/hotspot/src/share/vm/adlc/output_h.cpp +++ b/hotspot/src/share/vm/adlc/output_h.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1754,7 +1754,7 @@ void ArchDesc::declareClasses(FILE *fp) { instr->has_temps() || instr->_matrule != NULL && instr->num_opnds() != instr->num_unique_opnds() ) { - fprintf(fp," virtual MachNode *Expand(State *state, Node_List &proj_list);\n"); + fprintf(fp," virtual MachNode *Expand(State *state, Node_List &proj_list, Node* mem);\n"); } if (instr->is_pinned(_globalNames)) { diff --git a/hotspot/src/share/vm/asm/codeBuffer.hpp b/hotspot/src/share/vm/asm/codeBuffer.hpp index 6880fc59d5f..8751fb6494d 100644 --- a/hotspot/src/share/vm/asm/codeBuffer.hpp +++ b/hotspot/src/share/vm/asm/codeBuffer.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,6 +39,7 @@ public: Dtrace_trap = OSR_Entry, // dtrace probes can never have an OSR entry so reuse it Exceptions, // Offset where exception handler lives Deopt, // Offset where deopt handler lives + DeoptMH, // Offset where MethodHandle deopt handler lives max_Entries }; // special value to note codeBlobs where profile (forte) stack walking is @@ -51,12 +52,13 @@ private: public: CodeOffsets() { - _values[Entry] = 0; + _values[Entry ] = 0; _values[Verified_Entry] = 0; _values[Frame_Complete] = frame_never_safe; - _values[OSR_Entry] = 0; - _values[Exceptions] = -1; - _values[Deopt] = -1; + _values[OSR_Entry ] = 0; + _values[Exceptions ] = -1; + _values[Deopt ] = -1; + _values[DeoptMH ] = -1; } int value(Entries e) { return _values[e]; } diff --git a/hotspot/src/share/vm/c1/c1_Compilation.cpp b/hotspot/src/share/vm/c1/c1_Compilation.cpp index d89ef4e7b1a..e1df739770f 100644 --- a/hotspot/src/share/vm/c1/c1_Compilation.cpp +++ b/hotspot/src/share/vm/c1/c1_Compilation.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -205,6 +205,8 @@ void Compilation::emit_lir() { void Compilation::emit_code_epilog(LIR_Assembler* assembler) { CHECK_BAILOUT(); + CodeOffsets* code_offsets = assembler->offsets(); + // generate code or slow cases assembler->emit_slow_case_stubs(); CHECK_BAILOUT(); @@ -213,10 +215,18 @@ void Compilation::emit_code_epilog(LIR_Assembler* assembler) { assembler->emit_exception_entries(exception_info_list()); CHECK_BAILOUT(); - // generate code for exception handler - assembler->emit_exception_handler(); + // Generate code for exception handler. + code_offsets->set_value(CodeOffsets::Exceptions, assembler->emit_exception_handler()); CHECK_BAILOUT(); - assembler->emit_deopt_handler(); + + // Generate code for deopt handler. + code_offsets->set_value(CodeOffsets::Deopt, assembler->emit_deopt_handler()); + CHECK_BAILOUT(); + + // Generate code for MethodHandle deopt handler. We can use the + // same code as for the normal deopt handler, we just need a + // different entry point address. + code_offsets->set_value(CodeOffsets::DeoptMH, assembler->emit_deopt_handler()); CHECK_BAILOUT(); // done diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp index caa99ded618..f567d6e120d 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp @@ -365,7 +365,7 @@ void BlockListBuilder::make_loop_header(BlockBegin* block) { if (_next_loop_index < 31) _next_loop_index++; } else { // block already marked as loop header - assert(is_power_of_2(_loop_map.at(block->block_id())), "exactly one bit must be set"); + assert(is_power_of_2((unsigned int)_loop_map.at(block->block_id())), "exactly one bit must be set"); } } diff --git a/hotspot/src/share/vm/c1/c1_IR.hpp b/hotspot/src/share/vm/c1/c1_IR.hpp index f7bbea2ff3b..32ed4a40d00 100644 --- a/hotspot/src/share/vm/c1/c1_IR.hpp +++ b/hotspot/src/share/vm/c1/c1_IR.hpp @@ -251,8 +251,10 @@ class IRScopeDebugInfo: public CompilationResourceObj { DebugToken* expvals = recorder->create_scope_values(expressions()); DebugToken* monvals = recorder->create_monitor_values(monitors()); // reexecute allowed only for the topmost frame - bool reexecute = topmost ? should_reexecute() : false; - recorder->describe_scope(pc_offset, scope()->method(), bci(), reexecute, locvals, expvals, monvals); + bool reexecute = topmost ? should_reexecute() : false; + bool is_method_handle_invoke = false; + bool return_oop = false; // This flag will be ignored since it used only for C2 with escape analysis. + recorder->describe_scope(pc_offset, scope()->method(), bci(), reexecute, is_method_handle_invoke, return_oop, locvals, expvals, monvals); } }; diff --git a/hotspot/src/share/vm/c1/c1_LIR.hpp b/hotspot/src/share/vm/c1/c1_LIR.hpp index c3da44e2329..fb51de4ca2d 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.hpp +++ b/hotspot/src/share/vm/c1/c1_LIR.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2000,7 +2000,7 @@ class LIR_OpVisitState: public StackObj { typedef enum { inputMode, firstMode = inputMode, tempMode, outputMode, numModes, invalidMode = -1 } OprMode; enum { - maxNumberOfOperands = 14, + maxNumberOfOperands = 16, maxNumberOfInfos = 4 }; diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp index f5de2c73479..8219b534eb0 100644 --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -133,9 +133,9 @@ class LIR_Assembler: public CompilationResourceObj { void add_call_info_here(CodeEmitInfo* info) { add_call_info(code_offset(), info); } // code patterns - void emit_exception_handler(); + int emit_exception_handler(); void emit_exception_entries(ExceptionInfoList* info_list); - void emit_deopt_handler(); + int emit_deopt_handler(); void emit_code(BlockList* hir); void emit_block(BlockBegin* block); diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp index 8eb667dda29..05e479f26bf 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1765,7 +1765,7 @@ void LIRGenerator::do_Throw(Throw* x) { __ null_check(exception_opr, new CodeEmitInfo(info, true)); } - if (compilation()->env()->jvmti_can_post_exceptions() && + if (compilation()->env()->jvmti_can_post_on_exceptions() && !block()->is_set(BlockBegin::default_exception_handler_flag)) { // we need to go through the exception lookup path to get JVMTI // notification done @@ -1855,12 +1855,26 @@ void LIRGenerator::do_UnsafeGetRaw(UnsafeGetRaw* x) { addr = new LIR_Address(base_op, index_op->as_jint(), dst_type); } else { #ifdef X86 +#ifdef _LP64 + if (!index_op->is_illegal() && index_op->type() == T_INT) { + LIR_Opr tmp = new_pointer_register(); + __ convert(Bytecodes::_i2l, index_op, tmp); + index_op = tmp; + } +#endif addr = new LIR_Address(base_op, index_op, LIR_Address::Scale(log2_scale), 0, dst_type); #else if (index_op->is_illegal() || log2_scale == 0) { +#ifdef _LP64 + if (!index_op->is_illegal() && index_op->type() == T_INT) { + LIR_Opr tmp = new_pointer_register(); + __ convert(Bytecodes::_i2l, index_op, tmp); + index_op = tmp; + } +#endif addr = new LIR_Address(base_op, index_op, dst_type); } else { - LIR_Opr tmp = new_register(T_INT); + LIR_Opr tmp = new_pointer_register(); __ shift_left(index_op, log2_scale, tmp); addr = new LIR_Address(base_op, tmp, dst_type); } @@ -1915,10 +1929,25 @@ void LIRGenerator::do_UnsafePutRaw(UnsafePutRaw* x) { LIR_Opr index_op = idx.result(); if (log2_scale != 0) { // temporary fix (platform dependent code without shift on Intel would be better) - index_op = new_register(T_INT); - __ move(idx.result(), index_op); + index_op = new_pointer_register(); +#ifdef _LP64 + if(idx.result()->type() == T_INT) { + __ convert(Bytecodes::_i2l, idx.result(), index_op); + } else { +#endif + __ move(idx.result(), index_op); +#ifdef _LP64 + } +#endif __ shift_left(index_op, log2_scale, index_op); } +#ifdef _LP64 + else if(!index_op->is_illegal() && index_op->type() == T_INT) { + LIR_Opr tmp = new_pointer_register(); + __ convert(Bytecodes::_i2l, index_op, tmp); + index_op = tmp; + } +#endif LIR_Address* addr = new LIR_Address(base_op, index_op, x->basic_type()); __ move(value.result(), addr); diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp index bab43e2ad21..ab049832121 100644 --- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp +++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp @@ -2464,6 +2464,10 @@ int LinearScan::append_scope_value_for_constant(LIR_Opr opr, GrowableArrayappend(&_int_0_scope_value); + scope_values->append(new ConstantLongValue(c->as_jlong_bits())); +#else if (hi_word_offset_in_bytes > lo_word_offset_in_bytes) { scope_values->append(new ConstantIntValue(c->as_jint_hi_bits())); scope_values->append(new ConstantIntValue(c->as_jint_lo_bits())); @@ -2471,7 +2475,7 @@ int LinearScan::append_scope_value_for_constant(LIR_Opr opr, GrowableArrayappend(new ConstantIntValue(c->as_jint_lo_bits())); scope_values->append(new ConstantIntValue(c->as_jint_hi_bits())); } - +#endif return 2; } @@ -2503,17 +2507,18 @@ int LinearScan::append_scope_value_for_operand(LIR_Opr opr, GrowableArrayis_single_cpu()) { bool is_oop = opr->is_oop_register(); int cache_idx = opr->cpu_regnr() * 2 + (is_oop ? 1 : 0); + Location::Type int_loc_type = NOT_LP64(Location::normal) LP64_ONLY(Location::int_in_long); ScopeValue* sv = _scope_value_cache.at(cache_idx); if (sv == NULL) { - Location::Type loc_type = is_oop ? Location::oop : Location::normal; + Location::Type loc_type = is_oop ? Location::oop : int_loc_type; VMReg rname = frame_map()->regname(opr); sv = new LocationValue(Location::new_reg_loc(loc_type, rname)); _scope_value_cache.at_put(cache_idx, sv); } // check if cached value is correct - DEBUG_ONLY(assert_equal(sv, new LocationValue(Location::new_reg_loc(is_oop ? Location::oop : Location::normal, frame_map()->regname(opr))))); + DEBUG_ONLY(assert_equal(sv, new LocationValue(Location::new_reg_loc(is_oop ? Location::oop : int_loc_type, frame_map()->regname(opr))))); scope_values->append(sv); return 1; diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index 986cfd28561..2dd2c1f9ab9 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -110,8 +110,8 @@ static void deopt_caller() { RegisterMap reg_map(thread, false); frame runtime_frame = thread->last_frame(); frame caller_frame = runtime_frame.sender(®_map); - VM_DeoptimizeFrame deopt(thread, caller_frame.id()); - VMThread::execute(&deopt); + // bypass VM_DeoptimizeFrame and deoptimize the frame directly + Deoptimization::deoptimize_frame(thread, caller_frame.id()); assert(caller_is_deopted(), "Must be deoptimized"); } } @@ -354,7 +354,7 @@ JRT_END JRT_ENTRY(void, Runtime1::post_jvmti_exception_throw(JavaThread* thread)) - if (JvmtiExport::can_post_exceptions()) { + if (JvmtiExport::can_post_on_exceptions()) { vframeStream vfst(thread, true); address bcp = vfst.method()->bcp_from(vfst.bci()); JvmtiExport::post_exception_throw(thread, vfst.method(), bcp, thread->exception_oop()); @@ -425,7 +425,7 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t assert(exception.not_null(), "NULL exceptions should be handled by throw_exception"); assert(exception->is_oop(), "just checking"); // Check that exception is a subclass of Throwable, otherwise we have a VerifyError - if (!(exception->is_a(SystemDictionary::throwable_klass()))) { + if (!(exception->is_a(SystemDictionary::Throwable_klass()))) { if (ExitVMOnVerifyError) vm_exit(-1); ShouldNotReachHere(); } @@ -437,7 +437,7 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t bool guard_pages_enabled = thread->stack_yellow_zone_enabled(); if (!guard_pages_enabled) guard_pages_enabled = thread->reguard_stack(); - if (JvmtiExport::can_post_exceptions()) { + if (JvmtiExport::can_post_on_exceptions()) { // To ensure correct notification of exception catches and throws // we have to deoptimize here. If we attempted to notify the // catches and throws during this exception lookup it's possible @@ -1075,6 +1075,7 @@ enum { }; +// Below length is the # elements copied. template int obj_arraycopy_work(oopDesc* src, T* src_addr, oopDesc* dst, T* dst_addr, int length) { @@ -1083,22 +1084,22 @@ template int obj_arraycopy_work(oopDesc* src, T* src_addr, // barrier. The assert will fail if this is not the case. // Note that we use the non-virtual inlineable variant of write_ref_array. BarrierSet* bs = Universe::heap()->barrier_set(); - assert(bs->has_write_ref_array_opt(), - "Barrier set must have ref array opt"); + assert(bs->has_write_ref_array_opt(), "Barrier set must have ref array opt"); + assert(bs->has_write_ref_array_pre_opt(), "For pre-barrier as well."); if (src == dst) { // same object, no check + bs->write_ref_array_pre(dst_addr, length); Copy::conjoint_oops_atomic(src_addr, dst_addr, length); - bs->write_ref_array(MemRegion((HeapWord*)dst_addr, - (HeapWord*)(dst_addr + length))); + bs->write_ref_array((HeapWord*)dst_addr, length); return ac_ok; } else { klassOop bound = objArrayKlass::cast(dst->klass())->element_klass(); klassOop stype = objArrayKlass::cast(src->klass())->element_klass(); if (stype == bound || Klass::cast(stype)->is_subtype_of(bound)) { // Elements are guaranteed to be subtypes, so no check necessary + bs->write_ref_array_pre(dst_addr, length); Copy::conjoint_oops_atomic(src_addr, dst_addr, length); - bs->write_ref_array(MemRegion((HeapWord*)dst_addr, - (HeapWord*)(dst_addr + length))); + bs->write_ref_array((HeapWord*)dst_addr, length); return ac_ok; } } @@ -1162,9 +1163,16 @@ JRT_LEAF(void, Runtime1::oop_arraycopy(HeapWord* src, HeapWord* dst, int num)) #endif if (num == 0) return; - Copy::conjoint_oops_atomic((oop*) src, (oop*) dst, num); BarrierSet* bs = Universe::heap()->barrier_set(); - bs->write_ref_array(MemRegion(dst, dst + num)); + assert(bs->has_write_ref_array_opt(), "Barrier set must have ref array opt"); + assert(bs->has_write_ref_array_pre_opt(), "For pre-barrier as well."); + if (UseCompressedOops) { + bs->write_ref_array_pre((narrowOop*)dst, num); + } else { + bs->write_ref_array_pre((oop*)dst, num); + } + Copy::conjoint_oops_atomic((oop*) src, (oop*) dst, num); + bs->write_ref_array(dst, num); JRT_END diff --git a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp index 8c5122c1486..86de9695cc5 100644 --- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp +++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp @@ -61,9 +61,11 @@ class BCEscapeAnalyzer : public ResourceObj { BCEscapeAnalyzer* _parent; int _level; + public: class ArgumentMap; class StateInfo; + private: // helper functions bool is_argument(int i) { return i >= 0 && i < _arg_size; } diff --git a/hotspot/src/share/vm/ci/ciCPCache.cpp b/hotspot/src/share/vm/ci/ciCPCache.cpp new file mode 100644 index 00000000000..87bd409a615 --- /dev/null +++ b/hotspot/src/share/vm/ci/ciCPCache.cpp @@ -0,0 +1,49 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +#include "incls/_precompiled.incl" +#include "incls/_ciCPCache.cpp.incl" + +// ciCPCache + +// ------------------------------------------------------------------ +// ciCPCache::get_f1_offset +size_t ciCPCache::get_f1_offset(int index) { + // Calculate the offset from the constantPoolCacheOop to the f1 + // field. + ByteSize f1_offset = + constantPoolCacheOopDesc::entry_offset(index) + + ConstantPoolCacheEntry::f1_offset(); + + return in_bytes(f1_offset); +} + + +// ------------------------------------------------------------------ +// ciCPCache::print +// +// Print debugging information about the cache. +void ciCPCache::print() { + Unimplemented(); +} diff --git a/hotspot/src/share/vm/ci/ciCPCache.hpp b/hotspot/src/share/vm/ci/ciCPCache.hpp new file mode 100644 index 00000000000..48e0c3b8fe7 --- /dev/null +++ b/hotspot/src/share/vm/ci/ciCPCache.hpp @@ -0,0 +1,43 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +// ciCPCache +// +// This class represents a constant pool cache. +// +// Note: This class is called ciCPCache as ciConstantPoolCache is used +// for something different. +class ciCPCache : public ciObject { +public: + ciCPCache(constantPoolCacheHandle cpcache) : ciObject(cpcache) {} + + // What kind of ciObject is this? + bool is_cpcache() const { return true; } + + // Get the offset in bytes from the oop to the f1 field of the + // requested entry. + size_t get_f1_offset(int index); + + void print(); +}; diff --git a/hotspot/src/share/vm/ci/ciCallSite.cpp b/hotspot/src/share/vm/ci/ciCallSite.cpp new file mode 100644 index 00000000000..541432b914b --- /dev/null +++ b/hotspot/src/share/vm/ci/ciCallSite.cpp @@ -0,0 +1,46 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +#include "incls/_precompiled.incl" +#include "incls/_ciCallSite.cpp.incl" + +// ciCallSite + +// ------------------------------------------------------------------ +// ciCallSite::get_target +// +// Return the target MethodHandle of this CallSite. +ciMethodHandle* ciCallSite::get_target() const { + VM_ENTRY_MARK; + oop method_handle_oop = java_dyn_CallSite::target(get_oop()); + return CURRENT_ENV->get_object(method_handle_oop)->as_method_handle(); +} + +// ------------------------------------------------------------------ +// ciCallSite::print +// +// Print debugging information about the CallSite. +void ciCallSite::print() { + Unimplemented(); +} diff --git a/hotspot/src/share/vm/ci/ciCallSite.hpp b/hotspot/src/share/vm/ci/ciCallSite.hpp new file mode 100644 index 00000000000..3700ad54430 --- /dev/null +++ b/hotspot/src/share/vm/ci/ciCallSite.hpp @@ -0,0 +1,39 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +// ciCallSite +// +// The class represents a java.dyn.CallSite object. +class ciCallSite : public ciInstance { +public: + ciCallSite(instanceHandle h_i) : ciInstance(h_i) {} + + // What kind of ciObject is this? + bool is_call_site() const { return true; } + + // Return the target MethodHandle of this CallSite. + ciMethodHandle* get_target() const; + + void print(); +}; diff --git a/hotspot/src/share/vm/ci/ciClassList.hpp b/hotspot/src/share/vm/ci/ciClassList.hpp index f6a534477e2..5dc67b2c779 100644 --- a/hotspot/src/share/vm/ci/ciClassList.hpp +++ b/hotspot/src/share/vm/ci/ciClassList.hpp @@ -25,6 +25,7 @@ class ciEnv; class ciObjectFactory; class ciConstantPoolCache; +class ciCPCache; class ciField; class ciConstant; @@ -42,6 +43,8 @@ class ciTypeFlow; class ciObject; class ciNullObject; class ciInstance; +class ciCallSite; +class ciMethodHandle; class ciMethod; class ciMethodData; class ciReceiverTypeData; // part of ciMethodData @@ -78,6 +81,7 @@ friend class ciObjectFactory; // Any more access must be given explicitly. #define CI_PACKAGE_ACCESS_TO \ friend class ciObjectFactory; \ +friend class ciCallSite; \ friend class ciConstantPoolCache; \ friend class ciField; \ friend class ciConstant; \ @@ -93,6 +97,7 @@ friend class ciNullObject; \ friend class ciInstance; \ friend class ciMethod; \ friend class ciMethodData; \ +friend class ciMethodHandle; \ friend class ciReceiverTypeData; \ friend class ciSymbol; \ friend class ciArray; \ diff --git a/hotspot/src/share/vm/ci/ciEnv.cpp b/hotspot/src/share/vm/ci/ciEnv.cpp index b0a17b35c2e..90b8b0c760b 100644 --- a/hotspot/src/share/vm/ci/ciEnv.cpp +++ b/hotspot/src/share/vm/ci/ciEnv.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,14 +38,9 @@ ciInstanceKlassKlass* ciEnv::_instance_klass_klass_instance; ciTypeArrayKlassKlass* ciEnv::_type_array_klass_klass_instance; ciObjArrayKlassKlass* ciEnv::_obj_array_klass_klass_instance; -ciInstanceKlass* ciEnv::_ArrayStoreException; -ciInstanceKlass* ciEnv::_Class; -ciInstanceKlass* ciEnv::_ClassCastException; -ciInstanceKlass* ciEnv::_Object; -ciInstanceKlass* ciEnv::_Throwable; -ciInstanceKlass* ciEnv::_Thread; -ciInstanceKlass* ciEnv::_OutOfMemoryError; -ciInstanceKlass* ciEnv::_String; +#define WK_KLASS_DEFN(name, ignore_s, ignore_o) ciInstanceKlass* ciEnv::_##name = NULL; +WK_KLASSES_DO(WK_KLASS_DEFN) +#undef WK_KLASS_DEFN ciSymbol* ciEnv::_unloaded_cisymbol = NULL; ciInstanceKlass* ciEnv::_unloaded_ciinstance_klass = NULL; @@ -110,6 +105,8 @@ ciEnv::ciEnv(CompileTask* task, int system_dictionary_modification_counter) { _ArrayIndexOutOfBoundsException_instance = NULL; _ArrayStoreException_instance = NULL; _ClassCastException_instance = NULL; + _the_null_string = NULL; + _the_min_jint_string = NULL; } ciEnv::ciEnv(Arena* arena) { @@ -163,6 +160,8 @@ ciEnv::ciEnv(Arena* arena) { _ArrayIndexOutOfBoundsException_instance = NULL; _ArrayStoreException_instance = NULL; _ClassCastException_instance = NULL; + _the_null_string = NULL; + _the_min_jint_string = NULL; } ciEnv::~ciEnv() { @@ -179,7 +178,7 @@ void ciEnv::cache_jvmti_state() { _jvmti_can_hotswap_or_post_breakpoint = JvmtiExport::can_hotswap_or_post_breakpoint(); _jvmti_can_examine_or_deopt_anywhere = JvmtiExport::can_examine_or_deopt_anywhere(); _jvmti_can_access_local_variables = JvmtiExport::can_access_local_variables(); - _jvmti_can_post_exceptions = JvmtiExport::can_post_exceptions(); + _jvmti_can_post_on_exceptions = JvmtiExport::can_post_on_exceptions(); } // ------------------------------------------------------------------ @@ -248,6 +247,22 @@ ciInstance* ciEnv::ClassCastException_instance() { return _ClassCastException_instance; } +ciInstance* ciEnv::the_null_string() { + if (_the_null_string == NULL) { + VM_ENTRY_MARK; + _the_null_string = get_object(Universe::the_null_string())->as_instance(); + } + return _the_null_string; +} + +ciInstance* ciEnv::the_min_jint_string() { + if (_the_min_jint_string == NULL) { + VM_ENTRY_MARK; + _the_min_jint_string = get_object(Universe::the_min_jint_string())->as_instance(); + } + return _the_min_jint_string; +} + // ------------------------------------------------------------------ // ciEnv::get_method_from_handle ciMethod* ciEnv::get_method_from_handle(jobject method) { @@ -419,12 +434,11 @@ ciKlass* ciEnv::get_klass_by_name(ciKlass* accessing_klass, // ciEnv::get_klass_by_index_impl // // Implementation of get_klass_by_index. -ciKlass* ciEnv::get_klass_by_index_impl(ciInstanceKlass* accessor, +ciKlass* ciEnv::get_klass_by_index_impl(constantPoolHandle cpool, int index, - bool& is_accessible) { - assert(accessor->get_instanceKlass()->is_linked(), "must be linked before accessing constant pool"); + bool& is_accessible, + ciInstanceKlass* accessor) { EXCEPTION_CONTEXT; - constantPoolHandle cpool(THREAD, accessor->get_instanceKlass()->constants()); KlassHandle klass (THREAD, constantPoolOopDesc::klass_at_if_loaded(cpool, index)); symbolHandle klass_name; if (klass.is_null()) { @@ -486,22 +500,21 @@ ciKlass* ciEnv::get_klass_by_index_impl(ciInstanceKlass* accessor, // ciEnv::get_klass_by_index // // Get a klass from the constant pool. -ciKlass* ciEnv::get_klass_by_index(ciInstanceKlass* accessor, +ciKlass* ciEnv::get_klass_by_index(constantPoolHandle cpool, int index, - bool& is_accessible) { - GUARDED_VM_ENTRY(return get_klass_by_index_impl(accessor, index, is_accessible);) + bool& is_accessible, + ciInstanceKlass* accessor) { + GUARDED_VM_ENTRY(return get_klass_by_index_impl(cpool, index, is_accessible, accessor);) } // ------------------------------------------------------------------ // ciEnv::get_constant_by_index_impl // // Implementation of get_constant_by_index(). -ciConstant ciEnv::get_constant_by_index_impl(ciInstanceKlass* accessor, - int index) { +ciConstant ciEnv::get_constant_by_index_impl(constantPoolHandle cpool, + int index, + ciInstanceKlass* accessor) { EXCEPTION_CONTEXT; - instanceKlass* ik_accessor = accessor->get_instanceKlass(); - assert(ik_accessor->is_linked(), "must be linked before accessing constant pool"); - constantPoolOop cpool = ik_accessor->constants(); constantTag tag = cpool->tag_at(index); if (tag.is_int()) { return ciConstant(T_INT, (jint)cpool->int_at(index)); @@ -529,7 +542,7 @@ ciConstant ciEnv::get_constant_by_index_impl(ciInstanceKlass* accessor, } else if (tag.is_klass() || tag.is_unresolved_klass()) { // 4881222: allow ldc to take a class type bool ignore; - ciKlass* klass = get_klass_by_index_impl(accessor, index, ignore); + ciKlass* klass = get_klass_by_index_impl(cpool, index, ignore, accessor); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; record_out_of_memory_failure(); @@ -538,6 +551,11 @@ ciConstant ciEnv::get_constant_by_index_impl(ciInstanceKlass* accessor, assert (klass->is_instance_klass() || klass->is_array_klass(), "must be an instance or array klass "); return ciConstant(T_OBJECT, klass); + } else if (tag.is_object()) { + oop obj = cpool->object_at(index); + assert(obj->is_instance(), "must be an instance"); + ciObject* ciobj = get_object(obj); + return ciConstant(T_OBJECT, ciobj); } else { ShouldNotReachHere(); return ciConstant(); @@ -574,9 +592,10 @@ bool ciEnv::is_unresolved_klass_impl(instanceKlass* accessor, int index) const { // Pull a constant out of the constant pool. How appropriate. // // Implementation note: this query is currently in no way cached. -ciConstant ciEnv::get_constant_by_index(ciInstanceKlass* accessor, - int index) { - GUARDED_VM_ENTRY(return get_constant_by_index_impl(accessor, index); ) +ciConstant ciEnv::get_constant_by_index(constantPoolHandle cpool, + int index, + ciInstanceKlass* accessor) { + GUARDED_VM_ENTRY(return get_constant_by_index_impl(cpool, index, accessor);) } // ------------------------------------------------------------------ @@ -586,7 +605,7 @@ ciConstant ciEnv::get_constant_by_index(ciInstanceKlass* accessor, // // Implementation note: this query is currently in no way cached. bool ciEnv::is_unresolved_string(ciInstanceKlass* accessor, - int index) const { + int index) const { GUARDED_VM_ENTRY(return is_unresolved_string_impl(accessor->get_instanceKlass(), index); ) } @@ -597,7 +616,7 @@ bool ciEnv::is_unresolved_string(ciInstanceKlass* accessor, // // Implementation note: this query is currently in no way cached. bool ciEnv::is_unresolved_klass(ciInstanceKlass* accessor, - int index) const { + int index) const { GUARDED_VM_ENTRY(return is_unresolved_klass_impl(accessor->get_instanceKlass(), index); ) } @@ -678,22 +697,17 @@ methodOop ciEnv::lookup_method(instanceKlass* accessor, // ------------------------------------------------------------------ // ciEnv::get_method_by_index_impl -ciMethod* ciEnv::get_method_by_index_impl(ciInstanceKlass* accessor, - int index, Bytecodes::Code bc) { - // Get the method's declared holder. - - assert(accessor->get_instanceKlass()->is_linked(), "must be linked before accessing constant pool"); - constantPoolHandle cpool = accessor->get_instanceKlass()->constants(); +ciMethod* ciEnv::get_method_by_index_impl(constantPoolHandle cpool, + int index, Bytecodes::Code bc, + ciInstanceKlass* accessor) { int holder_index = cpool->klass_ref_index_at(index); bool holder_is_accessible; - ciKlass* holder = get_klass_by_index_impl(accessor, holder_index, holder_is_accessible); + ciKlass* holder = get_klass_by_index_impl(cpool, holder_index, holder_is_accessible, accessor); ciInstanceKlass* declared_holder = get_instance_klass_for_declared_method_holder(holder); // Get the method's name and signature. - int nt_index = cpool->name_and_type_ref_index_at(index); - int sig_index = cpool->signature_ref_index_at(nt_index); symbolOop name_sym = cpool->name_ref_at(index); - symbolOop sig_sym = cpool->symbol_at(sig_index); + symbolOop sig_sym = cpool->signature_ref_at(index); if (holder_is_accessible) { // Our declared holder is loaded. instanceKlass* lookup = declared_holder->get_instanceKlass(); @@ -714,6 +728,33 @@ ciMethod* ciEnv::get_method_by_index_impl(ciInstanceKlass* accessor, } +// ------------------------------------------------------------------ +// ciEnv::get_fake_invokedynamic_method_impl +ciMethod* ciEnv::get_fake_invokedynamic_method_impl(constantPoolHandle cpool, + int index, Bytecodes::Code bc) { + assert(bc == Bytecodes::_invokedynamic, "must be invokedynamic"); + + // Get the CallSite from the constant pool cache. + ConstantPoolCacheEntry* cpc_entry = cpool->cache()->secondary_entry_at(index); + assert(cpc_entry != NULL && cpc_entry->is_secondary_entry(), "sanity"); + Handle call_site = cpc_entry->f1(); + + // Call site might not be linked yet. + if (call_site.is_null()) { + ciInstanceKlass* mh_klass = get_object(SystemDictionary::MethodHandle_klass())->as_instance_klass(); + ciSymbol* sig_sym = get_object(cpool->signature_ref_at(index))->as_symbol(); + return get_unloaded_method(mh_klass, ciSymbol::invoke_name(), sig_sym); + } + + // Get the methodOop from the CallSite. + methodOop method_oop = (methodOop) java_dyn_CallSite::vmmethod(call_site()); + assert(method_oop != NULL, "sanity"); + assert(method_oop->is_method_handle_invoke(), "consistent"); + + return get_object(method_oop)->as_method(); +} + + // ------------------------------------------------------------------ // ciEnv::get_instance_klass_for_declared_method_holder ciInstanceKlass* ciEnv::get_instance_klass_for_declared_method_holder(ciKlass* method_holder) { @@ -736,15 +777,19 @@ ciInstanceKlass* ciEnv::get_instance_klass_for_declared_method_holder(ciKlass* m } - - // ------------------------------------------------------------------ // ciEnv::get_method_by_index -ciMethod* ciEnv::get_method_by_index(ciInstanceKlass* accessor, - int index, Bytecodes::Code bc) { - GUARDED_VM_ENTRY(return get_method_by_index_impl(accessor, index, bc);) +ciMethod* ciEnv::get_method_by_index(constantPoolHandle cpool, + int index, Bytecodes::Code bc, + ciInstanceKlass* accessor) { + if (bc == Bytecodes::_invokedynamic) { + GUARDED_VM_ENTRY(return get_fake_invokedynamic_method_impl(cpool, index, bc);) + } else { + GUARDED_VM_ENTRY(return get_method_by_index_impl(cpool, index, bc, accessor);) + } } + // ------------------------------------------------------------------ // ciEnv::name_buffer char *ciEnv::name_buffer(int req_len) { @@ -846,8 +891,8 @@ void ciEnv::register_method(ciMethod* target, JvmtiExport::can_examine_or_deopt_anywhere()) || (!jvmti_can_access_local_variables() && JvmtiExport::can_access_local_variables()) || - (!jvmti_can_post_exceptions() && - JvmtiExport::can_post_exceptions()) )) { + (!jvmti_can_post_on_exceptions() && + JvmtiExport::can_post_on_exceptions()) )) { record_failure("Jvmti state change invalidated dependencies"); } @@ -917,18 +962,10 @@ void ciEnv::register_method(ciMethod* target, if (nm == NULL) { // The CodeCache is full. Print out warning and disable compilation. record_failure("code cache is full"); - UseInterpreter = true; - if (UseCompiler || AlwaysCompileLoopMethods ) { -#ifndef PRODUCT - warning("CodeCache is full. Compiler has been disabled"); - if (CompileTheWorld || ExitOnFullCodeCache) { - before_exit(JavaThread::current()); - exit_globals(); // will delete tty - vm_direct_exit(CompileTheWorld ? 0 : 1); - } -#endif - UseCompiler = false; - AlwaysCompileLoopMethods = false; + { + MutexUnlocker ml(Compile_lock); + MutexUnlocker locker(MethodCompileQueue_lock); + CompileBroker::handle_full_code_cache(); } } else { NOT_PRODUCT(nm->set_has_debug_info(has_debug_info); ) diff --git a/hotspot/src/share/vm/ci/ciEnv.hpp b/hotspot/src/share/vm/ci/ciEnv.hpp index e855dbf9e4f..d20c1d1a380 100644 --- a/hotspot/src/share/vm/ci/ciEnv.hpp +++ b/hotspot/src/share/vm/ci/ciEnv.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,7 +57,7 @@ private: bool _jvmti_can_hotswap_or_post_breakpoint; bool _jvmti_can_examine_or_deopt_anywhere; bool _jvmti_can_access_local_variables; - bool _jvmti_can_post_exceptions; + bool _jvmti_can_post_on_exceptions; // Cache DTrace flags bool _dtrace_extended_probes; @@ -74,14 +74,9 @@ private: static ciTypeArrayKlassKlass* _type_array_klass_klass_instance; static ciObjArrayKlassKlass* _obj_array_klass_klass_instance; - static ciInstanceKlass* _ArrayStoreException; - static ciInstanceKlass* _Class; - static ciInstanceKlass* _ClassCastException; - static ciInstanceKlass* _Object; - static ciInstanceKlass* _Throwable; - static ciInstanceKlass* _Thread; - static ciInstanceKlass* _OutOfMemoryError; - static ciInstanceKlass* _String; +#define WK_KLASS_DECL(name, ignore_s, ignore_o) static ciInstanceKlass* _##name; + WK_KLASSES_DO(WK_KLASS_DECL) +#undef WK_KLASS_DECL static ciSymbol* _unloaded_cisymbol; static ciInstanceKlass* _unloaded_ciinstance_klass; @@ -97,6 +92,9 @@ private: ciInstance* _ArrayStoreException_instance; ciInstance* _ClassCastException_instance; + ciInstance* _the_null_string; // The Java string "null" + ciInstance* _the_min_jint_string; // The Java string "-2147483648" + // Look up a klass by name from a particular class loader (the accessor's). // If require_local, result must be defined in that class loader, or NULL. // If !require_local, a result from remote class loader may be reported, @@ -114,37 +112,45 @@ private: bool require_local); // Constant pool access. - ciKlass* get_klass_by_index(ciInstanceKlass* loading_klass, + ciKlass* get_klass_by_index(constantPoolHandle cpool, int klass_index, - bool& is_accessible); - ciConstant get_constant_by_index(ciInstanceKlass* loading_klass, - int constant_index); + bool& is_accessible, + ciInstanceKlass* loading_klass); + ciConstant get_constant_by_index(constantPoolHandle cpool, + int constant_index, + ciInstanceKlass* accessor); bool is_unresolved_string(ciInstanceKlass* loading_klass, int constant_index) const; bool is_unresolved_klass(ciInstanceKlass* loading_klass, int constant_index) const; ciField* get_field_by_index(ciInstanceKlass* loading_klass, int field_index); - ciMethod* get_method_by_index(ciInstanceKlass* loading_klass, - int method_index, Bytecodes::Code bc); + ciMethod* get_method_by_index(constantPoolHandle cpool, + int method_index, Bytecodes::Code bc, + ciInstanceKlass* loading_klass); // Implementation methods for loading and constant pool access. ciKlass* get_klass_by_name_impl(ciKlass* accessing_klass, ciSymbol* klass_name, bool require_local); - ciKlass* get_klass_by_index_impl(ciInstanceKlass* loading_klass, + ciKlass* get_klass_by_index_impl(constantPoolHandle cpool, int klass_index, - bool& is_accessible); - ciConstant get_constant_by_index_impl(ciInstanceKlass* loading_klass, - int constant_index); + bool& is_accessible, + ciInstanceKlass* loading_klass); + ciConstant get_constant_by_index_impl(constantPoolHandle cpool, + int constant_index, + ciInstanceKlass* loading_klass); bool is_unresolved_string_impl (instanceKlass* loading_klass, int constant_index) const; bool is_unresolved_klass_impl (instanceKlass* loading_klass, int constant_index) const; ciField* get_field_by_index_impl(ciInstanceKlass* loading_klass, int field_index); - ciMethod* get_method_by_index_impl(ciInstanceKlass* loading_klass, - int method_index, Bytecodes::Code bc); + ciMethod* get_method_by_index_impl(constantPoolHandle cpool, + int method_index, Bytecodes::Code bc, + ciInstanceKlass* loading_klass); + ciMethod* get_fake_invokedynamic_method_impl(constantPoolHandle cpool, + int index, Bytecodes::Code bc); // Helper methods bool check_klass_accessibility(ciKlass* accessing_klass, @@ -253,7 +259,7 @@ public: bool jvmti_can_hotswap_or_post_breakpoint() const { return _jvmti_can_hotswap_or_post_breakpoint; } bool jvmti_can_examine_or_deopt_anywhere() const { return _jvmti_can_examine_or_deopt_anywhere; } bool jvmti_can_access_local_variables() const { return _jvmti_can_access_local_variables; } - bool jvmti_can_post_exceptions() const { return _jvmti_can_post_exceptions; } + bool jvmti_can_post_on_exceptions() const { return _jvmti_can_post_on_exceptions; } // Cache DTrace flags void cache_dtrace_flags(); @@ -286,30 +292,13 @@ public: // Access to certain well known ciObjects. - ciInstanceKlass* ArrayStoreException_klass() { - return _ArrayStoreException; - } - ciInstanceKlass* Class_klass() { - return _Class; - } - ciInstanceKlass* ClassCastException_klass() { - return _ClassCastException; - } - ciInstanceKlass* Object_klass() { - return _Object; - } - ciInstanceKlass* Throwable_klass() { - return _Throwable; - } - ciInstanceKlass* Thread_klass() { - return _Thread; - } - ciInstanceKlass* OutOfMemoryError_klass() { - return _OutOfMemoryError; - } - ciInstanceKlass* String_klass() { - return _String; +#define WK_KLASS_FUNC(name, ignore_s, ignore_o) \ + ciInstanceKlass* name() { \ + return _##name;\ } + WK_KLASSES_DO(WK_KLASS_FUNC) +#undef WK_KLASS_FUNC + ciInstance* NullPointerException_instance() { assert(_NullPointerException_instance != NULL, "initialization problem"); return _NullPointerException_instance; @@ -324,6 +313,9 @@ public: ciInstance* ArrayStoreException_instance(); ciInstance* ClassCastException_instance(); + ciInstance* the_null_string(); + ciInstance* the_min_jint_string(); + static ciSymbol* unloaded_cisymbol() { return _unloaded_cisymbol; } diff --git a/hotspot/src/share/vm/ci/ciExceptionHandler.cpp b/hotspot/src/share/vm/ci/ciExceptionHandler.cpp index 209f00e5b86..79f6ccec50f 100644 --- a/hotspot/src/share/vm/ci/ciExceptionHandler.cpp +++ b/hotspot/src/share/vm/ci/ciExceptionHandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,12 +34,16 @@ // // Get the exception klass that this handler catches. ciInstanceKlass* ciExceptionHandler::catch_klass() { + VM_ENTRY_MARK; assert(!is_catch_all(), "bad index"); if (_catch_klass == NULL) { bool will_link; - ciKlass* k = CURRENT_ENV->get_klass_by_index(_loading_klass, + assert(_loading_klass->get_instanceKlass()->is_linked(), "must be linked before accessing constant pool"); + constantPoolHandle cpool(_loading_klass->get_instanceKlass()->constants()); + ciKlass* k = CURRENT_ENV->get_klass_by_index(cpool, _catch_klass_index, - will_link); + will_link, + _loading_klass); if (!will_link && k->is_loaded()) { GUARDED_VM_ENTRY( k = CURRENT_ENV->get_unloaded_klass(_loading_klass, k->name()); diff --git a/hotspot/src/share/vm/ci/ciField.cpp b/hotspot/src/share/vm/ci/ciField.cpp index ed66c1781c4..39a5651dc68 100644 --- a/hotspot/src/share/vm/ci/ciField.cpp +++ b/hotspot/src/share/vm/ci/ciField.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -86,7 +86,7 @@ ciField::ciField(ciInstanceKlass* klass, int index): _known_to_link_with(NULL) { bool ignore; // This is not really a class reference; the index always refers to the // field's type signature, as a symbol. Linkage checks do not apply. - _type = ciEnv::current(thread)->get_klass_by_index(klass, sig_index, ignore); + _type = ciEnv::current(thread)->get_klass_by_index(cpool, sig_index, ignore, klass); } else { _type = ciType::make(field_type); } @@ -100,9 +100,9 @@ ciField::ciField(ciInstanceKlass* klass, int index): _known_to_link_with(NULL) { int holder_index = cpool->klass_ref_index_at(index); bool holder_is_accessible; ciInstanceKlass* declared_holder = - ciEnv::current(thread)->get_klass_by_index(klass, holder_index, - holder_is_accessible) - ->as_instance_klass(); + ciEnv::current(thread)->get_klass_by_index(cpool, holder_index, + holder_is_accessible, + klass)->as_instance_klass(); // The declared holder of this field may not have been loaded. // Bail out with partial field information. @@ -161,6 +161,18 @@ ciField::ciField(fieldDescriptor *fd): _known_to_link_with(NULL) { "bootstrap classes must not create & cache unshared fields"); } +static bool trust_final_non_static_fields(ciInstanceKlass* holder) { + if (holder == NULL) + return false; + if (holder->name() == ciSymbol::java_lang_System()) + // Never trust strangely unstable finals: System.out, etc. + return false; + // Even if general trusting is disabled, trust system-built closures in these packages. + if (holder->is_in_package("java/dyn") || holder->is_in_package("sun/dyn")) + return true; + return TrustFinalNonStaticFields; +} + void ciField::initialize_from(fieldDescriptor* fd) { // Get the flags, offset, and canonical holder of the field. _flags = ciFlags(fd->access_flags()); @@ -168,8 +180,18 @@ void ciField::initialize_from(fieldDescriptor* fd) { _holder = CURRENT_ENV->get_object(fd->field_holder())->as_instance_klass(); // Check to see if the field is constant. - if (_holder->is_initialized() && - this->is_final() && this->is_static()) { + if (_holder->is_initialized() && this->is_final()) { + if (!this->is_static()) { + // A field can be constant if it's a final static field or if it's + // a final non-static field of a trusted class ({java,sun}.dyn). + if (trust_final_non_static_fields(_holder)) { + _is_constant = true; + return; + } + _is_constant = false; + return; + } + // This field just may be constant. The only cases where it will // not be constant are: // @@ -182,8 +204,8 @@ void ciField::initialize_from(fieldDescriptor* fd) { // java.lang.System.out, and java.lang.System.err. klassOop k = _holder->get_klassOop(); - assert( SystemDictionary::system_klass() != NULL, "Check once per vm"); - if( k == SystemDictionary::system_klass() ) { + assert( SystemDictionary::System_klass() != NULL, "Check once per vm"); + if( k == SystemDictionary::System_klass() ) { // Check offsets for case 2: System.in, System.out, or System.err if( _offset == java_lang_System::in_offset_in_bytes() || _offset == java_lang_System::out_offset_in_bytes() || diff --git a/hotspot/src/share/vm/ci/ciField.hpp b/hotspot/src/share/vm/ci/ciField.hpp index 193d848d41c..ffe1f925e2c 100644 --- a/hotspot/src/share/vm/ci/ciField.hpp +++ b/hotspot/src/share/vm/ci/ciField.hpp @@ -138,10 +138,18 @@ public: // Get the constant value of this field. ciConstant constant_value() { - assert(is_constant(), "illegal call to constant_value()"); + assert(is_static() && is_constant(), "illegal call to constant_value()"); return _constant_value; } + // Get the constant value of non-static final field in the given + // object. + ciConstant constant_value_of(ciObject* object) { + assert(!is_static() && is_constant(), "only if field is non-static constant"); + assert(object->is_instance(), "must be instance"); + return object->as_instance()->field_value(this); + } + // Check for link time errors. Accessing a field from a // certain class via a certain bytecode may or may not be legal. // This call checks to see if an exception may be raised by diff --git a/hotspot/src/share/vm/ci/ciInstance.cpp b/hotspot/src/share/vm/ci/ciInstance.cpp index 9d07a4a6229..c377a739ba3 100644 --- a/hotspot/src/share/vm/ci/ciInstance.cpp +++ b/hotspot/src/share/vm/ci/ciInstance.cpp @@ -36,7 +36,7 @@ ciType* ciInstance::java_mirror_type() { VM_ENTRY_MARK; oop m = get_oop(); // Return NULL if it is not java.lang.Class. - if (m == NULL || m->klass() != SystemDictionary::class_klass()) { + if (m == NULL || m->klass() != SystemDictionary::Class_klass()) { return NULL; } // Return either a primitive type or a klass. diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp index 1053727a93f..60fabd0bac8 100644 --- a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp @@ -75,7 +75,7 @@ ciInstanceKlass::ciInstanceKlass(KlassHandle h_k) : _java_mirror = NULL; if (is_shared()) { - if (h_k() != SystemDictionary::object_klass()) { + if (h_k() != SystemDictionary::Object_klass()) { super(); } java_mirror(); @@ -232,8 +232,48 @@ bool ciInstanceKlass::is_java_lang_Object() { // ------------------------------------------------------------------ // ciInstanceKlass::uses_default_loader bool ciInstanceKlass::uses_default_loader() { - VM_ENTRY_MARK; - return loader() == NULL; + // Note: We do not need to resolve the handle or enter the VM + // in order to test null-ness. + return _loader == NULL; +} + +// ------------------------------------------------------------------ +// ciInstanceKlass::is_in_package +// +// Is this klass in the given package? +bool ciInstanceKlass::is_in_package(const char* packagename, int len) { + // To avoid class loader mischief, this test always rejects application classes. + if (!uses_default_loader()) + return false; + GUARDED_VM_ENTRY( + return is_in_package_impl(packagename, len); + ) +} + +bool ciInstanceKlass::is_in_package_impl(const char* packagename, int len) { + ASSERT_IN_VM; + + // If packagename contains trailing '/' exclude it from the + // prefix-test since we test for it explicitly. + if (packagename[len - 1] == '/') + len--; + + if (!name()->starts_with(packagename, len)) + return false; + + // Test if the class name is something like "java/lang". + if ((len + 1) > name()->utf8_length()) + return false; + + // Test for trailing '/' + if ((char) name()->byte_at(len) != '/') + return false; + + // Make sure it's not actually in a subpackage: + if (name()->index_of_at(len+1, "/", 1) >= 0) + return false; + + return true; } // ------------------------------------------------------------------ @@ -340,6 +380,20 @@ ciField* ciInstanceKlass::get_field_by_offset(int field_offset, bool is_static) return field; } +// ------------------------------------------------------------------ +// ciInstanceKlass::get_field_by_name +ciField* ciInstanceKlass::get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static) { + VM_ENTRY_MARK; + instanceKlass* k = get_instanceKlass(); + fieldDescriptor fd; + klassOop def = k->find_field(name->get_symbolOop(), signature->get_symbolOop(), is_static, &fd); + if (def == NULL) { + return NULL; + } + ciField* field = new (CURRENT_THREAD_ENV->arena()) ciField(&fd); + return field; +} + // ------------------------------------------------------------------ // ciInstanceKlass::non_static_fields. diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp index a60020adc34..29aeffa01f3 100644 --- a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp @@ -29,10 +29,11 @@ // be loaded. class ciInstanceKlass : public ciKlass { CI_PACKAGE_ACCESS + friend class ciBytecodeStream; friend class ciEnv; + friend class ciExceptionHandler; friend class ciMethod; friend class ciField; - friend class ciBytecodeStream; private: jobject _loader; @@ -78,6 +79,8 @@ protected: const char* type_string() { return "ciInstanceKlass"; } + bool is_in_package_impl(const char* packagename, int len); + void print_impl(outputStream* st); ciConstantPoolCache* field_cache(); @@ -148,6 +151,7 @@ public: ciInstanceKlass* get_canonical_holder(int offset); ciField* get_field_by_offset(int field_offset, bool is_static); + ciField* get_field_by_name(ciSymbol* name, ciSymbol* signature, bool is_static); GrowableArray* non_static_fields(); @@ -195,6 +199,12 @@ public: bool is_java_lang_Object(); + // Is this klass in the given package? + bool is_in_package(const char* packagename) { + return is_in_package(packagename, (int) strlen(packagename)); + } + bool is_in_package(const char* packagename, int len); + // What kind of ciObject is this? bool is_instance_klass() { return true; } bool is_java_klass() { return true; } diff --git a/hotspot/src/share/vm/ci/ciKlass.cpp b/hotspot/src/share/vm/ci/ciKlass.cpp index ac5da354422..b0f28620ab2 100644 --- a/hotspot/src/share/vm/ci/ciKlass.cpp +++ b/hotspot/src/share/vm/ci/ciKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/ci/ciKlass.hpp b/hotspot/src/share/vm/ci/ciKlass.hpp index 1f2571718bc..3f1c6d7aa45 100644 --- a/hotspot/src/share/vm/ci/ciKlass.hpp +++ b/hotspot/src/share/vm/ci/ciKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,7 +69,7 @@ public: ciKlass(KlassHandle k_h); // What is the name of this klass? - ciSymbol* name() { return _name; } + ciSymbol* name() const { return _name; } // What is its layout helper value? jint layout_helper() { return _layout_helper; } diff --git a/hotspot/src/share/vm/ci/ciMethod.cpp b/hotspot/src/share/vm/ci/ciMethod.cpp index f83429c1adf..54a04f8af1f 100644 --- a/hotspot/src/share/vm/ci/ciMethod.cpp +++ b/hotspot/src/share/vm/ci/ciMethod.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -436,15 +436,21 @@ ciCallProfile ciMethod::call_profile_at_bci(int bci) { // we will set result._method also. } // Determine call site's morphism. - // The call site count could be == (receivers_count_total + 1) - // not only in the case of a polymorphic call but also in the case - // when a method data snapshot is taken after the site count was updated - // but before receivers counters were updated. - if (morphism == result._limit) { - // There were no array klasses and morphism <= MorphismLimit. - if (morphism < ciCallProfile::MorphismLimit || - morphism == ciCallProfile::MorphismLimit && - (receivers_count_total+1) >= count) { + // The call site count is 0 with known morphism (onlt 1 or 2 receivers) + // or < 0 in the case of a type check failured for checkcast, aastore, instanceof. + // The call site count is > 0 in the case of a polymorphic virtual call. + if (morphism > 0 && morphism == result._limit) { + // The morphism <= MorphismLimit. + if ((morphism < ciCallProfile::MorphismLimit) || + (morphism == ciCallProfile::MorphismLimit && count == 0)) { +#ifdef ASSERT + if (count > 0) { + this->print_short_name(tty); + tty->print_cr(" @ bci:%d", bci); + this->print_codes(); + assert(false, "this call site should not be polymorphic"); + } +#endif result._morphism = morphism; } } @@ -452,10 +458,8 @@ ciCallProfile ciMethod::call_profile_at_bci(int bci) { // zero or less, presume that this is a typecheck profile and // do nothing. Otherwise, increase count to be the sum of all // receiver's counts. - if (count > 0) { - if (count < receivers_count_total) { - count = receivers_count_total; - } + if (count >= 0) { + count += receivers_count_total; } } result._count = count; @@ -687,7 +691,7 @@ int ciMethod::scale_count(int count, float prof_factor) { // ------------------------------------------------------------------ // invokedynamic support // -bool ciMethod::is_method_handle_invoke() { +bool ciMethod::is_method_handle_invoke() const { check_is_loaded(); bool flag = ((flags().as_int() & JVM_MH_INVOKE_BITS) == JVM_MH_INVOKE_BITS); #ifdef ASSERT @@ -700,6 +704,12 @@ bool ciMethod::is_method_handle_invoke() { return flag; } +bool ciMethod::is_method_handle_adapter() const { + check_is_loaded(); + VM_ENTRY_MARK; + return get_methodOop()->is_method_handle_adapter(); +} + ciInstance* ciMethod::method_handle_type() { check_is_loaded(); VM_ENTRY_MARK; diff --git a/hotspot/src/share/vm/ci/ciMethod.hpp b/hotspot/src/share/vm/ci/ciMethod.hpp index 1b65bc90c50..d574fa07b71 100644 --- a/hotspot/src/share/vm/ci/ciMethod.hpp +++ b/hotspot/src/share/vm/ci/ciMethod.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,6 +38,8 @@ class ciMethod : public ciObject { CI_PACKAGE_ACCESS friend class ciEnv; friend class ciExceptionHandlerStream; + friend class ciBytecodeStream; + friend class ciMethodHandle; private: // General method information. @@ -213,7 +215,10 @@ class ciMethod : public ciObject { bool check_call(int refinfo_index, bool is_static) const; void build_method_data(); // make sure it exists in the VM also int scale_count(int count, float prof_factor = 1.); // make MDO count commensurate with IIC - bool is_method_handle_invoke(); + + // JSR 292 support + bool is_method_handle_invoke() const; + bool is_method_handle_adapter() const; ciInstance* method_handle_type(); // What kind of ciObject is this? @@ -251,4 +256,10 @@ class ciMethod : public ciObject { // Print the name of this method in various incarnations. void print_name(outputStream* st = tty); void print_short_name(outputStream* st = tty); + + methodOop get_method_handle_target() { + klassOop receiver_limit_oop = NULL; + int flags = 0; + return MethodHandles::decode_method(get_oop(), receiver_limit_oop, flags); + } }; diff --git a/hotspot/src/share/vm/ci/ciMethodHandle.cpp b/hotspot/src/share/vm/ci/ciMethodHandle.cpp new file mode 100644 index 00000000000..d9612192bf8 --- /dev/null +++ b/hotspot/src/share/vm/ci/ciMethodHandle.cpp @@ -0,0 +1,52 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +#include "incls/_precompiled.incl" +#include "incls/_ciMethodHandle.cpp.incl" + +// ciMethodHandle + +// ------------------------------------------------------------------ +// ciMethodHandle::get_adapter +// +// Return an adapter for this MethodHandle. +ciMethod* ciMethodHandle::get_adapter(bool is_invokedynamic) const { + VM_ENTRY_MARK; + + Handle h(get_oop()); + methodHandle callee(_callee->get_methodOop()); + MethodHandleCompiler mhc(h, callee, is_invokedynamic, THREAD); + methodHandle m = mhc.compile(CHECK_NULL); + return CURRENT_ENV->get_object(m())->as_method(); +} + + +// ------------------------------------------------------------------ +// ciMethodHandle::print_impl +// +// Implementation of the print method. +void ciMethodHandle::print_impl(outputStream* st) { + st->print(" type="); + get_oop()->print(); +} diff --git a/hotspot/src/share/vm/ci/ciMethodHandle.hpp b/hotspot/src/share/vm/ci/ciMethodHandle.hpp new file mode 100644 index 00000000000..26d317f248d --- /dev/null +++ b/hotspot/src/share/vm/ci/ciMethodHandle.hpp @@ -0,0 +1,56 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +// ciMethodHandle +// +// The class represents a java.dyn.MethodHandle object. +class ciMethodHandle : public ciInstance { +private: + ciMethod* _callee; + + // Return an adapter for this MethodHandle. + ciMethod* get_adapter(bool is_invokedynamic) const; + +protected: + void print_impl(outputStream* st); + +public: + ciMethodHandle(instanceHandle h_i) : ciInstance(h_i) {}; + + // What kind of ciObject is this? + bool is_method_handle() const { return true; } + + ciMethod* callee() const { return _callee; } + void set_callee(ciMethod* m) { _callee = m; } + + // Return an adapter for a MethodHandle call. + ciMethod* get_method_handle_adapter() const { + return get_adapter(false); + } + + // Return an adapter for an invokedynamic call. + ciMethod* get_invokedynamic_adapter() const { + return get_adapter(true); + } +}; diff --git a/hotspot/src/share/vm/ci/ciObject.hpp b/hotspot/src/share/vm/ci/ciObject.hpp index 8d5e6b7f4dd..1f38e9c7109 100644 --- a/hotspot/src/share/vm/ci/ciObject.hpp +++ b/hotspot/src/share/vm/ci/ciObject.hpp @@ -131,9 +131,12 @@ public: // What kind of ciObject is this? virtual bool is_null_object() const { return false; } + virtual bool is_call_site() const { return false; } + virtual bool is_cpcache() const { return false; } virtual bool is_instance() { return false; } virtual bool is_method() { return false; } virtual bool is_method_data() { return false; } + virtual bool is_method_handle() const { return false; } virtual bool is_array() { return false; } virtual bool is_obj_array() { return false; } virtual bool is_type_array() { return false; } @@ -185,6 +188,14 @@ public: assert(is_null_object(), "bad cast"); return (ciNullObject*)this; } + ciCallSite* as_call_site() { + assert(is_call_site(), "bad cast"); + return (ciCallSite*) this; + } + ciCPCache* as_cpcache() { + assert(is_cpcache(), "bad cast"); + return (ciCPCache*) this; + } ciInstance* as_instance() { assert(is_instance(), "bad cast"); return (ciInstance*)this; @@ -197,6 +208,10 @@ public: assert(is_method_data(), "bad cast"); return (ciMethodData*)this; } + ciMethodHandle* as_method_handle() { + assert(is_method_handle(), "bad cast"); + return (ciMethodHandle*) this; + } ciArray* as_array() { assert(is_array(), "bad cast"); return (ciArray*)this; diff --git a/hotspot/src/share/vm/ci/ciObjectFactory.cpp b/hotspot/src/share/vm/ci/ciObjectFactory.cpp index 6fb4edc4d9c..cfbdf1659eb 100644 --- a/hotspot/src/share/vm/ci/ciObjectFactory.cpp +++ b/hotspot/src/share/vm/ci/ciObjectFactory.cpp @@ -144,30 +144,13 @@ void ciObjectFactory::init_shared_objects() { ciEnv::_obj_array_klass_klass_instance = get(Universe::objArrayKlassKlassObj()) ->as_obj_array_klass_klass(); - ciEnv::_ArrayStoreException = - get(SystemDictionary::ArrayStoreException_klass()) - ->as_instance_klass(); - ciEnv::_Class = - get(SystemDictionary::class_klass()) - ->as_instance_klass(); - ciEnv::_ClassCastException = - get(SystemDictionary::ClassCastException_klass()) - ->as_instance_klass(); - ciEnv::_Object = - get(SystemDictionary::object_klass()) - ->as_instance_klass(); - ciEnv::_Throwable = - get(SystemDictionary::throwable_klass()) - ->as_instance_klass(); - ciEnv::_Thread = - get(SystemDictionary::thread_klass()) - ->as_instance_klass(); - ciEnv::_OutOfMemoryError = - get(SystemDictionary::OutOfMemoryError_klass()) - ->as_instance_klass(); - ciEnv::_String = - get(SystemDictionary::string_klass()) - ->as_instance_klass(); + +#define WK_KLASS_DEFN(name, ignore_s, opt) \ + if (SystemDictionary::name() != NULL) \ + ciEnv::_##name = get(SystemDictionary::name())->as_instance_klass(); + + WK_KLASSES_DO(WK_KLASS_DEFN) +#undef WK_KLASS_DEFN for (int len = -1; len != _ci_objects->length(); ) { len = _ci_objects->length(); @@ -324,13 +307,21 @@ ciObject* ciObjectFactory::create_new_object(oop o) { return new (arena()) ciMethodData(h_md); } else if (o->is_instance()) { instanceHandle h_i(THREAD, (instanceOop)o); - return new (arena()) ciInstance(h_i); + if (java_dyn_CallSite::is_instance(o)) + return new (arena()) ciCallSite(h_i); + else if (java_dyn_MethodHandle::is_instance(o)) + return new (arena()) ciMethodHandle(h_i); + else + return new (arena()) ciInstance(h_i); } else if (o->is_objArray()) { objArrayHandle h_oa(THREAD, (objArrayOop)o); return new (arena()) ciObjArray(h_oa); } else if (o->is_typeArray()) { typeArrayHandle h_ta(THREAD, (typeArrayOop)o); return new (arena()) ciTypeArray(h_ta); + } else if (o->is_constantPoolCache()) { + constantPoolCacheHandle h_cpc(THREAD, (constantPoolCacheOop) o); + return new (arena()) ciCPCache(h_cpc); } // The oop is of some type not supported by the compiler interface. @@ -567,7 +558,7 @@ ciObjectFactory::NonPermObject* &ciObjectFactory::find_non_perm(oop key) { if (key->is_perm() && _non_perm_count == 0) { return emptyBucket; } else if (key->is_instance()) { - if (key->klass() == SystemDictionary::class_klass()) { + if (key->klass() == SystemDictionary::Class_klass()) { // class mirror instances are always perm return emptyBucket; } diff --git a/hotspot/src/share/vm/ci/ciStreams.cpp b/hotspot/src/share/vm/ci/ciStreams.cpp index d343ab8446d..52f17c33b47 100644 --- a/hotspot/src/share/vm/ci/ciStreams.cpp +++ b/hotspot/src/share/vm/ci/ciStreams.cpp @@ -186,8 +186,9 @@ int ciBytecodeStream::get_klass_index() const { // If this bytecode is a new, newarray, multianewarray, instanceof, // or checkcast, get the referenced klass. ciKlass* ciBytecodeStream::get_klass(bool& will_link) { - return CURRENT_ENV->get_klass_by_index(_holder, get_klass_index(), - will_link); + VM_ENTRY_MARK; + constantPoolHandle cpool(_method->get_methodOop()->constants()); + return CURRENT_ENV->get_klass_by_index(cpool, get_klass_index(), will_link, _holder); } // ------------------------------------------------------------------ @@ -213,7 +214,9 @@ int ciBytecodeStream::get_constant_index() const { // If this bytecode is one of the ldc variants, get the referenced // constant. ciConstant ciBytecodeStream::get_constant() { - return CURRENT_ENV->get_constant_by_index(_holder, get_constant_index()); + VM_ENTRY_MARK; + constantPoolHandle cpool(_method->get_methodOop()->constants()); + return CURRENT_ENV->get_constant_by_index(cpool, get_constant_index(), _holder); } // ------------------------------------------------------------------ @@ -264,9 +267,11 @@ ciField* ciBytecodeStream::get_field(bool& will_link) { // There is no "will_link" result passed back. The user is responsible // for checking linkability when retrieving the associated field. ciInstanceKlass* ciBytecodeStream::get_declared_field_holder() { + VM_ENTRY_MARK; + constantPoolHandle cpool(_method->get_methodOop()->constants()); int holder_index = get_field_holder_index(); bool ignore; - return CURRENT_ENV->get_klass_by_index(_holder, holder_index, ignore) + return CURRENT_ENV->get_klass_by_index(cpool, holder_index, ignore, _holder) ->as_instance_klass(); } @@ -277,9 +282,10 @@ ciInstanceKlass* ciBytecodeStream::get_declared_field_holder() { // referenced by the current bytecode. Used for generating // deoptimization information. int ciBytecodeStream::get_field_holder_index() { - VM_ENTRY_MARK; - constantPoolOop cpool = _holder->get_instanceKlass()->constants(); - return cpool->klass_ref_index_at(get_field_index()); + GUARDED_VM_ENTRY( + constantPoolOop cpool = _holder->get_instanceKlass()->constants(); + return cpool->klass_ref_index_at(get_field_index()); + ) } // ------------------------------------------------------------------ @@ -321,7 +327,9 @@ int ciBytecodeStream::get_method_index() { // // If this is a method invocation bytecode, get the invoked method. ciMethod* ciBytecodeStream::get_method(bool& will_link) { - ciMethod* m = CURRENT_ENV->get_method_by_index(_holder, get_method_index(),cur_bc()); + VM_ENTRY_MARK; + constantPoolHandle cpool(_method->get_methodOop()->constants()); + ciMethod* m = CURRENT_ENV->get_method_by_index(cpool, get_method_index(), cur_bc(), _holder); will_link = m->is_loaded(); return m; } @@ -338,11 +346,13 @@ ciMethod* ciBytecodeStream::get_method(bool& will_link) { // There is no "will_link" result passed back. The user is responsible // for checking linkability when retrieving the associated method. ciKlass* ciBytecodeStream::get_declared_method_holder() { + VM_ENTRY_MARK; + constantPoolHandle cpool(_method->get_methodOop()->constants()); bool ignore; - // report as Dynamic for invokedynamic, which is syntactically classless + // report as InvokeDynamic for invokedynamic, which is syntactically classless if (cur_bc() == Bytecodes::_invokedynamic) - return CURRENT_ENV->get_klass_by_name(_holder, ciSymbol::java_dyn_Dynamic(), false); - return CURRENT_ENV->get_klass_by_index(_holder, get_method_holder_index(), ignore); + return CURRENT_ENV->get_klass_by_name(_holder, ciSymbol::java_dyn_InvokeDynamic(), false); + return CURRENT_ENV->get_klass_by_index(cpool, get_method_holder_index(), ignore, _holder); } // ------------------------------------------------------------------ @@ -352,8 +362,7 @@ ciKlass* ciBytecodeStream::get_declared_method_holder() { // referenced by the current bytecode. Used for generating // deoptimization information. int ciBytecodeStream::get_method_holder_index() { - VM_ENTRY_MARK; - constantPoolOop cpool = _holder->get_instanceKlass()->constants(); + constantPoolOop cpool = _method->get_methodOop()->constants(); return cpool->klass_ref_index_at(get_method_index()); } @@ -370,3 +379,31 @@ int ciBytecodeStream::get_method_signature_index() { int name_and_type_index = cpool->name_and_type_ref_index_at(method_index); return cpool->signature_ref_index_at(name_and_type_index); } + +// ------------------------------------------------------------------ +// ciBytecodeStream::get_cpcache +ciCPCache* ciBytecodeStream::get_cpcache() { + VM_ENTRY_MARK; + // Get the constant pool. + constantPoolOop cpool = _holder->get_instanceKlass()->constants(); + constantPoolCacheOop cpcache = cpool->cache(); + + return CURRENT_ENV->get_object(cpcache)->as_cpcache(); +} + +// ------------------------------------------------------------------ +// ciBytecodeStream::get_call_site +ciCallSite* ciBytecodeStream::get_call_site() { + VM_ENTRY_MARK; + // Get the constant pool. + constantPoolOop cpool = _holder->get_instanceKlass()->constants(); + constantPoolCacheOop cpcache = cpool->cache(); + + // Get the CallSite from the constant pool cache. + int method_index = get_method_index(); + ConstantPoolCacheEntry* cpcache_entry = cpcache->secondary_entry_at(method_index); + oop call_site_oop = cpcache_entry->f1(); + + // Create a CallSite object and return it. + return CURRENT_ENV->get_object(call_site_oop)->as_call_site(); +} diff --git a/hotspot/src/share/vm/ci/ciStreams.hpp b/hotspot/src/share/vm/ci/ciStreams.hpp index 448e27cb16a..97a046f132f 100644 --- a/hotspot/src/share/vm/ci/ciStreams.hpp +++ b/hotspot/src/share/vm/ci/ciStreams.hpp @@ -232,6 +232,9 @@ public: int get_method_holder_index(); int get_method_signature_index(); + ciCPCache* get_cpcache(); + ciCallSite* get_call_site(); + private: void assert_index_size(int required_size) const { #ifdef ASSERT diff --git a/hotspot/src/share/vm/ci/ciSymbol.cpp b/hotspot/src/share/vm/ci/ciSymbol.cpp index 7284893e81d..e534f04c3de 100644 --- a/hotspot/src/share/vm/ci/ciSymbol.cpp +++ b/hotspot/src/share/vm/ci/ciSymbol.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,6 +59,22 @@ int ciSymbol::byte_at(int i) { GUARDED_VM_ENTRY(return get_symbolOop()->byte_at(i);) } +// ------------------------------------------------------------------ +// ciSymbol::starts_with +// +// Tests if the symbol starts with the given prefix. +bool ciSymbol::starts_with(const char* prefix, int len) const { + GUARDED_VM_ENTRY(return get_symbolOop()->starts_with(prefix, len);) +} + +// ------------------------------------------------------------------ +// ciSymbol::index_of +// +// Determines where the symbol contains the given substring. +int ciSymbol::index_of_at(int i, const char* str, int len) const { + GUARDED_VM_ENTRY(return get_symbolOop()->index_of_at(i, str, len);) +} + // ------------------------------------------------------------------ // ciSymbol::utf8_length int ciSymbol::utf8_length() { diff --git a/hotspot/src/share/vm/ci/ciSymbol.hpp b/hotspot/src/share/vm/ci/ciSymbol.hpp index 701fb8023d7..abb3088edbf 100644 --- a/hotspot/src/share/vm/ci/ciSymbol.hpp +++ b/hotspot/src/share/vm/ci/ciSymbol.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ // machine. class ciSymbol : public ciObject { CI_PACKAGE_ACCESS + // These friends all make direct use of get_symbolOop: friend class ciEnv; friend class ciInstanceKlass; friend class ciSignature; @@ -38,13 +39,13 @@ private: ciSymbol(symbolOop s) : ciObject(s) {} ciSymbol(symbolHandle s); // for use with vmSymbolHandles - symbolOop get_symbolOop() { return (symbolOop)get_oop(); } + symbolOop get_symbolOop() const { return (symbolOop)get_oop(); } const char* type_string() { return "ciSymbol"; } void print_impl(outputStream* st); - int byte_at(int i); + // This is public in symbolOop but private here, because the base can move: jbyte* base(); // Make a ciSymbol from a C string (implementation). @@ -55,6 +56,15 @@ public: const char* as_utf8(); int utf8_length(); + // Return the i-th utf8 byte, where i < utf8_length + int byte_at(int i); + + // Tests if the symbol starts with the given prefix. + bool starts_with(const char* prefix, int len) const; + + // Determines where the symbol contains the given substring. + int index_of_at(int i, const char* str, int len) const; + // What kind of ciObject is this? bool is_symbol() { return true; } diff --git a/hotspot/src/share/vm/ci/ciType.cpp b/hotspot/src/share/vm/ci/ciType.cpp index ca2c79a102a..e94af7d89a4 100644 --- a/hotspot/src/share/vm/ci/ciType.cpp +++ b/hotspot/src/share/vm/ci/ciType.cpp @@ -111,7 +111,7 @@ ciType* ciType::make(BasicType t) { // short, etc. // Note: Bare T_ADDRESS means a raw pointer type, not a return_address. assert((uint)t < T_CONFLICT+1, "range check"); - if (t == T_OBJECT) return ciEnv::_Object; // java/lang/Object + if (t == T_OBJECT) return ciEnv::_Object_klass; // java/lang/Object assert(_basic_types[t] != NULL, "domain check"); return _basic_types[t]; } diff --git a/hotspot/src/share/vm/ci/ciTypeFlow.cpp b/hotspot/src/share/vm/ci/ciTypeFlow.cpp index d21ea761a4f..4aceca8410a 100644 --- a/hotspot/src/share/vm/ci/ciTypeFlow.cpp +++ b/hotspot/src/share/vm/ci/ciTypeFlow.cpp @@ -635,8 +635,15 @@ void ciTypeFlow::StateVector::do_invoke(ciBytecodeStream* str, ciMethod* method = str->get_method(will_link); if (!will_link) { // We weren't able to find the method. - ciKlass* unloaded_holder = method->holder(); - trap(str, unloaded_holder, str->get_method_holder_index()); + if (str->cur_bc() == Bytecodes::_invokedynamic) { + trap(str, NULL, + Deoptimization::make_trap_request + (Deoptimization::Reason_uninitialized, + Deoptimization::Action_reinterpret)); + } else { + ciKlass* unloaded_holder = method->holder(); + trap(str, unloaded_holder, str->get_method_holder_index()); + } } else { ciSignature* signature = method->signature(); ciSignatureStream sigstr(signature); @@ -1292,8 +1299,8 @@ bool ciTypeFlow::StateVector::apply_one_bytecode(ciBytecodeStream* str) { case Bytecodes::_invokeinterface: do_invoke(str, true); break; case Bytecodes::_invokespecial: do_invoke(str, true); break; case Bytecodes::_invokestatic: do_invoke(str, false); break; - case Bytecodes::_invokevirtual: do_invoke(str, true); break; + case Bytecodes::_invokedynamic: do_invoke(str, false); break; case Bytecodes::_istore: store_local_int(str->get_index()); break; case Bytecodes::_istore_0: store_local_int(0); break; diff --git a/hotspot/src/share/vm/ci/ciUtilities.hpp b/hotspot/src/share/vm/ci/ciUtilities.hpp index 163e8089b65..709752d0d14 100644 --- a/hotspot/src/share/vm/ci/ciUtilities.hpp +++ b/hotspot/src/share/vm/ci/ciUtilities.hpp @@ -79,7 +79,7 @@ THREAD); \ if (HAS_PENDING_EXCEPTION) { \ if (PENDING_EXCEPTION->klass() == \ - SystemDictionary::threaddeath_klass()) { \ + SystemDictionary::ThreadDeath_klass()) { \ /* Kill the compilation. */ \ fatal("unhandled ci exception"); \ return (result); \ diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index 8235db6f082..8671af37de6 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -430,7 +430,7 @@ void ClassFileParser::patch_constant_pool(constantPoolHandle cp, int index, Hand case JVM_CONSTANT_UnresolvedClass : // Patching a class means pre-resolving it. // The name in the constant pool is ignored. - if (patch->klass() == SystemDictionary::class_klass()) { // %%% java_lang_Class::is_instance + if (patch->klass() == SystemDictionary::Class_klass()) { // %%% java_lang_Class::is_instance guarantee_property(!java_lang_Class::is_primitive(patch()), "Illegal class patch at %d in class file %s", index, CHECK); @@ -643,7 +643,7 @@ void ClassFileParser::verify_constantvalue(int constantvalue_index, int signatur guarantee_property(value_type.is_int(), "Inconsistent constant value type in class file %s", CHECK); break; case T_OBJECT: - guarantee_property((cp->symbol_at(signature_index)->equals("Ljava/lang/String;", 18) + guarantee_property((cp->symbol_at(signature_index)->equals("Ljava/lang/String;") && (value_type.is_string() || value_type.is_unresolved_string())), "Bad string initial value in class file %s", CHECK); break; @@ -1718,9 +1718,7 @@ methodHandle ClassFileParser::parse_method(constantPoolHandle cp, bool is_interf m->set_exception_table(exception_handlers()); // Copy byte codes - if (code_length > 0) { - memcpy(m->code_base(), code_start, code_length); - } + m->set_code(code_start); // Copy line number table if (linenumber_table != NULL) { @@ -2511,23 +2509,12 @@ void ClassFileParser::java_dyn_MethodHandle_fix_pre(constantPoolHandle cp, fac_ptr->nonstatic_byte_count -= 1; (*fields_ptr)->ushort_at_put(i + instanceKlass::signature_index_offset, word_sig_index); - if (wordSize == jintSize) { - fac_ptr->nonstatic_word_count += 1; - } else { - fac_ptr->nonstatic_double_count += 1; - } + fac_ptr->nonstatic_word_count += 1; - FieldAllocationType atype = (FieldAllocationType) (*fields_ptr)->ushort_at(i+4); + FieldAllocationType atype = (FieldAllocationType) (*fields_ptr)->ushort_at(i + instanceKlass::low_offset); assert(atype == NONSTATIC_BYTE, ""); FieldAllocationType new_atype = NONSTATIC_WORD; - if (wordSize > jintSize) { - if (Universe::field_type_should_be_aligned(T_LONG)) { - atype = NONSTATIC_ALIGNED_DOUBLE; - } else { - atype = NONSTATIC_DOUBLE; - } - } - (*fields_ptr)->ushort_at_put(i+4, new_atype); + (*fields_ptr)->ushort_at_put(i + instanceKlass::low_offset, new_atype); found_vmentry = true; break; @@ -3085,7 +3072,7 @@ instanceKlassHandle ClassFileParser::parseClassFile(symbolHandle name, int len = fields->length(); for (int i = 0; i < len; i += instanceKlass::next_offset) { int real_offset; - FieldAllocationType atype = (FieldAllocationType) fields->ushort_at(i+4); + FieldAllocationType atype = (FieldAllocationType) fields->ushort_at(i + instanceKlass::low_offset); switch (atype) { case STATIC_OOP: real_offset = next_static_oop_offset; @@ -3173,8 +3160,8 @@ instanceKlassHandle ClassFileParser::parseClassFile(symbolHandle name, default: ShouldNotReachHere(); } - fields->short_at_put(i+4, extract_low_short_from_int(real_offset) ); - fields->short_at_put(i+5, extract_high_short_from_int(real_offset) ); + fields->short_at_put(i + instanceKlass::low_offset, extract_low_short_from_int(real_offset)); + fields->short_at_put(i + instanceKlass::high_offset, extract_high_short_from_int(real_offset)); } // Size of instances @@ -3482,8 +3469,8 @@ void ClassFileParser::set_precomputed_flags(instanceKlassHandle k) { #endif // Check if this klass supports the java.lang.Cloneable interface - if (SystemDictionary::cloneable_klass_loaded()) { - if (k->is_subtype_of(SystemDictionary::cloneable_klass())) { + if (SystemDictionary::Cloneable_klass_loaded()) { + if (k->is_subtype_of(SystemDictionary::Cloneable_klass())) { k->set_is_cloneable(); } } @@ -3766,8 +3753,9 @@ bool ClassFileParser::has_illegal_visibility(jint flags) { } bool ClassFileParser::is_supported_version(u2 major, u2 minor) { - u2 max_version = JDK_Version::is_gte_jdk17x_version() ? - JAVA_MAX_SUPPORTED_VERSION : JAVA_6_VERSION; + u2 max_version = + JDK_Version::is_gte_jdk17x_version() ? JAVA_MAX_SUPPORTED_VERSION : + (JDK_Version::is_gte_jdk16x_version() ? JAVA_6_VERSION : JAVA_1_5_VERSION); return (major >= JAVA_MIN_SUPPORTED_VERSION) && (major <= max_version) && ((major != max_version) || @@ -4188,7 +4176,7 @@ char* ClassFileParser::skip_over_field_name(char* name, bool slash_ok, unsigned // Check if ch is Java identifier start or is Java identifier part // 4672820: call java.lang.Character methods directly without generating separate tables. EXCEPTION_MARK; - instanceKlassHandle klass (THREAD, SystemDictionary::char_klass()); + instanceKlassHandle klass (THREAD, SystemDictionary::Character_klass()); // return value JavaValue result(T_BOOLEAN); diff --git a/hotspot/src/share/vm/classfile/classLoader.cpp b/hotspot/src/share/vm/classfile/classLoader.cpp index 669beb7ff32..824ba88aeb1 100644 --- a/hotspot/src/share/vm/classfile/classLoader.cpp +++ b/hotspot/src/share/vm/classfile/classLoader.cpp @@ -819,7 +819,7 @@ objArrayOop ClassLoader::get_system_packages(TRAPS) { _package_hash_table->copy_pkgnames(packages); } // Allocate objArray and fill with java.lang.String - objArrayOop r = oopFactory::new_objArray(SystemDictionary::string_klass(), + objArrayOop r = oopFactory::new_objArray(SystemDictionary::String_klass(), nof_entries, CHECK_0); objArrayHandle result(THREAD, r); for (int i = 0; i < nof_entries; i++) { @@ -1249,6 +1249,7 @@ void ClassLoader::compile_the_world() { } int ClassLoader::_compile_the_world_counter = 0; +static int _codecache_sweep_counter = 0; void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) { int len = (int)strlen(name); @@ -1293,6 +1294,13 @@ void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) { for (int n = 0; n < k->methods()->length(); n++) { methodHandle m (THREAD, methodOop(k->methods()->obj_at(n))); if (CompilationPolicy::canBeCompiled(m)) { + + if (++_codecache_sweep_counter == CompileTheWorldSafepointInterval) { + // Give sweeper a chance to keep up with CTW + VM_ForceSafepoint op; + VMThread::execute(&op); + _codecache_sweep_counter = 0; + } // Force compilation CompileBroker::compile_method(m, InvocationEntryBci, methodHandle(), 0, "CTW", THREAD); diff --git a/hotspot/src/share/vm/classfile/javaAssertions.cpp b/hotspot/src/share/vm/classfile/javaAssertions.cpp index 8f318e6a426..551dd2acd86 100644 --- a/hotspot/src/share/vm/classfile/javaAssertions.cpp +++ b/hotspot/src/share/vm/classfile/javaAssertions.cpp @@ -95,14 +95,14 @@ oop JavaAssertions::createAssertionStatusDirectives(TRAPS) { int len; typeArrayOop t; len = OptionList::count(_packages); - objArrayOop pn = oopFactory::new_objArray(SystemDictionary::string_klass(), len, CHECK_NULL); + objArrayOop pn = oopFactory::new_objArray(SystemDictionary::String_klass(), len, CHECK_NULL); objArrayHandle pkgNames (THREAD, pn); t = oopFactory::new_typeArray(T_BOOLEAN, len, CHECK_NULL); typeArrayHandle pkgEnabled(THREAD, t); fillJavaArrays(_packages, len, pkgNames, pkgEnabled, CHECK_NULL); len = OptionList::count(_classes); - objArrayOop cn = oopFactory::new_objArray(SystemDictionary::string_klass(), len, CHECK_NULL); + objArrayOop cn = oopFactory::new_objArray(SystemDictionary::String_klass(), len, CHECK_NULL); objArrayHandle classNames (THREAD, cn); t = oopFactory::new_typeArray(T_BOOLEAN, len, CHECK_NULL); typeArrayHandle classEnabled(THREAD, t); diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp index cc0db7a173b..730f1c7abc8 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.cpp +++ b/hotspot/src/share/vm/classfile/javaClasses.cpp @@ -68,9 +68,9 @@ Handle java_lang_String::basic_create(int length, bool tenured, TRAPS) { // and the char array it points to end up in the same cache line. oop obj; if (tenured) { - obj = instanceKlass::cast(SystemDictionary::string_klass())->allocate_permanent_instance(CHECK_NH); + obj = instanceKlass::cast(SystemDictionary::String_klass())->allocate_permanent_instance(CHECK_NH); } else { - obj = instanceKlass::cast(SystemDictionary::string_klass())->allocate_instance(CHECK_NH); + obj = instanceKlass::cast(SystemDictionary::String_klass())->allocate_instance(CHECK_NH); } // Create the char array. The String object must be handlized here @@ -293,7 +293,7 @@ char* java_lang_String::as_utf8_string(oop java_string, int start, int len) { bool java_lang_String::equals(oop java_string, jchar* chars, int len) { assert(SharedSkipVerify || - java_string->klass() == SystemDictionary::string_klass(), + java_string->klass() == SystemDictionary::String_klass(), "must be java_string"); typeArrayOop value = java_lang_String::value(java_string); int offset = java_lang_String::offset(java_string); @@ -311,7 +311,7 @@ bool java_lang_String::equals(oop java_string, jchar* chars, int len) { void java_lang_String::print(Handle java_string, outputStream* st) { oop obj = java_string(); - assert(obj->klass() == SystemDictionary::string_klass(), "must be java_string"); + assert(obj->klass() == SystemDictionary::String_klass(), "must be java_string"); typeArrayOop value = java_lang_String::value(obj); int offset = java_lang_String::offset(obj); int length = java_lang_String::length(obj); @@ -339,9 +339,9 @@ oop java_lang_Class::create_mirror(KlassHandle k, TRAPS) { // class is put into the system dictionary. int computed_modifiers = k->compute_modifier_flags(CHECK_0); k->set_modifier_flags(computed_modifiers); - if (SystemDictionary::class_klass_loaded()) { + if (SystemDictionary::Class_klass_loaded()) { // Allocate mirror (java.lang.Class instance) - Handle mirror = instanceKlass::cast(SystemDictionary::class_klass())->allocate_permanent_instance(CHECK_0); + Handle mirror = instanceKlass::cast(SystemDictionary::Class_klass())->allocate_permanent_instance(CHECK_0); // Setup indirections mirror->obj_field_put(klass_offset, k()); k->set_java_mirror(mirror()); @@ -378,7 +378,7 @@ oop java_lang_Class::create_mirror(KlassHandle k, TRAPS) { oop java_lang_Class::create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS) { // This should be improved by adding a field at the Java level or by // introducing a new VM klass (see comment in ClassFileParser) - oop java_class = instanceKlass::cast(SystemDictionary::class_klass())->allocate_permanent_instance(CHECK_0); + oop java_class = instanceKlass::cast(SystemDictionary::Class_klass())->allocate_permanent_instance(CHECK_0); if (type != T_VOID) { klassOop aklass = Universe::typeArrayKlassObj(type); assert(aklass != NULL, "correct bootstrap"); @@ -502,7 +502,7 @@ BasicType java_lang_Class::as_BasicType(oop java_class, klassOop* reference_klas oop java_lang_Class::primitive_mirror(BasicType t) { oop mirror = Universe::java_mirror(t); - assert(mirror != NULL && mirror->is_a(SystemDictionary::class_klass()), "must be a Class"); + assert(mirror != NULL && mirror->is_a(SystemDictionary::Class_klass()), "must be a Class"); assert(java_lang_Class::is_primitive(mirror), "must be primitive"); return mirror; } @@ -515,14 +515,14 @@ void java_lang_Class::compute_offsets() { assert(!offsets_computed, "offsets should be initialized only once"); offsets_computed = true; - klassOop k = SystemDictionary::class_klass(); + klassOop k = SystemDictionary::Class_klass(); // The classRedefinedCount field is only present starting in 1.5, // so don't go fatal. compute_optional_offset(classRedefinedCount_offset, k, vmSymbols::classRedefinedCount_name(), vmSymbols::int_signature()); // The field indicating parallelCapable (parallelLockMap) is only present starting in 7, - klassOop k1 = SystemDictionary::classloader_klass(); + klassOop k1 = SystemDictionary::ClassLoader_klass(); compute_optional_offset(parallelCapable_offset, k1, vmSymbols::parallelCapable_name(), vmSymbols::concurrenthashmap_signature()); } @@ -588,7 +588,7 @@ int java_lang_Thread::_park_event_offset = 0 ; void java_lang_Thread::compute_offsets() { assert(_group_offset == 0, "offsets should be initialized only once"); - klassOop k = SystemDictionary::thread_klass(); + klassOop k = SystemDictionary::Thread_klass(); compute_offset(_name_offset, k, vmSymbols::name_name(), vmSymbols::char_array_signature()); compute_offset(_group_offset, k, vmSymbols::group_name(), vmSymbols::threadgroup_signature()); compute_offset(_contextClassLoader_offset, k, vmSymbols::contextClassLoader_name(), vmSymbols::classloader_signature()); @@ -847,7 +847,7 @@ bool java_lang_ThreadGroup::is_vmAllowSuspension(oop java_thread_group) { void java_lang_ThreadGroup::compute_offsets() { assert(_parent_offset == 0, "offsets should be initialized only once"); - klassOop k = SystemDictionary::threadGroup_klass(); + klassOop k = SystemDictionary::ThreadGroup_klass(); compute_offset(_parent_offset, k, vmSymbols::parent_name(), vmSymbols::threadgroup_signature()); compute_offset(_name_offset, k, vmSymbols::name_name(), vmSymbols::string_signature()); @@ -1121,11 +1121,23 @@ class BacktraceBuilder: public StackObj { } void flush() { + // The following appears to have been an optimization to save from + // doing a barrier for each individual store into the _methods array, + // but rather to do it for the entire array after the series of writes. + // That optimization seems to have been lost when compressed oops was + // implemented. However, the extra card-marks below was left in place, + // but is now redundant because the individual stores into the + // _methods array already execute the barrier code. CR 6918185 has + // been filed so the original code may be restored by deferring the + // barriers until after the entire sequence of stores, thus re-enabling + // the intent of the original optimization. In the meantime the redundant + // card mark below is now disabled. if (_dirty && _methods != NULL) { +#if 0 BarrierSet* bs = Universe::heap()->barrier_set(); assert(bs->has_write_ref_array_opt(), "Barrier set must have ref array opt"); - bs->write_ref_array(MemRegion((HeapWord*)_methods->base(), - _methods->array_size())); + bs->write_ref_array((HeapWord*)_methods->base(), _methods->length()); +#endif _dirty = false; } } @@ -1169,9 +1181,7 @@ class BacktraceBuilder: public StackObj { method = mhandle(); } - _methods->obj_at_put(_index, method); - // bad for UseCompressedOops - // *_methods->obj_at_addr(_index) = method; + _methods->obj_at_put(_index, method); _bcis->ushort_at_put(_index, bci); _index++; _dirty = true; @@ -1345,7 +1355,7 @@ void java_lang_Throwable::fill_in_stack_trace_of_preallocated_backtrace(Handle t // No-op if stack trace is disabled if (!StackTraceInThrowable) return; - assert(throwable->is_a(SystemDictionary::throwable_klass()), "sanity check"); + assert(throwable->is_a(SystemDictionary::Throwable_klass()), "sanity check"); oop backtrace = java_lang_Throwable::backtrace(throwable()); assert(backtrace != NULL, "backtrace not preallocated"); @@ -1450,7 +1460,7 @@ oop java_lang_StackTraceElement::create(methodHandle method, int bci, TRAPS) { assert(JDK_Version::is_gte_jdk14x_version(), "should only be called in >= 1.4"); // Allocate java.lang.StackTraceElement instance - klassOop k = SystemDictionary::stackTraceElement_klass(); + klassOop k = SystemDictionary::StackTraceElement_klass(); assert(k != NULL, "must be loaded in 1.4+"); instanceKlassHandle ik (THREAD, k); if (ik->should_be_initialized()) { @@ -1488,7 +1498,7 @@ oop java_lang_StackTraceElement::create(methodHandle method, int bci, TRAPS) { void java_lang_reflect_AccessibleObject::compute_offsets() { - klassOop k = SystemDictionary::reflect_accessible_object_klass(); + klassOop k = SystemDictionary::reflect_AccessibleObject_klass(); compute_offset(override_offset, k, vmSymbols::override_name(), vmSymbols::bool_signature()); } @@ -1503,7 +1513,7 @@ void java_lang_reflect_AccessibleObject::set_override(oop reflect, jboolean valu } void java_lang_reflect_Method::compute_offsets() { - klassOop k = SystemDictionary::reflect_method_klass(); + klassOop k = SystemDictionary::reflect_Method_klass(); compute_offset(clazz_offset, k, vmSymbols::clazz_name(), vmSymbols::class_signature()); compute_offset(name_offset, k, vmSymbols::name_name(), vmSymbols::string_signature()); compute_offset(returnType_offset, k, vmSymbols::returnType_name(), vmSymbols::class_signature()); @@ -1524,7 +1534,7 @@ void java_lang_reflect_Method::compute_offsets() { Handle java_lang_reflect_Method::create(TRAPS) { assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem"); - klassOop klass = SystemDictionary::reflect_method_klass(); + klassOop klass = SystemDictionary::reflect_Method_klass(); // This class is eagerly initialized during VM initialization, since we keep a refence // to one of the methods assert(instanceKlass::cast(klass)->is_initialized(), "must be initialized"); @@ -1666,7 +1676,7 @@ void java_lang_reflect_Method::set_annotation_default(oop method, oop value) { } void java_lang_reflect_Constructor::compute_offsets() { - klassOop k = SystemDictionary::reflect_constructor_klass(); + klassOop k = SystemDictionary::reflect_Constructor_klass(); compute_offset(clazz_offset, k, vmSymbols::clazz_name(), vmSymbols::class_signature()); compute_offset(parameterTypes_offset, k, vmSymbols::parameterTypes_name(), vmSymbols::class_array_signature()); compute_offset(exceptionTypes_offset, k, vmSymbols::exceptionTypes_name(), vmSymbols::class_array_signature()); @@ -1790,7 +1800,7 @@ void java_lang_reflect_Constructor::set_parameter_annotations(oop method, oop va } void java_lang_reflect_Field::compute_offsets() { - klassOop k = SystemDictionary::reflect_field_klass(); + klassOop k = SystemDictionary::reflect_Field_klass(); compute_offset(clazz_offset, k, vmSymbols::clazz_name(), vmSymbols::class_signature()); compute_offset(name_offset, k, vmSymbols::name_name(), vmSymbols::string_signature()); compute_offset(type_offset, k, vmSymbols::type_name(), vmSymbols::class_signature()); @@ -1897,7 +1907,7 @@ void java_lang_reflect_Field::set_annotations(oop field, oop value) { void sun_reflect_ConstantPool::compute_offsets() { - klassOop k = SystemDictionary::reflect_constant_pool_klass(); + klassOop k = SystemDictionary::reflect_ConstantPool_klass(); // This null test can be removed post beta if (k != NULL) { compute_offset(_cp_oop_offset, k, vmSymbols::constantPoolOop_name(), vmSymbols::object_signature()); @@ -1907,7 +1917,7 @@ void sun_reflect_ConstantPool::compute_offsets() { Handle sun_reflect_ConstantPool::create(TRAPS) { assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem"); - klassOop k = SystemDictionary::reflect_constant_pool_klass(); + klassOop k = SystemDictionary::reflect_ConstantPool_klass(); instanceKlassHandle klass (THREAD, k); // Ensure it is initialized klass->initialize(CHECK_NH); @@ -1927,7 +1937,7 @@ void sun_reflect_ConstantPool::set_cp_oop(oop reflect, oop value) { } void sun_reflect_UnsafeStaticFieldAccessorImpl::compute_offsets() { - klassOop k = SystemDictionary::reflect_unsafe_static_field_accessor_impl_klass(); + klassOop k = SystemDictionary::reflect_UnsafeStaticFieldAccessorImpl_klass(); // This null test can be removed post beta if (k != NULL) { compute_offset(_base_offset, k, @@ -2073,7 +2083,7 @@ void java_lang_boxing_object::print(BasicType type, jvalue* value, outputStream* // Support for java_lang_ref_Reference oop java_lang_ref_Reference::pending_list_lock() { - instanceKlass* ik = instanceKlass::cast(SystemDictionary::reference_klass()); + instanceKlass* ik = instanceKlass::cast(SystemDictionary::Reference_klass()); char *addr = (((char *)ik->start_of_static_fields()) + static_lock_offset); if (UseCompressedOops) { return oopDesc::load_decode_heap_oop((narrowOop *)addr); @@ -2083,7 +2093,7 @@ oop java_lang_ref_Reference::pending_list_lock() { } HeapWord *java_lang_ref_Reference::pending_list_addr() { - instanceKlass* ik = instanceKlass::cast(SystemDictionary::reference_klass()); + instanceKlass* ik = instanceKlass::cast(SystemDictionary::Reference_klass()); char *addr = (((char *)ik->start_of_static_fields()) + static_pending_offset); // XXX This might not be HeapWord aligned, almost rather be char *. return (HeapWord*)addr; @@ -2106,17 +2116,17 @@ jlong java_lang_ref_SoftReference::timestamp(oop ref) { } jlong java_lang_ref_SoftReference::clock() { - instanceKlass* ik = instanceKlass::cast(SystemDictionary::soft_reference_klass()); + instanceKlass* ik = instanceKlass::cast(SystemDictionary::SoftReference_klass()); int offset = ik->offset_of_static_fields() + static_clock_offset; - return SystemDictionary::soft_reference_klass()->long_field(offset); + return SystemDictionary::SoftReference_klass()->long_field(offset); } void java_lang_ref_SoftReference::set_clock(jlong value) { - instanceKlass* ik = instanceKlass::cast(SystemDictionary::soft_reference_klass()); + instanceKlass* ik = instanceKlass::cast(SystemDictionary::SoftReference_klass()); int offset = ik->offset_of_static_fields() + static_clock_offset; - SystemDictionary::soft_reference_klass()->long_field_put(offset, value); + SystemDictionary::SoftReference_klass()->long_field_put(offset, value); } @@ -2404,6 +2414,10 @@ oop java_dyn_MethodType::ptype(oop mt, int idx) { return ptypes(mt)->obj_at(idx); } +int java_dyn_MethodType::ptype_count(oop mt) { + return ptypes(mt)->length(); +} + // Support for java_dyn_MethodTypeForm @@ -2430,15 +2444,15 @@ oop java_dyn_MethodTypeForm::erasedType(oop mtform) { } -// Support for sun_dyn_CallSiteImpl +// Support for java_dyn_CallSite -int sun_dyn_CallSiteImpl::_type_offset; -int sun_dyn_CallSiteImpl::_target_offset; -int sun_dyn_CallSiteImpl::_vmmethod_offset; +int java_dyn_CallSite::_type_offset; +int java_dyn_CallSite::_target_offset; +int java_dyn_CallSite::_vmmethod_offset; -void sun_dyn_CallSiteImpl::compute_offsets() { +void java_dyn_CallSite::compute_offsets() { if (!EnableInvokeDynamic) return; - klassOop k = SystemDictionary::CallSiteImpl_klass(); + klassOop k = SystemDictionary::CallSite_klass(); if (k != NULL) { compute_offset(_type_offset, k, vmSymbols::type_name(), vmSymbols::java_dyn_MethodType_signature(), true); compute_offset(_target_offset, k, vmSymbols::target_name(), vmSymbols::java_dyn_MethodHandle_signature(), true); @@ -2446,23 +2460,23 @@ void sun_dyn_CallSiteImpl::compute_offsets() { } } -oop sun_dyn_CallSiteImpl::type(oop site) { +oop java_dyn_CallSite::type(oop site) { return site->obj_field(_type_offset); } -oop sun_dyn_CallSiteImpl::target(oop site) { +oop java_dyn_CallSite::target(oop site) { return site->obj_field(_target_offset); } -void sun_dyn_CallSiteImpl::set_target(oop site, oop target) { +void java_dyn_CallSite::set_target(oop site, oop target) { site->obj_field_put(_target_offset, target); } -oop sun_dyn_CallSiteImpl::vmmethod(oop site) { +oop java_dyn_CallSite::vmmethod(oop site) { return site->obj_field(_vmmethod_offset); } -void sun_dyn_CallSiteImpl::set_vmmethod(oop site, oop ref) { +void java_dyn_CallSite::set_vmmethod(oop site, oop ref) { site->obj_field_put(_vmmethod_offset, ref); } @@ -2535,7 +2549,7 @@ oop java_lang_ClassLoader::non_reflection_class_loader(oop loader) { // the generated bytecodes for reflection, and if so, "magically" // delegate to its parent to prevent class loading from occurring // in places where applications using reflection didn't expect it. - klassOop delegating_cl_class = SystemDictionary::reflect_delegating_classloader_klass(); + klassOop delegating_cl_class = SystemDictionary::reflect_DelegatingClassLoader_klass(); // This might be null in non-1.4 JDKs if (delegating_cl_class != NULL && loader->is_a(delegating_cl_class)) { return parent(loader); @@ -2550,7 +2564,7 @@ oop java_lang_ClassLoader::non_reflection_class_loader(oop loader) { void java_lang_System::compute_offsets() { assert(offset_of_static_fields == 0, "offsets should be initialized only once"); - instanceKlass* ik = instanceKlass::cast(SystemDictionary::system_klass()); + instanceKlass* ik = instanceKlass::cast(SystemDictionary::System_klass()); offset_of_static_fields = ik->offset_of_static_fields(); } @@ -2811,7 +2825,7 @@ void JavaClasses::compute_offsets() { java_dyn_MethodTypeForm::compute_offsets(); } if (EnableInvokeDynamic) { - sun_dyn_CallSiteImpl::compute_offsets(); + java_dyn_CallSite::compute_offsets(); } java_security_AccessControlContext::compute_offsets(); // Initialize reflection classes. The layouts of these classes diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp index 048fba8d4b0..af78d5e58b3 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.hpp +++ b/hotspot/src/share/vm/classfile/javaClasses.hpp @@ -111,7 +111,7 @@ class java_lang_String : AllStatic { // Testers static bool is_instance(oop obj) { - return obj != NULL && obj->klass() == SystemDictionary::string_klass(); + return obj != NULL && obj->klass() == SystemDictionary::String_klass(); } // Debugging @@ -161,7 +161,7 @@ class java_lang_Class : AllStatic { static void print_signature(oop java_class, outputStream *st); // Testing static bool is_instance(oop obj) { - return obj != NULL && obj->klass() == SystemDictionary::class_klass(); + return obj != NULL && obj->klass() == SystemDictionary::Class_klass(); } static bool is_primitive(oop java_class); static BasicType primitive_type(oop java_class); @@ -1027,6 +1027,7 @@ class java_dyn_MethodType: AllStatic { static oop form(oop mt); static oop ptype(oop mt, int index); + static int ptype_count(oop mt); static symbolOop as_signature(oop mt, bool intern_if_not_found, TRAPS); static void print_signature(oop mt, outputStream* st); @@ -1061,9 +1062,9 @@ class java_dyn_MethodTypeForm: AllStatic { }; -// Interface to sun.dyn.CallSiteImpl objects +// Interface to java.dyn.CallSite objects -class sun_dyn_CallSiteImpl: AllStatic { +class java_dyn_CallSite: AllStatic { friend class JavaClasses; private: @@ -1083,6 +1084,14 @@ public: static oop vmmethod(oop site); static void set_vmmethod(oop site, oop ref); + // Testers + static bool is_subclass(klassOop klass) { + return Klass::cast(klass)->is_subclass_of(SystemDictionary::CallSite_klass()); + } + static bool is_instance(oop obj) { + return obj != NULL && is_subclass(obj->klass()); + } + // Accessors for code generation: static int target_offset_in_bytes() { return _target_offset; } static int type_offset_in_bytes() { return _type_offset; } diff --git a/hotspot/src/share/vm/classfile/loaderConstraints.cpp b/hotspot/src/share/vm/classfile/loaderConstraints.cpp index daaaa327556..0a8693403d1 100644 --- a/hotspot/src/share/vm/classfile/loaderConstraints.cpp +++ b/hotspot/src/share/vm/classfile/loaderConstraints.cpp @@ -457,7 +457,8 @@ void LoaderConstraintTable::merge_loader_constraints( } -void LoaderConstraintTable::verify(Dictionary* dictionary) { +void LoaderConstraintTable::verify(Dictionary* dictionary, + PlaceholderTable* placeholders) { Thread *thread = Thread::current(); for (int cindex = 0; cindex < _loader_constraint_size; cindex++) { for (LoaderConstraintEntry* probe = bucket(cindex); @@ -472,7 +473,23 @@ void LoaderConstraintTable::verify(Dictionary* dictionary) { unsigned int d_hash = dictionary->compute_hash(name, loader); int d_index = dictionary->hash_to_index(d_hash); klassOop k = dictionary->find_class(d_index, d_hash, name, loader); - guarantee(k == probe->klass(), "klass should be in dictionary"); + if (k != NULL) { + // We found the class in the system dictionary, so we should + // make sure that the klassOop matches what we already have. + guarantee(k == probe->klass(), "klass should be in dictionary"); + } else { + // If we don't find the class in the system dictionary, it + // has to be in the placeholders table. + unsigned int p_hash = placeholders->compute_hash(name, loader); + int p_index = placeholders->hash_to_index(p_hash); + PlaceholderEntry* entry = placeholders->get_entry(p_index, p_hash, + name, loader); + + // The instanceKlass might not be on the entry, so the only + // thing we can check here is whether we were successful in + // finding the class in the placeholders table. + guarantee(entry != NULL, "klass should be in the placeholders"); + } } for (int n = 0; n< probe->num_loaders(); n++) { guarantee(probe->loader(n)->is_oop_or_null(), "should be oop"); diff --git a/hotspot/src/share/vm/classfile/loaderConstraints.hpp b/hotspot/src/share/vm/classfile/loaderConstraints.hpp index 6928180d22a..53ce146b168 100644 --- a/hotspot/src/share/vm/classfile/loaderConstraints.hpp +++ b/hotspot/src/share/vm/classfile/loaderConstraints.hpp @@ -84,7 +84,7 @@ public: void purge_loader_constraints(BoolObjectClosure* is_alive); - void verify(Dictionary* dictionary); + void verify(Dictionary* dictionary, PlaceholderTable* placeholders); #ifndef PRODUCT void print(); #endif diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp index 5598c9fcfb3..1db0a5cfb15 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.cpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp @@ -60,10 +60,10 @@ oop SystemDictionary::java_system_loader() { } void SystemDictionary::compute_java_system_loader(TRAPS) { - KlassHandle system_klass(THREAD, WK_KLASS(classloader_klass)); + KlassHandle system_klass(THREAD, WK_KLASS(ClassLoader_klass)); JavaValue result(T_OBJECT); JavaCalls::call_static(&result, - KlassHandle(THREAD, WK_KLASS(classloader_klass)), + KlassHandle(THREAD, WK_KLASS(ClassLoader_klass)), vmSymbolHandles::getSystemClassLoader_name(), vmSymbolHandles::void_classloader_signature(), CHECK); @@ -99,6 +99,15 @@ bool SystemDictionary::is_parallelCapable(Handle class_loader) { return java_lang_Class::parallelCapable(class_loader()); } // ---------------------------------------------------------------------------- +// ParallelDefineClass flag does not apply to bootclass loader +bool SystemDictionary::is_parallelDefine(Handle class_loader) { + if (class_loader.is_null()) return false; + if (AllowParallelDefineClass && java_lang_Class::parallelCapable(class_loader())) { + return true; + } + return false; +} +// ---------------------------------------------------------------------------- // Resolving of classes // Forwards to resolve_or_null @@ -119,7 +128,7 @@ klassOop SystemDictionary::handle_resolution_exception(symbolHandle class_name, // in which case we have to check whether the pending exception is a ClassNotFoundException, // and if so convert it to a NoClassDefFoundError // And chain the original ClassNotFoundException - if (throw_error && PENDING_EXCEPTION->is_a(SystemDictionary::classNotFoundException_klass())) { + if (throw_error && PENDING_EXCEPTION->is_a(SystemDictionary::ClassNotFoundException_klass())) { ResourceMark rm(THREAD); assert(klass_h() == NULL, "Should not have result with exception pending"); Handle e(THREAD, PENDING_EXCEPTION); @@ -350,7 +359,7 @@ void SystemDictionary::validate_protection_domain(instanceKlassHandle klass, assert(class_loader() != NULL, "should not have non-null protection domain for null classloader"); - KlassHandle system_loader(THREAD, SystemDictionary::classloader_klass()); + KlassHandle system_loader(THREAD, SystemDictionary::ClassLoader_klass()); JavaCalls::call_special(&result, class_loader, system_loader, @@ -724,17 +733,17 @@ klassOop SystemDictionary::resolve_instance_class_or_null(symbolHandle class_nam // Do actual loading k = load_instance_class(name, class_loader, THREAD); - // For UnsyncloadClass and AllowParallelDefineClass only: + // For UnsyncloadClass only // If they got a linkageError, check if a parallel class load succeeded. // If it did, then for bytecode resolution the specification requires // that we return the same result we did for the other thread, i.e. the // successfully loaded instanceKlass // Should not get here for classloaders that support parallelism - // with the new cleaner mechanism + // with the new cleaner mechanism, even with AllowParallelDefineClass // Bootstrap goes through here to allow for an extra guarantee check if (UnsyncloadClass || (class_loader.is_null())) { if (k.is_null() && HAS_PENDING_EXCEPTION - && PENDING_EXCEPTION->is_a(SystemDictionary::linkageError_klass())) { + && PENDING_EXCEPTION->is_a(SystemDictionary::LinkageError_klass())) { MutexLocker mu(SystemDictionary_lock, THREAD); klassOop check = find_class(d_index, d_hash, name, class_loader); if (check != NULL) { @@ -1358,7 +1367,7 @@ instanceKlassHandle SystemDictionary::load_instance_class(symbolHandle class_nam JavaValue result(T_OBJECT); - KlassHandle spec_klass (THREAD, SystemDictionary::classloader_klass()); + KlassHandle spec_klass (THREAD, SystemDictionary::ClassLoader_klass()); // Call public unsynchronized loadClass(String) directly for all class loaders // for parallelCapable class loaders. JDK >=7, loadClass(String, boolean) will @@ -1483,14 +1492,17 @@ void SystemDictionary::define_instance_class(instanceKlassHandle k, TRAPS) { } // Support parallel classloading -// Initial implementation for bootstrap classloader -// For custom class loaders that support parallel classloading, +// All parallel class loaders, including bootstrap classloader +// lock a placeholder entry for this class/class_loader pair +// to allow parallel defines of different classes for this class loader // With AllowParallelDefine flag==true, in case they do not synchronize around // FindLoadedClass/DefineClass, calls, we check for parallel // loading for them, wait if a defineClass is in progress // and return the initial requestor's results +// This flag does not apply to the bootstrap classloader. // With AllowParallelDefine flag==false, call through to define_instance_class // which will throw LinkageError: duplicate class definition. +// False is the requested default. // For better performance, the class loaders should synchronize // findClass(), i.e. FindLoadedClass/DefineClassIfAbsent or they // potentially waste time reading and parsing the bytestream. @@ -1511,9 +1523,11 @@ instanceKlassHandle SystemDictionary::find_or_define_instance_class(symbolHandle { MutexLocker mu(SystemDictionary_lock, THREAD); // First check if class already defined - klassOop check = find_class(d_index, d_hash, name_h, class_loader); - if (check != NULL) { - return(instanceKlassHandle(THREAD, check)); + if (UnsyncloadClass || (is_parallelDefine(class_loader))) { + klassOop check = find_class(d_index, d_hash, name_h, class_loader); + if (check != NULL) { + return(instanceKlassHandle(THREAD, check)); + } } // Acquire define token for this class/classloader @@ -1529,7 +1543,7 @@ instanceKlassHandle SystemDictionary::find_or_define_instance_class(symbolHandle // Only special cases allow parallel defines and can use other thread's results // Other cases fall through, and may run into duplicate defines // caught by finding an entry in the SystemDictionary - if ((UnsyncloadClass || AllowParallelDefineClass) && (probe->instanceKlass() != NULL)) { + if ((UnsyncloadClass || is_parallelDefine(class_loader)) && (probe->instanceKlass() != NULL)) { probe->remove_seen_thread(THREAD, PlaceholderTable::DEFINE_CLASS); placeholders()->find_and_remove(p_index, p_hash, name_h, class_loader, THREAD); SystemDictionary_lock->notify_all(); @@ -1930,13 +1944,13 @@ void SystemDictionary::initialize_wk_klasses_until(WKID limit_id, WKID &start_id void SystemDictionary::initialize_preloaded_classes(TRAPS) { - assert(WK_KLASS(object_klass) == NULL, "preloaded classes should only be initialized once"); + assert(WK_KLASS(Object_klass) == NULL, "preloaded classes should only be initialized once"); // Preload commonly used klasses WKID scan = FIRST_WKID; // first do Object, String, Class - initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(class_klass), scan, CHECK); + initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(Class_klass), scan, CHECK); - debug_only(instanceKlass::verify_class_klass_nonstatic_oop_maps(WK_KLASS(class_klass))); + debug_only(instanceKlass::verify_class_klass_nonstatic_oop_maps(WK_KLASS(Class_klass))); // Fixup mirrors for classes loaded before java.lang.Class. // These calls iterate over the objects currently in the perm gen @@ -1947,17 +1961,17 @@ void SystemDictionary::initialize_preloaded_classes(TRAPS) { Universe::fixup_mirrors(CHECK); // do a bunch more: - initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(reference_klass), scan, CHECK); + initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(Reference_klass), scan, CHECK); // Preload ref klasses and set reference types - instanceKlass::cast(WK_KLASS(reference_klass))->set_reference_type(REF_OTHER); - instanceRefKlass::update_nonstatic_oop_maps(WK_KLASS(reference_klass)); + instanceKlass::cast(WK_KLASS(Reference_klass))->set_reference_type(REF_OTHER); + instanceRefKlass::update_nonstatic_oop_maps(WK_KLASS(Reference_klass)); - initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(phantom_reference_klass), scan, CHECK); - instanceKlass::cast(WK_KLASS(soft_reference_klass))->set_reference_type(REF_SOFT); - instanceKlass::cast(WK_KLASS(weak_reference_klass))->set_reference_type(REF_WEAK); - instanceKlass::cast(WK_KLASS(final_reference_klass))->set_reference_type(REF_FINAL); - instanceKlass::cast(WK_KLASS(phantom_reference_klass))->set_reference_type(REF_PHANTOM); + initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(PhantomReference_klass), scan, CHECK); + instanceKlass::cast(WK_KLASS(SoftReference_klass))->set_reference_type(REF_SOFT); + instanceKlass::cast(WK_KLASS(WeakReference_klass))->set_reference_type(REF_WEAK); + instanceKlass::cast(WK_KLASS(FinalReference_klass))->set_reference_type(REF_FINAL); + instanceKlass::cast(WK_KLASS(PhantomReference_klass))->set_reference_type(REF_PHANTOM); WKID meth_group_start = WK_KLASS_ENUM_NAME(MethodHandle_klass); WKID meth_group_end = WK_KLASS_ENUM_NAME(WrongMethodTypeException_klass); @@ -1970,10 +1984,10 @@ void SystemDictionary::initialize_preloaded_classes(TRAPS) { scan = WKID(meth_group_end+1); } WKID indy_group_start = WK_KLASS_ENUM_NAME(Linkage_klass); - WKID indy_group_end = WK_KLASS_ENUM_NAME(Dynamic_klass); + WKID indy_group_end = WK_KLASS_ENUM_NAME(InvokeDynamic_klass); initialize_wk_klasses_until(indy_group_start, scan, CHECK); if (EnableInvokeDynamic) { - initialize_wk_klasses_through(indy_group_start, scan, CHECK); + initialize_wk_klasses_through(indy_group_end, scan, CHECK); } if (_well_known_klasses[indy_group_start] == NULL) { // Skip the rest of the dynamic typing classes, if Linkage is not loaded. @@ -1982,14 +1996,14 @@ void SystemDictionary::initialize_preloaded_classes(TRAPS) { initialize_wk_klasses_until(WKID_LIMIT, scan, CHECK); - _box_klasses[T_BOOLEAN] = WK_KLASS(boolean_klass); - _box_klasses[T_CHAR] = WK_KLASS(char_klass); - _box_klasses[T_FLOAT] = WK_KLASS(float_klass); - _box_klasses[T_DOUBLE] = WK_KLASS(double_klass); - _box_klasses[T_BYTE] = WK_KLASS(byte_klass); - _box_klasses[T_SHORT] = WK_KLASS(short_klass); - _box_klasses[T_INT] = WK_KLASS(int_klass); - _box_klasses[T_LONG] = WK_KLASS(long_klass); + _box_klasses[T_BOOLEAN] = WK_KLASS(Boolean_klass); + _box_klasses[T_CHAR] = WK_KLASS(Character_klass); + _box_klasses[T_FLOAT] = WK_KLASS(Float_klass); + _box_klasses[T_DOUBLE] = WK_KLASS(Double_klass); + _box_klasses[T_BYTE] = WK_KLASS(Byte_klass); + _box_klasses[T_SHORT] = WK_KLASS(Short_klass); + _box_klasses[T_INT] = WK_KLASS(Integer_klass); + _box_klasses[T_LONG] = WK_KLASS(Long_klass); //_box_klasses[T_OBJECT] = WK_KLASS(object_klass); //_box_klasses[T_ARRAY] = WK_KLASS(object_klass); @@ -2000,11 +2014,11 @@ void SystemDictionary::initialize_preloaded_classes(TRAPS) { #endif // KERNEL { // Compute whether we should use loadClass or loadClassInternal when loading classes. - methodOop method = instanceKlass::cast(classloader_klass())->find_method(vmSymbols::loadClassInternal_name(), vmSymbols::string_class_signature()); + methodOop method = instanceKlass::cast(ClassLoader_klass())->find_method(vmSymbols::loadClassInternal_name(), vmSymbols::string_class_signature()); _has_loadClassInternal = (method != NULL); } { // Compute whether we should use checkPackageAccess or NOT - methodOop method = instanceKlass::cast(classloader_klass())->find_method(vmSymbols::checkPackageAccess_name(), vmSymbols::class_protectiondomain_signature()); + methodOop method = instanceKlass::cast(ClassLoader_klass())->find_method(vmSymbols::checkPackageAccess_name(), vmSymbols::class_protectiondomain_signature()); _has_checkPackageAccess = (method != NULL); } } @@ -2326,6 +2340,8 @@ methodOop SystemDictionary::find_method_handle_invoke(symbolHandle signature, SymbolPropertyEntry* spe = invoke_method_table()->find_entry(index, hash, signature); if (spe == NULL || spe->property_oop() == NULL) { // Must create lots of stuff here, but outside of the SystemDictionary lock. + if (THREAD->is_Compiler_thread()) + return NULL; // do not attempt from within compiler Handle mt = compute_method_handle_type(signature(), class_loader, protection_domain, CHECK_NULL); @@ -2358,7 +2374,7 @@ Handle SystemDictionary::compute_method_handle_type(symbolHandle signature, TRAPS) { Handle empty; int npts = ArgumentCount(signature()).size(); - objArrayHandle pts = oopFactory::new_objArray(SystemDictionary::class_klass(), npts, CHECK_(empty)); + objArrayHandle pts = oopFactory::new_objArray(SystemDictionary::Class_klass(), npts, CHECK_(empty)); int arg = 0; Handle rt; // the return type from the signature for (SignatureStream ss(signature()); !ss.is_done(); ss.next()) { @@ -2404,7 +2420,7 @@ Handle SystemDictionary::make_dynamic_call_site(KlassHandle caller, methodHandle mh_invdyn, TRAPS) { Handle empty; - // call sun.dyn.CallSiteImpl::makeSite(caller, name, mtype, cmid, cbci) + // call java.dyn.CallSite::makeSite(caller, name, mtype, cmid, cbci) oop name_str_oop = StringTable::intern(name(), CHECK_(empty)); // not a handle! JavaCallArguments args(Handle(THREAD, caller->java_mirror())); args.push_oop(name_str_oop); @@ -2413,17 +2429,19 @@ Handle SystemDictionary::make_dynamic_call_site(KlassHandle caller, args.push_int(caller_bci); JavaValue result(T_OBJECT); JavaCalls::call_static(&result, - SystemDictionary::CallSiteImpl_klass(), + SystemDictionary::CallSite_klass(), vmSymbols::makeSite_name(), vmSymbols::makeSite_signature(), &args, CHECK_(empty)); oop call_site_oop = (oop) result.get_jobject(); assert(call_site_oop->is_oop() - /*&& sun_dyn_CallSiteImpl::is_instance(call_site_oop)*/, "must be sane"); - sun_dyn_CallSiteImpl::set_vmmethod(call_site_oop, mh_invdyn()); + /*&& java_dyn_CallSite::is_instance(call_site_oop)*/, "must be sane"); + java_dyn_CallSite::set_vmmethod(call_site_oop, mh_invdyn()); if (TraceMethodHandles) { +#ifndef PRODUCT tty->print_cr("Linked invokedynamic bci=%d site="INTPTR_FORMAT":", caller_bci, call_site_oop); call_site_oop->print(); tty->cr(); +#endif //PRODUCT } return call_site_oop; } @@ -2436,9 +2454,17 @@ Handle SystemDictionary::find_bootstrap_method(KlassHandle caller, instanceKlassHandle ik(THREAD, caller()); - if (ik->bootstrap_method() != NULL) { - return Handle(THREAD, ik->bootstrap_method()); + oop boot_method_oop = ik->bootstrap_method(); + if (boot_method_oop != NULL) { + if (TraceMethodHandles) { + tty->print_cr("bootstrap method for "PTR_FORMAT" cached as "PTR_FORMAT":", ik(), boot_method_oop); + } + NOT_PRODUCT(if (!boot_method_oop->is_oop()) { tty->print_cr("*** boot MH of "PTR_FORMAT" = "PTR_FORMAT, ik(), boot_method_oop); ik()->print(); }); + assert(boot_method_oop->is_oop() + && java_dyn_MethodHandle::is_instance(boot_method_oop), "must be sane"); + return Handle(THREAD, boot_method_oop); } + boot_method_oop = NULL; // GC safety // call java.dyn.Linkage::findBootstrapMethod(caller, sbk) JavaCallArguments args(Handle(THREAD, ik->java_mirror())); @@ -2452,9 +2478,18 @@ Handle SystemDictionary::find_bootstrap_method(KlassHandle caller, vmSymbols::findBootstrapMethod_name(), vmSymbols::findBootstrapMethod_signature(), &args, CHECK_(empty)); - oop boot_method_oop = (oop) result.get_jobject(); + boot_method_oop = (oop) result.get_jobject(); if (boot_method_oop != NULL) { + if (TraceMethodHandles) { +#ifndef PRODUCT + tty->print_cr("--------"); + tty->print_cr("bootstrap method for "PTR_FORMAT" computed as "PTR_FORMAT":", ik(), boot_method_oop); + ik()->print(); + boot_method_oop->print(); + tty->print_cr("========"); +#endif //PRODUCT + } assert(boot_method_oop->is_oop() && java_dyn_MethodHandle::is_instance(boot_method_oop), "must be sane"); // probably no race conditions, but let's be careful: @@ -2463,6 +2498,14 @@ Handle SystemDictionary::find_bootstrap_method(KlassHandle caller, else boot_method_oop = ik->bootstrap_method(); } else { + if (TraceMethodHandles) { +#ifndef PRODUCT + tty->print_cr("--------"); + tty->print_cr("bootstrap method for "PTR_FORMAT" computed as NULL:", ik()); + ik()->print(); + tty->print_cr("========"); +#endif //PRODUCT + } boot_method_oop = ik->bootstrap_method(); } @@ -2530,7 +2573,7 @@ void SystemDictionary::verify() { // Verify constraint table guarantee(constraints() != NULL, "Verify of loader constraints failed"); - constraints()->verify(dictionary()); + constraints()->verify(dictionary(), placeholders()); } diff --git a/hotspot/src/share/vm/classfile/systemDictionary.hpp b/hotspot/src/share/vm/classfile/systemDictionary.hpp index b7c82033628..03b2aeb6b42 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.hpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -82,55 +82,55 @@ class SymbolPropertyTable; #define WK_KLASSES_DO(template) \ /* well-known classes */ \ - template(object_klass, java_lang_Object, Pre) \ - template(string_klass, java_lang_String, Pre) \ - template(class_klass, java_lang_Class, Pre) \ - template(cloneable_klass, java_lang_Cloneable, Pre) \ - template(classloader_klass, java_lang_ClassLoader, Pre) \ - template(serializable_klass, java_io_Serializable, Pre) \ - template(system_klass, java_lang_System, Pre) \ - template(throwable_klass, java_lang_Throwable, Pre) \ - template(error_klass, java_lang_Error, Pre) \ - template(threaddeath_klass, java_lang_ThreadDeath, Pre) \ - template(exception_klass, java_lang_Exception, Pre) \ - template(runtime_exception_klass, java_lang_RuntimeException, Pre) \ - template(protectionDomain_klass, java_security_ProtectionDomain, Pre) \ + template(Object_klass, java_lang_Object, Pre) \ + template(String_klass, java_lang_String, Pre) \ + template(Class_klass, java_lang_Class, Pre) \ + template(Cloneable_klass, java_lang_Cloneable, Pre) \ + template(ClassLoader_klass, java_lang_ClassLoader, Pre) \ + template(Serializable_klass, java_io_Serializable, Pre) \ + template(System_klass, java_lang_System, Pre) \ + template(Throwable_klass, java_lang_Throwable, Pre) \ + template(Error_klass, java_lang_Error, Pre) \ + template(ThreadDeath_klass, java_lang_ThreadDeath, Pre) \ + template(Exception_klass, java_lang_Exception, Pre) \ + template(RuntimeException_klass, java_lang_RuntimeException, Pre) \ + template(ProtectionDomain_klass, java_security_ProtectionDomain, Pre) \ template(AccessControlContext_klass, java_security_AccessControlContext, Pre) \ - template(classNotFoundException_klass, java_lang_ClassNotFoundException, Pre) \ - template(noClassDefFoundError_klass, java_lang_NoClassDefFoundError, Pre) \ - template(linkageError_klass, java_lang_LinkageError, Pre) \ + template(ClassNotFoundException_klass, java_lang_ClassNotFoundException, Pre) \ + template(NoClassDefFoundError_klass, java_lang_NoClassDefFoundError, Pre) \ + template(LinkageError_klass, java_lang_LinkageError, Pre) \ template(ClassCastException_klass, java_lang_ClassCastException, Pre) \ template(ArrayStoreException_klass, java_lang_ArrayStoreException, Pre) \ - template(virtualMachineError_klass, java_lang_VirtualMachineError, Pre) \ + template(VirtualMachineError_klass, java_lang_VirtualMachineError, Pre) \ template(OutOfMemoryError_klass, java_lang_OutOfMemoryError, Pre) \ template(StackOverflowError_klass, java_lang_StackOverflowError, Pre) \ template(IllegalMonitorStateException_klass, java_lang_IllegalMonitorStateException, Pre) \ - template(reference_klass, java_lang_ref_Reference, Pre) \ + template(Reference_klass, java_lang_ref_Reference, Pre) \ \ /* Preload ref klasses and set reference types */ \ - template(soft_reference_klass, java_lang_ref_SoftReference, Pre) \ - template(weak_reference_klass, java_lang_ref_WeakReference, Pre) \ - template(final_reference_klass, java_lang_ref_FinalReference, Pre) \ - template(phantom_reference_klass, java_lang_ref_PhantomReference, Pre) \ - template(finalizer_klass, java_lang_ref_Finalizer, Pre) \ + template(SoftReference_klass, java_lang_ref_SoftReference, Pre) \ + template(WeakReference_klass, java_lang_ref_WeakReference, Pre) \ + template(FinalReference_klass, java_lang_ref_FinalReference, Pre) \ + template(PhantomReference_klass, java_lang_ref_PhantomReference, Pre) \ + template(Finalizer_klass, java_lang_ref_Finalizer, Pre) \ \ - template(thread_klass, java_lang_Thread, Pre) \ - template(threadGroup_klass, java_lang_ThreadGroup, Pre) \ - template(properties_klass, java_util_Properties, Pre) \ - template(reflect_accessible_object_klass, java_lang_reflect_AccessibleObject, Pre) \ - template(reflect_field_klass, java_lang_reflect_Field, Pre) \ - template(reflect_method_klass, java_lang_reflect_Method, Pre) \ - template(reflect_constructor_klass, java_lang_reflect_Constructor, Pre) \ + template(Thread_klass, java_lang_Thread, Pre) \ + template(ThreadGroup_klass, java_lang_ThreadGroup, Pre) \ + template(Properties_klass, java_util_Properties, Pre) \ + template(reflect_AccessibleObject_klass, java_lang_reflect_AccessibleObject, Pre) \ + template(reflect_Field_klass, java_lang_reflect_Field, Pre) \ + template(reflect_Method_klass, java_lang_reflect_Method, Pre) \ + template(reflect_Constructor_klass, java_lang_reflect_Constructor, Pre) \ \ /* NOTE: needed too early in bootstrapping process to have checks based on JDK version */ \ /* Universe::is_gte_jdk14x_version() is not set up by this point. */ \ /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ - template(reflect_magic_klass, sun_reflect_MagicAccessorImpl, Opt) \ - template(reflect_method_accessor_klass, sun_reflect_MethodAccessorImpl, Opt_Only_JDK14NewRef) \ - template(reflect_constructor_accessor_klass, sun_reflect_ConstructorAccessorImpl, Opt_Only_JDK14NewRef) \ - template(reflect_delegating_classloader_klass, sun_reflect_DelegatingClassLoader, Opt) \ - template(reflect_constant_pool_klass, sun_reflect_ConstantPool, Opt_Only_JDK15) \ - template(reflect_unsafe_static_field_accessor_impl_klass, sun_reflect_UnsafeStaticFieldAccessorImpl, Opt_Only_JDK15) \ + template(reflect_MagicAccessorImpl_klass, sun_reflect_MagicAccessorImpl, Opt) \ + template(reflect_MethodAccessorImpl_klass, sun_reflect_MethodAccessorImpl, Opt_Only_JDK14NewRef) \ + template(reflect_ConstructorAccessorImpl_klass, sun_reflect_ConstructorAccessorImpl, Opt_Only_JDK14NewRef) \ + template(reflect_DelegatingClassLoader_klass, sun_reflect_DelegatingClassLoader, Opt) \ + template(reflect_ConstantPool_klass, sun_reflect_ConstantPool, Opt_Only_JDK15) \ + template(reflect_UnsafeStaticFieldAccessorImpl_klass, sun_reflect_UnsafeStaticFieldAccessorImpl, Opt_Only_JDK15) \ \ /* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \ template(MethodHandle_klass, java_dyn_MethodHandle, Opt) \ @@ -144,16 +144,14 @@ class SymbolPropertyTable; template(WrongMethodTypeException_klass, java_dyn_WrongMethodTypeException, Opt) \ template(Linkage_klass, java_dyn_Linkage, Opt) \ template(CallSite_klass, java_dyn_CallSite, Opt) \ - template(CallSiteImpl_klass, sun_dyn_CallSiteImpl, Opt) \ - template(Dynamic_klass, java_dyn_Dynamic, Opt) \ - /* Note: MethodHandle must be first, and Dynamic last in group */ \ + template(InvokeDynamic_klass, java_dyn_InvokeDynamic, Opt) \ + /* Note: MethodHandle must be first, and InvokeDynamic last in group */ \ \ - template(vector_klass, java_util_Vector, Pre) \ - template(hashtable_klass, java_util_Hashtable, Pre) \ - template(stringBuffer_klass, java_lang_StringBuffer, Pre) \ + template(StringBuffer_klass, java_lang_StringBuffer, Pre) \ + template(StringBuilder_klass, java_lang_StringBuilder, Pre) \ \ /* It's NULL in non-1.4 JDKs. */ \ - template(stackTraceElement_klass, java_lang_StackTraceElement, Opt) \ + template(StackTraceElement_klass, java_lang_StackTraceElement, Opt) \ /* Universe::is_gte_jdk14x_version() is not set up by this point. */ \ /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ template(java_nio_Buffer_klass, java_nio_Buffer, Opt) \ @@ -164,14 +162,14 @@ class SymbolPropertyTable; template(sun_jkernel_DownloadManager_klass, sun_jkernel_DownloadManager, Opt_Kernel) \ \ /* Preload boxing klasses */ \ - template(boolean_klass, java_lang_Boolean, Pre) \ - template(char_klass, java_lang_Character, Pre) \ - template(float_klass, java_lang_Float, Pre) \ - template(double_klass, java_lang_Double, Pre) \ - template(byte_klass, java_lang_Byte, Pre) \ - template(short_klass, java_lang_Short, Pre) \ - template(int_klass, java_lang_Integer, Pre) \ - template(long_klass, java_lang_Long, Pre) \ + template(Boolean_klass, java_lang_Boolean, Pre) \ + template(Character_klass, java_lang_Character, Pre) \ + template(Float_klass, java_lang_Float, Pre) \ + template(Double_klass, java_lang_Double, Pre) \ + template(Byte_klass, java_lang_Byte, Pre) \ + template(Short_klass, java_lang_Short, Pre) \ + template(Integer_klass, java_lang_Integer, Pre) \ + template(Long_klass, java_lang_Long, Pre) \ /*end*/ @@ -438,8 +436,8 @@ public: // Tells whether ClassLoader.checkPackageAccess is present static bool has_checkPackageAccess() { return _has_checkPackageAccess; } - static bool class_klass_loaded() { return WK_KLASS(class_klass) != NULL; } - static bool cloneable_klass_loaded() { return WK_KLASS(cloneable_klass) != NULL; } + static bool Class_klass_loaded() { return WK_KLASS(Class_klass) != NULL; } + static bool Cloneable_klass_loaded() { return WK_KLASS(Cloneable_klass) != NULL; } // Returns default system loader static oop java_system_loader(); @@ -578,6 +576,7 @@ private: static Handle compute_loader_lock_object(Handle class_loader, TRAPS); static void check_loader_lock_contention(Handle loader_lock, TRAPS); static bool is_parallelCapable(Handle class_loader); + static bool is_parallelDefine(Handle class_loader); static klassOop find_shared_class(symbolHandle class_name); diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp index dd947d19cfb..3a9136c7b9b 100644 --- a/hotspot/src/share/vm/classfile/verifier.cpp +++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -143,7 +143,7 @@ bool Verifier::verify(instanceKlassHandle klass, Verifier::Mode mode, bool shoul bool Verifier::is_eligible_for_verification(instanceKlassHandle klass, bool should_verify_class) { symbolOop name = klass->name(); - klassOop refl_magic_klass = SystemDictionary::reflect_magic_klass(); + klassOop refl_magic_klass = SystemDictionary::reflect_MagicAccessorImpl_klass(); return (should_verify_for(klass->class_loader(), should_verify_class) && // return if the class is a bootstrapping class @@ -1903,17 +1903,8 @@ void ClassVerifier::verify_invoke_instructions( verify_cp_type(index, cp, types, CHECK_VERIFY(this)); // Get method name and signature - symbolHandle method_name; - symbolHandle method_sig; - if (opcode == Bytecodes::_invokedynamic) { - int name_index = cp->name_ref_index_at(index); - int sig_index = cp->signature_ref_index_at(index); - method_name = symbolHandle(THREAD, cp->symbol_at(name_index)); - method_sig = symbolHandle(THREAD, cp->symbol_at(sig_index)); - } else { - method_name = symbolHandle(THREAD, cp->name_ref_at(index)); - method_sig = symbolHandle(THREAD, cp->signature_ref_at(index)); - } + symbolHandle method_name(THREAD, cp->name_ref_at(index)); + symbolHandle method_sig(THREAD, cp->signature_ref_at(index)); if (!SignatureVerifier::is_valid_method_signature(method_sig)) { class_format_error( diff --git a/hotspot/src/share/vm/classfile/vmSymbols.cpp b/hotspot/src/share/vm/classfile/vmSymbols.cpp index c805af344e7..6cc7f3c2d33 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.cpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -70,6 +70,7 @@ static const char* vm_symbol_bodies = VM_SYMBOLS_DO(VM_SYMBOL_BODY, VM_ALIAS_IGN void vmSymbols::initialize(TRAPS) { assert((int)SID_LIMIT <= (1< (1<find_method(mname, msig); +} + #define VM_INTRINSIC_INITIALIZE(id, klass, name, sig, flags) #id "\0" static const char* vm_intrinsic_name_bodies = @@ -303,6 +356,11 @@ inline bool match_F_R(jshort flags) { const int neg = JVM_ACC_STATIC | JVM_ACC_SYNCHRONIZED; return (flags & (req | neg)) == req; } +inline bool match_F_Y(jshort flags) { + const int req = JVM_ACC_SYNCHRONIZED; + const int neg = JVM_ACC_STATIC; + return (flags & (req | neg)) == req; +} inline bool match_F_RN(jshort flags) { const int req = JVM_ACC_NATIVE; const int neg = JVM_ACC_STATIC | JVM_ACC_SYNCHRONIZED; @@ -325,15 +383,15 @@ inline bool match_F_RNY(jshort flags) { } // These are for forming case labels: -#define ID3(x, y, z) (( jint)(z) + \ - ((jint)(y) << vmSymbols::log2_SID_LIMIT) + \ - ((jint)(x) << (2*vmSymbols::log2_SID_LIMIT)) ) +#define ID3(x, y, z) (( jlong)(z) + \ + ((jlong)(y) << vmSymbols::log2_SID_LIMIT) + \ + ((jlong)(x) << (2*vmSymbols::log2_SID_LIMIT)) ) #define SID_ENUM(n) vmSymbols::VM_SYMBOL_ENUM_NAME(n) -vmIntrinsics::ID vmIntrinsics::find_id(vmSymbols::SID holder, - vmSymbols::SID name, - vmSymbols::SID sig, - jshort flags) { +vmIntrinsics::ID vmIntrinsics::find_id_impl(vmSymbols::SID holder, + vmSymbols::SID name, + vmSymbols::SID sig, + jshort flags) { assert((int)vmSymbols::SID_LIMIT <= (1<> shift) & mask) == 1021, ""); + return vmSymbols::SID( (info >> shift) & mask ); } vmSymbols::SID vmIntrinsics::name_for(vmIntrinsics::ID id) { -#ifndef PRODUCT -#define VM_INTRINSIC_CASE(id, klass, name, sig, fcode) \ - case id: return SID_ENUM(name); - - switch (id) { - VM_INTRINSICS_DO(VM_INTRINSIC_CASE, - VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE); - } -#undef VM_INTRINSIC_CASE -#endif //PRODUCT - return vmSymbols::NO_SID; + jlong info = intrinsic_info(id); + int shift = vmSymbols::log2_SID_LIMIT + log2_FLAG_LIMIT, mask = right_n_bits(vmSymbols::log2_SID_LIMIT); + assert(((ID4(1021,1022,1023,15) >> shift) & mask) == 1022, ""); + return vmSymbols::SID( (info >> shift) & mask ); } vmSymbols::SID vmIntrinsics::signature_for(vmIntrinsics::ID id) { -#ifndef PRODUCT -#define VM_INTRINSIC_CASE(id, klass, name, sig, fcode) \ - case id: return SID_ENUM(sig); - - switch (id) { - VM_INTRINSICS_DO(VM_INTRINSIC_CASE, - VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE); - } -#undef VM_INTRINSIC_CASE -#endif //PRODUCT - return vmSymbols::NO_SID; + jlong info = intrinsic_info(id); + int shift = log2_FLAG_LIMIT, mask = right_n_bits(vmSymbols::log2_SID_LIMIT); + assert(((ID4(1021,1022,1023,15) >> shift) & mask) == 1023, ""); + return vmSymbols::SID( (info >> shift) & mask ); } vmIntrinsics::Flags vmIntrinsics::flags_for(vmIntrinsics::ID id) { -#ifndef PRODUCT -#define VM_INTRINSIC_CASE(id, klass, name, sig, fcode) \ - case id: return fcode; - - switch (id) { - VM_INTRINSICS_DO(VM_INTRINSIC_CASE, - VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE); - } -#undef VM_INTRINSIC_CASE -#endif //PRODUCT - return F_none; + jlong info = intrinsic_info(id); + int shift = 0, mask = right_n_bits(log2_FLAG_LIMIT); + assert(((ID4(1021,1022,1023,15) >> shift) & mask) == 15, ""); + return Flags( (info >> shift) & mask ); } diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index 04bb9369205..0b4652157d1 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -84,6 +84,7 @@ template(java_lang_reflect_Field, "java/lang/reflect/Field") \ template(java_lang_reflect_Array, "java/lang/reflect/Array") \ template(java_lang_StringBuffer, "java/lang/StringBuffer") \ + template(java_lang_StringBuilder, "java/lang/StringBuilder") \ template(java_lang_CharSequence, "java/lang/CharSequence") \ template(java_security_AccessControlContext, "java/security/AccessControlContext") \ template(java_security_ProtectionDomain, "java/security/ProtectionDomain") \ @@ -104,6 +105,7 @@ template(java_lang_AssertionStatusDirectives, "java/lang/AssertionStatusDirectives") \ template(sun_jkernel_DownloadManager, "sun/jkernel/DownloadManager") \ template(getBootClassPathEntryForClass_name, "getBootClassPathEntryForClass") \ + template(setBootClassLoaderHook_name, "setBootClassLoaderHook") \ \ /* class file format tags */ \ template(tag_source_file, "SourceFile") \ @@ -217,7 +219,7 @@ template(base_name, "base") \ \ /* Support for JSR 292 & invokedynamic (JDK 1.7 and above) */ \ - template(java_dyn_Dynamic, "java/dyn/Dynamic") \ + template(java_dyn_InvokeDynamic, "java/dyn/InvokeDynamic") \ template(java_dyn_Linkage, "java/dyn/Linkage") \ template(java_dyn_CallSite, "java/dyn/CallSite") \ template(java_dyn_MethodHandle, "java/dyn/MethodHandle") \ @@ -233,10 +235,9 @@ template(sun_dyn_AdapterMethodHandle, "sun/dyn/AdapterMethodHandle") \ template(sun_dyn_BoundMethodHandle, "sun/dyn/BoundMethodHandle") \ template(sun_dyn_DirectMethodHandle, "sun/dyn/DirectMethodHandle") \ - template(sun_dyn_CallSiteImpl, "sun/dyn/CallSiteImpl") \ template(makeImpl_name, "makeImpl") /*MethodType::makeImpl*/ \ template(makeImpl_signature, "(Ljava/lang/Class;[Ljava/lang/Class;ZZ)Ljava/dyn/MethodType;") \ - template(makeSite_name, "makeSite") /*CallSiteImpl::makeImpl*/ \ + template(makeSite_name, "makeSite") /*CallSite::makeSite*/ \ template(makeSite_signature, "(Ljava/lang/Class;Ljava/lang/String;Ljava/dyn/MethodType;II)Ljava/dyn/CallSite;") \ template(findBootstrapMethod_name, "findBootstrapMethod") \ template(findBootstrapMethod_signature, "(Ljava/lang/Class;Ljava/lang/Class;)Ljava/dyn/MethodHandle;") \ @@ -335,6 +336,7 @@ template(ptypes_name, "ptypes") \ template(form_name, "form") \ template(erasedType_name, "erasedType") \ + template(append_name, "append") \ \ /* non-intrinsic name/signature pairs: */ \ template(register_method_name, "register") \ @@ -345,9 +347,14 @@ \ /* common signatures names */ \ template(void_method_signature, "()V") \ + template(void_boolean_signature, "()Z") \ + template(void_byte_signature, "()B") \ + template(void_char_signature, "()C") \ + template(void_short_signature, "()S") \ template(void_int_signature, "()I") \ template(void_long_signature, "()J") \ - template(void_boolean_signature, "()Z") \ + template(void_float_signature, "()F") \ + template(void_double_signature, "()D") \ template(int_void_signature, "(I)V") \ template(int_int_signature, "(I)I") \ template(int_bool_signature, "(I)Z") \ @@ -416,6 +423,13 @@ template(string_signature, "Ljava/lang/String;") \ template(reference_signature, "Ljava/lang/ref/Reference;") \ template(concurrenthashmap_signature, "Ljava/util/concurrent/ConcurrentHashMap;") \ + template(String_StringBuilder_signature, "(Ljava/lang/String;)Ljava/lang/StringBuilder;") \ + template(int_StringBuilder_signature, "(I)Ljava/lang/StringBuilder;") \ + template(char_StringBuilder_signature, "(C)Ljava/lang/StringBuilder;") \ + template(String_StringBuffer_signature, "(Ljava/lang/String;)Ljava/lang/StringBuffer;") \ + template(int_StringBuffer_signature, "(I)Ljava/lang/StringBuffer;") \ + template(char_StringBuffer_signature, "(C)Ljava/lang/StringBuffer;") \ + template(int_String_signature, "(I)Ljava/lang/String;") \ /* signature symbols needed by intrinsics */ \ VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, template, VM_ALIAS_IGNORE) \ \ @@ -815,12 +829,76 @@ /*the compiler does have special inlining code for these; bytecode inline is just fine */ \ \ do_intrinsic(_fillInStackTrace, java_lang_Throwable, fillInStackTrace_name, void_throwable_signature, F_RNY) \ - \ - do_intrinsic(_Object_init, java_lang_Object, object_initializer_name, void_method_signature, F_R) \ - /* (symbol object_initializer_name defined above) */ \ - \ + \ + do_intrinsic(_StringBuilder_void, java_lang_StringBuilder, object_initializer_name, void_method_signature, F_R) \ + do_intrinsic(_StringBuilder_int, java_lang_StringBuilder, object_initializer_name, int_void_signature, F_R) \ + do_intrinsic(_StringBuilder_String, java_lang_StringBuilder, object_initializer_name, string_void_signature, F_R) \ + \ + do_intrinsic(_StringBuilder_append_char, java_lang_StringBuilder, append_name, char_StringBuilder_signature, F_R) \ + do_intrinsic(_StringBuilder_append_int, java_lang_StringBuilder, append_name, int_StringBuilder_signature, F_R) \ + do_intrinsic(_StringBuilder_append_String, java_lang_StringBuilder, append_name, String_StringBuilder_signature, F_R) \ + \ + do_intrinsic(_StringBuilder_toString, java_lang_StringBuilder, toString_name, void_string_signature, F_R) \ + \ + do_intrinsic(_StringBuffer_void, java_lang_StringBuffer, object_initializer_name, void_method_signature, F_R) \ + do_intrinsic(_StringBuffer_int, java_lang_StringBuffer, object_initializer_name, int_void_signature, F_R) \ + do_intrinsic(_StringBuffer_String, java_lang_StringBuffer, object_initializer_name, string_void_signature, F_R) \ + \ + do_intrinsic(_StringBuffer_append_char, java_lang_StringBuffer, append_name, char_StringBuffer_signature, F_Y) \ + do_intrinsic(_StringBuffer_append_int, java_lang_StringBuffer, append_name, int_StringBuffer_signature, F_Y) \ + do_intrinsic(_StringBuffer_append_String, java_lang_StringBuffer, append_name, String_StringBuffer_signature, F_Y) \ + \ + do_intrinsic(_StringBuffer_toString, java_lang_StringBuffer, toString_name, void_string_signature, F_Y) \ + \ + do_intrinsic(_Integer_toString, java_lang_Integer, toString_name, int_String_signature, F_S) \ + \ + do_intrinsic(_String_String, java_lang_String, object_initializer_name, string_void_signature, F_R) \ + \ + do_intrinsic(_Object_init, java_lang_Object, object_initializer_name, void_method_signature, F_R) \ + /* (symbol object_initializer_name defined above) */ \ + \ do_intrinsic(_invoke, java_lang_reflect_Method, invoke_name, object_array_object_object_signature, F_R) \ /* (symbols invoke_name and invoke_signature defined above) */ \ + do_intrinsic(_checkSpreadArgument, sun_dyn_MethodHandleImpl, checkSpreadArgument_name, checkSpreadArgument_signature, F_S) \ + do_name( checkSpreadArgument_name, "checkSpreadArgument") \ + do_name( checkSpreadArgument_signature, "(Ljava/lang/Object;I)V") \ + \ + /* unboxing methods: */ \ + do_intrinsic(_booleanValue, java_lang_Boolean, booleanValue_name, void_boolean_signature, F_R) \ + do_name( booleanValue_name, "booleanValue") \ + do_intrinsic(_byteValue, java_lang_Byte, byteValue_name, void_byte_signature, F_R) \ + do_name( byteValue_name, "byteValue") \ + do_intrinsic(_charValue, java_lang_Character, charValue_name, void_char_signature, F_R) \ + do_name( charValue_name, "charValue") \ + do_intrinsic(_shortValue, java_lang_Short, shortValue_name, void_short_signature, F_R) \ + do_name( shortValue_name, "shortValue") \ + do_intrinsic(_intValue, java_lang_Integer, intValue_name, void_int_signature, F_R) \ + do_name( intValue_name, "intValue") \ + do_intrinsic(_longValue, java_lang_Long, longValue_name, void_long_signature, F_R) \ + do_name( longValue_name, "longValue") \ + do_intrinsic(_floatValue, java_lang_Float, floatValue_name, void_float_signature, F_R) \ + do_name( floatValue_name, "floatValue") \ + do_intrinsic(_doubleValue, java_lang_Double, doubleValue_name, void_double_signature, F_R) \ + do_name( doubleValue_name, "doubleValue") \ + \ + /* boxing methods: */ \ + do_name( valueOf_name, "valueOf") \ + do_intrinsic(_Boolean_valueOf, java_lang_Boolean, valueOf_name, Boolean_valueOf_signature, F_S) \ + do_name( Boolean_valueOf_signature, "(Z)Ljava/lang/Boolean;") \ + do_intrinsic(_Byte_valueOf, java_lang_Byte, valueOf_name, Byte_valueOf_signature, F_S) \ + do_name( Byte_valueOf_signature, "(B)Ljava/lang/Byte;") \ + do_intrinsic(_Character_valueOf, java_lang_Character, valueOf_name, Character_valueOf_signature, F_S) \ + do_name( Character_valueOf_signature, "(C)Ljava/lang/Character;") \ + do_intrinsic(_Short_valueOf, java_lang_Short, valueOf_name, Short_valueOf_signature, F_S) \ + do_name( Short_valueOf_signature, "(S)Ljava/lang/Short;") \ + do_intrinsic(_Integer_valueOf, java_lang_Integer, valueOf_name, Integer_valueOf_signature, F_S) \ + do_name( Integer_valueOf_signature, "(I)Ljava/lang/Integer;") \ + do_intrinsic(_Long_valueOf, java_lang_Long, valueOf_name, Long_valueOf_signature, F_S) \ + do_name( Long_valueOf_signature, "(J)Ljava/lang/Long;") \ + do_intrinsic(_Float_valueOf, java_lang_Float, valueOf_name, Float_valueOf_signature, F_S) \ + do_name( Float_valueOf_signature, "(F)Ljava/lang/Float;") \ + do_intrinsic(_Double_valueOf, java_lang_Double, valueOf_name, Double_valueOf_signature, F_S) \ + do_name( Double_valueOf_signature, "(D)Ljava/lang/Double;") \ \ /*end*/ @@ -946,11 +1024,17 @@ class vmIntrinsics: AllStatic { enum Flags { // AccessFlags syndromes relevant to intrinsics. F_none = 0, - F_R, // !static !synchronized (R="regular") - F_S, // static !synchronized - F_RN, // !static native !synchronized - F_SN, // static native !synchronized - F_RNY // !static native synchronized + F_R, // !static ?native !synchronized (R="regular") + F_S, // static ?native !synchronized + F_Y, // !static ?native synchronized + F_RN, // !static native !synchronized + F_SN, // static native !synchronized + F_RNY, // !static native synchronized + + FLAG_LIMIT + }; + enum { + log2_FLAG_LIMIT = 4 // checked by an assert at start-up }; public: @@ -962,15 +1046,32 @@ public: static const char* name_at(ID id); +private: + static ID find_id_impl(vmSymbols::SID holder, + vmSymbols::SID name, + vmSymbols::SID sig, + jshort flags); + +public: // Given a method's class, name, signature, and access flags, report its ID. static ID find_id(vmSymbols::SID holder, vmSymbols::SID name, vmSymbols::SID sig, - jshort flags); + jshort flags) { + ID id = find_id_impl(holder, name, sig, flags); +#ifdef ASSERT + // ID _none does not hold the following asserts. + if (id == _none) return id; +#endif + assert( class_for(id) == holder, "correct id"); + assert( name_for(id) == name, "correct id"); + assert(signature_for(id) == sig, "correct id"); + return id; + } static void verify_method(ID actual_id, methodOop m) PRODUCT_RETURN; - // No need for these in the product: + // Find out the symbols behind an intrinsic: static vmSymbols::SID class_for(ID id); static vmSymbols::SID name_for(ID id); static vmSymbols::SID signature_for(ID id); @@ -980,4 +1081,11 @@ public: // Access to intrinsic methods: static methodOop method_for(ID id); + + // Wrapper object methods: + static ID for_boxing(BasicType type); + static ID for_unboxing(BasicType type); + + // Raw conversion: + static ID for_raw_conversion(BasicType src, BasicType dest); }; diff --git a/hotspot/src/share/vm/code/codeBlob.hpp b/hotspot/src/share/vm/code/codeBlob.hpp index 81acc81fcac..bbd430a14c6 100644 --- a/hotspot/src/share/vm/code/codeBlob.hpp +++ b/hotspot/src/share/vm/code/codeBlob.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -102,6 +102,9 @@ class CodeBlob VALUE_OBJ_CLASS_SPEC { virtual bool is_compiled_by_c2() const { return false; } virtual bool is_compiled_by_c1() const { return false; } + // Casting + nmethod* as_nmethod_or_null() { return is_nmethod() ? (nmethod*) this : NULL; } + // Boundaries address header_begin() const { return (address) this; } address header_end() const { return ((address) this) + _header_size; }; @@ -201,7 +204,8 @@ class CodeBlob VALUE_OBJ_CLASS_SPEC { virtual void print_value_on(outputStream* st) const PRODUCT_RETURN; // Print the comment associated with offset on stream, if there is one - void print_block_comment(outputStream* stream, intptr_t offset) { + virtual void print_block_comment(outputStream* stream, address block_begin) { + intptr_t offset = (intptr_t)(block_begin - instructions_begin()); _comments.print_block_comment(stream, offset); } diff --git a/hotspot/src/share/vm/code/codeCache.cpp b/hotspot/src/share/vm/code/codeCache.cpp index 0300957cca2..65ee62241fe 100644 --- a/hotspot/src/share/vm/code/codeCache.cpp +++ b/hotspot/src/share/vm/code/codeCache.cpp @@ -96,6 +96,7 @@ int CodeCache::_number_of_blobs = 0; int CodeCache::_number_of_nmethods_with_dependencies = 0; bool CodeCache::_needs_cache_clean = false; nmethod* CodeCache::_scavenge_root_nmethods = NULL; +nmethod* CodeCache::_saved_nmethods = NULL; CodeBlob* CodeCache::first() { @@ -395,6 +396,85 @@ void CodeCache::verify_perm_nmethods(CodeBlobClosure* f_or_null) { } #endif //PRODUCT + +nmethod* CodeCache::find_and_remove_saved_code(methodOop m) { + MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); + nmethod* saved = _saved_nmethods; + nmethod* prev = NULL; + while (saved != NULL) { + if (saved->is_in_use() && saved->method() == m) { + if (prev != NULL) { + prev->set_saved_nmethod_link(saved->saved_nmethod_link()); + } else { + _saved_nmethods = saved->saved_nmethod_link(); + } + assert(saved->is_speculatively_disconnected(), "shouldn't call for other nmethods"); + saved->set_speculatively_disconnected(false); + saved->set_saved_nmethod_link(NULL); + if (PrintMethodFlushing) { + saved->print_on(tty, " ### nmethod is reconnected"); + } + if (LogCompilation && (xtty != NULL)) { + ttyLocker ttyl; + xtty->begin_elem("nmethod_reconnected compile_id='%3d'", saved->compile_id()); + xtty->method(methodOop(m)); + xtty->stamp(); + xtty->end_elem(); + } + return saved; + } + prev = saved; + saved = saved->saved_nmethod_link(); + } + return NULL; +} + +void CodeCache::remove_saved_code(nmethod* nm) { + MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); + assert(nm->is_speculatively_disconnected(), "shouldn't call for other nmethods"); + nmethod* saved = _saved_nmethods; + nmethod* prev = NULL; + while (saved != NULL) { + if (saved == nm) { + if (prev != NULL) { + prev->set_saved_nmethod_link(saved->saved_nmethod_link()); + } else { + _saved_nmethods = saved->saved_nmethod_link(); + } + if (LogCompilation && (xtty != NULL)) { + ttyLocker ttyl; + xtty->begin_elem("nmethod_removed compile_id='%3d'", nm->compile_id()); + xtty->stamp(); + xtty->end_elem(); + } + return; + } + prev = saved; + saved = saved->saved_nmethod_link(); + } + ShouldNotReachHere(); +} + +void CodeCache::speculatively_disconnect(nmethod* nm) { + assert_locked_or_safepoint(CodeCache_lock); + assert(nm->is_in_use() && !nm->is_speculatively_disconnected(), "should only disconnect live nmethods"); + nm->set_saved_nmethod_link(_saved_nmethods); + _saved_nmethods = nm; + if (PrintMethodFlushing) { + nm->print_on(tty, " ### nmethod is speculatively disconnected"); + } + if (LogCompilation && (xtty != NULL)) { + ttyLocker ttyl; + xtty->begin_elem("nmethod_disconnected compile_id='%3d'", nm->compile_id()); + xtty->method(methodOop(nm->method())); + xtty->stamp(); + xtty->end_elem(); + } + nm->method()->clear_code(); + nm->set_speculatively_disconnected(true); +} + + void CodeCache::gc_prologue() { assert(!nmethod::oops_do_marking_is_active(), "oops_do_marking_epilogue must be called"); } diff --git a/hotspot/src/share/vm/code/codeCache.hpp b/hotspot/src/share/vm/code/codeCache.hpp index da5149c6eb4..9eacd5d4cd2 100644 --- a/hotspot/src/share/vm/code/codeCache.hpp +++ b/hotspot/src/share/vm/code/codeCache.hpp @@ -46,6 +46,7 @@ class CodeCache : AllStatic { static int _number_of_nmethods_with_dependencies; static bool _needs_cache_clean; static nmethod* _scavenge_root_nmethods; // linked via nm->scavenge_root_link() + static nmethod* _saved_nmethods; // linked via nm->saved_nmethod_look() static void verify_if_often() PRODUCT_RETURN; @@ -141,11 +142,16 @@ class CodeCache : AllStatic { static size_t capacity() { return _heap->capacity(); } static size_t max_capacity() { return _heap->max_capacity(); } static size_t unallocated_capacity() { return _heap->unallocated_capacity(); } + static bool needs_flushing() { return unallocated_capacity() < CodeCacheFlushingMinimumFreeSpace; } static bool needs_cache_clean() { return _needs_cache_clean; } static void set_needs_cache_clean(bool v) { _needs_cache_clean = v; } static void clear_inline_caches(); // clear all inline caches + static nmethod* find_and_remove_saved_code(methodOop m); + static void remove_saved_code(nmethod* nm); + static void speculatively_disconnect(nmethod* nm); + // Deoptimization static int mark_for_deoptimization(DepChange& changes); #ifdef HOTSWAP diff --git a/hotspot/src/share/vm/code/debugInfoRec.cpp b/hotspot/src/share/vm/code/debugInfoRec.cpp index fa24eb7c4c8..14765e4fc53 100644 --- a/hotspot/src/share/vm/code/debugInfoRec.cpp +++ b/hotspot/src/share/vm/code/debugInfoRec.cpp @@ -281,6 +281,8 @@ void DebugInformationRecorder::describe_scope(int pc_offset, ciMethod* method, int bci, bool reexecute, + bool is_method_handle_invoke, + bool return_oop, DebugToken* locals, DebugToken* expressions, DebugToken* monitors) { @@ -292,8 +294,10 @@ void DebugInformationRecorder::describe_scope(int pc_offset, int stream_offset = stream()->position(); last_pd->set_scope_decode_offset(stream_offset); - // Record reexecute bit into pcDesc + // Record flags into pcDesc. last_pd->set_should_reexecute(reexecute); + last_pd->set_is_method_handle_invoke(is_method_handle_invoke); + last_pd->set_return_oop(return_oop); // serialize sender stream offest stream()->write_int(sender_stream_offset); diff --git a/hotspot/src/share/vm/code/debugInfoRec.hpp b/hotspot/src/share/vm/code/debugInfoRec.hpp index bb896adeae2..8282a051f08 100644 --- a/hotspot/src/share/vm/code/debugInfoRec.hpp +++ b/hotspot/src/share/vm/code/debugInfoRec.hpp @@ -88,6 +88,8 @@ class DebugInformationRecorder: public ResourceObj { ciMethod* method, int bci, bool reexecute, + bool is_method_handle_invoke = false, + bool return_oop = false, DebugToken* locals = NULL, DebugToken* expressions = NULL, DebugToken* monitors = NULL); diff --git a/hotspot/src/share/vm/code/dependencies.cpp b/hotspot/src/share/vm/code/dependencies.cpp index 0d38dc7c2f6..07e7ed9b2ce 100644 --- a/hotspot/src/share/vm/code/dependencies.cpp +++ b/hotspot/src/share/vm/code/dependencies.cpp @@ -843,13 +843,15 @@ static bool count_find_witness_calls() { if (occasional_print || final_stats) { // Every now and then dump a little info about dependency searching. if (xtty != NULL) { - xtty->elem("deps_find_witness calls='%d' steps='%d' recursions='%d' singles='%d'", + ttyLocker ttyl; + xtty->elem("deps_find_witness calls='%d' steps='%d' recursions='%d' singles='%d'", deps_find_witness_calls, deps_find_witness_steps, deps_find_witness_recursions, deps_find_witness_singles); } if (final_stats || (TraceDependencies && WizardMode)) { + ttyLocker ttyl; tty->print_cr("Dependency check (find_witness) " "calls=%d, steps=%d (avg=%.1f), recursions=%d, singles=%d", deps_find_witness_calls, @@ -1528,19 +1530,23 @@ void DepChange::print() { int nsup = 0, nint = 0; for (ContextStream str(*this); str.next(); ) { klassOop k = str.klass(); - switch (str._change_type) { + switch (str.change_type()) { case Change_new_type: tty->print_cr(" dependee = %s", instanceKlass::cast(k)->external_name()); break; case Change_new_sub: - if (!WizardMode) - ++nsup; - else tty->print_cr(" context super = %s", instanceKlass::cast(k)->external_name()); + if (!WizardMode) { + ++nsup; + } else { + tty->print_cr(" context super = %s", instanceKlass::cast(k)->external_name()); + } break; case Change_new_impl: - if (!WizardMode) - ++nint; - else tty->print_cr(" context interface = %s", instanceKlass::cast(k)->external_name()); + if (!WizardMode) { + ++nint; + } else { + tty->print_cr(" context interface = %s", instanceKlass::cast(k)->external_name()); + } break; } } diff --git a/hotspot/src/share/vm/code/dependencies.hpp b/hotspot/src/share/vm/code/dependencies.hpp index faf98b36537..ae3c077b4a8 100644 --- a/hotspot/src/share/vm/code/dependencies.hpp +++ b/hotspot/src/share/vm/code/dependencies.hpp @@ -470,7 +470,7 @@ class Dependencies: public ResourceObj { // super types can be context types for a relevant dependency, which the // new type could invalidate. class DepChange : public StackObj { - private: + public: enum ChangeType { NO_CHANGE = 0, // an uninvolved klass Change_new_type, // a newly loaded type @@ -480,6 +480,7 @@ class DepChange : public StackObj { Start_Klass = CHANGE_LIMIT // internal indicator for ContextStream }; + private: // each change set is rooted in exactly one new type (at present): KlassHandle _new_type; @@ -510,15 +511,15 @@ class DepChange : public StackObj { // } class ContextStream : public StackObj { private: - DepChange& _changes; + DepChange& _changes; friend class DepChange; // iteration variables: - ChangeType _change_type; - klassOop _klass; - objArrayOop _ti_base; // i.e., transitive_interfaces - int _ti_index; - int _ti_limit; + ChangeType _change_type; + klassOop _klass; + objArrayOop _ti_base; // i.e., transitive_interfaces + int _ti_index; + int _ti_limit; // start at the beginning: void start() { @@ -530,11 +531,11 @@ class DepChange : public StackObj { _ti_limit = 0; } + public: ContextStream(DepChange& changes) : _changes(changes) { start(); } - public: ContextStream(DepChange& changes, No_Safepoint_Verifier& nsv) : _changes(changes) // the nsv argument makes it safe to hold oops like _klass @@ -542,6 +543,7 @@ class DepChange : public StackObj { bool next(); + ChangeType change_type() { return _change_type; } klassOop klass() { return _klass; } }; friend class DepChange::ContextStream; diff --git a/hotspot/src/share/vm/code/jvmticmlr.h b/hotspot/src/share/vm/code/jvmticmlr.h new file mode 100644 index 00000000000..d2713954f6f --- /dev/null +++ b/hotspot/src/share/vm/code/jvmticmlr.h @@ -0,0 +1,115 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * This header file defines the data structures sent by the VM + * through the JVMTI CompiledMethodLoad callback function via the + * "void * compile_info" parameter. The memory pointed to by the + * compile_info parameter may not be referenced after returning from + * the CompiledMethodLoad callback. These are VM implementation + * specific data structures that may evolve in future releases. A + * JVMTI agent should interpret a non-NULL compile_info as a pointer + * to a region of memory containing a list of records. In a typical + * usage scenario, a JVMTI agent would cast each record to a + * jvmtiCompiledMethodLoadRecordHeader, a struct that represents + * arbitrary information. This struct contains a kind field to indicate + * the kind of information being passed, and a pointer to the next + * record. If the kind field indicates inlining information, then the + * agent would cast the record to a jvmtiCompiledMethodLoadInlineRecord. + * This record contains an array of PCStackInfo structs, which indicate + * for every pc address what are the methods on the invocation stack. + * The "methods" and "bcis" fields in each PCStackInfo struct specify a + * 1-1 mapping between these inlined methods and their bytecode indices. + * This can be used to derive the proper source lines of the inlined + * methods. + */ + +#ifndef _JVMTI_CMLR_H_ +#define _JVMTI_CMLR_H_ + +enum { + JVMTI_CMLR_MAJOR_VERSION_1 = 0x00000001, + JVMTI_CMLR_MINOR_VERSION_0 = 0x00000000, + + JVMTI_CMLR_MAJOR_VERSION = 0x00000001, + JVMTI_CMLR_MINOR_VERSION = 0x00000000 + + /* + * This comment is for the "JDK import from HotSpot" sanity check: + * version: 1.0.0 + */ +}; + +typedef enum { + JVMTI_CMLR_DUMMY = 1, + JVMTI_CMLR_INLINE_INFO = 2 +} jvmtiCMLRKind; + +/* + * Record that represents arbitrary information passed through JVMTI + * CompiledMethodLoadEvent void pointer. + */ +typedef struct _jvmtiCompiledMethodLoadRecordHeader { + jvmtiCMLRKind kind; /* id for the kind of info passed in the record */ + jint majorinfoversion; /* major and minor info version values. Init'ed */ + jint minorinfoversion; /* to current version value in jvmtiExport.cpp. */ + + struct _jvmtiCompiledMethodLoadRecordHeader* next; +} jvmtiCompiledMethodLoadRecordHeader; + +/* + * Record that gives information about the methods on the compile-time + * stack at a specific pc address of a compiled method. Each element in + * the methods array maps to same element in the bcis array. + */ +typedef struct _PCStackInfo { + void* pc; /* the pc address for this compiled method */ + jint numstackframes; /* number of methods on the stack */ + jmethodID* methods; /* array of numstackframes method ids */ + jint* bcis; /* array of numstackframes bytecode indices */ +} PCStackInfo; + +/* + * Record that contains inlining information for each pc address of + * an nmethod. + */ +typedef struct _jvmtiCompiledMethodLoadInlineRecord { + jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */ + jint numpcs; /* number of pc descriptors in this nmethod */ + PCStackInfo* pcinfo; /* array of numpcs pc descriptors */ +} jvmtiCompiledMethodLoadInlineRecord; + +/* + * Dummy record used to test that we can pass records with different + * information through the void pointer provided that they can be cast + * to a jvmtiCompiledMethodLoadRecordHeader. + */ + +typedef struct _jvmtiCompiledMethodLoadDummyRecord { + jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */ + char message[50]; +} jvmtiCompiledMethodLoadDummyRecord; + +#endif diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index 7f7ca11750f..7ffb0f57026 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,13 +56,13 @@ HS_DTRACE_PROBE_DECL6(hotspot, compiled__method__unload, #endif bool nmethod::is_compiled_by_c1() const { + if (compiler() == NULL || method() == NULL) return false; // can happen during debug printing if (is_native_method()) return false; - assert(compiler() != NULL, "must be"); return compiler()->is_c1(); } bool nmethod::is_compiled_by_c2() const { + if (compiler() == NULL || method() == NULL) return false; // can happen during debug printing if (is_native_method()) return false; - assert(compiler() != NULL, "must be"); return compiler()->is_c2(); } @@ -414,9 +414,8 @@ int nmethod::total_size() const { } const char* nmethod::compile_kind() const { - if (method() == NULL) return "unloaded"; - if (is_native_method()) return "c2n"; if (is_osr_method()) return "osr"; + if (method() != NULL && is_native_method()) return "c2n"; return NULL; } @@ -588,11 +587,13 @@ nmethod::nmethod( _osr_link = NULL; _scavenge_root_link = NULL; _scavenge_root_state = 0; + _saved_nmethod_link = NULL; _compiler = NULL; // We have no exception handler or deopt handler make the // values something that will never match a pc like the nmethod vtable entry _exception_offset = 0; _deoptimize_offset = 0; + _deoptimize_mh_offset = 0; _orig_pc_offset = 0; #ifdef HAVE_DTRACE_H _trap_offset = 0; @@ -683,6 +684,7 @@ nmethod::nmethod( // values something that will never match a pc like the nmethod vtable entry _exception_offset = 0; _deoptimize_offset = 0; + _deoptimize_mh_offset = 0; _trap_offset = offsets->value(CodeOffsets::Dtrace_trap); _orig_pc_offset = 0; _stub_offset = data_offset(); @@ -795,6 +797,7 @@ nmethod::nmethod( // Exception handler and deopt handler are in the stub section _exception_offset = _stub_offset + offsets->value(CodeOffsets::Exceptions); _deoptimize_offset = _stub_offset + offsets->value(CodeOffsets::Deopt); + _deoptimize_mh_offset = _stub_offset + offsets->value(CodeOffsets::DeoptMH); _consts_offset = instructions_offset() + code_buffer->total_offset_of(code_buffer->consts()->start()); _scopes_data_offset = data_offset(); _scopes_pcs_offset = _scopes_data_offset + round_to(debug_info->data_size (), oopSize); @@ -985,7 +988,8 @@ ScopeDesc* nmethod::scope_desc_at(address pc) { PcDesc* pd = pc_desc_at(pc); guarantee(pd != NULL, "scope must be present"); return new ScopeDesc(this, pd->scope_decode_offset(), - pd->obj_decode_offset(), pd->should_reexecute()); + pd->obj_decode_offset(), pd->should_reexecute(), + pd->return_oop()); } @@ -1034,7 +1038,7 @@ void nmethod::cleanup_inline_caches() { if( cb != NULL && cb->is_nmethod() ) { nmethod* nm = (nmethod*)cb; // Clean inline caches pointing to both zombie and not_entrant methods - if (!nm->is_in_use()) ic->set_to_clean(); + if (!nm->is_in_use() || (nm->method()->code() != nm)) ic->set_to_clean(); } break; } @@ -1044,7 +1048,7 @@ void nmethod::cleanup_inline_caches() { if( cb != NULL && cb->is_nmethod() ) { nmethod* nm = (nmethod*)cb; // Clean inline caches pointing to both zombie and not_entrant methods - if (!nm->is_in_use()) csc->set_to_clean(); + if (!nm->is_in_use() || (nm->method()->code() != nm)) csc->set_to_clean(); } break; } @@ -1114,7 +1118,6 @@ void nmethod::make_unloaded(BoolObjectClosure* is_alive, oop cause) { if (_method->code() == this) { _method->clear_code(); // Break a cycle } - inc_decompile_count(); // Last chance to make a mark on the MDO _method = NULL; // Clear the method of this dead nmethod } // Make the class unloaded - i.e., change state and notify sweeper @@ -1127,6 +1130,9 @@ void nmethod::make_unloaded(BoolObjectClosure* is_alive, oop cause) { } flags.state = unloaded; + // Log the unloading. + log_state_change(); + // The methodOop is gone at this point assert(_method == NULL, "Tautology"); @@ -1137,8 +1143,6 @@ void nmethod::make_unloaded(BoolObjectClosure* is_alive, oop cause) { void nmethod::invalidate_osr_method() { assert(_entry_bci != InvocationEntryBci, "wrong kind of nmethod"); - if (_entry_bci != InvalidOSREntryBci) - inc_decompile_count(); // Remove from list of active nmethods if (method() != NULL) instanceKlass::cast(method()->method_holder())->remove_osr_nmethod(this); @@ -1146,59 +1150,65 @@ void nmethod::invalidate_osr_method() { _entry_bci = InvalidOSREntryBci; } -void nmethod::log_state_change(int state) const { +void nmethod::log_state_change() const { if (LogCompilation) { if (xtty != NULL) { ttyLocker ttyl; // keep the following output all in one block - xtty->begin_elem("make_not_entrant %sthread='" UINTX_FORMAT "'", - (state == zombie ? "zombie='1' " : ""), - os::current_thread_id()); + if (flags.state == unloaded) { + xtty->begin_elem("make_unloaded thread='" UINTX_FORMAT "'", + os::current_thread_id()); + } else { + xtty->begin_elem("make_not_entrant thread='" UINTX_FORMAT "'%s", + os::current_thread_id(), + (flags.state == zombie ? " zombie='1'" : "")); + } log_identity(xtty); xtty->stamp(); xtty->end_elem(); } } - if (PrintCompilation) { - print_on(tty, state == zombie ? "made zombie " : "made not entrant "); + if (PrintCompilation && flags.state != unloaded) { + print_on(tty, flags.state == zombie ? "made zombie " : "made not entrant "); tty->cr(); } } // Common functionality for both make_not_entrant and make_zombie -void nmethod::make_not_entrant_or_zombie(int state) { +bool nmethod::make_not_entrant_or_zombie(unsigned int state) { assert(state == zombie || state == not_entrant, "must be zombie or not_entrant"); - // Code for an on-stack-replacement nmethod is removed when a class gets unloaded. - // They never become zombie/non-entrant, so the nmethod sweeper will never remove - // them. Instead the entry_bci is set to InvalidOSREntryBci, so the osr nmethod - // will never be used anymore. That the nmethods only gets removed when class unloading - // happens, make life much simpler, since the nmethods are not just going to disappear - // out of the blue. - if (is_osr_method()) { - if (osr_entry_bci() != InvalidOSREntryBci) { - // only log this once - log_state_change(state); - } - invalidate_osr_method(); - return; - } - - // If the method is already zombie or set to the state we want, nothing to do - if (is_zombie() || (state == not_entrant && is_not_entrant())) { - return; - } - - log_state_change(state); + bool was_alive = false; // Make sure the nmethod is not flushed in case of a safepoint in code below. nmethodLocker nml(this); { + // If the method is already zombie there is nothing to do + if (is_zombie()) { + return false; + } + + // invalidate osr nmethod before acquiring the patching lock since + // they both acquire leaf locks and we don't want a deadlock. + // This logic is equivalent to the logic below for patching the + // verified entry point of regular methods. + if (is_osr_method()) { + // this effectively makes the osr nmethod not entrant + invalidate_osr_method(); + } + // Enter critical section. Does not block for safepoint. MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag); + + if (flags.state == state) { + // another thread already performed this transition so nothing + // to do, but return false to indicate this. + return false; + } + // The caller can be calling the method statically or through an inline // cache call. - if (!is_not_entrant()) { + if (!is_osr_method() && !is_not_entrant()) { NativeJump::patch_verified_entry(entry_point(), verified_entry_point(), SharedRuntime::get_handle_wrong_method_stub()); assert (NativeJump::instruction_size == nmethod::_zombie_instruction_size, ""); @@ -1215,8 +1225,14 @@ void nmethod::make_not_entrant_or_zombie(int state) { assert(state == not_entrant, "other cases may need to be handled differently"); } + was_alive = is_in_use(); // Read state under lock + // Change state flags.state = state; + + // Log the transition once + log_state_change(); + } // leave critical region under Patching_lock if (state == not_entrant) { @@ -1237,9 +1253,11 @@ void nmethod::make_not_entrant_or_zombie(int state) { mark_as_seen_on_stack(); } - // It's a true state change, so mark the method as decompiled. - inc_decompile_count(); - + if (was_alive) { + // It's a true state change, so mark the method as decompiled. + // Do it only for transition from alive. + inc_decompile_count(); + } // zombie only - if a JVMTI agent has enabled the CompiledMethodUnload event // and it hasn't already been reported for this nmethod then report it now. @@ -1268,7 +1286,7 @@ void nmethod::make_not_entrant_or_zombie(int state) { // Check whether method got unloaded at a safepoint before this, // if so we can skip the flushing steps below - if (method() == NULL) return; + if (method() == NULL) return true; // Remove nmethod from method. // We need to check if both the _code and _from_compiled_code_entry_point @@ -1282,6 +1300,8 @@ void nmethod::make_not_entrant_or_zombie(int state) { HandleMark hm; method()->clear_code(); } + + return true; } @@ -1303,7 +1323,8 @@ void nmethod::flush() { // completely deallocate this method EventMark m("flushing nmethod " INTPTR_FORMAT " %s", this, ""); if (PrintMethodFlushing) { - tty->print_cr("*flushing nmethod " INTPTR_FORMAT ". Live blobs: %d", this, CodeCache::nof_blobs()); + tty->print_cr("*flushing nmethod %3d/" INTPTR_FORMAT ". Live blobs:" UINT32_FORMAT "/Free CodeCache:" SIZE_FORMAT "Kb", + _compile_id, this, CodeCache::nof_blobs(), CodeCache::unallocated_capacity()/1024); } // We need to deallocate any ExceptionCache data. @@ -1321,6 +1342,10 @@ void nmethod::flush() { CodeCache::drop_scavenge_root_nmethod(this); } + if (is_speculatively_disconnected()) { + CodeCache::remove_saved_code(this); + } + ((CodeBlob*)(this))->flush(); CodeCache::free(this); @@ -1715,9 +1740,9 @@ void nmethod::preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map if (!method()->is_native()) { SimpleScopeDesc ssd(this, fr.pc()); Bytecode_invoke* call = Bytecode_invoke_at(ssd.method(), ssd.bci()); - bool is_static = call->is_invokestatic(); + bool has_receiver = call->has_receiver(); symbolOop signature = call->signature(); - fr.oops_compiled_arguments_do(signature, is_static, reg_map, f); + fr.oops_compiled_arguments_do(signature, has_receiver, reg_map, f); } } @@ -1754,6 +1779,14 @@ void nmethod::copy_scopes_pcs(PcDesc* pcs, int count) { "must end with a sentinel"); #endif //ASSERT + // Search for MethodHandle invokes and tag the nmethod. + for (int i = 0; i < count; i++) { + if (pcs[i].is_method_handle_invoke()) { + set_has_method_handle_invokes(true); + break; + } + } + int size = count * sizeof(PcDesc); assert(scopes_pcs_size() >= size, "oob"); memcpy(scopes_pcs_begin(), pcs, size); @@ -1978,7 +2011,10 @@ address nmethod::continuation_for_implicit_exception(address pc) { print_pcs(); } #endif - guarantee(cont_offset != 0, "unhandled implicit exception in compiled code"); + if (cont_offset == 0) { + // Let the normal error handling report the exception + return NULL; + } return instructions_begin() + cont_offset; } @@ -2014,9 +2050,33 @@ void nmethodLocker::unlock_nmethod(nmethod* nm) { guarantee(nm->_lock_count >= 0, "unmatched nmethod lock/unlock"); } -bool nmethod::is_deopt_pc(address pc) { - bool ret = pc == deopt_handler_begin(); - return ret; + +// ----------------------------------------------------------------------------- +// nmethod::get_deopt_original_pc +// +// Return the original PC for the given PC if: +// (a) the given PC belongs to a nmethod and +// (b) it is a deopt PC +address nmethod::get_deopt_original_pc(const frame* fr) { + if (fr->cb() == NULL) return NULL; + + nmethod* nm = fr->cb()->as_nmethod_or_null(); + if (nm != NULL && nm->is_deopt_pc(fr->pc())) + return nm->get_original_pc(fr); + + return NULL; +} + + +// ----------------------------------------------------------------------------- +// MethodHandle + +bool nmethod::is_method_handle_return(address return_pc) { + if (!has_method_handle_invokes()) return false; + PcDesc* pd = pc_desc_at(return_pc); + if (pd == NULL) + return false; + return pd->is_method_handle_invoke(); } @@ -2100,7 +2160,8 @@ void nmethod::verify_interrupt_point(address call_site) { PcDesc* pd = pc_desc_at(ic->end_of_call()); assert(pd != NULL, "PcDesc must exist"); for (ScopeDesc* sd = new ScopeDesc(this, pd->scope_decode_offset(), - pd->obj_decode_offset(), pd->should_reexecute()); + pd->obj_decode_offset(), pd->should_reexecute(), + pd->return_oop()); !sd->is_top(); sd = sd->sender()) { sd->verify(); } @@ -2365,11 +2426,115 @@ ScopeDesc* nmethod::scope_desc_in(address begin, address end) { PcDesc* p = pc_desc_near(begin+1); if (p != NULL && p->real_pc(this) <= end) { return new ScopeDesc(this, p->scope_decode_offset(), - p->obj_decode_offset(), p->should_reexecute()); + p->obj_decode_offset(), p->should_reexecute(), + p->return_oop()); } return NULL; } +void nmethod::print_nmethod_labels(outputStream* stream, address block_begin) { + if (block_begin == entry_point()) stream->print_cr("[Entry Point]"); + if (block_begin == verified_entry_point()) stream->print_cr("[Verified Entry Point]"); + if (block_begin == exception_begin()) stream->print_cr("[Exception Handler]"); + if (block_begin == stub_begin()) stream->print_cr("[Stub Code]"); + if (block_begin == deopt_handler_begin()) stream->print_cr("[Deopt Handler Code]"); + if (block_begin == deopt_mh_handler_begin()) stream->print_cr("[Deopt MH Handler Code]"); + if (block_begin == consts_begin()) stream->print_cr("[Constants]"); + if (block_begin == entry_point()) { + methodHandle m = method(); + if (m.not_null()) { + stream->print(" # "); + m->print_value_on(stream); + stream->cr(); + } + if (m.not_null() && !is_osr_method()) { + ResourceMark rm; + int sizeargs = m->size_of_parameters(); + BasicType* sig_bt = NEW_RESOURCE_ARRAY(BasicType, sizeargs); + VMRegPair* regs = NEW_RESOURCE_ARRAY(VMRegPair, sizeargs); + { + int sig_index = 0; + if (!m->is_static()) + sig_bt[sig_index++] = T_OBJECT; // 'this' + for (SignatureStream ss(m->signature()); !ss.at_return_type(); ss.next()) { + BasicType t = ss.type(); + sig_bt[sig_index++] = t; + if (type2size[t] == 2) { + sig_bt[sig_index++] = T_VOID; + } else { + assert(type2size[t] == 1, "size is 1 or 2"); + } + } + assert(sig_index == sizeargs, ""); + } + const char* spname = "sp"; // make arch-specific? + intptr_t out_preserve = SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs, false); + int stack_slot_offset = this->frame_size() * wordSize; + int tab1 = 14, tab2 = 24; + int sig_index = 0; + int arg_index = (m->is_static() ? 0 : -1); + bool did_old_sp = false; + for (SignatureStream ss(m->signature()); !ss.at_return_type(); ) { + bool at_this = (arg_index == -1); + bool at_old_sp = false; + BasicType t = (at_this ? T_OBJECT : ss.type()); + assert(t == sig_bt[sig_index], "sigs in sync"); + if (at_this) + stream->print(" # this: "); + else + stream->print(" # parm%d: ", arg_index); + stream->move_to(tab1); + VMReg fst = regs[sig_index].first(); + VMReg snd = regs[sig_index].second(); + if (fst->is_reg()) { + stream->print("%s", fst->name()); + if (snd->is_valid()) { + stream->print(":%s", snd->name()); + } + } else if (fst->is_stack()) { + int offset = fst->reg2stack() * VMRegImpl::stack_slot_size + stack_slot_offset; + if (offset == stack_slot_offset) at_old_sp = true; + stream->print("[%s+0x%x]", spname, offset); + } else { + stream->print("reg%d:%d??", (int)(intptr_t)fst, (int)(intptr_t)snd); + } + stream->print(" "); + stream->move_to(tab2); + stream->print("= "); + if (at_this) { + m->method_holder()->print_value_on(stream); + } else { + bool did_name = false; + if (!at_this && ss.is_object()) { + symbolOop name = ss.as_symbol_or_null(); + if (name != NULL) { + name->print_value_on(stream); + did_name = true; + } + } + if (!did_name) + stream->print("%s", type2name(t)); + } + if (at_old_sp) { + stream->print(" (%s of caller)", spname); + did_old_sp = true; + } + stream->cr(); + sig_index += type2size[t]; + arg_index += 1; + if (!at_this) ss.next(); + } + if (!did_old_sp) { + stream->print(" # "); + stream->move_to(tab1); + stream->print("[%s+0x%x]", spname, stack_slot_offset); + stream->print(" (%s of caller)", spname); + stream->cr(); + } + } + } +} + void nmethod::print_code_comment_on(outputStream* st, int column, u_char* begin, u_char* end) { // First, find an oopmap in (begin, end]. // We use the odd half-closed interval so that oop maps and scope descs diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp index c7abdea89c8..f910efbd224 100644 --- a/hotspot/src/share/vm/code/nmethod.hpp +++ b/hotspot/src/share/vm/code/nmethod.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,18 +81,21 @@ class PcDescCache VALUE_OBJ_CLASS_SPEC { struct nmFlags { friend class VMStructs; - unsigned int version:8; // version number (0 = first version) - unsigned int level:4; // optimization level - unsigned int age:4; // age (in # of sweep steps) + unsigned int version:8; // version number (0 = first version) + unsigned int level:4; // optimization level + unsigned int age:4; // age (in # of sweep steps) - unsigned int state:2; // {alive, zombie, unloaded) + unsigned int state:2; // {alive, zombie, unloaded) - unsigned int isUncommonRecompiled:1; // recompiled because of uncommon trap? - unsigned int isToBeRecompiled:1; // to be recompiled as soon as it matures - unsigned int hasFlushedDependencies:1; // Used for maintenance of dependencies - unsigned int markedForReclamation:1; // Used by NMethodSweeper + unsigned int isUncommonRecompiled:1; // recompiled because of uncommon trap? + unsigned int isToBeRecompiled:1; // to be recompiled as soon as it matures + unsigned int hasFlushedDependencies:1; // Used for maintenance of dependencies + unsigned int markedForReclamation:1; // Used by NMethodSweeper - unsigned int has_unsafe_access:1; // May fault due to unsafe access. + unsigned int has_unsafe_access:1; // May fault due to unsafe access. + unsigned int has_method_handle_invokes:1; // Has this method MethodHandle invokes? + + unsigned int speculatively_disconnected:1; // Marked for potential unload void clear(); }; @@ -136,6 +139,7 @@ class nmethod : public CodeBlob { // To support simple linked-list chaining of nmethods: nmethod* _osr_link; // from instanceKlass::osr_nmethods_head nmethod* _scavenge_root_link; // from CodeCache::scavenge_root_nmethods + nmethod* _saved_nmethod_link; // from CodeCache::speculatively_disconnect static nmethod* volatile _oops_do_mark_nmethods; nmethod* volatile _oops_do_mark_link; @@ -144,8 +148,12 @@ class nmethod : public CodeBlob { // Offsets for different nmethod parts int _exception_offset; - // All deoptee's will resume execution at this location described by this offset + // All deoptee's will resume execution at this location described by + // this offset. int _deoptimize_offset; + // All deoptee's at a MethodHandle call site will resume execution + // at this location described by this offset. + int _deoptimize_mh_offset; #ifdef HAVE_DTRACE_H int _trap_offset; #endif // def HAVE_DTRACE_H @@ -252,7 +260,9 @@ class nmethod : public CodeBlob { void* operator new(size_t size, int nmethod_size); const char* reloc_string_for(u_char* begin, u_char* end); - void make_not_entrant_or_zombie(int state); + // Returns true if this thread changed the state of the nmethod or + // false if another thread performed the transition. + bool make_not_entrant_or_zombie(unsigned int state); void inc_decompile_count(); // used to check that writes to nmFlags are done consistently. @@ -326,24 +336,25 @@ class nmethod : public CodeBlob { bool is_compiled_by_c2() const; // boundaries for different parts - address code_begin () const { return _entry_point; } - address code_end () const { return header_begin() + _stub_offset ; } - address exception_begin () const { return header_begin() + _exception_offset ; } - address deopt_handler_begin() const { return header_begin() + _deoptimize_offset ; } - address stub_begin () const { return header_begin() + _stub_offset ; } - address stub_end () const { return header_begin() + _consts_offset ; } - address consts_begin () const { return header_begin() + _consts_offset ; } - address consts_end () const { return header_begin() + _scopes_data_offset ; } - address scopes_data_begin () const { return header_begin() + _scopes_data_offset ; } - address scopes_data_end () const { return header_begin() + _scopes_pcs_offset ; } - PcDesc* scopes_pcs_begin () const { return (PcDesc*)(header_begin() + _scopes_pcs_offset ); } - PcDesc* scopes_pcs_end () const { return (PcDesc*)(header_begin() + _dependencies_offset); } - address dependencies_begin () const { return header_begin() + _dependencies_offset ; } - address dependencies_end () const { return header_begin() + _handler_table_offset ; } - address handler_table_begin() const { return header_begin() + _handler_table_offset ; } - address handler_table_end () const { return header_begin() + _nul_chk_table_offset ; } - address nul_chk_table_begin() const { return header_begin() + _nul_chk_table_offset ; } - address nul_chk_table_end () const { return header_begin() + _nmethod_end_offset ; } + address code_begin () const { return _entry_point; } + address code_end () const { return header_begin() + _stub_offset ; } + address exception_begin () const { return header_begin() + _exception_offset ; } + address deopt_handler_begin () const { return header_begin() + _deoptimize_offset ; } + address deopt_mh_handler_begin() const { return header_begin() + _deoptimize_mh_offset ; } + address stub_begin () const { return header_begin() + _stub_offset ; } + address stub_end () const { return header_begin() + _consts_offset ; } + address consts_begin () const { return header_begin() + _consts_offset ; } + address consts_end () const { return header_begin() + _scopes_data_offset ; } + address scopes_data_begin () const { return header_begin() + _scopes_data_offset ; } + address scopes_data_end () const { return header_begin() + _scopes_pcs_offset ; } + PcDesc* scopes_pcs_begin () const { return (PcDesc*)(header_begin() + _scopes_pcs_offset ); } + PcDesc* scopes_pcs_end () const { return (PcDesc*)(header_begin() + _dependencies_offset) ; } + address dependencies_begin () const { return header_begin() + _dependencies_offset ; } + address dependencies_end () const { return header_begin() + _handler_table_offset ; } + address handler_table_begin () const { return header_begin() + _handler_table_offset ; } + address handler_table_end () const { return header_begin() + _nul_chk_table_offset ; } + address nul_chk_table_begin () const { return header_begin() + _nul_chk_table_offset ; } + address nul_chk_table_end () const { return header_begin() + _nmethod_end_offset ; } int code_size () const { return code_end () - code_begin (); } int stub_size () const { return stub_end () - stub_begin (); } @@ -375,10 +386,12 @@ class nmethod : public CodeBlob { bool is_zombie() const { return flags.state == zombie; } bool is_unloaded() const { return flags.state == unloaded; } - // Make the nmethod non entrant. The nmethod will continue to be alive. - // It is used when an uncommon trap happens. - void make_not_entrant() { make_not_entrant_or_zombie(not_entrant); } - void make_zombie() { make_not_entrant_or_zombie(zombie); } + // Make the nmethod non entrant. The nmethod will continue to be + // alive. It is used when an uncommon trap happens. Returns true + // if this thread changed the state of the nmethod or false if + // another thread performed the transition. + bool make_not_entrant() { return make_not_entrant_or_zombie(not_entrant); } + bool make_zombie() { return make_not_entrant_or_zombie(zombie); } // used by jvmti to track if the unload event has been reported bool unload_reported() { return _unload_reported; } @@ -405,6 +418,12 @@ class nmethod : public CodeBlob { bool has_unsafe_access() const { return flags.has_unsafe_access; } void set_has_unsafe_access(bool z) { flags.has_unsafe_access = z; } + bool has_method_handle_invokes() const { return flags.has_method_handle_invokes; } + void set_has_method_handle_invokes(bool z) { flags.has_method_handle_invokes = z; } + + bool is_speculatively_disconnected() const { return flags.speculatively_disconnected; } + void set_speculatively_disconnected(bool z) { flags.speculatively_disconnected = z; } + int level() const { return flags.level; } void set_level(int newLevel) { check_safepoint(); flags.level = newLevel; } @@ -429,6 +448,9 @@ class nmethod : public CodeBlob { nmethod* scavenge_root_link() const { return _scavenge_root_link; } void set_scavenge_root_link(nmethod *n) { _scavenge_root_link = n; } + nmethod* saved_nmethod_link() const { return _saved_nmethod_link; } + void set_saved_nmethod_link(nmethod *n) { _saved_nmethod_link = n; } + public: // Sweeper support @@ -507,7 +529,7 @@ class nmethod : public CodeBlob { private: ScopeDesc* scope_desc_in(address begin, address end); - address* orig_pc_addr(const frame* fr ) { return (address*) ((address)fr->unextended_sp() + _orig_pc_offset); } + address* orig_pc_addr(const frame* fr) { return (address*) ((address)fr->unextended_sp() + _orig_pc_offset); } PcDesc* find_pc_desc_internal(address pc, bool approximate); @@ -530,13 +552,20 @@ class nmethod : public CodeBlob { void copy_scopes_pcs(PcDesc* pcs, int count); void copy_scopes_data(address buffer, int size); - // deopt - // return true is the pc is one would expect if the frame is being deopted. - bool is_deopt_pc(address pc); + // Deopt + // Return true is the PC is one would expect if the frame is being deopted. + bool is_deopt_pc (address pc) { return is_deopt_entry(pc) || is_deopt_mh_entry(pc); } + bool is_deopt_entry (address pc) { return pc == deopt_handler_begin(); } + bool is_deopt_mh_entry(address pc) { return pc == deopt_mh_handler_begin(); } // Accessor/mutator for the original pc of a frame before a frame was deopted. address get_original_pc(const frame* fr) { return *orig_pc_addr(fr); } void set_original_pc(const frame* fr, address pc) { *orig_pc_addr(fr) = pc; } + static address get_deopt_original_pc(const frame* fr); + + // MethodHandle + bool is_method_handle_return(address return_pc); + // jvmti support: void post_compiled_method_load_event(); @@ -563,7 +592,14 @@ class nmethod : public CodeBlob { // Logging void log_identity(xmlStream* log) const; void log_new_nmethod() const; - void log_state_change(int state) const; + void log_state_change() const; + + // Prints block-level comments, including nmethod specific block labels: + virtual void print_block_comment(outputStream* stream, address block_begin) { + print_nmethod_labels(stream, block_begin); + CodeBlob::print_block_comment(stream, block_begin); + } + void print_nmethod_labels(outputStream* stream, address block_begin); // Prints a comment for one native instruction (reloc info, pc desc) void print_code_comment_on(outputStream* st, int column, address begin, address end); diff --git a/hotspot/src/share/vm/code/pcDesc.cpp b/hotspot/src/share/vm/code/pcDesc.cpp index 5b981645a1b..5d6456bf513 100644 --- a/hotspot/src/share/vm/code/pcDesc.cpp +++ b/hotspot/src/share/vm/code/pcDesc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,7 +52,8 @@ void PcDesc::print(nmethod* code) { tty->print(" "); sd->method()->print_short_name(tty); tty->print(" @%d", sd->bci()); - tty->print(" reexecute=%s", sd->should_reexecute()?"true":"false"); + if (sd->should_reexecute()) + tty->print(" reexecute=true"); tty->cr(); } #endif diff --git a/hotspot/src/share/vm/code/pcDesc.hpp b/hotspot/src/share/vm/code/pcDesc.hpp index de9334b4cee..c666810613a 100644 --- a/hotspot/src/share/vm/code/pcDesc.hpp +++ b/hotspot/src/share/vm/code/pcDesc.hpp @@ -38,6 +38,8 @@ class PcDesc VALUE_OBJ_CLASS_SPEC { int word; struct { unsigned int reexecute: 1; + unsigned int is_method_handle_invoke: 1; + unsigned int return_oop: 1; } bits; bool operator ==(const PcDescFlags& other) { return word == other.word; } } _flags; @@ -72,6 +74,12 @@ class PcDesc VALUE_OBJ_CLASS_SPEC { _flags == pd->_flags; } + bool is_method_handle_invoke() const { return _flags.bits.is_method_handle_invoke; } + void set_is_method_handle_invoke(bool z) { _flags.bits.is_method_handle_invoke = z; } + + bool return_oop() const { return _flags.bits.return_oop; } + void set_return_oop(bool z) { _flags.bits.return_oop = z; } + // Returns the real pc address real_pc(const nmethod* code) const; diff --git a/hotspot/src/share/vm/code/scopeDesc.cpp b/hotspot/src/share/vm/code/scopeDesc.cpp index a034530e6bf..5b411c5bef1 100644 --- a/hotspot/src/share/vm/code/scopeDesc.cpp +++ b/hotspot/src/share/vm/code/scopeDesc.cpp @@ -26,19 +26,21 @@ # include "incls/_scopeDesc.cpp.incl" -ScopeDesc::ScopeDesc(const nmethod* code, int decode_offset, int obj_decode_offset, bool reexecute) { +ScopeDesc::ScopeDesc(const nmethod* code, int decode_offset, int obj_decode_offset, bool reexecute, bool return_oop) { _code = code; _decode_offset = decode_offset; _objects = decode_object_values(obj_decode_offset); _reexecute = reexecute; + _return_oop = return_oop; decode_body(); } -ScopeDesc::ScopeDesc(const nmethod* code, int decode_offset, bool reexecute) { +ScopeDesc::ScopeDesc(const nmethod* code, int decode_offset, bool reexecute, bool return_oop) { _code = code; _decode_offset = decode_offset; _objects = decode_object_values(DebugInformationRecorder::serialized_null); _reexecute = reexecute; + _return_oop = return_oop; decode_body(); } @@ -48,6 +50,7 @@ ScopeDesc::ScopeDesc(const ScopeDesc* parent) { _decode_offset = parent->_sender_decode_offset; _objects = parent->_objects; _reexecute = false; //reexecute only applies to the first scope + _return_oop = false; decode_body(); } diff --git a/hotspot/src/share/vm/code/scopeDesc.hpp b/hotspot/src/share/vm/code/scopeDesc.hpp index d030eaea849..345769ae550 100644 --- a/hotspot/src/share/vm/code/scopeDesc.hpp +++ b/hotspot/src/share/vm/code/scopeDesc.hpp @@ -52,17 +52,18 @@ class SimpleScopeDesc : public StackObj { class ScopeDesc : public ResourceObj { public: // Constructor - ScopeDesc(const nmethod* code, int decode_offset, int obj_decode_offset, bool reexecute); + ScopeDesc(const nmethod* code, int decode_offset, int obj_decode_offset, bool reexecute, bool return_oop); // Calls above, giving default value of "serialized_null" to the // "obj_decode_offset" argument. (We don't use a default argument to // avoid a .hpp-.hpp dependency.) - ScopeDesc(const nmethod* code, int decode_offset, bool reexecute); + ScopeDesc(const nmethod* code, int decode_offset, bool reexecute, bool return_oop); // JVM state methodHandle method() const { return _method; } int bci() const { return _bci; } bool should_reexecute() const { return _reexecute; } + bool return_oop() const { return _return_oop; } GrowableArray* locals(); GrowableArray* expressions(); @@ -88,6 +89,7 @@ class ScopeDesc : public ResourceObj { methodHandle _method; int _bci; bool _reexecute; + bool _return_oop; // Decoding offsets int _decode_offset; diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index 799d9f89202..c3173c9290c 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,6 +69,7 @@ HS_DTRACE_PROBE_DECL9(hotspot, method__compile__end, bool CompileBroker::_initialized = false; volatile bool CompileBroker::_should_block = false; +volatile jint CompileBroker::_should_compile_new_jobs = run_compilation; // The installed compiler(s) AbstractCompiler* CompileBroker::_compilers[2]; @@ -986,6 +987,13 @@ nmethod* CompileBroker::compile_method(methodHandle method, int osr_bci, return method_code; } if (method->is_not_compilable(comp_level)) return NULL; + + nmethod* saved = CodeCache::find_and_remove_saved_code(method()); + if (saved != NULL) { + method->set_code(method, saved); + return saved; + } + } else { // osr compilation #ifndef TIERED @@ -1037,6 +1045,14 @@ nmethod* CompileBroker::compile_method(methodHandle method, int osr_bci, method->jmethod_id(); } + // If the compiler is shut off due to code cache flushing or otherwise, + // fail out now so blocking compiles dont hang the java thread + if (!should_compile_new_jobs() || (UseCodeCacheFlushing && CodeCache::needs_flushing())) { + method->invocation_counter()->decay(); + method->backedge_counter()->decay(); + return NULL; + } + // do the compilation if (method->is_native()) { if (!PreferInterpreterNativeStubs) { @@ -1116,7 +1132,7 @@ bool CompileBroker::compilation_is_prohibited(methodHandle method, int osr_bci, // the specified level if (is_native && (!CICompileNatives || !compiler(comp_level)->supports_native())) { - method->set_not_compilable(); + method->set_not_compilable_quietly(); return true; } @@ -1140,7 +1156,7 @@ bool CompileBroker::compilation_is_prohibited(methodHandle method, int osr_bci, method->print_short_name(tty); tty->cr(); } - method->set_not_compilable(); + method->set_not_compilable_quietly(); } return false; @@ -1173,7 +1189,7 @@ uint CompileBroker::assign_compile_id(methodHandle method, int osr_bci) { } // Method was not in the appropriate compilation range. - method->set_not_compilable(); + method->set_not_compilable_quietly(); return 0; } @@ -1325,26 +1341,13 @@ void CompileBroker::compiler_thread_loop() { { // We need this HandleMark to avoid leaking VM handles. HandleMark hm(thread); + if (CodeCache::unallocated_capacity() < CodeCacheMinimumFreeSpace) { - // The CodeCache is full. Print out warning and disable compilation. - UseInterpreter = true; - if (UseCompiler || AlwaysCompileLoopMethods ) { - if (log != NULL) { - log->begin_elem("code_cache_full"); - log->stamp(); - log->end_elem(); - } -#ifndef PRODUCT - warning("CodeCache is full. Compiler has been disabled"); - if (CompileTheWorld || ExitOnFullCodeCache) { - before_exit(thread); - exit_globals(); // will delete tty - vm_direct_exit(CompileTheWorld ? 0 : 1); - } -#endif - UseCompiler = false; - AlwaysCompileLoopMethods = false; - } + // the code cache is really full + handle_full_code_cache(); + } else if (UseCodeCacheFlushing && CodeCache::needs_flushing()) { + // Attempt to start cleaning the code cache while there is still a little headroom + NMethodSweeper::handle_full_code_cache(false); } CompileTask* task = queue->get(); @@ -1369,7 +1372,7 @@ void CompileBroker::compiler_thread_loop() { // Never compile a method if breakpoints are present in it if (method()->number_of_breakpoints() == 0) { // Compile the method. - if (UseCompiler || AlwaysCompileLoopMethods) { + if ((UseCompiler || AlwaysCompileLoopMethods) && CompileBroker::should_compile_new_jobs()) { #ifdef COMPILER1 // Allow repeating compilations for the purpose of benchmarking // compile speed. This is not useful for customers. @@ -1587,10 +1590,10 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) { if (is_osr) { method->set_not_osr_compilable(); } else { - method->set_not_compilable(); + method->set_not_compilable_quietly(); } } else if (compilable == ciEnv::MethodCompilable_not_at_tier) { - method->set_not_compilable(task->comp_level()); + method->set_not_compilable_quietly(task->comp_level()); } // Note that the queued_for_compilation bits are cleared without @@ -1613,6 +1616,38 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) { } +// ------------------------------------------------------------------ +// CompileBroker::handle_full_code_cache +// +// The CodeCache is full. Print out warning and disable compilation or +// try code cache cleaning so compilation can continue later. +void CompileBroker::handle_full_code_cache() { + UseInterpreter = true; + if (UseCompiler || AlwaysCompileLoopMethods ) { + CompilerThread* thread = CompilerThread::current(); + CompileLog* log = thread->log(); + if (log != NULL) { + log->begin_elem("code_cache_full"); + log->stamp(); + log->end_elem(); + } + #ifndef PRODUCT + warning("CodeCache is full. Compiler has been disabled"); + if (CompileTheWorld || ExitOnFullCodeCache) { + before_exit(JavaThread::current()); + exit_globals(); // will delete tty + vm_direct_exit(CompileTheWorld ? 0 : 1); + } + #endif + if (UseCodeCacheFlushing) { + NMethodSweeper::handle_full_code_cache(true); + } else { + UseCompiler = false; + AlwaysCompileLoopMethods = false; + } + } +} + // ------------------------------------------------------------------ // CompileBroker::set_last_compile // @@ -1820,9 +1855,11 @@ void CompileBroker::print_times() { CompileBroker::_t_standard_compilation.seconds(), CompileBroker::_t_standard_compilation.seconds() / CompileBroker::_total_standard_compile_count); tty->print_cr(" On stack replacement : %6.3f s, Average : %2.3f", CompileBroker::_t_osr_compilation.seconds(), CompileBroker::_t_osr_compilation.seconds() / CompileBroker::_total_osr_compile_count); - compiler(CompLevel_fast_compile)->print_timers(); - if (compiler(CompLevel_fast_compile) != compiler(CompLevel_highest_tier)) { - compiler(CompLevel_highest_tier)->print_timers(); + + if (compiler(CompLevel_fast_compile)) { + compiler(CompLevel_fast_compile)->print_timers(); + if (compiler(CompLevel_fast_compile) != compiler(CompLevel_highest_tier)) + compiler(CompLevel_highest_tier)->print_timers(); } tty->cr(); diff --git a/hotspot/src/share/vm/compiler/compileBroker.hpp b/hotspot/src/share/vm/compiler/compileBroker.hpp index d976be14f26..83383378fa6 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.hpp +++ b/hotspot/src/share/vm/compiler/compileBroker.hpp @@ -193,6 +193,9 @@ class CompileBroker: AllStatic { static bool _initialized; static volatile bool _should_block; + // This flag can be used to stop compilation or turn it back on + static volatile jint _should_compile_new_jobs; + // The installed compiler(s) static AbstractCompiler* _compilers[2]; @@ -319,6 +322,7 @@ class CompileBroker: AllStatic { static void compiler_thread_loop(); + static uint get_compilation_id() { return _compilation_id; } static bool is_idle(); // Set _should_block. @@ -328,6 +332,20 @@ class CompileBroker: AllStatic { // Call this from the compiler at convenient points, to poll for _should_block. static void maybe_block(); + enum { + // Flags for toggling compiler activity + stop_compilation = 0, + run_compilation = 1 + }; + + static bool should_compile_new_jobs() { return UseCompiler && (_should_compile_new_jobs == run_compilation); } + static bool set_should_compile_new_jobs(jint new_state) { + // Return success if the current caller set it + jint old = Atomic::cmpxchg(new_state, &_should_compile_new_jobs, 1-new_state); + return (old == (1-new_state)); + } + static void handle_full_code_cache(); + // Return total compilation ticks static jlong total_compilation_ticks() { return _perf_total_compilation != NULL ? _perf_total_compilation->get_value() : 0; diff --git a/hotspot/src/share/vm/compiler/compilerOracle.cpp b/hotspot/src/share/vm/compiler/compilerOracle.cpp index 1829e044a06..73f36d7016b 100644 --- a/hotspot/src/share/vm/compiler/compilerOracle.cpp +++ b/hotspot/src/share/vm/compiler/compilerOracle.cpp @@ -392,18 +392,18 @@ static const char* patterns[] = { }; static MethodMatcher::Mode check_mode(char name[], const char*& error_msg) { - if (strcmp(name, "*") == 0) return MethodMatcher::Any; - int match = MethodMatcher::Exact; - if (name[0] == '*') { + while (name[0] == '*') { match |= MethodMatcher::Suffix; strcpy(name, name + 1); } + if (strcmp(name, "*") == 0) return MethodMatcher::Any; + size_t len = strlen(name); - if (len > 0 && name[len - 1] == '*') { + while (len > 0 && name[len - 1] == '*') { match |= MethodMatcher::Prefix; - name[len - 1] = '\0'; + name[--len] = '\0'; } if (strstr(name, "*") != NULL) { @@ -610,6 +610,14 @@ void compilerOracle_init() { CompilerOracle::parse_from_string(CompileCommand, CompilerOracle::parse_from_line); CompilerOracle::parse_from_string(CompileOnly, CompilerOracle::parse_compile_only); CompilerOracle::parse_from_file(); + if (lists[PrintCommand] != NULL) { + if (PrintAssembly) { + warning("CompileCommand and/or .hotspot_compiler file contains 'print' commands, but PrintAssembly is also enabled"); + } else if (FLAG_IS_DEFAULT(DebugNonSafepoints)) { + warning("printing of assembly code is enabled; turning on DebugNonSafepoints to gain additional output"); + DebugNonSafepoints = true; + } + } } diff --git a/hotspot/src/share/vm/compiler/disassembler.cpp b/hotspot/src/share/vm/compiler/disassembler.cpp index 3e800e9b9e7..dc33af2ee5b 100644 --- a/hotspot/src/share/vm/compiler/disassembler.cpp +++ b/hotspot/src/share/vm/compiler/disassembler.cpp @@ -151,8 +151,10 @@ class decode_env { outputStream* st = output(); if (_print_bytes && pc > pc0) print_insn_bytes(pc0, pc); - if (_nm != NULL) + if (_nm != NULL) { _nm->print_code_comment_on(st, COMMENT_COLUMN, pc0, pc); + // this calls reloc_string_for which calls oop::print_value_on + } // Output pc bucket ticks if we have any if (total_ticks() != 0) { @@ -273,8 +275,15 @@ void decode_env::print_address(address adr) { oop obj; if (_nm != NULL && (obj = _nm->embeddedOop_at(cur_insn())) != NULL - && (address) obj == adr) { + && (address) obj == adr + && Universe::heap()->is_in(obj) + && Universe::heap()->is_in(obj->klass())) { + julong c = st->count(); obj->print_value_on(st); + if (st->count() == c) { + // No output. (Can happen in product builds.) + st->print("(a %s)", Klass::cast(obj->klass())->external_name()); + } return; } } @@ -286,17 +295,9 @@ void decode_env::print_address(address adr) { void decode_env::print_insn_labels() { address p = cur_insn(); outputStream* st = output(); - nmethod* nm = _nm; - if (nm != NULL) { - if (p == nm->entry_point()) st->print_cr("[Entry Point]"); - if (p == nm->verified_entry_point()) st->print_cr("[Verified Entry Point]"); - if (p == nm->exception_begin()) st->print_cr("[Exception Handler]"); - if (p == nm->stub_begin()) st->print_cr("[Stub Code]"); - if (p == nm->consts_begin()) st->print_cr("[Constants]"); - } CodeBlob* cb = _code; if (cb != NULL) { - cb->print_block_comment(st, (intptr_t)(p - cb->instructions_begin())); + cb->print_block_comment(st, p); } if (_print_pc) { st->print(" " INTPTR_FORMAT ": ", (intptr_t) p); diff --git a/hotspot/src/share/vm/compiler/methodLiveness.cpp b/hotspot/src/share/vm/compiler/methodLiveness.cpp index a9a90a07197..4c53bcc1829 100644 --- a/hotspot/src/share/vm/compiler/methodLiveness.cpp +++ b/hotspot/src/share/vm/compiler/methodLiveness.cpp @@ -782,6 +782,7 @@ void MethodLiveness::BasicBlock::compute_gen_kill_single(ciBytecodeStream *instr case Bytecodes::_invokespecial: case Bytecodes::_invokestatic: case Bytecodes::_invokeinterface: + case Bytecodes::_invokedynamic: case Bytecodes::_newarray: case Bytecodes::_anewarray: case Bytecodes::_checkcast: diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp index eb1a1118d72..ec4caa22fc6 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp @@ -62,12 +62,13 @@ TreeList* TreeList::as_TreeList(TreeChunk* tc) { tl->link_head(tc); tl->link_tail(tc); tl->set_count(1); - tl->init_statistics(); + tl->init_statistics(true /* split_birth */); tl->setParent(NULL); tl->setLeft(NULL); tl->setRight(NULL); return tl; } + TreeList* TreeList::as_TreeList(HeapWord* addr, size_t size) { TreeChunk* tc = (TreeChunk*) addr; assert(size >= sizeof(TreeChunk), "Chunk is too small for a TreeChunk"); @@ -267,6 +268,31 @@ TreeChunk* TreeList::first_available() { return retTC; } +// Returns the block with the largest heap address amongst +// those in the list for this size; potentially slow and expensive, +// use with caution! +TreeChunk* TreeList::largest_address() { + guarantee(head() != NULL, "The head of the list cannot be NULL"); + FreeChunk* fc = head()->next(); + TreeChunk* retTC; + if (fc == NULL) { + retTC = head_as_TreeChunk(); + } else { + // walk down the list and return the one with the highest + // heap address among chunks of this size. + FreeChunk* last = fc; + while (fc->next() != NULL) { + if ((HeapWord*)last < (HeapWord*)fc) { + last = fc; + } + fc = fc->next(); + } + retTC = TreeChunk::as_TreeChunk(last); + } + assert(retTC->list() == this, "Wrong type of chunk."); + return retTC; +} + BinaryTreeDictionary::BinaryTreeDictionary(MemRegion mr, bool splay): _splay(splay) { @@ -379,7 +405,7 @@ BinaryTreeDictionary::getChunkFromTree(size_t size, Dither dither, bool splay) break; } // The evm code reset the hint of the candidate as - // at an interrim point. Why? Seems like this leaves + // at an interim point. Why? Seems like this leaves // the hint pointing to a list that didn't work. // curTL->set_hint(hintTL->size()); } @@ -436,7 +462,7 @@ FreeChunk* BinaryTreeDictionary::findLargestDict() const { TreeList *curTL = root(); if (curTL != NULL) { while(curTL->right() != NULL) curTL = curTL->right(); - return curTL->first_available(); + return curTL->largest_address(); } else { return NULL; } @@ -664,7 +690,7 @@ void BinaryTreeDictionary::insertChunkInTree(FreeChunk* fc) { } } TreeChunk* tc = TreeChunk::as_TreeChunk(fc); - // This chunk is being returned to the binary try. It's embedded + // This chunk is being returned to the binary tree. Its embedded // TreeList should be unused at this point. tc->initialize(); if (curTL != NULL) { // exact match @@ -807,6 +833,8 @@ void BinaryTreeDictionary::dictCensusUpdate(size_t size, bool split, bool birth) } bool BinaryTreeDictionary::coalDictOverPopulated(size_t size) { + if (FLSAlwaysCoalesceLarge) return true; + TreeList* list_of_size = findList(size); // None of requested size implies overpopulated. return list_of_size == NULL || list_of_size->coalDesired() <= 0 || @@ -854,17 +882,20 @@ class BeginSweepClosure : public AscendTreeCensusClosure { double _percentage; float _inter_sweep_current; float _inter_sweep_estimate; + float _intra_sweep_estimate; public: BeginSweepClosure(double p, float inter_sweep_current, - float inter_sweep_estimate) : + float inter_sweep_estimate, + float intra_sweep_estimate) : _percentage(p), _inter_sweep_current(inter_sweep_current), - _inter_sweep_estimate(inter_sweep_estimate) { } + _inter_sweep_estimate(inter_sweep_estimate), + _intra_sweep_estimate(intra_sweep_estimate) { } void do_list(FreeList* fl) { double coalSurplusPercent = _percentage; - fl->compute_desired(_inter_sweep_current, _inter_sweep_estimate); + fl->compute_desired(_inter_sweep_current, _inter_sweep_estimate, _intra_sweep_estimate); fl->set_coalDesired((ssize_t)((double)fl->desired() * coalSurplusPercent)); fl->set_beforeSweep(fl->count()); fl->set_bfrSurp(fl->surplus()); @@ -939,9 +970,10 @@ FreeChunk* BinaryTreeDictionary::find_chunk_ends_at(HeapWord* target) const { } void BinaryTreeDictionary::beginSweepDictCensus(double coalSurplusPercent, - float inter_sweep_current, float inter_sweep_estimate) { + float inter_sweep_current, float inter_sweep_estimate, float intra_sweep_estimate) { BeginSweepClosure bsc(coalSurplusPercent, inter_sweep_current, - inter_sweep_estimate); + inter_sweep_estimate, + intra_sweep_estimate); bsc.do_tree(root()); } @@ -1077,13 +1109,13 @@ void BinaryTreeDictionary::reportStatistics() const { // Print census information - counts, births, deaths, etc. // for each list in the tree. Also print some summary // information. -class printTreeCensusClosure : public AscendTreeCensusClosure { +class PrintTreeCensusClosure : public AscendTreeCensusClosure { int _print_line; size_t _totalFree; FreeList _total; public: - printTreeCensusClosure() { + PrintTreeCensusClosure() { _print_line = 0; _totalFree = 0; } @@ -1113,7 +1145,7 @@ void BinaryTreeDictionary::printDictCensus(void) const { gclog_or_tty->print("\nBinaryTree\n"); FreeList::print_labels_on(gclog_or_tty, "size"); - printTreeCensusClosure ptc; + PrintTreeCensusClosure ptc; ptc.do_tree(root()); FreeList* total = ptc.total(); @@ -1130,6 +1162,38 @@ void BinaryTreeDictionary::printDictCensus(void) const { /(total->desired() != 0 ? (double)total->desired() : 1.0)); } +class PrintFreeListsClosure : public AscendTreeCensusClosure { + outputStream* _st; + int _print_line; + + public: + PrintFreeListsClosure(outputStream* st) { + _st = st; + _print_line = 0; + } + void do_list(FreeList* fl) { + if (++_print_line >= 40) { + FreeList::print_labels_on(_st, "size"); + _print_line = 0; + } + fl->print_on(gclog_or_tty); + size_t sz = fl->size(); + for (FreeChunk* fc = fl->head(); fc != NULL; + fc = fc->next()) { + _st->print_cr("\t[" PTR_FORMAT "," PTR_FORMAT ") %s", + fc, (HeapWord*)fc + sz, + fc->cantCoalesce() ? "\t CC" : ""); + } + } +}; + +void BinaryTreeDictionary::print_free_lists(outputStream* st) const { + + FreeList::print_labels_on(st, "size"); + PrintFreeListsClosure pflc(st); + pflc.do_tree(root()); +} + // Verify the following tree invariants: // . _root has no parent // . parent and child point to each other diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp index d45193be9fb..0a107da91ab 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp @@ -42,9 +42,6 @@ class TreeList: public FreeList { friend class AscendTreeCensusClosure; friend class DescendTreeCensusClosure; friend class DescendTreeSearchClosure; - TreeList* _parent; - TreeList* _left; - TreeList* _right; protected: TreeList* parent() const { return _parent; } @@ -82,6 +79,11 @@ class TreeList: public FreeList { // to a TreeChunk. TreeChunk* first_available(); + // Returns the block with the largest heap address amongst + // those in the list for this size; potentially slow and expensive, + // use with caution! + TreeChunk* largest_address(); + // removeChunkReplaceIfNeeded() removes the given "tc" from the TreeList. // If "tc" is the first chunk in the list, it is also the // TreeList that is the node in the tree. removeChunkReplaceIfNeeded() @@ -254,8 +256,9 @@ class BinaryTreeDictionary: public FreeBlockDictionary { // Methods called at the beginning of a sweep to prepare the // statistics for the sweep. void beginSweepDictCensus(double coalSurplusPercent, - float sweep_current, - float sweep_estimate); + float inter_sweep_current, + float inter_sweep_estimate, + float intra_sweep_estimate); // Methods called after the end of a sweep to modify the // statistics for the sweep. void endSweepDictCensus(double splitSurplusPercent); @@ -269,6 +272,7 @@ class BinaryTreeDictionary: public FreeBlockDictionary { // Print the statistcis for all the lists in the tree. Also may // print out summaries. void printDictCensus(void) const; + void print_free_lists(outputStream* st) const; // For debugging. Returns the sum of the _returnedBytes for // all lists in the tree. diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.cpp index 00ef43f6957..b0ee1e8869e 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.cpp @@ -32,7 +32,9 @@ // threads. The second argument is in support of an extra locking // check for CFL spaces' free list locks. #ifndef PRODUCT -void CMSLockVerifier::assert_locked(const Mutex* lock, const Mutex* p_lock) { +void CMSLockVerifier::assert_locked(const Mutex* lock, + const Mutex* p_lock1, + const Mutex* p_lock2) { if (!Universe::is_fully_initialized()) { return; } @@ -40,7 +42,7 @@ void CMSLockVerifier::assert_locked(const Mutex* lock, const Mutex* p_lock) { Thread* myThread = Thread::current(); if (lock == NULL) { // a "lock-free" structure, e.g. MUT, protected by CMS token - assert(p_lock == NULL, "Unexpected state"); + assert(p_lock1 == NULL && p_lock2 == NULL, "Unexpected caller error"); if (myThread->is_ConcurrentGC_thread()) { // This test might have to change in the future, if there can be // multiple peer CMS threads. But for now, if we're testing the CMS @@ -60,36 +62,39 @@ void CMSLockVerifier::assert_locked(const Mutex* lock, const Mutex* p_lock) { return; } - if (ParallelGCThreads == 0) { + if (myThread->is_VM_thread() + || myThread->is_ConcurrentGC_thread() + || myThread->is_Java_thread()) { + // Make sure that we are holding the associated lock. assert_lock_strong(lock); - } else { - if (myThread->is_VM_thread() - || myThread->is_ConcurrentGC_thread() - || myThread->is_Java_thread()) { - // Make sure that we are holding the associated lock. - assert_lock_strong(lock); - // The checking of p_lock is a spl case for CFLS' free list - // locks: we make sure that none of the parallel GC work gang - // threads are holding "sub-locks" of freeListLock(). We check only - // the parDictionaryAllocLock because the others are too numerous. - // This spl case code is somewhat ugly and any improvements - // are welcome XXX FIX ME!! - if (p_lock != NULL) { - assert(!p_lock->is_locked() || p_lock->owned_by_self(), - "Possible race between this and parallel GC threads"); - } - } else if (myThread->is_GC_task_thread()) { - // Make sure that the VM or CMS thread holds lock on our behalf - // XXX If there were a concept of a gang_master for a (set of) - // gang_workers, we could have used the identity of that thread - // for checking ownership here; for now we just disjunct. - assert(lock->owner() == VMThread::vm_thread() || - lock->owner() == ConcurrentMarkSweepThread::cmst(), - "Should be locked by VM thread or CMS thread on my behalf"); - } else { - // Make sure we didn't miss some obscure corner case - ShouldNotReachHere(); + // The checking of p_lock is a spl case for CFLS' free list + // locks: we make sure that none of the parallel GC work gang + // threads are holding "sub-locks" of freeListLock(). We check only + // the parDictionaryAllocLock because the others are too numerous. + // This spl case code is somewhat ugly and any improvements + // are welcome. + assert(p_lock1 == NULL || !p_lock1->is_locked() || p_lock1->owned_by_self(), + "Possible race between this and parallel GC threads"); + assert(p_lock2 == NULL || !p_lock2->is_locked() || p_lock2->owned_by_self(), + "Possible race between this and parallel GC threads"); + } else if (myThread->is_GC_task_thread()) { + // Make sure that the VM or CMS thread holds lock on our behalf + // XXX If there were a concept of a gang_master for a (set of) + // gang_workers, we could have used the identity of that thread + // for checking ownership here; for now we just disjunct. + assert(lock->owner() == VMThread::vm_thread() || + lock->owner() == ConcurrentMarkSweepThread::cmst(), + "Should be locked by VM thread or CMS thread on my behalf"); + if (p_lock1 != NULL) { + assert_lock_strong(p_lock1); } + if (p_lock2 != NULL) { + assert_lock_strong(p_lock2); + } + } else { + // Make sure we didn't miss some other thread type calling into here; + // perhaps as a result of future VM evolution. + ShouldNotReachHere(); } } #endif diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.hpp index f2fe4514061..943eba0374c 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsLockVerifier.hpp @@ -29,8 +29,11 @@ // the parallel threads. class CMSLockVerifier: AllStatic { public: - static void assert_locked(const Mutex* lock, const Mutex* p_lock) + static void assert_locked(const Mutex* lock, const Mutex* p_lock1, const Mutex* p_lock2) PRODUCT_RETURN; + static void assert_locked(const Mutex* lock, const Mutex* p_lock) { + assert_locked(lock, p_lock, NULL); + } static void assert_locked(const Mutex* lock) { assert_locked(lock, NULL); } diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp index 6b4bd36d934..9e3b6cf81cc 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp @@ -62,18 +62,15 @@ CompactibleFreeListSpace::CompactibleFreeListSpace(BlockOffsetSharedArray* bs, // implementation, namely, the simple binary tree (splaying // temporarily disabled). switch (dictionaryChoice) { - case FreeBlockDictionary::dictionaryBinaryTree: - _dictionary = new BinaryTreeDictionary(mr); - break; case FreeBlockDictionary::dictionarySplayTree: case FreeBlockDictionary::dictionarySkipList: default: warning("dictionaryChoice: selected option not understood; using" " default BinaryTreeDictionary implementation instead."); + case FreeBlockDictionary::dictionaryBinaryTree: _dictionary = new BinaryTreeDictionary(mr); break; } - splitBirth(mr.word_size()); assert(_dictionary != NULL, "CMS dictionary initialization"); // The indexed free lists are initially all empty and are lazily // filled in on demand. Initialize the array elements to NULL. @@ -388,6 +385,105 @@ size_t CompactibleFreeListSpace::max_alloc_in_words() const { return res; } +void CompactibleFreeListSpace::print_indexed_free_lists(outputStream* st) +const { + reportIndexedFreeListStatistics(); + gclog_or_tty->print_cr("Layout of Indexed Freelists"); + gclog_or_tty->print_cr("---------------------------"); + FreeList::print_labels_on(st, "size"); + for (size_t i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) { + _indexedFreeList[i].print_on(gclog_or_tty); + for (FreeChunk* fc = _indexedFreeList[i].head(); fc != NULL; + fc = fc->next()) { + gclog_or_tty->print_cr("\t[" PTR_FORMAT "," PTR_FORMAT ") %s", + fc, (HeapWord*)fc + i, + fc->cantCoalesce() ? "\t CC" : ""); + } + } +} + +void CompactibleFreeListSpace::print_promo_info_blocks(outputStream* st) +const { + _promoInfo.print_on(st); +} + +void CompactibleFreeListSpace::print_dictionary_free_lists(outputStream* st) +const { + _dictionary->reportStatistics(); + st->print_cr("Layout of Freelists in Tree"); + st->print_cr("---------------------------"); + _dictionary->print_free_lists(st); +} + +class BlkPrintingClosure: public BlkClosure { + const CMSCollector* _collector; + const CompactibleFreeListSpace* _sp; + const CMSBitMap* _live_bit_map; + const bool _post_remark; + outputStream* _st; +public: + BlkPrintingClosure(const CMSCollector* collector, + const CompactibleFreeListSpace* sp, + const CMSBitMap* live_bit_map, + outputStream* st): + _collector(collector), + _sp(sp), + _live_bit_map(live_bit_map), + _post_remark(collector->abstract_state() > CMSCollector::FinalMarking), + _st(st) { } + size_t do_blk(HeapWord* addr); +}; + +size_t BlkPrintingClosure::do_blk(HeapWord* addr) { + size_t sz = _sp->block_size_no_stall(addr, _collector); + assert(sz != 0, "Should always be able to compute a size"); + if (_sp->block_is_obj(addr)) { + const bool dead = _post_remark && !_live_bit_map->isMarked(addr); + _st->print_cr(PTR_FORMAT ": %s object of size " SIZE_FORMAT "%s", + addr, + dead ? "dead" : "live", + sz, + (!dead && CMSPrintObjectsInDump) ? ":" : "."); + if (CMSPrintObjectsInDump && !dead) { + oop(addr)->print_on(_st); + _st->print_cr("--------------------------------------"); + } + } else { // free block + _st->print_cr(PTR_FORMAT ": free block of size " SIZE_FORMAT "%s", + addr, sz, CMSPrintChunksInDump ? ":" : "."); + if (CMSPrintChunksInDump) { + ((FreeChunk*)addr)->print_on(_st); + _st->print_cr("--------------------------------------"); + } + } + return sz; +} + +void CompactibleFreeListSpace::dump_at_safepoint_with_locks(CMSCollector* c, + outputStream* st) { + st->print_cr("\n========================="); + st->print_cr("Block layout in CMS Heap:"); + st->print_cr("========================="); + BlkPrintingClosure bpcl(c, this, c->markBitMap(), st); + blk_iterate(&bpcl); + + st->print_cr("\n======================================="); + st->print_cr("Order & Layout of Promotion Info Blocks"); + st->print_cr("======================================="); + print_promo_info_blocks(st); + + st->print_cr("\n==========================="); + st->print_cr("Order of Indexed Free Lists"); + st->print_cr("========================="); + print_indexed_free_lists(st); + + st->print_cr("\n================================="); + st->print_cr("Order of Free Lists in Dictionary"); + st->print_cr("================================="); + print_dictionary_free_lists(st); +} + + void CompactibleFreeListSpace::reportFreeListStatistics() const { assert_lock_strong(&_freelistLock); assert(PrintFLSStatistics != 0, "Reporting error"); @@ -449,37 +545,37 @@ void CompactibleFreeListSpace::set_end(HeapWord* value) { if (prevEnd != NULL) { // Resize the underlying block offset table. _bt.resize(pointer_delta(value, bottom())); - if (value <= prevEnd) { - assert(value >= unallocated_block(), "New end is below unallocated block"); - } else { - // Now, take this new chunk and add it to the free blocks. - // Note that the BOT has not yet been updated for this block. - size_t newFcSize = pointer_delta(value, prevEnd); - // XXX This is REALLY UGLY and should be fixed up. XXX - if (!_adaptive_freelists && _smallLinearAllocBlock._ptr == NULL) { - // Mark the boundary of the new block in BOT - _bt.mark_block(prevEnd, value); - // put it all in the linAB - if (ParallelGCThreads == 0) { - _smallLinearAllocBlock._ptr = prevEnd; - _smallLinearAllocBlock._word_size = newFcSize; - repairLinearAllocBlock(&_smallLinearAllocBlock); - } else { // ParallelGCThreads > 0 - MutexLockerEx x(parDictionaryAllocLock(), - Mutex::_no_safepoint_check_flag); - _smallLinearAllocBlock._ptr = prevEnd; - _smallLinearAllocBlock._word_size = newFcSize; - repairLinearAllocBlock(&_smallLinearAllocBlock); - } - // Births of chunks put into a LinAB are not recorded. Births - // of chunks as they are allocated out of a LinAB are. + if (value <= prevEnd) { + assert(value >= unallocated_block(), "New end is below unallocated block"); } else { - // Add the block to the free lists, if possible coalescing it - // with the last free block, and update the BOT and census data. - addChunkToFreeListsAtEndRecordingStats(prevEnd, newFcSize); + // Now, take this new chunk and add it to the free blocks. + // Note that the BOT has not yet been updated for this block. + size_t newFcSize = pointer_delta(value, prevEnd); + // XXX This is REALLY UGLY and should be fixed up. XXX + if (!_adaptive_freelists && _smallLinearAllocBlock._ptr == NULL) { + // Mark the boundary of the new block in BOT + _bt.mark_block(prevEnd, value); + // put it all in the linAB + if (ParallelGCThreads == 0) { + _smallLinearAllocBlock._ptr = prevEnd; + _smallLinearAllocBlock._word_size = newFcSize; + repairLinearAllocBlock(&_smallLinearAllocBlock); + } else { // ParallelGCThreads > 0 + MutexLockerEx x(parDictionaryAllocLock(), + Mutex::_no_safepoint_check_flag); + _smallLinearAllocBlock._ptr = prevEnd; + _smallLinearAllocBlock._word_size = newFcSize; + repairLinearAllocBlock(&_smallLinearAllocBlock); + } + // Births of chunks put into a LinAB are not recorded. Births + // of chunks as they are allocated out of a LinAB are. + } else { + // Add the block to the free lists, if possible coalescing it + // with the last free block, and update the BOT and census data. + addChunkToFreeListsAtEndRecordingStats(prevEnd, newFcSize); + } } } - } } class FreeListSpace_DCTOC : public Filtering_DCTOC { @@ -732,7 +828,7 @@ void CompactibleFreeListSpace::safe_object_iterate(ObjectClosure* blk) { void CompactibleFreeListSpace::object_iterate_mem(MemRegion mr, UpwardsObjectClosure* cl) { - assert_locked(); + assert_locked(freelistLock()); NOT_PRODUCT(verify_objects_initialized()); Space::object_iterate_mem(mr, cl); } @@ -1212,12 +1308,15 @@ bool CompactibleFreeListSpace::verifyChunkInFreeLists(FreeChunk* fc) const { void CompactibleFreeListSpace::assert_locked() const { CMSLockVerifier::assert_locked(freelistLock(), parDictionaryAllocLock()); } + +void CompactibleFreeListSpace::assert_locked(const Mutex* lock) const { + CMSLockVerifier::assert_locked(lock); +} #endif FreeChunk* CompactibleFreeListSpace::allocateScratch(size_t size) { // In the parallel case, the main thread holds the free list lock // on behalf the parallel threads. - assert_locked(); FreeChunk* fc; { // If GC is parallel, this might be called by several threads. @@ -1298,17 +1397,18 @@ CompactibleFreeListSpace::getChunkFromLinearAllocBlock(LinearAllocBlock *blk, res = blk->_ptr; _bt.allocated(res, blk->_word_size); } else if (size + MinChunkSize <= blk->_refillSize) { + size_t sz = blk->_word_size; // Update _unallocated_block if the size is such that chunk would be // returned to the indexed free list. All other chunks in the indexed // free lists are allocated from the dictionary so that _unallocated_block // has already been adjusted for them. Do it here so that the cost // for all chunks added back to the indexed free lists. - if (blk->_word_size < SmallForDictionary) { - _bt.allocated(blk->_ptr, blk->_word_size); + if (sz < SmallForDictionary) { + _bt.allocated(blk->_ptr, sz); } // Return the chunk that isn't big enough, and then refill below. - addChunkToFreeLists(blk->_ptr, blk->_word_size); - _bt.verify_single_block(blk->_ptr, (blk->_ptr + blk->_word_size)); + addChunkToFreeLists(blk->_ptr, sz); + splitBirth(sz); // Don't keep statistics on adding back chunk from a LinAB. } else { // A refilled block would not satisfy the request. @@ -1376,11 +1476,13 @@ CompactibleFreeListSpace::getChunkFromIndexedFreeList(size_t size) { res = getChunkFromIndexedFreeListHelper(size); } _bt.verify_not_unallocated((HeapWord*) res, size); + assert(res == NULL || res->size() == size, "Incorrect block size"); return res; } FreeChunk* -CompactibleFreeListSpace::getChunkFromIndexedFreeListHelper(size_t size) { +CompactibleFreeListSpace::getChunkFromIndexedFreeListHelper(size_t size, + bool replenish) { assert_locked(); FreeChunk* fc = NULL; if (size < SmallForDictionary) { @@ -1398,54 +1500,66 @@ CompactibleFreeListSpace::getChunkFromIndexedFreeListHelper(size_t size) { // and replenishing indexed lists from the small linAB. // FreeChunk* newFc = NULL; - size_t replenish_size = CMSIndexedFreeListReplenish * size; + const size_t replenish_size = CMSIndexedFreeListReplenish * size; if (replenish_size < SmallForDictionary) { // Do not replenish from an underpopulated size. if (_indexedFreeList[replenish_size].surplus() > 0 && _indexedFreeList[replenish_size].head() != NULL) { - newFc = - _indexedFreeList[replenish_size].getChunkAtHead(); - } else { + newFc = _indexedFreeList[replenish_size].getChunkAtHead(); + } else if (bestFitFirst()) { newFc = bestFitSmall(replenish_size); } } - if (newFc != NULL) { - splitDeath(replenish_size); - } else if (replenish_size > size) { + if (newFc == NULL && replenish_size > size) { assert(CMSIndexedFreeListReplenish > 1, "ctl pt invariant"); - newFc = - getChunkFromIndexedFreeListHelper(replenish_size); + newFc = getChunkFromIndexedFreeListHelper(replenish_size, false); } + // Note: The stats update re split-death of block obtained above + // will be recorded below precisely when we know we are going to + // be actually splitting it into more than one pieces below. if (newFc != NULL) { - assert(newFc->size() == replenish_size, "Got wrong size"); - size_t i; - FreeChunk *curFc, *nextFc; - // carve up and link blocks 0, ..., CMSIndexedFreeListReplenish - 2 - // The last chunk is not added to the lists but is returned as the - // free chunk. - for (curFc = newFc, nextFc = (FreeChunk*)((HeapWord*)curFc + size), - i = 0; - i < (CMSIndexedFreeListReplenish - 1); - curFc = nextFc, nextFc = (FreeChunk*)((HeapWord*)nextFc + size), - i++) { + if (replenish || CMSReplenishIntermediate) { + // Replenish this list and return one block to caller. + size_t i; + FreeChunk *curFc, *nextFc; + size_t num_blk = newFc->size() / size; + assert(num_blk >= 1, "Smaller than requested?"); + assert(newFc->size() % size == 0, "Should be integral multiple of request"); + if (num_blk > 1) { + // we are sure we will be splitting the block just obtained + // into multiple pieces; record the split-death of the original + splitDeath(replenish_size); + } + // carve up and link blocks 0, ..., num_blk - 2 + // The last chunk is not added to the lists but is returned as the + // free chunk. + for (curFc = newFc, nextFc = (FreeChunk*)((HeapWord*)curFc + size), + i = 0; + i < (num_blk - 1); + curFc = nextFc, nextFc = (FreeChunk*)((HeapWord*)nextFc + size), + i++) { + curFc->setSize(size); + // Don't record this as a return in order to try and + // determine the "returns" from a GC. + _bt.verify_not_unallocated((HeapWord*) fc, size); + _indexedFreeList[size].returnChunkAtTail(curFc, false); + _bt.mark_block((HeapWord*)curFc, size); + splitBirth(size); + // Don't record the initial population of the indexed list + // as a split birth. + } + + // check that the arithmetic was OK above + assert((HeapWord*)nextFc == (HeapWord*)newFc + num_blk*size, + "inconsistency in carving newFc"); curFc->setSize(size); - // Don't record this as a return in order to try and - // determine the "returns" from a GC. - _bt.verify_not_unallocated((HeapWord*) fc, size); - _indexedFreeList[size].returnChunkAtTail(curFc, false); _bt.mark_block((HeapWord*)curFc, size); splitBirth(size); - // Don't record the initial population of the indexed list - // as a split birth. + fc = curFc; + } else { + // Return entire block to caller + fc = newFc; } - - // check that the arithmetic was OK above - assert((HeapWord*)nextFc == (HeapWord*)newFc + replenish_size, - "inconsistency in carving newFc"); - curFc->setSize(size); - _bt.mark_block((HeapWord*)curFc, size); - splitBirth(size); - return curFc; } } } else { @@ -1453,7 +1567,7 @@ CompactibleFreeListSpace::getChunkFromIndexedFreeListHelper(size_t size) { // replenish the indexed free list. fc = getChunkFromDictionaryExact(size); } - assert(fc == NULL || fc->isFree(), "Should be returning a free chunk"); + // assert(fc == NULL || fc->isFree(), "Should be returning a free chunk"); return fc; } @@ -1512,6 +1626,11 @@ CompactibleFreeListSpace::returnChunkToDictionary(FreeChunk* chunk) { // adjust _unallocated_block downward, as necessary _bt.freed((HeapWord*)chunk, size); _dictionary->returnChunk(chunk); +#ifndef PRODUCT + if (CMSCollector::abstract_state() != CMSCollector::Sweeping) { + TreeChunk::as_TreeChunk(chunk)->list()->verify_stats(); + } +#endif // PRODUCT } void @@ -1525,6 +1644,11 @@ CompactibleFreeListSpace::returnChunkToFreeList(FreeChunk* fc) { } else { _indexedFreeList[size].returnChunkAtHead(fc); } +#ifndef PRODUCT + if (CMSCollector::abstract_state() != CMSCollector::Sweeping) { + _indexedFreeList[size].verify_stats(); + } +#endif // PRODUCT } // Add chunk to end of last block -- if it's the largest @@ -1537,7 +1661,6 @@ CompactibleFreeListSpace::addChunkToFreeListsAtEndRecordingStats( HeapWord* chunk, size_t size) { // check that the chunk does lie in this space! assert(chunk != NULL && is_in_reserved(chunk), "Not in this space!"); - assert_locked(); // One of the parallel gc task threads may be here // whilst others are allocating. Mutex* lock = NULL; @@ -1991,24 +2114,26 @@ double CompactibleFreeListSpace::flsFrag() const { return frag; } -#define CoalSurplusPercent 1.05 -#define SplitSurplusPercent 1.10 - void CompactibleFreeListSpace::beginSweepFLCensus( float inter_sweep_current, - float inter_sweep_estimate) { + float inter_sweep_estimate, + float intra_sweep_estimate) { assert_locked(); size_t i; for (i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) { FreeList* fl = &_indexedFreeList[i]; - fl->compute_desired(inter_sweep_current, inter_sweep_estimate); - fl->set_coalDesired((ssize_t)((double)fl->desired() * CoalSurplusPercent)); + if (PrintFLSStatistics > 1) { + gclog_or_tty->print("size[%d] : ", i); + } + fl->compute_desired(inter_sweep_current, inter_sweep_estimate, intra_sweep_estimate); + fl->set_coalDesired((ssize_t)((double)fl->desired() * CMSSmallCoalSurplusPercent)); fl->set_beforeSweep(fl->count()); fl->set_bfrSurp(fl->surplus()); } - _dictionary->beginSweepDictCensus(CoalSurplusPercent, + _dictionary->beginSweepDictCensus(CMSLargeCoalSurplusPercent, inter_sweep_current, - inter_sweep_estimate); + inter_sweep_estimate, + intra_sweep_estimate); } void CompactibleFreeListSpace::setFLSurplus() { @@ -2017,7 +2142,7 @@ void CompactibleFreeListSpace::setFLSurplus() { for (i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) { FreeList *fl = &_indexedFreeList[i]; fl->set_surplus(fl->count() - - (ssize_t)((double)fl->desired() * SplitSurplusPercent)); + (ssize_t)((double)fl->desired() * CMSSmallSplitSurplusPercent)); } } @@ -2048,6 +2173,11 @@ void CompactibleFreeListSpace::clearFLCensus() { } void CompactibleFreeListSpace::endSweepFLCensus(size_t sweep_count) { + if (PrintFLSStatistics > 0) { + HeapWord* largestAddr = (HeapWord*) dictionary()->findLargestDict(); + gclog_or_tty->print_cr("CMS: Large block " PTR_FORMAT, + largestAddr); + } setFLSurplus(); setFLHints(); if (PrintGC && PrintFLSCensus > 0) { @@ -2055,7 +2185,7 @@ void CompactibleFreeListSpace::endSweepFLCensus(size_t sweep_count) { } clearFLCensus(); assert_locked(); - _dictionary->endSweepDictCensus(SplitSurplusPercent); + _dictionary->endSweepDictCensus(CMSLargeSplitSurplusPercent); } bool CompactibleFreeListSpace::coalOverPopulated(size_t size) { @@ -2312,13 +2442,18 @@ void CompactibleFreeListSpace::verifyIndexedFreeLists() const { } void CompactibleFreeListSpace::verifyIndexedFreeList(size_t size) const { - FreeChunk* fc = _indexedFreeList[size].head(); + FreeChunk* fc = _indexedFreeList[size].head(); + FreeChunk* tail = _indexedFreeList[size].tail(); + size_t num = _indexedFreeList[size].count(); + size_t n = 0; guarantee((size % 2 == 0) || fc == NULL, "Odd slots should be empty"); - for (; fc != NULL; fc = fc->next()) { + for (; fc != NULL; fc = fc->next(), n++) { guarantee(fc->size() == size, "Size inconsistency"); guarantee(fc->isFree(), "!free?"); guarantee(fc->next() == NULL || fc->next()->prev() == fc, "Broken list"); + guarantee((fc->next() == NULL) == (fc == tail), "Incorrect tail"); } + guarantee(n == num, "Incorrect count"); } #ifndef PRODUCT @@ -2516,11 +2651,41 @@ void PromotionInfo::startTrackingPromotions() { _tracking = true; } -void PromotionInfo::stopTrackingPromotions() { +#define CMSPrintPromoBlockInfo 1 + +void PromotionInfo::stopTrackingPromotions(uint worker_id) { assert(_spoolHead == _spoolTail && _firstIndex == _nextIndex, "spooling inconsistency?"); _firstIndex = _nextIndex = 1; _tracking = false; + if (CMSPrintPromoBlockInfo > 1) { + print_statistics(worker_id); + } +} + +void PromotionInfo::print_statistics(uint worker_id) const { + assert(_spoolHead == _spoolTail && _firstIndex == _nextIndex, + "Else will undercount"); + assert(CMSPrintPromoBlockInfo > 0, "Else unnecessary call"); + // Count the number of blocks and slots in the free pool + size_t slots = 0; + size_t blocks = 0; + for (SpoolBlock* cur_spool = _spareSpool; + cur_spool != NULL; + cur_spool = cur_spool->nextSpoolBlock) { + // the first entry is just a self-pointer; indices 1 through + // bufferSize - 1 are occupied (thus, bufferSize - 1 slots). + guarantee((void*)cur_spool->displacedHdr == (void*)&cur_spool->displacedHdr, + "first entry of displacedHdr should be self-referential"); + slots += cur_spool->bufferSize - 1; + blocks++; + } + if (_spoolHead != NULL) { + slots += _spoolHead->bufferSize - 1; + blocks++; + } + gclog_or_tty->print_cr(" [worker %d] promo_blocks = %d, promo_slots = %d ", + worker_id, blocks, slots); } // When _spoolTail is not NULL, then the slot <_spoolTail, _nextIndex> @@ -2584,15 +2749,84 @@ void PromotionInfo::verify() const { guarantee(numDisplacedHdrs == numObjsWithDisplacedHdrs, "Displaced hdr count"); } +void PromotionInfo::print_on(outputStream* st) const { + SpoolBlock* curSpool = NULL; + size_t i = 0; + st->print_cr("start & end indices: [" SIZE_FORMAT ", " SIZE_FORMAT ")", + _firstIndex, _nextIndex); + for (curSpool = _spoolHead; curSpool != _spoolTail && curSpool != NULL; + curSpool = curSpool->nextSpoolBlock) { + curSpool->print_on(st); + st->print_cr(" active "); + i++; + } + for (curSpool = _spoolTail; curSpool != NULL; + curSpool = curSpool->nextSpoolBlock) { + curSpool->print_on(st); + st->print_cr(" inactive "); + i++; + } + for (curSpool = _spareSpool; curSpool != NULL; + curSpool = curSpool->nextSpoolBlock) { + curSpool->print_on(st); + st->print_cr(" free "); + i++; + } + st->print_cr(SIZE_FORMAT " header spooling blocks", i); +} + +void SpoolBlock::print_on(outputStream* st) const { + st->print("[" PTR_FORMAT "," PTR_FORMAT "), " SIZE_FORMAT " HeapWords -> " PTR_FORMAT, + this, (HeapWord*)displacedHdr + bufferSize, + bufferSize, nextSpoolBlock); +} + +/////////////////////////////////////////////////////////////////////////// +// CFLS_LAB +/////////////////////////////////////////////////////////////////////////// + +#define VECTOR_257(x) \ + /* 1 2 3 4 5 6 7 8 9 1x 11 12 13 14 15 16 17 18 19 2x 21 22 23 24 25 26 27 28 29 3x 31 32 */ \ + { x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ + x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ + x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ + x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ + x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ + x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ + x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ + x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, \ + x } + +// Initialize with default setting of CMSParPromoteBlocksToClaim, _not_ +// OldPLABSize, whose static default is different; if overridden at the +// command-line, this will get reinitialized via a call to +// modify_initialization() below. +AdaptiveWeightedAverage CFLS_LAB::_blocks_to_claim[] = + VECTOR_257(AdaptiveWeightedAverage(OldPLABWeight, (float)CMSParPromoteBlocksToClaim)); +size_t CFLS_LAB::_global_num_blocks[] = VECTOR_257(0); +int CFLS_LAB::_global_num_workers[] = VECTOR_257(0); CFLS_LAB::CFLS_LAB(CompactibleFreeListSpace* cfls) : _cfls(cfls) { - _blocks_to_claim = CMSParPromoteBlocksToClaim; + assert(CompactibleFreeListSpace::IndexSetSize == 257, "Modify VECTOR_257() macro above"); for (size_t i = CompactibleFreeListSpace::IndexSetStart; i < CompactibleFreeListSpace::IndexSetSize; i += CompactibleFreeListSpace::IndexSetStride) { _indexedFreeList[i].set_size(i); + _num_blocks[i] = 0; + } +} + +static bool _CFLS_LAB_modified = false; + +void CFLS_LAB::modify_initialization(size_t n, unsigned wt) { + assert(!_CFLS_LAB_modified, "Call only once"); + _CFLS_LAB_modified = true; + for (size_t i = CompactibleFreeListSpace::IndexSetStart; + i < CompactibleFreeListSpace::IndexSetSize; + i += CompactibleFreeListSpace::IndexSetStride) { + _blocks_to_claim[i].modify(n, wt, true /* force */); } } @@ -2607,11 +2841,9 @@ HeapWord* CFLS_LAB::alloc(size_t word_sz) { if (res == NULL) return NULL; } else { FreeList* fl = &_indexedFreeList[word_sz]; - bool filled = false; //TRAP if (fl->count() == 0) { - bool filled = true; //TRAP // Attempt to refill this local free list. - _cfls->par_get_chunk_of_blocks(word_sz, _blocks_to_claim, fl); + get_from_global_pool(word_sz, fl); // If it didn't work, give up. if (fl->count() == 0) return NULL; } @@ -2626,80 +2858,190 @@ HeapWord* CFLS_LAB::alloc(size_t word_sz) { return (HeapWord*)res; } -void CFLS_LAB::retire() { - for (size_t i = CompactibleFreeListSpace::IndexSetStart; +// Get a chunk of blocks of the right size and update related +// book-keeping stats +void CFLS_LAB::get_from_global_pool(size_t word_sz, FreeList* fl) { + // Get the #blocks we want to claim + size_t n_blks = (size_t)_blocks_to_claim[word_sz].average(); + assert(n_blks > 0, "Error"); + assert(ResizePLAB || n_blks == OldPLABSize, "Error"); + // In some cases, when the application has a phase change, + // there may be a sudden and sharp shift in the object survival + // profile, and updating the counts at the end of a scavenge + // may not be quick enough, giving rise to large scavenge pauses + // during these phase changes. It is beneficial to detect such + // changes on-the-fly during a scavenge and avoid such a phase-change + // pothole. The following code is a heuristic attempt to do that. + // It is protected by a product flag until we have gained + // enough experience with this heuristic and fine-tuned its behaviour. + // WARNING: This might increase fragmentation if we overreact to + // small spikes, so some kind of historical smoothing based on + // previous experience with the greater reactivity might be useful. + // Lacking sufficient experience, CMSOldPLABResizeQuicker is disabled by + // default. + if (ResizeOldPLAB && CMSOldPLABResizeQuicker) { + size_t multiple = _num_blocks[word_sz]/(CMSOldPLABToleranceFactor*CMSOldPLABNumRefills*n_blks); + n_blks += CMSOldPLABReactivityFactor*multiple*n_blks; + n_blks = MIN2(n_blks, CMSOldPLABMax); + } + assert(n_blks > 0, "Error"); + _cfls->par_get_chunk_of_blocks(word_sz, n_blks, fl); + // Update stats table entry for this block size + _num_blocks[word_sz] += fl->count(); +} + +void CFLS_LAB::compute_desired_plab_size() { + for (size_t i = CompactibleFreeListSpace::IndexSetStart; i < CompactibleFreeListSpace::IndexSetSize; i += CompactibleFreeListSpace::IndexSetStride) { - if (_indexedFreeList[i].count() > 0) { - MutexLockerEx x(_cfls->_indexedFreeListParLocks[i], - Mutex::_no_safepoint_check_flag); - _cfls->_indexedFreeList[i].prepend(&_indexedFreeList[i]); - // Reset this list. - _indexedFreeList[i] = FreeList(); - _indexedFreeList[i].set_size(i); + assert((_global_num_workers[i] == 0) == (_global_num_blocks[i] == 0), + "Counter inconsistency"); + if (_global_num_workers[i] > 0) { + // Need to smooth wrt historical average + if (ResizeOldPLAB) { + _blocks_to_claim[i].sample( + MAX2((size_t)CMSOldPLABMin, + MIN2((size_t)CMSOldPLABMax, + _global_num_blocks[i]/(_global_num_workers[i]*CMSOldPLABNumRefills)))); + } + // Reset counters for next round + _global_num_workers[i] = 0; + _global_num_blocks[i] = 0; + if (PrintOldPLAB) { + gclog_or_tty->print_cr("[%d]: %d", i, (size_t)_blocks_to_claim[i].average()); + } } } } -void -CompactibleFreeListSpace:: -par_get_chunk_of_blocks(size_t word_sz, size_t n, FreeList* fl) { +void CFLS_LAB::retire(int tid) { + // We run this single threaded with the world stopped; + // so no need for locks and such. +#define CFLS_LAB_PARALLEL_ACCESS 0 + NOT_PRODUCT(Thread* t = Thread::current();) + assert(Thread::current()->is_VM_thread(), "Error"); + assert(CompactibleFreeListSpace::IndexSetStart == CompactibleFreeListSpace::IndexSetStride, + "Will access to uninitialized slot below"); +#if CFLS_LAB_PARALLEL_ACCESS + for (size_t i = CompactibleFreeListSpace::IndexSetSize - 1; + i > 0; + i -= CompactibleFreeListSpace::IndexSetStride) { +#else // CFLS_LAB_PARALLEL_ACCESS + for (size_t i = CompactibleFreeListSpace::IndexSetStart; + i < CompactibleFreeListSpace::IndexSetSize; + i += CompactibleFreeListSpace::IndexSetStride) { +#endif // !CFLS_LAB_PARALLEL_ACCESS + assert(_num_blocks[i] >= (size_t)_indexedFreeList[i].count(), + "Can't retire more than what we obtained"); + if (_num_blocks[i] > 0) { + size_t num_retire = _indexedFreeList[i].count(); + assert(_num_blocks[i] > num_retire, "Should have used at least one"); + { +#if CFLS_LAB_PARALLEL_ACCESS + MutexLockerEx x(_cfls->_indexedFreeListParLocks[i], + Mutex::_no_safepoint_check_flag); +#endif // CFLS_LAB_PARALLEL_ACCESS + // Update globals stats for num_blocks used + _global_num_blocks[i] += (_num_blocks[i] - num_retire); + _global_num_workers[i]++; + assert(_global_num_workers[i] <= (ssize_t)ParallelGCThreads, "Too big"); + if (num_retire > 0) { + _cfls->_indexedFreeList[i].prepend(&_indexedFreeList[i]); + // Reset this list. + _indexedFreeList[i] = FreeList(); + _indexedFreeList[i].set_size(i); + } + } + if (PrintOldPLAB) { + gclog_or_tty->print_cr("%d[%d]: %d/%d/%d", + tid, i, num_retire, _num_blocks[i], (size_t)_blocks_to_claim[i].average()); + } + // Reset stats for next round + _num_blocks[i] = 0; + } + } +} + +void CompactibleFreeListSpace:: par_get_chunk_of_blocks(size_t word_sz, size_t n, FreeList* fl) { assert(fl->count() == 0, "Precondition."); assert(word_sz < CompactibleFreeListSpace::IndexSetSize, "Precondition"); - // We'll try all multiples of word_sz in the indexed set (starting with - // word_sz itself), then try getting a big chunk and splitting it. - int k = 1; - size_t cur_sz = k * word_sz; - bool found = false; - while (cur_sz < CompactibleFreeListSpace::IndexSetSize && k == 1) { - FreeList* gfl = &_indexedFreeList[cur_sz]; - FreeList fl_for_cur_sz; // Empty. - fl_for_cur_sz.set_size(cur_sz); - { - MutexLockerEx x(_indexedFreeListParLocks[cur_sz], - Mutex::_no_safepoint_check_flag); - if (gfl->count() != 0) { - size_t nn = MAX2(n/k, (size_t)1); - gfl->getFirstNChunksFromList(nn, &fl_for_cur_sz); - found = true; - } - } - // Now transfer fl_for_cur_sz to fl. Common case, we hope, is k = 1. - if (found) { - if (k == 1) { - fl->prepend(&fl_for_cur_sz); - } else { - // Divide each block on fl_for_cur_sz up k ways. - FreeChunk* fc; - while ((fc = fl_for_cur_sz.getChunkAtHead()) != NULL) { - // Must do this in reverse order, so that anybody attempting to - // access the main chunk sees it as a single free block until we - // change it. - size_t fc_size = fc->size(); - for (int i = k-1; i >= 0; i--) { - FreeChunk* ffc = (FreeChunk*)((HeapWord*)fc + i * word_sz); - ffc->setSize(word_sz); - ffc->linkNext(NULL); - ffc->linkPrev(NULL); // Mark as a free block for other (parallel) GC threads. - // Above must occur before BOT is updated below. - // splitting from the right, fc_size == (k - i + 1) * wordsize - _bt.mark_block((HeapWord*)ffc, word_sz); - fc_size -= word_sz; - _bt.verify_not_unallocated((HeapWord*)ffc, ffc->size()); - _bt.verify_single_block((HeapWord*)fc, fc_size); - _bt.verify_single_block((HeapWord*)ffc, ffc->size()); - // Push this on "fl". - fl->returnChunkAtHead(ffc); + // We'll try all multiples of word_sz in the indexed set, starting with + // word_sz itself and, if CMSSplitIndexedFreeListBlocks, try larger multiples, + // then try getting a big chunk and splitting it. + { + bool found; + int k; + size_t cur_sz; + for (k = 1, cur_sz = k * word_sz, found = false; + (cur_sz < CompactibleFreeListSpace::IndexSetSize) && + (CMSSplitIndexedFreeListBlocks || k <= 1); + k++, cur_sz = k * word_sz) { + FreeList* gfl = &_indexedFreeList[cur_sz]; + FreeList fl_for_cur_sz; // Empty. + fl_for_cur_sz.set_size(cur_sz); + { + MutexLockerEx x(_indexedFreeListParLocks[cur_sz], + Mutex::_no_safepoint_check_flag); + if (gfl->count() != 0) { + // nn is the number of chunks of size cur_sz that + // we'd need to split k-ways each, in order to create + // "n" chunks of size word_sz each. + const size_t nn = MAX2(n/k, (size_t)1); + gfl->getFirstNChunksFromList(nn, &fl_for_cur_sz); + found = true; + if (k > 1) { + // Update split death stats for the cur_sz-size blocks list: + // we increment the split death count by the number of blocks + // we just took from the cur_sz-size blocks list and which + // we will be splitting below. + ssize_t deaths = _indexedFreeList[cur_sz].splitDeaths() + + fl_for_cur_sz.count(); + _indexedFreeList[cur_sz].set_splitDeaths(deaths); } - // TRAP - assert(fl->tail()->next() == NULL, "List invariant."); } } - return; + // Now transfer fl_for_cur_sz to fl. Common case, we hope, is k = 1. + if (found) { + if (k == 1) { + fl->prepend(&fl_for_cur_sz); + } else { + // Divide each block on fl_for_cur_sz up k ways. + FreeChunk* fc; + while ((fc = fl_for_cur_sz.getChunkAtHead()) != NULL) { + // Must do this in reverse order, so that anybody attempting to + // access the main chunk sees it as a single free block until we + // change it. + size_t fc_size = fc->size(); + for (int i = k-1; i >= 0; i--) { + FreeChunk* ffc = (FreeChunk*)((HeapWord*)fc + i * word_sz); + ffc->setSize(word_sz); + ffc->linkNext(NULL); + ffc->linkPrev(NULL); // Mark as a free block for other (parallel) GC threads. + // Above must occur before BOT is updated below. + // splitting from the right, fc_size == (k - i + 1) * wordsize + _bt.mark_block((HeapWord*)ffc, word_sz); + fc_size -= word_sz; + _bt.verify_not_unallocated((HeapWord*)ffc, ffc->size()); + _bt.verify_single_block((HeapWord*)fc, fc_size); + _bt.verify_single_block((HeapWord*)ffc, ffc->size()); + // Push this on "fl". + fl->returnChunkAtHead(ffc); + } + // TRAP + assert(fl->tail()->next() == NULL, "List invariant."); + } + } + // Update birth stats for this block size. + size_t num = fl->count(); + MutexLockerEx x(_indexedFreeListParLocks[word_sz], + Mutex::_no_safepoint_check_flag); + ssize_t births = _indexedFreeList[word_sz].splitBirths() + num; + _indexedFreeList[word_sz].set_splitBirths(births); + return; + } } - k++; cur_sz = k * word_sz; } // Otherwise, we'll split a block from the dictionary. FreeChunk* fc = NULL; @@ -2723,17 +3065,31 @@ par_get_chunk_of_blocks(size_t word_sz, size_t n, FreeList* fl) { } } if (fc == NULL) return; + assert((ssize_t)n >= 1, "Control point invariant"); // Otherwise, split up that block. - size_t nn = fc->size() / word_sz; + const size_t nn = fc->size() / word_sz; n = MIN2(nn, n); + assert((ssize_t)n >= 1, "Control point invariant"); rem = fc->size() - n * word_sz; // If there is a remainder, and it's too small, allocate one fewer. if (rem > 0 && rem < MinChunkSize) { n--; rem += word_sz; } + // Note that at this point we may have n == 0. + assert((ssize_t)n >= 0, "Control point invariant"); + + // If n is 0, the chunk fc that was found is not large + // enough to leave a viable remainder. We are unable to + // allocate even one block. Return fc to the + // dictionary and return, leaving "fl" empty. + if (n == 0) { + returnChunkToDictionary(fc); + return; + } + // First return the remainder, if any. // Note that we hold the lock until we decide if we're going to give - // back the remainder to the dictionary, since a contending allocator + // back the remainder to the dictionary, since a concurrent allocation // may otherwise see the heap as empty. (We're willing to take that // hit if the block is a small block.) if (rem > 0) { @@ -2743,18 +3099,16 @@ par_get_chunk_of_blocks(size_t word_sz, size_t n, FreeList* fl) { rem_fc->linkNext(NULL); rem_fc->linkPrev(NULL); // Mark as a free block for other (parallel) GC threads. // Above must occur before BOT is updated below. + assert((ssize_t)n > 0 && prefix_size > 0 && rem_fc > fc, "Error"); _bt.split_block((HeapWord*)fc, fc->size(), prefix_size); if (rem >= IndexSetSize) { returnChunkToDictionary(rem_fc); - dictionary()->dictCensusUpdate(fc->size(), - true /*split*/, - true /*birth*/); + dictionary()->dictCensusUpdate(rem, true /*split*/, true /*birth*/); rem_fc = NULL; } // Otherwise, return it to the small list below. } } - // if (rem_fc != NULL) { MutexLockerEx x(_indexedFreeListParLocks[rem], Mutex::_no_safepoint_check_flag); @@ -2762,7 +3116,7 @@ par_get_chunk_of_blocks(size_t word_sz, size_t n, FreeList* fl) { _indexedFreeList[rem].returnChunkAtHead(rem_fc); smallSplitBirth(rem); } - + assert((ssize_t)n > 0 && fc != NULL, "Consistency"); // Now do the splitting up. // Must do this in reverse order, so that anybody attempting to // access the main chunk sees it as a single free block until we @@ -2792,13 +3146,15 @@ par_get_chunk_of_blocks(size_t word_sz, size_t n, FreeList* fl) { _bt.verify_single_block((HeapWord*)fc, fc->size()); fl->returnChunkAtHead(fc); + assert((ssize_t)n > 0 && (ssize_t)n == fl->count(), "Incorrect number of blocks"); { + // Update the stats for this block size. MutexLockerEx x(_indexedFreeListParLocks[word_sz], Mutex::_no_safepoint_check_flag); - ssize_t new_births = _indexedFreeList[word_sz].splitBirths() + n; - _indexedFreeList[word_sz].set_splitBirths(new_births); - ssize_t new_surplus = _indexedFreeList[word_sz].surplus() + n; - _indexedFreeList[word_sz].set_surplus(new_surplus); + const ssize_t births = _indexedFreeList[word_sz].splitBirths() + n; + _indexedFreeList[word_sz].set_splitBirths(births); + // ssize_t new_surplus = _indexedFreeList[word_sz].surplus() + n; + // _indexedFreeList[word_sz].set_surplus(new_surplus); } // TRAP diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp index 9f16f8d2eb0..d937de86156 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp @@ -25,8 +25,6 @@ // Classes in support of keeping track of promotions into a non-Contiguous // space, in this case a CompactibleFreeListSpace. -#define CFLS_LAB_REFILL_STATS 0 - // Forward declarations class CompactibleFreeListSpace; class BlkClosure; @@ -89,6 +87,9 @@ class SpoolBlock: public FreeChunk { displacedHdr = (markOop*)&displacedHdr; nextSpoolBlock = NULL; } + + void print_on(outputStream* st) const; + void print() const { print_on(gclog_or_tty); } }; class PromotionInfo VALUE_OBJ_CLASS_SPEC { @@ -121,7 +122,7 @@ class PromotionInfo VALUE_OBJ_CLASS_SPEC { return _promoHead == NULL; } void startTrackingPromotions(); - void stopTrackingPromotions(); + void stopTrackingPromotions(uint worker_id = 0); bool tracking() const { return _tracking; } void track(PromotedObject* trackOop); // keep track of a promoted oop // The following variant must be used when trackOop is not fully @@ -161,6 +162,9 @@ class PromotionInfo VALUE_OBJ_CLASS_SPEC { _nextIndex = 0; } + + void print_on(outputStream* st) const; + void print_statistics(uint worker_id) const; }; class LinearAllocBlock VALUE_OBJ_CLASS_SPEC { @@ -243,6 +247,7 @@ class CompactibleFreeListSpace: public CompactibleSpace { mutable Mutex _freelistLock; // locking verifier convenience function void assert_locked() const PRODUCT_RETURN; + void assert_locked(const Mutex* lock) const PRODUCT_RETURN; // Linear allocation blocks LinearAllocBlock _smallLinearAllocBlock; @@ -281,13 +286,6 @@ class CompactibleFreeListSpace: public CompactibleSpace { // Locks protecting the exact lists during par promotion allocation. Mutex* _indexedFreeListParLocks[IndexSetSize]; -#if CFLS_LAB_REFILL_STATS - // Some statistics. - jint _par_get_chunk_from_small; - jint _par_get_chunk_from_large; -#endif - - // Attempt to obtain up to "n" blocks of the size "word_sz" (which is // required to be smaller than "IndexSetSize".) If successful, // adds them to "fl", which is required to be an empty free list. @@ -320,7 +318,7 @@ class CompactibleFreeListSpace: public CompactibleSpace { // Helper function for getChunkFromIndexedFreeList. // Replenish the indexed free list for this "size". Do not take from an // underpopulated size. - FreeChunk* getChunkFromIndexedFreeListHelper(size_t size); + FreeChunk* getChunkFromIndexedFreeListHelper(size_t size, bool replenish = true); // Get a chunk from the indexed free list. If the indexed free list // does not have a free chunk, try to replenish the indexed free list @@ -430,10 +428,6 @@ class CompactibleFreeListSpace: public CompactibleSpace { void initialize_sequential_subtasks_for_marking(int n_threads, HeapWord* low = NULL); -#if CFLS_LAB_REFILL_STATS - void print_par_alloc_stats(); -#endif - // Space enquiries size_t used() const; size_t free() const; @@ -617,6 +611,12 @@ class CompactibleFreeListSpace: public CompactibleSpace { // Do some basic checks on the the free lists. void checkFreeListConsistency() const PRODUCT_RETURN; + // Printing support + void dump_at_safepoint_with_locks(CMSCollector* c, outputStream* st); + void print_indexed_free_lists(outputStream* st) const; + void print_dictionary_free_lists(outputStream* st) const; + void print_promo_info_blocks(outputStream* st) const; + NOT_PRODUCT ( void initializeIndexedFreeListArrayReturnedBytes(); size_t sumIndexedFreeListArrayReturnedBytes(); @@ -638,8 +638,9 @@ class CompactibleFreeListSpace: public CompactibleSpace { // Statistics functions // Initialize census for lists before the sweep. - void beginSweepFLCensus(float sweep_current, - float sweep_estimate); + void beginSweepFLCensus(float inter_sweep_current, + float inter_sweep_estimate, + float intra_sweep_estimate); // Set the surplus for each of the free lists. void setFLSurplus(); // Set the hint for each of the free lists. @@ -730,16 +731,17 @@ class CFLS_LAB : public CHeapObj { FreeList _indexedFreeList[CompactibleFreeListSpace::IndexSetSize]; // Initialized from a command-line arg. - size_t _blocks_to_claim; -#if CFLS_LAB_REFILL_STATS - // Some statistics. - int _refills; - int _blocksTaken; - static int _tot_refills; - static int _tot_blocksTaken; - static int _next_threshold; -#endif + // Allocation statistics in support of dynamic adjustment of + // #blocks to claim per get_from_global_pool() call below. + static AdaptiveWeightedAverage + _blocks_to_claim [CompactibleFreeListSpace::IndexSetSize]; + static size_t _global_num_blocks [CompactibleFreeListSpace::IndexSetSize]; + static int _global_num_workers[CompactibleFreeListSpace::IndexSetSize]; + size_t _num_blocks [CompactibleFreeListSpace::IndexSetSize]; + + // Internal work method + void get_from_global_pool(size_t word_sz, FreeList* fl); public: CFLS_LAB(CompactibleFreeListSpace* cfls); @@ -748,7 +750,12 @@ public: HeapWord* alloc(size_t word_sz); // Return any unused portions of the buffer to the global pool. - void retire(); + void retire(int tid); + + // Dynamic OldPLABSize sizing + static void compute_desired_plab_size(); + // When the settings are modified from default static initialization + static void modify_initialization(size_t n, unsigned wt); }; size_t PromotionInfo::refillSize() const { diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp index c3d30c348b2..7cc33d105a4 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp @@ -253,7 +253,6 @@ void ConcurrentMarkSweepGeneration::init_initiating_occupancy(intx io, intx tr) } } - void ConcurrentMarkSweepGeneration::ref_processor_init() { assert(collector() != NULL, "no collector"); collector()->ref_processor_init(); @@ -341,6 +340,14 @@ CMSStats::CMSStats(ConcurrentMarkSweepGeneration* cms_gen, unsigned int alpha): _icms_duty_cycle = CMSIncrementalDutyCycle; } +double CMSStats::cms_free_adjustment_factor(size_t free) const { + // TBD: CR 6909490 + return 1.0; +} + +void CMSStats::adjust_cms_free_adjustment_factor(bool fail, size_t free) { +} + // If promotion failure handling is on use // the padded average size of the promotion for each // young generation collection. @@ -361,7 +368,11 @@ double CMSStats::time_until_cms_gen_full() const { // Adjust by the safety factor. double cms_free_dbl = (double)cms_free; - cms_free_dbl = cms_free_dbl * (100.0 - CMSIncrementalSafetyFactor) / 100.0; + double cms_adjustment = (100.0 - CMSIncrementalSafetyFactor)/100.0; + // Apply a further correction factor which tries to adjust + // for recent occurance of concurrent mode failures. + cms_adjustment = cms_adjustment * cms_free_adjustment_factor(cms_free); + cms_free_dbl = cms_free_dbl * cms_adjustment; if (PrintGCDetails && Verbose) { gclog_or_tty->print_cr("CMSStats::time_until_cms_gen_full: cms_free " @@ -395,6 +406,8 @@ double CMSStats::time_until_cms_start() const { // late. double work = cms_duration() + gc0_period(); double deadline = time_until_cms_gen_full(); + // If a concurrent mode failure occurred recently, we want to be + // more conservative and halve our expected time_until_cms_gen_full() if (work > deadline) { if (Verbose && PrintGCDetails) { gclog_or_tty->print( @@ -556,7 +569,8 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen, _should_unload_classes(false), _concurrent_cycles_since_last_unload(0), _roots_scanning_options(0), - _sweep_estimate(CMS_SweepWeight, CMS_SweepPadding) + _inter_sweep_estimate(CMS_SweepWeight, CMS_SweepPadding), + _intra_sweep_estimate(CMS_SweepWeight, CMS_SweepPadding) { if (ExplicitGCInvokesConcurrentAndUnloadsClasses) { ExplicitGCInvokesConcurrent = true; @@ -709,7 +723,8 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen, // Support for parallelizing survivor space rescan if (CMSParallelRemarkEnabled && CMSParallelSurvivorRemarkEnabled) { - size_t max_plab_samples = MaxNewSize/((SurvivorRatio+2)*MinTLABSize); + size_t max_plab_samples = cp->max_gen0_size()/ + ((SurvivorRatio+2)*MinTLABSize); _survivor_plab_array = NEW_C_HEAP_ARRAY(ChunkArray, ParallelGCThreads); _survivor_chunk_array = NEW_C_HEAP_ARRAY(HeapWord*, 2*max_plab_samples); _cursor = NEW_C_HEAP_ARRAY(size_t, ParallelGCThreads); @@ -772,7 +787,7 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen, NOT_PRODUCT(_overflow_counter = CMSMarkStackOverflowInterval;) _gc_counters = new CollectorCounters("CMS", 1); _completed_initialization = true; - _sweep_timer.start(); // start of time + _inter_sweep_timer.start(); // start of time } const char* ConcurrentMarkSweepGeneration::name() const { @@ -899,6 +914,14 @@ bool ConcurrentMarkSweepGeneration::promotion_attempt_is_safe( return result; } +// At a promotion failure dump information on block layout in heap +// (cms old generation). +void ConcurrentMarkSweepGeneration::promotion_failure_occurred() { + if (CMSDumpAtPromotionFailure) { + cmsSpace()->dump_at_safepoint_with_locks(collector(), gclog_or_tty); + } +} + CompactibleSpace* ConcurrentMarkSweepGeneration::first_compaction_space() const { return _cmsSpace; @@ -1367,12 +1390,7 @@ void ConcurrentMarkSweepGeneration:: par_promote_alloc_done(int thread_num) { CMSParGCThreadState* ps = _par_gc_thread_states[thread_num]; - ps->lab.retire(); -#if CFLS_LAB_REFILL_STATS - if (thread_num == 0) { - _cmsSpace->print_par_alloc_stats(); - } -#endif + ps->lab.retire(thread_num); } void @@ -1973,11 +1991,14 @@ void CMSCollector::do_compaction_work(bool clear_all_soft_refs) { // We must adjust the allocation statistics being maintained // in the free list space. We do so by reading and clearing // the sweep timer and updating the block flux rate estimates below. - assert(_sweep_timer.is_active(), "We should never see the timer inactive"); - _sweep_timer.stop(); - // Note that we do not use this sample to update the _sweep_estimate. - _cmsGen->cmsSpace()->beginSweepFLCensus((float)(_sweep_timer.seconds()), - _sweep_estimate.padded_average()); + assert(!_intra_sweep_timer.is_active(), "_intra_sweep_timer should be inactive"); + if (_inter_sweep_timer.is_active()) { + _inter_sweep_timer.stop(); + // Note that we do not use this sample to update the _inter_sweep_estimate. + _cmsGen->cmsSpace()->beginSweepFLCensus((float)(_inter_sweep_timer.seconds()), + _inter_sweep_estimate.padded_average(), + _intra_sweep_estimate.padded_average()); + } GenMarkSweep::invoke_at_safepoint(_cmsGen->level(), ref_processor(), clear_all_soft_refs); @@ -2014,10 +2035,10 @@ void CMSCollector::do_compaction_work(bool clear_all_soft_refs) { } // Adjust the per-size allocation stats for the next epoch. - _cmsGen->cmsSpace()->endSweepFLCensus(sweepCount() /* fake */); - // Restart the "sweep timer" for next epoch. - _sweep_timer.reset(); - _sweep_timer.start(); + _cmsGen->cmsSpace()->endSweepFLCensus(sweep_count() /* fake */); + // Restart the "inter sweep timer" for the next epoch. + _inter_sweep_timer.reset(); + _inter_sweep_timer.start(); // Sample collection pause time and reset for collection interval. if (UseAdaptiveSizePolicy) { @@ -2675,7 +2696,7 @@ void ConcurrentMarkSweepGeneration::gc_epilogue(bool full) { // Also reset promotion tracking in par gc thread states. if (ParallelGCThreads > 0) { for (uint i = 0; i < ParallelGCThreads; i++) { - _par_gc_thread_states[i]->promo.stopTrackingPromotions(); + _par_gc_thread_states[i]->promo.stopTrackingPromotions(i); } } } @@ -2770,7 +2791,7 @@ class VerifyMarkedClosure: public BitMapClosure { bool do_bit(size_t offset) { HeapWord* addr = _marks->offsetToHeapWord(offset); if (!_marks->isMarked(addr)) { - oop(addr)->print(); + oop(addr)->print_on(gclog_or_tty); gclog_or_tty->print_cr(" ("INTPTR_FORMAT" should have been marked)", addr); _failed = true; } @@ -2819,7 +2840,7 @@ bool CMSCollector::verify_after_remark() { // Clear any marks from a previous round verification_mark_bm()->clear_all(); assert(verification_mark_stack()->isEmpty(), "markStack should be empty"); - assert(overflow_list_is_empty(), "overflow list should be empty"); + verify_work_stacks_empty(); GenCollectedHeap* gch = GenCollectedHeap::heap(); gch->ensure_parsability(false); // fill TLABs, but no need to retire them @@ -2892,8 +2913,8 @@ void CMSCollector::verify_after_remark_work_1() { verification_mark_bm()->iterate(&vcl); if (vcl.failed()) { gclog_or_tty->print("Verification failed"); - Universe::heap()->print(); - fatal(" ... aborting"); + Universe::heap()->print_on(gclog_or_tty); + fatal("CMS: failed marking verification after remark"); } } @@ -3313,7 +3334,7 @@ bool ConcurrentMarkSweepGeneration::grow_by(size_t bytes) { Universe::heap()->barrier_set()->resize_covered_region(mr); // Hmmmm... why doesn't CFLS::set_end verify locking? // This is quite ugly; FIX ME XXX - _cmsSpace->assert_locked(); + _cmsSpace->assert_locked(freelistLock()); _cmsSpace->set_end((HeapWord*)_virtual_space.high()); // update the space and generation capacity counters @@ -3634,9 +3655,7 @@ bool CMSCollector::markFromRootsWork(bool asynch) { verify_work_stacks_empty(); verify_overflow_empty(); assert(_revisitStack.isEmpty(), "tabula rasa"); - - DEBUG_ONLY(RememberKlassesChecker cmx(CMSClassUnloadingEnabled);) - + DEBUG_ONLY(RememberKlassesChecker cmx(should_unload_classes());) bool result = false; if (CMSConcurrentMTEnabled && ParallelCMSThreads > 0) { result = do_marking_mt(asynch); @@ -4103,7 +4122,6 @@ void CMSConcMarkingTask::do_work_steal(int i) { void CMSConcMarkingTask::coordinator_yield() { assert(ConcurrentMarkSweepThread::cms_thread_has_cms_token(), "CMS thread should hold CMS token"); - DEBUG_ONLY(RememberKlassesChecker mux(false);) // First give up the locks, then yield, then re-lock // We should probably use a constructor/destructor idiom to @@ -4180,9 +4198,7 @@ bool CMSCollector::do_marking_mt(bool asynch) { // Mutate the Refs discovery so it is MT during the // multi-threaded marking phase. ReferenceProcessorMTMutator mt(ref_processor(), num_workers > 1); - - DEBUG_ONLY(RememberKlassesChecker cmx(CMSClassUnloadingEnabled);) - + DEBUG_ONLY(RememberKlassesChecker cmx(should_unload_classes());) conc_workers()->start_task(&tsk); while (tsk.yielded()) { tsk.coordinator_yield(); @@ -4451,7 +4467,7 @@ size_t CMSCollector::preclean_work(bool clean_refs, bool clean_survivor) { // for cleaner interfaces. rp->preclean_discovered_references( rp->is_alive_non_header(), &keep_alive, &complete_trace, - &yield_cl); + &yield_cl, should_unload_classes()); } if (clean_survivor) { // preclean the active survivor space(s) @@ -4473,7 +4489,7 @@ size_t CMSCollector::preclean_work(bool clean_refs, bool clean_survivor) { SurvivorSpacePrecleanClosure sss_cl(this, _span, &_markBitMap, &_markStack, &pam_cl, before_count, CMSYield); - DEBUG_ONLY(RememberKlassesChecker mx(CMSClassUnloadingEnabled);) + DEBUG_ONLY(RememberKlassesChecker mx(should_unload_classes());) dng->from()->object_iterate_careful(&sss_cl); dng->to()->object_iterate_careful(&sss_cl); } @@ -4644,7 +4660,7 @@ size_t CMSCollector::preclean_mod_union_table( verify_work_stacks_empty(); verify_overflow_empty(); sample_eden(); - DEBUG_ONLY(RememberKlassesChecker mx(CMSClassUnloadingEnabled);) + DEBUG_ONLY(RememberKlassesChecker mx(should_unload_classes());) stop_point = gen->cmsSpace()->object_iterate_careful_m(dirtyRegion, cl); } @@ -4732,7 +4748,7 @@ size_t CMSCollector::preclean_card_table(ConcurrentMarkSweepGeneration* gen, sample_eden(); verify_work_stacks_empty(); verify_overflow_empty(); - DEBUG_ONLY(RememberKlassesChecker mx(CMSClassUnloadingEnabled);) + DEBUG_ONLY(RememberKlassesChecker mx(should_unload_classes());) HeapWord* stop_point = gen->cmsSpace()->object_iterate_careful_m(dirtyRegion, cl); if (stop_point != NULL) { @@ -4832,7 +4848,7 @@ void CMSCollector::checkpointRootsFinalWork(bool asynch, assert(haveFreelistLocks(), "must have free list locks"); assert_lock_strong(bitMapLock()); - DEBUG_ONLY(RememberKlassesChecker fmx(CMSClassUnloadingEnabled);) + DEBUG_ONLY(RememberKlassesChecker fmx(should_unload_classes());) if (!init_mark_was_synchronous) { // We might assume that we need not fill TLAB's when // CMSScavengeBeforeRemark is set, because we may have just done @@ -5867,9 +5883,9 @@ void CMSCollector::sweep(bool asynch) { check_correct_thread_executing(); verify_work_stacks_empty(); verify_overflow_empty(); - incrementSweepCount(); - _sweep_timer.stop(); - _sweep_estimate.sample(_sweep_timer.seconds()); + increment_sweep_count(); + _inter_sweep_timer.stop(); + _inter_sweep_estimate.sample(_inter_sweep_timer.seconds()); size_policy()->avg_cms_free_at_sweep()->sample(_cmsGen->free()); // PermGen verification support: If perm gen sweeping is disabled in @@ -5892,6 +5908,9 @@ void CMSCollector::sweep(bool asynch) { } } + assert(!_intra_sweep_timer.is_active(), "Should not be active"); + _intra_sweep_timer.reset(); + _intra_sweep_timer.start(); if (asynch) { TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); CMSPhaseAccounting pa(this, "sweep", !PrintGCDetails); @@ -5936,8 +5955,11 @@ void CMSCollector::sweep(bool asynch) { verify_work_stacks_empty(); verify_overflow_empty(); - _sweep_timer.reset(); - _sweep_timer.start(); + _intra_sweep_timer.stop(); + _intra_sweep_estimate.sample(_intra_sweep_timer.seconds()); + + _inter_sweep_timer.reset(); + _inter_sweep_timer.start(); update_time_of_last_gc(os::javaTimeMillis()); @@ -5980,11 +6002,11 @@ void CMSCollector::sweep(bool asynch) { // FIX ME!!! Looks like this belongs in CFLSpace, with // CMSGen merely delegating to it. void ConcurrentMarkSweepGeneration::setNearLargestChunk() { - double nearLargestPercent = 0.999; + double nearLargestPercent = FLSLargestBlockCoalesceProximity; HeapWord* minAddr = _cmsSpace->bottom(); HeapWord* largestAddr = (HeapWord*) _cmsSpace->dictionary()->findLargestDict(); - if (largestAddr == 0) { + if (largestAddr == NULL) { // The dictionary appears to be empty. In this case // try to coalesce at the end of the heap. largestAddr = _cmsSpace->end(); @@ -5992,6 +6014,13 @@ void ConcurrentMarkSweepGeneration::setNearLargestChunk() { size_t largestOffset = pointer_delta(largestAddr, minAddr); size_t nearLargestOffset = (size_t)((double)largestOffset * nearLargestPercent) - MinChunkSize; + if (PrintFLSStatistics != 0) { + gclog_or_tty->print_cr( + "CMS: Large Block: " PTR_FORMAT ";" + " Proximity: " PTR_FORMAT " -> " PTR_FORMAT, + largestAddr, + _cmsSpace->nearLargestChunk(), minAddr + nearLargestOffset); + } _cmsSpace->set_nearLargestChunk(minAddr + nearLargestOffset); } @@ -6071,9 +6100,11 @@ void CMSCollector::sweepWork(ConcurrentMarkSweepGeneration* gen, assert_lock_strong(gen->freelistLock()); assert_lock_strong(bitMapLock()); - assert(!_sweep_timer.is_active(), "Was switched off in an outer context"); - gen->cmsSpace()->beginSweepFLCensus((float)(_sweep_timer.seconds()), - _sweep_estimate.padded_average()); + assert(!_inter_sweep_timer.is_active(), "Was switched off in an outer context"); + assert(_intra_sweep_timer.is_active(), "Was switched on in an outer context"); + gen->cmsSpace()->beginSweepFLCensus((float)(_inter_sweep_timer.seconds()), + _inter_sweep_estimate.padded_average(), + _intra_sweep_estimate.padded_average()); gen->setNearLargestChunk(); { @@ -6086,7 +6117,7 @@ void CMSCollector::sweepWork(ConcurrentMarkSweepGeneration* gen, // end-of-sweep-census below will be off by a little bit. } gen->cmsSpace()->sweep_completed(); - gen->cmsSpace()->endSweepFLCensus(sweepCount()); + gen->cmsSpace()->endSweepFLCensus(sweep_count()); if (should_unload_classes()) { // unloaded classes this cycle, _concurrent_cycles_since_last_unload = 0; // ... reset count } else { // did not unload classes, diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp index a58217faf93..18164a58b4e 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp @@ -355,6 +355,11 @@ class CMSStats VALUE_OBJ_CLASS_SPEC { unsigned int new_duty_cycle); unsigned int icms_update_duty_cycle_impl(); + // In support of adjusting of cms trigger ratios based on history + // of concurrent mode failure. + double cms_free_adjustment_factor(size_t free) const; + void adjust_cms_free_adjustment_factor(bool fail, size_t free); + public: CMSStats(ConcurrentMarkSweepGeneration* cms_gen, unsigned int alpha = CMSExpAvgFactor); @@ -570,8 +575,11 @@ class CMSCollector: public CHeapObj { // appropriately. void check_gc_time_limit(); // XXX Move these to CMSStats ??? FIX ME !!! - elapsedTimer _sweep_timer; - AdaptivePaddedAverage _sweep_estimate; + elapsedTimer _inter_sweep_timer; // time between sweeps + elapsedTimer _intra_sweep_timer; // time _in_ sweeps + // padded decaying average estimates of the above + AdaptivePaddedAverage _inter_sweep_estimate; + AdaptivePaddedAverage _intra_sweep_estimate; protected: ConcurrentMarkSweepGeneration* _cmsGen; // old gen (CMS) @@ -625,6 +633,7 @@ class CMSCollector: public CHeapObj { // . _collectorState <= Idling == post-sweep && pre-mark // . _collectorState in (Idling, Sweeping) == {initial,final}marking || // precleaning || abortablePrecleanb + public: enum CollectorState { Resizing = 0, Resetting = 1, @@ -636,6 +645,7 @@ class CMSCollector: public CHeapObj { FinalMarking = 7, Sweeping = 8 }; + protected: static CollectorState _collectorState; // State related to prologue/epilogue invocation for my generations @@ -655,7 +665,7 @@ class CMSCollector: public CHeapObj { int _numYields; size_t _numDirtyCards; - uint _sweepCount; + size_t _sweep_count; // number of full gc's since the last concurrent gc. uint _full_gcs_since_conc_gc; @@ -905,7 +915,7 @@ class CMSCollector: public CHeapObj { // Check that the currently executing thread is the expected // one (foreground collector or background collector). - void check_correct_thread_executing() PRODUCT_RETURN; + static void check_correct_thread_executing() PRODUCT_RETURN; // XXXPERM void print_statistics() PRODUCT_RETURN; bool is_cms_reachable(HeapWord* addr); @@ -930,8 +940,8 @@ class CMSCollector: public CHeapObj { static void set_foregroundGCShouldWait(bool v) { _foregroundGCShouldWait = v; } static bool foregroundGCIsActive() { return _foregroundGCIsActive; } static void set_foregroundGCIsActive(bool v) { _foregroundGCIsActive = v; } - uint sweepCount() const { return _sweepCount; } - void incrementSweepCount() { _sweepCount++; } + size_t sweep_count() const { return _sweep_count; } + void increment_sweep_count() { _sweep_count++; } // Timers/stats for gc scheduling and incremental mode pacing. CMSStats& stats() { return _stats; } @@ -1165,6 +1175,11 @@ class ConcurrentMarkSweepGeneration: public CardGeneration { virtual bool promotion_attempt_is_safe(size_t promotion_in_bytes, bool younger_handles_promotion_failure) const; + // Inform this (non-young) generation that a promotion failure was + // encountered during a collection of a younger generation that + // promotes into this generation. + virtual void promotion_failure_occurred(); + bool should_collect(bool full, size_t size, bool tlab); virtual bool should_concurrent_collect() const; virtual bool is_too_full() const; diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp index 5f9c4f22632..1a454fe68f4 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp @@ -55,7 +55,8 @@ class FreeBlockDictionary: public CHeapObj { virtual void dictCensusUpdate(size_t size, bool split, bool birth) = 0; virtual bool coalDictOverPopulated(size_t size) = 0; virtual void beginSweepDictCensus(double coalSurplusPercent, - float sweep_current, float sweep_ewstimate) = 0; + float inter_sweep_current, float inter_sweep_estimate, + float intra__sweep_current) = 0; virtual void endSweepDictCensus(double splitSurplusPercent) = 0; virtual FreeChunk* findLargestDict() const = 0; // verify that the given chunk is in the dictionary. @@ -79,6 +80,7 @@ class FreeBlockDictionary: public CHeapObj { } virtual void printDictCensus() const = 0; + virtual void print_free_lists(outputStream* st) const = 0; virtual void verify() const = 0; diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp index 494c090c6fb..e709c3af6ca 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp @@ -67,3 +67,8 @@ void FreeChunk::verifyList() const { } } #endif + +void FreeChunk::print_on(outputStream* st) { + st->print_cr("Next: " PTR_FORMAT " Prev: " PTR_FORMAT " %s", + next(), prev(), cantCoalesce() ? "[can't coalesce]" : ""); +} diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp index 768614d7e2b..9e731e7ca35 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp @@ -129,6 +129,8 @@ class FreeChunk VALUE_OBJ_CLASS_SPEC { void verifyList() const PRODUCT_RETURN; void mangleAllocated(size_t size) PRODUCT_RETURN; void mangleFreed(size_t size) PRODUCT_RETURN; + + void print_on(outputStream* st); }; // Alignment helpers etc. diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.cpp index 79503deb81d..1ca1a4e5396 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.cpp @@ -81,8 +81,8 @@ void FreeList::reset(size_t hint) { set_hint(hint); } -void FreeList::init_statistics() { - _allocation_stats.initialize(); +void FreeList::init_statistics(bool split_birth) { + _allocation_stats.initialize(split_birth); } FreeChunk* FreeList::getChunkAtHead() { @@ -292,14 +292,31 @@ bool FreeList::verifyChunkInFreeLists(FreeChunk* fc) const { } #ifndef PRODUCT +void FreeList::verify_stats() const { + // The +1 of the LH comparand is to allow some "looseness" in + // checking: we usually call this interface when adding a block + // and we'll subsequently update the stats; we cannot update the + // stats beforehand because in the case of the large-block BT + // dictionary for example, this might be the first block and + // in that case there would be no place that we could record + // the stats (which are kept in the block itself). + assert(_allocation_stats.prevSweep() + _allocation_stats.splitBirths() + 1 // Total Stock + 1 + >= _allocation_stats.splitDeaths() + (ssize_t)count(), "Conservation Principle"); +} + void FreeList::assert_proper_lock_protection_work() const { -#ifdef ASSERT - if (_protecting_lock != NULL && - SharedHeap::heap()->n_par_threads() > 0) { - // Should become an assert. - guarantee(_protecting_lock->owned_by_self(), "FreeList RACE DETECTED"); + assert(_protecting_lock != NULL, "Don't call this directly"); + assert(ParallelGCThreads > 0, "Don't call this directly"); + Thread* thr = Thread::current(); + if (thr->is_VM_thread() || thr->is_ConcurrentGC_thread()) { + // assert that we are holding the freelist lock + } else if (thr->is_GC_task_thread()) { + assert(_protecting_lock->owned_by_self(), "FreeList RACE DETECTED"); + } else if (thr->is_Java_thread()) { + assert(!SafepointSynchronize::is_at_safepoint(), "Should not be executing"); + } else { + ShouldNotReachHere(); // unaccounted thread type? } -#endif } #endif diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp index 581317643c7..8dd1543ab64 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp @@ -35,18 +35,26 @@ class CompactibleFreeListSpace; // for that implementation. class Mutex; +class TreeList; class FreeList VALUE_OBJ_CLASS_SPEC { friend class CompactibleFreeListSpace; friend class VMStructs; - friend class printTreeCensusClosure; - FreeChunk* _head; // List of free chunks + friend class PrintTreeCensusClosure; + + protected: + TreeList* _parent; + TreeList* _left; + TreeList* _right; + + private: + FreeChunk* _head; // Head of list of free chunks FreeChunk* _tail; // Tail of list of free chunks - size_t _size; // Size in Heap words of each chunks + size_t _size; // Size in Heap words of each chunk ssize_t _count; // Number of entries in list size_t _hint; // next larger size list with a positive surplus - AllocationStats _allocation_stats; // statistics for smart allocation + AllocationStats _allocation_stats; // allocation-related statistics #ifdef ASSERT Mutex* _protecting_lock; @@ -63,9 +71,12 @@ class FreeList VALUE_OBJ_CLASS_SPEC { // Initialize the allocation statistics. protected: - void init_statistics(); + void init_statistics(bool split_birth = false); void set_count(ssize_t v) { _count = v;} - void increment_count() { _count++; } + void increment_count() { + _count++; + } + void decrement_count() { _count--; assert(_count >= 0, "Count should not be negative"); @@ -167,11 +178,13 @@ class FreeList VALUE_OBJ_CLASS_SPEC { _allocation_stats.set_desired(v); } void compute_desired(float inter_sweep_current, - float inter_sweep_estimate) { + float inter_sweep_estimate, + float intra_sweep_estimate) { assert_proper_lock_protection(); _allocation_stats.compute_desired(_count, inter_sweep_current, - inter_sweep_estimate); + inter_sweep_estimate, + intra_sweep_estimate); } ssize_t coalDesired() const { return _allocation_stats.coalDesired(); @@ -306,6 +319,9 @@ class FreeList VALUE_OBJ_CLASS_SPEC { // found. Return NULL if "fc" is not found. bool verifyChunkInFreeLists(FreeChunk* fc) const; + // Stats verification + void verify_stats() const PRODUCT_RETURN; + // Printing support static void print_labels_on(outputStream* st, const char* c); void print_on(outputStream* st, const char* c = NULL) const; diff --git a/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp b/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp index 3000f010b17..96760517637 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp @@ -351,9 +351,16 @@ void CollectionSetChooser::printSortedHeapRegions() { gclog_or_tty->print_cr("Printing %d Heap Regions sorted by amount of known garbage", _numMarkedRegions); + + DEBUG_ONLY(int marked_count = 0;) for (int i = 0; i < _markedRegions.length(); i++) { - printHeapRegion(_markedRegions.at(i)); + HeapRegion* r = _markedRegions.at(i); + if (r != NULL) { + printHeapRegion(r); + DEBUG_ONLY(marked_count++;) + } } + assert(marked_count == _numMarkedRegions, "must be"); gclog_or_tty->print_cr("Done sorted heap region print"); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp index 34939de57c7..79874f0df69 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp @@ -42,28 +42,49 @@ ConcurrentG1Refine::ConcurrentG1Refine() : _n_periods(0), _threads(NULL), _n_threads(0) { - if (G1ConcRefine) { - _n_threads = (int)thread_num(); - if (_n_threads > 0) { - _threads = NEW_C_HEAP_ARRAY(ConcurrentG1RefineThread*, _n_threads); - int worker_id_offset = (int)DirtyCardQueueSet::num_par_ids(); - ConcurrentG1RefineThread *next = NULL; - for (int i = _n_threads - 1; i >= 0; i--) { - ConcurrentG1RefineThread* t = new ConcurrentG1RefineThread(this, next, worker_id_offset, i); - assert(t != NULL, "Conc refine should have been created"); - assert(t->cg1r() == this, "Conc refine thread should refer to this"); - _threads[i] = t; - next = t; - } - } + + // Ergomonically select initial concurrent refinement parameters + if (FLAG_IS_DEFAULT(G1ConcRefineGreenZone)) { + FLAG_SET_DEFAULT(G1ConcRefineGreenZone, MAX2(ParallelGCThreads, 1)); + } + set_green_zone(G1ConcRefineGreenZone); + + if (FLAG_IS_DEFAULT(G1ConcRefineYellowZone)) { + FLAG_SET_DEFAULT(G1ConcRefineYellowZone, green_zone() * 3); + } + set_yellow_zone(MAX2(G1ConcRefineYellowZone, green_zone())); + + if (FLAG_IS_DEFAULT(G1ConcRefineRedZone)) { + FLAG_SET_DEFAULT(G1ConcRefineRedZone, yellow_zone() * 2); + } + set_red_zone(MAX2(G1ConcRefineRedZone, yellow_zone())); + _n_worker_threads = thread_num(); + // We need one extra thread to do the young gen rset size sampling. + _n_threads = _n_worker_threads + 1; + reset_threshold_step(); + + _threads = NEW_C_HEAP_ARRAY(ConcurrentG1RefineThread*, _n_threads); + int worker_id_offset = (int)DirtyCardQueueSet::num_par_ids(); + ConcurrentG1RefineThread *next = NULL; + for (int i = _n_threads - 1; i >= 0; i--) { + ConcurrentG1RefineThread* t = new ConcurrentG1RefineThread(this, next, worker_id_offset, i); + assert(t != NULL, "Conc refine should have been created"); + assert(t->cg1r() == this, "Conc refine thread should refer to this"); + _threads[i] = t; + next = t; } } -size_t ConcurrentG1Refine::thread_num() { - if (G1ConcRefine) { - return (G1ParallelRSetThreads > 0) ? G1ParallelRSetThreads : ParallelGCThreads; +void ConcurrentG1Refine::reset_threshold_step() { + if (FLAG_IS_DEFAULT(G1ConcRefineThresholdStep)) { + _thread_threshold_step = (yellow_zone() - green_zone()) / (worker_thread_num() + 1); + } else { + _thread_threshold_step = G1ConcRefineThresholdStep; } - return 0; +} + +int ConcurrentG1Refine::thread_num() { + return MAX2((G1ParallelRSetThreads > 0) ? G1ParallelRSetThreads : ParallelGCThreads, 1); } void ConcurrentG1Refine::init() { @@ -123,6 +144,15 @@ void ConcurrentG1Refine::stop() { } } +void ConcurrentG1Refine::reinitialize_threads() { + reset_threshold_step(); + if (_threads != NULL) { + for (int i = 0; i < _n_threads; i++) { + _threads[i]->initialize(); + } + } +} + ConcurrentG1Refine::~ConcurrentG1Refine() { if (G1ConcRSLogCacheSize > 0) { assert(_card_counts != NULL, "Logic"); @@ -270,7 +300,23 @@ jbyte* ConcurrentG1Refine::cache_insert(jbyte* card_ptr, bool* defer) { int count; jbyte* cached_ptr = add_card_count(card_ptr, &count, defer); assert(cached_ptr != NULL, "bad cached card ptr"); - assert(!is_young_card(cached_ptr), "shouldn't get a card in young region"); + + if (is_young_card(cached_ptr)) { + // The region containing cached_ptr has been freed during a clean up + // pause, reallocated, and tagged as young. + assert(cached_ptr != card_ptr, "shouldn't be"); + + // We've just inserted a new old-gen card pointer into the card count + // cache and evicted the previous contents of that count slot. + // The evicted card pointer has been determined to be in a young region + // and so cannot be the newly inserted card pointer (that will be + // in an old region). + // The count for newly inserted card will be set to zero during the + // insertion, so we don't want to defer the cleaning of the newly + // inserted card pointer. + assert(*defer == false, "deferring non-hot card"); + return NULL; + } // The card pointer we obtained from card count cache is not hot // so do not store it in the cache; return it for immediate @@ -384,4 +430,3 @@ void ConcurrentG1Refine::print_worker_threads_on(outputStream* st) const { st->cr(); } } - diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp index 5cef3058ca4..7bcbecfbe5e 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.hpp @@ -29,6 +29,31 @@ class G1RemSet; class ConcurrentG1Refine: public CHeapObj { ConcurrentG1RefineThread** _threads; int _n_threads; + int _n_worker_threads; + /* + * The value of the update buffer queue length falls into one of 3 zones: + * green, yellow, red. If the value is in [0, green) nothing is + * done, the buffers are left unprocessed to enable the caching effect of the + * dirtied cards. In the yellow zone [green, yellow) the concurrent refinement + * threads are gradually activated. In [yellow, red) all threads are + * running. If the length becomes red (max queue length) the mutators start + * processing the buffers. + * + * There are some interesting cases (with G1AdaptiveConcRefine turned off): + * 1) green = yellow = red = 0. In this case the mutator will process all + * buffers. Except for those that are created by the deferred updates + * machinery during a collection. + * 2) green = 0. Means no caching. Can be a good way to minimize the + * amount of time spent updating rsets during a collection. + */ + int _green_zone; + int _yellow_zone; + int _red_zone; + + int _thread_threshold_step; + + // Reset the threshold step value based of the current zone boundaries. + void reset_threshold_step(); // The cache for card refinement. bool _use_cache; @@ -147,6 +172,8 @@ class ConcurrentG1Refine: public CHeapObj { void init(); // Accomplish some initialization that has to wait. void stop(); + void reinitialize_threads(); + // Iterate over the conc refine threads void threads_do(ThreadClosure *tc); @@ -178,7 +205,20 @@ class ConcurrentG1Refine: public CHeapObj { void clear_and_record_card_counts(); - static size_t thread_num(); + static int thread_num(); void print_worker_threads_on(outputStream* st) const; + + void set_green_zone(int x) { _green_zone = x; } + void set_yellow_zone(int x) { _yellow_zone = x; } + void set_red_zone(int x) { _red_zone = x; } + + int green_zone() const { return _green_zone; } + int yellow_zone() const { return _yellow_zone; } + int red_zone() const { return _red_zone; } + + int total_thread_num() const { return _n_threads; } + int worker_thread_num() const { return _n_worker_threads; } + + int thread_threshold_step() const { return _thread_threshold_step; } }; diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.cpp index aaf2544fe9b..b23c287a6e5 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.cpp @@ -25,10 +25,6 @@ #include "incls/_precompiled.incl" #include "incls/_concurrentG1RefineThread.cpp.incl" -// ======= Concurrent Mark Thread ======== - -// The CM thread is created when the G1 garbage collector is used - ConcurrentG1RefineThread:: ConcurrentG1RefineThread(ConcurrentG1Refine* cg1r, ConcurrentG1RefineThread *next, int worker_id_offset, int worker_id) : @@ -37,19 +33,42 @@ ConcurrentG1RefineThread(ConcurrentG1Refine* cg1r, ConcurrentG1RefineThread *nex _worker_id(worker_id), _active(false), _next(next), + _monitor(NULL), _cg1r(cg1r), - _vtime_accum(0.0), - _interval_ms(5.0) + _vtime_accum(0.0) { + + // Each thread has its own monitor. The i-th thread is responsible for signalling + // to thread i+1 if the number of buffers in the queue exceeds a threashold for this + // thread. Monitors are also used to wake up the threads during termination. + // The 0th worker in notified by mutator threads and has a special monitor. + // The last worker is used for young gen rset size sampling. + if (worker_id > 0) { + _monitor = new Monitor(Mutex::nonleaf, "Refinement monitor", true); + } else { + _monitor = DirtyCardQ_CBL_mon; + } + initialize(); create_and_start(); } +void ConcurrentG1RefineThread::initialize() { + if (_worker_id < cg1r()->worker_thread_num()) { + // Current thread activation threshold + _threshold = MIN2(cg1r()->thread_threshold_step() * (_worker_id + 1) + cg1r()->green_zone(), + cg1r()->yellow_zone()); + // A thread deactivates once the number of buffer reached a deactivation threshold + _deactivation_threshold = MAX2(_threshold - cg1r()->thread_threshold_step(), cg1r()->green_zone()); + } else { + set_active(true); + } +} + void ConcurrentG1RefineThread::sample_young_list_rs_lengths() { G1CollectedHeap* g1h = G1CollectedHeap::heap(); G1CollectorPolicy* g1p = g1h->g1_policy(); if (g1p->adaptive_young_list_length()) { int regions_visited = 0; - g1h->young_list_rs_length_sampling_init(); while (g1h->young_list_rs_length_sampling_more()) { g1h->young_list_rs_length_sampling_next(); @@ -70,99 +89,121 @@ void ConcurrentG1RefineThread::sample_young_list_rs_lengths() { } } +void ConcurrentG1RefineThread::run_young_rs_sampling() { + DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); + _vtime_start = os::elapsedVTime(); + while(!_should_terminate) { + _sts.join(); + sample_young_list_rs_lengths(); + _sts.leave(); + + if (os::supports_vtime()) { + _vtime_accum = (os::elapsedVTime() - _vtime_start); + } else { + _vtime_accum = 0.0; + } + + MutexLockerEx x(_monitor, Mutex::_no_safepoint_check_flag); + if (_should_terminate) { + break; + } + _monitor->wait(Mutex::_no_safepoint_check_flag, G1ConcRefineServiceInterval); + } +} + +void ConcurrentG1RefineThread::wait_for_completed_buffers() { + DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); + MutexLockerEx x(_monitor, Mutex::_no_safepoint_check_flag); + while (!_should_terminate && !is_active()) { + _monitor->wait(Mutex::_no_safepoint_check_flag); + } +} + +bool ConcurrentG1RefineThread::is_active() { + DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); + return _worker_id > 0 ? _active : dcqs.process_completed_buffers(); +} + +void ConcurrentG1RefineThread::activate() { + MutexLockerEx x(_monitor, Mutex::_no_safepoint_check_flag); + if (_worker_id > 0) { + if (G1TraceConcurrentRefinement) { + DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); + gclog_or_tty->print_cr("G1-Refine-activated worker %d, on threshold %d, current %d", + _worker_id, _threshold, (int)dcqs.completed_buffers_num()); + } + set_active(true); + } else { + DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); + dcqs.set_process_completed(true); + } + _monitor->notify(); +} + +void ConcurrentG1RefineThread::deactivate() { + MutexLockerEx x(_monitor, Mutex::_no_safepoint_check_flag); + if (_worker_id > 0) { + if (G1TraceConcurrentRefinement) { + DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); + gclog_or_tty->print_cr("G1-Refine-deactivated worker %d, off threshold %d, current %d", + _worker_id, _deactivation_threshold, (int)dcqs.completed_buffers_num()); + } + set_active(false); + } else { + DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); + dcqs.set_process_completed(false); + } +} + void ConcurrentG1RefineThread::run() { initialize_in_thread(); - _vtime_start = os::elapsedVTime(); wait_for_universe_init(); + if (_worker_id >= cg1r()->worker_thread_num()) { + run_young_rs_sampling(); + terminate(); + } + + _vtime_start = os::elapsedVTime(); while (!_should_terminate) { DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); - // Wait for completed log buffers to exist. - { - MutexLockerEx x(DirtyCardQ_CBL_mon, Mutex::_no_safepoint_check_flag); - while (((_worker_id == 0 && !dcqs.process_completed_buffers()) || - (_worker_id > 0 && !is_active())) && - !_should_terminate) { - DirtyCardQ_CBL_mon->wait(Mutex::_no_safepoint_check_flag); - } - } + + // Wait for work + wait_for_completed_buffers(); if (_should_terminate) { - return; + break; } - // Now we take them off (this doesn't hold locks while it applies - // closures.) (If we did a full collection, then we'll do a full - // traversal. _sts.join(); - int n_logs = 0; - int lower_limit = 0; - double start_vtime_sec; // only used when G1SmoothConcRefine is on - int prev_buffer_num; // only used when G1SmoothConcRefine is on - // This thread activation threshold - int threshold = G1UpdateBufferQueueProcessingThreshold * _worker_id; - // Next thread activation threshold - int next_threshold = threshold + G1UpdateBufferQueueProcessingThreshold; - int deactivation_threshold = MAX2(threshold - G1UpdateBufferQueueProcessingThreshold / 2, 0); - if (G1SmoothConcRefine) { - lower_limit = 0; - start_vtime_sec = os::elapsedVTime(); - prev_buffer_num = (int) dcqs.completed_buffers_num(); - } else { - lower_limit = G1UpdateBufferQueueProcessingThreshold / 4; // For now. - } - while (dcqs.apply_closure_to_completed_buffer(_worker_id + _worker_id_offset, lower_limit)) { - double end_vtime_sec; - double elapsed_vtime_sec; - int elapsed_vtime_ms; - int curr_buffer_num = (int) dcqs.completed_buffers_num(); - - if (G1SmoothConcRefine) { - end_vtime_sec = os::elapsedVTime(); - elapsed_vtime_sec = end_vtime_sec - start_vtime_sec; - elapsed_vtime_ms = (int) (elapsed_vtime_sec * 1000.0); - - if (curr_buffer_num > prev_buffer_num || - curr_buffer_num > next_threshold) { - decreaseInterval(elapsed_vtime_ms); - } else if (curr_buffer_num < prev_buffer_num) { - increaseInterval(elapsed_vtime_ms); - } + do { + int curr_buffer_num = (int)dcqs.completed_buffers_num(); + // If the number of the buffers falls down into the yellow zone, + // that means that the transition period after the evacuation pause has ended. + if (dcqs.completed_queue_padding() > 0 && curr_buffer_num <= cg1r()->yellow_zone()) { + dcqs.set_completed_queue_padding(0); } - if (_worker_id == 0) { - sample_young_list_rs_lengths(); - } else if (curr_buffer_num < deactivation_threshold) { + + if (_worker_id > 0 && curr_buffer_num <= _deactivation_threshold) { // If the number of the buffer has fallen below our threshold // we should deactivate. The predecessor will reactivate this // thread should the number of the buffers cross the threshold again. - MutexLockerEx x(DirtyCardQ_CBL_mon, Mutex::_no_safepoint_check_flag); deactivate(); - if (G1TraceConcurrentRefinement) { - gclog_or_tty->print_cr("G1-Refine-deactivated worker %d", _worker_id); - } break; } // Check if we need to activate the next thread. - if (curr_buffer_num > next_threshold && _next != NULL && !_next->is_active()) { - MutexLockerEx x(DirtyCardQ_CBL_mon, Mutex::_no_safepoint_check_flag); + if (_next != NULL && !_next->is_active() && curr_buffer_num > _next->_threshold) { _next->activate(); - DirtyCardQ_CBL_mon->notify_all(); - if (G1TraceConcurrentRefinement) { - gclog_or_tty->print_cr("G1-Refine-activated worker %d", _next->_worker_id); - } } + } while (dcqs.apply_closure_to_completed_buffer(_worker_id + _worker_id_offset, cg1r()->green_zone())); - if (G1SmoothConcRefine) { - prev_buffer_num = curr_buffer_num; - _sts.leave(); - os::sleep(Thread::current(), (jlong) _interval_ms, false); - _sts.join(); - start_vtime_sec = os::elapsedVTime(); - } - n_logs++; + // We can exit the loop above while being active if there was a yield request. + if (is_active()) { + deactivate(); } + _sts.leave(); if (os::supports_vtime()) { @@ -172,7 +213,6 @@ void ConcurrentG1RefineThread::run() { } } assert(_should_terminate, "just checking"); - terminate(); } @@ -191,8 +231,8 @@ void ConcurrentG1RefineThread::stop() { } { - MutexLockerEx x(DirtyCardQ_CBL_mon, Mutex::_no_safepoint_check_flag); - DirtyCardQ_CBL_mon->notify_all(); + MutexLockerEx x(_monitor, Mutex::_no_safepoint_check_flag); + _monitor->notify(); } { diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.hpp index 167fc176ef7..b2eb5d3276e 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1RefineThread.hpp @@ -40,42 +40,36 @@ class ConcurrentG1RefineThread: public ConcurrentGCThread { // when the number of the rset update buffer crosses a certain threshold. A successor // would self-deactivate when the number of the buffers falls below the threshold. bool _active; - ConcurrentG1RefineThread * _next; - public: - virtual void run(); + ConcurrentG1RefineThread* _next; + Monitor* _monitor; + ConcurrentG1Refine* _cg1r; - bool is_active() { return _active; } - void activate() { _active = true; } - void deactivate() { _active = false; } + int _thread_threshold_step; + // This thread activation threshold + int _threshold; + // This thread deactivation threshold + int _deactivation_threshold; - private: - ConcurrentG1Refine* _cg1r; + void sample_young_list_rs_lengths(); + void run_young_rs_sampling(); + void wait_for_completed_buffers(); - double _interval_ms; - - void decreaseInterval(int processing_time_ms) { - double min_interval_ms = (double) processing_time_ms; - _interval_ms = 0.8 * _interval_ms; - if (_interval_ms < min_interval_ms) - _interval_ms = min_interval_ms; - } - void increaseInterval(int processing_time_ms) { - double max_interval_ms = 9.0 * (double) processing_time_ms; - _interval_ms = 1.1 * _interval_ms; - if (max_interval_ms > 0 && _interval_ms > max_interval_ms) - _interval_ms = max_interval_ms; - } - - void sleepBeforeNextCycle(); + void set_active(bool x) { _active = x; } + bool is_active(); + void activate(); + void deactivate(); // For use by G1CollectedHeap, which is a friend. static SuspendibleThreadSet* sts() { return &_sts; } - public: +public: + virtual void run(); // Constructor ConcurrentG1RefineThread(ConcurrentG1Refine* cg1r, ConcurrentG1RefineThread* next, int worker_id_offset, int worker_id); + void initialize(); + // Printing void print() const; void print_on(outputStream* st) const; @@ -83,13 +77,10 @@ class ConcurrentG1RefineThread: public ConcurrentGCThread { // Total virtual time so far. double vtime_accum() { return _vtime_accum; } - ConcurrentG1Refine* cg1r() { return _cg1r; } - - void sample_young_list_rs_lengths(); + ConcurrentG1Refine* cg1r() { return _cg1r; } // Yield for GC - void yield(); - + void yield(); // shutdown void stop(); }; diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp index af93ae7d231..c77af414161 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp @@ -760,7 +760,6 @@ void ConcurrentMark::checkpointRootsInitialPost() { rp->setup_policy(false); // snapshot the soft ref policy to be used in this cycle SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set(); - satb_mq_set.set_process_completed_threshold(G1SATBProcessCompletedThreshold); satb_mq_set.set_active_all_threads(true); // update_g1_committed() will be called at the end of an evac pause diff --git a/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp b/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp index 7372a4a787c..81d8716b1b1 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp @@ -61,8 +61,8 @@ bool DirtyCardQueue::apply_closure_to_buffer(CardTableEntryClosure* cl, #pragma warning( disable:4355 ) // 'this' : used in base member initializer list #endif // _MSC_VER -DirtyCardQueueSet::DirtyCardQueueSet() : - PtrQueueSet(true /*notify_when_complete*/), +DirtyCardQueueSet::DirtyCardQueueSet(bool notify_when_complete) : + PtrQueueSet(notify_when_complete), _closure(NULL), _shared_dirty_card_queue(this, true /*perm*/), _free_ids(NULL), @@ -77,12 +77,12 @@ size_t DirtyCardQueueSet::num_par_ids() { } void DirtyCardQueueSet::initialize(Monitor* cbl_mon, Mutex* fl_lock, + int process_completed_threshold, int max_completed_queue, Mutex* lock, PtrQueueSet* fl_owner) { - PtrQueueSet::initialize(cbl_mon, fl_lock, max_completed_queue, fl_owner); + PtrQueueSet::initialize(cbl_mon, fl_lock, process_completed_threshold, + max_completed_queue, fl_owner); set_buffer_size(G1UpdateBufferSize); - set_process_completed_threshold(G1UpdateBufferQueueProcessingThreshold); - _shared_dirty_card_queue.set_lock(lock); _free_ids = new FreeIdSet((int) num_par_ids(), _cbl_mon); } @@ -154,9 +154,10 @@ bool DirtyCardQueueSet::mut_process_buffer(void** buf) { return b; } -DirtyCardQueueSet::CompletedBufferNode* -DirtyCardQueueSet::get_completed_buffer_lock(int stop_at) { - CompletedBufferNode* nd = NULL; + +BufferNode* +DirtyCardQueueSet::get_completed_buffer(int stop_at) { + BufferNode* nd = NULL; MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag); if ((int)_n_completed_buffers <= stop_at) { @@ -166,53 +167,31 @@ DirtyCardQueueSet::get_completed_buffer_lock(int stop_at) { if (_completed_buffers_head != NULL) { nd = _completed_buffers_head; - _completed_buffers_head = nd->next; + _completed_buffers_head = nd->next(); if (_completed_buffers_head == NULL) _completed_buffers_tail = NULL; _n_completed_buffers--; + assert(_n_completed_buffers >= 0, "Invariant"); } debug_only(assert_completed_buffer_list_len_correct_locked()); return nd; } -// We only do this in contexts where there is no concurrent enqueueing. -DirtyCardQueueSet::CompletedBufferNode* -DirtyCardQueueSet::get_completed_buffer_CAS() { - CompletedBufferNode* nd = _completed_buffers_head; - - while (nd != NULL) { - CompletedBufferNode* next = nd->next; - CompletedBufferNode* result = - (CompletedBufferNode*)Atomic::cmpxchg_ptr(next, - &_completed_buffers_head, - nd); - if (result == nd) { - return result; - } else { - nd = _completed_buffers_head; - } - } - assert(_completed_buffers_head == NULL, "Loop post"); - _completed_buffers_tail = NULL; - return NULL; -} - bool DirtyCardQueueSet:: apply_closure_to_completed_buffer_helper(int worker_i, - CompletedBufferNode* nd) { + BufferNode* nd) { if (nd != NULL) { + void **buf = BufferNode::make_buffer_from_node(nd); + size_t index = nd->index(); bool b = - DirtyCardQueue::apply_closure_to_buffer(_closure, nd->buf, - nd->index, _sz, + DirtyCardQueue::apply_closure_to_buffer(_closure, buf, + index, _sz, true, worker_i); - void** buf = nd->buf; - size_t index = nd->index; - delete nd; if (b) { deallocate_buffer(buf); return true; // In normal case, go on to next buffer. } else { - enqueue_complete_buffer(buf, index, true); + enqueue_complete_buffer(buf, index); return false; } } else { @@ -222,40 +201,36 @@ apply_closure_to_completed_buffer_helper(int worker_i, bool DirtyCardQueueSet::apply_closure_to_completed_buffer(int worker_i, int stop_at, - bool with_CAS) + bool during_pause) { - CompletedBufferNode* nd = NULL; - if (with_CAS) { - guarantee(stop_at == 0, "Precondition"); - nd = get_completed_buffer_CAS(); - } else { - nd = get_completed_buffer_lock(stop_at); - } + assert(!during_pause || stop_at == 0, "Should not leave any completed buffers during a pause"); + BufferNode* nd = get_completed_buffer(stop_at); bool res = apply_closure_to_completed_buffer_helper(worker_i, nd); if (res) Atomic::inc(&_processed_buffers_rs_thread); return res; } void DirtyCardQueueSet::apply_closure_to_all_completed_buffers() { - CompletedBufferNode* nd = _completed_buffers_head; + BufferNode* nd = _completed_buffers_head; while (nd != NULL) { bool b = - DirtyCardQueue::apply_closure_to_buffer(_closure, nd->buf, 0, _sz, - false); + DirtyCardQueue::apply_closure_to_buffer(_closure, + BufferNode::make_buffer_from_node(nd), + 0, _sz, false); guarantee(b, "Should not stop early."); - nd = nd->next; + nd = nd->next(); } } void DirtyCardQueueSet::abandon_logs() { assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint."); - CompletedBufferNode* buffers_to_delete = NULL; + BufferNode* buffers_to_delete = NULL; { MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag); while (_completed_buffers_head != NULL) { - CompletedBufferNode* nd = _completed_buffers_head; - _completed_buffers_head = nd->next; - nd->next = buffers_to_delete; + BufferNode* nd = _completed_buffers_head; + _completed_buffers_head = nd->next(); + nd->set_next(buffers_to_delete); buffers_to_delete = nd; } _n_completed_buffers = 0; @@ -263,10 +238,9 @@ void DirtyCardQueueSet::abandon_logs() { debug_only(assert_completed_buffer_list_len_correct_locked()); } while (buffers_to_delete != NULL) { - CompletedBufferNode* nd = buffers_to_delete; - buffers_to_delete = nd->next; - deallocate_buffer(nd->buf); - delete nd; + BufferNode* nd = buffers_to_delete; + buffers_to_delete = nd->next(); + deallocate_buffer(BufferNode::make_buffer_from_node(nd)); } // Since abandon is done only at safepoints, we can safely manipulate // these queues. diff --git a/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp b/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp index 7a6f3f27bbd..da2c8378451 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/dirtyCardQueue.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -84,11 +84,12 @@ class DirtyCardQueueSet: public PtrQueueSet { jint _processed_buffers_rs_thread; public: - DirtyCardQueueSet(); + DirtyCardQueueSet(bool notify_when_complete = true); void initialize(Monitor* cbl_mon, Mutex* fl_lock, - int max_completed_queue = 0, - Mutex* lock = NULL, PtrQueueSet* fl_owner = NULL); + int process_completed_threshold, + int max_completed_queue, + Mutex* lock, PtrQueueSet* fl_owner = NULL); // The number of parallel ids that can be claimed to allow collector or // mutator threads to do card-processing work. @@ -120,12 +121,13 @@ public: // is returned to the completed buffer set, and this call returns false. bool apply_closure_to_completed_buffer(int worker_i = 0, int stop_at = 0, - bool with_CAS = false); - bool apply_closure_to_completed_buffer_helper(int worker_i, - CompletedBufferNode* nd); + bool during_pause = false); + + bool apply_closure_to_completed_buffer_helper(int worker_i, + BufferNode* nd); + + BufferNode* get_completed_buffer(int stop_at); - CompletedBufferNode* get_completed_buffer_CAS(); - CompletedBufferNode* get_completed_buffer_lock(int stop_at); // Applies the current closure to all completed buffers, // non-consumptively. void apply_closure_to_all_completed_buffers(); diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index 550b028ea60..9b2b71292d8 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -928,6 +928,8 @@ void G1CollectedHeap::do_collection(bool full, bool clear_all_soft_refs, TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); TraceTime t(full ? "Full GC (System.gc())" : "Full GC", PrintGC, true, gclog_or_tty); + TraceMemoryManagerStats tms(true /* fullGC */); + double start = os::elapsedTime(); g1_policy()->record_full_collection_start(); @@ -1001,6 +1003,8 @@ void G1CollectedHeap::do_collection(bool full, bool clear_all_soft_refs, COMPILER2_PRESENT(DerivedPointerTable::update_pointers()); + MemoryService::track_memory_usage(); + if (VerifyAfterGC && total_collections() >= VerifyGCStartAt) { HandleMark hm; // Discard invalid handles created during verification gclog_or_tty->print(" VerifyAfterGC:"); @@ -1371,6 +1375,7 @@ void G1CollectedHeap::shrink(size_t shrink_bytes) { G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) : SharedHeap(policy_), _g1_policy(policy_), + _dirty_card_queue_set(false), _ref_processor(NULL), _process_strong_tasks(new SubTasksDone(G1H_PS_NumElements)), _bot_shared(NULL), @@ -1436,6 +1441,7 @@ G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) : } jint G1CollectedHeap::initialize() { + CollectedHeap::pre_initialize(); os::enable_vtime(); // Necessary to satisfy locking discipline assertions. @@ -1456,8 +1462,6 @@ jint G1CollectedHeap::initialize() { Universe::check_alignment(init_byte_size, HeapRegion::GrainBytes, "g1 heap"); Universe::check_alignment(max_byte_size, HeapRegion::GrainBytes, "g1 heap"); - // We allocate this in any case, but only do no work if the command line - // param is off. _cg1r = new ConcurrentG1Refine(); // Reserve the maximum. @@ -1590,18 +1594,20 @@ jint G1CollectedHeap::initialize() { JavaThread::satb_mark_queue_set().initialize(SATB_Q_CBL_mon, SATB_Q_FL_lock, - 0, + G1SATBProcessCompletedThreshold, Shared_SATB_Q_lock); JavaThread::dirty_card_queue_set().initialize(DirtyCardQ_CBL_mon, DirtyCardQ_FL_lock, - G1UpdateBufferQueueMaxLength, + concurrent_g1_refine()->yellow_zone(), + concurrent_g1_refine()->red_zone(), Shared_DirtyCardQ_lock); if (G1DeferredRSUpdate) { dirty_card_queue_set().initialize(DirtyCardQ_CBL_mon, DirtyCardQ_FL_lock, - 0, + -1, // never trigger processing + -1, // no limit on length Shared_DirtyCardQ_lock, &JavaThread::dirty_card_queue_set()); } @@ -1732,13 +1738,6 @@ size_t G1CollectedHeap::unsafe_max_alloc() { return car->free(); } -void G1CollectedHeap::collect(GCCause::Cause cause) { - // The caller doesn't have the Heap_lock - assert(!Heap_lock->owned_by_self(), "this thread should not own the Heap_lock"); - MutexLocker ml(Heap_lock); - collect_locked(cause); -} - void G1CollectedHeap::collect_as_vm_thread(GCCause::Cause cause) { assert(Thread::current()->is_VM_thread(), "Precondition#1"); assert(Heap_lock->is_locked(), "Precondition#2"); @@ -1755,17 +1754,31 @@ void G1CollectedHeap::collect_as_vm_thread(GCCause::Cause cause) { } } +void G1CollectedHeap::collect(GCCause::Cause cause) { + // The caller doesn't have the Heap_lock + assert(!Heap_lock->owned_by_self(), "this thread should not own the Heap_lock"); -void G1CollectedHeap::collect_locked(GCCause::Cause cause) { - // Don't want to do a GC until cleanup is completed. - wait_for_cleanup_complete(); - - // Read the GC count while holding the Heap_lock - int gc_count_before = SharedHeap::heap()->total_collections(); + int gc_count_before; { - MutexUnlocker mu(Heap_lock); // give up heap lock, execute gets it back - VM_G1CollectFull op(gc_count_before, cause); - VMThread::execute(&op); + MutexLocker ml(Heap_lock); + // Read the GC count while holding the Heap_lock + gc_count_before = SharedHeap::heap()->total_collections(); + + // Don't want to do a GC until cleanup is completed. + wait_for_cleanup_complete(); + } // We give up heap lock; VMThread::execute gets it back below + switch (cause) { + case GCCause::_scavenge_alot: { + // Do an incremental pause, which might sometimes be abandoned. + VM_G1IncCollectionPause op(gc_count_before, cause); + VMThread::execute(&op); + break; + } + default: { + // In all other cases, we currently do a full gc. + VM_G1CollectFull op(gc_count_before, cause); + VMThread::execute(&op); + } } } @@ -2119,7 +2132,7 @@ size_t G1CollectedHeap::large_typearray_limit() { } size_t G1CollectedHeap::max_capacity() const { - return _g1_committed.byte_size(); + return g1_reserved_obj_bytes(); } jlong G1CollectedHeap::millis_since_last_gc() { @@ -2492,6 +2505,7 @@ G1CollectedHeap* G1CollectedHeap::heap() { } void G1CollectedHeap::gc_prologue(bool full /* Ignored */) { + // always_do_update_barrier = false; assert(InlineCacheBuffer::is_empty(), "should have cleaned up ICBuffer"); // Call allocation profiler AllocationProfiler::iterate_since_last_gc(); @@ -2505,6 +2519,7 @@ void G1CollectedHeap::gc_epilogue(bool full /* Ignored */) { // is set. COMPILER2_PRESENT(assert(DerivedPointerTable::is_empty(), "derived pointer present")); + // always_do_update_barrier = true; } void G1CollectedHeap::do_collection_pause() { @@ -2631,6 +2646,13 @@ G1CollectedHeap::cleanup_surviving_young_words() { // +struct PrepareForRSScanningClosure : public HeapRegionClosure { + bool doHeapRegion(HeapRegion *r) { + r->rem_set()->set_iter_claimed(0); + return false; + } +}; + void G1CollectedHeap::do_collection_pause_at_safepoint() { if (PrintHeapAtGC) { @@ -2638,6 +2660,8 @@ G1CollectedHeap::do_collection_pause_at_safepoint() { } { + ResourceMark rm; + char verbose_str[128]; sprintf(verbose_str, "GC pause "); if (g1_policy()->in_young_gc_mode()) { @@ -2649,8 +2673,6 @@ G1CollectedHeap::do_collection_pause_at_safepoint() { if (g1_policy()->should_initiate_conc_mark()) strcat(verbose_str, " (initial-mark)"); - GCCauseSetter x(this, GCCause::_g1_inc_collection_pause); - // if PrintGCDetails is on, we'll print long statistics information // in the collector policy code, so let's not print this as the output // is messy if we do. @@ -2658,7 +2680,8 @@ G1CollectedHeap::do_collection_pause_at_safepoint() { TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); TraceTime t(verbose_str, PrintGC && !PrintGCDetails, true, gclog_or_tty); - ResourceMark rm; + TraceMemoryManagerStats tms(false /* fullGC */); + assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint"); assert(Thread::current() == VMThread::vm_thread(), "should be in vm thread"); guarantee(!is_gc_active(), "collection is not reentrant"); @@ -2768,6 +2791,8 @@ G1CollectedHeap::do_collection_pause_at_safepoint() { gclog_or_tty->print_cr("\nAfter pause, heap:"); print(); #endif + PrepareForRSScanningClosure prepare_for_rs_scan; + collection_set_iterate(&prepare_for_rs_scan); setup_surviving_young_words(); @@ -2802,6 +2827,22 @@ G1CollectedHeap::do_collection_pause_at_safepoint() { _young_list->reset_auxilary_lists(); } } else { + if (_in_cset_fast_test != NULL) { + assert(_in_cset_fast_test_base != NULL, "Since _in_cset_fast_test isn't"); + FREE_C_HEAP_ARRAY(bool, _in_cset_fast_test_base); + // this is more for peace of mind; we're nulling them here and + // we're expecting them to be null at the beginning of the next GC + _in_cset_fast_test = NULL; + _in_cset_fast_test_base = NULL; + } + // This looks confusing, because the DPT should really be empty + // at this point -- since we have not done any collection work, + // there should not be any derived pointers in the table to update; + // however, there is some additional state in the DPT which is + // reset at the end of the (null) "gc" here via the following call. + // A better approach might be to split off that state resetting work + // into a separate method that asserts that the DPT is empty and call + // that here. That is deferred for now. COMPILER2_PRESENT(DerivedPointerTable::update_pointers()); } @@ -2838,6 +2879,8 @@ G1CollectedHeap::do_collection_pause_at_safepoint() { assert(regions_accounted_for(), "Region leakage."); + MemoryService::track_memory_usage(); + if (VerifyAfterGC && total_collections() >= VerifyGCStartAt) { HandleMark hm; // Discard invalid handles created during verification gclog_or_tty->print(" VerifyAfterGC:"); @@ -3747,22 +3790,16 @@ oop G1ParCopyHelper::copy_to_survivor_space(oop old) { return obj; } -template +template template -void G1ParCopyClosure +void G1ParCopyClosure ::do_oop_work(T* p) { oop obj = oopDesc::load_decode_heap_oop(p); assert(barrier != G1BarrierRS || obj != NULL, "Precondition: G1BarrierRS implies obj is nonNull"); - // The only time we skip the cset test is when we're scanning - // references popped from the queue. And we only push on the queue - // references that we know point into the cset, so no point in - // checking again. But we'll leave an assert here for peace of mind. - assert(!skip_cset_test || _g1->obj_in_cs(obj), "invariant"); - // here the null check is implicit in the cset_fast_test() test - if (skip_cset_test || _g1->in_cset_fast_test(obj)) { + if (_g1->in_cset_fast_test(obj)) { #if G1_REM_SET_LOGGING gclog_or_tty->print_cr("Loc "PTR_FORMAT" contains pointer "PTR_FORMAT" " "into CS.", p, (void*) obj); @@ -3779,7 +3816,6 @@ void G1ParCopyClosure update_rs(_from, p, _par_scan_state->queue_num()); } @@ -3789,8 +3825,8 @@ void G1ParCopyClosure ::do_oop_work(oop* p); -template void G1ParCopyClosure::do_oop_work(narrowOop* p); +template void G1ParCopyClosure::do_oop_work(oop* p); +template void G1ParCopyClosure::do_oop_work(narrowOop* p); template void G1ParScanPartialArrayClosure::do_oop_nv(T* p) { assert(has_partial_array_mask(p), "invariant"); @@ -3862,11 +3898,11 @@ public: assert(UseCompressedOops, "Error"); narrowOop* p = (narrowOop*) stolen_task; assert(has_partial_array_mask(p) || - _g1h->obj_in_cs(oopDesc::load_decode_heap_oop(p)), "Error"); + _g1h->is_in_g1_reserved(oopDesc::load_decode_heap_oop(p)), "Error"); pss->push_on_queue(p); } else { oop* p = (oop*) stolen_task; - assert(has_partial_array_mask(p) || _g1h->obj_in_cs(*p), "Error"); + assert(has_partial_array_mask(p) || _g1h->is_in_g1_reserved(*p), "Error"); pss->push_on_queue(p); } continue; @@ -3928,6 +3964,7 @@ public: G1ParScanExtRootClosure only_scan_root_cl(_g1h, &pss); G1ParScanPermClosure only_scan_perm_cl(_g1h, &pss); G1ParScanHeapRSClosure only_scan_heap_rs_cl(_g1h, &pss); + G1ParPushHeapRSClosure push_heap_rs_cl(_g1h, &pss); G1ParScanAndMarkExtRootClosure scan_mark_root_cl(_g1h, &pss); G1ParScanAndMarkPermClosure scan_mark_perm_cl(_g1h, &pss); @@ -3951,7 +3988,7 @@ public: _g1h->g1_process_strong_roots(/* not collecting perm */ false, SharedHeap::SO_AllClasses, scan_root_cl, - &only_scan_heap_rs_cl, + &push_heap_rs_cl, scan_so_cl, scan_perm_cl, i); @@ -4209,10 +4246,11 @@ void G1CollectedHeap::evacuate_collection_set() { RedirtyLoggedCardTableEntryFastClosure redirty; dirty_card_queue_set().set_closure(&redirty); dirty_card_queue_set().apply_closure_to_all_completed_buffers(); - JavaThread::dirty_card_queue_set().merge_bufferlists(&dirty_card_queue_set()); + + DirtyCardQueueSet& dcq = JavaThread::dirty_card_queue_set(); + dcq.merge_bufferlists(&dirty_card_queue_set()); assert(dirty_card_queue_set().completed_buffers_num() == 0, "All should be consumed"); } - COMPILER2_PRESENT(DerivedPointerTable::update_pointers()); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp index 5e07828267f..692b3e7f32a 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @@ -692,7 +692,7 @@ public: // Reserved (g1 only; super method includes perm), capacity and the used // portion in bytes. - size_t g1_reserved_obj_bytes() { return _g1_reserved.byte_size(); } + size_t g1_reserved_obj_bytes() const { return _g1_reserved.byte_size(); } virtual size_t capacity() const; virtual size_t used() const; // This should be called when we're not holding the heap lock. The @@ -1004,6 +1004,15 @@ public: // storage in the heap comes from a young region or not. // See ReduceInitialCardMarks. virtual bool can_elide_tlab_store_barriers() const { + // 6920090: Temporarily disabled, because of lingering + // instabilities related to RICM with G1. In the + // interim, the option ReduceInitialCardMarksForG1 + // below is left solely as a debugging device at least + // until 6920109 fixes the instabilities. + return ReduceInitialCardMarksForG1; + } + + virtual bool card_mark_must_follow_store() const { return true; } @@ -1022,6 +1031,8 @@ public: // However, non-generational G1 (-XX:-G1Gen) appears to have // bit-rotted so was not tested below. virtual bool can_elide_initializing_store_barrier(oop new_obj) { + // Re 6920090, 6920109 above. + assert(ReduceInitialCardMarksForG1, "Else cannot be here"); assert(G1Gen || !is_in_young(new_obj), "Non-generational G1 should never return true below"); return is_in_young(new_obj); @@ -1612,7 +1623,7 @@ public: template void push_on_queue(T* ref) { assert(ref != NULL, "invariant"); assert(has_partial_array_mask(ref) || - _g1h->obj_in_cs(oopDesc::load_decode_heap_oop(ref)), "invariant"); + _g1h->is_in_g1_reserved(oopDesc::load_decode_heap_oop(ref)), "invariant"); #ifdef ASSERT if (has_partial_array_mask(ref)) { oop p = clear_partial_array_mask(ref); @@ -1633,9 +1644,9 @@ public: assert((oop*)ref != NULL, "pop_local() returned true"); assert(UseCompressedOops || !ref.is_narrow(), "Error"); assert(has_partial_array_mask((oop*)ref) || - _g1h->obj_in_cs(ref.is_narrow() ? oopDesc::load_decode_heap_oop((narrowOop*)ref) - : oopDesc::load_decode_heap_oop((oop*)ref)), - "invariant"); + _g1h->is_in_g1_reserved(ref.is_narrow() ? oopDesc::load_decode_heap_oop((narrowOop*)ref) + : oopDesc::load_decode_heap_oop((oop*)ref)), + "invariant"); IF_G1_DETAILED_STATS(note_pop()); } else { StarTask null_task; @@ -1648,9 +1659,9 @@ public: assert((oop*)new_ref != NULL, "pop() from a local non-empty stack"); assert(UseCompressedOops || !new_ref.is_narrow(), "Error"); assert(has_partial_array_mask((oop*)new_ref) || - _g1h->obj_in_cs(new_ref.is_narrow() ? oopDesc::load_decode_heap_oop((narrowOop*)new_ref) - : oopDesc::load_decode_heap_oop((oop*)new_ref)), - "invariant"); + _g1h->is_in_g1_reserved(new_ref.is_narrow() ? oopDesc::load_decode_heap_oop((narrowOop*)new_ref) + : oopDesc::load_decode_heap_oop((oop*)new_ref)), + "invariant"); ref = new_ref; } @@ -1814,12 +1825,12 @@ public: assert(UseCompressedOops, "Error"); narrowOop* p = (narrowOop*)ref_to_scan; assert(!has_partial_array_mask(p) && - _g1h->obj_in_cs(oopDesc::load_decode_heap_oop(p)), "sanity"); + _g1h->is_in_g1_reserved(oopDesc::load_decode_heap_oop(p)), "sanity"); deal_with_reference(p); } else { oop* p = (oop*)ref_to_scan; - assert((has_partial_array_mask(p) && _g1h->obj_in_cs(clear_partial_array_mask(p))) || - _g1h->obj_in_cs(oopDesc::load_decode_heap_oop(p)), "sanity"); + assert((has_partial_array_mask(p) && _g1h->is_in_g1_reserved(clear_partial_array_mask(p))) || + _g1h->is_in_g1_reserved(oopDesc::load_decode_heap_oop(p)), "sanity"); deal_with_reference(p); } } @@ -1833,12 +1844,12 @@ public: assert(UseCompressedOops, "Error"); narrowOop* p = (narrowOop*)ref_to_scan; assert(!has_partial_array_mask(p) && - _g1h->obj_in_cs(oopDesc::load_decode_heap_oop(p)), "sanity"); + _g1h->is_in_g1_reserved(oopDesc::load_decode_heap_oop(p)), "sanity"); deal_with_reference(p); } else { oop* p = (oop*)ref_to_scan; assert((has_partial_array_mask(p) && _g1h->obj_in_cs(clear_partial_array_mask(p))) || - _g1h->obj_in_cs(oopDesc::load_decode_heap_oop(p)), "sanity"); + _g1h->is_in_g1_reserved(oopDesc::load_decode_heap_oop(p)), "sanity"); deal_with_reference(p); } } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp index 20e8fba5dea..7702c788f21 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp @@ -205,6 +205,7 @@ G1CollectorPolicy::G1CollectorPolicy() : // policy is created before the heap, we have to set this up here, // so it's done as soon as possible. HeapRegion::setup_heap_region_size(Arguments::min_heap_size()); + HeapRegionRemSet::setup_remset_size(); _recent_prev_end_times_for_all_gcs_sec->add(os::elapsedTime()); _prev_collection_pause_end_ms = os::elapsedTime() * 1000.0; @@ -1516,8 +1517,30 @@ void G1CollectorPolicy::record_collection_pause_end(bool abandoned) { (end_time_sec - _recent_prev_end_times_for_all_gcs_sec->oldest()) * 1000.0; update_recent_gc_times(end_time_sec, elapsed_ms); _recent_avg_pause_time_ratio = _recent_gc_times_ms->sum()/interval_ms; - // using 1.01 to account for floating point inaccuracies - assert(recent_avg_pause_time_ratio() < 1.01, "All GC?"); + if (recent_avg_pause_time_ratio() < 0.0 || + (recent_avg_pause_time_ratio() - 1.0 > 0.0)) { +#ifndef PRODUCT + // Dump info to allow post-facto debugging + gclog_or_tty->print_cr("recent_avg_pause_time_ratio() out of bounds"); + gclog_or_tty->print_cr("-------------------------------------------"); + gclog_or_tty->print_cr("Recent GC Times (ms):"); + _recent_gc_times_ms->dump(); + gclog_or_tty->print_cr("(End Time=%3.3f) Recent GC End Times (s):", end_time_sec); + _recent_prev_end_times_for_all_gcs_sec->dump(); + gclog_or_tty->print_cr("GC = %3.3f, Interval = %3.3f, Ratio = %3.3f", + _recent_gc_times_ms->sum(), interval_ms, recent_avg_pause_time_ratio()); + // In debug mode, terminate the JVM if the user wants to debug at this point. + assert(!G1FailOnFPError, "Debugging data for CR 6898948 has been dumped above"); +#endif // !PRODUCT + // Clip ratio between 0.0 and 1.0, and continue. This will be fixed in + // CR 6902692 by redoing the manner in which the ratio is incrementally computed. + if (_recent_avg_pause_time_ratio < 0.0) { + _recent_avg_pause_time_ratio = 0.0; + } else { + assert(_recent_avg_pause_time_ratio - 1.0 > 0.0, "Ctl-point invariant"); + _recent_avg_pause_time_ratio = 1.0; + } + } } if (G1PolicyVerbose > 1) { @@ -1892,6 +1915,10 @@ void G1CollectorPolicy::record_collection_pause_end(bool abandoned) { calculate_young_list_min_length(); calculate_young_list_target_config(); + // Note that _mmu_tracker->max_gc_time() returns the time in seconds. + double update_rs_time_goal_ms = _mmu_tracker->max_gc_time() * MILLIUNITS * G1RSUpdatePauseFractionPercent / 100.0; + adjust_concurrent_refinement(update_rs_time, update_rs_processed_buffers, update_rs_time_goal_ms); + // _target_pause_time_ms = -1.0; @@ -1899,6 +1926,47 @@ void G1CollectorPolicy::record_collection_pause_end(bool abandoned) { // +void G1CollectorPolicy::adjust_concurrent_refinement(double update_rs_time, + double update_rs_processed_buffers, + double goal_ms) { + DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); + ConcurrentG1Refine *cg1r = G1CollectedHeap::heap()->concurrent_g1_refine(); + + if (G1AdaptiveConcRefine) { + const int k_gy = 3, k_gr = 6; + const double inc_k = 1.1, dec_k = 0.9; + + int g = cg1r->green_zone(); + if (update_rs_time > goal_ms) { + g = (int)(g * dec_k); // Can become 0, that's OK. That would mean a mutator-only processing. + } else { + if (update_rs_time < goal_ms && update_rs_processed_buffers > g) { + g = (int)MAX2(g * inc_k, g + 1.0); + } + } + // Change the refinement threads params + cg1r->set_green_zone(g); + cg1r->set_yellow_zone(g * k_gy); + cg1r->set_red_zone(g * k_gr); + cg1r->reinitialize_threads(); + + int processing_threshold_delta = MAX2((int)(cg1r->green_zone() * sigma()), 1); + int processing_threshold = MIN2(cg1r->green_zone() + processing_threshold_delta, + cg1r->yellow_zone()); + // Change the barrier params + dcqs.set_process_completed_threshold(processing_threshold); + dcqs.set_max_completed_queue(cg1r->red_zone()); + } + + int curr_queue_size = dcqs.completed_buffers_num(); + if (curr_queue_size >= cg1r->yellow_zone()) { + dcqs.set_completed_queue_padding(curr_queue_size); + } else { + dcqs.set_completed_queue_padding(0); + } + dcqs.notify_if_necessary(); +} + double G1CollectorPolicy:: predict_young_collection_elapsed_time_ms(size_t adjustment) { @@ -2825,8 +2893,15 @@ choose_collection_set() { double non_young_start_time_sec; start_recording_regions(); - guarantee(_target_pause_time_ms > -1.0, + guarantee(_target_pause_time_ms > -1.0 + NOT_PRODUCT(|| Universe::heap()->gc_cause() == GCCause::_scavenge_alot), "_target_pause_time_ms should have been set!"); +#ifndef PRODUCT + if (_target_pause_time_ms <= -1.0) { + assert(ScavengeALot && Universe::heap()->gc_cause() == GCCause::_scavenge_alot, "Error"); + _target_pause_time_ms = _mmu_tracker->max_gc_time() * 1000.0; + } +#endif assert(_collection_set == NULL, "Precondition"); double base_time_ms = predict_base_elapsed_time_ms(_pending_cards); @@ -2972,7 +3047,3 @@ record_collection_pause_end(bool abandoned) { G1CollectorPolicy::record_collection_pause_end(abandoned); assert(assertMarkedBytesDataOK(), "Marked regions not OK at pause end."); } - -// Local Variables: *** -// c-indentation-style: gnu *** -// End: *** diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp index 0dff91a0b50..2b9eb83f074 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp @@ -316,6 +316,10 @@ private: bool verify_young_ages(HeapRegion* head, SurvRateGroup *surv_rate_group); #endif // PRODUCT + void adjust_concurrent_refinement(double update_rs_time, + double update_rs_processed_buffers, + double goal_ms); + protected: double _pause_time_target_ms; double _recorded_young_cset_choice_time_ms; diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1MMUTracker.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1MMUTracker.cpp index b0d0df45dd9..492adaef6fd 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1MMUTracker.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1MMUTracker.cpp @@ -86,12 +86,22 @@ void G1MMUTrackerQueue::add_pause(double start, double end, bool gc_thread) { // increase the array size (:-) // remove the oldest entry (this might allow more GC time for // the time slice than what's allowed) - // concolidate the two entries with the minimum gap between them - // (this mighte allow less GC time than what's allowed) - guarantee(0, "array full, currently we can't recover"); + // consolidate the two entries with the minimum gap between them + // (this might allow less GC time than what's allowed) + guarantee(NOT_PRODUCT(ScavengeALot ||) G1ForgetfulMMUTracker, + "array full, currently we can't recover unless +G1ForgetfulMMUTracker"); + // In the case where ScavengeALot is true, such overflow is not + // uncommon; in such cases, we can, without much loss of precision + // or performance (we are GC'ing most of the time anyway!), + // simply overwrite the oldest entry in the tracker: this + // is also the behaviour when G1ForgetfulMMUTracker is enabled. + _head_index = trim_index(_head_index + 1); + assert(_head_index == _tail_index, "Because we have a full circular buffer"); + _tail_index = trim_index(_tail_index + 1); + } else { + _head_index = trim_index(_head_index + 1); + ++_no_entries; } - _head_index = trim_index(_head_index + 1); - ++_no_entries; _array[_head_index] = G1MMUTrackerQueueElem(start, end); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1MMUTracker.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1MMUTracker.hpp index 0eff2c3867a..1030454a741 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1MMUTracker.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1MMUTracker.hpp @@ -99,7 +99,10 @@ private: // The array is of fixed size and I don't think we'll need more than // two or three entries with the current behaviour of G1 pauses. // If the array is full, an easy fix is to look for the pauses with - // the shortest gap between them and concolidate them. + // the shortest gap between them and consolidate them. + // For now, we have taken the expedient alternative of forgetting + // the oldest entry in the event that +G1ForgetfulMMUTracker, thus + // potentially violating MMU specs for some time thereafter. G1MMUTrackerQueueElem _array[QueueLength]; int _head_index; diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp index f710203a1e9..fa143ba9bb3 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp @@ -53,6 +53,15 @@ public: bool apply_to_weak_ref_discovered_field() { return true; } }; +class G1ParPushHeapRSClosure : public G1ParClosureSuper { +public: + G1ParPushHeapRSClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : + G1ParClosureSuper(g1, par_scan_state) { } + template void do_oop_nv(T* p); + virtual void do_oop(oop* p) { do_oop_nv(p); } + virtual void do_oop(narrowOop* p) { do_oop_nv(p); } +}; + class G1ParScanClosure : public G1ParClosureSuper { public: G1ParScanClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : @@ -100,7 +109,7 @@ public: }; template + bool do_mark_forwardee> class G1ParCopyClosure : public G1ParCopyHelper { G1ParScanClosure _scanner; template void do_oop_work(T* p); @@ -116,12 +125,13 @@ public: virtual void do_oop(narrowOop* p) { do_oop_nv(p); } }; -typedef G1ParCopyClosure G1ParScanExtRootClosure; -typedef G1ParCopyClosure G1ParScanPermClosure; -typedef G1ParCopyClosure G1ParScanHeapRSClosure; -typedef G1ParCopyClosure G1ParScanAndMarkExtRootClosure; -typedef G1ParCopyClosure G1ParScanAndMarkPermClosure; -typedef G1ParCopyClosure G1ParScanAndMarkHeapRSClosure; +typedef G1ParCopyClosure G1ParScanExtRootClosure; +typedef G1ParCopyClosure G1ParScanPermClosure; +typedef G1ParCopyClosure G1ParScanHeapRSClosure; +typedef G1ParCopyClosure G1ParScanAndMarkExtRootClosure; +typedef G1ParCopyClosure G1ParScanAndMarkPermClosure; +typedef G1ParCopyClosure G1ParScanAndMarkHeapRSClosure; + // This is the only case when we set skip_cset_test. Basically, this // closure is (should?) only be called directly while we're draining // the overflow and task queues. In that case we know that the @@ -132,7 +142,7 @@ typedef G1ParCopyClosure G1ParScanAndMarkHea // We need a separate closure to handle references during evacuation // failure processing, as we cannot asume that the reference already // points into the collection set (like G1ParScanHeapEvacClosure does). -typedef G1ParCopyClosure G1ParScanHeapEvacFailureClosure; +typedef G1ParCopyClosure G1ParScanHeapEvacFailureClosure; class FilterIntoCSClosure: public OopClosure { G1CollectedHeap* _g1; diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp index 2ba92a7f8d3..32697da3648 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp @@ -104,3 +104,16 @@ template inline void G1ParScanClosure::do_oop_nv(T* p) { } } } + +template inline void G1ParPushHeapRSClosure::do_oop_nv(T* p) { + T heap_oop = oopDesc::load_heap_oop(p); + + if (!oopDesc::is_null(heap_oop)) { + oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); + if (_g1->in_cset_fast_test(obj)) { + Prefetch::write(obj->mark_addr(), 0); + Prefetch::read(obj->mark_addr(), (HeapWordSize*2)); + _par_scan_state->push_on_queue(p); + } + } +} diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp index 224263e54ea..fa8916e52c5 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp @@ -155,8 +155,8 @@ class ScanRSClosure : public HeapRegionClosure { G1BlockOffsetSharedArray* _bot_shared; CardTableModRefBS *_ct_bs; int _worker_i; + int _block_size; bool _try_claimed; - size_t _min_skip_distance, _max_skip_distance; public: ScanRSClosure(OopsInHeapRegionClosure* oc, int worker_i) : _oc(oc), @@ -168,8 +168,7 @@ public: _g1h = G1CollectedHeap::heap(); _bot_shared = _g1h->bot_shared(); _ct_bs = (CardTableModRefBS*) (_g1h->barrier_set()); - _min_skip_distance = 16; - _max_skip_distance = 2 * _g1h->n_par_threads() * _min_skip_distance; + _block_size = MAX2(G1RSetScanBlockSize, 1); } void set_try_claimed() { _try_claimed = true; } @@ -225,12 +224,15 @@ public: HeapRegionRemSetIterator* iter = _g1h->rem_set_iterator(_worker_i); hrrs->init_iterator(iter); size_t card_index; - size_t skip_distance = 0, current_card = 0, jump_to_card = 0; - while (iter->has_next(card_index)) { - if (current_card < jump_to_card) { - ++current_card; - continue; + + // We claim cards in block so as to recude the contention. The block size is determined by + // the G1RSetScanBlockSize parameter. + size_t jump_to_card = hrrs->iter_claimed_next(_block_size); + for (size_t current_card = 0; iter->has_next(card_index); current_card++) { + if (current_card >= jump_to_card + _block_size) { + jump_to_card = hrrs->iter_claimed_next(_block_size); } + if (current_card < jump_to_card) continue; HeapWord* card_start = _g1h->bot_shared()->address_for_index(card_index); #if 0 gclog_or_tty->print("Rem set iteration yielded card [" PTR_FORMAT ", " PTR_FORMAT ").\n", @@ -247,22 +249,14 @@ public: // If the card is dirty, then we will scan it during updateRS. if (!card_region->in_collection_set() && !_ct_bs->is_card_dirty(card_index)) { - if (!_ct_bs->is_card_claimed(card_index) && _ct_bs->claim_card(card_index)) { - scanCard(card_index, card_region); - } else if (_try_claimed) { - if (jump_to_card == 0 || jump_to_card != current_card) { - // We did some useful work in the previous iteration. - // Decrease the distance. - skip_distance = MAX2(skip_distance >> 1, _min_skip_distance); - } else { - // Previous iteration resulted in a claim failure. - // Increase the distance. - skip_distance = MIN2(skip_distance << 1, _max_skip_distance); - } - jump_to_card = current_card + skip_distance; - } + // We make the card as "claimed" lazily (so races are possible but they're benign), + // which reduces the number of duplicate scans (the rsets of the regions in the cset + // can intersect). + if (!_ct_bs->is_card_claimed(card_index)) { + _ct_bs->set_card_claimed(card_index); + scanCard(card_index, card_region); + } } - ++current_card; } if (!_try_claimed) { hrrs->set_iter_complete(); @@ -299,30 +293,18 @@ void HRInto_G1RemSet::scanRS(OopsInHeapRegionClosure* oc, int worker_i) { double rs_time_start = os::elapsedTime(); HeapRegion *startRegion = calculateStartRegion(worker_i); - BufferingOopsInHeapRegionClosure boc(oc); - ScanRSClosure scanRScl(&boc, worker_i); + ScanRSClosure scanRScl(oc, worker_i); _g1->collection_set_iterate_from(startRegion, &scanRScl); scanRScl.set_try_claimed(); _g1->collection_set_iterate_from(startRegion, &scanRScl); - boc.done(); - double closure_app_time_sec = boc.closure_app_seconds(); - double scan_rs_time_sec = (os::elapsedTime() - rs_time_start) - - closure_app_time_sec; - double closure_app_time_ms = closure_app_time_sec * 1000.0; + double scan_rs_time_sec = os::elapsedTime() - rs_time_start; assert( _cards_scanned != NULL, "invariant" ); _cards_scanned[worker_i] = scanRScl.cards_done(); _g1p->record_scan_rs_start_time(worker_i, rs_time_start * 1000.0); _g1p->record_scan_rs_time(worker_i, scan_rs_time_sec * 1000.0); - - double scan_new_refs_time_ms = _g1p->get_scan_new_refs_time(worker_i); - if (scan_new_refs_time_ms > 0.0) { - closure_app_time_ms += scan_new_refs_time_ms; - } - - _g1p->record_obj_copy_time(worker_i, closure_app_time_ms); } void HRInto_G1RemSet::updateRS(int worker_i) { @@ -449,9 +431,8 @@ HRInto_G1RemSet::scanNewRefsRS_work(OopsInHeapRegionClosure* oc, oc->do_oop(p); } } - _g1p->record_scan_new_refs_time(worker_i, - (os::elapsedTime() - scan_new_refs_start_sec) - * 1000.0); + double scan_new_refs_time_ms = (os::elapsedTime() - scan_new_refs_start_sec) * 1000.0; + _g1p->record_scan_new_refs_time(worker_i, scan_new_refs_time_ms); } void HRInto_G1RemSet::cleanupHRRS() { diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp index c941c8755d6..7e084731a2d 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp @@ -85,7 +85,7 @@ diagnostic(bool, G1SummarizeZFStats, false, \ "Summarize zero-filling info") \ \ - develop(bool, G1TraceConcurrentRefinement, false, \ + diagnostic(bool, G1TraceConcurrentRefinement, false, \ "Trace G1 concurrent refinement") \ \ product(intx, G1MarkStackSize, 2 * 1024 * 1024, \ @@ -94,19 +94,6 @@ product(intx, G1MarkRegionStackSize, 1024 * 1024, \ "Size of the region stack for concurrent marking.") \ \ - develop(bool, G1ConcRefine, true, \ - "If true, run concurrent rem set refinement for G1") \ - \ - develop(intx, G1ConcRefineTargTraversals, 4, \ - "Number of concurrent refinement we try to achieve") \ - \ - develop(intx, G1ConcRefineInitialDelta, 4, \ - "Number of heap regions of alloc ahead of starting collection " \ - "pause to start concurrent refinement (initially)") \ - \ - develop(bool, G1SmoothConcRefine, true, \ - "Attempts to smooth out the overhead of concurrent refinement") \ - \ develop(bool, G1ConcZeroFill, true, \ "If true, run concurrent zero-filling thread") \ \ @@ -178,13 +165,38 @@ product(intx, G1UpdateBufferSize, 256, \ "Size of an update buffer") \ \ - product(intx, G1UpdateBufferQueueProcessingThreshold, 5, \ + product(intx, G1ConcRefineYellowZone, 0, \ "Number of enqueued update buffers that will " \ - "trigger concurrent processing") \ + "trigger concurrent processing. Will be selected ergonomically " \ + "by default.") \ \ - product(intx, G1UpdateBufferQueueMaxLength, 30, \ + product(intx, G1ConcRefineRedZone, 0, \ "Maximum number of enqueued update buffers before mutator " \ - "threads start processing new ones instead of enqueueing them") \ + "threads start processing new ones instead of enqueueing them. " \ + "Will be selected ergonomically by default. Zero will disable " \ + "concurrent processing.") \ + \ + product(intx, G1ConcRefineGreenZone, 0, \ + "The number of update buffers that are left in the queue by the " \ + "concurrent processing threads. Will be selected ergonomically " \ + "by default.") \ + \ + product(intx, G1ConcRefineServiceInterval, 300, \ + "The last concurrent refinement thread wakes up every " \ + "specified number of milliseconds to do miscellaneous work.") \ + \ + product(intx, G1ConcRefineThresholdStep, 0, \ + "Each time the rset update queue increases by this amount " \ + "activate the next refinement thread if available. " \ + "Will be selected ergonomically by default.") \ + \ + product(intx, G1RSUpdatePauseFractionPercent, 10, \ + "A target percentage of time that is allowed to be spend on " \ + "process RS update buffers during the collection pause.") \ + \ + product(bool, G1AdaptiveConcRefine, true, \ + "Select green, yellow and red zones adaptively to meet the " \ + "the pause requirements.") \ \ develop(intx, G1ConcRSLogCacheSize, 10, \ "Log base 2 of the length of conc RS hot-card cache.") \ @@ -195,8 +207,20 @@ develop(bool, G1PrintOopAppls, false, \ "When true, print applications of closures to external locs.") \ \ - develop(intx, G1LogRSRegionEntries, 7, \ - "Log_2 of max number of regions for which we keep bitmaps.") \ + develop(intx, G1RSetRegionEntriesBase, 256, \ + "Max number of regions in a fine-grain table per MB.") \ + \ + product(intx, G1RSetRegionEntries, 0, \ + "Max number of regions for which we keep bitmaps." \ + "Will be set ergonomically by default") \ + \ + develop(intx, G1RSetSparseRegionEntriesBase, 4, \ + "Max number of entries per region in a sparse table " \ + "per MB.") \ + \ + product(intx, G1RSetSparseRegionEntries, 0, \ + "Max number of entries per region in a sparse table." \ + "Will be set ergonomically by default.") \ \ develop(bool, G1RecordHRRSOops, false, \ "When true, record recent calls to rem set operations.") \ @@ -242,6 +266,10 @@ product(bool, G1UseSurvivorSpaces, true, \ "When true, use survivor space.") \ \ + develop(bool, G1FailOnFPError, false, \ + "When set, G1 will fail when it encounters an FP 'error', " \ + "so as to allow debugging") \ + \ develop(bool, G1FixedTenuringThreshold, false, \ "When set, G1 will not adjust the tenuring threshold") \ \ @@ -252,6 +280,9 @@ "If non-0 is the size of the G1 survivor space, " \ "otherwise SurvivorRatio is used to determine the size") \ \ + product(bool, G1ForgetfulMMUTracker, false, \ + "If the MMU tracker's memory is full, forget the oldest entry") \ + \ product(uintx, G1HeapRegionSize, 0, \ "Size of the G1 regions.") \ \ @@ -272,6 +303,14 @@ "a particular entry exceeds this value.") \ \ develop(bool, G1VerifyCTCleanup, false, \ - "Verify card table cleanup.") + "Verify card table cleanup.") \ + \ + product(uintx, G1RSetScanBlockSize, 64, \ + "Size of a work unit of cards claimed by a worker thread" \ + "during RSet scanning.") \ + \ + develop(bool, ReduceInitialCardMarksForG1, false, \ + "When ReduceInitialCardMarks is true, this flag setting " \ + " controls whether G1 allows the RICM optimization") G1_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_EXPERIMENTAL_FLAG, DECLARE_NOTPRODUCT_FLAG, DECLARE_MANAGEABLE_FLAG, DECLARE_PRODUCT_RW_FLAG) diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp index 101d330077e..266bbb5abdc 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1_specialized_oop_closures.hpp @@ -33,11 +33,12 @@ enum G1Barrier { }; template + bool do_mark_forwardee> class G1ParCopyClosure; class G1ParScanClosure; +class G1ParPushHeapRSClosure; -typedef G1ParCopyClosure G1ParScanHeapEvacClosure; +typedef G1ParCopyClosure G1ParScanHeapEvacClosure; class FilterIntoCSClosure; class FilterOutOfRegionClosure; @@ -51,6 +52,7 @@ class FilterAndMarkInHeapRegionAndIntoCSClosure; #define FURTHER_SPECIALIZED_OOP_OOP_ITERATE_CLOSURES(f) \ f(G1ParScanHeapEvacClosure,_nv) \ f(G1ParScanClosure,_nv) \ + f(G1ParPushHeapRSClosure,_nv) \ f(FilterIntoCSClosure,_nv) \ f(FilterOutOfRegionClosure,_nv) \ f(FilterInHeapRegionAndIntoCSClosure,_nv) \ diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp index dd04bc8dcb8..883b2b1ef26 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp @@ -258,42 +258,6 @@ class PosParPRT: public PerRegionTable { ReserveParTableExpansion = 1 }; - void par_expand() { - int n = HeapRegionRemSet::num_par_rem_sets()-1; - if (n <= 0) return; - if (_par_tables == NULL) { - PerRegionTable* res = - (PerRegionTable*) - Atomic::cmpxchg_ptr((PerRegionTable*)ReserveParTableExpansion, - &_par_tables, NULL); - if (res != NULL) return; - // Otherwise, we reserved the right to do the expansion. - - PerRegionTable** ptables = NEW_C_HEAP_ARRAY(PerRegionTable*, n); - for (int i = 0; i < n; i++) { - PerRegionTable* ptable = PerRegionTable::alloc(hr()); - ptables[i] = ptable; - } - // Here we do not need an atomic. - _par_tables = ptables; -#if COUNT_PAR_EXPANDS - print_par_expand(); -#endif - // We must put this table on the expanded list. - PosParPRT* exp_head = _par_expanded_list; - while (true) { - set_next_par_expanded(exp_head); - PosParPRT* res = - (PosParPRT*) - Atomic::cmpxchg_ptr(this, &_par_expanded_list, exp_head); - if (res == exp_head) return; - // Otherwise. - exp_head = res; - } - ShouldNotReachHere(); - } - } - void par_contract() { assert(_par_tables != NULL, "Precondition."); int n = HeapRegionRemSet::num_par_rem_sets()-1; @@ -391,13 +355,49 @@ public: void set_next(PosParPRT* nxt) { _next = nxt; } PosParPRT** next_addr() { return &_next; } + bool should_expand(int tid) { + return par_tables() == NULL && tid > 0 && hr()->is_gc_alloc_region(); + } + + void par_expand() { + int n = HeapRegionRemSet::num_par_rem_sets()-1; + if (n <= 0) return; + if (_par_tables == NULL) { + PerRegionTable* res = + (PerRegionTable*) + Atomic::cmpxchg_ptr((PerRegionTable*)ReserveParTableExpansion, + &_par_tables, NULL); + if (res != NULL) return; + // Otherwise, we reserved the right to do the expansion. + + PerRegionTable** ptables = NEW_C_HEAP_ARRAY(PerRegionTable*, n); + for (int i = 0; i < n; i++) { + PerRegionTable* ptable = PerRegionTable::alloc(hr()); + ptables[i] = ptable; + } + // Here we do not need an atomic. + _par_tables = ptables; +#if COUNT_PAR_EXPANDS + print_par_expand(); +#endif + // We must put this table on the expanded list. + PosParPRT* exp_head = _par_expanded_list; + while (true) { + set_next_par_expanded(exp_head); + PosParPRT* res = + (PosParPRT*) + Atomic::cmpxchg_ptr(this, &_par_expanded_list, exp_head); + if (res == exp_head) return; + // Otherwise. + exp_head = res; + } + ShouldNotReachHere(); + } + } + void add_reference(OopOrNarrowOopStar from, int tid) { // Expand if necessary. PerRegionTable** pt = par_tables(); - if (par_tables() == NULL && tid > 0 && hr()->is_gc_alloc_region()) { - par_expand(); - pt = par_tables(); - } if (pt != NULL) { // We always have to assume that mods to table 0 are in parallel, // because of the claiming scheme in parallel expansion. A thread @@ -505,12 +505,13 @@ OtherRegionsTable::OtherRegionsTable(HeapRegion* hr) : typedef PosParPRT* PosParPRTPtr; if (_max_fine_entries == 0) { assert(_mod_max_fine_entries_mask == 0, "Both or none."); - _max_fine_entries = (size_t)(1 << G1LogRSRegionEntries); + size_t max_entries_log = (size_t)log2_long((jlong)G1RSetRegionEntries); + _max_fine_entries = (size_t)(1 << max_entries_log); _mod_max_fine_entries_mask = _max_fine_entries - 1; #if SAMPLE_FOR_EVICTION assert(_fine_eviction_sample_size == 0 && _fine_eviction_stride == 0, "All init at same time."); - _fine_eviction_sample_size = MAX2((size_t)4, (size_t)G1LogRSRegionEntries); + _fine_eviction_sample_size = MAX2((size_t)4, max_entries_log); _fine_eviction_stride = _max_fine_entries / _fine_eviction_sample_size; #endif } @@ -655,13 +656,6 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, int tid) { #endif } - // Otherwise, transfer from sparse to fine-grain. - CardIdx_t cards[SparsePRTEntry::CardsPerEntry]; - if (G1HRRSUseSparseTable) { - bool res = _sparse_table.get_cards(from_hrs_ind, &cards[0]); - assert(res, "There should have been an entry"); - } - if (_n_fine_entries == _max_fine_entries) { prt = delete_region_table(); } else { @@ -676,10 +670,12 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, int tid) { _fine_grain_regions[ind] = prt; _n_fine_entries++; - // Add in the cards from the sparse table. if (G1HRRSUseSparseTable) { - for (int i = 0; i < SparsePRTEntry::CardsPerEntry; i++) { - CardIdx_t c = cards[i]; + // Transfer from sparse to fine-grain. + SparsePRTEntry *sprt_entry = _sparse_table.get_entry(from_hrs_ind); + assert(sprt_entry != NULL, "There should have been an entry"); + for (int i = 0; i < SparsePRTEntry::cards_num(); i++) { + CardIdx_t c = sprt_entry->card(i); if (c != SparsePRTEntry::NullEntry) { prt->add_card(c); } @@ -696,7 +692,21 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, int tid) { // OtherRegionsTable for why this is OK. assert(prt != NULL, "Inv"); - prt->add_reference(from, tid); + if (prt->should_expand(tid)) { + MutexLockerEx x(&_m, Mutex::_no_safepoint_check_flag); + HeapRegion* prt_hr = prt->hr(); + if (prt_hr == from_hr) { + // Make sure the table still corresponds to the same region + prt->par_expand(); + prt->add_reference(from, tid); + } + // else: The table has been concurrently coarsened, evicted, and + // the table data structure re-used for another table. So, we + // don't need to add the reference any more given that the table + // has been coarsened and the whole region will be scanned anyway. + } else { + prt->add_reference(from, tid); + } if (G1RecordHRRSOops) { HeapRegionRemSet::record(hr(), from); #if HRRS_VERBOSE @@ -1070,6 +1080,19 @@ HeapRegionRemSet::HeapRegionRemSet(G1BlockOffsetSharedArray* bosa, {} +void HeapRegionRemSet::setup_remset_size() { + // Setup sparse and fine-grain tables sizes. + // table_size = base * (log(region_size / 1M) + 1) + int region_size_log_mb = MAX2((int)HeapRegion::LogOfHRGrainBytes - (int)LOG_M, 0); + if (FLAG_IS_DEFAULT(G1RSetSparseRegionEntries)) { + G1RSetSparseRegionEntries = G1RSetSparseRegionEntriesBase * (region_size_log_mb + 1); + } + if (FLAG_IS_DEFAULT(G1RSetRegionEntries)) { + G1RSetRegionEntries = G1RSetRegionEntriesBase * (region_size_log_mb + 1); + } + guarantee(G1RSetSparseRegionEntries > 0 && G1RSetRegionEntries > 0 , "Sanity"); +} + void HeapRegionRemSet::init_for_par_iteration() { _iter_state = Unclaimed; } @@ -1385,7 +1408,7 @@ void HeapRegionRemSet::test() { os::sleep(Thread::current(), (jlong)5000, false); G1CollectedHeap* g1h = G1CollectedHeap::heap(); - // Run with "-XX:G1LogRSRegionEntries=2", so that 1 and 5 end up in same + // Run with "-XX:G1LogRSetRegionEntries=2", so that 1 and 5 end up in same // hash bucket. HeapRegion* hr0 = g1h->region_at(0); HeapRegion* hr1 = g1h->region_at(1); diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp index d525b5ad306..c51286290af 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.hpp @@ -187,7 +187,8 @@ private: void clear_outgoing_entries(); enum ParIterState { Unclaimed, Claimed, Complete }; - ParIterState _iter_state; + volatile ParIterState _iter_state; + volatile jlong _iter_claimed; // Unused unless G1RecordHRRSOops is true. @@ -209,6 +210,7 @@ public: HeapRegion* hr); static int num_par_rem_sets(); + static void setup_remset_size(); HeapRegion* hr() const { return _other_regions.hr(); @@ -272,6 +274,19 @@ public: // Returns "true" iff the region's iteration is complete. bool iter_is_complete(); + // Support for claiming blocks of cards during iteration + void set_iter_claimed(size_t x) { _iter_claimed = (jlong)x; } + size_t iter_claimed() const { return (size_t)_iter_claimed; } + // Claim the next block of cards + size_t iter_claimed_next(size_t step) { + size_t current, next; + do { + current = iter_claimed(); + next = current + step; + } while (Atomic::cmpxchg((jlong)next, &_iter_claimed, (jlong)current) != (jlong)current); + return current; + } + // Initialize the given iterator to iterate over this rem set. void init_iterator(HeapRegionRemSetIterator* iter) const; diff --git a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp index 060743dd38a..4a3fac2faaf 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.cpp @@ -64,8 +64,8 @@ void PtrQueue::enqueue_known_active(void* ptr) { while (_index == 0) { handle_zero_index(); } - assert(_index > 0, "postcondition"); + assert(_index > 0, "postcondition"); _index -= oopSize; _buf[byte_index_to_index((int)_index)] = ptr; assert(0 <= _index && _index <= _sz, "Invariant."); @@ -73,7 +73,12 @@ void PtrQueue::enqueue_known_active(void* ptr) { void PtrQueue::locking_enqueue_completed_buffer(void** buf) { assert(_lock->owned_by_self(), "Required."); + + // We have to unlock _lock (which may be Shared_DirtyCardQ_lock) before + // we acquire DirtyCardQ_CBL_mon inside enqeue_complete_buffer as they + // have the same rank and we may get the "possible deadlock" message _lock->unlock(); + qset()->enqueue_complete_buffer(buf); // We must relock only because the caller will unlock, for the normal // case. @@ -99,94 +104,139 @@ void** PtrQueueSet::allocate_buffer() { assert(_sz > 0, "Didn't set a buffer size."); MutexLockerEx x(_fl_owner->_fl_lock, Mutex::_no_safepoint_check_flag); if (_fl_owner->_buf_free_list != NULL) { - void** res = _fl_owner->_buf_free_list; - _fl_owner->_buf_free_list = (void**)_fl_owner->_buf_free_list[0]; + void** res = BufferNode::make_buffer_from_node(_fl_owner->_buf_free_list); + _fl_owner->_buf_free_list = _fl_owner->_buf_free_list->next(); _fl_owner->_buf_free_list_sz--; - // Just override the next pointer with NULL, just in case we scan this part - // of the buffer. - res[0] = NULL; return res; } else { - return NEW_C_HEAP_ARRAY(void*, _sz); + // Allocate space for the BufferNode in front of the buffer. + char *b = NEW_C_HEAP_ARRAY(char, _sz + BufferNode::aligned_size()); + return BufferNode::make_buffer_from_block(b); } } void PtrQueueSet::deallocate_buffer(void** buf) { assert(_sz > 0, "Didn't set a buffer size."); MutexLockerEx x(_fl_owner->_fl_lock, Mutex::_no_safepoint_check_flag); - buf[0] = (void*)_fl_owner->_buf_free_list; - _fl_owner->_buf_free_list = buf; + BufferNode *node = BufferNode::make_node_from_buffer(buf); + node->set_next(_fl_owner->_buf_free_list); + _fl_owner->_buf_free_list = node; _fl_owner->_buf_free_list_sz++; } void PtrQueueSet::reduce_free_list() { + assert(_fl_owner == this, "Free list reduction is allowed only for the owner"); // For now we'll adopt the strategy of deleting half. MutexLockerEx x(_fl_lock, Mutex::_no_safepoint_check_flag); size_t n = _buf_free_list_sz / 2; while (n > 0) { assert(_buf_free_list != NULL, "_buf_free_list_sz must be wrong."); - void** head = _buf_free_list; - _buf_free_list = (void**)_buf_free_list[0]; - FREE_C_HEAP_ARRAY(void*,head); + void* b = BufferNode::make_block_from_node(_buf_free_list); + _buf_free_list = _buf_free_list->next(); + FREE_C_HEAP_ARRAY(char, b); + _buf_free_list_sz --; n--; } } -void PtrQueueSet::enqueue_complete_buffer(void** buf, size_t index, bool ignore_max_completed) { - // I use explicit locking here because there's a bailout in the middle. - _cbl_mon->lock_without_safepoint_check(); +void PtrQueue::handle_zero_index() { + assert(0 == _index, "Precondition."); + // This thread records the full buffer and allocates a new one (while + // holding the lock if there is one). + if (_buf != NULL) { + if (_lock) { + assert(_lock->owned_by_self(), "Required."); - Thread* thread = Thread::current(); - assert( ignore_max_completed || - thread->is_Java_thread() || - SafepointSynchronize::is_at_safepoint(), - "invariant" ); - ignore_max_completed = ignore_max_completed || !thread->is_Java_thread(); + // The current PtrQ may be the shared dirty card queue and + // may be being manipulated by more than one worker thread + // during a pause. Since the enqueuing of the completed + // buffer unlocks the Shared_DirtyCardQ_lock more than one + // worker thread can 'race' on reading the shared queue attributes + // (_buf and _index) and multiple threads can call into this + // routine for the same buffer. This will cause the completed + // buffer to be added to the CBL multiple times. - if (!ignore_max_completed && _max_completed_queue > 0 && - _n_completed_buffers >= (size_t) _max_completed_queue) { - _cbl_mon->unlock(); - bool b = mut_process_buffer(buf); - if (b) { - deallocate_buffer(buf); - return; + // We "claim" the current buffer by caching value of _buf in + // a local and clearing the field while holding _lock. When + // _lock is released (while enqueueing the completed buffer) + // the thread that acquires _lock will skip this code, + // preventing the subsequent the multiple enqueue, and + // install a newly allocated buffer below. + + void** buf = _buf; // local pointer to completed buffer + _buf = NULL; // clear shared _buf field + + locking_enqueue_completed_buffer(buf); // enqueue completed buffer + + // While the current thread was enqueuing the buffer another thread + // may have a allocated a new buffer and inserted it into this pointer + // queue. If that happens then we just return so that the current + // thread doesn't overwrite the buffer allocated by the other thread + // and potentially losing some dirtied cards. + + if (_buf != NULL) return; + } else { + if (qset()->process_or_enqueue_complete_buffer(_buf)) { + // Recycle the buffer. No allocation. + _sz = qset()->buffer_size(); + _index = _sz; + return; + } } - - // Otherwise, go ahead and enqueue the buffer. Must reaquire the lock. - _cbl_mon->lock_without_safepoint_check(); } + // Reallocate the buffer + _buf = qset()->allocate_buffer(); + _sz = qset()->buffer_size(); + _index = _sz; + assert(0 <= _index && _index <= _sz, "Invariant."); +} - // Here we still hold the _cbl_mon. - CompletedBufferNode* cbn = new CompletedBufferNode; - cbn->buf = buf; - cbn->next = NULL; - cbn->index = index; +bool PtrQueueSet::process_or_enqueue_complete_buffer(void** buf) { + if (Thread::current()->is_Java_thread()) { + // We don't lock. It is fine to be epsilon-precise here. + if (_max_completed_queue == 0 || _max_completed_queue > 0 && + _n_completed_buffers >= _max_completed_queue + _completed_queue_padding) { + bool b = mut_process_buffer(buf); + if (b) { + // True here means that the buffer hasn't been deallocated and the caller may reuse it. + return true; + } + } + } + // The buffer will be enqueued. The caller will have to get a new one. + enqueue_complete_buffer(buf); + return false; +} + +void PtrQueueSet::enqueue_complete_buffer(void** buf, size_t index) { + MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag); + BufferNode* cbn = BufferNode::new_from_buffer(buf); + cbn->set_index(index); if (_completed_buffers_tail == NULL) { assert(_completed_buffers_head == NULL, "Well-formedness"); _completed_buffers_head = cbn; _completed_buffers_tail = cbn; } else { - _completed_buffers_tail->next = cbn; + _completed_buffers_tail->set_next(cbn); _completed_buffers_tail = cbn; } _n_completed_buffers++; - if (!_process_completed && + if (!_process_completed && _process_completed_threshold >= 0 && _n_completed_buffers >= _process_completed_threshold) { _process_completed = true; if (_notify_when_complete) - _cbl_mon->notify_all(); + _cbl_mon->notify(); } debug_only(assert_completed_buffer_list_len_correct_locked()); - _cbl_mon->unlock(); } int PtrQueueSet::completed_buffers_list_length() { int n = 0; - CompletedBufferNode* cbn = _completed_buffers_head; + BufferNode* cbn = _completed_buffers_head; while (cbn != NULL) { n++; - cbn = cbn->next; + cbn = cbn->next(); } return n; } @@ -197,7 +247,7 @@ void PtrQueueSet::assert_completed_buffer_list_len_correct() { } void PtrQueueSet::assert_completed_buffer_list_len_correct_locked() { - guarantee((size_t)completed_buffers_list_length() == _n_completed_buffers, + guarantee(completed_buffers_list_length() == _n_completed_buffers, "Completed buffer length is wrong."); } @@ -206,12 +256,8 @@ void PtrQueueSet::set_buffer_size(size_t sz) { _sz = sz * oopSize; } -void PtrQueueSet::set_process_completed_threshold(size_t sz) { - _process_completed_threshold = sz; -} - -// Merge lists of buffers. Notify waiting threads if the length of the list -// exceeds threshold. The source queue is emptied as a result. The queues +// Merge lists of buffers. Notify the processing threads. +// The source queue is emptied as a result. The queues // must share the monitor. void PtrQueueSet::merge_bufferlists(PtrQueueSet *src) { assert(_cbl_mon == src->_cbl_mon, "Should share the same lock"); @@ -223,7 +269,7 @@ void PtrQueueSet::merge_bufferlists(PtrQueueSet *src) { } else { assert(_completed_buffers_head != NULL, "Well formedness"); if (src->_completed_buffers_head != NULL) { - _completed_buffers_tail->next = src->_completed_buffers_head; + _completed_buffers_tail->set_next(src->_completed_buffers_head); _completed_buffers_tail = src->_completed_buffers_tail; } } @@ -236,31 +282,13 @@ void PtrQueueSet::merge_bufferlists(PtrQueueSet *src) { assert(_completed_buffers_head == NULL && _completed_buffers_tail == NULL || _completed_buffers_head != NULL && _completed_buffers_tail != NULL, "Sanity"); +} - if (!_process_completed && - _n_completed_buffers >= _process_completed_threshold) { +void PtrQueueSet::notify_if_necessary() { + MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag); + if (_n_completed_buffers >= _process_completed_threshold || _max_completed_queue == 0) { _process_completed = true; if (_notify_when_complete) - _cbl_mon->notify_all(); + _cbl_mon->notify(); } } - -// Merge free lists of the two queues. The free list of the source -// queue is emptied as a result. The queues must share the same -// mutex that guards free lists. -void PtrQueueSet::merge_freelists(PtrQueueSet* src) { - assert(_fl_lock == src->_fl_lock, "Should share the same lock"); - MutexLockerEx x(_fl_lock, Mutex::_no_safepoint_check_flag); - if (_buf_free_list != NULL) { - void **p = _buf_free_list; - while (*p != NULL) { - p = (void**)*p; - } - *p = src->_buf_free_list; - } else { - _buf_free_list = src->_buf_free_list; - } - _buf_free_list_sz += src->_buf_free_list_sz; - src->_buf_free_list = NULL; - src->_buf_free_list_sz = 0; -} diff --git a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp index 663dcba4fa6..ccf5b207c76 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.hpp @@ -27,8 +27,10 @@ // the addresses of modified old-generation objects. This type supports // this operation. -class PtrQueueSet; +// The definition of placement operator new(size_t, void*) in the . +#include +class PtrQueueSet; class PtrQueue VALUE_OBJ_CLASS_SPEC { protected: @@ -77,7 +79,7 @@ public: else enqueue_known_active(ptr); } - inline void handle_zero_index(); + void handle_zero_index(); void locking_enqueue_completed_buffer(void** buf); void enqueue_known_active(void* ptr); @@ -126,34 +128,65 @@ public: }; +class BufferNode { + size_t _index; + BufferNode* _next; +public: + BufferNode() : _index(0), _next(NULL) { } + BufferNode* next() const { return _next; } + void set_next(BufferNode* n) { _next = n; } + size_t index() const { return _index; } + void set_index(size_t i) { _index = i; } + + // Align the size of the structure to the size of the pointer + static size_t aligned_size() { + static const size_t alignment = round_to(sizeof(BufferNode), sizeof(void*)); + return alignment; + } + + // BufferNode is allocated before the buffer. + // The chunk of memory that holds both of them is a block. + + // Produce a new BufferNode given a buffer. + static BufferNode* new_from_buffer(void** buf) { + return new (make_block_from_buffer(buf)) BufferNode; + } + + // The following are the required conversion routines: + static BufferNode* make_node_from_buffer(void** buf) { + return (BufferNode*)make_block_from_buffer(buf); + } + static void** make_buffer_from_node(BufferNode *node) { + return make_buffer_from_block(node); + } + static void* make_block_from_node(BufferNode *node) { + return (void*)node; + } + static void** make_buffer_from_block(void* p) { + return (void**)((char*)p + aligned_size()); + } + static void* make_block_from_buffer(void** p) { + return (void*)((char*)p - aligned_size()); + } +}; + // A PtrQueueSet represents resources common to a set of pointer queues. // In particular, the individual queues allocate buffers from this shared // set, and return completed buffers to the set. // All these variables are are protected by the TLOQ_CBL_mon. XXX ??? class PtrQueueSet VALUE_OBJ_CLASS_SPEC { - protected: - - class CompletedBufferNode: public CHeapObj { - public: - void** buf; - size_t index; - CompletedBufferNode* next; - CompletedBufferNode() : buf(NULL), - index(0), next(NULL){ } - }; - Monitor* _cbl_mon; // Protects the fields below. - CompletedBufferNode* _completed_buffers_head; - CompletedBufferNode* _completed_buffers_tail; - size_t _n_completed_buffers; - size_t _process_completed_threshold; + BufferNode* _completed_buffers_head; + BufferNode* _completed_buffers_tail; + int _n_completed_buffers; + int _process_completed_threshold; volatile bool _process_completed; // This (and the interpretation of the first element as a "next" // pointer) are protected by the TLOQ_FL_lock. Mutex* _fl_lock; - void** _buf_free_list; + BufferNode* _buf_free_list; size_t _buf_free_list_sz; // Queue set can share a freelist. The _fl_owner variable // specifies the owner. It is set to "this" by default. @@ -170,6 +203,7 @@ protected: // Maximum number of elements allowed on completed queue: after that, // enqueuer does the work itself. Zero indicates no maximum. int _max_completed_queue; + int _completed_queue_padding; int completed_buffers_list_length(); void assert_completed_buffer_list_len_correct_locked(); @@ -191,9 +225,12 @@ public: // Because of init-order concerns, we can't pass these as constructor // arguments. void initialize(Monitor* cbl_mon, Mutex* fl_lock, - int max_completed_queue = 0, + int process_completed_threshold, + int max_completed_queue, PtrQueueSet *fl_owner = NULL) { _max_completed_queue = max_completed_queue; + _process_completed_threshold = process_completed_threshold; + _completed_queue_padding = 0; assert(cbl_mon != NULL && fl_lock != NULL, "Init order issue?"); _cbl_mon = cbl_mon; _fl_lock = fl_lock; @@ -208,14 +245,17 @@ public: void deallocate_buffer(void** buf); // Declares that "buf" is a complete buffer. - void enqueue_complete_buffer(void** buf, size_t index = 0, - bool ignore_max_completed = false); + void enqueue_complete_buffer(void** buf, size_t index = 0); + + // To be invoked by the mutator. + bool process_or_enqueue_complete_buffer(void** buf); bool completed_buffers_exist_dirty() { return _n_completed_buffers > 0; } bool process_completed_buffers() { return _process_completed; } + void set_process_completed(bool x) { _process_completed = x; } bool active() { return _all_active; } @@ -226,15 +266,24 @@ public: // Get the buffer size. size_t buffer_size() { return _sz; } - // Set the number of completed buffers that triggers log processing. - void set_process_completed_threshold(size_t sz); + // Get/Set the number of completed buffers that triggers log processing. + void set_process_completed_threshold(int sz) { _process_completed_threshold = sz; } + int process_completed_threshold() const { return _process_completed_threshold; } // Must only be called at a safe point. Indicates that the buffer free // list size may be reduced, if that is deemed desirable. void reduce_free_list(); - size_t completed_buffers_num() { return _n_completed_buffers; } + int completed_buffers_num() { return _n_completed_buffers; } void merge_bufferlists(PtrQueueSet* src); - void merge_freelists(PtrQueueSet* src); + + void set_max_completed_queue(int m) { _max_completed_queue = m; } + int max_completed_queue() { return _max_completed_queue; } + + void set_completed_queue_padding(int padding) { _completed_queue_padding = padding; } + int completed_queue_padding() { return _completed_queue_padding; } + + // Notify the consumer if the number of buffers crossed the threshold + void notify_if_necessary(); }; diff --git a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp index 3cf402ce7a8..8efdc3b9c23 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp @@ -67,9 +67,9 @@ SATBMarkQueueSet::SATBMarkQueueSet() : {} void SATBMarkQueueSet::initialize(Monitor* cbl_mon, Mutex* fl_lock, - int max_completed_queue, + int process_completed_threshold, Mutex* lock) { - PtrQueueSet::initialize(cbl_mon, fl_lock, max_completed_queue); + PtrQueueSet::initialize(cbl_mon, fl_lock, process_completed_threshold, -1); _shared_satb_queue.set_lock(lock); if (ParallelGCThreads > 0) { _par_closures = NEW_C_HEAP_ARRAY(ObjectClosure*, ParallelGCThreads); @@ -122,12 +122,12 @@ void SATBMarkQueueSet::par_iterate_closure_all_threads(int worker) { bool SATBMarkQueueSet::apply_closure_to_completed_buffer_work(bool par, int worker) { - CompletedBufferNode* nd = NULL; + BufferNode* nd = NULL; { MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag); if (_completed_buffers_head != NULL) { nd = _completed_buffers_head; - _completed_buffers_head = nd->next; + _completed_buffers_head = nd->next(); if (_completed_buffers_head == NULL) _completed_buffers_tail = NULL; _n_completed_buffers--; if (_n_completed_buffers == 0) _process_completed = false; @@ -135,9 +135,9 @@ bool SATBMarkQueueSet::apply_closure_to_completed_buffer_work(bool par, } ObjectClosure* cl = (par ? _par_closures[worker] : _closure); if (nd != NULL) { - ObjPtrQueue::apply_closure_to_buffer(cl, nd->buf, 0, _sz); - deallocate_buffer(nd->buf); - delete nd; + void **buf = BufferNode::make_buffer_from_node(nd); + ObjPtrQueue::apply_closure_to_buffer(cl, buf, 0, _sz); + deallocate_buffer(buf); return true; } else { return false; @@ -145,13 +145,13 @@ bool SATBMarkQueueSet::apply_closure_to_completed_buffer_work(bool par, } void SATBMarkQueueSet::abandon_partial_marking() { - CompletedBufferNode* buffers_to_delete = NULL; + BufferNode* buffers_to_delete = NULL; { MutexLockerEx x(_cbl_mon, Mutex::_no_safepoint_check_flag); while (_completed_buffers_head != NULL) { - CompletedBufferNode* nd = _completed_buffers_head; - _completed_buffers_head = nd->next; - nd->next = buffers_to_delete; + BufferNode* nd = _completed_buffers_head; + _completed_buffers_head = nd->next(); + nd->set_next(buffers_to_delete); buffers_to_delete = nd; } _completed_buffers_tail = NULL; @@ -159,10 +159,9 @@ void SATBMarkQueueSet::abandon_partial_marking() { DEBUG_ONLY(assert_completed_buffer_list_len_correct_locked()); } while (buffers_to_delete != NULL) { - CompletedBufferNode* nd = buffers_to_delete; - buffers_to_delete = nd->next; - deallocate_buffer(nd->buf); - delete nd; + BufferNode* nd = buffers_to_delete; + buffers_to_delete = nd->next(); + deallocate_buffer(BufferNode::make_buffer_from_node(nd)); } assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint."); // So we can safely manipulate these queues. diff --git a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp index ed1181dd79f..76218a6363b 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp @@ -60,8 +60,8 @@ public: SATBMarkQueueSet(); void initialize(Monitor* cbl_mon, Mutex* fl_lock, - int max_completed_queue = 0, - Mutex* lock = NULL); + int process_completed_threshold, + Mutex* lock); static void handle_zero_index_for_thread(JavaThread* t); diff --git a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp index cef8297a367..c6b835b3513 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp @@ -27,7 +27,7 @@ #define SPARSE_PRT_VERBOSE 0 -#define UNROLL_CARD_LOOPS 1 +#define UNROLL_CARD_LOOPS 1 void SparsePRT::init_iterator(SparsePRTIter* sprt_iter) { sprt_iter->init(this); @@ -36,27 +36,32 @@ void SparsePRT::init_iterator(SparsePRTIter* sprt_iter) { void SparsePRTEntry::init(RegionIdx_t region_ind) { _region_ind = region_ind; _next_index = NullEntry; + #if UNROLL_CARD_LOOPS - assert(CardsPerEntry == 4, "Assumption. If changes, un-unroll."); - _cards[0] = NullEntry; - _cards[1] = NullEntry; - _cards[2] = NullEntry; - _cards[3] = NullEntry; + assert((cards_num() & (UnrollFactor - 1)) == 0, "Invalid number of cards in the entry"); + for (int i = 0; i < cards_num(); i += UnrollFactor) { + _cards[i] = NullEntry; + _cards[i + 1] = NullEntry; + _cards[i + 2] = NullEntry; + _cards[i + 3] = NullEntry; + } #else - for (int i = 0; i < CardsPerEntry; i++) + for (int i = 0; i < cards_num(); i++) _cards[i] = NullEntry; #endif } bool SparsePRTEntry::contains_card(CardIdx_t card_index) const { #if UNROLL_CARD_LOOPS - assert(CardsPerEntry == 4, "Assumption. If changes, un-unroll."); - if (_cards[0] == card_index) return true; - if (_cards[1] == card_index) return true; - if (_cards[2] == card_index) return true; - if (_cards[3] == card_index) return true; + assert((cards_num() & (UnrollFactor - 1)) == 0, "Invalid number of cards in the entry"); + for (int i = 0; i < cards_num(); i += UnrollFactor) { + if (_cards[i] == card_index || + _cards[i + 1] == card_index || + _cards[i + 2] == card_index || + _cards[i + 3] == card_index) return true; + } #else - for (int i = 0; i < CardsPerEntry; i++) { + for (int i = 0; i < cards_num(); i++) { if (_cards[i] == card_index) return true; } #endif @@ -67,14 +72,16 @@ bool SparsePRTEntry::contains_card(CardIdx_t card_index) const { int SparsePRTEntry::num_valid_cards() const { int sum = 0; #if UNROLL_CARD_LOOPS - assert(CardsPerEntry == 4, "Assumption. If changes, un-unroll."); - if (_cards[0] != NullEntry) sum++; - if (_cards[1] != NullEntry) sum++; - if (_cards[2] != NullEntry) sum++; - if (_cards[3] != NullEntry) sum++; + assert((cards_num() & (UnrollFactor - 1)) == 0, "Invalid number of cards in the entry"); + for (int i = 0; i < cards_num(); i += UnrollFactor) { + sum += (_cards[i] != NullEntry); + sum += (_cards[i + 1] != NullEntry); + sum += (_cards[i + 2] != NullEntry); + sum += (_cards[i + 3] != NullEntry); + } #else - for (int i = 0; i < CardsPerEntry; i++) { - if (_cards[i] != NulLEntry) sum++; + for (int i = 0; i < cards_num(); i++) { + sum += (_cards[i] != NullEntry); } #endif // Otherwise, we're full. @@ -83,27 +90,27 @@ int SparsePRTEntry::num_valid_cards() const { SparsePRTEntry::AddCardResult SparsePRTEntry::add_card(CardIdx_t card_index) { #if UNROLL_CARD_LOOPS - assert(CardsPerEntry == 4, "Assumption. If changes, un-unroll."); - CardIdx_t c = _cards[0]; - if (c == card_index) return found; - if (c == NullEntry) { _cards[0] = card_index; return added; } - c = _cards[1]; - if (c == card_index) return found; - if (c == NullEntry) { _cards[1] = card_index; return added; } - c = _cards[2]; - if (c == card_index) return found; - if (c == NullEntry) { _cards[2] = card_index; return added; } - c = _cards[3]; - if (c == card_index) return found; - if (c == NullEntry) { _cards[3] = card_index; return added; } + assert((cards_num() & (UnrollFactor - 1)) == 0, "Invalid number of cards in the entry"); + CardIdx_t c; + for (int i = 0; i < cards_num(); i += UnrollFactor) { + c = _cards[i]; + if (c == card_index) return found; + if (c == NullEntry) { _cards[i] = card_index; return added; } + c = _cards[i + 1]; + if (c == card_index) return found; + if (c == NullEntry) { _cards[i + 1] = card_index; return added; } + c = _cards[i + 2]; + if (c == card_index) return found; + if (c == NullEntry) { _cards[i + 2] = card_index; return added; } + c = _cards[i + 3]; + if (c == card_index) return found; + if (c == NullEntry) { _cards[i + 3] = card_index; return added; } + } #else - for (int i = 0; i < CardsPerEntry; i++) { + for (int i = 0; i < cards_num(); i++) { CardIdx_t c = _cards[i]; if (c == card_index) return found; - if (c == NullEntry) { - _cards[i] = card_index; - return added; - } + if (c == NullEntry) { _cards[i] = card_index; return added; } } #endif // Otherwise, we're full. @@ -112,13 +119,15 @@ SparsePRTEntry::AddCardResult SparsePRTEntry::add_card(CardIdx_t card_index) { void SparsePRTEntry::copy_cards(CardIdx_t* cards) const { #if UNROLL_CARD_LOOPS - assert(CardsPerEntry == 4, "Assumption. If changes, un-unroll."); - cards[0] = _cards[0]; - cards[1] = _cards[1]; - cards[2] = _cards[2]; - cards[3] = _cards[3]; + assert((cards_num() & (UnrollFactor - 1)) == 0, "Invalid number of cards in the entry"); + for (int i = 0; i < cards_num(); i += UnrollFactor) { + cards[i] = _cards[i]; + cards[i + 1] = _cards[i + 1]; + cards[i + 2] = _cards[i + 2]; + cards[i + 3] = _cards[i + 3]; + } #else - for (int i = 0; i < CardsPerEntry; i++) { + for (int i = 0; i < cards_num(); i++) { cards[i] = _cards[i]; } #endif @@ -133,7 +142,7 @@ void SparsePRTEntry::copy_cards(SparsePRTEntry* e) const { RSHashTable::RSHashTable(size_t capacity) : _capacity(capacity), _capacity_mask(capacity-1), _occupied_entries(0), _occupied_cards(0), - _entries(NEW_C_HEAP_ARRAY(SparsePRTEntry, capacity)), + _entries((SparsePRTEntry*)NEW_C_HEAP_ARRAY(char, SparsePRTEntry::size() * capacity)), _buckets(NEW_C_HEAP_ARRAY(int, capacity)), _free_list(NullEntry), _free_region(0) { @@ -161,8 +170,8 @@ void RSHashTable::clear() { "_capacity too large"); // This will put -1 == NullEntry in the key field of all entries. - memset(_entries, -1, _capacity * sizeof(SparsePRTEntry)); - memset(_buckets, -1, _capacity * sizeof(int)); + memset(_entries, NullEntry, _capacity * SparsePRTEntry::size()); + memset(_buckets, NullEntry, _capacity * sizeof(int)); _free_list = NullEntry; _free_region = 0; } @@ -175,8 +184,8 @@ bool RSHashTable::add_card(RegionIdx_t region_ind, CardIdx_t card_index) { if (res == SparsePRTEntry::added) _occupied_cards++; #if SPARSE_PRT_VERBOSE gclog_or_tty->print_cr(" after add_card[%d]: valid-cards = %d.", - pointer_delta(e, _entries, sizeof(SparsePRTEntry)), - e->num_valid_cards()); + pointer_delta(e, _entries, SparsePRTEntry::size()), + e->num_valid_cards()); #endif assert(e->num_valid_cards() > 0, "Postcondition"); return res != SparsePRTEntry::overflow; @@ -199,6 +208,22 @@ bool RSHashTable::get_cards(RegionIdx_t region_ind, CardIdx_t* cards) { return true; } +SparsePRTEntry* RSHashTable::get_entry(RegionIdx_t region_ind) { + int ind = (int) (region_ind & capacity_mask()); + int cur_ind = _buckets[ind]; + SparsePRTEntry* cur; + while (cur_ind != NullEntry && + (cur = entry(cur_ind))->r_ind() != region_ind) { + cur_ind = cur->next_index(); + } + + if (cur_ind == NullEntry) return NULL; + // Otherwise... + assert(cur->r_ind() == region_ind, "Postcondition of loop + test above."); + assert(cur->num_valid_cards() > 0, "Inv"); + return cur; +} + bool RSHashTable::delete_entry(RegionIdx_t region_ind) { int ind = (int) (region_ind & capacity_mask()); int* prev_loc = &_buckets[ind]; @@ -225,20 +250,8 @@ RSHashTable::entry_for_region_ind(RegionIdx_t region_ind) const { int ind = (int) (region_ind & capacity_mask()); int cur_ind = _buckets[ind]; SparsePRTEntry* cur; - // XXX - // int k = 0; while (cur_ind != NullEntry && (cur = entry(cur_ind))->r_ind() != region_ind) { - /* - k++; - if (k > 10) { - gclog_or_tty->print_cr("RSHashTable::entry_for_region_ind(%d): " - "k = %d, cur_ind = %d.", region_ind, k, cur_ind); - if (k >= 1000) { - while (1) ; - } - } - */ cur_ind = cur->next_index(); } @@ -319,7 +332,7 @@ size_t /* RSHashTable:: */ RSHashTableIter::compute_card_ind(CardIdx_t ci) { bool /* RSHashTable:: */ RSHashTableIter::has_next(size_t& card_index) { _card_ind++; CardIdx_t ci; - if (_card_ind < SparsePRTEntry::CardsPerEntry && + if (_card_ind < SparsePRTEntry::cards_num() && ((ci = _rsht->entry(_bl_ind)->card(_card_ind)) != SparsePRTEntry::NullEntry)) { card_index = compute_card_ind(ci); @@ -359,7 +372,7 @@ bool RSHashTable::contains_card(RegionIdx_t region_index, CardIdx_t card_index) size_t RSHashTable::mem_size() const { return sizeof(this) + - capacity() * (sizeof(SparsePRTEntry) + sizeof(int)); + capacity() * (SparsePRTEntry::size() + sizeof(int)); } // ---------------------------------------------------------------------- @@ -446,6 +459,10 @@ bool SparsePRT::get_cards(RegionIdx_t region_id, CardIdx_t* cards) { return _next->get_cards(region_id, cards); } +SparsePRTEntry* SparsePRT::get_entry(RegionIdx_t region_id) { + return _next->get_entry(region_id); +} + bool SparsePRT::delete_entry(RegionIdx_t region_id) { return _next->delete_entry(region_id); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp index c5a39737c52..5c35c69b813 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/sparsePRT.hpp @@ -32,21 +32,28 @@ // insertions only enqueue old versions for deletions, but do not delete // old versions synchronously. - class SparsePRTEntry: public CHeapObj { public: - enum SomePublicConstants { - CardsPerEntry = 4, - NullEntry = -1 + NullEntry = -1, + UnrollFactor = 4 }; - private: RegionIdx_t _region_ind; int _next_index; - CardIdx_t _cards[CardsPerEntry]; - + CardIdx_t _cards[1]; + // WARNING: Don't put any data members beyond this line. Card array has, in fact, variable length. + // It should always be the last data member. public: + // Returns the size of the entry, used for entry allocation. + static size_t size() { return sizeof(SparsePRTEntry) + sizeof(CardIdx_t) * (cards_num() - 1); } + // Returns the size of the card array. + static int cards_num() { + // The number of cards should be a multiple of 4, because that's our current + // unrolling factor. + static const int s = MAX2(G1RSetSparseRegionEntries & ~(UnrollFactor - 1), UnrollFactor); + return s; + } // Set the region_ind to the given value, and delete all cards. inline void init(RegionIdx_t region_ind); @@ -134,12 +141,15 @@ public: bool add_card(RegionIdx_t region_id, CardIdx_t card_index); bool get_cards(RegionIdx_t region_id, CardIdx_t* cards); + bool delete_entry(RegionIdx_t region_id); bool contains_card(RegionIdx_t region_id, CardIdx_t card_index) const; void add_entry(SparsePRTEntry* e); + SparsePRTEntry* get_entry(RegionIdx_t region_id); + void clear(); size_t capacity() const { return _capacity; } @@ -148,7 +158,7 @@ public: size_t occupied_cards() const { return _occupied_cards; } size_t mem_size() const; - SparsePRTEntry* entry(int i) const { return &_entries[i]; } + SparsePRTEntry* entry(int i) const { return (SparsePRTEntry*)((char*)_entries + SparsePRTEntry::size() * i); } void print(); }; @@ -157,7 +167,7 @@ public: class RSHashTableIter VALUE_OBJ_CLASS_SPEC { int _tbl_ind; // [-1, 0.._rsht->_capacity) int _bl_ind; // [-1, 0.._rsht->_capacity) - short _card_ind; // [0..CardsPerEntry) + short _card_ind; // [0..SparsePRTEntry::cards_num()) RSHashTable* _rsht; size_t _heap_bot_card_ind; @@ -176,7 +186,7 @@ public: RSHashTableIter(size_t heap_bot_card_ind) : _tbl_ind(RSHashTable::NullEntry), _bl_ind(RSHashTable::NullEntry), - _card_ind((SparsePRTEntry::CardsPerEntry-1)), + _card_ind((SparsePRTEntry::cards_num() - 1)), _rsht(NULL), _heap_bot_card_ind(heap_bot_card_ind) {} @@ -185,7 +195,7 @@ public: _rsht = rsht; _tbl_ind = -1; // So that first increment gets to 0. _bl_ind = RSHashTable::NullEntry; - _card_ind = (SparsePRTEntry::CardsPerEntry-1); + _card_ind = (SparsePRTEntry::cards_num() - 1); } bool has_next(size_t& card_index); @@ -241,9 +251,13 @@ public: // If the table hold an entry for "region_ind", Copies its // cards into "cards", which must be an array of length at least - // "CardsPerEntry", and returns "true"; otherwise, returns "false". + // "SparePRTEntry::cards_num()", and returns "true"; otherwise, + // returns "false". bool get_cards(RegionIdx_t region_ind, CardIdx_t* cards); + // Return the pointer to the entry associated with the given region. + SparsePRTEntry* get_entry(RegionIdx_t region_ind); + // If there is an entry for "region_ind", removes it and return "true"; // otherwise returns "false." bool delete_entry(RegionIdx_t region_ind); diff --git a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp index e59dbe483d2..2137efa4e83 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp @@ -42,7 +42,7 @@ void VM_G1CollectFull::doit() { void VM_G1IncCollectionPause::doit() { JvmtiGCForAllocationMarker jgcm; G1CollectedHeap* g1h = G1CollectedHeap::heap(); - GCCauseSetter x(g1h, GCCause::_g1_inc_collection_pause); + GCCauseSetter x(g1h, _gc_cause); g1h->do_collection_pause_at_safepoint(); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp index 6cf0605ec8c..95dda3844b7 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp @@ -68,8 +68,9 @@ class VM_G1CollectForAllocation: public VM_GC_Operation { class VM_G1IncCollectionPause: public VM_GC_Operation { public: - VM_G1IncCollectionPause(int gc_count_before) : - VM_GC_Operation(gc_count_before) {} + VM_G1IncCollectionPause(int gc_count_before, + GCCause::Cause gc_cause = GCCause::_g1_inc_collection_pause) : + VM_GC_Operation(gc_count_before) { _gc_cause = gc_cause; } virtual VMOp_Type type() const { return VMOp_G1IncCollectionPause; } virtual void doit(); virtual const char* name() const { diff --git a/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep b/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep index 7ae314990c8..c5a7a386b60 100644 --- a/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep +++ b/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep @@ -221,6 +221,7 @@ freeList.cpp freeList.hpp freeList.cpp globals.hpp freeList.cpp mutex.hpp freeList.cpp sharedHeap.hpp +freeList.cpp vmThread.hpp freeList.hpp allocationStats.hpp diff --git a/hotspot/src/share/vm/gc_implementation/includeDB_gc_g1 b/hotspot/src/share/vm/gc_implementation/includeDB_gc_g1 index 63bfbce76f9..60531af9032 100644 --- a/hotspot/src/share/vm/gc_implementation/includeDB_gc_g1 +++ b/hotspot/src/share/vm/gc_implementation/includeDB_gc_g1 @@ -109,7 +109,6 @@ dirtyCardQueue.cpp atomic.hpp dirtyCardQueue.cpp dirtyCardQueue.hpp dirtyCardQueue.cpp heapRegionRemSet.hpp dirtyCardQueue.cpp mutexLocker.hpp -dirtyCardQueue.cpp ptrQueue.inline.hpp dirtyCardQueue.cpp safepoint.hpp dirtyCardQueue.cpp thread.hpp dirtyCardQueue.cpp thread_.inline.hpp @@ -222,6 +221,15 @@ g1MarkSweep.hpp oop.hpp g1MarkSweep.hpp timer.hpp g1MarkSweep.hpp universe.hpp +g1MemoryPool.cpp heapRegion.hpp +g1MemoryPool.cpp g1CollectedHeap.inline.hpp +g1MemoryPool.cpp g1CollectedHeap.hpp +g1MemoryPool.cpp g1CollectorPolicy.hpp +g1MemoryPool.cpp g1MemoryPool.hpp + +g1MemoryPool.hpp memoryUsage.hpp +g1MemoryPool.hpp memoryPool.hpp + g1OopClosures.inline.hpp concurrentMark.hpp g1OopClosures.inline.hpp g1OopClosures.hpp g1OopClosures.inline.hpp g1CollectedHeap.hpp @@ -303,12 +311,13 @@ heapRegionSeq.inline.hpp heapRegionSeq.hpp klass.hpp g1OopClosures.hpp +memoryService.cpp g1MemoryPool.hpp + ptrQueue.cpp allocation.hpp ptrQueue.cpp allocation.inline.hpp ptrQueue.cpp mutex.hpp ptrQueue.cpp mutexLocker.hpp ptrQueue.cpp ptrQueue.hpp -ptrQueue.cpp ptrQueue.inline.hpp ptrQueue.cpp thread_.inline.hpp ptrQueue.hpp allocation.hpp @@ -318,7 +327,6 @@ ptrQueue.inline.hpp ptrQueue.hpp satbQueue.cpp allocation.inline.hpp satbQueue.cpp mutexLocker.hpp -satbQueue.cpp ptrQueue.inline.hpp satbQueue.cpp satbQueue.hpp satbQueue.cpp sharedHeap.hpp satbQueue.cpp thread.hpp diff --git a/hotspot/src/share/vm/gc_implementation/includeDB_gc_serial b/hotspot/src/share/vm/gc_implementation/includeDB_gc_serial index 6fb42f95b6f..60e41874d43 100644 --- a/hotspot/src/share/vm/gc_implementation/includeDB_gc_serial +++ b/hotspot/src/share/vm/gc_implementation/includeDB_gc_serial @@ -71,6 +71,7 @@ gcUtil.cpp gcUtil.hpp gcUtil.hpp allocation.hpp gcUtil.hpp debug.hpp gcUtil.hpp globalDefinitions.hpp +gcUtil.hpp ostream.hpp gcUtil.hpp timer.hpp generationCounters.cpp generationCounters.hpp diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp index 5acb923a056..07f759c9457 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp @@ -50,6 +50,7 @@ ParScanThreadState::ParScanThreadState(Space* to_space_, work_queue_set_, &term_), _is_alive_closure(gen_), _scan_weak_ref_closure(gen_, this), _keep_alive_closure(&_scan_weak_ref_closure), + _promotion_failure_size(0), _pushes(0), _pops(0), _steals(0), _steal_attempts(0), _term_attempts(0), _strong_roots_time(0.0), _term_time(0.0) { @@ -249,6 +250,16 @@ void ParScanThreadState::undo_alloc_in_to_space(HeapWord* obj, } } +void ParScanThreadState::print_and_clear_promotion_failure_size() { + if (_promotion_failure_size != 0) { + if (PrintPromotionFailure) { + gclog_or_tty->print(" (%d: promotion failure size = " SIZE_FORMAT ") ", + _thread_num, _promotion_failure_size); + } + _promotion_failure_size = 0; + } +} + class ParScanThreadStateSet: private ResourceArray { public: // Initializes states for the specified number of threads; @@ -260,11 +271,11 @@ public: GrowableArray** overflow_stacks_, size_t desired_plab_sz, ParallelTaskTerminator& term); - inline ParScanThreadState& thread_sate(int i); + inline ParScanThreadState& thread_state(int i); int pushes() { return _pushes; } int pops() { return _pops; } int steals() { return _steals; } - void reset(); + void reset(bool promotion_failed); void flush(); private: ParallelTaskTerminator& _term; @@ -295,22 +306,31 @@ ParScanThreadStateSet::ParScanThreadStateSet( } } -inline ParScanThreadState& ParScanThreadStateSet::thread_sate(int i) +inline ParScanThreadState& ParScanThreadStateSet::thread_state(int i) { assert(i >= 0 && i < length(), "sanity check!"); return ((ParScanThreadState*)_data)[i]; } -void ParScanThreadStateSet::reset() +void ParScanThreadStateSet::reset(bool promotion_failed) { _term.reset_for_reuse(); + if (promotion_failed) { + for (int i = 0; i < length(); ++i) { + thread_state(i).print_and_clear_promotion_failure_size(); + } + } } void ParScanThreadStateSet::flush() { + // Work in this loop should be kept as lightweight as + // possible since this might otherwise become a bottleneck + // to scaling. Should we add heavy-weight work into this + // loop, consider parallelizing the loop into the worker threads. for (int i = 0; i < length(); ++i) { - ParScanThreadState& par_scan_state = thread_sate(i); + ParScanThreadState& par_scan_state = thread_state(i); // Flush stats related to To-space PLAB activity and // retire the last buffer. @@ -362,6 +382,14 @@ void ParScanThreadStateSet::flush() } } } + if (UseConcMarkSweepGC && ParallelGCThreads > 0) { + // We need to call this even when ResizeOldPLAB is disabled + // so as to avoid breaking some asserts. While we may be able + // to avoid this by reorganizing the code a bit, I am loathe + // to do that unless we find cases where ergo leads to bad + // performance. + CFLS_LAB::compute_desired_plab_size(); + } } ParScanClosure::ParScanClosure(ParNewGeneration* g, @@ -475,7 +503,7 @@ void ParNewGenTask::work(int i) { Generation* old_gen = gch->next_gen(_gen); - ParScanThreadState& par_scan_state = _state_set->thread_sate(i); + ParScanThreadState& par_scan_state = _state_set->thread_state(i); par_scan_state.set_young_old_boundary(_young_old_boundary); par_scan_state.start_strong_roots(); @@ -659,7 +687,7 @@ void ParNewRefProcTaskProxy::work(int i) { ResourceMark rm; HandleMark hm; - ParScanThreadState& par_scan_state = _state_set.thread_sate(i); + ParScanThreadState& par_scan_state = _state_set.thread_state(i); par_scan_state.set_young_old_boundary(_young_old_boundary); _task.work(i, par_scan_state.is_alive_closure(), par_scan_state.keep_alive_closure(), @@ -693,7 +721,7 @@ void ParNewRefProcTaskExecutor::execute(ProcessTask& task) ParNewRefProcTaskProxy rp_task(task, _generation, *_generation.next_gen(), _generation.reserved().end(), _state_set); workers->run_task(&rp_task); - _state_set.reset(); + _state_set.reset(_generation.promotion_failed()); } void ParNewRefProcTaskExecutor::execute(EnqueueTask& task) @@ -813,7 +841,7 @@ void ParNewGeneration::collect(bool full, GenCollectedHeap::StrongRootsScope srs(gch); tsk.work(0); } - thread_state_set.reset(); + thread_state_set.reset(promotion_failed()); if (PAR_STATS_ENABLED && ParallelGCVerbose) { gclog_or_tty->print("Thread totals:\n" @@ -882,6 +910,8 @@ void ParNewGeneration::collect(bool full, swap_spaces(); // Make life simpler for CMS || rescan; see 6483690. from()->set_next_compaction_space(to()); gch->set_incremental_collection_will_fail(); + // Inform the next generation that a promotion failure occurred. + _next_gen->promotion_failure_occurred(); // Reset the PromotionFailureALot counters. NOT_PRODUCT(Universe::heap()->reset_promotion_should_fail();) @@ -1029,6 +1059,8 @@ oop ParNewGeneration::copy_to_survivor_space_avoiding_promotion_undo( new_obj = old; preserve_mark_if_necessary(old, m); + // Log the size of the maiden promotion failure + par_scan_state->log_promotion_failure(sz); } old->forward_to(new_obj); @@ -1150,6 +1182,8 @@ oop ParNewGeneration::copy_to_survivor_space_with_undo( failed_to_promote = true; preserve_mark_if_necessary(old, m); + // Log the size of the maiden promotion failure + par_scan_state->log_promotion_failure(sz); } } else { // Is in to-space; do copying ourselves. diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp index 3e2ab80af2e..a8dee0bbca9 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp @@ -97,6 +97,9 @@ class ParScanThreadState { int _pushes, _pops, _steals, _steal_attempts, _term_attempts; int _overflow_pushes, _overflow_refills, _overflow_refill_objs; + // Stats for promotion failure + size_t _promotion_failure_size; + // Timing numbers. double _start; double _start_strong_roots; @@ -169,6 +172,15 @@ class ParScanThreadState { // Undo the most recent allocation ("obj", of "word_sz"). void undo_alloc_in_to_space(HeapWord* obj, size_t word_sz); + // Promotion failure stats + size_t promotion_failure_size() { return promotion_failure_size(); } + void log_promotion_failure(size_t sz) { + if (_promotion_failure_size == 0) { + _promotion_failure_size = sz; + } + } + void print_and_clear_promotion_failure_size(); + int pushes() { return _pushes; } int pops() { return _pops; } int steals() { return _steals; } diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp index 8396e7960b1..9fe57121f14 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp @@ -51,6 +51,8 @@ static void trace_gen_sizes(const char* const str, } jint ParallelScavengeHeap::initialize() { + CollectedHeap::pre_initialize(); + // Cannot be initialized until after the flags are parsed GenerationSizer flag_parser; @@ -717,10 +719,6 @@ HeapWord* ParallelScavengeHeap::allocate_new_tlab(size_t size) { return young_gen()->allocate(size, true); } -void ParallelScavengeHeap::fill_all_tlabs(bool retire) { - CollectedHeap::fill_all_tlabs(retire); -} - void ParallelScavengeHeap::accumulate_statistics_all_tlabs() { CollectedHeap::accumulate_statistics_all_tlabs(); } diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp index 3bf7671b29a..46fdcc53348 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp @@ -54,7 +54,6 @@ class ParallelScavengeHeap : public CollectedHeap { protected: static inline size_t total_invocations(); HeapWord* allocate_new_tlab(size_t size); - void fill_all_tlabs(bool retire); public: ParallelScavengeHeap() : CollectedHeap() { @@ -191,6 +190,10 @@ class ParallelScavengeHeap : public CollectedHeap { return true; } + virtual bool card_mark_must_follow_store() const { + return false; + } + // Return true if we don't we need a store barrier for // initializing stores to an object at this address. virtual bool can_elide_initializing_store_barrier(oop new_obj); diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.cpp index 02c6450a7a0..26345dbc924 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.cpp @@ -51,7 +51,7 @@ PSGCAdaptivePolicyCounters::PSGCAdaptivePolicyCounters(const char* name_arg, cname = PerfDataManager::counter_name(name_space(), "oldCapacity"); _old_capacity = PerfDataManager::create_variable(SUN_GC, cname, - PerfData::U_Bytes, (jlong) Arguments::initial_heap_size(), CHECK); + PerfData::U_Bytes, (jlong) InitialHeapSize, CHECK); cname = PerfDataManager::counter_name(name_space(), "boundaryMoved"); _boundary_moved = PerfDataManager::create_variable(SUN_GC, cname, diff --git a/hotspot/src/share/vm/gc_implementation/shared/allocationStats.hpp b/hotspot/src/share/vm/gc_implementation/shared/allocationStats.hpp index 4772f7c45bc..9358688a4c9 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/allocationStats.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/allocationStats.hpp @@ -31,7 +31,7 @@ class AllocationStats VALUE_OBJ_CLASS_SPEC { // beginning of this sweep: // Count(end_last_sweep) - Count(start_this_sweep) // + splitBirths(between) - splitDeaths(between) - // The above number divided by the time since the start [END???] of the + // The above number divided by the time since the end of the // previous sweep gives us a time rate of demand for blocks // of this size. We compute a padded average of this rate as // our current estimate for the time rate of demand for blocks @@ -41,7 +41,7 @@ class AllocationStats VALUE_OBJ_CLASS_SPEC { // estimates. AdaptivePaddedAverage _demand_rate_estimate; - ssize_t _desired; // Estimate computed as described above + ssize_t _desired; // Demand stimate computed as described above ssize_t _coalDesired; // desired +/- small-percent for tuning coalescing ssize_t _surplus; // count - (desired +/- small-percent), @@ -53,9 +53,9 @@ class AllocationStats VALUE_OBJ_CLASS_SPEC { ssize_t _coalDeaths; // loss from coalescing ssize_t _splitBirths; // additional chunks from splitting ssize_t _splitDeaths; // loss from splitting - size_t _returnedBytes; // number of bytes returned to list. + size_t _returnedBytes; // number of bytes returned to list. public: - void initialize() { + void initialize(bool split_birth = false) { AdaptivePaddedAverage* dummy = new (&_demand_rate_estimate) AdaptivePaddedAverage(CMS_FLSWeight, CMS_FLSPadding); @@ -67,7 +67,7 @@ class AllocationStats VALUE_OBJ_CLASS_SPEC { _beforeSweep = 0; _coalBirths = 0; _coalDeaths = 0; - _splitBirths = 0; + _splitBirths = split_birth? 1 : 0; _splitDeaths = 0; _returnedBytes = 0; } @@ -75,10 +75,12 @@ class AllocationStats VALUE_OBJ_CLASS_SPEC { AllocationStats() { initialize(); } + // The rate estimate is in blocks per second. void compute_desired(size_t count, float inter_sweep_current, - float inter_sweep_estimate) { + float inter_sweep_estimate, + float intra_sweep_estimate) { // If the latest inter-sweep time is below our granularity // of measurement, we may call in here with // inter_sweep_current == 0. However, even for suitably small @@ -88,12 +90,31 @@ class AllocationStats VALUE_OBJ_CLASS_SPEC { // vulnerable to noisy glitches. In such cases, we // ignore the current sample and use currently available // historical estimates. + // XXX NEEDS TO BE FIXED + // assert(prevSweep() + splitBirths() >= splitDeaths() + (ssize_t)count, "Conservation Principle"); + // ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + // "Total Stock" "Not used at this block size" if (inter_sweep_current > _threshold) { - ssize_t demand = prevSweep() - count + splitBirths() - splitDeaths(); + ssize_t demand = prevSweep() - (ssize_t)count + splitBirths() - splitDeaths(); + // XXX NEEDS TO BE FIXED + // assert(demand >= 0, "Demand should be non-negative"); + // Defensive: adjust for imprecision in event counting + if (demand < 0) { + demand = 0; + } + float old_rate = _demand_rate_estimate.padded_average(); float rate = ((float)demand)/inter_sweep_current; _demand_rate_estimate.sample(rate); - _desired = (ssize_t)(_demand_rate_estimate.padded_average() - *inter_sweep_estimate); + float new_rate = _demand_rate_estimate.padded_average(); + ssize_t old_desired = _desired; + _desired = (ssize_t)(new_rate * (inter_sweep_estimate + + CMSExtrapolateSweep + ? intra_sweep_estimate + : 0.0)); + if (PrintFLSStatistics > 1) { + gclog_or_tty->print_cr("demand: %d, old_rate: %f, current_rate: %f, new_rate: %f, old_desired: %d, new_desired: %d", + demand, old_rate, rate, new_rate, old_desired, _desired); + } } } diff --git a/hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp b/hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp index 9ae5e4a0d29..e18782aac55 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp @@ -52,11 +52,35 @@ void AdaptiveWeightedAverage::sample(float new_sample) { _last_sample = new_sample; } +void AdaptiveWeightedAverage::print() const { + print_on(tty); +} + +void AdaptiveWeightedAverage::print_on(outputStream* st) const { + guarantee(false, "NYI"); +} + +void AdaptivePaddedAverage::print() const { + print_on(tty); +} + +void AdaptivePaddedAverage::print_on(outputStream* st) const { + guarantee(false, "NYI"); +} + +void AdaptivePaddedNoZeroDevAverage::print() const { + print_on(tty); +} + +void AdaptivePaddedNoZeroDevAverage::print_on(outputStream* st) const { + guarantee(false, "NYI"); +} + void AdaptivePaddedAverage::sample(float new_sample) { - // Compute our parent classes sample information + // Compute new adaptive weighted average based on new sample. AdaptiveWeightedAverage::sample(new_sample); - // Now compute the deviation and the new padded sample + // Now update the deviation and the padded average. float new_avg = average(); float new_dev = compute_adaptive_average(fabsd(new_sample - new_avg), deviation()); diff --git a/hotspot/src/share/vm/gc_implementation/shared/gcUtil.hpp b/hotspot/src/share/vm/gc_implementation/shared/gcUtil.hpp index affc3e44597..1bb4fc9f852 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/gcUtil.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/gcUtil.hpp @@ -54,8 +54,8 @@ class AdaptiveWeightedAverage : public CHeapObj { public: // Input weight must be between 0 and 100 - AdaptiveWeightedAverage(unsigned weight) : - _average(0.0), _sample_count(0), _weight(weight), _last_sample(0.0) { + AdaptiveWeightedAverage(unsigned weight, float avg = 0.0) : + _average(avg), _sample_count(0), _weight(weight), _last_sample(0.0) { } void clear() { @@ -64,6 +64,13 @@ class AdaptiveWeightedAverage : public CHeapObj { _last_sample = 0; } + // Useful for modifying static structures after startup. + void modify(size_t avg, unsigned wt, bool force = false) { + assert(force, "Are you sure you want to call this?"); + _average = (float)avg; + _weight = wt; + } + // Accessors float average() const { return _average; } unsigned weight() const { return _weight; } @@ -83,6 +90,10 @@ class AdaptiveWeightedAverage : public CHeapObj { // Convert to float and back to avoid integer overflow. return (size_t)exp_avg((float)avg, (float)sample, weight); } + + // Printing + void print_on(outputStream* st) const; + void print() const; }; @@ -129,6 +140,10 @@ class AdaptivePaddedAverage : public AdaptiveWeightedAverage { // Override void sample(float new_sample); + + // Printing + void print_on(outputStream* st) const; + void print() const; }; // A weighted average that includes a deviation from the average, @@ -146,7 +161,12 @@ public: AdaptivePaddedAverage(weight, padding) {} // Override void sample(float new_sample); + + // Printing + void print_on(outputStream* st) const; + void print() const; }; + // Use a least squares fit to a set of data to generate a linear // equation. // y = intercept + slope * x diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.cpp b/hotspot/src/share/vm/gc_interface/collectedHeap.cpp index c775e6021b1..c5bf893c9e4 100644 --- a/hotspot/src/share/vm/gc_interface/collectedHeap.cpp +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.cpp @@ -59,8 +59,19 @@ CollectedHeap::CollectedHeap() PerfDataManager::create_string_variable(SUN_GC, "lastCause", 80, GCCause::to_string(_gc_lastcause), CHECK); } + _defer_initial_card_mark = false; // strengthened by subclass in pre_initialize() below. } +void CollectedHeap::pre_initialize() { + // Used for ReduceInitialCardMarks (when COMPILER2 is used); + // otherwise remains unused. +#ifdef COMPLER2 + _defer_initial_card_mark = ReduceInitialCardMarks && can_elide_tlab_store_barriers() + && (DeferInitialCardMark || card_mark_must_follow_store()); +#else + assert(_defer_initial_card_mark == false, "Who would set it?"); +#endif +} #ifndef PRODUCT void CollectedHeap::check_for_bad_heap_word_value(HeapWord* addr, size_t size) { @@ -140,12 +151,13 @@ HeapWord* CollectedHeap::allocate_from_tlab_slow(Thread* thread, size_t size) { void CollectedHeap::flush_deferred_store_barrier(JavaThread* thread) { MemRegion deferred = thread->deferred_card_mark(); if (!deferred.is_empty()) { + assert(_defer_initial_card_mark, "Otherwise should be empty"); { // Verify that the storage points to a parsable object in heap DEBUG_ONLY(oop old_obj = oop(deferred.start());) assert(is_in(old_obj), "Not in allocated heap"); assert(!can_elide_initializing_store_barrier(old_obj), - "Else should have been filtered in defer_store_barrier()"); + "Else should have been filtered in new_store_pre_barrier()"); assert(!is_in_permanent(old_obj), "Sanity: not expected"); assert(old_obj->is_oop(true), "Not an oop"); assert(old_obj->is_parsable(), "Will not be concurrently parsable"); @@ -174,9 +186,7 @@ void CollectedHeap::flush_deferred_store_barrier(JavaThread* thread) { // so long as the card-mark is completed before the next // scavenge. For all these cases, we can do a card mark // at the point at which we do a slow path allocation -// in the old gen. For uniformity, however, we end -// up using the same scheme (see below) for all three -// cases (deferring the card-mark appropriately). +// in the old gen, i.e. in this call. // (b) GenCollectedHeap(ConcurrentMarkSweepGeneration) requires // in addition that the card-mark for an old gen allocated // object strictly follow any associated initializing stores. @@ -199,12 +209,13 @@ void CollectedHeap::flush_deferred_store_barrier(JavaThread* thread) { // but, like in CMS, because of the presence of concurrent refinement // (much like CMS' precleaning), must strictly follow the oop-store. // Thus, using the same protocol for maintaining the intended -// invariants turns out, serendepitously, to be the same for all -// three collectors/heap types above. +// invariants turns out, serendepitously, to be the same for both +// G1 and CMS. // -// For each future collector, this should be reexamined with -// that specific collector in mind. -oop CollectedHeap::defer_store_barrier(JavaThread* thread, oop new_obj) { +// For any future collector, this code should be reexamined with +// that specific collector in mind, and the documentation above suitably +// extended and updated. +oop CollectedHeap::new_store_pre_barrier(JavaThread* thread, oop new_obj) { // If a previous card-mark was deferred, flush it now. flush_deferred_store_barrier(thread); if (can_elide_initializing_store_barrier(new_obj)) { @@ -212,10 +223,17 @@ oop CollectedHeap::defer_store_barrier(JavaThread* thread, oop new_obj) { // following the flush above. assert(thread->deferred_card_mark().is_empty(), "Error"); } else { - // Remember info for the newly deferred store barrier - MemRegion deferred = MemRegion((HeapWord*)new_obj, new_obj->size()); - assert(!deferred.is_empty(), "Error"); - thread->set_deferred_card_mark(deferred); + MemRegion mr((HeapWord*)new_obj, new_obj->size()); + assert(!mr.is_empty(), "Error"); + if (_defer_initial_card_mark) { + // Defer the card mark + thread->set_deferred_card_mark(mr); + } else { + // Do the card mark + BarrierSet* bs = barrier_set(); + assert(bs->has_write_region_opt(), "No write_region() on BarrierSet"); + bs->write_region(mr); + } } return new_obj; } @@ -241,9 +259,9 @@ void CollectedHeap::fill_args_check(HeapWord* start, size_t words) assert(Universe::heap()->is_in_reserved(start + words - 1), "not in heap"); } -void CollectedHeap::zap_filler_array(HeapWord* start, size_t words) +void CollectedHeap::zap_filler_array(HeapWord* start, size_t words, bool zap) { - if (ZapFillerObjects) { + if (ZapFillerObjects && zap) { Copy::fill_to_words(start + filler_array_hdr_size(), words - filler_array_hdr_size(), 0XDEAFBABE); } @@ -251,7 +269,7 @@ void CollectedHeap::zap_filler_array(HeapWord* start, size_t words) #endif // ASSERT void -CollectedHeap::fill_with_array(HeapWord* start, size_t words) +CollectedHeap::fill_with_array(HeapWord* start, size_t words, bool zap) { assert(words >= filler_array_min_size(), "too small for an array"); assert(words <= filler_array_max_size(), "too big for a single object"); @@ -262,31 +280,31 @@ CollectedHeap::fill_with_array(HeapWord* start, size_t words) // Set the length first for concurrent GC. ((arrayOop)start)->set_length((int)len); post_allocation_setup_common(Universe::intArrayKlassObj(), start, words); - DEBUG_ONLY(zap_filler_array(start, words);) + DEBUG_ONLY(zap_filler_array(start, words, zap);) } void -CollectedHeap::fill_with_object_impl(HeapWord* start, size_t words) +CollectedHeap::fill_with_object_impl(HeapWord* start, size_t words, bool zap) { assert(words <= filler_array_max_size(), "too big for a single object"); if (words >= filler_array_min_size()) { - fill_with_array(start, words); + fill_with_array(start, words, zap); } else if (words > 0) { assert(words == min_fill_size(), "unaligned size"); - post_allocation_setup_common(SystemDictionary::object_klass(), start, + post_allocation_setup_common(SystemDictionary::Object_klass(), start, words); } } -void CollectedHeap::fill_with_object(HeapWord* start, size_t words) +void CollectedHeap::fill_with_object(HeapWord* start, size_t words, bool zap) { DEBUG_ONLY(fill_args_check(start, words);) HandleMark hm; // Free handles before leaving. - fill_with_object_impl(start, words); + fill_with_object_impl(start, words, zap); } -void CollectedHeap::fill_with_objects(HeapWord* start, size_t words) +void CollectedHeap::fill_with_objects(HeapWord* start, size_t words, bool zap) { DEBUG_ONLY(fill_args_check(start, words);) HandleMark hm; // Free handles before leaving. @@ -299,13 +317,13 @@ void CollectedHeap::fill_with_objects(HeapWord* start, size_t words) const size_t max = filler_array_max_size(); while (words > max) { const size_t cur = words - max >= min ? max : max - min; - fill_with_array(start, cur); + fill_with_array(start, cur, zap); start += cur; words -= cur; } #endif - fill_with_object_impl(start, words); + fill_with_object_impl(start, words, zap); } HeapWord* CollectedHeap::allocate_new_tlab(size_t size) { @@ -313,22 +331,6 @@ HeapWord* CollectedHeap::allocate_new_tlab(size_t size) { return NULL; } -void CollectedHeap::fill_all_tlabs(bool retire) { - assert(UseTLAB, "should not reach here"); - // See note in ensure_parsability() below. - assert(SafepointSynchronize::is_at_safepoint() || - !is_init_completed(), - "should only fill tlabs at safepoint"); - // The main thread starts allocating via a TLAB even before it - // has added itself to the threads list at vm boot-up. - assert(Threads::first() != NULL, - "Attempt to fill tlabs before main thread has been added" - " to threads list is doomed to failure!"); - for(JavaThread *thread = Threads::first(); thread; thread = thread->next()) { - thread->tlab().make_parsable(retire); - } -} - void CollectedHeap::ensure_parsability(bool retire_tlabs) { // The second disjunct in the assertion below makes a concession // for the start-up verification done while the VM is being @@ -343,8 +345,24 @@ void CollectedHeap::ensure_parsability(bool retire_tlabs) { "Should only be called at a safepoint or at start-up" " otherwise concurrent mutator activity may make heap " " unparsable again"); - if (UseTLAB) { - fill_all_tlabs(retire_tlabs); + const bool use_tlab = UseTLAB; + const bool deferred = _defer_initial_card_mark; + // The main thread starts allocating via a TLAB even before it + // has added itself to the threads list at vm boot-up. + assert(!use_tlab || Threads::first() != NULL, + "Attempt to fill tlabs before main thread has been added" + " to threads list is doomed to failure!"); + for (JavaThread *thread = Threads::first(); thread; thread = thread->next()) { + if (use_tlab) thread->tlab().make_parsable(retire_tlabs); +#ifdef COMPILER2 + // The deferred store barriers must all have been flushed to the + // card-table (or other remembered set structure) before GC starts + // processing the card-table (or other remembered set). + if (deferred) flush_deferred_store_barrier(thread); +#else + assert(!deferred, "Should be false"); + assert(thread->deferred_card_mark().is_empty(), "Should be empty"); +#endif } } diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp index 18148c8a30f..2bc210a4717 100644 --- a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp @@ -51,6 +51,9 @@ class CollectedHeap : public CHeapObj { // Used for filler objects (static, but initialized in ctor). static size_t _filler_array_max_size; + // Used in support of ReduceInitialCardMarks; only consulted if COMPILER2 is being used + bool _defer_initial_card_mark; + protected: MemRegion _reserved; BarrierSet* _barrier_set; @@ -70,13 +73,16 @@ class CollectedHeap : public CHeapObj { // Constructor CollectedHeap(); + // Do common initializations that must follow instance construction, + // for example, those needing virtual calls. + // This code could perhaps be moved into initialize() but would + // be slightly more awkward because we want the latter to be a + // pure virtual. + void pre_initialize(); + // Create a new tlab virtual HeapWord* allocate_new_tlab(size_t size); - // Fix up tlabs to make the heap well-formed again, - // optionally retiring the tlabs. - virtual void fill_all_tlabs(bool retire); - // Accumulate statistics on all tlabs. virtual void accumulate_statistics_all_tlabs(); @@ -127,14 +133,14 @@ class CollectedHeap : public CHeapObj { static inline size_t filler_array_max_size(); DEBUG_ONLY(static void fill_args_check(HeapWord* start, size_t words);) - DEBUG_ONLY(static void zap_filler_array(HeapWord* start, size_t words);) + DEBUG_ONLY(static void zap_filler_array(HeapWord* start, size_t words, bool zap = true);) // Fill with a single array; caller must ensure filler_array_min_size() <= // words <= filler_array_max_size(). - static inline void fill_with_array(HeapWord* start, size_t words); + static inline void fill_with_array(HeapWord* start, size_t words, bool zap = true); // Fill with a single object (either an int array or a java.lang.Object). - static inline void fill_with_object_impl(HeapWord* start, size_t words); + static inline void fill_with_object_impl(HeapWord* start, size_t words, bool zap = true); // Verification functions virtual void check_for_bad_heap_word_value(HeapWord* addr, size_t size) @@ -338,14 +344,14 @@ class CollectedHeap : public CHeapObj { return size_t(align_object_size(oopDesc::header_size())); } - static void fill_with_objects(HeapWord* start, size_t words); + static void fill_with_objects(HeapWord* start, size_t words, bool zap = true); - static void fill_with_object(HeapWord* start, size_t words); - static void fill_with_object(MemRegion region) { - fill_with_object(region.start(), region.word_size()); + static void fill_with_object(HeapWord* start, size_t words, bool zap = true); + static void fill_with_object(MemRegion region, bool zap = true) { + fill_with_object(region.start(), region.word_size(), zap); } - static void fill_with_object(HeapWord* start, HeapWord* end) { - fill_with_object(start, pointer_delta(end, start)); + static void fill_with_object(HeapWord* start, HeapWord* end, bool zap = true) { + fill_with_object(start, pointer_delta(end, start), zap); } // Some heaps may offer a contiguous region for shared non-blocking @@ -431,14 +437,25 @@ class CollectedHeap : public CHeapObj { // promises to call this function on such a slow-path-allocated // object before performing initializations that have elided // store barriers. Returns new_obj, or maybe a safer copy thereof. - virtual oop defer_store_barrier(JavaThread* thread, oop new_obj); + virtual oop new_store_pre_barrier(JavaThread* thread, oop new_obj); // Answers whether an initializing store to a new object currently - // allocated at the given address doesn't need a (deferred) store + // allocated at the given address doesn't need a store // barrier. Returns "true" if it doesn't need an initializing // store barrier; answers "false" if it does. virtual bool can_elide_initializing_store_barrier(oop new_obj) = 0; + // If a compiler is eliding store barriers for TLAB-allocated objects, + // we will be informed of a slow-path allocation by a call + // to new_store_pre_barrier() above. Such a call precedes the + // initialization of the object itself, and no post-store-barriers will + // be issued. Some heap types require that the barrier strictly follows + // the initializing stores. (This is currently implemented by deferring the + // barrier until the next slow-path allocation or gc-related safepoint.) + // This interface answers whether a particular heap type needs the card + // mark to be thus strictly sequenced after the stores. + virtual bool card_mark_must_follow_store() const = 0; + // If the CollectedHeap was asked to defer a store barrier above, // this informs it to flush such a deferred store barrier to the // remembered set. diff --git a/hotspot/src/share/vm/includeDB_compiler2 b/hotspot/src/share/vm/includeDB_compiler2 index 6ba7bfaf867..5c2f1c5c9fe 100644 --- a/hotspot/src/share/vm/includeDB_compiler2 +++ b/hotspot/src/share/vm/includeDB_compiler2 @@ -149,11 +149,15 @@ c2compiler.cpp runtime.hpp c2compiler.hpp abstractCompiler.hpp callGenerator.cpp addnode.hpp +callGenerator.cpp bcEscapeAnalyzer.hpp callGenerator.cpp callGenerator.hpp callGenerator.cpp callnode.hpp callGenerator.cpp cfgnode.hpp callGenerator.cpp compileLog.hpp callGenerator.cpp connode.hpp +callGenerator.cpp ciCPCache.hpp +callGenerator.cpp ciMethodHandle.hpp +callGenerator.cpp javaClasses.hpp callGenerator.cpp parse.hpp callGenerator.cpp rootnode.hpp callGenerator.cpp runtime.hpp @@ -321,6 +325,7 @@ compile.cpp phaseX.hpp compile.cpp rootnode.hpp compile.cpp runtime.hpp compile.cpp signature.hpp +compile.cpp stringopts.hpp compile.cpp stubRoutines.hpp compile.cpp systemDictionary.hpp compile.cpp timer.hpp @@ -389,6 +394,9 @@ divnode.hpp type.hpp doCall.cpp addnode.hpp doCall.cpp callGenerator.hpp +doCall.cpp ciCallSite.hpp +doCall.cpp ciCPCache.hpp +doCall.cpp ciMethodHandle.hpp doCall.cpp cfgnode.hpp doCall.cpp compileLog.hpp doCall.cpp linkResolver.hpp @@ -476,12 +484,16 @@ graphKit.cpp rootnode.hpp graphKit.cpp runtime.hpp graphKit.cpp sharedRuntime.hpp +graphKit.hpp addnode.hpp graphKit.hpp callnode.hpp graphKit.hpp cfgnode.hpp graphKit.hpp ciEnv.hpp +graphKit.hpp divnode.hpp graphKit.hpp compile.hpp graphKit.hpp deoptimization.hpp graphKit.hpp phaseX.hpp +graphKit.hpp mulnode.hpp +graphKit.hpp subnode.hpp graphKit.hpp type.hpp idealKit.cpp addnode.hpp @@ -490,7 +502,10 @@ idealKit.cpp cfgnode.hpp idealKit.cpp idealKit.hpp idealKit.cpp runtime.hpp +idealKit.hpp addnode.hpp +idealKit.hpp cfgnode.hpp idealKit.hpp connode.hpp +idealKit.hpp divnode.hpp idealKit.hpp mulnode.hpp idealKit.hpp phaseX.hpp idealKit.hpp subnode.hpp @@ -586,6 +601,7 @@ locknode.hpp subnode.hpp loopTransform.cpp addnode.hpp loopTransform.cpp allocation.inline.hpp +loopTransform.cpp callnode.hpp loopTransform.cpp connode.hpp loopTransform.cpp compileLog.hpp loopTransform.cpp divnode.hpp @@ -641,6 +657,7 @@ macro.cpp addnode.hpp macro.cpp callnode.hpp macro.cpp cfgnode.hpp macro.cpp compile.hpp +macro.cpp compileLog.hpp macro.cpp connode.hpp macro.cpp locknode.hpp macro.cpp loopnode.hpp @@ -758,6 +775,7 @@ output.cpp allocation.inline.hpp output.cpp assembler.inline.hpp output.cpp callnode.hpp output.cpp cfgnode.hpp +output.cpp compileBroker.hpp output.cpp debugInfo.hpp output.cpp debugInfoRec.hpp output.cpp handles.inline.hpp @@ -993,6 +1011,21 @@ split_if.cpp callnode.hpp split_if.cpp connode.hpp split_if.cpp loopnode.hpp +stringopts.hpp phaseX.hpp +stringopts.hpp node.hpp + +stringopts.cpp addnode.hpp +stringopts.cpp callnode.hpp +stringopts.cpp callGenerator.hpp +stringopts.cpp compileLog.hpp +stringopts.cpp divnode.hpp +stringopts.cpp idealKit.hpp +stringopts.cpp graphKit.hpp +stringopts.cpp rootnode.hpp +stringopts.cpp runtime.hpp +stringopts.cpp subnode.hpp +stringopts.cpp stringopts.hpp + stubGenerator_.cpp runtime.hpp stubRoutines.cpp runtime.hpp diff --git a/hotspot/src/share/vm/includeDB_core b/hotspot/src/share/vm/includeDB_core index e96a5e9be1a..0d1b52513e3 100644 --- a/hotspot/src/share/vm/includeDB_core +++ b/hotspot/src/share/vm/includeDB_core @@ -1,5 +1,5 @@ // -// Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. +// Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it @@ -175,6 +175,7 @@ arguments.cpp jvmtiExport.hpp arguments.cpp management.hpp arguments.cpp oop.inline.hpp arguments.cpp os_.inline.hpp +arguments.cpp referenceProcessor.hpp arguments.cpp universe.inline.hpp arguments.cpp vm_version_.hpp @@ -289,7 +290,7 @@ attachListener.hpp allocation.hpp attachListener.hpp debug.hpp attachListener.hpp ostream.hpp -barrierSet.cpp barrierSet.hpp +barrierSet.cpp barrierSet.inline.hpp barrierSet.cpp collectedHeap.hpp barrierSet.cpp universe.hpp @@ -516,6 +517,11 @@ ciArrayKlassKlass.hpp ciKlassKlass.hpp ciCallProfile.hpp ciClassList.hpp +ciCallSite.cpp ciCallSite.hpp +ciCallSite.cpp ciUtilities.hpp + +ciCallSite.hpp ciInstance.hpp + ciConstant.cpp allocation.hpp ciConstant.cpp allocation.inline.hpp ciConstant.cpp ciConstant.hpp @@ -532,6 +538,12 @@ ciConstantPoolCache.cpp ciUtilities.hpp ciConstantPoolCache.hpp growableArray.hpp ciConstantPoolCache.hpp resourceArea.hpp +ciCPCache.cpp cpCacheOop.hpp +ciCPCache.cpp ciCPCache.hpp + +ciCPCache.hpp ciClassList.hpp +ciCPCache.hpp ciObject.hpp + ciEnv.cpp allocation.inline.hpp ciEnv.cpp ciConstant.hpp ciEnv.cpp ciEnv.hpp @@ -570,6 +582,7 @@ ciEnv.hpp debugInfoRec.hpp ciEnv.hpp dependencies.hpp ciEnv.hpp exceptionHandlerTable.hpp ciEnv.hpp oopMap.hpp +ciEnv.hpp systemDictionary.hpp ciEnv.hpp thread.hpp ciExceptionHandler.cpp ciExceptionHandler.hpp @@ -592,6 +605,7 @@ ciField.cpp universe.inline.hpp ciField.hpp ciClassList.hpp ciField.hpp ciConstant.hpp ciField.hpp ciFlags.hpp +ciField.hpp ciInstance.hpp ciFlags.cpp ciFlags.hpp @@ -678,6 +692,7 @@ ciMethod.hpp ciFlags.hpp ciMethod.hpp ciInstanceKlass.hpp ciMethod.hpp ciObject.hpp ciMethod.hpp ciSignature.hpp +ciMethod.hpp methodHandles.hpp ciMethod.hpp methodLiveness.hpp ciMethodBlocks.cpp bytecode.hpp @@ -709,6 +724,15 @@ ciMethodKlass.cpp ciUtilities.hpp ciMethodKlass.hpp ciKlass.hpp ciMethodKlass.hpp ciSymbol.hpp +ciMethodHandle.cpp ciClassList.hpp +ciMethodHandle.cpp ciInstance.hpp +ciMethodHandle.cpp ciMethodHandle.hpp +ciMethodHandle.cpp ciUtilities.hpp +ciMethodHandle.cpp methodHandles.hpp +ciMethodHandle.cpp methodHandleWalk.hpp + +ciMethodHandle.hpp methodHandles.hpp + ciNullObject.cpp ciNullObject.hpp ciNullObject.hpp ciClassList.hpp @@ -754,11 +778,14 @@ ciObject.hpp handles.hpp ciObject.hpp jniHandles.hpp ciObjectFactory.cpp allocation.inline.hpp +ciObjectFactory.cpp ciCallSite.hpp +ciObjectFactory.cpp ciCPCache.hpp ciObjectFactory.cpp ciInstance.hpp ciObjectFactory.cpp ciInstanceKlass.hpp ciObjectFactory.cpp ciInstanceKlassKlass.hpp ciObjectFactory.cpp ciMethod.hpp ciObjectFactory.cpp ciMethodData.hpp +ciObjectFactory.cpp ciMethodHandle.hpp ciObjectFactory.cpp ciMethodKlass.hpp ciObjectFactory.cpp ciNullObject.hpp ciObjectFactory.cpp ciObjArray.hpp @@ -792,6 +819,7 @@ ciSignature.hpp ciSymbol.hpp ciSignature.hpp globalDefinitions.hpp ciSignature.hpp growableArray.hpp +ciStreams.cpp ciCallSite.hpp ciStreams.cpp ciConstant.hpp ciStreams.cpp ciField.hpp ciStreams.cpp ciStreams.hpp @@ -894,6 +922,7 @@ classFileStream.hpp top.hpp classLoader.cpp allocation.inline.hpp classLoader.cpp arguments.hpp +classLoader.cpp bytecodeStream.hpp classLoader.cpp classFileParser.hpp classLoader.cpp classFileStream.hpp classLoader.cpp classLoader.hpp @@ -921,6 +950,7 @@ classLoader.cpp jvm_misc.hpp classLoader.cpp management.hpp classLoader.cpp oop.inline.hpp classLoader.cpp oopFactory.hpp +classLoader.cpp oopMapCache.hpp classLoader.cpp os_.inline.hpp classLoader.cpp symbolOop.hpp classLoader.cpp systemDictionary.hpp @@ -1003,6 +1033,7 @@ codeCache.cpp objArrayOop.hpp codeCache.cpp oop.inline.hpp codeCache.cpp pcDesc.hpp codeCache.cpp resourceArea.hpp +codeCache.cpp xmlstream.hpp codeCache.hpp allocation.hpp codeCache.hpp codeBlob.hpp @@ -1091,6 +1122,7 @@ compileBroker.cpp nativeLookup.hpp compileBroker.cpp oop.inline.hpp compileBroker.cpp os.hpp compileBroker.cpp sharedRuntime.hpp +compileBroker.cpp sweeper.hpp compileBroker.cpp systemDictionary.hpp compileBroker.cpp vmSymbols.hpp @@ -1291,6 +1323,7 @@ cpCacheOop.cpp jvmtiRedefineClassesTrace.hpp cpCacheOop.cpp markSweep.inline.hpp cpCacheOop.cpp objArrayOop.hpp cpCacheOop.cpp oop.inline.hpp +cpCacheOop.cpp rewriter.hpp cpCacheOop.cpp universe.inline.hpp cpCacheOop.hpp allocation.hpp @@ -1451,6 +1484,7 @@ deoptimization.cpp thread.hpp deoptimization.cpp vframe.hpp deoptimization.cpp vframeArray.hpp deoptimization.cpp vframe_hp.hpp +deoptimization.cpp vmreg_.inline.hpp deoptimization.cpp xmlstream.hpp deoptimization.hpp allocation.hpp @@ -1497,6 +1531,7 @@ disassembler.cpp disassembler.hpp disassembler.cpp fprofiler.hpp disassembler.cpp handles.inline.hpp disassembler.cpp hpi.hpp +disassembler.cpp javaClasses.hpp disassembler.cpp stubCodeGenerator.hpp disassembler.cpp stubRoutines.hpp @@ -2501,6 +2536,7 @@ jvmtiExport.hpp growableArray.hpp jvmtiExport.hpp handles.hpp jvmtiExport.hpp iterator.hpp jvmtiExport.hpp jvmti.h +jvmtiExport.hpp jvmticmlr.h jvmtiExport.hpp oop.hpp jvmtiExport.hpp oopsHierarchy.hpp @@ -2619,6 +2655,7 @@ loaderConstraints.cpp resourceArea.hpp loaderConstraints.cpp safepoint.hpp loaderConstraints.hpp dictionary.hpp +loaderConstraints.hpp placeholders.hpp loaderConstraints.hpp hashtable.hpp location.cpp debugInfo.hpp @@ -2812,6 +2849,12 @@ methodDataOop.hpp oop.hpp methodDataOop.hpp orderAccess.hpp methodDataOop.hpp universe.hpp +methodHandleWalk.hpp methodHandles.hpp + +methodHandleWalk.cpp methodHandleWalk.hpp +methodHandleWalk.cpp oopFactory.hpp +methodHandleWalk.cpp rewriter.hpp + methodHandles.hpp frame.inline.hpp methodHandles.hpp globals.hpp methodHandles.hpp interfaceSupport.hpp @@ -3469,6 +3512,7 @@ reflection.cpp javaCalls.hpp reflection.cpp javaClasses.hpp reflection.cpp jvm.h reflection.cpp linkResolver.hpp +reflection.cpp methodHandleWalk.hpp reflection.cpp objArrayKlass.hpp reflection.cpp objArrayOop.hpp reflection.cpp oopFactory.hpp @@ -3680,6 +3724,7 @@ sharedHeap.hpp permGen.hpp sharedRuntime.cpp abstractCompiler.hpp sharedRuntime.cpp arguments.hpp sharedRuntime.cpp biasedLocking.hpp +sharedRuntime.cpp compileBroker.hpp sharedRuntime.cpp compiledIC.hpp sharedRuntime.cpp compilerOracle.hpp sharedRuntime.cpp copy.hpp @@ -3688,6 +3733,7 @@ sharedRuntime.cpp events.hpp sharedRuntime.cpp forte.hpp sharedRuntime.cpp gcLocker.inline.hpp sharedRuntime.cpp handles.inline.hpp +sharedRuntime.cpp hashtable.inline.hpp sharedRuntime.cpp init.hpp sharedRuntime.cpp interfaceSupport.hpp sharedRuntime.cpp interpreterRuntime.hpp @@ -3715,6 +3761,7 @@ sharedRuntime.cpp xmlstream.hpp sharedRuntime.hpp allocation.hpp sharedRuntime.hpp bytecodeHistogram.hpp sharedRuntime.hpp bytecodeTracer.hpp +sharedRuntime.hpp hashtable.hpp sharedRuntime.hpp linkResolver.hpp sharedRuntime.hpp resourceArea.hpp sharedRuntime.hpp threadLocalStorage.hpp @@ -3932,6 +3979,7 @@ stubs.hpp os_.inline.hpp sweeper.cpp atomic.hpp sweeper.cpp codeCache.hpp +sweeper.cpp compileBroker.hpp sweeper.cpp events.hpp sweeper.cpp methodOop.hpp sweeper.cpp mutexLocker.hpp @@ -3939,6 +3987,8 @@ sweeper.cpp nmethod.hpp sweeper.cpp os.hpp sweeper.cpp resourceArea.hpp sweeper.cpp sweeper.hpp +sweeper.cpp vm_operations.hpp +sweeper.cpp xmlstream.hpp symbolKlass.cpp gcLocker.hpp symbolKlass.cpp handles.inline.hpp @@ -4592,6 +4642,7 @@ vm_operations.cpp deoptimization.hpp vm_operations.cpp interfaceSupport.hpp vm_operations.cpp isGCActiveMark.hpp vm_operations.cpp resourceArea.hpp +vm_operations.cpp sweeper.hpp vm_operations.cpp threadService.hpp vm_operations.cpp thread_.inline.hpp vm_operations.cpp vmSymbols.hpp diff --git a/hotspot/src/share/vm/includeDB_gc_parallel b/hotspot/src/share/vm/includeDB_gc_parallel index 5f089b7d7f1..2d1c45a0c9b 100644 --- a/hotspot/src/share/vm/includeDB_gc_parallel +++ b/hotspot/src/share/vm/includeDB_gc_parallel @@ -21,6 +21,8 @@ // have any questions. // +arguments.cpp compactibleFreeListSpace.hpp + assembler_.cpp g1SATBCardTableModRefBS.hpp assembler_.cpp g1CollectedHeap.inline.hpp assembler_.cpp heapRegion.hpp diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp index 78323ee2aee..8ab9e40d32b 100644 --- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -109,6 +109,8 @@ class AbstractInterpreter: AllStatic { static void print_method_kind(MethodKind kind) PRODUCT_RETURN; + static bool can_be_compiled(methodHandle m); + // Runtime support // length = invoke bytecode length (to advance to next bytecode) diff --git a/hotspot/src/share/vm/interpreter/bytecode.cpp b/hotspot/src/share/vm/interpreter/bytecode.cpp index 0cc8a728950..4e8d9053615 100644 --- a/hotspot/src/share/vm/interpreter/bytecode.cpp +++ b/hotspot/src/share/vm/interpreter/bytecode.cpp @@ -102,7 +102,9 @@ methodHandle Bytecode_invoke::static_target(TRAPS) { KlassHandle resolved_klass; constantPoolHandle constants(THREAD, _method->constants()); - if (adjusted_invoke_code() != Bytecodes::_invokeinterface) { + if (adjusted_invoke_code() == Bytecodes::_invokedynamic) { + LinkResolver::resolve_dynamic_method(m, resolved_klass, constants, index(), CHECK_(methodHandle())); + } else if (adjusted_invoke_code() != Bytecodes::_invokeinterface) { LinkResolver::resolve_method(m, resolved_klass, constants, index(), CHECK_(methodHandle())); } else { LinkResolver::resolve_interface_method(m, resolved_klass, constants, index(), CHECK_(methodHandle())); diff --git a/hotspot/src/share/vm/interpreter/bytecode.hpp b/hotspot/src/share/vm/interpreter/bytecode.hpp index 49e70e8c1f3..7069081028f 100644 --- a/hotspot/src/share/vm/interpreter/bytecode.hpp +++ b/hotspot/src/share/vm/interpreter/bytecode.hpp @@ -205,12 +205,14 @@ class Bytecode_invoke: public ResourceObj { bool is_invokespecial() const { return adjusted_invoke_code() == Bytecodes::_invokespecial; } bool is_invokedynamic() const { return adjusted_invoke_code() == Bytecodes::_invokedynamic; } + bool has_receiver() const { return !is_invokestatic() && !is_invokedynamic(); } bool has_giant_index() const { return is_invokedynamic(); } bool is_valid() const { return is_invokeinterface() || is_invokevirtual() || is_invokestatic() || - is_invokespecial(); } + is_invokespecial() || + is_invokedynamic(); } // Creation inline friend Bytecode_invoke* Bytecode_invoke_at(methodHandle method, int bci); diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp index ac46f4ab5e1..1f0adb487ed 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp @@ -281,7 +281,7 @@ #define DO_BACKEDGE_CHECKS(skip, branch_pc) \ if ((skip) <= 0) { \ - if (UseCompiler && UseLoopCounter) { \ + if (UseLoopCounter) { \ bool do_OSR = UseOnStackReplacement; \ BACKEDGE_COUNT->increment(); \ if (do_OSR) do_OSR = BACKEDGE_COUNT->reached_InvocationLimit(); \ @@ -289,16 +289,12 @@ nmethod* osr_nmethod; \ OSR_REQUEST(osr_nmethod, branch_pc); \ if (osr_nmethod != NULL && osr_nmethod->osr_entry_bci() != InvalidOSREntryBci) { \ - intptr_t* buf; \ - CALL_VM(buf=SharedRuntime::OSR_migration_begin(THREAD), handle_exception); \ + intptr_t* buf = SharedRuntime::OSR_migration_begin(THREAD); \ istate->set_msg(do_osr); \ istate->set_osr_buf((address)buf); \ istate->set_osr_entry(osr_nmethod->osr_entry()); \ return; \ } \ - } else { \ - INCR_INVOCATION_COUNT; \ - SAFEPOINT; \ } \ } /* UseCompiler ... */ \ INCR_INVOCATION_COUNT; \ @@ -1281,12 +1277,7 @@ run: jfloat f; jdouble r; f = STACK_FLOAT(-1); -#ifdef IA64 - // IA64 gcc bug - r = ( f == 0.0f ) ? (jdouble) f : (jdouble) f + ia64_double_zero; -#else r = (jdouble) f; -#endif MORE_STACK(-1); // POP SET_STACK_DOUBLE(r, 1); UPDATE_PC_AND_TOS_AND_CONTINUE(1, 2); diff --git a/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp b/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp index 79cee762daa..c7a874ac4df 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp @@ -270,6 +270,8 @@ void BytecodePrinter::print_constant(int i, outputStream* st) { st->print_cr(" %s", constants->resolved_klass_at(i)->klass_part()->external_name()); } else if (tag.is_unresolved_klass()) { st->print_cr(" ", i); + } else if (tag.is_object()) { + st->print_cr(" " PTR_FORMAT, constants->object_at(i)); } else { st->print_cr(" bad tag=%d at %d", tag.value(), i); } @@ -282,18 +284,21 @@ void BytecodePrinter::print_field_or_method(int i, outputStream* st) { constantPoolOop constants = method()->constants(); constantTag tag = constants->tag_at(i); + int nt_index = -1; + switch (tag.value()) { case JVM_CONSTANT_InterfaceMethodref: case JVM_CONSTANT_Methodref: case JVM_CONSTANT_Fieldref: + case JVM_CONSTANT_NameAndType: break; default: st->print_cr(" bad tag=%d at %d", tag.value(), i); return; } - symbolOop name = constants->name_ref_at(orig_i); - symbolOop signature = constants->signature_ref_at(orig_i); + symbolOop name = constants->uncached_name_ref_at(i); + symbolOop signature = constants->uncached_signature_ref_at(i); st->print_cr(" %d <%s> <%s> ", i, name->as_C_string(), signature->as_C_string()); } diff --git a/hotspot/src/share/vm/interpreter/bytecodes.cpp b/hotspot/src/share/vm/interpreter/bytecodes.cpp index e55c9ff3851..cb2a7ecb234 100644 --- a/hotspot/src/share/vm/interpreter/bytecodes.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodes.cpp @@ -357,7 +357,7 @@ void Bytecodes::initialize() { def(_invokespecial , "invokespecial" , "bjj" , NULL , T_ILLEGAL, -1, true); def(_invokestatic , "invokestatic" , "bjj" , NULL , T_ILLEGAL, 0, true); def(_invokeinterface , "invokeinterface" , "bjj__", NULL , T_ILLEGAL, -1, true); - def(_invokedynamic , "invokedynamic" , "bjjjj", NULL , T_ILLEGAL, -1, true ); + def(_invokedynamic , "invokedynamic" , "bjjjj", NULL , T_ILLEGAL, 0, true ); def(_new , "new" , "bii" , NULL , T_OBJECT , 1, true ); def(_newarray , "newarray" , "bc" , NULL , T_OBJECT , 0, true ); def(_anewarray , "anewarray" , "bii" , NULL , T_OBJECT , 0, true ); diff --git a/hotspot/src/share/vm/interpreter/interpreter.cpp b/hotspot/src/share/vm/interpreter/interpreter.cpp index b4f1007bc6c..484a47f7d42 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.cpp +++ b/hotspot/src/share/vm/interpreter/interpreter.cpp @@ -314,6 +314,20 @@ address AbstractInterpreter::deopt_continue_after_entry(methodOop method, addres break; } + case Bytecodes::_invokedynamic: { + Thread *thread = Thread::current(); + ResourceMark rm(thread); + methodHandle mh(thread, method); + type = Bytecode_invoke_at(mh, bci)->result_type(thread); + // since the cache entry might not be initialized: + // (NOT needed for the old calling convension) + if (!is_top_frame) { + int index = Bytes::get_native_u4(bcp+1); + method->constants()->cache()->secondary_entry_at(index)->set_parameter_size(callee_parameters); + } + break; + } + case Bytecodes::_ldc : type = constant_pool_type( method, *(bcp+1) ); break; diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp index c8e19944de7..78a6af5549e 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -353,7 +353,7 @@ IRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea assert(h_exception.not_null(), "NULL exceptions should be handled by athrow"); assert(h_exception->is_oop(), "just checking"); // Check that exception is a subclass of Throwable, otherwise we have a VerifyError - if (!(h_exception->is_a(SystemDictionary::throwable_klass()))) { + if (!(h_exception->is_a(SystemDictionary::Throwable_klass()))) { if (ExitVMOnVerifyError) vm_exit(-1); ShouldNotReachHere(); } @@ -397,7 +397,7 @@ IRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea // notify JVMTI of an exception throw; JVMTI will detect if this is a first // time throw or a stack unwinding throw and accordingly notify the debugger - if (JvmtiExport::can_post_exceptions()) { + if (JvmtiExport::can_post_on_exceptions()) { JvmtiExport::post_exception_throw(thread, h_method(), bcp(thread), h_exception()); } @@ -426,7 +426,7 @@ IRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea } // notify debugger of an exception catch // (this is good for exceptions caught in native methods as well) - if (JvmtiExport::can_post_exceptions()) { + if (JvmtiExport::can_post_on_exceptions()) { JvmtiExport::notice_unwind_due_to_exception(thread, h_method(), handler_pc, h_exception(), (handler_pc != NULL)); } @@ -585,7 +585,7 @@ IRT_ENTRY(void, InterpreterRuntime::new_illegal_monitor_state_exception(JavaThre Handle exception(thread, thread->vm_result()); assert(exception() != NULL, "vm result should be set"); thread->set_vm_result(NULL); // clear vm result before continuing (may cause memory leaks and assert failures) - if (!exception->is_a(SystemDictionary::threaddeath_klass())) { + if (!exception->is_a(SystemDictionary::ThreadDeath_klass())) { exception = get_preinitialized_exception( SystemDictionary::IllegalMonitorStateException_klass(), CATCH); @@ -660,7 +660,7 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_invoke(JavaThread* thread, Bytecodes tty->print_cr("Resolving: klass: %s to method: %s", info.resolved_klass()->name()->as_C_string(), info.resolved_method()->name()->as_C_string()); } if (info.resolved_method()->method_holder() == - SystemDictionary::object_klass()) { + SystemDictionary::Object_klass()) { // NOTE: THIS IS A FIX FOR A CORNER CASE in the JVM spec // (see also cpCacheOop.cpp for details) methodHandle rm = info.resolved_method(); @@ -681,7 +681,7 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_invoke(JavaThread* thread, Bytecodes IRT_END -// First time execution: Resolve symbols, create a permanent CallSiteImpl object. +// First time execution: Resolve symbols, create a permanent CallSite object. IRT_ENTRY(void, InterpreterRuntime::resolve_invokedynamic(JavaThread* thread)) { ResourceMark rm(thread); @@ -708,21 +708,16 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_invokedynamic(JavaThread* thread)) { constantPoolHandle pool(thread, caller_method->constants()); pool->set_invokedynamic(); // mark header to flag active call sites - int raw_index = four_byte_index(thread); - assert(constantPoolCacheOopDesc::is_secondary_index(raw_index), "invokedynamic indexes marked specially"); - - // there are two CPC entries that are of interest: - int site_index = constantPoolCacheOopDesc::decode_secondary_index(raw_index); - int main_index = pool->cache()->entry_at(site_index)->main_entry_index(); - // and there is one CP entry, a NameAndType: - int nt_index = pool->map_instruction_operand_to_index(raw_index); + int site_index = four_byte_index(thread); + // there is a second CPC entries that is of interest; it caches signature info: + int main_index = pool->cache()->secondary_entry_at(site_index)->main_entry_index(); // first resolve the signature to a MH.invoke methodOop if (!pool->cache()->entry_at(main_index)->is_resolved(bytecode)) { JvmtiHideSingleStepping jhss(thread); CallInfo info; LinkResolver::resolve_invoke(info, Handle(), pool, - raw_index, bytecode, CHECK); + site_index, bytecode, CHECK); // The main entry corresponds to a JVM_CONSTANT_NameAndType, and serves // as a common reference point for all invokedynamic call sites with // that exact call descriptor. We will link it in the CP cache exactly @@ -741,7 +736,7 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_invokedynamic(JavaThread* thread)) { assert(mh_invdyn.not_null() && mh_invdyn->is_method() && mh_invdyn->is_method_handle_invoke(), "correct result from LinkResolver::resolve_invokedynamic"); - symbolHandle call_site_name(THREAD, pool->nt_name_ref_at(nt_index)); + symbolHandle call_site_name(THREAD, pool->name_ref_at(site_index)); Handle call_site = SystemDictionary::make_dynamic_call_site(caller_method->method_holder(), caller_method->method_idnum(), @@ -753,61 +748,11 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_invokedynamic(JavaThread* thread)) { // In the secondary entry, the f1 field is the call site, and the f2 (index) // field is some data about the invoke site. int extra_data = 0; - pool->cache()->entry_at(site_index)->set_dynamic_call(call_site(), extra_data); + pool->cache()->secondary_entry_at(site_index)->set_dynamic_call(call_site(), extra_data); } IRT_END -// Called on first time execution, and also whenever the CallSite.target is null. -// FIXME: Do more of this in Java code. -IRT_ENTRY(void, InterpreterRuntime::bootstrap_invokedynamic(JavaThread* thread, oopDesc* call_site)) { - methodHandle mh_invdyn(thread, (methodOop) sun_dyn_CallSiteImpl::vmmethod(call_site)); - Handle mh_type(thread, mh_invdyn->method_handle_type()); - objArrayHandle mh_ptypes(thread, java_dyn_MethodType::ptypes(mh_type())); - - // squish the arguments down to a single array - int nargs = mh_ptypes->length(); - objArrayHandle arg_array; - { - objArrayOop aaoop = oopFactory::new_objArray(SystemDictionary::object_klass(), nargs, CHECK); - arg_array = objArrayHandle(thread, aaoop); - } - frame fr = thread->last_frame(); - assert(fr.interpreter_frame_bcp() != NULL, "sanity"); - int tos_offset = 0; - for (int i = nargs; --i >= 0; ) { - intptr_t* slot_addr = fr.interpreter_frame_tos_at(tos_offset++); - oop ptype = mh_ptypes->obj_at(i); - oop arg = NULL; - if (!java_lang_Class::is_primitive(ptype)) { - arg = *(oop*) slot_addr; - } else { - BasicType bt = java_lang_Class::primitive_type(ptype); - assert(frame::interpreter_frame_expression_stack_direction() < 0, "else reconsider this code"); - jvalue value; - Interpreter::get_jvalue_in_slot(slot_addr, bt, &value); - tos_offset += type2size[bt]-1; - arg = java_lang_boxing_object::create(bt, &value, CHECK); - // FIXME: These boxing objects are not canonicalized under - // the Java autoboxing rules. They should be... - // The best approach would be to push the arglist creation into Java. - // The JVM should use a lower-level interface to communicate argument lists. - } - arg_array->obj_at_put(i, arg); - } - - // now find the bootstrap method - oop bootstrap_mh_oop = instanceKlass::cast(fr.interpreter_frame_method()->method_holder())->bootstrap_method(); - assert(bootstrap_mh_oop != NULL, "resolve_invokedynamic ensures a BSM"); - - // return the bootstrap method and argument array via vm_result/_2 - thread->set_vm_result(bootstrap_mh_oop); - thread->set_vm_result_2(arg_array()); -} -IRT_END - - - //------------------------------------------------------------------------------------------------------------------------ // Miscellaneous @@ -1305,7 +1250,7 @@ IRT_LEAF(void, InterpreterRuntime::popframe_move_outgoing_args(JavaThread* threa methodHandle mh(thread, fr.interpreter_frame_method()); Bytecode_invoke* invoke = Bytecode_invoke_at(mh, bci); ArgumentSizeComputer asc(invoke->signature()); - int size_of_arguments = (asc.size() + (invoke->is_invokestatic() ? 0 : 1)); // receiver + int size_of_arguments = (asc.size() + (invoke->has_receiver() ? 1 : 0)); // receiver Copy::conjoint_bytes(src_address, dest_address, size_of_arguments * Interpreter::stackElementSize()); IRT_END diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp index 76b9e9c2191..b0a616308e4 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp @@ -91,7 +91,6 @@ class InterpreterRuntime: AllStatic { // Calls static void resolve_invoke (JavaThread* thread, Bytecodes::Code bytecode); static void resolve_invokedynamic(JavaThread* thread); - static void bootstrap_invokedynamic(JavaThread* thread, oopDesc* call_site); // Breakpoints static void _breakpoint(JavaThread* thread, methodOopDesc* method, address bcp); diff --git a/hotspot/src/share/vm/interpreter/linkResolver.cpp b/hotspot/src/share/vm/interpreter/linkResolver.cpp index c9a2c13c5b1..4c5fd690393 100644 --- a/hotspot/src/share/vm/interpreter/linkResolver.cpp +++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp @@ -55,7 +55,7 @@ void CallInfo::set_interface(KlassHandle resolved_klass, KlassHandle selected_kl // we should pick the vtable index from the resolved method. // Other than that case, there is no valid vtable index to specify. int vtable_index = methodOopDesc::invalid_vtable_index; - if (resolved_method->method_holder() == SystemDictionary::object_klass()) { + if (resolved_method->method_holder() == SystemDictionary::Object_klass()) { assert(resolved_method->vtable_index() == selected_method->vtable_index(), "sanity check"); vtable_index = resolved_method->vtable_index(); } @@ -75,6 +75,8 @@ void CallInfo::set_common(KlassHandle resolved_klass, KlassHandle selected_klass _selected_method = selected_method; _vtable_index = vtable_index; if (CompilationPolicy::mustBeCompiled(selected_method)) { + // This path is unusual, mostly used by the '-Xcomp' stress test mode. + // Note: with several active threads, the mustBeCompiled may be true // while canBeCompiled is false; remove assert // assert(CompilationPolicy::canBeCompiled(selected_method), "cannot compile"); @@ -82,6 +84,16 @@ void CallInfo::set_common(KlassHandle resolved_klass, KlassHandle selected_klass // don't force compilation, resolve was on behalf of compiler return; } + if (instanceKlass::cast(selected_method->method_holder())->is_not_initialized()) { + // 'is_not_initialized' means not only '!is_initialized', but also that + // initialization has not been started yet ('!being_initialized') + // Do not force compilation of methods in uninitialized classes. + // Note that doing this would throw an assert later, + // in CompileBroker::compile_method. + // We sometimes use the link resolver to do reflective lookups + // even before classes are initialized. + return; + } CompileBroker::compile_method(selected_method, InvocationEntryBci, methodHandle(), 0, "mustBeCompiled", CHECK); } @@ -181,7 +193,7 @@ void LinkResolver::check_method_accessability(KlassHandle ref_klass, // We'll check for the method name first, as that's most likely // to be false (so we'll short-circuit out of these tests). if (sel_method->name() == vmSymbols::clone_name() && - sel_klass() == SystemDictionary::object_klass() && + sel_klass() == SystemDictionary::Object_klass() && resolved_klass->oop_is_array()) { // We need to change "protected" to "public". assert(flags.is_protected(), "clone not protected?"); @@ -223,6 +235,18 @@ void LinkResolver::resolve_method(methodHandle& resolved_method, KlassHandle& re resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, true, CHECK); } +void LinkResolver::resolve_dynamic_method(methodHandle& resolved_method, KlassHandle& resolved_klass, constantPoolHandle pool, int index, TRAPS) { + // The class is java.dyn.MethodHandle + resolved_klass = SystemDictionaryHandles::MethodHandle_klass(); + + symbolHandle method_name = vmSymbolHandles::invoke_name(); + + symbolHandle method_signature(THREAD, pool->signature_ref_at(index)); + KlassHandle current_klass (THREAD, pool->pool_holder()); + + resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, true, CHECK); +} + void LinkResolver::resolve_interface_method(methodHandle& resolved_method, KlassHandle& resolved_klass, constantPoolHandle pool, int index, TRAPS) { // resolve klass @@ -1015,11 +1039,8 @@ void LinkResolver::resolve_invokedynamic(CallInfo& result, constantPoolHandle po // This guy is reached from InterpreterRuntime::resolve_invokedynamic. - assert(constantPoolCacheOopDesc::is_secondary_index(raw_index), "must be secondary index"); - int nt_index = pool->map_instruction_operand_to_index(raw_index); - // At this point, we only need the signature, and can ignore the name. - symbolHandle method_signature(THREAD, pool->nt_signature_ref_at(nt_index)); + symbolHandle method_signature(THREAD, pool->signature_ref_at(raw_index)); // raw_index works directly symbolHandle method_name = vmSymbolHandles::invoke_name(); KlassHandle resolved_klass = SystemDictionaryHandles::MethodHandle_klass(); diff --git a/hotspot/src/share/vm/interpreter/linkResolver.hpp b/hotspot/src/share/vm/interpreter/linkResolver.hpp index a95873b4c90..efc1b53f5f3 100644 --- a/hotspot/src/share/vm/interpreter/linkResolver.hpp +++ b/hotspot/src/share/vm/interpreter/linkResolver.hpp @@ -133,6 +133,7 @@ class LinkResolver: AllStatic { // static resolving for all calls except interface calls static void resolve_method (methodHandle& method_result, KlassHandle& klass_result, constantPoolHandle pool, int index, TRAPS); + static void resolve_dynamic_method (methodHandle& resolved_method, KlassHandle& resolved_klass, constantPoolHandle pool, int index, TRAPS); static void resolve_interface_method(methodHandle& method_result, KlassHandle& klass_result, constantPoolHandle pool, int index, TRAPS); // runtime/static resolving for fields diff --git a/hotspot/src/share/vm/interpreter/rewriter.cpp b/hotspot/src/share/vm/interpreter/rewriter.cpp index c70c0c0356f..8ff99109349 100644 --- a/hotspot/src/share/vm/interpreter/rewriter.cpp +++ b/hotspot/src/share/vm/interpreter/rewriter.cpp @@ -48,16 +48,6 @@ void Rewriter::compute_index_maps() { } -int Rewriter::add_extra_cp_cache_entry(int main_entry) { - // Hack: We put it on the map as an encoded value. - // The only place that consumes this is ConstantPoolCacheEntry::set_initial_state - int encoded = constantPoolCacheOopDesc::encode_secondary_index(main_entry); - int plain_secondary_index = _cp_cache_map.append(encoded); - return constantPoolCacheOopDesc::encode_secondary_index(plain_secondary_index); -} - - - // Creates a constant pool cache given a CPC map // This creates the constant pool cache initially in a state // that is unsafe for concurrent GC processing but sets it to @@ -127,7 +117,7 @@ void Rewriter::rewrite_invokedynamic(address bcp, int offset, int delete_me) { assert(p[-1] == Bytecodes::_invokedynamic, ""); int cp_index = Bytes::get_Java_u2(p); int cpc = maybe_add_cp_cache_entry(cp_index); // add lazily - int cpc2 = add_extra_cp_cache_entry(cpc); + int cpc2 = add_secondary_cp_cache_entry(cpc); // Replace the trailing four bytes with a CPC index for the dynamic // call site. Unlike other CPC entries, there is one per bytecode, @@ -137,7 +127,7 @@ void Rewriter::rewrite_invokedynamic(address bcp, int offset, int delete_me) { // all these entries. That is the main reason invokedynamic // must have a five-byte instruction format. (Of course, other JVM // implementations can use the bytes for other purposes.) - Bytes::put_native_u4(p, cpc2); + Bytes::put_native_u4(p, constantPoolCacheOopDesc::encode_secondary_index(cpc2)); // Note: We use native_u4 format exclusively for 4-byte indexes. } @@ -257,15 +247,22 @@ methodHandle Rewriter::rewrite_jsrs(methodHandle method, TRAPS) { void Rewriter::rewrite(instanceKlassHandle klass, TRAPS) { ResourceMark rm(THREAD); - Rewriter rw(klass, CHECK); + Rewriter rw(klass, klass->constants(), klass->methods(), CHECK); // (That's all, folks.) } -Rewriter::Rewriter(instanceKlassHandle klass, TRAPS) + +void Rewriter::rewrite(instanceKlassHandle klass, constantPoolHandle cpool, objArrayHandle methods, TRAPS) { + ResourceMark rm(THREAD); + Rewriter rw(klass, cpool, methods, CHECK); + // (That's all, folks.) +} + + +Rewriter::Rewriter(instanceKlassHandle klass, constantPoolHandle cpool, objArrayHandle methods, TRAPS) : _klass(klass), - // gather starting points - _pool( THREAD, klass->constants()), - _methods(THREAD, klass->methods()) + _pool(cpool), + _methods(methods) { assert(_pool->cache() == NULL, "constant pool cache must not be set yet"); diff --git a/hotspot/src/share/vm/interpreter/rewriter.hpp b/hotspot/src/share/vm/interpreter/rewriter.hpp index 2546b57ef37..39325e743aa 100644 --- a/hotspot/src/share/vm/interpreter/rewriter.hpp +++ b/hotspot/src/share/vm/interpreter/rewriter.hpp @@ -43,16 +43,21 @@ class Rewriter: public StackObj { bool has_cp_cache(int i) { return (uint)i < (uint)_cp_map.length() && _cp_map[i] >= 0; } int maybe_add_cp_cache_entry(int i) { return has_cp_cache(i) ? _cp_map[i] : add_cp_cache_entry(i); } int add_cp_cache_entry(int cp_index) { + assert((cp_index & _secondary_entry_tag) == 0, "bad tag"); assert(_cp_map[cp_index] == -1, "not twice on same cp_index"); int cache_index = _cp_cache_map.append(cp_index); _cp_map.at_put(cp_index, cache_index); assert(cp_entry_to_cp_cache(cp_index) == cache_index, ""); return cache_index; } - int add_extra_cp_cache_entry(int main_entry); + int add_secondary_cp_cache_entry(int main_cpc_entry) { + assert(main_cpc_entry < _cp_cache_map.length(), "must be earlier CP cache entry"); + int cache_index = _cp_cache_map.append(main_cpc_entry | _secondary_entry_tag); + return cache_index; + } // All the work goes in here: - Rewriter(instanceKlassHandle klass, TRAPS); + Rewriter(instanceKlassHandle klass, constantPoolHandle cpool, objArrayHandle methods, TRAPS); void compute_index_maps(); void make_constant_pool_cache(TRAPS); @@ -65,4 +70,9 @@ class Rewriter: public StackObj { public: // Driver routine: static void rewrite(instanceKlassHandle klass, TRAPS); + static void rewrite(instanceKlassHandle klass, constantPoolHandle cpool, objArrayHandle methods, TRAPS); + + enum { + _secondary_entry_tag = nth_bit(30) + }; }; diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp index 9f12f44e3a5..e617623506b 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp @@ -178,14 +178,12 @@ EntryPoint TemplateInterpreter::_trace_code; #endif // !PRODUCT EntryPoint TemplateInterpreter::_return_entry[TemplateInterpreter::number_of_return_entries]; EntryPoint TemplateInterpreter::_earlyret_entry; -EntryPoint TemplateInterpreter::_return_unbox_entry; EntryPoint TemplateInterpreter::_deopt_entry [TemplateInterpreter::number_of_deopt_entries ]; EntryPoint TemplateInterpreter::_continuation_entry; EntryPoint TemplateInterpreter::_safept_entry; address TemplateInterpreter::_return_3_addrs_by_index[TemplateInterpreter::number_of_return_addrs]; address TemplateInterpreter::_return_5_addrs_by_index[TemplateInterpreter::number_of_return_addrs]; -address TemplateInterpreter::_return_5_unbox_addrs_by_index[TemplateInterpreter::number_of_return_addrs]; DispatchTable TemplateInterpreter::_active_table; DispatchTable TemplateInterpreter::_normal_table; @@ -253,22 +251,6 @@ void TemplateInterpreterGenerator::generate_all() { } } - if (EnableInvokeDynamic) { - CodeletMark cm(_masm, "unboxing return entry points"); - Interpreter::_return_unbox_entry = - EntryPoint( - generate_return_unbox_entry_for(btos, 5), - generate_return_unbox_entry_for(ctos, 5), - generate_return_unbox_entry_for(stos, 5), - generate_return_unbox_entry_for(atos, 5), // cast conversion - generate_return_unbox_entry_for(itos, 5), - generate_return_unbox_entry_for(ltos, 5), - generate_return_unbox_entry_for(ftos, 5), - generate_return_unbox_entry_for(dtos, 5), - Interpreter::_return_entry[5].entry(vtos) // no unboxing for void - ); - } - { CodeletMark cm(_masm, "earlyret entry points"); Interpreter::_earlyret_entry = EntryPoint( @@ -319,8 +301,6 @@ void TemplateInterpreterGenerator::generate_all() { int index = Interpreter::TosState_as_index(states[j]); Interpreter::_return_3_addrs_by_index[index] = Interpreter::return_entry(states[j], 3); Interpreter::_return_5_addrs_by_index[index] = Interpreter::return_entry(states[j], 5); - if (EnableInvokeDynamic) - Interpreter::_return_5_unbox_addrs_by_index[index] = Interpreter::return_unbox_entry(states[j], 5); } { CodeletMark cm(_masm, "continuation entry points"); @@ -485,9 +465,11 @@ void TemplateInterpreterGenerator::set_wide_entry_point(Template* t, address& we void TemplateInterpreterGenerator::set_short_entry_points(Template* t, address& bep, address& cep, address& sep, address& aep, address& iep, address& lep, address& fep, address& dep, address& vep) { assert(t->is_valid(), "template must exist"); switch (t->tos_in()) { - case btos: vep = __ pc(); __ pop(btos); bep = __ pc(); generate_and_dispatch(t); break; - case ctos: vep = __ pc(); __ pop(ctos); sep = __ pc(); generate_and_dispatch(t); break; - case stos: vep = __ pc(); __ pop(stos); sep = __ pc(); generate_and_dispatch(t); break; + case btos: + case ctos: + case stos: + ShouldNotReachHere(); // btos/ctos/stos should use itos. + break; case atos: vep = __ pc(); __ pop(atos); aep = __ pc(); generate_and_dispatch(t); break; case itos: vep = __ pc(); __ pop(itos); iep = __ pc(); generate_and_dispatch(t); break; case ltos: vep = __ pc(); __ pop(ltos); lep = __ pc(); generate_and_dispatch(t); break; @@ -547,18 +529,6 @@ address TemplateInterpreter::return_entry(TosState state, int length) { } -address TemplateInterpreter::return_unbox_entry(TosState state, int length) { - assert(EnableInvokeDynamic, ""); - if (state == vtos) { - // no unboxing to do, actually - return return_entry(state, length); - } else { - assert(length == 5, "unboxing entries generated for invokedynamic only"); - return _return_unbox_entry.entry(state); - } -} - - address TemplateInterpreter::deopt_entry(TosState state, int length) { guarantee(0 <= length && length < Interpreter::number_of_deopt_entries, "illegal length"); return _deopt_entry[length].entry(state); diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp index 7de665b882f..b3eed1c3a4e 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp @@ -110,14 +110,12 @@ class TemplateInterpreter: public AbstractInterpreter { #endif // !PRODUCT static EntryPoint _return_entry[number_of_return_entries]; // entry points to return to from a call static EntryPoint _earlyret_entry; // entry point to return early from a call - static EntryPoint _return_unbox_entry; // entry point to unbox a return value from a call static EntryPoint _deopt_entry[number_of_deopt_entries]; // entry points to return to from a deoptimization static EntryPoint _continuation_entry; static EntryPoint _safept_entry; static address _return_3_addrs_by_index[number_of_return_addrs]; // for invokevirtual return entries static address _return_5_addrs_by_index[number_of_return_addrs]; // for invokeinterface return entries - static address _return_5_unbox_addrs_by_index[number_of_return_addrs]; // for invokedynamic bootstrap methods static DispatchTable _active_table; // the active dispatch table (used by the interpreter for dispatch) static DispatchTable _normal_table; // the normal dispatch table (used to set the active table in normal mode) @@ -159,12 +157,10 @@ class TemplateInterpreter: public AbstractInterpreter { // Support for invokes static address* return_3_addrs_by_index_table() { return _return_3_addrs_by_index; } static address* return_5_addrs_by_index_table() { return _return_5_addrs_by_index; } - static address* return_5_unbox_addrs_by_index_table() { return _return_5_unbox_addrs_by_index; } static int TosState_as_index(TosState state); // computes index into return_3_entry_by_index table static address return_entry (TosState state, int length); static address deopt_entry (TosState state, int length); - static address return_unbox_entry(TosState state, int length); // Safepoint support static void notice_safepoints(); // stops the thread when reaching a safepoint diff --git a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp index 9d5b694049e..676e762725d 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp @@ -51,10 +51,7 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator { address generate_WrongMethodType_handler(); address generate_ArrayIndexOutOfBounds_handler(const char* name); address generate_continuation_for(TosState state); - address generate_return_entry_for(TosState state, int step, bool unbox = false); - address generate_return_unbox_entry_for(TosState state, int step) { - return generate_return_entry_for(state, step, true); - } + address generate_return_entry_for(TosState state, int step); address generate_earlyret_entry_for(TosState state); address generate_deopt_entry_for(TosState state, int step); address generate_safept_entry_for(TosState state, address runtime_entry); diff --git a/hotspot/src/share/vm/memory/barrierSet.cpp b/hotspot/src/share/vm/memory/barrierSet.cpp index 07ff7a0fc21..8cd80b7c437 100644 --- a/hotspot/src/share/vm/memory/barrierSet.cpp +++ b/hotspot/src/share/vm/memory/barrierSet.cpp @@ -41,11 +41,6 @@ void BarrierSet::static_write_ref_array_pre(HeapWord* start, size_t count) { // count is number of array elements being written void BarrierSet::static_write_ref_array_post(HeapWord* start, size_t count) { - assert(count <= (size_t)max_intx, "count too large"); - HeapWord* end = start + objArrayOopDesc::array_size((int)count); -#if 0 - warning("Post:\t" INTPTR_FORMAT "[" SIZE_FORMAT "] : [" INTPTR_FORMAT","INTPTR_FORMAT")\t", - start, count, start, end); -#endif - Universe::heap()->barrier_set()->write_ref_array_work(MemRegion(start, end)); + // simply delegate to instance method + Universe::heap()->barrier_set()->write_ref_array(start, count); } diff --git a/hotspot/src/share/vm/memory/barrierSet.hpp b/hotspot/src/share/vm/memory/barrierSet.hpp index 0fc6a006140..4188e11fa96 100644 --- a/hotspot/src/share/vm/memory/barrierSet.hpp +++ b/hotspot/src/share/vm/memory/barrierSet.hpp @@ -121,17 +121,18 @@ public: virtual void read_ref_array(MemRegion mr) = 0; virtual void read_prim_array(MemRegion mr) = 0; + // Below length is the # array elements being written virtual void write_ref_array_pre( oop* dst, int length) {} virtual void write_ref_array_pre(narrowOop* dst, int length) {} - inline void write_ref_array(MemRegion mr); + // Below count is the # array elements being written, starting + // at the address "start", which may not necessarily be HeapWord-aligned + inline void write_ref_array(HeapWord* start, size_t count); - // Static versions, suitable for calling from generated code. + // Static versions, suitable for calling from generated code; + // count is # array elements being written, starting with "start", + // which may not necessarily be HeapWord-aligned. static void static_write_ref_array_pre(HeapWord* start, size_t count); static void static_write_ref_array_post(HeapWord* start, size_t count); - // Narrow oop versions of the above; count is # of array elements being written, - // starting with "start", which is HeapWord-aligned. - static void static_write_ref_array_pre_narrow(HeapWord* start, size_t count); - static void static_write_ref_array_post_narrow(HeapWord* start, size_t count); protected: virtual void write_ref_array_work(MemRegion mr) = 0; diff --git a/hotspot/src/share/vm/memory/barrierSet.inline.hpp b/hotspot/src/share/vm/memory/barrierSet.inline.hpp index edcb551bdcd..f8858253e17 100644 --- a/hotspot/src/share/vm/memory/barrierSet.inline.hpp +++ b/hotspot/src/share/vm/memory/barrierSet.inline.hpp @@ -42,14 +42,34 @@ void BarrierSet::write_ref_field(void* field, oop new_val) { } } -void BarrierSet::write_ref_array(MemRegion mr) { - if (kind() == CardTableModRef) { - ((CardTableModRefBS*)this)->inline_write_ref_array(mr); - } else { - write_ref_array_work(mr); - } +// count is number of array elements being written +void BarrierSet::write_ref_array(HeapWord* start, size_t count) { + assert(count <= (size_t)max_intx, "count too large"); + HeapWord* end = (HeapWord*)((char*)start + (count*heapOopSize)); + // In the case of compressed oops, start and end may potentially be misaligned; + // so we need to conservatively align the first downward (this is not + // strictly necessary for current uses, but a case of good hygiene and, + // if you will, aesthetics) and the second upward (this is essential for + // current uses) to a HeapWord boundary, so we mark all cards overlapping + // this write. If this evolves in the future to calling a + // logging barrier of narrow oop granularity, like the pre-barrier for G1 + // (mentioned here merely by way of example), we will need to change this + // interface, so it is "exactly precise" (if i may be allowed the adverbial + // redundancy for emphasis) and does not include narrow oop slots not + // included in the original write interval. + HeapWord* aligned_start = (HeapWord*)align_size_down((uintptr_t)start, HeapWordSize); + HeapWord* aligned_end = (HeapWord*)align_size_up ((uintptr_t)end, HeapWordSize); + // If compressed oops were not being used, these should already be aligned + assert(UseCompressedOops || (aligned_start == start && aligned_end == end), + "Expected heap word alignment of start and end"); +#if 0 + warning("Post:\t" INTPTR_FORMAT "[" SIZE_FORMAT "] : [" INTPTR_FORMAT","INTPTR_FORMAT")\t", + start, count, aligned_start, aligned_end); +#endif + write_ref_array_work(MemRegion(aligned_start, aligned_end)); } + void BarrierSet::write_region(MemRegion mr) { if (kind() == CardTableModRef) { ((CardTableModRefBS*)this)->inline_write_region(mr); diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp index c036a355514..2deb7da83f0 100644 --- a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp +++ b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp @@ -511,6 +511,8 @@ void CardTableModRefBS::mod_oop_in_space_iterate(Space* sp, } void CardTableModRefBS::dirty_MemRegion(MemRegion mr) { + assert((HeapWord*)align_size_down((uintptr_t)mr.start(), HeapWordSize) == mr.start(), "Unaligned start"); + assert((HeapWord*)align_size_up ((uintptr_t)mr.end(), HeapWordSize) == mr.end(), "Unaligned end" ); jbyte* cur = byte_for(mr.start()); jbyte* last = byte_after(mr.last()); while (cur < last) { @@ -520,6 +522,8 @@ void CardTableModRefBS::dirty_MemRegion(MemRegion mr) { } void CardTableModRefBS::invalidate(MemRegion mr, bool whole_heap) { + assert((HeapWord*)align_size_down((uintptr_t)mr.start(), HeapWordSize) == mr.start(), "Unaligned start"); + assert((HeapWord*)align_size_up ((uintptr_t)mr.end(), HeapWordSize) == mr.end(), "Unaligned end" ); for (int i = 0; i < _cur_covered_regions; i++) { MemRegion mri = mr.intersection(_covered[i]); if (!mri.is_empty()) dirty_MemRegion(mri); diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp index bffdd50926b..02fd91db16a 100644 --- a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp +++ b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp @@ -339,6 +339,16 @@ public: return (val & (clean_card_mask_val() | claimed_card_val())) == claimed_card_val(); } + void set_card_claimed(size_t card_index) { + jbyte val = _byte_map[card_index]; + if (val == clean_card_val()) { + val = (jbyte)claimed_card_val(); + } else { + val |= (jbyte)claimed_card_val(); + } + _byte_map[card_index] = val; + } + bool claim_card(size_t card_index); bool is_card_clean(size_t card_index) { diff --git a/hotspot/src/share/vm/memory/classify.cpp b/hotspot/src/share/vm/memory/classify.cpp index 0cb6a572cb3..bc4fecd74ff 100644 --- a/hotspot/src/share/vm/memory/classify.cpp +++ b/hotspot/src/share/vm/memory/classify.cpp @@ -49,7 +49,7 @@ object_type ClassifyObjectClosure::classify_object(oop obj, bool count) { Klass* k = obj->blueprint(); - if (k->as_klassOop() == SystemDictionary::object_klass()) { + if (k->as_klassOop() == SystemDictionary::Object_klass()) { tty->print_cr("Found the class!"); } diff --git a/hotspot/src/share/vm/memory/collectorPolicy.cpp b/hotspot/src/share/vm/memory/collectorPolicy.cpp index 3f885d9ecba..ebb886fbad8 100644 --- a/hotspot/src/share/vm/memory/collectorPolicy.cpp +++ b/hotspot/src/share/vm/memory/collectorPolicy.cpp @@ -55,7 +55,7 @@ void CollectorPolicy::initialize_flags() { void CollectorPolicy::initialize_size_info() { // User inputs from -mx and ms are aligned - set_initial_heap_byte_size(Arguments::initial_heap_size()); + set_initial_heap_byte_size(InitialHeapSize); if (initial_heap_byte_size() == 0) { set_initial_heap_byte_size(NewSize + OldSize); } diff --git a/hotspot/src/share/vm/memory/defNewGeneration.cpp b/hotspot/src/share/vm/memory/defNewGeneration.cpp index 7db8b9dea97..875cf00817b 100644 --- a/hotspot/src/share/vm/memory/defNewGeneration.cpp +++ b/hotspot/src/share/vm/memory/defNewGeneration.cpp @@ -609,7 +609,7 @@ void DefNewGeneration::collect(bool full, remove_forwarding_pointers(); if (PrintGCDetails) { - gclog_or_tty->print(" (promotion failed)"); + gclog_or_tty->print(" (promotion failed) "); } // Add to-space to the list of space to compact // when a promotion failure has occurred. In that @@ -620,6 +620,9 @@ void DefNewGeneration::collect(bool full, from()->set_next_compaction_space(to()); gch->set_incremental_collection_will_fail(); + // Inform the next generation that a promotion failure occurred. + _next_gen->promotion_failure_occurred(); + // Reset the PromotionFailureALot counters. NOT_PRODUCT(Universe::heap()->reset_promotion_should_fail();) } @@ -679,6 +682,11 @@ void DefNewGeneration::preserve_mark_if_necessary(oop obj, markOop m) { void DefNewGeneration::handle_promotion_failure(oop old) { preserve_mark_if_necessary(old, old->mark()); + if (!_promotion_failed && PrintPromotionFailure) { + gclog_or_tty->print(" (promotion failure size = " SIZE_FORMAT ") ", + old->size()); + } + // forward to self old->forward_to(old); _promotion_failed = true; diff --git a/hotspot/src/share/vm/memory/dump.cpp b/hotspot/src/share/vm/memory/dump.cpp index 658e8347665..09ab997de10 100644 --- a/hotspot/src/share/vm/memory/dump.cpp +++ b/hotspot/src/share/vm/memory/dump.cpp @@ -63,7 +63,7 @@ public: void do_oop(oop* p) { if (p != NULL) { oop obj = *p; - if (obj->klass() == SystemDictionary::string_klass()) { + if (obj->klass() == SystemDictionary::String_klass()) { int hash; typeArrayOop value = java_lang_String::value(obj); @@ -625,11 +625,11 @@ public: if (obj->is_klass() || obj->is_instance()) { if (obj->is_klass() || - obj->is_a(SystemDictionary::class_klass()) || - obj->is_a(SystemDictionary::throwable_klass())) { + obj->is_a(SystemDictionary::Class_klass()) || + obj->is_a(SystemDictionary::Throwable_klass())) { // Do nothing } - else if (obj->is_a(SystemDictionary::string_klass())) { + else if (obj->is_a(SystemDictionary::String_klass())) { // immutable objects. } else { // someone added an object we hadn't accounted for. diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.cpp b/hotspot/src/share/vm/memory/genCollectedHeap.cpp index 5bff1597062..f85fe142156 100644 --- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp +++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp @@ -51,6 +51,8 @@ GenCollectedHeap::GenCollectedHeap(GenCollectorPolicy *policy) : } jint GenCollectedHeap::initialize() { + CollectedHeap::pre_initialize(); + int i; _n_gens = gen_policy()->number_of_generations(); @@ -129,6 +131,7 @@ jint GenCollectedHeap::initialize() { _rem_set = collector_policy()->create_rem_set(_reserved, n_covered_regions); set_barrier_set(rem_set()->bs()); + _gch = this; for (i = 0; i < _n_gens; i++) { @@ -925,6 +928,8 @@ bool GenCollectedHeap::is_in(const void* p) const { guarantee(VerifyBeforeGC || VerifyDuringGC || VerifyBeforeExit || + PrintAssembly || + tty->count() != 0 || // already printing VerifyAfterGC, "too expensive"); #endif // This might be sped up with a cache of the last generation that diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.hpp b/hotspot/src/share/vm/memory/genCollectedHeap.hpp index 9004e0d842c..8295d078bfa 100644 --- a/hotspot/src/share/vm/memory/genCollectedHeap.hpp +++ b/hotspot/src/share/vm/memory/genCollectedHeap.hpp @@ -260,6 +260,10 @@ public: return true; } + virtual bool card_mark_must_follow_store() const { + return UseConcMarkSweepGC; + } + // We don't need barriers for stores to objects in the // young gen and, a fortiori, for initializing stores to // objects therein. This applies to {DefNew,ParNew}+{Tenured,CMS} diff --git a/hotspot/src/share/vm/memory/generation.hpp b/hotspot/src/share/vm/memory/generation.hpp index 985e9db1028..e39be059506 100644 --- a/hotspot/src/share/vm/memory/generation.hpp +++ b/hotspot/src/share/vm/memory/generation.hpp @@ -181,6 +181,12 @@ class Generation: public CHeapObj { virtual bool promotion_attempt_is_safe(size_t promotion_in_bytes, bool younger_handles_promotion_failure) const; + // For a non-young generation, this interface can be used to inform a + // generation that a promotion attempt into that generation failed. + // Typically used to enable diagnostic output for post-mortem analysis, + // but other uses of the interface are not ruled out. + virtual void promotion_failure_occurred() { /* does nothing */ } + // Return an estimate of the maximum allocation that could be performed // in the generation without triggering any collection or expansion // activity. It is "unsafe" because no locks are taken; the result diff --git a/hotspot/src/share/vm/memory/heap.cpp b/hotspot/src/share/vm/memory/heap.cpp index 4f638fda468..2d355ca6800 100644 --- a/hotspot/src/share/vm/memory/heap.cpp +++ b/hotspot/src/share/vm/memory/heap.cpp @@ -464,7 +464,7 @@ void CodeHeap::verify() { } // Verify that freelist contains the right amount of free space - guarantee(len == _free_segments, "wrong freelist"); + // guarantee(len == _free_segments, "wrong freelist"); // Verify that the number of free blocks is not out of hand. static int free_block_threshold = 10000; @@ -479,5 +479,5 @@ void CodeHeap::verify() { for(HeapBlock *h = first_block(); h != NULL; h = next_block(h)) { if (h->free()) count--; } - guarantee(count == 0, "missing free blocks"); + // guarantee(count == 0, "missing free blocks"); } diff --git a/hotspot/src/share/vm/memory/iterator.hpp b/hotspot/src/share/vm/memory/iterator.hpp index 4d073a2e48d..ab4416e2227 100644 --- a/hotspot/src/share/vm/memory/iterator.hpp +++ b/hotspot/src/share/vm/memory/iterator.hpp @@ -296,23 +296,32 @@ public: // RememberKlassesChecker can be passed "false" to turn off checking. // It is used by CMS when CMS yields to a different collector. class RememberKlassesChecker: StackObj { - bool _state; - bool _skip; + bool _saved_state; + bool _do_check; public: - RememberKlassesChecker(bool checking_on) : _state(false), _skip(false) { - _skip = !(ClassUnloading && !UseConcMarkSweepGC || - CMSClassUnloadingEnabled && UseConcMarkSweepGC); - if (_skip) { - return; + RememberKlassesChecker(bool checking_on) : _saved_state(false), + _do_check(true) { + // The ClassUnloading unloading flag affects the collectors except + // for CMS. + // CMS unloads classes if CMSClassUnloadingEnabled is true or + // if ExplicitGCInvokesConcurrentAndUnloadsClasses is true and + // the current collection is an explicit collection. Turning + // on the checking in general for + // ExplicitGCInvokesConcurrentAndUnloadsClasses and + // UseConcMarkSweepGC should not lead to false positives. + _do_check = + ClassUnloading && !UseConcMarkSweepGC || + CMSClassUnloadingEnabled && UseConcMarkSweepGC || + ExplicitGCInvokesConcurrentAndUnloadsClasses && UseConcMarkSweepGC; + if (_do_check) { + _saved_state = OopClosure::must_remember_klasses(); + OopClosure::set_must_remember_klasses(checking_on); } - _state = OopClosure::must_remember_klasses(); - OopClosure::set_must_remember_klasses(checking_on); } ~RememberKlassesChecker() { - if (_skip) { - return; + if (_do_check) { + OopClosure::set_must_remember_klasses(_saved_state); } - OopClosure::set_must_remember_klasses(_state); } }; #endif // ASSERT diff --git a/hotspot/src/share/vm/memory/referenceProcessor.cpp b/hotspot/src/share/vm/memory/referenceProcessor.cpp index 134181c45db..dc9668b500e 100644 --- a/hotspot/src/share/vm/memory/referenceProcessor.cpp +++ b/hotspot/src/share/vm/memory/referenceProcessor.cpp @@ -71,7 +71,7 @@ void ReferenceProcessor::init_statics() { assert(_sentinelRef == NULL, "should be initialized precisely once"); EXCEPTION_MARK; _sentinelRef = instanceKlass::cast( - SystemDictionary::reference_klass())-> + SystemDictionary::Reference_klass())-> allocate_permanent_instance(THREAD); // Initialize the master soft ref clock. @@ -299,8 +299,8 @@ void ReferenceProcessor::process_phaseJNI(BoolObjectClosure* is_alive, template -static bool enqueue_discovered_ref_helper(ReferenceProcessor* ref, - AbstractRefProcTaskExecutor* task_executor) { +bool enqueue_discovered_ref_helper(ReferenceProcessor* ref, + AbstractRefProcTaskExecutor* task_executor) { // Remember old value of pending references list T* pending_list_addr = (T*)java_lang_ref_Reference::pending_list_addr(); @@ -1227,13 +1227,16 @@ void ReferenceProcessor::preclean_discovered_references( BoolObjectClosure* is_alive, OopClosure* keep_alive, VoidClosure* complete_gc, - YieldClosure* yield) { + YieldClosure* yield, + bool should_unload_classes) { NOT_PRODUCT(verify_ok_to_handle_reflists()); #ifdef ASSERT bool must_remember_klasses = ClassUnloading && !UseConcMarkSweepGC || - CMSClassUnloadingEnabled && UseConcMarkSweepGC; + CMSClassUnloadingEnabled && UseConcMarkSweepGC || + ExplicitGCInvokesConcurrentAndUnloadsClasses && + UseConcMarkSweepGC && should_unload_classes; RememberKlassesChecker mx(must_remember_klasses); #endif // Soft references diff --git a/hotspot/src/share/vm/memory/referenceProcessor.hpp b/hotspot/src/share/vm/memory/referenceProcessor.hpp index 6d82e524d8a..5d0023e0af5 100644 --- a/hotspot/src/share/vm/memory/referenceProcessor.hpp +++ b/hotspot/src/share/vm/memory/referenceProcessor.hpp @@ -170,11 +170,13 @@ class ReferenceProcessor : public CHeapObj { // The caller is responsible for taking care of potential // interference with concurrent operations on these lists // (or predicates involved) by other threads. Currently - // only used by the CMS collector. + // only used by the CMS collector. should_unload_classes is + // used to aid assertion checking when classes are collected. void preclean_discovered_references(BoolObjectClosure* is_alive, OopClosure* keep_alive, VoidClosure* complete_gc, - YieldClosure* yield); + YieldClosure* yield, + bool should_unload_classes); // Delete entries in the discovered lists that have // either a null referent or are not active. Such @@ -261,10 +263,13 @@ class ReferenceProcessor : public CHeapObj { int parallel_gc_threads = 1, bool mt_processing = false, bool discovered_list_needs_barrier = false); + // RefDiscoveryPolicy values - enum { + enum DiscoveryPolicy { ReferenceBasedDiscovery = 0, - ReferentBasedDiscovery = 1 + ReferentBasedDiscovery = 1, + DiscoveryPolicyMin = ReferenceBasedDiscovery, + DiscoveryPolicyMax = ReferentBasedDiscovery }; static void init_statics(); diff --git a/hotspot/src/share/vm/memory/sharedHeap.hpp b/hotspot/src/share/vm/memory/sharedHeap.hpp index 0bf863fb133..6094387241b 100644 --- a/hotspot/src/share/vm/memory/sharedHeap.hpp +++ b/hotspot/src/share/vm/memory/sharedHeap.hpp @@ -224,10 +224,6 @@ public: CodeBlobClosure* code_roots, OopClosure* non_root_closure); - - // Like CollectedHeap::collect, but assume that the caller holds the Heap_lock. - virtual void collect_locked(GCCause::Cause cause) = 0; - // The functions below are helper functions that a subclass of // "SharedHeap" can use in the implementation of its virtual // functions. diff --git a/hotspot/src/share/vm/memory/space.cpp b/hotspot/src/share/vm/memory/space.cpp index 53c3c2600e1..38e58ba6886 100644 --- a/hotspot/src/share/vm/memory/space.cpp +++ b/hotspot/src/share/vm/memory/space.cpp @@ -876,7 +876,7 @@ void ContiguousSpace::allocate_temporary_filler(int factor) { instanceOop obj = (instanceOop) allocate(size); obj->set_mark(markOopDesc::prototype()); obj->set_klass_gap(0); - obj->set_klass(SystemDictionary::object_klass()); + obj->set_klass(SystemDictionary::Object_klass()); } } diff --git a/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp b/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp index be7538604ff..5aa36245cde 100644 --- a/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp +++ b/hotspot/src/share/vm/memory/threadLocalAllocBuffer.cpp @@ -100,7 +100,7 @@ void ThreadLocalAllocBuffer::accumulate_statistics() { void ThreadLocalAllocBuffer::make_parsable(bool retire) { if (end() != NULL) { invariants(); - CollectedHeap::fill_with_object(top(), hard_end()); + CollectedHeap::fill_with_object(top(), hard_end(), retire); if (retire || ZeroTLAB) { // "Reset" the TLAB set_start(NULL); diff --git a/hotspot/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp b/hotspot/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp index 68b2d92a1e3..361ae3aecb1 100644 --- a/hotspot/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp +++ b/hotspot/src/share/vm/memory/threadLocalAllocBuffer.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,13 @@ inline HeapWord* ThreadLocalAllocBuffer::allocate(size_t size) { HeapWord* obj = top(); if (pointer_delta(end(), obj) >= size) { // successful thread-local allocation - - DEBUG_ONLY(Copy::fill_to_words(obj, size, badHeapWordVal)); +#ifdef ASSERT + // Skip mangling the space corresponding to the object header to + // ensure that the returned space is not considered parsable by + // any concurrent GC thread. + size_t hdr_size = CollectedHeap::min_fill_size(); + Copy::fill_to_words(obj + hdr_size, size - hdr_size, badHeapWordVal); +#endif // ASSERT // This addition is safe because we know that top is // at least size below end, so the add can't wrap. set_top(obj + size); diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp index 5043f9e2599..5803a4d356e 100644 --- a/hotspot/src/share/vm/memory/universe.cpp +++ b/hotspot/src/share/vm/memory/universe.cpp @@ -67,6 +67,8 @@ typeArrayOop Universe::_the_empty_int_array = NULL; objArrayOop Universe::_the_empty_system_obj_array = NULL; objArrayOop Universe::_the_empty_class_klass_array = NULL; objArrayOop Universe::_the_array_interfaces_array = NULL; +oop Universe::_the_null_string = NULL; +oop Universe::_the_min_jint_string = NULL; LatestMethodOopCache* Universe::_finalizer_register_cache = NULL; LatestMethodOopCache* Universe::_loader_addClass_cache = NULL; ActiveMethodOopsCache* Universe::_reflect_invoke_cache = NULL; @@ -187,6 +189,8 @@ void Universe::oops_do(OopClosure* f, bool do_all) { f->do_oop((oop*)&_the_empty_system_obj_array); f->do_oop((oop*)&_the_empty_class_klass_array); f->do_oop((oop*)&_the_array_interfaces_array); + f->do_oop((oop*)&_the_null_string); + f->do_oop((oop*)&_the_min_jint_string); _finalizer_register_cache->oops_do(f); _loader_addClass_cache->oops_do(f); _reflect_invoke_cache->oops_do(f); @@ -287,14 +291,17 @@ void Universe::genesis(TRAPS) { SystemDictionary::initialize(CHECK); - klassOop ok = SystemDictionary::object_klass(); + klassOop ok = SystemDictionary::Object_klass(); + + _the_null_string = StringTable::intern("null", CHECK); + _the_min_jint_string = StringTable::intern("-2147483648", CHECK); if (UseSharedSpaces) { // Verify shared interfaces array. assert(_the_array_interfaces_array->obj_at(0) == - SystemDictionary::cloneable_klass(), "u3"); + SystemDictionary::Cloneable_klass(), "u3"); assert(_the_array_interfaces_array->obj_at(1) == - SystemDictionary::serializable_klass(), "u3"); + SystemDictionary::Serializable_klass(), "u3"); // Verify element klass for system obj array klass assert(objArrayKlass::cast(_systemObjArrayKlassObj)->element_klass() == ok, "u1"); @@ -313,8 +320,8 @@ void Universe::genesis(TRAPS) { assert(Klass::cast(systemObjArrayKlassObj())->super() == ok, "u3"); } else { // Set up shared interfaces array. (Do this before supers are set up.) - _the_array_interfaces_array->obj_at_put(0, SystemDictionary::cloneable_klass()); - _the_array_interfaces_array->obj_at_put(1, SystemDictionary::serializable_klass()); + _the_array_interfaces_array->obj_at_put(0, SystemDictionary::Cloneable_klass()); + _the_array_interfaces_array->obj_at_put(1, SystemDictionary::Serializable_klass()); // Set element klass for system obj array klass objArrayKlass::cast(_systemObjArrayKlassObj)->set_element_klass(ok); @@ -358,7 +365,7 @@ void Universe::genesis(TRAPS) { // Initialize _objectArrayKlass after core bootstraping to make // sure the super class is set up properly for _objectArrayKlass. _objectArrayKlassObj = instanceKlass:: - cast(SystemDictionary::object_klass())->array_klass(1, CHECK); + cast(SystemDictionary::Object_klass())->array_klass(1, CHECK); // Add the class to the class hierarchy manually to make sure that // its vtable is initialized after core bootstrapping is completed. Klass::cast(_objectArrayKlassObj)->append_to_sibling_list(); @@ -419,11 +426,11 @@ void Universe::genesis(TRAPS) { while (i < size) { if (!UseConcMarkSweepGC) { // Allocate dummy in old generation - oop dummy = instanceKlass::cast(SystemDictionary::object_klass())->allocate_instance(CHECK); + oop dummy = instanceKlass::cast(SystemDictionary::Object_klass())->allocate_instance(CHECK); dummy_array->obj_at_put(i++, dummy); } // Allocate dummy in permanent generation - oop dummy = instanceKlass::cast(SystemDictionary::object_klass())->allocate_permanent_instance(CHECK); + oop dummy = instanceKlass::cast(SystemDictionary::Object_klass())->allocate_permanent_instance(CHECK); dummy_array->obj_at_put(i++, dummy); } { @@ -533,7 +540,7 @@ void Universe::fixup_mirrors(TRAPS) { // but we cannot do that for classes created before java.lang.Class is loaded. Here we simply // walk over permanent objects created so far (mostly classes) and fixup their mirrors. Note // that the number of objects allocated at this point is very small. - assert(SystemDictionary::class_klass_loaded(), "java.lang.Class should be loaded"); + assert(SystemDictionary::Class_klass_loaded(), "java.lang.Class should be loaded"); FixupMirrorClosure blk; Universe::heap()->permanent_object_iterate(&blk); } @@ -549,7 +556,7 @@ void Universe::run_finalizers_on_exit() { if (TraceReferenceGC) tty->print_cr("Callback to run finalizers on exit"); { PRESERVE_EXCEPTION_MARK; - KlassHandle finalizer_klass(THREAD, SystemDictionary::finalizer_klass()); + KlassHandle finalizer_klass(THREAD, SystemDictionary::Finalizer_klass()); JavaValue result(T_VOID); JavaCalls::call_static( &result, @@ -744,22 +751,22 @@ static const uint64_t NarrowOopHeapMax = (uint64_t(max_juint) + 1); static const uint64_t OopEncodingHeapMax = NarrowOopHeapMax << LogMinObjAlignmentInBytes; char* Universe::preferred_heap_base(size_t heap_size, NARROW_OOP_MODE mode) { + size_t base = 0; #ifdef _LP64 if (UseCompressedOops) { assert(mode == UnscaledNarrowOop || mode == ZeroBasedNarrowOop || mode == HeapBasedNarrowOop, "mode is invalid"); + const size_t total_size = heap_size + HeapBaseMinAddress; // Return specified base for the first request. if (!FLAG_IS_DEFAULT(HeapBaseMinAddress) && (mode == UnscaledNarrowOop)) { - return (char*)HeapBaseMinAddress; - } - const size_t total_size = heap_size + HeapBaseMinAddress; - if (total_size <= OopEncodingHeapMax && (mode != HeapBasedNarrowOop)) { + base = HeapBaseMinAddress; + } else if (total_size <= OopEncodingHeapMax && (mode != HeapBasedNarrowOop)) { if (total_size <= NarrowOopHeapMax && (mode == UnscaledNarrowOop) && (Universe::narrow_oop_shift() == 0)) { // Use 32-bits oops without encoding and // place heap's top on the 4Gb boundary - return (char*)(NarrowOopHeapMax - heap_size); + base = (NarrowOopHeapMax - heap_size); } else { // Can't reserve with NarrowOopShift == 0 Universe::set_narrow_oop_shift(LogMinObjAlignmentInBytes); @@ -768,16 +775,38 @@ char* Universe::preferred_heap_base(size_t heap_size, NARROW_OOP_MODE mode) { // Use zero based compressed oops with encoding and // place heap's top on the 32Gb boundary in case // total_size > 4Gb or failed to reserve below 4Gb. - return (char*)(OopEncodingHeapMax - heap_size); + base = (OopEncodingHeapMax - heap_size); } } } else { // Can't reserve below 32Gb. Universe::set_narrow_oop_shift(LogMinObjAlignmentInBytes); } + // Set narrow_oop_base and narrow_oop_use_implicit_null_checks + // used in ReservedHeapSpace() constructors. + // The final values will be set in initialize_heap() below. + if (base != 0 && (base + heap_size) <= OopEncodingHeapMax) { + // Use zero based compressed oops + Universe::set_narrow_oop_base(NULL); + // Don't need guard page for implicit checks in indexed + // addressing mode with zero based Compressed Oops. + Universe::set_narrow_oop_use_implicit_null_checks(true); + } else { + // Set to a non-NULL value so the ReservedSpace ctor computes + // the correct no-access prefix. + // The final value will be set in initialize_heap() below. + Universe::set_narrow_oop_base((address)NarrowOopHeapMax); +#ifdef _WIN64 + if (UseLargePages) { + // Cannot allocate guard pages for implicit checks in indexed + // addressing mode when large pages are specified on windows. + Universe::set_narrow_oop_use_implicit_null_checks(false); + } +#endif // _WIN64 + } } #endif - return NULL; // also return NULL (don't care) for 32-bit VM + return (char*)base; // also return NULL (don't care) for 32-bit VM } jint Universe::initialize_heap() { @@ -921,7 +950,7 @@ bool universe_post_init() { { ResourceMark rm; Interpreter::initialize(); // needed for interpreter entry points if (!UseSharedSpaces) { - KlassHandle ok_h(THREAD, SystemDictionary::object_klass()); + KlassHandle ok_h(THREAD, SystemDictionary::Object_klass()); Universe::reinitialize_vtable_of(ok_h, CHECK_false); Universe::reinitialize_itables(CHECK_false); } @@ -931,7 +960,7 @@ bool universe_post_init() { instanceKlassHandle k_h; if (!UseSharedSpaces) { // Setup preallocated empty java.lang.Class array - Universe::_the_empty_class_klass_array = oopFactory::new_objArray(SystemDictionary::class_klass(), 0, CHECK_false); + Universe::_the_empty_class_klass_array = oopFactory::new_objArray(SystemDictionary::Class_klass(), 0, CHECK_false); // Setup preallocated OutOfMemoryError errors k = SystemDictionary::resolve_or_fail(vmSymbolHandles::java_lang_OutOfMemoryError(), true, CHECK_false); k_h = instanceKlassHandle(THREAD, k); @@ -998,8 +1027,8 @@ bool universe_post_init() { // Setup static method for registering finalizers // The finalizer klass must be linked before looking up the method, in // case it needs to get rewritten. - instanceKlass::cast(SystemDictionary::finalizer_klass())->link_class(CHECK_false); - methodOop m = instanceKlass::cast(SystemDictionary::finalizer_klass())->find_method( + instanceKlass::cast(SystemDictionary::Finalizer_klass())->link_class(CHECK_false); + methodOop m = instanceKlass::cast(SystemDictionary::Finalizer_klass())->find_method( vmSymbols::register_method_name(), vmSymbols::register_method_signature()); if (m == NULL || !m->is_static()) { @@ -1007,7 +1036,7 @@ bool universe_post_init() { "java.lang.ref.Finalizer.register", false); } Universe::_finalizer_register_cache->init( - SystemDictionary::finalizer_klass(), m, CHECK_false); + SystemDictionary::Finalizer_klass(), m, CHECK_false); // Resolve on first use and initialize class. // Note: No race-condition here, since a resolve will always return the same result @@ -1024,14 +1053,14 @@ bool universe_post_init() { Universe::_reflect_invoke_cache->init(k_h(), m, CHECK_false); // Setup method for registering loaded classes in class loader vector - instanceKlass::cast(SystemDictionary::classloader_klass())->link_class(CHECK_false); - m = instanceKlass::cast(SystemDictionary::classloader_klass())->find_method(vmSymbols::addClass_name(), vmSymbols::class_void_signature()); + instanceKlass::cast(SystemDictionary::ClassLoader_klass())->link_class(CHECK_false); + m = instanceKlass::cast(SystemDictionary::ClassLoader_klass())->find_method(vmSymbols::addClass_name(), vmSymbols::class_void_signature()); if (m == NULL || m->is_static()) { THROW_MSG_(vmSymbols::java_lang_NoSuchMethodException(), "java.lang.ClassLoader.addClass", false); } Universe::_loader_addClass_cache->init( - SystemDictionary::classloader_klass(), m, CHECK_false); + SystemDictionary::ClassLoader_klass(), m, CHECK_false); // The folowing is initializing converter functions for serialization in // JVM.cpp. If we clean up the StrictMath code above we may want to find diff --git a/hotspot/src/share/vm/memory/universe.hpp b/hotspot/src/share/vm/memory/universe.hpp index b22a1eba6c9..97044e161d4 100644 --- a/hotspot/src/share/vm/memory/universe.hpp +++ b/hotspot/src/share/vm/memory/universe.hpp @@ -169,6 +169,8 @@ class Universe: AllStatic { static objArrayOop _the_empty_system_obj_array; // Canonicalized system obj array static objArrayOop _the_empty_class_klass_array; // Canonicalized obj array of type java.lang.Class static objArrayOop _the_array_interfaces_array; // Canonicalized 2-array of cloneable & serializable klasses + static oop _the_null_string; // A cache of "null" as a Java string + static oop _the_min_jint_string; // A cache of "-2147483648" as a Java string static LatestMethodOopCache* _finalizer_register_cache; // static method for registering finalizable objects static LatestMethodOopCache* _loader_addClass_cache; // method for registering loaded classes in class loader vector static ActiveMethodOopsCache* _reflect_invoke_cache; // method for security checks @@ -310,6 +312,8 @@ class Universe: AllStatic { static objArrayOop the_empty_system_obj_array () { return _the_empty_system_obj_array; } static objArrayOop the_empty_class_klass_array () { return _the_empty_class_klass_array; } static objArrayOop the_array_interfaces_array() { return _the_array_interfaces_array; } + static oop the_null_string() { return _the_null_string; } + static oop the_min_jint_string() { return _the_min_jint_string; } static methodOop finalizer_register_method() { return _finalizer_register_cache->get_methodOop(); } static methodOop loader_addClass_method() { return _loader_addClass_cache->get_methodOop(); } static ActiveMethodOopsCache* reflect_invoke_cache() { return _reflect_invoke_cache; } diff --git a/hotspot/src/share/vm/oops/arrayKlass.cpp b/hotspot/src/share/vm/oops/arrayKlass.cpp index 7ff6d2f2f57..ac50c258663 100644 --- a/hotspot/src/share/vm/oops/arrayKlass.cpp +++ b/hotspot/src/share/vm/oops/arrayKlass.cpp @@ -43,7 +43,7 @@ klassOop arrayKlass::java_super() const { if (super() == NULL) return NULL; // bootstrap case // Array klasses have primary supertypes which are not reported to Java. // Example super chain: String[][] -> Object[][] -> Object[] -> Object - return SystemDictionary::object_klass(); + return SystemDictionary::Object_klass(); } @@ -82,7 +82,7 @@ const Klass_vtbl& cplusplus_vtbl, int header_size, KlassHandle klass, TRAPS) { k = arrayKlassHandle(THREAD, base_klass()); assert(!k()->is_parsable(), "not expecting parsability yet."); - k->set_super(Universe::is_bootstrapping() ? (klassOop)NULL : SystemDictionary::object_klass()); + k->set_super(Universe::is_bootstrapping() ? (klassOop)NULL : SystemDictionary::Object_klass()); k->set_layout_helper(Klass::_lh_neutral_value); k->set_dimension(1); k->set_higher_dimension(NULL); @@ -117,9 +117,9 @@ objArrayOop arrayKlass::compute_secondary_supers(int num_extra_slots, TRAPS) { bool arrayKlass::compute_is_subtype_of(klassOop k) { // An array is a subtype of Serializable, Clonable, and Object - return k == SystemDictionary::object_klass() - || k == SystemDictionary::cloneable_klass() - || k == SystemDictionary::serializable_klass(); + return k == SystemDictionary::Object_klass() + || k == SystemDictionary::Cloneable_klass() + || k == SystemDictionary::Serializable_klass(); } diff --git a/hotspot/src/share/vm/oops/arrayKlass.hpp b/hotspot/src/share/vm/oops/arrayKlass.hpp index b2bc0862c73..40280501b8d 100644 --- a/hotspot/src/share/vm/oops/arrayKlass.hpp +++ b/hotspot/src/share/vm/oops/arrayKlass.hpp @@ -67,7 +67,7 @@ class arrayKlass: public Klass { // Compiler/Interpreter offset static ByteSize component_mirror_offset() { return byte_offset_of(arrayKlass, _component_mirror); } - virtual klassOop java_super() const;//{ return SystemDictionary::object_klass(); } + virtual klassOop java_super() const;//{ return SystemDictionary::Object_klass(); } // Allocation // Sizes points to the first dimension of the array, subsequent dimensions diff --git a/hotspot/src/share/vm/oops/arrayKlassKlass.cpp b/hotspot/src/share/vm/oops/arrayKlassKlass.cpp index 1757aae8a1f..918a7dd9bee 100644 --- a/hotspot/src/share/vm/oops/arrayKlassKlass.cpp +++ b/hotspot/src/share/vm/oops/arrayKlassKlass.cpp @@ -159,7 +159,7 @@ void arrayKlassKlass::oop_print_on(oop obj, outputStream* st) { assert(obj->is_klass(), "must be klass"); klassKlass::oop_print_on(obj, st); } - +#endif //PRODUCT void arrayKlassKlass::oop_print_value_on(oop obj, outputStream* st) { assert(obj->is_klass(), "must be klass"); @@ -168,7 +168,6 @@ void arrayKlassKlass::oop_print_value_on(oop obj, outputStream* st) { st->print("[]"); } } -#endif const char* arrayKlassKlass::internal_name() const { diff --git a/hotspot/src/share/vm/oops/arrayKlassKlass.hpp b/hotspot/src/share/vm/oops/arrayKlassKlass.hpp index 1d98d21745a..75a2becd1c9 100644 --- a/hotspot/src/share/vm/oops/arrayKlassKlass.hpp +++ b/hotspot/src/share/vm/oops/arrayKlassKlass.hpp @@ -55,14 +55,13 @@ class arrayKlassKlass : public klassKlass { int oop_oop_iterate(oop obj, OopClosure* blk); int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr); -#ifndef PRODUCT public: // Printing - void oop_print_on(oop obj, outputStream* st); void oop_print_value_on(oop obj, outputStream* st); -#endif +#ifndef PRODUCT + void oop_print_on(oop obj, outputStream* st); +#endif //PRODUCT - public: // Verification const char* internal_name() const; void oop_verify_on(oop obj, outputStream* st); diff --git a/hotspot/src/share/vm/oops/compiledICHolderKlass.cpp b/hotspot/src/share/vm/oops/compiledICHolderKlass.cpp index 434205d3ed3..cbca7fbe202 100644 --- a/hotspot/src/share/vm/oops/compiledICHolderKlass.cpp +++ b/hotspot/src/share/vm/oops/compiledICHolderKlass.cpp @@ -166,12 +166,12 @@ void compiledICHolderKlass::oop_print_on(oop obj, outputStream* st) { st->print(" - klass: "); c->holder_klass()->print_value_on(st); st->cr(); } +#endif //PRODUCT void compiledICHolderKlass::oop_print_value_on(oop obj, outputStream* st) { assert(obj->is_compiledICHolder(), "must be compiledICHolder"); Klass::oop_print_value_on(obj, st); } -#endif const char* compiledICHolderKlass::internal_name() const { return "{compiledICHolder}"; diff --git a/hotspot/src/share/vm/oops/compiledICHolderKlass.hpp b/hotspot/src/share/vm/oops/compiledICHolderKlass.hpp index 3d704773945..93f187faee6 100644 --- a/hotspot/src/share/vm/oops/compiledICHolderKlass.hpp +++ b/hotspot/src/share/vm/oops/compiledICHolderKlass.hpp @@ -68,14 +68,13 @@ class compiledICHolderKlass : public Klass { int oop_oop_iterate(oop obj, OopClosure* blk); int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr); -#ifndef PRODUCT public: // Printing - void oop_print_on (oop obj, outputStream* st); void oop_print_value_on(oop obj, outputStream* st); -#endif +#ifndef PRODUCT + void oop_print_on (oop obj, outputStream* st); +#endif //PRODUCT - public: // Verification const char* internal_name() const; void oop_verify_on(oop obj, outputStream* st); diff --git a/hotspot/src/share/vm/oops/constMethodKlass.cpp b/hotspot/src/share/vm/oops/constMethodKlass.cpp index c1ad90c1d57..ca48fe3eb2b 100644 --- a/hotspot/src/share/vm/oops/constMethodKlass.cpp +++ b/hotspot/src/share/vm/oops/constMethodKlass.cpp @@ -216,6 +216,7 @@ void constMethodKlass::oop_print_on(oop obj, outputStream* st) { } } +#endif //PRODUCT // Short version of printing constMethodOop - just print the name of the // method it belongs to. @@ -226,8 +227,6 @@ void constMethodKlass::oop_print_value_on(oop obj, outputStream* st) { m->method()->print_value_on(st); } -#endif // PRODUCT - const char* constMethodKlass::internal_name() const { return "{constMethod}"; } diff --git a/hotspot/src/share/vm/oops/constMethodKlass.hpp b/hotspot/src/share/vm/oops/constMethodKlass.hpp index 2387d0210a6..69eebb74444 100644 --- a/hotspot/src/share/vm/oops/constMethodKlass.hpp +++ b/hotspot/src/share/vm/oops/constMethodKlass.hpp @@ -77,15 +77,13 @@ public: int oop_oop_iterate(oop obj, OopClosure* blk); int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr); -#ifndef PRODUCT public: // Printing - void oop_print_on (oop obj, outputStream* st); void oop_print_value_on(oop obj, outputStream* st); +#ifndef PRODUCT + void oop_print_on (oop obj, outputStream* st); +#endif //PRODUCT -#endif - - public: // Verify operations const char* internal_name() const; void oop_verify_on(oop obj, outputStream* st); diff --git a/hotspot/src/share/vm/oops/constMethodOop.hpp b/hotspot/src/share/vm/oops/constMethodOop.hpp index c6d373946e1..91d01167246 100644 --- a/hotspot/src/share/vm/oops/constMethodOop.hpp +++ b/hotspot/src/share/vm/oops/constMethodOop.hpp @@ -258,6 +258,11 @@ public: LocalVariableTableElement* localvariable_table_start() const; // byte codes + void set_code(address code) { + if (code_size() > 0) { + memcpy(code_base(), code, code_size()); + } + } address code_base() const { return (address) (this+1); } address code_end() const { return code_base() + code_size(); } bool contains(address bcp) const { return code_base() <= bcp diff --git a/hotspot/src/share/vm/oops/constantPoolKlass.cpp b/hotspot/src/share/vm/oops/constantPoolKlass.cpp index 44b16435f31..f46963fd305 100644 --- a/hotspot/src/share/vm/oops/constantPoolKlass.cpp +++ b/hotspot/src/share/vm/oops/constantPoolKlass.cpp @@ -387,9 +387,19 @@ void constantPoolKlass::oop_print_on(oop obj, outputStream* st) { cp->set_cache(cache()); } - #endif +void constantPoolKlass::oop_print_value_on(oop obj, outputStream* st) { + assert(obj->is_constantPool(), "must be constantPool"); + constantPoolOop cp = constantPoolOop(obj); + st->print("constant pool [%d]", cp->length()); + if (cp->has_pseudo_string()) st->print("/pseudo_string"); + if (cp->has_invokedynamic()) st->print("/invokedynamic"); + cp->print_address_on(st); + st->print(" for "); + cp->pool_holder()->print_value_on(st); +} + const char* constantPoolKlass::internal_name() const { return "{constant pool}"; } diff --git a/hotspot/src/share/vm/oops/constantPoolKlass.hpp b/hotspot/src/share/vm/oops/constantPoolKlass.hpp index a01edbab42c..47a80d2b20e 100644 --- a/hotspot/src/share/vm/oops/constantPoolKlass.hpp +++ b/hotspot/src/share/vm/oops/constantPoolKlass.hpp @@ -65,9 +65,10 @@ class constantPoolKlass : public Klass { juint alloc_size() const { return _alloc_size; } void set_alloc_size(juint n) { _alloc_size = n; } -#ifndef PRODUCT public: // Printing + void oop_print_value_on(oop obj, outputStream* st); +#ifndef PRODUCT void oop_print_on(oop obj, outputStream* st); #endif diff --git a/hotspot/src/share/vm/oops/constantPoolOop.cpp b/hotspot/src/share/vm/oops/constantPoolOop.cpp index af72333b0b0..a324b7ae6aa 100644 --- a/hotspot/src/share/vm/oops/constantPoolOop.cpp +++ b/hotspot/src/share/vm/oops/constantPoolOop.cpp @@ -110,7 +110,7 @@ klassOop constantPoolOopDesc::klass_at_impl(constantPoolHandle this_oop, int whi } if (!PENDING_EXCEPTION-> - is_a(SystemDictionary::linkageError_klass())) { + is_a(SystemDictionary::LinkageError_klass())) { // Just throw the exception and don't prevent these classes from // being loaded due to virtual machine errors like StackOverflow // and OutOfMemoryError, etc, or if the thread was hit by stop() @@ -262,25 +262,48 @@ symbolOop constantPoolOopDesc::impl_signature_ref_at(int which, bool uncached) { int constantPoolOopDesc::impl_name_and_type_ref_index_at(int which, bool uncached) { - jint ref_index = field_or_method_at(which, uncached); + int i = which; + if (!uncached && cache() != NULL) { + if (constantPoolCacheOopDesc::is_secondary_index(which)) + // Invokedynamic indexes are always processed in native order + // so there is no question of reading a native u2 in Java order here. + return cache()->main_entry_at(which)->constant_pool_index(); + // change byte-ordering and go via cache + i = remap_instruction_operand_from_cache(which); + } else { + if (tag_at(which).is_name_and_type()) + // invokedynamic index is a simple name-and-type + return which; + } + assert(tag_at(i).is_field_or_method(), "Corrupted constant pool"); + jint ref_index = *int_at_addr(i); return extract_high_short_from_int(ref_index); } int constantPoolOopDesc::impl_klass_ref_index_at(int which, bool uncached) { - jint ref_index = field_or_method_at(which, uncached); + guarantee(!constantPoolCacheOopDesc::is_secondary_index(which), + "an invokedynamic instruction does not have a klass"); + int i = which; + if (!uncached && cache() != NULL) { + // change byte-ordering and go via cache + i = remap_instruction_operand_from_cache(which); + } + assert(tag_at(i).is_field_or_method(), "Corrupted constant pool"); + jint ref_index = *int_at_addr(i); return extract_low_short_from_int(ref_index); } -int constantPoolOopDesc::map_instruction_operand_to_index(int operand) { - if (constantPoolCacheOopDesc::is_secondary_index(operand)) { - return cache()->main_entry_at(operand)->constant_pool_index(); - } +int constantPoolOopDesc::remap_instruction_operand_from_cache(int operand) { + // Operand was fetched by a stream using get_Java_u2, yet was stored + // by Rewriter::rewrite_member_reference in native order. + // So now we have to fix the damage by swapping back to native order. assert((int)(u2)operand == operand, "clean u2"); - int index = Bytes::swap_u2(operand); - return cache()->entry_at(index)->constant_pool_index(); + int cpc_index = Bytes::swap_u2(operand); + int member_index = cache()->entry_at(cpc_index)->constant_pool_index(); + return member_index; } diff --git a/hotspot/src/share/vm/oops/constantPoolOop.hpp b/hotspot/src/share/vm/oops/constantPoolOop.hpp index 72bec650014..fb50c6a2949 100644 --- a/hotspot/src/share/vm/oops/constantPoolOop.hpp +++ b/hotspot/src/share/vm/oops/constantPoolOop.hpp @@ -191,6 +191,16 @@ class constantPoolOopDesc : public oopDesc { } } + void object_at_put(int which, oop str) { + oop_store((volatile oop*) obj_at_addr(which), str); + release_tag_at_put(which, JVM_CONSTANT_Object); + if (UseConcMarkSweepGC) { + // In case the earlier card-mark was consumed by a concurrent + // marking thread before the tag was updated, redirty the card. + oop_store_without_check((volatile oop*) obj_at_addr(which), str); + } + } + // For temporary use while constructing constant pool void string_index_at_put(int which, int string_index) { tag_at_put(which, JVM_CONSTANT_StringIndex); @@ -228,7 +238,8 @@ class constantPoolOopDesc : public oopDesc { tag.is_unresolved_klass() || tag.is_symbol() || tag.is_unresolved_string() || - tag.is_string(); + tag.is_string() || + tag.is_object(); } // Fetching constants @@ -291,6 +302,11 @@ class constantPoolOopDesc : public oopDesc { return string_at_impl(h_this, which, CHECK_NULL); } + oop object_at(int which) { + assert(tag_at(which).is_object(), "Corrupted constant pool"); + return *obj_at_addr(which); + } + // A "pseudo-string" is an non-string oop that has found is way into // a String entry. // Under AnonymousClasses this can happen if the user patches a live @@ -342,12 +358,14 @@ class constantPoolOopDesc : public oopDesc { } // The following methods (name/signature/klass_ref_at, klass_ref_at_noresolve, - // name_and_type_ref_index_at) all expect constant pool indices - // from the bytecodes to be passed in, which are actually potentially byte-swapped - // or rewritten constant pool cache indices. They all call map_instruction_operand_to_index. - int map_instruction_operand_to_index(int operand); + // name_and_type_ref_index_at) all expect to be passed indices obtained + // directly from the bytecode, and extracted according to java byte order. + // If the indices are meant to refer to fields or methods, they are + // actually potentially byte-swapped, rewritten constant pool cache indices. + // The routine remap_instruction_operand_from_cache manages the adjustment + // of these values back to constant pool indices. - // There are also "uncached" versions which do not map the operand index; see below. + // There are also "uncached" versions which do not adjust the operand index; see below. // Lookup for entries consisting of (klass_index, name_and_type index) klassOop klass_ref_at(int which, TRAPS); @@ -361,8 +379,6 @@ class constantPoolOopDesc : public oopDesc { // Lookup for entries consisting of (name_index, signature_index) int name_ref_index_at(int which_nt); // == low-order jshort of name_and_type_at(which_nt) int signature_ref_index_at(int which_nt); // == high-order jshort of name_and_type_at(which_nt) - symbolOop nt_name_ref_at(int which_nt) { return symbol_at(name_ref_index_at(which_nt)); } - symbolOop nt_signature_ref_at(int which_nt) { return symbol_at(signature_ref_index_at(which_nt)); } BasicType basic_type_for_signature_at(int which); @@ -425,18 +441,7 @@ class constantPoolOopDesc : public oopDesc { int impl_klass_ref_index_at(int which, bool uncached); int impl_name_and_type_ref_index_at(int which, bool uncached); - // Takes either a constant pool cache index in possibly byte-swapped - // byte order (which comes from the bytecodes after rewriting) or, - // if "uncached" is true, a vanilla constant pool index - jint field_or_method_at(int which, bool uncached) { - int i = which; - if (!uncached && cache() != NULL) { - // change byte-ordering and go via cache - i = map_instruction_operand_to_index(which); - } - assert(tag_at(i).is_field_or_method(), "Corrupted constant pool"); - return *int_at_addr(i); - } + int remap_instruction_operand_from_cache(int operand); // Used while constructing constant pool (only by ClassFileParser) jint klass_index_at(int which) { diff --git a/hotspot/src/share/vm/oops/cpCacheKlass.cpp b/hotspot/src/share/vm/oops/cpCacheKlass.cpp index 5a85e88d46e..b922dc8f2ea 100644 --- a/hotspot/src/share/vm/oops/cpCacheKlass.cpp +++ b/hotspot/src/share/vm/oops/cpCacheKlass.cpp @@ -261,6 +261,15 @@ void constantPoolCacheKlass::oop_print_on(oop obj, outputStream* st) { #endif +void constantPoolCacheKlass::oop_print_value_on(oop obj, outputStream* st) { + assert(obj->is_constantPoolCache(), "obj must be constant pool cache"); + constantPoolCacheOop cache = (constantPoolCacheOop)obj; + st->print("cache [%d]", cache->length()); + cache->print_address_on(st); + st->print(" for "); + cache->constant_pool()->print_value_on(st); +} + void constantPoolCacheKlass::oop_verify_on(oop obj, outputStream* st) { guarantee(obj->is_constantPoolCache(), "obj must be constant pool cache"); constantPoolCacheOop cache = (constantPoolCacheOop)obj; diff --git a/hotspot/src/share/vm/oops/cpCacheKlass.hpp b/hotspot/src/share/vm/oops/cpCacheKlass.hpp index 859f64a46f5..e49b52d75a1 100644 --- a/hotspot/src/share/vm/oops/cpCacheKlass.hpp +++ b/hotspot/src/share/vm/oops/cpCacheKlass.hpp @@ -61,9 +61,10 @@ class constantPoolCacheKlass: public Klass { juint alloc_size() const { return _alloc_size; } void set_alloc_size(juint n) { _alloc_size = n; } -#ifndef PRODUCT public: // Printing + void oop_print_value_on(oop obj, outputStream* st); +#ifndef PRODUCT void oop_print_on(oop obj, outputStream* st); #endif diff --git a/hotspot/src/share/vm/oops/cpCacheOop.cpp b/hotspot/src/share/vm/oops/cpCacheOop.cpp index 6f549afbe38..36380c88903 100644 --- a/hotspot/src/share/vm/oops/cpCacheOop.cpp +++ b/hotspot/src/share/vm/oops/cpCacheOop.cpp @@ -28,21 +28,17 @@ // Implememtation of ConstantPoolCacheEntry -void ConstantPoolCacheEntry::set_initial_state(int index) { - if (constantPoolCacheOopDesc::is_secondary_index(index)) { - // Hack: The rewriter is trying to say that this entry itself - // will be a secondary entry. - int main_index = constantPoolCacheOopDesc::decode_secondary_index(index); - assert(0 <= main_index && main_index < 0x10000, "sanity check"); - _indices = (main_index << 16); - assert(main_entry_index() == main_index, ""); - return; - } +void ConstantPoolCacheEntry::initialize_entry(int index) { assert(0 < index && index < 0x10000, "sanity check"); _indices = index; assert(constant_pool_index() == index, ""); } +void ConstantPoolCacheEntry::initialize_secondary_entry(int main_index) { + assert(0 <= main_index && main_index < 0x10000, "sanity check"); + _indices = (main_index << 16); + assert(main_entry_index() == main_index, ""); +} int ConstantPoolCacheEntry::as_flags(TosState state, bool is_final, bool is_vfinal, bool is_volatile, @@ -223,10 +219,10 @@ void ConstantPoolCacheEntry::set_interface_call(methodHandle method, int index) void ConstantPoolCacheEntry::set_dynamic_call(Handle call_site, int extra_data) { - methodOop method = (methodOop) sun_dyn_CallSiteImpl::vmmethod(call_site()); + methodOop method = (methodOop) java_dyn_CallSite::vmmethod(call_site()); assert(method->is_method(), "must be initialized properly"); int param_size = method->size_of_parameters(); - assert(param_size > 1, "method argument size must include MH.this & initial dynamic receiver"); + assert(param_size >= 1, "method argument size must include MH.this"); param_size -= 1; // do not count MH.this; it is not stacked for invokedynamic if (Atomic::cmpxchg_ptr(call_site(), &_f1, NULL) == NULL) { // racing threads might be trying to install their own favorites @@ -439,7 +435,18 @@ void ConstantPoolCacheEntry::verify(outputStream* st) const { void constantPoolCacheOopDesc::initialize(intArray& inverse_index_map) { assert(inverse_index_map.length() == length(), "inverse index map must have same length as cache"); - for (int i = 0; i < length(); i++) entry_at(i)->set_initial_state(inverse_index_map[i]); + for (int i = 0; i < length(); i++) { + ConstantPoolCacheEntry* e = entry_at(i); + int original_index = inverse_index_map[i]; + if ((original_index & Rewriter::_secondary_entry_tag) != 0) { + int main_index = (original_index - Rewriter::_secondary_entry_tag); + assert(!entry_at(main_index)->is_secondary_entry(), "valid main index"); + e->initialize_secondary_entry(main_index); + } else { + e->initialize_entry(original_index); + } + assert(entry_at(i) == e, "sanity"); + } } // RedefineClasses() API support: diff --git a/hotspot/src/share/vm/oops/cpCacheOop.hpp b/hotspot/src/share/vm/oops/cpCacheOop.hpp index ec25b87352b..6fb7a635e56 100644 --- a/hotspot/src/share/vm/oops/cpCacheOop.hpp +++ b/hotspot/src/share/vm/oops/cpCacheOop.hpp @@ -154,7 +154,8 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC { }; // Initialization - void set_initial_state(int index); // sets entry to initial state + void initialize_entry(int original_index); // initialize primary entry + void initialize_secondary_entry(int main_index); // initialize secondary entry void set_field( // sets entry to resolved field state Bytecodes::Code get_code, // the bytecode used for reading the field @@ -251,6 +252,7 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC { // Code generation support static WordSize size() { return in_WordSize(sizeof(ConstantPoolCacheEntry) / HeapWordSize); } + static ByteSize size_in_bytes() { return in_ByteSize(sizeof(ConstantPoolCacheEntry)); } static ByteSize indices_offset() { return byte_offset_of(ConstantPoolCacheEntry, _indices); } static ByteSize f1_offset() { return byte_offset_of(ConstantPoolCacheEntry, _f1); } static ByteSize f2_offset() { return byte_offset_of(ConstantPoolCacheEntry, _f2); } @@ -321,6 +323,7 @@ class constantPoolCacheOopDesc: public oopDesc { ConstantPoolCacheEntry* base() const { return (ConstantPoolCacheEntry*)((address)this + in_bytes(base_offset())); } friend class constantPoolCacheKlass; + friend class ConstantPoolCacheEntry; public: // Initialization @@ -329,7 +332,8 @@ class constantPoolCacheOopDesc: public oopDesc { // Secondary indexes. // They must look completely different from normal indexes. // The main reason is that byte swapping is sometimes done on normal indexes. - // Also, it is helpful for debugging to tell the two apart. + // Also, some of the CP accessors do different things for secondary indexes. + // Finally, it is helpful for debugging to tell the two apart. static bool is_secondary_index(int i) { return (i < 0); } static int decode_secondary_index(int i) { assert(is_secondary_index(i), ""); return ~i; } static int encode_secondary_index(int i) { assert(!is_secondary_index(i), ""); return ~i; } @@ -337,18 +341,35 @@ class constantPoolCacheOopDesc: public oopDesc { // Accessors void set_constant_pool(constantPoolOop pool) { oop_store_without_check((oop*)&_constant_pool, (oop)pool); } constantPoolOop constant_pool() const { return _constant_pool; } - ConstantPoolCacheEntry* entry_at(int i) const { assert(0 <= i && i < length(), "index out of bounds"); return base() + i; } + // Fetches the entry at the given index. + // The entry may be either primary or secondary. + // In either case the index must not be encoded or byte-swapped in any way. + ConstantPoolCacheEntry* entry_at(int i) const { + assert(0 <= i && i < length(), "index out of bounds"); + return base() + i; + } + // Fetches the secondary entry referred to by index. + // The index may be a secondary index, and must not be byte-swapped. + ConstantPoolCacheEntry* secondary_entry_at(int i) const { + int raw_index = i; + if (is_secondary_index(i)) { // correct these on the fly + raw_index = decode_secondary_index(i); + } + assert(entry_at(raw_index)->is_secondary_entry(), "not a secondary entry"); + return entry_at(raw_index); + } + // Given a primary or secondary index, fetch the corresponding primary entry. + // Indirect through the secondary entry, if the index is encoded as a secondary index. + // The index must not be byte-swapped. ConstantPoolCacheEntry* main_entry_at(int i) const { - ConstantPoolCacheEntry* e; + int primary_index = i; if (is_secondary_index(i)) { // run through an extra level of indirection: - i = decode_secondary_index(i); - e = entry_at(i); - i = e->main_entry_index(); + int raw_index = decode_secondary_index(i); + primary_index = entry_at(raw_index)->main_entry_index(); } - e = entry_at(i); - assert(!e->is_secondary_entry(), "only one level of indirection"); - return e; + assert(!entry_at(primary_index)->is_secondary_entry(), "only one level of indirection"); + return entry_at(primary_index); } // GC support @@ -359,6 +380,12 @@ class constantPoolCacheOopDesc: public oopDesc { // Code generation static ByteSize base_offset() { return in_ByteSize(sizeof(constantPoolCacheOopDesc)); } + static ByteSize entry_offset(int raw_index) { + int index = raw_index; + if (is_secondary_index(raw_index)) + index = decode_secondary_index(raw_index); + return (base_offset() + ConstantPoolCacheEntry::size_in_bytes() * index); + } // RedefineClasses() API support: // If any entry of this constantPoolCache points to any of diff --git a/hotspot/src/share/vm/oops/generateOopMap.cpp b/hotspot/src/share/vm/oops/generateOopMap.cpp index eb533a81e6f..845f1ec22b6 100644 --- a/hotspot/src/share/vm/oops/generateOopMap.cpp +++ b/hotspot/src/share/vm/oops/generateOopMap.cpp @@ -1559,7 +1559,7 @@ void GenerateOopMap::interp1(BytecodeStream *itr) { case Bytecodes::_invokevirtual: case Bytecodes::_invokespecial: do_method(false, false, itr->get_index_big(), itr->bci()); break; case Bytecodes::_invokestatic: do_method(true, false, itr->get_index_big(), itr->bci()); break; - case Bytecodes::_invokedynamic: do_method(false, true, itr->get_index_int(), itr->bci()); break; + case Bytecodes::_invokedynamic: do_method(true, false, itr->get_index_int(), itr->bci()); break; case Bytecodes::_invokeinterface: do_method(false, true, itr->get_index_big(), itr->bci()); break; case Bytecodes::_newarray: case Bytecodes::_anewarray: pp_new_ref(vCTS, itr->bci()); break; @@ -1830,12 +1830,8 @@ void GenerateOopMap::do_jsr(int targ_bci) { void GenerateOopMap::do_ldc(int idx, int bci) { - constantPoolOop cp = method()->constants(); - constantTag tag = cp->tag_at(idx); - - CellTypeState cts = (tag.is_string() || tag.is_unresolved_string() || - tag.is_klass() || tag.is_unresolved_klass()) - ? CellTypeState::make_line_ref(bci) : valCTS; + constantPoolOop cp = method()->constants(); + CellTypeState cts = cp->is_pointer_entry(idx) ? CellTypeState::make_line_ref(bci) : valCTS; ppush1(cts); } @@ -1900,11 +1896,9 @@ void GenerateOopMap::do_field(int is_get, int is_static, int idx, int bci) { } void GenerateOopMap::do_method(int is_static, int is_interface, int idx, int bci) { - // Dig up signature for field in constant pool - constantPoolOop cp = _method->constants(); - int nameAndTypeIdx = cp->name_and_type_ref_index_at(idx); - int signatureIdx = cp->signature_ref_index_at(nameAndTypeIdx); // @@@@@ - symbolOop signature = cp->symbol_at(signatureIdx); + // Dig up signature for field in constant pool + constantPoolOop cp = _method->constants(); + symbolOop signature = cp->signature_ref_at(idx); // Parse method signature CellTypeState out[4]; diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp index aaa2bfe876e..ae57e59143b 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp @@ -383,7 +383,7 @@ void instanceKlass::initialize_impl(instanceKlassHandle this_oop, TRAPS) { this_oop->set_initialization_state_and_notify(initialization_error, THREAD); CLEAR_PENDING_EXCEPTION; // ignore any exception thrown, class initialization error is thrown below } - if (e->is_a(SystemDictionary::error_klass())) { + if (e->is_a(SystemDictionary::Error_klass())) { THROW_OOP(e()); } else { JavaCallArguments args(e); @@ -568,7 +568,7 @@ void instanceKlass::check_valid_for_instantiation(bool throwError, TRAPS) { THROW_MSG(throwError ? vmSymbols::java_lang_InstantiationError() : vmSymbols::java_lang_InstantiationException(), external_name()); } - if (as_klassOop() == SystemDictionary::class_klass()) { + if (as_klassOop() == SystemDictionary::Class_klass()) { ResourceMark rm(THREAD); THROW_MSG(throwError ? vmSymbols::java_lang_IllegalAccessError() : vmSymbols::java_lang_IllegalAccessException(), external_name()); @@ -2045,8 +2045,9 @@ bool instanceKlass::is_same_package_member_impl(instanceKlassHandle class1, // As we walk along, look for equalities between outer1 and class2. // Eventually, the walks will terminate as outer1 stops // at the top-level class around the original class. - symbolOop ignore_name; - klassOop next = outer1->compute_enclosing_class(ignore_name, CHECK_false); + bool ignore_inner_is_member; + klassOop next = outer1->compute_enclosing_class(&ignore_inner_is_member, + CHECK_false); if (next == NULL) break; if (next == class2()) return true; outer1 = instanceKlassHandle(THREAD, next); @@ -2055,8 +2056,9 @@ bool instanceKlass::is_same_package_member_impl(instanceKlassHandle class1, // Now do the same for class2. instanceKlassHandle outer2 = class2; for (;;) { - symbolOop ignore_name; - klassOop next = outer2->compute_enclosing_class(ignore_name, CHECK_false); + bool ignore_inner_is_member; + klassOop next = outer2->compute_enclosing_class(&ignore_inner_is_member, + CHECK_false); if (next == NULL) break; // Might as well check the new outer against all available values. if (next == class1()) return true; @@ -2223,7 +2225,7 @@ void FieldPrinter::do_field(fieldDescriptor* fd) { void instanceKlass::oop_print_on(oop obj, outputStream* st) { Klass::oop_print_on(obj, st); - if (as_klassOop() == SystemDictionary::string_klass()) { + if (as_klassOop() == SystemDictionary::String_klass()) { typeArrayOop value = java_lang_String::value(obj); juint offset = java_lang_String::offset(obj); juint length = java_lang_String::length(obj); @@ -2243,7 +2245,7 @@ void instanceKlass::oop_print_on(oop obj, outputStream* st) { FieldPrinter print_nonstatic_field(st, obj); do_nonstatic_fields(&print_nonstatic_field); - if (as_klassOop() == SystemDictionary::class_klass()) { + if (as_klassOop() == SystemDictionary::Class_klass()) { st->print(BULLET"signature: "); java_lang_Class::print_signature(obj, st); st->cr(); @@ -2266,11 +2268,13 @@ void instanceKlass::oop_print_on(oop obj, outputStream* st) { } } +#endif //PRODUCT + void instanceKlass::oop_print_value_on(oop obj, outputStream* st) { st->print("a "); name()->print_value_on(st); obj->print_address_on(st); - if (as_klassOop() == SystemDictionary::string_klass() + if (as_klassOop() == SystemDictionary::String_klass() && java_lang_String::value(obj) != NULL) { ResourceMark rm; int len = java_lang_String::length(obj); @@ -2279,7 +2283,7 @@ void instanceKlass::oop_print_value_on(oop obj, outputStream* st) { st->print(" = \"%s\"", str); if (len > plen) st->print("...[%d]", len); - } else if (as_klassOop() == SystemDictionary::class_klass()) { + } else if (as_klassOop() == SystemDictionary::Class_klass()) { klassOop k = java_lang_Class::as_klassOop(obj); st->print(" = "); if (k != NULL) { @@ -2297,8 +2301,6 @@ void instanceKlass::oop_print_value_on(oop obj, outputStream* st) { } } -#endif // ndef PRODUCT - const char* instanceKlass::internal_name() const { return external_name(); } @@ -2346,7 +2348,7 @@ void instanceKlass::verify_class_klass_nonstatic_oop_maps(klassOop k) { // Check that we have the right class static bool first_time = true; - guarantee(k == SystemDictionary::class_klass() && first_time, "Invalid verify of maps"); + guarantee(k == SystemDictionary::Class_klass() && first_time, "Invalid verify of maps"); first_time = false; const int extra = java_lang_Class::number_of_fake_oop_fields; guarantee(ik->nonstatic_field_size() == extra, "just checking"); diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp index 9147892b1ea..798a3808931 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceKlass.hpp @@ -337,12 +337,12 @@ class instanceKlass: public Klass { static bool is_same_class_package(oop class_loader1, symbolOop class_name1, oop class_loader2, symbolOop class_name2); // find an enclosing class (defined where original code was, in jvm.cpp!) - klassOop compute_enclosing_class(symbolOop& simple_name_result, TRAPS) { + klassOop compute_enclosing_class(bool* inner_is_member, TRAPS) { instanceKlassHandle self(THREAD, this->as_klassOop()); - return compute_enclosing_class_impl(self, simple_name_result, THREAD); + return compute_enclosing_class_impl(self, inner_is_member, THREAD); } static klassOop compute_enclosing_class_impl(instanceKlassHandle self, - symbolOop& simple_name_result, TRAPS); + bool* inner_is_member, TRAPS); // tell if two classes have the same enclosing class (at package level) bool is_same_package_member(klassOop class2, TRAPS) { @@ -839,17 +839,16 @@ public: // JVMTI support jint jvmti_class_status() const; -#ifndef PRODUCT public: // Printing - void oop_print_on (oop obj, outputStream* st); void oop_print_value_on(oop obj, outputStream* st); +#ifndef PRODUCT + void oop_print_on (oop obj, outputStream* st); void print_dependent_nmethods(bool verbose = false); bool is_dependent_nmethod(nmethod* nm); #endif - public: // Verification const char* internal_name() const; void oop_verify_on(oop obj, outputStream* st); diff --git a/hotspot/src/share/vm/oops/instanceKlassKlass.cpp b/hotspot/src/share/vm/oops/instanceKlassKlass.cpp index 18a6d7addf8..05748104d3b 100644 --- a/hotspot/src/share/vm/oops/instanceKlassKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceKlassKlass.cpp @@ -317,6 +317,11 @@ void instanceKlassKlass::oop_copy_contents(PSPromotionManager* pm, oop obj) { pm->claim_or_forward_breadth(sg_addr); } + oop* bsm_addr = ik->adr_bootstrap_method(); + if (PSScavenge::should_scavenge(bsm_addr)) { + pm->claim_or_forward_breadth(bsm_addr); + } + klassKlass::oop_copy_contents(pm, obj); } @@ -345,6 +350,11 @@ void instanceKlassKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { pm->claim_or_forward_depth(sg_addr); } + oop* bsm_addr = ik->adr_bootstrap_method(); + if (PSScavenge::should_scavenge(bsm_addr)) { + pm->claim_or_forward_depth(bsm_addr); + } + klassKlass::oop_copy_contents(pm, obj); } @@ -628,6 +638,7 @@ void instanceKlassKlass::oop_print_on(oop obj, outputStream* st) { st->cr(); } +#endif //PRODUCT void instanceKlassKlass::oop_print_value_on(oop obj, outputStream* st) { assert(obj->is_klass(), "must be klass"); @@ -635,8 +646,6 @@ void instanceKlassKlass::oop_print_value_on(oop obj, outputStream* st) { ik->name()->print_value_on(st); } -#endif // PRODUCT - const char* instanceKlassKlass::internal_name() const { return "{instance class}"; } diff --git a/hotspot/src/share/vm/oops/instanceKlassKlass.hpp b/hotspot/src/share/vm/oops/instanceKlassKlass.hpp index d736ca5eb23..79a93b63910 100644 --- a/hotspot/src/share/vm/oops/instanceKlassKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceKlassKlass.hpp @@ -69,14 +69,13 @@ private: // Apply closure to the InstanceKlass oops that are outside the java heap. inline void iterate_c_heap_oops(instanceKlass* ik, OopClosure* closure); -#ifndef PRODUCT public: // Printing - void oop_print_on(oop obj, outputStream* st); void oop_print_value_on(oop obj, outputStream* st); +#ifndef PRODUCT + void oop_print_on(oop obj, outputStream* st); #endif - public: // Verification const char* internal_name() const; void oop_verify_on(oop obj, outputStream* st); diff --git a/hotspot/src/share/vm/oops/instanceRefKlass.cpp b/hotspot/src/share/vm/oops/instanceRefKlass.cpp index a8c7baf5214..a8f1ebeeca3 100644 --- a/hotspot/src/share/vm/oops/instanceRefKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceRefKlass.cpp @@ -78,9 +78,9 @@ void instanceRefKlass::oop_follow_contents(oop obj) { #ifndef SERIALGC template -static void specialized_oop_follow_contents(instanceRefKlass* ref, - ParCompactionManager* cm, - oop obj) { +void specialized_oop_follow_contents(instanceRefKlass* ref, + ParCompactionManager* cm, + oop obj) { T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj); T heap_oop = oopDesc::load_heap_oop(referent_addr); debug_only( @@ -397,7 +397,7 @@ void instanceRefKlass::update_nonstatic_oop_maps(klassOop k) { // Check that we have the right class debug_only(static bool first_time = true); - assert(k == SystemDictionary::reference_klass() && first_time, + assert(k == SystemDictionary::Reference_klass() && first_time, "Invalid update of maps"); debug_only(first_time = false); assert(ik->nonstatic_oop_map_count() == 1, "just checking"); diff --git a/hotspot/src/share/vm/oops/klass.cpp b/hotspot/src/share/vm/oops/klass.cpp index a842709649e..8260ee274b5 100644 --- a/hotspot/src/share/vm/oops/klass.cpp +++ b/hotspot/src/share/vm/oops/klass.cpp @@ -217,8 +217,8 @@ void Klass::initialize_supers(klassOop k, TRAPS) { set_super(NULL); oop_store_without_check((oop*) &_primary_supers[0], (oop) this->as_klassOop()); assert(super_depth() == 0, "Object must already be initialized properly"); - } else if (k != super() || k == SystemDictionary::object_klass()) { - assert(super() == NULL || super() == SystemDictionary::object_klass(), + } else if (k != super() || k == SystemDictionary::Object_klass()) { + assert(super() == NULL || super() == SystemDictionary::Object_klass(), "initialize this only once to a non-trivial value"); set_super(k); Klass* sup = k->klass_part(); @@ -370,7 +370,7 @@ void Klass::append_to_sibling_list() { void Klass::remove_from_sibling_list() { // remove receiver from sibling list instanceKlass* super = superklass(); - assert(super != NULL || as_klassOop() == SystemDictionary::object_klass(), "should have super"); + assert(super != NULL || as_klassOop() == SystemDictionary::Object_klass(), "should have super"); if (super == NULL) return; // special case: class Object if (super->subklass() == this) { // first subklass @@ -541,6 +541,7 @@ void Klass::oop_print_on(oop obj, outputStream* st) { st->cr(); } +#endif //PRODUCT void Klass::oop_print_value_on(oop obj, outputStream* st) { // print title @@ -549,8 +550,6 @@ void Klass::oop_print_value_on(oop obj, outputStream* st) { obj->print_address_on(st); } -#endif - // Verification void Klass::oop_verify_on(oop obj, outputStream* st) { diff --git a/hotspot/src/share/vm/oops/klass.hpp b/hotspot/src/share/vm/oops/klass.hpp index c4436d6554f..427d24c7755 100644 --- a/hotspot/src/share/vm/oops/klass.hpp +++ b/hotspot/src/share/vm/oops/klass.hpp @@ -776,14 +776,13 @@ class Klass : public Klass_vtbl { // JVMTI support virtual jint jvmti_class_status() const; -#ifndef PRODUCT public: // Printing - virtual void oop_print_on (oop obj, outputStream* st); virtual void oop_print_value_on(oop obj, outputStream* st); -#endif +#ifndef PRODUCT + virtual void oop_print_on (oop obj, outputStream* st); +#endif //PRODUCT - public: // Verification virtual const char* internal_name() const = 0; virtual void oop_verify_on(oop obj, outputStream* st); diff --git a/hotspot/src/share/vm/oops/klassKlass.cpp b/hotspot/src/share/vm/oops/klassKlass.cpp index b38d55cf4e8..78b5c797099 100644 --- a/hotspot/src/share/vm/oops/klassKlass.cpp +++ b/hotspot/src/share/vm/oops/klassKlass.cpp @@ -202,13 +202,12 @@ void klassKlass::oop_print_on(oop obj, outputStream* st) { Klass::oop_print_on(obj, st); } +#endif //PRODUCT void klassKlass::oop_print_value_on(oop obj, outputStream* st) { Klass::oop_print_value_on(obj, st); } -#endif - const char* klassKlass::internal_name() const { return "{other class}"; } diff --git a/hotspot/src/share/vm/oops/klassKlass.hpp b/hotspot/src/share/vm/oops/klassKlass.hpp index c8b5a9a6510..04b4ed958f3 100644 --- a/hotspot/src/share/vm/oops/klassKlass.hpp +++ b/hotspot/src/share/vm/oops/klassKlass.hpp @@ -67,14 +67,13 @@ class klassKlass: public Klass { juint alloc_size() const { return _alloc_size; } void set_alloc_size(juint n) { _alloc_size = n; } -#ifndef PRODUCT public: // Printing - void oop_print_on (oop obj, outputStream* st); void oop_print_value_on(oop obj, outputStream* st); -#endif +#ifndef PRODUCT + void oop_print_on (oop obj, outputStream* st); +#endif //PRODUCT - public: // Verification const char* internal_name() const; void oop_verify_on(oop obj, outputStream* st); diff --git a/hotspot/src/share/vm/oops/methodDataKlass.cpp b/hotspot/src/share/vm/oops/methodDataKlass.cpp index 56592b0ee24..04823a30831 100644 --- a/hotspot/src/share/vm/oops/methodDataKlass.cpp +++ b/hotspot/src/share/vm/oops/methodDataKlass.cpp @@ -214,6 +214,8 @@ void methodDataKlass::oop_print_on(oop obj, outputStream* st) { m->print_data_on(st); } +#endif //PRODUCT + void methodDataKlass::oop_print_value_on(oop obj, outputStream* st) { assert(obj->is_methodData(), "should be method data"); methodDataOop m = methodDataOop(obj); @@ -221,8 +223,6 @@ void methodDataKlass::oop_print_value_on(oop obj, outputStream* st) { m->method()->print_value_on(st); } -#endif // !PRODUCT - const char* methodDataKlass::internal_name() const { return "{method data}"; } diff --git a/hotspot/src/share/vm/oops/methodDataKlass.hpp b/hotspot/src/share/vm/oops/methodDataKlass.hpp index 0b78000d46f..14eaf35b229 100644 --- a/hotspot/src/share/vm/oops/methodDataKlass.hpp +++ b/hotspot/src/share/vm/oops/methodDataKlass.hpp @@ -71,14 +71,13 @@ class methodDataKlass : public Klass { int oop_oop_iterate(oop obj, OopClosure* blk); int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr); -#ifndef PRODUCT public: // Printing - void oop_print_on (oop obj, outputStream* st); void oop_print_value_on(oop obj, outputStream* st); -#endif // !PRODUCT +#ifndef PRODUCT + void oop_print_on (oop obj, outputStream* st); +#endif //PRODUCT - public: // Verify operations const char* internal_name() const; void oop_verify_on(oop obj, outputStream* st); diff --git a/hotspot/src/share/vm/oops/methodDataOop.hpp b/hotspot/src/share/vm/oops/methodDataOop.hpp index 80361d9f9ac..ca585f8b692 100644 --- a/hotspot/src/share/vm/oops/methodDataOop.hpp +++ b/hotspot/src/share/vm/oops/methodDataOop.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -545,6 +545,10 @@ public: return cell_offset(counter_cell_count); } + void set_count(uint count) { + set_uint_at(count_off, count); + } + #ifndef PRODUCT void print_data_on(outputStream* st); #endif @@ -692,6 +696,23 @@ public: void clear_row(uint row) { assert(row < row_limit(), "oob"); + // Clear total count - indicator of polymorphic call site. + // The site may look like as monomorphic after that but + // it allow to have more accurate profiling information because + // there was execution phase change since klasses were unloaded. + // If the site is still polymorphic then MDO will be updated + // to reflect it. But it could be the case that the site becomes + // only bimorphic. Then keeping total count not 0 will be wrong. + // Even if we use monomorphic (when it is not) for compilation + // we will only have trap, deoptimization and recompile again + // with updated MDO after executing method in Interpreter. + // An additional receiver will be recorded in the cleaned row + // during next call execution. + // + // Note: our profiling logic works with empty rows in any slot. + // We do sorting a profiling info (ciCallProfile) for compilation. + // + set_count(0); set_receiver(row, NULL); set_receiver_count(row, 0); } @@ -1391,6 +1412,9 @@ public: } void inc_decompile_count() { _nof_decompiles += 1; + if (decompile_count() > (uint)PerMethodRecompilationCutoff) { + method()->set_not_compilable(); + } } // Support for code generation diff --git a/hotspot/src/share/vm/oops/methodKlass.cpp b/hotspot/src/share/vm/oops/methodKlass.cpp index 2879529bb9f..1b788c63b13 100644 --- a/hotspot/src/share/vm/oops/methodKlass.cpp +++ b/hotspot/src/share/vm/oops/methodKlass.cpp @@ -308,6 +308,7 @@ void methodKlass::oop_print_on(oop obj, outputStream* st) { } } +#endif //PRODUCT void methodKlass::oop_print_value_on(oop obj, outputStream* st) { assert(obj->is_method(), "must be method"); @@ -323,8 +324,6 @@ void methodKlass::oop_print_value_on(oop obj, outputStream* st) { if (WizardMode && m->code() != NULL) st->print(" ((nmethod*)%p)", m->code()); } -#endif // PRODUCT - const char* methodKlass::internal_name() const { return "{method}"; } diff --git a/hotspot/src/share/vm/oops/methodKlass.hpp b/hotspot/src/share/vm/oops/methodKlass.hpp index 7c26114f744..abd1cbf4741 100644 --- a/hotspot/src/share/vm/oops/methodKlass.hpp +++ b/hotspot/src/share/vm/oops/methodKlass.hpp @@ -68,14 +68,13 @@ class methodKlass : public Klass { int oop_oop_iterate(oop obj, OopClosure* blk); int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr); -#ifndef PRODUCT public: // Printing - void oop_print_on (oop obj, outputStream* st); void oop_print_value_on(oop obj, outputStream* st); -#endif +#ifndef PRODUCT + void oop_print_on (oop obj, outputStream* st); +#endif //PRODUCT - public: // Verify operations const char* internal_name() const; void oop_verify_on(oop obj, outputStream* st); diff --git a/hotspot/src/share/vm/oops/methodOop.cpp b/hotspot/src/share/vm/oops/methodOop.cpp index cd575e5c488..07ef9a8b9a5 100644 --- a/hotspot/src/share/vm/oops/methodOop.cpp +++ b/hotspot/src/share/vm/oops/methodOop.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -456,12 +456,12 @@ objArrayHandle methodOopDesc::resolved_checked_exceptions_impl(methodOop this_oo return objArrayHandle(THREAD, Universe::the_empty_class_klass_array()); } else { methodHandle h_this(THREAD, this_oop); - objArrayOop m_oop = oopFactory::new_objArray(SystemDictionary::class_klass(), length, CHECK_(objArrayHandle())); + objArrayOop m_oop = oopFactory::new_objArray(SystemDictionary::Class_klass(), length, CHECK_(objArrayHandle())); objArrayHandle mirrors (THREAD, m_oop); for (int i = 0; i < length; i++) { CheckedExceptionElement* table = h_this->checked_exceptions_start(); // recompute on each iteration, not gc safe klassOop k = h_this->constants()->klass_at(table[i].class_cp_index, CHECK_(objArrayHandle())); - assert(Klass::cast(k)->is_subclass_of(SystemDictionary::throwable_klass()), "invalid exception class"); + assert(Klass::cast(k)->is_subclass_of(SystemDictionary::Throwable_klass()), "invalid exception class"); mirrors->obj_at_put(i, Klass::cast(k)->java_mirror()); } return mirrors; @@ -575,12 +575,6 @@ bool methodOopDesc::is_not_compilable(int comp_level) const { return true; } - methodDataOop mdo = method_data(); - if (mdo != NULL - && (uint)mdo->decompile_count() > (uint)PerMethodRecompilationCutoff) { - // Since (uint)-1 is large, -1 really means 'no cutoff'. - return true; - } #ifdef COMPILER2 if (is_tier1_compile(comp_level)) { if (is_not_tier1_compilable()) { @@ -593,7 +587,16 @@ bool methodOopDesc::is_not_compilable(int comp_level) const { } // call this when compiler finds that this method is not compilable -void methodOopDesc::set_not_compilable(int comp_level) { +void methodOopDesc::set_not_compilable(int comp_level, bool report) { + if (PrintCompilation && report) { + ttyLocker ttyl; + tty->print("made not compilable "); + this->print_short_name(tty); + int size = this->code_size(); + if (size > 0) + tty->print(" (%d bytes)", size); + tty->cr(); + } if ((TraceDeoptimization || LogCompilation) && (xtty != NULL)) { ttyLocker ttyl; xtty->begin_elem("make_not_compilable thread='%d'", (int) os::current_thread_id()); @@ -688,7 +691,7 @@ address methodOopDesc::make_adapters(methodHandle mh, TRAPS) { // so making them eagerly shouldn't be too expensive. AdapterHandlerEntry* adapter = AdapterHandlerLibrary::get_adapter(mh); if (adapter == NULL ) { - THROW_0(vmSymbols::java_lang_OutOfMemoryError()); + THROW_MSG_NULL(vmSymbols::java_lang_VirtualMachineError(), "out of space in CodeCache for adapters"); } mh->set_adapter_entry(adapter); @@ -705,6 +708,16 @@ address methodOopDesc::make_adapters(methodHandle mh, TRAPS) { // This function must not hit a safepoint! address methodOopDesc::verified_code_entry() { debug_only(No_Safepoint_Verifier nsv;) + nmethod *code = (nmethod *)OrderAccess::load_ptr_acquire(&_code); + if (code == NULL && UseCodeCacheFlushing) { + nmethod *saved_code = CodeCache::find_and_remove_saved_code(this); + if (saved_code != NULL) { + methodHandle method(this); + assert( ! saved_code->is_osr_method(), "should not get here for osr" ); + set_code( method, saved_code ); + } + } + assert(_from_compiled_entry != NULL, "must be set"); return _from_compiled_entry; } @@ -733,8 +746,8 @@ void methodOopDesc::set_code(methodHandle mh, nmethod *code) { int comp_level = code->comp_level(); // In theory there could be a race here. In practice it is unlikely // and not worth worrying about. - if (comp_level > highest_tier_compile()) { - set_highest_tier_compile(comp_level); + if (comp_level > mh->highest_tier_compile()) { + mh->set_highest_tier_compile(comp_level); } OrderAccess::storestore(); @@ -821,6 +834,18 @@ jint* methodOopDesc::method_type_offsets_chain() { return pchase; } +//------------------------------------------------------------------------------ +// methodOopDesc::is_method_handle_adapter +// +// Tests if this method is an internal adapter frame from the +// MethodHandleCompiler. +bool methodOopDesc::is_method_handle_adapter() const { + return ((name() == vmSymbols::invoke_name() && + method_holder() == SystemDictionary::MethodHandle_klass()) + || + method_holder() == SystemDictionary::InvokeDynamic_klass()); +} + methodHandle methodOopDesc::make_invoke_method(KlassHandle holder, symbolHandle signature, Handle method_type, TRAPS) { @@ -1032,8 +1057,8 @@ bool methodOopDesc::load_signature_classes(methodHandle m, TRAPS) { // We are loading classes eagerly. If a ClassNotFoundException or // a LinkageError was generated, be sure to ignore it. if (HAS_PENDING_EXCEPTION) { - if (PENDING_EXCEPTION->is_a(SystemDictionary::classNotFoundException_klass()) || - PENDING_EXCEPTION->is_a(SystemDictionary::linkageError_klass())) { + if (PENDING_EXCEPTION->is_a(SystemDictionary::ClassNotFoundException_klass()) || + PENDING_EXCEPTION->is_a(SystemDictionary::LinkageError_klass())) { CLEAR_PENDING_EXCEPTION; } else { return false; diff --git a/hotspot/src/share/vm/oops/methodOop.hpp b/hotspot/src/share/vm/oops/methodOop.hpp index fc3d3451ca4..61dc3f1bc39 100644 --- a/hotspot/src/share/vm/oops/methodOop.hpp +++ b/hotspot/src/share/vm/oops/methodOop.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -303,7 +303,7 @@ class methodOopDesc : public oopDesc { bool check_code() const; // Not inline to avoid circular ref nmethod* volatile code() const { assert( check_code(), "" ); return (nmethod *)OrderAccess::load_ptr_acquire(&_code); } void clear_code(); // Clear out any compiled code - void set_code(methodHandle mh, nmethod* code); + static void set_code(methodHandle mh, nmethod* code); void set_adapter_entry(AdapterHandlerEntry* adapter) { _adapter = adapter; } address get_i2c_entry(); address get_c2i_entry(); @@ -365,6 +365,7 @@ class methodOopDesc : public oopDesc { #endif // byte codes + void set_code(address code) { return constMethod()->set_code(code); } address code_base() const { return constMethod()->code_base(); } bool contains(address bcp) const { return constMethod()->contains(bcp); } @@ -524,6 +525,9 @@ class methodOopDesc : public oopDesc { // JSR 292 support bool is_method_handle_invoke() const { return access_flags().is_method_handle_invoke(); } + // Tests if this method is an internal adapter frame from the + // MethodHandleCompiler. + bool is_method_handle_adapter() const; static methodHandle make_invoke_method(KlassHandle holder, symbolHandle signature, Handle method_type, @@ -537,6 +541,7 @@ class methodOopDesc : public oopDesc { // all without checking for a stack overflow static int extra_stack_entries() { return (EnableMethodHandles ? (int)MethodHandlePushLimit : 0) + (EnableInvokeDynamic ? 3 : 0); } static int extra_stack_words(); // = extra_stack_entries() * Interpreter::stackElementSize() + // RedefineClasses() support: bool is_old() const { return access_flags().is_old(); } void set_is_old() { _access_flags.set_is_old(); } @@ -591,7 +596,10 @@ class methodOopDesc : public oopDesc { // whether it is not compilable for another reason like having a // breakpoint set in it. bool is_not_compilable(int comp_level = CompLevel_highest_tier) const; - void set_not_compilable(int comp_level = CompLevel_highest_tier); + void set_not_compilable(int comp_level = CompLevel_highest_tier, bool report = true); + void set_not_compilable_quietly(int comp_level = CompLevel_highest_tier) { + set_not_compilable(comp_level, false); + } bool is_not_osr_compilable() const { return is_not_compilable() || access_flags().is_not_osr_compilable(); } void set_not_osr_compilable() { _access_flags.set_not_osr_compilable(); } diff --git a/hotspot/src/share/vm/oops/objArrayKlass.cpp b/hotspot/src/share/vm/oops/objArrayKlass.cpp index 212126490cd..cb6884a9c01 100644 --- a/hotspot/src/share/vm/oops/objArrayKlass.cpp +++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp @@ -127,16 +127,14 @@ template void objArrayKlass::do_copy(arrayOop s, T* src, // pointer delta is scaled to number of elements (length field in // objArrayOop) which we assume is 32 bit. assert(pd == (size_t)(int)pd, "length field overflow"); - const size_t done_word_len = objArrayOopDesc::array_size((int)pd); - bs->write_ref_array(MemRegion((HeapWord*)dst, done_word_len)); + bs->write_ref_array((HeapWord*)dst, pd); THROW(vmSymbols::java_lang_ArrayStoreException()); return; } } } } - const size_t word_len = objArrayOopDesc::array_size(length); - bs->write_ref_array(MemRegion((HeapWord*)dst, word_len)); + bs->write_ref_array((HeapWord*)dst, length); } void objArrayKlass::copy_array(arrayOop s, int src_pos, arrayOop d, @@ -248,8 +246,8 @@ objArrayOop objArrayKlass::compute_secondary_supers(int num_extra_slots, TRAPS) } else { objArrayOop sec_oop = oopFactory::new_system_objArray(num_secondaries, CHECK_NULL); objArrayHandle secondaries(THREAD, sec_oop); - secondaries->obj_at_put(num_extra_slots+0, SystemDictionary::cloneable_klass()); - secondaries->obj_at_put(num_extra_slots+1, SystemDictionary::serializable_klass()); + secondaries->obj_at_put(num_extra_slots+0, SystemDictionary::Cloneable_klass()); + secondaries->obj_at_put(num_extra_slots+1, SystemDictionary::Serializable_klass()); for (int i = 0; i < num_elem_supers; i++) { klassOop elem_super = (klassOop) elem_supers->obj_at(i); klassOop array_super = elem_super->klass_part()->array_klass_or_null(); @@ -501,6 +499,8 @@ void objArrayKlass::oop_print_on(oop obj, outputStream* st) { } } +#endif //PRODUCT + static int max_objArray_print_length = 4; void objArrayKlass::oop_print_value_on(oop obj, outputStream* st) { @@ -510,7 +510,7 @@ void objArrayKlass::oop_print_value_on(oop obj, outputStream* st) { int len = objArrayOop(obj)->length(); st->print("[%d] ", len); obj->print_address_on(st); - if (PrintOopAddress || PrintMiscellaneous && (WizardMode || Verbose)) { + if (NOT_PRODUCT(PrintOopAddress ||) PrintMiscellaneous && (WizardMode || Verbose)) { st->print("{"); for (int i = 0; i < len; i++) { if (i > max_objArray_print_length) { @@ -522,8 +522,6 @@ void objArrayKlass::oop_print_value_on(oop obj, outputStream* st) { } } -#endif // PRODUCT - const char* objArrayKlass::internal_name() const { return external_name(); } diff --git a/hotspot/src/share/vm/oops/objArrayKlass.hpp b/hotspot/src/share/vm/oops/objArrayKlass.hpp index fcc62aad5b9..fba1069b3d0 100644 --- a/hotspot/src/share/vm/oops/objArrayKlass.hpp +++ b/hotspot/src/share/vm/oops/objArrayKlass.hpp @@ -119,14 +119,13 @@ class objArrayKlass : public arrayKlass { private: static klassOop array_klass_impl (objArrayKlassHandle this_oop, bool or_null, int n, TRAPS); -#ifndef PRODUCT public: // Printing - void oop_print_on (oop obj, outputStream* st); void oop_print_value_on(oop obj, outputStream* st); -#endif +#ifndef PRODUCT + void oop_print_on (oop obj, outputStream* st); +#endif //PRODUCT - public: // Verification const char* internal_name() const; void oop_verify_on(oop obj, outputStream* st); diff --git a/hotspot/src/share/vm/oops/objArrayKlassKlass.cpp b/hotspot/src/share/vm/oops/objArrayKlassKlass.cpp index 06c7f39f5eb..67626975c3c 100644 --- a/hotspot/src/share/vm/oops/objArrayKlassKlass.cpp +++ b/hotspot/src/share/vm/oops/objArrayKlassKlass.cpp @@ -99,7 +99,7 @@ klassOop objArrayKlassKlass::allocate_objArray_klass_impl(objArrayKlassKlassHand } } else { // The element type is already Object. Object[] has direct super of Object. - super_klass = KlassHandle(THREAD, SystemDictionary::object_klass()); + super_klass = KlassHandle(THREAD, SystemDictionary::Object_klass()); } } @@ -278,6 +278,7 @@ void objArrayKlassKlass::oop_print_on(oop obj, outputStream* st) { st->cr(); } +#endif //PRODUCT void objArrayKlassKlass::oop_print_value_on(oop obj, outputStream* st) { assert(obj->is_klass(), "must be klass"); @@ -287,8 +288,6 @@ void objArrayKlassKlass::oop_print_value_on(oop obj, outputStream* st) { st->print("[]"); } -#endif - const char* objArrayKlassKlass::internal_name() const { return "{object array class}"; } diff --git a/hotspot/src/share/vm/oops/objArrayKlassKlass.hpp b/hotspot/src/share/vm/oops/objArrayKlassKlass.hpp index ff3e94a6016..b428cf3f54c 100644 --- a/hotspot/src/share/vm/oops/objArrayKlassKlass.hpp +++ b/hotspot/src/share/vm/oops/objArrayKlassKlass.hpp @@ -64,14 +64,13 @@ class objArrayKlassKlass : public arrayKlassKlass { // helpers static klassOop allocate_objArray_klass_impl(objArrayKlassKlassHandle this_oop, int n, KlassHandle element_klass, TRAPS); -#ifndef PRODUCT public: // Printing - void oop_print_on(oop obj, outputStream* st); void oop_print_value_on(oop obj, outputStream* st); -#endif +#ifndef PRODUCT + void oop_print_on(oop obj, outputStream* st); +#endif //PRODUCT - public: // Verification const char* internal_name() const; void oop_verify_on(oop obj, outputStream* st); diff --git a/hotspot/src/share/vm/oops/objArrayOop.hpp b/hotspot/src/share/vm/oops/objArrayOop.hpp index 626f398a6be..1c1764a8751 100644 --- a/hotspot/src/share/vm/oops/objArrayOop.hpp +++ b/hotspot/src/share/vm/oops/objArrayOop.hpp @@ -37,6 +37,32 @@ class objArrayOopDesc : public arrayOopDesc { return &((T*)base())[index]; } +private: + // Give size of objArrayOop in HeapWords minus the header + static int array_size(int length) { + const int OopsPerHeapWord = HeapWordSize/heapOopSize; + assert(OopsPerHeapWord >= 1 && (HeapWordSize % heapOopSize == 0), + "Else the following (new) computation would be in error"); +#ifdef ASSERT + // The old code is left in for sanity-checking; it'll + // go away pretty soon. XXX + // Without UseCompressedOops, this is simply: + // oop->length() * HeapWordsPerOop; + // With narrowOops, HeapWordsPerOop is 1/2 or equal 0 as an integer. + // The oop elements are aligned up to wordSize + const int HeapWordsPerOop = heapOopSize/HeapWordSize; + int old_res; + if (HeapWordsPerOop > 0) { + old_res = length * HeapWordsPerOop; + } else { + old_res = align_size_up(length, OopsPerHeapWord)/OopsPerHeapWord; + } +#endif // ASSERT + int res = ((uint)length + OopsPerHeapWord - 1)/OopsPerHeapWord; + assert(res == old_res, "Inconsistency between old and new."); + return res; + } + public: // Returns the offset of the first element. static int base_offset_in_bytes() { @@ -67,27 +93,14 @@ class objArrayOopDesc : public arrayOopDesc { // Sizing static int header_size() { return arrayOopDesc::header_size(T_OBJECT); } int object_size() { return object_size(length()); } - int array_size() { return array_size(length()); } static int object_size(int length) { // This returns the object size in HeapWords. - return align_object_size(header_size() + array_size(length)); - } - - // Give size of objArrayOop in HeapWords minus the header - static int array_size(int length) { - // Without UseCompressedOops, this is simply: - // oop->length() * HeapWordsPerOop; - // With narrowOops, HeapWordsPerOop is 1/2 or equal 0 as an integer. - // The oop elements are aligned up to wordSize - const int HeapWordsPerOop = heapOopSize/HeapWordSize; - if (HeapWordsPerOop > 0) { - return length * HeapWordsPerOop; - } else { - const int OopsPerHeapWord = HeapWordSize/heapOopSize; - int word_len = align_size_up(length, OopsPerHeapWord)/OopsPerHeapWord; - return word_len; - } + uint asz = array_size(length); + uint osz = align_object_size(header_size() + asz); + assert(osz >= asz, "no overflow"); + assert((int)osz > 0, "no overflow"); + return (int)osz; } // special iterators for index ranges, returns size of object diff --git a/hotspot/src/share/vm/oops/oop.cpp b/hotspot/src/share/vm/oops/oop.cpp index da787bed038..96b04d051cd 100644 --- a/hotspot/src/share/vm/oops/oop.cpp +++ b/hotspot/src/share/vm/oops/oop.cpp @@ -31,14 +31,13 @@ BarrierSet* oopDesc::_bs = NULL; #ifdef PRODUCT void oopDesc::print_on(outputStream* st) const {} -void oopDesc::print_value_on(outputStream* st) const {} void oopDesc::print_address_on(outputStream* st) const {} -char* oopDesc::print_value_string() { return NULL; } char* oopDesc::print_string() { return NULL; } void oopDesc::print() {} -void oopDesc::print_value() {} void oopDesc::print_address() {} -#else + +#else //PRODUCT + void oopDesc::print_on(outputStream* st) const { if (this == NULL) { st->print_cr("NULL"); @@ -47,22 +46,6 @@ void oopDesc::print_on(outputStream* st) const { } } -void oopDesc::print_value_on(outputStream* st) const { - oop obj = oop(this); - if (this == NULL) { - st->print("NULL"); - } else if (java_lang_String::is_instance(obj)) { - java_lang_String::print(obj, st); - if (PrintOopAddress) print_address_on(st); -#ifdef ASSERT - } else if (!Universe::heap()->is_in(obj) || !Universe::heap()->is_in(klass())) { - st->print("### BAD OOP %p ###", (address)obj); -#endif - } else { - blueprint()->oop_print_value_on(obj, st); - } -} - void oopDesc::print_address_on(outputStream* st) const { if (PrintOopAddress) { st->print("{"INTPTR_FORMAT"}", this); @@ -71,24 +54,48 @@ void oopDesc::print_address_on(outputStream* st) const { void oopDesc::print() { print_on(tty); } -void oopDesc::print_value() { print_value_on(tty); } - void oopDesc::print_address() { print_address_on(tty); } char* oopDesc::print_string() { - stringStream* st = new stringStream(); - print_on(st); - return st->as_string(); -} - -char* oopDesc::print_value_string() { - stringStream* st = new stringStream(); - print_value_on(st); - return st->as_string(); + stringStream st; + print_on(&st); + return st.as_string(); } #endif // PRODUCT +// The print_value functions are present in all builds, to support the disassembler. + +void oopDesc::print_value() { + print_value_on(tty); +} + +char* oopDesc::print_value_string() { + char buf[100]; + stringStream st(buf, sizeof(buf)); + print_value_on(&st); + return st.as_string(); +} + +void oopDesc::print_value_on(outputStream* st) const { + oop obj = oop(this); + if (this == NULL) { + st->print("NULL"); + } else if (java_lang_String::is_instance(obj)) { + java_lang_String::print(obj, st); +#ifndef PRODUCT + if (PrintOopAddress) print_address_on(st); +#endif //PRODUCT +#ifdef ASSERT + } else if (!Universe::heap()->is_in(obj) || !Universe::heap()->is_in(klass())) { + st->print("### BAD OOP %p ###", (address)obj); +#endif //ASSERT + } else { + blueprint()->oop_print_value_on(obj, st); + } +} + + void oopDesc::verify_on(outputStream* st) { if (this != NULL) { blueprint()->oop_verify_on(this, st); diff --git a/hotspot/src/share/vm/oops/oop.hpp b/hotspot/src/share/vm/oops/oop.hpp index 9b7e9baf5c0..c67220a26e6 100644 --- a/hotspot/src/share/vm/oops/oop.hpp +++ b/hotspot/src/share/vm/oops/oop.hpp @@ -30,13 +30,12 @@ // no virtual functions allowed // store into oop with store check -template void oop_store(T* p, oop v); -template void oop_store(volatile T* p, oop v); +template inline void oop_store(T* p, oop v); +template inline void oop_store(volatile T* p, oop v); // store into oop without store check -template void oop_store_without_check(T* p, oop v); -template void oop_store_without_check(volatile T* p, oop v); - +template inline void oop_store_without_check(T* p, oop v); +template inline void oop_store_without_check(volatile T* p, oop v); extern bool always_do_update_barrier; diff --git a/hotspot/src/share/vm/oops/symbolKlass.cpp b/hotspot/src/share/vm/oops/symbolKlass.cpp index d0b6e2f33b5..4307beb8897 100644 --- a/hotspot/src/share/vm/oops/symbolKlass.cpp +++ b/hotspot/src/share/vm/oops/symbolKlass.cpp @@ -213,6 +213,8 @@ void symbolKlass::oop_print_on(oop obj, outputStream* st) { st->print("'"); } +#endif //PRODUCT + void symbolKlass::oop_print_value_on(oop obj, outputStream* st) { symbolOop sym = symbolOop(obj); st->print("'"); @@ -222,8 +224,6 @@ void symbolKlass::oop_print_value_on(oop obj, outputStream* st) { st->print("'"); } -#endif //PRODUCT - const char* symbolKlass::internal_name() const { return "{symbol}"; } diff --git a/hotspot/src/share/vm/oops/symbolKlass.hpp b/hotspot/src/share/vm/oops/symbolKlass.hpp index aca3e27175b..c03f2080fcc 100644 --- a/hotspot/src/share/vm/oops/symbolKlass.hpp +++ b/hotspot/src/share/vm/oops/symbolKlass.hpp @@ -65,10 +65,10 @@ class symbolKlass : public Klass { int oop_oop_iterate(oop obj, OopClosure* blk); int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr); -#ifndef PRODUCT // Printing void oop_print_value_on(oop obj, outputStream* st); +#ifndef PRODUCT void oop_print_on(oop obj, outputStream* st); -#endif +#endif //PRODUCT const char* internal_name() const; }; diff --git a/hotspot/src/share/vm/oops/symbolOop.cpp b/hotspot/src/share/vm/oops/symbolOop.cpp index 6308735223d..b99a303f490 100644 --- a/hotspot/src/share/vm/oops/symbolOop.cpp +++ b/hotspot/src/share/vm/oops/symbolOop.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,11 @@ # include "incls/_precompiled.incl" # include "incls/_symbolOop.cpp.incl" + +// ------------------------------------------------------------------ +// symbolOopDesc::equals +// +// Compares the symbol with a string of the given length. bool symbolOopDesc::equals(const char* str, int len) const { int l = utf8_length(); if (l != len) return false; @@ -36,6 +41,48 @@ bool symbolOopDesc::equals(const char* str, int len) const { return true; } + +// ------------------------------------------------------------------ +// symbolOopDesc::starts_with +// +// Tests if the symbol starts with the specified prefix of the given +// length. +bool symbolOopDesc::starts_with(const char* prefix, int len) const { + if (len > utf8_length()) return false; + while (len-- > 0) { + if (prefix[len] != (char) byte_at(len)) + return false; + } + assert(len == -1, "we should be at the beginning"); + return true; +} + + +// ------------------------------------------------------------------ +// symbolOopDesc::index_of +// +// Finds if the given string is a substring of this symbol's utf8 bytes. +// Return -1 on failure. Otherwise return the first index where str occurs. +int symbolOopDesc::index_of_at(int i, const char* str, int len) const { + assert(i >= 0 && i <= utf8_length(), "oob"); + if (len <= 0) return 0; + char first_char = str[0]; + address bytes = (address) ((symbolOopDesc*)this)->base(); + address limit = bytes + utf8_length() - len; // inclusive limit + address scan = bytes + i; + if (scan > limit) + return -1; + for (;;) { + scan = (address) memchr(scan, first_char, (limit + 1 - scan)); + if (scan == NULL) + return -1; // not found + assert(scan >= bytes+i && scan <= limit, "scan oob"); + if (memcmp(scan, str, len) == 0) + return (int)(scan - bytes); + } +} + + char* symbolOopDesc::as_C_string(char* buf, int size) const { if (size > 0) { int len = MIN2(size - 1, utf8_length()); diff --git a/hotspot/src/share/vm/oops/symbolOop.hpp b/hotspot/src/share/vm/oops/symbolOop.hpp index 49f95ec510d..15a4b0a8504 100644 --- a/hotspot/src/share/vm/oops/symbolOop.hpp +++ b/hotspot/src/share/vm/oops/symbolOop.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -70,8 +70,21 @@ class symbolOopDesc : public oopDesc { void set_utf8_length(int len) { _length = len; } - // Compares the symbol with a string + // Compares the symbol with a string. bool equals(const char* str, int len) const; + bool equals(const char* str) const { return equals(str, (int) strlen(str)); } + + // Tests if the symbol starts with the given prefix. + bool starts_with(const char* prefix, int len) const; + bool starts_with(const char* prefix) const { + return starts_with(prefix, (int) strlen(prefix)); + } + + // Tests if the symbol starts with the given prefix. + int index_of_at(int i, const char* str, int len) const; + int index_of_at(int i, const char* str) const { + return index_of_at(i, str, (int) strlen(str)); + } // Three-way compare for sorting; returns -1/0/1 if receiver is than arg // note that the ordering is not alfabetical diff --git a/hotspot/src/share/vm/oops/typeArrayKlassKlass.cpp b/hotspot/src/share/vm/oops/typeArrayKlassKlass.cpp index d987f0d14be..da19938fe83 100644 --- a/hotspot/src/share/vm/oops/typeArrayKlassKlass.cpp +++ b/hotspot/src/share/vm/oops/typeArrayKlassKlass.cpp @@ -45,6 +45,7 @@ void typeArrayKlassKlass::oop_print_on(oop obj, outputStream* st) { Klass:: oop_print_on(obj, st); } +#endif //PRODUCT void typeArrayKlassKlass::oop_print_value_on(oop obj, outputStream* st) { assert(obj->is_klass(), "must be klass"); @@ -63,8 +64,6 @@ void typeArrayKlassKlass::oop_print_value_on(oop obj, outputStream* st) { st->print("}"); } -#endif - const char* typeArrayKlassKlass::internal_name() const { return "{type array class}"; } diff --git a/hotspot/src/share/vm/oops/typeArrayKlassKlass.hpp b/hotspot/src/share/vm/oops/typeArrayKlassKlass.hpp index fabda84467a..01b0f9def74 100644 --- a/hotspot/src/share/vm/oops/typeArrayKlassKlass.hpp +++ b/hotspot/src/share/vm/oops/typeArrayKlassKlass.hpp @@ -47,12 +47,12 @@ class typeArrayKlassKlass : public arrayKlassKlass { static int header_size() { return oopDesc::header_size() + sizeof(typeArrayKlassKlass)/HeapWordSize; } int object_size() const { return align_object_size(header_size()); } -#ifndef PRODUCT public: // Printing - void oop_print_on(oop obj, outputStream* st); void oop_print_value_on(oop obj, outputStream* st); -#endif - public: +#ifndef PRODUCT + void oop_print_on(oop obj, outputStream* st); +#endif //PRODUCT + const char* internal_name() const; }; diff --git a/hotspot/src/share/vm/opto/bytecodeInfo.cpp b/hotspot/src/share/vm/opto/bytecodeInfo.cpp index eeb1658913a..b199d7c7047 100644 --- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp +++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp @@ -27,11 +27,16 @@ //============================================================================= //------------------------------InlineTree------------------------------------- -InlineTree::InlineTree( Compile* c, const InlineTree *caller_tree, ciMethod* callee, JVMState* caller_jvms, int caller_bci, float site_invoke_ratio ) +InlineTree::InlineTree( Compile* c, + const InlineTree *caller_tree, ciMethod* callee, + JVMState* caller_jvms, int caller_bci, + float site_invoke_ratio, int site_depth_adjust) : C(c), _caller_jvms(caller_jvms), _caller_tree((InlineTree*)caller_tree), _method(callee), _site_invoke_ratio(site_invoke_ratio), - _count_inline_bcs(method()->code_size()) { + _site_depth_adjust(site_depth_adjust), + _count_inline_bcs(method()->code_size()) +{ NOT_PRODUCT(_count_inlines = 0;) if (_caller_jvms != NULL) { // Keep a private copy of the caller_jvms: @@ -40,7 +45,7 @@ InlineTree::InlineTree( Compile* c, const InlineTree *caller_tree, ciMethod* cal assert(!caller_jvms->should_reexecute(), "there should be no reexecute bytecode with inlining"); } assert(_caller_jvms->same_calls_as(caller_jvms), "consistent JVMS"); - assert((caller_tree == NULL ? 0 : caller_tree->inline_depth() + 1) == inline_depth(), "correct (redundant) depth parameter"); + assert((caller_tree == NULL ? 0 : caller_tree->stack_depth() + 1) == stack_depth(), "correct (redundant) depth parameter"); assert(caller_bci == this->caller_bci(), "correct (redundant) bci parameter"); if (UseOldInlining) { // Update hierarchical counts, count_inline_bcs() and count_inlines() @@ -52,10 +57,13 @@ InlineTree::InlineTree( Compile* c, const InlineTree *caller_tree, ciMethod* cal } } -InlineTree::InlineTree(Compile* c, ciMethod* callee_method, JVMState* caller_jvms, float site_invoke_ratio) +InlineTree::InlineTree(Compile* c, ciMethod* callee_method, JVMState* caller_jvms, + float site_invoke_ratio, int site_depth_adjust) : C(c), _caller_jvms(caller_jvms), _caller_tree(NULL), _method(callee_method), _site_invoke_ratio(site_invoke_ratio), - _count_inline_bcs(method()->code_size()) { + _site_depth_adjust(site_depth_adjust), + _count_inline_bcs(method()->code_size()) +{ NOT_PRODUCT(_count_inlines = 0;) assert(!UseOldInlining, "do not use for old stuff"); } @@ -180,6 +188,10 @@ const char* InlineTree::shouldNotInline(ciMethod *callee_method, ciMethod* calle return NULL; } + // Always inline MethodHandle methods. + if (callee_method->is_method_handle_invoke()) + return NULL; + // First check all inlining restrictions which are required for correctness if (callee_method->is_abstract()) return "abstract method"; // note: we allow ik->is_abstract() @@ -265,10 +277,13 @@ const char* InlineTree::try_to_inline(ciMethod* callee_method, ciMethod* caller_ return msg; } - bool is_accessor = InlineAccessors && callee_method->is_accessor(); + if (InlineAccessors && callee_method->is_accessor()) { + // accessor methods are not subject to any of the following limits. + return NULL; + } // suppress a few checks for accessors and trivial methods - if (!is_accessor && callee_method->code_size() > MaxTrivialSize) { + if (callee_method->code_size() > MaxTrivialSize) { // don't inline into giant methods if (C->unique() > (uint)NodeCountInliningCutoff) { @@ -287,7 +302,7 @@ const char* InlineTree::try_to_inline(ciMethod* callee_method, ciMethod* caller_ } } - if (!C->do_inlining() && InlineAccessors && !is_accessor) { + if (!C->do_inlining() && InlineAccessors) { return "not an accessor"; } if( inline_depth() > MaxInlineLevel ) { @@ -322,14 +337,17 @@ bool pass_initial_checks(ciMethod* caller_method, int caller_bci, ciMethod* call // stricter than callee_holder->is_initialized() ciBytecodeStream iter(caller_method); iter.force_bci(caller_bci); - int index = iter.get_index_int(); - if( !caller_method->is_klass_loaded(index, true) ) { - return false; - } - // Try to do constant pool resolution if running Xcomp Bytecodes::Code call_bc = iter.cur_bc(); - if( !caller_method->check_call(index, call_bc == Bytecodes::_invokestatic) ) { - return false; + // An invokedynamic instruction does not have a klass. + if (call_bc != Bytecodes::_invokedynamic) { + int index = iter.get_index_int(); + if (!caller_method->is_klass_loaded(index, true)) { + return false; + } + // Try to do constant pool resolution if running Xcomp + if( !caller_method->check_call(index, call_bc == Bytecodes::_invokestatic) ) { + return false; + } } } // We will attempt to see if a class/field/etc got properly loaded. If it @@ -457,7 +475,30 @@ InlineTree *InlineTree::build_inline_tree_for_callee( ciMethod* callee_method, J if (old_ilt != NULL) { return old_ilt; } - InlineTree *ilt = new InlineTree( C, this, callee_method, caller_jvms, caller_bci, recur_frequency ); + int new_depth_adjust = 0; + if (caller_jvms->method() != NULL) { + if ((caller_jvms->method()->name() == ciSymbol::invoke_name() && + caller_jvms->method()->holder()->name() == ciSymbol::java_dyn_MethodHandle()) + || caller_jvms->method()->holder()->name() == ciSymbol::java_dyn_InvokeDynamic()) + /* @@@ FIXME: + if (caller_jvms->method()->is_method_handle_adapter()) + */ + new_depth_adjust -= 1; // don't count actions in MH or indy adapter frames + else if (callee_method->is_method_handle_invoke()) { + new_depth_adjust -= 1; // don't count method handle calls from java.dyn implem + } + if (new_depth_adjust != 0 && PrintInlining) { + stringStream nm1; caller_jvms->method()->print_name(&nm1); + stringStream nm2; callee_method->print_name(&nm2); + tty->print_cr("discounting inlining depth from %s to %s", nm1.base(), nm2.base()); + } + if (new_depth_adjust != 0 && C->log()) { + int id1 = C->log()->identify(caller_jvms->method()); + int id2 = C->log()->identify(callee_method); + C->log()->elem("inline_depth_discount caller='%d' callee='%d'", id1, id2); + } + } + InlineTree *ilt = new InlineTree(C, this, callee_method, caller_jvms, caller_bci, recur_frequency, _site_depth_adjust + new_depth_adjust); _subtrees.append( ilt ); NOT_PRODUCT( _count_inlines += 1; ) @@ -483,7 +524,7 @@ InlineTree *InlineTree::build_inline_tree_root() { Compile* C = Compile::current(); // Root of inline tree - InlineTree *ilt = new InlineTree(C, NULL, C->method(), NULL, -1, 1.0F); + InlineTree *ilt = new InlineTree(C, NULL, C->method(), NULL, -1, 1.0F, 0); return ilt; } diff --git a/hotspot/src/share/vm/opto/c2_globals.cpp b/hotspot/src/share/vm/opto/c2_globals.cpp index 5715b24ba57..40594bf940e 100644 --- a/hotspot/src/share/vm/opto/c2_globals.cpp +++ b/hotspot/src/share/vm/opto/c2_globals.cpp @@ -25,4 +25,4 @@ # include "incls/_precompiled.incl" # include "incls/_c2_globals.cpp.incl" -C2_FLAGS(MATERIALIZE_DEVELOPER_FLAG, MATERIALIZE_PD_DEVELOPER_FLAG, MATERIALIZE_PRODUCT_FLAG, MATERIALIZE_PD_PRODUCT_FLAG, MATERIALIZE_DIAGNOSTIC_FLAG, MATERIALIZE_NOTPRODUCT_FLAG) +C2_FLAGS(MATERIALIZE_DEVELOPER_FLAG, MATERIALIZE_PD_DEVELOPER_FLAG, MATERIALIZE_PRODUCT_FLAG, MATERIALIZE_PD_PRODUCT_FLAG, MATERIALIZE_DIAGNOSTIC_FLAG, MATERIALIZE_EXPERIMENTAL_FLAG, MATERIALIZE_NOTPRODUCT_FLAG) diff --git a/hotspot/src/share/vm/opto/c2_globals.hpp b/hotspot/src/share/vm/opto/c2_globals.hpp index 091ad4a9bb4..fd3256ade33 100644 --- a/hotspot/src/share/vm/opto/c2_globals.hpp +++ b/hotspot/src/share/vm/opto/c2_globals.hpp @@ -26,7 +26,7 @@ // Defines all globals flags used by the server compiler. // -#define C2_FLAGS(develop, develop_pd, product, product_pd, diagnostic, notproduct) \ +#define C2_FLAGS(develop, develop_pd, product, product_pd, diagnostic, experimental, notproduct) \ \ notproduct(intx, CompileZapFirst, 0, \ "If +ZapDeadCompiledLocals, " \ @@ -154,6 +154,12 @@ notproduct(bool, TraceProfileTripCount, false, \ "Trace profile loop trip count information") \ \ + product(bool, UseLoopPredicate, true, \ + "Generate a predicate to select fast/slow loop versions") \ + \ + develop(bool, TraceLoopPredicate, false, \ + "Trace generation of loop predicates") \ + \ develop(bool, OptoCoalesce, true, \ "Use Conservative Copy Coalescing in the Register Allocator") \ \ @@ -394,6 +400,12 @@ product(bool, UseOptoBiasInlining, true, \ "Generate biased locking code in C2 ideal graph") \ \ + product(bool, OptimizeStringConcat, false, \ + "Optimize the construction of Strings by StringBuilder") \ + \ + notproduct(bool, PrintOptimizeStringConcat, false, \ + "Print information about transformations performed on Strings") \ + \ product(intx, ValueSearchLimit, 1000, \ "Recursion limit in PhaseMacroExpand::value_from_mem_phi") \ \ @@ -413,4 +425,4 @@ product(bool, BlockLayoutRotateLoops, true, \ "Allow back branches to be fall throughs in the block layour") \ -C2_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_NOTPRODUCT_FLAG) +C2_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_EXPERIMENTAL_FLAG, DECLARE_NOTPRODUCT_FLAG) diff --git a/hotspot/src/share/vm/opto/callGenerator.cpp b/hotspot/src/share/vm/opto/callGenerator.cpp index 8ce7c0ce57d..a358e535076 100644 --- a/hotspot/src/share/vm/opto/callGenerator.cpp +++ b/hotspot/src/share/vm/opto/callGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -98,12 +98,21 @@ JVMState* ParseGenerator::generate(JVMState* jvms) { //---------------------------DirectCallGenerator------------------------------ // Internal class which handles all out-of-line calls w/o receiver type checks. class DirectCallGenerator : public CallGenerator { -public: - DirectCallGenerator(ciMethod* method) - : CallGenerator(method) + private: + CallStaticJavaNode* _call_node; + // Force separate memory and I/O projections for the exceptional + // paths to facilitate late inlinig. + bool _separate_io_proj; + + public: + DirectCallGenerator(ciMethod* method, bool separate_io_proj) + : CallGenerator(method), + _separate_io_proj(separate_io_proj) { } virtual JVMState* generate(JVMState* jvms); + + CallStaticJavaNode* call_node() const { return _call_node; } }; JVMState* DirectCallGenerator::generate(JVMState* jvms) { @@ -127,14 +136,85 @@ JVMState* DirectCallGenerator::generate(JVMState* jvms) { } // Mark the call node as virtual, sort of: call->set_optimized_virtual(true); + if (method()->is_method_handle_invoke()) { + call->set_method_handle_invoke(true); + kit.C->set_has_method_handle_invokes(true); + } } kit.set_arguments_for_java_call(call); + kit.set_edges_for_java_call(call, false, _separate_io_proj); + Node* ret = kit.set_results_for_java_call(call, _separate_io_proj); + kit.push_node(method()->return_type()->basic_type(), ret); + _call_node = call; // Save the call node in case we need it later + return kit.transfer_exceptions_into_jvms(); +} + +//---------------------------DynamicCallGenerator----------------------------- +// Internal class which handles all out-of-line invokedynamic calls. +class DynamicCallGenerator : public CallGenerator { +public: + DynamicCallGenerator(ciMethod* method) + : CallGenerator(method) + { + } + virtual JVMState* generate(JVMState* jvms); +}; + +JVMState* DynamicCallGenerator::generate(JVMState* jvms) { + GraphKit kit(jvms); + + if (kit.C->log() != NULL) { + kit.C->log()->elem("dynamic_call bci='%d'", jvms->bci()); + } + + // Get the constant pool cache from the caller class. + ciMethod* caller_method = jvms->method(); + ciBytecodeStream str(caller_method); + str.force_bci(jvms->bci()); // Set the stream to the invokedynamic bci. + assert(str.cur_bc() == Bytecodes::_invokedynamic, "wrong place to issue a dynamic call!"); + ciCPCache* cpcache = str.get_cpcache(); + + // Get the offset of the CallSite from the constant pool cache + // pointer. + int index = str.get_method_index(); + size_t call_site_offset = cpcache->get_f1_offset(index); + + // Load the CallSite object from the constant pool cache. + const TypeOopPtr* cpcache_ptr = TypeOopPtr::make_from_constant(cpcache); + Node* cpcache_adr = kit.makecon(cpcache_ptr); + Node* call_site_adr = kit.basic_plus_adr(cpcache_adr, cpcache_adr, call_site_offset); + Node* call_site = kit.make_load(kit.control(), call_site_adr, TypeInstPtr::BOTTOM, T_OBJECT, Compile::AliasIdxRaw); + + // Load the target MethodHandle from the CallSite object. + Node* target_mh_adr = kit.basic_plus_adr(call_site, call_site, java_dyn_CallSite::target_offset_in_bytes()); + Node* target_mh = kit.make_load(kit.control(), target_mh_adr, TypeInstPtr::BOTTOM, T_OBJECT); + + address resolve_stub = SharedRuntime::get_resolve_opt_virtual_call_stub(); + + CallStaticJavaNode *call = new (kit.C, tf()->domain()->cnt()) CallStaticJavaNode(tf(), resolve_stub, method(), kit.bci()); + // invokedynamic is treated as an optimized invokevirtual. + call->set_optimized_virtual(true); + // Take extra care (in the presence of argument motion) not to trash the SP: + call->set_method_handle_invoke(true); + kit.C->set_has_method_handle_invokes(true); + + // Pass the target MethodHandle as first argument and shift the + // other arguments. + call->init_req(0 + TypeFunc::Parms, target_mh); + uint nargs = call->method()->arg_size(); + for (uint i = 1; i < nargs; i++) { + Node* arg = kit.argument(i - 1); + call->init_req(i + TypeFunc::Parms, arg); + } + kit.set_edges_for_java_call(call); Node* ret = kit.set_results_for_java_call(call); kit.push_node(method()->return_type()->basic_type(), ret); return kit.transfer_exceptions_into_jvms(); } +//--------------------------VirtualCallGenerator------------------------------ +// Internal class which handles all out-of-line calls checking receiver type. class VirtualCallGenerator : public CallGenerator { private: int _vtable_index; @@ -149,8 +229,6 @@ public: virtual JVMState* generate(JVMState* jvms); }; -//--------------------------VirtualCallGenerator------------------------------ -// Internal class which handles all out-of-line calls checking receiver type. JVMState* VirtualCallGenerator::generate(JVMState* jvms) { GraphKit kit(jvms); Node* receiver = kit.argument(0); @@ -238,16 +316,124 @@ CallGenerator* CallGenerator::for_osr(ciMethod* m, int osr_bci) { return new ParseGenerator(m, expected_uses, true); } -CallGenerator* CallGenerator::for_direct_call(ciMethod* m) { +CallGenerator* CallGenerator::for_direct_call(ciMethod* m, bool separate_io_proj) { assert(!m->is_abstract(), "for_direct_call mismatch"); - return new DirectCallGenerator(m); + return new DirectCallGenerator(m, separate_io_proj); +} + +CallGenerator* CallGenerator::for_dynamic_call(ciMethod* m) { + assert(m->is_method_handle_invoke(), "for_dynamic_call mismatch"); + return new DynamicCallGenerator(m); } CallGenerator* CallGenerator::for_virtual_call(ciMethod* m, int vtable_index) { assert(!m->is_static(), "for_virtual_call mismatch"); + assert(!m->is_method_handle_invoke(), "should be a direct call"); return new VirtualCallGenerator(m, vtable_index); } +// Allow inlining decisions to be delayed +class LateInlineCallGenerator : public DirectCallGenerator { + CallGenerator* _inline_cg; + + public: + LateInlineCallGenerator(ciMethod* method, CallGenerator* inline_cg) : + DirectCallGenerator(method, true), _inline_cg(inline_cg) {} + + virtual bool is_late_inline() const { return true; } + + // Convert the CallStaticJava into an inline + virtual void do_late_inline(); + + JVMState* generate(JVMState* jvms) { + // Record that this call site should be revisited once the main + // parse is finished. + Compile::current()->add_late_inline(this); + + // Emit the CallStaticJava and request separate projections so + // that the late inlining logic can distinguish between fall + // through and exceptional uses of the memory and io projections + // as is done for allocations and macro expansion. + return DirectCallGenerator::generate(jvms); + } + +}; + + +void LateInlineCallGenerator::do_late_inline() { + // Can't inline it + if (call_node() == NULL || call_node()->outcnt() == 0 || + call_node()->in(0) == NULL || call_node()->in(0)->is_top()) + return; + + CallStaticJavaNode* call = call_node(); + + // Make a clone of the JVMState that appropriate to use for driving a parse + Compile* C = Compile::current(); + JVMState* jvms = call->jvms()->clone_shallow(C); + uint size = call->req(); + SafePointNode* map = new (C, size) SafePointNode(size, jvms); + for (uint i1 = 0; i1 < size; i1++) { + map->init_req(i1, call->in(i1)); + } + + // Make sure the state is a MergeMem for parsing. + if (!map->in(TypeFunc::Memory)->is_MergeMem()) { + map->set_req(TypeFunc::Memory, MergeMemNode::make(C, map->in(TypeFunc::Memory))); + } + + // Make enough space for the expression stack and transfer the incoming arguments + int nargs = method()->arg_size(); + jvms->set_map(map); + map->ensure_stack(jvms, jvms->method()->max_stack()); + if (nargs > 0) { + for (int i1 = 0; i1 < nargs; i1++) { + map->set_req(i1 + jvms->argoff(), call->in(TypeFunc::Parms + i1)); + } + } + + CompileLog* log = C->log(); + if (log != NULL) { + log->head("late_inline method='%d'", log->identify(method())); + JVMState* p = jvms; + while (p != NULL) { + log->elem("jvms bci='%d' method='%d'", p->bci(), log->identify(p->method())); + p = p->caller(); + } + log->tail("late_inline"); + } + + // Setup default node notes to be picked up by the inlining + Node_Notes* old_nn = C->default_node_notes(); + if (old_nn != NULL) { + Node_Notes* entry_nn = old_nn->clone(C); + entry_nn->set_jvms(jvms); + C->set_default_node_notes(entry_nn); + } + + // Now perform the inling using the synthesized JVMState + JVMState* new_jvms = _inline_cg->generate(jvms); + if (new_jvms == NULL) return; // no change + if (C->failing()) return; + + // Capture any exceptional control flow + GraphKit kit(new_jvms); + + // Find the result object + Node* result = C->top(); + int result_size = method()->return_type()->size(); + if (result_size != 0 && !kit.stopped()) { + result = (result_size == 1) ? kit.pop() : kit.pop_pair(); + } + + kit.replace_call(call, result); +} + + +CallGenerator* CallGenerator::for_late_inline(ciMethod* method, CallGenerator* inline_cg) { + return new LateInlineCallGenerator(method, inline_cg); +} + //---------------------------WarmCallGenerator-------------------------------- // Internal class which handles initial deferral of inlining decisions. @@ -315,70 +501,7 @@ JVMState* WarmCallGenerator::generate(JVMState* jvms) { } void WarmCallInfo::make_hot() { - Compile* C = Compile::current(); - // Replace the callnode with something better. - CallJavaNode* call = this->call()->as_CallJava(); - ciMethod* method = call->method(); - int nargs = method->arg_size(); - JVMState* jvms = call->jvms()->clone_shallow(C); - uint size = TypeFunc::Parms + MAX2(2, nargs); - SafePointNode* map = new (C, size) SafePointNode(size, jvms); - for (uint i1 = 0; i1 < (uint)(TypeFunc::Parms + nargs); i1++) { - map->init_req(i1, call->in(i1)); - } - jvms->set_map(map); - jvms->set_offsets(map->req()); - jvms->set_locoff(TypeFunc::Parms); - jvms->set_stkoff(TypeFunc::Parms); - GraphKit kit(jvms); - - JVMState* new_jvms = _hot_cg->generate(kit.jvms()); - if (new_jvms == NULL) return; // no change - if (C->failing()) return; - - kit.set_jvms(new_jvms); - Node* res = C->top(); - int res_size = method->return_type()->size(); - if (res_size != 0) { - kit.inc_sp(-res_size); - res = kit.argument(0); - } - GraphKit ekit(kit.combine_and_pop_all_exception_states()->jvms()); - - // Replace the call: - for (DUIterator i = call->outs(); call->has_out(i); i++) { - Node* n = call->out(i); - Node* nn = NULL; // replacement - if (n->is_Proj()) { - ProjNode* nproj = n->as_Proj(); - assert(nproj->_con < (uint)(TypeFunc::Parms + (res_size ? 1 : 0)), "sane proj"); - if (nproj->_con == TypeFunc::Parms) { - nn = res; - } else { - nn = kit.map()->in(nproj->_con); - } - if (nproj->_con == TypeFunc::I_O) { - for (DUIterator j = nproj->outs(); nproj->has_out(j); j++) { - Node* e = nproj->out(j); - if (e->Opcode() == Op_CreateEx) { - e->replace_by(ekit.argument(0)); - } else if (e->Opcode() == Op_Catch) { - for (DUIterator k = e->outs(); e->has_out(k); k++) { - CatchProjNode* p = e->out(j)->as_CatchProj(); - if (p->is_handler_proj()) { - p->replace_by(ekit.control()); - } else { - p->replace_by(kit.control()); - } - } - } - } - } - } - NOT_PRODUCT(if (!nn) n->dump(2)); - assert(nn != NULL, "don't know what to do with this user"); - n->replace_by(nn); - } + Unimplemented(); } void WarmCallInfo::make_cold() { @@ -527,6 +650,155 @@ JVMState* PredictedCallGenerator::generate(JVMState* jvms) { } +//------------------------PredictedDynamicCallGenerator----------------------- +// Internal class which handles all out-of-line calls checking receiver type. +class PredictedDynamicCallGenerator : public CallGenerator { + ciMethodHandle* _predicted_method_handle; + CallGenerator* _if_missed; + CallGenerator* _if_hit; + float _hit_prob; + +public: + PredictedDynamicCallGenerator(ciMethodHandle* predicted_method_handle, + CallGenerator* if_missed, + CallGenerator* if_hit, + float hit_prob) + : CallGenerator(if_missed->method()), + _predicted_method_handle(predicted_method_handle), + _if_missed(if_missed), + _if_hit(if_hit), + _hit_prob(hit_prob) + {} + + virtual bool is_inline() const { return _if_hit->is_inline(); } + virtual bool is_deferred() const { return _if_hit->is_deferred(); } + + virtual JVMState* generate(JVMState* jvms); +}; + + +CallGenerator* CallGenerator::for_predicted_dynamic_call(ciMethodHandle* predicted_method_handle, + CallGenerator* if_missed, + CallGenerator* if_hit, + float hit_prob) { + return new PredictedDynamicCallGenerator(predicted_method_handle, if_missed, if_hit, hit_prob); +} + + +JVMState* PredictedDynamicCallGenerator::generate(JVMState* jvms) { + GraphKit kit(jvms); + PhaseGVN& gvn = kit.gvn(); + + CompileLog* log = kit.C->log(); + if (log != NULL) { + log->elem("predicted_dynamic_call bci='%d'", jvms->bci()); + } + + // Get the constant pool cache from the caller class. + ciMethod* caller_method = jvms->method(); + ciBytecodeStream str(caller_method); + str.force_bci(jvms->bci()); // Set the stream to the invokedynamic bci. + ciCPCache* cpcache = str.get_cpcache(); + + // Get the offset of the CallSite from the constant pool cache + // pointer. + int index = str.get_method_index(); + size_t call_site_offset = cpcache->get_f1_offset(index); + + // Load the CallSite object from the constant pool cache. + const TypeOopPtr* cpcache_ptr = TypeOopPtr::make_from_constant(cpcache); + Node* cpcache_adr = kit.makecon(cpcache_ptr); + Node* call_site_adr = kit.basic_plus_adr(cpcache_adr, cpcache_adr, call_site_offset); + Node* call_site = kit.make_load(kit.control(), call_site_adr, TypeInstPtr::BOTTOM, T_OBJECT, Compile::AliasIdxRaw); + + // Load the target MethodHandle from the CallSite object. + Node* target_adr = kit.basic_plus_adr(call_site, call_site, java_dyn_CallSite::target_offset_in_bytes()); + Node* target_mh = kit.make_load(kit.control(), target_adr, TypeInstPtr::BOTTOM, T_OBJECT); + + // Check if the MethodHandle is still the same. + const TypeOopPtr* predicted_mh_ptr = TypeOopPtr::make_from_constant(_predicted_method_handle, true); + Node* predicted_mh = kit.makecon(predicted_mh_ptr); + + Node* cmp = gvn.transform(new(kit.C, 3) CmpPNode(target_mh, predicted_mh)); + Node* bol = gvn.transform(new(kit.C, 2) BoolNode(cmp, BoolTest::eq) ); + IfNode* iff = kit.create_and_xform_if(kit.control(), bol, _hit_prob, COUNT_UNKNOWN); + kit.set_control( gvn.transform(new(kit.C, 1) IfTrueNode (iff))); + Node* slow_ctl = gvn.transform(new(kit.C, 1) IfFalseNode(iff)); + + SafePointNode* slow_map = NULL; + JVMState* slow_jvms; + { PreserveJVMState pjvms(&kit); + kit.set_control(slow_ctl); + if (!kit.stopped()) { + slow_jvms = _if_missed->generate(kit.sync_jvms()); + assert(slow_jvms != NULL, "miss path must not fail to generate"); + kit.add_exception_states_from(slow_jvms); + kit.set_map(slow_jvms->map()); + if (!kit.stopped()) + slow_map = kit.stop(); + } + } + + if (kit.stopped()) { + // Instance exactly does not matches the desired type. + kit.set_jvms(slow_jvms); + return kit.transfer_exceptions_into_jvms(); + } + + // Make the hot call: + JVMState* new_jvms = _if_hit->generate(kit.sync_jvms()); + if (new_jvms == NULL) { + // Inline failed, so make a direct call. + assert(_if_hit->is_inline(), "must have been a failed inline"); + CallGenerator* cg = CallGenerator::for_direct_call(_if_hit->method()); + new_jvms = cg->generate(kit.sync_jvms()); + } + kit.add_exception_states_from(new_jvms); + kit.set_jvms(new_jvms); + + // Need to merge slow and fast? + if (slow_map == NULL) { + // The fast path is the only path remaining. + return kit.transfer_exceptions_into_jvms(); + } + + if (kit.stopped()) { + // Inlined method threw an exception, so it's just the slow path after all. + kit.set_jvms(slow_jvms); + return kit.transfer_exceptions_into_jvms(); + } + + // Finish the diamond. + kit.C->set_has_split_ifs(true); // Has chance for split-if optimization + RegionNode* region = new (kit.C, 3) RegionNode(3); + region->init_req(1, kit.control()); + region->init_req(2, slow_map->control()); + kit.set_control(gvn.transform(region)); + Node* iophi = PhiNode::make(region, kit.i_o(), Type::ABIO); + iophi->set_req(2, slow_map->i_o()); + kit.set_i_o(gvn.transform(iophi)); + kit.merge_memory(slow_map->merged_memory(), region, 2); + uint tos = kit.jvms()->stkoff() + kit.sp(); + uint limit = slow_map->req(); + for (uint i = TypeFunc::Parms; i < limit; i++) { + // Skip unused stack slots; fast forward to monoff(); + if (i == tos) { + i = kit.jvms()->monoff(); + if( i >= limit ) break; + } + Node* m = kit.map()->in(i); + Node* n = slow_map->in(i); + if (m != n) { + const Type* t = gvn.type(m)->meet(gvn.type(n)); + Node* phi = PhiNode::make(region, m, t); + phi->set_req(2, n); + kit.map()->set_req(i, gvn.transform(phi)); + } + } + return kit.transfer_exceptions_into_jvms(); +} + + //-------------------------UncommonTrapCallGenerator----------------------------- // Internal class which handles all out-of-line calls checking receiver type. class UncommonTrapCallGenerator : public CallGenerator { diff --git a/hotspot/src/share/vm/opto/callGenerator.hpp b/hotspot/src/share/vm/opto/callGenerator.hpp index bbd47ca4aab..ecc7a4ac2e4 100644 --- a/hotspot/src/share/vm/opto/callGenerator.hpp +++ b/hotspot/src/share/vm/opto/callGenerator.hpp @@ -57,6 +57,13 @@ class CallGenerator : public ResourceObj { // is_trap: Does not return to the caller. (E.g., uncommon trap.) virtual bool is_trap() const { return false; } + // is_late_inline: supports conversion of call into an inline + virtual bool is_late_inline() const { return false; } + // Replace the call with an inline version of the code + virtual void do_late_inline() { ShouldNotReachHere(); } + + virtual CallStaticJavaNode* call_node() const { ShouldNotReachHere(); return NULL; } + // Note: It is possible for a CG to be both inline and virtual. // (The hashCode intrinsic does a vtable check and an inlined fast path.) @@ -92,9 +99,13 @@ class CallGenerator : public ResourceObj { static CallGenerator* for_osr(ciMethod* m, int osr_bci); // How to generate vanilla out-of-line call sites: - static CallGenerator* for_direct_call(ciMethod* m); // static, special + static CallGenerator* for_direct_call(ciMethod* m, bool separate_io_projs = false); // static, special + static CallGenerator* for_dynamic_call(ciMethod* m); // invokedynamic static CallGenerator* for_virtual_call(ciMethod* m, int vtable_index); // virtual, interface + // How to generate a replace a direct call with an inline version + static CallGenerator* for_late_inline(ciMethod* m, CallGenerator* inline_cg); + // How to make a call but defer the decision whether to inline or not. static CallGenerator* for_warm_call(WarmCallInfo* ci, CallGenerator* if_cold, @@ -106,6 +117,12 @@ class CallGenerator : public ResourceObj { CallGenerator* if_hit, float hit_prob); + // How to make a call that optimistically assumes a MethodHandle target: + static CallGenerator* for_predicted_dynamic_call(ciMethodHandle* predicted_method_handle, + CallGenerator* if_missed, + CallGenerator* if_hit, + float hit_prob); + // How to make a call that gives up and goes back to the interpreter: static CallGenerator* for_uncommon_trap(ciMethod* m, Deoptimization::DeoptReason reason, diff --git a/hotspot/src/share/vm/opto/callnode.cpp b/hotspot/src/share/vm/opto/callnode.cpp index 5c69109b8fe..a5902713111 100644 --- a/hotspot/src/share/vm/opto/callnode.cpp +++ b/hotspot/src/share/vm/opto/callnode.cpp @@ -693,6 +693,84 @@ Node *CallNode::result_cast() { } +void CallNode::extract_projections(CallProjections* projs, bool separate_io_proj) { + projs->fallthrough_proj = NULL; + projs->fallthrough_catchproj = NULL; + projs->fallthrough_ioproj = NULL; + projs->catchall_ioproj = NULL; + projs->catchall_catchproj = NULL; + projs->fallthrough_memproj = NULL; + projs->catchall_memproj = NULL; + projs->resproj = NULL; + projs->exobj = NULL; + + for (DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++) { + ProjNode *pn = fast_out(i)->as_Proj(); + if (pn->outcnt() == 0) continue; + switch (pn->_con) { + case TypeFunc::Control: + { + // For Control (fallthrough) and I_O (catch_all_index) we have CatchProj -> Catch -> Proj + projs->fallthrough_proj = pn; + DUIterator_Fast jmax, j = pn->fast_outs(jmax); + const Node *cn = pn->fast_out(j); + if (cn->is_Catch()) { + ProjNode *cpn = NULL; + for (DUIterator_Fast kmax, k = cn->fast_outs(kmax); k < kmax; k++) { + cpn = cn->fast_out(k)->as_Proj(); + assert(cpn->is_CatchProj(), "must be a CatchProjNode"); + if (cpn->_con == CatchProjNode::fall_through_index) + projs->fallthrough_catchproj = cpn; + else { + assert(cpn->_con == CatchProjNode::catch_all_index, "must be correct index."); + projs->catchall_catchproj = cpn; + } + } + } + break; + } + case TypeFunc::I_O: + if (pn->_is_io_use) + projs->catchall_ioproj = pn; + else + projs->fallthrough_ioproj = pn; + for (DUIterator j = pn->outs(); pn->has_out(j); j++) { + Node* e = pn->out(j); + if (e->Opcode() == Op_CreateEx && e->in(0)->is_CatchProj()) { + assert(projs->exobj == NULL, "only one"); + projs->exobj = e; + } + } + break; + case TypeFunc::Memory: + if (pn->_is_io_use) + projs->catchall_memproj = pn; + else + projs->fallthrough_memproj = pn; + break; + case TypeFunc::Parms: + projs->resproj = pn; + break; + default: + assert(false, "unexpected projection from allocation node."); + } + } + + // The resproj may not exist because the result couuld be ignored + // and the exception object may not exist if an exception handler + // swallows the exception but all the other must exist and be found. + assert(projs->fallthrough_proj != NULL, "must be found"); + assert(projs->fallthrough_catchproj != NULL, "must be found"); + assert(projs->fallthrough_memproj != NULL, "must be found"); + assert(projs->fallthrough_ioproj != NULL, "must be found"); + assert(projs->catchall_catchproj != NULL, "must be found"); + if (separate_io_proj) { + assert(projs->catchall_memproj != NULL, "must be found"); + assert(projs->catchall_ioproj != NULL, "must be found"); + } +} + + //============================================================================= uint CallJavaNode::size_of() const { return sizeof(*this); } uint CallJavaNode::cmp( const Node &n ) const { diff --git a/hotspot/src/share/vm/opto/callnode.hpp b/hotspot/src/share/vm/opto/callnode.hpp index ac886f3ba99..e3bd8906d95 100644 --- a/hotspot/src/share/vm/opto/callnode.hpp +++ b/hotspot/src/share/vm/opto/callnode.hpp @@ -470,6 +470,23 @@ public: #endif }; + +// Simple container for the outgoing projections of a call. Useful +// for serious surgery on calls. +class CallProjections : public StackObj { +public: + Node* fallthrough_proj; + Node* fallthrough_catchproj; + Node* fallthrough_memproj; + Node* fallthrough_ioproj; + Node* catchall_catchproj; + Node* catchall_memproj; + Node* catchall_ioproj; + Node* resproj; + Node* exobj; +}; + + //------------------------------CallNode--------------------------------------- // Call nodes now subsume the function of debug nodes at callsites, so they // contain the functionality of a full scope chain of debug nodes. @@ -521,6 +538,11 @@ public: // or returns NULL if there is no one. Node *result_cast(); + // Collect all the interesting edges from a call for use in + // replacing the call by something else. Used by macro expansion + // and the late inlining support. + void extract_projections(CallProjections* projs, bool separate_io_proj); + virtual uint match_edge(uint idx) const; #ifndef PRODUCT @@ -529,6 +551,7 @@ public: #endif }; + //------------------------------CallJavaNode----------------------------------- // Make a static or dynamic subroutine call node using Java calling // convention. (The "Java" calling convention is the compiler's calling @@ -539,12 +562,15 @@ protected: virtual uint size_of() const; // Size is bigger bool _optimized_virtual; + bool _method_handle_invoke; ciMethod* _method; // Method being direct called public: const int _bci; // Byte Code Index of call byte code CallJavaNode(const TypeFunc* tf , address addr, ciMethod* method, int bci) : CallNode(tf, addr, TypePtr::BOTTOM), - _method(method), _bci(bci), _optimized_virtual(false) + _method(method), _bci(bci), + _optimized_virtual(false), + _method_handle_invoke(false) { init_class_id(Class_CallJava); } @@ -554,6 +580,8 @@ public: void set_method(ciMethod *m) { _method = m; } void set_optimized_virtual(bool f) { _optimized_virtual = f; } bool is_optimized_virtual() const { return _optimized_virtual; } + void set_method_handle_invoke(bool f) { _method_handle_invoke = f; } + bool is_method_handle_invoke() const { return _method_handle_invoke; } #ifndef PRODUCT virtual void dump_spec(outputStream *st) const; diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp index ecffd2f4e6a..5ca0286b545 100644 --- a/hotspot/src/share/vm/opto/compile.cpp +++ b/hotspot/src/share/vm/opto/compile.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -224,6 +224,32 @@ bool Compile::valid_bundle_info(const Node *n) { } +void Compile::gvn_replace_by(Node* n, Node* nn) { + for (DUIterator_Last imin, i = n->last_outs(imin); i >= imin; ) { + Node* use = n->last_out(i); + bool is_in_table = initial_gvn()->hash_delete(use); + uint uses_found = 0; + for (uint j = 0; j < use->len(); j++) { + if (use->in(j) == n) { + if (j < use->req()) + use->set_req(j, nn); + else + use->set_prec(j, nn); + uses_found++; + } + } + if (is_in_table) { + // reinsert into table + initial_gvn()->hash_find_insert(use); + } + record_for_igvn(use); + i -= uses_found; // we deleted 1 or more copies of this edge + } +} + + + + // Identify all nodes that are reachable from below, useful. // Use breadth-first pass that records state in a Unique_Node_List, // recursive traversal is slower. @@ -439,6 +465,7 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr _code_buffer("Compile::Fill_buffer"), _orig_pc_slot(0), _orig_pc_slot_offset_in_bytes(0), + _has_method_handle_invokes(false), _node_bundling_limit(0), _node_bundling_base(NULL), _java_calls(0), @@ -554,6 +581,28 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr rethrow_exceptions(kit.transfer_exceptions_into_jvms()); } + if (!failing() && has_stringbuilder()) { + { + // remove useless nodes to make the usage analysis simpler + ResourceMark rm; + PhaseRemoveUseless pru(initial_gvn(), &for_igvn); + } + + { + ResourceMark rm; + print_method("Before StringOpts", 3); + PhaseStringOpts pso(initial_gvn(), &for_igvn); + print_method("After StringOpts", 3); + } + + // now inline anything that we skipped the first time around + while (_late_inlines.length() > 0) { + CallGenerator* cg = _late_inlines.pop(); + cg->do_late_inline(); + } + } + assert(_late_inlines.length() == 0, "should have been processed"); + print_method("Before RemoveUseless", 3); // Remove clutter produced by parsing. @@ -711,6 +760,7 @@ Compile::Compile( ciEnv* ci_env, _do_escape_analysis(false), _failure_reason(NULL), _code_buffer("Compile::Fill_buffer"), + _has_method_handle_invokes(false), _node_bundling_limit(0), _node_bundling_base(NULL), _java_calls(0), @@ -820,6 +870,7 @@ void Compile::Init(int aliaslevel) { _fixed_slots = 0; set_has_split_ifs(false); set_has_loops(has_method() && method()->has_loops()); // first approximation + set_has_stringbuilder(false); _deopt_happens = true; // start out assuming the worst _trap_can_recompile = false; // no traps emitted yet _major_progress = true; // start out assuming good things will happen @@ -883,6 +934,7 @@ void Compile::Init(int aliaslevel) { _intrinsics = NULL; _macro_nodes = new GrowableArray(comp_arena(), 8, 0, NULL); + _predicate_opaqs = new GrowableArray(comp_arena(), 8, 0, NULL); register_library_intrinsics(); } @@ -1504,6 +1556,19 @@ void Compile::Finish_Warm() { } } +//---------------------cleanup_loop_predicates----------------------- +// Remove the opaque nodes that protect the predicates so that all unused +// checks and uncommon_traps will be eliminated from the ideal graph +void Compile::cleanup_loop_predicates(PhaseIterGVN &igvn) { + if (predicate_count()==0) return; + for (int i = predicate_count(); i > 0; i--) { + Node * n = predicate_opaque1_node(i-1); + assert(n->Opcode() == Op_Opaque1, "must be"); + igvn.replace_node(n, n->in(1)); + } + assert(predicate_count()==0, "should be clean!"); + igvn.optimize(); +} //------------------------------Optimize--------------------------------------- // Given a graph, optimize it. @@ -1545,7 +1610,7 @@ void Compile::Optimize() { if((loop_opts_cnt > 0) && (has_loops() || has_split_ifs())) { { TracePhase t2("idealLoop", &_t_idealLoop, true); - PhaseIdealLoop ideal_loop( igvn, true ); + PhaseIdealLoop ideal_loop( igvn, true, UseLoopPredicate); loop_opts_cnt--; if (major_progress()) print_method("PhaseIdealLoop 1", 2); if (failing()) return; @@ -1553,7 +1618,7 @@ void Compile::Optimize() { // Loop opts pass if partial peeling occurred in previous pass if(PartialPeelLoop && major_progress() && (loop_opts_cnt > 0)) { TracePhase t3("idealLoop", &_t_idealLoop, true); - PhaseIdealLoop ideal_loop( igvn, false ); + PhaseIdealLoop ideal_loop( igvn, false, UseLoopPredicate); loop_opts_cnt--; if (major_progress()) print_method("PhaseIdealLoop 2", 2); if (failing()) return; @@ -1561,7 +1626,7 @@ void Compile::Optimize() { // Loop opts pass for loop-unrolling before CCP if(major_progress() && (loop_opts_cnt > 0)) { TracePhase t4("idealLoop", &_t_idealLoop, true); - PhaseIdealLoop ideal_loop( igvn, false ); + PhaseIdealLoop ideal_loop( igvn, false, UseLoopPredicate); loop_opts_cnt--; if (major_progress()) print_method("PhaseIdealLoop 3", 2); } @@ -1599,13 +1664,21 @@ void Compile::Optimize() { // peeling, unrolling, etc. if(loop_opts_cnt > 0) { debug_only( int cnt = 0; ); + bool loop_predication = UseLoopPredicate; while(major_progress() && (loop_opts_cnt > 0)) { TracePhase t2("idealLoop", &_t_idealLoop, true); assert( cnt++ < 40, "infinite cycle in loop optimization" ); - PhaseIdealLoop ideal_loop( igvn, true ); + PhaseIdealLoop ideal_loop( igvn, true, loop_predication); loop_opts_cnt--; if (major_progress()) print_method("PhaseIdealLoop iterations", 2); if (failing()) return; + // Perform loop predication optimization during first iteration after CCP. + // After that switch it off and cleanup unused loop predicates. + if (loop_predication) { + loop_predication = false; + cleanup_loop_predicates(igvn); + if (failing()) return; + } } } @@ -1803,6 +1876,7 @@ void Compile::dump_asm(int *pcs, uint pc_limit) { !n->is_Phi() && // a few noisely useless nodes !n->is_Proj() && !n->is_MachTemp() && + !n->is_SafePointScalarObject() && !n->is_Catch() && // Would be nice to print exception table targets !n->is_MergeMem() && // Not very interesting !n->is_top() && // Debug info table constants @@ -2240,6 +2314,30 @@ static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc ) { break; } + case Op_Proj: { + if (OptimizeStringConcat) { + ProjNode* p = n->as_Proj(); + if (p->_is_io_use) { + // Separate projections were used for the exception path which + // are normally removed by a late inline. If it wasn't inlined + // then they will hang around and should just be replaced with + // the original one. + Node* proj = NULL; + // Replace with just one + for (SimpleDUIterator i(p->in(0)); i.has_next(); i.next()) { + Node *use = i.get(); + if (use->is_Proj() && p != use && use->as_Proj()->_con == p->_con) { + proj = use; + break; + } + } + assert(p != NULL, "must be found"); + p->subsume_by(proj); + } + } + break; + } + case Op_Phi: if (n->as_Phi()->bottom_type()->isa_narrowoop()) { // The EncodeP optimization may create Phi with the same edges diff --git a/hotspot/src/share/vm/opto/compile.hpp b/hotspot/src/share/vm/opto/compile.hpp index 4bd1900fc70..7027d29d533 100644 --- a/hotspot/src/share/vm/opto/compile.hpp +++ b/hotspot/src/share/vm/opto/compile.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,6 +38,7 @@ class Node_Notes; class OptoReg; class PhaseCFG; class PhaseGVN; +class PhaseIterGVN; class PhaseRegAlloc; class PhaseCCP; class PhaseCCP_DCE; @@ -149,6 +150,7 @@ class Compile : public Phase { bool _has_loops; // True if the method _may_ have some loops bool _has_split_ifs; // True if the method _may_ have some split-if bool _has_unsafe_access; // True if the method _may_ produce faults in unsafe loads or stores. + bool _has_stringbuilder; // True StringBuffers or StringBuilders are allocated uint _trap_hist[trapHistLength]; // Cumulative traps bool _trap_can_recompile; // Have we emitted a recompiling trap? uint _decompile_count; // Cumulative decompilation counts. @@ -164,6 +166,9 @@ class Compile : public Phase { bool _parsed_irreducible_loop; // True if ciTypeFlow detected irreducible loops during parsing #endif + // JSR 292 + bool _has_method_handle_invokes; // True if this method has MethodHandle invokes. + // Compilation environment. Arena _comp_arena; // Arena with lifetime equivalent to Compile ciEnv* _env; // CI interface @@ -171,6 +176,7 @@ class Compile : public Phase { const char* _failure_reason; // for record_failure/failing pattern GrowableArray* _intrinsics; // List of intrinsics. GrowableArray* _macro_nodes; // List of nodes which need to be expanded before matching. + GrowableArray* _predicate_opaqs; // List of Opaque1 nodes for the loop predicates. ConnectionGraph* _congraph; #ifndef PRODUCT IdealGraphPrinter* _printer; @@ -219,6 +225,9 @@ class Compile : public Phase { Unique_Node_List* _for_igvn; // Initial work-list for next round of Iterative GVN WarmCallInfo* _warm_calls; // Sorted work-list for heat-based inlining. + GrowableArray _late_inlines; // List of CallGenerators to be revisited after + // main parsing has finished. + // Matching, CFG layout, allocation, code generation PhaseCFG* _cfg; // Results of CFG finding bool _select_24_bit_instr; // We selected an instruction with a 24-bit result @@ -298,6 +307,8 @@ class Compile : public Phase { void set_has_split_ifs(bool z) { _has_split_ifs = z; } bool has_unsafe_access() const { return _has_unsafe_access; } void set_has_unsafe_access(bool z) { _has_unsafe_access = z; } + bool has_stringbuilder() const { return _has_stringbuilder; } + void set_has_stringbuilder(bool z) { _has_stringbuilder = z; } void set_trap_count(uint r, uint c) { assert(r < trapHistLength, "oob"); _trap_hist[r] = c; } uint trap_count(uint r) const { assert(r < trapHistLength, "oob"); return _trap_hist[r]; } bool trap_can_recompile() const { return _trap_can_recompile; } @@ -328,6 +339,10 @@ class Compile : public Phase { void set_parsed_irreducible_loop(bool z) { _parsed_irreducible_loop = z; } #endif + // JSR 292 + bool has_method_handle_invokes() const { return _has_method_handle_invokes; } + void set_has_method_handle_invokes(bool z) { _has_method_handle_invokes = z; } + void begin_method() { #ifndef PRODUCT if (_printer) _printer->begin_method(this); @@ -345,7 +360,9 @@ class Compile : public Phase { } int macro_count() { return _macro_nodes->length(); } + int predicate_count() { return _predicate_opaqs->length();} Node* macro_node(int idx) { return _macro_nodes->at(idx); } + Node* predicate_opaque1_node(int idx) { return _predicate_opaqs->at(idx);} ConnectionGraph* congraph() { return _congraph;} void add_macro_node(Node * n) { //assert(n->is_macro(), "must be a macro node"); @@ -357,7 +374,19 @@ class Compile : public Phase { // that the node is in the array before attempting to remove it if (_macro_nodes->contains(n)) _macro_nodes->remove(n); + // remove from _predicate_opaqs list also if it is there + if (predicate_count() > 0 && _predicate_opaqs->contains(n)){ + _predicate_opaqs->remove(n); + } } + void add_predicate_opaq(Node * n) { + assert(!_predicate_opaqs->contains(n), " duplicate entry in predicate opaque1"); + assert(_macro_nodes->contains(n), "should have already been in macro list"); + _predicate_opaqs->append(n); + } + // remove the opaque nodes that protect the predicates so that the unused checks and + // uncommon traps will be eliminated from the graph. + void cleanup_loop_predicates(PhaseIterGVN &igvn); // Compilation environment. Arena* comp_arena() { return &_comp_arena; } @@ -475,6 +504,7 @@ class Compile : public Phase { // Decide how to build a call. // The profile factor is a discount to apply to this site's interp. profile. CallGenerator* call_generator(ciMethod* call_method, int vtable_index, bool call_is_virtual, JVMState* jvms, bool allow_inline, float profile_factor); + bool should_delay_inlining(ciMethod* call_method, JVMState* jvms); // Report if there were too many traps at a current method and bci. // Report if a trap was recorded, and/or PerMethodTrapLimit was exceeded. @@ -495,6 +525,11 @@ class Compile : public Phase { void set_initial_gvn(PhaseGVN *gvn) { _initial_gvn = gvn; } void set_for_igvn(Unique_Node_List *for_igvn) { _for_igvn = for_igvn; } + // Replace n by nn using initial_gvn, calling hash_delete and + // record_for_igvn as needed. + void gvn_replace_by(Node* n, Node* nn); + + void identify_useful_nodes(Unique_Node_List &useful); void remove_useless_nodes (Unique_Node_List &useful); @@ -502,6 +537,9 @@ class Compile : public Phase { void set_warm_calls(WarmCallInfo* l) { _warm_calls = l; } WarmCallInfo* pop_warm_call(); + // Record this CallGenerator for inlining at the end of parsing. + void add_late_inline(CallGenerator* cg) { _late_inlines.push(cg); } + // Matching, CFG layout, allocation, code generation PhaseCFG* cfg() { return _cfg; } bool select_24_bit_instr() const { return _select_24_bit_instr; } diff --git a/hotspot/src/share/vm/opto/divnode.cpp b/hotspot/src/share/vm/opto/divnode.cpp index a81e3b1942f..bc3c5ac9f7e 100644 --- a/hotspot/src/share/vm/opto/divnode.cpp +++ b/hotspot/src/share/vm/opto/divnode.cpp @@ -114,7 +114,8 @@ static Node *transform_int_divide( PhaseGVN *phase, Node *dividend, jint divisor if( andconi_t && andconi_t->is_con() ) { jint andconi = andconi_t->get_con(); if( andconi < 0 && is_power_of_2(-andconi) && (-andconi) >= d ) { - dividend = dividend->in(1); + if( (-andconi) == d ) // Remove AND if it clears bits which will be shifted + dividend = dividend->in(1); needs_rounding = false; } } @@ -356,7 +357,8 @@ static Node *transform_long_divide( PhaseGVN *phase, Node *dividend, jlong divis if( andconl_t && andconl_t->is_con() ) { jlong andconl = andconl_t->get_con(); if( andconl < 0 && is_power_of_2_long(-andconl) && (-andconl) >= d ) { - dividend = dividend->in(1); + if( (-andconl) == d ) // Remove AND if it clears bits which will be shifted + dividend = dividend->in(1); needs_rounding = false; } } diff --git a/hotspot/src/share/vm/opto/doCall.cpp b/hotspot/src/share/vm/opto/doCall.cpp index 5104e648aa6..2f3f734fd45 100644 --- a/hotspot/src/share/vm/opto/doCall.cpp +++ b/hotspot/src/share/vm/opto/doCall.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,9 @@ void trace_type_profile(ciMethod *method, int depth, int bci, ciMethod *prof_met } #endif -CallGenerator* Compile::call_generator(ciMethod* call_method, int vtable_index, bool call_is_virtual, JVMState* jvms, bool allow_inline, float prof_factor) { +CallGenerator* Compile::call_generator(ciMethod* call_method, int vtable_index, bool call_is_virtual, + JVMState* jvms, bool allow_inline, + float prof_factor) { CallGenerator* cg; // Dtrace currently doesn't work unless all calls are vanilla @@ -68,7 +70,7 @@ CallGenerator* Compile::call_generator(ciMethod* call_method, int vtable_index, CompileLog* log = this->log(); if (log != NULL) { int rid = (receiver_count >= 0)? log->identify(profile.receiver(0)): -1; - int r2id = (profile.morphism() == 2)? log->identify(profile.receiver(1)):-1; + int r2id = (rid != -1 && profile.has_receiver(1))? log->identify(profile.receiver(1)):-1; log->begin_elem("call method='%d' count='%d' prof_factor='%g'", log->identify(call_method), site_count, prof_factor); if (call_is_virtual) log->print(" virtual='1'"); @@ -116,7 +118,7 @@ CallGenerator* Compile::call_generator(ciMethod* call_method, int vtable_index, // TO DO: When UseOldInlining is removed, copy the ILT code elsewhere. float site_invoke_ratio = prof_factor; // Note: ilt is for the root of this parse, not the present call site. - ilt = new InlineTree(this, jvms->method(), jvms->caller(), site_invoke_ratio); + ilt = new InlineTree(this, jvms->method(), jvms->caller(), site_invoke_ratio, 0); } WarmCallInfo scratch_ci; if (!UseOldInlining) @@ -128,6 +130,12 @@ CallGenerator* Compile::call_generator(ciMethod* call_method, int vtable_index, if (allow_inline) { CallGenerator* cg = CallGenerator::for_inline(call_method, expected_uses); + if (require_inline && cg != NULL && should_delay_inlining(call_method, jvms)) { + // Delay the inlining of this method to give us the + // opportunity to perform some high level optimizations + // first. + return CallGenerator::for_late_inline(call_method, cg); + } if (cg == NULL) { // Fall through. } else if (require_inline || !InlineWarmCalls) { @@ -174,26 +182,16 @@ CallGenerator* Compile::call_generator(ciMethod* call_method, int vtable_index, } } CallGenerator* miss_cg; + Deoptimization::DeoptReason reason = (profile.morphism() == 2) ? + Deoptimization::Reason_bimorphic : + Deoptimization::Reason_class_check; if (( profile.morphism() == 1 || (profile.morphism() == 2 && next_hit_cg != NULL) ) && - - !too_many_traps(Deoptimization::Reason_class_check) - - // Check only total number of traps per method to allow - // the transition from monomorphic to bimorphic case between - // compilations without falling into virtual call. - // A monomorphic case may have the class_check trap flag is set - // due to the time gap between the uncommon trap processing - // when flags are set in MDO and the call site bytecode execution - // in Interpreter when MDO counters are updated. - // There was also class_check trap in monomorphic case due to - // the bug 6225440. - + !too_many_traps(jvms->method(), jvms->bci(), reason) ) { // Generate uncommon trap for class check failure path // in case of monomorphic or bimorphic virtual call site. - miss_cg = CallGenerator::for_uncommon_trap(call_method, - Deoptimization::Reason_class_check, + miss_cg = CallGenerator::for_uncommon_trap(call_method, reason, Deoptimization::Action_maybe_recompile); } else { // Generate virtual call for class check failure path @@ -218,6 +216,57 @@ CallGenerator* Compile::call_generator(ciMethod* call_method, int vtable_index, } } + // Do MethodHandle calls. + if (call_method->is_method_handle_invoke()) { + if (jvms->method()->java_code_at_bci(jvms->bci()) != Bytecodes::_invokedynamic) { + GraphKit kit(jvms); + Node* n = kit.argument(0); + + if (n->Opcode() == Op_ConP) { + const TypeOopPtr* oop_ptr = n->bottom_type()->is_oopptr(); + ciObject* const_oop = oop_ptr->const_oop(); + ciMethodHandle* method_handle = const_oop->as_method_handle(); + + // Set the actually called method to have access to the class + // and signature in the MethodHandleCompiler. + method_handle->set_callee(call_method); + + // Get an adapter for the MethodHandle. + ciMethod* target_method = method_handle->get_method_handle_adapter(); + + CallGenerator* hit_cg = this->call_generator(target_method, vtable_index, false, jvms, true, prof_factor); + if (hit_cg != NULL && hit_cg->is_inline()) + return hit_cg; + } + + return CallGenerator::for_direct_call(call_method); + } + else { + // Get the MethodHandle from the CallSite. + ciMethod* caller_method = jvms->method(); + ciBytecodeStream str(caller_method); + str.force_bci(jvms->bci()); // Set the stream to the invokedynamic bci. + ciCallSite* call_site = str.get_call_site(); + ciMethodHandle* method_handle = call_site->get_target(); + + // Set the actually called method to have access to the class + // and signature in the MethodHandleCompiler. + method_handle->set_callee(call_method); + + // Get an adapter for the MethodHandle. + ciMethod* target_method = method_handle->get_invokedynamic_adapter(); + + CallGenerator* hit_cg = this->call_generator(target_method, vtable_index, false, jvms, true, prof_factor); + if (hit_cg != NULL && hit_cg->is_inline()) { + CallGenerator* miss_cg = CallGenerator::for_dynamic_call(call_method); + return CallGenerator::for_predicted_dynamic_call(method_handle, miss_cg, hit_cg, prof_factor); + } + + // If something failed, generate a normal dynamic call. + return CallGenerator::for_dynamic_call(call_method); + } + } + // There was no special inlining tactic, or it bailed out. // Use a more generic tactic, like a simple call. if (call_is_virtual) { @@ -225,10 +274,63 @@ CallGenerator* Compile::call_generator(ciMethod* call_method, int vtable_index, } else { // Class Hierarchy Analysis or Type Profile reveals a unique target, // or it is a static or special call. - return CallGenerator::for_direct_call(call_method); + return CallGenerator::for_direct_call(call_method, should_delay_inlining(call_method, jvms)); } } +// Return true for methods that shouldn't be inlined early so that +// they are easier to analyze and optimize as intrinsics. +bool Compile::should_delay_inlining(ciMethod* call_method, JVMState* jvms) { + if (has_stringbuilder()) { + + if ((call_method->holder() == C->env()->StringBuilder_klass() || + call_method->holder() == C->env()->StringBuffer_klass()) && + (jvms->method()->holder() == C->env()->StringBuilder_klass() || + jvms->method()->holder() == C->env()->StringBuffer_klass())) { + // Delay SB calls only when called from non-SB code + return false; + } + + switch (call_method->intrinsic_id()) { + case vmIntrinsics::_StringBuilder_void: + case vmIntrinsics::_StringBuilder_int: + case vmIntrinsics::_StringBuilder_String: + case vmIntrinsics::_StringBuilder_append_char: + case vmIntrinsics::_StringBuilder_append_int: + case vmIntrinsics::_StringBuilder_append_String: + case vmIntrinsics::_StringBuilder_toString: + case vmIntrinsics::_StringBuffer_void: + case vmIntrinsics::_StringBuffer_int: + case vmIntrinsics::_StringBuffer_String: + case vmIntrinsics::_StringBuffer_append_char: + case vmIntrinsics::_StringBuffer_append_int: + case vmIntrinsics::_StringBuffer_append_String: + case vmIntrinsics::_StringBuffer_toString: + case vmIntrinsics::_Integer_toString: + return true; + + case vmIntrinsics::_String_String: + { + Node* receiver = jvms->map()->in(jvms->argoff() + 1); + if (receiver->is_Proj() && receiver->in(0)->is_CallStaticJava()) { + CallStaticJavaNode* csj = receiver->in(0)->as_CallStaticJava(); + ciMethod* m = csj->method(); + if (m != NULL && + (m->intrinsic_id() == vmIntrinsics::_StringBuffer_toString || + m->intrinsic_id() == vmIntrinsics::_StringBuilder_toString)) + // Delay String.(new SB()) + return true; + } + return false; + } + + default: + return false; + } + } + return false; +} + // uncommon-trap call-sites where callee is unloaded, uninitialized or will not link bool Parse::can_not_compile_call_site(ciMethod *dest_method, ciInstanceKlass* klass) { @@ -240,7 +342,7 @@ bool Parse::can_not_compile_call_site(ciMethod *dest_method, ciInstanceKlass* kl // Interface classes can be loaded & linked and never get around to // being initialized. Uncommon-trap for not-initialized static or // v-calls. Let interface calls happen. - ciInstanceKlass* holder_klass = dest_method->holder(); + ciInstanceKlass* holder_klass = dest_method->holder(); if (!holder_klass->is_initialized() && !holder_klass->is_interface()) { uncommon_trap(Deoptimization::Reason_uninitialized, @@ -248,14 +350,6 @@ bool Parse::can_not_compile_call_site(ciMethod *dest_method, ciInstanceKlass* kl holder_klass); return true; } - if (dest_method->is_method_handle_invoke() - && holder_klass->name() == ciSymbol::java_dyn_Dynamic()) { - // FIXME: NYI - uncommon_trap(Deoptimization::Reason_unhandled, - Deoptimization::Action_none, - holder_klass); - return true; - } assert(dest_method->will_link(method()->holder(), klass, bc()), "dest_method: typeflow responsibility"); return false; @@ -274,6 +368,7 @@ void Parse::do_call() { bool is_virtual = bc() == Bytecodes::_invokevirtual; bool is_virtual_or_interface = is_virtual || bc() == Bytecodes::_invokeinterface; bool has_receiver = is_virtual_or_interface || bc() == Bytecodes::_invokespecial; + bool is_invokedynamic = bc() == Bytecodes::_invokedynamic; // Find target being called bool will_link; @@ -282,7 +377,8 @@ void Parse::do_call() { ciKlass* holder = iter().get_declared_method_holder(); ciInstanceKlass* klass = ciEnv::get_instance_klass_for_declared_method_holder(holder); - int nargs = dest_method->arg_size(); + int nargs = dest_method->arg_size(); + if (is_invokedynamic) nargs -= 1; // uncommon-trap when callee is unloaded, uninitialized or will not link // bailout when too many arguments for register representation @@ -296,7 +392,7 @@ void Parse::do_call() { return; } assert(holder_klass->is_loaded(), ""); - assert(dest_method->is_static() == !has_receiver, "must match bc"); + assert((dest_method->is_static() || is_invokedynamic) == !has_receiver , "must match bc"); // Note: this takes into account invokeinterface of methods declared in java/lang/Object, // which should be invokevirtuals but according to the VM spec may be invokeinterfaces assert(holder_klass->is_interface() || holder_klass->super() == NULL || (bc() != Bytecodes::_invokeinterface), "must match bc"); diff --git a/hotspot/src/share/vm/opto/escape.cpp b/hotspot/src/share/vm/opto/escape.cpp index b22f4814a57..111443cd1ae 100644 --- a/hotspot/src/share/vm/opto/escape.cpp +++ b/hotspot/src/share/vm/opto/escape.cpp @@ -537,11 +537,13 @@ bool ConnectionGraph::split_AddP(Node *addp, Node *base, PhaseGVN *igvn) { } const TypeOopPtr *tinst = base_t->add_offset(t->offset())->is_oopptr(); - // Do NOT remove the next call: ensure an new alias index is allocated - // for the instance type + // Do NOT remove the next line: ensure a new alias index is allocated + // for the instance type. Note: C++ will not remove it since the call + // has side effect. int alias_idx = _compile->get_alias_index(tinst); igvn->set_type(addp, tinst); // record the allocation in the node map + assert(ptnode_adr(addp->_idx)->_node != NULL, "should be registered"); set_map(addp->_idx, get_map(base->_idx)); // Set addp's Base and Address to 'base'. @@ -617,9 +619,14 @@ PhiNode *ConnectionGraph::create_split_phi(PhiNode *orig_phi, int alias_idx, Gro const TypePtr *atype = C->get_adr_type(alias_idx); result = PhiNode::make(orig_phi->in(0), NULL, Type::MEMORY, atype); C->copy_node_notes_to(result, orig_phi); - set_map_phi(orig_phi->_idx, result); igvn->set_type(result, result->bottom_type()); record_for_optimizer(result); + + debug_only(Node* pn = ptnode_adr(orig_phi->_idx)->_node;) + assert(pn == NULL || pn == orig_phi, "wrong node"); + set_map(orig_phi->_idx, result); + ptnode_adr(orig_phi->_idx)->_node = orig_phi; + new_created = true; return result; } @@ -709,6 +716,81 @@ static Node *step_through_mergemem(MergeMemNode *mmem, int alias_idx, const Type return mem; } +// +// Move memory users to their memory slices. +// +void ConnectionGraph::move_inst_mem(Node* n, GrowableArray &orig_phis, PhaseGVN *igvn) { + Compile* C = _compile; + + const TypePtr* tp = igvn->type(n->in(MemNode::Address))->isa_ptr(); + assert(tp != NULL, "ptr type"); + int alias_idx = C->get_alias_index(tp); + int general_idx = C->get_general_index(alias_idx); + + // Move users first + for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) { + Node* use = n->fast_out(i); + if (use->is_MergeMem()) { + MergeMemNode* mmem = use->as_MergeMem(); + assert(n == mmem->memory_at(alias_idx), "should be on instance memory slice"); + if (n != mmem->memory_at(general_idx) || alias_idx == general_idx) { + continue; // Nothing to do + } + // Replace previous general reference to mem node. + uint orig_uniq = C->unique(); + Node* m = find_inst_mem(n, general_idx, orig_phis, igvn); + assert(orig_uniq == C->unique(), "no new nodes"); + mmem->set_memory_at(general_idx, m); + --imax; + --i; + } else if (use->is_MemBar()) { + assert(!use->is_Initialize(), "initializing stores should not be moved"); + if (use->req() > MemBarNode::Precedent && + use->in(MemBarNode::Precedent) == n) { + // Don't move related membars. + record_for_optimizer(use); + continue; + } + tp = use->as_MemBar()->adr_type()->isa_ptr(); + if (tp != NULL && C->get_alias_index(tp) == alias_idx || + alias_idx == general_idx) { + continue; // Nothing to do + } + // Move to general memory slice. + uint orig_uniq = C->unique(); + Node* m = find_inst_mem(n, general_idx, orig_phis, igvn); + assert(orig_uniq == C->unique(), "no new nodes"); + igvn->hash_delete(use); + imax -= use->replace_edge(n, m); + igvn->hash_insert(use); + record_for_optimizer(use); + --i; +#ifdef ASSERT + } else if (use->is_Mem()) { + if (use->Opcode() == Op_StoreCM && use->in(MemNode::OopStore) == n) { + // Don't move related cardmark. + continue; + } + // Memory nodes should have new memory input. + tp = igvn->type(use->in(MemNode::Address))->isa_ptr(); + assert(tp != NULL, "ptr type"); + int idx = C->get_alias_index(tp); + assert(get_map(use->_idx) != NULL || idx == alias_idx, + "Following memory nodes should have new memory input or be on the same memory slice"); + } else if (use->is_Phi()) { + // Phi nodes should be split and moved already. + tp = use->as_Phi()->adr_type()->isa_ptr(); + assert(tp != NULL, "ptr type"); + int idx = C->get_alias_index(tp); + assert(idx == alias_idx, "Following Phi nodes should be on the same memory slice"); + } else { + use->dump(); + assert(false, "should not be here"); +#endif + } + } +} + // // Search memory chain of "mem" to find a MemNode whose address // is the specified alias index. @@ -774,10 +856,18 @@ Node* ConnectionGraph::find_inst_mem(Node *orig_mem, int alias_idx, GrowableArra C->get_alias_index(result->as_Phi()->adr_type()) != alias_idx) { Node *un = result->as_Phi()->unique_input(phase); if (un != NULL) { + orig_phis.append_if_missing(result->as_Phi()); result = un; } else { break; } + } else if (result->is_ClearArray()) { + if (!ClearArrayNode::step_through(&result, (uint)tinst->instance_id(), phase)) { + // Can not bypass initialization of the instance + // we are looking for. + break; + } + // Otherwise skip it (the call updated 'result' value). } else if (result->Opcode() == Op_SCMemProj) { assert(result->in(0)->is_LoadStore(), "sanity"); const Type *at = phase->type(result->in(0)->in(MemNode::Address)); @@ -807,7 +897,6 @@ Node* ConnectionGraph::find_inst_mem(Node *orig_mem, int alias_idx, GrowableArra return result; } - // // Convert the types of unescaped object to instance types where possible, // propagate the new type information through the graph, and update memory @@ -899,12 +988,13 @@ Node* ConnectionGraph::find_inst_mem(Node *orig_mem, int alias_idx, GrowableArra // void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) { GrowableArray memnode_worklist; - GrowableArray mergemem_worklist; GrowableArray orig_phis; + PhaseGVN *igvn = _compile->initial_gvn(); uint new_index_start = (uint) _compile->num_alias_types(); - VectorSet visited(Thread::current()->resource_area()); - VectorSet ptset(Thread::current()->resource_area()); + Arena* arena = Thread::current()->resource_area(); + VectorSet visited(arena); + VectorSet ptset(arena); // Phase 1: Process possible allocations from alloc_worklist. @@ -980,6 +1070,8 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) // - non-escaping // - eligible to be a unique type // - not determined to be ineligible by escape analysis + assert(ptnode_adr(alloc->_idx)->_node != NULL && + ptnode_adr(n->_idx)->_node != NULL, "should be registered"); set_map(alloc->_idx, n); set_map(n->_idx, alloc); const TypeOopPtr *t = igvn->type(n)->isa_oopptr(); @@ -1024,7 +1116,7 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) alloc_worklist.append_if_missing(addp2); } alloc_worklist.append_if_missing(use); - } else if (use->is_Initialize()) { + } else if (use->is_MemBar()) { memnode_worklist.append_if_missing(use); } } @@ -1034,10 +1126,12 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) PointsTo(ptset, get_addp_base(n), igvn); assert(ptset.Size() == 1, "AddP address is unique"); uint elem = ptset.getelem(); // Allocation node's index - if (elem == _phantom_object) + if (elem == _phantom_object) { + assert(false, "escaped allocation"); continue; // Assume the value was set outside this method. + } Node *base = get_map(elem); // CheckCastPP node - if (!split_AddP(n, base, igvn)) continue; // wrong type + if (!split_AddP(n, base, igvn)) continue; // wrong type from dead path tinst = igvn->type(base)->isa_oopptr(); } else if (n->is_Phi() || n->is_CheckCastPP() || @@ -1052,8 +1146,10 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) PointsTo(ptset, n, igvn); if (ptset.Size() == 1) { uint elem = ptset.getelem(); // Allocation node's index - if (elem == _phantom_object) + if (elem == _phantom_object) { + assert(false, "escaped allocation"); continue; // Assume the value was set outside this method. + } Node *val = get_map(elem); // CheckCastPP node TypeNode *tn = n->as_Type(); tinst = igvn->type(val)->isa_oopptr(); @@ -1068,8 +1164,7 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) tn_t = tn_type->isa_oopptr(); } - if (tn_t != NULL && - tinst->cast_to_instance_id(TypeOopPtr::InstanceBot)->higher_equal(tn_t)) { + if (tn_t != NULL && tinst->klass()->is_subtype_of(tn_t->klass())) { if (tn_type->isa_narrowoop()) { tn_type = tinst->make_narrowoop(); } else { @@ -1081,33 +1176,25 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) igvn->hash_insert(tn); record_for_optimizer(n); } else { - continue; // wrong type + assert(tn_type == TypePtr::NULL_PTR || + tn_t != NULL && !tinst->klass()->is_subtype_of(tn_t->klass()), + "unexpected type"); + continue; // Skip dead path with different type } } } else { + debug_only(n->dump();) + assert(false, "EA: unexpected node"); continue; } - // push users on appropriate worklist + // push allocation's users on appropriate worklist for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) { Node *use = n->fast_out(i); if(use->is_Mem() && use->in(MemNode::Address) == n) { + // Load/store to instance's field memnode_worklist.append_if_missing(use); - } else if (use->is_Initialize()) { + } else if (use->is_MemBar()) { memnode_worklist.append_if_missing(use); - } else if (use->is_MergeMem()) { - mergemem_worklist.append_if_missing(use); - } else if (use->is_SafePoint() && tinst != NULL) { - // Look for MergeMem nodes for calls which reference unique allocation - // (through CheckCastPP nodes) even for debug info. - Node* m = use->in(TypeFunc::Memory); - uint iid = tinst->instance_id(); - while (m->is_Proj() && m->in(0)->is_SafePoint() && - m->in(0) != use && !m->in(0)->_idx != iid) { - m = m->in(0)->in(TypeFunc::Memory); - } - if (m->is_MergeMem()) { - mergemem_worklist.append_if_missing(m); - } } else if (use->is_AddP() && use->outcnt() > 0) { // No dead nodes Node* addp2 = find_second_addp(use, n); if (addp2 != NULL) { @@ -1120,6 +1207,29 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) use->is_DecodeN() || (use->is_ConstraintCast() && use->Opcode() == Op_CastPP)) { alloc_worklist.append_if_missing(use); +#ifdef ASSERT + } else if (use->is_Mem()) { + assert(use->in(MemNode::Address) != n, "EA: missing allocation reference path"); + } else if (use->is_MergeMem()) { + assert(_mergemem_worklist.contains(use->as_MergeMem()), "EA: missing MergeMem node in the worklist"); + } else if (use->is_SafePoint()) { + // Look for MergeMem nodes for calls which reference unique allocation + // (through CheckCastPP nodes) even for debug info. + Node* m = use->in(TypeFunc::Memory); + if (m->is_MergeMem()) { + assert(_mergemem_worklist.contains(m->as_MergeMem()), "EA: missing MergeMem node in the worklist"); + } + } else { + uint op = use->Opcode(); + if (!(op == Op_CmpP || op == Op_Conv2B || + op == Op_CastP2X || op == Op_StoreCM || + op == Op_FastLock || op == Op_AryEq || op == Op_StrComp || + op == Op_StrEquals || op == Op_StrIndexOf)) { + n->dump(); + use->dump(); + assert(false, "EA: missing allocation reference path"); + } +#endif } } @@ -1137,19 +1247,16 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) Node *n = memnode_worklist.pop(); if (visited.test_set(n->_idx)) continue; - if (n->is_Phi()) { - assert(n->as_Phi()->adr_type() != TypePtr::BOTTOM, "narrow memory slice required"); - // we don't need to do anything, but the users must be pushed if we haven't processed - // this Phi before - } else if (n->is_Initialize()) { - // we don't need to do anything, but the users of the memory projection must be pushed - n = n->as_Initialize()->proj_out(TypeFunc::Memory); + if (n->is_Phi() || n->is_ClearArray()) { + // we don't need to do anything, but the users must be pushed + } else if (n->is_MemBar()) { // Initialize, MemBar nodes + // we don't need to do anything, but the users must be pushed + n = n->as_MemBar()->proj_out(TypeFunc::Memory); if (n == NULL) continue; } else { assert(n->is_Mem(), "memory node required."); Node *addr = n->in(MemNode::Address); - assert(addr->is_AddP(), "AddP required"); const Type *addr_t = igvn->type(addr); if (addr_t == Type::TOP) continue; @@ -1161,6 +1268,10 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) return; } if (mem != n->in(MemNode::Memory)) { + // We delay the memory edge update since we need old one in + // MergeMem code below when instances memory slices are separated. + debug_only(Node* pn = ptnode_adr(n->_idx)->_node;) + assert(pn == NULL || pn == n, "wrong node"); set_map(n->_idx, mem); ptnode_adr(n->_idx)->_node = n; } @@ -1181,36 +1292,55 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) // push user on appropriate worklist for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) { Node *use = n->fast_out(i); - if (use->is_Phi()) { + if (use->is_Phi() || use->is_ClearArray()) { memnode_worklist.append_if_missing(use); } else if(use->is_Mem() && use->in(MemNode::Memory) == n) { + if (use->Opcode() == Op_StoreCM) // Ignore cardmark stores + continue; memnode_worklist.append_if_missing(use); - } else if (use->is_Initialize()) { + } else if (use->is_MemBar()) { memnode_worklist.append_if_missing(use); +#ifdef ASSERT + } else if(use->is_Mem()) { + assert(use->in(MemNode::Memory) != n, "EA: missing memory path"); } else if (use->is_MergeMem()) { - mergemem_worklist.append_if_missing(use); + assert(_mergemem_worklist.contains(use->as_MergeMem()), "EA: missing MergeMem node in the worklist"); + } else { + uint op = use->Opcode(); + if (!(op == Op_StoreCM || + (op == Op_CallLeaf && use->as_CallLeaf()->_name != NULL && + strcmp(use->as_CallLeaf()->_name, "g1_wb_pre") == 0) || + op == Op_AryEq || op == Op_StrComp || + op == Op_StrEquals || op == Op_StrIndexOf)) { + n->dump(); + use->dump(); + assert(false, "EA: missing memory path"); + } +#endif } } } // Phase 3: Process MergeMem nodes from mergemem_worklist. - // Walk each memory moving the first node encountered of each + // Walk each memory slice moving the first node encountered of each // instance type to the the input corresponding to its alias index. - while (mergemem_worklist.length() != 0) { - Node *n = mergemem_worklist.pop(); - assert(n->is_MergeMem(), "MergeMem node required."); - if (visited.test_set(n->_idx)) - continue; - MergeMemNode *nmm = n->as_MergeMem(); + uint length = _mergemem_worklist.length(); + for( uint next = 0; next < length; ++next ) { + MergeMemNode* nmm = _mergemem_worklist.at(next); + assert(!visited.test_set(nmm->_idx), "should not be visited before"); // Note: we don't want to use MergeMemStream here because we only want to - // scan inputs which exist at the start, not ones we add during processing. - uint nslices = nmm->req(); + // scan inputs which exist at the start, not ones we add during processing. + // Note 2: MergeMem may already contains instance memory slices added + // during find_inst_mem() call when memory nodes were processed above. igvn->hash_delete(nmm); + uint nslices = nmm->req(); for (uint i = Compile::AliasIdxRaw+1; i < nslices; i++) { Node* mem = nmm->in(i); Node* cur = NULL; if (mem == NULL || mem->is_top()) continue; + // First, update mergemem by moving memory nodes to corresponding slices + // if their type became more precise since this mergemem was created. while (mem->is_Mem()) { const Type *at = igvn->type(mem->in(MemNode::Address)); if (at != Type::TOP) { @@ -1229,7 +1359,7 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) } nmm->set_memory_at(i, (cur != NULL) ? cur : mem); // Find any instance of the current type if we haven't encountered - // a value of the instance along the chain. + // already a memory slice of the instance along the memory chain. for (uint ni = new_index_start; ni < new_index_end; ni++) { if((uint)_compile->get_general_index(ni) == i) { Node *m = (ni >= nmm->req()) ? nmm->empty_memory() : nmm->in(ni); @@ -1245,11 +1375,11 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) } // Find the rest of instances values for (uint ni = new_index_start; ni < new_index_end; ni++) { - const TypeOopPtr *tinst = igvn->C->get_adr_type(ni)->isa_oopptr(); + const TypeOopPtr *tinst = _compile->get_adr_type(ni)->isa_oopptr(); Node* result = step_through_mergemem(nmm, ni, tinst); if (result == nmm->base_memory()) { // Didn't find instance memory, search through general slice recursively. - result = nmm->memory_at(igvn->C->get_general_index(ni)); + result = nmm->memory_at(_compile->get_general_index(ni)); result = find_inst_mem(result, ni, orig_phis, igvn); if (_compile->failing()) { return; @@ -1259,41 +1389,6 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) } igvn->hash_insert(nmm); record_for_optimizer(nmm); - - // Propagate new memory slices to following MergeMem nodes. - for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) { - Node *use = n->fast_out(i); - if (use->is_Call()) { - CallNode* in = use->as_Call(); - if (in->proj_out(TypeFunc::Memory) != NULL) { - Node* m = in->proj_out(TypeFunc::Memory); - for (DUIterator_Fast jmax, j = m->fast_outs(jmax); j < jmax; j++) { - Node* mm = m->fast_out(j); - if (mm->is_MergeMem()) { - mergemem_worklist.append_if_missing(mm); - } - } - } - if (use->is_Allocate()) { - use = use->as_Allocate()->initialization(); - if (use == NULL) { - continue; - } - } - } - if (use->is_Initialize()) { - InitializeNode* in = use->as_Initialize(); - if (in->proj_out(TypeFunc::Memory) != NULL) { - Node* m = in->proj_out(TypeFunc::Memory); - for (DUIterator_Fast jmax, j = m->fast_outs(jmax); j < jmax; j++) { - Node* mm = m->fast_out(j); - if (mm->is_MergeMem()) { - mergemem_worklist.append_if_missing(mm); - } - } - } - } - } } // Phase 4: Update the inputs of non-instance memory Phis and @@ -1322,19 +1417,48 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) } // Update the memory inputs of MemNodes with the value we computed - // in Phase 2. + // in Phase 2 and move stores memory users to corresponding memory slices. +#ifdef ASSERT + visited.Clear(); + Node_Stack old_mems(arena, _compile->unique() >> 2); +#endif for (uint i = 0; i < nodes_size(); i++) { Node *nmem = get_map(i); if (nmem != NULL) { Node *n = ptnode_adr(i)->_node; - if (n != NULL && n->is_Mem()) { + assert(n != NULL, "sanity"); + if (n->is_Mem()) { +#ifdef ASSERT + Node* old_mem = n->in(MemNode::Memory); + if (!visited.test_set(old_mem->_idx)) { + old_mems.push(old_mem, old_mem->outcnt()); + } +#endif + assert(n->in(MemNode::Memory) != nmem, "sanity"); + if (!n->is_Load()) { + // Move memory users of a store first. + move_inst_mem(n, orig_phis, igvn); + } + // Now update memory input igvn->hash_delete(n); n->set_req(MemNode::Memory, nmem); igvn->hash_insert(n); record_for_optimizer(n); + } else { + assert(n->is_Allocate() || n->is_CheckCastPP() || + n->is_AddP() || n->is_Phi(), "unknown node used for set_map()"); } } } +#ifdef ASSERT + // Verify that memory was split correctly + while (old_mems.is_nonempty()) { + Node* old_mem = old_mems.node(); + uint old_cnt = old_mems.index(); + old_mems.pop(); + assert(old_cnt = old_mem->outcnt(), "old mem could be lost"); + } +#endif } bool ConnectionGraph::has_candidates(Compile *C) { @@ -1381,8 +1505,20 @@ bool ConnectionGraph::compute_escape() { ptnode_adr(n->_idx)->node_type() == PointsToNode::JavaObject) { has_allocations = true; } - if(n->is_AddP()) - cg_worklist.append(n->_idx); + if(n->is_AddP()) { + // Collect address nodes which directly reference an allocation. + // Use them during stage 3 below to build initial connection graph + // field edges. Other field edges could be added after StoreP/LoadP + // nodes are processed during stage 4 below. + Node* base = get_addp_base(n); + if(base->is_Proj() && base->in(0)->is_Allocate()) { + cg_worklist.append(n->_idx); + } + } else if (n->is_MergeMem()) { + // Collect all MergeMem nodes to add memory slices for + // scalar replaceable objects in split_unique_types(). + _mergemem_worklist.append(n->as_MergeMem()); + } for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) { Node* m = n->fast_out(i); // Get user worklist_init.push(m); @@ -1423,12 +1559,13 @@ bool ConnectionGraph::compute_escape() { } } - VectorSet ptset(Thread::current()->resource_area()); + Arena* arena = Thread::current()->resource_area(); + VectorSet ptset(arena); GrowableArray deferred_edges; - VectorSet visited(Thread::current()->resource_area()); + VectorSet visited(arena); - // 5. Remove deferred edges from the graph and collect - // information needed for type splitting. + // 5. Remove deferred edges from the graph and adjust + // escape state of nonescaping objects. cg_length = cg_worklist.length(); for( uint next = 0; next < cg_length; ++next ) { int ni = cg_worklist.at(next); @@ -1438,98 +1575,9 @@ bool ConnectionGraph::compute_escape() { remove_deferred(ni, &deferred_edges, &visited); Node *n = ptn->_node; if (n->is_AddP()) { - // Search for objects which are not scalar replaceable. - // Mark their escape state as ArgEscape to propagate the state - // to referenced objects. - // Note: currently there are no difference in compiler optimizations - // for ArgEscape objects and NoEscape objects which are not - // scalar replaceable. - - int offset = ptn->offset(); - Node *base = get_addp_base(n); - ptset.Clear(); - PointsTo(ptset, base, igvn); - int ptset_size = ptset.Size(); - - // Check if a field's initializing value is recorded and add - // a corresponding NULL field's value if it is not recorded. - // Connection Graph does not record a default initialization by NULL - // captured by Initialize node. - // - // Note: it will disable scalar replacement in some cases: - // - // Point p[] = new Point[1]; - // p[0] = new Point(); // Will be not scalar replaced - // - // but it will save us from incorrect optimizations in next cases: - // - // Point p[] = new Point[1]; - // if ( x ) p[0] = new Point(); // Will be not scalar replaced - // - // Without a control flow analysis we can't distinguish above cases. - // - if (offset != Type::OffsetBot && ptset_size == 1) { - uint elem = ptset.getelem(); // Allocation node's index - // It does not matter if it is not Allocation node since - // only non-escaping allocations are scalar replaced. - if (ptnode_adr(elem)->_node->is_Allocate() && - ptnode_adr(elem)->escape_state() == PointsToNode::NoEscape) { - AllocateNode* alloc = ptnode_adr(elem)->_node->as_Allocate(); - InitializeNode* ini = alloc->initialization(); - Node* value = NULL; - if (ini != NULL) { - BasicType ft = UseCompressedOops ? T_NARROWOOP : T_OBJECT; - Node* store = ini->find_captured_store(offset, type2aelembytes(ft), igvn); - if (store != NULL && store->is_Store()) - value = store->in(MemNode::ValueIn); - } - if (value == NULL || value != ptnode_adr(value->_idx)->_node) { - // A field's initializing value was not recorded. Add NULL. - uint null_idx = UseCompressedOops ? _noop_null : _oop_null; - add_pointsto_edge(ni, null_idx); - } - } - } - - // An object is not scalar replaceable if the field which may point - // to it has unknown offset (unknown element of an array of objects). - // - if (offset == Type::OffsetBot) { - uint e_cnt = ptn->edge_count(); - for (uint ei = 0; ei < e_cnt; ei++) { - uint npi = ptn->edge_target(ei); - set_escape_state(npi, PointsToNode::ArgEscape); - ptnode_adr(npi)->_scalar_replaceable = false; - } - } - - // Currently an object is not scalar replaceable if a LoadStore node - // access its field since the field value is unknown after it. - // - bool has_LoadStore = false; - for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) { - Node *use = n->fast_out(i); - if (use->is_LoadStore()) { - has_LoadStore = true; - break; - } - } - // An object is not scalar replaceable if the address points - // to unknown field (unknown element for arrays, offset is OffsetBot). - // - // Or the address may point to more then one object. This may produce - // the false positive result (set scalar_replaceable to false) - // since the flow-insensitive escape analysis can't separate - // the case when stores overwrite the field's value from the case - // when stores happened on different control branches. - // - if (ptset_size > 1 || ptset_size != 0 && - (has_LoadStore || offset == Type::OffsetBot)) { - for( VectorSetI j(&ptset); j.test(); ++j ) { - set_escape_state(j.elem, PointsToNode::ArgEscape); - ptnode_adr(j.elem)->_scalar_replaceable = false; - } - } + // Search for objects which are not scalar replaceable + // and adjust their escape state. + verify_escape_state(ni, ptset, igvn); } } } @@ -1646,6 +1694,150 @@ bool ConnectionGraph::compute_escape() { return has_non_escaping_obj; } +// Search for objects which are not scalar replaceable. +void ConnectionGraph::verify_escape_state(int nidx, VectorSet& ptset, PhaseTransform* phase) { + PointsToNode* ptn = ptnode_adr(nidx); + Node* n = ptn->_node; + assert(n->is_AddP(), "Should be called for AddP nodes only"); + // Search for objects which are not scalar replaceable. + // Mark their escape state as ArgEscape to propagate the state + // to referenced objects. + // Note: currently there are no difference in compiler optimizations + // for ArgEscape objects and NoEscape objects which are not + // scalar replaceable. + + Compile* C = _compile; + + int offset = ptn->offset(); + Node* base = get_addp_base(n); + ptset.Clear(); + PointsTo(ptset, base, phase); + int ptset_size = ptset.Size(); + + // Check if a oop field's initializing value is recorded and add + // a corresponding NULL field's value if it is not recorded. + // Connection Graph does not record a default initialization by NULL + // captured by Initialize node. + // + // Note: it will disable scalar replacement in some cases: + // + // Point p[] = new Point[1]; + // p[0] = new Point(); // Will be not scalar replaced + // + // but it will save us from incorrect optimizations in next cases: + // + // Point p[] = new Point[1]; + // if ( x ) p[0] = new Point(); // Will be not scalar replaced + // + // Do a simple control flow analysis to distinguish above cases. + // + if (offset != Type::OffsetBot && ptset_size == 1) { + uint elem = ptset.getelem(); // Allocation node's index + // It does not matter if it is not Allocation node since + // only non-escaping allocations are scalar replaced. + if (ptnode_adr(elem)->_node->is_Allocate() && + ptnode_adr(elem)->escape_state() == PointsToNode::NoEscape) { + AllocateNode* alloc = ptnode_adr(elem)->_node->as_Allocate(); + InitializeNode* ini = alloc->initialization(); + + // Check only oop fields. + const Type* adr_type = n->as_AddP()->bottom_type(); + BasicType basic_field_type = T_INT; + if (adr_type->isa_instptr()) { + ciField* field = C->alias_type(adr_type->isa_instptr())->field(); + if (field != NULL) { + basic_field_type = field->layout_type(); + } else { + // Ignore non field load (for example, klass load) + } + } else if (adr_type->isa_aryptr()) { + const Type* elemtype = adr_type->isa_aryptr()->elem(); + basic_field_type = elemtype->array_element_basic_type(); + } else { + // Raw pointers are used for initializing stores so skip it. + assert(adr_type->isa_rawptr() && base->is_Proj() && + (base->in(0) == alloc),"unexpected pointer type"); + } + if (basic_field_type == T_OBJECT || + basic_field_type == T_NARROWOOP || + basic_field_type == T_ARRAY) { + Node* value = NULL; + if (ini != NULL) { + BasicType ft = UseCompressedOops ? T_NARROWOOP : T_OBJECT; + Node* store = ini->find_captured_store(offset, type2aelembytes(ft), phase); + if (store != NULL && store->is_Store()) { + value = store->in(MemNode::ValueIn); + } else if (ptn->edge_count() > 0) { // Are there oop stores? + // Check for a store which follows allocation without branches. + // For example, a volatile field store is not collected + // by Initialize node. TODO: it would be nice to use idom() here. + for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) { + store = n->fast_out(i); + if (store->is_Store() && store->in(0) != NULL) { + Node* ctrl = store->in(0); + while(!(ctrl == ini || ctrl == alloc || ctrl == NULL || + ctrl == C->root() || ctrl == C->top() || ctrl->is_Region() || + ctrl->is_IfTrue() || ctrl->is_IfFalse())) { + ctrl = ctrl->in(0); + } + if (ctrl == ini || ctrl == alloc) { + value = store->in(MemNode::ValueIn); + break; + } + } + } + } + } + if (value == NULL || value != ptnode_adr(value->_idx)->_node) { + // A field's initializing value was not recorded. Add NULL. + uint null_idx = UseCompressedOops ? _noop_null : _oop_null; + add_pointsto_edge(nidx, null_idx); + } + } + } + } + + // An object is not scalar replaceable if the field which may point + // to it has unknown offset (unknown element of an array of objects). + // + if (offset == Type::OffsetBot) { + uint e_cnt = ptn->edge_count(); + for (uint ei = 0; ei < e_cnt; ei++) { + uint npi = ptn->edge_target(ei); + set_escape_state(npi, PointsToNode::ArgEscape); + ptnode_adr(npi)->_scalar_replaceable = false; + } + } + + // Currently an object is not scalar replaceable if a LoadStore node + // access its field since the field value is unknown after it. + // + bool has_LoadStore = false; + for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) { + Node *use = n->fast_out(i); + if (use->is_LoadStore()) { + has_LoadStore = true; + break; + } + } + // An object is not scalar replaceable if the address points + // to unknown field (unknown element for arrays, offset is OffsetBot). + // + // Or the address may point to more then one object. This may produce + // the false positive result (set scalar_replaceable to false) + // since the flow-insensitive escape analysis can't separate + // the case when stores overwrite the field's value from the case + // when stores happened on different control branches. + // + if (ptset_size > 1 || ptset_size != 0 && + (has_LoadStore || offset == Type::OffsetBot)) { + for( VectorSetI j(&ptset); j.test(); ++j ) { + set_escape_state(j.elem, PointsToNode::ArgEscape); + ptnode_adr(j.elem)->_scalar_replaceable = false; + } + } +} + void ConnectionGraph::process_call_arguments(CallNode *call, PhaseTransform *phase) { switch (call->Opcode()) { @@ -1657,6 +1849,7 @@ void ConnectionGraph::process_call_arguments(CallNode *call, PhaseTransform *pha assert(false, "should be done already"); break; #endif + case Op_CallLeaf: case Op_CallLeafNoFP: { // Stub calls, objects do not escape but they are not scale replaceable. @@ -1667,9 +1860,23 @@ void ConnectionGraph::process_call_arguments(CallNode *call, PhaseTransform *pha const Type* at = d->field_at(i); Node *arg = call->in(i)->uncast(); const Type *aat = phase->type(arg); - if (!arg->is_top() && at->isa_ptr() && aat->isa_ptr()) { + if (!arg->is_top() && at->isa_ptr() && aat->isa_ptr() && + ptnode_adr(arg->_idx)->escape_state() < PointsToNode::ArgEscape) { + assert(aat == Type::TOP || aat == TypePtr::NULL_PTR || aat->isa_ptr() != NULL, "expecting an Ptr"); +#ifdef ASSERT + if (!(call->Opcode() == Op_CallLeafNoFP && + call->as_CallLeaf()->_name != NULL && + (strstr(call->as_CallLeaf()->_name, "arraycopy") != 0) || + call->as_CallLeaf()->_name != NULL && + (strcmp(call->as_CallLeaf()->_name, "g1_wb_pre") == 0 || + strcmp(call->as_CallLeaf()->_name, "g1_wb_post") == 0 )) + ) { + call->dump(); + assert(false, "EA: unexpected CallLeaf"); + } +#endif set_escape_state(arg->_idx, PointsToNode::ArgEscape); if (arg->is_AddP()) { // @@ -1706,9 +1913,10 @@ void ConnectionGraph::process_call_arguments(CallNode *call, PhaseTransform *pha for (uint i = TypeFunc::Parms; i < d->cnt(); i++) { const Type* at = d->field_at(i); int k = i - TypeFunc::Parms; + Node *arg = call->in(i)->uncast(); - if (at->isa_oopptr() != NULL) { - Node *arg = call->in(i)->uncast(); + if (at->isa_oopptr() != NULL && + ptnode_adr(arg->_idx)->escape_state() < PointsToNode::GlobalEscape) { bool global_escapes = false; bool fields_escapes = false; @@ -1942,20 +2150,23 @@ void ConnectionGraph::record_for_escape_analysis(Node *n, PhaseTransform *phase) record_for_optimizer(n); _processed.set(n->_idx); } else { - // Have to process call's arguments first. + // Don't mark as processed since call's arguments have to be processed. PointsToNode::NodeType nt = PointsToNode::UnknownType; + PointsToNode::EscapeState es = PointsToNode::UnknownEscape; // Check if a call returns an object. const TypeTuple *r = n->as_Call()->tf()->range(); - if (n->is_CallStaticJava() && r->cnt() > TypeFunc::Parms && + if (r->cnt() > TypeFunc::Parms && + r->field_at(TypeFunc::Parms)->isa_ptr() && n->as_Call()->proj_out(TypeFunc::Parms) != NULL) { - // Note: use isa_ptr() instead of isa_oopptr() here because - // the _multianewarray functions return a TypeRawPtr. - if (r->field_at(TypeFunc::Parms)->isa_ptr() != NULL) { - nt = PointsToNode::JavaObject; + nt = PointsToNode::JavaObject; + if (!n->is_CallStaticJava()) { + // Since the called mathod is statically unknown assume + // the worst case that the returned value globally escapes. + es = PointsToNode::GlobalEscape; } } - add_node(n, nt, PointsToNode::UnknownEscape, false); + add_node(n, nt, es, false); } return; } @@ -2088,18 +2299,27 @@ void ConnectionGraph::record_for_escape_analysis(Node *n, PhaseTransform *phase) } case Op_Proj: { - // we are only interested in the result projection from a call + // we are only interested in the oop result projection from a call if (n->as_Proj()->_con == TypeFunc::Parms && n->in(0)->is_Call() ) { - add_node(n, PointsToNode::LocalVar, PointsToNode::UnknownEscape, false); - process_call_result(n->as_Proj(), phase); - if (!_processed.test(n->_idx)) { - // The call's result may need to be processed later if the call - // returns it's argument and the argument is not processed yet. - _delayed_worklist.push(n); + const TypeTuple *r = n->in(0)->as_Call()->tf()->range(); + assert(r->cnt() > TypeFunc::Parms, "sanity"); + if (r->field_at(TypeFunc::Parms)->isa_ptr() != NULL) { + add_node(n, PointsToNode::LocalVar, PointsToNode::UnknownEscape, false); + int ti = n->in(0)->_idx; + // The call may not be registered yet (since not all its inputs are registered) + // if this is the projection from backbranch edge of Phi. + if (ptnode_adr(ti)->node_type() != PointsToNode::UnknownType) { + process_call_result(n->as_Proj(), phase); + } + if (!_processed.test(n->_idx)) { + // The call's result may need to be processed later if the call + // returns it's argument and the argument is not processed yet. + _delayed_worklist.push(n); + } + break; } - } else { - _processed.set(n->_idx); } + _processed.set(n->_idx); break; } case Op_Return: @@ -2160,6 +2380,15 @@ void ConnectionGraph::record_for_escape_analysis(Node *n, PhaseTransform *phase) } break; } + case Op_AryEq: + case Op_StrComp: + case Op_StrEquals: + case Op_StrIndexOf: + { + // char[] arrays passed to string intrinsics are not scalar replaceable. + add_node(n, PointsToNode::UnknownType, PointsToNode::UnknownEscape, false); + break; + } case Op_ThreadLocal: { add_node(n, PointsToNode::JavaObject, PointsToNode::ArgEscape, true); @@ -2174,6 +2403,7 @@ void ConnectionGraph::record_for_escape_analysis(Node *n, PhaseTransform *phase) void ConnectionGraph::build_connection_graph(Node *n, PhaseTransform *phase) { uint n_idx = n->_idx; + assert(ptnode_adr(n_idx)->_node != NULL, "node should be registered"); // Don't set processed bit for AddP, LoadP, StoreP since // they may need more then one pass to process. @@ -2211,6 +2441,7 @@ void ConnectionGraph::build_connection_graph(Node *n, PhaseTransform *phase) { case Op_DecodeN: { int ti = n->in(1)->_idx; + assert(ptnode_adr(ti)->node_type() != PointsToNode::UnknownType, "all nodes should be registered"); if (ptnode_adr(ti)->node_type() == PointsToNode::JavaObject) { add_pointsto_edge(n_idx, ti); } else { @@ -2250,7 +2481,6 @@ void ConnectionGraph::build_connection_graph(Node *n, PhaseTransform *phase) { #endif Node* adr = n->in(MemNode::Address)->uncast(); - const Type *adr_type = phase->type(adr); Node* adr_base; if (adr->is_AddP()) { adr_base = get_addp_base(adr); @@ -2302,13 +2532,19 @@ void ConnectionGraph::build_connection_graph(Node *n, PhaseTransform *phase) { } case Op_Proj: { - // we are only interested in the result projection from a call + // we are only interested in the oop result projection from a call if (n->as_Proj()->_con == TypeFunc::Parms && n->in(0)->is_Call() ) { - process_call_result(n->as_Proj(), phase); - assert(_processed.test(n_idx), "all call results should be processed"); - } else { - assert(false, "Op_Proj"); + assert(ptnode_adr(n->in(0)->_idx)->node_type() != PointsToNode::UnknownType, + "all nodes should be registered"); + const TypeTuple *r = n->in(0)->as_Call()->tf()->range(); + assert(r->cnt() > TypeFunc::Parms, "sanity"); + if (r->field_at(TypeFunc::Parms)->isa_ptr() != NULL) { + process_call_result(n->as_Proj(), phase); + assert(_processed.test(n_idx), "all call results should be processed"); + break; + } } + assert(false, "Op_Proj"); break; } case Op_Return: @@ -2320,6 +2556,7 @@ void ConnectionGraph::build_connection_graph(Node *n, PhaseTransform *phase) { } #endif int ti = n->in(TypeFunc::Parms)->_idx; + assert(ptnode_adr(ti)->node_type() != PointsToNode::UnknownType, "node should be registered"); if (ptnode_adr(ti)->node_type() == PointsToNode::JavaObject) { add_pointsto_edge(n_idx, ti); } else { @@ -2354,14 +2591,38 @@ void ConnectionGraph::build_connection_graph(Node *n, PhaseTransform *phase) { } break; } + case Op_AryEq: + case Op_StrComp: + case Op_StrEquals: + case Op_StrIndexOf: + { + // char[] arrays passed to string intrinsic do not escape but + // they are not scalar replaceable. Adjust escape state for them. + // Start from in(2) edge since in(1) is memory edge. + for (uint i = 2; i < n->req(); i++) { + Node* adr = n->in(i)->uncast(); + const Type *at = phase->type(adr); + if (!adr->is_top() && at->isa_ptr()) { + assert(at == Type::TOP || at == TypePtr::NULL_PTR || + at->isa_ptr() != NULL, "expecting an Ptr"); + if (adr->is_AddP()) { + adr = get_addp_base(adr); + } + // Mark as ArgEscape everything "adr" could point to. + set_escape_state(adr->_idx, PointsToNode::ArgEscape); + } + } + _processed.set(n_idx); + break; + } case Op_ThreadLocal: { assert(false, "Op_ThreadLocal"); break; } default: - ; - // nothing to do + // This method should be called only for EA specific nodes. + ShouldNotReachHere(); } } diff --git a/hotspot/src/share/vm/opto/escape.hpp b/hotspot/src/share/vm/opto/escape.hpp index 1ce0cc9cf29..576043beb45 100644 --- a/hotspot/src/share/vm/opto/escape.hpp +++ b/hotspot/src/share/vm/opto/escape.hpp @@ -210,6 +210,8 @@ private: Unique_Node_List _delayed_worklist; // Nodes to be processed before // the call build_connection_graph(). + GrowableArray _mergemem_worklist; // List of all MergeMem nodes + VectorSet _processed; // Records which nodes have been // processed. @@ -289,7 +291,7 @@ private: bool split_AddP(Node *addp, Node *base, PhaseGVN *igvn); PhiNode *create_split_phi(PhiNode *orig_phi, int alias_idx, GrowableArray &orig_phi_worklist, PhaseGVN *igvn, bool &new_created); PhiNode *split_memory_phi(PhiNode *orig_phi, int alias_idx, GrowableArray &orig_phi_worklist, PhaseGVN *igvn); - Node *find_mem(Node *mem, int alias_idx, PhaseGVN *igvn); + void move_inst_mem(Node* n, GrowableArray &orig_phis, PhaseGVN *igvn); Node *find_inst_mem(Node *mem, int alias_idx,GrowableArray &orig_phi_worklist, PhaseGVN *igvn); // Propagate unique types created for unescaped allocated objects @@ -298,7 +300,6 @@ private: // manage entries in _node_map void set_map(int idx, Node *n) { _node_map.map(idx, n); } - void set_map_phi(int idx, PhiNode *p) { _node_map.map(idx, (Node *) p); } Node *get_map(int idx) { return _node_map[idx]; } PhiNode *get_map_phi(int idx) { Node *phi = _node_map[idx]; @@ -315,6 +316,9 @@ private: // Set the escape state of a node void set_escape_state(uint ni, PointsToNode::EscapeState es); + // Search for objects which are not scalar replaceable. + void verify_escape_state(int nidx, VectorSet& ptset, PhaseTransform* phase); + public: ConnectionGraph(Compile *C); diff --git a/hotspot/src/share/vm/opto/graphKit.cpp b/hotspot/src/share/vm/opto/graphKit.cpp index b63aae489ff..3d550551451 100644 --- a/hotspot/src/share/vm/opto/graphKit.cpp +++ b/hotspot/src/share/vm/opto/graphKit.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -455,16 +455,44 @@ Bytecodes::Code GraphKit::java_bc() const { return Bytecodes::_illegal; } +void GraphKit::uncommon_trap_if_should_post_on_exceptions(Deoptimization::DeoptReason reason, + bool must_throw) { + // if the exception capability is set, then we will generate code + // to check the JavaThread.should_post_on_exceptions flag to see + // if we actually need to report exception events (for this + // thread). If we don't need to report exception events, we will + // take the normal fast path provided by add_exception_events. If + // exception event reporting is enabled for this thread, we will + // take the uncommon_trap in the BuildCutout below. + + // first must access the should_post_on_exceptions_flag in this thread's JavaThread + Node* jthread = _gvn.transform(new (C, 1) ThreadLocalNode()); + Node* adr = basic_plus_adr(top(), jthread, in_bytes(JavaThread::should_post_on_exceptions_flag_offset())); + Node* should_post_flag = make_load(control(), adr, TypeInt::INT, T_INT, Compile::AliasIdxRaw, false); + + // Test the should_post_on_exceptions_flag vs. 0 + Node* chk = _gvn.transform( new (C, 3) CmpINode(should_post_flag, intcon(0)) ); + Node* tst = _gvn.transform( new (C, 2) BoolNode(chk, BoolTest::eq) ); + + // Branch to slow_path if should_post_on_exceptions_flag was true + { BuildCutout unless(this, tst, PROB_MAX); + // Do not try anything fancy if we're notifying the VM on every throw. + // Cf. case Bytecodes::_athrow in parse2.cpp. + uncommon_trap(reason, Deoptimization::Action_none, + (ciKlass*)NULL, (char*)NULL, must_throw); + } + +} + //------------------------------builtin_throw---------------------------------- void GraphKit::builtin_throw(Deoptimization::DeoptReason reason, Node* arg) { bool must_throw = true; - if (env()->jvmti_can_post_exceptions()) { - // Do not try anything fancy if we're notifying the VM on every throw. - // Cf. case Bytecodes::_athrow in parse2.cpp. - uncommon_trap(reason, Deoptimization::Action_none, - (ciKlass*)NULL, (char*)NULL, must_throw); - return; + if (env()->jvmti_can_post_on_exceptions()) { + // check if we must post exception events, take uncommon trap if so + uncommon_trap_if_should_post_on_exceptions(reason, must_throw); + // here if should_post_on_exceptions is false + // continue on with the normal codegen } // If this particular condition has not yet happened at this @@ -752,12 +780,20 @@ bool GraphKit::dead_locals_are_killed() { // Helper function for enforcing certain bytecodes to reexecute if // deoptimization happens -static bool should_reexecute_implied_by_bytecode(JVMState *jvms) { +static bool should_reexecute_implied_by_bytecode(JVMState *jvms, bool is_anewarray) { ciMethod* cur_method = jvms->method(); int cur_bci = jvms->bci(); if (cur_method != NULL && cur_bci != InvocationEntryBci) { Bytecodes::Code code = cur_method->java_code_at_bci(cur_bci); - return Interpreter::bytecode_should_reexecute(code); + return Interpreter::bytecode_should_reexecute(code) || + is_anewarray && code == Bytecodes::_multianewarray; + // Reexecute _multianewarray bytecode which was replaced with + // sequence of [a]newarray. See Parse::do_multianewarray(). + // + // Note: interpreter should not have it set since this optimization + // is limited by dimensions and guarded by flag so in some cases + // multianewarray() runtime calls will be generated and + // the bytecode should not be reexecutes (stack will not be reset). } else return false; } @@ -808,7 +844,7 @@ void GraphKit::add_safepoint_edges(SafePointNode* call, bool must_throw) { // For a known set of bytecodes, the interpreter should reexecute them if // deoptimization happens. We set the reexecute state for them here if (out_jvms->is_reexecute_undefined() && //don't change if already specified - should_reexecute_implied_by_bytecode(out_jvms)) { + should_reexecute_implied_by_bytecode(out_jvms, call->is_AllocateArray())) { out_jvms->set_should_reexecute(true); //NOTE: youngest_jvms not changed } @@ -981,14 +1017,19 @@ bool GraphKit::compute_stack_effects(int& inputs, int& depth) { case Bytecodes::_invokedynamic: case Bytecodes::_invokeinterface: { - bool is_static = (depth == 0); bool ignore; ciBytecodeStream iter(method()); iter.reset_to_bci(bci()); iter.next(); ciMethod* method = iter.get_method(ignore); inputs = method->arg_size_no_receiver(); - if (!is_static) inputs += 1; + // Add a receiver argument, maybe: + if (code != Bytecodes::_invokestatic && + code != Bytecodes::_invokedynamic) + inputs += 1; + // (Do not use ciMethod::arg_size(), because + // it might be an unloaded method, which doesn't + // know whether it is static or not.) int size = method->return_type()->size(); depth = size - inputs; } @@ -1351,8 +1392,8 @@ void GraphKit::set_all_memory(Node* newmem) { } //------------------------------set_all_memory_call---------------------------- -void GraphKit::set_all_memory_call(Node* call) { - Node* newmem = _gvn.transform( new (C, 1) ProjNode(call, TypeFunc::Memory) ); +void GraphKit::set_all_memory_call(Node* call, bool separate_io_proj) { + Node* newmem = _gvn.transform( new (C, 1) ProjNode(call, TypeFunc::Memory, separate_io_proj) ); set_all_memory(newmem); } @@ -1573,7 +1614,7 @@ void GraphKit::set_arguments_for_java_call(CallJavaNode* call) { //---------------------------set_edges_for_java_call--------------------------- // Connect a newly created call into the current JVMS. // A return value node (if any) is returned from set_edges_for_java_call. -void GraphKit::set_edges_for_java_call(CallJavaNode* call, bool must_throw) { +void GraphKit::set_edges_for_java_call(CallJavaNode* call, bool must_throw, bool separate_io_proj) { // Add the predefined inputs: call->init_req( TypeFunc::Control, control() ); @@ -1595,13 +1636,13 @@ void GraphKit::set_edges_for_java_call(CallJavaNode* call, bool must_throw) { // Re-use the current map to produce the result. set_control(_gvn.transform(new (C, 1) ProjNode(call, TypeFunc::Control))); - set_i_o( _gvn.transform(new (C, 1) ProjNode(call, TypeFunc::I_O ))); - set_all_memory_call(xcall); + set_i_o( _gvn.transform(new (C, 1) ProjNode(call, TypeFunc::I_O , separate_io_proj))); + set_all_memory_call(xcall, separate_io_proj); //return xcall; // no need, caller already has it } -Node* GraphKit::set_results_for_java_call(CallJavaNode* call) { +Node* GraphKit::set_results_for_java_call(CallJavaNode* call, bool separate_io_proj) { if (stopped()) return top(); // maybe the call folded up? // Capture the return value, if any. @@ -1614,8 +1655,15 @@ Node* GraphKit::set_results_for_java_call(CallJavaNode* call) { // Note: Since any out-of-line call can produce an exception, // we always insert an I_O projection from the call into the result. - make_slow_call_ex(call, env()->Throwable_klass(), false); + make_slow_call_ex(call, env()->Throwable_klass(), separate_io_proj); + if (separate_io_proj) { + // The caller requested separate projections be used by the fall + // through and exceptional paths, so replace the projections for + // the fall through path. + set_i_o(_gvn.transform( new (C, 1) ProjNode(call, TypeFunc::I_O) )); + set_all_memory(_gvn.transform( new (C, 1) ProjNode(call, TypeFunc::Memory) )); + } return ret; } @@ -1678,6 +1726,64 @@ void GraphKit::set_predefined_output_for_runtime_call(Node* call, } } + +// Replace the call with the current state of the kit. +void GraphKit::replace_call(CallNode* call, Node* result) { + JVMState* ejvms = NULL; + if (has_exceptions()) { + ejvms = transfer_exceptions_into_jvms(); + } + + SafePointNode* final_state = stop(); + + // Find all the needed outputs of this call + CallProjections callprojs; + call->extract_projections(&callprojs, true); + + // Replace all the old call edges with the edges from the inlining result + C->gvn_replace_by(callprojs.fallthrough_catchproj, final_state->in(TypeFunc::Control)); + C->gvn_replace_by(callprojs.fallthrough_memproj, final_state->in(TypeFunc::Memory)); + C->gvn_replace_by(callprojs.fallthrough_ioproj, final_state->in(TypeFunc::I_O)); + + // Replace the result with the new result if it exists and is used + if (callprojs.resproj != NULL && result != NULL) { + C->gvn_replace_by(callprojs.resproj, result); + } + + if (ejvms == NULL) { + // No exception edges to simply kill off those paths + C->gvn_replace_by(callprojs.catchall_catchproj, C->top()); + C->gvn_replace_by(callprojs.catchall_memproj, C->top()); + C->gvn_replace_by(callprojs.catchall_ioproj, C->top()); + + // Replace the old exception object with top + if (callprojs.exobj != NULL) { + C->gvn_replace_by(callprojs.exobj, C->top()); + } + } else { + GraphKit ekit(ejvms); + + // Load my combined exception state into the kit, with all phis transformed: + SafePointNode* ex_map = ekit.combine_and_pop_all_exception_states(); + + Node* ex_oop = ekit.use_exception_state(ex_map); + + C->gvn_replace_by(callprojs.catchall_catchproj, ekit.control()); + C->gvn_replace_by(callprojs.catchall_memproj, ekit.reset_memory()); + C->gvn_replace_by(callprojs.catchall_ioproj, ekit.i_o()); + + // Replace the old exception object with the newly created one + if (callprojs.exobj != NULL) { + C->gvn_replace_by(callprojs.exobj, ex_oop); + } + } + + // Disconnect the call from the graph + call->disconnect_inputs(NULL); + C->gvn_replace_by(call, C->top()); +} + + //------------------------------increment_counter------------------------------ // for statistics: increment a VM counter by 1 @@ -3189,9 +3295,10 @@ void GraphKit::write_barrier_post(Node* oop_store, if (use_ReduceInitialCardMarks() && obj == just_allocated_object(control())) { // We can skip marks on a freshly-allocated object in Eden. - // Keep this code in sync with maybe_defer_card_mark() in runtime.cpp. - // That routine informs GC to take appropriate compensating steps - // so as to make this card-mark elision safe. + // Keep this code in sync with new_store_pre_barrier() in runtime.cpp. + // That routine informs GC to take appropriate compensating steps, + // upon a slow-path allocation, so as to make this card-mark + // elision safe. return; } @@ -3459,4 +3566,3 @@ void GraphKit::g1_write_barrier_post(Node* oop_store, sync_kit(ideal); } #undef __ - diff --git a/hotspot/src/share/vm/opto/graphKit.hpp b/hotspot/src/share/vm/opto/graphKit.hpp index b127789b5f3..b08c5859d1a 100644 --- a/hotspot/src/share/vm/opto/graphKit.hpp +++ b/hotspot/src/share/vm/opto/graphKit.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -251,6 +251,11 @@ class GraphKit : public Phase { // via an uncommon trap. void builtin_throw(Deoptimization::DeoptReason reason, Node* arg = NULL); + // Helper to check the JavaThread::_should_post_on_exceptions flag + // and branch to an uncommon_trap if it is true (with the specified reason and must_throw) + void uncommon_trap_if_should_post_on_exceptions(Deoptimization::DeoptReason reason, + bool must_throw) ; + // Helper Functions for adding debug information void kill_dead_locals(); #ifdef ASSERT @@ -279,6 +284,34 @@ class GraphKit : public Phase { } Node* basic_plus_adr(Node* base, Node* ptr, Node* offset); + + // Some convenient shortcuts for common nodes + Node* IfTrue(IfNode* iff) { return _gvn.transform(new (C,1) IfTrueNode(iff)); } + Node* IfFalse(IfNode* iff) { return _gvn.transform(new (C,1) IfFalseNode(iff)); } + + Node* AddI(Node* l, Node* r) { return _gvn.transform(new (C,3) AddINode(l, r)); } + Node* SubI(Node* l, Node* r) { return _gvn.transform(new (C,3) SubINode(l, r)); } + Node* MulI(Node* l, Node* r) { return _gvn.transform(new (C,3) MulINode(l, r)); } + Node* DivI(Node* ctl, Node* l, Node* r) { return _gvn.transform(new (C,3) DivINode(ctl, l, r)); } + + Node* AndI(Node* l, Node* r) { return _gvn.transform(new (C,3) AndINode(l, r)); } + Node* OrI(Node* l, Node* r) { return _gvn.transform(new (C,3) OrINode(l, r)); } + Node* XorI(Node* l, Node* r) { return _gvn.transform(new (C,3) XorINode(l, r)); } + + Node* MaxI(Node* l, Node* r) { return _gvn.transform(new (C,3) MaxINode(l, r)); } + Node* MinI(Node* l, Node* r) { return _gvn.transform(new (C,3) MinINode(l, r)); } + + Node* LShiftI(Node* l, Node* r) { return _gvn.transform(new (C,3) LShiftINode(l, r)); } + Node* RShiftI(Node* l, Node* r) { return _gvn.transform(new (C,3) RShiftINode(l, r)); } + Node* URShiftI(Node* l, Node* r) { return _gvn.transform(new (C,3) URShiftINode(l, r)); } + + Node* CmpI(Node* l, Node* r) { return _gvn.transform(new (C,3) CmpINode(l, r)); } + Node* CmpL(Node* l, Node* r) { return _gvn.transform(new (C,3) CmpLNode(l, r)); } + Node* CmpP(Node* l, Node* r) { return _gvn.transform(new (C,3) CmpPNode(l, r)); } + Node* Bool(Node* cmp, BoolTest::mask relop) { return _gvn.transform(new (C,2) BoolNode(cmp, relop)); } + + Node* AddP(Node* b, Node* a, Node* o) { return _gvn.transform(new (C,4) AddPNode(b, a, o)); } + // Convert between int and long, and size_t. // (See macros ConvI2X, etc., in type.hpp for ConvI2X, etc.) Node* ConvI2L(Node* offset); @@ -400,7 +433,7 @@ class GraphKit : public Phase { void set_all_memory(Node* newmem); // Create a memory projection from the call, then set_all_memory. - void set_all_memory_call(Node* call); + void set_all_memory_call(Node* call, bool separate_io_proj = false); // Create a LoadNode, reading from the parser's memory state. // (Note: require_atomic_access is useful only with T_LONG.) @@ -543,12 +576,12 @@ class GraphKit : public Phase { // Transform the call, and update the basics: control, i_o, memory. // (The next step is usually to call set_results_for_java_call.) void set_edges_for_java_call(CallJavaNode* call, - bool must_throw = false); + bool must_throw = false, bool separate_io_proj = false); // Finish up a java call that was started by set_edges_for_java_call. // Call add_exception on any throw arising from the call. // Return the call result (transformed). - Node* set_results_for_java_call(CallJavaNode* call); + Node* set_results_for_java_call(CallJavaNode* call, bool separate_io_proj = false); // Similar to set_edges_for_java_call, but simplified for runtime calls. void set_predefined_output_for_runtime_call(Node* call) { @@ -559,6 +592,11 @@ class GraphKit : public Phase { const TypePtr* hook_mem); Node* set_predefined_input_for_runtime_call(SafePointNode* call); + // Replace the call with the current state of the kit. Requires + // that the call was generated with separate io_projs so that + // exceptional control flow can be handled properly. + void replace_call(CallNode* call, Node* result); + // helper functions for statistics void increment_counter(address counter_addr); // increment a debug counter void increment_counter(Node* counter_addr); // increment a debug counter diff --git a/hotspot/src/share/vm/opto/ifg.cpp b/hotspot/src/share/vm/opto/ifg.cpp index 9d260cbec67..224abe2365c 100644 --- a/hotspot/src/share/vm/opto/ifg.cpp +++ b/hotspot/src/share/vm/opto/ifg.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/opto/ifnode.cpp b/hotspot/src/share/vm/opto/ifnode.cpp index 51ca8fe28ad..a026fceef47 100644 --- a/hotspot/src/share/vm/opto/ifnode.cpp +++ b/hotspot/src/share/vm/opto/ifnode.cpp @@ -531,6 +531,9 @@ Node* IfNode::up_one_dom(Node *curr, bool linear_only) { if (linear_only) return NULL; + if( dom->is_Root() ) + return NULL; + // Else hit a Region. Check for a loop header if( dom->is_Loop() ) return dom->in(1); // Skip up thru loops diff --git a/hotspot/src/share/vm/opto/lcm.cpp b/hotspot/src/share/vm/opto/lcm.cpp index 31de55a5435..4f1d6b670e2 100644 --- a/hotspot/src/share/vm/opto/lcm.cpp +++ b/hotspot/src/share/vm/opto/lcm.cpp @@ -120,6 +120,7 @@ void Block::implicit_null_check(PhaseCFG *cfg, Node *proj, Node *val, int allowe case Op_LoadRange: case Op_LoadD_unaligned: case Op_LoadL_unaligned: + assert(mach->in(2) == val, "should be address"); break; case Op_StoreB: case Op_StoreC: @@ -146,6 +147,21 @@ void Block::implicit_null_check(PhaseCFG *cfg, Node *proj, Node *val, int allowe default: // Also check for embedded loads if( !mach->needs_anti_dependence_check() ) continue; // Not an memory op; skip it + { + // Check that value is used in memory address. + Node* base; + Node* index; + const MachOper* oper = mach->memory_inputs(base, index); + if (oper == NULL || oper == (MachOper*)-1) { + continue; // Not an memory op; skip it + } + if (val == base || + val == index && val->bottom_type()->isa_narrowoop()) { + break; // Found it + } else { + continue; // Skip it + } + } break; } // check if the offset is not too high for implicit exception @@ -542,6 +558,16 @@ uint Block::sched_call( Matcher &matcher, Block_Array &bbs, uint node_cnt, Node_ // pointers as far as the kill mask goes. bool exclude_soe = op == Op_CallRuntime; + // If the call is a MethodHandle invoke, we need to exclude the + // register which is used to save the SP value over MH invokes from + // the mask. Otherwise this register could be used for + // deoptimization information. + if (op == Op_CallStaticJava) { + MachCallStaticJavaNode* mcallstaticjava = (MachCallStaticJavaNode*) mcall; + if (mcallstaticjava->_method_handle_invoke) + proj->_rout.OR(Matcher::method_handle_invoke_SP_save_mask()); + } + // Fill in the kill mask for the call for( OptoReg::Name r = OptoReg::Name(0); r < _last_Mach_Reg; r=OptoReg::add(r,1) ) { if( !regs.Member(r) ) { // Not already defined by the call @@ -616,8 +642,9 @@ bool Block::schedule_local(PhaseCFG *cfg, Matcher &matcher, int *ready_cnt, Vect assert(cfg->_bbs[oop_store->_idx]->_dom_depth <= this->_dom_depth, "oop_store must dominate card-mark"); } } - if( n->is_Mach() && n->as_Mach()->ideal_Opcode() == Op_MemBarAcquire && - n->req() > TypeFunc::Parms ) { + if( n->is_Mach() && n->req() > TypeFunc::Parms && + (n->as_Mach()->ideal_Opcode() == Op_MemBarAcquire || + n->as_Mach()->ideal_Opcode() == Op_MemBarVolatile) ) { // MemBarAcquire could be created without Precedent edge. // del_req() replaces the specified edge with the last input edge // and then removes the last edge. If the specified edge > number of diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 1be04de6acf..8f69208911e 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -3697,12 +3697,14 @@ bool LibraryCallKit::inline_native_Reflection_getCallerClass() { // Helper routine for above bool LibraryCallKit::is_method_invoke_or_aux_frame(JVMState* jvms) { + ciMethod* method = jvms->method(); + // Is this the Method.invoke method itself? - if (jvms->method()->intrinsic_id() == vmIntrinsics::_invoke) + if (method->intrinsic_id() == vmIntrinsics::_invoke) return true; // Is this a helper, defined somewhere underneath MethodAccessorImpl. - ciKlass* k = jvms->method()->holder(); + ciKlass* k = method->holder(); if (k->is_instance_klass()) { ciInstanceKlass* ik = k->as_instance_klass(); for (; ik != NULL; ik = ik->super()) { @@ -3712,6 +3714,10 @@ bool LibraryCallKit::is_method_invoke_or_aux_frame(JVMState* jvms) { } } } + else if (method->is_method_handle_adapter()) { + // This is an internal adapter frame from the MethodHandleCompiler -- skip it + return true; + } return false; } diff --git a/hotspot/src/share/vm/opto/loopTransform.cpp b/hotspot/src/share/vm/opto/loopTransform.cpp index 0d4bf7869ea..809f47472c6 100644 --- a/hotspot/src/share/vm/opto/loopTransform.cpp +++ b/hotspot/src/share/vm/opto/loopTransform.cpp @@ -549,6 +549,10 @@ bool IdealLoopTree::policy_range_check( PhaseIdealLoop *phase ) const { // Comparing trip+off vs limit Node *bol = iff->in(1); if( bol->req() != 2 ) continue; // dead constant test + if (!bol->is_Bool()) { + assert(UseLoopPredicate && bol->Opcode() == Op_Conv2B, "predicate check only"); + continue; + } Node *cmp = bol->in(1); Node *rc_exp = cmp->in(1); @@ -875,7 +879,7 @@ void PhaseIdealLoop::insert_pre_post_loops( IdealLoopTree *loop, Node_List &old_ //------------------------------is_invariant----------------------------- // Return true if n is invariant bool IdealLoopTree::is_invariant(Node* n) const { - Node *n_c = _phase->get_ctrl(n); + Node *n_c = _phase->has_ctrl(n) ? _phase->get_ctrl(n) : n; if (n_c->is_top()) return false; return !is_member(_phase->get_loop(n_c)); } @@ -1594,7 +1598,7 @@ bool IdealLoopTree::policy_do_remove_empty_loop( PhaseIdealLoop *phase ) { bool IdealLoopTree::iteration_split_impl( PhaseIdealLoop *phase, Node_List &old_new ) { // Check and remove empty loops (spam micro-benchmarks) if( policy_do_remove_empty_loop(phase) ) - return true; // Here we removed an empty loop + return true; // Here we removed an empty loop bool should_peel = policy_peeling(phase); // Should we peel? @@ -1688,8 +1692,8 @@ bool IdealLoopTree::iteration_split_impl( PhaseIdealLoop *phase, Node_List &old_ // an even number of trips). If we are peeling, we might enable some RCE // and we'd rather unroll the post-RCE'd loop SO... do not unroll if // peeling. - if( should_unroll && !should_peel ) - phase->do_unroll(this,old_new, true); + if( should_unroll && !should_peel ) + phase->do_unroll(this,old_new, true); // Adjust the pre-loop limits to align the main body // iterations. @@ -1731,9 +1735,9 @@ bool IdealLoopTree::iteration_split( PhaseIdealLoop *phase, Node_List &old_new ) _allow_optimizations && !tail()->is_top() ) { // Also ignore the occasional dead backedge if (!_has_call) { - if (!iteration_split_impl( phase, old_new )) { - return false; - } + if (!iteration_split_impl( phase, old_new )) { + return false; + } } else if (policy_unswitching(phase)) { phase->do_unswitching(this, old_new); } @@ -1746,3 +1750,576 @@ bool IdealLoopTree::iteration_split( PhaseIdealLoop *phase, Node_List &old_new ) return false; return true; } + +//-------------------------------is_uncommon_trap_proj---------------------------- +// Return true if proj is the form of "proj->[region->..]call_uct" +bool PhaseIdealLoop::is_uncommon_trap_proj(ProjNode* proj, bool must_reason_predicate) { + int path_limit = 10; + assert(proj, "invalid argument"); + Node* out = proj; + for (int ct = 0; ct < path_limit; ct++) { + out = out->unique_ctrl_out(); + if (out == NULL || out->is_Root() || out->is_Start()) + return false; + if (out->is_CallStaticJava()) { + int req = out->as_CallStaticJava()->uncommon_trap_request(); + if (req != 0) { + Deoptimization::DeoptReason reason = Deoptimization::trap_request_reason(req); + if (!must_reason_predicate || reason == Deoptimization::Reason_predicate){ + return true; + } + } + return false; // don't do further after call + } + } + return false; +} + +//-------------------------------is_uncommon_trap_if_pattern------------------------- +// Return true for "if(test)-> proj -> ... +// | +// V +// other_proj->[region->..]call_uct" +// +// "must_reason_predicate" means the uct reason must be Reason_predicate +bool PhaseIdealLoop::is_uncommon_trap_if_pattern(ProjNode *proj, bool must_reason_predicate) { + Node *in0 = proj->in(0); + if (!in0->is_If()) return false; + IfNode* iff = in0->as_If(); + + // we need "If(Conv2B(Opaque1(...)))" pattern for must_reason_predicate + if (must_reason_predicate) { + if (iff->in(1)->Opcode() != Op_Conv2B || + iff->in(1)->in(1)->Opcode() != Op_Opaque1) { + return false; + } + } + + ProjNode* other_proj = iff->proj_out(1-proj->_con)->as_Proj(); + return is_uncommon_trap_proj(other_proj, must_reason_predicate); +} + +//------------------------------create_new_if_for_predicate------------------------ +// create a new if above the uct_if_pattern for the predicate to be promoted. +// +// before after +// ---------- ---------- +// ctrl ctrl +// | | +// | | +// v v +// iff new_iff +// / \ / \ +// / \ / \ +// v v v v +// uncommon_proj cont_proj if_uct if_cont +// \ | | | | +// \ | | | | +// v v v | v +// rgn loop | iff +// | | / \ +// | | / \ +// v | v v +// uncommon_trap | uncommon_proj cont_proj +// \ \ | | +// \ \ | | +// v v v v +// rgn loop +// | +// | +// v +// uncommon_trap +// +// +// We will create a region to guard the uct call if there is no one there. +// The true projecttion (if_cont) of the new_iff is returned. +ProjNode* PhaseIdealLoop::create_new_if_for_predicate(ProjNode* cont_proj) { + assert(is_uncommon_trap_if_pattern(cont_proj, true), "must be a uct if pattern!"); + IfNode* iff = cont_proj->in(0)->as_If(); + + ProjNode *uncommon_proj = iff->proj_out(1 - cont_proj->_con); + Node *rgn = uncommon_proj->unique_ctrl_out(); + assert(rgn->is_Region() || rgn->is_Call(), "must be a region or call uct"); + + if (!rgn->is_Region()) { // create a region to guard the call + assert(rgn->is_Call(), "must be call uct"); + CallNode* call = rgn->as_Call(); + rgn = new (C, 1) RegionNode(1); + _igvn.set_type(rgn, rgn->bottom_type()); + rgn->add_req(uncommon_proj); + set_idom(rgn, idom(uncommon_proj), dom_depth(uncommon_proj)+1); + _igvn.hash_delete(call); + call->set_req(0, rgn); + } + + // Create new_iff + uint iffdd = dom_depth(iff); + IdealLoopTree* lp = get_loop(iff); + IfNode *new_iff = new (C, 2) IfNode(iff->in(0), NULL, iff->_prob, iff->_fcnt); + register_node(new_iff, lp, idom(iff), iffdd); + Node *if_cont = new (C, 1) IfTrueNode(new_iff); + Node *if_uct = new (C, 1) IfFalseNode(new_iff); + if (cont_proj->is_IfFalse()) { + // Swap + Node* tmp = if_uct; if_uct = if_cont; if_cont = tmp; + } + register_node(if_cont, lp, new_iff, iffdd); + register_node(if_uct, get_loop(rgn), new_iff, iffdd); + + // if_cont to iff + _igvn.hash_delete(iff); + iff->set_req(0, if_cont); + set_idom(iff, if_cont, dom_depth(iff)); + + // if_uct to rgn + _igvn.hash_delete(rgn); + rgn->add_req(if_uct); + Node* ridom = idom(rgn); + Node* nrdom = dom_lca(ridom, new_iff); + set_idom(rgn, nrdom, dom_depth(rgn)); + + // rgn must have no phis + assert(!rgn->as_Region()->has_phi(), "region must have no phis"); + + return if_cont->as_Proj(); +} + +//------------------------------find_predicate_insertion_point-------------------------- +// Find a good location to insert a predicate +ProjNode* PhaseIdealLoop::find_predicate_insertion_point(Node* start_c) { + if (start_c == C->root() || !start_c->is_Proj()) + return NULL; + if (is_uncommon_trap_if_pattern(start_c->as_Proj(), true/*Reason_Predicate*/)) { + return start_c->as_Proj(); + } + return NULL; +} + +//------------------------------Invariance----------------------------------- +// Helper class for loop_predication_impl to compute invariance on the fly and +// clone invariants. +class Invariance : public StackObj { + VectorSet _visited, _invariant; + Node_Stack _stack; + VectorSet _clone_visited; + Node_List _old_new; // map of old to new (clone) + IdealLoopTree* _lpt; + PhaseIdealLoop* _phase; + + // Helper function to set up the invariance for invariance computation + // If n is a known invariant, set up directly. Otherwise, look up the + // the possibility to push n onto the stack for further processing. + void visit(Node* use, Node* n) { + if (_lpt->is_invariant(n)) { // known invariant + _invariant.set(n->_idx); + } else if (!n->is_CFG()) { + Node *n_ctrl = _phase->ctrl_or_self(n); + Node *u_ctrl = _phase->ctrl_or_self(use); // self if use is a CFG + if (_phase->is_dominator(n_ctrl, u_ctrl)) { + _stack.push(n, n->in(0) == NULL ? 1 : 0); + } + } + } + + // Compute invariance for "the_node" and (possibly) all its inputs recursively + // on the fly + void compute_invariance(Node* n) { + assert(_visited.test(n->_idx), "must be"); + visit(n, n); + while (_stack.is_nonempty()) { + Node* n = _stack.node(); + uint idx = _stack.index(); + if (idx == n->req()) { // all inputs are processed + _stack.pop(); + // n is invariant if it's inputs are all invariant + bool all_inputs_invariant = true; + for (uint i = 0; i < n->req(); i++) { + Node* in = n->in(i); + if (in == NULL) continue; + assert(_visited.test(in->_idx), "must have visited input"); + if (!_invariant.test(in->_idx)) { // bad guy + all_inputs_invariant = false; + break; + } + } + if (all_inputs_invariant) { + _invariant.set(n->_idx); // I am a invariant too + } + } else { // process next input + _stack.set_index(idx + 1); + Node* m = n->in(idx); + if (m != NULL && !_visited.test_set(m->_idx)) { + visit(n, m); + } + } + } + } + + // Helper function to set up _old_new map for clone_nodes. + // If n is a known invariant, set up directly ("clone" of n == n). + // Otherwise, push n onto the stack for real cloning. + void clone_visit(Node* n) { + assert(_invariant.test(n->_idx), "must be invariant"); + if (_lpt->is_invariant(n)) { // known invariant + _old_new.map(n->_idx, n); + } else{ // to be cloned + assert (!n->is_CFG(), "should not see CFG here"); + _stack.push(n, n->in(0) == NULL ? 1 : 0); + } + } + + // Clone "n" and (possibly) all its inputs recursively + void clone_nodes(Node* n, Node* ctrl) { + clone_visit(n); + while (_stack.is_nonempty()) { + Node* n = _stack.node(); + uint idx = _stack.index(); + if (idx == n->req()) { // all inputs processed, clone n! + _stack.pop(); + // clone invariant node + Node* n_cl = n->clone(); + _old_new.map(n->_idx, n_cl); + _phase->register_new_node(n_cl, ctrl); + for (uint i = 0; i < n->req(); i++) { + Node* in = n_cl->in(i); + if (in == NULL) continue; + n_cl->set_req(i, _old_new[in->_idx]); + } + } else { // process next input + _stack.set_index(idx + 1); + Node* m = n->in(idx); + if (m != NULL && !_clone_visited.test_set(m->_idx)) { + clone_visit(m); // visit the input + } + } + } + } + + public: + Invariance(Arena* area, IdealLoopTree* lpt) : + _lpt(lpt), _phase(lpt->_phase), + _visited(area), _invariant(area), _stack(area, 10 /* guess */), + _clone_visited(area), _old_new(area) + {} + + // Map old to n for invariance computation and clone + void map_ctrl(Node* old, Node* n) { + assert(old->is_CFG() && n->is_CFG(), "must be"); + _old_new.map(old->_idx, n); // "clone" of old is n + _invariant.set(old->_idx); // old is invariant + _clone_visited.set(old->_idx); + } + + // Driver function to compute invariance + bool is_invariant(Node* n) { + if (!_visited.test_set(n->_idx)) + compute_invariance(n); + return (_invariant.test(n->_idx) != 0); + } + + // Driver function to clone invariant + Node* clone(Node* n, Node* ctrl) { + assert(ctrl->is_CFG(), "must be"); + assert(_invariant.test(n->_idx), "must be an invariant"); + if (!_clone_visited.test(n->_idx)) + clone_nodes(n, ctrl); + return _old_new[n->_idx]; + } +}; + +//------------------------------is_range_check_if ----------------------------------- +// Returns true if the predicate of iff is in "scale*iv + offset u< load_range(ptr)" format +// Note: this function is particularly designed for loop predication. We require load_range +// and offset to be loop invariant computed on the fly by "invar" +bool IdealLoopTree::is_range_check_if(IfNode *iff, PhaseIdealLoop *phase, Invariance& invar) const { + if (!is_loop_exit(iff)) { + return false; + } + if (!iff->in(1)->is_Bool()) { + return false; + } + const BoolNode *bol = iff->in(1)->as_Bool(); + if (bol->_test._test != BoolTest::lt) { + return false; + } + if (!bol->in(1)->is_Cmp()) { + return false; + } + const CmpNode *cmp = bol->in(1)->as_Cmp(); + if (cmp->Opcode() != Op_CmpU ) { + return false; + } + if (cmp->in(2)->Opcode() != Op_LoadRange) { + return false; + } + LoadRangeNode* lr = (LoadRangeNode*)cmp->in(2); + if (!invar.is_invariant(lr)) { // loadRange must be invariant + return false; + } + Node *iv = _head->as_CountedLoop()->phi(); + int scale = 0; + Node *offset = NULL; + if (!phase->is_scaled_iv_plus_offset(cmp->in(1), iv, &scale, &offset)) { + return false; + } + if(offset && !invar.is_invariant(offset)) { // offset must be invariant + return false; + } + return true; +} + +//------------------------------rc_predicate----------------------------------- +// Create a range check predicate +// +// for (i = init; i < limit; i += stride) { +// a[scale*i+offset] +// } +// +// Compute max(scale*i + offset) for init <= i < limit and build the predicate +// as "max(scale*i + offset) u< a.length". +// +// There are two cases for max(scale*i + offset): +// (1) stride*scale > 0 +// max(scale*i + offset) = scale*(limit-stride) + offset +// (2) stride*scale < 0 +// max(scale*i + offset) = scale*init + offset +BoolNode* PhaseIdealLoop::rc_predicate(Node* ctrl, + int scale, Node* offset, + Node* init, Node* limit, Node* stride, + Node* range) { + Node* max_idx_expr = init; + int stride_con = stride->get_int(); + if ((stride_con > 0) == (scale > 0)) { + max_idx_expr = new (C, 3) SubINode(limit, stride); + register_new_node(max_idx_expr, ctrl); + } + + if (scale != 1) { + ConNode* con_scale = _igvn.intcon(scale); + max_idx_expr = new (C, 3) MulINode(max_idx_expr, con_scale); + register_new_node(max_idx_expr, ctrl); + } + + if (offset && (!offset->is_Con() || offset->get_int() != 0)){ + max_idx_expr = new (C, 3) AddINode(max_idx_expr, offset); + register_new_node(max_idx_expr, ctrl); + } + + CmpUNode* cmp = new (C, 3) CmpUNode(max_idx_expr, range); + register_new_node(cmp, ctrl); + BoolNode* bol = new (C, 2) BoolNode(cmp, BoolTest::lt); + register_new_node(bol, ctrl); + return bol; +} + +//------------------------------ loop_predication_impl-------------------------- +// Insert loop predicates for null checks and range checks +bool PhaseIdealLoop::loop_predication_impl(IdealLoopTree *loop) { + if (!UseLoopPredicate) return false; + + // Too many traps seen? + bool tmt = C->too_many_traps(C->method(), 0, Deoptimization::Reason_predicate); + int tc = C->trap_count(Deoptimization::Reason_predicate); + if (tmt || tc > 0) { + if (TraceLoopPredicate) { + tty->print_cr("too many predicate traps: %d", tc); + C->method()->print(); // which method has too many predicate traps + tty->print_cr(""); + } + return false; + } + + CountedLoopNode *cl = NULL; + if (loop->_head->is_CountedLoop()) { + cl = loop->_head->as_CountedLoop(); + // do nothing for iteration-splitted loops + if(!cl->is_normal_loop()) return false; + } + + LoopNode *lpn = loop->_head->as_Loop(); + Node* entry = lpn->in(LoopNode::EntryControl); + + ProjNode *predicate_proj = find_predicate_insertion_point(entry); + if (!predicate_proj){ +#ifndef PRODUCT + if (TraceLoopPredicate) { + tty->print("missing predicate:"); + loop->dump_head(); + } +#endif + return false; + } + + ConNode* zero = _igvn.intcon(0); + set_ctrl(zero, C->root()); + Node *cond_false = new (C, 2) Conv2BNode(zero); + register_new_node(cond_false, C->root()); + ConNode* one = _igvn.intcon(1); + set_ctrl(one, C->root()); + Node *cond_true = new (C, 2) Conv2BNode(one); + register_new_node(cond_true, C->root()); + + ResourceArea *area = Thread::current()->resource_area(); + Invariance invar(area, loop); + + // Create list of if-projs such that a newer proj dominates all older + // projs in the list, and they all dominate loop->tail() + Node_List if_proj_list(area); + LoopNode *head = loop->_head->as_Loop(); + Node *current_proj = loop->tail(); //start from tail + while ( current_proj != head ) { + if (loop == get_loop(current_proj) && // still in the loop ? + current_proj->is_Proj() && // is a projection ? + current_proj->in(0)->Opcode() == Op_If) { // is a if projection ? + if_proj_list.push(current_proj); + } + current_proj = idom(current_proj); + } + + bool hoisted = false; // true if at least one proj is promoted + while (if_proj_list.size() > 0) { + // Following are changed to nonnull when a predicate can be hoisted + ProjNode* new_predicate_proj = NULL; + BoolNode* new_predicate_bol = NULL; + + ProjNode* proj = if_proj_list.pop()->as_Proj(); + IfNode* iff = proj->in(0)->as_If(); + + if (!is_uncommon_trap_if_pattern(proj)) { + if (loop->is_loop_exit(iff)) { + // stop processing the remaining projs in the list because the execution of them + // depends on the condition of "iff" (iff->in(1)). + break; + } else { + // Both arms are inside the loop. There are two cases: + // (1) there is one backward branch. In this case, any remaining proj + // in the if_proj list post-dominates "iff". So, the condition of "iff" + // does not determine the execution the remining projs directly, and we + // can safely continue. + // (2) both arms are forwarded, i.e. a diamond shape. In this case, "proj" + // does not dominate loop->tail(), so it can not be in the if_proj list. + continue; + } + } + + Node* test = iff->in(1); + if (!test->is_Bool()){ //Conv2B, ... + continue; + } + BoolNode* bol = test->as_Bool(); + if (invar.is_invariant(bol)) { + // Invariant test + new_predicate_proj = create_new_if_for_predicate(predicate_proj); + Node* ctrl = new_predicate_proj->in(0)->as_If()->in(0); + new_predicate_bol = invar.clone(bol, ctrl)->as_Bool(); + if (TraceLoopPredicate) tty->print("invariant"); + } else if (cl != NULL && loop->is_range_check_if(iff, this, invar)) { + // Range check (only for counted loops) + new_predicate_proj = create_new_if_for_predicate(predicate_proj); + Node *ctrl = new_predicate_proj->in(0)->as_If()->in(0); + const Node* cmp = bol->in(1)->as_Cmp(); + Node* idx = cmp->in(1); + assert(!invar.is_invariant(idx), "index is variant"); + assert(cmp->in(2)->Opcode() == Op_LoadRange, "must be"); + LoadRangeNode* ld_rng = (LoadRangeNode*)cmp->in(2); // LoadRangeNode + assert(invar.is_invariant(ld_rng), "load range must be invariant"); + ld_rng = (LoadRangeNode*)invar.clone(ld_rng, ctrl); + int scale = 1; + Node* offset = zero; + bool ok = is_scaled_iv_plus_offset(idx, cl->phi(), &scale, &offset); + assert(ok, "must be index expression"); + if (offset && offset != zero) { + assert(invar.is_invariant(offset), "offset must be loop invariant"); + offset = invar.clone(offset, ctrl); + } + Node* init = cl->init_trip(); + Node* limit = cl->limit(); + Node* stride = cl->stride(); + new_predicate_bol = rc_predicate(ctrl, scale, offset, init, limit, stride, ld_rng); + if (TraceLoopPredicate) tty->print("range check"); + } + + if (new_predicate_proj == NULL) { + // The other proj of the "iff" is a uncommon trap projection, and we can assume + // the other proj will not be executed ("executed" means uct raised). + continue; + } else { + // Success - attach condition (new_predicate_bol) to predicate if + invar.map_ctrl(proj, new_predicate_proj); // so that invariance test can be appropriate + IfNode* new_iff = new_predicate_proj->in(0)->as_If(); + + // Negate test if necessary + if (proj->_con != predicate_proj->_con) { + new_predicate_bol = new (C, 2) BoolNode(new_predicate_bol->in(1), new_predicate_bol->_test.negate()); + register_new_node(new_predicate_bol, new_iff->in(0)); + if (TraceLoopPredicate) tty->print_cr(" if negated: %d", iff->_idx); + } else { + if (TraceLoopPredicate) tty->print_cr(" if: %d", iff->_idx); + } + + _igvn.hash_delete(new_iff); + new_iff->set_req(1, new_predicate_bol); + + _igvn.hash_delete(iff); + iff->set_req(1, proj->is_IfFalse() ? cond_false : cond_true); + + Node* ctrl = new_predicate_proj; // new control + ProjNode* dp = proj; // old control + assert(get_loop(dp) == loop, "guarenteed at the time of collecting proj"); + // Find nodes (depends only on the test) off the surviving projection; + // move them outside the loop with the control of proj_clone + for (DUIterator_Fast imax, i = dp->fast_outs(imax); i < imax; i++) { + Node* cd = dp->fast_out(i); // Control-dependent node + if (cd->depends_only_on_test()) { + assert(cd->in(0) == dp, ""); + _igvn.hash_delete(cd); + cd->set_req(0, ctrl); // ctrl, not NULL + set_early_ctrl(cd); + _igvn._worklist.push(cd); + IdealLoopTree *new_loop = get_loop(get_ctrl(cd)); + if (new_loop != loop) { + if (!loop->_child) loop->_body.yank(cd); + if (!new_loop->_child ) new_loop->_body.push(cd); + } + --i; + --imax; + } + } + + hoisted = true; + C->set_major_progress(); + } + } // end while + +#ifndef PRODUCT + // report that the loop predication has been actually performed + // for this loop + if (TraceLoopPredicate && hoisted) { + tty->print("Loop Predication Performed:"); + loop->dump_head(); + } +#endif + + return hoisted; +} + +//------------------------------loop_predication-------------------------------- +// driver routine for loop predication optimization +bool IdealLoopTree::loop_predication( PhaseIdealLoop *phase) { + bool hoisted = false; + // Recursively promote predicates + if ( _child ) { + hoisted = _child->loop_predication( phase); + } + + // self + if (!_irreducible && !tail()->is_top()) { + hoisted |= phase->loop_predication_impl(this); + } + + if ( _next ) { //sibling + hoisted |= _next->loop_predication( phase); + } + + return hoisted; +} diff --git a/hotspot/src/share/vm/opto/loopnode.cpp b/hotspot/src/share/vm/opto/loopnode.cpp index a1d87225203..b662aa29328 100644 --- a/hotspot/src/share/vm/opto/loopnode.cpp +++ b/hotspot/src/share/vm/opto/loopnode.cpp @@ -1279,7 +1279,8 @@ void IdealLoopTree::counted_loop( PhaseIdealLoop *phase ) { // Visit all children, looking for Phis for (DUIterator i = cl->outs(); cl->has_out(i); i++) { Node *out = cl->out(i); - if (!out->is_Phi() || out == phi) continue; // Looking for other phis + // Look for other phis (secondary IVs). Skip dead ones + if (!out->is_Phi() || out == phi || !phase->has_node(out)) continue; PhiNode* phi2 = out->as_Phi(); Node *incr2 = phi2->in( LoopNode::LoopBackControl ); // Look for induction variables of the form: X += constant @@ -1419,11 +1420,57 @@ static void log_loop_tree(IdealLoopTree* root, IdealLoopTree* loop, CompileLog* } } +//---------------------collect_potentially_useful_predicates----------------------- +// Helper function to collect potentially useful predicates to prevent them from +// being eliminated by PhaseIdealLoop::eliminate_useless_predicates +void PhaseIdealLoop::collect_potentially_useful_predicates( + IdealLoopTree * loop, Unique_Node_List &useful_predicates) { + if (loop->_child) { // child + collect_potentially_useful_predicates(loop->_child, useful_predicates); + } + + // self (only loops that we can apply loop predication may use their predicates) + if (loop->_head->is_Loop() && + !loop->_irreducible && + !loop->tail()->is_top()) { + LoopNode *lpn = loop->_head->as_Loop(); + Node* entry = lpn->in(LoopNode::EntryControl); + ProjNode *predicate_proj = find_predicate_insertion_point(entry); + if (predicate_proj != NULL ) { // right pattern that can be used by loop predication + assert(entry->in(0)->in(1)->in(1)->Opcode()==Op_Opaque1, "must be"); + useful_predicates.push(entry->in(0)->in(1)->in(1)); // good one + } + } + + if ( loop->_next ) { // sibling + collect_potentially_useful_predicates(loop->_next, useful_predicates); + } +} + +//------------------------eliminate_useless_predicates----------------------------- +// Eliminate all inserted predicates if they could not be used by loop predication. +void PhaseIdealLoop::eliminate_useless_predicates() { + if (C->predicate_count() == 0) return; // no predicate left + + Unique_Node_List useful_predicates; // to store useful predicates + if (C->has_loops()) { + collect_potentially_useful_predicates(_ltree_root->_child, useful_predicates); + } + + for (int i = C->predicate_count(); i > 0; i--) { + Node * n = C->predicate_opaque1_node(i-1); + assert(n->Opcode() == Op_Opaque1, "must be"); + if (!useful_predicates.member(n)) { // not in the useful list + _igvn.replace_node(n, n->in(1)); + } + } +} + //============================================================================= //----------------------------build_and_optimize------------------------------- // Create a PhaseLoop. Build the ideal Loop tree. Map each Ideal Node to // its corresponding LoopNode. If 'optimize' is true, do some loop cleanups. -void PhaseIdealLoop::build_and_optimize(bool do_split_ifs) { +void PhaseIdealLoop::build_and_optimize(bool do_split_ifs, bool do_loop_pred) { int old_progress = C->major_progress(); // Reset major-progress flag for the driver's heuristics @@ -1576,6 +1623,12 @@ void PhaseIdealLoop::build_and_optimize(bool do_split_ifs) { return; } + // some parser-inserted loop predicates could never be used by loop + // predication. Eliminate them before loop optimization + if (UseLoopPredicate) { + eliminate_useless_predicates(); + } + // clear out the dead code while(_deadlist.size()) { _igvn.remove_globally_dead_node(_deadlist.pop()); @@ -1602,7 +1655,7 @@ void PhaseIdealLoop::build_and_optimize(bool do_split_ifs) { // Because RCE opportunities can be masked by split_thru_phi, // look for RCE candidates and inhibit split_thru_phi // on just their loop-phi's for this pass of loop opts - if( SplitIfBlocks && do_split_ifs ) { + if (SplitIfBlocks && do_split_ifs) { if (lpt->policy_range_check(this)) { lpt->_rce_candidate = 1; // = true } @@ -1618,12 +1671,17 @@ void PhaseIdealLoop::build_and_optimize(bool do_split_ifs) { NOT_PRODUCT( if( VerifyLoopOptimizations ) verify(); ); } + // Perform loop predication before iteration splitting + if (do_loop_pred && C->has_loops() && !C->major_progress()) { + _ltree_root->_child->loop_predication(this); + } + // Perform iteration-splitting on inner loops. Split iterations to avoid // range checks or one-shot null checks. // If split-if's didn't hack the graph too bad (no CFG changes) // then do loop opts. - if( C->has_loops() && !C->major_progress() ) { + if (C->has_loops() && !C->major_progress()) { memset( worklist.adr(), 0, worklist.Size()*sizeof(Node*) ); _ltree_root->_child->iteration_split( this, worklist ); // No verify after peeling! GCM has hoisted code out of the loop. @@ -1635,7 +1693,7 @@ void PhaseIdealLoop::build_and_optimize(bool do_split_ifs) { // Do verify graph edges in any case NOT_PRODUCT( C->verify_graph_edges(); ); - if( !do_split_ifs ) { + if (!do_split_ifs) { // We saw major progress in Split-If to get here. We forced a // pass with unrolling and not split-if, however more split-if's // might make progress. If the unrolling didn't make progress @@ -2762,6 +2820,22 @@ void PhaseIdealLoop::build_loop_late_post( Node *n ) { Node *legal = LCA; // Walk 'legal' up the IDOM chain Node *least = legal; // Best legal position so far while( early != legal ) { // While not at earliest legal +#ifdef ASSERT + if (legal->is_Start() && !early->is_Root()) { + // Bad graph. Print idom path and fail. + tty->print_cr( "Bad graph detected in build_loop_late"); + tty->print("n: ");n->dump(); tty->cr(); + tty->print("early: ");early->dump(); tty->cr(); + int ct = 0; + Node *dbg_legal = LCA; + while(!dbg_legal->is_Start() && ct < 100) { + tty->print("idom[%d] ",ct); dbg_legal->dump(); tty->cr(); + ct++; + dbg_legal = idom(dbg_legal); + } + assert(false, "Bad graph detected in build_loop_late"); + } +#endif // Find least loop nesting depth legal = idom(legal); // Bump up the IDOM tree // Check for lower nesting depth diff --git a/hotspot/src/share/vm/opto/loopnode.hpp b/hotspot/src/share/vm/opto/loopnode.hpp index 892095595ed..e34cfcb18a3 100644 --- a/hotspot/src/share/vm/opto/loopnode.hpp +++ b/hotspot/src/share/vm/opto/loopnode.hpp @@ -30,6 +30,7 @@ class LoopNode; class Node; class PhaseIdealLoop; class VectorSet; +class Invariance; struct small_cache; // @@ -325,6 +326,10 @@ public: // Returns TRUE if loop tree is structurally changed. bool beautify_loops( PhaseIdealLoop *phase ); + // Perform optimization to use the loop predicates for null checks and range checks. + // Applies to any loop level (not just the innermost one) + bool loop_predication( PhaseIdealLoop *phase); + // Perform iteration-splitting on inner loops. Split iterations to // avoid range checks or one-shot null checks. Returns false if the // current round of loop opts should stop. @@ -395,6 +400,9 @@ public: // into longer memory ops, we may want to increase alignment. bool policy_align( PhaseIdealLoop *phase ) const; + // Return TRUE if "iff" is a range check. + bool is_range_check_if(IfNode *iff, PhaseIdealLoop *phase, Invariance& invar) const; + // Compute loop trip count from profile data void compute_profile_trip_cnt( PhaseIdealLoop *phase ); @@ -521,9 +529,6 @@ class PhaseIdealLoop : public PhaseTransform { } Node *dom_lca_for_get_late_ctrl_internal( Node *lca, Node *n, Node *tag ); - // true if CFG node d dominates CFG node n - bool is_dominator(Node *d, Node *n); - // Helper function for directing control inputs away from CFG split // points. Node *find_non_split_ctrl( Node *ctrl ) const { @@ -572,6 +577,17 @@ public: assert(n == find_non_split_ctrl(n), "must return legal ctrl" ); return n; } + // true if CFG node d dominates CFG node n + bool is_dominator(Node *d, Node *n); + // return get_ctrl for a data node and self(n) for a CFG node + Node* ctrl_or_self(Node* n) { + if (has_ctrl(n)) + return get_ctrl(n); + else { + assert (n->is_CFG(), "must be a CFG node"); + return n; + } + } private: Node *get_ctrl_no_update( Node *i ) const { @@ -600,7 +616,7 @@ private: // Lazy-dazy update of 'get_ctrl' and 'idom_at' mechanisms. Replace // the 'old_node' with 'new_node'. Kill old-node. Add a reference // from old_node to new_node to support the lazy update. Reference - // replaces loop reference, since that is not neede for dead node. + // replaces loop reference, since that is not needed for dead node. public: void lazy_update( Node *old_node, Node *new_node ) { assert( old_node != new_node, "no cycles please" ); @@ -679,11 +695,11 @@ private: _dom_lca_tags(C->comp_arena()), _verify_me(NULL), _verify_only(true) { - build_and_optimize(false); + build_and_optimize(false, false); } // build the loop tree and perform any requested optimizations - void build_and_optimize(bool do_split_if); + void build_and_optimize(bool do_split_if, bool do_loop_pred); public: // Dominators for the sea of nodes @@ -694,13 +710,13 @@ public: Node *dom_lca_internal( Node *n1, Node *n2 ) const; // Compute the Ideal Node to Loop mapping - PhaseIdealLoop( PhaseIterGVN &igvn, bool do_split_ifs) : + PhaseIdealLoop( PhaseIterGVN &igvn, bool do_split_ifs, bool do_loop_pred) : PhaseTransform(Ideal_Loop), _igvn(igvn), _dom_lca_tags(C->comp_arena()), _verify_me(NULL), _verify_only(false) { - build_and_optimize(do_split_ifs); + build_and_optimize(do_split_ifs, do_loop_pred); } // Verify that verify_me made the same decisions as a fresh run. @@ -710,7 +726,7 @@ public: _dom_lca_tags(C->comp_arena()), _verify_me(verify_me), _verify_only(false) { - build_and_optimize(false); + build_and_optimize(false, false); } // Build and verify the loop tree without modifying the graph. This @@ -790,6 +806,30 @@ public: // Return true if exp is a scaled induction var plus (or minus) constant bool is_scaled_iv_plus_offset(Node* exp, Node* iv, int* p_scale, Node** p_offset, int depth = 0); + // Return true if proj is for "proj->[region->..]call_uct" + bool is_uncommon_trap_proj(ProjNode* proj, bool must_reason_predicate = false); + // Return true for "if(test)-> proj -> ... + // | + // V + // other_proj->[region->..]call_uct" + bool is_uncommon_trap_if_pattern(ProjNode* proj, bool must_reason_predicate = false); + // Create a new if above the uncommon_trap_if_pattern for the predicate to be promoted + ProjNode* create_new_if_for_predicate(ProjNode* cont_proj); + // Find a good location to insert a predicate + ProjNode* find_predicate_insertion_point(Node* start_c); + // Construct a range check for a predicate if + BoolNode* rc_predicate(Node* ctrl, + int scale, Node* offset, + Node* init, Node* limit, Node* stride, + Node* range); + + // Implementation of the loop predication to promote checks outside the loop + bool loop_predication_impl(IdealLoopTree *loop); + + // Helper function to collect predicate for eliminating the useless ones + void collect_potentially_useful_predicates(IdealLoopTree *loop, Unique_Node_List &predicate_opaque1); + void eliminate_useless_predicates(); + // Eliminate range-checks and other trip-counter vs loop-invariant tests. void do_range_check( IdealLoopTree *loop, Node_List &old_new ); @@ -906,7 +946,6 @@ private: const TypeInt* filtered_type_from_dominators( Node* val, Node *val_ctrl); // Helper functions - void register_new_node( Node *n, Node *blk ); Node *spinup( Node *iff, Node *new_false, Node *new_true, Node *region, Node *phi, small_cache *cache ); Node *find_use_block( Node *use, Node *def, Node *old_false, Node *new_false, Node *old_true, Node *new_true ); void handle_use( Node *use, Node *def, small_cache *cache, Node *region_dom, Node *new_false, Node *new_true, Node *old_false, Node *old_true ); @@ -918,6 +957,7 @@ private: public: void set_created_loop_node() { _created_loop_node = true; } bool created_loop_node() { return _created_loop_node; } + void register_new_node( Node *n, Node *blk ); #ifndef PRODUCT void dump( ) const; diff --git a/hotspot/src/share/vm/opto/loopopts.cpp b/hotspot/src/share/vm/opto/loopopts.cpp index 68e5f468c10..05295751f1f 100644 --- a/hotspot/src/share/vm/opto/loopopts.cpp +++ b/hotspot/src/share/vm/opto/loopopts.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,7 +47,7 @@ Node *PhaseIdealLoop::split_thru_phi( Node *n, Node *region, int policy ) { int offset = t_oop->offset(); phi = new (C,region->req()) PhiNode(region, type, NULL, iid, index, offset); } else { - phi = new (C,region->req()) PhiNode(region, type); + phi = PhiNode::make_blank(region, n); } uint old_unique = C->unique(); for( uint i = 1; i < region->req(); i++ ) { diff --git a/hotspot/src/share/vm/opto/machnode.cpp b/hotspot/src/share/vm/opto/machnode.cpp index 76121704b5f..0e9d4c6e819 100644 --- a/hotspot/src/share/vm/opto/machnode.cpp +++ b/hotspot/src/share/vm/opto/machnode.cpp @@ -636,7 +636,9 @@ uint MachCallJavaNode::cmp( const Node &n ) const { } #ifndef PRODUCT void MachCallJavaNode::dump_spec(outputStream *st) const { - if( _method ) { + if (_method_handle_invoke) + st->print("MethodHandle "); + if (_method) { _method->print_short_name(st); st->print(" "); } @@ -644,6 +646,20 @@ void MachCallJavaNode::dump_spec(outputStream *st) const { } #endif +//------------------------------Registers-------------------------------------- +const RegMask &MachCallJavaNode::in_RegMask(uint idx) const { + // Values in the domain use the users calling convention, embodied in the + // _in_rms array of RegMasks. + if (idx < tf()->domain()->cnt()) return _in_rms[idx]; + // Values outside the domain represent debug info + Matcher* m = Compile::current()->matcher(); + // If this call is a MethodHandle invoke we have to use a different + // debugmask which does not include the register we use to save the + // SP over MH invokes. + RegMask** debugmask = _method_handle_invoke ? m->idealreg2mhdebugmask : m->idealreg2debugmask; + return *debugmask[in(idx)->ideal_reg()]; +} + //============================================================================= uint MachCallStaticJavaNode::size_of() const { return sizeof(*this); } uint MachCallStaticJavaNode::cmp( const Node &n ) const { diff --git a/hotspot/src/share/vm/opto/machnode.hpp b/hotspot/src/share/vm/opto/machnode.hpp index 3c24a3e5c65..128b55fdde1 100644 --- a/hotspot/src/share/vm/opto/machnode.hpp +++ b/hotspot/src/share/vm/opto/machnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -232,7 +232,7 @@ public: // Expand method for MachNode, replaces nodes representing pseudo // instructions with a set of nodes which represent real machine // instructions and compute the same value. - virtual MachNode *Expand( State *, Node_List &proj_list ) { return this; } + virtual MachNode *Expand( State *, Node_List &proj_list, Node* mem ) { return this; } // Bottom_type call; value comes from operand0 virtual const class Type *bottom_type() const { return _opnds[0]->type(); } @@ -662,9 +662,13 @@ public: ciMethod* _method; // Method being direct called int _bci; // Byte Code index of call byte code bool _optimized_virtual; // Tells if node is a static call or an optimized virtual + bool _method_handle_invoke; // Tells if the call has to preserve SP MachCallJavaNode() : MachCallNode() { init_class_id(Class_MachCallJava); } + + virtual const RegMask &in_RegMask(uint) const; + #ifndef PRODUCT virtual void dump_spec(outputStream *st) const; #endif diff --git a/hotspot/src/share/vm/opto/macro.cpp b/hotspot/src/share/vm/opto/macro.cpp index e2421a7f3d3..2fdc335b918 100644 --- a/hotspot/src/share/vm/opto/macro.cpp +++ b/hotspot/src/share/vm/opto/macro.cpp @@ -316,6 +316,21 @@ static Node *scan_mem_chain(Node *mem, int alias_idx, int offset, Node *start_me assert(adr_idx == Compile::AliasIdxRaw, "address must match or be raw"); } mem = mem->in(MemNode::Memory); + } else if (mem->is_ClearArray()) { + if (!ClearArrayNode::step_through(&mem, alloc->_idx, phase)) { + // Can not bypass initialization of the instance + // we are looking. + debug_only(intptr_t offset;) + assert(alloc == AllocateNode::Ideal_allocation(mem->in(3), phase, offset), "sanity"); + InitializeNode* init = alloc->as_Allocate()->initialization(); + // We are looking for stored value, return Initialize node + // or memory edge from Allocate node. + if (init != NULL) + return init; + else + return alloc->in(TypeFunc::Memory); // It will produce zero value (see callers). + } + // Otherwise skip it (the call updated 'mem' value). } else if (mem->Opcode() == Op_SCMemProj) { assert(mem->in(0)->is_LoadStore(), "sanity"); const TypePtr* atype = mem->in(0)->in(MemNode::Address)->bottom_type()->is_ptr(); @@ -823,6 +838,18 @@ void PhaseMacroExpand::process_users_of_allocation(AllocateNode *alloc) { Node *n = use->last_out(k); uint oc2 = use->outcnt(); if (n->is_Store()) { +#ifdef ASSERT + // Verify that there is no dependent MemBarVolatile nodes, + // they should be removed during IGVN, see MemBarNode::Ideal(). + for (DUIterator_Fast pmax, p = n->fast_outs(pmax); + p < pmax; p++) { + Node* mb = n->fast_out(p); + assert(mb->is_Initialize() || !mb->is_MemBar() || + mb->req() <= MemBarNode::Precedent || + mb->in(MemBarNode::Precedent) != n, + "MemBarVolatile should be eliminated for non-escaping object"); + } +#endif _igvn.replace_node(n, n->in(MemNode::Memory)); } else { eliminate_card_mark(n); @@ -912,15 +939,29 @@ bool PhaseMacroExpand::eliminate_allocate_node(AllocateNode *alloc) { return false; } + CompileLog* log = C->log(); + if (log != NULL) { + Node* klass = alloc->in(AllocateNode::KlassNode); + const TypeKlassPtr* tklass = _igvn.type(klass)->is_klassptr(); + log->head("eliminate_allocation type='%d'", + log->identify(tklass->klass())); + JVMState* p = alloc->jvms(); + while (p != NULL) { + log->elem("jvms bci='%d' method='%d'", p->bci(), log->identify(p->method())); + p = p->caller(); + } + log->tail("eliminate_allocation"); + } + process_users_of_allocation(alloc); #ifndef PRODUCT -if (PrintEliminateAllocations) { - if (alloc->is_AllocateArray()) - tty->print_cr("++++ Eliminated: %d AllocateArray", alloc->_idx); - else - tty->print_cr("++++ Eliminated: %d Allocate", alloc->_idx); -} + if (PrintEliminateAllocations) { + if (alloc->is_AllocateArray()) + tty->print_cr("++++ Eliminated: %d AllocateArray", alloc->_idx); + else + tty->print_cr("++++ Eliminated: %d Allocate", alloc->_idx); + } #endif return true; @@ -1639,6 +1680,18 @@ bool PhaseMacroExpand::eliminate_locking_node(AbstractLockNode *alock) { } // if (!oldbox->is_eliminated()) } // if (alock->is_Lock() && !lock->is_coarsened()) + CompileLog* log = C->log(); + if (log != NULL) { + log->head("eliminate_lock lock='%d'", + alock->is_Lock()); + JVMState* p = alock->jvms(); + while (p != NULL) { + log->elem("jvms bci='%d' method='%d'", p->bci(), log->identify(p->method())); + p = p->caller(); + } + log->tail("eliminate_lock"); + } + #ifndef PRODUCT if (PrintEliminateLocks) { if (alock->is_Lock()) { diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp index 57d2c5e72ae..c1e6e70657a 100644 --- a/hotspot/src/share/vm/opto/matcher.cpp +++ b/hotspot/src/share/vm/opto/matcher.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -70,19 +70,27 @@ Matcher::Matcher( Node_List &proj_list ) : _dontcare(&_states_arena) { C->set_matcher(this); - idealreg2spillmask[Op_RegI] = NULL; - idealreg2spillmask[Op_RegN] = NULL; - idealreg2spillmask[Op_RegL] = NULL; - idealreg2spillmask[Op_RegF] = NULL; - idealreg2spillmask[Op_RegD] = NULL; - idealreg2spillmask[Op_RegP] = NULL; + idealreg2spillmask [Op_RegI] = NULL; + idealreg2spillmask [Op_RegN] = NULL; + idealreg2spillmask [Op_RegL] = NULL; + idealreg2spillmask [Op_RegF] = NULL; + idealreg2spillmask [Op_RegD] = NULL; + idealreg2spillmask [Op_RegP] = NULL; + + idealreg2debugmask [Op_RegI] = NULL; + idealreg2debugmask [Op_RegN] = NULL; + idealreg2debugmask [Op_RegL] = NULL; + idealreg2debugmask [Op_RegF] = NULL; + idealreg2debugmask [Op_RegD] = NULL; + idealreg2debugmask [Op_RegP] = NULL; + + idealreg2mhdebugmask[Op_RegI] = NULL; + idealreg2mhdebugmask[Op_RegN] = NULL; + idealreg2mhdebugmask[Op_RegL] = NULL; + idealreg2mhdebugmask[Op_RegF] = NULL; + idealreg2mhdebugmask[Op_RegD] = NULL; + idealreg2mhdebugmask[Op_RegP] = NULL; - idealreg2debugmask[Op_RegI] = NULL; - idealreg2debugmask[Op_RegN] = NULL; - idealreg2debugmask[Op_RegL] = NULL; - idealreg2debugmask[Op_RegF] = NULL; - idealreg2debugmask[Op_RegD] = NULL; - idealreg2debugmask[Op_RegP] = NULL; debug_only(_mem_node = NULL;) // Ideal memory node consumed by mach node } @@ -389,19 +397,28 @@ static RegMask *init_input_masks( uint size, RegMask &ret_adr, RegMask &fp ) { void Matcher::init_first_stack_mask() { // Allocate storage for spill masks as masks for the appropriate load type. - RegMask *rms = (RegMask*)C->comp_arena()->Amalloc_D(sizeof(RegMask)*12); - idealreg2spillmask[Op_RegN] = &rms[0]; - idealreg2spillmask[Op_RegI] = &rms[1]; - idealreg2spillmask[Op_RegL] = &rms[2]; - idealreg2spillmask[Op_RegF] = &rms[3]; - idealreg2spillmask[Op_RegD] = &rms[4]; - idealreg2spillmask[Op_RegP] = &rms[5]; - idealreg2debugmask[Op_RegN] = &rms[6]; - idealreg2debugmask[Op_RegI] = &rms[7]; - idealreg2debugmask[Op_RegL] = &rms[8]; - idealreg2debugmask[Op_RegF] = &rms[9]; - idealreg2debugmask[Op_RegD] = &rms[10]; - idealreg2debugmask[Op_RegP] = &rms[11]; + RegMask *rms = (RegMask*)C->comp_arena()->Amalloc_D(sizeof(RegMask) * 3*6); + + idealreg2spillmask [Op_RegN] = &rms[0]; + idealreg2spillmask [Op_RegI] = &rms[1]; + idealreg2spillmask [Op_RegL] = &rms[2]; + idealreg2spillmask [Op_RegF] = &rms[3]; + idealreg2spillmask [Op_RegD] = &rms[4]; + idealreg2spillmask [Op_RegP] = &rms[5]; + + idealreg2debugmask [Op_RegN] = &rms[6]; + idealreg2debugmask [Op_RegI] = &rms[7]; + idealreg2debugmask [Op_RegL] = &rms[8]; + idealreg2debugmask [Op_RegF] = &rms[9]; + idealreg2debugmask [Op_RegD] = &rms[10]; + idealreg2debugmask [Op_RegP] = &rms[11]; + + idealreg2mhdebugmask[Op_RegN] = &rms[12]; + idealreg2mhdebugmask[Op_RegI] = &rms[13]; + idealreg2mhdebugmask[Op_RegL] = &rms[14]; + idealreg2mhdebugmask[Op_RegF] = &rms[15]; + idealreg2mhdebugmask[Op_RegD] = &rms[16]; + idealreg2mhdebugmask[Op_RegP] = &rms[17]; OptoReg::Name i; @@ -442,12 +459,19 @@ void Matcher::init_first_stack_mask() { // Make up debug masks. Any spill slot plus callee-save registers. // Caller-save registers are assumed to be trashable by the various // inline-cache fixup routines. - *idealreg2debugmask[Op_RegN]= *idealreg2spillmask[Op_RegN]; - *idealreg2debugmask[Op_RegI]= *idealreg2spillmask[Op_RegI]; - *idealreg2debugmask[Op_RegL]= *idealreg2spillmask[Op_RegL]; - *idealreg2debugmask[Op_RegF]= *idealreg2spillmask[Op_RegF]; - *idealreg2debugmask[Op_RegD]= *idealreg2spillmask[Op_RegD]; - *idealreg2debugmask[Op_RegP]= *idealreg2spillmask[Op_RegP]; + *idealreg2debugmask [Op_RegN]= *idealreg2spillmask[Op_RegN]; + *idealreg2debugmask [Op_RegI]= *idealreg2spillmask[Op_RegI]; + *idealreg2debugmask [Op_RegL]= *idealreg2spillmask[Op_RegL]; + *idealreg2debugmask [Op_RegF]= *idealreg2spillmask[Op_RegF]; + *idealreg2debugmask [Op_RegD]= *idealreg2spillmask[Op_RegD]; + *idealreg2debugmask [Op_RegP]= *idealreg2spillmask[Op_RegP]; + + *idealreg2mhdebugmask[Op_RegN]= *idealreg2spillmask[Op_RegN]; + *idealreg2mhdebugmask[Op_RegI]= *idealreg2spillmask[Op_RegI]; + *idealreg2mhdebugmask[Op_RegL]= *idealreg2spillmask[Op_RegL]; + *idealreg2mhdebugmask[Op_RegF]= *idealreg2spillmask[Op_RegF]; + *idealreg2mhdebugmask[Op_RegD]= *idealreg2spillmask[Op_RegD]; + *idealreg2mhdebugmask[Op_RegP]= *idealreg2spillmask[Op_RegP]; // Prevent stub compilations from attempting to reference // callee-saved registers from debug info @@ -458,14 +482,31 @@ void Matcher::init_first_stack_mask() { if( _register_save_policy[i] == 'C' || _register_save_policy[i] == 'A' || (_register_save_policy[i] == 'E' && exclude_soe) ) { - idealreg2debugmask[Op_RegN]->Remove(i); - idealreg2debugmask[Op_RegI]->Remove(i); // Exclude save-on-call - idealreg2debugmask[Op_RegL]->Remove(i); // registers from debug - idealreg2debugmask[Op_RegF]->Remove(i); // masks - idealreg2debugmask[Op_RegD]->Remove(i); - idealreg2debugmask[Op_RegP]->Remove(i); + idealreg2debugmask [Op_RegN]->Remove(i); + idealreg2debugmask [Op_RegI]->Remove(i); // Exclude save-on-call + idealreg2debugmask [Op_RegL]->Remove(i); // registers from debug + idealreg2debugmask [Op_RegF]->Remove(i); // masks + idealreg2debugmask [Op_RegD]->Remove(i); + idealreg2debugmask [Op_RegP]->Remove(i); + + idealreg2mhdebugmask[Op_RegN]->Remove(i); + idealreg2mhdebugmask[Op_RegI]->Remove(i); + idealreg2mhdebugmask[Op_RegL]->Remove(i); + idealreg2mhdebugmask[Op_RegF]->Remove(i); + idealreg2mhdebugmask[Op_RegD]->Remove(i); + idealreg2mhdebugmask[Op_RegP]->Remove(i); } } + + // Subtract the register we use to save the SP for MethodHandle + // invokes to from the debug mask. + const RegMask save_mask = method_handle_invoke_SP_save_mask(); + idealreg2mhdebugmask[Op_RegN]->SUBTRACT(save_mask); + idealreg2mhdebugmask[Op_RegI]->SUBTRACT(save_mask); + idealreg2mhdebugmask[Op_RegL]->SUBTRACT(save_mask); + idealreg2mhdebugmask[Op_RegF]->SUBTRACT(save_mask); + idealreg2mhdebugmask[Op_RegD]->SUBTRACT(save_mask); + idealreg2mhdebugmask[Op_RegP]->SUBTRACT(save_mask); } //---------------------------is_save_on_entry---------------------------------- @@ -989,6 +1030,7 @@ MachNode *Matcher::match_sfpt( SafePointNode *sfpt ) { CallNode *call; const TypeTuple *domain; ciMethod* method = NULL; + bool is_method_handle_invoke = false; // for special kill effects if( sfpt->is_Call() ) { call = sfpt->as_Call(); domain = call->tf()->domain(); @@ -1013,6 +1055,8 @@ MachNode *Matcher::match_sfpt( SafePointNode *sfpt ) { mcall_java->_method = method; mcall_java->_bci = call_java->_bci; mcall_java->_optimized_virtual = call_java->is_optimized_virtual(); + is_method_handle_invoke = call_java->is_method_handle_invoke(); + mcall_java->_method_handle_invoke = is_method_handle_invoke; if( mcall_java->is_MachCallStaticJava() ) mcall_java->as_MachCallStaticJava()->_name = call_java->as_CallStaticJava()->_name; @@ -1126,6 +1170,15 @@ MachNode *Matcher::match_sfpt( SafePointNode *sfpt ) { mcall->_argsize = out_arg_limit_per_call - begin_out_arg_area; } + if (is_method_handle_invoke) { + // Kill some extra stack space in case method handles want to do + // a little in-place argument insertion. + int regs_per_word = NOT_LP64(1) LP64_ONLY(2); // %%% make a global const! + out_arg_limit_per_call += MethodHandlePushLimit * regs_per_word; + // Do not update mcall->_argsize because (a) the extra space is not + // pushed as arguments and (b) _argsize is dead (not used anywhere). + } + // Compute the max stack slot killed by any call. These will not be // available for debug info, and will be used to adjust FIRST_STACK_mask // after all call sites have been visited. @@ -1527,7 +1580,7 @@ MachNode *Matcher::ReduceInst( State *s, int rule, Node *&mem ) { uint num_proj = _proj_list.size(); // Perform any 1-to-many expansions required - MachNode *ex = mach->Expand(s,_proj_list); + MachNode *ex = mach->Expand(s,_proj_list, mem); if( ex != mach ) { assert(ex->ideal_reg() == mach->ideal_reg(), "ideal types should match"); if( ex->in(1)->is_Con() ) @@ -1832,67 +1885,23 @@ void Matcher::find_shared( Node *n ) { case Op_Binary: // These are introduced in the Post_Visit state. ShouldNotReachHere(); break; - case Op_StoreB: // Do match these, despite no ideal reg - case Op_StoreC: - case Op_StoreCM: - case Op_StoreD: - case Op_StoreF: - case Op_StoreI: - case Op_StoreL: - case Op_StoreP: - case Op_StoreN: - case Op_Store16B: - case Op_Store8B: - case Op_Store4B: - case Op_Store8C: - case Op_Store4C: - case Op_Store2C: - case Op_Store4I: - case Op_Store2I: - case Op_Store2L: - case Op_Store4F: - case Op_Store2F: - case Op_Store2D: case Op_ClearArray: case Op_SafePoint: mem_op = true; break; - case Op_LoadB: - case Op_LoadUS: - case Op_LoadD: - case Op_LoadF: - case Op_LoadI: - case Op_LoadKlass: - case Op_LoadNKlass: - case Op_LoadL: - case Op_LoadS: - case Op_LoadP: - case Op_LoadN: - case Op_LoadRange: - case Op_LoadD_unaligned: - case Op_LoadL_unaligned: - case Op_Load16B: - case Op_Load8B: - case Op_Load4B: - case Op_Load4C: - case Op_Load2C: - case Op_Load8C: - case Op_Load8S: - case Op_Load4S: - case Op_Load2S: - case Op_Load4I: - case Op_Load2I: - case Op_Load2L: - case Op_Load4F: - case Op_Load2F: - case Op_Load2D: - mem_op = true; - // Must be root of match tree due to prior load conflict - if( C->subsume_loads() == false ) { - set_shared(n); + default: + if( n->is_Store() ) { + // Do match stores, despite no ideal reg + mem_op = true; + break; + } + if( n->is_Mem() ) { // Loads and LoadStores + mem_op = true; + // Loads must be root of match tree due to prior load conflict + if( C->subsume_loads() == false ) + set_shared(n); } // Fall into default case - default: if( !n->ideal_reg() ) set_dontcare(n); // Unmatchable Nodes } // end_switch @@ -1913,15 +1922,15 @@ void Matcher::find_shared( Node *n ) { continue; // for(int i = ...) } - // Clone addressing expressions as they are "free" in most instructions - if( mem_op && i == MemNode::Address && mop == Op_AddP ) { - if (m->in(AddPNode::Base)->Opcode() == Op_DecodeN) { - // Bases used in addresses must be shared but since - // they are shared through a DecodeN they may appear - // to have a single use so force sharing here. - set_shared(m->in(AddPNode::Base)->in(1)); - } + if( mop == Op_AddP && m->in(AddPNode::Base)->Opcode() == Op_DecodeN ) { + // Bases used in addresses must be shared but since + // they are shared through a DecodeN they may appear + // to have a single use so force sharing here. + set_shared(m->in(AddPNode::Base)->in(1)); + } + // Clone addressing expressions as they are "free" in memory access instructions + if( mem_op && i == MemNode::Address && mop == Op_AddP ) { // Some inputs for address expression are not put on stack // to avoid marking them as shared and forcing them into register // if they are used only in address expressions. diff --git a/hotspot/src/share/vm/opto/matcher.hpp b/hotspot/src/share/vm/opto/matcher.hpp index fe657c53421..b48303baa87 100644 --- a/hotspot/src/share/vm/opto/matcher.hpp +++ b/hotspot/src/share/vm/opto/matcher.hpp @@ -117,8 +117,9 @@ public: static const int base2reg[]; // Map Types to machine register types // Convert ideal machine register to a register mask for spill-loads static const RegMask *idealreg2regmask[]; - RegMask *idealreg2spillmask[_last_machine_leaf]; - RegMask *idealreg2debugmask[_last_machine_leaf]; + RegMask *idealreg2spillmask [_last_machine_leaf]; + RegMask *idealreg2debugmask [_last_machine_leaf]; + RegMask *idealreg2mhdebugmask[_last_machine_leaf]; void init_spill_mask( Node *ret ); // Convert machine register number to register mask static uint mreg2regmask_max; @@ -297,6 +298,8 @@ public: // Register for MODL projection of divmodL static RegMask modL_proj_mask(); + static const RegMask method_handle_invoke_SP_save_mask(); + // Java-Interpreter calling convention // (what you use when calling between compiled-Java and Interpreted-Java diff --git a/hotspot/src/share/vm/opto/memnode.cpp b/hotspot/src/share/vm/opto/memnode.cpp index b80f18c2e7d..4698add456b 100644 --- a/hotspot/src/share/vm/opto/memnode.cpp +++ b/hotspot/src/share/vm/opto/memnode.cpp @@ -123,6 +123,13 @@ Node *MemNode::optimize_simple_memory_chain(Node *mchain, const TypePtr *t_adr, } else { assert(false, "unexpected projection"); } + } else if (result->is_ClearArray()) { + if (!ClearArrayNode::step_through(&result, instance_id, phase)) { + // Can not bypass initialization of the instance + // we are looking for. + break; + } + // Otherwise skip it (the call updated 'result' value). } else if (result->is_MergeMem()) { result = step_through_mergemem(phase, result->as_MergeMem(), t_adr, NULL, tty); } @@ -255,6 +262,13 @@ Node *MemNode::Ideal_common(PhaseGVN *phase, bool can_reshape) { return NodeSentinel; // caller will return NULL } + // Do NOT remove or optimize the next lines: ensure a new alias index + // is allocated for an oop pointer type before Escape Analysis. + // Note: C++ will not remove it since the call has side effect. + if ( t_adr->isa_oopptr() ) { + int alias_idx = phase->C->get_alias_index(t_adr->is_ptr()); + } + #ifdef ASSERT Node* base = NULL; if (address->is_AddP()) @@ -530,6 +544,15 @@ Node* MemNode::find_previous_store(PhaseTransform* phase) { } else if (mem->is_Proj() && mem->in(0)->is_MemBar()) { mem = mem->in(0)->in(TypeFunc::Memory); continue; // (a) advance through independent MemBar memory + } else if (mem->is_ClearArray()) { + if (ClearArrayNode::step_through(&mem, (uint)addr_t->instance_id(), phase)) { + // (the call updated 'mem' value) + continue; // (a) advance through independent allocation memory + } else { + // Can not bypass initialization of the instance + // we are looking for. + return mem; + } } else if (mem->is_MergeMem()) { int alias_idx = phase->C->get_alias_index(adr_type()); mem = mem->as_MergeMem()->memory_at(alias_idx); @@ -1496,6 +1519,8 @@ const Type *LoadNode::Value( PhaseTransform *phase ) const { } } } else if (tp->base() == Type::InstPtr) { + const TypeInstPtr* tinst = tp->is_instptr(); + ciKlass* klass = tinst->klass(); assert( off != Type::OffsetBot || // arrays can be cast to Objects tp->is_oopptr()->klass()->is_java_lang_Object() || @@ -1503,6 +1528,25 @@ const Type *LoadNode::Value( PhaseTransform *phase ) const { phase->C->has_unsafe_access(), "Field accesses must be precise" ); // For oop loads, we expect the _type to be precise + if (OptimizeStringConcat && klass == phase->C->env()->String_klass() && + adr->is_AddP() && off != Type::OffsetBot) { + // For constant Strings treat the fields as compile time constants. + Node* base = adr->in(AddPNode::Base); + if (base->Opcode() == Op_ConP) { + const TypeOopPtr* t = phase->type(base)->isa_oopptr(); + ciObject* string = t->const_oop(); + ciConstant constant = string->as_instance()->field_value_by_offset(off); + if (constant.basic_type() == T_INT) { + return TypeInt::make(constant.as_int()); + } else if (constant.basic_type() == T_ARRAY) { + if (adr->bottom_type()->is_ptr_to_narrowoop()) { + return TypeNarrowOop::make_from_constant(constant.as_object()); + } else { + return TypeOopPtr::make_from_constant(constant.as_object()); + } + } + } + } } else if (tp->base() == Type::KlassPtr) { assert( off != Type::OffsetBot || // arrays can be cast to Objects @@ -2426,6 +2470,31 @@ Node *ClearArrayNode::Ideal(PhaseGVN *phase, bool can_reshape){ return mem; } +//----------------------------step_through---------------------------------- +// Return allocation input memory edge if it is different instance +// or itself if it is the one we are looking for. +bool ClearArrayNode::step_through(Node** np, uint instance_id, PhaseTransform* phase) { + Node* n = *np; + assert(n->is_ClearArray(), "sanity"); + intptr_t offset; + AllocateNode* alloc = AllocateNode::Ideal_allocation(n->in(3), phase, offset); + // This method is called only before Allocate nodes are expanded during + // macro nodes expansion. Before that ClearArray nodes are only generated + // in LibraryCallKit::generate_arraycopy() which follows allocations. + assert(alloc != NULL, "should have allocation"); + if (alloc->_idx == instance_id) { + // Can not bypass initialization of the instance we are looking for. + return false; + } + // Otherwise skip it. + InitializeNode* init = alloc->initialization(); + if (init != NULL) + *np = init->in(TypeFunc::Memory); + else + *np = alloc->in(TypeFunc::Memory); + return true; +} + //----------------------------clear_memory------------------------------------- // Generate code to initialize object storage to zero. Node* ClearArrayNode::clear_memory(Node* ctl, Node* mem, Node* dest, @@ -2599,7 +2668,30 @@ MemBarNode* MemBarNode::make(Compile* C, int opcode, int atp, Node* pn) { // Return a node which is more "ideal" than the current node. Strip out // control copies Node *MemBarNode::Ideal(PhaseGVN *phase, bool can_reshape) { - return remove_dead_region(phase, can_reshape) ? this : NULL; + if (remove_dead_region(phase, can_reshape)) return this; + + // Eliminate volatile MemBars for scalar replaced objects. + if (can_reshape && req() == (Precedent+1) && + (Opcode() == Op_MemBarAcquire || Opcode() == Op_MemBarVolatile)) { + // Volatile field loads and stores. + Node* my_mem = in(MemBarNode::Precedent); + if (my_mem != NULL && my_mem->is_Mem()) { + const TypeOopPtr* t_oop = my_mem->in(MemNode::Address)->bottom_type()->isa_oopptr(); + // Check for scalar replaced object reference. + if( t_oop != NULL && t_oop->is_known_instance_field() && + t_oop->offset() != Type::OffsetBot && + t_oop->offset() != Type::OffsetTop) { + // Replace MemBar projections by its inputs. + PhaseIterGVN* igvn = phase->is_IterGVN(); + igvn->replace_node(proj_out(TypeFunc::Memory), in(TypeFunc::Memory)); + igvn->replace_node(proj_out(TypeFunc::Control), in(TypeFunc::Control)); + // Must return either the original node (now dead) or a new node + // (Do not return a top here, since that would break the uniqueness of top.) + return new (phase->C, 1) ConINode(TypeInt::ZERO); + } + } + } + return NULL; } //------------------------------Value------------------------------------------ diff --git a/hotspot/src/share/vm/opto/memnode.hpp b/hotspot/src/share/vm/opto/memnode.hpp index a71df7d406a..918a8353310 100644 --- a/hotspot/src/share/vm/opto/memnode.hpp +++ b/hotspot/src/share/vm/opto/memnode.hpp @@ -583,9 +583,22 @@ public: // Preceeding equivalent StoreCMs may be eliminated. class StoreCMNode : public StoreNode { private: + virtual uint hash() const { return StoreNode::hash() + _oop_alias_idx; } + virtual uint cmp( const Node &n ) const { + return _oop_alias_idx == ((StoreCMNode&)n)._oop_alias_idx + && StoreNode::cmp(n); + } + virtual uint size_of() const { return sizeof(*this); } int _oop_alias_idx; // The alias_idx of OopStore + public: - StoreCMNode( Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, Node *oop_store, int oop_alias_idx ) : StoreNode(c,mem,adr,at,val,oop_store), _oop_alias_idx(oop_alias_idx) {} + StoreCMNode( Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, Node *oop_store, int oop_alias_idx ) : + StoreNode(c,mem,adr,at,val,oop_store), + _oop_alias_idx(oop_alias_idx) { + assert(_oop_alias_idx >= Compile::AliasIdxRaw || + _oop_alias_idx == Compile::AliasIdxBot && Compile::current()->AliasLevel() == 0, + "bad oop alias idx"); + } virtual int Opcode() const; virtual Node *Identity( PhaseTransform *phase ); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); @@ -717,7 +730,10 @@ public: //------------------------------ClearArray------------------------------------- class ClearArrayNode: public Node { public: - ClearArrayNode( Node *ctrl, Node *arymem, Node *word_cnt, Node *base ) : Node(ctrl,arymem,word_cnt,base) {} + ClearArrayNode( Node *ctrl, Node *arymem, Node *word_cnt, Node *base ) + : Node(ctrl,arymem,word_cnt,base) { + init_class_id(Class_ClearArray); + } virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::MEMORY; } // ClearArray modifies array elements, and so affects only the @@ -743,6 +759,9 @@ public: Node* start_offset, Node* end_offset, PhaseGVN* phase); + // Return allocation input memory edge if it is different instance + // or itself if it is the one we are looking for. + static bool step_through(Node** np, uint instance_id, PhaseTransform* phase); }; //------------------------------StrComp------------------------------------- diff --git a/hotspot/src/share/vm/opto/node.hpp b/hotspot/src/share/vm/opto/node.hpp index bad1607058e..92da96b40a2 100644 --- a/hotspot/src/share/vm/opto/node.hpp +++ b/hotspot/src/share/vm/opto/node.hpp @@ -47,6 +47,7 @@ class CallStaticJavaNode; class CatchNode; class CatchProjNode; class CheckCastPPNode; +class ClearArrayNode; class CmpNode; class CodeBuffer; class ConstraintCastNode; @@ -599,8 +600,9 @@ public: DEFINE_CLASS_ID(BoxLock, Node, 10) DEFINE_CLASS_ID(Add, Node, 11) DEFINE_CLASS_ID(Mul, Node, 12) + DEFINE_CLASS_ID(ClearArray, Node, 13) - _max_classes = ClassMask_Mul + _max_classes = ClassMask_ClearArray }; #undef DEFINE_CLASS_ID @@ -661,18 +663,25 @@ public: return (_flags & Flag_is_Call) != 0; } + CallNode* isa_Call() const { + return is_Call() ? as_Call() : NULL; + } + CallNode *as_Call() const { // Only for CallNode (not for MachCallNode) assert((_class_id & ClassMask_Call) == Class_Call, "invalid node class"); return (CallNode*)this; } - #define DEFINE_CLASS_QUERY(type) \ - bool is_##type() const { \ + #define DEFINE_CLASS_QUERY(type) \ + bool is_##type() const { \ return ((_class_id & ClassMask_##type) == Class_##type); \ - } \ - type##Node *as_##type() const { \ - assert(is_##type(), "invalid node class"); \ - return (type##Node*)this; \ + } \ + type##Node *as_##type() const { \ + assert(is_##type(), "invalid node class"); \ + return (type##Node*)this; \ + } \ + type##Node* isa_##type() const { \ + return (is_##type()) ? as_##type() : NULL; \ } DEFINE_CLASS_QUERY(AbstractLock) @@ -691,6 +700,7 @@ public: DEFINE_CLASS_QUERY(CatchProj) DEFINE_CLASS_QUERY(CheckCastPP) DEFINE_CLASS_QUERY(ConstraintCast) + DEFINE_CLASS_QUERY(ClearArray) DEFINE_CLASS_QUERY(CMove) DEFINE_CLASS_QUERY(Cmp) DEFINE_CLASS_QUERY(CountedLoop) @@ -1249,6 +1259,24 @@ Node* Node::last_out(DUIterator_Last& i) const { #undef I_VDUI_ONLY #undef VDUI_ONLY +// An Iterator that truly follows the iterator pattern. Doesn't +// support deletion but could be made to. +// +// for (SimpleDUIterator i(n); i.has_next(); i.next()) { +// Node* m = i.get(); +// +class SimpleDUIterator : public StackObj { + private: + Node* node; + DUIterator_Fast i; + DUIterator_Fast imax; + public: + SimpleDUIterator(Node* n): node(n), i(n->fast_outs(imax)) {} + bool has_next() { return i < imax; } + void next() { i++; } + Node* get() { return node->fast_out(i); } +}; + //----------------------------------------------------------------------------- // Map dense integer indices to Nodes. Uses classic doubling-array trick. @@ -1290,6 +1318,12 @@ class Node_List : public Node_Array { public: Node_List() : Node_Array(Thread::current()->resource_area()), _cnt(0) {} Node_List(Arena *a) : Node_Array(a), _cnt(0) {} + bool contains(Node* n) { + for (uint e = 0; e < size(); e++) { + if (at(e) == n) return true; + } + return false; + } void insert( uint i, Node *n ) { Node_Array::insert(i,n); _cnt++; } void remove( uint i ) { Node_Array::remove(i); _cnt--; } void push( Node *b ) { map(_cnt++,b); } diff --git a/hotspot/src/share/vm/opto/output.cpp b/hotspot/src/share/vm/opto/output.cpp index 3274fd4d9df..fb5db8e7791 100644 --- a/hotspot/src/share/vm/opto/output.cpp +++ b/hotspot/src/share/vm/opto/output.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -794,6 +794,8 @@ void Compile::Process_OopMap_Node(MachNode *mach, int current_offset) { #endif int safepoint_pc_offset = current_offset; + bool is_method_handle_invoke = false; + bool return_oop = false; // Add the safepoint in the DebugInfoRecorder if( !mach->is_MachCall() ) { @@ -801,6 +803,20 @@ void Compile::Process_OopMap_Node(MachNode *mach, int current_offset) { debug_info()->add_safepoint(safepoint_pc_offset, sfn->_oop_map); } else { mcall = mach->as_MachCall(); + + // Is the call a MethodHandle call? + if (mcall->is_MachCallJava()) { + if (mcall->as_MachCallJava()->_method_handle_invoke) { + assert(has_method_handle_invokes(), "must have been set during call generation"); + is_method_handle_invoke = true; + } + } + + // Check if a call returns an object. + if (mcall->return_value_is_used() && + mcall->tf()->range()->field_at(TypeFunc::Parms)->isa_ptr()) { + return_oop = true; + } safepoint_pc_offset += mcall->ret_addr_offset(); debug_info()->add_safepoint(safepoint_pc_offset, mcall->_oop_map); } @@ -911,9 +927,9 @@ void Compile::Process_OopMap_Node(MachNode *mach, int current_offset) { ciMethod* scope_method = method ? method : _method; // Describe the scope here assert(jvms->bci() >= InvocationEntryBci && jvms->bci() <= 0x10000, "must be a valid or entry BCI"); - assert(!jvms->should_reexecute() || depth==max_depth, "reexecute allowed only for the youngest"); + assert(!jvms->should_reexecute() || depth == max_depth, "reexecute allowed only for the youngest"); // Now we can describe the scope. - debug_info()->describe_scope(safepoint_pc_offset,scope_method,jvms->bci(),jvms->should_reexecute(),locvals,expvals,monvals); + debug_info()->describe_scope(safepoint_pc_offset, scope_method, jvms->bci(), jvms->should_reexecute(), is_method_handle_invoke, return_oop, locvals, expvals, monvals); } // End jvms loop // Mark the end of the scope set. @@ -1080,14 +1096,26 @@ void Compile::Fill_buffer() { deopt_handler_req += MAX_stubs_size; // add marginal slop for handler stub_req += MAX_stubs_size; // ensure per-stub margin code_req += MAX_inst_size; // ensure per-instruction margin + if (StressCodeBuffers) code_req = const_req = stub_req = exception_handler_req = deopt_handler_req = 0x10; // force expansion - int total_req = code_req + pad_req + stub_req + exception_handler_req + deopt_handler_req + const_req; + + int total_req = + code_req + + pad_req + + stub_req + + exception_handler_req + + deopt_handler_req + // deopt handler + const_req; + + if (has_method_handle_invokes()) + total_req += deopt_handler_req; // deopt MH handler + CodeBuffer* cb = code_buffer(); cb->initialize(total_req, locs_req); // Have we run out of code space? - if (cb->blob() == NULL) { + if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) { turn_off_compiler(this); return; } @@ -1308,7 +1336,7 @@ void Compile::Fill_buffer() { // Verify that there is sufficient space remaining cb->insts()->maybe_expand_to_ensure_remaining(MAX_inst_size); - if (cb->blob() == NULL) { + if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) { turn_off_compiler(this); return; } @@ -1424,10 +1452,17 @@ void Compile::Fill_buffer() { _code_offsets.set_value(CodeOffsets::Exceptions, emit_exception_handler(*cb)); // Emit the deopt handler code. _code_offsets.set_value(CodeOffsets::Deopt, emit_deopt_handler(*cb)); + + // Emit the MethodHandle deopt handler code (if required). + if (has_method_handle_invokes()) { + // We can use the same code as for the normal deopt handler, we + // just need a different entry point address. + _code_offsets.set_value(CodeOffsets::DeoptMH, emit_deopt_handler(*cb)); + } } // One last check for failed CodeBuffer::expand: - if (cb->blob() == NULL) { + if ((cb->blob() == NULL) || (!CompileBroker::should_compile_new_jobs())) { turn_off_compiler(this); return; } diff --git a/hotspot/src/share/vm/opto/parse.hpp b/hotspot/src/share/vm/opto/parse.hpp index 37f7b629fbe..d48b21971b7 100644 --- a/hotspot/src/share/vm/opto/parse.hpp +++ b/hotspot/src/share/vm/opto/parse.hpp @@ -39,6 +39,7 @@ class InlineTree : public ResourceObj { // Always between 0.0 and 1.0. Represents the percentage of the method's // total execution time used at this call site. const float _site_invoke_ratio; + const int _site_depth_adjust; float compute_callee_frequency( int caller_bci ) const; GrowableArray _subtrees; @@ -50,7 +51,8 @@ protected: ciMethod* callee_method, JVMState* caller_jvms, int caller_bci, - float site_invoke_ratio); + float site_invoke_ratio, + int site_depth_adjust); InlineTree *build_inline_tree_for_callee(ciMethod* callee_method, JVMState* caller_jvms, int caller_bci); @@ -61,14 +63,15 @@ protected: InlineTree *caller_tree() const { return _caller_tree; } InlineTree* callee_at(int bci, ciMethod* m) const; - int inline_depth() const { return _caller_jvms ? _caller_jvms->depth() : 0; } + int inline_depth() const { return stack_depth() + _site_depth_adjust; } + int stack_depth() const { return _caller_jvms ? _caller_jvms->depth() : 0; } public: static InlineTree* build_inline_tree_root(); static InlineTree* find_subtree_from_root(InlineTree* root, JVMState* jvms, ciMethod* callee, bool create_if_not_found = false); // For temporary (stack-allocated, stateless) ilts: - InlineTree(Compile* c, ciMethod* callee_method, JVMState* caller_jvms, float site_invoke_ratio); + InlineTree(Compile* c, ciMethod* callee_method, JVMState* caller_jvms, float site_invoke_ratio, int site_depth_adjust); // InlineTree enum enum InlineStyle { @@ -427,6 +430,11 @@ class Parse : public GraphKit { } } + // Return true if the parser should add a loop predicate + bool should_add_predicate(int target_bci); + // Insert a loop predicate into the graph + void add_predicate(); + // Note: Intrinsic generation routines may be found in library_call.cpp. // Helper function to setup Ideal Call nodes @@ -488,7 +496,7 @@ class Parse : public GraphKit { void do_ifnull(BoolTest::mask btest, Node* c); void do_if(BoolTest::mask btest, Node* c); - void repush_if_args(); + int repush_if_args(); void adjust_map_after_if(BoolTest::mask btest, Node* c, float prob, Block* path, Block* other_path); IfNode* jump_if_fork_int(Node* a, Node* b, BoolTest::mask mask); diff --git a/hotspot/src/share/vm/opto/parse1.cpp b/hotspot/src/share/vm/opto/parse1.cpp index 9633c5e270b..4cae42dd2cc 100644 --- a/hotspot/src/share/vm/opto/parse1.cpp +++ b/hotspot/src/share/vm/opto/parse1.cpp @@ -231,12 +231,13 @@ void Parse::load_interpreter_state(Node* osr_buf) { // Use the raw liveness computation to make sure that unexpected // values don't propagate into the OSR frame. - MethodLivenessResult live_locals = method()->raw_liveness_at_bci(osr_bci()); + MethodLivenessResult live_locals = method()->liveness_at_bci(osr_bci()); if (!live_locals.is_valid()) { // Degenerate or breakpointed method. C->record_method_not_compilable("OSR in empty or breakpointed method"); return; } + MethodLivenessResult raw_live_locals = method()->raw_liveness_at_bci(osr_bci()); // Extract the needed locals from the interpreter frame. Node *locals_addr = basic_plus_adr(osr_buf, osr_buf, (max_locals-1)*wordSize); @@ -316,6 +317,10 @@ void Parse::load_interpreter_state(Node* osr_buf) { continue; } } + if (type->basic_type() == T_ADDRESS && !raw_live_locals.at(index)) { + // Skip type check for dead address locals + continue; + } set_local(index, check_interpreter_type(l, type, bad_type_exit)); } @@ -819,7 +824,6 @@ bool Parse::can_rerun_bytecode() { case Bytecodes::_ddiv: case Bytecodes::_checkcast: case Bytecodes::_instanceof: - case Bytecodes::_athrow: case Bytecodes::_anewarray: case Bytecodes::_newarray: case Bytecodes::_multianewarray: @@ -829,6 +833,8 @@ bool Parse::can_rerun_bytecode() { return true; break; + // Don't rerun athrow since it's part of the exception path. + case Bytecodes::_athrow: case Bytecodes::_invokestatic: case Bytecodes::_invokedynamic: case Bytecodes::_invokespecial: @@ -1378,6 +1384,10 @@ void Parse::do_one_block() { set_parse_bci(iter().cur_bci()); if (bci() == block()->limit()) { + // insert a predicate if it falls through to a loop head block + if (should_add_predicate(bci())){ + add_predicate(); + } // Do not walk into the next block until directed by do_all_blocks. merge(bci()); break; @@ -2078,6 +2088,37 @@ void Parse::add_safepoint() { } } +//------------------------------should_add_predicate-------------------------- +bool Parse::should_add_predicate(int target_bci) { + if (!UseLoopPredicate) return false; + Block* target = successor_for_bci(target_bci); + if (target != NULL && + target->is_loop_head() && + block()->rpo() < target->rpo()) { + return true; + } + return false; +} + +//------------------------------add_predicate--------------------------------- +void Parse::add_predicate() { + assert(UseLoopPredicate,"use only for loop predicate"); + Node *cont = _gvn.intcon(1); + Node* opq = _gvn.transform(new (C, 2) Opaque1Node(C, cont)); + Node *bol = _gvn.transform(new (C, 2) Conv2BNode(opq)); + IfNode* iff = create_and_map_if(control(), bol, PROB_MAX, COUNT_UNKNOWN); + Node* iffalse = _gvn.transform(new (C, 1) IfFalseNode(iff)); + C->add_predicate_opaq(opq); + { + PreserveJVMState pjvms(this); + set_control(iffalse); + uncommon_trap(Deoptimization::Reason_predicate, + Deoptimization::Action_maybe_recompile); + } + Node* iftrue = _gvn.transform(new (C, 1) IfTrueNode(iff)); + set_control(iftrue); +} + #ifndef PRODUCT //------------------------show_parse_info-------------------------------------- void Parse::show_parse_info() { diff --git a/hotspot/src/share/vm/opto/parse2.cpp b/hotspot/src/share/vm/opto/parse2.cpp index 5457d966b6f..e0012681a2e 100644 --- a/hotspot/src/share/vm/opto/parse2.cpp +++ b/hotspot/src/share/vm/opto/parse2.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -278,6 +278,11 @@ void Parse::do_tableswitch() { if (len < 1) { // If this is a backward branch, add safepoint maybe_add_safepoint(default_dest); + if (should_add_predicate(default_dest)){ + _sp += 1; // set original stack for use by uncommon_trap + add_predicate(); + _sp -= 1; + } merge(default_dest); return; } @@ -324,6 +329,11 @@ void Parse::do_lookupswitch() { if (len < 1) { // If this is a backward branch, add safepoint maybe_add_safepoint(default_dest); + if (should_add_predicate(default_dest)){ + _sp += 1; // set original stack for use by uncommon_trap + add_predicate(); + _sp -= 1; + } merge(default_dest); return; } @@ -731,6 +741,9 @@ void Parse::do_jsr() { push(_gvn.makecon(ret_addr)); // Flow to the jsr. + if (should_add_predicate(jsr_bci)){ + add_predicate(); + } merge(jsr_bci); } @@ -881,7 +894,7 @@ bool Parse::seems_never_taken(float prob) { //-------------------------------repush_if_args-------------------------------- // Push arguments of an "if" bytecode back onto the stack by adjusting _sp. -inline void Parse::repush_if_args() { +inline int Parse::repush_if_args() { #ifndef PRODUCT if (PrintOpto && WizardMode) { tty->print("defending against excessive implicit null exceptions on %s @%d in ", @@ -895,6 +908,7 @@ inline void Parse::repush_if_args() { assert(argument(0) != NULL, "must exist"); assert(bc_depth == 1 || argument(1) != NULL, "two must exist"); _sp += bc_depth; + return bc_depth; } //----------------------------------do_ifnull---------------------------------- @@ -954,8 +968,14 @@ void Parse::do_ifnull(BoolTest::mask btest, Node *c) { // Update method data profile_taken_branch(target_bci); adjust_map_after_if(btest, c, prob, branch_block, next_block); - if (!stopped()) + if (!stopped()) { + if (should_add_predicate(target_bci)){ // add a predicate if it branches to a loop + int nargs = repush_if_args(); // set original stack for uncommon_trap + add_predicate(); + _sp -= nargs; + } merge(target_bci); + } } } @@ -1076,8 +1096,14 @@ void Parse::do_if(BoolTest::mask btest, Node* c) { // Update method data profile_taken_branch(target_bci); adjust_map_after_if(taken_btest, c, prob, branch_block, next_block); - if (!stopped()) + if (!stopped()) { + if (should_add_predicate(target_bci)){ // add a predicate if it branches to a loop + int nargs = repush_if_args(); // set original stack for the uncommon_trap + add_predicate(); + _sp -= nargs; + } merge(target_bci); + } } } @@ -2053,13 +2079,6 @@ void Parse::do_one_bytecode() { // null exception oop throws NULL pointer exception do_null_check(peek(), T_OBJECT); if (stopped()) return; - if (env()->jvmti_can_post_exceptions()) { - // "Full-speed throwing" is not necessary here, - // since we're notifying the VM on every throw. - uncommon_trap(Deoptimization::Reason_unhandled, - Deoptimization::Action_none); - return; - } // Hook the thrown exception directly to subsequent handlers. if (BailoutToInterpreterForThrows) { // Keep method interpreted from now on. @@ -2067,6 +2086,11 @@ void Parse::do_one_bytecode() { Deoptimization::Action_make_not_compilable); return; } + if (env()->jvmti_can_post_on_exceptions()) { + // check if we must post exception events, take uncommon trap if so (with must_throw = false) + uncommon_trap_if_should_post_on_exceptions(Deoptimization::Reason_unhandled, false); + } + // Here if either can_post_on_exceptions or should_post_on_exceptions is false add_exception_state(make_exception_state(peek())); break; @@ -2080,6 +2104,10 @@ void Parse::do_one_bytecode() { // Update method data profile_taken_branch(target_bci); + // Add loop predicate if it goes to a loop + if (should_add_predicate(target_bci)){ + add_predicate(); + } // Merge the current control into the target basic block merge(target_bci); diff --git a/hotspot/src/share/vm/opto/parse3.cpp b/hotspot/src/share/vm/opto/parse3.cpp index 7125cb5d619..9f0a034bb63 100644 --- a/hotspot/src/share/vm/opto/parse3.cpp +++ b/hotspot/src/share/vm/opto/parse3.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -125,7 +125,25 @@ void Parse::do_field_access(bool is_get, bool is_field) { void Parse::do_get_xxx(const TypePtr* obj_type, Node* obj, ciField* field, bool is_field) { // Does this field have a constant value? If so, just push the value. - if (field->is_constant() && push_constant(field->constant_value())) return; + if (field->is_constant()) { + if (field->is_static()) { + // final static field + if (push_constant(field->constant_value())) + return; + } + else { + // final non-static field of a trusted class ({java,sun}.dyn + // classes). + if (obj->is_Con()) { + const TypeOopPtr* oop_ptr = obj->bottom_type()->isa_oopptr(); + ciObject* constant_oop = oop_ptr->const_oop(); + ciConstant constant = field->constant_value_of(constant_oop); + + if (push_constant(constant, true)) + return; + } + } + } ciType* field_klass = field->type(); bool is_vol = field->is_volatile(); @@ -145,7 +163,7 @@ void Parse::do_get_xxx(const TypePtr* obj_type, Node* obj, ciField* field, bool if (!field->type()->is_loaded()) { type = TypeInstPtr::BOTTOM; must_assert_null = true; - } else if (field->is_constant()) { + } else if (field->is_constant() && field->is_static()) { // This can happen if the constant oop is non-perm. ciObject* con = field->constant_value().as_object(); // Do not "join" in the previous type; it doesn't add value, @@ -240,19 +258,19 @@ void Parse::do_put_xxx(const TypePtr* obj_type, Node* obj, ciField* field, bool // membar is dependent on the store, keeping any other membars generated // below from floating up past the store. int adr_idx = C->get_alias_index(adr_type); - insert_mem_bar_volatile(Op_MemBarVolatile, adr_idx); + insert_mem_bar_volatile(Op_MemBarVolatile, adr_idx, store); // Now place a membar for AliasIdxBot for the unknown yet-to-be-parsed // volatile alias indices. Skip this if the membar is redundant. if (adr_idx != Compile::AliasIdxBot) { - insert_mem_bar_volatile(Op_MemBarVolatile, Compile::AliasIdxBot); + insert_mem_bar_volatile(Op_MemBarVolatile, Compile::AliasIdxBot, store); } // Finally, place alias-index-specific membars for each volatile index // that isn't the adr_idx membar. Typically there's only 1 or 2. for( int i = Compile::AliasIdxRaw; i < C->num_alias_types(); i++ ) { if (i != adr_idx && C->alias_type(i)->is_volatile()) { - insert_mem_bar_volatile(Op_MemBarVolatile, i); + insert_mem_bar_volatile(Op_MemBarVolatile, i, store); } } } @@ -421,8 +439,18 @@ void Parse::do_multianewarray() { // Can use multianewarray instead of [a]newarray if only one dimension, // or if all non-final dimensions are small constants. - if (expand_count == 1 || (1 <= expand_count && expand_count <= expand_limit)) { - Node* obj = expand_multianewarray(array_klass, &length[0], ndimensions, ndimensions); + if (ndimensions == 1 || (1 <= expand_count && expand_count <= expand_limit)) { + Node* obj = NULL; + // Set the original stack and the reexecute bit for the interpreter + // to reexecute the multianewarray bytecode if deoptimization happens. + // Do it unconditionally even for one dimension multianewarray. + // Note: the reexecute bit will be set in GraphKit::add_safepoint_edges() + // when AllocateArray node for newarray is created. + { PreserveReexecuteState preexecs(this); + _sp += ndimensions; + // Pass 0 as nargs since uncommon trap code does not need to restore stack. + obj = expand_multianewarray(array_klass, &length[0], ndimensions, 0); + } //original reexecute and sp are set back here push(obj); return; } diff --git a/hotspot/src/share/vm/opto/parseHelper.cpp b/hotspot/src/share/vm/opto/parseHelper.cpp index 6b3f432eae7..196c77f1f1a 100644 --- a/hotspot/src/share/vm/opto/parseHelper.cpp +++ b/hotspot/src/share/vm/opto/parseHelper.cpp @@ -221,6 +221,14 @@ void Parse::do_new() { // Push resultant oop onto stack push(obj); + + // Keep track of whether opportunities exist for StringBuilder + // optimizations. + if (OptimizeStringConcat && + (klass == C->env()->StringBuilder_klass() || + klass == C->env()->StringBuffer_klass())) { + C->set_has_stringbuilder(true); + } } #ifndef PRODUCT @@ -406,8 +414,6 @@ void Parse::profile_not_taken_branch(bool force_update) { void Parse::profile_call(Node* receiver) { if (!method_data_update()) return; - profile_generic_call(); - switch (bc()) { case Bytecodes::_invokevirtual: case Bytecodes::_invokeinterface: @@ -416,6 +422,7 @@ void Parse::profile_call(Node* receiver) { case Bytecodes::_invokestatic: case Bytecodes::_invokedynamic: case Bytecodes::_invokespecial: + profile_generic_call(); break; default: fatal("unexpected call bytecode"); } @@ -436,13 +443,16 @@ void Parse::profile_generic_call() { void Parse::profile_receiver_type(Node* receiver) { assert(method_data_update(), "must be generating profile code"); - // Skip if we aren't tracking receivers - if (TypeProfileWidth < 1) return; - ciMethodData* md = method()->method_data(); assert(md != NULL, "expected valid ciMethodData"); ciProfileData* data = md->bci_to_data(bci()); assert(data->is_ReceiverTypeData(), "need ReceiverTypeData here"); + + // Skip if we aren't tracking receivers + if (TypeProfileWidth < 1) { + increment_md_counter_at(md, data, CounterData::count_offset()); + return; + } ciReceiverTypeData* rdata = (ciReceiverTypeData*)data->as_ReceiverTypeData(); Node* method_data = method_data_addressing(md, rdata, in_ByteSize(0)); diff --git a/hotspot/src/share/vm/opto/phase.hpp b/hotspot/src/share/vm/opto/phase.hpp index d0d54e1d900..9df5500fd5e 100644 --- a/hotspot/src/share/vm/opto/phase.hpp +++ b/hotspot/src/share/vm/opto/phase.hpp @@ -44,6 +44,7 @@ public: BlockLayout, // Linear ordering of blocks Register_Allocation, // Register allocation, duh LIVE, // Dragon-book LIVE range problem + StringOpts, // StringBuilder related optimizations Interference_Graph, // Building the IFG Coalesce, // Coalescing copies Ideal_Loop, // Find idealized trip-counted loops diff --git a/hotspot/src/share/vm/opto/phaseX.hpp b/hotspot/src/share/vm/opto/phaseX.hpp index b9391ba1d97..33ff56f0ee4 100644 --- a/hotspot/src/share/vm/opto/phaseX.hpp +++ b/hotspot/src/share/vm/opto/phaseX.hpp @@ -345,7 +345,11 @@ public: Node *hash_find(const Node *n) { return _table.hash_find(n); } // Used after parsing to eliminate values that are no longer in program - void remove_useless_nodes(VectorSet &useful) { _table.remove_useless_nodes(useful); } + void remove_useless_nodes(VectorSet &useful) { + _table.remove_useless_nodes(useful); + // this may invalidate cached cons so reset the cache + init_con_caches(); + } virtual ConNode* uncached_makecon(const Type* t); // override from PhaseTransform diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp index 2b3851961ee..c2d5ca7df88 100644 --- a/hotspot/src/share/vm/opto/runtime.cpp +++ b/hotspot/src/share/vm/opto/runtime.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -143,7 +143,7 @@ const char* OptoRuntime::stub_name(address entry) { // We failed the fast-path allocation. Now we need to do a scavenge or GC // and try allocation again. -void OptoRuntime::maybe_defer_card_mark(JavaThread* thread) { +void OptoRuntime::new_store_pre_barrier(JavaThread* thread) { // After any safepoint, just before going back to compiled code, // we inform the GC that we will be doing initializing writes to // this object in the future without emitting card-marks, so @@ -156,7 +156,7 @@ void OptoRuntime::maybe_defer_card_mark(JavaThread* thread) { assert(Universe::heap()->can_elide_tlab_store_barriers(), "compiler must check this first"); // GC may decide to give back a safer copy of new_obj. - new_obj = Universe::heap()->defer_store_barrier(thread, new_obj); + new_obj = Universe::heap()->new_store_pre_barrier(thread, new_obj); thread->set_vm_result(new_obj); } @@ -200,7 +200,7 @@ JRT_BLOCK_ENTRY(void, OptoRuntime::new_instance_C(klassOopDesc* klass, JavaThrea if (GraphKit::use_ReduceInitialCardMarks()) { // inform GC that we won't do card marks for initializing writes. - maybe_defer_card_mark(thread); + new_store_pre_barrier(thread); } JRT_END @@ -239,7 +239,7 @@ JRT_BLOCK_ENTRY(void, OptoRuntime::new_array_C(klassOopDesc* array_type, int len if (GraphKit::use_ReduceInitialCardMarks()) { // inform GC that we won't do card marks for initializing writes. - maybe_defer_card_mark(thread); + new_store_pre_barrier(thread); } JRT_END @@ -706,6 +706,11 @@ JRT_LEAF(void, OptoRuntime::profile_receiver_type_C(DataLayout* data, oopDesc* r // vc->set_receiver_count(empty_row, DataLayout::counter_increment); int count_off = ReceiverTypeData::receiver_count_cell_index(empty_row); *(mdp + count_off) = DataLayout::counter_increment; + } else { + // Receiver did not match any saved receiver and there is no empty row for it. + // Increment total counter to indicate polymorphic case. + intptr_t* count_p = (intptr_t*)(((byte*)(data)) + in_bytes(CounterData::count_offset())); + *count_p += DataLayout::counter_increment; } JRT_END @@ -790,7 +795,7 @@ JRT_ENTRY_NO_ASYNC(address, OptoRuntime::handle_exception_C_helper(JavaThread* t NOT_PRODUCT(Exceptions::debug_check_abort(exception)); #ifdef ASSERT - if (!(exception->is_a(SystemDictionary::throwable_klass()))) { + if (!(exception->is_a(SystemDictionary::Throwable_klass()))) { // should throw an exception here ShouldNotReachHere(); } @@ -810,7 +815,7 @@ JRT_ENTRY_NO_ASYNC(address, OptoRuntime::handle_exception_C_helper(JavaThread* t // we are switching to old paradigm: search for exception handler in caller_frame // instead in exception handler of caller_frame.sender() - if (JvmtiExport::can_post_exceptions()) { + if (JvmtiExport::can_post_on_exceptions()) { // "Full-speed catching" is not necessary here, // since we're notifying the VM on every catch. // Force deoptimization and the rest of the lookup @@ -858,6 +863,9 @@ JRT_ENTRY_NO_ASYNC(address, OptoRuntime::handle_exception_C_helper(JavaThread* t thread->set_exception_pc(pc); thread->set_exception_handler_pc(handler_address); thread->set_exception_stack_size(0); + + // Check if the exception PC is a MethodHandle call. + thread->set_is_method_handle_exception(nm->is_method_handle_return(pc)); } // Restore correct return pc. Was saved above. @@ -936,7 +944,7 @@ address OptoRuntime::rethrow_C(oopDesc* exception, JavaThread* thread, address r #endif assert (exception != NULL, "should have thrown a NULLPointerException"); #ifdef ASSERT - if (!(exception->is_a(SystemDictionary::throwable_klass()))) { + if (!(exception->is_a(SystemDictionary::Throwable_klass()))) { // should throw an exception here ShouldNotReachHere(); } @@ -972,8 +980,8 @@ void OptoRuntime::deoptimize_caller_frame(JavaThread *thread, bool doit) { assert(stub_frame.is_runtime_frame() || exception_blob()->contains(stub_frame.pc()), "sanity check"); frame caller_frame = stub_frame.sender(®_map); - VM_DeoptimizeFrame deopt(thread, caller_frame.id()); - VMThread::execute(&deopt); + // bypass VM_DeoptimizeFrame and deoptimize the frame directly + Deoptimization::deoptimize_frame(thread, caller_frame.id()); } } diff --git a/hotspot/src/share/vm/opto/runtime.hpp b/hotspot/src/share/vm/opto/runtime.hpp index c3d8238ae1e..2c0c49880e4 100644 --- a/hotspot/src/share/vm/opto/runtime.hpp +++ b/hotspot/src/share/vm/opto/runtime.hpp @@ -133,8 +133,9 @@ class OptoRuntime : public AllStatic { // Allocate storage for a objArray or typeArray static void new_array_C(klassOopDesc* array_klass, int len, JavaThread *thread); - // Post-slow-path-allocation step for implementing ReduceInitialCardMarks: - static void maybe_defer_card_mark(JavaThread* thread); + // Post-slow-path-allocation, pre-initializing-stores step for + // implementing ReduceInitialCardMarks + static void new_store_pre_barrier(JavaThread* thread); // Allocate storage for a multi-dimensional arrays // Note: needs to be fixed for arbitrary number of dimensions diff --git a/hotspot/src/share/vm/opto/split_if.cpp b/hotspot/src/share/vm/opto/split_if.cpp index a7a6baaa925..75ba440a6bd 100644 --- a/hotspot/src/share/vm/opto/split_if.cpp +++ b/hotspot/src/share/vm/opto/split_if.cpp @@ -219,6 +219,7 @@ bool PhaseIdealLoop::split_up( Node *n, Node *blk1, Node *blk2 ) { //------------------------------register_new_node------------------------------ void PhaseIdealLoop::register_new_node( Node *n, Node *blk ) { + assert(!n->is_CFG(), "must be data node"); _igvn.register_new_node_with_optimizer(n); set_ctrl(n, blk); IdealLoopTree *loop = get_loop(blk); diff --git a/hotspot/src/share/vm/opto/stringopts.cpp b/hotspot/src/share/vm/opto/stringopts.cpp new file mode 100644 index 00000000000..01476453b3d --- /dev/null +++ b/hotspot/src/share/vm/opto/stringopts.cpp @@ -0,0 +1,1396 @@ +/* + * Copyright 2009-2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +#include "incls/_precompiled.incl" +#include "incls/_stringopts.cpp.incl" + +#define __ kit. + +class StringConcat : public ResourceObj { + private: + PhaseStringOpts* _stringopts; + Node* _string_alloc; + AllocateNode* _begin; // The allocation the begins the pattern + CallStaticJavaNode* _end; // The final call of the pattern. Will either be + // SB.toString or or String.(SB.toString) + bool _multiple; // indicates this is a fusion of two or more + // separate StringBuilders + + Node* _arguments; // The list of arguments to be concatenated + GrowableArray _mode; // into a String along with a mode flag + // indicating how to treat the value. + + Node_List _control; // List of control nodes that will be deleted + Node_List _uncommon_traps; // Uncommon traps that needs to be rewritten + // to restart at the initial JVMState. + public: + // Mode for converting arguments to Strings + enum { + StringMode, + IntMode, + CharMode + }; + + StringConcat(PhaseStringOpts* stringopts, CallStaticJavaNode* end): + _end(end), + _begin(NULL), + _multiple(false), + _string_alloc(NULL), + _stringopts(stringopts) { + _arguments = new (_stringopts->C, 1) Node(1); + _arguments->del_req(0); + } + + bool validate_control_flow(); + + void merge_add() { +#if 0 + // XXX This is place holder code for reusing an existing String + // allocation but the logic for checking the state safety is + // probably inadequate at the moment. + CallProjections endprojs; + sc->end()->extract_projections(&endprojs, false); + if (endprojs.resproj != NULL) { + for (SimpleDUIterator i(endprojs.resproj); i.has_next(); i.next()) { + CallStaticJavaNode *use = i.get()->isa_CallStaticJava(); + if (use != NULL && use->method() != NULL && + use->method()->holder() == C->env()->String_klass() && + use->method()->name() == ciSymbol::object_initializer_name() && + use->in(TypeFunc::Parms + 1) == endprojs.resproj) { + // Found useless new String(sb.toString()) so reuse the newly allocated String + // when creating the result instead of allocating a new one. + sc->set_string_alloc(use->in(TypeFunc::Parms)); + sc->set_end(use); + } + } + } +#endif + } + + StringConcat* merge(StringConcat* other, Node* arg); + + void set_allocation(AllocateNode* alloc) { + _begin = alloc; + } + + void append(Node* value, int mode) { + _arguments->add_req(value); + _mode.append(mode); + } + void push(Node* value, int mode) { + _arguments->ins_req(0, value); + _mode.insert_before(0, mode); + } + void push_string(Node* value) { + push(value, StringMode); + } + void push_int(Node* value) { + push(value, IntMode); + } + void push_char(Node* value) { + push(value, CharMode); + } + + Node* argument(int i) { + return _arguments->in(i); + } + void set_argument(int i, Node* value) { + _arguments->set_req(i, value); + } + int num_arguments() { + return _mode.length(); + } + int mode(int i) { + return _mode.at(i); + } + void add_control(Node* ctrl) { + assert(!_control.contains(ctrl), "only push once"); + _control.push(ctrl); + } + CallStaticJavaNode* end() { return _end; } + AllocateNode* begin() { return _begin; } + Node* string_alloc() { return _string_alloc; } + + void eliminate_unneeded_control(); + void eliminate_initialize(InitializeNode* init); + void eliminate_call(CallNode* call); + + void maybe_log_transform() { + CompileLog* log = _stringopts->C->log(); + if (log != NULL) { + log->head("replace_string_concat arguments='%d' string_alloc='%d' multiple='%d'", + num_arguments(), + _string_alloc != NULL, + _multiple); + JVMState* p = _begin->jvms(); + while (p != NULL) { + log->elem("jvms bci='%d' method='%d'", p->bci(), log->identify(p->method())); + p = p->caller(); + } + log->tail("replace_string_concat"); + } + } + + void convert_uncommon_traps(GraphKit& kit, const JVMState* jvms) { + for (uint u = 0; u < _uncommon_traps.size(); u++) { + Node* uct = _uncommon_traps.at(u); + + // Build a new call using the jvms state of the allocate + address call_addr = SharedRuntime::uncommon_trap_blob()->instructions_begin(); + const TypeFunc* call_type = OptoRuntime::uncommon_trap_Type(); + int size = call_type->domain()->cnt(); + const TypePtr* no_memory_effects = NULL; + Compile* C = _stringopts->C; + CallStaticJavaNode* call = new (C, size) CallStaticJavaNode(call_type, call_addr, "uncommon_trap", + jvms->bci(), no_memory_effects); + for (int e = 0; e < TypeFunc::Parms; e++) { + call->init_req(e, uct->in(e)); + } + // Set the trap request to record intrinsic failure if this trap + // is taken too many times. Ideally we would handle then traps by + // doing the original bookkeeping in the MDO so that if it caused + // the code to be thrown out we could still recompile and use the + // optimization. Failing the uncommon traps doesn't really mean + // that the optimization is a bad idea but there's no other way to + // do the MDO updates currently. + int trap_request = Deoptimization::make_trap_request(Deoptimization::Reason_intrinsic, + Deoptimization::Action_make_not_entrant); + call->init_req(TypeFunc::Parms, __ intcon(trap_request)); + kit.add_safepoint_edges(call); + + _stringopts->gvn()->transform(call); + C->gvn_replace_by(uct, call); + uct->disconnect_inputs(NULL); + } + } + + void cleanup() { + // disconnect the hook node + _arguments->disconnect_inputs(NULL); + } +}; + + +void StringConcat::eliminate_unneeded_control() { + eliminate_initialize(begin()->initialization()); + for (uint i = 0; i < _control.size(); i++) { + Node* n = _control.at(i); + if (n->is_Call()) { + if (n != _end) { + eliminate_call(n->as_Call()); + } + } else if (n->is_IfTrue()) { + Compile* C = _stringopts->C; + C->gvn_replace_by(n, n->in(0)->in(0)); + C->gvn_replace_by(n->in(0), C->top()); + } + } +} + + +StringConcat* StringConcat::merge(StringConcat* other, Node* arg) { + StringConcat* result = new StringConcat(_stringopts, _end); + for (uint x = 0; x < _control.size(); x++) { + Node* n = _control.at(x); + if (n->is_Call()) { + result->_control.push(n); + } + } + for (uint x = 0; x < other->_control.size(); x++) { + Node* n = other->_control.at(x); + if (n->is_Call()) { + result->_control.push(n); + } + } + assert(result->_control.contains(other->_end), "what?"); + assert(result->_control.contains(_begin), "what?"); + for (int x = 0; x < num_arguments(); x++) { + if (argument(x) == arg) { + // replace the toString result with the all the arguments that + // made up the other StringConcat + for (int y = 0; y < other->num_arguments(); y++) { + result->append(other->argument(y), other->mode(y)); + } + } else { + result->append(argument(x), mode(x)); + } + } + result->set_allocation(other->_begin); + result->_multiple = true; + return result; +} + + +void StringConcat::eliminate_call(CallNode* call) { + Compile* C = _stringopts->C; + CallProjections projs; + call->extract_projections(&projs, false); + if (projs.fallthrough_catchproj != NULL) { + C->gvn_replace_by(projs.fallthrough_catchproj, call->in(TypeFunc::Control)); + } + if (projs.fallthrough_memproj != NULL) { + C->gvn_replace_by(projs.fallthrough_memproj, call->in(TypeFunc::Memory)); + } + if (projs.catchall_memproj != NULL) { + C->gvn_replace_by(projs.catchall_memproj, C->top()); + } + if (projs.fallthrough_ioproj != NULL) { + C->gvn_replace_by(projs.fallthrough_ioproj, call->in(TypeFunc::I_O)); + } + if (projs.catchall_ioproj != NULL) { + C->gvn_replace_by(projs.catchall_ioproj, C->top()); + } + if (projs.catchall_catchproj != NULL) { + // EA can't cope with the partially collapsed graph this + // creates so put it on the worklist to be collapsed later. + for (SimpleDUIterator i(projs.catchall_catchproj); i.has_next(); i.next()) { + Node *use = i.get(); + int opc = use->Opcode(); + if (opc == Op_CreateEx || opc == Op_Region) { + _stringopts->record_dead_node(use); + } + } + C->gvn_replace_by(projs.catchall_catchproj, C->top()); + } + if (projs.resproj != NULL) { + C->gvn_replace_by(projs.resproj, C->top()); + } + C->gvn_replace_by(call, C->top()); +} + +void StringConcat::eliminate_initialize(InitializeNode* init) { + Compile* C = _stringopts->C; + + // Eliminate Initialize node. + assert(init->outcnt() <= 2, "only a control and memory projection expected"); + assert(init->req() <= InitializeNode::RawStores, "no pending inits"); + Node *ctrl_proj = init->proj_out(TypeFunc::Control); + if (ctrl_proj != NULL) { + C->gvn_replace_by(ctrl_proj, init->in(TypeFunc::Control)); + } + Node *mem_proj = init->proj_out(TypeFunc::Memory); + if (mem_proj != NULL) { + Node *mem = init->in(TypeFunc::Memory); + C->gvn_replace_by(mem_proj, mem); + } + C->gvn_replace_by(init, C->top()); + init->disconnect_inputs(NULL); +} + +Node_List PhaseStringOpts::collect_toString_calls() { + Node_List string_calls; + Node_List worklist; + + _visited.Clear(); + + // Prime the worklist + for (uint i = 1; i < C->root()->len(); i++) { + Node* n = C->root()->in(i); + if (n != NULL && !_visited.test_set(n->_idx)) { + worklist.push(n); + } + } + + while (worklist.size() > 0) { + Node* ctrl = worklist.pop(); + if (ctrl->is_CallStaticJava()) { + CallStaticJavaNode* csj = ctrl->as_CallStaticJava(); + ciMethod* m = csj->method(); + if (m != NULL && + (m->intrinsic_id() == vmIntrinsics::_StringBuffer_toString || + m->intrinsic_id() == vmIntrinsics::_StringBuilder_toString)) { + string_calls.push(csj); + } + } + if (ctrl->in(0) != NULL && !_visited.test_set(ctrl->in(0)->_idx)) { + worklist.push(ctrl->in(0)); + } + if (ctrl->is_Region()) { + for (uint i = 1; i < ctrl->len(); i++) { + if (ctrl->in(i) != NULL && !_visited.test_set(ctrl->in(i)->_idx)) { + worklist.push(ctrl->in(i)); + } + } + } + } + return string_calls; +} + + +StringConcat* PhaseStringOpts::build_candidate(CallStaticJavaNode* call) { + ciMethod* m = call->method(); + ciSymbol* string_sig; + ciSymbol* int_sig; + ciSymbol* char_sig; + if (m->holder() == C->env()->StringBuilder_klass()) { + string_sig = ciSymbol::String_StringBuilder_signature(); + int_sig = ciSymbol::int_StringBuilder_signature(); + char_sig = ciSymbol::char_StringBuilder_signature(); + } else if (m->holder() == C->env()->StringBuffer_klass()) { + string_sig = ciSymbol::String_StringBuffer_signature(); + int_sig = ciSymbol::int_StringBuffer_signature(); + char_sig = ciSymbol::char_StringBuffer_signature(); + } else { + return NULL; + } +#ifndef PRODUCT + if (PrintOptimizeStringConcat) { + tty->print("considering toString call in "); + call->jvms()->dump_spec(tty); tty->cr(); + } +#endif + + StringConcat* sc = new StringConcat(this, call); + + AllocateNode* alloc = NULL; + InitializeNode* init = NULL; + + // possible opportunity for StringBuilder fusion + CallStaticJavaNode* cnode = call; + while (cnode) { + Node* recv = cnode->in(TypeFunc::Parms)->uncast(); + if (recv->is_Proj()) { + recv = recv->in(0); + } + cnode = recv->isa_CallStaticJava(); + if (cnode == NULL) { + alloc = recv->isa_Allocate(); + if (alloc == NULL) { + break; + } + // Find the constructor call + Node* result = alloc->result_cast(); + if (result == NULL || !result->is_CheckCastPP()) { + // strange looking allocation +#ifndef PRODUCT + if (PrintOptimizeStringConcat) { + tty->print("giving up because allocation looks strange "); + alloc->jvms()->dump_spec(tty); tty->cr(); + } +#endif + break; + } + Node* constructor = NULL; + for (SimpleDUIterator i(result); i.has_next(); i.next()) { + CallStaticJavaNode *use = i.get()->isa_CallStaticJava(); + if (use != NULL && use->method() != NULL && + use->method()->name() == ciSymbol::object_initializer_name() && + use->method()->holder() == m->holder()) { + // Matched the constructor. + ciSymbol* sig = use->method()->signature()->as_symbol(); + if (sig == ciSymbol::void_method_signature() || + sig == ciSymbol::int_void_signature() || + sig == ciSymbol::string_void_signature()) { + if (sig == ciSymbol::string_void_signature()) { + // StringBuilder(String) so pick this up as the first argument + assert(use->in(TypeFunc::Parms + 1) != NULL, "what?"); + sc->push_string(use->in(TypeFunc::Parms + 1)); + } + // The int variant takes an initial size for the backing + // array so just treat it like the void version. + constructor = use; + } else { +#ifndef PRODUCT + if (PrintOptimizeStringConcat) { + tty->print("unexpected constructor signature: %s", sig->as_utf8()); + } +#endif + } + break; + } + } + if (constructor == NULL) { + // couldn't find constructor +#ifndef PRODUCT + if (PrintOptimizeStringConcat) { + tty->print("giving up because couldn't find constructor "); + alloc->jvms()->dump_spec(tty); + } +#endif + break; + } + + // Walked all the way back and found the constructor call so see + // if this call converted into a direct string concatenation. + sc->add_control(call); + sc->add_control(constructor); + sc->add_control(alloc); + sc->set_allocation(alloc); + if (sc->validate_control_flow()) { + return sc; + } else { + return NULL; + } + } else if (cnode->method() == NULL) { + break; + } else if (cnode->method()->holder() == m->holder() && + cnode->method()->name() == ciSymbol::append_name() && + (cnode->method()->signature()->as_symbol() == string_sig || + cnode->method()->signature()->as_symbol() == char_sig || + cnode->method()->signature()->as_symbol() == int_sig)) { + sc->add_control(cnode); + Node* arg = cnode->in(TypeFunc::Parms + 1); + if (cnode->method()->signature()->as_symbol() == int_sig) { + sc->push_int(arg); + } else if (cnode->method()->signature()->as_symbol() == char_sig) { + sc->push_char(arg); + } else { + if (arg->is_Proj() && arg->in(0)->is_CallStaticJava()) { + CallStaticJavaNode* csj = arg->in(0)->as_CallStaticJava(); + if (csj->method() != NULL && + csj->method()->holder() == C->env()->Integer_klass() && + csj->method()->name() == ciSymbol::toString_name()) { + sc->add_control(csj); + sc->push_int(csj->in(TypeFunc::Parms)); + continue; + } + } + sc->push_string(arg); + } + continue; + } else { + // some unhandled signature +#ifndef PRODUCT + if (PrintOptimizeStringConcat) { + tty->print("giving up because encountered unexpected signature "); + cnode->tf()->dump(); tty->cr(); + cnode->in(TypeFunc::Parms + 1)->dump(); + } +#endif + break; + } + } + return NULL; +} + + +PhaseStringOpts::PhaseStringOpts(PhaseGVN* gvn, Unique_Node_List*): + Phase(StringOpts), + _gvn(gvn), + _visited(Thread::current()->resource_area()) { + + assert(OptimizeStringConcat, "shouldn't be here"); + + size_table_field = C->env()->Integer_klass()->get_field_by_name(ciSymbol::make("sizeTable"), + ciSymbol::make("[I"), true); + if (size_table_field == NULL) { + // Something wrong so give up. + assert(false, "why can't we find Integer.sizeTable?"); + return; + } + + // Collect the types needed to talk about the various slices of memory + const TypeInstPtr* string_type = TypeInstPtr::make(TypePtr::NotNull, C->env()->String_klass(), + false, NULL, 0); + + const TypePtr* value_field_type = string_type->add_offset(java_lang_String::value_offset_in_bytes()); + const TypePtr* offset_field_type = string_type->add_offset(java_lang_String::offset_offset_in_bytes()); + const TypePtr* count_field_type = string_type->add_offset(java_lang_String::count_offset_in_bytes()); + + value_field_idx = C->get_alias_index(value_field_type); + count_field_idx = C->get_alias_index(count_field_type); + offset_field_idx = C->get_alias_index(offset_field_type); + char_adr_idx = C->get_alias_index(TypeAryPtr::CHARS); + + // For each locally allocated StringBuffer see if the usages can be + // collapsed into a single String construction. + + // Run through the list of allocation looking for SB.toString to see + // if it's possible to fuse the usage of the SB into a single String + // construction. + GrowableArray concats; + Node_List toStrings = collect_toString_calls(); + while (toStrings.size() > 0) { + StringConcat* sc = build_candidate(toStrings.pop()->as_CallStaticJava()); + if (sc != NULL) { + concats.push(sc); + } + } + + // try to coalesce separate concats + restart: + for (int c = 0; c < concats.length(); c++) { + StringConcat* sc = concats.at(c); + for (int i = 0; i < sc->num_arguments(); i++) { + Node* arg = sc->argument(i); + if (arg->is_Proj() && arg->in(0)->is_CallStaticJava()) { + CallStaticJavaNode* csj = arg->in(0)->as_CallStaticJava(); + if (csj->method() != NULL && + (csj->method()->holder() == C->env()->StringBuffer_klass() || + csj->method()->holder() == C->env()->StringBuilder_klass()) && + csj->method()->name() == ciSymbol::toString_name()) { + for (int o = 0; o < concats.length(); o++) { + if (c == o) continue; + StringConcat* other = concats.at(o); + if (other->end() == csj) { +#ifndef PRODUCT + if (PrintOptimizeStringConcat) { + tty->print_cr("considering stacked concats"); + } +#endif + + StringConcat* merged = sc->merge(other, arg); + if (merged->validate_control_flow()) { +#ifndef PRODUCT + if (PrintOptimizeStringConcat) { + tty->print_cr("stacking would succeed"); + } +#endif + if (c < o) { + concats.remove_at(o); + concats.at_put(c, merged); + } else { + concats.remove_at(c); + concats.at_put(o, merged); + } + goto restart; + } else { +#ifndef PRODUCT + if (PrintOptimizeStringConcat) { + tty->print_cr("stacking would fail"); + } +#endif + } + } + } + } + } + } + } + + + for (int c = 0; c < concats.length(); c++) { + StringConcat* sc = concats.at(c); + replace_string_concat(sc); + } + + remove_dead_nodes(); +} + +void PhaseStringOpts::record_dead_node(Node* dead) { + dead_worklist.push(dead); +} + +void PhaseStringOpts::remove_dead_nodes() { + // Delete any dead nodes to make things clean enough that escape + // analysis doesn't get unhappy. + while (dead_worklist.size() > 0) { + Node* use = dead_worklist.pop(); + int opc = use->Opcode(); + switch (opc) { + case Op_Region: { + uint i = 1; + for (i = 1; i < use->req(); i++) { + if (use->in(i) != C->top()) { + break; + } + } + if (i >= use->req()) { + for (SimpleDUIterator i(use); i.has_next(); i.next()) { + Node* m = i.get(); + if (m->is_Phi()) { + dead_worklist.push(m); + } + } + C->gvn_replace_by(use, C->top()); + } + break; + } + case Op_AddP: + case Op_CreateEx: { + // Recurisvely clean up references to CreateEx so EA doesn't + // get unhappy about the partially collapsed graph. + for (SimpleDUIterator i(use); i.has_next(); i.next()) { + Node* m = i.get(); + if (m->is_AddP()) { + dead_worklist.push(m); + } + } + C->gvn_replace_by(use, C->top()); + break; + } + case Op_Phi: + if (use->in(0) == C->top()) { + C->gvn_replace_by(use, C->top()); + } + break; + } + } +} + + +bool StringConcat::validate_control_flow() { + // We found all the calls and arguments now lets see if it's + // safe to transform the graph as we would expect. + + // Check to see if this resulted in too many uncommon traps previously + if (Compile::current()->too_many_traps(_begin->jvms()->method(), _begin->jvms()->bci(), + Deoptimization::Reason_intrinsic)) { + return false; + } + + // Walk backwards over the control flow from toString to the + // allocation and make sure all the control flow is ok. This + // means it's either going to be eliminated once the calls are + // removed or it can safely be transformed into an uncommon + // trap. + + int null_check_count = 0; + Unique_Node_List ctrl_path; + + assert(_control.contains(_begin), "missing"); + assert(_control.contains(_end), "missing"); + + // Collect the nodes that we know about and will eliminate into ctrl_path + for (uint i = 0; i < _control.size(); i++) { + // Push the call and it's control projection + Node* n = _control.at(i); + if (n->is_Allocate()) { + AllocateNode* an = n->as_Allocate(); + InitializeNode* init = an->initialization(); + ctrl_path.push(init); + ctrl_path.push(init->as_Multi()->proj_out(0)); + } + if (n->is_Call()) { + CallNode* cn = n->as_Call(); + ctrl_path.push(cn); + ctrl_path.push(cn->proj_out(0)); + ctrl_path.push(cn->proj_out(0)->unique_out()); + ctrl_path.push(cn->proj_out(0)->unique_out()->as_Catch()->proj_out(0)); + } else { + ShouldNotReachHere(); + } + } + + // Skip backwards through the control checking for unexpected contro flow + Node* ptr = _end; + bool fail = false; + while (ptr != _begin) { + if (ptr->is_Call() && ctrl_path.member(ptr)) { + ptr = ptr->in(0); + } else if (ptr->is_CatchProj() && ctrl_path.member(ptr)) { + ptr = ptr->in(0)->in(0)->in(0); + assert(ctrl_path.member(ptr), "should be a known piece of control"); + } else if (ptr->is_IfTrue()) { + IfNode* iff = ptr->in(0)->as_If(); + BoolNode* b = iff->in(1)->isa_Bool(); + Node* cmp = b->in(1); + Node* v1 = cmp->in(1); + Node* v2 = cmp->in(2); + Node* otherproj = iff->proj_out(1 - ptr->as_Proj()->_con); + + // Null check of the return of append which can simply be eliminated + if (b->_test._test == BoolTest::ne && + v2->bottom_type() == TypePtr::NULL_PTR && + v1->is_Proj() && ctrl_path.member(v1->in(0))) { + // NULL check of the return value of the append + null_check_count++; + if (otherproj->outcnt() == 1) { + CallStaticJavaNode* call = otherproj->unique_out()->isa_CallStaticJava(); + if (call != NULL && call->_name != NULL && strcmp(call->_name, "uncommon_trap") == 0) { + ctrl_path.push(call); + } + } + _control.push(ptr); + ptr = ptr->in(0)->in(0); + continue; + } + + // A test which leads to an uncommon trap which should be safe. + // Later this trap will be converted into a trap that restarts + // at the beginning. + if (otherproj->outcnt() == 1) { + CallStaticJavaNode* call = otherproj->unique_out()->isa_CallStaticJava(); + if (call != NULL && call->_name != NULL && strcmp(call->_name, "uncommon_trap") == 0) { + // control flow leads to uct so should be ok + _uncommon_traps.push(call); + ctrl_path.push(call); + ptr = ptr->in(0)->in(0); + continue; + } + } + +#ifndef PRODUCT + // Some unexpected control flow we don't know how to handle. + if (PrintOptimizeStringConcat) { + tty->print_cr("failing with unknown test"); + b->dump(); + cmp->dump(); + v1->dump(); + v2->dump(); + tty->cr(); + } +#endif + break; + } else if (ptr->is_Proj() && ptr->in(0)->is_Initialize()) { + ptr = ptr->in(0)->in(0); + } else if (ptr->is_Region()) { + Node* copy = ptr->as_Region()->is_copy(); + if (copy != NULL) { + ptr = copy; + continue; + } + if (ptr->req() == 3 && + ptr->in(1) != NULL && ptr->in(1)->is_Proj() && + ptr->in(2) != NULL && ptr->in(2)->is_Proj() && + ptr->in(1)->in(0) == ptr->in(2)->in(0) && + ptr->in(1)->in(0) != NULL && ptr->in(1)->in(0)->is_If()) { + // Simple diamond. + // XXX should check for possibly merging stores. simple data merges are ok. + ptr = ptr->in(1)->in(0)->in(0); + continue; + } +#ifndef PRODUCT + if (PrintOptimizeStringConcat) { + tty->print_cr("fusion would fail for region"); + _begin->dump(); + ptr->dump(2); + } +#endif + fail = true; + break; + } else { + // other unknown control + if (!fail) { +#ifndef PRODUCT + if (PrintOptimizeStringConcat) { + tty->print_cr("fusion would fail for"); + _begin->dump(); + } +#endif + fail = true; + } +#ifndef PRODUCT + if (PrintOptimizeStringConcat) { + ptr->dump(); + } +#endif + ptr = ptr->in(0); + } + } +#ifndef PRODUCT + if (PrintOptimizeStringConcat && fail) { + tty->cr(); + } +#endif + if (fail) return !fail; + + // Validate that all these results produced are contained within + // this cluster of objects. First collect all the results produced + // by calls in the region. + _stringopts->_visited.Clear(); + Node_List worklist; + Node* final_result = _end->proj_out(TypeFunc::Parms); + for (uint i = 0; i < _control.size(); i++) { + CallNode* cnode = _control.at(i)->isa_Call(); + if (cnode != NULL) { + _stringopts->_visited.test_set(cnode->_idx); + } + Node* result = cnode != NULL ? cnode->proj_out(TypeFunc::Parms) : NULL; + if (result != NULL && result != final_result) { + worklist.push(result); + } + } + + Node* last_result = NULL; + while (worklist.size() > 0) { + Node* result = worklist.pop(); + if (_stringopts->_visited.test_set(result->_idx)) + continue; + for (SimpleDUIterator i(result); i.has_next(); i.next()) { + Node *use = i.get(); + if (ctrl_path.member(use)) { + // already checked this + continue; + } + int opc = use->Opcode(); + if (opc == Op_CmpP || opc == Op_Node) { + ctrl_path.push(use); + continue; + } + if (opc == Op_CastPP || opc == Op_CheckCastPP) { + for (SimpleDUIterator j(use); j.has_next(); j.next()) { + worklist.push(j.get()); + } + worklist.push(use->in(1)); + ctrl_path.push(use); + continue; + } +#ifndef PRODUCT + if (PrintOptimizeStringConcat) { + if (result != last_result) { + last_result = result; + tty->print_cr("extra uses for result:"); + last_result->dump(); + } + use->dump(); + } +#endif + fail = true; + break; + } + } + +#ifndef PRODUCT + if (PrintOptimizeStringConcat && !fail) { + ttyLocker ttyl; + tty->cr(); + tty->print("fusion would succeed (%d %d) for ", null_check_count, _uncommon_traps.size()); + _begin->jvms()->dump_spec(tty); tty->cr(); + for (int i = 0; i < num_arguments(); i++) { + argument(i)->dump(); + } + _control.dump(); + tty->cr(); + } +#endif + + return !fail; +} + +Node* PhaseStringOpts::fetch_static_field(GraphKit& kit, ciField* field) { + const TypeKlassPtr* klass_type = TypeKlassPtr::make(field->holder()); + Node* klass_node = __ makecon(klass_type); + BasicType bt = field->layout_type(); + ciType* field_klass = field->type(); + + const Type *type; + if( bt == T_OBJECT ) { + if (!field->type()->is_loaded()) { + type = TypeInstPtr::BOTTOM; + } else if (field->is_constant()) { + // This can happen if the constant oop is non-perm. + ciObject* con = field->constant_value().as_object(); + // Do not "join" in the previous type; it doesn't add value, + // and may yield a vacuous result if the field is of interface type. + type = TypeOopPtr::make_from_constant(con)->isa_oopptr(); + assert(type != NULL, "field singleton type must be consistent"); + } else { + type = TypeOopPtr::make_from_klass(field_klass->as_klass()); + } + } else { + type = Type::get_const_basic_type(bt); + } + + return kit.make_load(NULL, kit.basic_plus_adr(klass_node, field->offset_in_bytes()), + type, T_OBJECT, + C->get_alias_index(klass_type->add_offset(field->offset_in_bytes()))); +} + +Node* PhaseStringOpts::int_stringSize(GraphKit& kit, Node* arg) { + RegionNode *final_merge = new (C, 3) RegionNode(3); + kit.gvn().set_type(final_merge, Type::CONTROL); + Node* final_size = new (C, 3) PhiNode(final_merge, TypeInt::INT); + kit.gvn().set_type(final_size, TypeInt::INT); + + IfNode* iff = kit.create_and_map_if(kit.control(), + __ Bool(__ CmpI(arg, __ intcon(0x80000000)), BoolTest::ne), + PROB_FAIR, COUNT_UNKNOWN); + Node* is_min = __ IfFalse(iff); + final_merge->init_req(1, is_min); + final_size->init_req(1, __ intcon(11)); + + kit.set_control(__ IfTrue(iff)); + if (kit.stopped()) { + final_merge->init_req(2, C->top()); + final_size->init_req(2, C->top()); + } else { + + // int size = (i < 0) ? stringSize(-i) + 1 : stringSize(i); + RegionNode *r = new (C, 3) RegionNode(3); + kit.gvn().set_type(r, Type::CONTROL); + Node *phi = new (C, 3) PhiNode(r, TypeInt::INT); + kit.gvn().set_type(phi, TypeInt::INT); + Node *size = new (C, 3) PhiNode(r, TypeInt::INT); + kit.gvn().set_type(size, TypeInt::INT); + Node* chk = __ CmpI(arg, __ intcon(0)); + Node* p = __ Bool(chk, BoolTest::lt); + IfNode* iff = kit.create_and_map_if(kit.control(), p, PROB_FAIR, COUNT_UNKNOWN); + Node* lessthan = __ IfTrue(iff); + Node* greaterequal = __ IfFalse(iff); + r->init_req(1, lessthan); + phi->init_req(1, __ SubI(__ intcon(0), arg)); + size->init_req(1, __ intcon(1)); + r->init_req(2, greaterequal); + phi->init_req(2, arg); + size->init_req(2, __ intcon(0)); + kit.set_control(r); + C->record_for_igvn(r); + C->record_for_igvn(phi); + C->record_for_igvn(size); + + // for (int i=0; ; i++) + // if (x <= sizeTable[i]) + // return i+1; + RegionNode *loop = new (C, 3) RegionNode(3); + loop->init_req(1, kit.control()); + kit.gvn().set_type(loop, Type::CONTROL); + + Node *index = new (C, 3) PhiNode(loop, TypeInt::INT); + index->init_req(1, __ intcon(0)); + kit.gvn().set_type(index, TypeInt::INT); + kit.set_control(loop); + Node* sizeTable = fetch_static_field(kit, size_table_field); + + Node* value = kit.load_array_element(NULL, sizeTable, index, TypeAryPtr::INTS); + C->record_for_igvn(value); + Node* limit = __ CmpI(phi, value); + Node* limitb = __ Bool(limit, BoolTest::le); + IfNode* iff2 = kit.create_and_map_if(kit.control(), limitb, PROB_MIN, COUNT_UNKNOWN); + Node* lessEqual = __ IfTrue(iff2); + Node* greater = __ IfFalse(iff2); + + loop->init_req(2, greater); + index->init_req(2, __ AddI(index, __ intcon(1))); + + kit.set_control(lessEqual); + C->record_for_igvn(loop); + C->record_for_igvn(index); + + final_merge->init_req(2, kit.control()); + final_size->init_req(2, __ AddI(__ AddI(index, size), __ intcon(1))); + } + + kit.set_control(final_merge); + C->record_for_igvn(final_merge); + C->record_for_igvn(final_size); + + return final_size; +} + +void PhaseStringOpts::int_getChars(GraphKit& kit, Node* arg, Node* char_array, Node* start, Node* end) { + RegionNode *final_merge = new (C, 4) RegionNode(4); + kit.gvn().set_type(final_merge, Type::CONTROL); + Node *final_mem = PhiNode::make(final_merge, kit.memory(char_adr_idx), Type::MEMORY, TypeAryPtr::CHARS); + kit.gvn().set_type(final_mem, Type::MEMORY); + + // need to handle Integer.MIN_VALUE specially because negating doesn't make it positive + { + // i == MIN_VALUE + IfNode* iff = kit.create_and_map_if(kit.control(), + __ Bool(__ CmpI(arg, __ intcon(0x80000000)), BoolTest::ne), + PROB_FAIR, COUNT_UNKNOWN); + + Node* old_mem = kit.memory(char_adr_idx); + + kit.set_control(__ IfFalse(iff)); + if (kit.stopped()) { + // Statically not equal to MIN_VALUE so this path is dead + final_merge->init_req(3, kit.control()); + } else { + copy_string(kit, __ makecon(TypeInstPtr::make(C->env()->the_min_jint_string())), + char_array, start); + final_merge->init_req(3, kit.control()); + final_mem->init_req(3, kit.memory(char_adr_idx)); + } + + kit.set_control(__ IfTrue(iff)); + kit.set_memory(old_mem, char_adr_idx); + } + + + // Simplified version of Integer.getChars + + // int q, r; + // int charPos = index; + Node* charPos = end; + + // char sign = 0; + + Node* i = arg; + Node* sign = __ intcon(0); + + // if (i < 0) { + // sign = '-'; + // i = -i; + // } + { + IfNode* iff = kit.create_and_map_if(kit.control(), + __ Bool(__ CmpI(arg, __ intcon(0)), BoolTest::lt), + PROB_FAIR, COUNT_UNKNOWN); + + RegionNode *merge = new (C, 3) RegionNode(3); + kit.gvn().set_type(merge, Type::CONTROL); + i = new (C, 3) PhiNode(merge, TypeInt::INT); + kit.gvn().set_type(i, TypeInt::INT); + sign = new (C, 3) PhiNode(merge, TypeInt::INT); + kit.gvn().set_type(sign, TypeInt::INT); + + merge->init_req(1, __ IfTrue(iff)); + i->init_req(1, __ SubI(__ intcon(0), arg)); + sign->init_req(1, __ intcon('-')); + merge->init_req(2, __ IfFalse(iff)); + i->init_req(2, arg); + sign->init_req(2, __ intcon(0)); + + kit.set_control(merge); + + C->record_for_igvn(merge); + C->record_for_igvn(i); + C->record_for_igvn(sign); + } + + // for (;;) { + // q = i / 10; + // r = i - ((q << 3) + (q << 1)); // r = i-(q*10) ... + // buf [--charPos] = digits [r]; + // i = q; + // if (i == 0) break; + // } + + { + RegionNode *head = new (C, 3) RegionNode(3); + head->init_req(1, kit.control()); + kit.gvn().set_type(head, Type::CONTROL); + Node *i_phi = new (C, 3) PhiNode(head, TypeInt::INT); + i_phi->init_req(1, i); + kit.gvn().set_type(i_phi, TypeInt::INT); + charPos = PhiNode::make(head, charPos); + kit.gvn().set_type(charPos, TypeInt::INT); + Node *mem = PhiNode::make(head, kit.memory(char_adr_idx), Type::MEMORY, TypeAryPtr::CHARS); + kit.gvn().set_type(mem, Type::MEMORY); + kit.set_control(head); + kit.set_memory(mem, char_adr_idx); + + Node* q = __ DivI(NULL, i_phi, __ intcon(10)); + Node* r = __ SubI(i_phi, __ AddI(__ LShiftI(q, __ intcon(3)), + __ LShiftI(q, __ intcon(1)))); + Node* m1 = __ SubI(charPos, __ intcon(1)); + Node* ch = __ AddI(r, __ intcon('0')); + + Node* st = __ store_to_memory(kit.control(), kit.array_element_address(char_array, m1, T_CHAR), + ch, T_CHAR, char_adr_idx); + + + IfNode* iff = kit.create_and_map_if(head, __ Bool(__ CmpI(q, __ intcon(0)), BoolTest::ne), + PROB_FAIR, COUNT_UNKNOWN); + Node* ne = __ IfTrue(iff); + Node* eq = __ IfFalse(iff); + + head->init_req(2, ne); + mem->init_req(2, st); + i_phi->init_req(2, q); + charPos->init_req(2, m1); + + charPos = m1; + + kit.set_control(eq); + kit.set_memory(st, char_adr_idx); + + C->record_for_igvn(head); + C->record_for_igvn(mem); + C->record_for_igvn(i_phi); + C->record_for_igvn(charPos); + } + + { + // if (sign != 0) { + // buf [--charPos] = sign; + // } + IfNode* iff = kit.create_and_map_if(kit.control(), + __ Bool(__ CmpI(sign, __ intcon(0)), BoolTest::ne), + PROB_FAIR, COUNT_UNKNOWN); + + final_merge->init_req(2, __ IfFalse(iff)); + final_mem->init_req(2, kit.memory(char_adr_idx)); + + kit.set_control(__ IfTrue(iff)); + if (kit.stopped()) { + final_merge->init_req(1, C->top()); + final_mem->init_req(1, C->top()); + } else { + Node* m1 = __ SubI(charPos, __ intcon(1)); + Node* st = __ store_to_memory(kit.control(), kit.array_element_address(char_array, m1, T_CHAR), + sign, T_CHAR, char_adr_idx); + + final_merge->init_req(1, kit.control()); + final_mem->init_req(1, st); + } + + kit.set_control(final_merge); + kit.set_memory(final_mem, char_adr_idx); + + C->record_for_igvn(final_merge); + C->record_for_igvn(final_mem); + } +} + + +Node* PhaseStringOpts::copy_string(GraphKit& kit, Node* str, Node* char_array, Node* start) { + Node* string = str; + Node* offset = kit.make_load(NULL, + kit.basic_plus_adr(string, string, java_lang_String::offset_offset_in_bytes()), + TypeInt::INT, T_INT, offset_field_idx); + Node* count = kit.make_load(NULL, + kit.basic_plus_adr(string, string, java_lang_String::count_offset_in_bytes()), + TypeInt::INT, T_INT, count_field_idx); + const TypeAryPtr* value_type = TypeAryPtr::make(TypePtr::NotNull, + TypeAry::make(TypeInt::CHAR,TypeInt::POS), + ciTypeArrayKlass::make(T_CHAR), true, 0); + Node* value = kit.make_load(NULL, + kit.basic_plus_adr(string, string, java_lang_String::value_offset_in_bytes()), + value_type, T_OBJECT, value_field_idx); + + // copy the contents + if (offset->is_Con() && count->is_Con() && value->is_Con() && count->get_int() < unroll_string_copy_length) { + // For small constant strings just emit individual stores. + // A length of 6 seems like a good space/speed tradeof. + int c = count->get_int(); + int o = offset->get_int(); + const TypeOopPtr* t = kit.gvn().type(value)->isa_oopptr(); + ciTypeArray* value_array = t->const_oop()->as_type_array(); + for (int e = 0; e < c; e++) { + __ store_to_memory(kit.control(), kit.array_element_address(char_array, start, T_CHAR), + __ intcon(value_array->char_at(o + e)), T_CHAR, char_adr_idx); + start = __ AddI(start, __ intcon(1)); + } + } else { + Node* src_ptr = kit.array_element_address(value, offset, T_CHAR); + Node* dst_ptr = kit.array_element_address(char_array, start, T_CHAR); + Node* c = count; + Node* extra = NULL; +#ifdef _LP64 + c = __ ConvI2L(c); + extra = C->top(); +#endif + Node* call = kit.make_runtime_call(GraphKit::RC_LEAF|GraphKit::RC_NO_FP, + OptoRuntime::fast_arraycopy_Type(), + CAST_FROM_FN_PTR(address, StubRoutines::jshort_disjoint_arraycopy()), + "jshort_disjoint_arraycopy", TypeAryPtr::CHARS, + src_ptr, dst_ptr, c, extra); + start = __ AddI(start, count); + } + return start; +} + + +void PhaseStringOpts::replace_string_concat(StringConcat* sc) { + // Log a little info about the transformation + sc->maybe_log_transform(); + + // pull the JVMState of the allocation into a SafePointNode to serve as + // as a shim for the insertion of the new code. + JVMState* jvms = sc->begin()->jvms()->clone_shallow(C); + uint size = sc->begin()->req(); + SafePointNode* map = new (C, size) SafePointNode(size, jvms); + + // copy the control and memory state from the final call into our + // new starting state. This allows any preceeding tests to feed + // into the new section of code. + for (uint i1 = 0; i1 < TypeFunc::Parms; i1++) { + map->init_req(i1, sc->end()->in(i1)); + } + // blow away old allocation arguments + for (uint i1 = TypeFunc::Parms; i1 < jvms->debug_start(); i1++) { + map->init_req(i1, C->top()); + } + // Copy the rest of the inputs for the JVMState + for (uint i1 = jvms->debug_start(); i1 < sc->begin()->req(); i1++) { + map->init_req(i1, sc->begin()->in(i1)); + } + // Make sure the memory state is a MergeMem for parsing. + if (!map->in(TypeFunc::Memory)->is_MergeMem()) { + map->set_req(TypeFunc::Memory, MergeMemNode::make(C, map->in(TypeFunc::Memory))); + } + + jvms->set_map(map); + map->ensure_stack(jvms, jvms->method()->max_stack()); + + + // disconnect all the old StringBuilder calls from the graph + sc->eliminate_unneeded_control(); + + // At this point all the old work has been completely removed from + // the graph and the saved JVMState exists at the point where the + // final toString call used to be. + GraphKit kit(jvms); + + // There may be uncommon traps which are still using the + // intermediate states and these need to be rewritten to point at + // the JVMState at the beginning of the transformation. + sc->convert_uncommon_traps(kit, jvms); + + // Now insert the logic to compute the size of the string followed + // by all the logic to construct array and resulting string. + + Node* null_string = __ makecon(TypeInstPtr::make(C->env()->the_null_string())); + + // Create a region for the overflow checks to merge into. + int args = MAX2(sc->num_arguments(), 1); + RegionNode* overflow = new (C, args) RegionNode(args); + kit.gvn().set_type(overflow, Type::CONTROL); + + // Create a hook node to hold onto the individual sizes since they + // are need for the copying phase. + Node* string_sizes = new (C, args) Node(args); + + Node* length = __ intcon(0); + for (int argi = 0; argi < sc->num_arguments(); argi++) { + Node* arg = sc->argument(argi); + switch (sc->mode(argi)) { + case StringConcat::IntMode: { + Node* string_size = int_stringSize(kit, arg); + + // accumulate total + length = __ AddI(length, string_size); + + // Cache this value for the use by int_toString + string_sizes->init_req(argi, string_size); + break; + } + case StringConcat::StringMode: { + const Type* type = kit.gvn().type(arg); + if (type == TypePtr::NULL_PTR) { + // replace the argument with the null checked version + arg = null_string; + sc->set_argument(argi, arg); + } else if (!type->higher_equal(TypeInstPtr::NOTNULL)) { + // s = s != null ? s : "null"; + // length = length + (s.count - s.offset); + RegionNode *r = new (C, 3) RegionNode(3); + kit.gvn().set_type(r, Type::CONTROL); + Node *phi = new (C, 3) PhiNode(r, type); + kit.gvn().set_type(phi, phi->bottom_type()); + Node* p = __ Bool(__ CmpP(arg, kit.null()), BoolTest::ne); + IfNode* iff = kit.create_and_map_if(kit.control(), p, PROB_MIN, COUNT_UNKNOWN); + Node* notnull = __ IfTrue(iff); + Node* isnull = __ IfFalse(iff); + kit.set_control(notnull); // set control for the cast_not_null + r->init_req(1, notnull); + phi->init_req(1, kit.cast_not_null(arg, false)); + r->init_req(2, isnull); + phi->init_req(2, null_string); + kit.set_control(r); + C->record_for_igvn(r); + C->record_for_igvn(phi); + // replace the argument with the null checked version + arg = phi; + sc->set_argument(argi, arg); + } + // Node* offset = kit.make_load(NULL, kit.basic_plus_adr(arg, arg, offset_offset), + // TypeInt::INT, T_INT, offset_field_idx); + Node* count = kit.make_load(NULL, kit.basic_plus_adr(arg, arg, java_lang_String::count_offset_in_bytes()), + TypeInt::INT, T_INT, count_field_idx); + length = __ AddI(length, count); + string_sizes->init_req(argi, NULL); + break; + } + case StringConcat::CharMode: { + // one character only + length = __ AddI(length, __ intcon(1)); + break; + } + default: + ShouldNotReachHere(); + } + if (argi > 0) { + // Check that the sum hasn't overflowed + IfNode* iff = kit.create_and_map_if(kit.control(), + __ Bool(__ CmpI(length, __ intcon(0)), BoolTest::lt), + PROB_MIN, COUNT_UNKNOWN); + kit.set_control(__ IfFalse(iff)); + overflow->set_req(argi, __ IfTrue(iff)); + } + } + + { + // Hook + PreserveJVMState pjvms(&kit); + kit.set_control(overflow); + kit.uncommon_trap(Deoptimization::Reason_intrinsic, + Deoptimization::Action_make_not_entrant); + } + + // length now contains the number of characters needed for the + // char[] so create a new AllocateArray for the char[] + Node* char_array = NULL; + { + PreserveReexecuteState preexecs(&kit); + // The original jvms is for an allocation of either a String or + // StringBuffer so no stack adjustment is necessary for proper + // reexecution. If we deoptimize in the slow path the bytecode + // will be reexecuted and the char[] allocation will be thrown away. + kit.jvms()->set_should_reexecute(true); + char_array = kit.new_array(__ makecon(TypeKlassPtr::make(ciTypeArrayKlass::make(T_CHAR))), + length, 1); + } + + // Mark the allocation so that zeroing is skipped since the code + // below will overwrite the entire array + AllocateArrayNode* char_alloc = AllocateArrayNode::Ideal_array_allocation(char_array, _gvn); + char_alloc->maybe_set_complete(_gvn); + + // Now copy the string representations into the final char[] + Node* start = __ intcon(0); + for (int argi = 0; argi < sc->num_arguments(); argi++) { + Node* arg = sc->argument(argi); + switch (sc->mode(argi)) { + case StringConcat::IntMode: { + Node* end = __ AddI(start, string_sizes->in(argi)); + // getChars words backwards so pass the ending point as well as the start + int_getChars(kit, arg, char_array, start, end); + start = end; + break; + } + case StringConcat::StringMode: { + start = copy_string(kit, arg, char_array, start); + break; + } + case StringConcat::CharMode: { + __ store_to_memory(kit.control(), kit.array_element_address(char_array, start, T_CHAR), + arg, T_CHAR, char_adr_idx); + start = __ AddI(start, __ intcon(1)); + break; + } + default: + ShouldNotReachHere(); + } + } + + // If we're not reusing an existing String allocation then allocate one here. + Node* result = sc->string_alloc(); + if (result == NULL) { + PreserveReexecuteState preexecs(&kit); + // The original jvms is for an allocation of either a String or + // StringBuffer so no stack adjustment is necessary for proper + // reexecution. + kit.jvms()->set_should_reexecute(true); + result = kit.new_instance(__ makecon(TypeKlassPtr::make(C->env()->String_klass()))); + } + + // Intialize the string + kit.store_to_memory(kit.control(), kit.basic_plus_adr(result, java_lang_String::offset_offset_in_bytes()), + __ intcon(0), T_INT, offset_field_idx); + kit.store_to_memory(kit.control(), kit.basic_plus_adr(result, java_lang_String::count_offset_in_bytes()), + length, T_INT, count_field_idx); + kit.store_to_memory(kit.control(), kit.basic_plus_adr(result, java_lang_String::value_offset_in_bytes()), + char_array, T_OBJECT, value_field_idx); + + // hook up the outgoing control and result + kit.replace_call(sc->end(), result); + + // Unhook any hook nodes + string_sizes->disconnect_inputs(NULL); + sc->cleanup(); +} diff --git a/hotspot/src/share/vm/opto/stringopts.hpp b/hotspot/src/share/vm/opto/stringopts.hpp new file mode 100644 index 00000000000..417e08a9185 --- /dev/null +++ b/hotspot/src/share/vm/opto/stringopts.hpp @@ -0,0 +1,83 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +class StringConcat; + +class PhaseStringOpts : public Phase { + friend class StringConcat; + + private: + PhaseGVN* _gvn; + + // List of dead nodes to clean up aggressively at the end + Unique_Node_List dead_worklist; + + // Memory slices needed for code gen + int char_adr_idx; + int value_field_idx; + int count_field_idx; + int offset_field_idx; + + // Integer.sizeTable - used for int to String conversion + ciField* size_table_field; + + // A set for use by various stages + VectorSet _visited; + + // Collect a list of all SB.toString calls + Node_List collect_toString_calls(); + + // Examine the use of the SB alloc to see if it can be replace with + // a single string construction. + StringConcat* build_candidate(CallStaticJavaNode* call); + + // Replace all the SB calls in concat with an optimization String allocation + void replace_string_concat(StringConcat* concat); + + // Load the value of a static field, performing any constant folding. + Node* fetch_static_field(GraphKit& kit, ciField* field); + + // Compute the number of characters required to represent the int value + Node* int_stringSize(GraphKit& kit, Node* value); + + // Copy the characters representing value into char_array starting at start + void int_getChars(GraphKit& kit, Node* value, Node* char_array, Node* start, Node* end); + + // Copy of the contents of the String str into char_array starting at index start. + Node* copy_string(GraphKit& kit, Node* str, Node* char_array, Node* start); + + // Clean up any leftover nodes + void record_dead_node(Node* node); + void remove_dead_nodes(); + + PhaseGVN* gvn() { return _gvn; } + + enum { + // max length of constant string copy unrolling in copy_string + unroll_string_copy_length = 6 + }; + + public: + PhaseStringOpts(PhaseGVN* gvn, Unique_Node_List* worklist); +}; diff --git a/hotspot/src/share/vm/opto/subnode.cpp b/hotspot/src/share/vm/opto/subnode.cpp index 81e033f2769..1a8c2f60e66 100644 --- a/hotspot/src/share/vm/opto/subnode.cpp +++ b/hotspot/src/share/vm/opto/subnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1244,8 +1244,7 @@ const Type *CosDNode::Value( PhaseTransform *phase ) const { if( t1 == Type::TOP ) return Type::TOP; if( t1->base() != Type::DoubleCon ) return Type::DOUBLE; double d = t1->getd(); - if( d < 0.0 ) return Type::DOUBLE; - return TypeD::make( SharedRuntime::dcos( d ) ); + return TypeD::make( StubRoutines::intrinsic_cos( d ) ); } //============================================================================= @@ -1256,8 +1255,7 @@ const Type *SinDNode::Value( PhaseTransform *phase ) const { if( t1 == Type::TOP ) return Type::TOP; if( t1->base() != Type::DoubleCon ) return Type::DOUBLE; double d = t1->getd(); - if( d < 0.0 ) return Type::DOUBLE; - return TypeD::make( SharedRuntime::dsin( d ) ); + return TypeD::make( StubRoutines::intrinsic_sin( d ) ); } //============================================================================= @@ -1268,8 +1266,7 @@ const Type *TanDNode::Value( PhaseTransform *phase ) const { if( t1 == Type::TOP ) return Type::TOP; if( t1->base() != Type::DoubleCon ) return Type::DOUBLE; double d = t1->getd(); - if( d < 0.0 ) return Type::DOUBLE; - return TypeD::make( SharedRuntime::dtan( d ) ); + return TypeD::make( StubRoutines::intrinsic_tan( d ) ); } //============================================================================= @@ -1280,8 +1277,7 @@ const Type *LogDNode::Value( PhaseTransform *phase ) const { if( t1 == Type::TOP ) return Type::TOP; if( t1->base() != Type::DoubleCon ) return Type::DOUBLE; double d = t1->getd(); - if( d < 0.0 ) return Type::DOUBLE; - return TypeD::make( SharedRuntime::dlog( d ) ); + return TypeD::make( StubRoutines::intrinsic_log( d ) ); } //============================================================================= @@ -1292,8 +1288,7 @@ const Type *Log10DNode::Value( PhaseTransform *phase ) const { if( t1 == Type::TOP ) return Type::TOP; if( t1->base() != Type::DoubleCon ) return Type::DOUBLE; double d = t1->getd(); - if( d < 0.0 ) return Type::DOUBLE; - return TypeD::make( SharedRuntime::dlog10( d ) ); + return TypeD::make( StubRoutines::intrinsic_log10( d ) ); } //============================================================================= @@ -1304,8 +1299,7 @@ const Type *ExpDNode::Value( PhaseTransform *phase ) const { if( t1 == Type::TOP ) return Type::TOP; if( t1->base() != Type::DoubleCon ) return Type::DOUBLE; double d = t1->getd(); - if( d < 0.0 ) return Type::DOUBLE; - return TypeD::make( SharedRuntime::dexp( d ) ); + return TypeD::make( StubRoutines::intrinsic_exp( d ) ); } @@ -1323,5 +1317,5 @@ const Type *PowDNode::Value( PhaseTransform *phase ) const { double d2 = t2->getd(); if( d1 < 0.0 ) return Type::DOUBLE; if( d2 < 0.0 ) return Type::DOUBLE; - return TypeD::make( SharedRuntime::dpow( d1, d2 ) ); + return TypeD::make( StubRoutines::intrinsic_pow( d1, d2 ) ); } diff --git a/hotspot/src/share/vm/opto/superword.cpp b/hotspot/src/share/vm/opto/superword.cpp index bc62f30c3d3..83d359d31f1 100644 --- a/hotspot/src/share/vm/opto/superword.cpp +++ b/hotspot/src/share/vm/opto/superword.cpp @@ -1921,6 +1921,11 @@ SWPointer::SWPointer(MemNode* mem, SuperWord* slp) : } // Match AddP(base, AddP(ptr, k*iv [+ invariant]), constant) Node* base = adr->in(AddPNode::Base); + //unsafe reference could not be aligned appropriately without runtime checking + if (base == NULL || base->bottom_type() == Type::TOP) { + assert(!valid(), "unsafe access"); + return; + } for (int i = 0; i < 3; i++) { if (!scaled_iv_plus_offset(adr->in(AddPNode::Offset))) { assert(!valid(), "too complex"); diff --git a/hotspot/src/share/vm/opto/type.cpp b/hotspot/src/share/vm/opto/type.cpp index c22d1e8f6b0..289835af4c8 100644 --- a/hotspot/src/share/vm/opto/type.cpp +++ b/hotspot/src/share/vm/opto/type.cpp @@ -2431,7 +2431,7 @@ const TypeOopPtr* TypeOopPtr::make_from_klass_common(ciKlass *klass, bool klass_ //------------------------------make_from_constant----------------------------- // Make a java pointer from an oop constant const TypeOopPtr* TypeOopPtr::make_from_constant(ciObject* o, bool require_constant) { - if (o->is_method_data() || o->is_method()) { + if (o->is_method_data() || o->is_method() || o->is_cpcache()) { // Treat much like a typeArray of bytes, like below, but fake the type... const Type* etype = (Type*)get_const_basic_type(T_BYTE); const TypeAry* arr0 = TypeAry::make(etype, TypeInt::POS); @@ -3966,7 +3966,7 @@ const TypeFunc *TypeFunc::make(ciMethod* method) { const TypeFunc* tf = C->last_tf(method); // check cache if (tf != NULL) return tf; // The hit rate here is almost 50%. const TypeTuple *domain; - if (method->flags().is_static()) { + if (method->is_static()) { domain = TypeTuple::make_domain(NULL, method->signature()); } else { domain = TypeTuple::make_domain(method->holder(), method->signature()); diff --git a/hotspot/src/share/vm/opto/type.hpp b/hotspot/src/share/vm/opto/type.hpp index 9b11f9ca595..03f81532c41 100644 --- a/hotspot/src/share/vm/opto/type.hpp +++ b/hotspot/src/share/vm/opto/type.hpp @@ -847,9 +847,6 @@ public: // Constant pointer to array static const TypeAryPtr *make( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot); - // Convenience - static const TypeAryPtr *make(ciObject* o); - // Return a 'ptr' version of this type virtual const Type *cast_to_ptr_type(PTR ptr) const; diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index 20484da07a9..fbf66099a79 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -396,11 +396,11 @@ JNI_ENTRY(jmethodID, jni_FromReflectedMethod(JNIEnv *env, jobject method)) oop mirror = NULL; int slot = 0; - if (reflected->klass() == SystemDictionary::reflect_constructor_klass()) { + if (reflected->klass() == SystemDictionary::reflect_Constructor_klass()) { mirror = java_lang_reflect_Constructor::clazz(reflected); slot = java_lang_reflect_Constructor::slot(reflected); } else { - assert(reflected->klass() == SystemDictionary::reflect_method_klass(), "wrong type"); + assert(reflected->klass() == SystemDictionary::reflect_Method_klass(), "wrong type"); mirror = java_lang_reflect_Method::clazz(reflected); slot = java_lang_reflect_Method::slot(reflected); } @@ -496,7 +496,7 @@ JNI_ENTRY(jclass, jni_GetSuperclass(JNIEnv *env, jclass sub)) klassOop super = Klass::cast(k)->java_super(); // super2 is the value computed by the compiler's getSuperClass intrinsic: debug_only(klassOop super2 = ( Klass::cast(k)->oop_is_javaArray() - ? SystemDictionary::object_klass() + ? SystemDictionary::Object_klass() : Klass::cast(k)->super() ) ); assert(super == super2, "java_super computation depends on interface, array, other super"); @@ -584,7 +584,7 @@ JNI_ENTRY_NO_PRESERVE(void, jni_ExceptionDescribe(JNIEnv *env)) if (thread->has_pending_exception()) { Handle ex(thread, thread->pending_exception()); thread->clear_pending_exception(); - if (ex->is_a(SystemDictionary::threaddeath_klass())) { + if (ex->is_a(SystemDictionary::ThreadDeath_klass())) { // Don't print anything if we are being killed. } else { jio_fprintf(defaultStream::error_stream(), "Exception "); @@ -593,12 +593,12 @@ JNI_ENTRY_NO_PRESERVE(void, jni_ExceptionDescribe(JNIEnv *env)) jio_fprintf(defaultStream::error_stream(), "in thread \"%s\" ", thread->get_thread_name()); } - if (ex->is_a(SystemDictionary::throwable_klass())) { + if (ex->is_a(SystemDictionary::Throwable_klass())) { JavaValue result(T_VOID); JavaCalls::call_virtual(&result, ex, KlassHandle(THREAD, - SystemDictionary::throwable_klass()), + SystemDictionary::Throwable_klass()), vmSymbolHandles::printStackTrace_name(), vmSymbolHandles::void_method_signature(), THREAD); @@ -3231,6 +3231,21 @@ _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_CreateJavaVM(JavaVM **vm, void **penv, v jint result = JNI_ERR; DT_RETURN_MARK(CreateJavaVM, jint, (const jint&)result); + // We're about to use Atomic::xchg for synchronization. Some Zero + // platforms use the GCC builtin __sync_lock_test_and_set for this, + // but __sync_lock_test_and_set is not guaranteed to do what we want + // on all architectures. So we check it works before relying on it. +#if defined(ZERO) && defined(ASSERT) + { + jint a = 0xcafebabe; + jint b = Atomic::xchg(0xdeadbeef, &a); + void *c = &a; + void *d = Atomic::xchg_ptr(&b, &c); + assert(a == (jint) 0xdeadbeef && b == (jint) 0xcafebabe, "Atomic::xchg() works"); + assert(c == &b && d == &a, "Atomic::xchg_ptr() works"); + } +#endif // ZERO && ASSERT + // At the moment it's only possible to have one Java VM, // since some of the runtime state is in global variables. diff --git a/hotspot/src/share/vm/prims/jniCheck.cpp b/hotspot/src/share/vm/prims/jniCheck.cpp index 0e3baac47ed..43c17cc392b 100644 --- a/hotspot/src/share/vm/prims/jniCheck.cpp +++ b/hotspot/src/share/vm/prims/jniCheck.cpp @@ -341,7 +341,7 @@ klassOop jniCheck::validate_class(JavaThread* thr, jclass clazz, bool allow_prim ReportJNIFatalError(thr, fatal_received_null_class); } - if (mirror->klass() != SystemDictionary::class_klass()) { + if (mirror->klass() != SystemDictionary::Class_klass()) { ReportJNIFatalError(thr, fatal_class_not_a_class); } @@ -358,7 +358,7 @@ void jniCheck::validate_throwable_klass(JavaThread* thr, klassOop klass) { assert(klass != NULL, "klass argument must have a value"); if (!Klass::cast(klass)->oop_is_instance() || - !instanceKlass::cast(klass)->is_subclass_of(SystemDictionary::throwable_klass())) { + !instanceKlass::cast(klass)->is_subclass_of(SystemDictionary::Throwable_klass())) { ReportJNIFatalError(thr, fatal_class_not_a_throwable_class); } } diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp index 36c6507ee72..7ddb08d9967 100644 --- a/hotspot/src/share/vm/prims/jvm.cpp +++ b/hotspot/src/share/vm/prims/jvm.cpp @@ -80,7 +80,7 @@ static void trace_class_resolution_impl(klassOop to_class, TRAPS) { while (!vfst.at_end()) { methodOop m = vfst.method(); - if (!vfst.method()->method_holder()->klass_part()->is_subclass_of(SystemDictionary::classloader_klass())&& + if (!vfst.method()->method_holder()->klass_part()->is_subclass_of(SystemDictionary::ClassLoader_klass())&& !vfst.method()->method_holder()->klass_part()->is_subclass_of(access_controller_klass) && !vfst.method()->method_holder()->klass_part()->is_subclass_of(privileged_action_klass)) { break; @@ -257,7 +257,7 @@ static void set_property(Handle props, const char* key, const char* value, TRAPS Handle value_str = java_lang_String::create_from_platform_dependent_str((value != NULL ? value : ""), CHECK); JavaCalls::call_virtual(&r, props, - KlassHandle(THREAD, SystemDictionary::properties_klass()), + KlassHandle(THREAD, SystemDictionary::Properties_klass()), vmSymbolHandles::put_name(), vmSymbolHandles::object_object_object_signature(), key_str, @@ -495,7 +495,7 @@ JVM_ENTRY(jobject, JVM_Clone(JNIEnv* env, jobject handle)) guarantee(klass->is_cloneable(), "all arrays are cloneable"); } else { guarantee(obj->is_instance(), "should be instanceOop"); - bool cloneable = klass->is_subtype_of(SystemDictionary::cloneable_klass()); + bool cloneable = klass->is_subtype_of(SystemDictionary::Cloneable_klass()); guarantee(cloneable == klass->is_cloneable(), "incorrect cloneable flag"); } #endif @@ -908,7 +908,7 @@ JVM_ENTRY(jobjectArray, JVM_GetClassInterfaces(JNIEnv *env, jclass cls)) // Special handling for primitive objects if (java_lang_Class::is_primitive(mirror)) { // Primitive objects does not have any interfaces - objArrayOop r = oopFactory::new_objArray(SystemDictionary::class_klass(), 0, CHECK_NULL); + objArrayOop r = oopFactory::new_objArray(SystemDictionary::Class_klass(), 0, CHECK_NULL); return (jobjectArray) JNIHandles::make_local(env, r); } @@ -923,7 +923,7 @@ JVM_ENTRY(jobjectArray, JVM_GetClassInterfaces(JNIEnv *env, jclass cls)) } // Allocate result array - objArrayOop r = oopFactory::new_objArray(SystemDictionary::class_klass(), size, CHECK_NULL); + objArrayOop r = oopFactory::new_objArray(SystemDictionary::Class_klass(), size, CHECK_NULL); objArrayHandle result (THREAD, r); // Fill in result if (klass->oop_is_instance()) { @@ -934,8 +934,8 @@ JVM_ENTRY(jobjectArray, JVM_GetClassInterfaces(JNIEnv *env, jclass cls)) } } else { // All arrays implement java.lang.Cloneable and java.io.Serializable - result->obj_at_put(0, Klass::cast(SystemDictionary::cloneable_klass())->java_mirror()); - result->obj_at_put(1, Klass::cast(SystemDictionary::serializable_klass())->java_mirror()); + result->obj_at_put(0, Klass::cast(SystemDictionary::Cloneable_klass())->java_mirror()); + result->obj_at_put(1, Klass::cast(SystemDictionary::Serializable_klass())->java_mirror()); } return (jobjectArray) JNIHandles::make_local(env, result()); JVM_END @@ -1098,8 +1098,8 @@ JVM_ENTRY(jobject, JVM_DoPrivileged(JNIEnv *env, jclass cls, jobject action, job pending_exception = Handle(THREAD, PENDING_EXCEPTION); CLEAR_PENDING_EXCEPTION; - if ( pending_exception->is_a(SystemDictionary::exception_klass()) && - !pending_exception->is_a(SystemDictionary::runtime_exception_klass())) { + if ( pending_exception->is_a(SystemDictionary::Exception_klass()) && + !pending_exception->is_a(SystemDictionary::RuntimeException_klass())) { // Throw a java.security.PrivilegedActionException(Exception e) exception JavaCallArguments args(pending_exception); THROW_ARG_0(vmSymbolHandles::java_security_PrivilegedActionException(), @@ -1190,7 +1190,7 @@ JVM_ENTRY(jobject, JVM_GetStackAccessControlContext(JNIEnv *env, jclass cls)) // the resource area must be registered in case of a gc RegisterArrayForGC ragc(thread, local_array); - objArrayOop context = oopFactory::new_objArray(SystemDictionary::protectionDomain_klass(), + objArrayOop context = oopFactory::new_objArray(SystemDictionary::ProtectionDomain_klass(), local_array->length(), CHECK_NULL); objArrayHandle h_context(thread, context); for (int index = 0; index < local_array->length(); index++) { @@ -1251,7 +1251,7 @@ JVM_ENTRY(jobjectArray, JVM_GetDeclaredClasses(JNIEnv *env, jclass ofClass)) if (java_lang_Class::is_primitive(JNIHandles::resolve_non_null(ofClass)) || ! Klass::cast(java_lang_Class::as_klassOop(JNIHandles::resolve_non_null(ofClass)))->oop_is_instance()) { - oop result = oopFactory::new_objArray(SystemDictionary::class_klass(), 0, CHECK_NULL); + oop result = oopFactory::new_objArray(SystemDictionary::Class_klass(), 0, CHECK_NULL); return (jobjectArray)JNIHandles::make_local(env, result); } @@ -1259,7 +1259,7 @@ JVM_ENTRY(jobjectArray, JVM_GetDeclaredClasses(JNIEnv *env, jclass ofClass)) if (k->inner_classes()->length() == 0) { // Neither an inner nor outer class - oop result = oopFactory::new_objArray(SystemDictionary::class_klass(), 0, CHECK_NULL); + oop result = oopFactory::new_objArray(SystemDictionary::Class_klass(), 0, CHECK_NULL); return (jobjectArray)JNIHandles::make_local(env, result); } @@ -1269,7 +1269,7 @@ JVM_ENTRY(jobjectArray, JVM_GetDeclaredClasses(JNIEnv *env, jclass ofClass)) int length = icls->length(); // Allocate temp. result array - objArrayOop r = oopFactory::new_objArray(SystemDictionary::class_klass(), length/4, CHECK_NULL); + objArrayOop r = oopFactory::new_objArray(SystemDictionary::Class_klass(), length/4, CHECK_NULL); objArrayHandle result (THREAD, r); int members = 0; @@ -1299,7 +1299,7 @@ JVM_ENTRY(jobjectArray, JVM_GetDeclaredClasses(JNIEnv *env, jclass ofClass)) if (members != length) { // Return array of right length - objArrayOop res = oopFactory::new_objArray(SystemDictionary::class_klass(), members, CHECK_NULL); + objArrayOop res = oopFactory::new_objArray(SystemDictionary::Class_klass(), members, CHECK_NULL); for(int i = 0; i < members; i++) { res->obj_at_put(i, result->obj_at(i)); } @@ -1318,19 +1318,20 @@ JVM_ENTRY(jclass, JVM_GetDeclaringClass(JNIEnv *env, jclass ofClass)) return NULL; } - symbolOop simple_name = NULL; + bool inner_is_member = false; klassOop outer_klass = instanceKlass::cast(java_lang_Class::as_klassOop(JNIHandles::resolve_non_null(ofClass)) - )->compute_enclosing_class(simple_name, CHECK_NULL); + )->compute_enclosing_class(&inner_is_member, CHECK_NULL); if (outer_klass == NULL) return NULL; // already a top-level class - if (simple_name == NULL) return NULL; // an anonymous class (inside a method) + if (!inner_is_member) return NULL; // an anonymous class (inside a method) return (jclass) JNIHandles::make_local(env, Klass::cast(outer_klass)->java_mirror()); } JVM_END // should be in instanceKlass.cpp, but is here for historical reasons klassOop instanceKlass::compute_enclosing_class_impl(instanceKlassHandle k, - symbolOop& simple_name_result, TRAPS) { + bool* inner_is_member, + TRAPS) { Thread* thread = THREAD; const int inner_class_info_index = inner_class_inner_class_info_offset; const int outer_class_info_index = inner_class_outer_class_info_offset; @@ -1347,8 +1348,7 @@ klassOop instanceKlass::compute_enclosing_class_impl(instanceKlassHandle k, bool found = false; klassOop ok; instanceKlassHandle outer_klass; - bool inner_is_member = false; - int simple_name_index = 0; + *inner_is_member = false; // Find inner_klass attribute for (int i = 0; i < i_length && !found; i += inner_class_next_offset) { @@ -1364,8 +1364,7 @@ klassOop instanceKlass::compute_enclosing_class_impl(instanceKlassHandle k, if (found && ooff != 0) { ok = i_cp->klass_at(ooff, CHECK_NULL); outer_klass = instanceKlassHandle(thread, ok); - simple_name_index = noff; - inner_is_member = true; + *inner_is_member = true; } } } @@ -1377,7 +1376,7 @@ klassOop instanceKlass::compute_enclosing_class_impl(instanceKlassHandle k, if (encl_method_class_idx != 0) { ok = i_cp->klass_at(encl_method_class_idx, CHECK_NULL); outer_klass = instanceKlassHandle(thread, ok); - inner_is_member = false; + *inner_is_member = false; } } @@ -1387,9 +1386,7 @@ klassOop instanceKlass::compute_enclosing_class_impl(instanceKlassHandle k, // Throws an exception if outer klass has not declared k as an inner klass // We need evidence that each klass knows about the other, or else // the system could allow a spoof of an inner class to gain access rights. - Reflection::check_for_inner_class(outer_klass, k, inner_is_member, CHECK_NULL); - - simple_name_result = (inner_is_member ? i_cp->symbol_at(simple_name_index) : symbolOop(NULL)); + Reflection::check_for_inner_class(outer_klass, k, *inner_is_member, CHECK_NULL); return outer_klass(); } @@ -1473,11 +1470,11 @@ static methodOop jvm_get_method_common(jobject method, TRAPS) { oop mirror = NULL; int slot = 0; - if (reflected->klass() == SystemDictionary::reflect_constructor_klass()) { + if (reflected->klass() == SystemDictionary::reflect_Constructor_klass()) { mirror = java_lang_reflect_Constructor::clazz(reflected); slot = java_lang_reflect_Constructor::slot(reflected); } else { - assert(reflected->klass() == SystemDictionary::reflect_method_klass(), + assert(reflected->klass() == SystemDictionary::reflect_Method_klass(), "wrong type"); mirror = java_lang_reflect_Method::clazz(reflected); slot = java_lang_reflect_Method::slot(reflected); @@ -1533,7 +1530,7 @@ JVM_ENTRY(jobjectArray, JVM_GetClassDeclaredFields(JNIEnv *env, jclass ofClass, if (java_lang_Class::is_primitive(JNIHandles::resolve_non_null(ofClass)) || Klass::cast(java_lang_Class::as_klassOop(JNIHandles::resolve_non_null(ofClass)))->oop_is_javaArray()) { // Return empty array - oop res = oopFactory::new_objArray(SystemDictionary::reflect_field_klass(), 0, CHECK_NULL); + oop res = oopFactory::new_objArray(SystemDictionary::reflect_Field_klass(), 0, CHECK_NULL); return (jobjectArray) JNIHandles::make_local(env, res); } @@ -1561,13 +1558,13 @@ JVM_ENTRY(jobjectArray, JVM_GetClassDeclaredFields(JNIEnv *env, jclass ofClass, } else { num_fields = fields_len / instanceKlass::next_offset; - if (k() == SystemDictionary::throwable_klass()) { + if (k() == SystemDictionary::Throwable_klass()) { num_fields--; skip_backtrace = true; } } - objArrayOop r = oopFactory::new_objArray(SystemDictionary::reflect_field_klass(), num_fields, CHECK_NULL); + objArrayOop r = oopFactory::new_objArray(SystemDictionary::reflect_Field_klass(), num_fields, CHECK_NULL); objArrayHandle result (THREAD, r); int out_idx = 0; @@ -1601,7 +1598,7 @@ JVM_ENTRY(jobjectArray, JVM_GetClassDeclaredMethods(JNIEnv *env, jclass ofClass, if (java_lang_Class::is_primitive(JNIHandles::resolve_non_null(ofClass)) || Klass::cast(java_lang_Class::as_klassOop(JNIHandles::resolve_non_null(ofClass)))->oop_is_javaArray()) { // Return empty array - oop res = oopFactory::new_objArray(SystemDictionary::reflect_method_klass(), 0, CHECK_NULL); + oop res = oopFactory::new_objArray(SystemDictionary::reflect_Method_klass(), 0, CHECK_NULL); return (jobjectArray) JNIHandles::make_local(env, res); } @@ -1625,7 +1622,7 @@ JVM_ENTRY(jobjectArray, JVM_GetClassDeclaredMethods(JNIEnv *env, jclass ofClass, } // Allocate result - objArrayOop r = oopFactory::new_objArray(SystemDictionary::reflect_method_klass(), num_methods, CHECK_NULL); + objArrayOop r = oopFactory::new_objArray(SystemDictionary::reflect_Method_klass(), num_methods, CHECK_NULL); objArrayHandle result (THREAD, r); int out_idx = 0; @@ -1653,7 +1650,7 @@ JVM_ENTRY(jobjectArray, JVM_GetClassDeclaredConstructors(JNIEnv *env, jclass ofC if (java_lang_Class::is_primitive(JNIHandles::resolve_non_null(ofClass)) || Klass::cast(java_lang_Class::as_klassOop(JNIHandles::resolve_non_null(ofClass)))->oop_is_javaArray()) { // Return empty array - oop res = oopFactory::new_objArray(SystemDictionary::reflect_constructor_klass(), 0 , CHECK_NULL); + oop res = oopFactory::new_objArray(SystemDictionary::reflect_Constructor_klass(), 0 , CHECK_NULL); return (jobjectArray) JNIHandles::make_local(env, res); } @@ -1677,7 +1674,7 @@ JVM_ENTRY(jobjectArray, JVM_GetClassDeclaredConstructors(JNIEnv *env, jclass ofC } // Allocate result - objArrayOop r = oopFactory::new_objArray(SystemDictionary::reflect_constructor_klass(), num_constructors, CHECK_NULL); + objArrayOop r = oopFactory::new_objArray(SystemDictionary::reflect_Constructor_klass(), num_constructors, CHECK_NULL); objArrayHandle result(THREAD, r); int out_idx = 0; @@ -1890,7 +1887,7 @@ JVM_ENTRY(jobjectArray, JVM_ConstantPoolGetMemberRefInfoAt(JNIEnv *env, jobject symbolHandle klass_name (THREAD, cp->klass_name_at(klass_ref)); symbolHandle member_name(THREAD, cp->uncached_name_ref_at(index)); symbolHandle member_sig (THREAD, cp->uncached_signature_ref_at(index)); - objArrayOop dest_o = oopFactory::new_objArray(SystemDictionary::string_klass(), 3, CHECK_NULL); + objArrayOop dest_o = oopFactory::new_objArray(SystemDictionary::String_klass(), 3, CHECK_NULL); objArrayHandle dest(THREAD, dest_o); Handle str = java_lang_String::create_from_symbol(klass_name, CHECK_NULL); dest->obj_at_put(0, str()); @@ -2257,10 +2254,8 @@ JVM_ENTRY(const char*, JVM_GetCPMethodNameUTF(JNIEnv *env, jclass cls, jint cp_i switch (cp->tag_at(cp_index).value()) { case JVM_CONSTANT_InterfaceMethodref: case JVM_CONSTANT_Methodref: + case JVM_CONSTANT_NameAndType: // for invokedynamic return cp->uncached_name_ref_at(cp_index)->as_utf8(); - case JVM_CONSTANT_NameAndType: - // for invokedynamic - return cp->nt_name_ref_at(cp_index)->as_utf8(); default: fatal("JVM_GetCPMethodNameUTF: illegal constant"); } @@ -2277,10 +2272,8 @@ JVM_ENTRY(const char*, JVM_GetCPMethodSignatureUTF(JNIEnv *env, jclass cls, jint switch (cp->tag_at(cp_index).value()) { case JVM_CONSTANT_InterfaceMethodref: case JVM_CONSTANT_Methodref: + case JVM_CONSTANT_NameAndType: // for invokedynamic return cp->uncached_signature_ref_at(cp_index)->as_utf8(); - case JVM_CONSTANT_NameAndType: - // for invokedynamic - return cp->nt_signature_ref_at(cp_index)->as_utf8(); default: fatal("JVM_GetCPMethodSignatureUTF: illegal constant"); } @@ -2582,7 +2575,7 @@ static void thread_entry(JavaThread* thread, TRAPS) { JavaValue result(T_VOID); JavaCalls::call_virtual(&result, obj, - KlassHandle(THREAD, SystemDictionary::thread_klass()), + KlassHandle(THREAD, SystemDictionary::Thread_klass()), vmSymbolHandles::run_method_name(), vmSymbolHandles::void_method_signature(), THREAD); @@ -2680,7 +2673,7 @@ JVM_ENTRY(void, JVM_StopThread(JNIEnv* env, jobject jthread, jobject throwable)) // Fix for 4314342, 4145910, perhaps others: it now doesn't have // any effect on the "liveness" of a thread; see // JVM_IsThreadAlive, below. - if (java_throwable->is_a(SystemDictionary::threaddeath_klass())) { + if (java_throwable->is_a(SystemDictionary::ThreadDeath_klass())) { java_lang_Thread::set_stillborn(java_thread); } THROW_OOP(java_throwable); @@ -3035,7 +3028,7 @@ JVM_ENTRY(jobjectArray, JVM_GetClassContext(JNIEnv *env)) } // Create result array of type [Ljava/lang/Class; - objArrayOop result = oopFactory::new_objArray(SystemDictionary::class_klass(), depth, CHECK_NULL); + objArrayOop result = oopFactory::new_objArray(SystemDictionary::Class_klass(), depth, CHECK_NULL); // Fill in mirrors corresponding to method holders int index = 0; while (first != NULL) { @@ -4331,7 +4324,7 @@ JVM_ENTRY(jobjectArray, JVM_GetAllThreads(JNIEnv *env, jclass dummy)) JvmtiVMObjectAllocEventCollector oam; int num_threads = tle.num_threads(); - objArrayOop r = oopFactory::new_objArray(SystemDictionary::thread_klass(), num_threads, CHECK_NULL); + objArrayOop r = oopFactory::new_objArray(SystemDictionary::Thread_klass(), num_threads, CHECK_NULL); objArrayHandle threads_ah(THREAD, r); for (int i = 0; i < num_threads; i++) { @@ -4365,7 +4358,7 @@ JVM_ENTRY(jobjectArray, JVM_DumpThreads(JNIEnv *env, jclass threadClass, jobject // check if threads is not an array of objects of Thread class klassOop k = objArrayKlass::cast(ah->klass())->element_klass(); - if (k != SystemDictionary::thread_klass()) { + if (k != SystemDictionary::Thread_klass()) { THROW_(vmSymbols::java_lang_IllegalArgumentException(), 0); } @@ -4425,7 +4418,7 @@ JVM_ENTRY(jobjectArray, JVM_GetEnclosingMethodInfo(JNIEnv *env, jclass ofClass)) if (encl_method_class_idx == 0) { return NULL; } - objArrayOop dest_o = oopFactory::new_objArray(SystemDictionary::object_klass(), 3, CHECK_NULL); + objArrayOop dest_o = oopFactory::new_objArray(SystemDictionary::Object_klass(), 3, CHECK_NULL); objArrayHandle dest(THREAD, dest_o); klassOop enc_k = ik_h->constants()->klass_at(encl_method_class_idx, CHECK_NULL); dest->obj_at_put(0, Klass::cast(enc_k)->java_mirror()); @@ -4539,7 +4532,7 @@ JVM_ENTRY(jobjectArray, JVM_GetThreadStateNames(JNIEnv* env, values_h->int_at(0) == java_lang_Thread::NEW, "Invalid threadStatus value"); - objArrayOop r = oopFactory::new_objArray(SystemDictionary::string_klass(), + objArrayOop r = oopFactory::new_objArray(SystemDictionary::String_klass(), 1, /* only 1 substate */ CHECK_NULL); names_h = objArrayHandle(THREAD, r); @@ -4552,7 +4545,7 @@ JVM_ENTRY(jobjectArray, JVM_GetThreadStateNames(JNIEnv* env, values_h->int_at(0) == java_lang_Thread::RUNNABLE, "Invalid threadStatus value"); - objArrayOop r = oopFactory::new_objArray(SystemDictionary::string_klass(), + objArrayOop r = oopFactory::new_objArray(SystemDictionary::String_klass(), 1, /* only 1 substate */ CHECK_NULL); names_h = objArrayHandle(THREAD, r); @@ -4565,7 +4558,7 @@ JVM_ENTRY(jobjectArray, JVM_GetThreadStateNames(JNIEnv* env, values_h->int_at(0) == java_lang_Thread::BLOCKED_ON_MONITOR_ENTER, "Invalid threadStatus value"); - objArrayOop r = oopFactory::new_objArray(SystemDictionary::string_klass(), + objArrayOop r = oopFactory::new_objArray(SystemDictionary::String_klass(), 1, /* only 1 substate */ CHECK_NULL); names_h = objArrayHandle(THREAD, r); @@ -4578,7 +4571,7 @@ JVM_ENTRY(jobjectArray, JVM_GetThreadStateNames(JNIEnv* env, values_h->int_at(0) == java_lang_Thread::IN_OBJECT_WAIT && values_h->int_at(1) == java_lang_Thread::PARKED, "Invalid threadStatus value"); - objArrayOop r = oopFactory::new_objArray(SystemDictionary::string_klass(), + objArrayOop r = oopFactory::new_objArray(SystemDictionary::String_klass(), 2, /* number of substates */ CHECK_NULL); names_h = objArrayHandle(THREAD, r); @@ -4596,7 +4589,7 @@ JVM_ENTRY(jobjectArray, JVM_GetThreadStateNames(JNIEnv* env, values_h->int_at(1) == java_lang_Thread::IN_OBJECT_WAIT_TIMED && values_h->int_at(2) == java_lang_Thread::PARKED_TIMED, "Invalid threadStatus value"); - objArrayOop r = oopFactory::new_objArray(SystemDictionary::string_klass(), + objArrayOop r = oopFactory::new_objArray(SystemDictionary::String_klass(), 3, /* number of substates */ CHECK_NULL); names_h = objArrayHandle(THREAD, r); @@ -4615,7 +4608,7 @@ JVM_ENTRY(jobjectArray, JVM_GetThreadStateNames(JNIEnv* env, assert(values_h->length() == 1 && values_h->int_at(0) == java_lang_Thread::TERMINATED, "Invalid threadStatus value"); - objArrayOop r = oopFactory::new_objArray(SystemDictionary::string_klass(), + objArrayOop r = oopFactory::new_objArray(SystemDictionary::String_klass(), 1, /* only 1 substate */ CHECK_NULL); names_h = objArrayHandle(THREAD, r); @@ -4650,4 +4643,3 @@ JVM_ENTRY(void, JVM_GetVersionInfo(JNIEnv* env, jvm_version_info* info, size_t i #endif // KERNEL } JVM_END - diff --git a/hotspot/src/share/vm/prims/jvmtiCodeBlobEvents.cpp b/hotspot/src/share/vm/prims/jvmtiCodeBlobEvents.cpp index 93217303fcf..d09bf8152ff 100644 --- a/hotspot/src/share/vm/prims/jvmtiCodeBlobEvents.cpp +++ b/hotspot/src/share/vm/prims/jvmtiCodeBlobEvents.cpp @@ -402,7 +402,7 @@ void JvmtiCodeBlobEvents::build_jvmti_addr_location_map(nmethod *nm, address scopes_data = nm->scopes_data_begin(); for( pcd = nm->scopes_pcs_begin(); pcd < nm->scopes_pcs_end(); ++pcd ) { - ScopeDesc sc0(nm, pcd->scope_decode_offset(), pcd->should_reexecute()); + ScopeDesc sc0(nm, pcd->scope_decode_offset(), pcd->should_reexecute(), pcd->return_oop()); ScopeDesc *sd = &sc0; while( !sd->is_top() ) { sd = sd->sender(); } int bci = sd->bci(); diff --git a/hotspot/src/share/vm/prims/jvmtiEnter.xsl b/hotspot/src/share/vm/prims/jvmtiEnter.xsl index 6380ca3ee0a..28044aafd75 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnter.xsl +++ b/hotspot/src/share/vm/prims/jvmtiEnter.xsl @@ -773,7 +773,7 @@ static jvmtiError JNICALL } - if (!thread_oop->is_a(SystemDictionary::thread_klass())) { + if (!thread_oop->is_a(SystemDictionary::Thread_klass())) { JVMTI_ERROR_INVALID_THREAD @@ -857,7 +857,7 @@ static jvmtiError JNICALL } - if (!k_mirror->is_a(SystemDictionary::class_klass())) { + if (!k_mirror->is_a(SystemDictionary::Class_klass())) { JVMTI_ERROR_INVALID_CLASS diff --git a/hotspot/src/share/vm/prims/jvmtiEnv.cpp b/hotspot/src/share/vm/prims/jvmtiEnv.cpp index 95977f0092e..4ad9996baae 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp +++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,15 +32,15 @@ // FIXLATER: hook into JvmtiTrace #define TraceJVMTICalls false -JvmtiEnv::JvmtiEnv() : JvmtiEnvBase() { +JvmtiEnv::JvmtiEnv(jint version) : JvmtiEnvBase(version) { } JvmtiEnv::~JvmtiEnv() { } JvmtiEnv* -JvmtiEnv::create_a_jvmti() { - return new JvmtiEnv(); +JvmtiEnv::create_a_jvmti(jint version) { + return new JvmtiEnv(version); } // VM operation class to copy jni function table at safepoint. @@ -133,7 +133,7 @@ JvmtiEnv::GetThreadLocalStorage(jthread thread, void** data_ptr) { if (thread_oop == NULL) { return JVMTI_ERROR_INVALID_THREAD; } - if (!thread_oop->is_a(SystemDictionary::thread_klass())) { + if (!thread_oop->is_a(SystemDictionary::Thread_klass())) { return JVMTI_ERROR_INVALID_THREAD; } JavaThread* java_thread = java_lang_Thread::thread(thread_oop); @@ -199,7 +199,7 @@ JvmtiEnv::RetransformClasses(jint class_count, const jclass* classes) { if (k_mirror == NULL) { return JVMTI_ERROR_INVALID_CLASS; } - if (!k_mirror->is_a(SystemDictionary::class_klass())) { + if (!k_mirror->is_a(SystemDictionary::Class_klass())) { return JVMTI_ERROR_INVALID_CLASS; } @@ -266,7 +266,7 @@ JvmtiEnv::GetObjectSize(jobject object, jlong* size_ptr) { oop mirror = JNIHandles::resolve_external_guard(object); NULL_CHECK(mirror, JVMTI_ERROR_INVALID_OBJECT); - if (mirror->klass() == SystemDictionary::class_klass()) { + if (mirror->klass() == SystemDictionary::Class_klass()) { if (!java_lang_Class::is_primitive(mirror)) { mirror = java_lang_Class::as_klassOop(mirror); assert(mirror != NULL, "class for non-primitive mirror must exist"); @@ -327,7 +327,7 @@ JvmtiEnv::SetEventNotificationMode(jvmtiEventMode mode, jvmtiEvent event_type, j if (thread_oop == NULL) { return JVMTI_ERROR_INVALID_THREAD; } - if (!thread_oop->is_a(SystemDictionary::thread_klass())) { + if (!thread_oop->is_a(SystemDictionary::Thread_klass())) { return JVMTI_ERROR_INVALID_THREAD; } java_thread = java_lang_Thread::thread(thread_oop); @@ -411,8 +411,15 @@ JvmtiEnv::AddToBootstrapClassLoaderSearch(const char* segment) { if (phase == JVMTI_PHASE_ONLOAD) { Arguments::append_sysclasspath(segment); return JVMTI_ERROR_NONE; - } else { - assert(phase == JVMTI_PHASE_LIVE, "sanity check"); + } else if (use_version_1_0_semantics()) { + // This JvmtiEnv requested version 1.0 semantics and this function + // is only allowed in the ONLOAD phase in version 1.0 so we need to + // return an error here. + return JVMTI_ERROR_WRONG_PHASE; + } else if (phase == JVMTI_PHASE_LIVE) { + // The phase is checked by the wrapper that called this function, + // but this thread could be racing with the thread that is + // terminating the VM so we check one more time. // create the zip entry ClassPathZipEntry* zip_entry = ClassLoader::create_class_path_zip_entry(segment); @@ -433,6 +440,8 @@ JvmtiEnv::AddToBootstrapClassLoaderSearch(const char* segment) { } ClassLoader::add_to_list(zip_entry); return JVMTI_ERROR_NONE; + } else { + return JVMTI_ERROR_WRONG_PHASE; } } /* end AddToBootstrapClassLoaderSearch */ @@ -451,11 +460,12 @@ JvmtiEnv::AddToSystemClassLoaderSearch(const char* segment) { } } return JVMTI_ERROR_NONE; - } else { + } else if (phase == JVMTI_PHASE_LIVE) { + // The phase is checked by the wrapper that called this function, + // but this thread could be racing with the thread that is + // terminating the VM so we check one more time. HandleMark hm; - assert(phase == JVMTI_PHASE_LIVE, "sanity check"); - // create the zip entry (which will open the zip file and hence // check that the segment is indeed a zip file). ClassPathZipEntry* zip_entry = ClassLoader::create_class_path_zip_entry(segment); @@ -504,6 +514,8 @@ JvmtiEnv::AddToSystemClassLoaderSearch(const char* segment) { } return JVMTI_ERROR_NONE; + } else { + return JVMTI_ERROR_WRONG_PHASE; } } /* end AddToSystemClassLoaderSearch */ @@ -580,7 +592,6 @@ JvmtiEnv::SetVerboseFlag(jvmtiVerboseFlag flag, jboolean value) { break; case JVMTI_VERBOSE_GC: PrintGC = value != 0; - TraceClassUnloading = value != 0; break; case JVMTI_VERBOSE_JNI: PrintJNIResolving = value != 0; @@ -620,7 +631,7 @@ JvmtiEnv::GetThreadState(jthread thread, jint* thread_state_ptr) { thread_oop = JNIHandles::resolve_external_guard(thread); } - if (thread_oop == NULL || !thread_oop->is_a(SystemDictionary::thread_klass())) { + if (thread_oop == NULL || !thread_oop->is_a(SystemDictionary::Thread_klass())) { return JVMTI_ERROR_INVALID_THREAD; } @@ -858,7 +869,7 @@ JvmtiEnv::StopThread(JavaThread* java_thread, jobject exception) { jvmtiError JvmtiEnv::InterruptThread(jthread thread) { oop thread_oop = JNIHandles::resolve_external_guard(thread); - if (thread_oop == NULL || !thread_oop->is_a(SystemDictionary::thread_klass())) + if (thread_oop == NULL || !thread_oop->is_a(SystemDictionary::Thread_klass())) return JVMTI_ERROR_INVALID_THREAD; JavaThread* current_thread = JavaThread::current(); @@ -895,7 +906,7 @@ JvmtiEnv::GetThreadInfo(jthread thread, jvmtiThreadInfo* info_ptr) { } else { thread_oop = JNIHandles::resolve_external_guard(thread); } - if (thread_oop == NULL || !thread_oop->is_a(SystemDictionary::thread_klass())) + if (thread_oop == NULL || !thread_oop->is_a(SystemDictionary::Thread_klass())) return JVMTI_ERROR_INVALID_THREAD; Handle thread_obj(current_thread, thread_oop); @@ -1061,7 +1072,7 @@ JvmtiEnv::GetCurrentContendedMonitor(JavaThread* java_thread, jobject* monitor_p jvmtiError JvmtiEnv::RunAgentThread(jthread thread, jvmtiStartFunction proc, const void* arg, jint priority) { oop thread_oop = JNIHandles::resolve_external_guard(thread); - if (thread_oop == NULL || !thread_oop->is_a(SystemDictionary::thread_klass())) { + if (thread_oop == NULL || !thread_oop->is_a(SystemDictionary::Thread_klass())) { return JVMTI_ERROR_INVALID_THREAD; } if (priority < JVMTI_THREAD_MIN_PRIORITY || priority > JVMTI_THREAD_MAX_PRIORITY) { @@ -2863,6 +2874,14 @@ JvmtiEnv::IsMethodSynthetic(methodOop method_oop, jboolean* is_synthetic_ptr) { // is_obsolete_ptr - pre-checked for NULL jvmtiError JvmtiEnv::IsMethodObsolete(methodOop method_oop, jboolean* is_obsolete_ptr) { + if (use_version_1_0_semantics() && + get_capabilities()->can_redefine_classes == 0) { + // This JvmtiEnv requested version 1.0 semantics and this function + // requires the can_redefine_classes capability in version 1.0 so + // we need to return an error here. + return JVMTI_ERROR_MUST_POSSESS_CAPABILITY; + } + if (method_oop == NULL || method_oop->is_obsolete()) { *is_obsolete_ptr = true; } else { diff --git a/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp b/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp index c6526995912..24311492bee 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp +++ b/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp @@ -123,7 +123,26 @@ JvmtiEnvBase::is_valid() { } -JvmtiEnvBase::JvmtiEnvBase() : _env_event_enable() { +bool +JvmtiEnvBase::use_version_1_0_semantics() { + int major, minor, micro; + + JvmtiExport::decode_version_values(_version, &major, &minor, µ); + return major == 1 && minor == 0; // micro version doesn't matter here +} + + +bool +JvmtiEnvBase::use_version_1_1_semantics() { + int major, minor, micro; + + JvmtiExport::decode_version_values(_version, &major, &minor, µ); + return major == 1 && minor == 1; // micro version doesn't matter here +} + + +JvmtiEnvBase::JvmtiEnvBase(jint version) : _env_event_enable() { + _version = version; _env_local_storage = NULL; _tag_map = NULL; _native_method_prefix_count = 0; @@ -508,7 +527,7 @@ JvmtiEnvBase::new_jthreadGroupArray(int length, Handle *handles) { JavaThread * JvmtiEnvBase::get_JavaThread(jthread jni_thread) { oop t = JNIHandles::resolve_external_guard(jni_thread); - if (t == NULL || !t->is_a(SystemDictionary::thread_klass())) { + if (t == NULL || !t->is_a(SystemDictionary::Thread_klass())) { return NULL; } // The following returns NULL if the thread has not yet run or is in @@ -1250,7 +1269,7 @@ VM_GetThreadListStackTraces::doit() { for (int i = 0; i < _thread_count; ++i) { jthread jt = _thread_list[i]; oop thread_oop = JNIHandles::resolve_external_guard(jt); - if (thread_oop == NULL || !thread_oop->is_a(SystemDictionary::thread_klass())) { + if (thread_oop == NULL || !thread_oop->is_a(SystemDictionary::Thread_klass())) { set_result(JVMTI_ERROR_INVALID_THREAD); return; } diff --git a/hotspot/src/share/vm/prims/jvmtiEnvBase.hpp b/hotspot/src/share/vm/prims/jvmtiEnvBase.hpp index e6dd31e5870..8ad31f9ebf8 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnvBase.hpp +++ b/hotspot/src/share/vm/prims/jvmtiEnvBase.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -76,6 +76,7 @@ class JvmtiEnvBase : public CHeapObj { jvmtiEnv _jvmti_external; jint _magic; + jint _version; // version value passed to JNI GetEnv() JvmtiEnvBase* _next; bool _is_retransformable; const void *_env_local_storage; // per env agent allocated data. @@ -91,7 +92,7 @@ class JvmtiEnvBase : public CHeapObj { int _native_method_prefix_count; protected: - JvmtiEnvBase(); + JvmtiEnvBase(jint version); ~JvmtiEnvBase(); void dispose(); void env_dispose(); @@ -122,6 +123,9 @@ class JvmtiEnvBase : public CHeapObj { bool is_valid(); + bool use_version_1_0_semantics(); // agent asked for version 1.0 + bool use_version_1_1_semantics(); // agent asked for version 1.1 + bool is_retransformable() { return _is_retransformable; } static ByteSize jvmti_external_offset() { diff --git a/hotspot/src/share/vm/prims/jvmtiEventController.cpp b/hotspot/src/share/vm/prims/jvmtiEventController.cpp index 4e07d6f84c2..4eb2d587084 100644 --- a/hotspot/src/share/vm/prims/jvmtiEventController.cpp +++ b/hotspot/src/share/vm/prims/jvmtiEventController.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -82,7 +82,7 @@ static const jlong EARLY_EVENT_BITS = CLASS_FILE_LOAD_HOOK_BIT | THREAD_START_BIT | THREAD_END_BIT | DYNAMIC_CODE_GENERATED_BIT; static const jlong GLOBAL_EVENT_BITS = ~THREAD_FILTERED_EVENT_BITS; - +static const jlong SHOULD_POST_ON_EXCEPTIONS_BITS = EXCEPTION_BITS | METHOD_EXIT_BIT | FRAME_POP_BIT; /////////////////////////////////////////////////////////////// // @@ -511,7 +511,12 @@ JvmtiEventControllerPrivate::recompute_thread_enabled(JvmtiThreadState *state) { leave_interp_only_mode(state); } } + + // update the JavaThread cached value for thread-specific should_post_on_exceptions value + bool should_post_on_exceptions = (any_env_enabled & SHOULD_POST_ON_EXCEPTIONS_BITS) != 0; + state->set_should_post_on_exceptions(should_post_on_exceptions); } + return any_env_enabled; } @@ -615,6 +620,10 @@ JvmtiEventControllerPrivate::recompute_enabled() { // set global truly enabled, that is, any thread in any environment JvmtiEventController::_universal_global_event_enabled.set_bits(any_env_thread_enabled); + + // set global should_post_on_exceptions + JvmtiExport::set_should_post_on_exceptions((any_env_thread_enabled & SHOULD_POST_ON_EXCEPTIONS_BITS) != 0); + } EC_TRACE(("JVMTI [-] # recompute enabled - after %llx", any_env_thread_enabled)); diff --git a/hotspot/src/share/vm/prims/jvmtiExport.cpp b/hotspot/src/share/vm/prims/jvmtiExport.cpp index 7a5068b43b3..7d189e5beee 100644 --- a/hotspot/src/share/vm/prims/jvmtiExport.cpp +++ b/hotspot/src/share/vm/prims/jvmtiExport.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -319,7 +319,27 @@ address JvmtiExport::get_field_modification_count_addr() { jint JvmtiExport::get_jvmti_interface(JavaVM *jvm, void **penv, jint version) { - /* To Do: add version checks */ + // The JVMTI_VERSION_INTERFACE_JVMTI part of the version number + // has already been validated in JNI GetEnv(). + int major, minor, micro; + + // micro version doesn't matter here (yet?) + decode_version_values(version, &major, &minor, µ); + switch (major) { + case 1: + switch (minor) { + case 0: // version 1.0. is recognized + case 1: // version 1.1. is recognized + break; + + default: + return JNI_EVERSION; // unsupported minor version number + } + break; + + default: + return JNI_EVERSION; // unsupported major version number + } if (JvmtiEnv::get_phase() == JVMTI_PHASE_LIVE) { JavaThread* current_thread = (JavaThread*) ThreadLocalStorage::thread(); @@ -328,13 +348,13 @@ JvmtiExport::get_jvmti_interface(JavaVM *jvm, void **penv, jint version) { __ENTRY(jvmtiEnv*, JvmtiExport::get_jvmti_interface, current_thread) debug_only(VMNativeEntryWrapper __vew;) - JvmtiEnv *jvmti_env = JvmtiEnv::create_a_jvmti(); + JvmtiEnv *jvmti_env = JvmtiEnv::create_a_jvmti(version); *penv = jvmti_env->jvmti_external(); // actual type is jvmtiEnv* -- not to be confused with JvmtiEnv* return JNI_OK; } else if (JvmtiEnv::get_phase() == JVMTI_PHASE_ONLOAD) { // not live, no thread to transition - JvmtiEnv *jvmti_env = JvmtiEnv::create_a_jvmti(); + JvmtiEnv *jvmti_env = JvmtiEnv::create_a_jvmti(version); *penv = jvmti_env->jvmti_external(); // actual type is jvmtiEnv* -- not to be confused with JvmtiEnv* return JNI_OK; @@ -345,6 +365,15 @@ JvmtiExport::get_jvmti_interface(JavaVM *jvm, void **penv, jint version) { } } + +void +JvmtiExport::decode_version_values(jint version, int * major, int * minor, + int * micro) { + *major = (version & JVMTI_VERSION_MASK_MAJOR) >> JVMTI_VERSION_SHIFT_MAJOR; + *minor = (version & JVMTI_VERSION_MASK_MINOR) >> JVMTI_VERSION_SHIFT_MINOR; + *micro = (version & JVMTI_VERSION_MASK_MICRO) >> JVMTI_VERSION_SHIFT_MICRO; +} + void JvmtiExport::enter_primordial_phase() { JvmtiEnvBase::set_phase(JVMTI_PHASE_PRIMORDIAL); } @@ -627,7 +656,7 @@ static inline klassOop oop_to_klassOop(oop obj) { klassOop k = obj->klass(); // if the object is a java.lang.Class then return the java mirror - if (k == SystemDictionary::class_klass()) { + if (k == SystemDictionary::Class_klass()) { if (!java_lang_Class::is_primitive(obj)) { k = java_lang_Class::as_klassOop(obj); assert(k != NULL, "class for non-primitive mirror must exist"); @@ -657,11 +686,11 @@ class JvmtiCompiledMethodLoadEventMark : public JvmtiMethodEventMark { jvmtiAddrLocationMap *_map; const void *_compile_info; public: - JvmtiCompiledMethodLoadEventMark(JavaThread *thread, nmethod *nm) + JvmtiCompiledMethodLoadEventMark(JavaThread *thread, nmethod *nm, void* compile_info_ptr = NULL) : JvmtiMethodEventMark(thread,methodHandle(thread, nm->method())) { _code_data = nm->code_begin(); _code_size = nm->code_size(); - _compile_info = NULL; /* no info for our VM. */ + _compile_info = compile_info_ptr; // Set void pointer of compiledMethodLoad Event. Default value is NULL. JvmtiCodeBlobEvents::build_jvmti_addr_location_map(nm, &_map, &_map_length); } ~JvmtiCompiledMethodLoadEventMark() { @@ -848,7 +877,7 @@ void JvmtiExport::post_raw_breakpoint(JavaThread *thread, methodOop method, addr bool JvmtiExport::_can_get_source_debug_extension = false; bool JvmtiExport::_can_maintain_original_method_order = false; bool JvmtiExport::_can_post_interpreter_events = false; -bool JvmtiExport::_can_post_exceptions = false; +bool JvmtiExport::_can_post_on_exceptions = false; bool JvmtiExport::_can_post_breakpoint = false; bool JvmtiExport::_can_post_field_access = false; bool JvmtiExport::_can_post_field_modification = false; @@ -879,6 +908,7 @@ bool JvmtiExport::_should_post_garbage_collection_finish = fals bool JvmtiExport::_should_post_object_free = false; bool JvmtiExport::_should_post_resource_exhausted = false; bool JvmtiExport::_should_post_vm_object_alloc = false; +bool JvmtiExport::_should_post_on_exceptions = false; //////////////////////////////////////////////////////////////////////////////////////////////// @@ -1723,6 +1753,46 @@ void JvmtiExport::post_native_method_bind(methodOop method, address* function_pt } } +// Returns a record containing inlining information for the given nmethod +jvmtiCompiledMethodLoadInlineRecord* create_inline_record(nmethod* nm) { + jint numstackframes = 0; + jvmtiCompiledMethodLoadInlineRecord* record = (jvmtiCompiledMethodLoadInlineRecord*)NEW_RESOURCE_OBJ(jvmtiCompiledMethodLoadInlineRecord); + record->header.kind = JVMTI_CMLR_INLINE_INFO; + record->header.next = NULL; + record->header.majorinfoversion = JVMTI_CMLR_MAJOR_VERSION_1; + record->header.minorinfoversion = JVMTI_CMLR_MINOR_VERSION_0; + record->numpcs = 0; + for(PcDesc* p = nm->scopes_pcs_begin(); p < nm->scopes_pcs_end(); p++) { + if(p->scope_decode_offset() == DebugInformationRecorder::serialized_null) continue; + record->numpcs++; + } + record->pcinfo = (PCStackInfo*)(NEW_RESOURCE_ARRAY(PCStackInfo, record->numpcs)); + int scope = 0; + for(PcDesc* p = nm->scopes_pcs_begin(); p < nm->scopes_pcs_end(); p++) { + if(p->scope_decode_offset() == DebugInformationRecorder::serialized_null) continue; + void* pc_address = (void*)p->real_pc(nm); + assert(pc_address != NULL, "pc_address must be non-null"); + record->pcinfo[scope].pc = pc_address; + numstackframes=0; + for(ScopeDesc* sd = nm->scope_desc_at(p->real_pc(nm));sd != NULL;sd = sd->sender()) { + numstackframes++; + } + assert(numstackframes != 0, "numstackframes must be nonzero."); + record->pcinfo[scope].methods = (jmethodID *)NEW_RESOURCE_ARRAY(jmethodID, numstackframes); + record->pcinfo[scope].bcis = (jint *)NEW_RESOURCE_ARRAY(jint, numstackframes); + record->pcinfo[scope].numstackframes = numstackframes; + int stackframe = 0; + for(ScopeDesc* sd = nm->scope_desc_at(p->real_pc(nm));sd != NULL;sd = sd->sender()) { + // sd->method() can be NULL for stubs but not for nmethods. To be completely robust, include an assert that we should never see a null sd->method() + assert(!sd->method().is_null(), "sd->method() cannot be null."); + record->pcinfo[scope].methods[stackframe] = sd->method()->jmethod_id(); + record->pcinfo[scope].bcis[stackframe] = sd->bci(); + stackframe++; + } + scope++; + } + return record; +} void JvmtiExport::post_compiled_method_load(nmethod *nm) { // If there are pending CompiledMethodUnload events then these are @@ -1751,7 +1821,11 @@ void JvmtiExport::post_compiled_method_load(nmethod *nm) { (nm->method() == NULL) ? "NULL" : nm->method()->name()->as_C_string())); ResourceMark rm(thread); - JvmtiCompiledMethodLoadEventMark jem(thread, nm); + + // Add inlining information + jvmtiCompiledMethodLoadInlineRecord* inlinerecord = create_inline_record(nm); + // Pass inlining information through the void pointer + JvmtiCompiledMethodLoadEventMark jem(thread, nm, inlinerecord); JvmtiJavaThreadEventTransition jet(thread); jvmtiEventCompiledMethodLoad callback = env->callbacks()->CompiledMethodLoad; if (callback != NULL) { @@ -1896,7 +1970,7 @@ void JvmtiExport::record_vm_internal_object_allocation(oop obj) { if (collector != NULL && collector->is_enabled()) { // Don't record classes as these will be notified via the ClassLoad // event. - if (obj->klass() != SystemDictionary::class_klass()) { + if (obj->klass() != SystemDictionary::Class_klass()) { collector->record_allocation(obj); } } diff --git a/hotspot/src/share/vm/prims/jvmtiExport.hpp b/hotspot/src/share/vm/prims/jvmtiExport.hpp index 54a9416f425..a7e264ba78f 100644 --- a/hotspot/src/share/vm/prims/jvmtiExport.hpp +++ b/hotspot/src/share/vm/prims/jvmtiExport.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -66,7 +66,7 @@ class JvmtiExport : public AllStatic { JVMTI_SUPPORT_FLAG(can_get_source_debug_extension) JVMTI_SUPPORT_FLAG(can_maintain_original_method_order) JVMTI_SUPPORT_FLAG(can_post_interpreter_events) - JVMTI_SUPPORT_FLAG(can_post_exceptions) + JVMTI_SUPPORT_FLAG(can_post_on_exceptions) JVMTI_SUPPORT_FLAG(can_post_breakpoint) JVMTI_SUPPORT_FLAG(can_post_field_access) JVMTI_SUPPORT_FLAG(can_post_field_modification) @@ -93,6 +93,7 @@ class JvmtiExport : public AllStatic { JVMTI_SUPPORT_FLAG(should_post_data_dump) JVMTI_SUPPORT_FLAG(should_post_garbage_collection_start) JVMTI_SUPPORT_FLAG(should_post_garbage_collection_finish) + JVMTI_SUPPORT_FLAG(should_post_on_exceptions) // ------ the below maybe don't have to be (but are for now) // fixed conditions here ------------ @@ -236,6 +237,8 @@ class JvmtiExport : public AllStatic { static bool is_jvmti_version(jint version) { return (version & JVMTI_VERSION_MASK) == JVMTI_VERSION_VALUE; } static bool is_jvmdi_version(jint version) { return (version & JVMTI_VERSION_MASK) == JVMDI_VERSION_VALUE; } static jint get_jvmti_interface(JavaVM *jvm, void **penv, jint version); + static void decode_version_values(jint version, int * major, int * minor, + int * micro); // single stepping management methods static void at_single_stepping_point(JavaThread *thread, methodOop method, address location) KERNEL_RETURN; diff --git a/hotspot/src/share/vm/prims/jvmtiHpp.xsl b/hotspot/src/share/vm/prims/jvmtiHpp.xsl index 3b3b23e90f6..e5dd49ffc6c 100644 --- a/hotspot/src/share/vm/prims/jvmtiHpp.xsl +++ b/hotspot/src/share/vm/prims/jvmtiHpp.xsl @@ -1,6 +1,6 @@ - tasks used to compile the tools javac.source = 7 javac.target = 7 diff --git a/jaxws/build.xml b/jaxws/build.xml index b14eb6b8bd8..5ee8f190b25 100644 --- a/jaxws/build.xml +++ b/jaxws/build.xml @@ -113,7 +113,10 @@ - $@ + @$(install-module-file) .PHONY: copy-files diff --git a/jdk/make/com/sun/tracing/Makefile b/jdk/make/com/sun/tracing/Makefile index 166aee38db4..e2599024755 100644 --- a/jdk/make/com/sun/tracing/Makefile +++ b/jdk/make/com/sun/tracing/Makefile @@ -33,6 +33,8 @@ PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk SUBDIRS = dtrace +include $(BUILDDIR)/common/Subdirs.gmk + all build: $(SUBDIRS-loop) clean clobber:: diff --git a/jdk/make/common/Defs.gmk b/jdk/make/common/Defs.gmk index de974fe62ec..75077b666a8 100644 --- a/jdk/make/common/Defs.gmk +++ b/jdk/make/common/Defs.gmk @@ -225,12 +225,6 @@ DEVTOOLS_FT_DIR_EXISTS = $(shell \ endif endif - ifeq ($(PLATFORM), windows) - FREETYPE_LIB = $(FREETYPE_LIB_PATH)/freetype.lib - else - FREETYPE_LIB = -L$(FREETYPE_LIB_PATH) -lfreetype - endif - ifdef ALT_FREETYPE_HEADERS_PATH FREETYPE_HEADERS_PATH = $(ALT_FREETYPE_HEADERS_PATH) else @@ -313,6 +307,9 @@ INCLUDEDIR = $(OUTPUTDIR)/include # for generated class files CLASSBINDIR = $(OUTPUTDIR)/classes DEMOCLASSDIR = $(OUTPUTDIR)/democlasses +# for modules +MODULES_DIR = $(OUTPUTDIR)/modules +ABS_MODULES_DIR = $(ABS_OUTPUTDIR)/modules # for generated tool class files BUILDTOOLCLASSDIR = $(OUTPUTDIR)/btclasses # for build tool jar files @@ -388,6 +385,22 @@ ifneq ($(THREADDIR),) UNIQUE_LOCATION_STRING += /$(THREADDIR) endif +# +# Build units may or may not define MODULE. Default to "other". +# +# MODULE variable defines the lowest-level module name that +# might or might not be the name of the modules created in +# the modules build (see make/modules/modules.config and +# modules.group). +# +MODULES_TEMPDIR = $(OUTPUTDIR)/tmp/modules +ABS_MODULES_TEMPDIR = $(ABS_OUTPUTDIR)/tmp/modules + +ifndef MODULE + MODULE = other +endif +override MODULE_DEST_DIR = $(MODULES_TEMPDIR)/$(MODULE) + # the use of += above makes a space separated list which we need to # remove for filespecs. # @@ -497,6 +510,58 @@ PKGDIR = $(subst .,/,$(PACKAGE)) # include $(JDK_MAKE_SHARED_DIR)/Defs-java.gmk +# +# Macros to find the module that $@ belongs to +# + +UNIQUE_PATH_PATTERN = $(subst /,.,$(UNIQUE_PATH)) +MODULE_PATH_PATTERN = -e 's%.*\/classes\/%classes\/%' \ + -e 's%.*\/$(UNIQUE_PATH_PATTERN)\/%classes\/%' \ + -e 's%.*\/lib\/%lib\/%' \ + -e 's%.*\/bin\/%bin\/%' \ + -e 's%.*\/include\/%include\/%' \ + -e 's%.*\/demo\/%demo\/%' \ + -e 's%.*\/sample\/%sample\/%' + +# Install a file to its module +define install-module-file +dest=`echo $(@D)/ | $(SED) $(MODULE_PATH_PATTERN)` ; \ +$(MKDIR) -p $(MODULE_DEST_DIR)/$$dest; \ +$(CP) -f $@ $(MODULE_DEST_DIR)/$$dest +endef + +# Install all files from the directory to its module +define install-module-dir +dest=`echo $(@D)/ | $(SED) $(MODULE_PATH_PATTERN)` ; \ +$(MKDIR) -p $(MODULE_DEST_DIR)/$$dest; \ +$(CP) -rf $(@D)/* $(MODULE_DEST_DIR)/$$dest +endef + +# chmod the file in its module +define chmod-module-file +dest=`echo $@ | $(SED) $(MODULE_PATH_PATTERN)` ; \ +$(CHMOD) $1 $(MODULE_DEST_DIR)/$$dest +endef + +# install a sym link in its module +define install-module-sym-link +dest=`echo $@ | $(SED) $(MODULE_PATH_PATTERN)` ; \ +$(LN) -sf $1 $(MODULE_DEST_DIR)/$$dest +endef + + +# Run MAKE $@ for a launcher: +# $(call make-launcher, name, mainclass, java-args, main-args) +define make-launcher +$(CD) $(BUILDDIR)/launchers && \ +$(MAKE) -f Makefile.launcher \ + MODULE=$(MODULE) \ + PROGRAM=$(strip $1) \ + MAIN_CLASS=$(strip $2) \ + MAIN_JAVA_ARGS="$(strip $3)" \ + MAIN_ARGS="$(strip $4)" +endef + # # Convenient macros # @@ -511,6 +576,28 @@ endef define install-file $(prep-target) $(CP) $< $@ +@$(install-module-file) +endef + +define chmod-file +$(CHMOD) $1 $@ +@$(call chmod-module-file, $1) +endef + +define install-sym-link +$(LN) -s $1 $@ +@$(call install-module-sym-link, $1) +endef + +# +# Marcos for files not belonging to any module +define install-non-module-file +$(prep-target) +$(CP) $< $@ +endef + +define install-manifest-file +$(install-non-module-file) endef # Cleanup rule for after debug java run (hotspot.log file is left around) @@ -520,131 +607,9 @@ define java-vm-cleanup if [ -w $(HOTSPOT_LOG_NAME) ] ; then $(RM) $(HOTSPOT_LOG_NAME); fi endef -# Default make settings for processing SUBDIRS with clobber or clean names -SUBDIRS_MAKEFLAGS-clobber = INCREMENTAL_BUILD=false -SUBDIRS_MAKEFLAGS-clean = INCREMENTAL_BUILD=false - # Current directory CURRENT_DIRECTORY := $(shell $(PWD)) -# If no timing wanted, we need to define these as empty -ifdef NO_TIMING - -TIMING_ID:=NA - -define TIMING_start -t=0:0:0:0 -endef - -define TIMING_end -time_used=0 -endef - -else # NO_TIMING - -# Default timing id -TIMING_ID:=$(shell $(BASENAME) $(CURRENT_DIRECTORY)) - -# Timing start (must be used in same shell, e.g. same command line) -# Defines the shell variable $1 to have the start time. -define TIMING_start -$1=`$(DATE) +%j:%H:%M:%S` -endef - -# Timing end (must be used in same shell, e.g. same command line) -# Expects shell variable $1 to have been defined as the start time. -# Expects shell variable $2 to have timing id string -# Sets total_seconds shell variable as the total seconds used. -# Sets time_used shell variable to contain format "%dh%dm%ds" -define TIMING_end -begTime="$${$1}"; \ -timing_id="$${$2}"; \ -endTime=`$(DATE) +%j:%H:%M:%S`; \ -d1=`$(ECHO) $${begTime} | $(CUT) -d':' -f1 | $(SED) -e 's@^0*@@'`; \ -if [ "$${d1}" = "" ] ; then d1=0; fi; \ -h1=`$(ECHO) $${begTime} | $(CUT) -d':' -f2 | $(SED) -e 's@^0*@@'`; \ -if [ "$${h1}" = "" ] ; then h1=0; fi; \ -m1=`$(ECHO) $${begTime} | $(CUT) -d':' -f3 | $(SED) -e 's@^0*@@'`; \ -if [ "$${m1}" = "" ] ; then m1=0; fi; \ -s1=`$(ECHO) $${begTime} | $(CUT) -d':' -f4 | $(SED) -e 's@^0*@@'`; \ -if [ "$${s1}" = "" ] ; then s1=0; fi; \ -d2=`$(ECHO) $${endTime} | $(CUT) -d':' -f1 | $(SED) -e 's@^0*@@'`; \ -if [ "$${d2}" = "" ] ; then d2=0; fi; \ -h2=`$(ECHO) $${endTime} | $(CUT) -d':' -f2 | $(SED) -e 's@^0*@@'`; \ -if [ "$${h2}" = "" ] ; then h2=0; fi; \ -m2=`$(ECHO) $${endTime} | $(CUT) -d':' -f3 | $(SED) -e 's@^0*@@'`; \ -if [ "$${m2}" = "" ] ; then m2=0; fi; \ -s2=`$(ECHO) $${endTime} | $(CUT) -d':' -f4 | $(SED) -e 's@^0*@@'`; \ -if [ "$${s2}" = "" ] ; then s2=0; fi; \ -t1_secs=`$(EXPR) $${d1} '*' 60 '*' 60 '*' 24 '+' $${h1} '*' 60 '*' 60 \ - '+' $${m1} '*' 60 '+' $${s1}`; \ -t2_secs=`$(EXPR) $${d2} '*' 60 '*' 60 '*' 24 '+' $${h2} '*' 60 '*' 60 \ - '+' $${m2} '*' 60 '+' $${s2}`; \ -total_seconds=`$(EXPR) $${t2_secs} '-' $${t1_secs}`; \ -if [ "$${total_seconds}" -lt 0 ] ; then total_seconds=0; fi; \ -t_hour=`$(EXPR) $${total_seconds} '/' '(' 60 '*' 60 ')'`h; \ -t_min=`$(EXPR) '(' $${total_seconds} '%' '(' 60 '*' 60 ')' ')' '/' 60`m; \ -t_sec=`$(EXPR) $${total_seconds} '%' 60`s; \ -time_used=$${t_sec}; \ -if [ "$${t_hour}" != "0h" ] ; then \ -time_used=$${t_hour}$${t_min}$${t_sec}; \ -elif [ "$${t_min}" != "0m" ] ; then \ -time_used=$${t_min}$${t_sec}; \ -else \ -time_used=$${t_sec}; \ -fi; \ -$(PRINTF) " Timing: %05d seconds or %s for %s\n" \ - $${total_seconds} $${time_used} $${timing_id} -endef - -endif # NO_TIMING - -# Given a SUBDIRS list, cd into them and make them -# SUBDIRS_MAKEFLAGS Make settings for a subdir make -# SUBDIRS_MAKEFLAGS-$@ Make settings specific to this target -define SUBDIRS-loop -@$(ECHO) "Begin Processing SUBDIRS: $(SUBDIRS)" -@for i in DUMMY $(SUBDIRS) ; do \ - if [ "$$i" != "DUMMY" ] ; then \ - $(ECHO) ">>>Recursively making "$$i" "$@" @ `$(DATE)` ..."; \ - timing_id="$(TIMING_ID)-`$(BASENAME) $${i}`"; \ - $(call TIMING_start,startTime); \ - curDir=$(CURRENT_DIRECTORY); \ - $(CD) $$i; $(MAKE) $@ TIMING_ID=$${timing_id} \ - $(SUBDIRS_MAKEFLAGS) \ - $(SUBDIRS_MAKEFLAGS-$@) \ - FULL_VERSION=$(FULL_VERSION) \ - RELEASE=$(RELEASE) || exit 1; \ - $(CD) $${curDir}; \ - $(call TIMING_end,startTime,timing_id); \ - $(ECHO) "<<>>Recursively making "$$i" "$@" @ `$(DATE)` ..."; \ - timing_id="$(TIMING_ID)-`$(BASENAME) $${i}`"; \ - $(call TIMING_start,startTime); \ - curDir=$(CURRENT_DIRECTORY); \ - $(CD) $$i; $(MAKE) $@ TIMING_ID=$${timing_id} \ - $(OTHERSUBDIRS_MAKEFLAGS) \ - FULL_VERSION=$(FULL_VERSION) \ - RELEASE=$(RELEASE) || exit 1; \ - $(CD) $${curDir}; \ - $(call TIMING_end,startTime,timing_id); \ - $(ECHO) "<<>>Making "$@" @ `$(DATE)` ..." + +# Order is important here, trim jre after jdk image is created +modules:: gen-modules \ + sanity-module-images post-sanity-module-images \ + $(INITIAL_MODULE_IMAGE_JRE) $(INITIAL_MODULE_IMAGE_JDK) \ + trim-module-image-jre trim-module-image-jdk \ + process-module-image-jre process-module-image-jdk + +# Don't use these +module-image-jre:: initial-module-image-jre trim-module-image-jre process-module-image-jre +module-image-jdk:: initial-module-image-jdk trim-module-image-jdk process-module-image-jdk + +# +# Paths to these files we need +JDK_MODULE_LICENSES = $(LICENSE_DOCLIST_JDK:%=$(JDK_MODULE_IMAGE_DIR)/%) +JDK_MODULE_64_LICENSES = $(LICENSE_DOCLIST_JDK:%=$(JDK_MODULE_IMAGE_DIR)/%64) +JDK_MODULE_DOCFILES = $(OTHER_DOCLIST_JDK:%=$(JDK_MODULE_IMAGE_DIR)/%) + +JRE_MODULE_LICENSES = $(LICENSE_DOCLIST_JRE:%=$(JRE_MODULE_IMAGE_DIR)/%) +JRE_MODULE_64_LICENSES = $(LICENSE_DOCLIST_JRE:%=$(JRE_MODULE_IMAGE_DIR)/%64) +JRE_MODULE_DOCFILES = $(OTHER_DOCLIST_JRE:%=$(JRE_MODULE_IMAGE_DIR)/%) +JRE_MODULE_DOCFILES += $(JRE_NAMECHANGE_DOCLIST:%=$(JRE_MODULE_IMAGE_DIR)/%$(TEXT_SUFFIX)) + +###### RULES + +# JDK files +$(JDK_MODULE_IMAGE_DIR)/%: $(SHARE_JDK_DOC_SRC)/% + $(process-doc-file) +# Removes LICENSE_VERSION or not +ifdef LICENSE_VERSION +$(JDK_MODULE_IMAGE_DIR)/%: $(SHARE_JDK_DOC_SRC)/%$(LICENSE_VERSION) + $(process-doc-file) +$(JDK_MODULE_IMAGE_DIR)/%64: $(SHARE_JDK_DOC_SRC)/%$(LICENSE_VERSION) + $(process-doc-file) +else +$(JDK_MODULE_IMAGE_DIR)/%64: $(SHARE_JDK_DOC_SRC)/% + $(process-doc-file) +endif + +# JRE files +$(JRE_MODULE_IMAGE_DIR)/%: $(SHARE_JRE_DOC_SRC)/% + $(process-doc-file) +# Add $(TEXT_SUFFIX) suffix +ifdef TEXT_SUFFIX +$(JRE_MODULE_IMAGE_DIR)/%$(TEXT_SUFFIX): $(SHARE_JRE_DOC_SRC)/% + $(process-doc-file) +endif +# Removes LICENSE_VERSION or not +ifdef LICENSE_VERSION +$(JRE_MODULE_IMAGE_DIR)/%: $(SHARE_JRE_DOC_SRC)/%$(LICENSE_VERSION) + $(process-doc-file) +$(JRE_MODULE_IMAGE_DIR)/%64: $(SHARE_JRE_DOC_SRC)/%$(LICENSE_VERSION) + $(process-doc-file) +else +$(JRE_MODULE_IMAGE_DIR)/%64: $(SHARE_JRE_DOC_SRC)/% + $(process-doc-file) +endif + +###################################################### +# JRE Image +###################################################### + +MODULES_LIST = $(MODULES_TEMPDIR)/classlist/modules.list + +# Modules in the jre/lib/security directory +POLICY_MODULES = US_export_policy local_policy + +# Modules in the modules/ext directory +EXT_MODULES = localedata security-sunec security-sunjce + +# Build PKCS#11 on all platforms except 64-bit Windows. +PKCS11 = security-sunpkcs11 +ifeq ($(ARCH_DATA_MODEL), 64) + ifeq ($(PLATFORM), windows) + PKCS11 = + endif +endif + +EXT_MODULES += $(PKCS11) + +# Build Microsoft CryptoAPI provider only on (non-64-bit) Windows platform. +ifeq ($(PLATFORM), windows) + ifneq ($(ARCH_DATA_MODEL), 64) + EXT_MODULES += security-sunmscapi + endif +endif + +# Modules for JDK only +JDK_MODULES = tools + +gen-modules: + $(CD) modules; $(MAKE) all + +initial-module-image-jre-setup: + $(RM) -r $(JRE_MODULE_IMAGE_DIR) + $(MKDIR) -p $(JRE_MODULE_IMAGE_DIR) + +# 64-bit solaris jre image contains only the 64-bit add-on files. +initial-module-image-jre-sol64:: initial-module-image-jre-setup \ + $(JRE_MODULE_LICENSES) $(JRE_MODULE_64_LICENSES) + @# Use tar instead of cp to preserve the symbolic links + for dir in bin lib ; do \ + ( $(CD) $(OUTPUTDIR) && \ + $(TAR) cf - `$(FIND) $$dir -name '$(ARCH)' -print` | \ + ($(CD) $(JRE_MODULE_IMAGE_DIR) && $(TAR) xf -) ) ; \ + done + @# Remove some files from the jre area + for t in $(NOTJRETOOLS) ; do \ + $(RM) $(JRE_MODULE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \ + done + $(RM) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'orb.idl'` + $(RM) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'ir.idl'` + +# Construct an initial jre image (initial jdk jre) no trimming or stripping +initial-module-image-jre:: initial-module-image-jre-setup \ + $(JRE_LICENSES) $(JRE_MODULE_DOCFILES) \ + $(BUILDMETAINDEX_JARFILE) + @# Copy in bin directory + $(CD) $(OUTPUTDIR) && $(FIND) bin -depth | $(CPIO) -pdum $(JRE_MODULE_IMAGE_DIR) + @# CTE plugin security change require new empty directory lib/applet + $(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)/lib/applet + @# Copy files but not .jar in lib directory + $(CD) $(OUTPUTDIR) && $(FIND) lib -depth | $(EGREP) -v ".jar$$" | $(CPIO) -pdum $(JRE_MODULE_IMAGE_DIR) + @# + @# copy modules to jre/lib + @# + for m in `$(NAWK) '{print $$1}' $(MODULES_LIST)` ; do \ + $(CP) $(MODULES_DIR)/$$m/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib ; \ + done + $(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)/lib/ext + for m in $(EXT_MODULES) ; do \ + $(MV) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib/ext ; \ + done + for m in $(POLICY_MODULES) ; do \ + $(MV) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib/security; \ + done + @# Remove jdk modules + for m in $(JDK_MODULES) ; do \ + $(RM) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar ; \ + done + + @# Make sure all directories are read/execute for everyone + $(CHMOD) a+rx `$(FIND) $(JRE_MODULE_IMAGE_DIR) -type d` + @# Remove some files from the jre area + for t in $(NOTJRETOOLS) ; do \ + $(RM) $(JRE_MODULE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \ + done + @# Remove orb.idl and ir.idl from jre + $(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'orb.idl' -exec $(RM) \{} \; + $(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'ir.idl' -exec $(RM) \{} \; + @# Generate meta-index to make boot and extension class loaders lazier + $(CD) $(JRE_MODULE_IMAGE_DIR)/lib && \ + $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \ + -o meta-index *.jar + @$(CD) $(JRE_MODULE_IMAGE_DIR)/lib && $(java-vm-cleanup) + $(CD) $(JRE_MODULE_IMAGE_DIR)/lib/ext && \ + $(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \ + -o meta-index *.jar + @$(CD) $(JRE_MODULE_IMAGE_DIR)/lib/ext && $(java-vm-cleanup) +ifeq ($(PLATFORM), windows) + @# Remove certain *.lib files + $(CD) $(JRE_MODULE_IMAGE_DIR)/lib && \ + $(RM) java.$(LIB_SUFFIX) jvm.$(LIB_SUFFIX) \ + hpi.$(LIB_SUFFIX) awt.$(LIB_SUFFIX) jawt.$(LIB_SUFFIX) + ifeq ($(ARCH_DATA_MODEL), 32) + @# The Java Kernel JRE image ships with a special VM. It is not included + @# in the full JRE image, so remove it. Also, is it only for 32-bit windows. + $(CD) $(JRE_MODULE_IMAGE_DIR)/bin && $(RM) -r kernel + endif +endif # Windows +ifneq ($(PLATFORM), windows) + $(call copy-man-pages,$(JRE_MODULE_IMAGE_DIR),$(JRE_MAN_PAGES)) +endif # !windows + +# Trim out any extra files not for the jre shipment but wanted in the jdk jre. +# (Note the jdk WILL want the jre image before this trimming) +# Removes server VM on Windows 32bit. +# Remove certain shared libraries that should not be in the jre image +# but should be in the jdk jre image. +trim-module-image-jre:: +ifeq ($(PLATFORM), windows) + ifeq ($(ARCH_DATA_MODEL), 32) + $(RM) -r $(JRE_MODULE_IMAGE_DIR)/bin/server + endif + ifdef NOTJRE_SHARED_LIBS + for l in $(NOTJRE_SHARED_LIBS) ; do \ + $(RM) $(JRE_MODULE_IMAGE_DIR)/bin/$$l ; \ + done ; + endif +else # PLATFORM + ifdef NOTJRE_SHARED_LIBS + for l in $(NOTJRE_SHARED_LIBS) ; do \ + $(RM) $(JRE_MODULE_IMAGE_DIR)/lib/$(LIBARCH)/$$l ; \ + done ; + endif +endif # PLATFORM + +# Get list of all Elf files in the jre +JRE_MODULE_ELF_LIST=$(MODULES_TEMPDIR)/jre-elf-files.list +$(JRE_MODULE_ELF_LIST): + @$(prep-target) +ifneq ($(PLATFORM), windows) + $(RM) $@ + $(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -type f -name \*.$(LIB_SUFFIX) >> $@ + $(FILE) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/bin -type f -name \*$(EXE_SUFFIX)` \ + | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@ +endif + +# Post process the image (strips and mcs on Elf files we are shipping) +# (Note the jdk WILL want the jre image before this processing) +process-module-image-jre:: $(JRE_MODULE_ELF_LIST) +ifneq ($(POST_STRIP_PROCESS), ) + for f in `$(CAT) $(JRE_MODULE_ELF_LIST)`; do \ + $(CHMOD) u+w $${f}; \ + $(ECHO) $(POST_STRIP_PROCESS) $${f}; \ + $(POST_STRIP_PROCESS) $${f}; \ + $(CHMOD) go-w $${f}; \ + done +endif +ifneq ($(POST_MCS_PROCESS), ) + for f in `$(CAT) $(JRE_MODULE_ELF_LIST)`; do \ + $(CHMOD) u+w $${f}; \ + $(ECHO) $(POST_MCS_PROCESS) $${f}; \ + $(POST_MCS_PROCESS) $${f}; \ + $(CHMOD) go-w $${f}; \ + done +endif + $(RM) $(JRE_MODULE_ELF_LIST) + +###################################################### +# JDK Image +###################################################### +# Note: cpio ($(CPIO)) sometimes leaves directories without rx access. + +initial-module-image-jdk-setup: + $(RM) -r $(JDK_MODULE_IMAGE_DIR) + $(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/jre + ($(CD) $(JRE_MODULE_IMAGE_DIR) && $(FIND) . -depth -print \ + | $(CPIO) -pdum $(JDK_MODULE_IMAGE_DIR)/jre ) + $(RM) -rf $(JDK_MODULE_IMAGE_DIR)/jre/man + $(CHMOD) a+rx `$(FIND) $(JDK_MODULE_IMAGE_DIR) -type d` + +initial-module-image-jdk64-bindemos: + for dir in bin demo ; do \ + ( $(CD) $(OUTPUTDIR) && \ + $(TAR) cf - `$(FIND) $$dir -name '$(LIBARCH)' -print` | \ + ($(CD) $(JDK_MODULE_IMAGE_DIR) && $(TAR) xf -) ) ; \ + done + +# Solaris 64 bit image is special +initial-module-image-jdk-sol64:: initial-module-image-jdk-setup \ + initial-module-image-jdk64-bindemos \ + $(JDK_MODULE_LICENSES) $(JDK_MODULARLIZED_64_LICENSES) + +# DB files to add +ifeq ($(OPENJDK),true) + +initial-module-image-jdk-db: + +else + +# Create the list of db *.zip files to bundle with jdk +ABS_DB_PATH :=$(call FullPath,$(CLOSED_SHARE_SRC)/db) +DB_ZIP_LIST = $(shell $(LS) $(ABS_DB_PATH)/*.zip 2>/dev/null) + +initial-module-image-jdk-db: $(DB_ZIP_LIST) + $(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/db + for d in $(DB_ZIP_LIST); do \ + ($(CD) $(JDK_MODULE_IMAGE_DIR)/db && $(UNZIP) -o $$d); \ + done + +endif + +# Standard jdk image +initial-module-image-jdk:: initial-module-image-jdk-setup \ + initial-module-image-jdk-db \ + $(JDK_MODULE_LICENSES) $(JDK_MODULE_DOCFILES) + $(MKDIR) $(JDK_MODULE_IMAGE_DIR)/lib + @# + @# copy jdk modules to jdk/lib + @# + $(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/lib + for m in $(JDK_MODULES) ; do \ + $(CP) $(MODULES_DIR)/$$m/lib/$$m.jar $(JDK_MODULE_IMAGE_DIR)/lib ; \ + done + ifeq ($(PLATFORM), windows) + @# + @# lib/ + @# + $(CP) $(LIBDIR)/$(LIB_PREFIX)jvm.$(LIB_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/lib + $(CP) $(LIBDIR)/$(LIB_PREFIX)jawt.$(LIB_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/lib + @# + @# bin/ + @# + @# copy all EXE files and only certain DLL files from BINDIR + $(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/bin + $(CP) $(BINDIR)/*$(EXE_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin + $(CP) $(BINDIR)/jli.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin + ifeq ($(ARCH_DATA_MODEL), 32) + ifeq ($(COMPILER_VERSION), VS2003) + $(CP) $(BINDIR)/msvc*71.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin + endif + endif + else # PLATFORM + @# + @# bin/ + @# + ($(CD) $(BINDIR)/.. && $(TAR) cf - \ + `$(FIND) bin \( -type f -o -type l \) -print `) | \ + ($(CD) $(JDK_MODULE_IMAGE_DIR) && $(TAR) xf -) + endif # PLATFORM + @# + @# lib/ct.sym + @# + $(MKDIR) -p $(OUTPUTDIR)/symbols/META-INF/sym + $(JAVAC_CMD) -XDprocess.packages -proc:only \ + -processor com.sun.tools.javac.sym.CreateSymbols \ + -Acom.sun.tools.javac.sym.Jar=$(RT_JAR) \ + -Acom.sun.tools.javac.sym.Dest=$(OUTPUTDIR)/symbols/META-INF/sym/rt.jar \ + $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) + $(BOOT_JAR_CMD) c0f $(LIBDIR)/ct.sym \ + -C $(OUTPUTDIR)/symbols META-INF $(BOOT_JAR_JFLAGS) + @$(java-vm-cleanup) + $(CP) $(LIBDIR)/ct.sym $(JDK_MODULE_IMAGE_DIR)/lib/ct.sym + @# + @# CORBA supported orb.idl and ir.idl should be copied to lib + @# + $(CP) $(LIBDIR)/orb.idl $(JDK_MODULE_IMAGE_DIR)/lib/orb.idl + $(CP) $(LIBDIR)/ir.idl $(JDK_MODULE_IMAGE_DIR)/lib/ir.idl + ifeq ($(PLATFORM), linux) + @# + @# on Linux copy jexec from jre/lib to /lib + @# + $(CP) $(LIBDIR)/jexec $(JDK_MODULE_IMAGE_DIR)/lib/jexec + endif # PLATFORM + @# + @# demo, include + @# + $(CP) -r -f $(DEMODIR) $(JDK_MODULE_IMAGE_DIR) + $(CP) -r -f $(SAMPLEDIR) $(JDK_MODULE_IMAGE_DIR) + $(CP) -r $(INCLUDEDIR) $(JDK_MODULE_IMAGE_DIR) + @# + @# Swing BeanInfo generation + @# + $(CD) javax/swing/beaninfo && $(MAKE) JDK_IMAGE_DIR=$(JDK_MODULE_IMAGE_DIR) swing-1.2-beans +ifneq ($(PLATFORM), windows) + $(call copy-man-pages,$(JDK_MODULE_IMAGE_DIR),$(JDK_MAN_PAGES)) +endif # !windows + +# Trim out files we don't want to ship +trim-module-image-jdk:: + @# Remove tools that should not be part of SDK. + for t in $(NOTJDKTOOLS); do \ + $(RM) $(JDK_MODULE_IMAGE_DIR)/bin/$${t}$(EXE_SUFFIX) \ + $(JDK_MODULE_IMAGE_DIR)/bin/*/native_threads/$${t}$(EXE_SUFFIX); \ + done + +# Get list of Elf files in the jdk +JDK_MODULE_ELF_LIST=$(MODULES_TEMPDIR)/jdk-elf-files.list +$(JDK_MODULE_ELF_LIST): + @$(prep-target) +ifneq ($(PLATFORM), windows) + $(RM) $@ + $(FIND) $(JDK_MODULE_IMAGE_DIR)/jre/lib -type f -name \*.$(LIB_SUFFIX) >> $@ + $(FILE) `$(FIND) $(JDK_MODULE_IMAGE_DIR)/jre/bin -type f -name \*$(EXE_SUFFIX)` \ + | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@ + file `$(FIND) $(JDK_MODULE_IMAGE_DIR)/bin -type f -name \*$(EXE_SUFFIX)` \ + | $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@ +endif + +# Post process the image (strips and mcs on files we are shipping) +process-module-image-jdk:: $(JDK_MODULE_ELF_LIST) +ifneq ($(POST_STRIP_PROCESS), ) + for f in `$(CAT) $(JDK_MODULE_ELF_LIST)`; do \ + $(CHMOD) u+w $${f}; \ + $(ECHO) $(POST_STRIP_PROCESS) $${f}; \ + $(POST_STRIP_PROCESS) $${f}; \ + $(CHMOD) go-w $${f}; \ + done +endif +ifneq ($(POST_MCS_PROCESS), ) + for f in `$(CAT) $(JDK_MODULE_ELF_LIST)`; do \ + $(CHMOD) u+w $${f}; \ + $(ECHO) $(POST_MCS_PROCESS) $${f}; \ + $(POST_MCS_PROCESS) $${f}; \ + $(CHMOD) go-w $${f}; \ + done +endif + $(RM) $(JDK_MODULE_ELF_LIST) + +###################################################### +# clobber +###################################################### +modules-clobber:: + $(RM) -r $(JDK_MODULE_IMAGE_DIR) + $(RM) -r $(JRE_MODULE_IMAGE_DIR) + +# +# TODO - nop for now +sanity-module-images post-sanity-module-images: + +modules modules-clobber:: + @$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..." + @$(java-vm-cleanup) + +.PHONY: modules module-image-jre module-image-jdk \ + initial-module-image-jre initial-module-image-jdk \ + initial-module-image-jre-sol64 initial-module-image-jdk-sol64 \ + initial-module-image-jdk-setup \ + initial-module-image-jdk-db \ + initial-module-image-jdk64-bindemos \ + initial-module-image-jre-setup \ + trim-module-image-jre trim-module-image-jdk \ + process-module-image-jre process-module-image-jdk \ + install-previous-jre install-previous-jdk \ + modules-clobber + +# Force rule +FRC: + diff --git a/jdk/make/common/Program.gmk b/jdk/make/common/Program.gmk index 091ec95f809..7cae90fb10f 100644 --- a/jdk/make/common/Program.gmk +++ b/jdk/make/common/Program.gmk @@ -50,8 +50,6 @@ ACTUAL_PROGRAM_NAME = $(PROGRAM)$(EXE_SUFFIX) ACTUAL_PROGRAM_DIR = $(BINDIR) ACTUAL_PROGRAM = $(ACTUAL_PROGRAM_DIR)/$(ACTUAL_PROGRAM_NAME) -JVMCFG = $(LIBDIR)/$(LIBARCH)/jvm.cfg - # Make sure the default rule is all program_default_rule: all @@ -116,7 +114,7 @@ endif ifeq ($(COMPILE_IT),true) -$(ACTUAL_PROGRAM):: classes $(JVMCFG) $(INIT) +$(ACTUAL_PROGRAM):: classes $(INIT) # # Windows only @@ -190,12 +188,13 @@ $(ACTUAL_PROGRAM):: $(FILES_o) @$(MKDIR) -p $(TEMPDIR) $(LINK_PRE_CMD) $(CC) $(CC_OBJECT_OUTPUT_FLAG)$@ $(LDFLAGS) \ $(FILES_o) $(THREADLIBS) $(LDLIBS) + $(install-module-file) endif # PLATFORM else # COMPILE_IT -$(ACTUAL_PROGRAM):: $(JVMCFG) +$(ACTUAL_PROGRAM):: # Copies in the file from the JDK_IMPORT_PATH area $(ACTUAL_PROGRAM_DIR)/%: $(JDK_IMPORT_PATH)/jre/bin/% @@ -271,18 +270,6 @@ $(OBJDIR)/main.$(OBJECT_SUFFIX): $(LAUNCHER_SHARE_SRC)/bin/main.c $(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$(OBJDIR)/main.$(OBJECT_SUFFIX) \ $(VERSION_DEFINES) $< -# -# How to install jvm.cfg. -# -ifeq ($(ZERO_BUILD), true) -JVMCFG_ARCH = zero -else -JVMCFG_ARCH = $(ARCH) -endif - -$(JVMCFG): $(LAUNCHER_PLATFORM_SRC)/bin/$(JVMCFG_ARCH)/jvm.cfg - $(install-file) - # # Default dependencies # diff --git a/jdk/make/common/Sanity.gmk b/jdk/make/common/Sanity.gmk index a136e6d8d34..449dcb2358f 100644 --- a/jdk/make/common/Sanity.gmk +++ b/jdk/make/common/Sanity.gmk @@ -71,7 +71,8 @@ sanity-base: pre-sanity \ sane-cacerts \ sane-ant_version \ sane-zip_version \ - sane-msvcrt_path + sane-msvcrt_path \ + sane-build_modules # The rules sanity-* have a one-to-one correspondence with the major targets # Each sanity-* rule should have no body to ensure that the post-sanity-* is the diff --git a/jdk/make/common/Subdirs.gmk b/jdk/make/common/Subdirs.gmk new file mode 100644 index 00000000000..947d171c495 --- /dev/null +++ b/jdk/make/common/Subdirs.gmk @@ -0,0 +1,204 @@ +# Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions +# + +# +# Generic makefile for building subdirectories. +# +# SUBDIRS variables to specify the subdirectories to build recursively. +# Makefile has to include Subdirs.gmk AFTER all SUBDIRS variables are +# defined. +# +# This file does not contain any rule. +# +# WARNING: This file is shared with other workspaces. +# So when it includes other files, it must use JDK_TOPDIR. + +# +# SUBDIRS subdirs for the base module always get built +# SUBDIRS_ subdirs for the named group +# +# By default, subdirs specified in the SUBDIRS and all SUBDIRS_* +# variables will be built. +# +# BUILD_MODULES variable can be used to specify one or more groups +# to be built (BUILD_MODULES=all will build all groups). +# +# Variables of the currently supported groups are: +# SUBDIRS_desktop +# SUBDIRS_management +# SUBDIRS_enterprise +# SUBDIRS_misc +# SUBDIRS_tools +# +# Change to the above list also need to update +# make/common/shared/Sanity.gmk. NOTE: this list is subject +# to change till the JDK 7 SE profiles/modules are finalized. +# +# Eventually we want to restructure the make directory +# according to these grouping (e.g. make/desktop/...) and +# the SUBDIRS_ variables would not be needed. +# +# To build the desktop and tools groups only, you can do: +# gnumake BUILD_MODULES="desktop tools" ... +# + +# Iterate the subdirectories specified in $1. +# - cd into each subdir and make them + +# Given a SUBDIRS* list (first argument), cd into them and make them +# SUBDIRS_MAKEFLAGS Make settings for a subdir make +# SUBDIRS_MAKEFLAGS-$@ Make settings specific to this target +# +define subdirs-group-loop +@$(ECHO) "Begin Processing SUBDIRS: $($1)" +@for i in DUMMY $($1) ; do \ + if [ "$$i" != "DUMMY" ] ; then \ + $(MAKE) -C $$i $@ $(SUBDIRS_MAKEFLAGS) $(SUBDIRS_MAKEFLAGS-$@) \ + FULL_VERSION=$(FULL_VERSION) RELEASE=$(RELEASE) || exit 1; \ + fi ; \ +done +@$(ECHO) "Done Processing SUBDIRS: $($1)" +endef + +# Given a OTHERSUBDIRS list, cd into them and make them (extra loop define) +# OTHERSUBDIRS_MAKEFLAGS Make settings for a subdir make +define OTHERSUBDIRS-loop +@$(ECHO) "Begin Processing OTHERSUBDIRS: $(OTHERSUBDIRS)" +@for i in DUMMY $(OTHERSUBDIRS) ; do \ + if [ "$$i" != "DUMMY" ] ; then \ + $(MAKE) -C $$i $@ $(OTHERSUBDIRS_MAKEFLAGS) \ + FULL_VERSION=$(FULL_VERSION) RELEASE=$(RELEASE) || exit 1; \ + fi ; \ +done +@$(ECHO) "Done Processing OTHERSUBDIRS: $(OTHERSUBDIRS)" +endef + +# +# Iterate the list specified in SUBDIRS_ only if +# SUBDIRS_ is set and or "all" is specified +# in the BUILD_MODULES variable +# +ifdef SUBDIRS_desktop + ifneq (,$(findstring desktop, $(BUILD_MODULES))) + define subdirs-desktop-loop + @$(call subdirs-group-loop,SUBDIRS_desktop) + endef + else + define subdirs-desktop-loop + endef + endif +else + define subdirs-desktop-loop + endef +endif # SUBDIRS_desktop + +ifdef SUBDIRS_enterprise + ifneq (,$(findstring enterprise, $(BUILD_MODULES))) + define subdirs-enterprise-loop + @$(call subdirs-group-loop,SUBDIRS_enterprise) + endef + else + define subdirs-enterprise-loop + endef + endif +else +define subdirs-enterprise-loop +endef +endif # SUBDIRS_enterprise + +ifdef SUBDIRS_management + ifneq (,$(findstring management, $(BUILD_MODULES))) + define subdirs-management-loop + @$(call subdirs-group-loop,SUBDIRS_management) + endef + else + define subdirs-management-loop + endef + endif +else +define subdirs-management-loop +endef +endif # SUBDIRS_management + +ifdef SUBDIRS_misc + ifneq (,$(findstring misc, $(BUILD_MODULES))) + define subdirs-misc-loop + @$(call subdirs-group-loop,SUBDIRS_misc) + endef + else + define subdirs-misc-loop + endef + endif +else +define subdirs-misc-loop +endef +endif # SUBDIRS_misc + +ifdef SUBDIRS_tools + ifneq (,$(findstring tools, $(BUILD_MODULES))) + define subdirs-tools-loop + @$(call subdirs-group-loop,SUBDIRS_tools) + endef + else + define subdirs-tools-loop + endef + endif +else +define subdirs-tools-loop +endef +endif # SUBDIRS_tools + +# +# If BUILD_MODULES is not set or it's set to "all", +# iterate all groups. +SUBDIRS_all = $(SUBDIRS) $(SUBDIRS_desktop) $(SUBDIRS_enterprise) \ + $(SUBDIRS_management) $(SUBDIRS_misc) $(SUBDIRS_tools) + +ifndef BUILD_MODULES +define SUBDIRS-loop + @$(call subdirs-group-loop,SUBDIRS_all) +endef + +else + +ifneq (,$(findstring all, $(BUILD_MODULES))) +define SUBDIRS-loop + @$(call subdirs-group-loop,SUBDIRS_all) +endef + +else # BUILD_MODULES set +# +# Iterate SUBDIRS and the groups specified in BUILD_MODULES +# +define SUBDIRS-loop + @$(call subdirs-group-loop,SUBDIRS) + @$(subdirs-desktop-loop) + @$(subdirs-enterprise-loop) + @$(subdirs-management-loop) + @$(subdirs-misc-loop) + @$(subdirs-tools-loop) +endef + +endif +endif # BUILD_MODULES diff --git a/jdk/make/common/internal/BinaryPlugs.gmk b/jdk/make/common/internal/BinaryPlugs.gmk index a77044af43c..96c7ba989bd 100644 --- a/jdk/make/common/internal/BinaryPlugs.gmk +++ b/jdk/make/common/internal/BinaryPlugs.gmk @@ -116,7 +116,7 @@ PLUG_IMPORT_JARFILE=$(BINARY_PLUGS_JARFILE) define import-binary-plug-file @$(ECHO) "PLUG IMPORT: $(@F)" -$(install-file) +$(install-non-module-file) endef # import-binary-plug-file # Import classes command @@ -184,7 +184,7 @@ PLUG_EXPORT_JARFILE=$(PLUG_EXPORT_DIR)/jre/lib/$(BINARY_PLUGS_JARNAME) define export-binary-plug-file @$(ECHO) "PLUG EXPORT: $(@F)" -$(install-file) +$(install-non-module-file) endef # export-binary-plug-file # OpenJDK Binary Plug License diff --git a/jdk/make/common/internal/Resources.gmk b/jdk/make/common/internal/Resources.gmk index a772194b471..dbbc4b561d8 100644 --- a/jdk/make/common/internal/Resources.gmk +++ b/jdk/make/common/internal/Resources.gmk @@ -139,7 +139,7 @@ STRIP_PROP_FILES = $(PROPERTIES_FILES:%=$(CLASSDESTDIR)/%) STRIP_PROP_options=$(TEMPDIR)/strip_prop_options define install-properties-file $(install-file) -$(CHMOD) a+rw $@ +$(call chmod-file, a+rw) @$(ECHO) "# Adding to strip properties list: $@" $(ECHO) "$@" >> $(STRIP_PROP_options) endef diff --git a/jdk/make/common/shared/Defs-java.gmk b/jdk/make/common/shared/Defs-java.gmk index f9ed6353131..1d13c216940 100644 --- a/jdk/make/common/shared/Defs-java.gmk +++ b/jdk/make/common/shared/Defs-java.gmk @@ -138,6 +138,10 @@ JAVACFLAGS += $(OTHER_JAVACFLAGS) # Needed for javah JAVAHFLAGS += -bootclasspath $(CLASSBINDIR) +# Needed for javadoc to ensure it builds documentation +# against the newly built classes +JAVADOCFLAGS += -bootclasspath $(CLASSBINDIR) + # Needed for JAVADOC and BOOT_JAVACFLAGS NO_PROPRIETARY_API_WARNINGS = -XDignore.symbol.file=true @@ -155,14 +159,15 @@ ifdef LANGTOOLS_DIST -jar $(JAVAH_JAR) $(JAVAHFLAGS) JAVADOC_CMD = $(BOOT_JAVA_CMD) \ "-Xbootclasspath/p:$(JAVADOC_JAR)$(CLASSPATH_SEPARATOR)$(JAVAC_JAR)$(CLASSPATH_SEPARATOR)$(DOCLETS_JAR)" \ - -jar $(JAVADOC_JAR) + -jar $(JAVADOC_JAR) $(JAVADOCFLAGS) else # If no explicit tools, use boot tools (add VM flags in this case) JAVAC_CMD = $(JAVA_TOOLS_DIR)/javac $(JAVAC_JVM_FLAGS) \ $(JAVACFLAGS) JAVAH_CMD = $(JAVA_TOOLS_DIR)/javah \ $(JAVAHFLAGS) - JAVADOC_CMD = $(JAVA_TOOLS_DIR)/javadoc $(JAVA_TOOLS_FLAGS:%=-J%) + JAVADOC_CMD = $(JAVA_TOOLS_DIR)/javadoc $(JAVA_TOOLS_FLAGS:%=-J%) \ + $(JAVADOCFLAGS) endif # Override of what javac to use (see deploy workspace) diff --git a/jdk/make/common/shared/Platform.gmk b/jdk/make/common/shared/Platform.gmk index e07de2499fb..ee6f38f3bb0 100644 --- a/jdk/make/common/shared/Platform.gmk +++ b/jdk/make/common/shared/Platform.gmk @@ -165,6 +165,9 @@ ifeq ($(SYSTEM_UNAME), Linux) sparc*) \ echo sparc \ ;; \ + arm*) \ + echo arm \ + ;; \ *) \ echo $(mach) \ ;; \ diff --git a/jdk/make/common/shared/Sanity.gmk b/jdk/make/common/shared/Sanity.gmk index e8b19c942eb..5fb51fe3cfe 100644 --- a/jdk/make/common/shared/Sanity.gmk +++ b/jdk/make/common/shared/Sanity.gmk @@ -1,5 +1,5 @@ # -# Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-2010 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -218,7 +218,8 @@ include $(JDK_MAKE_SHARED_DIR)/Sanity-Settings.gmk sane-zip_version \ sane-unzip_version \ sane-msvcrt_path \ - sane-freetype + sane-freetype \ + sane-build_modules ###################################################### # check for COPYRIGHT_YEAR variable @@ -686,13 +687,13 @@ endif ###################################################### sane-alt_outputdir: ifdef ALT_OUTPUTDIR - @if [ `$(ECHO) $(subst \,/,$(ALT_OUTPUTDIR)) | $(EGREP) -ci '^([a-z]:)?/'` -ne 1 ]; then \ + @if [ `$(ECHO) $(subst \,/,$(ALT_OUTPUTDIR)) | $(EGREP) -c '^([A-Za-z]:)?/'` -ne 1 ]; then \ $(ECHO) "ERROR: ALT_OUTPUTDIR must be an Absolute Path Name, \n" \ " not a Relative Path Name. \n" \ "" >> $(ERROR_FILE) ; \ fi ifeq ($(PLATFORM), windows) - @if [ `$(ECHO) $(subst \,/,$(ALT_OUTPUTDIR)) | $(EGREP) -ci '^([a-z]:)'` -ne 1 ]; then \ + @if [ `$(ECHO) $(subst \,/,$(ALT_OUTPUTDIR)) | $(EGREP) -c '^([A-Za-z]:)'` -ne 1 ]; then \ $(ECHO) "ERROR: On windows, ALT_OUTPUTDIR must contain the drive letter. \n" \ "" >> $(ERROR_FILE) ; \ fi @@ -741,7 +742,7 @@ sane-outputdir: ###################################################### sane-alt_bootdir: ifdef ALT_BOOTDIR - @if [ `$(ECHO) $(subst \,/,$(ALT_BOOTDIR)) | $(EGREP) -ci '^([a-z]:)?/'` -ne 1 ]; then \ + @if [ `$(ECHO) $(subst \,/,$(ALT_BOOTDIR)) | $(EGREP) -c '^([A-Za-z]:)?/'` -ne 1 ]; then \ $(ECHO) "ERROR: ALT_BOOTDIR must be an Absolute Path Name, \n" \ " not a Relative Path Name. \n" \ " The current value of ALT_BOOTDIR is \n" \ @@ -771,7 +772,7 @@ sane-bootdir: ###################################################### sane-local-bootdir: ifeq ($(PLATFORM), windows) - @if [ `$(ECHO) $(BOOTDIR) | $(EGREP) -ci '^J:'` -ne 0 ]; then \ + @if [ `$(ECHO) $(BOOTDIR) | $(EGREP) -c '^[jJ]:'` -ne 0 ]; then \ $(ECHO) "WARNING: Your BOOTDIR is located on the J: drive. Often the J:\n" \ " drive is mapped over a network. Using a mapped drive for\n" \ " the BOOTDIR may significantly slow down the build process.\n" \ @@ -788,7 +789,7 @@ endif ###################################################### sane-cacerts: ifdef ALT_CACERTS_FILE - @if [ `$(ECHO) $(subst \,/,$(ALT_CACERTS_FILE)) | $(EGREP) -ci '^([a-z]:)?/'` -ne 1 ]; then \ + @if [ `$(ECHO) $(subst \,/,$(ALT_CACERTS_FILE)) | $(EGREP) -c '^([A-Za-z]:)?/'` -ne 1 ]; then \ $(ECHO) "ERROR: ALT_CACERTS_FILE must be an Absolute Path Name, \n" \ " not a Relative Path Name. \n" \ " The current value of ALT_CACERTS_FILE is \n" \ @@ -844,6 +845,21 @@ else sane-freetype: endif +###################################################### +# if specified, BUILD_MODULES must contain valid values. +###################################################### +MODULES_REGEX="all|base|desktop|management|enterprise|misc|tools" +sane-build_modules: +ifdef BUILD_MODULES + @for m in $(BUILD_MODULES) ; do \ + valid=`$(ECHO) $$m | $(EGREP) $(MODULES_REGEX)`; \ + if [ "x$$valid" = "x" ] ; then \ + $(ECHO) "ERROR: $$m set in the BUILD_MODULES variable is invalid.\n" \ + "" >> $(ERROR_FILE); \ + fi \ + done +endif + ###################################################### # CUPS_HEADERS_PATH must be valid ###################################################### @@ -1093,6 +1109,7 @@ endif # Check for existence of misc Hotspot imported files ###################################################### HOTSPOT_INCLUDE_FILE_LIST = jvmti.h +HOTSPOT_INCLUDE_FILE_LIST += jvmticmlr.h #HOTSPOT_INCLUDE_FILE_LIST += jni.h jni_md.h #HOTSPOT_INCLUDE_FILE_LIST += jvm.h jvm_md.h #HOTSPOT_INCLUDE_FILE_LIST += jmm.h @@ -1117,7 +1134,7 @@ TMP_SDK_INCLUDE_GET_FULL_VERSION= $(TMP_SDK_INCLUDE_FIND_VERSION) | \ # be checked when this represents a full control build (i.e. the # HOTSPOT_IMPORT_PATH includes these files in it's 'include' directory). $(TEMPDIR)/%.h: $(SHARE_SRC)/javavm/export/%.h - @$(install-file) + @$(install-non-module-file) @$(RM) $@.IMPORT @if [ -r $(HOTSPOT_IMPORT_PATH)/include/$(@F) ]; then \ $(CP) $(HOTSPOT_IMPORT_PATH)/include/$(@F) $@.IMPORT ; \ @@ -1131,7 +1148,7 @@ $(TEMPDIR)/%.h: $(SHARE_SRC)/javavm/export/%.h fi $(TEMPDIR)/%.h: $(PLATFORM_SRC)/javavm/export/%.h - @$(install-file) + @$(install-non-module-file) @$(RM) $@.IMPORT @if [ -r $(HOTSPOT_IMPORT_PATH)/include/$(PLATFORM_INCLUDE_NAME)/$(@F) ]; then \ $(CP) $(HOTSPOT_IMPORT_PATH)/include/$(PLATFORM_INCLUDE_NAME)/$(@F) $@.IMPORT ; \ @@ -1521,7 +1538,7 @@ endif sane-mozilla: ifeq ($(ARCH_DATA_MODEL), 32) ifdef ALT_MOZILLA_HEADERS_PATH - @if [ `$(ECHO) $(subst \,/,$(ALT_MOZILLA_HEADERS_PATH)) | $(EGREP) -ci '^([a-z]:)?/'` -ne 1 ]; then \ + @if [ `$(ECHO) $(subst \,/,$(ALT_MOZILLA_HEADERS_PATH)) | $(EGREP) -c '^([A-Za-z]:)?/'` -ne 1 ]; then \ $(ECHO) "ERROR: ALT_MOZILLA_HEADERS_PATH must be an Absolute Path Name, \n" \ " not a Relative Path Name. \n" \ " The current value of ALT_MOZILLA_HEADERS_PATH is \n" \ diff --git a/jdk/make/docs/Makefile b/jdk/make/docs/Makefile index 5d287c37272..e0ae9b5a400 100644 --- a/jdk/make/docs/Makefile +++ b/jdk/make/docs/Makefile @@ -69,7 +69,7 @@ DRAFT = '
DRAFT '$(MILESTONE)-$(BUILD_NUMBER)'' THIS_YEAR := $(shell $(DATE) | $(SED) -e 's/ / /g' | $(CUT) -d' ' -f6) TRADEMARK = &\#x2122; -IGNORED_TAGS = beaninfo revised since.unbundled spec Note ToDo +IGNORED_TAGS = beaninfo revised since.unbundled spec specdefault Note ToDo JLS3_URL = http://java.sun.com/docs/books/jls/ JLS3_CITE = \ diff --git a/jdk/make/java/Makefile b/jdk/make/java/Makefile index ca48cc9bef5..e3d046f7ae4 100644 --- a/jdk/make/java/Makefile +++ b/jdk/make/java/Makefile @@ -38,9 +38,13 @@ SUBDIRS += hpi version jvm redist verify fdlibm java sun_nio jli main zip # Others # Note: java_crw_demo java_hprof_demo are demos but must be delivered built in sdk -SUBDIRS += security npt java_crw_demo java_hprof_demo \ - math awt util text applet net nio dyn \ - sql rmi jar beans logging management instrument + +SUBDIRS += security math util text net nio jar + +SUBDIRS_desktop = awt applet beans +SUBDIRS_management = management +SUBDIRS_misc = npt java_crw_demo java_hprof_demo \ + logging instrument dyn sql rmi ifeq ($(PLATFORM), solaris) @@ -53,6 +57,8 @@ ifeq ($(PLATFORM), linux) SUBDIRS += jexec endif # PLATFORM +include $(BUILDDIR)/common/Subdirs.gmk + all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/java/awt/Makefile b/jdk/make/java/awt/Makefile index e019a309d9f..f8c56732c3a 100644 --- a/jdk/make/java/awt/Makefile +++ b/jdk/make/java/awt/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../.. +MODULE = awt PACKAGE = java.awt PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/java/fdlibm/Makefile b/jdk/make/java/fdlibm/Makefile index 739eaf4403f..fcacf2d7106 100644 --- a/jdk/make/java/fdlibm/Makefile +++ b/jdk/make/java/fdlibm/Makefile @@ -31,6 +31,7 @@ # BUILDDIR = ../.. +MODULE = base LIBRARY = fdlibm PRODUCT = java diff --git a/jdk/make/java/hpi/Makefile b/jdk/make/java/hpi/Makefile index ee6453832ec..69f3861c0b1 100644 --- a/jdk/make/java/hpi/Makefile +++ b/jdk/make/java/hpi/Makefile @@ -34,6 +34,8 @@ include $(BUILDDIR)/common/Defs.gmk # Build specified the HPI implementations # SUBDIRS = $(HPIS) +include $(BUILDDIR)/common/Subdirs.gmk + all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/java/hpi/native/Makefile b/jdk/make/java/hpi/native/Makefile index 7e9f2d2047c..79cafdcf82e 100644 --- a/jdk/make/java/hpi/native/Makefile +++ b/jdk/make/java/hpi/native/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../../.. +MODULE = base LIBRARY = hpi PRODUCT = java THREADDIR = native_threads diff --git a/jdk/make/java/hpi/windows/Makefile b/jdk/make/java/hpi/windows/Makefile index b82d8853ab2..44d0501363a 100644 --- a/jdk/make/java/hpi/windows/Makefile +++ b/jdk/make/java/hpi/windows/Makefile @@ -26,8 +26,9 @@ # # Makefile for Windows HPI DLL # -BUILDDIR = ../../.. -LIBRARY = hpi +BUILDDIR = ../../.. +MODULE = base +LIBRARY = hpi PRODUCT = java THREADDIR = windows_threads LIB_LOCATION = $(BINDIR) diff --git a/jdk/make/java/instrument/Makefile b/jdk/make/java/instrument/Makefile index f46b3d10cc1..8b703afd920 100644 --- a/jdk/make/java/instrument/Makefile +++ b/jdk/make/java/instrument/Makefile @@ -27,6 +27,7 @@ # agent, supporting java.lang.instrument BUILDDIR = ../.. +MODULE = instrument PACKAGE = sun.instrument LIBRARY = instrument PRODUCT = sun diff --git a/jdk/make/java/java/Makefile b/jdk/make/java/java/Makefile index b0e40530f4e..26853ac3aa8 100644 --- a/jdk/make/java/java/Makefile +++ b/jdk/make/java/java/Makefile @@ -29,6 +29,7 @@ # BUILDDIR = ../.. +MODULE = base PACKAGE = java.lang LIBRARY = java PRODUCT = java @@ -217,6 +218,8 @@ ifeq ($(PLATFORM), solaris) endif SUBDIRS = reflect +include $(BUILDDIR)/common/Subdirs.gmk + all build: $(SUBDIRS-loop) clean clobber:: @@ -241,7 +244,7 @@ ifneq ($(PLATFORM),windows) $(GENSRCDIR)/java/lang/UNIXProcess.java: \ $(PLATFORM_SRC)/classes/java/lang/UNIXProcess.java.$(PLATFORM) - $(install-file) + $(install-non-module-file) clean:: $(RM) $(GENSRCDIR)/java/lang/UNIXProcess.java @@ -285,7 +288,7 @@ TZMAPFILE = $(PLATFORM_SRC)/lib/tzmappings $(TZMAP): $(TZMAPFILE) $(install-file) - $(CHMOD) 444 $@ + $(call chmod-file, 444) endif build: $(LIBDIR)/$(PROPS) $(LIBDIR)/$(CAL_PROPS) $(TZMAP) @@ -315,7 +318,8 @@ $(CURDATA): \ $(BOOT_JAVA_CMD) -jar $(GENERATECURRENCYDATA_JARFILE) -o $@.temp \ < $(SHARE_SRC)/classes/java/util/CurrencyData.properties $(MV) $@.temp $@ - $(CHMOD) 444 $@ + $(install-module-file) + $(call chmod-file, 444) clean:: $(RM) $(CURDATA) @@ -369,7 +373,7 @@ $(GENSRCDIR)/java/lang/CharacterDataLatin1.java \ -usecharforbyte 11 4 1 $(GENSRCDIR)/java/lang/%.java : $(CHARACTERDATA)/%.java.template - $(install-file) + $(install-non-module-file) clean:: $(RM) $(GENSRCDIR)/java/lang/CharacterDataLatin1.java diff --git a/jdk/make/java/java/genlocales.gmk b/jdk/make/java/java/genlocales.gmk index 3adb769490d..df9aec72678 100644 --- a/jdk/make/java/java/genlocales.gmk +++ b/jdk/make/java/java/genlocales.gmk @@ -49,7 +49,7 @@ Euro_Resources_properties := $(FILES_compiled_properties) # $(BUILDDIR)/java/text/FILES_java.gmk contains the "sun.text.resources" for # European language support -include $(BUILDDIR)/java/text/FILES_java.gmk +include $(BUILDDIR)/java/text/base/FILES_java.gmk Euro_Resources_java += $(FILES_java) diff --git a/jdk/make/java/java/mapfile-vers b/jdk/make/java/java/mapfile-vers index 661db2f463c..24c8d21a789 100644 --- a/jdk/make/java/java/mapfile-vers +++ b/jdk/make/java/java/mapfile-vers @@ -150,10 +150,8 @@ SUNWprivate_1.1 { Java_java_lang_StrictMath_asin; Java_java_lang_StrictMath_atan; Java_java_lang_StrictMath_atan2; - Java_java_lang_StrictMath_ceil; Java_java_lang_StrictMath_cos; Java_java_lang_StrictMath_exp; - Java_java_lang_StrictMath_floor; Java_java_lang_StrictMath_log; Java_java_lang_StrictMath_log10; Java_java_lang_StrictMath_pow; diff --git a/jdk/make/java/java/reorder-i586 b/jdk/make/java/java/reorder-i586 index 6489abcdc2c..fc3202a8439 100644 --- a/jdk/make/java/java/reorder-i586 +++ b/jdk/make/java/java/reorder-i586 @@ -107,4 +107,3 @@ text: .text%Java_java_lang_Class_isInstance; text: .text%Java_java_util_TimeZone_getSystemTimeZoneID; text: .text%findJavaTZ_md; text: .text%Java_java_lang_StrictMath_log; -text: .text%Java_java_lang_StrictMath_floor; diff --git a/jdk/make/java/java/reorder-sparc b/jdk/make/java/java/reorder-sparc index 22a178b6498..090f0001da2 100644 --- a/jdk/make/java/java/reorder-sparc +++ b/jdk/make/java/java/reorder-sparc @@ -105,4 +105,3 @@ text: .text%Java_java_util_TimeZone_getSystemTimeZoneID; text: .text%findJavaTZ_md; text: .text%Java_java_lang_StrictMath_log; text: .text%Java_java_lang_StrictMath_sqrt; -text: .text%Java_java_lang_StrictMath_floor; diff --git a/jdk/make/java/java/reorder-sparcv9 b/jdk/make/java/java/reorder-sparcv9 index d5f49f21ac6..b20b45ab960 100644 --- a/jdk/make/java/java/reorder-sparcv9 +++ b/jdk/make/java/java/reorder-sparcv9 @@ -101,4 +101,3 @@ text: .text%Java_java_util_TimeZone_getSystemTimeZoneID; text: .text%findJavaTZ_md; text: .text%Java_java_lang_StrictMath_log; text: .text%Java_java_lang_StrictMath_sqrt; -text: .text%Java_java_lang_StrictMath_floor; diff --git a/jdk/make/java/java_crw_demo/Makefile b/jdk/make/java/java_crw_demo/Makefile index 6c45bcbd499..4ee6467aa6d 100644 --- a/jdk/make/java/java_crw_demo/Makefile +++ b/jdk/make/java/java_crw_demo/Makefile @@ -24,6 +24,8 @@ # BUILDDIR = ../.. + +MODULE = demos LIBRARY = java_crw_demo PRODUCT = sun LIBRARY_OUTPUT = java_crw_demo diff --git a/jdk/make/java/java_hprof_demo/Makefile b/jdk/make/java/java_hprof_demo/Makefile index 4e1ef2a31a8..0826dd0213d 100644 --- a/jdk/make/java/java_hprof_demo/Makefile +++ b/jdk/make/java/java_hprof_demo/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../.. +MODULE = instrument LIBRARY = hprof PRODUCT = sun LIBRARY_OUTPUT = hprof_jvmti diff --git a/jdk/make/java/jli/Makefile b/jdk/make/java/jli/Makefile index eeb64ca6e34..98a7874402e 100644 --- a/jdk/make/java/jli/Makefile +++ b/jdk/make/java/jli/Makefile @@ -30,6 +30,7 @@ # its manifestations (java, javaw, javac, ...). # BUILDDIR = ../.. +MODULE = base LIBRARY = jli PRODUCT = java @@ -152,7 +153,6 @@ STATIC_LIBRARY_NAME = $(LIBPREFIX)$(LIBRARY).lib STATIC_LIBRARY = $(STATIC_LIBRARY_DIR)/$(STATIC_LIBRARY_NAME) $(STATIC_LIBRARY_DIR): $(OBJDIR) - @$(prep-target) @$(MKDIR) $(STATIC_LIBRARY_DIR) $(STATIC_LIBRARY): $(STATIC_LIBRARY_DIR) diff --git a/jdk/make/java/jvm/Makefile b/jdk/make/java/jvm/Makefile index 42b756309f4..8bc1c800e4e 100644 --- a/jdk/make/java/jvm/Makefile +++ b/jdk/make/java/jvm/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1995-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1995-2010 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,8 @@ # BUILDDIR = ../.. +MODULE = base + include $(BUILDDIR)/common/Defs.gmk # @@ -32,19 +34,34 @@ include $(BUILDDIR)/common/Defs.gmk FILES_h = $(INCLUDEDIR)/jni.h \ $(PLATFORM_INCLUDE)/jni_md.h \ - $(INCLUDEDIR)/jvmti.h \ + $(INCLUDEDIR)/jvmti.h \ + $(INCLUDEDIR)/jvmticmlr.h \ $(INCLUDEDIR)/classfile_constants.h $(INCLUDEDIR)/%.h: $(SHARE_SRC)/javavm/export/%.h - $(install-file) + $(install-non-module-file) $(PLATFORM_INCLUDE)/%.h: $(PLATFORM_SRC)/javavm/export/%.h + $(install-non-module-file) + +JVMCFG = $(LIBDIR)/$(LIBARCH)/jvm.cfg + +# +# How to install jvm.cfg. +# +ifeq ($(ZERO_BUILD), true) +JVMCFG_ARCH = zero +else +JVMCFG_ARCH = $(ARCH) +endif + +$(JVMCFG): $(PLATFORM_SRC)/bin/$(JVMCFG_ARCH)/jvm.cfg $(install-file) all: build -build: $(FILES_h) +build: $(FILES_h) $(JVMCFG) clean clobber:: - $(RM) $(FILES_h) + $(RM) $(FILES_h) $(JVMCFG) diff --git a/jdk/make/java/logging/Makefile b/jdk/make/java/logging/Makefile index 444c1c63b5a..2077c02a01b 100644 --- a/jdk/make/java/logging/Makefile +++ b/jdk/make/java/logging/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../.. +MODULE = logging PACKAGE = java.util.logging PRODUCT = java include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/java/main/Makefile b/jdk/make/java/main/Makefile index 4e90729d4ea..9758d6dd8a1 100644 --- a/jdk/make/java/main/Makefile +++ b/jdk/make/java/main/Makefile @@ -36,6 +36,8 @@ SUBDIRS = java javaw else SUBDIRS = java endif +include $(BUILDDIR)/common/Subdirs.gmk + all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/java/main/java/Makefile b/jdk/make/java/main/java/Makefile index 37fdf2bdd0f..b24e9f0aaae 100644 --- a/jdk/make/java/main/java/Makefile +++ b/jdk/make/java/main/java/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../../.. +MODULE = base PROGRAM = java PRODUCT = java diff --git a/jdk/make/java/main/javaw/Makefile b/jdk/make/java/main/javaw/Makefile index 7ebc218f669..cd81b3ae113 100644 --- a/jdk/make/java/main/javaw/Makefile +++ b/jdk/make/java/main/javaw/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../../.. +MODULE = base PROGRAM = javaw PRODUCT = java diff --git a/jdk/make/java/management/Makefile b/jdk/make/java/management/Makefile index f579e10c105..17c778e938c 100644 --- a/jdk/make/java/management/Makefile +++ b/jdk/make/java/management/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../.. +MODULE = management PACKAGE = java.lang.management LIBRARY = management PRODUCT = java @@ -99,7 +100,7 @@ $(AGENTJAR): $(LIBDIR) $(TEMPDIR)/manifest @$(java-vm-cleanup) $(TEMPDIR)/manifest: $(MANIFEST) - $(install-file) + $(install-manifest-file) build: $(AGENTJAR) diff --git a/jdk/make/java/net/Makefile b/jdk/make/java/net/Makefile index 3c0985bcf9d..c714d0a61ac 100644 --- a/jdk/make/java/net/Makefile +++ b/jdk/make/java/net/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../.. +MODULE = base PACKAGE = java.net LIBRARY = net PRODUCT = sun @@ -111,8 +112,7 @@ LOCALE_SET_DEFINITION = jre MISC_FILES = $(LIBDIR) $(LIBDIR)/net.properties $(LIBDIR)/net.properties: $(SHARE_SRC)/lib/net.properties - @$(RM) $@ - $(CP) $< $@ + $(install-file) # # SDP configuration template diff --git a/jdk/make/java/nio/FILES_java.gmk b/jdk/make/java/nio/FILES_java.gmk index f3ba8254868..f1f58dc9720 100644 --- a/jdk/make/java/nio/FILES_java.gmk +++ b/jdk/make/java/nio/FILES_java.gmk @@ -26,7 +26,6 @@ FILES_src = \ java/nio/Bits.java \ java/nio/Buffer.java \ - java/nio/BufferPoolMXBean.java \ java/nio/ByteOrder.java \ java/nio/MappedByteBuffer.java \ java/nio/StringCharBuffer.java \ @@ -234,6 +233,7 @@ FILES_src = \ sun/nio/cs/UTF_16BE.java \ sun/nio/cs/UTF_16LE.java \ sun/nio/cs/UTF_8.java \ + sun/nio/cs/Unicode.java \ sun/nio/cs/UnicodeDecoder.java \ sun/nio/cs/UnicodeEncoder.java \ sun/nio/cs/UTF_32.java \ diff --git a/jdk/make/java/nio/Makefile b/jdk/make/java/nio/Makefile index 455d7529f67..b2a17e26991 100644 --- a/jdk/make/java/nio/Makefile +++ b/jdk/make/java/nio/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../.. +MODULE = nio PACKAGE = java.nio LIBRARY = nio PRODUCT = java @@ -303,7 +304,11 @@ endif # PLATFORM # Rules # +SUBDIRS_management = mxbean +include $(BUILDDIR)/common/Subdirs.gmk + build: sources + $(SUBDIRS-loop) clean clobber:: $(RM) -r $(NIO_GEN) $(SNIO_GEN) @@ -816,7 +821,7 @@ SOR_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSOR_SRC) | \ $(NAWK) '/^.*Copyright.*Sun/ { print $$3 }') $(TEMPDIR)/$(GENSOR_SRC) : $(GENSOR_SRC) - $(install-file) + $(install-non-module-file) $(GENSOR_EXE) : $(TEMPDIR)/$(GENSOR_SRC) $(prep-target) diff --git a/jdk/make/java/nio/genBuffer.sh b/jdk/make/java/nio/genBuffer.sh index 27e3f82f0fd..69e86238baa 100644 --- a/jdk/make/java/nio/genBuffer.sh +++ b/jdk/make/java/nio/genBuffer.sh @@ -44,6 +44,7 @@ rwkey=XX case $type in char) fulltype=character;; + int) fulltype=integer;; *) fulltype=$type;; esac @@ -54,6 +55,11 @@ case $type in long | double) LBPV=3;; esac +case $type in + float|double) floatingPointOrIntegralType=floatingPointType;; + *) floatingPointOrIntegralType=integralType;; +esac + typesAndBits() { type="$1"; BO="$2" @@ -101,6 +107,7 @@ set -e $SPP <$SRC >$DST \ -K$type \ + -K$floatingPointOrIntegralType \ -Dtype=$type \ -DType=$Type \ -Dfulltype=$fulltype \ diff --git a/jdk/make/java/nio/mxbean/Makefile b/jdk/make/java/nio/mxbean/Makefile new file mode 100644 index 00000000000..383d4dc18c5 --- /dev/null +++ b/jdk/make/java/nio/mxbean/Makefile @@ -0,0 +1,34 @@ +# +# Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +BUILDDIR = ../../.. +MODULE = management +PACKAGE = java.nio +PRODUCT = java +include $(BUILDDIR)/common/Defs.gmk + +FILES_java = java/nio/BufferPoolMXBean.java + +include $(BUILDDIR)/common/Classes.gmk diff --git a/jdk/make/java/npt/Makefile b/jdk/make/java/npt/Makefile index 57e6a663805..77afce633dd 100644 --- a/jdk/make/java/npt/Makefile +++ b/jdk/make/java/npt/Makefile @@ -24,6 +24,9 @@ # BUILDDIR = ../.. + +# It's currently used by jpda and hprof. Put it in base module for now. +MODULE = base LIBRARY = npt PRODUCT = sun LIBRARY_OUTPUT = npt diff --git a/jdk/make/java/redist/Makefile b/jdk/make/java/redist/Makefile index 69d95a60577..28821008ab6 100644 --- a/jdk/make/java/redist/Makefile +++ b/jdk/make/java/redist/Makefile @@ -35,6 +35,7 @@ # BUILDDIR = ../.. +MODULE = base PRODUCT = java include $(BUILDDIR)/common/Defs.gmk @@ -61,7 +62,14 @@ CLASSSHARINGDATA_DIR = $(BUILDDIR)/tools/sharing # Needed to do file copy ABS_BUILDDIR :=$(call FullPath,$(BUILDDIR)) -all: build +SUBDIRS_desktop = fonts +SUBDIRS_tools = sajdi +include $(BUILDDIR)/common/Subdirs.gmk + +all clean clobber:: + $(SUBDIRS-loop) + +all:: build # List of files created here or coming from BUILDDIR area (this workspace) INTERNAL_IMPORT_LIST = $(LIBDIR)/classlist @@ -70,30 +78,6 @@ INTERNAL_IMPORT_LIST = $(LIBDIR)/classlist IMPORT_LIST = $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME) \ $(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt -# INCLUDE_SA is false on platforms where SA is not supported. -# On platforms where it is supported, we want to allow it to -# not be present, at least temporarily. So, -# if the SA files (well, just sa-jdi.jar) do not exist -# in the HOTSPOT_IMPORT_PATH, then we won't build SA. -SA_EXISTS := $(shell if [ -r $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar ] ; then \ - $(ECHO) true; \ - else \ - $(ECHO) false; \ - fi) - -ifeq ($(SA_EXISTS), false) - INCLUDE_SA := false -endif - -ifeq ($(INCLUDE_SA), true) - IMPORT_LIST += $(LIBDIR)/sa-jdi.jar \ - $(LIB_LOCATION)/$(SALIB_NAME) - ifeq ($(PLATFORM), windows) - IMPORT_LIST += $(LIB_LOCATION)/$(SAMAP_NAME) \ - $(LIB_LOCATION)/$(SAPDB_NAME) - endif -endif # INCLUDE_SA - # Hotspot client is only available on 32-bit non-Zero builds ifneq ($(ZERO_BUILD), true) ifeq ($(ARCH_DATA_MODEL), 32) @@ -110,10 +94,10 @@ IMPORT_LIST += $(MS_RUNTIME_LIBRARIES:%=$(BINDIR)/%) # NOTE: These might actually come from BUILDDIR, depends on the settings. $(BINDIR)/msvcrt.dll: $(MSVCRT_DLL_PATH)/msvcrt.dll $(install-import-file) - $(CHMOD) a+x $@ + $(call chmod-file, a+x) $(BINDIR)/$(MSVCRNN_DLL): $(MSVCRNN_DLL_PATH)/$(MSVCRNN_DLL) $(install-import-file) - $(CHMOD) a+x $@ + $(call chmod-file, a+x) # Get the hotspot .map and .pdb files for client and server IMPORT_LIST += \ @@ -140,26 +124,32 @@ $(LIBDIR)/$(JVMLIB_NAME): $(HOTSPOT_LIB_PATH)/$(JVMLIB_NAME) $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMMAP_NAME): @$(prep-target) -$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMMAP_NAME) $@ + @$(install-module-file) $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMMAP_NAME): @$(prep-target) -$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMMAP_NAME) $@ + @$(install-module-file) $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME): @$(prep-target) -$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMMAP_NAME) $@ + @$(install-module-file) $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME): @$(prep-target) -$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMPDB_NAME) $@ + @$(install-module-file) $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVMPDB_NAME): @$(prep-target) -$(CP) $(HOTSPOT_KERNEL_PATH)/$(JVMPDB_NAME) $@ + @$(install-module-file) $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME): @$(prep-target) -$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMPDB_NAME) $@ + @$(install-module-file) # Windows ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Windows else # PLATFORM @@ -220,7 +210,7 @@ $(LIB_LOCATION)/$(LIBJSIG_NAME): $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJ $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME) \ $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME): @$(prep-target) - $(LN) -s ../$(LIBJSIG_NAME) $@ + $(call install-sym-link, ../$(LIBJSIG_NAME)) $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDB_NAME) $(install-import-file) @@ -246,28 +236,6 @@ $(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt : $(HOTSPOT_CLIENT_PATH)/Xusage.tx $(LIB_LOCATION)/$(KERNEL_LOCATION)/Xusage.txt : $(HOTSPOT_KERNEL_PATH)/Xusage.txt $(install-file) -ifeq ($(INCLUDE_SA), true) -# The Serviceability Agent is built in the Hotspot workspace. -# It contains two files: -# - sa-jdi.jar: This goes into the same dir as tools.jar. -# - a shared library: sawindbg.dll on windows / libproc.sa on unix -# This goes into the same dir as the other -# shared libs, eg. libjdwp.so. -$(LIBDIR)/sa-jdi.jar: $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar - $(install-import-file) - -$(LIB_LOCATION)/$(SALIB_NAME): $(HOTSPOT_SALIB_PATH)/$(SALIB_NAME) - $(install-import-file) - -ifeq ($(PLATFORM), windows) -$(LIB_LOCATION)/$(SAPDB_NAME): $(HOTSPOT_SALIB_PATH)/$(SAPDB_NAME) - $(install-import-file) - -$(LIB_LOCATION)/$(SAMAP_NAME): $(HOTSPOT_SALIB_PATH)/$(SAMAP_NAME) - $(install-import-file) -endif # windows -endif # INCLUDE_SA - # # Specific to OpenJDK building # @@ -288,7 +256,7 @@ INTERNAL_IMPORT_LIST += \ $(LIBDIR)/jce.jar: \ $(BUILDDIR)/closed/tools/crypto/jce/jce.jar - $(install-file) + $(install-non-module-file) $(LIBDIR)/security/US_export_policy.jar: \ $(BUILDDIR)/closed/tools/crypto/jce/US_export_policy.jar $(install-file) @@ -310,46 +278,6 @@ $(LIBDIR)/classlist: \ $(CLASSSHARINGDATA_DIR)/classlist.$(PLATFORM) $@.temp $(MV) $@.temp $@ -ifndef OPENJDK - -# Lucida font files are not included in the OpenJDK distribution. -# Get names of font files -include FILES.gmk - -# Copy font files into OUTPUTDIR area - -FONTFILES = $(SHARED_FONTFILES) -FONTSDIR = $(LIBDIR)/fonts -FONTSDIRFILE = $(FONTSDIR)/fonts.dir -INTERNAL_IMPORT_LIST += $(FONTFILES) - -ifneq ($(PLATFORM), windows) - INTERNAL_IMPORT_LIST += $(FONTSDIRFILE) -endif - -$(LIBDIR)/fonts/%.ttf: $(CLOSED_SRC)/share/lib/fonts/%.ttf - $(install-file) - -$(FONTSDIRFILE): $(PLATFORM_SRC)/classes/sun/awt/motif/java.fonts.dir - $(install-file) - -ifeq ($(PLATFORM), linux) - -# The oblique fonts are only needed/wanted on Linux. - -OBLFONTSDIR = $(LIBDIR)/oblique-fonts -OBLFONTSDIRFILE = $(OBLFONTSDIR)/fonts.dir -INTERNAL_IMPORT_LIST += $(OBLIQUE_FONTFILES) $(OBLFONTSDIRFILE) - -$(LIBDIR)/oblique-fonts/%.ttf: $(CLOSED_SRC)/share/lib/fonts/oblique/%.ttf - $(install-file) - -$(OBLFONTSDIRFILE): $(PLATFORM_SRC)/classes/sun/awt/motif/java.oblique-fonts.dir - $(install-file) - -endif # linux -endif # !OPENJDK - # Import internal files (ones that are stashed in this source tree) import_internal_files : $(INTERNAL_IMPORT_LIST) diff --git a/jdk/make/java/redist/FILES.gmk b/jdk/make/java/redist/fonts/Makefile similarity index 65% rename from jdk/make/java/redist/FILES.gmk rename to jdk/make/java/redist/fonts/Makefile index a90da603f4a..263d9b25c0e 100644 --- a/jdk/make/java/redist/FILES.gmk +++ b/jdk/make/java/redist/fonts/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1998-2003 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -23,6 +23,12 @@ # have any questions. # +BUILDDIR = ../../.. +MODULE = font +PRODUCT = java +include $(BUILDDIR)/common/Defs.gmk + + # # List of lucida font files that we redistribute. # @@ -54,3 +60,52 @@ OBLIQUE_FONTFILES = \ $(LIBDIR)/oblique-fonts/LucidaSansDemiOblique.ttf \ endif + +ifndef OPENJDK + +# Lucida font files are not included in the OpenJDK distribution. +# Get names of font files + +# Copy font files into OUTPUTDIR area + +FONTFILES = $(SHARED_FONTFILES) +FONTSDIR = $(LIBDIR)/fonts +FONTSDIRFILE = $(FONTSDIR)/fonts.dir +INTERNAL_IMPORT_LIST = $(FONTFILES) + +ifneq ($(PLATFORM), windows) + INTERNAL_IMPORT_LIST += $(FONTSDIRFILE) +endif + +$(LIBDIR)/fonts/%.ttf: $(CLOSED_SRC)/share/lib/fonts/%.ttf + $(install-file) + +$(FONTSDIRFILE): $(PLATFORM_SRC)/classes/sun/awt/motif/java.fonts.dir + $(install-file) + +ifeq ($(PLATFORM), linux) + +# The oblique fonts are only needed/wanted on Linux. + +OBLFONTSDIR = $(LIBDIR)/oblique-fonts +OBLFONTSDIRFILE = $(OBLFONTSDIR)/fonts.dir +INTERNAL_IMPORT_LIST += $(OBLIQUE_FONTFILES) $(OBLFONTSDIRFILE) + +$(LIBDIR)/oblique-fonts/%.ttf: $(CLOSED_SRC)/share/lib/fonts/oblique/%.ttf + $(install-file) + +$(OBLFONTSDIRFILE): $(PLATFORM_SRC)/classes/sun/awt/motif/java.oblique-fonts.dir + $(install-file) + +endif # linux + +all build : $(INTERNAL_IMPORT_LIST) + +clean clobber:: + $(RM) $(INTERNAL_IMPORT_LIST) + +else + +all build clean clobber : + +endif # !OPENJDK diff --git a/jdk/make/java/redist/sajdi/Makefile b/jdk/make/java/redist/sajdi/Makefile new file mode 100644 index 00000000000..7117763e299 --- /dev/null +++ b/jdk/make/java/redist/sajdi/Makefile @@ -0,0 +1,87 @@ +# +# Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +BUILDDIR = ../../.. +MODULE = sajdi +PRODUCT = java +include $(BUILDDIR)/common/Defs.gmk + +ifeq ($(PLATFORM), windows) + LIB_LOCATION = $(BINDIR) +else + LIB_LOCATION = $(LIBDIR)/$(LIBARCH) +endif + +# INCLUDE_SA is false on platforms where SA is not supported. +# On platforms where it is supported, we want to allow it to +# not be present, at least temporarily. So, +# if the SA files (well, just sa-jdi.jar) do not exist +# in the HOTSPOT_IMPORT_PATH, then we won't build SA. +SA_EXISTS := $(shell if [ -r $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar ] ; then \ + $(ECHO) true; \ + else \ + $(ECHO) false; \ + fi) + +ifeq ($(SA_EXISTS), false) + INCLUDE_SA := false +endif + +IMPORT_LIST = +ifeq ($(INCLUDE_SA), true) + IMPORT_LIST += $(LIBDIR)/sa-jdi.jar \ + $(LIB_LOCATION)/$(SALIB_NAME) + ifeq ($(PLATFORM), windows) + IMPORT_LIST += $(LIB_LOCATION)/$(SAMAP_NAME) \ + $(LIB_LOCATION)/$(SAPDB_NAME) + endif +endif # INCLUDE_SA + + +ifeq ($(INCLUDE_SA), true) +# The Serviceability Agent is built in the Hotspot workspace. +# It contains two files: +# - sa-jdi.jar: This goes into the same dir as tools.jar. +# - a shared library: sawindbg.dll on windows / libproc.sa on unix +# This goes into the same dir as the other +# shared libs, eg. libjdwp.so. +$(LIBDIR)/sa-jdi.jar: $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar + $(install-importonly-file) + +$(LIB_LOCATION)/$(SALIB_NAME): $(HOTSPOT_SALIB_PATH)/$(SALIB_NAME) + $(install-import-file) + +ifeq ($(PLATFORM), windows) +$(LIB_LOCATION)/$(SAPDB_NAME): $(HOTSPOT_SALIB_PATH)/$(SAPDB_NAME) + $(install-import-file) + +$(LIB_LOCATION)/$(SAMAP_NAME): $(HOTSPOT_SALIB_PATH)/$(SAMAP_NAME) + $(install-import-file) +endif # windows +endif # INCLUDE_SA + +all: $(IMPORT_LIST) + +clean clobber:: diff --git a/jdk/make/java/security/Makefile b/jdk/make/java/security/Makefile index 5da905a698d..8228eea85db 100644 --- a/jdk/make/java/security/Makefile +++ b/jdk/make/java/security/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../.. +MODULE = base PACKAGE = java.security PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk @@ -38,11 +39,9 @@ AUTO_FILES_JAVA_DIRS = java/security # PROPS_SRC = $(TOPDIR)/src/share/lib/security/java.security -SUNPKCS11 = ifeq ($(PLATFORM), solaris) PROPS_SRC = $(TOPDIR)/src/share/lib/security/java.security-solaris -SUNPKCS11 = sunpkcs11 else # PLATFORM @@ -57,9 +56,6 @@ endif # PLATFORM PROPS_BUILD = $(LIBDIR)/security/java.security -SUNPKCS11_SRC = $(TOPDIR)/src/share/lib/security/sunpkcs11-solaris.cfg -SUNPKCS11_BUILD = $(LIBDIR)/security/sunpkcs11-solaris.cfg - POLICY_SRC = $(TOPDIR)/src/share/lib/security/java.policy POLICY_BUILD = $(LIBDIR)/security/java.policy @@ -73,14 +69,12 @@ FILES_class = $(FILES_java:%.java=$(CLASSBINDIR)/%.class) # include $(BUILDDIR)/common/Rules.gmk -build: properties $(SUNPKCS11) policy cacerts +build: properties policy cacerts install: all properties: classes $(PROPS_BUILD) -sunpkcs11: classes $(SUNPKCS11_BUILD) - policy: classes $(POLICY_BUILD) cacerts: classes $(CACERTS_BUILD) @@ -88,9 +82,6 @@ cacerts: classes $(CACERTS_BUILD) $(PROPS_BUILD): $(PROPS_SRC) $(install-file) -$(SUNPKCS11_BUILD): $(SUNPKCS11_SRC) - $(install-file) - $(POLICY_BUILD): $(POLICY_SRC) $(install-file) @@ -99,7 +90,7 @@ $(CACERTS_BUILD): $(CACERTS_SRC) clean clobber:: .delete.classlist $(RM) -r $(CLASSBINDIR)/java/security - $(RM) $(PROPS_BUILD) $(POLICY_BUILD) $(CACERTS_BUILD) $(SUNPKCS11_BUILD) + $(RM) $(PROPS_BUILD) $(POLICY_BUILD) $(CACERTS_BUILD) # Additional Rule for building sun.security.util $(CLASSBINDIR)/%.class: $(SHARE_SRC)/sun/%.java diff --git a/jdk/make/java/sql/Makefile b/jdk/make/java/sql/Makefile index 61e8047227b..62ce4b726e6 100644 --- a/jdk/make/java/sql/Makefile +++ b/jdk/make/java/sql/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../.. +MODULE = jdbc-base PACKAGE = java.sql PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/java/sun_nio/Makefile b/jdk/make/java/sun_nio/Makefile index bf316dfb3e2..23f07f13102 100644 --- a/jdk/make/java/sun_nio/Makefile +++ b/jdk/make/java/sun_nio/Makefile @@ -31,7 +31,7 @@ BUILDDIR = ../.. PACKAGE = sun.nio PRODUCT = sun -OTHER_JAVACFLAGS += -Xlint:serial -Werror +OTHER_JAVACFLAGS += -Xlint:serial,-deprecation -Werror include $(BUILDDIR)/common/Defs.gmk # diff --git a/jdk/make/java/text/Makefile b/jdk/make/java/text/Makefile index 4db338926f3..4bda138f676 100644 --- a/jdk/make/java/text/Makefile +++ b/jdk/make/java/text/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1996-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -23,86 +23,19 @@ # have any questions. # +# +# Makefile for building all of java.text +# + BUILDDIR = ../.. - -PACKAGE = java.text PRODUCT = sun - include $(BUILDDIR)/common/Defs.gmk -# -# Files -# -include FILES_java.gmk +SUBDIRS = base +SUBDIRS_desktop = bidi -# -# Include -# -include $(BUILDDIR)/common/Classes.gmk +include $(BUILDDIR)/common/Subdirs.gmk -# -# Rules to add data files BreakIterator -# -TEXT_CLASSES = $(BUILDTOOLCLASSDIR)/java.text/classes - -# input -# -# Notes: sun.text.resources.BreakIteratorRules no longer goes to runtime. -# They are used at JDK build phase in order to create $(BIFILES) which -# are used on runtime instead. -# -TEXT_SRCDIR = $(SHARE_SRC)/classes/sun/text/resources -TEXT_SOURCES = $(TEXT_SRCDIR)/BreakIteratorRules.java \ - $(TEXT_SRCDIR)/BreakIteratorInfo.java -UNICODEDATA = $(BUILDDIR)/tools/UnicodeData - -# output -TEXT_CLASSDIR = $(CLASSBINDIR)/sun/text/resources -BIFILES = $(TEXT_CLASSDIR)/CharacterBreakIteratorData \ - $(TEXT_CLASSDIR)/WordBreakIteratorData \ - $(TEXT_CLASSDIR)/LineBreakIteratorData \ - $(TEXT_CLASSDIR)/SentenceBreakIteratorData - -ICU_FILES = $(TEXT_CLASSDIR)/unorm.icu \ - $(TEXT_CLASSDIR)/uprops.icu \ - $(TEXT_CLASSDIR)/ubidi.icu - -# builder -GENERATEBREAKITERATORDATA_JARFILE = \ - $(BUILDTOOLJARDIR)/generatebreakiteratordata.jar - -$(BIFILES): $(GENERATEBREAKITERATORDATA_JARFILE) \ - $(UNICODEDATA)/UnicodeData.txt \ - $(TEXT_SOURCES) - $(prep-target) - $(RM) -r $(TEXT_CLASSES) - $(MKDIR) -p $(TEXT_CLASSES) - $(BOOT_JAVAC_CMD) -d $(TEXT_CLASSES) \ - -sourcepath $(TEXT_SRCDIR) \ - $(TEXT_SOURCES) - $(MKDIR) -p $(TEXT_CLASSDIR) - $(BOOT_JAVA_CMD) -Xbootclasspath/p:$(TEXT_CLASSES) \ - -jar $(GENERATEBREAKITERATORDATA_JARFILE) \ - -o $(TEXT_CLASSDIR) \ - -spec $(UNICODEDATA)/UnicodeData.txt - @$(java-vm-cleanup) - -build: $(BIFILES) $(ICU_FILES) - -# -# Extra rules to copy unorm.icu, uprops.icu, and ubidi.icu -# -$(TEXT_CLASSDIR)/unorm.icu: $(TEXT_SRCDIR)/unorm.icu - $(install-file) - -$(TEXT_CLASSDIR)/uprops.icu: $(TEXT_SRCDIR)/uprops.icu - $(install-file) - -$(TEXT_CLASSDIR)/ubidi.icu: $(TEXT_SRCDIR)/ubidi.icu - $(install-file) - -clean clobber:: - $(RM) -r $(TEXT_CLASSES) - $(RM) -r $(BIFILES) - $(RM) $(ICU_FILES) +all build clean clobber:: + $(SUBDIRS-loop) diff --git a/jdk/make/java/text/FILES_java.gmk b/jdk/make/java/text/base/FILES_java.gmk similarity index 98% rename from jdk/make/java/text/FILES_java.gmk rename to jdk/make/java/text/base/FILES_java.gmk index ada9bde7fee..6ca1f72c5b8 100644 --- a/jdk/make/java/text/FILES_java.gmk +++ b/jdk/make/java/text/base/FILES_java.gmk @@ -29,7 +29,6 @@ FILES_java = \ java/text/AttributedString.java \ java/text/BreakDictionary.java \ java/text/BreakIterator.java \ - java/text/Bidi.java \ java/text/CharacterIterator.java \ java/text/CharacterIteratorFieldDelegate.java \ java/text/ChoiceFormat.java \ @@ -76,10 +75,6 @@ FILES_java = \ sun/text/Normalizer.java \ sun/text/SupplementaryCharacterData.java \ sun/text/UCompactIntArray.java \ - sun/text/bidi/BidiBase.java \ - sun/text/bidi/BidiLine.java \ - sun/text/bidi/BidiRun.java \ - \ sun/text/normalizer/CharTrie.java \ sun/text/normalizer/CharacterIteratorWrapper.java \ sun/text/normalizer/ICUBinary.java \ diff --git a/jdk/make/java/text/base/Makefile b/jdk/make/java/text/base/Makefile new file mode 100644 index 00000000000..d4cc5164a1f --- /dev/null +++ b/jdk/make/java/text/base/Makefile @@ -0,0 +1,108 @@ +# +# Copyright 1996-2006 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +BUILDDIR = ../../.. +MODULE = base +PACKAGE = java.text +PRODUCT = sun + +include $(BUILDDIR)/common/Defs.gmk + +# +# Files +# +include FILES_java.gmk + +# +# Include +# +include $(BUILDDIR)/common/Classes.gmk + +# +# Rules to add data files BreakIterator +# +TEXT_CLASSES = $(BUILDTOOLCLASSDIR)/java.text/classes + +# input +# +# Notes: sun.text.resources.BreakIteratorRules no longer goes to runtime. +# They are used at JDK build phase in order to create $(BIFILES) which +# are used on runtime instead. +# +TEXT_SRCDIR = $(SHARE_SRC)/classes/sun/text/resources +TEXT_SOURCES = $(TEXT_SRCDIR)/BreakIteratorRules.java \ + $(TEXT_SRCDIR)/BreakIteratorInfo.java +UNICODEDATA = $(BUILDDIR)/tools/UnicodeData + +# output +TEXT_CLASSDIR = $(CLASSBINDIR)/sun/text/resources +BIFILES = $(TEXT_CLASSDIR)/CharacterBreakIteratorData \ + $(TEXT_CLASSDIR)/WordBreakIteratorData \ + $(TEXT_CLASSDIR)/LineBreakIteratorData \ + $(TEXT_CLASSDIR)/SentenceBreakIteratorData + +ICU_FILES = $(TEXT_CLASSDIR)/unorm.icu \ + $(TEXT_CLASSDIR)/uprops.icu \ + $(TEXT_CLASSDIR)/ubidi.icu + +# builder +GENERATEBREAKITERATORDATA_JARFILE = \ + $(BUILDTOOLJARDIR)/generatebreakiteratordata.jar + +$(BIFILES): $(GENERATEBREAKITERATORDATA_JARFILE) \ + $(UNICODEDATA)/UnicodeData.txt \ + $(TEXT_SOURCES) + $(prep-target) + $(RM) -r $(TEXT_CLASSES) + $(MKDIR) -p $(TEXT_CLASSES) + $(BOOT_JAVAC_CMD) -d $(TEXT_CLASSES) \ + -sourcepath $(TEXT_SRCDIR) \ + $(TEXT_SOURCES) + $(MKDIR) -p $(TEXT_CLASSDIR) + $(BOOT_JAVA_CMD) -Xbootclasspath/p:$(TEXT_CLASSES) \ + -jar $(GENERATEBREAKITERATORDATA_JARFILE) \ + -o $(TEXT_CLASSDIR) \ + -spec $(UNICODEDATA)/UnicodeData.txt + @$(java-vm-cleanup) + +build: $(BIFILES) $(ICU_FILES) + +# +# Extra rules to copy unorm.icu, uprops.icu, and ubidi.icu +# +$(TEXT_CLASSDIR)/unorm.icu: $(TEXT_SRCDIR)/unorm.icu + $(install-file) + +$(TEXT_CLASSDIR)/uprops.icu: $(TEXT_SRCDIR)/uprops.icu + $(install-file) + +$(TEXT_CLASSDIR)/ubidi.icu: $(TEXT_SRCDIR)/ubidi.icu + $(install-file) + +clean clobber:: + $(RM) -r $(TEXT_CLASSES) + $(RM) -r $(BIFILES) + $(RM) $(ICU_FILES) + diff --git a/jdk/make/java/text/bidi/Makefile b/jdk/make/java/text/bidi/Makefile new file mode 100644 index 00000000000..e61c5335340 --- /dev/null +++ b/jdk/make/java/text/bidi/Makefile @@ -0,0 +1,44 @@ +# +# Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +BUILDDIR = ../../.. +PACKAGE = java.text +PRODUCT = sun +include $(BUILDDIR)/common/Defs.gmk + +# +# Files for Bidi that is not in the base module +# +FILES_java = \ + java/text/Bidi.java \ + sun/text/bidi/BidiBase.java \ + sun/text/bidi/BidiLine.java \ + sun/text/bidi/BidiRun.java \ + sun/text/CodePointIterator.java + +# +# Include +# +include $(BUILDDIR)/common/Classes.gmk diff --git a/jdk/make/java/verify/Makefile b/jdk/make/java/verify/Makefile index 24bcc0f48d4..783dd2c55c7 100644 --- a/jdk/make/java/verify/Makefile +++ b/jdk/make/java/verify/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../.. +MODULE = base PRODUCT = java LIBRARY = verify include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/java/zip/Makefile b/jdk/make/java/zip/Makefile index cec9d0d6cf1..809753050e1 100644 --- a/jdk/make/java/zip/Makefile +++ b/jdk/make/java/zip/Makefile @@ -25,6 +25,7 @@ BUILDDIR = ../.. +MODULE = base PACKAGE = java.util.zip LIBRARY = zip PRODUCT = sun diff --git a/jdk/make/javax/Makefile b/jdk/make/javax/Makefile index 8ec72ade7e1..15f5cd7ecb2 100644 --- a/jdk/make/javax/Makefile +++ b/jdk/make/javax/Makefile @@ -30,19 +30,24 @@ BUILDDIR = .. include $(BUILDDIR)/common/Defs.gmk -# imageio uses xml, so build it last +SUBDIRS = others -SUBDIRS = \ - others \ - accessibility \ - print \ - swing \ - crypto \ - sound \ - sql \ - rmi \ - management \ - imageio +SUBDIRS_management = management + +SUBDIRS_misc = \ + crypto \ + sql \ + rmi + +# imageio uses xml, so build it last +SUBDIRS_desktop = \ + accessibility \ + print \ + swing \ + sound \ + imageio + +include $(BUILDDIR)/common/Subdirs.gmk all build: $(SUBDIRS-loop) diff --git a/jdk/make/javax/crypto/Makefile b/jdk/make/javax/crypto/Makefile index fe07ed5edf7..19a00a5e197 100644 --- a/jdk/make/javax/crypto/Makefile +++ b/jdk/make/javax/crypto/Makefile @@ -108,6 +108,7 @@ # BUILDDIR = ../.. +MODULE = base PACKAGE = javax.crypto PRODUCT = sun @@ -293,7 +294,7 @@ limited: \ $(UNSIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar: \ $(UNSIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar - $(install-file) + $(install-non-module-file) $(UNSIGNED_POLICY_BUILDDIR)/limited/local_policy.jar: \ policy/limited/default_local.policy \ @@ -414,7 +415,7 @@ $(JAR_DESTFILE): $(UNSIGNED_DIR)/jce.jar else $(JAR_DESTFILE): $(SIGNED_DIR)/jce.jar endif - $(install-file) + $(install-non-module-file) # # Install the appropriate policy file, depending on the type of build. @@ -425,7 +426,7 @@ else INSTALL_POLICYDIR = $(SIGNED_POLICY_BUILDDIR) endif -install-limited: \ +install-limited-jars: \ $(INSTALL_POLICYDIR)/limited/US_export_policy.jar \ $(INSTALL_POLICYDIR)/limited/local_policy.jar $(MKDIR) -p $(POLICY_DESTDIR) @@ -433,24 +434,28 @@ install-limited: \ $(POLICY_DESTDIR)/US_export_policy.jar \ $(POLICY_DESTDIR)/local_policy.jar $(CP) $^ $(POLICY_DESTDIR) + +install-limited: install-limited-jars install-module-files ifndef OPENJDK $(release-warning) endif -install-unlimited: \ +install-unlimited-jars: \ $(INSTALL_POLICYDIR)/unlimited/US_export_policy.jar \ - $(INSTALL_POLICYDIR)/unlimited/local_policy.jar + $(INSTALL_POLICYDIR)/unlimited/local_policy.jar $(MKDIR) -p $(POLICY_DESTDIR) $(RM) \ $(POLICY_DESTDIR)/US_export_policy.jar \ $(POLICY_DESTDIR)/local_policy.jar $(CP) $^ $(POLICY_DESTDIR) + +install-unlimited: install-unlimited-jars install-module-files ifndef OPENJDK $(release-warning) endif ifndef OPENJDK -install-prebuilt: +install-prebuilt-jars: @$(ECHO) "\n>>>Installing prebuilt JCE framework..." $(RM) $(JAR_DESTFILE) \ $(POLICY_DESTDIR)/US_export_policy.jar \ @@ -460,8 +465,16 @@ install-prebuilt: $(PREBUILT_DIR)/jce/US_export_policy.jar \ $(PREBUILT_DIR)/jce/local_policy.jar \ $(POLICY_DESTDIR) + +install-prebuilt: install-prebuilt-jars install-module-files endif +install-module-files: \ + $(POLICY_DESTDIR)/US_export_policy.jar \ + $(POLICY_DESTDIR)/local_policy.jar + +$(POLICY_DESTDIR)/%.jar : + $(install-module-file) # ===================================================== # Support routines. diff --git a/jdk/make/javax/imageio/Makefile b/jdk/make/javax/imageio/Makefile index b3f75d18181..62f3b1b65ed 100644 --- a/jdk/make/javax/imageio/Makefile +++ b/jdk/make/javax/imageio/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../.. +MODULE = imageio PACKAGE = javax.imageio PRODUCT = jiio include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/javax/print/Makefile b/jdk/make/javax/print/Makefile index b3652f8368e..639dc148556 100644 --- a/jdk/make/javax/print/Makefile +++ b/jdk/make/javax/print/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../.. +MODULE = print PACKAGE = javax.print PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/javax/rmi/Makefile b/jdk/make/javax/rmi/Makefile index 10910f5d213..49f6c817900 100644 --- a/jdk/make/javax/rmi/Makefile +++ b/jdk/make/javax/rmi/Makefile @@ -31,6 +31,8 @@ BUILDDIR = ../.. include $(BUILDDIR)/common/Defs.gmk SUBDIRS = ssl +include $(BUILDDIR)/common/Subdirs.gmk + all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/javax/sound/Makefile b/jdk/make/javax/sound/Makefile index 5572e637b7c..cc6c274e785 100644 --- a/jdk/make/javax/sound/Makefile +++ b/jdk/make/javax/sound/Makefile @@ -26,6 +26,7 @@ # WARNING: Make sure the OPENJDK plugs are up-to-date, see make/common/internal/BinaryPlugs.gmk BUILDDIR = ../.. +MODULE = sound PACKAGE = javax.sound LIBRARY = jsound PRODUCT = sun @@ -108,22 +109,14 @@ ifeq ($(PLATFORM), linux) endif # PLATFORM linux ifeq ($(PLATFORM), solaris) - ifneq ($(ARCH), amd64) - # build with ports and direct audio - CPPFLAGS += -DUSE_PORTS=TRUE \ - -DUSE_DAUDIO=TRUE + # build with ports and direct audio + CPPFLAGS += -DUSE_PORTS=TRUE \ + -DUSE_DAUDIO=TRUE - INCLUDE_PORTS = TRUE - INCLUDE_DAUDIO = TRUE - INCLUDE_MIDI = TRUE - else - # build with empty MIDI i/o - INCLUDE_MIDI = TRUE - # build with empty ports - INCLUDE_PORTS = TRUE - # build with empty direct audio - INCLUDE_DAUDIO = TRUE - endif + INCLUDE_PORTS = TRUE + INCLUDE_DAUDIO = TRUE + # build with empty MIDI i/o + INCLUDE_MIDI = TRUE endif # PLATFORM solaris # for dynamic inclusion of extra sound libs: these @@ -166,6 +159,7 @@ vpath %.cpp $(PLATFORM_SRC)/native/com/sun/media/sound # Include rules # include $(BUILDDIR)/common/Library.gmk +include $(BUILDDIR)/common/Subdirs.gmk # # Rules that copy files. diff --git a/jdk/make/javax/sound/jsoundalsa/Makefile b/jdk/make/javax/sound/jsoundalsa/Makefile index 6fdde65ee5c..15b215fe6b2 100644 --- a/jdk/make/javax/sound/jsoundalsa/Makefile +++ b/jdk/make/javax/sound/jsoundalsa/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../../.. +MODULE = sound PACKAGE = javax.sound LIBRARY = jsoundalsa PRODUCT = sun diff --git a/jdk/make/javax/sound/jsoundds/Makefile b/jdk/make/javax/sound/jsoundds/Makefile index 5dcd336c935..5da3ee7bf77 100644 --- a/jdk/make/javax/sound/jsoundds/Makefile +++ b/jdk/make/javax/sound/jsoundds/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../../.. +MODULE = sound PACKAGE = javax.sound LIBRARY = jsoundds PRODUCT = sun diff --git a/jdk/make/javax/sql/Makefile b/jdk/make/javax/sql/Makefile index 9edaff36f5c..deac8ea2399 100644 --- a/jdk/make/javax/sql/Makefile +++ b/jdk/make/javax/sql/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../.. +MODULE = jdbc-enterprise PACKAGE = javax.sql PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/javax/swing/Makefile b/jdk/make/javax/swing/Makefile index 1f3fa6c0f39..7331426a075 100644 --- a/jdk/make/javax/swing/Makefile +++ b/jdk/make/javax/swing/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../.. +MODULE = swing PACKAGE = javax.swing PRODUCT = com SWING_SRC = $(SHARE_SRC)/classes/javax/swing @@ -39,6 +40,7 @@ AUTO_JAVA_PRUNE = plaf SUBDIRS = html32dtd plaf include $(BUILDDIR)/common/Classes.gmk +include $(BUILDDIR)/common/Subdirs.gmk build: other_files $(SUBDIRS-loop) diff --git a/jdk/make/javax/swing/beaninfo/SwingBeans.gmk b/jdk/make/javax/swing/beaninfo/SwingBeans.gmk index 20a716e0742..61fcf0b79a9 100644 --- a/jdk/make/javax/swing/beaninfo/SwingBeans.gmk +++ b/jdk/make/javax/swing/beaninfo/SwingBeans.gmk @@ -25,7 +25,7 @@ # # Makefile to build the BeanInfo generation tool (ie, a doclet), and -# then the beaninfo itself. Swing versions prior to 1.2 is no longer +# then the beaninfo itself. Swing versions prior to 1.2 are no longer # built. # # This makefile could be a lot simpler if we made it more regular. @@ -44,13 +44,12 @@ swing-1.2-beans-debug: $(MAKE) DEBUG_FLAG=true make-swing-beans -LOCAL_JAVADOC = $(JAVADOC_CMD) $(JAVADOCFLAGS) # get the absolute path to the jar command. PREFIX = 1.2 -JAVADOCFLAGS = $(NO_PROPRIETARY_API_WARNINGS) $(LANGUAGE_VERSION) +JAVADOCFLAGS += $(NO_PROPRIETARY_API_WARNINGS) $(LANGUAGE_VERSION) SWINGPKG = javax/swing LOCAL_JAVAC_FLAGS = $(OTHER_JAVACFLAGS) -# since LOCAL_JAVADOC runs on ALT_BOOTDIR, the doclet and all its classes must be compiled to match +# since JAVADOC_CMD runs on ALT_BOOTDIR, the doclet and all its classes must be compiled to match DOCLET_JAVAC_FLAGS = -source 6 -target 6 include FILES.gmk @@ -114,7 +113,7 @@ mkbeaninfo: $(BEANSRCDIR) .delete.beanlist $(FILES_beans) .javadoc.beanlist .javadoc.beanlist: if [ -s $(TEMPDIR)/.beans.list ]; \ - then $(LOCAL_JAVADOC) $(DOCLETFLAGS) -x $(DEBUG_FLAG) -d $(BEANSRCDIR) -t $(DOCLETSRC)/SwingBeanInfo.template -docletpath $(DOCLETDST) \ + then $(JAVADOC_CMD) $(DOCLETFLAGS) -x $(DEBUG_FLAG) -d $(BEANSRCDIR) -t $(DOCLETSRC)/SwingBeanInfo.template -docletpath $(DOCLETDST) \ $(shell if [ -s $(TEMPDIR)/.beans.list ]; then $(CAT) $(TEMPDIR)/.beans.list; fi); \ fi @$(java-vm-cleanup) diff --git a/jdk/make/javax/swing/plaf/Makefile b/jdk/make/javax/swing/plaf/Makefile index c0c5ebecc70..2ef72c8b4c1 100644 --- a/jdk/make/javax/swing/plaf/Makefile +++ b/jdk/make/javax/swing/plaf/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../../.. +MODULE = swing PACKAGE = javax.swing.plaf PRODUCT = com SWING_SRC = $(SHARE_SRC)/classes/javax/swing diff --git a/jdk/make/jpda/Makefile b/jdk/make/jpda/Makefile index b2567882efa..857952b24bc 100644 --- a/jdk/make/jpda/Makefile +++ b/jdk/make/jpda/Makefile @@ -35,6 +35,7 @@ include $(BUILDDIR)/common/Defs.gmk # Core. # SUBDIRS = jdwp back front transport expr tty bdi gui +include $(BUILDDIR)/common/Subdirs.gmk all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/jpda/back/Makefile b/jdk/make/jpda/back/Makefile index 5237d9c798c..e2e073f31a6 100644 --- a/jdk/make/jpda/back/Makefile +++ b/jdk/make/jpda/back/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../.. +MODULE = debugging LIBRARY = jdwp PRODUCT = jpda diff --git a/jdk/make/jpda/transport/Makefile b/jdk/make/jpda/transport/Makefile index 8e507eab596..dddc0dbc84f 100644 --- a/jdk/make/jpda/transport/Makefile +++ b/jdk/make/jpda/transport/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../.. +MODULE = debugging PRODUCT = jpda include $(BUILDDIR)/common/Defs.gmk @@ -35,6 +36,8 @@ SUBDIRS = socket ifeq ($(PLATFORM), windows) SUBDIRS += shmem endif # PLATFORM + +include $(BUILDDIR)/common/Subdirs.gmk all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/jpda/transport/shmem/Makefile b/jdk/make/jpda/transport/shmem/Makefile index fcc8c632de4..36d1d7fe861 100644 --- a/jdk/make/jpda/transport/shmem/Makefile +++ b/jdk/make/jpda/transport/shmem/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../../.. +MODULE = debugging LIBRARY = dt_shmem PRODUCT = jbug diff --git a/jdk/make/jpda/transport/socket/Makefile b/jdk/make/jpda/transport/socket/Makefile index 65f8018477f..d48d0327524 100644 --- a/jdk/make/jpda/transport/socket/Makefile +++ b/jdk/make/jpda/transport/socket/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../../.. +MODULE = debugging LIBRARY = dt_socket PRODUCT = jbug diff --git a/jdk/make/jpda/tty/Makefile b/jdk/make/jpda/tty/Makefile index 4468bddbeb3..1706aba1641 100644 --- a/jdk/make/jpda/tty/Makefile +++ b/jdk/make/jpda/tty/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../.. +MODULE = jdb PACKAGE = com.sun.tools.example.debug.tty PRODUCT = jpda PROGRAM = jdb diff --git a/jdk/make/launchers/Makefile b/jdk/make/launchers/Makefile index e9f949c1b28..c9d32b9d207 100644 --- a/jdk/make/launchers/Makefile +++ b/jdk/make/launchers/Makefile @@ -28,33 +28,23 @@ # BUILDDIR = .. +MODULE = tools PACKAGE = launchers PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk -# Run MAKE $@ for a launcher: +# Run MAKE $@ for a launcher for the corba module: # $(call make-launcher, name, mainclass, java-args, main-args) -define make-launcher +define make-corba-launcher +$(CD) $(BUILDDIR)/launchers && \ $(MAKE) -f Makefile.launcher \ - PROGRAM=$(strip $1) \ - MAIN_CLASS=$(strip $2) \ - MAIN_JAVA_ARGS="$(strip $3)" \ - MAIN_ARGS="$(strip $4)" $@ + MODULE=corba \ + PROGRAM=$(strip $1) \ + MAIN_CLASS=$(strip $2) \ + MAIN_JAVA_ARGS="$(strip $3)" \ + MAIN_ARGS="$(strip $4)" endef -# Run MAKE $@ for all launchers -ifeq ($(PLATFORM),windows) -# Run MAKE $@ for all platform specific launchers -define make-platform-specific-launchers -$(call make-launcher, kinit, sun.security.krb5.internal.tools.Kinit, , ) -$(call make-launcher, klist, sun.security.krb5.internal.tools.Klist, , ) -$(call make-launcher, ktab, sun.security.krb5.internal.tools.Ktab, , ) -endef -else -# Run MAKE $@ for all platform specific launchers -define make-platform-specific-launchers -endef -endif # Run MAKE $@ for all generic launchers define make-all-launchers $(call make-launcher, appletviewer, sun.applet.Main, , ) @@ -85,36 +75,29 @@ $(call make-launcher, jstack, sun.tools.jstack.JStack, \ -J-Dsun.jvm.hotspot.debugger.useWindbgDebugger, ) $(call make-launcher, jstat, sun.tools.jstat.Jstat, , ) $(call make-launcher, jstatd, sun.tools.jstatd.Jstatd, , ) -$(call make-launcher, keytool, sun.security.tools.KeyTool, , ) $(call make-launcher, native2ascii, sun.tools.native2ascii.Main, , ) -$(call make-launcher, orbd, com.sun.corba.se.impl.activation.ORBD, \ +$(call make-launcher, rmic, sun.rmi.rmic.Main, , ) +$(call make-launcher, schemagen, com.sun.tools.internal.jxc.SchemaGenerator, , ) +$(call make-launcher, serialver, sun.tools.serialver.SerialVer, , ) +$(call make-launcher, xjc, com.sun.tools.internal.xjc.Driver, , ) +$(call make-launcher, wsgen, com.sun.tools.internal.ws.WsGen, , ) +$(call make-launcher, wsimport, com.sun.tools.internal.ws.WsImport, , ) +$(call make-corba-launcher, orbd, com.sun.corba.se.impl.activation.ORBD, \ -J-Dcom.sun.CORBA.activation.DbDir=./orb.db \ -J-Dcom.sun.CORBA.activation.Port=1049 \ -J-Dcom.sun.CORBA.POA.ORBServerId=1, ) -$(call make-launcher, pack200, com.sun.java.util.jar.pack.Driver, , --pack) -$(call make-launcher, policytool, sun.security.tools.PolicyTool, , ) -$(call make-launcher, rmic, sun.rmi.rmic.Main, , ) -$(call make-launcher, rmid, sun.rmi.server.Activation, , ) -$(call make-launcher, rmiregistry, sun.rmi.registry.RegistryImpl, , ) -$(call make-launcher, schemagen, com.sun.tools.internal.jxc.SchemaGenerator, , ) -$(call make-launcher, serialver, sun.tools.serialver.SerialVer, , ) -$(call make-launcher, servertool, com.sun.corba.se.impl.activation.ServerTool, , ) -$(call make-launcher, tnameserv, com.sun.corba.se.impl.naming.cosnaming.TransientNameServer, \ +$(call make-corba-launcher, servertool, com.sun.corba.se.impl.activation.ServerTool, , ) +$(call make-corba-launcher, tnameserv, com.sun.corba.se.impl.naming.cosnaming.TransientNameServer, \ -J-Dcom.sun.CORBA.activation.DbDir=./orb.db \ -J-Djava.util.logging.LoggingPermission=contol \ -J-Dcom.sun.CORBA.POA.ORBServerId=1, ) -$(call make-launcher, wsgen, com.sun.tools.internal.ws.WsGen, , ) -$(call make-launcher, wsimport, com.sun.tools.internal.ws.WsImport, , ) -$(call make-launcher, xjc, com.sun.tools.internal.xjc.Driver, , ) endef build: $(make-all-launchers) - $(make-platform-specific-launchers) clean clobber:: $(make-all-launchers) - $(make-platform-specific-launchers) include $(BUILDDIR)/common/Rules.gmk diff --git a/jdk/make/mkdemo/Makefile b/jdk/make/mkdemo/Makefile index b0bd7f5902d..86e9de6a030 100644 --- a/jdk/make/mkdemo/Makefile +++ b/jdk/make/mkdemo/Makefile @@ -31,7 +31,13 @@ BUILDDIR = .. PRODUCT = demos include $(BUILDDIR)/common/Defs.gmk -SUBDIRS = applets jfc jvmti management jni scripting jpda +SUBDIRS = jni +SUBDIRS_desktop = applets jfc +SUBDIRS_management = management +SUBDIRS_misc = scripting +SUBDIRS_tools = jpda jvmti + +include $(BUILDDIR)/common/Subdirs.gmk all build:: nbproject $(SUBDIRS-loop) diff --git a/jdk/make/mkdemo/applets/Makefile b/jdk/make/mkdemo/applets/Makefile index f8000bfdc7c..79e0a9d2bb9 100644 --- a/jdk/make/mkdemo/applets/Makefile +++ b/jdk/make/mkdemo/applets/Makefile @@ -40,6 +40,7 @@ endif SUBDIRS_MAKEFLAGS += DEMO_IS_APPLET=true +include $(BUILDDIR)/common/Subdirs.gmk all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/mkdemo/jfc/Makefile b/jdk/make/mkdemo/jfc/Makefile index 06817a1cb23..e57ca5b9c1f 100644 --- a/jdk/make/mkdemo/jfc/Makefile +++ b/jdk/make/mkdemo/jfc/Makefile @@ -46,6 +46,7 @@ ifndef OPENJDK SUBDIRS += Java2D SwingSet2 Stylepad endif +include $(BUILDDIR)/common/Subdirs.gmk all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/mkdemo/jni/Makefile b/jdk/make/mkdemo/jni/Makefile index 4cc363902e5..dd9e617c3c2 100644 --- a/jdk/make/mkdemo/jni/Makefile +++ b/jdk/make/mkdemo/jni/Makefile @@ -37,6 +37,8 @@ ifeq ($(PLATFORM),solaris) SUBDIRS += Poller endif +include $(BUILDDIR)/common/Subdirs.gmk + all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/mkdemo/jvmti/Makefile b/jdk/make/mkdemo/jvmti/Makefile index 592413087f1..f59a9d287c8 100644 --- a/jdk/make/mkdemo/jvmti/Makefile +++ b/jdk/make/mkdemo/jvmti/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2004-2010 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -28,17 +28,19 @@ # BUILDDIR = ../.. +MODULE = demos PRODUCT = demos include $(BUILDDIR)/common/Defs.gmk # Can be built in any order, the JRE version of hprof and java_crw_demo are # really built in make/java. -# The hprof target here just deliveres the sources and README files. +# The hprof target here just delivers the sources and README files. # The java_crw_demo and agent_util files are copied into each demo that # uses them. SUBDIRS = \ versionCheck \ - gctest \ + compiledMethodLoad \ + gctest \ heapViewer \ heapTracker \ minst \ @@ -46,6 +48,8 @@ SUBDIRS = \ waiters \ hprof +include $(BUILDDIR)/common/Subdirs.gmk + all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/mkdemo/jvmti/README.txt b/jdk/make/mkdemo/jvmti/README.txt index cc02bb4c6f1..0078d534ab7 100644 --- a/jdk/make/mkdemo/jvmti/README.txt +++ b/jdk/make/mkdemo/jvmti/README.txt @@ -1,5 +1,5 @@ # -# Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2004-2010 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,8 @@ Instructions on adding a jvmti demo agent. Basically you want to mimic the jvmti demo agent "mtrace". -* Create and populate a source directory at src/demo/jvmti - (Try and re-use code in agent_util area like src/demo/jvmti/mtrace) +* Create and populate a source directory at src/share/demo/jvmti + (Try and re-use code in agent_util area like src/share/demo/jvmti/mtrace) (This should include a small README.txt document on what this demo is) * Make sure the appropriate "demo" copyright notice is added to all the @@ -44,7 +44,7 @@ Basically you want to mimic the jvmti demo agent "mtrace". * Create test directory at test/demo/jvmti, create at least one test (Use test/demo/jvmti/mtrace as a template) -* Don't forget to SCCS in all the new files +* Don't forget to check in all the new files * Build and create images (cd make && gnumake && gnumake images) (Do this on Solaris, Linux, and at least one Windows platform) @@ -54,5 +54,5 @@ Basically you want to mimic the jvmti demo agent "mtrace". * Run the tests: cd test/demo/jvmti && runregress . (Do this on Solaris, Linux, and at least one Windows platform) -Contact: jk-svc-group@sun.com for more information or help. +Contact: serviceability-dev@openjdk.java.net for more information or help. diff --git a/jdk/make/mkdemo/jvmti/compiledMethodLoad/Makefile b/jdk/make/mkdemo/jvmti/compiledMethodLoad/Makefile new file mode 100644 index 00000000000..aea96e4d068 --- /dev/null +++ b/jdk/make/mkdemo/jvmti/compiledMethodLoad/Makefile @@ -0,0 +1,41 @@ +# +# Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +BUILDDIR = ../../.. +PRODUCT = demo/jvmti +DEMONAME = compiledMethodLoad +include $(BUILDDIR)/common/Defs.gmk + +DEMO_ROOT = $(SHARE_SRC)/demo/jvmti/$(DEMONAME) +DEMO_TOPFILES = ./README.txt +DEMO_DESTDIR = $(DEMODIR)/jvmti/$(DEMONAME) + +DEMO_OBJECTS = agent_util.$(OBJECT_SUFFIX) + +# +# Demo jar building rules. +# +include $(BUILDDIR)/common/Demo.gmk + diff --git a/jdk/make/mkdemo/management/Makefile b/jdk/make/mkdemo/management/Makefile index b021ddd1eb0..42d3c7c6775 100644 --- a/jdk/make/mkdemo/management/Makefile +++ b/jdk/make/mkdemo/management/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../.. +MODULE = demos PRODUCT = demos include $(BUILDDIR)/common/Defs.gmk @@ -37,6 +38,8 @@ SUBDIRS = FullThreadDump \ MemoryMonitor \ JTop +include $(BUILDDIR)/common/Subdirs.gmk + all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/mkdemo/scripting/Makefile b/jdk/make/mkdemo/scripting/Makefile index b32cfb77d5a..42e46ed3b04 100644 --- a/jdk/make/mkdemo/scripting/Makefile +++ b/jdk/make/mkdemo/scripting/Makefile @@ -32,6 +32,7 @@ PRODUCT = demos include $(BUILDDIR)/common/Defs.gmk SUBDIRS = jconsole-plugin +include $(BUILDDIR)/common/Subdirs.gmk all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/mksample/Makefile b/jdk/make/mksample/Makefile index 2d87ebd734c..0822f031de8 100644 --- a/jdk/make/mksample/Makefile +++ b/jdk/make/mksample/Makefile @@ -37,13 +37,18 @@ else WEBSERVICES_SUBDIR = webservices endif -SUBDIRS = nio jmx scripting $(WEBSERVICES_SUBDIR) nbproject +SUBDIRS = +SUBDIRS_misc = nio scripting nbproject +SUBDIRS_enterprise = $(WEBSERVICES_SUBDIR) +SUBDIRS_management = jmx # include dtrace samples in Solaris builds ifeq ($(PLATFORM), solaris) SUBDIRS += dtrace endif +include $(BUILDDIR)/common/Subdirs.gmk + all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/mksample/dtrace/Makefile b/jdk/make/mksample/dtrace/Makefile index 056f0b29f73..dbe1eed8159 100644 --- a/jdk/make/mksample/dtrace/Makefile +++ b/jdk/make/mksample/dtrace/Makefile @@ -29,6 +29,7 @@ BUILDDIR = ../.. +MODULE = samples PRODUCT = java include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/mksample/jmx/Makefile b/jdk/make/mksample/jmx/Makefile index 94d0a1843df..0528442dce0 100644 --- a/jdk/make/mksample/jmx/Makefile +++ b/jdk/make/mksample/jmx/Makefile @@ -32,6 +32,8 @@ PRODUCT = java include $(BUILDDIR)/common/Defs.gmk SUBDIRS = jmx-scandir +include $(BUILDDIR)/common/Subdirs.gmk + all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/mksample/jmx/jmx-scandir/Makefile b/jdk/make/mksample/jmx/jmx-scandir/Makefile index b32a4191750..5c06efce7dd 100644 --- a/jdk/make/mksample/jmx/jmx-scandir/Makefile +++ b/jdk/make/mksample/jmx/jmx-scandir/Makefile @@ -29,6 +29,7 @@ BUILDDIR = ../../.. +MODULE = samples PRODUCT = java include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/mksample/nbproject/Makefile b/jdk/make/mksample/nbproject/Makefile index abc326c9000..6543282c220 100644 --- a/jdk/make/mksample/nbproject/Makefile +++ b/jdk/make/mksample/nbproject/Makefile @@ -29,6 +29,7 @@ BUILDDIR = ../.. +MODULE = samples PRODUCT = java include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/mksample/nio/Makefile b/jdk/make/mksample/nio/Makefile index 5fcfd03a783..03fc36d3ac2 100644 --- a/jdk/make/mksample/nio/Makefile +++ b/jdk/make/mksample/nio/Makefile @@ -32,6 +32,8 @@ PRODUCT = java include $(BUILDDIR)/common/Defs.gmk SUBDIRS = file multicast server +include $(BUILDDIR)/common/Subdirs.gmk + all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/mksample/nio/file/Makefile b/jdk/make/mksample/nio/file/Makefile index f7159de83a3..3181339e180 100644 --- a/jdk/make/mksample/nio/file/Makefile +++ b/jdk/make/mksample/nio/file/Makefile @@ -29,6 +29,7 @@ BUILDDIR = ../../.. +MODULE = samples PRODUCT = java include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/mksample/nio/multicast/Makefile b/jdk/make/mksample/nio/multicast/Makefile index 179d3d4a97c..7e794c90539 100644 --- a/jdk/make/mksample/nio/multicast/Makefile +++ b/jdk/make/mksample/nio/multicast/Makefile @@ -29,6 +29,7 @@ BUILDDIR = ../../.. +MODULE = samples PRODUCT = java include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/mksample/nio/server/Makefile b/jdk/make/mksample/nio/server/Makefile index a776fa98fb3..3eced2d38ba 100644 --- a/jdk/make/mksample/nio/server/Makefile +++ b/jdk/make/mksample/nio/server/Makefile @@ -29,6 +29,7 @@ BUILDDIR = ../../.. +MODULE = samples PRODUCT = java include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/mksample/scripting/Makefile b/jdk/make/mksample/scripting/Makefile index 0fd9e8737e5..2cae9f6c40e 100644 --- a/jdk/make/mksample/scripting/Makefile +++ b/jdk/make/mksample/scripting/Makefile @@ -32,6 +32,8 @@ PRODUCT = java include $(BUILDDIR)/common/Defs.gmk SUBDIRS = scriptpad +include $(BUILDDIR)/common/Subdirs.gmk + all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/mksample/scripting/scriptpad/Makefile b/jdk/make/mksample/scripting/scriptpad/Makefile index 8918764ed5e..bd9009aa954 100644 --- a/jdk/make/mksample/scripting/scriptpad/Makefile +++ b/jdk/make/mksample/scripting/scriptpad/Makefile @@ -29,6 +29,7 @@ BUILDDIR = ../../.. +MODULE = samples PRODUCT = java include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/mksample/webservices/EbayClient/Makefile b/jdk/make/mksample/webservices/EbayClient/Makefile index 541bd14d4f4..16f42d214fc 100644 --- a/jdk/make/mksample/webservices/EbayClient/Makefile +++ b/jdk/make/mksample/webservices/EbayClient/Makefile @@ -29,6 +29,7 @@ BUILDDIR = ../../.. +MODULE = samples PRODUCT = java include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/mksample/webservices/EbayServer/Makefile b/jdk/make/mksample/webservices/EbayServer/Makefile index a0481cdedb9..6cbe9f06235 100644 --- a/jdk/make/mksample/webservices/EbayServer/Makefile +++ b/jdk/make/mksample/webservices/EbayServer/Makefile @@ -29,6 +29,7 @@ BUILDDIR = ../../.. +MODULE = samples PRODUCT = java include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/mksample/webservices/Makefile b/jdk/make/mksample/webservices/Makefile index 208db3c6448..4dee839c34b 100644 --- a/jdk/make/mksample/webservices/Makefile +++ b/jdk/make/mksample/webservices/Makefile @@ -32,6 +32,7 @@ PRODUCT = java include $(BUILDDIR)/common/Defs.gmk SUBDIRS = EbayClient EbayServer +include $(BUILDDIR)/common/Subdirs.gmk all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/modules/Makefile b/jdk/make/modules/Makefile new file mode 100644 index 00000000000..ca7528f611e --- /dev/null +++ b/jdk/make/modules/Makefile @@ -0,0 +1,134 @@ +# +# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +BUILDDIR = .. +include $(BUILDDIR)/common/Defs.gmk + +# +# Modularizing the JDK +# - Post jdk build process until the source tree is restructured +# for modules build +# - /modules/ will be created for each module. +# +# Steps: +# 0. During jdk build before this makefile is invoked, classes, +# resource files, and other non-class files such as native libraries, +# properties file, images, etc are created. +# +# Non-class files are copied to /tmp/modules/ +# directory in this step to prepare for the post-build modularization. +# +# The MODULE variable defined in other makefiles specifies +# the lowest-level module that the non-class files belong to. +# The name might or might not be the same as the name of the modules +# in the resulting /modules directory. +# +# 1. Unpack all jars in the /lib directory to a temporary +# location (/tmp/modules/classes) to prepare for modules +# creation. +# +# 2. Run ClassAnalyzer tool to analyze all jdk classes and generate +# class list for all modules and also perform dependency analysis. +# +# Input configuration files :- +# +# modules.config : defines the low-level modules and specifies +# what classes and resource files each module includes. +# modules.group : defines the module groups and its members. +# jdk7.depconfig : lists the dynamic dependencies including +# use of reflection Class.forName and JNI FindClass and +# service provider. +# optional.depconfig : lists the optional dependencies +# +# 3. Create one directory for each module (/modules/) +# based on the output files from (2). +# +# modules.list lists the modules to be created for the modules +# build and its members. For each module (m) in modules.list, +# a. create $m/lib/$m.jar with all classes and resource files +# listed in $m.classlist and $m.resources respectively. +# b. copy all non-class files from its members to +# /modules/$m. + + +MAINMANIFEST=$(JDK_TOPDIR)/make/tools/manifest.mf +MODULE_JAR_MANIFEST_FILE=$(ABS_TEMPDIR)/manifest.tmp + +TMP = $(ABS_MODULES_TEMPDIR) +MODULE_CLASSLIST = $(ABS_MODULES_TEMPDIR)/classlist +MODULE_CLASSES = $(ABS_MODULES_TEMPDIR)/classes +MODULES_LIST = $(MODULE_CLASSLIST)/modules.list + +all:: unpack-jars gen-classlist modularize + +JAR_LIST := $(shell $(FIND) $(ABS_OUTPUTDIR)/lib -name \*.jar -print) +unpack-jars: + @$(ECHO) ">>>Making "$@" @ `$(DATE)` ..." + $(RM) -rf $(MODULE_CLASSES) + $(MKDIR) -p $(MODULE_CLASSES) + $(CP) -rf $(CLASSBINDIR)/* $(MODULE_CLASSES) + @for jf in $(JAR_LIST) ; do \ + $(CD) $(MODULE_CLASSES) && $(BOOT_JAR_CMD) xf $$jf $(BOOT_JAR_JFLAGS);\ + done + @$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..." + +gen-classlist: + $(CD) tools && $(MAKE) all + +modularize: $(MODULE_JAR_MANIFEST_FILE) + @$(ECHO) ">>>Making "$@" @ `$(DATE)` ..." + @$(RM) -rf $(MODULES_DIR) + + @# create jar file for modules and + @# copy other files from all members of this module + for m in `$(NAWK) '{print $$1}' $(MODULES_LIST)` ; do \ + $(ECHO) "Creating module $$m" ; \ + $(SED) -e 's%\\%\/%g' < $(MODULE_CLASSLIST)/$$m.classlist > $(TMP)/tmp.cf ; \ + if [ -f $(MODULE_CLASSLIST)/$$m.resources ] ; then \ + $(SED) -e 's%\\%\/%g' < $(MODULE_CLASSLIST)/$$m.resources >> $(TMP)/tmp.cf ; \ + fi ; \ + $(MKDIR) -p $(ABS_MODULES_DIR)/$$m/lib; \ + $(CD) $(MODULE_CLASSES) && \ + $(BOOT_JAR_CMD) c0mf $(MODULE_JAR_MANIFEST_FILE) \ + $(ABS_MODULES_DIR)/$$m/lib/$$m.jar \ + @$(TMP)/tmp.cf \ + $(BOOT_JAR_JFLAGS); \ + for s in `$(GREP) "^$$m" $(MODULES_LIST)` ; do \ + if [ -d $(TMP)/$$s ] ; then \ + $(CP) -rf $(TMP)/$$s/* $(ABS_MODULES_DIR)/$$m; \ + $(RM) -rf $(ABS_MODULES_DIR)/$$m/classes; \ + fi \ + done \ + done + @$(CD) $(MODULE_CLASSES) && $(java-vm-cleanup) + @$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..." + +$(MODULE_JAR_MANIFEST_FILE): + $(SED) -e "s/@@RELEASE@@/$(RELEASE)/" $(MAINMANIFEST) > $@ + +clean clobber:: + $(RM) -rf $(MODULE_CLASSLIST) + $(RM) -rf $(MODULES_DIR) + $(RM) $(MODULE_JAR_MANIFEST_FILE) diff --git a/jdk/make/modules/bootmodule.roots b/jdk/make/modules/bootmodule.roots new file mode 100644 index 00000000000..cd0b264b254 --- /dev/null +++ b/jdk/make/modules/bootmodule.roots @@ -0,0 +1,199 @@ +# +# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# +# List of root classes/methods, each line of the following syntax: +# +# |* +# exclude | + +# The boot module generated based on this rootset does not support +# - security permission check +# - non-standard charset +# - logging output +# - resource bundles +# including error output from the launcher + +# VM preloaded classes +java.lang.Object +java.lang.String +java.lang.Class +java.lang.Cloneable +java.lang.ClassLoader +java.lang.System +java.lang.Throwable +java.lang.Error +java.lang.ThreadDeath +java.lang.Exception +java.lang.RuntimeException +java.security.ProtectionDomain +java.security.AccessControlContext +java.lang.ClassNotFoundException +java.lang.NoClassDefFoundError +java.lang.ClassCastException +java.lang.ArrayStoreException +java.lang.VirtualMachineError +java.lang.OutOfMemoryError +java.lang.StackOverflowError +java.lang.IllegalMonitorStateException +java.lang.ref.Reference +java.lang.ref.SoftReference +java.lang.ref.WeakReference +java.lang.ref.FinalReference +java.lang.ref.PhantomReference +java.lang.ref.Finalizer +java.lang.Runnable +java.lang.Thread +java.lang.ThreadGroup +java.util.Properties +java.lang.reflect.AccessibleObject +java.lang.reflect.Member +java.lang.reflect.Field +java.lang.reflect.Method +java.lang.reflect.Constructor +java.lang.reflect.Type +sun.reflect.MagicAccessorImpl +sun.reflect.MethodAccessorImpl +sun.reflect.ConstructorAccessorImpl +sun.reflect.DelegatingClassLoader +sun.reflect.ConstantPool +sun.reflect.UnsafeStaticFieldAccessorImpl +java.util.Vector +java.lang.StringBuffer +java.lang.StackTraceElement +java.nio.Buffer +java.lang.Boolean +java.lang.Character +java.lang.Float +java.lang.Double +java.lang.Byte +java.lang.Short +java.lang.Integer +java.lang.Long +java.lang.NullPointerException +java.lang.ArithmeticException +java.lang.Compiler + + +# Root methods +java.lang.ClassLoader.getSystemClassLoader ()Ljava/lang/ClassLoader; +java.lang.System.initializeSystemClass ()V +sun.launcher.LauncherHelper.checkAndLoadMain (ZZLjava/lang/String;)Ljava/lang/Object; + +# The tool doesn't automatically find superclasses and parse the method +# if overridden as it tries to reduce unnecessary classes being pulled in. +# The following forces the dependency to be included the result. +sun.net.www.protocol.file.Handler. ()V +sun.net.www.protocol.jar.Handler. ()V +sun.net.www.protocol.file.Handler.openConnection * +sun.net.www.protocol.jar.Handler.openConnection * +sun.misc.URLClassPath$JarLoader. (Ljava/net/URL;Ljava/net/URLStreamHandler;Ljava/util/HashMap;)V +sun.misc.URLClassPath$FileLoader. (Ljava/net/URL;)V +sun.misc.URLClassPath$FileLoader.getClassPath * +sun.misc.URLClassPath$FileLoader.getResource * +sun.misc.URLClassPath$JarLoader.getResource * +sun.misc.URLClassPath$JarLoader.getClassPath * + +# permission collections +java.io.FilePermission.newPermissionCollection ()Ljava/security/PermissionCollection; +java.security.BasicPermission.newPermissionCollection ()Ljava/security/PermissionCollection; + +# native +java.io.UnixFileSystem +java.io.UnixFileSystem. ()V +java.io.UnixFileSystem.canonicalize * +java.io.Win32FileSystem +java.io.Win32FileSystem. ()V +java.io.Win32FileSystem.canonicalize * +java.io.WinNTFileSystem +java.io.WinNTFileSystem. ()V +java.io.WinNTFileSystem.canonicalize * + +# missing +java.util.HashMap. ()V +java.util.HashMap$EntrySet.iterator * + +# Called from native GetStringPlatformChars (jni_util.c) +java.lang.String.getBytes * + +# charset +sun.nio.cs.US_ASCII.newEncoder ()Ljava/nio/charset/CharsetEncoder; +sun.nio.cs.UTF_8.newEncoder ()Ljava/nio/charset/CharsetEncoder; +sun.nio.cs.UTF_8.newDecoder * +sun.nio.cs.UTF_16.newEncoder ()Ljava/nio/charset/CharsetEncoder; +sun.nio.cs.UTF_16.newDecoder * +sun.nio.cs.UTF_32.newEncoder ()Ljava/nio/charset/CharsetEncoder; +sun.nio.cs.UTF_32.newDecoder * + +# hashcode +java.util.jar.Attributes$Name.hashCode * + +# nio +sun.nio.ByteBuffered +sun.nio.ch.DirectBuffer +java.nio.DirectByteBuffer +java.nio.MappedByteBuffer +java.nio.DirectLongBufferU + +# resource files +sun.launcher.resources.launcher + +sun.misc.Launcher$AppClassLoader.getPermissions * +sun.misc.Launcher$AppClassLoader.loadClass (Ljava/lang/String;)Ljava/lang/Class; +sun.misc.Launcher$AppClassLoader.findClass (Ljava/lang/String;)Ljava/lang/Class; +sun.misc.Launcher$ExtClassLoader.getPermissions * +sun.misc.Launcher$ExtClassLoader.loadClass (Ljava/lang/String;)Ljava/lang/Class; +sun.misc.Launcher$ExtClassLoader.findClass (Ljava/lang/String;)Ljava/lang/Class; +java.lang.ClassLoader.checkPackageAccess * +java.lang.ClassLoader.findClass * +java.lang.ClassLoader.defineClass * +java.net.URLClassLoader.getPermissions * +java.net.URLClassLoader.findClass * +java.net.URLClassLoader.defineClass * +java.security.SecureClassLoader.defineClass * +# need to parse superclasses +java.security.SecureClassLoader. ()V + +exclude sun.security.provider.PolicyFile. +exclude java.lang.ClassLoader.compareCerts +exclude java.security.cert.Certificate.equals +# unsigned jars - no verifier +exclude java.util.jar.JarFile.initializeVerifier +exclude java.util.jar.JarVerifier +exclude sun.security.util.SignatureFileVerifier. + + +# what about other charset +exclude sun.misc.Service +exclude java.util.ServiceLoader + +# exclude support for localized messages +exclude java.util.ResourceBundle.getBundle +exclude java.text.MessageFormat +exclude sun.util.logging.PlatformLogger$LoggerProxy.format * + +# exclude nio and miscellaneous classes +exclude java.nio.channels.** +exclude sun.misc.FloatingDecimal +exclude sun.misc.FormattedFloatingDecimal +exclude sun.misc.FDBigInt diff --git a/jdk/make/modules/jdk7.depconfig b/jdk/make/modules/jdk7.depconfig new file mode 100644 index 00000000000..286b19e3ad0 --- /dev/null +++ b/jdk/make/modules/jdk7.depconfig @@ -0,0 +1,473 @@ +# +# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# private java.lang.Object createInetSocketAddress(java.lang.String, int) +@ClassForName + com.sun.jndi.ldap.Connection -> java.net.InetSocketAddress + com.sun.jndi.ldap.Connection -> java.net.SocketAddress + +# com.sun.jndi.ldap.VersionHelper +@ClassForName(optional) + com.sun.jndi.ldap.VersionHelper -> com.sun.jndi.ldap.VersionHelper* + +# private static void initMethodHandles() +@ClassForName + com.sun.jndi.toolkit.corba.CorbaUtils -> javax.rmi.CORBA.Stub + com.sun.jndi.toolkit.corba.CorbaUtils -> javax.rmi.PortableRemoteObject + +# com.sun.naming.internal.ResourceManager$AppletParameter +@ClassForName(optional) + com.sun.naming.internal.ResourceManager$AppletParameter -> java.applet.Applet + +# private static boolean loadProviderAsService() +@Provider + com.sun.net.httpserver.spi.HttpServerProvider -> META-INF/services/com.sun.net.httpserver.spi.HttpServerProvider + +# com.sun.org.apache.xml.internal.security.transforms.implementations.TransformXSLT +@ClassForName + com.sun.org.apache.xml.internal.security.transforms.implementations.TransformXSLT -> javax.xml.XMLConstants + +# public static java.beans.PersistenceDelegate getPersistenceDelegate(java.lang.Class) +@ClassForName + java.beans.MetaData -> java.beans.*_PersistenceDelegate + +# private static java.lang.reflect.Method getNanosMethod() +@ClassForName(optional) + java.beans.java_sql_Timestamp_PersistenceDelegate -> java.sql.Timestamp + +# java.beans.java_util_Collections$CheckedCollection_PersistenceDelegate +@ClassForName + java.beans.java_util_Collections$CheckedCollection_PersistenceDelegate -> java.util.Collections$CheckedCollection + +# java.beans.java_util_Collections$CheckedMap_PersistenceDelegate +@ClassForName + java.beans.java_util_Collections$CheckedMap_PersistenceDelegate -> java.util.Collections$CheckedMap + +# private static java.lang.Object getType(java.lang.Object) +@ClassForName + java.beans.java_util_EnumMap_PersistenceDelegate -> java.util.EnumMap + +# private java.lang.Integer getAxis(java.lang.Object) +@ClassForName + java.beans.javax_swing_Box_PersistenceDelegate -> javax.swing.BoxLayout + +# java.lang.Double +@Inline + java.lang.Double -> sun.misc.FloatConsts + java.lang.Double -> sun.misc.DoubleConsts + +# java.lang.Float +@Inline + java.lang.Float -> sun.misc.FloatConsts + java.lang.Float -> sun.misc.DoubleConsts + +# java.net.DefaultDatagramSocketImplFactory +@ClassForName(optional) + java.net.DefaultDatagramSocketImplFactory -> java.net.*DatagramSocketImpl + +# private static sun.net.spi.nameservice.NameService createNSProvider(java.lang.String) +@Provider + java.net.InetAddress -> META-INF/services/sun.net.spi.nameservice.NameServiceDescriptor + +# static java.net.InetAddressImpl create() +@ClassForName + java.net.InetAddressImplFactory -> java.net.*Inet[46]AddressImpl + +# private static void init() +@NativeFindClass + java.net.PlainDatagramSocketImpl -> java.io.FileDescriptor + +# java.net.ProxySelector +@ClassForName + java.net.ProxySelector -> sun.net.spi.DefaultProxySelector + +# static java.net.URLStreamHandler getURLStreamHandler(java.lang.String) +@ClassForName(optional) + java.net.URL -> sun.net.www.protocol.*.Handler + +# private java.net.ContentHandler lookupContentHandlerClassFor(java.lang.String) +@ClassForName + java.net.URLConnection -> sun.net.www.content.* + +# private static java.nio.channels.spi.AsynchronousChannelProvider loadProviderAsService() +@Provider + java.nio.channels.spi.AsynchronousChannelProvider$ProviderHolder -> META-INF/services/java.nio.channels.spi.AsynchronousChannelProvider + +# private static boolean loadProviderFromProperty() +@ClassForName + java.nio.channels.spi.SelectorProvider -> sun.nio.ch.DefaultSelectorProvider + +# private static boolean loadProviderAsService() +@Provider + java.nio.channels.spi.SelectorProvider -> META-INF/services/java.nio.channels.spi.SelectorProvider + +# private static java.util.Iterator providers() +@Provider + java.nio.charset.Charset -> META-INF/services/java.nio.charset.spi.CharsetProvider + +# private static void probeExtendedProvider() +@ClassForName(optional) + java.nio.charset.Charset -> sun.nio.cs.ext.ExtendedCharsets + +# public static java.nio.file.FileSystem newFileSystem(java.net.URI, java.util.Map, java.lang.ClassLoader) +@Provider + java.nio.file.FileSystems -> META-INF/services/java.nio.file.FileSystemProvider + +# private static java.util.List loadInstalledDetectors() +@Provider + java.nio.file.Files$DefaultFileTypeDetectorHolder -> META-INF/services/java.nio.file.spi.FileTypeDetector + +# public static java.util.List installedProviders() +@Provider + java.nio.file.spi.FileSystemProvider -> META-INF/services/java.nio.file.FileSystemProvider + +# private static java.rmi.server.RMIClassLoaderSpi initializeProvider() +@Provider + java.rmi.server.RMIClassLoader -> META-INF/services/java.rmi.server.RMIClassLoaderSpi + +# private static void initializeSystemScope() +@ClassForName(optional) + java.security.IdentityScope -> sun.security.provider.IdentityDatabase + +# static java.security.Policy getPolicyNoCheck() +@ClassForName + java.security.Policy -> sun.security.provider.PolicyFile + +# private static java.lang.Class getSpiClass(java.lang.String) +@ClassForName + java.security.Security -> java.security.*Spi + +# private static void invalidateSMCache(java.lang.String) +@ClassForName + java.security.Security -> java.lang.SecurityManager + +# private static void loadInitialDrivers() +@Provider + java.sql.DriverManager -> META-INF/services/java.sql.Driver + +# private static java.text.BreakIterator createBreakInstance(java.util.Locale, int, java.lang.String, java.lang.String) +@Provider + java.text.BreakIterator -> META-INF/services/java.util.spi.BreakIteratorProvider + +# public static java.text.Collator getInstance(java.util.Locale) +@Provider + java.text.Collator -> META-INF/services/java.util.spi.CollatorProvider + +# private static java.text.DateFormat get(int, int, int, java.util.Locale) +@Provider + java.text.DateFormat -> META-INF/services/java.util.spi.DateNameProvider + +# public static java.util.Locale[] getAvailableLocales() +@Provider + java.text.DateFormatSymbols -> META-INF/services/java.util.spi.DateFormatSymbolsProvider + +# public static java.util.Locale[] getAvailableLocales() +@Provider + java.text.DecimalFormatSymbols -> META-INF/services/java.util.spi.DecimalFormatSymbolsProvider + +# public static java.util.Locale[] getAvailableLocales() +@Provider + java.text.NumberFormat -> META-INF/services/java.util.spi.NumberFormatProvider + +# public java.lang.String getDisplayName(java.util.Locale) +@Provider + java.util.Currency -> META-INF/services/java.util.spi.CurrencyNameProvider + +# java.util.Formatter +@Inline + java.util.Formatter -> sun.misc.DoubleConsts + +# java.util.Locale +@Inline + java.util.Locale -> java.util.LocaleISOData + +# private java.lang.String getDisplayString(java.lang.String, java.util.Locale, int) +@Provider + java.util.Locale -> META-INF/services/java.util.spi.LocaleNameProvider + +# private static java.util.prefs.PreferencesFactory factory1() +@ClassForName + java.util.prefs.Preferences -> java.util.prefs.WindowsPreferencesFactory + java.util.prefs.Preferences -> java.util.prefs.FileSystemPreferencesFactory + +# private static java.util.prefs.PreferencesFactory factory1() +@Provider + java.util.prefs.Preferences -> META-INF/services/java.util.prefs.PreferencesFactory + +# public void registerApplicationClasspathSpis() +@Provider + javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.IIOServiceProvider + +# private void registerInstalledProviders() +@Provider + javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageReaderSpi + javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageWriterSpi + javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageReaderWriterSpi + javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageTranscoderSpi + javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageInputStreamSpi + javax.imageio.spi.IIORegistry -> META-INF/services/javax.imageio.spi.ImageOutputStreamSpi + +# public javax.naming.ldap.ExtendedResponse createExtendedResponse(java.lang.String, byte[], int, int) +@Provider + javax.naming.ldap.StartTlsRequest -> META-INF/services/javax.naming.ldap.StartTlsResponse + +# private static java.util.ArrayList getAllLookupServices() +@Provider + javax.print.PrintServiceLookup -> META-INF/services/javax.print.PrintServiceLookup + +# private static java.util.ArrayList getAllFactories() +@Provider + javax.print.StreamPrintServiceFactory -> META-INF/services/javax.print.StreamPrintServiceFactory + +# private void initEngines(java.lang.ClassLoader) +@Provider + javax.script.ScriptEngineManager -> META-INF/services/javax.script.ScriptEngineFactory + +# private void initializeInputMethodLocatorList() +@Provider + sun.awt.im.ExecutableInputMethodManager -> META-INF/services/java.awt.im.spi.InputMethodDescriptor + +# private static java.lang.Class getConverterClass(int, java.lang.String) +@ClassForName(optional) + sun.io.Converters -> sun.io.* + +# public static sun.java2d.cmm.PCMM getModule() +@Provider + sun.java2d.cmm.CMSManager -> META-INF/services/sun.java2d.cmm.PCMM + +# public static sun.java2d.pipe.RenderingEngine getInstance() +@Provider + sun.java2d.pipe.RenderingEngine -> META-INF/services/sun.java2d.pipe.RenderingEngine + +# public static sun.java2d.pipe.RenderingEngine getInstance() +@ClassForName(optional) + sun.java2d.pipe.RenderingEngine -> sun.dc.DuctusRenderingEngine + +# sun.misc.FloatingDecimal +@Inline + sun.misc.FloatingDecimal -> sun.misc.FloatConsts + sun.misc.FloatingDecimal -> sun.misc.DoubleConsts + +# sun.misc.FormattedFloatingDecimal +@Inline + sun.misc.FormattedFloatingDecimal -> sun.misc.FloatConsts + sun.misc.FormattedFloatingDecimal -> sun.misc.DoubleConsts + +# sun.misc.FpUtils +@Inline + sun.misc.FpUtils -> sun.misc.FloatConsts + sun.misc.FpUtils -> sun.misc.DoubleConsts + +# public java.net.URLStreamHandler createURLStreamHandler(java.lang.String) +@ClassForName(optional) + sun.misc.Launcher$Factory -> sun.net.www.protocol.*.Handler + +# private static sun.net.NetHooks$Provider loadProvider(java.lang.String) +@ClassForName(optional) + sun.net.NetHooks -> sun.net.spi.SdpProvider + +# sun.net.idn.StringPrep +@Inline + sun.net.idn.StringPrep -> sun.net.idn.UCharacterDirection + +# private static boolean init() +@NativeFindClass + sun.net.spi.DefaultProxySelector -> java.net.Proxy + sun.net.spi.DefaultProxySelector -> java.net.Proxy$Type + sun.net.spi.DefaultProxySelector -> java.net.InetSocketAddress + +# private static java.nio.channels.Channel createChannel() +@ClassForName + sun.nio.ch.InheritedChannel -> java.io.FileDescriptor + +# private static void initDBBConstructor() +@ClassForName + sun.nio.ch.Util -> java.nio.DirectByteBuffer + +# private static void initDBBRConstructor() +@ClassForName + sun.nio.ch.Util -> java.nio.DirectByteBufferR + +# private java.nio.charset.Charset lookup(java.lang.String) +@ClassForName(optional) + sun.nio.cs.FastCharsetProvider -> sun.nio.cs.* + +# sun.nio.cs.ext.ExtendedCharsets +@ClassForName(optional) + sun.nio.cs.ext.ExtendedCharsets -> sun.nio.cs.ext.* + +# sun.nio.cs.ext.ExtendedCharsets +@ClassForName(optional) + sun.nio.cs.ext.ExtendedCharsets -> sun.nio.cs.ext.* + +# public static java.nio.file.spi.FileSystemProvider create() +@ClassForName + sun.nio.fs.DefaultFileSystemProvider -> sun.nio.fs.SolarisFileSystemProvider + sun.nio.fs.DefaultFileSystemProvider -> sun.nio.fs.LinuxFileSystemProvider + +# sun.rmi.server.MarshalInputStream +@ClassForName + sun.rmi.server.MarshalInputStream -> sun.rmi.server.Activation$ActivationSystemImpl_Stub + sun.rmi.server.MarshalInputStream -> sun.rmi.registry.RegistryImpl_Stub + +# private java.security.Provider doLoadProvider() +@ClassForName(optional) + sun.security.jca.ProviderConfig -> sun.security.pkcs11.SunPKCS11 + sun.security.jca.ProviderConfig -> sun.security.provider.Sun + sun.security.jca.ProviderConfig -> sun.security.rsa.SunRsaSign + sun.security.jca.ProviderConfig -> sun.security.ec.SunEC + sun.security.jca.ProviderConfig -> com.sun.net.ssl.internal.ssl.Provider + sun.security.jca.ProviderConfig -> com.sun.crypto.provider.SunJCE + sun.security.jca.ProviderConfig -> sun.security.jgss.SunProvider + sun.security.jca.ProviderConfig -> com.sun.security.sasl.Provider + sun.security.jca.ProviderConfig -> org.jcp.xml.dsig.internal.dom.XMLDSigRI + sun.security.jca.ProviderConfig -> sun.security.smartcardio.SunPCSC + sun.security.jca.ProviderConfig -> sun.security.mscapi.SunMSCAPI + +# public static java.security.Provider getSunProvider() +@ClassForName + sun.security.jca.Providers -> sun.security.provider.Sun + sun.security.jca.Providers -> sun.security.provider.VerificationProvider + +# private static sun.security.jgss.spi.MechanismFactory getMechFactoryImpl(java.security.Provider, java.lang.String, org.ietf.jgss.Oid, sun.security.jgss.GSSCaller) +@ClassForName + sun.security.jgss.ProviderList -> sun.security.jgss.spi.MechanismFactory + +# sun.security.jgss.wrapper.SunNativeProvider +@NativeFindClass + sun.security.jgss.wrapper.SunNativeProvider -> org.ietf.jgss.Oid + sun.security.jgss.wrapper.SunNativeProvider -> org.ietf.jgss.GSSException + sun.security.jgss.wrapper.SunNativeProvider -> sun.security.jgss.wrapper.GSSNameElement + sun.security.jgss.wrapper.SunNativeProvider -> sun.security.jgss.wrapper.GSSCredElement + sun.security.jgss.wrapper.SunNativeProvider -> sun.security.jgss.wrapper.NativeGSSContext + sun.security.jgss.wrapper.SunNativeProvider -> sun.security.jgss.wrapper.SunNativeProvider + sun.security.jgss.wrapper.SunNativeProvider -> org.ietf.jgss.MessageProp + sun.security.jgss.wrapper.SunNativeProvider -> org.ietf.jgss.ChannelBinding + sun.security.jgss.wrapper.SunNativeProvider -> java.net.InetAddress + sun.security.jgss.wrapper.SunNativeProvider -> sun.security.jgss.wrapper.GSSLibStub + +# static void ensureLoaded() +@NativeFindClass + sun.security.krb5.Credentials -> sun.security.krb5.internal.Krb5 + sun.security.krb5.Credentials -> sun.security.krb5.internal.Ticket + sun.security.krb5.Credentials -> sun.security.krb5.PrincipalName + sun.security.krb5.Credentials -> sun.security.util.DerValue + sun.security.krb5.Credentials -> sun.security.krb5.EncryptionKey + sun.security.krb5.Credentials -> sun.security.krb5.internal.TicketFlags + sun.security.krb5.Credentials -> sun.security.krb5.internal.KerberosTime + +# public static java.lang.String getDefaultCacheName() +@ClassForName(optional) + sun.security.krb5.internal.ccache.FileCredentialsCache -> com.sun.security.auth.module.UnixSystem + +# sun.security.pkcs.PKCS9Attribute +@ClassForName + sun.security.pkcs.PKCS9Attribute -> sun.security.util.ObjectIdentifier + sun.security.pkcs.PKCS9Attribute -> java.util.Date + sun.security.pkcs.PKCS9Attribute -> sun.security.pkcs.SignerInfo + sun.security.pkcs.PKCS9Attribute -> sun.security.x509.CertificateExtensions + +# protected T engineGetKeySpec(java.security.Key, java.lang.Class) +@ClassForName + sun.security.provider.DSAKeyFactory -> java.security.spec.DSAPublicKeySpec + sun.security.provider.DSAKeyFactory -> java.security.spec.X509EncodedKeySpec + sun.security.provider.DSAKeyFactory -> java.security.spec.DSAPrivateKeySpec + sun.security.provider.DSAKeyFactory -> java.security.spec.PKCS8EncodedKeySpec + +# protected T engineGetParameterSpec(java.lang.Class) +@ClassForName + sun.security.provider.DSAParameters -> java.security.spec.DSAParameterSpec + +# sun.security.provider.VerificationProvider +@ClassForName(optional) + sun.security.provider.VerificationProvider -> sun.security.provider.Sun + sun.security.provider.VerificationProvider -> sun.security.rsa.SunRsaSign + +# sun.security.provider.certpath.URICertStore$LDAP +@ClassForName(optional) + sun.security.provider.certpath.URICertStore$LDAP -> sun.security.provider.certpath.ldap.LDAPCertStoreHelper + +# sun.security.smartcardio.PCSC +@NativeFindClass + sun.security.smartcardio.PCSC -> sun.security.smartcardio.PCSCException + +# sun.security.ssl.HandshakeMessage +@ClassForName + sun.security.ssl.HandshakeMessage -> java.security.MessageDigest$Delegate + +# sun.security.ssl.JsseJce +@ClassForName(optional) + sun.security.ssl.JsseJce -> sun.security.krb5.PrincipalName + +# sun.security.x509.OIDMap$OIDInfo +@ClassForName + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.SubjectKeyIdentifierExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.KeyUsageExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.PrivateKeyUsageExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.SubjectAlternativeNameExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.IssuerAlternativeNameExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.BasicConstraintsExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.CRLNumberExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.CRLReasonCodeExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.NameConstraintsExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.PolicyMappingsExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.AuthorityKeyIdentifierExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.PolicyConstraintsExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.NetscapeCertTypeExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.CertificatePoliciesExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.ExtendedKeyUsageExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.InhibitAnyPolicyExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.CRLDistributionPointsExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.CertificateIssuerExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.SubjectInfoAccessExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.AuthorityInfoAccessExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.IssuingDistributionPointExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.DeltaCRLIndicatorExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.FreshestCRLExtension + sun.security.x509.OIDMap$OIDInfo -> sun.security.x509.OCSPNoCheckExtension + +# sun.util.LocaleServiceProviderPool$AllAvailableLocales +@Provider + sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.BreakIteratorProvider + sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.CollatorProvider + sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.DateFormatProvider + sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.DateFormatSymbolsProvider + sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.DecimalFormatSymbolsProvider + sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.text.spi.NumberFormatProvider + sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.util.spi.CurrencyNameProvider + sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.util.spi.LocaleNameProvider + sun.util.LocaleServiceProviderPool$AllAvailableLocales -> META-INF/services/java.util.spi.TimeZoneNameProvider + +# private static final java.lang.String[] retrieveDisplayNames(sun.util.resources.OpenListResourceBundle, java.lang.String, java.util.Locale) +@Provider + sun.util.TimeZoneNameUtility -> META-INF/services/java.util.spi.TimeZoneNamePProvider + +# public static sun.util.calendar.CalendarSystem forName(java.lang.String) +@ClassForName + sun.util.calendar.CalendarSystem -> sun.util.calendar.Gregorian + sun.util.calendar.CalendarSystem -> sun.util.calendar.LocalGregorianCalendar + sun.util.calendar.CalendarSystem -> sun.util.calendar.JulianCalendar + +# sun.util.logging.LoggingSupport +@ClassForName(optional) + sun.util.logging.LoggingSupport -> java.util.logging.LoggingProxyImpl diff --git a/jdk/make/modules/modules.config b/jdk/make/modules/modules.config new file mode 100644 index 00000000000..bcc0493a980 --- /dev/null +++ b/jdk/make/modules/modules.config @@ -0,0 +1,929 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +// These classes are not referenced in the JDK but we can't +// remove them for compatibility reason. Define this module +// first so that other modules don't need to exclude these clases +module private-legacy { + include sun.misc.Cache*, + sun.misc.ClassLoaderUtil, + sun.misc.Compare, + sun.misc.ConditionLock, + sun.misc.CRC16, + sun.misc.Lock, + sun.misc.Regexp, + sun.misc.RequestProcessor, + sun.misc.Sort, + sun.misc.Request, + sun.misc.Timeable, + sun.misc.Timer, + sun.misc.TimerThread, + sun.misc.TimerTickThread, + sun.misc.UCDecoder, + sun.misc.UCEncoder, + sun.misc.UUDecoder, + sun.misc.UUEncoder, + com.sun.net.ssl.SSLContext, + sun.net.NetworkServer, + sun.net.URLCanonicalizer, + sun.reflect.misc.ConstructorUtil, + sun.reflect.FieldInfo, + sun.reflect.SignatureIterator, + sun.reflect.generics.reflectiveObjects.NotImplementedException, + sunw.io.Serializable, + sunw.util.EventListener, + sunw.util.EventObject; +} + +// Deprecated classes that aren't referenced/used go here. +module deprecated { + // add deprecated security classes once b78 is promoted +} + +/**************************************************************************/ + +module base { + // core classes + include java.lang.*, + java.lang.annotation.*, + java.lang.ref.*, + java.lang.reflect.*, + java.math.*, + java.net.*, + java.util.*, + java.util.concurrent.**, + java.util.jar.*, + java.util.regex.*, + java.util.spi.*, + java.util.zip.*, + java.text.**; + + exclude java.util.jar.Pack200*, + java.util.XMLUtils, + java.text.Bidi; + + include java.io.*, java.nio.*, java.nio.charset.**; + exclude java.io.TempFileHelper, java.nio.BufferPoolMXBean; + + // security APIs + // javax.crypto and javax.security.auth are included to avoid inconsistent + // spliting of JCA and JAAS. This adds about 85k. Also note that some deprecated + // classes must be included for now (see 6876158, 6876170) + include java.security.*, + java.security.cert.*, + java.security.interfaces.*, + java.security.spec.*, + javax.security.auth.**, + javax.crypto.**; + + // Sun and RSA security providers (except LDAP CertStore) + // roots sun.security.provider.* sun.security.provider.certpath.* sun.security.rsa.* + include com.sun.security.auth.PrincipalComparator, + com.sun.security.auth.SubjectCodeSource, + com.sun.security.auth.login.**, + com.sun.security.auth.Policy*, + sun.security.action.*, + sun.security.ec.*, + sun.security.jca.*, + sun.security.pkcs.*, + sun.security.provider.*, + sun.security.provider.certpath.*, + sun.security.rsa.*, + sun.security.util.*, + sun.security.validator.*, + sun.security.x509.*, + sun.security.timestamp.*; + + // this list is based on the classlist generated from the rootset + // need investigation + exclude sun.security.ec.ECD*, + sun.security.ec.ECKeyPairGenerator, + sun.security.ec.SunEC*, + sun.security.pkcs.PKCS10*, + sun.security.pkcs.EncodingException, + sun.security.util.AuthResources_*, + sun.security.util.Resources_*, + sun.security.util.BigInt, + sun.security.util.HostnameChecker, + sun.security.x509.CertAndKeyGen, + sun.security.util.PathList; + + // Kerberos not needed + exclude javax.security.auth.kerberos.**, + sun.security.jgss.**, + sun.security.krb5.**, + sun.security.ssl.Kerberos*, + org.ietf.jgss.**; + + // property events and annotations + include java.beans.ChangeListenerMap, + java.beans.IndexedPropertyChangeEvent, + java.beans.PropertyChange*, + java.beans.PropertyVetoException, + java.beans.VetoableChange*, + java.beans.ConstructorProperties; + + // mandatory charsets + include sun.nio.cs.*; + + exclude sun.nio.cs.AbstractCharsetProvider, + sun.nio.cs.CharsetMapping, + sun.nio.cs.IBM*, + sun.nio.cs.ISO*, + sun.nio.cs.KOI8_*, + sun.nio.cs.MS125*, + sun.nio.cs.UTF_32*, + sun.nio.cs.SingleByteDecoder, + sun.nio.cs.SingleByteEncoder; + + allow sun.nio.cs.ISO_8859_1, + sun.nio.cs.ISO_8859_15, + sun.nio.cs.MS1252; + + include sun.text.*, + sun.text.normalizer.*; + + // resource files + include sun/text/resources/*.icu; + + exclude sun.text.bidi.*, + sun.text.CharArrayCodePointIterator, + sun.text.CharSequenceCodePointIterator, + sun.text.CharacterIteratorCodePointIterator, + sun.text.CodePointIterator; + + include sun.util.*, + sun.util.calendar.*, + sun.util.logging.*, + sun.util.resources.LocaleData, + sun.util.resources.LocaleNamesBundle, + sun.util.resources.OpenListResourceBundle; + + // US_en locale + include sun.text.resources.BreakIteratorInfo, + sun.text.resources.FormatData, + sun.text.resources.FormatData_en_US, + sun.util.resources.CalendarData, + sun.util.resources.CalendarData_en, + sun.util.resources.TimeZoneNames, + sun.util.resources.TimeZoneNames_en, + sun.util.resources.TimeZoneNamesBundle, + sun.util.resources.LocaleNames, + sun.util.resources.LocaleNames_en, + sun.util.resources.LocalenamesBundles, + sun.util.resources.CurrencyNames, + sun.util.resources.CurrencyNames_en_US, + sun.util.EmptyListResourceBundle; + + // resources file needed by + // - sun.misc.ExtensionInfo + // - sun.security.provider.PolicyFile + // - com.sun.security.auth.PolicyFile + include sun.misc.resources.Messages, + sun.security.util.Resources, + sun.security.util.AuthResources; + + // java.nio.channels and java.nio.file not in base + include sun.nio.ch.Interruptible, + sun.nio.ch.DirectBuffer, + sun.nio.ByteBuffered; + + include sun.reflect.**; + + // protocol handlers + include sun.net.www.protocol.file.*, + sun.net.www.protocol.jar.*, + sun.net.www.protocol.http.*; + + include sun.net.*, + sun.net.spi.*, + sun.net.idn.*, + sun.net.util.*, + sun.net.www.*, + sun.net.www.http.*, + sun.net.spi.nameservice.*; + + // resource file for sun.net.idn + include sun/net/idn/*; + + // classes in net-compat + exclude sun.net.Telnet*, sun.net.TransferProtocolClient; + + // classes in deploy + exclude sun.net.www.protocol.http.AuthCacheBridge; + + // classes in security-jsse + exclude java.net.SecureCacheResponse; + + // launcher + include sun.launcher.LauncherHelper, sun.launcher.resources.launcher; + + include sun.misc.*; + exclude sun.misc.FIFOQueueEnumerator, + sun.misc.LIFOQueueEnumerator, + sun.misc.GC, + sun.misc.PerformanceLogger, + sun.misc.Queue, + sun.misc.QueueElement, + sun.misc.Ref, + sun.misc.VMSupport; + + // On Windows, OSEnvironment dependency + include sun.io.Win32ErrorMode; +} + +/**************************************************************************/ + +module charsets { + include sun.nio.cs.ext.**; + + include sun.nio.cs.AbstractCharsetProvider, + sun.nio.cs.CharsetMapping, + sun.nio.cs.IBM*, + sun.nio.cs.ISO*, + sun.nio.cs.KOI8_*, + sun.nio.cs.MS125*, + sun.nio.cs.SingleByte*, + sun.nio.cs.UTF_32*; + + exclude sun.nio.cs.ISO_8859_1, + sun.nio.cs.MS1252; + + // legacy sun.io converters + include sun.io.*; +} + +/**************************************************************************/ + +// For now, retains the current JRE extensions where localedata.jar in jre/lib/ext +module localedata { + include sun.util.resources.*_ar, + sun.util.resources.*_ar_*, + sun.util.resources.*_hi, + sun.util.resources.*_hi_*, + sun.util.resources.*_iw, + sun.util.resources.*_iw_*, + sun.util.resources.*_ja, + sun.util.resources.*_ja_*, + sun.util.resources.*_ko, + sun.util.resources.*_ko_*, + sun.util.resources.*_th, + sun.util.resources.*_th_*, + sun.util.resources.*_vi, + sun.util.resources.*_vi_*, + sun.util.resources.*_zh, + sun.util.resources.*_zh_*; + include sun.text.resources.*_ar, + sun.text.resources.*_ar_*, + sun.text.resources.*_hi, + sun.text.resources.*_hi_*, + sun.text.resources.*_iw, + sun.text.resources.*_iw_*, + sun.text.resources.*_ja, + sun.text.resources.*_ja_*, + sun.text.resources.*_ko, + sun.text.resources.*_ko_*, + sun.text.resources.*_th, + sun.text.resources.*_th_*, + sun.text.resources.*_vi, + sun.text.resources.*_vi_*, + sun.text.resources.*_zh, + sun.text.resources.*_zh_*; +} + +module resources { + include sun.text.resources.*, sun.util.resources.*, sun.misc.resources.*; +} + +/**************************************************************************/ + +module nio { + include java.nio.channels.**, java.nio.file.**, com.sun.nio.file.**; + + // this is excluded from base + include java.io.TempFileHelper; + + // provider implementations and their dependencies + include sun.nio.ch.*, sun.nio.fs.**; + exclude sun.nio.ch.Sctp*; +} + +/**************************************************************************/ + +module pack200 { + include java.util.jar.Pack200*, com.sun.java.util.jar.pack.**; +} + +/**************************************************************************/ + +module logging { + include java.util.logging.*, sun.util.logging.**; + exclude java.util.logging.PlatformLoggingMXBean; + + // Formatter for HTTP messages + include sun.net.www.protocol.http.logging.*; +} + +/**************************************************************************/ + +module management-snmp { + include com.sun.jmx.snmp.**, sun.management.snmp.**; +} + +module management-iiop { + include com.sun.jmx.remote.protocol.iiop.*; + + // stubs and ties + include javax.management.remote.rmi._*, + org.omg.stub.javax.management.remote.rmi.**; +} + +module management { + include java.lang.management.*, com.sun.management.**, sun.management.**; + include javax.management.**, com.sun.jmx.**; + + // other management interfaces + include java.nio.BufferPoolMXBean; + include java.util.logging.PlatformLoggingMXBean; + + // supporting classes in sun.misc + include sun.misc.VMSupport; +} + +/**************************************************************************/ + +module tracing { + // tracing + include com.sun.tracing.**, sun.tracing.**; +} + +module instrument { + // java.lang.instrument + include java.lang.instrument.*, sun.instrument.*; + + // HPROF support + include com.sun.demo.jvmti.hprof.*; + + include tracing; +} + +/**************************************************************************/ + +module rmi-activation { + include java.rmi.activation.**, + sun.rmi.server.Act*, + sun.rmi.server.InactiveGroupException; +} + +module rmic { + // rmic is included in tools + include sun.rmi.rmic.**; +} + +module rmi { + include java.rmi.**, sun.rmi.**, com.sun.rmi.**; + + // SSL factories are in rmi + include javax.rmi.ssl.**; + + // supporting classes in sun.misc and dependencies + include sun.misc.GC; +} + +/**************************************************************************/ + +module prefs { + include java.util.prefs.*; +} + +/**************************************************************************/ + +module security-jsse { + include javax.net.**, + javax.security.cert.*, + java.net.SecureCacheResponse, + com.sun.net.ssl.**, + com.sun.security.cert.internal.x509.*, + sun.security.ssl.*, + sun.net.www.protocol.https.**, + sun.security.internal.interfaces.Tls*, + sun.security.internal.spec.Tls*, + sun.security.util.HostnameChecker; +} + +module security-sunpkcs11 { + include sun.security.pkcs11.**; +} + +module security-sunjce { + include com.sun.crypto.provider.*; +} + +module security-sunec { + include sun.security.ec.*; +} + +module security-sunmscapi { + include sun.security.mscapi.*; +} + +module security-kerberos { + include javax.security.auth.kerberos.*, + com.sun.security.jgss.**, + com.sun.security.auth.module.Krb5LoginModule, + com.sun.security.sasl.gsskerb.**, // GSSAPI SASL mechanism + sun.security.jgss.**, + sun.security.ssl.krb5.**, + sun.security.krb5.**, + org.ietf.jgss.**, + sun.net.www.protocol.http.spnego.*; +} + +module security-sasl { + include javax.security.sasl.**, + com.sun.security.sasl.**; +} + +module security-xmldsig { + include javax.xml.crypto.**, + org.jcp.xml.dsig.**, + com.sun.org.apache.xml.internal.security.**; +} + +module security-smartcardio { + include javax.smartcardio.**, sun.security.smartcardio.**; +} + +module security-auth { + include com.sun.security.auth.**, sun.security.util.AuthResources_*; +} + +module security-misc { + include security-auth; + + include sun.security.pkcs.*, + sun.security.pkcs12.*; + + // this class is a candidate to be removed. + include sun.security.util.BigInt; +} + +module security-resources { + include sun.security.util.Resources_*; +} + +module security-compat { + include java.security.acl.*, sun.security.acl.*; +} + +/**************************************************************************/ + +module jndi-ldap { + include javax.naming.ldap.**, + com.sun.jndi.ldap.**, + com.sun.jndi.url.ldap.*, + com.sun.jndi.url.ldaps.*, + sun.security.provider.certpath.ldap.**; +} + +module jndi-rmiregistry { + include com.sun.jndi.rmi.**, com.sun.jndi.url.rmi.**; +} + +module jndi-dns { + include net-dns; + include com.sun.jndi.dns.**, com.sun.jndi.url.dns.**; +} + +module jndi-cosnaming { + include com.sun.jndi.cosnaming.**, + com.sun.jndi.toolkit.corba.**, + com.sun.jndi.url.corbaname.**, + com.sun.jndi.url.iiop.**, + com.sun.jndi.url.iiopname.**; +} + +// framework/API and classes used by providers +module jndi { + include javax.naming.**, + com.sun.naming.**, + com.sun.jndi.toolkit.ctx.**, + com.sun.jndi.toolkit.dir.**, + com.sun.jndi.toolkit.url.**; +} + +/**************************************************************************/ + +module jdbc-base { + include java.sql.**, javax.sql.*; + exclude javax.sql.XA*; +} + +module jdbc-enterprise { + include javax.sql.**, com.sun.rowset.**; +} + +module jdbc-odbc { + include sun.jdbc.odbc.**; +} + +/**************************************************************************/ + +module scripting { + include javax.script.**; + + // supporting classes for scripting engines + include com.sun.script.util.**; +} + +module scripting-rhino { + include com.sun.script.javascript.**, sun.org.mozilla.javascript.**; +} + +/**************************************************************************/ + +module httpserver { + include com.sun.net.httpserver.**, sun.net.httpserver.**; +} + +/**************************************************************************/ + +module sctp { + // API and dependencies + include com.sun.nio.sctp.**, sun.nio.ch.Sctp*; +} + +/**************************************************************************/ + +module langtools { + include javax.tools.**, javax.lang.model.**, javax.annotation.processing.**; + + // include mirror API for now + include com.sun.mirror.**; + + // include the JSR292 APIs for now + include java.dyn.**, sun.dyn.**; +} + +/**************************************************************************/ + +module beans { + include java.beans.**, com.sun.beans.**, sun.beans.**; +} + +/**************************************************************************/ + +module jaxp-parsers-api { + include javax.xml.*, javax.xml.parsers.**, + org.w3c.dom.**, org.w3c.sax.**, org.xml.sax.**; +} + +module jaxp-api { + include javax.xml.**; + exclude javax.xml.crypto.**, // XML-DSIG + javax.xml.bind.**, // JAX-WS + javax.xml.soap.**, + javax.xml.ws.**; +} + +module jaxp-xerces-impl { + include com.sun.org.apache.xerces.internal.**; + + // include in xerces-impl due to circular dependencies + include com.sun.org.apache.xml.internal.serialize.**, + com.sun.xml.internal.stream.**; + exclude com.sun.xml.internal.stream.buffer.**; // JAX-WS +} + +// required by Xerces and JAX-WS +module jaxp-xerces-resolver { + include com.sun.org.apache.xml.internal.resolver.**; +} + +module jaxp-xalan { + include com.sun.org.apache.xalan.internal.**, + com.sun.org.apache.xpath.internal.**, + com.sun.org.apache.xml.internal.dtm.**, + com.sun.org.apache.xml.internal.res.**, + com.sun.org.apache.xml.internal.serializer.**, + com.sun.org.apache.xml.internal.utils.**, + com.sun.org.apache.bcel.internal.**, + com.sun.org.apache.regexp.internal.**, + com.sun.java_cup.internal.**; +} + +/**************************************************************************/ + +module jaxws-tools { + include com.sun.codemodel.**, + com.sun.xml.internal.dtdparser.**, + com.sun.xml.internal.rngom.**, + com.sun.xml.internal.xsom.**, + com.sun.istack.internal.tools.**, + com.sun.istack.internal.ws.**, + com.sun.tools.internal.xjc.**, + com.sun.tools.internal.ws.**, + com.sun.tools.internal.jxc.**, + org.relaxng.datatype.**; +} + +module jaxws { + include javax.jws.**, + javax.xml.bind.**, + javax.xml.soap.**, + javax.xml.ws.**, + org.relaxng.**, + com.sun.istack.internal.*, + com.sun.istack.internal.localization.*, + com.sun.xml.internal.**; + + // include JAF in this module + include javax.activation.**, com.sun.activation.**; + + include META-INF/mailcap.default, + META-INF/mimetypes.default; +} + +/**************************************************************************/ +module enterprise-base { + include javax.transaction.**, // JTA + javax.annotation.*; // Common annotations (JSR-250) +} + +/**************************************************************************/ +module corba { + include javax.activity.**, + javax.rmi.*, + javax.rmi.CORBA.*, + javax.transaction.**, + com.sun.corba.**, + com.sun.org.omg.**, + org.omg.**, + sun.corba.**; + + // JMX remote API + exclude org.omg.stub.javax.management.**; +} + +/**************************************************************************/ + +module applet { + include java.applet.**, + sun.applet.**; +} + +module awt { + include java.awt.**, + sun.awt.**, + com.sun.awt.**; +} + +module font { + include sun.font.**; +} + +module imageio { + include javax.imageio.**, + com.sun.imageio.**; +} + +module java2d { + include sun.dc.**, + sun.java2d.**, + com.sun.image.**; +} + +module media { + include com.sun.media.**; +} + +module print { + include javax.print.**, + sun.print.**; +} + +module sound { + include javax.sound.**; +} + +module swing { + include javax.swing.**, + sun.swing.**, + // sajdi also contains classes in subpackages of com.sun.java.swing; + // so use '*' instead of '**' + com.sun.java.swing.*, + com.sun.java.swing.plaf.**, + com.sun.swing.**; +} + +module client { + include applet, + awt, + font, + imageio, + java2d, + media, + print, + sound, + swing; + + include javax.accessibility.*, + sun.audio.**, + com.sun.accessibility.**; + + // Bidi class in client module for now + include java.text.Bidi, sun.text.bidi.*; + + // PerformanceLogger and dependencies + include sun.misc.Ref, sun.misc.PerformanceLogger; + + // misc. dependencies that we need to examine + include sun.text.CodePointIterator, + sun.text.Char*, + sun.misc.Queue*, + sun.misc.FIFOQueueEnumerator, + sun.misc.LIFOQueueEnumerator; + + // content handlers + include sun.net.www.content.audio.**, + sun.net.www.content.image.**; +} + +/**************************************************************************/ + +module jkernel { + include sun.jkernel.*; +} + +module deploy { + include jkernel; + + // For now, all plugin and JNLP + include com.sun.java.browser.**, + netscape.**, + sun.plugin.**, + sun.plugin2.**,, + com.sun.deploy.**, + com.sun.javaws.**, + javax.jnlp.*, + com.sun.jnlp.*; + + // Hook for http authentication + include sun.net.www.protocol.http.AuthCacheBridge; +} + +/**************************************************************************/ + +module net-dns { + include sun.net.dns.**; // to access DNS config. + include sun.net.spi.nameservice.dns.**; // for DNS-only name service. +} + +module net-compat { + // NTLM authentication support + include sun.net.www.protocol.http.ntlm.*; + + // ftp and mail clients + include sun.net.ftp.**, sun.net.smtp.**; + + // Legacy protocol handlers + include sun.net.www.protocol.**; + + // Legacy content handlers + include sun.net.www.content.**; + + include sun.net.Telnet*, + sun.net.TransferProtocolClient; +} + +/**************************************************************************/ + +// jar-tool and security-tools are JRE tools +module jar-tool { + include sun.tools.jar.**; +} + +module security-tools { + include sun.security.tools.**; + + // Used by security tools + include sun.security.util.PathList, sun.security.x509.CertAndKeyGen; + + exclude sun.security.tools.JarBASE64Encoder, + sun.security.tools.JarSigner, + sun.security.tools.JarSignerParameters, + sun.security.tools.JarSignerResources*, + sun.security.tools.SignatureFile, + sun.security.tools.TimestampedSigner; +} + +module jconsole { + include sun.tools.jconsole.**, + com.sun.tools.jconsole.*; +} + +module serialver { + include sun.tools.serialver.**; +} + +module gui-tools { + include jconsole, + serialver; + + include com.sun.tools.example.debug.bdi.**, + com.sun.tools.example.debug.gui.**, + com.sun.tools.internal.xjc.**; +} + +module attach { + include com.sun.tools.attach.**, + sun.tools.attach.**; +} + +module debugging { + include com.sun.jdi.**, com.sun.tools.jdi.**; +} + +module jdb { + include com.sun.tools.example.debug.**; +} + +module sajdi { + include sun.jvm.hotspot.**, + com.sun.java.swing.ui.**, + com.sun.java.swing.action.**; + + include toolbarButtonGraphics/**; + include sa.properties; +} + +module tools { + include attach, + debugging, + jaxws-tools, + jdb, + rmic, + sajdi; + + // include gui-tools in tools module unless the tool binaries + // are modified to load the new gui-tools.jar + include gui-tools; + + include com.sun.tools.**, sun.tools.**, sun.security.tools.**, + com.sun.jarsigner.**, + com.sun.javac.**, + com.sun.javadoc.**, com.sun.source.**, + sun.jvmstat.**; +} + +/**************************************************************************/ + +module servicetag { + include com.sun.servicetag.**; +} + +/**************************************************************************/ + +// these classes will be removed from JRE - see 6909002 +module inputmethods-ext { + include com.sun.inputmethods.internal.**; +} + +/**************************************************************************/ + +// Workaround for US export and local policy files +// They are currently in signed jars under the jre/lib/security directory +module US_export_policy { + include default_US_export.policy; +} + +module local_policy { + include default_local.policy, + exempt_local.policy; +} + +/**************************************************************************/ + +module other { + include **; +} diff --git a/jdk/make/modules/modules.group b/jdk/make/modules/modules.group new file mode 100644 index 00000000000..64abd180718 --- /dev/null +++ b/jdk/make/modules/modules.group @@ -0,0 +1,29 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * Example: + * module jdbc { + * include jdbc-base, jdbc-enterprise, jdbc-odbc; + * } + */ diff --git a/jdk/make/modules/optional.depconfig b/jdk/make/modules/optional.depconfig new file mode 100644 index 00000000000..83f8bc79f91 --- /dev/null +++ b/jdk/make/modules/optional.depconfig @@ -0,0 +1,149 @@ +# +# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# public final java.nio.channels.SocketChannel getChannel() +@Optional + sun.security.ssl.BaseSSLSocketImpl -> java.nio.channels.SocketChannel + +# public XMLDecoder(java.io.InputStream) +# public XMLDecoder(java.io.InputStream, java.lang.Object) +# public XMLDecoder(java.io.InputStream, java.lang.Object, java.beans.ExceptionListener) +# public XMLDecoder(java.io.InputStream, java.lang.Object, java.beans.ExceptionListener, java.lang.ClassLoader) +# public XMLDecoder(org.xml.sax.InputSource) +@Optional + java.beans.XMLDecoder -> com.sun.beans.decoder.DocumentHandler + java.beans.XMLDecoder -> org.xml.sax.InputSource + +# public static org.xml.sax.helpers.DefaultHandler createHandler(java.lang.Object, java.beans.ExceptionListener, java.lang.ClassLoader) +@Optional + java.beans.XMLDecoder -> com.sun.beans.decoder.DocumentHandler + java.beans.XMLDecoder -> org.xml.sax.helpers.DefaultHandler + +# public final java.nio.channels.FileChannel getChannel() +@Optional + java.net.SocketInputStream -> java.nio.channels.FileChannel + +# public final java.nio.channels.FileChannel getChannel() +@Optional + java.net.SocketOutputStream -> java.nio.channels.FileChannel + +# public Scanner(java.io.File) +# public Scanner(java.io.File, java.lang.String) +@Optional + java.util.Scanner -> java.nio.channels.ReadableByteChannel + java.util.Scanner -> java.nio.channels.Channels + +# public Scanner(java.nio.file.FileRef) +# public Scanner(java.nio.file.FileRef, java.lang.String) +@Optional + java.util.Scanner -> java.nio.file.FileRef + java.util.Scanner -> java.nio.file.OpenOption + +# public Scanner(java.nio.channels.ReadableByteChannel) +# public Scanner(java.nio.channels.ReadableByteChannel, java.lang.String) +@Optional + java.util.Scanner -> java.nio.channels.ReadableByteChannel + java.util.Scanner -> java.nio.channels.Channels + +# private static void loadSnmpAgent(java.lang.String, java.util.Properties) +@Optional + sun.management.Agent -> sun.management.snmp.AdaptorBootstrap + +# public void connect() +@Optional + sun.net.www.protocol.http.HttpURLConnection -> java.net.SecureCacheResponse + +# private static sun.security.util.PermissionFactory permissionFactory() +@Optional + sun.security.util.SecurityConstants$AWT -> sun.awt.AWTPermissionFactory + +# sun.util.logging.LoggingSupport +@Optional + sun.util.logging.LoggingSupport -> java.util.logging.LoggingProxyImpl + +# public java.nio.channels.DatagramChannel getChannel() +@Optional + java.net.DatagramSocket -> java.nio.channels.DatagramChannel + +# public java.nio.channels.SocketChannel getChannel() +@Optional + java.net.Socket -> java.nio.channels.SocketChannel + +# public java.nio.channels.ServerSocketChannel getChannel() +@Optional + java.net.ServerSocket -> java.nio.channels.ServerSocketChannel + +# public final java.nio.channels.FileChannel getChannel() +@Optional + java.io.RandomAccessFile -> java.nio.channels.FileChannel + java.io.RandomAccessFile -> sun.nio.ch.FileChannelImpl + +# public static sun.nio.cs.StreamDecoder forDecoder(java.nio.channels.ReadableByteChannel, java.nio.charset.CharsetDecoder, int) +@Optional + sun.nio.cs.StreamDecoder -> java.nio.channels.ReadableByteChannel + +# private static java.nio.channels.FileChannel getChannel(java.io.FileInputStream) +# StreamDecoder(java.io.InputStream, java.lang.Object, java.nio.charset.CharsetDecoder) +@Optional + sun.nio.cs.StreamDecoder -> java.nio.channels.FileChannel + +# StreamDecoder(java.nio.channels.ReadableByteChannel, java.nio.charset.CharsetDecoder, int) +@Optional + sun.nio.cs.StreamDecoder -> java.nio.channels.ReadableByteChannel + +# public static java.io.File createTemporaryFile(java.lang.String, java.lang.String, java.nio.file.attribute.FileAttribute[]) +@Optional + java.io.File -> java.io.TempFileHelper + java.io.File -> java.nio.file.attribute.FileAttribute + +# public java.nio.file.Path toPath() +@Optional + java.io.File -> java.nio.file.Paths + java.io.File -> java.nio.file.Path + +# public static sun.nio.cs.StreamEncoder forEncoder(java.nio.channels.WritableByteChannel, java.nio.charset.CharsetEncoder, int) +# private StreamEncoder(java.nio.channels.WritableByteChannel, java.nio.charset.CharsetEncoder, int) +@Optional + sun.nio.cs.StreamEncoder -> java.nio.channels.WritableByteChannel + +# public java.nio.channels.FileChannel getChannel() +@Optional + java.io.FileOutputStream -> java.nio.channels.FileChannel + java.io.FileOutputStream -> sun.nio.ch.FileChannelImpl + +# public java.nio.channels.FileChannel getChannel() +@Optional + java.io.FileInputStream -> java.nio.channels.FileChannel + java.io.FileInputStream -> sun.nio.ch.FileChannelImpl + +# public void loadFromXML(java.io.InputStream) +# public void storeToXML(java.io.OutputStream, java.lang.String, java.lang.String) +@Optional + java.util.Properties -> java.util.XMLUtils + +# public static java.nio.channels.Channel inheritedChannel() +@Optional + java.lang.System -> java.nio.channels.Channel + java.lang.System -> java.nio.channels.spi.SelectorProvider diff --git a/jdk/make/modules/tools/Makefile b/jdk/make/modules/tools/Makefile new file mode 100644 index 00000000000..415c07d7563 --- /dev/null +++ b/jdk/make/modules/tools/Makefile @@ -0,0 +1,154 @@ +# +# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# +# Makefile for building the classanalyzer tool +# + +BUILDDIR = ../.. +include $(BUILDDIR)/common/Defs.gmk + +PKGDIR = com/sun/classanalyzer +BUILDTOOL_SOURCE_ROOT = src +BUILDTOOL_MAIN = $(PKGDIR)/ClassAnalyzer.java +BUILTTOOL_MAINCLASS = $(subst /,.,$(BUILDTOOL_MAIN:%.java=%)) + +BUILDTOOL_MAIN_SOURCE_FILE = $(BUILDTOOL_SOURCE_ROOT)/$(BUILDTOOL_MAIN) +BUILDTOOL_MANIFEST_FILE = $(BUILDTOOLCLASSDIR)/classanalyzer_manifest.mf + +FILES_java := $(shell $(CD) $(BUILDTOOL_SOURCE_ROOT) \ + && $(FIND) $(PKGDIR) -type f -print) + +FILES_class = $(FILES_java:%.java=$(BUILDTOOLCLASSDIR)/%.class) + +CLASSANALYZER_JAR_FILE = $(BUILDTOOLJARDIR)/classanalyzer.jar + +# +# ClassAnalyzer depends on the com.sun.tools.classfile API. +# The tool is compiled with the latest version of the classfile +# library in the langtools repo to make sure that synchronized +# change is made if the classfile API is changed. +# +# If langtools repo exists, build its own copy of the +# classfile library and use it for compile time and runtime. +# If not exist (the top level repo is not a forest), use +# the built jdk tools that imports tools.jar from the latest +# promoted build. +# +# If the classfile API is changed but not yet in a promoted build, +# the build might fail and the tool would need the langtools repo +# to build in that case. +# +ifndef LANGTOOLS_TOPDIR + LANGTOOLS_TOPDIR=$(JDK_TOPDIR)/../langtools +endif + +LANGTOOLS_TOPDIR_EXISTS := $(shell \ + if [ -d $(LANGTOOLS_TOPDIR) ] ; then \ + echo true; \ + else \ + echo false; \ + fi) + +CLASSFILE_SRC = $(LANGTOOLS_TOPDIR)/src/share/classes +CLASSFILE_PKGDIR = com/sun/tools/classfile + +ifeq ($(LANGTOOLS_TOPDIR_EXISTS), true) + FILES_classfile_java := $(shell \ + $(CD) $(CLASSFILE_SRC) && \ + $(FIND) $(CLASSFILE_PKGDIR) -name '*.java' -print) + FILES_classfile_class = $(FILES_classfile_java:%.java=$(BUILDTOOLCLASSDIR)/%.class) + CLASSFILE_JAR_FILE = $(BUILDTOOLJARDIR)/classfile.jar + BUILDTOOL_JAVAC = $(BOOT_JAVAC_CMD) $(JAVAC_JVM_FLAGS) \ + $(BOOT_JAVACFLAGS) -classpath $(CLASSFILE_JAR_FILE) + BUILDTOOL_JAVA = $(BOOT_JAVA_CMD) $(JAVA_TOOLS_FLAGS) \ + -Xbootclasspath/p:$(CLASSFILE_JAR_FILE) +else + # if langtools doesn't exist, use tools from the built jdk + BUILDTOOL_JAVAC = $(BINDIR)/javac $(JAVAC_JVM_FLAGS) \ + $(BOOT_JAVACFLAGS) + BUILDTOOL_JAVA = $(BINDIR)/java $(JAVA_TOOLS_FLAGS) +endif + +# Location of the output modules.list, .classlist +# and other output files generated by the class analyzer tool. +# +MODULE_CLASSLIST = $(MODULES_TEMPDIR)/classlist + +all build: classanalyzer gen-classlist + +classanalyzer: $(CLASSFILE_JAR_FILE) $(CLASSANALYZER_JAR_FILE) + +gen-classlist: + @$(ECHO) ">>>Making "$@" @ `$(DATE)` ..." + @$(RM) -rf $(MODULE_CLASSLIST) + @$(MKDIR) -p $(MODULE_CLASSLIST) + $(BUILDTOOL_JAVA) \ + -Dclassanalyzer.debug \ + -jar $(CLASSANALYZER_JAR_FILE) \ + -jdkhome $(OUTPUTDIR) \ + -config ../modules.config \ + -config ../modules.group \ + -depconfig ../jdk7.depconfig \ + -depconfig ../optional.depconfig \ + -showdynamic \ + -output $(MODULE_CLASSLIST) + @$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..." + +$(BUILDTOOL_MANIFEST_FILE): $(BUILDTOOL_MAIN_SOURCE_FILE) + @$(prep-target) + $(ECHO) "Main-Class: $(BUILTTOOL_MAINCLASS)" > $@ + +$(BUILDTOOLCLASSDIR)/$(CLASSFILE_PKGDIR)/%.class : $(CLASSFILE_SRC)/$(CLASSFILE_PKGDIR)/%.java + @$(prep-target) + @$(BUILDTOOL_JAVAC) \ + -sourcepath $(CLASSFILE_SRC) \ + -d $(BUILDTOOLCLASSDIR) $< + +$(BUILDTOOLCLASSDIR)/%.class : $(BUILDTOOL_SOURCE_ROOT)/%.java + @$(prep-target) + $(BUILDTOOL_JAVAC) \ + -sourcepath $(BUILDTOOL_SOURCE_ROOT) \ + -d $(BUILDTOOLCLASSDIR) $< + +$(CLASSANALYZER_JAR_FILE): $(BUILDTOOL_MANIFEST_FILE) $(FILES_class) + @$(prep-target) + $(BOOT_JAR_CMD) cfm $@ $(BUILDTOOL_MANIFEST_FILE) \ + -C $(BUILDTOOLCLASSDIR) $(PKGDIR) $(BOOT_JAR_JFLAGS) || $(RM) $@ + @$(java-vm-cleanup) + +$(BUILDTOOLJARDIR)/classfile.jar: $(FILES_classfile_class) + @$(prep-target) + $(CD) $(BUILDTOOLCLASSDIR) && \ + $(BOOT_JAR_CMD) cf $@ \ + $(CLASSFILE_PKGDIR) $(BOOT_JAR_JFLAGS) || $(RM) $@ + @$(java-vm-cleanup) + +clean clobber:: + @$(RM) -rf $(BUILDTOOLCLASSDIR)/$(PKGDIR) + @$(RM) -rf $(BUILDTOOLCLASSDIR)/$(CLASSFILE_PKGDIR) + @$(RM) $(BUILDTOOL_MANIFEST_FILE) + @$(RM) $(CLASSANALYZER_JAR_FILE) + @$(RM) $(CLASSFILE_JAR_FILE) diff --git a/jdk/make/modules/tools/build.xml b/jdk/make/modules/tools/build.xml new file mode 100644 index 00000000000..c52de21af90 --- /dev/null +++ b/jdk/make/modules/tools/build.xml @@ -0,0 +1,29 @@ + + + + + + diff --git a/jdk/make/modules/tools/nbproject/project.properties b/jdk/make/modules/tools/nbproject/project.properties new file mode 100644 index 00000000000..84df879f82b --- /dev/null +++ b/jdk/make/modules/tools/nbproject/project.properties @@ -0,0 +1,86 @@ +# +# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +application.title=classanalyzer +application.vendor=mchung +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form + +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources + +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results + +cp.extra=${tools.jar} + +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} + +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/classanalyzer.jar +dist.javadoc.dir=${dist.dir}/javadoc + +excludes= + +file.reference.tools.jar=${jdk.home}/lib/tools.jar +file.reference.tools-src=src +includes=** +jar.compress=false +javac.classpath=\ + ${file.reference.tools.jar} +javac.deprecation=false +javac.source=1.5 +javac.target=1.5 +javac.test.classpath= +javadoc.author=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=false +javadoc.use=false +javadoc.version=false +main.class=com.sun.classanalyzer.ClassAnalyzer +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +platform.active=JDK_1.6 +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project +# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value +# or test-sys-prop.name=value to set system properties for unit tests): +run.jvmargs=-Xmx256m +run.test.classpath= +source.encoding=UTF-8 +src.dir=${file.reference.tools-src} diff --git a/jdk/make/modules/tools/nbproject/project.xml b/jdk/make/modules/tools/nbproject/project.xml new file mode 100644 index 00000000000..bd83ccaeb9b --- /dev/null +++ b/jdk/make/modules/tools/nbproject/project.xml @@ -0,0 +1,39 @@ + + + + + org.netbeans.modules.java.j2seproject + + + classanalyzer + + + + + + + + diff --git a/jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotatedDependency.java b/jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotatedDependency.java new file mode 100644 index 00000000000..72b21d9949e --- /dev/null +++ b/jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotatedDependency.java @@ -0,0 +1,627 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ +package com.sun.classanalyzer; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; +import java.util.Map; + +import com.sun.classanalyzer.Module.Reference; +import java.util.LinkedList; +import java.util.TreeMap; + +/** + * + * @author Mandy Chung + */ +public abstract class AnnotatedDependency implements Comparable { + + final Klass from; + final List classes; + protected boolean optional; + String description; + Klass.Method method; + private List filters = null; + + public AnnotatedDependency(Klass klass) { + this(klass, false); + } + + public AnnotatedDependency(Klass klass, boolean optional) { + this.from = klass; + this.classes = new ArrayList(); + this.optional = optional; + } + + abstract String getTag(); + + abstract boolean isDynamic(); + + void setMethod(Klass.Method m) { + this.method = m; + } + + void addElement(String element, List value) { + if (element.equals("value")) { + addValue(value); + } else if (element.equals("description")) { + description = value.get(0); + } else if (element.equals("optional")) { + optional = value.get(0).equals("1") || Boolean.parseBoolean(value.get(0)); + } + } + + void addValue(List value) { + for (String s : value) { + if ((s = s.trim()).length() > 0) { + classes.add(s); + } + } + } + + List getValue() { + return classes; + } + + boolean isOptional() { + return optional; + } + + boolean isEmpty() { + return classes.isEmpty(); + } + + boolean matches(String classname) { + synchronized (this) { + // initialize filters + if (filters == null) { + filters = new ArrayList(); + for (String pattern : classes) { + filters.add(new Filter(pattern)); + } + + } + } + + for (Filter f : filters) { + if (f.matches(classname)) { + return true; + } + } + return false; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + for (String v : getValue()) { + if (sb.length() == 0) { + sb.append(getTag()); + sb.append("\n"); + } else { + sb.append("\n"); + } + sb.append(" "); + sb.append(from.getClassName()).append(" -> "); + sb.append(v); + } + return sb.toString(); + } + + @Override + public int compareTo(AnnotatedDependency o) { + if (from == o.from) { + if (this.getClass().getName().equals(o.getClass().getName())) { + String s1 = classes.isEmpty() ? "" : classes.get(0); + String s2 = o.classes.isEmpty() ? "" : o.classes.get(0); + return s1.compareTo(s2); + } else { + return this.getClass().getName().compareTo(o.getClass().getName()); + } + + } else { + return from.compareTo(o.from); + } + } + + @Override + public int hashCode() { + int hashcode = 7 + 73 * from.hashCode(); + for (String s : classes) { + hashcode ^= s.hashCode(); + } + return hashcode; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof AnnotatedDependency)) { + return false; + } + AnnotatedDependency other = (AnnotatedDependency) obj; + boolean ret = this.from.equals(other.from) && this.classes.size() == other.classes.size(); + if (ret == true) { + for (int i = 0; i < this.classes.size(); i++) { + ret = ret && this.classes.get(i).equals(other.classes.get(i)); + } + } + return ret; + } + + static class ClassForName extends AnnotatedDependency { + + public ClassForName(Klass klass, boolean optional) { + super(klass, optional); + } + + @Override + String getTag() { + if (this.optional) { + return TAG + "(optional)"; + } else { + return TAG; + } + } + + @Override + boolean isDynamic() { + return true; + } + static final String TYPE = "sun.annotation.ClassForName"; + static final String TAG = "@ClassForName"; + } + + static class NativeFindClass extends AnnotatedDependency { + + public NativeFindClass(Klass klass, boolean optional) { + super(klass, optional); + } + + @Override + String getTag() { + if (this.optional) { + return TAG + "(optional)"; + } else { + return TAG; + } + } + + @Override + boolean isDynamic() { + return true; + } + static final String TYPE = "sun.annotation.NativeFindClass"; + static final String TAG = "@NativeFindClass"; + } + + static class Provider extends AnnotatedDependency { + + private List services = new ArrayList(); + + Provider(Klass klass) { + super(klass, true); + } + + @Override + boolean isDynamic() { + return true; + } + + public List services() { + return services; + } + + @Override + void addElement(String element, List value) { + if (element.equals("service")) { + List configFiles = new ArrayList(); + for (String s : value) { + if ((s = s.trim()).length() > 0) { + configFiles.add(metaInfPath + s); + } + } + addValue(configFiles); + } + } + + @Override + void addValue(List value) { + for (String s : value) { + if ((s = s.trim()).length() > 0) { + if (s.startsWith("META-INF")) { + services.add(s); + readServiceConfiguration(s, classes); + } else { + throw new RuntimeException("invalid value" + s); + } + } + } + } + + boolean isEmpty() { + return services.isEmpty(); + } + static final String metaInfPath = + "META-INF" + File.separator + "services" + File.separator; + + static void readServiceConfiguration(String config, List names) { + BufferedReader br = null; + try { + InputStream is = ClassPath.open(config); + if (is != null) { + // Properties doesn't perserve the order of the input file + br = new BufferedReader(new InputStreamReader(is, "utf-8")); + int lc = 1; + while ((lc = parseLine(br, lc, names)) >= 0); + } + } catch (IOException ex) { + throw new RuntimeException(ex); + } finally { + if (br != null) { + try { + br.close(); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + } + } + } + + // Parse a single line from the given configuration file, adding the name + // on the line to the names list. + // + private static int parseLine(BufferedReader r, int lc, List names) throws IOException { + String ln = r.readLine(); + if (ln == null) { + return -1; + } + int ci = ln.indexOf('#'); + if (ci >= 0) { + ln = ln.substring(0, ci); + } + ln = ln.trim(); + int n = ln.length(); + if (n != 0) { + if ((ln.indexOf(' ') >= 0) || (ln.indexOf('\t') >= 0)) { + throw new RuntimeException("Illegal configuration-file syntax"); + } + int cp = ln.codePointAt(0); + if (!Character.isJavaIdentifierStart(cp)) { + throw new RuntimeException("Illegal provider-class name: " + ln); + } + for (int i = Character.charCount(cp); i < n; i += Character.charCount(cp)) { + cp = ln.codePointAt(i); + if (!Character.isJavaIdentifierPart(cp) && (cp != '.')) { + throw new RuntimeException("Illegal provider-class name: " + ln); + } + } + if (!names.contains(ln)) { + names.add(ln); + } + } + return lc + 1; + } + + @Override + String getTag() { + return TAG; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof AnnotatedDependency)) { + return false; + } + Provider other = (Provider) obj; + boolean ret = this.from.equals(other.from) && + this.services.size() == other.services.size(); + if (ret == true) { + for (int i = 0; i < this.services.size(); i++) { + ret = ret && this.services.get(i).equals(other.services.get(i)); + } + } + return ret; + } + + @Override + public int hashCode() { + int hashcode = 7 + 73 * from.hashCode(); + for (String s : services) { + hashcode ^= s.hashCode(); + } + return hashcode; + } + + @Override + public List getValue() { + List result = new ArrayList(); + result.addAll(services); + return result; + } + static final String TYPE = "sun.annotation.Provider"; + static final String TAG = "@Provider"; + } + + static class OptionalDependency extends AnnotatedDependency { + + static boolean isOptional(Klass from, Klass to) { + synchronized (OptionalDependency.class) { + if (optionalDepsMap == null) { + // Build a map of classes to its optional dependencies + initDependencies(); + } + } + for (Reference ref : optionalDepsMap.keySet()) { + if (ref.referrer() == from && ref.referree() == to) { + return true; + } + } + return false; + } + + OptionalDependency(Klass klass) { + super(klass, true); + } + + @Override + boolean isDynamic() { + return false; + } + + @Override + String getTag() { + return TAG; + } + static final String TYPE = "sun.annotation.Optional"; + static final String TAG = "@Optional"; + } + + static class CompilerInline extends AnnotatedDependency { + + public CompilerInline(Klass klass) { + super(klass); + } + + @Override + String getTag() { + return TAG; + } + + @Override + boolean isDynamic() { + return false; + } + static final String TYPE = "sun.annotation.Inline"; + static final String TAG = "@Inline"; + } + + static class Filter { + + final String pattern; + final String regex; + + Filter(String pattern) { + this.pattern = pattern; + + boolean isRegex = false; + for (int i = 0; i < pattern.length(); i++) { + char p = pattern.charAt(i); + if (p == '*' || p == '[' || p == ']') { + isRegex = true; + break; + } + } + + if (isRegex) { + this.regex = convertToRegex(pattern); + } else { + this.regex = null; + } + } + + private String convertToRegex(String pattern) { + StringBuilder sb = new StringBuilder(); + int i = 0; + int index = 0; + int plen = pattern.length(); + while (i < plen) { + char p = pattern.charAt(i); + if (p == '*') { + sb.append("(").append(pattern.substring(index, i)).append(")"); + if (i + 1 < plen && pattern.charAt(i + 1) == '*') { + sb.append(".*"); + index = i + 2; + } else { + sb.append("[^\\.]*"); + index = i + 1; + } + } else if (p == '[') { + int j = i + 1; + while (j < plen) { + if (pattern.charAt(j) == ']') { + break; + } + j++; + } + if (j >= plen || pattern.charAt(j) != ']') { + throw new RuntimeException("Malformed pattern " + pattern); + } + sb.append("(").append(pattern.substring(index, i)).append(")"); + sb.append(pattern.substring(i, j + 1)); + index = j + 1; + i = j; + } + i++; + } + if (index < plen) { + sb.append("(").append(pattern.substring(index, plen)).append(")"); + } + return sb.toString(); + } + + boolean matches(String name) { + if (regex == null) { + // the pattern is not a regex + return name.equals(pattern); + } else { + return name.matches(regex); + } + } + } + + static boolean isValidType(String type) { + if (type.endsWith("(optional)")) { + int len = type.length() - "(optional)".length(); + type = type.substring(0, len); + } + return type.equals(ClassForName.TYPE) || type.equals(ClassForName.TAG) || + type.equals(NativeFindClass.TYPE) || type.equals(NativeFindClass.TAG) || + type.equals(Provider.TYPE) || type.equals(Provider.TAG) || + type.equals(CompilerInline.TYPE) || type.equals(CompilerInline.TAG) || + type.equals(OptionalDependency.TYPE) || type.equals(OptionalDependency.TAG); + } + + static AnnotatedDependency newAnnotatedDependency(String tag, String value, Klass klass) { + AnnotatedDependency dep = newAnnotatedDependency(tag, klass); + if (dep != null) { + dep.addValue(Collections.singletonList(value)); + } + return dep; + } + static List annotatedDependencies = new LinkedList(); + static List optionalDependencies = new LinkedList(); + + static AnnotatedDependency newAnnotatedDependency(String type, Klass klass) { + boolean optional = false; + if (type.endsWith("(optional)")) { + optional = true; + int len = type.length() - "(optional)".length(); + type = type.substring(0, len); + } + + if (type.equals(OptionalDependency.TYPE) || type.equals(OptionalDependency.TAG)) { + return newOptionalDependency(klass); + } + + AnnotatedDependency dep; + if (type.equals(ClassForName.TYPE) || type.equals(ClassForName.TAG)) { + dep = new ClassForName(klass, optional); + } else if (type.equals(NativeFindClass.TYPE) || type.equals(NativeFindClass.TAG)) { + dep = new NativeFindClass(klass, optional); + } else if (type.equals(Provider.TYPE) || type.equals(Provider.TAG)) { + dep = new Provider(klass); + } else if (type.equals(CompilerInline.TYPE) || type.equals(CompilerInline.TAG)) { + dep = new CompilerInline(klass); + } else { + return null; + } + klass.addAnnotatedDep(dep); + annotatedDependencies.add(dep); + return dep; + } + + static OptionalDependency newOptionalDependency(Klass klass) { + OptionalDependency dep = new OptionalDependency(klass); + optionalDependencies.add(dep); + return dep; + } + static Map> annotatedDepsMap = null; + static Map> optionalDepsMap = null; + + static Map> getReferences(Module m) { + // ensure it's initialized + initDependencies(); + + Map> result = new TreeMap>(); + for (Reference ref : annotatedDepsMap.keySet()) { + if (m.contains(ref.referrer()) && m.isModuleDependence(ref.referree())) { + result.put(ref, annotatedDepsMap.get(ref)); + } + } + return result; + } + + static Set getDependencies(Module m) { + // ensure it's initialized + initDependencies(); + + Set deps = new TreeSet(); + for (Reference ref : annotatedDepsMap.keySet()) { + if (m.contains(ref.referrer())) { + Module other = m.getModuleDependence(ref.referree()); + if (other != null) { + for (AnnotatedDependency ad : annotatedDepsMap.get(ref)) { + Module.Dependency d = new Module.Dependency(other, ad.isOptional(), ad.isDynamic()); + deps.add(d); + } + } + } + } + return deps; + } + + synchronized static void initDependencies() { + if (annotatedDepsMap != null) { + return; + } + + // Build a map of references to its dependencies + annotatedDepsMap = new TreeMap>(); + optionalDepsMap = new TreeMap>(); + + for (Klass k : Klass.getAllClasses()) { + for (AnnotatedDependency ad : annotatedDependencies) { + if (ad.matches(k.getClassName())) { + Reference ref = new Reference(ad.from, k); + Set set = annotatedDepsMap.get(ref); + if (set == null) { + set = new TreeSet(); + annotatedDepsMap.put(ref, set); + } + set.add(ad); + } + } + + for (AnnotatedDependency ad : optionalDependencies) { + if (ad.matches(k.getClassName())) { + Reference ref = new Reference(ad.from, k); + Set set = optionalDepsMap.get(ref); + if (set == null) { + set = new TreeSet(); + optionalDepsMap.put(ref, set); + } + set.add(ad); + } + } + } + } +} diff --git a/jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotationParser.java b/jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotationParser.java new file mode 100644 index 00000000000..7d984aa2e74 --- /dev/null +++ b/jdk/make/modules/tools/src/com/sun/classanalyzer/AnnotationParser.java @@ -0,0 +1,293 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +package com.sun.classanalyzer; + +import com.sun.tools.classfile.*; +import com.sun.tools.classfile.Annotation; +import com.sun.tools.classfile.ExtendedAnnotation; +import com.sun.tools.classfile.Annotation.Annotation_element_value; +import com.sun.tools.classfile.Annotation.Array_element_value; +import com.sun.tools.classfile.Annotation.Class_element_value; +import com.sun.tools.classfile.Annotation.Enum_element_value; +import com.sun.tools.classfile.Annotation.Primitive_element_value; +import com.sun.tools.classfile.ConstantPoolException; +import com.sun.tools.classfile.Descriptor; +import com.sun.tools.classfile.Descriptor.InvalidDescriptor; +import java.util.ArrayList; +import java.util.List; + +import com.sun.classanalyzer.AnnotatedDependency.*; +import java.io.File; +import java.io.PrintWriter; +import java.util.Map; +import java.util.Set; + +/** + * + * @author Mandy Chung + */ +public class AnnotationParser { + + static boolean parseAnnotation = false; + static void setParseAnnotation(boolean newValue) { + parseAnnotation = newValue; + } + + private final ClassFileParser cfparser; + public AnnotationParser(ClassFileParser cfparser) { + this.cfparser = cfparser; + } + + private AnnotatedDependency addAnnotation(Annotation annot, Klass.Method method) { + String type = getType(annot.type_index); + AnnotatedDependency dep = AnnotatedDependency.newAnnotatedDependency(type, cfparser.this_klass); + if (dep != null) { + for (int i = 0; i < annot.num_element_value_pairs; i++) { + Element element = getElement(annot.element_value_pairs[i]); + dep.addElement(element.name, element.value); + } + dep.setMethod(method); + } + return dep; + } + + private AnnotatedDependency addAnnotation(ExtendedAnnotation annot, Klass.Method method) { + return addAnnotation(annot.annotation, method); + } + + class Element { + + String name; + List value; + + Element(String name) { + this.name = name; + this.value = new ArrayList(); + } + + void add(String v) { + value.add(v); + } + } + + Element getElement(Annotation.element_value_pair pair) { + Element element = new Element(getName(pair.element_name_index)); + evp.parse(pair.value, element); + return element; + } + + private String getType(int index) { + try { + Descriptor d = new Descriptor(index); + return d.getFieldType(cfparser.classfile.constant_pool); + } catch (ConstantPoolException ignore) { + } catch (InvalidDescriptor ignore) { + } + return "Unknown"; + } + + private String getName(int index) { + return cfparser.constantPoolParser.stringValue(index); + } + element_value_Parser evp = new element_value_Parser(); + + class element_value_Parser implements Annotation.element_value.Visitor { + + public Void parse(Annotation.element_value value, Element element) { + value.accept(this, element); + return null; + } + + public Void visitPrimitive(Primitive_element_value ev, Element element) { + String value = getName(ev.const_value_index); + element.add(value); + return null; + } + + public Void visitEnum(Enum_element_value ev, Element element) { + String value = getName(ev.type_name_index) + "." + getName(ev.const_name_index); + element.add(value); + return null; + } + + public Void visitClass(Class_element_value ev, Element element) { + String value = getName(ev.class_info_index) + ".class"; + element.add(value); + return null; + } + + public Void visitAnnotation(Annotation_element_value ev, Element element) { + // AnnotationParser.this.addAnnotation(ev.annotation_value); + throw new UnsupportedOperationException("Not supported: " + ev); + } + + public Void visitArray(Array_element_value ev, Element element) { + for (int i = 0; i < ev.num_values; i++) { + parse(ev.values[i], element); + } + return null; + } + } + + void parseAttributes(Attributes attributes, Klass.Method method) { + if (!parseAnnotation) { + return; + } + + visitRuntimeAnnotations((RuntimeVisibleAnnotations_attribute) attributes.get(Attribute.RuntimeVisibleAnnotations), method); + visitRuntimeAnnotations((RuntimeInvisibleAnnotations_attribute) attributes.get(Attribute.RuntimeInvisibleAnnotations), method); + visitRuntimeTypeAnnotations((RuntimeVisibleTypeAnnotations_attribute) attributes.get(Attribute.RuntimeVisibleTypeAnnotations), method); + visitRuntimeTypeAnnotations((RuntimeInvisibleTypeAnnotations_attribute) attributes.get(Attribute.RuntimeInvisibleTypeAnnotations), method); + visitRuntimeParameterAnnotations((RuntimeVisibleParameterAnnotations_attribute) attributes.get(Attribute.RuntimeVisibleParameterAnnotations), method); + visitRuntimeParameterAnnotations((RuntimeInvisibleParameterAnnotations_attribute) attributes.get(Attribute.RuntimeInvisibleParameterAnnotations), method); + } + + public void visitRuntimeAnnotations(RuntimeAnnotations_attribute attr, Klass.Method method) { + if (attr == null) { + return; + } + + for (int i = 0; i < attr.annotations.length; i++) { + addAnnotation(attr.annotations[i], method); + } + } + + public void visitRuntimeTypeAnnotations(RuntimeTypeAnnotations_attribute attr, Klass.Method method) { + if (attr == null) { + return; + } + + for (int i = 0; i < attr.annotations.length; i++) { + addAnnotation(attr.annotations[i], method); + } + } + + public void visitRuntimeParameterAnnotations(RuntimeParameterAnnotations_attribute attr, Klass.Method method) { + if (attr == null) { + return; + } + + for (int param = 0; param < attr.parameter_annotations.length; param++) { + for (int i = 0; i < attr.parameter_annotations[param].length; i++) { + addAnnotation(attr.parameter_annotations[param][i], method); + } + } + } + + void parseAttributes(Attributes attributes) { + parseAttributes(attributes, null); + } + + public static void main(String[] args) throws Exception { + String jdkhome = null; + String output = "."; + + // process arguments + int i = 0; + while (i < args.length) { + String arg = args[i++]; + if (arg.equals("-jdkhome")) { + if (i < args.length) { + jdkhome = args[i++]; + } else { + usage(); + } + } else if (arg.equals("-output")) { + output = args[i++]; + } else { + usage(); + } + } + if (jdkhome == null) { + usage(); + } + + // parse annotation and code attribute to find all references + // to Class.forName etc + CodeAttributeParser.setParseCodeAttribute(true); + AnnotationParser.setParseAnnotation(true); + + ClassPath.setJDKHome(jdkhome); + ClassPath.parseAllClassFiles(); + + PrintWriter writer = new PrintWriter(new File(output, "jdk7.depconfig")); + + try { + for (Klass k : Klass.getAllClasses()) { + for (AnnotatedDependency dep : k.getAnnotatedDeps()) { + if (dep.isEmpty()) { + continue; + } + writer.format("# %s \n", dep.method == null ? dep.from : dep.method); + writer.format("%s\n\n", dep); + } + } + } finally { + writer.close(); + } + + writer = new PrintWriter(new File(output, "optional.depconfig")); + try { + AnnotatedDependency prev = null; + for (AnnotatedDependency dep : AnnotatedDependency.optionalDependencies) { + if (prev != null && !dep.equals(prev)) { + writer.format("%s\n\n", prev); + } + writer.format("# %s \n", dep.method == null ? dep.from : dep.method); + prev = dep; + } + if (prev != null) { + writer.format("%s\n\n", prev); + } + } finally { + writer.close(); + } + + writer = new PrintWriter(new File(output, "runtime.references")); + try { + for (Map.Entry> entry : CodeAttributeParser.runtimeReferences.entrySet()) { + writer.format("References to %s\n", entry.getKey()); + Klass prev = null; + for (Klass.Method m : entry.getValue()) { + if (prev == null || prev != m.getKlass()) { + writer.format(" %-50s # %s\n", m.getKlass(), m); + } else if (prev == m.getKlass()) { + writer.format(" %-50s # %s\n", "", m); + } + prev = m.getKlass(); + } + } + } finally { + writer.close(); + } + } + + private static void usage() { + System.out.println("Usage: AnnotationParser "); + System.out.println("Options: "); + System.out.println("\t-jdkhome where all jars will be parsed"); + System.out.println("\t-depconfig "); + System.out.println("\t-optional "); + System.exit(-1); + } +} diff --git a/jdk/make/modules/tools/src/com/sun/classanalyzer/BootAnalyzer.java b/jdk/make/modules/tools/src/com/sun/classanalyzer/BootAnalyzer.java new file mode 100644 index 00000000000..06e332ace7c --- /dev/null +++ b/jdk/make/modules/tools/src/com/sun/classanalyzer/BootAnalyzer.java @@ -0,0 +1,819 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ +package com.sun.classanalyzer; + +import java.io.BufferedReader; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.io.File; +import java.util.ArrayDeque; +import java.util.Deque; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; + +import com.sun.tools.classfile.*; +import com.sun.tools.classfile.ConstantPool.*; +import static com.sun.tools.classfile.ConstantPool.*; +import com.sun.tools.classfile.Instruction.TypeKind; +import com.sun.tools.classfile.Type.*; + +/** + * Generate the module config for the boot module with + * a given set of roots (classes or methods) and exclude list. + * + * This tool does method-level dependency analysis starting + * from the root set and follows references transitively as follows: + *

+ * + * Limitation: + * + * + * @author Mandy Chung + */ +public class BootAnalyzer { + + public static void main(String[] args) throws Exception { + String jdkhome = null; + String config = null; + String output = "."; + boolean printClassList = false; + + // process arguments + int i = 0; + while (i < args.length) { + String arg = args[i++]; + if (arg.equals("-jdkhome")) { + if (i < args.length) { + jdkhome = args[i++]; + } else { + usage(); + } + } else if (arg.equals("-config")) { + config = args[i++]; + } else if (arg.equals("-output")) { + output = args[i++]; + } else if (arg.equals("-classlist")) { + printClassList = true; + } else { + usage(); + } + } + + + + if (jdkhome == null || config == null) { + usage(); + } + + File jre = new File(jdkhome, "jre"); + if (jre.exists()) { + ClassPath.setJDKHome(jdkhome); + } else { + File classes = new File(jdkhome, "classes"); + if (classes.exists()) { + ClassPath.setClassPath(classes.getCanonicalPath()); + } else { + throw new RuntimeException("Invalid jdkhome: " + jdkhome); + } + } + + parseConfigFile(config); + followRoots(); + + // create output directory if it doesn't exist + File dir = new File(output); + if (!dir.isDirectory()) { + if (!dir.exists()) { + boolean created = dir.mkdir(); + if (!created) { + throw new RuntimeException("Unable to create `" + dir + "'"); + } + } + } + + String bootmodule = "boot"; + String bootconfig = resolve(dir, bootmodule, "config"); + printBootConfig(bootconfig, bootmodule); + + List list = ModuleConfig.readConfigurationFile(bootconfig); + Module module = Module.addModule(list.get(0)); + for (Klass k : Klass.getAllClasses()) { + module.addKlass(k); + } + module.fixupDependencies(); + + if (printClassList) { + module.printClassListTo(resolve(dir, bootmodule, "classlist")); + module.printSummaryTo(resolve(dir, bootmodule, "summary")); + } + } + + // print boot.config file as an input to the ClassAnalyzer + private static void printBootConfig(String output, String bootmodule) throws IOException { + + File f = new File(output); + PrintWriter writer = new PrintWriter(f); + try { + int count = 0; + writer.format("module %s {%n", bootmodule); + for (Klass k : Klass.getAllClasses()) { + if (count++ == 0) { + writer.format("%4s%7s %s", "", "include", k); + } else { + writer.format(",%n"); + writer.format("%4s%7s %s", "", "", k); + } + } + writer.format(";%n}%n"); + } finally { + writer.close(); + } + } + + private static String resolve(File dir, String mname, String suffix) { + File f = new File(dir, mname + "." + suffix); + return f.toString(); + + } + static List methods = new LinkedList(); + static Deque pending = new ArrayDeque(); + static Deque interfaceMethodRefs = new ArrayDeque(); + static Filter filter = new Filter(); + + private static void followRoots() throws IOException { + MethodDescriptor md = null; + + while ((md = pending.poll()) != null) { + if (!methods.contains(md)) { + methods.add(md); + if (md.classname.isEmpty()) { + trace("Warning: class missing %s%n", md); + continue; + } + + if (filter.isExcluded(md.classname)) { + trace("excluded %s%n", md); + } else { + KlassInfo kinfo = getKlassInfo(md.classname); + if (kinfo.classname.contains("$")) { + int pos = kinfo.classname.lastIndexOf('$'); + String outer = kinfo.classname.substring(0, pos); + if (!cache.containsKey(outer)) { + trace(" include outer class %s%n", outer); + getKlassInfo(outer).ensureParse(); + } + } + + kinfo.ensureParse(); + if (md.methodname.length() > 0) { + if (filter.isExcluded(md.name)) { + trace("excluded %s%n", md); + } else { + if (md.interfaceMethodRef) { + trace("interface methodref %s%n", md); + interfaceMethodRefs.add(md); + } else { + List descriptors = kinfo.parse(md); + if (descriptors.isEmpty()) { + if (kinfo.getSuperclass() != null) { + String sn = kinfo.getSuperclass().classname; + MethodDescriptor superMD = new MethodDescriptor(sn + "." + md.methodname, md.descriptor, false); + if (!methods.contains(superMD) && !pending.contains(superMD)) { + trace(" delegated %s to %s%n", md, superMD); + pending.add(superMD); + } + } else if (kinfo.isClass()) { + trace(" %s (not found)%n", md); + } else { + trace(" %s (interface)%n", md); + } + } else { + if (md.descriptor.equals("*")) { + trace(" parsed %s : ", md.name); + for (String s : descriptors) { + trace(" %s", s); + } + trace("%n"); + } + } + } + } + } + } + } + if (pending.isEmpty()) { + for (Klass k : Klass.getAllClasses()) { + if (k.getFileSize() == 0) { + getKlassInfo(k.getClassName()).ensureParse(); + } + } + while ((md = interfaceMethodRefs.poll()) != null) { + addSubClassMethods(md); + } + } + } + } + + static void addSubClassMethods(MethodDescriptor md) throws IOException { + for (KlassInfo kinfo : getSubClasses(md.classname)) { + String methodname = kinfo.classname + "." + md.methodname; + MethodDescriptor other = new MethodDescriptor(methodname, md.descriptor, false); + if (!methods.contains(other) && !pending.contains(other)) { + trace("Warning: subclass from %s to %s%n", md.classname, other); + pending.add(other); + } + } + } + private final static String privilegedActionInterf = "java.security.PrivilegedAction"; + private final static String privilegedExceptionActionInterf = "java.security.PrivilegedExceptionAction"; + + static boolean isPrivilegedAction(String classname) { + if (classname.isEmpty()) { + return false; + } + KlassInfo kinfo = getKlassInfo(classname); + for (KlassInfo ki : kinfo.getInterfaces()) { + String interf = ki.classname; + if (interf.equals(privilegedActionInterf) || + interf.equals(privilegedExceptionActionInterf)) { + return true; + } + } + return false; + } + static Map cache = new HashMap(); + + static KlassInfo getKlassInfo(String classname) { + classname = classname.replace('/', '.'); + + KlassInfo kinfo = cache.get(classname); + if (kinfo == null) { + kinfo = new KlassInfo(classname); + cache.put(classname, kinfo); + } + return kinfo; + } + + static class KlassInfo { + + final String classname; + private ClassFileParser parser; + private KlassInfo superclass; + private List interfaces = new LinkedList(); + + KlassInfo(String classname) { + this.classname = classname; + } + + boolean isClass() { + ensureParse(); + return parser.classfile.isClass(); + } + + KlassInfo getSuperclass() { + ensureParse(); + return superclass; + } + + List getInterfaces() { + ensureParse(); + return java.util.Collections.unmodifiableList(interfaces); + } + + void ensureParse() { + try { + getClassFileParser(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + synchronized ClassFileParser getClassFileParser() throws IOException { + if (parser == null) { + parser = ClassPath.parserForClass(classname); + if (parser != null) { + parseClassFile(); + List descriptors = parse(new MethodDescriptor(classname + ".", "()V", false)); + } + } + return parser; + } + + List parse(MethodDescriptor md) { + ensureParse(); + try { + List descriptors = new LinkedList(); + for (Method m : parser.classfile.methods) { + String name = m.getName(parser.classfile.constant_pool); + String desc = parser.constantPoolParser.getDescriptor(m.descriptor.index); + if (name.equals(md.methodname)) { + if (md.descriptor.equals("*") || md.descriptor.equals(desc)) { + parseMethod(parser, m); + descriptors.add(desc); + } + } + } + return descriptors; + } catch (ConstantPoolException ex) { + throw new RuntimeException(ex); + } + } + + private void parseClassFile() throws IOException { + parser.parseClassInfo(); + + ClassFile classfile = parser.classfile; + try { + if (classfile.super_class > 0) { + superclass = getKlassInfo(classfile.getSuperclassName()); + } + if (classfile.interfaces != null) { + for (int i = 0; i < classfile.interfaces.length; i++) { + interfaces.add(getKlassInfo(classfile.getInterfaceName(i))); + } + } + } catch (ConstantPoolException ex) { + throw new RuntimeException(ex); + } + } + } + + static List getSubClasses(String classname) throws IOException { + List result = new LinkedList(); + List list = new LinkedList(); + list.addAll(cache.values()); + for (KlassInfo kinfo : list) { + if (kinfo.getSuperclass() != null && classname.equals(kinfo.getSuperclass().classname)) { + result.add(kinfo); + } + for (KlassInfo interf : kinfo.getInterfaces()) { + if (classname.equals(interf.classname)) { + result.add(kinfo); + } + } + } + return result; + } + + private static void parseConfigFile(String config) throws IOException { + FileInputStream in = new FileInputStream(config); + try { + BufferedReader reader = new BufferedReader(new InputStreamReader(in)); + String line; + int lineNumber = 0; + while ((line = reader.readLine()) != null) { + lineNumber++; + if ((line = line.trim()).length() > 0) { + if (line.startsWith("#")) { + continue; + } + + String[] s = line.split("\\s+"); + if ("exclude".equals(s[0])) { + filter.exclude(s[1]); + } else { + String name = s[0].replace('/', '.'); + if (name.length() > 0) { + String classname = name.replace('/', '.'); + if (s.length == 2) { + // method name + int pos = classname.lastIndexOf('.'); + classname = classname.substring(0, pos); + } + + KlassInfo kinfo = getKlassInfo(classname); + if (kinfo.getClassFileParser() != null) { + // class exists + MethodDescriptor md = (s.length == 1) ? new MethodDescriptor(name) : new MethodDescriptor(name, s[1], false); + if (!pending.contains(md)) { + pending.add(md); + } + } else { + // class not found + trace("Class %s not found%n", classname); + } + } + } + } + } + + } finally { + in.close(); + } + } + + private static void parseMethod(ClassFileParser cfparser, Method m) { + Klass.Method kmethod = cfparser.parseMethod(m); + Code_attribute c_attr = (Code_attribute) m.attributes.get(Attribute.Code); + if (c_attr != null) { + LineNumberTable_attribute lineNumTable = + (LineNumberTable_attribute) c_attr.attributes.get(Attribute.LineNumberTable); + InstructorVisitor visitor = new InstructorVisitor(cfparser, lineNumTable); + trace("parseMethod %s %s %n", cfparser.this_klass, kmethod); + for (Instruction instr : c_attr.getInstructions()) { + try { + instr.accept(visitor, kmethod); + } catch (ArrayIndexOutOfBoundsException e) { + throw new RuntimeException("error at or after byte " + instr.getPC()); + } + + } + + if (c_attr.exception_table_langth > 0) { + for (int i = 0; i < + c_attr.exception_table.length; i++) { + Code_attribute.Exception_data handler = c_attr.exception_table[i]; + int catch_type = handler.catch_type; + if (catch_type > 0) { + visitor.addConstantPoolRef(catch_type, kmethod, handler.start_pc); + } + + } + } + } + } + + static class MethodDescriptor { + + final String name; + final String classname; + final String methodname; + final String descriptor; + final boolean interfaceMethodRef; + + MethodDescriptor(String classname) { + this.classname = classname.replace('/', '.'); + this.name = this.classname; + this.methodname = ""; + this.descriptor = ""; + this.interfaceMethodRef = false; + if (this.classname.length() == 1) { + throw new RuntimeException("invalid " + this); + } + } + + MethodDescriptor(String name, String descriptor, boolean interfaceMethodRef) { + name = name.replace('/', '.'); + this.name = name; + int pos = name.lastIndexOf('.'); + this.classname = name.substring(0, pos); + this.methodname = name.substring(pos + 1, name.length()); + this.descriptor = descriptor; + this.interfaceMethodRef = interfaceMethodRef; + if (this.classname.length() == 1) { + throw new RuntimeException("invalid " + this); + } + } + + @Override + public boolean equals(Object obj) { + MethodDescriptor m = (MethodDescriptor) obj; + + return this.name.equals(m.name) && + this.descriptor.equals(m.descriptor); + } + + @Override + public int hashCode() { + int hash = 7; + hash = 97 * hash + (this.name != null ? this.name.hashCode() : 0); + hash = 97 * hash + (this.descriptor != null ? this.descriptor.hashCode() : 0); + return hash; + } + + public String toString() { + if (descriptor.isEmpty()) { + return name; + } else { + return name + " : " + descriptor; + } + } + } + + static class Filter { + + private Set excludes = new TreeSet(); + + Filter exclude(String pattern) { + excludes.add(pattern); + return this; + } + + boolean isExcluded(String klass) { + for (String pattern : excludes) { + if (matches(klass, pattern)) { + return true; + } + } + return false; + } + + private boolean matches(String klass, String pattern) { + int pos = klass.lastIndexOf('.'); + String packageName = pos > 0 ? klass.substring(0, pos) : ""; + if (pattern.endsWith("**")) { + String p = pattern.substring(0, pattern.length() - 2); + return klass.startsWith(p); + } else if (pattern.endsWith("*")) { + pos = pattern.lastIndexOf('.'); + String pkg = pos > 0 ? pattern.substring(0, pos) : ""; + if (packageName.equals(pkg)) { + // package name has to be exact match + String p = pattern.substring(0, pattern.length() - 1); + return klass.startsWith(p); + } else { + return false; + } + } else { + // exact match or inner class + return klass.equals(pattern) || klass.startsWith(pattern + "$"); + } + } + } + + static class InstructorVisitor implements Instruction.KindVisitor { + + private final ClassFileParser parser; + private final LineNumberTable_attribute lineNumTable; + + InstructorVisitor(ClassFileParser parser, LineNumberTable_attribute lineNumTable) { + this.parser = parser; + this.lineNumTable = lineNumTable; + } + + int getLineNumber(int pc) { + if (lineNumTable != null) { + int start_pc = 0; + int lineno = 0; + for (int i = 0; i < lineNumTable.line_number_table_length; i++) { + int cur_start_pc = lineNumTable.line_number_table[i].start_pc; + if (pc == 0 && cur_start_pc == 0) { + return lineNumTable.line_number_table[i].line_number; + } else if (pc >= start_pc && pc < cur_start_pc) { + return lineno; + } + start_pc = cur_start_pc; + lineno = lineNumTable.line_number_table[i].line_number; + } + } + return 0; + } + + void addConstantPoolRef(int index, Klass.Method m, int pc) { + try { + CPInfo cpInfo = parser.classfile.constant_pool.get(index); + String name = cpInfo.accept(typeFinder, null); + if (name != null) { + trace(" %s %s at line %d%n", parser.constantPoolParser.tagName(index), name, getLineNumber(pc)); + } + } catch (InvalidIndex ex) { + throw new RuntimeException(ex); + } + } + + public Void visitNoOperands(Instruction instr, Klass.Method m) { + return null; + } + + public Void visitArrayType(Instruction instr, TypeKind kind, Klass.Method m) { + return null; + } + + public Void visitBranch(Instruction instr, int offset, Klass.Method m) { + return null; + } + + public Void visitConstantPoolRef(Instruction instr, int index, Klass.Method m) { + addConstantPoolRef(index, m, instr.getPC()); + return null; + } + + public Void visitConstantPoolRefAndValue(Instruction instr, int index, int value, Klass.Method m) { + addConstantPoolRef(index, m, instr.getPC()); + return null; + } + + public Void visitLocal(Instruction instr, int index, Klass.Method m) { + return null; + } + + public Void visitLocalAndValue(Instruction instr, int index, int value, Klass.Method m) { + return null; + } + + public Void visitLookupSwitch(Instruction instr, int default_, int npairs, int[] matches, int[] offsets, Klass.Method m) { + return null; + } + + public Void visitTableSwitch(Instruction instr, int default_, int low, int high, int[] offsets, Klass.Method m) { + return null; + } + + public Void visitValue(Instruction instr, int value, Klass.Method m) { + return null; + } + + public Void visitUnknown(Instruction instr, Klass.Method m) { + return null; + } + private ConstantPool.Visitor typeFinder = new ConstantPool.Visitor() { + + String getClassName(CPRefInfo info, Void p) { + try { + return parser.checkClassName(info.getClassName()).replace('/', '.'); + } catch (ConstantPoolException ex) { + throw new RuntimeException(ex); + } + } + + boolean addReferencedClass(String name) { + if (Klass.findKlass(name) == null) { + MethodDescriptor md = new MethodDescriptor(name); + if (!methods.contains(md) && !pending.contains(md)) { + pending.add(md); + } + return true; + } + return false; + } + private String privilegedActionClass = ""; + + void cachePrivilegedAction(String classname) { + trace(" found PrivilegedAction %s%n", classname); + privilegedActionClass = classname; + } + + void doPrivilegedCall(String method) { + if (privilegedActionClass.length() > 0) { + MethodDescriptor md = new MethodDescriptor(privilegedActionClass + ".run", "*", false); + if (!methods.contains(md) && !pending.contains(md)) { + trace(" doPrivileged %s%n", md); + pending.add(md); + } + } + } + + private String addMethodDescriptor(CPRefInfo info, Void p) { + try { + String classname = getClassName(info, null); + String method = classname + "." + info.getNameAndTypeInfo().getName(); + String descriptor = info.getNameAndTypeInfo().getType(); + + if (method.endsWith(".") && isPrivilegedAction(classname)) { + cachePrivilegedAction(classname); + } + if (method.equals("java.security.AccessController.doPrivileged")) { + doPrivilegedCall(method); + return method; + } + + boolean interfaceMethodRef = info instanceof CONSTANT_InterfaceMethodref_info; + MethodDescriptor md = new MethodDescriptor(method, descriptor, interfaceMethodRef); + if (!methods.contains(md) && !pending.contains(md)) { + pending.add(md); + } + return method; + } catch (ConstantPoolException e) { + throw new RuntimeException(e); + } + } + + public String visitClass(CONSTANT_Class_info info, Void p) { + try { + String classname = parser.checkClassName(info.getName()).replace('/', '.'); + if (classname.length() > 0) { + addReferencedClass(classname); + } + return classname; + } catch (ConstantPoolException ex) { + throw new RuntimeException(ex); + } + } + + public String visitDouble(CONSTANT_Double_info info, Void p) { + // skip + return null; + } + + public String visitFieldref(CONSTANT_Fieldref_info info, Void p) { + try { + String classname = getClassName(info, p); + if (classname.length() > 0) { + addReferencedClass(classname); + } + + String type = info.getNameAndTypeInfo().getType(); + String fieldType = parser.checkClassName(type).replace('/', '.'); + if (fieldType.length() > 0) { + addReferencedClass(classname); + } + return parser.constantPoolParser.stringValue(info); + } catch (ConstantPoolException e) { + throw new RuntimeException(e); + } + } + + public String visitFloat(CONSTANT_Float_info info, Void p) { + // skip + return null; + } + + public String visitInteger(CONSTANT_Integer_info info, Void p) { + // skip + return null; + } + + public String visitInterfaceMethodref(CONSTANT_InterfaceMethodref_info info, Void p) { + return addMethodDescriptor(info, p); + } + + public String visitLong(CONSTANT_Long_info info, Void p) { + // skip + return null; + } + + public String visitNameAndType(CONSTANT_NameAndType_info info, Void p) { + // skip + return null; + } + + public String visitMethodref(CONSTANT_Methodref_info info, Void p) { + return addMethodDescriptor(info, p); + } + + public String visitString(CONSTANT_String_info info, Void p) { + // skip + return null; + } + + public String visitUtf8(CONSTANT_Utf8_info info, Void p) { + return null; + } + }; + } + static boolean traceOn = System.getProperty("classanalyzer.debug") != null; + + private static void trace(String format, Object... args) { + if (traceOn) { + System.out.format(format, args); + } + } + + private static void usage() { + System.out.println("Usage: BootAnalyzer "); + System.out.println("Options: "); + System.out.println("\t-jdkhome where all jars will be parsed"); + System.out.println("\t-config "); + System.out.println("\t-output "); + System.out.println("\t-classlist print class list and summary"); + System.exit(-1); + } +} diff --git a/jdk/make/modules/tools/src/com/sun/classanalyzer/CheckDeps.java b/jdk/make/modules/tools/src/com/sun/classanalyzer/CheckDeps.java new file mode 100644 index 00000000000..ea73b43e3fc --- /dev/null +++ b/jdk/make/modules/tools/src/com/sun/classanalyzer/CheckDeps.java @@ -0,0 +1,181 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +package com.sun.classanalyzer; + +import java.io.*; +import java.util.*; + +/** + * A simple tool to check module dependencies against a known list of + * dependencies. The tool fails (by throwing a RuntimeException) is an + * unexpected dependency is detected. + */ + +public class CheckDeps { + + /** + * Represents a dependency from one module to another module. The dependency + * may be optional. + */ + static class Dependency { + private final String module; + private final String other; + private final boolean optional; + + private Dependency(String module, String other, boolean optional) { + this.module = module; + this.other = other; + this.optional = optional; + } + + String module() { return module; } + String other() { return other; } + boolean isOptional() { return optional; } + + /** + * Parses a dependency in one of the following forms: + * a -> b + * [optional] a -> b + */ + static Dependency fromString(String s) { + String[] components = s.split(" "); + int count = components.length; + if (count != 3 && count != 4) + throw new IllegalArgumentException(s); + boolean optional = (count == 4); + if (optional && !components[0].equals("[optional]")) + throw new IllegalArgumentException(s); + String arrow = optional ? components[2] : components[1]; + if (!arrow.equals("->")) + throw new IllegalArgumentException(s); + String module = optional ? components[1] : components[0]; + String other = optional ? components[3] : components[2]; + return new Dependency(module, other, optional); + } + + @Override public String toString() { + StringBuilder sb = new StringBuilder(); + if (optional) + sb.append("[optional] "); + sb.append(module); + sb.append(" -> "); + sb.append(other); + return sb.toString(); + } + } + + /** + * Represents the "tail" + */ + static class DependencyTail { + private final String module; + private final boolean optional; + + DependencyTail(String module, boolean optional) { + this.module = module; + this.optional = optional; + } + String module() { return module; } + boolean isOptional() { return optional; } + } + + static void usage() { + System.out.println("java CheckDeps file1 file2"); + System.out.println(" where file1 is the expected dependencies and file2 is"); + System.out.println(" the actual dependencies. Both files are assumed to be"); + System.out.println(" in modules.summary format (see ClassAnalyzer tool)."); + System.out.println(); + System.out.println("Example usages:"); + System.out.println(" java CheckDeps make/modules/modules.summary " + + "$(OUTPUTDIR)/modules.summary"); + System.exit(-1); + } + + public static void main(String[] args) throws IOException { + if (args.length != 2) + usage(); + + // maps a module to the list of modules that it depends on + Map> expected = + new HashMap>(); + + // parse the expected dependencies file + Scanner s; + s = new Scanner(new FileInputStream(args[0])); + try { + while (s.hasNextLine()) { + Dependency ref = Dependency.fromString(s.nextLine()); + if (ref != null) { + String module = ref.module(); + List list = expected.get(module); + if (list == null) { + list = new ArrayList(); + expected.put(module, list); + } + list.add(new DependencyTail(ref.other(), ref.isOptional())); + } + } + } finally { + s.close(); + } + + // parse the actual dependencies file, checking each dependency + // against the expected list. + boolean fail = false; + s = new Scanner(new FileInputStream(args[1])); + try { + while (s.hasNextLine()) { + Dependency dep = Dependency.fromString(s.nextLine()); + + // check if this dependency is expected + List list = expected.get(dep.module()); + DependencyTail tail = null; + if (list != null) { + for (DependencyTail t: list) { + if (t.module().equals(dep.other())) { + tail = t; + break; + } + } + } + if (tail == null) { + System.err.println("Unexpected dependency: " + dep); + fail = true; + } else { + // hard dependency when optional dependency is expected + if (tail.isOptional() != dep.isOptional()) { + if (tail.isOptional()) { + System.err.println("Unexpected dependency: " + dep); + fail = true; + } + } + } + } + } finally { + s.close(); + } + + if (fail) + throw new RuntimeException("Unexpected dependencies found"); + } +} diff --git a/jdk/make/modules/tools/src/com/sun/classanalyzer/ClassAnalyzer.java b/jdk/make/modules/tools/src/com/sun/classanalyzer/ClassAnalyzer.java new file mode 100644 index 00000000000..fd570a7c0b1 --- /dev/null +++ b/jdk/make/modules/tools/src/com/sun/classanalyzer/ClassAnalyzer.java @@ -0,0 +1,354 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +package com.sun.classanalyzer; + +import com.sun.classanalyzer.AnnotatedDependency.*; +import com.sun.classanalyzer.Module.Dependency; +import com.sun.classanalyzer.Module.PackageInfo; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.io.File; +import java.io.PrintWriter; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; + +/** + * + * @author Mandy Chung + */ +public class ClassAnalyzer { + + public static void main(String[] args) throws Exception { + String jdkhome = null; + String cpath = null; + List configs = new ArrayList(); + List depconfigs = new ArrayList(); + String output = "."; + boolean mergeModules = true; + boolean showDynamic = false; + + // process arguments + int i = 0; + while (i < args.length) { + String arg = args[i++]; + if (arg.equals("-jdkhome")) { + if (i < args.length) { + jdkhome = args[i++]; + } else { + usage(); + } + } else if (arg.equals("-cpath")) { + if (i < args.length) { + cpath = args[i++]; + } else { + usage(); + } + } else if (arg.equals("-config")) { + if (i < args.length) { + configs.add(args[i++]); + } else { + usage(); + } + } else if (arg.equals("-depconfig")) { + if (i < args.length) { + depconfigs.add(args[i++]); + } else { + usage(); + } + } else if (arg.equals("-output")) { + if (i < args.length) { + output = args[i++]; + } else { + usage(); + } + } else if (arg.equals("-base")) { + ModuleConfig.setBaseModule(args[i++]); + } else if (arg.equals("-nomerge")) { + // analyze the fine-grained module dependencies + mergeModules = false; + } else if (arg.equals("-showdynamic")) { + showDynamic = true; + } else { + System.err.println("Invalid option: " + arg); + usage(); + } + } + + if ((jdkhome == null && cpath == null) || (jdkhome != null && cpath != null)) { + usage(); + } + if (configs.isEmpty()) { + usage(); + } + + if (jdkhome != null) { + ClassPath.setJDKHome(jdkhome); + } else if (cpath != null) { + ClassPath.setClassPath(cpath); + } + + // create output directory if it doesn't exist + File dir = new File(output); + if (!dir.isDirectory()) { + if (!dir.exists()) { + boolean created = dir.mkdir(); + if (!created) { + throw new RuntimeException("Unable to create `" + dir + "'"); + } + } + } + + buildModules(configs, depconfigs, mergeModules); + + // generate output files + for (Module m : modules) { + // only generate reports for top-level modules + if (m.group() == m) { + m.printClassListTo(resolve(dir, m.name(), "classlist")); + m.printResourceListTo(resolve(dir, m.name(), "resources")); + m.printSummaryTo(resolve(dir, m.name(), "summary")); + m.printDependenciesTo(resolve(dir, m.name(), "dependencies"), showDynamic); + } + } + + // Generate other summary reports + printModulesSummary(dir, showDynamic); + printModulesDot(dir, showDynamic); + printModulesList(dir); + printPackagesSummary(dir); + } + private static List modules = new ArrayList(); + + static void buildModules(List configs, + List depconfigs, + boolean mergeModules) throws IOException { + // create modules based on the input config files + for (String file : configs) { + for (ModuleConfig mconfig : ModuleConfig.readConfigurationFile(file)) { + modules.add(Module.addModule(mconfig)); + } + } + + // parse class files + ClassPath.parseAllClassFiles(); + + // Add additional dependencies if specified + if (depconfigs != null && depconfigs.size() > 0) { + DependencyConfig.parse(depconfigs); + } + + // process the roots and dependencies to get the classes for each module + for (Module m : modules) { + m.processRootsAndReferences(); + } + + // update the dependencies for classes that were subsequently allocated + // to modules + for (Module m : modules) { + m.fixupDependencies(); + } + + if (mergeModules) { + Module.buildModuleMembers(); + } + } + + private static void printModulesSummary(File dir, boolean showDynamic) throws IOException { + // print summary of dependencies + PrintWriter writer = new PrintWriter(new File(dir, "modules.summary")); + try { + for (Module m : modules) { + // only show top-level module dependencies + if (m.group() == m) { + for (Dependency dep : m.dependents()) { + if (!showDynamic && dep.dynamic && dep.optional) { + continue; + } + if (dep.module == null || !dep.module.isBase()) { + + String prefix = ""; + if (dep.optional) { + if (dep.dynamic) { + prefix = "[dynamic] "; + } else { + prefix = "[optional] "; + } + } + + Module other = dep != null ? dep.module : null; + writer.format("%s%s -> %s%n", prefix, m, other); + } + } + } + } + } finally { + writer.close(); + } + } + + private static void printModulesDot(File dir, boolean showDynamic) throws IOException { + PrintWriter writer = new PrintWriter(new File(dir, "modules.dot")); + try { + writer.println("digraph jdk {"); + for (Module m : modules) { + if (m.group() == m) { + for (Dependency dep : m.dependents()) { + if (!showDynamic && dep.dynamic && dep.optional) { + continue; + } + if (dep.module == null || !dep.module.isBase()) { + String style = ""; + String color = ""; + String property = ""; + if (dep.optional) { + style = "style=dotted"; + } + if (dep.dynamic) { + color = "color=red"; + } + if (style.length() > 0 || color.length() > 0) { + String comma = ""; + if (style.length() > 0 && color.length() > 0) { + comma = ", "; + } + property = String.format(" [%s%s%s]", style, comma, color); + } + Module other = dep != null ? dep.module : null; + writer.format(" \"%s\" -> \"%s\"%s;%n", m, other, property); + } + } + } + } + writer.println("}"); + } finally { + writer.close(); + } + } + + private static void printMembers(Module m, PrintWriter writer) { + for (Module member : m.members()) { + if (!member.isEmpty()) { + writer.format("%s ", member); + printMembers(member, writer); + } + } + } + + private static void printModulesList(File dir) throws IOException { + // print module group / members relationship + PrintWriter writer = new PrintWriter(new File(dir, "modules.list")); + try { + for (Module m : modules) { + if (m.group() == m && !m.isEmpty()) { + writer.format("%s ", m); + printMembers(m, writer); + writer.println(); + } + } + } finally { + writer.close(); + } + } + + private static void printPackagesSummary(File dir) throws IOException { + // print package / module relationship + PrintWriter writer = new PrintWriter(new File(dir, "modules.pkginfo")); + try { + Map> packages = new TreeMap>(); + Set splitPackages = new TreeSet(); + + for (Module m : modules) { + if (m.group() == m) { + for (PackageInfo info : m.getPackageInfos()) { + Set value = packages.get(info.pkgName); + if (value == null) { + value = new TreeSet(); + packages.put(info.pkgName, value); + } else { + // package in more than one module + splitPackages.add(info.pkgName); + } + value.add(m); + } + } + } + + // packages that are splitted among multiple modules + writer.println("Packages splitted across modules:-\n"); + writer.format("%-60s %s\n", "Package", "Module"); + + for (String pkgname : splitPackages) { + writer.format("%-60s", pkgname); + for (Module m : packages.get(pkgname)) { + writer.format(" %s", m); + } + writer.println(); + } + + writer.println("\nPackage-private dependencies:-"); + for (String pkgname : splitPackages) { + for (Klass k : Klass.getAllClasses()) { + if (k.getPackageName().equals(pkgname)) { + Module m = k.getModule(); + // check if this klass references a package-private + // class that is in a different module + for (Klass other : k.getReferencedClasses()) { + if (other.getModule() != m && + !other.isPublic() && + other.getPackageName().equals(pkgname)) { + String from = k.getClassName() + " (" + m + ")"; + writer.format("%-60s -> %s (%s)\n", from, other, other.getModule()); + } + } + } + } + } + } finally { + writer.close(); + } + + } + + private static String resolve(File dir, String mname, String suffix) { + File f = new File(dir, mname + "." + suffix); + return f.toString(); + + } + + private static void usage() { + System.out.println("Usage: ClassAnalyzer "); + System.out.println("Options: "); + System.out.println("\t-jdkhome where all jars will be parsed"); + System.out.println("\t-cpath where classes and jars will be parsed"); + System.out.println("\t Either -jdkhome or -cpath option can be used."); + System.out.println("\t-config "); + System.out.println("\t This option can be repeated for multiple module config files"); + System.out.println("\t-output "); + System.out.println("\t-nomerge specify not to merge modules"); + System.out.println("\t-showdynamic show dynamic dependencies in the reports"); + System.exit(-1); + } +} diff --git a/jdk/make/modules/tools/src/com/sun/classanalyzer/ClassFileParser.java b/jdk/make/modules/tools/src/com/sun/classanalyzer/ClassFileParser.java new file mode 100644 index 00000000000..bbbeda7407f --- /dev/null +++ b/jdk/make/modules/tools/src/com/sun/classanalyzer/ClassFileParser.java @@ -0,0 +1,629 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ +package com.sun.classanalyzer; + +import com.sun.tools.classfile.*; +import com.sun.tools.classfile.Type.*; +import com.sun.tools.classfile.Descriptor.InvalidDescriptor; +import static com.sun.tools.classfile.AccessFlags.*; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +/** + * + * @author Mandy Chung + */ +public class ClassFileParser { + + final Klass this_klass; + final ClassFile classfile; + final ConstantPoolParser constantPoolParser; + final AnnotationParser annotationParser; + final CodeAttributeParser codeAttributeParser; + private final boolean buildDeps; + + protected ClassFileParser(InputStream in, long size, boolean buildDeps) throws IOException { + try { + this.classfile = ClassFile.read(in); + this.this_klass = getKlass(this.classfile); + this.buildDeps = buildDeps; + this.constantPoolParser = new ConstantPoolParser(this); + this.annotationParser = new AnnotationParser(this); + this.codeAttributeParser = new CodeAttributeParser(this); + } catch (ConstantPoolException ex) { + throw new RuntimeException(ex); + } + } + + private Klass getKlass(ClassFile cf) throws ConstantPoolException { + Klass k = Klass.getKlass(cf.getName()); + k.setAccessFlags(cf.access_flags.flags); + k.setFileSize(cf.byteLength()); + return k; + } + + public static ClassFileParser newParser(InputStream in, long size, boolean buildDeps) throws IOException { + return new ClassFileParser(in, size, buildDeps); + } + + public static ClassFileParser newParser(String classPathname, boolean buildDeps) throws IOException { + return newParser(new File(classPathname), buildDeps); + } + + public static ClassFileParser newParser(File f, boolean buildDeps) throws IOException { + BufferedInputStream in = new BufferedInputStream(new FileInputStream(f)); + try { + return newParser(in, f.length(), buildDeps); + } finally { + in.close(); + } + } + + public void parseDependency(boolean publicAPIs) throws IOException { + if (publicAPIs && !classfile.access_flags.is(ACC_PUBLIC)) { + // process public APIs only + return; + } + + parseClassInfo(); + if (!publicAPIs) { + // parse all references in the classfile + constantPoolParser.parseDependency(); + } + parseMethods(publicAPIs); + parseFields(publicAPIs); + } + + void parseClassInfo() throws IOException { + ConstantPool cpool = classfile.constant_pool; + try { + Signature_attribute sigAttr = (Signature_attribute) classfile.attributes.get(Attribute.Signature); + if (sigAttr == null) { + // use info from class file header + if (classfile.isClass() && classfile.super_class != 0) { + String sn = classfile.getSuperclassName(); + addExtends(sn); + } + for (int i = 0; i < classfile.interfaces.length; i++) { + String interf = classfile.getInterfaceName(i); + if (classfile.isClass()) { + addImplements(interf); + } else { + addExtends(interf); + } + } + } else { + Type t = sigAttr.getParsedSignature().getType(cpool); + // The signature parser cannot disambiguate between a + // FieldType and a ClassSignatureType that only contains a superclass type. + if (t instanceof Type.ClassSigType) { + Type.ClassSigType cst = Type.ClassSigType.class.cast(t); + if (cst.superclassType != null) { + for (Klass k : getKlass(cst.superclassType)) { + addExtends(k); + } + } + if (cst.superinterfaceTypes != null) { + for (Type t1 : cst.superinterfaceTypes) { + for (Klass k : getKlass(t1)) { + addImplements(k); + } + } + } + } else { + for (Klass k : getKlass(t)) { + addExtends(k); + } + } + } + // parse attributes + annotationParser.parseAttributes(classfile.attributes); + } catch (ConstantPoolException ex) { + throw new RuntimeException(ex); + } + } + + private void parseFields(boolean publicAPIs) throws IOException { + ConstantPool cpool = classfile.constant_pool; + for (Field f : classfile.fields) { + try { + AccessFlags flags = f.access_flags; + if (publicAPIs && !flags.is(ACC_PUBLIC) && !flags.is(ACC_PROTECTED)) { + continue; + } + String fieldname = f.getName(cpool); + Signature_attribute sigAttr = (Signature_attribute) f.attributes.get(Attribute.Signature); + + if (sigAttr == null) { + Set types = parseDescriptor(f.descriptor); + String info = getFlag(flags) + " " + f.descriptor.getFieldType(cpool) + " " + fieldname; + addFieldTypes(types, info, flags); + } else { + Type t = sigAttr.getParsedSignature().getType(cpool); + String info = getFlag(flags) + " " + t + " " + fieldname; + addFieldTypes(getKlass(t), info, flags); + } + // parse attributes + annotationParser.parseAttributes(f.attributes); + } catch (ConstantPoolException ex) { + throw new RuntimeException(ex); + } catch (InvalidDescriptor ex) { + throw new RuntimeException(ex); + } + } + } + + private void parseMethods(boolean publicAPIs) { + for (Method m : classfile.methods) { + if (publicAPIs && !m.access_flags.is(ACC_PUBLIC) && !m.access_flags.is(ACC_PROTECTED)) { + // only interest in the API level + return; + } + + parseMethod(m); + } + } + + String checkClassName(String classname) { + int i = 0; + while (i < classname.length()) { + switch (classname.charAt(i)) { + case 'Z': + case 'B': + case 'C': + case 'S': + case 'I': + case 'J': + case 'F': + case 'D': + return ""; + case 'L': + if (!classname.endsWith(";")) { + throw new RuntimeException("Invalid classname " + classname); + } + return classname.substring(i + 1, classname.length() - 1); + case '[': + i++; + break; + default: + if (classname.endsWith(";")) { + throw new RuntimeException("Invalid classname " + classname); + } + return classname; + + } + } + throw new RuntimeException("Invalid classname " + classname); + } + + private void addExtends(String classname) throws IOException { + if (!buildDeps) { + return; + } + + addExtends(Klass.getKlass(classname)); + } + + private void addExtends(Klass k) { + if (!buildDeps) { + return; + } + + ResolutionInfo resInfo = ResolutionInfo.resolvedExtends(this_klass, k); + resInfo.setPublicAccess(classfile.access_flags.is(ACC_PUBLIC)); + this_klass.addDep(k, resInfo); + k.addReferrer(this_klass, resInfo); + } + + private void addImplements(String classname) throws IOException { + if (!buildDeps) { + return; + } + + addImplements(Klass.getKlass(classname)); + } + + private void addImplements(Klass k) { + if (!buildDeps) { + return; + } + + ResolutionInfo resInfo = ResolutionInfo.resolvedImplements(this_klass, k); + resInfo.setPublicAccess(classfile.access_flags.is(ACC_PUBLIC)); + + this_klass.addDep(k, resInfo); + + k.addReferrer(this_klass, resInfo); + } + + private Set getKlass(Type type) throws IOException { + Set refTypes = new TreeSet(); + if (!buildDeps) { + return refTypes; + } + + type.accept(typevisitor, refTypes); + return refTypes; + } + private Type.Visitor> typevisitor = new Type.Visitor>() { + + public Void visitSimpleType(SimpleType type, Set klasses) { + // nop + return null; + } + + public Void visitArrayType(ArrayType type, Set klasses) { + try { + klasses.addAll(getKlass(type.elemType)); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + return null; + + } + + public Void visitMethodType(MethodType type, Set klasses) { + throw new InternalError("Unexpected type " + type); + } + + public Void visitClassSigType(ClassSigType type, Set klasses) { + try { + if (type.superclassType != null) { + klasses.addAll(getKlass(type.superclassType)); + } + if (type.superinterfaceTypes != null) { + for (Type t : type.superinterfaceTypes) { + klasses.addAll(getKlass(t)); + } + } + if (type.typeParamTypes != null) { + for (Type t : type.typeParamTypes) { + klasses.addAll(getKlass(t)); + } + } + } catch (IOException ex) { + throw new RuntimeException(ex); + } + return null; + } + + public Void visitClassType(ClassType type, Set klasses) { + klasses.add(Klass.getKlass(type.getBinaryName())); + if (type.typeArgs != null) { + for (Type t : type.typeArgs) { + try { + klasses.addAll(getKlass(t)); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + } + } + return null; + + } + + public Void visitTypeParamType(TypeParamType type, Set klasses) { + try { + if (type.classBound != null) { + klasses.addAll(getKlass(type.classBound)); + } + if (type.interfaceBounds != null) { + for (Type t : type.interfaceBounds) { + klasses.addAll(getKlass(t)); + } + } + + } catch (IOException ex) { + throw new RuntimeException(ex); + } + + return null; + + } + + public Void visitWildcardType(WildcardType type, Set klasses) { + if (type.boundType != null) { + try { + klasses.addAll(getKlass(type.boundType)); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + } + return null; + + } + }; + + private void printMethod(Method m) { + try { + System.out.println("parsing " + m.getName(classfile.constant_pool) + "(" + + m.descriptor.getParameterTypes(classfile.constant_pool) + ") return type " + + m.descriptor.getReturnType(classfile.constant_pool)); + + } catch (ConstantPoolException ex) { + } catch (InvalidDescriptor ex) { + } + } + + private static StringBuilder appendWord(StringBuilder sb, String word) { + if (sb.length() > 0) { + sb.append(" "); + } + sb.append(word); + return sb; + } + + private static String getFlag(AccessFlags flags) { + StringBuilder modifier = new StringBuilder(); + if (flags.is(ACC_PUBLIC)) { + modifier.append("public"); + } + if (flags.is(ACC_PRIVATE)) { + modifier.append("private"); + } + if (flags.is(ACC_PROTECTED)) { + modifier.append("protected"); + } + if (flags.is(ACC_STATIC)) { + appendWord(modifier, "static"); + } + if (flags.is(ACC_FINAL)) { + appendWord(modifier, "final"); + } + if (flags.is(ACC_SYNCHRONIZED)) { + // return "synchronized"; + } + if (flags.is(0x80)) { + // return (t == Type.Field ? "transient" : null); + // return "transient"; + } + if (flags.is(ACC_VOLATILE)) { + // return "volatile"; + } + if (flags.is(ACC_NATIVE)) { + // return "native"; + } + if (flags.is(ACC_ABSTRACT)) { + appendWord(modifier, "abstract"); + } + if (flags.is(ACC_STRICT)) { + // return "strictfp"; + } + if (flags.is(ACC_MODULE)) { + appendWord(modifier, "module"); + } + return modifier.toString(); + } + + private Klass.Method toKlassMethod(Method m, Descriptor d) { + try { + ConstantPool cpool = classfile.constant_pool; + String methodname = m.getName(cpool); + StringBuilder sb = new StringBuilder(); + sb.append(getFlag(m.access_flags)); + if (methodname.equals("")) { + String s = this_klass.getBasename() + d.getParameterTypes(cpool); + appendWord(sb, s); + } else if (methodname.equals("")) { + // + appendWord(sb, methodname); + } else { + String s = d.getReturnType(cpool) + " " + methodname + d.getParameterTypes(cpool); + appendWord(sb, s); + } + String signature = sb.toString().replace('/', '.'); + return this_klass.getMethod(methodname, signature); + } catch (ConstantPoolException ex) { + throw new RuntimeException(ex); + } catch (InvalidDescriptor ex) { + throw new RuntimeException(ex); + } + } + + Klass.Method parseMethod(Method m) { + AccessFlags flags = m.access_flags; + Descriptor d; + List methodExceptions = null; + try { + ConstantPool cpool = classfile.constant_pool; + Klass.Method kmethod; + Signature_attribute sigAttr = (Signature_attribute) m.attributes.get(Attribute.Signature); + if (sigAttr == null) { + d = m.descriptor; + Set types = parseDescriptor(d); + + kmethod = toKlassMethod(m, d); + addMethodTypes(types, kmethod, flags); + } else { + Type.MethodType methodType; + Signature methodSig = sigAttr.getParsedSignature(); + d = methodSig; + try { + kmethod = toKlassMethod(m, d); + methodType = (Type.MethodType) methodSig.getType(cpool); + addMethodTypes(getKlass(methodType.returnType), kmethod, flags); + if (methodType.paramTypes != null) { + for (Type t : methodType.paramTypes) { + addMethodTypes(getKlass(t), kmethod, flags); + } + } + if (methodType.typeParamTypes != null) { + for (Type t : methodType.typeParamTypes) { + addMethodTypes(getKlass(t), kmethod, flags); + } + } + + methodExceptions = methodType.throwsTypes; + if (methodExceptions != null) { + if (methodExceptions.size() == 0) { + methodExceptions = null; + } else { + for (Type t : methodExceptions) { + addCheckedExceptionTypes(getKlass(t), kmethod, flags); + } + } + } + } catch (ConstantPoolException e) { + throw new RuntimeException(e); + } + } + + Attribute e_attr = m.attributes.get(Attribute.Exceptions); + if (e_attr != null && methodExceptions == null) { + // if there are generic exceptions, there must be erased exceptions + if (e_attr instanceof Exceptions_attribute) { + Exceptions_attribute exceptions = (Exceptions_attribute) e_attr; + for (int i = 0; i < exceptions.number_of_exceptions; i++) { + String classname = checkClassName(exceptions.getException(i, classfile.constant_pool)); + if (classname.length() > 0 && buildDeps) { + Klass to = Klass.getKlass(classname); + ResolutionInfo resInfo = ResolutionInfo.resolvedCheckedException(this_klass, to, kmethod); + resInfo.setPublicAccess(flags.is(ACC_PUBLIC)); + + this_klass.addDep(to, resInfo); + to.addReferrer(this_klass, resInfo); + } + } + } else { + throw new RuntimeException("Invalid attribute: " + e_attr); + } + } + + Code_attribute c_attr = (Code_attribute) m.attributes.get(Attribute.Code); + if (c_attr != null) { + codeAttributeParser.parse(c_attr, kmethod); + } + kmethod.isAbstract = classfile.access_flags.is(ACC_ABSTRACT); + kmethod.setCodeLength(m.byteLength()); + + // parse annotation attributes + annotationParser.parseAttributes(m.attributes, kmethod); + return kmethod; + } catch (ConstantPoolException ex) { + throw new RuntimeException(ex); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + } + + private void addFieldTypes(Set types, String info, AccessFlags flags) { + if (types.isEmpty() || !buildDeps) { + return; + } + + for (Klass to : types) { + ResolutionInfo resInfo = ResolutionInfo.resolvedField(this_klass, to, info); + resInfo.setPublicAccess(flags.is(ACC_PUBLIC)); + + this_klass.addDep(to, resInfo); + to.addReferrer(this_klass, resInfo); + } + } + + private void addReferencedTypes(Method m, Descriptor d, AccessFlags flags) { + Set types = parseDescriptor(d); + + Klass.Method method = toKlassMethod(m, d); + addMethodTypes(types, method, flags); + } + + private void addMethodTypes(Set types, Klass.Method method, AccessFlags flags) { + if (types.isEmpty() || !buildDeps) { + return; + } + for (Klass to : types) { + ResolutionInfo resInfo = ResolutionInfo.resolvedMethodSignature(this_klass, to, method); + resInfo.setPublicAccess(flags.is(ACC_PUBLIC)); + + this_klass.addDep(to, resInfo); + to.addReferrer(this_klass, resInfo); + } + } + + private void addCheckedExceptionTypes(Set types, Klass.Method method, AccessFlags flags) { + if (types.isEmpty() || !buildDeps) { + return; + } + for (Klass to : types) { + ResolutionInfo resInfo = ResolutionInfo.resolvedCheckedException(this_klass, to, method); + resInfo.setPublicAccess(flags.is(ACC_PUBLIC)); + + this_klass.addDep(to, resInfo); + to.addReferrer(this_klass, resInfo); + } + } + + private Set parseDescriptor(Descriptor d) { + Set types = new TreeSet(); + try { + String desc = d.getValue(classfile.constant_pool); + int p = 0; + while (p < desc.length()) { + String type; + char ch; + switch (ch = desc.charAt(p++)) { + case '(': + case ')': + case '[': + case 'B': + case 'C': + case 'D': + case 'F': + case 'I': + case 'J': + case 'S': + case 'Z': + case 'V': + continue; + case 'L': + int sep = desc.indexOf(';', p); + if (sep == -1) { + throw new RuntimeException("Invalid descriptor: " + (p - 1) + " " + desc); + } + type = checkClassName(desc.substring(p, sep)); + p = sep + 1; + break; + default: + throw new RuntimeException("Invalid descriptor: " + (p - 1) + " " + desc); + } + + if (!type.isEmpty() && buildDeps) { + Klass to = Klass.getKlass(type); + types.add(to); + + } + } + } catch (ConstantPoolException ex) { + throw new RuntimeException(ex); + } + return types; + } +} diff --git a/jdk/make/modules/tools/src/com/sun/classanalyzer/ClassPath.java b/jdk/make/modules/tools/src/com/sun/classanalyzer/ClassPath.java new file mode 100644 index 00000000000..bfdcdd97f59 --- /dev/null +++ b/jdk/make/modules/tools/src/com/sun/classanalyzer/ClassPath.java @@ -0,0 +1,275 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ +package com.sun.classanalyzer; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; + +/** + * + * @author mchung + */ +public class ClassPath { + + public class FileInfo { + + File file; + JarFile jarfile; + int classCount; + long filesize; + + FileInfo(File f) throws IOException { + this.file = f; + this.classCount = 0; + if (file.getName().endsWith(".jar")) { + this.filesize = file.length(); + jarfile = new JarFile(f); + } + } + + File getFile() { + return file; + } + + JarFile getJarFile() { + return jarfile; + } + + String getName() throws IOException { + return file.getCanonicalPath(); + } + } + private List fileList = new ArrayList(); + private static ClassPath instance = new ClassPath(); + + static List getFileInfos() { + return instance.fileList; + } + + static ClassPath setJDKHome(String jdkhome) throws IOException { + List files = new ArrayList(); + File jre = new File(jdkhome, "jre"); + File lib = new File(jdkhome, "lib"); + if (jre.exists() && jre.isDirectory()) { + listFiles(new File(jre, "lib"), ".jar", files); + } else if (lib.exists() && lib.isDirectory()) { + // either a JRE or a jdk build image + listFiles(lib, ".jar", files); + + File classes = new File(jdkhome, "classes"); + if (classes.exists() && classes.isDirectory()) { + // jdk build outputdir + instance.add(classes); + } + } else { + throw new RuntimeException("\"" + jdkhome + "\" not a JDK home"); + } + + for (File f : files) { + instance.add(f); + } + return instance; + } + + static ClassPath setClassPath(String path) throws IOException { + if (path.endsWith(".class")) { + // one class file + File f = new File(path); + if (!f.exists()) { + throw new RuntimeException("Classfile \"" + f + "\" doesn't exist"); + } + + instance.add(f); + } else { + List jarFiles = new ArrayList(); + String[] locs = path.split(File.pathSeparator); + for (String p : locs) { + File f = new File(p); + if (!f.exists()) { + throw new RuntimeException("\"" + f + "\" doesn't exist"); + } + + if (f.isDirectory()) { + instance.add(f); // add the directory to look up .class files + listFiles(f, ".jar", jarFiles); + } else if (p.endsWith(".jar")) { + // jar files + jarFiles.add(f); + } else { + throw new RuntimeException("Invalid file \"" + f); + } + } + // add jarFiles if any + for (File f : jarFiles) { + instance.add(f); + } + } + + return instance; + } + + private void add(File f) throws IOException { + fileList.add(new FileInfo(f)); + } + + public static InputStream open(String pathname) throws IOException { + for (FileInfo fi : instance.fileList) { + if (fi.getName().endsWith(".jar")) { + String path = pathname.replace(File.separatorChar, '/'); + JarEntry e = fi.jarfile.getJarEntry(path); + if (e != null) { + return fi.jarfile.getInputStream(e); + } + } else if (fi.getFile().isDirectory()) { + File f = new File(fi.getFile(), pathname); + if (f.exists()) { + return new FileInputStream(f); + } + } else if (fi.file.isFile()) { + if (fi.getName().endsWith(File.separator + pathname)) { + return new FileInputStream(fi.file); + } + } + } + return null; + } + + static ClassFileParser parserForClass(String classname) throws IOException { + String pathname = classname.replace('.', File.separatorChar) + ".class"; + + ClassFileParser cfparser = null; + for (FileInfo fi : instance.fileList) { + if (fi.getName().endsWith(".class")) { + if (fi.getName().endsWith(File.separator + pathname)) { + cfparser = ClassFileParser.newParser(fi.getFile(), true); + break; + } + } else if (fi.getName().endsWith(".jar")) { + JarEntry e = fi.jarfile.getJarEntry(classname.replace('.', '/') + ".class"); + if (e != null) { + cfparser = ClassFileParser.newParser(fi.jarfile.getInputStream(e), e.getSize(), true); + break; + } + } else if (fi.getFile().isDirectory()) { + File f = new File(fi.getFile(), pathname); + if (f.exists()) { + cfparser = ClassFileParser.newParser(f, true); + break; + } + } + } + return cfparser; + } + + public static void parseAllClassFiles() throws IOException { + instance.parseFiles(); + } + + private void parseFiles() throws IOException { + Set classes = new HashSet(); + + int count = 0; + for (FileInfo fi : fileList) { + // filter out public generated classes (i.e. not public API) + // javax.management.remote.rmi._RMIConnectionImpl_Tie + // javax.management.remote.rmi._RMIServerImpl_Tie + if (fi.getName().endsWith(".class")) { + parseClass(fi); + } else if (fi.getName().endsWith(".jar")) { + Enumeration entries = fi.jarfile.entries(); + while (entries.hasMoreElements()) { + JarEntry e = entries.nextElement(); + if (e.getName().endsWith(".class")) { + ClassFileParser cfparser = ClassFileParser.newParser(fi.jarfile.getInputStream(e), e.getSize(), true); + cfparser.parseDependency(false); + fi.classCount++; + } else if (!e.isDirectory() && ResourceFile.isResource(e.getName())) { + ResourceFile.addResource(e.getName(), fi.jarfile.getInputStream(e)); + } + } + } else if (fi.getFile().isDirectory()) { + List files = new ArrayList(); + listFiles(fi.getFile(), "", files); + for (File f : files) { + if (f.getName().endsWith(".class")) { + parseClass(fi, f); + } else if (!f.isDirectory() && ResourceFile.isResource(f.getCanonicalPath())) { + String pathname = f.getCanonicalPath(); + String dir = fi.getName(); + if (!pathname.startsWith(dir)) { + throw new RuntimeException("Incorrect pathname " + pathname); + } + String name = pathname.substring(dir.length() + 1, pathname.length()); + BufferedInputStream in = new BufferedInputStream(new FileInputStream(f)); + try { + ResourceFile.addResource(name, in); + } finally { + in.close(); + } + } + } + } else { + // should not reach here + throw new RuntimeException("Unexpected class path: " + fi.getFile()); + } + } + } + + private void parseClass(FileInfo fi) throws IOException { + parseClass(fi, fi.getFile()); + } + + private void parseClass(FileInfo fi, File f) throws IOException { + ClassFileParser cfparser = ClassFileParser.newParser(f, true); + cfparser.parseDependency(false); + fi.classCount++; + // need to update the filesize for this directory + fi.filesize += fi.getFile().length(); + + } + + public static void listFiles(File path, String suffix, List result) { + if (path.isDirectory()) { + File[] children = path.listFiles(); + for (File c : children) { + listFiles(c, suffix, result); + } + + } else { + if (suffix.isEmpty() || path.getName().endsWith(suffix)) { + result.add(path); + } + } + } +} diff --git a/jdk/make/modules/tools/src/com/sun/classanalyzer/CodeAttributeParser.java b/jdk/make/modules/tools/src/com/sun/classanalyzer/CodeAttributeParser.java new file mode 100644 index 00000000000..98ff1a49277 --- /dev/null +++ b/jdk/make/modules/tools/src/com/sun/classanalyzer/CodeAttributeParser.java @@ -0,0 +1,157 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +package com.sun.classanalyzer; + +import com.sun.classanalyzer.Klass.Method; + +import com.sun.tools.classfile.*; +import com.sun.tools.classfile.Instruction.*; + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; + +/** + * + * @author Mandy Chung + */ +public class CodeAttributeParser { + private final ClassFileParser cfparser; + private final ConstantPool cpool; + private final ConstantPoolParser constantPoolParser; + + + static final Map> runtimeReferences = + new HashMap>(); + + + CodeAttributeParser(ClassFileParser parser) { + this.cfparser = parser; + this.cpool = cfparser.classfile.constant_pool; + this.constantPoolParser = cfparser.constantPoolParser; + } + + static boolean parseCodeAttribute = false; // by default don't parse code attribute + static void setParseCodeAttribute(boolean newValue) { + parseCodeAttribute = newValue; + } + + void parse(Code_attribute attr, Klass.Method method) { + if (!parseCodeAttribute) { + return; + } + + for (Instruction instr : attr.getInstructions()) { + try { + instr.accept(instructionVisitor, method); + } catch (ArrayIndexOutOfBoundsException e) { + throw new RuntimeException("error at or after byte " + instr.getPC()); + } + + } + + if (attr.exception_table_langth > 0) { + for (int i = 0; i < + attr.exception_table.length; i++) { + Code_attribute.Exception_data handler = attr.exception_table[i]; + int catch_type = handler.catch_type; + if (catch_type > 0) { + addMethodReference(catch_type, method); + } + + } + } + + } + + + private void addMethodReference(int index, Klass.Method m) { + String method = constantPoolParser.getMethodName(index); + + if (method != null && + (method.equals("java.lang.Class.forName") || + method.equals("java.lang.Class.loadClass") || + method.startsWith("java.util.ServiceLoader.load") || + method.equals("sun.misc.Service.providers"))) { + Set refs = runtimeReferences.get(method); + if (refs == null) { + refs = new TreeSet(); + runtimeReferences.put(method, refs); + } + refs.add(m); + } + } + + Instruction.KindVisitor instructionVisitor = + new Instruction.KindVisitor() { + + public Void visitNoOperands(Instruction instr, Klass.Method m) { + return null; + } + + public Void visitArrayType(Instruction instr, TypeKind kind, Klass.Method m) { + return null; + } + + public Void visitBranch(Instruction instr, int offset, Klass.Method m) { + return null; + } + + public Void visitConstantPoolRef(Instruction instr, int index, Klass.Method m) { + addMethodReference(index, m); + return null; + } + + public Void visitConstantPoolRefAndValue(Instruction instr, int index, int value, Klass.Method m) { + addMethodReference(index, m); + return null; + } + + public Void visitLocal(Instruction instr, int index, Klass.Method m) { + return null; + } + + public Void visitLocalAndValue(Instruction instr, int index, int value, Klass.Method m) { + return null; + } + + public Void visitLookupSwitch(Instruction instr, int default_, int npairs, int[] matches, int[] offsets, Klass.Method m) { + return null; + } + + public Void visitTableSwitch(Instruction instr, int default_, int low, int high, int[] offsets, Klass.Method m) { + return null; + } + + public Void visitValue(Instruction instr, int value, Klass.Method m) { + return null; + } + + public Void visitUnknown(Instruction instr, Klass.Method m) { + return null; + } + }; +} diff --git a/jdk/make/modules/tools/src/com/sun/classanalyzer/ConstantPoolAnalyzer.java b/jdk/make/modules/tools/src/com/sun/classanalyzer/ConstantPoolAnalyzer.java new file mode 100644 index 00000000000..f79f2bf6c36 --- /dev/null +++ b/jdk/make/modules/tools/src/com/sun/classanalyzer/ConstantPoolAnalyzer.java @@ -0,0 +1,60 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.classanalyzer; + +/** + * + * @author Mandy Chung + */ +public class ConstantPoolAnalyzer { + public static void main(String[] args) throws Exception { + String jdkhome = null; + + // process arguments + int i = 0; + while (i < args.length) { + String arg = args[i++]; + if (arg.equals("-jdkhome")) { + if (i < args.length) { + jdkhome = args[i++]; + } else { + usage(); + } + } + } + if (jdkhome == null) { + usage(); + } + ClassPath.setJDKHome(jdkhome); + ClassPath.parseAllClassFiles(); + } + + private static void usage() { + System.out.println("Usage: ConstantPoolAnalyzer "); + System.out.println("Options: "); + System.out.println("\t-jdkhome where all jars will be parsed"); + System.out.println("\t-cpath where classes and jars will be parsed"); + System.exit(-1); + } +} diff --git a/jdk/make/modules/tools/src/com/sun/classanalyzer/ConstantPoolParser.java b/jdk/make/modules/tools/src/com/sun/classanalyzer/ConstantPoolParser.java new file mode 100644 index 00000000000..33e593df875 --- /dev/null +++ b/jdk/make/modules/tools/src/com/sun/classanalyzer/ConstantPoolParser.java @@ -0,0 +1,377 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +package com.sun.classanalyzer; + +import com.sun.tools.classfile.*; +import com.sun.tools.classfile.ConstantPool.*; +import static com.sun.tools.classfile.ConstantPool.*; + +/** + * + * @author Mandy Chung + */ +public class ConstantPoolParser { + + private final ClassFileParser cfparser; + private final StringValueVisitor visitor; + private final ConstantPool cpool; + + ConstantPoolParser(ClassFileParser parser) { + this.cfparser = parser; + this.cpool = cfparser.classfile.constant_pool; + this.visitor = new StringValueVisitor(); + } + + public String stringValue(CPInfo cpInfo) { + return visitor.visit(cpInfo); + } + + public String stringValue(int constant_pool_index) { + try { + return stringValue(cpool.get(constant_pool_index)); + } catch (ConstantPool.InvalidIndex e) { + throw new RuntimeException(e); + } + } + + public void parseDependency() { + ConstantPool.Visitor v = new ConstantPool.Visitor() { + + public Integer visitClass(CONSTANT_Class_info info, Void p) { + try { + String classname = cfparser.checkClassName(info.getName()); + if (classname.isEmpty()) { + return 1; + } + + Klass from = cfparser.this_klass; + Klass to = Klass.getKlass(classname); + ResolutionInfo resInfo = ResolutionInfo.resolvedConstantPool(from, to, info.name_index); + + from.addDep(to, resInfo); + to.addReferrer(from, resInfo); + } catch (ConstantPoolException ex) { + throw new RuntimeException(ex); + } + return 1; + } + + public Integer visitDouble(CONSTANT_Double_info info, Void p) { + // skip + return 2; + } + + public Integer visitFieldref(CONSTANT_Fieldref_info info, Void p) { + // skip + return 1; + } + + public Integer visitFloat(CONSTANT_Float_info info, Void p) { + // skip + return 1; + } + + public Integer visitInteger(CONSTANT_Integer_info info, Void p) { + // skip + return 1; + } + + public Integer visitInterfaceMethodref(CONSTANT_InterfaceMethodref_info info, Void p) { + // skip + return 1; + } + + public Integer visitLong(CONSTANT_Long_info info, Void p) { + // skip + return 2; + } + + public Integer visitNameAndType(CONSTANT_NameAndType_info info, Void p) { + // skip + return 1; + } + + public Integer visitMethodref(CONSTANT_Methodref_info info, Void p) { + // skip + return 1; + } + + public Integer visitString(CONSTANT_String_info info, Void p) { + // skip + return 1; + } + + public Integer visitUtf8(CONSTANT_Utf8_info info, Void p) { + // skip + return 1; + } + }; + int cpx = 1; + while (cpx < cpool.size()) { + try { + CPInfo cpInfo = cpool.get(cpx); + cpx += cpInfo.accept(v, null); + } catch (ConstantPool.InvalidIndex ex) { + throw new RuntimeException(ex); + } + } + } + + int getTag(int index) { + try { + return cpool.get(index).getTag(); + } catch (ConstantPoolException ex) { + throw new RuntimeException(ex); + } + } + + String getDescriptor(int index) { + CPInfo cpInfo; + try { + cpInfo = cpool.get(index); + } catch (ConstantPoolException ex) { + throw new RuntimeException(ex); + } + + int tag = cpInfo.getTag(); + switch (tag) { + case CONSTANT_Methodref: + case CONSTANT_InterfaceMethodref: + case CONSTANT_Fieldref: + // simplify references within this class + CPRefInfo ref = (CPRefInfo) cpInfo; + try { + return ref.getNameAndTypeInfo().getType(); + } catch (ConstantPoolException ex) { + } + } + return stringValue(cpInfo); + } + + String getMethodName(int index) { + try { + CPInfo cpInfo = cpool.get(index); + if (cpInfo.getTag() == CONSTANT_Methodref || + cpInfo.getTag() == CONSTANT_InterfaceMethodref) { + + // simplify references within this class + CPRefInfo ref = (CPRefInfo) cpInfo; + String classname; + if (ref.class_index == cfparser.classfile.this_class) { + classname = cfparser.this_klass.getClassName(); + } else { + classname = cfparser.checkClassName(ref.getClassName()).replace('/', '.'); + } + String methodname = ref.getNameAndTypeInfo().getName(); + return classname + "." + methodname; + } else { + return null; + } + } catch (InvalidIndex ex) { + throw new RuntimeException(ex); + } catch (ConstantPoolException ex) { + throw new RuntimeException(ex); + } + + } + + class StringValueVisitor implements ConstantPool.Visitor { + + public StringValueVisitor() { + } + + public String visit(CPInfo info) { + return info.accept(this, null); + } + + public String visitClass(CONSTANT_Class_info info, Void p) { + return getCheckedName(info); + } + + String getCheckedName(CONSTANT_Class_info info) { + try { + return checkName(info.getName()); + } catch (ConstantPoolException e) { + throw new RuntimeException(e); + } + } + + public String visitDouble(CONSTANT_Double_info info, Void p) { + return info.value + "d"; + } + + public String visitFieldref(CONSTANT_Fieldref_info info, Void p) { + return visitRef(info, p); + } + + public String visitFloat(CONSTANT_Float_info info, Void p) { + return info.value + "f"; + } + + public String visitInteger(CONSTANT_Integer_info info, Void p) { + return String.valueOf(info.value); + } + + public String visitInterfaceMethodref(CONSTANT_InterfaceMethodref_info info, Void p) { + return visitRef(info, p); + } + + public String visitLong(CONSTANT_Long_info info, Void p) { + return info.value + "l"; + } + + public String visitNameAndType(CONSTANT_NameAndType_info info, Void p) { + return getCheckedName(info) + ":" + getType(info); + } + + String getCheckedName(CONSTANT_NameAndType_info info) { + try { + return checkName(info.getName()); + } catch (ConstantPoolException e) { + throw new RuntimeException(e); + } + } + + String getType(CONSTANT_NameAndType_info info) { + try { + return info.getType(); + } catch (ConstantPoolException e) { + throw new RuntimeException(e); + } + } + + public String visitMethodref(CONSTANT_Methodref_info info, Void p) { + return visitRef(info, p); + } + + public String visitString(CONSTANT_String_info info, Void p) { + try { + int string_index = info.string_index; + return cpool.getUTF8Info(string_index).accept(this, p); + } catch (ConstantPoolException e) { + throw new RuntimeException(e); + } + } + + public String visitUtf8(CONSTANT_Utf8_info info, Void p) { + String s = info.value; + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < s.length(); i++) { + char c = s.charAt(i); + switch (c) { + case '\t': + sb.append('\\').append('t'); + break; + case '\n': + sb.append('\\').append('n'); + break; + case '\r': + sb.append('\\').append('r'); + break; + case '\"': + sb.append('\\').append('\"'); + break; + default: + sb.append(c); + } + } + return sb.toString(); + } + + String visitRef(CPRefInfo info, Void p) { + String cn = getCheckedClassName(info); + String nat; + try { + nat = info.getNameAndTypeInfo().accept(this, p); + } catch (ConstantPoolException e) { + nat = e.getMessage(); + } + return cn + "." + nat; + } + + String getCheckedClassName(CPRefInfo info) { + try { + return checkName(info.getClassName()); + } catch (ConstantPoolException e) { + throw new RuntimeException(e); + } + } + } + /* If name is a valid binary name, return it; otherwise quote it. */ + + private static String checkName(String name) { + if (name == null) { + return "null"; + } + + int len = name.length(); + if (len == 0) { + return "\"\""; + } + + int cc = '/'; + int cp; + for (int k = 0; k < len; k += Character.charCount(cp)) { + cp = name.codePointAt(k); + if ((cc == '/' && !Character.isJavaIdentifierStart(cp)) || (cp != '/' && !Character.isJavaIdentifierPart(cp))) { + return "\"" + name + "\""; + } + cc = cp; + } + return name; + } + + String tagName(int index) { + try { + int tag = cpool.get(index).getTag(); + switch (tag) { + case CONSTANT_Utf8: + return "Utf8"; + case CONSTANT_Integer: + return "int"; + case CONSTANT_Float: + return "float"; + case CONSTANT_Long: + return "long"; + case CONSTANT_Double: + return "double"; + case CONSTANT_Class: + return "class"; + case CONSTANT_String: + return "String"; + case CONSTANT_Fieldref: + return "Field"; + case CONSTANT_Methodref: + return "Method"; + case CONSTANT_InterfaceMethodref: + return "InterfaceMethod"; + case CONSTANT_NameAndType: + return "NameAndType"; + default: + return "(unknown tag)"; + } + } catch (InvalidIndex e) { + throw new RuntimeException(e); + } + } +} diff --git a/jdk/make/modules/tools/src/com/sun/classanalyzer/DependencyConfig.java b/jdk/make/modules/tools/src/com/sun/classanalyzer/DependencyConfig.java new file mode 100644 index 00000000000..107e1d10c85 --- /dev/null +++ b/jdk/make/modules/tools/src/com/sun/classanalyzer/DependencyConfig.java @@ -0,0 +1,99 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +package com.sun.classanalyzer; + +import java.io.BufferedReader; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.List; + +/** + * Config file specifying additional dependency + * Each line consists of: + * -> + * where can be: + * @ClassForName and is its dependency + * @Provider and is the service name + * @Providers and is the list of the service names + * + * @author Mandy Chung + */ +public class DependencyConfig { + private DependencyConfig() { + } + + static void parse(List configs) throws IOException { + for (String s : configs) { + parse(s); + } + } + + private static void parse(String config) throws IOException { + // parse configuration file + FileInputStream in = new FileInputStream(config); + try { + BufferedReader reader = new BufferedReader(new InputStreamReader(in)); + String line; + int lineNumber = 0; + String type = null; + while ((line = reader.readLine()) != null) { + lineNumber++; + line = line.trim(); + if (line.length() == 0 || line.charAt(0) == '#') { + continue; + } + if (line.charAt(0) == '@') { + if (AnnotatedDependency.isValidType(line)) { + type = line; + continue; + } else { + throw new RuntimeException(config + ", line " + + lineNumber + ", invalid annotation type."); + } + } + String[] s = line.split("\\s+"); + if (s.length < 3 || !s[1].equals("->")) { + throw new RuntimeException(config + ", line " + + lineNumber + ", is malformed"); + } + String classname = s[0].trim(); + String value = s[2].trim(); + + Klass k = Klass.findKlass(classname); + if (k == null) { + // System.out.println("Warning: " + classname + " cannot be found"); + continue; + } + AnnotatedDependency dep = AnnotatedDependency.newAnnotatedDependency(type, value, k); + if (dep == null) { + throw new RuntimeException(config + ", line " + + lineNumber + ", is malformed. Fail to construct the dependency."); + } + } + + } finally { + in.close(); + } + } +} diff --git a/jdk/make/modules/tools/src/com/sun/classanalyzer/Klass.java b/jdk/make/modules/tools/src/com/sun/classanalyzer/Klass.java new file mode 100644 index 00000000000..a4d2eb27775 --- /dev/null +++ b/jdk/make/modules/tools/src/com/sun/classanalyzer/Klass.java @@ -0,0 +1,357 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +package com.sun.classanalyzer; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.SortedMap; +import java.util.TreeMap; +import java.util.TreeSet; + +import com.sun.tools.classfile.AccessFlags; + +/** + * + * @author Mandy Chung + */ +public class Klass implements Comparable { + private final String classname; + private final String packagename; + private Module module; + private boolean isJavaLangObject; + private String[] paths; + private Map> methods; + private AccessFlags accessFlags; + private long filesize; + + private SortedMap> deps; + private SortedMap> referrers; + private List annotatedDeps; + private Set classForNameRefs; + + private Klass(String classname) { + this.classname = classname; + this.paths = classname.replace('.', '/').split("/"); + this.isJavaLangObject = classname.equals("java.lang.Object"); + this.deps = new TreeMap>(); + this.referrers = new TreeMap>(); + this.methods = new HashMap>(); + this.annotatedDeps = new ArrayList(); + this.classForNameRefs = new TreeSet(); + + int pos = classname.lastIndexOf('.'); + this.packagename = (pos > 0) ? classname.substring(0, pos) : ""; + } + + String getBasename() { + return paths[paths.length - 1]; + } + + String getClassName() { + return classname; + } + + String getPackageName() { + return packagename; + } + + String getClassFilePathname() { + StringBuilder sb = new StringBuilder(paths[0]); + for (int i = 1; i < paths.length; i++) { + String p = paths[i]; + sb.append(File.separator).append(p); + } + return sb.append(".class").toString(); + } + + boolean isPublic() { + return accessFlags == null || accessFlags.is(AccessFlags.ACC_PUBLIC); + } + + Module getModule() { + return module; + } + + void setModule(Module m) { + if (module != null) { + throw new RuntimeException("Module for " + this + " already set"); + } + this.module = m; + } + + Set getReferencedClasses() { + return deps.keySet(); + } + + Set getReferencingClasses() { + return referrers.keySet(); + } + + void setAccessFlags(int flags) { + this.accessFlags = new AccessFlags(flags); + } + + void setFileSize(long size) { + this.filesize = size; + } + + long getFileSize() { + return this.filesize; + } + + boolean exists() { + return filesize > 0; + } + + boolean skip(Klass k) { + // skip if either class is a root or same class + return k.isJavaLangObject || this == k || k.classname.equals(classname); + } + + void addDep(Method callee, ResolutionInfo resInfo) { + addDep(callee.getKlass(), resInfo); + } + + void addDep(Klass ref, ResolutionInfo ri) { + if (skip(ref)) { + return; + } + Set resInfos; + if (!deps.containsKey(ref)) { + resInfos = new TreeSet(); + deps.put(ref, resInfos); + } else { + resInfos = deps.get(ref); + } + resInfos.add(ri); + } + + void addReferrer(Method caller, ResolutionInfo resInfo) { + addReferrer(caller.getKlass(), resInfo); + } + + void addReferrer(Klass k, ResolutionInfo ri) { + if (skip(k)) { + return; + } + Set resInfos; + if (!referrers.containsKey(k)) { + resInfos = new TreeSet(); + referrers.put(k, resInfos); + } else { + resInfos = referrers.get(k); + } + resInfos.add(ri); + } + + Method getMethod(String name) { + return getMethod(name, ""); + } + + Method getMethod(String name, String signature) { + Set set; + if (methods.containsKey(name)) { + set = methods.get(name); + } else { + set = new TreeSet(); + methods.put(name, set); + } + + for (Method m : set) { + if (m.getName().equals(name) && m.getSignature().equals(signature)) { + return m; + } + } + Method m = new Method(this, name, signature); + set.add(m); + return m; + } + + @Override + public String toString() { + return classname; + } + + @Override + public int compareTo(Klass o) { + return classname.compareTo(o.classname); + } + + void addAnnotatedDep(AnnotatedDependency dep) { + annotatedDeps.add(dep); + } + + void addClassForNameReference(String method) { + classForNameRefs.add(method); + } + + List getAnnotatedDeps() { + return annotatedDeps; + } + + private static Map classes = new TreeMap(); + static Set getAllClasses() { + return new TreeSet(classes.values()); + } + + static Klass findKlassFromPathname(String filename) { + String name = filename; + if (filename.endsWith(".class")) { + name = filename.substring(0, filename.length() - 6); + } + + // trim ".class" + name = name.replace('/', '.'); + for (Klass k : classes.values()) { + if (name.endsWith(k.getClassName())) { + return k; + } + } + return null; + } + + static Klass findKlass(String classname) { + return classes.get(classname); + } + + static Klass getKlass(String name) { + Klass k; + String classname = name.replace('/', '.'); + if (classname.charAt(classname.length() - 1) == ';') { + classname = classname.substring(0, classname.length() - 1); + } + if (classes.containsKey(classname)) { + k = classes.get(classname); + } else { + k = new Klass(classname); + classes.put(classname, k); + } + return k; + } + + public class Method implements Comparable { + + private final Klass k; + private final String method; + private final String signature; + private long codeLength; + // non-primitive types only + private final List argTypes; + private final Klass returnType; + boolean isAbstract = false; + boolean marked = false; + + public Method(Klass k, String method, String signature) { + this(k, method, signature, null, null); + } + + public Method(Klass k, String method, String signature, Klass returnType, List argTypes) { + this.k = k; + this.method = method; + this.signature = signature; + this.argTypes = argTypes; + this.returnType = returnType; + this.codeLength = 0; + } + + public Klass getKlass() { + return k; + } + + public String getName() { + return method; + } + + public String getSignature() { + return signature; + } + + public Klass getReturnType() { + return returnType; + } + + public List argTypes() { + return argTypes; + } + + public void setCodeLength(long len) { + this.codeLength = len; + } + + public long getCodeLength() { + return codeLength; + } + + @Override + public boolean equals(Object o) { + if (o instanceof Method) { + return compareTo((Method) o) == 0; + } else { + return false; + } + } + + @Override + public int hashCode() { + int hash = 3; + hash = 71 * hash + (this.k != null ? this.k.hashCode() : 0); + hash = 71 * hash + (this.method != null ? this.method.hashCode() : 0); + return hash; + } + + @Override + public String toString() { + if (signature.isEmpty()) { + return k.classname + "." + method; + } else { + return signature; + } + } + + public String toHtmlString() { + return toString().replace("<", "<").replace(">", ">"); + } + + boolean isClinit() { + return method.equals(""); + } + + public int compareTo(Method m) { + if (k == m.getKlass()) { + if (method.equals(m.method)) { + return signature.compareTo(m.signature); + } else { + return method.compareTo(m.method); + } + } else { + return k.compareTo(m.getKlass()); + } + } + } +} diff --git a/jdk/make/modules/tools/src/com/sun/classanalyzer/Module.java b/jdk/make/modules/tools/src/com/sun/classanalyzer/Module.java new file mode 100644 index 00000000000..0fdc5b145fa --- /dev/null +++ b/jdk/make/modules/tools/src/com/sun/classanalyzer/Module.java @@ -0,0 +1,693 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ +package com.sun.classanalyzer; + +import com.sun.classanalyzer.AnnotatedDependency.OptionalDependency; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.ArrayDeque; +import java.util.Collection; +import java.util.Collections; +import java.util.Deque; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; + +/** + * + * @author Mandy Chung + */ +public class Module implements Comparable { + + private static Map modules = new LinkedHashMap(); + + public static Module addModule(ModuleConfig config) { + String name = config.module; + if (modules.containsKey(name)) { + throw new RuntimeException("module \"" + name + "\" already exists"); + } + + Module m = new Module(config); + modules.put(name, m); + return m; + } + + public static Module findModule(String name) { + return modules.get(name); + } + + static Collection getAllModules() { + return Collections.unmodifiableCollection(modules.values()); + } + private final String name; + private final ModuleConfig config; + private final Set classes; + private final Set resources; + private final Set unresolved; + private final Set dependents; + private final Map packages; + private final Set members; + private Module group; + private boolean isBaseModule; + + private Module(ModuleConfig config) { + this.name = config.module; + this.isBaseModule = config.isBase; + this.classes = new TreeSet(); + this.resources = new TreeSet(); + this.config = config; + this.unresolved = new HashSet(); + this.dependents = new TreeSet(); + this.packages = new TreeMap(); + this.members = new TreeSet(); + this.group = this; // initialize to itself + } + + String name() { + return name; + } + + Module group() { + return group; + } + + boolean isBase() { + return isBaseModule; + } + + Set members() { + return members; + } + + boolean contains(Klass k) { + return k != null && classes.contains(k); + } + + boolean isEmpty() { + return classes.isEmpty() && resources.isEmpty(); + } + + /** + * Returns an Iterable of Dependency, only one for each dependent + * module of the strongest dependency (i.e. + * hard static > hard dynamic > optional static > optional dynamic + */ + Iterable dependents() { + Map deps = new LinkedHashMap(); + for (Dependency dep : dependents) { + Dependency d = deps.get(dep.module); + if (d == null || dep.compareTo(d) > 0) { + deps.put(dep.module, dep); + } + } + return deps.values(); + } + + @Override + public int compareTo(Module o) { + if (o == null) { + return -1; + } + return name.compareTo(o.name); + } + + @Override + public String toString() { + return name; + } + + void addKlass(Klass k) { + classes.add(k); + k.setModule(this); + + // update package statistics + String pkg = k.getPackageName(); + PackageInfo pkginfo = packages.get(pkg); + if (pkginfo == null) { + pkginfo = new PackageInfo(pkg); + packages.put(pkg, pkginfo); + } + if (k.exists()) { + // only count the class that is parsed + pkginfo.add(k.getFileSize()); + } + } + + void addResource(ResourceFile res) { + resources.add(res); + res.setModule(this); + } + + void processRootsAndReferences() { + // start with the root set + Deque pending = new ArrayDeque(); + for (Klass k : Klass.getAllClasses()) { + if (k.getModule() != null) { + continue; + } + String classname = k.getClassName(); + if (config.matchesRoot(classname) && !config.isExcluded(classname)) { + addKlass(k); + pending.add(k); + } + } + + // follow all references + Klass k; + while ((k = pending.poll()) != null) { + if (!classes.contains(k)) { + addKlass(k); + } + for (Klass other : k.getReferencedClasses()) { + Module otherModule = other.getModule(); + if (otherModule != null && otherModule != this) { + // this module is dependent on otherModule + addDependency(k, other); + continue; + } + + if (!classes.contains(other)) { + if (config.isExcluded(other.getClassName())) { + // reference to an excluded class + unresolved.add(new Reference(k, other)); + } else { + pending.add(other); + } + } + } + } + + // add other matching classes that don't require dependency analysis + for (Klass c : Klass.getAllClasses()) { + if (c.getModule() == null) { + String classname = c.getClassName(); + if (config.matchesIncludes(classname) && !config.isExcluded(classname)) { + addKlass(c); + // dependencies + for (Klass other : c.getReferencedClasses()) { + Module otherModule = other.getModule(); + if (otherModule == null) { + unresolved.add(new Reference(c, other)); + } else { + if (otherModule != this) { + // this module is dependent on otherModule + addDependency(c, other); + } + } + } + } + } + } + + + // add other matching classes that don't require dependency analysis + for (ResourceFile res : ResourceFile.getAllResources()) { + if (res.getModule() == null) { + String name = res.getName(); + if (config.matchesIncludes(name) && !config.isExcluded(name)) { + addResource(res); + } + } + } + } + + void addDependency(Klass from, Klass to) { + Dependency dep = new Dependency(from, to); + dependents.add(dep); + } + + void fixupDependencies() { + // update dependencies for classes that were allocated to modules after + // this module was processed. + for (Reference ref : unresolved) { + Module m = ref.referree().getModule(); + if (m == null || m != this) { + addDependency(ref.referrer, ref.referree); + } + } + + fixupAnnotatedDependencies(); + } + + private void fixupAnnotatedDependencies() { + // add dependencies that this klass may depend on due to the AnnotatedDependency + dependents.addAll(AnnotatedDependency.getDependencies(this)); + } + + boolean isModuleDependence(Klass k) { + Module m = k.getModule(); + return m == null || (!classes.contains(k) && !m.isBase()); + } + + Module getModuleDependence(Klass k) { + if (isModuleDependence(k)) { + Module m = k.getModule(); + if (group == this && m != null) { + // top-level module + return m.group; + } else { + return m; + } + } + return null; + } + +

void visit(Set visited, Visitor

visitor, P p) { + if (!visited.contains(this)) { + visited.add(this); + visitor.preVisit(this, p); + for (Module m : members) { + m.visit(visited, visitor, p); + visitor.postVisit(this, m, p); + } + } else { + throw new RuntimeException("Cycle detected: module " + this.name); + } + } + + void addMember(Module m) { + // merge class list + for (Klass k : m.classes) { + classes.add(k); + } + + // merge resource list + for (ResourceFile res : m.resources) { + resources.add(res); + } + + // merge the package statistics + for (PackageInfo pinfo : m.getPackageInfos()) { + String packageName = pinfo.pkgName; + PackageInfo pkginfo = packages.get(packageName); + if (pkginfo == null) { + pkginfo = new PackageInfo(packageName); + packages.put(packageName, pkginfo); + } + pkginfo.add(pinfo); + } + } + + static void buildModuleMembers() { + // set up module member relationship + for (Module m : modules.values()) { + m.group = m; // initialize to itself + for (String name : m.config.members()) { + Module member = modules.get(name); + if (member == null) { + throw new RuntimeException("module \"" + name + "\" doesn't exist"); + } + m.members.add(member); + } + } + + // set up the top-level module + Visitor groupSetter = new Visitor() { + + public void preVisit(Module m, Module p) { + m.group = p; + if (p.isBaseModule) { + // all members are also base + m.isBaseModule = true; + } + } + + public void postVisit(Module m, Module child, Module p) { + // nop - breadth-first search + } + }; + + // propagate the top-level module to all its members + for (Module p : modules.values()) { + for (Module m : p.members) { + if (m.group == m) { + m.visit(new TreeSet(), groupSetter, p); + } + } + } + + Visitor mergeClassList = new Visitor() { + + public void preVisit(Module m, Module p) { + // nop - depth-first search + } + + public void postVisit(Module m, Module child, Module p) { + m.addMember(child); + } + }; + + Set visited = new TreeSet(); + for (Module m : modules.values()) { + if (m.group() == m) { + if (m.members().size() > 0) { + // merge class list from all its members + m.visit(visited, mergeClassList, m); + } + + // clear the dependencies before fixup + m.dependents.clear(); + + // fixup dependencies + for (Klass k : m.classes) { + for (Klass other : k.getReferencedClasses()) { + if (m.isModuleDependence(other)) { + // this module is dependent on otherModule + m.addDependency(k, other); + } + } + } + + // add dependencies that this klass may depend on due to the AnnotatedDependency + m.fixupAnnotatedDependencies(); + } + } + } + + class PackageInfo implements Comparable { + + final String pkgName; + int count; + long filesize; + + PackageInfo(String name) { + this.pkgName = name; + this.count = 0; + this.filesize = 0; + } + + void add(PackageInfo pkg) { + this.count += pkg.count; + this.filesize += pkg.filesize; + } + + void add(long size) { + count++; + filesize += size; + + } + + @Override + public int compareTo(Object o) { + return pkgName.compareTo(((PackageInfo) o).pkgName); + } + } + + Set getPackageInfos() { + return new TreeSet(packages.values()); + } + + void printSummaryTo(String output) throws IOException { + PrintWriter writer = new PrintWriter(output); + try { + long total = 0L; + int count = 0; + writer.format("%10s\t%10s\t%s\n", "Bytes", "Classes", "Package name"); + for (String pkg : packages.keySet()) { + PackageInfo info = packages.get(pkg); + if (info.count > 0) { + writer.format("%10d\t%10d\t%s\n", info.filesize, info.count, pkg); + total += info.filesize; + count += info.count; + } + } + + writer.format("\nTotal: %d bytes (uncompressed) %d classes\n", total, count); + } finally { + writer.close(); + } + + } + + void printClassListTo(String output) throws IOException { + // no file created if the module doesn't have any class nor resource + if (isEmpty()) { + return; + } + + PrintWriter writer = new PrintWriter(output); + try { + for (Klass c : classes) { + if (c.exists()) { + writer.format("%s\n", c.getClassFilePathname()); + } else { + trace("%s in module %s missing\n", c, this); + } + } + + } finally { + writer.close(); + } + } + + void printResourceListTo(String output) throws IOException { + // no file created if the module doesn't have any resource file + if (resources.isEmpty()) { + return; + } + + PrintWriter writer = new PrintWriter(output); + try { + for (ResourceFile res : resources) { + writer.format("%s\n", res.getPathname()); + } + } finally { + writer.close(); + } + } + + void printDependenciesTo(String output, boolean showDynamic) throws IOException { + // no file created if the module doesn't have any class + if (isEmpty()) { + return; + } + + PrintWriter writer = new PrintWriter(output); + try { + // classes that this klass may depend on due to the AnnotatedDependency + Map> annotatedDeps = AnnotatedDependency.getReferences(this); + + for (Klass klass : classes) { + Set references = klass.getReferencedClasses(); + for (Klass other : references) { + String classname = klass.getClassName(); + boolean optional = OptionalDependency.isOptional(klass, other); + if (optional) { + classname = "[optional] " + classname; + } + + Module m = getModuleDependence(other); + if (m != null || other.getModule() == null) { + writer.format("%-40s -> %s (%s)", classname, other, m); + Reference ref = new Reference(klass, other); + if (annotatedDeps.containsKey(ref)) { + for (AnnotatedDependency ad : annotatedDeps.get(ref)) { + writer.format(" %s", ad.getTag()); + } + // printed; so remove the dependency from the annotated deps list + annotatedDeps.remove(ref); + } + writer.format("\n"); + } + } + } + + + // print remaining dependencies specified in AnnotatedDependency list + if (annotatedDeps.size() > 0) { + for (Map.Entry> entry : annotatedDeps.entrySet()) { + Reference ref = entry.getKey(); + Module m = getModuleDependence(ref.referree); + if (m != null || ref.referree.getModule() == null) { + String classname = ref.referrer.getClassName(); + boolean optional = true; + boolean dynamic = true; + String tag = ""; + for (AnnotatedDependency ad : entry.getValue()) { + if (optional && !ad.isOptional()) { + optional = false; + tag = ad.getTag(); + } + if (!ad.isDynamic()) { + dynamic = false; + } + } + if (!showDynamic && optional && dynamic) { + continue; + } + if (optional) { + if (dynamic) { + classname = "[dynamic] " + classname; + } else { + classname = "[optional] " + classname; + } + } + writer.format("%-40s -> %s (%s) %s%n", classname, ref.referree, m, tag); + } + } + } + + } finally { + writer.close(); + } + } + + static class Dependency implements Comparable { + + final Module module; + final boolean optional; + final boolean dynamic; + + Dependency(Klass from, Klass to) { + // static dependency + this.module = to.getModule() != null ? to.getModule().group() : null; + this.optional = OptionalDependency.isOptional(from, to); + this.dynamic = false; + } + + Dependency(Module m, boolean optional, boolean dynamic) { + this.module = m != null ? m.group() : null; + this.optional = optional; + this.dynamic = dynamic; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof Dependency)) { + return false; + } + if (this == obj) { + return true; + } + + Dependency d = (Dependency) obj; + if (this.module != d.module) { + return false; + } else { + return this.optional == d.optional && this.dynamic == d.dynamic; + } + } + + @Override + public int hashCode() { + int hash = 3; + hash = 19 * hash + (this.module != null ? this.module.hashCode() : 0); + hash = 19 * hash + (this.optional ? 1 : 0); + hash = 19 * hash + (this.dynamic ? 1 : 0); + return hash; + } + + @Override + public int compareTo(Dependency d) { + if (this.equals(d)) { + return 0; + } + + // Hard static > hard dynamic > optional static > optional dynamic + if (this.module == d.module) { + if (this.optional == d.optional) { + return this.dynamic ? -1 : 1; + } else { + return this.optional ? -1 : 1; + } + } else if (this.module != null && d.module != null) { + return (this.module.compareTo(d.module)); + } else { + return (this.module == null) ? -1 : 1; + } + } + + @Override + public String toString() { + String s = module.name(); + if (dynamic && optional) { + s += " (dynamic)"; + } else if (optional) { + s += " (optional)"; + } + return s; + } + } + + static class Reference implements Comparable { + + private final Klass referrer, referree; + + Reference(Klass referrer, Klass referree) { + this.referrer = referrer; + this.referree = referree; + } + + Klass referrer() { + return referrer; + } + + Klass referree() { + return referree; + } + + @Override + public int hashCode() { + return referrer.hashCode() ^ referree.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof Reference)) { + return false; + } + if (this == obj) { + return true; + } + + Reference r = (Reference) obj; + return (this.referrer.equals(r.referrer) && + this.referree.equals(r.referree)); + } + + @Override + public int compareTo(Reference r) { + int ret = referrer.compareTo(r.referrer); + if (ret == 0) { + ret = referree.compareTo(r.referree); + } + return ret; + } + } + + interface Visitor

{ + + public void preVisit(Module m, P param); + + public void postVisit(Module m, Module child, P param); + } + private static boolean traceOn = System.getProperty("classanalyzer.debug") != null; + + private static void trace(String format, Object... params) { + System.err.format(format, params); + } +} diff --git a/jdk/make/modules/tools/src/com/sun/classanalyzer/ModuleConfig.java b/jdk/make/modules/tools/src/com/sun/classanalyzer/ModuleConfig.java new file mode 100644 index 00000000000..d5ead840e01 --- /dev/null +++ b/jdk/make/modules/tools/src/com/sun/classanalyzer/ModuleConfig.java @@ -0,0 +1,562 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +package com.sun.classanalyzer; + +import java.io.BufferedReader; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collection; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; +import java.util.regex.Pattern; + +/** + * + * @author Mandy Chung + */ +public class ModuleConfig { + + private static String baseModuleName = "base"; + private final Set roots; + private final Set includes; + private final Filter filter; + private List members; + final String module; + final boolean isBase; + + private ModuleConfig(String name) throws IOException { + this.roots = new TreeSet(); + this.includes = new TreeSet(); + this.module = name; + this.isBase = name.equals(baseModuleName); + this.filter = new Filter(this); + } + + List members() { + if (members == null) { + members = new LinkedList(); + + for (String s : includes) { + if (!s.contains("*") && Module.findModule(s) != null) { + // module member + members.add(s); + } + } + } + return members; + } + + boolean matchesRoot(String name) { + for (String pattern : roots) { + if (matches(name, pattern)) { + return true; + } + } + return false; + } + + boolean matchesIncludes(String name) { + for (String pattern : includes) { + if (matches(name, pattern)) { + return true; + } + } + return false; + } + + boolean isExcluded(String name) { + return filter.isExcluded(name); + } + + boolean matchesPackage(String packageName, String pattern) { + int pos = pattern.lastIndexOf('.'); + String pkg = pos > 0 ? pattern.substring(0, pos) : ""; + return packageName.equals(pkg); + } + + + boolean matches(String name, String pattern) { + if (pattern.contains("**") && !pattern.endsWith("**")) { + throw new UnsupportedOperationException("Not yet implemented"); + } + + String javaName = name; + + boolean isResourceFile = name.indexOf('/') >= 0; + if (isResourceFile) { + // it's a resource file; convert the name as a java + javaName = name.replace('/', '.'); + } + if (pattern.indexOf('/') < 0) { + // if the pattern doesn't contain '/ + return matchesJavaName(javaName, pattern); + } else { + if (isResourceFile) { + // the pattern is for matching resource file + return matchesNameWithSlash(name, pattern); + } else { + return false; + } + } + } + + boolean matchesJavaName(String name, String pattern) { + int pos = name.lastIndexOf('.'); + String packageName = pos > 0 ? name.substring(0, pos) : ""; + if (pattern.endsWith("**")) { + String p = pattern.substring(0, pattern.length() - 2); + return name.startsWith(p); + } else if (pattern.endsWith("*") && pattern.indexOf('*') == pattern.lastIndexOf('*')) { + if (matchesPackage(packageName, pattern)) { + // package name has to be exact match + String p = pattern.substring(0, pattern.length() - 1); + return name.startsWith(p); + } else { + return false; + } + } else if (pattern.contains("*")) { + String basename = pos > 0 ? name.substring(pos + 1, name.length()) : name; + pos = pattern.indexOf('*'); + String prefix = pattern.substring(0, pos); + String suffix = pattern.substring(pos + 1, pattern.length()); + if (name.startsWith(prefix) && matchesPackage(packageName, prefix)) { + // package name has to be exact match + if (suffix.contains("*")) { + return name.matches(convertToRegex(pattern)); + } else { + return basename.endsWith(suffix); + } + } else { + // we don't support wildcard be used in the package name + return false; + } + } else { + // exact match or inner class + return name.equals(pattern) || name.startsWith(pattern + "$"); + } + } + + boolean matchesNameWithSlash(String name, String pattern) { + if (pattern.endsWith("**")) { + String p = pattern.substring(0, pattern.length() - 2); + return name.startsWith(p); + } else if (pattern.contains("*")) { + int pos = pattern.indexOf('*'); + String prefix = pattern.substring(0, pos); + String suffix = pattern.substring(pos + 1, pattern.length()); + String tail = name.substring(pos, name.length()); + + if (!name.startsWith(prefix)) { + // prefix has to exact match + return false; + } + + if (pattern.indexOf('*') == pattern.lastIndexOf('*')) { + // exact match prefix with no '/' in the tail string + String wildcard = tail.substring(0, tail.length() - suffix.length()); + return tail.indexOf('/') < 0 && tail.endsWith(suffix); + } + + if (suffix.contains("*")) { + return matchesNameWithSlash(tail, suffix); + } else { + // tail ends with the suffix while no '/' in the wildcard matched string + String any = tail.substring(0, tail.length() - suffix.length()); + return tail.endsWith(suffix) && any.indexOf('/') < 0; + } + } else { + // exact match + return name.equals(pattern); + } + } + + private String convertToRegex(String pattern) { + StringBuilder sb = new StringBuilder(); + int i = 0; + int index = 0; + int plen = pattern.length(); + while (i < plen) { + char p = pattern.charAt(i); + if (p == '*') { + sb.append("(").append(pattern.substring(index, i)).append(")"); + if (i + 1 < plen && pattern.charAt(i + 1) == '*') { + sb.append(".*"); + index = i + 2; + } else { + sb.append("[^\\.]*"); + index = i + 1; + } + } + i++; + } + if (index < plen) { + sb.append("(").append(pattern.substring(index, plen)).append(")"); + } + return sb.toString(); + } + + static class Filter { + + final ModuleConfig config; + final Set exclude = new TreeSet(); + final Set allow = new TreeSet(); + + Filter(ModuleConfig config) { + this.config = config; + } + + Filter exclude(String pattern) { + exclude.add(pattern); + return this; + } + + Filter allow(String pattern) { + allow.add(pattern); + return this; + } + + String allowedBy(String name) { + String allowedBy = null; + for (String pattern : allow) { + if (config.matches(name, pattern)) { + if (name.equals(pattern)) { + return pattern; // exact match + } + if (allowedBy == null) { + allowedBy = pattern; + } else { + if (pattern.length() > allowedBy.length()) { + allowedBy = pattern; + } + } + } + } + return allowedBy; + } + + String excludedBy(String name) { + String allowedBy = allowedBy(name); + String excludedBy = null; + + if (allowedBy != null && name.equals(allowedBy)) { + return null; // exact match + } + for (String pattern : exclude) { + if (config.matches(name, pattern)) { + // not matched by allowed rule or exact match + if (allowedBy == null || name.equals(pattern)) { + return pattern; + } + if (excludedBy == null) { + excludedBy = pattern; + } else { + if (pattern.length() > excludedBy.length()) { + excludedBy = pattern; + } + } + } + } + return excludedBy; + } + + boolean isExcluded(String name) { + String allowedBy = allowedBy(name); + String excludedBy = excludedBy(name); + + if (excludedBy == null) { + return false; + } + // not matched by allowed rule or exact match + if (allowedBy == null || name.equals(excludedBy)) { + return true; + } + + if (allowedBy == null) { + return true; + } + if (allowedBy != null && + excludedBy.length() > allowedBy.length()) { + return true; + } + return false; + } + } + + private static String trimComment(String line) { + StringBuilder sb = new StringBuilder(); + + int pos = 0; + while (pos >= 0 && pos < line.length()) { + int c1 = line.indexOf("//", pos); + if (c1 > 0 && !Character.isWhitespace(line.charAt(c1-1))) { + // not a comment + c1 = -1; + } + + int c2 = line.indexOf("/*", pos); + if (c2 > 0 && !Character.isWhitespace(line.charAt(c2-1))) { + // not a comment + c2 = -1; + } + + int c = line.length(); + int n = line.length(); + if (c1 >= 0 || c2 >= 0) { + if (c1 >= 0) { + c = c1; + } + if (c2 >= 0 && c2 < c) { + c = c2; + } + int c3 = line.indexOf("*/", c2 + 2); + if (c == c2 && c3 > c2) { + n = c3 + 2; + } + } + if (c > 0) { + if (sb.length() > 0) { + // add a whitespace if multiple comments on one line + sb.append(" "); + } + sb.append(line.substring(pos, c)); + } + pos = n; + } + return sb.toString(); + } + + private static boolean beginBlockComment(String line) { + int pos = 0; + while (pos >= 0 && pos < line.length()) { + int c = line.indexOf("/*", pos); + if (c < 0) { + return false; + } + + if (c > 0 && !Character.isWhitespace(line.charAt(c-1))) { + return false; + } + + int c1 = line.indexOf("//", pos); + if (c1 >= 0 && c1 < c) { + return false; + } + + int c2 = line.indexOf("*/", c + 2); + if (c2 < 0) { + return true; + } + pos = c + 2; + } + return false; + } + + static void setBaseModule(String name) { + baseModuleName = name; + } + // TODO: we shall remove "-" from the regex once we define + // the naming convention for the module names without dashes + static final Pattern classNamePattern = Pattern.compile("[\\w\\.\\*_$-/]+"); + + static List readConfigurationFile(String file) throws IOException { + List result = new ArrayList(); + // parse configuration file + FileInputStream in = new FileInputStream(file); + try { + BufferedReader reader = new BufferedReader(new InputStreamReader(in)); + String line; + + int lineNumber = 0; + boolean inRoots = false; + boolean inIncludes = false; + boolean inAllows = false; + boolean inExcludes = false; + boolean inBlockComment = false; + ModuleConfig config = null; + + while ((line = reader.readLine()) != null) { + lineNumber++; + + if (inBlockComment) { + int c = line.indexOf("*/"); + if (c >= 0) { + line = line.substring(c + 2, line.length()); + inBlockComment = false; + } else { + // skip lines until end of comment block + continue; + } + } + + inBlockComment = beginBlockComment(line); + + line = trimComment(line).trim(); + // ignore empty lines + if (line.length() == 0) { + continue; + } + + String values; + if (inRoots || inIncludes || inExcludes || inAllows) { + values = line; + } else { + String[] s = line.split("\\s+"); + String keyword = s[0].trim(); + if (keyword.equals("module")) { + if (s.length != 3 || !s[2].trim().equals("{")) { + throw new RuntimeException(file + ", line " + + lineNumber + ", is malformed"); + } + config = new ModuleConfig(s[1].trim()); + result.add(config); + // switch to a new module; so reset the flags + inRoots = false; + inIncludes = false; + inExcludes = false; + inAllows = false; + continue; + } else if (keyword.equals("roots")) { + inRoots = true; + } else if (keyword.equals("include")) { + inIncludes = true; + } else if (keyword.equals("exclude")) { + inExcludes = true; + } else if (keyword.equals("allow")) { + inAllows = true; + } else if (keyword.equals("}")) { + if (config == null || s.length != 1) { + throw new RuntimeException(file + ", line " + + lineNumber + ", is malformed"); + } else { + // end of a module + config = null; + continue; + } + } else { + throw new RuntimeException(file + ", \"" + keyword + "\" on line " + + lineNumber + ", is not recognized"); + } + values = line.substring(keyword.length(), line.length()).trim(); + } + + if (config == null) { + throw new RuntimeException(file + ", module not specified"); + } + + int len = values.length(); + if (len == 0) { + continue; + } + char lastchar = values.charAt(len - 1); + if (lastchar != ',' && lastchar != ';') { + throw new RuntimeException(file + ", line " + + lineNumber + ", is malformed:" + + " ',' or ';' is missing."); + } + + values = values.substring(0, len - 1); + // parse the values specified for a keyword specified + for (String s : values.split(",")) { + s = s.trim(); + if (s.length() > 0) { + if (!classNamePattern.matcher(s).matches()) { + throw new RuntimeException(file + ", line " + + lineNumber + ", is malformed: \"" + s + "\""); + } + if (inRoots) { + config.roots.add(s); + } else if (inIncludes) { + config.includes.add(s); + } else if (inExcludes) { + config.filter.exclude(s); + } else if (inAllows) { + config.filter.allow(s); + } + + } + } + if (lastchar == ';') { + inRoots = false; + inIncludes = false; + inExcludes = false; + inAllows = false; + } + } + + if (inBlockComment) { + throw new RuntimeException(file + ", line " + + lineNumber + ", missing \"*/\" to end a block comment"); + } + if (config != null) { + throw new RuntimeException(file + ", line " + + lineNumber + ", missing \"}\" to end module definition" + + " for \"" + config.module + "\""); + } + + } finally { + in.close(); + } + + return result; + } + + private String format(String keyword, Collection values) { + if (values.size() == 0) { + return ""; + } + + StringBuilder sb = new StringBuilder(); + String format = "%4s%-9s"; + String spaces = String.format(format, "", ""); + sb.append(String.format(format, "", keyword)); + int count = 0; + for (String s : values) { + if (count > 0) { + sb.append(",\n").append(spaces); + } else if (count++ > 0) { + sb.append(", "); + } + sb.append(s); + } + if (count > 0) { + sb.append(";\n"); + } + return sb.toString(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("module " + module).append(" {\n"); + sb.append(format("include", includes)); + sb.append(format("root", roots)); + sb.append(format("allow", filter.allow)); + sb.append(format("exclude", filter.exclude)); + sb.append("}\n"); + return sb.toString(); + } +} diff --git a/jdk/make/modules/tools/src/com/sun/classanalyzer/ResolutionInfo.java b/jdk/make/modules/tools/src/com/sun/classanalyzer/ResolutionInfo.java new file mode 100644 index 00000000000..19746a49648 --- /dev/null +++ b/jdk/make/modules/tools/src/com/sun/classanalyzer/ResolutionInfo.java @@ -0,0 +1,201 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +package com.sun.classanalyzer; + +import com.sun.classanalyzer.Klass.Method; + +/** + * + * @author mchung + */ +public class ResolutionInfo implements Comparable { + + enum Type { + + REFLECTION("reflection", true), + NATIVE("native", true), + INTERFACE("interface", false), + SUPER("super", false), + EXPLICIT("explicit", false), + VERIFICATION("verification", false), + METHODTRACE("method trace", true), + CONSTANT_POOL("constant pool", true), + CHECKED_EXCEPTION("throws", true), + METHOD("method", true), + FIELD("field", true), + EXTENDS("extends", true), + IMPLEMENTS("implements", true), + NOINFO("No info", false); + + private final String name; + private final boolean hasInfo; + + private Type(String name, boolean hasInfo) { + this.name = name; + this.hasInfo = hasInfo; + } + + public String getName() { + return name; + } + + public boolean hasInfo() { + return hasInfo; + } + + public static Type getType(String s) { + if (s.isEmpty()) { + return NOINFO; + } + for (Type t : values()) { + if (s.equals(t.name)) { + return t; + } + } + // Need to fix the VM output to add "native" + // throw new IllegalArgumentException("Invalid ResolutionInfo.type \"" + s + "\""); + System.out.println("WARNING: Invalid ResolutionInfo.type \"" + s + "\""); + return null; + } + } + final Klass fromClass; + final Method method; + final Klass toClass; + final int linenumber; + final Type type; + final String info; + private boolean isPublic = false; + + private ResolutionInfo(Klass from, Klass to, int linenumber, Type type, String info) { + this.fromClass = from; + this.method = null; + this.toClass = to; + this.linenumber = linenumber; + this.type = type; + this.info = info; + } + + private ResolutionInfo(Klass from, Method m, Klass to, int linenumber, Type type) { + this.fromClass = from; + this.method = m; + this.toClass = to; + this.linenumber = linenumber; + this.type = type; + this.info = m.toString(); + } + + public boolean isPublic() { + return isPublic; + } + + public void setPublicAccess(boolean value) { + isPublic = value; + } + static ResolutionInfo resolved(Klass from, Klass to) { + return new ResolutionInfo(from, to, 0, Type.NOINFO, ""); + } + + static ResolutionInfo resolved(Klass from, Klass to, int linenumber) { + return new ResolutionInfo(from, to, linenumber, Type.NOINFO, ""); + } + + static ResolutionInfo resolved(Klass from, Klass to, int linenumber, String reason) { + String[] ss = reason.split("\\s+"); + Type type; + String info; + if (linenumber == -1) { + type = Type.NATIVE; + info = ss[0]; // native method name + } else { + info = ss.length == 2 ? ss[1] : ""; + type = Type.getType(ss[0]); + if (type == null) { + if (reason.isEmpty()) { + throw new IllegalArgumentException("Invalid type: " + reason + " (" + ss[0] + ")" + ss.length); + } + // assume it's native + type = Type.NATIVE; + info = reason.isEmpty() ? ss[0] : reason; + } + } + + return new ResolutionInfo(from, to, linenumber, type, info); + } + + static ResolutionInfo resolved(Klass from, Klass to, Method callee) { + return new ResolutionInfo(from, callee, to, 0, Type.METHODTRACE); + } + + static ResolutionInfo resolvedConstantPool(Klass from, Klass to, int index) { + return new ResolutionInfo(from, to, 0, Type.CONSTANT_POOL, "#" + index); + } + + static ResolutionInfo resolvedField(Klass from, Klass to, String fieldname) { + return new ResolutionInfo(from, to, 0, Type.FIELD, fieldname); + } + + static ResolutionInfo resolvedMethodSignature(Klass from, Klass to, Method m) { + return new ResolutionInfo(from, m, to, 0, Type.METHOD); + } + + static ResolutionInfo resolvedCheckedException(Klass from, Klass to, Method m) { + return new ResolutionInfo(from, m, to, 0, Type.CHECKED_EXCEPTION); + } + + static ResolutionInfo resolvedExtends(Klass from, Klass to) { + String info = from.getClassName() + " implements " + to.getClassName(); + return new ResolutionInfo(from, to, 0, Type.EXTENDS, info); + } + + static ResolutionInfo resolvedImplements(Klass from, Klass to) { + String info = from.getClassName() + " implements " + to.getClassName(); + return new ResolutionInfo(from, to, 0, Type.IMPLEMENTS, info); + } + + @Override + public int compareTo(ResolutionInfo ri) { + if (this.fromClass == ri.fromClass && + this.toClass == ri.toClass && + this.linenumber == ri.linenumber && + this.type == ri.type && + this.info.equals(ri.info)) { + return 0; + } else if (this.fromClass == ri.fromClass) { + if (this.linenumber > ri.linenumber) { + return 1; + } else if (this.linenumber < ri.linenumber) { + return -1; + } else if (this.type != ri.type) { + return this.type.getName().compareTo(ri.type.getName()); + } else if (this.toClass != ri.toClass) { + return this.toClass.compareTo(ri.toClass); + } else { + return this.info.compareTo(ri.info); + } + } else { + return this.fromClass.compareTo(ri.fromClass); + } + } +} diff --git a/jdk/make/modules/tools/src/com/sun/classanalyzer/ResourceFile.java b/jdk/make/modules/tools/src/com/sun/classanalyzer/ResourceFile.java new file mode 100644 index 00000000000..8c6714085a6 --- /dev/null +++ b/jdk/make/modules/tools/src/com/sun/classanalyzer/ResourceFile.java @@ -0,0 +1,186 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ +package com.sun.classanalyzer; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +/** + * + * @author Mandy Chung + */ +public class ResourceFile implements Comparable { + + private final String pathname; + private Module module; + + ResourceFile(String pathname) { + this.pathname = pathname.replace(File.separatorChar, '/'); + } + + Module getModule() { + return module; + } + + void setModule(Module m) { + if (module != null) { + throw new RuntimeException("Module for " + this + " already set"); + } + this.module = m; + } + + String getName() { + return pathname; + } + + String getPathname() { + return pathname; + } + + @Override + public String toString() { + return pathname; + } + + @Override + public int compareTo(ResourceFile o) { + return pathname.compareTo(o.pathname); + } + static Set resources = new TreeSet(); + + static boolean isResource(String pathname) { + String name = pathname.replace(File.separatorChar, '/'); + + if (name.endsWith("META-INF/MANIFEST.MF")) { + return false; + } + if (name.contains("META-INF/JCE_RSA.")) { + return false; + } + + return true; + } + + static void addResource(String name, InputStream in) { + ResourceFile res; + name = name.replace(File.separatorChar, '/'); + if (name.startsWith("META-INF/services")) { + res = new ServiceProviderConfigFile(name, in); + } else { + res = new ResourceFile(name); + } + resources.add(res); + } + + static Set getAllResources() { + return Collections.unmodifiableSet(resources); + } + + static class ServiceProviderConfigFile extends ResourceFile { + + private final List providers = new ArrayList(); + private final String service; + ServiceProviderConfigFile(String pathname, InputStream in) { + super(pathname); + readServiceConfiguration(in, providers); + this.service = pathname.substring("META-INF/services".length() + 1, pathname.length()); + } + + @Override + String getName() { + if (providers.isEmpty()) { + return service; + } else { + // just use the first one for matching + return providers.get(0); + } + } + + @SuppressWarnings("empty-statement") + void readServiceConfiguration(InputStream in, List names) { + BufferedReader br = null; + try { + if (in != null) { + // Properties doesn't perserve the order of the input file + br = new BufferedReader(new InputStreamReader(in, "utf-8")); + int lc = 1; + while ((lc = parseLine(br, lc, names)) >= 0); + } + } catch (IOException ex) { + throw new RuntimeException(ex); + } finally { + if (br != null) { + try { + br.close(); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + } + } + } + + // Parse a single line from the given configuration file, adding the name + // on the line to the names list. + // + private int parseLine(BufferedReader r, int lc, List names) throws IOException { + String ln = r.readLine(); + if (ln == null) { + return -1; + } + int ci = ln.indexOf('#'); + if (ci >= 0) { + ln = ln.substring(0, ci); + } + ln = ln.trim(); + int n = ln.length(); + if (n != 0) { + if ((ln.indexOf(' ') >= 0) || (ln.indexOf('\t') >= 0)) { + throw new RuntimeException("Illegal configuration-file syntax"); + } + int cp = ln.codePointAt(0); + if (!Character.isJavaIdentifierStart(cp)) { + throw new RuntimeException("Illegal provider-class name: " + ln); + } + for (int i = Character.charCount(cp); i < n; i += Character.charCount(cp)) { + cp = ln.codePointAt(i); + if (!Character.isJavaIdentifierPart(cp) && (cp != '.')) { + throw new RuntimeException("Illegal provider-class name: " + ln); + } + } + if (!names.contains(ln)) { + names.add(ln); + } + } + return lc + 1; + } + } +} diff --git a/jdk/make/modules/tools/src/com/sun/classanalyzer/ShowDeps.java b/jdk/make/modules/tools/src/com/sun/classanalyzer/ShowDeps.java new file mode 100644 index 00000000000..ce585553ba6 --- /dev/null +++ b/jdk/make/modules/tools/src/com/sun/classanalyzer/ShowDeps.java @@ -0,0 +1,100 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +package com.sun.classanalyzer; + +import java.io.File; +import java.io.IOException; +import java.util.*; + +/** + * A simple tool to print out the static dependencies for a given set of JAR, + * class files, or combinations of. The tools supports an -ignore option to + * ignore references to classes listed in the file (including .classlists + * created by the ClassAnalyzer tool). + */ + +public class ShowDeps { + + static void usage() { + System.out.println("java ShowDeps [-ignore ] file..."); + System.out.println(" where is a class or JAR file, or a directory"); + System.out.println(); + System.out.println("Example usages:"); + System.out.println(" java ShowDeps Foo.jar"); + System.out.println(" java ShowDeps -ignore base.classlist Foo.jar"); + System.out.println(" java ShowDeps -ignore base.classlist -ignore " + + "jaxp-parsers.classlist

"); + System.exit(-1); + } + + public static void main(String[] args) throws IOException { + // process -ignore options + int argi = 0; + Set ignore = new HashSet(); + while (argi < args.length && args[argi].equals("-ignore")) { + argi++; + Scanner s = new Scanner(new File(args[argi++])); + try { + while (s.hasNextLine()) { + String line = s.nextLine(); + if (!line.endsWith(".class")) + continue; + int len = line.length(); + // convert to class names + String clazz = line.replace('\\', '.').replace('/', '.') + .substring(0, len-6); + ignore.add(clazz); + } + } finally { + s.close(); + } + } + + if (argi >= args.length) + usage(); + + // parse all classes + while (argi < args.length) + ClassPath.setClassPath(args[argi++]); + ClassPath.parseAllClassFiles(); + + // find the classes that don't exist + Set unresolved = new TreeSet(); + for (Klass k : Klass.getAllClasses()) { + if (k.getFileSize() == 0) + unresolved.add(k); + } + + // print references to classes that don't exist + for (Klass k: Klass.getAllClasses()) { + for (Klass other : k.getReferencedClasses()) { + if (unresolved.contains(other)) { + String name = other.toString(); + if (!ignore.contains(name)) { + System.out.format("%s -> %s\n", k, other); + } + } + } + } + } +} diff --git a/jdk/make/org/Makefile b/jdk/make/org/Makefile index 0b66445eccd..1d249295be7 100644 --- a/jdk/make/org/Makefile +++ b/jdk/make/org/Makefile @@ -32,6 +32,7 @@ PRODUCT = org include $(BUILDDIR)/common/Defs.gmk SUBDIRS = ietf jcp +include $(BUILDDIR)/common/Subdirs.gmk all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/org/ietf/Makefile b/jdk/make/org/ietf/Makefile index 9c4618701ca..0d3835b2459 100644 --- a/jdk/make/org/ietf/Makefile +++ b/jdk/make/org/ietf/Makefile @@ -31,6 +31,8 @@ BUILDDIR = ../.. include $(BUILDDIR)/common/Defs.gmk SUBDIRS = jgss +include $(BUILDDIR)/common/Subdirs.gmk + all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/sun/Makefile b/jdk/make/sun/Makefile index 7cf480fa83d..8e224e52aeb 100644 --- a/jdk/make/sun/Makefile +++ b/jdk/make/sun/Makefile @@ -58,13 +58,18 @@ ifdef OPENJDK else RENDER_SUBDIR = dcpr endif + # nio need to be compiled before awt to have all charsets ready -SUBDIRS = jar security javazic misc jkernel net audio $(RENDER_SUBDIR) image \ - nio awt splashscreen $(XAWT_SUBDIR) \ - $(HEADLESS_SUBDIR) $(DGA_SUBDIR) \ - font jpeg cmm applet rmi beans $(JDBC_SUBDIR) \ - jawt text launcher management $(ORG_SUBDIR) \ - native2ascii serialver tools jconsole tracing +SUBDIRS = jar security javazic misc net nio text launcher +SUBDIRS_desktop = audio $(RENDER_SUBDIR) image \ + awt splashscreen $(XAWT_SUBDIR) \ + $(HEADLESS_SUBDIR) $(DGA_SUBDIR) \ + jawt font jpeg cmm applet beans +SUBDIRS_management = management +SUBDIRS_misc = jkernel $(ORG_SUBDIR) \ + rmi $(JDBC_SUBDIR) tracing +SUBDIRS_tools = native2ascii serialver tools jconsole +include $(BUILDDIR)/common/Subdirs.gmk all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/sun/applet/Makefile b/jdk/make/sun/applet/Makefile index 415db17ddfb..83902ab7d86 100644 --- a/jdk/make/sun/applet/Makefile +++ b/jdk/make/sun/applet/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../.. +MODULE = applet PACKAGE = sun.applet PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/sun/awt/FILES_c_windows.gmk b/jdk/make/sun/awt/FILES_c_windows.gmk index c9eb3482ea6..ba461a386d3 100644 --- a/jdk/make/sun/awt/FILES_c_windows.gmk +++ b/jdk/make/sun/awt/FILES_c_windows.gmk @@ -179,6 +179,8 @@ FILES_cpp = \ awt_Mlib.cpp \ awt_new.cpp \ awt_TrayIcon.cpp \ + awt_DCHolder.cpp \ + awt_ole.cpp \ ShaderList.cpp \ D3DBlitLoops.cpp \ D3DBufImgOps.cpp \ diff --git a/jdk/make/sun/awt/Makefile b/jdk/make/sun/awt/Makefile index c3c1745ff54..163609ff377 100644 --- a/jdk/make/sun/awt/Makefile +++ b/jdk/make/sun/awt/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../.. +MODULE = awt PACKAGE = sun.awt LIBRARY = awt PRODUCT = sun @@ -249,13 +250,14 @@ ifeq ($(PLATFORM), windows) # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv WINDOWS OTHER_LDLIBS = kernel32.lib user32.lib gdi32.lib winspool.lib \ imm32.lib ole32.lib uuid.lib shell32.lib \ - comdlg32.lib winmm.lib comctl32.lib delayimp.lib \ + comdlg32.lib winmm.lib comctl32.lib \ + shlwapi.lib delayimp.lib \ $(JVMLIB) \ /DELAYLOAD:user32.dll /DELAYLOAD:gdi32.dll \ /DELAYLOAD:shell32.dll /DELAYLOAD:winmm.dll \ /DELAYLOAD:winspool.drv /DELAYLOAD:imm32.dll \ /DELAYLOAD:ole32.dll /DELAYLOAD:comdlg32.dll \ - /DELAYLOAD:comctl32.dll + /DELAYLOAD:comctl32.dll /DELAYLOAD:shlwapi.dll clean:: awt.clean @@ -312,15 +314,15 @@ dgalibs: $(DGALIBS) $(LIBDIR)/$(LIBARCH)/libxinerama.so: $(CLOSED_SRC)/solaris/lib/$(ARCH)/libxinerama.so $(install-file) - $(CHMOD) a+x $@ + $(call chmod-file, a+x) $(LIBDIR)/$(LIBARCH)/libjdgaSUNW%.so: $(CLOSED_SRC)/solaris/lib/$(ARCH)/libjdgaSUNW%.so $(install-file) - $(CHMOD) a+x $@ + $(call chmod-file, a+x) $(LIBDIR)/$(LIBARCH)/libjdgaSUNWafb.so: $(LIBDIR)/$(LIBARCH)/libjdgaSUNWffb.so $(prep-target) - $(LN) -s libjdgaSUNWffb.so $(LIBDIR)/$(LIBARCH)/libjdgaSUNWafb.so + $(call install-sym-link, libjdgaSUNWffb.so) clean:: dgalib.clean @@ -404,7 +406,8 @@ $(LIBDIR)/%.bfc: $(FONTCONFIGS_SRC)/$(FONTCONFIGS_SRC_PREFIX)%.properties \ $(COMPILEFONTCONFIG_JARFILE) $(prep-target) $(BOOT_JAVA_CMD) -jar $(COMPILEFONTCONFIG_JARFILE) $< $@ - $(CHMOD) 444 $(@) + $(install-module-file) + $(call chmod-file, 444) @$(java-vm-cleanup) fontconfigs.clean : diff --git a/jdk/make/sun/awt/make.depend b/jdk/make/sun/awt/make.depend index 8c0fa65ef16..e6bdfc239c2 100644 --- a/jdk/make/sun/awt/make.depend +++ b/jdk/make/sun/awt/make.depend @@ -1,351 +1,355 @@ -$(OBJDIR)/AccelGlyphCache.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/sunfontids.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h - -$(OBJDIR)/AlphaMacros.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/AlphaMath.obj:: ../../../src/share/native/sun/java2d/loops/AlphaMath.h - -$(OBJDIR)/Any3Byte.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/Any3Byte.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/Any4Byte.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/Any4Byte.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/AnyByte.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyByte.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/AnyInt.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyInt.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/AnyShort.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyShort.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/awt_AWTEvent.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_AWTEvent.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_BitmapUtil.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_BitmapUtil.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Brush.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Button.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Button.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WButtonPeer.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Button.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Canvas.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsConfig.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Checkbox.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Checkbox.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WCheckboxPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Checkbox.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Choice.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Choice.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_InputEvent.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Toolkit.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WChoicePeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Choice.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Container.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dimension.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/ComCtl32Util.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Clipboard.obj:: $(CLASSHDRDIR)/sun_awt_windows_WClipboard.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Clipboard.h ../../../src/windows/native/sun/windows/awt_DataTransferer.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Color.obj:: $(CLASSHDRDIR)/sun_awt_windows_WColor.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Color.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Component.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Color.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_InputEvent.h $(CLASSHDRDIR)/java_awt_event_InputMethodEvent.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_MouseWheelEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_Insets.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Toolkit.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WInputMethod.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WPanelPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jawt.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/pipe/Region.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_AWTEvent.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Cursor.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dimension.h ../../../src/windows/native/sun/windows/awt_DnDDT.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_InputEvent.h ../../../src/windows/native/sun/windows/awt_InputTextInfor.h ../../../src/windows/native/sun/windows/awt_Insets.h ../../../src/windows/native/sun/windows/awt_KeyEvent.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MouseEvent.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/ComCtl32Util.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Container.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Container.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Cursor.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Cursor.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WCustomCursor.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WGlobalCursorManager.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Container.h ../../../src/windows/native/sun/windows/awt_Cursor.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_IconCursor.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_DataTransferer.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_TextComponent.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_datatransfer_DataTransferer.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDataTransferer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WTextComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/common/locale_str.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_DataTransferer.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_DnDDT.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_TextComponent.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Debug.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Desktop.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_DesktopProperties.obj:: $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_windows_WDesktopProperties.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_DesktopProperties.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Dialog.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dialog.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Dimension.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dimension.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_DnDDS.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_dnd_DnDConstants.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_InputEvent.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_dnd_SunDragSourceContextPeer.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDragSourceContextPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Cursor.h ../../../src/windows/native/sun/windows/awt_DataTransferer.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_DnDDS.h ../../../src/windows/native/sun/windows/awt_DnDDT.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_DnDDT.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_dnd_DnDConstants.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDropTargetContextPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Container.h ../../../src/windows/native/sun/windows/awt_DataTransferer.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_DnDDS.h ../../../src/windows/native/sun/windows/awt_DnDDT.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_DrawingSurface.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jawt.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jawt_md.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_DrawingSurface.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Event.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Event.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_FileDialog.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_FileDialog.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFileDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dialog.h ../../../src/windows/native/sun/windows/awt_FileDialog.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/ComCtl32Util.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Font.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDefaultFontCharset.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFontPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/Disposer.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Frame.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/java_lang_Integer.h $(CLASSHDRDIR)/sun_awt_EmbeddedFrame.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WEmbeddedFrame.h $(CLASSHDRDIR)/sun_awt_windows_WEmbeddedFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dialog.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_IconCursor.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/ComCtl32Util.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_GDIObject.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_IconCursor.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_IconCursor.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_ImageRep.obj:: $(CLASSHDRDIR)/sun_awt_image_ImageRepresentation.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/image/awt_parseImage.h ../../../src/share/native/sun/awt/image/imageInitIDs.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h - -$(OBJDIR)/awt_ImagingLib.obj:: $(CLASSHDRDIR)/java_awt_color_ColorSpace.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_image_BufferedImage.h $(CLASSHDRDIR)/java_awt_image_ConvolveOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_awt_image_ImagingLib.h $(CLASSHDRDIR)/sun_awt_image_IntegerComponentRaster.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/image/awt_parseImage.h ../../../src/share/native/sun/awt/image/imageInitIDs.h ../../../src/share/native/sun/awt/medialib/awt_ImagingLib.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_types.h ../../../src/share/native/sun/awt/medialib/mlib_status.h ../../../src/share/native/sun/awt/medialib/mlib_types.h ../../../src/share/native/sun/awt/medialib/safe_alloc.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/awt_Mlib.h - -$(OBJDIR)/awt_InputEvent.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_InputEvent.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_InputMethod.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_InputMethodEvent.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WInputMethodDescriptor.h $(CLASSHDRDIR)/sun_awt_windows_WInputMethod.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/common/locale_str.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_AWTEvent.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_InputTextInfor.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_InputTextInfor.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Insets.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Insets.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_KeyboardFocusManager.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_KeyboardFocusManager.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_KeyEvent.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_KeyEvent.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Label.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_Label.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WLabelPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Label.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_List.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_List.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WListPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dimension.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_List.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/ComCtl32Util.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_MenuBar.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_MenuItem.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_CheckboxMenuItem.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_InputEvent.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Toolkit.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCheckboxMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_DesktopProperties.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Menu.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Mlib.obj:: $(CLASSHDRDIR)/java_awt_image_BufferedImage.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/medialib/awt_ImagingLib.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_types.h ../../../src/share/native/sun/awt/medialib/mlib_status.h ../../../src/share/native/sun/awt/medialib/mlib_types.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Mlib.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_MouseEvent.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_MouseEvent.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_new.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_new.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Object.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Palette.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_CustomPaletteDef.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/img_util_md.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Panel.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Panel.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_parseImage.obj:: $(CLASSHDRDIR)/java_awt_color_ColorSpace.h $(CLASSHDRDIR)/java_awt_image_BufferedImage.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_awt_image_ImagingLib.h $(CLASSHDRDIR)/sun_awt_image_IntegerComponentRaster.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/image/awt_parseImage.h ../../../src/share/native/sun/awt/image/imageInitIDs.h ../../../src/share/native/sun/awt/medialib/awt_ImagingLib.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_types.h ../../../src/share/native/sun/awt/medialib/mlib_status.h ../../../src/share/native/sun/awt/medialib/mlib_types.h ../../../src/share/native/sun/awt/medialib/safe_alloc.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/awt_Mlib.h - -$(OBJDIR)/awt_Pen.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_PopupMenu.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_PopupMenu.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WPopupMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Event.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_PopupMenu.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_PrintControl.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_PrintControl.h ../../../src/windows/native/sun/windows/awt_PrintDialog.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_PrintDialog.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WPrintDialog.h $(CLASSHDRDIR)/sun_awt_windows_WPrintDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dialog.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_PrintControl.h ../../../src/windows/native/sun/windows/awt_PrintDialog.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/ComCtl32Util.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_PrintJob.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WPrinterJob.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dialog.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_PrintControl.h ../../../src/windows/native/sun/windows/awt_PrintDialog.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/ComCtl32Util.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Rectangle.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Rectangle.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Robot.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_InputEvent.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WRobotPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Robot.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Scrollbar.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_Scrollbar.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WScrollbarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Scrollbar.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_ScrollPane.obj:: $(CLASSHDRDIR)/java_awt_Adjustable.h $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_AdjustmentEvent.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_Insets.h $(CLASSHDRDIR)/java_awt_Scrollbar.h $(CLASSHDRDIR)/java_awt_ScrollPaneAdjustable.h $(CLASSHDRDIR)/java_awt_ScrollPane.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WScrollbarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WScrollPanePeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Container.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Insets.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Panel.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Scrollbar.h ../../../src/windows/native/sun/windows/awt_ScrollPane.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_TextArea.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_TextArea.h $(CLASSHDRDIR)/java_awt_TextComponent.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WTextAreaPeer.h $(CLASSHDRDIR)/sun_awt_windows_WTextComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_TextArea.h ../../../src/windows/native/sun/windows/awt_TextComponent.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_TextComponent.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_TextComponent.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WTextComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_TextComponent.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_TextField.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_TextComponent.h $(CLASSHDRDIR)/java_awt_TextField.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WTextComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WTextFieldPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_TextComponent.h ../../../src/windows/native/sun/windows/awt_TextField.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Toolkit.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_InputMethodEvent.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_FileDialog.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_List.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_ComponentPeer.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_PopupMenu.h $(CLASSHDRDIR)/java_awt_Toolkit.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFileDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WListPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WPopupMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jawt.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jawt_md.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DPipelineManager.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_AWTEvent.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Clipboard.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Cursor.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_DesktopProperties.h ../../../src/windows/native/sun/windows/awt_Dialog.h ../../../src/windows/native/sun/windows/awt_DnDDS.h ../../../src/windows/native/sun/windows/awt_DnDDT.h ../../../src/windows/native/sun/windows/awt_DrawingSurface.h ../../../src/windows/native/sun/windows/awt_FileDialog.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_InputEvent.h ../../../src/windows/native/sun/windows/awt_KeyEvent.h ../../../src/windows/native/sun/windows/awt_List.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_new.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_PopupMenu.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/CmdIDList.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/ComCtl32Util.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/DllUtil.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_TrayIcon.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_ActionEvent.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_InputEvent.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_TrayIcon.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WTrayIconPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_AWTEvent.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_TrayIcon.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Win32GraphicsConfig.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_image_DataBuffer.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_Win32GraphicsConfig.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsConfig.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Win32GraphicsDevice.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_color_ColorSpace.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_image_DataBuffer.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_Win32GraphicsDevice.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/awt/image/dither.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/img_util_md.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Win32GraphicsEnv.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_Win32GraphicsEnvironment.h $(CLASSHDRDIR)/sun_awt_Win32FontManager.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/java2d/windows/WindowsFlags.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/DllUtil.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/awt_Window.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Container.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_ComponentEvent.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_Insets.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_BitmapUtil.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Container.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dialog.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_IconCursor.h ../../../src/windows/native/sun/windows/awt_Insets.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Panel.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/ComCtl32Util.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/BlitBg.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_BlitBg.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/Region.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/Blit.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_Blit.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/Region.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/BufferedMaskBlit.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedMaskBlit.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedOpCodes.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntBgr.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/BufferedRenderPipe.obj:: $(CLASSHDRDIR)/sun_java2d_pipe_BufferedOpCodes.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedRenderPipe.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h - -$(OBJDIR)/BufImgSurfaceData.obj:: $(CLASSHDRDIR)/sun_awt_image_BufImgSurfaceData.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/image/BufImgSurfaceData.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/img_util_md.h - -$(OBJDIR)/ByteBinary1Bit.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyByteBinary.h ../../../src/share/native/sun/java2d/loops/ByteBinary1Bit.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/ByteBinary2Bit.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyByteBinary.h ../../../src/share/native/sun/java2d/loops/ByteBinary2Bit.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/ByteBinary4Bit.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyByteBinary.h ../../../src/share/native/sun/java2d/loops/ByteBinary4Bit.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/ByteGray.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyByte.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/Index12Gray.h ../../../src/share/native/sun/java2d/loops/Index8Gray.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/ByteIndexed.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyByte.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/Index12Gray.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/CmdIDList.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/CmdIDList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/ComCtl32Util.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/ComCtl32Util.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/D3DBlitLoops.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DBlitLoops.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntBgr.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/Ushort555Rgb.h ../../../src/share/native/sun/java2d/loops/Ushort565Rgb.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DBlitLoops.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/D3DBufImgOps.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DBufImgOps.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/D3DContext.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedTextPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h $(CLASSHDRDIR)/sun_java2d_SunGraphics2D.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/sunfontids.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DBufImgOps.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DGlyphCache.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPaints.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DPipelineManager.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DShaders.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DTextRenderer.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/D3DGlyphCache.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedTextPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/sunfontids.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DGlyphCache.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DTextRenderer.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/D3DGraphicsDevice.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DGraphicsDevice.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DGraphicsDevice.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DPipelineManager.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/D3DMaskBlit.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskBlit.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/D3DMaskCache.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/D3DMaskFill.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DMaskFill.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskFill.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/D3DPaints.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h $(CLASSHDRDIR)/sun_java2d_SunGraphics2D.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPaints.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/D3DPipelineManager.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DBadHardware.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DPipelineManager.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/WindowsFlags.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/D3DRenderer.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DRenderer.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedRenderPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderer.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/D3DRenderQueue.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DBlitLoops.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedOpCodes.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedRenderPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedTextPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h $(CLASSHDRDIR)/sun_java2d_SunGraphics2D.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/sunfontids.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DBlitLoops.h ../../../src/windows/native/sun/java2d/d3d/D3DBufImgOps.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskBlit.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskFill.h ../../../src/windows/native/sun/java2d/d3d/D3DPaints.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DPipelineManager.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderer.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DTextRenderer.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/D3DResourceManager.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedTextPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h $(CLASSHDRDIR)/sun_java2d_SunGraphics2D.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/sunfontids.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPaints.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DTextRenderer.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/D3DSurfaceData.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DPipelineManager.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_BitmapUtil.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/D3DTextRenderer.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DTextRenderer.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedTextPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/sunfontids.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DGlyphCache.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DTextRenderer.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/D3DVertexCacher.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h $(CLASSHDRDIR)/sun_java2d_SunGraphics2D.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPaints.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/DataBufferNative.obj:: $(CLASSHDRDIR)/sun_awt_image_DataBufferNative.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h - -$(OBJDIR)/debug_assert.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h - -$(OBJDIR)/debug_mem.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h - -$(OBJDIR)/debug_trace.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h - -$(OBJDIR)/debug_util.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h - -$(OBJDIR)/Devices.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DPipelineManager.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/Disposer.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/Disposer.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h - -$(OBJDIR)/dither.obj:: ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/awt/image/dither.h ../../../src/windows/native/sun/windows/colordata.h - -$(OBJDIR)/DllUtil.obj:: ../../../src/windows/native/sun/windows/DllUtil.h - -$(OBJDIR)/DrawLine.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_DrawLine.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/DrawPath.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_DrawPath.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/DrawPath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/ProcessPath.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/DrawPolygons.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_DrawPolygons.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/DrawRect.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_DrawRect.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/FillPath.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_FillPath.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/DrawPath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/ProcessPath.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/FillRect.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_FillRect.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/FillSpans.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_FillSpans.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/FourByteAbgr.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/Any4Byte.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/FourByteAbgr.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/FourByteAbgrPre.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/Any4Byte.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/FourByteAbgrPre.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/GDIBlitLoops.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_windows_GDIBlitLoops.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/GDIHashtable.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/GDIRenderer.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_geom_PathIterator.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_windows_GDIRenderer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/GDIWindowSurfaceData.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_windows_GDIWindowSurfaceData.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/Disposer.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/Region.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/java2d/windows/WindowsFlags.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/gifdecoder.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h - -$(OBJDIR)/GraphicsPrimitiveMgr.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_GraphicsPrimitiveMgr.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/Region.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/Hashtable.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/imageInitIDs.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/image/imageInitIDs.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h - -$(OBJDIR)/img_colors.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h - -$(OBJDIR)/img_globals.obj:: $(CLASSHDRDIR)/java_awt_image_DirectColorModel.h $(CLASSHDRDIR)/java_awt_image_IndexColorModel.h $(CLASSHDRDIR)/java_awt_Transparency.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/windows/javavm/export/jni_md.h - -$(OBJDIR)/Index12Gray.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyShort.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/Index12Gray.h ../../../src/share/native/sun/java2d/loops/Index8Gray.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/Index8Gray.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyByte.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/Index12Gray.h ../../../src/share/native/sun/java2d/loops/Index8Gray.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/initIDs.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h - -$(OBJDIR)/IntArgbBm.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyInt.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/IntArgb.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyInt.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/Index12Gray.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/IntArgbPre.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyInt.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/IntBgr.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyInt.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/Index12Gray.h ../../../src/share/native/sun/java2d/loops/Index8Gray.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntBgr.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/IntRgb.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyInt.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/Index12Gray.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/IntRgbx.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyInt.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/IntRgbx.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/MaskBlit.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_MaskBlit.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/Region.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/MaskFill.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_MaskFill.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/MouseInfo.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/ObjectList.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/OGLBlitLoops.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLBlitLoops.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLBlitLoops.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLRenderQueue.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h - -$(OBJDIR)/OGLBufImgOps.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLBufImgOps.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLRenderQueue.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h - -$(OBJDIR)/OGLContext.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h $(CLASSHDRDIR)/sun_java2d_SunGraphics2D.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLRenderQueue.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/pipe/Region.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h - -$(OBJDIR)/OGLFuncs.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h - -$(OBJDIR)/OGLMaskBlit.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLMaskBlit.h ../../../src/share/native/sun/java2d/opengl/OGLRenderQueue.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h - -$(OBJDIR)/OGLMaskFill.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLMaskFill.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLMaskFill.h ../../../src/share/native/sun/java2d/opengl/OGLRenderQueue.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/opengl/OGLVertexCache.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h - -$(OBJDIR)/OGLPaints.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedPaints.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h $(CLASSHDRDIR)/sun_java2d_SunGraphics2D.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLPaints.h ../../../src/share/native/sun/java2d/opengl/OGLRenderQueue.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h - -$(OBJDIR)/OGLRenderer.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLRenderer.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedRenderPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLRenderer.h ../../../src/share/native/sun/java2d/opengl/OGLRenderQueue.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h - -$(OBJDIR)/OGLRenderQueue.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLBlitLoops.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedOpCodes.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedRenderPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedTextPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLBlitLoops.h ../../../src/share/native/sun/java2d/opengl/OGLBufImgOps.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLMaskBlit.h ../../../src/share/native/sun/java2d/opengl/OGLMaskFill.h ../../../src/share/native/sun/java2d/opengl/OGLPaints.h ../../../src/share/native/sun/java2d/opengl/OGLRenderer.h ../../../src/share/native/sun/java2d/opengl/OGLRenderQueue.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/opengl/OGLTextRenderer.h ../../../src/share/native/sun/java2d/opengl/OGLVertexCache.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h - -$(OBJDIR)/OGLSurfaceData.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h - -$(OBJDIR)/OGLTextRenderer.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLTextRenderer.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedTextPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/sunfontids.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLRenderQueue.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/opengl/OGLTextRenderer.h ../../../src/share/native/sun/java2d/opengl/OGLVertexCache.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h - -$(OBJDIR)/OGLVertexCache.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h $(CLASSHDRDIR)/sun_java2d_SunGraphics2D.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLPaints.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/opengl/OGLVertexCache.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h - -$(OBJDIR)/ProcessPath.obj:: $(CLASSHDRDIR)/java_awt_geom_PathIterator.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/loops/ProcessPath.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/Region.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/pipe/Region.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h - -$(OBJDIR)/RenderBuffer.obj:: $(CLASSHDRDIR)/sun_java2d_pipe_RenderBuffer.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h - -$(OBJDIR)/ScaledBlit.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_ScaledBlit.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/Region.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/ShapeSpanIterator.obj:: $(CLASSHDRDIR)/java_awt_geom_PathIterator.h $(CLASSHDRDIR)/sun_java2d_pipe_ShapeSpanIterator.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/pipe/PathConsumer2D.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/ShellFolder2.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/SpanClipRenderer.obj:: $(CLASSHDRDIR)/sun_java2d_pipe_RegionIterator.h $(CLASSHDRDIR)/sun_java2d_pipe_SpanClipRenderer.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h - -$(OBJDIR)/SurfaceData.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/Disposer.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h - -$(OBJDIR)/ThemeReader.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_ThemeReader.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/ThreeByteBgr.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/Any3Byte.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/Trace.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h - -$(OBJDIR)/TransformHelper.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_loops_TransformHelper.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/Region.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/Ushort4444Argb.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyShort.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/Ushort4444Argb.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/Ushort555Rgb.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyShort.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/Ushort555Rgb.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/Ushort555Rgbx.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyShort.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/Ushort555Rgbx.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/Ushort565Rgb.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyShort.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/Ushort4444Argb.h ../../../src/share/native/sun/java2d/loops/Ushort565Rgb.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/UshortGray.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyShort.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/UshortIndexed.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyByte.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/Index12Gray.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/loops/UshortIndexed.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h - -$(OBJDIR)/WGLGraphicsConfig.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_opengl_WGLGraphicsConfig.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h ../../../src/windows/native/sun/java2d/opengl/WGLGraphicsConfig.h ../../../src/windows/native/sun/java2d/opengl/WGLSurfaceData.h - -$(OBJDIR)/WGLSurfaceData.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_opengl_WGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLRenderQueue.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h ../../../src/windows/native/sun/java2d/opengl/WGLGraphicsConfig.h ../../../src/windows/native/sun/java2d/opengl/WGLSurfaceData.h - -$(OBJDIR)/WindowsFlags.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/WindowsFlags.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h - -$(OBJDIR)/WPrinterJob.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_PrintControl.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/stdhdrs.h +$(OBJDIR)/AccelGlyphCache.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/sunfontids.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h + +$(OBJDIR)/AlphaMacros.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/AlphaMath.obj:: ../../../src/share/native/sun/java2d/loops/AlphaMath.h + +$(OBJDIR)/Any3Byte.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/Any3Byte.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/Any4Byte.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/Any4Byte.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/AnyByte.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyByte.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/AnyInt.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyInt.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/AnyShort.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyShort.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/awt_AWTEvent.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_AWTEvent.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_BitmapUtil.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_BitmapUtil.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Brush.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Button.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Button.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WButtonPeer.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Button.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Canvas.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsConfig.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Checkbox.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Checkbox.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WCheckboxPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Checkbox.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Choice.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Choice.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_InputEvent.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Toolkit.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WChoicePeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Choice.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Container.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dimension.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/ComCtl32Util.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Clipboard.obj:: $(CLASSHDRDIR)/sun_awt_windows_WClipboard.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Clipboard.h ../../../src/windows/native/sun/windows/awt_DataTransferer.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Color.obj:: $(CLASSHDRDIR)/sun_awt_windows_WColor.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Color.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Component.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Color.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_InputEvent.h $(CLASSHDRDIR)/java_awt_event_InputMethodEvent.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_MouseWheelEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_Insets.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Toolkit.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WInputMethod.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WPanelPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jawt.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/pipe/Region.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_AWTEvent.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Cursor.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dimension.h ../../../src/windows/native/sun/windows/awt_DnDDT.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_InputEvent.h ../../../src/windows/native/sun/windows/awt_InputTextInfor.h ../../../src/windows/native/sun/windows/awt_Insets.h ../../../src/windows/native/sun/windows/awt_KeyEvent.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MouseEvent.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/ComCtl32Util.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Container.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Container.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Cursor.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Cursor.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WCustomCursor.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WGlobalCursorManager.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Container.h ../../../src/windows/native/sun/windows/awt_Cursor.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_IconCursor.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_DataTransferer.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_TextComponent.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_datatransfer_DataTransferer.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDataTransferer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WTextComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/common/locale_str.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_DataTransferer.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_DnDDT.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_TextComponent.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Debug.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Desktop.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_DesktopProperties.obj:: $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_windows_WDesktopProperties.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_DesktopProperties.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Dialog.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dialog.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Dimension.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dimension.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_DnDDS.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_dnd_DnDConstants.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_InputEvent.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_dnd_SunDragSourceContextPeer.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDragSourceContextPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Cursor.h ../../../src/windows/native/sun/windows/awt_DataTransferer.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_DnDDS.h ../../../src/windows/native/sun/windows/awt_DnDDT.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_DnDDT.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_dnd_DnDConstants.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDropTargetContextPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Container.h ../../../src/windows/native/sun/windows/awt_DataTransferer.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_DnDDS.h ../../../src/windows/native/sun/windows/awt_DnDDT.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_DrawingSurface.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jawt.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jawt_md.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_DrawingSurface.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_DCHolder.obj:: ../../../src/windows/native/sun/windows/awt_DCHolder.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/awt_ole.h + +$(OBJDIR)/awt_ole.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/awt_ole.h + +$(OBJDIR)/awt_Event.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Event.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_FileDialog.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_FileDialog.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFileDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dialog.h ../../../src/windows/native/sun/windows/awt_FileDialog.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/ComCtl32Util.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Font.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDefaultFontCharset.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFontPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/Disposer.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Frame.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/java_lang_Integer.h $(CLASSHDRDIR)/sun_awt_EmbeddedFrame.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WEmbeddedFrame.h $(CLASSHDRDIR)/sun_awt_windows_WEmbeddedFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dialog.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_IconCursor.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/ComCtl32Util.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_GDIObject.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_IconCursor.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_IconCursor.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_ImageRep.obj:: $(CLASSHDRDIR)/sun_awt_image_ImageRepresentation.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/image/awt_parseImage.h ../../../src/share/native/sun/awt/image/imageInitIDs.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h + +$(OBJDIR)/awt_ImagingLib.obj:: $(CLASSHDRDIR)/java_awt_color_ColorSpace.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_image_BufferedImage.h $(CLASSHDRDIR)/java_awt_image_ConvolveOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_awt_image_ImagingLib.h $(CLASSHDRDIR)/sun_awt_image_IntegerComponentRaster.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/image/awt_parseImage.h ../../../src/share/native/sun/awt/image/imageInitIDs.h ../../../src/share/native/sun/awt/medialib/awt_ImagingLib.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_types.h ../../../src/share/native/sun/awt/medialib/mlib_status.h ../../../src/share/native/sun/awt/medialib/mlib_types.h ../../../src/share/native/sun/awt/medialib/safe_alloc.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/awt_Mlib.h + +$(OBJDIR)/awt_InputEvent.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_InputEvent.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_InputMethod.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_InputMethodEvent.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WInputMethodDescriptor.h $(CLASSHDRDIR)/sun_awt_windows_WInputMethod.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/common/locale_str.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_AWTEvent.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_InputTextInfor.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_InputTextInfor.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Insets.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Insets.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_KeyboardFocusManager.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_KeyboardFocusManager.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_KeyEvent.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_KeyEvent.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Label.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_Label.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WLabelPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Label.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_List.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_List.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WListPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dimension.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_List.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/ComCtl32Util.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_MenuBar.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_MenuItem.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_CheckboxMenuItem.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_InputEvent.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Toolkit.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCheckboxMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_DesktopProperties.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Menu.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Mlib.obj:: $(CLASSHDRDIR)/java_awt_image_BufferedImage.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/medialib/awt_ImagingLib.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_types.h ../../../src/share/native/sun/awt/medialib/mlib_status.h ../../../src/share/native/sun/awt/medialib/mlib_types.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Mlib.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_MouseEvent.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_MouseEvent.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_new.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_new.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Object.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Palette.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_CustomPaletteDef.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/img_util_md.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Panel.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Panel.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_parseImage.obj:: $(CLASSHDRDIR)/java_awt_color_ColorSpace.h $(CLASSHDRDIR)/java_awt_image_BufferedImage.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_awt_image_ImagingLib.h $(CLASSHDRDIR)/sun_awt_image_IntegerComponentRaster.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/image/awt_parseImage.h ../../../src/share/native/sun/awt/image/imageInitIDs.h ../../../src/share/native/sun/awt/medialib/awt_ImagingLib.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_types.h ../../../src/share/native/sun/awt/medialib/mlib_status.h ../../../src/share/native/sun/awt/medialib/mlib_types.h ../../../src/share/native/sun/awt/medialib/safe_alloc.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/awt_Mlib.h + +$(OBJDIR)/awt_Pen.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_PopupMenu.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_PopupMenu.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WPopupMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Event.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_PopupMenu.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_PrintControl.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_PrintControl.h ../../../src/windows/native/sun/windows/awt_PrintDialog.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_PrintDialog.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WPrintDialog.h $(CLASSHDRDIR)/sun_awt_windows_WPrintDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dialog.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_PrintControl.h ../../../src/windows/native/sun/windows/awt_PrintDialog.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/ComCtl32Util.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_PrintJob.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WPrinterJob.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dialog.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_PrintControl.h ../../../src/windows/native/sun/windows/awt_PrintDialog.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/ComCtl32Util.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Rectangle.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Rectangle.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Robot.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_InputEvent.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WRobotPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Robot.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Scrollbar.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_Scrollbar.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WScrollbarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Scrollbar.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_ScrollPane.obj:: $(CLASSHDRDIR)/java_awt_Adjustable.h $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_AdjustmentEvent.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_Insets.h $(CLASSHDRDIR)/java_awt_Scrollbar.h $(CLASSHDRDIR)/java_awt_ScrollPaneAdjustable.h $(CLASSHDRDIR)/java_awt_ScrollPane.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WScrollbarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WScrollPanePeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Container.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Insets.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Panel.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Scrollbar.h ../../../src/windows/native/sun/windows/awt_ScrollPane.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_TextArea.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_TextArea.h $(CLASSHDRDIR)/java_awt_TextComponent.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WTextAreaPeer.h $(CLASSHDRDIR)/sun_awt_windows_WTextComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_TextArea.h ../../../src/windows/native/sun/windows/awt_TextComponent.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_TextComponent.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_TextComponent.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WTextComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_TextComponent.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_TextField.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_TextComponent.h $(CLASSHDRDIR)/java_awt_TextField.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WTextComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WTextFieldPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_TextComponent.h ../../../src/windows/native/sun/windows/awt_TextField.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Toolkit.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_InputMethodEvent.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_FileDialog.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_List.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_ComponentPeer.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_PopupMenu.h $(CLASSHDRDIR)/java_awt_Toolkit.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFileDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WListPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WPopupMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jawt.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jawt_md.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DPipelineManager.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_AWTEvent.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Clipboard.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Cursor.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_DesktopProperties.h ../../../src/windows/native/sun/windows/awt_Dialog.h ../../../src/windows/native/sun/windows/awt_DnDDS.h ../../../src/windows/native/sun/windows/awt_DnDDT.h ../../../src/windows/native/sun/windows/awt_DrawingSurface.h ../../../src/windows/native/sun/windows/awt_FileDialog.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_InputEvent.h ../../../src/windows/native/sun/windows/awt_KeyEvent.h ../../../src/windows/native/sun/windows/awt_List.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_new.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_PopupMenu.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/CmdIDList.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/ComCtl32Util.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/DllUtil.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_TrayIcon.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_ActionEvent.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_InputEvent.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_TrayIcon.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WTrayIconPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_AWTEvent.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_TrayIcon.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Win32GraphicsConfig.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_image_DataBuffer.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_Win32GraphicsConfig.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsConfig.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Win32GraphicsDevice.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_color_ColorSpace.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_image_DataBuffer.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_Win32GraphicsDevice.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/awt/image/dither.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/img_util_md.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Win32GraphicsEnv.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_Win32GraphicsEnvironment.h $(CLASSHDRDIR)/sun_awt_Win32FontManager.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/java2d/windows/WindowsFlags.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/DllUtil.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/awt_Window.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Container.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_ComponentEvent.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_FontMetrics.h $(CLASSHDRDIR)/java_awt_Frame.h $(CLASSHDRDIR)/java_awt_Insets.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WFramePeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuBarPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuItemPeer.h $(CLASSHDRDIR)/sun_awt_windows_WMenuPeer.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_BitmapUtil.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Container.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dialog.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_Frame.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_IconCursor.h ../../../src/windows/native/sun/windows/awt_Insets.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Panel.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/ComCtl32Util.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/BlitBg.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_BlitBg.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/Region.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/Blit.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_Blit.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/Region.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/BufferedMaskBlit.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedMaskBlit.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedOpCodes.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntBgr.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/BufferedRenderPipe.obj:: $(CLASSHDRDIR)/sun_java2d_pipe_BufferedOpCodes.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedRenderPipe.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h + +$(OBJDIR)/BufImgSurfaceData.obj:: $(CLASSHDRDIR)/sun_awt_image_BufImgSurfaceData.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/image/BufImgSurfaceData.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/img_util_md.h + +$(OBJDIR)/ByteBinary1Bit.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyByteBinary.h ../../../src/share/native/sun/java2d/loops/ByteBinary1Bit.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/ByteBinary2Bit.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyByteBinary.h ../../../src/share/native/sun/java2d/loops/ByteBinary2Bit.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/ByteBinary4Bit.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyByteBinary.h ../../../src/share/native/sun/java2d/loops/ByteBinary4Bit.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/ByteGray.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyByte.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/Index12Gray.h ../../../src/share/native/sun/java2d/loops/Index8Gray.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/ByteIndexed.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyByte.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/Index12Gray.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/CmdIDList.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/CmdIDList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/ComCtl32Util.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/ComCtl32Util.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/D3DBlitLoops.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DBlitLoops.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntBgr.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/Ushort555Rgb.h ../../../src/share/native/sun/java2d/loops/Ushort565Rgb.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DBlitLoops.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/D3DBufImgOps.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DBufImgOps.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/D3DContext.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedTextPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h $(CLASSHDRDIR)/sun_java2d_SunGraphics2D.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/sunfontids.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DBufImgOps.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DGlyphCache.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPaints.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DPipelineManager.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DShaders.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DTextRenderer.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/D3DGlyphCache.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedTextPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/sunfontids.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DGlyphCache.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DTextRenderer.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/D3DGraphicsDevice.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DGraphicsDevice.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DGraphicsDevice.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DPipelineManager.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/D3DMaskBlit.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskBlit.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/D3DMaskCache.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/D3DMaskFill.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DMaskFill.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskFill.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/D3DPaints.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h $(CLASSHDRDIR)/sun_java2d_SunGraphics2D.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPaints.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/D3DPipelineManager.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DBadHardware.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DPipelineManager.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/WindowsFlags.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/D3DRenderer.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DRenderer.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedRenderPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderer.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/D3DRenderQueue.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DBlitLoops.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedOpCodes.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedRenderPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedTextPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h $(CLASSHDRDIR)/sun_java2d_SunGraphics2D.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/sunfontids.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DBlitLoops.h ../../../src/windows/native/sun/java2d/d3d/D3DBufImgOps.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskBlit.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskFill.h ../../../src/windows/native/sun/java2d/d3d/D3DPaints.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DPipelineManager.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderer.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DTextRenderer.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/D3DResourceManager.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedTextPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h $(CLASSHDRDIR)/sun_java2d_SunGraphics2D.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/sunfontids.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPaints.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DTextRenderer.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/D3DSurfaceData.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/java_awt_Window.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WCanvasPeer.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DPipelineManager.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_BitmapUtil.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Canvas.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/awt_Window.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/D3DTextRenderer.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DTextRenderer.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedTextPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/sunfontids.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DGlyphCache.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DRenderQueue.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DTextRenderer.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/D3DVertexCacher.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h $(CLASSHDRDIR)/sun_java2d_SunGraphics2D.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPaints.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/DataBufferNative.obj:: $(CLASSHDRDIR)/sun_awt_image_DataBufferNative.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h + +$(OBJDIR)/debug_assert.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h + +$(OBJDIR)/debug_mem.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h + +$(OBJDIR)/debug_trace.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h + +$(OBJDIR)/debug_util.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h + +$(OBJDIR)/Devices.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelDeviceEventNotifier.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/ShaderList.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DMaskCache.h ../../../src/windows/native/sun/java2d/d3d/D3DPipeline.h ../../../src/windows/native/sun/java2d/d3d/D3DPipelineManager.h ../../../src/windows/native/sun/java2d/d3d/D3DResourceManager.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DVertexCacher.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/Disposer.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/Disposer.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h + +$(OBJDIR)/dither.obj:: ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/awt/image/dither.h ../../../src/windows/native/sun/windows/colordata.h + +$(OBJDIR)/DllUtil.obj:: ../../../src/windows/native/sun/windows/DllUtil.h + +$(OBJDIR)/DrawLine.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_DrawLine.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/DrawPath.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_DrawPath.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/DrawPath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/ProcessPath.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/DrawPolygons.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_DrawPolygons.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/DrawRect.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_DrawRect.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/FillPath.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_FillPath.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/DrawPath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/ProcessPath.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/FillRect.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_FillRect.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/FillSpans.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_FillSpans.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/FourByteAbgr.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/Any4Byte.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/FourByteAbgr.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/FourByteAbgrPre.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/Any4Byte.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/FourByteAbgrPre.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/GDIBlitLoops.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_windows_GDIBlitLoops.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/GDIHashtable.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/GDIRenderer.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/java_awt_geom_PathIterator.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_windows_GDIRenderer.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/GDIWindowSurfaceData.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_windows_GDIWindowSurfaceData.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/Disposer.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/Region.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/java2d/windows/WindowsFlags.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/gifdecoder.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h + +$(OBJDIR)/GraphicsPrimitiveMgr.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_GraphicsPrimitiveMgr.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/Region.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/Hashtable.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/imageInitIDs.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/image/imageInitIDs.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h + +$(OBJDIR)/img_colors.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h + +$(OBJDIR)/img_globals.obj:: $(CLASSHDRDIR)/java_awt_image_DirectColorModel.h $(CLASSHDRDIR)/java_awt_image_IndexColorModel.h $(CLASSHDRDIR)/java_awt_Transparency.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/windows/javavm/export/jni_md.h + +$(OBJDIR)/Index12Gray.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyShort.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/Index12Gray.h ../../../src/share/native/sun/java2d/loops/Index8Gray.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/Index8Gray.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyByte.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/Index12Gray.h ../../../src/share/native/sun/java2d/loops/Index8Gray.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/initIDs.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h + +$(OBJDIR)/IntArgbBm.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyInt.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/IntArgb.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyInt.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/Index12Gray.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/IntArgbPre.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyInt.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/IntBgr.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyInt.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/Index12Gray.h ../../../src/share/native/sun/java2d/loops/Index8Gray.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntBgr.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/IntRgb.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyInt.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/Index12Gray.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/IntRgbx.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyInt.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/IntRgbx.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/MaskBlit.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_MaskBlit.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/Region.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/MaskFill.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_MaskFill.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/MouseInfo.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/ObjectList.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/OGLBlitLoops.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLBlitLoops.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLBlitLoops.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLRenderQueue.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h + +$(OBJDIR)/OGLBufImgOps.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLBufImgOps.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLRenderQueue.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h + +$(OBJDIR)/OGLContext.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h $(CLASSHDRDIR)/sun_java2d_SunGraphics2D.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLRenderQueue.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/pipe/Region.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h + +$(OBJDIR)/OGLFuncs.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h + +$(OBJDIR)/OGLMaskBlit.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLMaskBlit.h ../../../src/share/native/sun/java2d/opengl/OGLRenderQueue.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h + +$(OBJDIR)/OGLMaskFill.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLMaskFill.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLMaskFill.h ../../../src/share/native/sun/java2d/opengl/OGLRenderQueue.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/opengl/OGLVertexCache.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h + +$(OBJDIR)/OGLPaints.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedPaints.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h $(CLASSHDRDIR)/sun_java2d_SunGraphics2D.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLPaints.h ../../../src/share/native/sun/java2d/opengl/OGLRenderQueue.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h + +$(OBJDIR)/OGLRenderer.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLRenderer.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedRenderPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLRenderer.h ../../../src/share/native/sun/java2d/opengl/OGLRenderQueue.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h + +$(OBJDIR)/OGLRenderQueue.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLBlitLoops.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedOpCodes.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedRenderPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedTextPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLBlitLoops.h ../../../src/share/native/sun/java2d/opengl/OGLBufImgOps.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLMaskBlit.h ../../../src/share/native/sun/java2d/opengl/OGLMaskFill.h ../../../src/share/native/sun/java2d/opengl/OGLPaints.h ../../../src/share/native/sun/java2d/opengl/OGLRenderer.h ../../../src/share/native/sun/java2d/opengl/OGLRenderQueue.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/opengl/OGLTextRenderer.h ../../../src/share/native/sun/java2d/opengl/OGLVertexCache.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h + +$(OBJDIR)/OGLSurfaceData.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h + +$(OBJDIR)/OGLTextRenderer.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLTextRenderer.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedTextPipe.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/sunfontids.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLRenderQueue.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/opengl/OGLTextRenderer.h ../../../src/share/native/sun/java2d/opengl/OGLVertexCache.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h + +$(OBJDIR)/OGLVertexCache.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h $(CLASSHDRDIR)/sun_java2d_SunGraphics2D.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLPaints.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/opengl/OGLVertexCache.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h + +$(OBJDIR)/ProcessPath.obj:: $(CLASSHDRDIR)/java_awt_geom_PathIterator.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/loops/ProcessPath.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/Region.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/pipe/Region.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h + +$(OBJDIR)/RenderBuffer.obj:: $(CLASSHDRDIR)/sun_java2d_pipe_RenderBuffer.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h + +$(OBJDIR)/ScaledBlit.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_loops_ScaledBlit.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/Region.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/ShapeSpanIterator.obj:: $(CLASSHDRDIR)/java_awt_geom_PathIterator.h $(CLASSHDRDIR)/sun_java2d_pipe_ShapeSpanIterator.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/pipe/PathConsumer2D.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/ShellFolder2.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/SpanClipRenderer.obj:: $(CLASSHDRDIR)/sun_java2d_pipe_RegionIterator.h $(CLASSHDRDIR)/sun_java2d_pipe_SpanClipRenderer.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h + +$(OBJDIR)/SurfaceData.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/Disposer.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/jlong_md.h + +$(OBJDIR)/ThemeReader.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/java_awt_Font.h $(CLASSHDRDIR)/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/sun_awt_PlatformFont.h $(CLASSHDRDIR)/sun_awt_windows_ThemeReader.h $(CLASSHDRDIR)/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/awt/image/cvutils/img_globals.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Brush.h ../../../src/windows/native/sun/windows/awt_Component.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Font.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Palette.h ../../../src/windows/native/sun/windows/awt_Pen.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Win32GraphicsDevice.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/Devices.h ../../../src/windows/native/sun/windows/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/ThreeByteBgr.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/Any3Byte.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/Trace.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h + +$(OBJDIR)/TransformHelper.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_loops_TransformHelper.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/pipe/Region.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/Ushort4444Argb.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyShort.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/Ushort4444Argb.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/Ushort555Rgb.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyShort.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/Ushort555Rgb.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/Ushort555Rgbx.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyShort.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/Ushort555Rgbx.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/Ushort565Rgb.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyShort.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/Ushort4444Argb.h ../../../src/share/native/sun/java2d/loops/Ushort565Rgb.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/UshortGray.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyShort.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/UshortIndexed.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/sun/java2d/loops/AlphaMacros.h ../../../src/share/native/sun/java2d/loops/AlphaMath.h ../../../src/share/native/sun/java2d/loops/AnyByte.h ../../../src/share/native/sun/java2d/loops/ByteGray.h ../../../src/share/native/sun/java2d/loops/ByteIndexed.h ../../../src/share/native/sun/java2d/loops/GlyphImageRef.h ../../../src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h ../../../src/share/native/sun/java2d/loops/Index12Gray.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.h ../../../src/share/native/sun/java2d/loops/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbPre.h ../../../src/share/native/sun/java2d/loops/IntDcm.h ../../../src/share/native/sun/java2d/loops/IntRgb.h ../../../src/share/native/sun/java2d/loops/LineUtils.h ../../../src/share/native/sun/java2d/loops/LoopMacros.h ../../../src/share/native/sun/java2d/loops/ThreeByteBgr.h ../../../src/share/native/sun/java2d/loops/UshortGray.h ../../../src/share/native/sun/java2d/loops/UshortIndexed.h ../../../src/share/native/sun/java2d/pipe/SpanIterator.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h + +$(OBJDIR)/WGLGraphicsConfig.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_opengl_WGLGraphicsConfig.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h ../../../src/windows/native/sun/java2d/opengl/WGLGraphicsConfig.h ../../../src/windows/native/sun/java2d/opengl/WGLSurfaceData.h + +$(OBJDIR)/WGLSurfaceData.obj:: $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLContext.h $(CLASSHDRDIR)/sun_java2d_opengl_OGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_opengl_WGLSurfaceData.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedContext.h $(CLASSHDRDIR)/sun_java2d_pipe_hw_AccelSurface.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/gl.h ../../../src/share/native/sun/java2d/opengl/OGLContext.h ../../../src/share/native/sun/java2d/opengl/OGLFuncMacros.h ../../../src/share/native/sun/java2d/opengl/OGLFuncs.h ../../../src/share/native/sun/java2d/opengl/OGLRenderQueue.h ../../../src/share/native/sun/java2d/opengl/OGLSurfaceData.h ../../../src/share/native/sun/java2d/SurfaceData.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/opengl/J2D_GL/wglext.h ../../../src/windows/native/sun/java2d/opengl/OGLFuncs_md.h ../../../src/windows/native/sun/java2d/opengl/WGLGraphicsConfig.h ../../../src/windows/native/sun/java2d/opengl/WGLSurfaceData.h + +$(OBJDIR)/WindowsFlags.obj:: ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/java2d/windows/WindowsFlags.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/stdhdrs.h + +$(OBJDIR)/WPrinterJob.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/classfile_constants.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jlong.h ../../../src/share/native/common/jni_util.h ../../../src/share/native/sun/awt/debug/debug_assert.h ../../../src/share/native/sun/awt/debug/debug_mem.h ../../../src/share/native/sun/awt/debug/debug_trace.h ../../../src/share/native/sun/awt/debug/debug_util.h ../../../src/share/native/sun/java2d/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/common/jlong_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_PrintControl.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/stdhdrs.h diff --git a/jdk/make/sun/cmm/Makefile b/jdk/make/sun/cmm/Makefile index bbed857654c..e6738821c59 100644 --- a/jdk/make/sun/cmm/Makefile +++ b/jdk/make/sun/cmm/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../.. +MODULE = java2d PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk @@ -35,6 +36,8 @@ else # !OPENJDK ICCPROFILE_SRC_DIR = $(CLOSED_SRC)/share/lib/cmm/kcms endif # OPENJDK +include $(BUILDDIR)/common/Subdirs.gmk + # # ICC Profiles used by the CMM. # @@ -45,34 +48,24 @@ iccprofiles: $(ICCPROFILE_DEST_DIR)/sRGB.pf $(ICCPROFILE_DEST_DIR)/GRAY.pf \ $(ICCPROFILE_DEST_DIR)/LINEAR_RGB.pf $(ICCPROFILE_DEST_DIR)/sRGB.pf: $(ICCPROFILE_SRC_DIR)/sRGB.pf - $(RM) $(ICCPROFILE_DEST_DIR)/sRGB.pf - -$(MKDIR) -p $(ICCPROFILE_DEST_DIR) - $(CP) $(ICCPROFILE_SRC_DIR)/sRGB.pf $(ICCPROFILE_DEST_DIR) - $(CHMOD) 444 $(ICCPROFILE_DEST_DIR)/sRGB.pf + $(install-file) + $(call chmod-file, 444) $(ICCPROFILE_DEST_DIR)/GRAY.pf: $(ICCPROFILE_SRC_DIR)/GRAY.pf - $(RM) $(ICCPROFILE_DEST_DIR)/GRAY.pf - -$(MKDIR) -p $(ICCPROFILE_DEST_DIR) - $(CP) $(ICCPROFILE_SRC_DIR)/GRAY.pf $(ICCPROFILE_DEST_DIR) - $(CHMOD) 444 $(ICCPROFILE_DEST_DIR)/GRAY.pf + $(install-file) + $(call chmod-file, 444) $(ICCPROFILE_DEST_DIR)/CIEXYZ.pf: $(ICCPROFILE_SRC_DIR)/CIEXYZ.pf - $(RM) $(ICCPROFILE_DEST_DIR)/CIEXYZ.pf - -$(MKDIR) -p $(ICCPROFILE_DEST_DIR) - $(CP) $(ICCPROFILE_SRC_DIR)/CIEXYZ.pf $(ICCPROFILE_DEST_DIR) - $(CHMOD) 444 $(ICCPROFILE_DEST_DIR)/CIEXYZ.pf + $(install-file) + $(call chmod-file, 444) $(ICCPROFILE_DEST_DIR)/PYCC.pf: $(ICCPROFILE_SRC_DIR)/PYCC.pf - $(RM) $(ICCPROFILE_DEST_DIR)/PYCC.pf - -$(MKDIR) -p $(ICCPROFILE_DEST_DIR) - $(CP) $(ICCPROFILE_SRC_DIR)/PYCC.pf $(ICCPROFILE_DEST_DIR) - $(CHMOD) 444 $(ICCPROFILE_DEST_DIR)/PYCC.pf + $(install-file) + $(call chmod-file, 444) $(ICCPROFILE_DEST_DIR)/LINEAR_RGB.pf: $(ICCPROFILE_SRC_DIR)/LINEAR_RGB.pf - $(RM) $(ICCPROFILE_DEST_DIR)/LINEAR_RGB.pf - -$(MKDIR) -p $(ICCPROFILE_DEST_DIR) - $(CP) $(ICCPROFILE_SRC_DIR)/LINEAR_RGB.pf $(ICCPROFILE_DEST_DIR) - $(CHMOD) 444 $(ICCPROFILE_DEST_DIR)/LINEAR_RGB.pf + $(install-file) + $(call chmod-file, 444) iccprofiles.clean: $(RM) -r $(ICCPROFILE_DEST_DIR) diff --git a/jdk/make/sun/cmm/kcms/Makefile b/jdk/make/sun/cmm/kcms/Makefile index 10ff72b4f57..a7250f74b87 100644 --- a/jdk/make/sun/cmm/kcms/Makefile +++ b/jdk/make/sun/cmm/kcms/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../../.. +MODULE = java2d PACKAGE = sun.java2d.cmm.kcms LIBRARY = kcms PRODUCT = sun diff --git a/jdk/make/sun/cmm/lcms/Makefile b/jdk/make/sun/cmm/lcms/Makefile index ba595507b7a..ac8746af7b2 100644 --- a/jdk/make/sun/cmm/lcms/Makefile +++ b/jdk/make/sun/cmm/lcms/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../../.. +MODULE = java2d PACKAGE = sun.java2d.cmm.lcms LIBRARY = lcms PRODUCT = sun diff --git a/jdk/make/sun/dcpr/Makefile b/jdk/make/sun/dcpr/Makefile index e49db2af23a..4dc39f93b9f 100644 --- a/jdk/make/sun/dcpr/Makefile +++ b/jdk/make/sun/dcpr/Makefile @@ -26,6 +26,7 @@ # WARNING: Make sure the OPENJDK plugs are up-to-date, see make/common/internal/BinaryPlugs.gmk BUILDDIR = ../.. +MODULE = java2d PACKAGE = sun.dc LIBRARY = dcpr PRODUCT = sun diff --git a/jdk/make/sun/font/Makefile b/jdk/make/sun/font/Makefile index f513a64bd46..c95e52f458e 100644 --- a/jdk/make/sun/font/Makefile +++ b/jdk/make/sun/font/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../.. +MODULE = font PACKAGE = sun.font LIBRARY = fontmanager PRODUCT = sun @@ -121,16 +122,21 @@ FILES_m=mapfile-vers.openjdk # #TODO: rework this to avoid hardcoding library name in the makefile # -library:: $(LIB_LOCATION)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX) - -$(LIB_LOCATION)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX): ifeq ($(PLATFORM), windows) - $(CP) $(FREETYPE_LIB_PATH)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX) $@ + FREETYPE_LIB = $(LIB_LOCATION)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX) + OTHER_LDLIBS += $(FREETYPE_LIB_PATH)/freetype.lib else ifeq ($(USING_SYSTEM_FT_LIB), false) - $(CP) $(FREETYPE_LIB_PATH)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX) $@.6 + FREETYPE_LIB = $(LIB_LOCATION)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX).6 endif + OTHER_LDLIBS += -L$(FREETYPE_LIB_PATH) -lfreetype endif + +library:: $(FREETYPE_LIB) + +$(FREETYPE_LIB): + $(CP) $(FREETYPE_LIB_PATH)/$(LIB_PREFIX)freetype.$(LIBRARY_SUFFIX) $@ + $(install-module-file) endif #ifeq ($(PLATFORM), solaris) @@ -158,7 +164,6 @@ ifndef OPENJDK CPPFLAGS += -I$(CLOSED_SRC)/share/native/$(PKGDIR)/t2k else CPPFLAGS += -I$(FREETYPE_HEADERS_PATH) -I$(FREETYPE_HEADERS_PATH)/freetype2 - OTHER_LDLIBS += $(FREETYPE_LIB) endif ifeq ($(PLATFORM), windows) diff --git a/jdk/make/sun/font/t2k/Makefile b/jdk/make/sun/font/t2k/Makefile index d01e825159b..651eea84d2c 100644 --- a/jdk/make/sun/font/t2k/Makefile +++ b/jdk/make/sun/font/t2k/Makefile @@ -30,6 +30,7 @@ # BUILDDIR = ../../.. +MODULE = font PACKAGE = sun.font LIBRARY = t2k PRODUCT = sun diff --git a/jdk/make/sun/headless/Makefile b/jdk/make/sun/headless/Makefile index b1e1ebf6d5b..ee853eae746 100644 --- a/jdk/make/sun/headless/Makefile +++ b/jdk/make/sun/headless/Makefile @@ -30,6 +30,7 @@ MOTIF_VERSION = none MOTIF_VERSION_STRING=none LIB_LOCATION = $(LIBDIR)/$(LIBARCH)/headless +MODULE = awt PACKAGE = sun.awt LIBRARY = mawt LIBRARY_OUTPUT = headless diff --git a/jdk/make/sun/image/Makefile b/jdk/make/sun/image/Makefile index 0a264b669d1..cd69637b9ef 100644 --- a/jdk/make/sun/image/Makefile +++ b/jdk/make/sun/image/Makefile @@ -43,6 +43,8 @@ ifeq ($(PLATFORM),solaris) endif endif +include $(BUILDDIR)/common/Subdirs.gmk + all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/sun/image/generic/Makefile b/jdk/make/sun/image/generic/Makefile index 5caedf6d7d0..446209f8667 100644 --- a/jdk/make/sun/image/generic/Makefile +++ b/jdk/make/sun/image/generic/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../../.. +MODULE = media PACKAGE = sun.awt.medialib LIBRARY = mlib_image PRODUCT = sun diff --git a/jdk/make/sun/image/vis/Makefile b/jdk/make/sun/image/vis/Makefile index b0e399b0878..2bc891a5cf6 100644 --- a/jdk/make/sun/image/vis/Makefile +++ b/jdk/make/sun/image/vis/Makefile @@ -27,6 +27,7 @@ # Makefile for building the VIS (solaris-only) version of medialib # BUILDDIR = ../../.. +MODULE = media PACKAGE = sun.awt.medialib LIBRARY = mlib_image_v PRODUCT = sun diff --git a/jdk/make/sun/jar/Makefile b/jdk/make/sun/jar/Makefile index b90d738900c..7dd586e2ff7 100644 --- a/jdk/make/sun/jar/Makefile +++ b/jdk/make/sun/jar/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../.. +MODULE = jar-tool PACKAGE = sun.tools PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/sun/javazic/Makefile b/jdk/make/sun/javazic/Makefile index 96a2df1e0d9..10c2b1a8565 100644 --- a/jdk/make/sun/javazic/Makefile +++ b/jdk/make/sun/javazic/Makefile @@ -27,6 +27,7 @@ BUILDDIR = ../.. +MODULE = base PACKAGE = sun.javazic PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk @@ -69,6 +70,7 @@ $(INSTALLDIR)/$(MAPFILE): $(WORKDIR)/$(MAPFILE) $(RM) -r $(@D) $(prep-target) $(CP) -r $(WORKDIR)/* $(@D) + $(install-module-dir) clean clobber:: $(RM) -r $(TEMPDIR) $(INSTALLDIR) diff --git a/jdk/make/sun/javazic/tzdata/VERSION b/jdk/make/sun/javazic/tzdata/VERSION index a5146914b90..07595249769 100644 --- a/jdk/make/sun/javazic/tzdata/VERSION +++ b/jdk/make/sun/javazic/tzdata/VERSION @@ -21,4 +21,4 @@ # CA 95054 USA or visit www.sun.com if you need additional information or # have any questions. # -tzdata2009r +tzdata2010b diff --git a/jdk/make/sun/javazic/tzdata/antarctica b/jdk/make/sun/javazic/tzdata/antarctica index c77fc899cad..bd5cd134765 100644 --- a/jdk/make/sun/javazic/tzdata/antarctica +++ b/jdk/make/sun/javazic/tzdata/antarctica @@ -128,7 +128,7 @@ Zone Antarctica/Casey 0 - zzz 1969 Zone Antarctica/Davis 0 - zzz 1957 Jan 13 7:00 - DAVT 1964 Nov # Davis Time 0 - zzz 1969 Feb - 7:00 - DAVT 2009 Oct 18 2:0 + 7:00 - DAVT 2009 Oct 18 2:00 5:00 - DAVT Zone Antarctica/Mawson 0 - zzz 1954 Feb 13 6:00 - MAWT 2009 Oct 18 2:00 diff --git a/jdk/make/sun/javazic/tzdata/asia b/jdk/make/sun/javazic/tzdata/asia index 139df5ee0e1..a8e6746fb30 100644 --- a/jdk/make/sun/javazic/tzdata/asia +++ b/jdk/make/sun/javazic/tzdata/asia @@ -218,6 +218,41 @@ Zone Asia/Bahrain 3:22:20 - LMT 1920 # Al Manamah # http://www.thaindian.com/newsportal/business/bangladesh-to-continue-indefinitely-with-advanced-time_100259987.html # +# From Alexander Krivenyshev (2009-12-24): +# According to Bangladesh newspaper "The Daily Star," +# Bangladesh will change its clock back to Standard Time on Dec 31, 2009. +# +# Clock goes back 1-hr on Dec 31 night. +# +# http://www.thedailystar.net/newDesign/news-details.php?nid=119228 +# +# and +# +# http://www.worldtimezone.com/dst_news/dst_news_bangladesh05.html +# +# +# "...The government yesterday decided to put the clock back by one hour +# on December 31 midnight and the new time will continue until March 31, +# 2010 midnight. The decision came at a cabinet meeting at the Prime +# Minister's Office last night..." + +# From Danvin Ruangchan (2009-12-24): +# ...the news mentions DST will be turned off again 7 months after March +# 31st on Oct 31, 2010. + +# From Arthur David Olson (2009-12-26): +# Indeed, "The government will advance again the Banglasdesh Standard +# Time by one one hour on March 31 next year by enforcing the Daylight +# Saving Time (DST) for seven months. It will continue till October 31 +# until further notice." I take that last sentence as the +# establishment of a rule. + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Dhaka 2009 only - Jun 19 23:00 1:00 S +Rule Dhaka 2010 only - Jan 1 0:00 0 - +Rule Dhaka 2010 max - Mar 31 23:00 1:00 S +Rule Dhaka 2010 max - Nov 1 0:00 0 - + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Dhaka 6:01:40 - LMT 1890 5:53:20 - HMT 1941 Oct # Howrah Mean Time? @@ -225,8 +260,8 @@ Zone Asia/Dhaka 6:01:40 - LMT 1890 5:30 - IST 1942 Sep 6:30 - BURT 1951 Sep 30 6:00 - DACT 1971 Mar 26 # Dacca Time - 6:00 - BDT 2009 Jun 19 23:00 # Bangladesh Time - 6:00 1:00 BDST + 6:00 - BDT 2009 + 6:00 Dhaka BD%sT # Bhutan # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -385,6 +420,69 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # or Urumchi # West Xinjiang, including Aksu, Atushi, Yining, Hetian, Cele, Luopu, Nileke, # Zhaosu, Tekesi, Gongliu, Chabuchaer, Huocheng, Bole, Pishan, Suiding, # and Yarkand. + +# From Luther Ma (2009-10-17): +# Almost all (>99.9%) ethnic Chinese (properly ethnic Han) living in +# Xinjiang use Chinese Standard Time. Some are aware of Xinjiang time, +# but have no need of it. All planes, trains, and schools function on +# what is called "Beijing time." When Han make an appointment in Chinese +# they implicitly use Beijing time. +# +# On the other hand, ethnic Uyghurs, who make up about half the +# population of Xinjiang, typically use "Xinjiang time" which is two +# hours behind Beijing time, or UTC +0600. The government of the Xinjiang +# Uyghur Autonomous Region, (XAUR, or just Xinjiang for short) as well as +# local governments such as the Urumqi city government use both times in +# publications, referring to what is popularly called Xinjiang time as +# "Urumqi time." When Uyghurs make an appointment in the Uyghur language +# they almost invariably use Xinjiang time. +# +# (Their ethnic Han compatriots would typically have no clue of its +# widespread use, however, because so extremely few of them are fluent in +# Uyghur, comparable to the number of Anglo-Americans fluent in Navajo.) +# +# (...As with the rest of China there was a brief interval ending in 1990 +# or 1991 when summer time was in use. The confusion was severe, with +# the province not having dual times but four times in use at the same +# time. Some areas remained on standard Xinjiang time or Beijing time and +# others moving their clocks ahead.) +# +# ...an example of an official website using of Urumqi time. +# +# The first few lines of the Google translation of +# +# http://www.fjysgl.gov.cn/show.aspx?id=2379&cid=39 +# +# (retrieved 2009-10-13) +# > Urumqi fire seven people are missing the alleged losses of at least +# > 500 million yuan +# > +# > (Reporter Dong Liu) the day before 20:20 or so (Urumqi Time 18:20), +# > Urumqi City Department of International Plaza Luther Qiantang River +# > burst fire. As of yesterday, 18:30, Urumqi City Fire officers and men +# > have worked continuously for 22 hours... + +# From Luther Ma (2009-11-19): +# With the risk of being redundant to previous answers these are the most common +# English "transliterations" (w/o using non-English symbols): +# +# 1. Wulumuqi... +# 2. Kashi... +# 3. Urumqi... +# 4. Kashgar... +# ... +# 5. It seems that Uyghurs in Urumqi has been using Xinjiang since at least the +# 1960's. I know of one Han, now over 50, who grew up in the surrounding +# countryside and used Xinjiang time as a child. +# +# 6. Likewise for Kashgar and the rest of south Xinjiang I don't know of any +# start date for Xinjiang time. +# +# Without having access to local historical records, nor the ability to legally +# publish them, I would go with October 1, 1949, when Xinjiang became the Uyghur +# Autonomous Region under the PRC. (Before that Uyghurs, of course, would also +# not be using Beijing time, but some local time.) + Zone Asia/Kashgar 5:03:56 - LMT 1928 # or Kashi or Kaxgar 5:30 - KAST 1940 # Kashgar Time 5:00 - KAST 1980 May @@ -392,8 +490,8 @@ Zone Asia/Kashgar 5:03:56 - LMT 1928 # or Kashi or Kaxgar # From Lee Yiu Chung (2009-10-24): -# I found there are some mistakes for the historial DST rule for Hong -# Kong. Accoring to the DST record from Hong Kong Observatory (actually, +# I found there are some mistakes for the...DST rule for Hong +# Kong. [According] to the DST record from Hong Kong Observatory (actually, # it is not [an] observatory, but the official meteorological agency of HK, # and also serves as the official timing agency), there are some missing # and incorrect rules. Although the exact switch over time is missing, I diff --git a/jdk/make/sun/javazic/tzdata/australasia b/jdk/make/sun/javazic/tzdata/australasia index d9150b5ffd5..940d4e16614 100644 --- a/jdk/make/sun/javazic/tzdata/australasia +++ b/jdk/make/sun/javazic/tzdata/australasia @@ -270,9 +270,30 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 6:30 - CCT # Cocos Islands Time # Fiji +# From Alexander Krivenyshev (2009-11-10): +# According to Fiji Broadcasting Corporation, Fiji plans to re-introduce DST +# from November 29th 2009 to April 25th 2010. +# +# "Daylight savings to commence this month" +# +# http://www.radiofiji.com.fj/fullstory.php?id=23719 +# +# or +# +# http://www.worldtimezone.com/dst_news/dst_news_fiji01.html +# + +# From Steffen Thorsen (2009-11-10): +# The Fiji Government has posted some more details about the approved +# amendments: +# +# http://www.fiji.gov.fj/publish/page_16198.shtml +# # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 S Rule Fiji 1999 2000 - Feb lastSun 3:00 0 - +Rule Fiji 2009 only - Nov 29 2:00 1:00 S +Rule Fiji 2010 only - Apr 25 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Fiji 11:53:40 - LMT 1915 Oct 26 # Suva 12:00 Fiji FJ%sT # Fiji Time diff --git a/jdk/make/sun/javazic/tzdata/europe b/jdk/make/sun/javazic/tzdata/europe index d7fffc23c7e..9235c7e1697 100644 --- a/jdk/make/sun/javazic/tzdata/europe +++ b/jdk/make/sun/javazic/tzdata/europe @@ -2152,12 +2152,20 @@ Zone Asia/Irkutsk 6:57:20 - LMT 1880 # From Oscar van Vlijmen (2003-10-18): [This region consists of] # Aginskij Buryatskij avtonomnyj okrug, Amurskaya oblast', # [parts of] Respublika Sakha (Yakutiya), Chitinskaya oblast'. + +# From Oscar van Vlijmen (2009-11-29): +# ...some regions of RUssia were merged with others since 2005... +# Some names were changed, no big deal, except for one instance: a new name. +# YAK/YAKST: UTC+9 Zabajkal'skij kraj. + +# From Oscar van Vlijmen (2009-11-29): # The Sakha districts are: Aldanskij, Amginskij, Anabarskij, -# Bulunskij, Verkhnekolymskij, Verkhnevilyujskij, Vilyujskij, Gornyj, +# Verkhnevilyujskij, Vilyujskij, Gornyj, # Zhiganskij, Kobyajskij, Lenskij, Megino-Kangalasskij, Mirninskij, -# Namskij, Nyurbinskij, Olenekskij, Olekminskij, Srednekolymskij, +# Namskij, Nyurbinskij, Olenyokskij, Olyokminskij, # Suntarskij, Tattinskij, Ust'-Aldanskij, Khangalasskij, -# Churapchinskij, Eveno-Bytantajskij. +# Churapchinskij, Eveno-Bytantajskij Natsional'nij. + Zone Asia/Yakutsk 8:38:40 - LMT 1919 Dec 15 8:00 - YAKT 1930 Jun 21 # Yakutsk Time 9:00 Russia YAK%sT 1991 Mar 31 2:00s @@ -2167,7 +2175,9 @@ Zone Asia/Yakutsk 8:38:40 - LMT 1919 Dec 15 # From Oscar van Vlijmen (2003-10-18): [This region consists of] # Evrejskaya avtonomnaya oblast', Khabarovskij kraj, Primorskij kraj, # [parts of] Respublika Sakha (Yakutiya). -# The Sakha districts are: Verkhoyanskij, Tomponskij, Ust'-Majskij, + +# From Oscar van Vlijmen (2009-11-29): +# The Sakha districts are: Bulunskij, Verkhoyanskij, Tomponskij, Ust'-Majskij, # Ust'-Yanskij. Zone Asia/Vladivostok 8:47:44 - LMT 1922 Nov 15 9:00 - VLAT 1930 Jun 21 # Vladivostok Time @@ -2188,8 +2198,10 @@ Zone Asia/Sakhalin 9:30:48 - LMT 1905 Aug 23 # From Oscar van Vlijmen (2003-10-18): [This region consists of] # Magadanskaya oblast', Respublika Sakha (Yakutiya). # Probably also: Kuril Islands. -# The Sakha districts are: Abyjskij, Allaikhovskij, Momskij, -# Nizhnekolymskij, Ojmyakonskij. + +# From Oscar van Vlijmen (2009-11-29): +# The Sakha districts are: Abyjskij, Allaikhovskij, Verkhhhnekolymskij, Momskij, +# Nizhnekolymskij, Ojmyakonskij, Srednekolymskij. Zone Asia/Magadan 10:03:12 - LMT 1924 May 2 10:00 - MAGT 1930 Jun 21 # Magadan Time 11:00 Russia MAG%sT 1991 Mar 31 2:00s diff --git a/jdk/make/sun/javazic/tzdata/northamerica b/jdk/make/sun/javazic/tzdata/northamerica index 1b8cb7a27ed..787966a2a51 100644 --- a/jdk/make/sun/javazic/tzdata/northamerica +++ b/jdk/make/sun/javazic/tzdata/northamerica @@ -1977,6 +1977,58 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20 # http://www.conae.gob.mx/ahorro/horaver2001_m1_2002.html (2002-02-20) # confirms this. Sonora as usual is the only state where DST is not applied. +# From Steffen Thorsen (2009-12-28): +# +# Steffen Thorsen wrote: +# > Mexico's House of Representatives has approved a proposal for northern +# > Mexico's border cities to share the same daylight saving schedule as +# > the United States. +# Now this has passed both the Congress and the Senate, so starting from +# 2010, some border regions will be the same: +# +# http://www.signonsandiego.com/news/2009/dec/28/clocks-will-match-both-sides-border/ +# +# +# http://www.elmananarey.com/diario/noticia/nacional/noticias/empatan_horario_de_frontera_con_eu/621939 +# +# (Spanish) +# +# Could not find the new law text, but the proposed law text changes are here: +# +# http://gaceta.diputados.gob.mx/Gaceta/61/2009/dic/20091210-V.pdf +# +# (Gaceta Parlamentaria) +# +# There is also a list of the votes here: +# +# http://gaceta.diputados.gob.mx/Gaceta/61/2009/dic/V2-101209.html +# +# +# Our page: +# +# http://www.timeanddate.com/news/time/north-mexico-dst-change.html +# + +# From Arthur David Olson (2010-01-20): +# The page +# +# http://dof.gob.mx/nota_detalle.php?codigo=5127480&fecha=06/01/2010 +# +# includes this text: +# En los municipios fronterizos de Tijuana y Mexicali en Baja California; +# Juárez y Ojinaga en Chihuahua; Acuña y Piedras Negras en Coahuila; +# Anáhuac en Nuevo León; y Nuevo Laredo, Reynosa y Matamoros en +# Tamaulipas, la aplicación de este horario estacional surtirá efecto +# desde las dos horas del segundo domingo de marzo y concluirá a las dos +# horas del primer domingo de noviembre. +# En los municipios fronterizos que se encuentren ubicados en la franja +# fronteriza norte en el territorio comprendido entre la línea +# internacional y la línea paralela ubicada a una distancia de veinte +# kilómetros, así como la Ciudad de Ensenada, Baja California, hacia el +# interior del país, la aplicación de este horario estacional surtirá +# efecto desde las dos horas del segundo domingo de marzo y concluirá a +# las dos horas del primer domingo de noviembre. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Mexico 1939 only - Feb 5 0:00 1:00 D Rule Mexico 1939 only - Jun 25 0:00 0 S @@ -2003,13 +2055,19 @@ Zone America/Merida -5:58:28 - LMT 1922 Jan 1 0:01:32 -6:00 - CST 1981 Dec 23 -5:00 - EST 1982 Dec 2 -6:00 Mexico C%sT -# Coahuila, Durango, Nuevo Leon, Tamaulipas +# Coahuila, Durango, Nuevo Leon, Tamaulipas (near US border) +Zone America/Matamoros -6:40:00 - LMT 1921 Dec 31 23:20:00 + -6:00 - CST 1988 + -6:00 US C%sT 1989 + -6:00 Mexico C%sT 2010 + -6:00 US C%sT +# Coahuila, Durango, Nuevo Leon, Tamaulipas (away from US border) Zone America/Monterrey -6:41:16 - LMT 1921 Dec 31 23:18:44 -6:00 - CST 1988 -6:00 US C%sT 1989 -6:00 Mexico C%sT # Central Mexico -Zone America/Mexico_City -6:36:36 - LMT 1922 Jan 1 0:23:24 +Zone America/Mexico_City -6:36:36 - LMT 1922 Jan 1 0:23:24 -7:00 - MST 1927 Jun 10 23:00 -6:00 - CST 1930 Nov 15 -7:00 - MST 1931 May 1 23:00 @@ -2018,7 +2076,19 @@ Zone America/Mexico_City -6:36:36 - LMT 1922 Jan 1 0:23:24 -6:00 Mexico C%sT 2001 Sep 30 02:00 -6:00 - CST 2002 Feb 20 -6:00 Mexico C%sT -# Chihuahua +# Chihuahua (near US border) +Zone America/Ojinaga -6:57:40 - LMT 1922 Jan 1 0:02:20 + -7:00 - MST 1927 Jun 10 23:00 + -6:00 - CST 1930 Nov 15 + -7:00 - MST 1931 May 1 23:00 + -6:00 - CST 1931 Oct + -7:00 - MST 1932 Apr 1 + -6:00 - CST 1996 + -6:00 Mexico C%sT 1998 + -6:00 - CST 1998 Apr Sun>=1 3:00 + -7:00 Mexico M%sT 2010 + -7:00 US M%sT +# Chihuahua (away from US border) Zone America/Chihuahua -7:04:20 - LMT 1921 Dec 31 23:55:40 -7:00 - MST 1927 Jun 10 23:00 -6:00 - CST 1930 Nov 15 @@ -2052,8 +2122,28 @@ Zone America/Mazatlan -7:05:40 - LMT 1921 Dec 31 23:54:20 -7:00 - MST 1949 Jan 14 -8:00 - PST 1970 -7:00 Mexico M%sT -# Baja California +# Baja California (near US border) Zone America/Tijuana -7:48:04 - LMT 1922 Jan 1 0:11:56 + -7:00 - MST 1924 + -8:00 - PST 1927 Jun 10 23:00 + -7:00 - MST 1930 Nov 15 + -8:00 - PST 1931 Apr 1 + -8:00 1:00 PDT 1931 Sep 30 + -8:00 - PST 1942 Apr 24 + -8:00 1:00 PWT 1945 Aug 14 23:00u + -8:00 1:00 PPT 1945 Nov 12 # Peace + -8:00 - PST 1948 Apr 5 + -8:00 1:00 PDT 1949 Jan 14 + -8:00 - PST 1954 + -8:00 CA P%sT 1961 + -8:00 - PST 1976 + -8:00 US P%sT 1996 + -8:00 Mexico P%sT 2001 + -8:00 US P%sT 2002 Feb 20 + -8:00 Mexico P%sT 2010 + -8:00 US P%sT +# Baja California (away from US border) +Zone America/Santa_Isabel -7:39:28 - LMT 1922 Jan 1 0:20:32 -7:00 - MST 1924 -8:00 - PST 1927 Jun 10 23:00 -7:00 - MST 1930 Nov 15 diff --git a/jdk/make/sun/javazic/tzdata/zone.tab b/jdk/make/sun/javazic/tzdata/zone.tab index 3e6f4657739..e4bc3450c76 100644 --- a/jdk/make/sun/javazic/tzdata/zone.tab +++ b/jdk/make/sun/javazic/tzdata/zone.tab @@ -301,11 +301,14 @@ MW -1547+03500 Africa/Blantyre MX +1924-09909 America/Mexico_City Central Time - most locations MX +2105-08646 America/Cancun Central Time - Quintana Roo MX +2058-08937 America/Merida Central Time - Campeche, Yucatan -MX +2540-10019 America/Monterrey Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas +MX +2540-10019 America/Monterrey Mexican Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas away from US border +MX +2550-09730 America/Matamoros US Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas near US border MX +2313-10625 America/Mazatlan Mountain Time - S Baja, Nayarit, Sinaloa -MX +2838-10605 America/Chihuahua Mountain Time - Chihuahua +MX +2838-10605 America/Chihuahua Mexican Mountain Time - Chihuahua away from US border +MX +2934-10425 America/Ojinaga US Mountain Time - Chihuahua near US border MX +2904-11058 America/Hermosillo Mountain Standard Time - Sonora -MX +3232-11701 America/Tijuana Pacific Time +MX +3232-11701 America/Tijuana US Pacific Time - Baja California near US border +MX +3018-11452 America/Santa_Isabel Mexican Pacific Time - Baja California away from US border MY +0310+10142 Asia/Kuala_Lumpur peninsular Malaysia MY +0133+11020 Asia/Kuching Sabah & Sarawak MZ -2558+03235 Africa/Maputo diff --git a/jdk/make/sun/jawt/Makefile b/jdk/make/sun/jawt/Makefile index 45d337258a4..424a20d1c41 100644 --- a/jdk/make/sun/jawt/Makefile +++ b/jdk/make/sun/jawt/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../.. +MODULE = awt PACKAGE = sun.awt LIBRARY = jawt PRODUCT = sun diff --git a/jdk/make/sun/jconsole/Makefile b/jdk/make/sun/jconsole/Makefile index dc61227fe62..42f624e38b2 100644 --- a/jdk/make/sun/jconsole/Makefile +++ b/jdk/make/sun/jconsole/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../.. +MODULE = jconsole PACKAGE = sun.tools.jconsole PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk @@ -79,7 +80,7 @@ $(CLASSBINDIR)/$(PKGDIR)/resources/%: $(SHARE_SRC)/classes/$(PKGDIR)/resources/% $(install-file) $(TEMPDIR)/manifest: $(SHARE_SRC)/classes/$(PKGDIR)/manifest - $(install-file) + $(install-manifest-file) # # Extra rule to build jconsole.jar diff --git a/jdk/make/sun/jdbc/Makefile b/jdk/make/sun/jdbc/Makefile index d7e7eaf1530..4b241b9174e 100644 --- a/jdk/make/sun/jdbc/Makefile +++ b/jdk/make/sun/jdbc/Makefile @@ -33,6 +33,7 @@ # BUILDDIR = ../.. +MODULE = jdbc-odbc PACKAGE = sun.jdbc.odbc LIBRARY = JdbcOdbc PRODUCT = sun diff --git a/jdk/make/sun/jdga/Makefile b/jdk/make/sun/jdga/Makefile index 257996d7721..d9a6db65565 100644 --- a/jdk/make/sun/jdga/Makefile +++ b/jdk/make/sun/jdga/Makefile @@ -25,6 +25,7 @@ BUILDDIR = ../.. +MODULE = java2d PACKAGE = sun.jdga LIBRARY = sunwjdga PRODUCT = sun diff --git a/jdk/make/sun/jkernel/Makefile b/jdk/make/sun/jkernel/Makefile index 97f2f38aca5..7a7a6a3645f 100644 --- a/jdk/make/sun/jkernel/Makefile +++ b/jdk/make/sun/jkernel/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../.. +MODULE = jkernel PACKAGE = sun.jkernel LIBRARY = jkernel PRODUCT = sun diff --git a/jdk/make/sun/jpeg/Makefile b/jdk/make/sun/jpeg/Makefile index f97e2cd08b8..99d36a9b257 100644 --- a/jdk/make/sun/jpeg/Makefile +++ b/jdk/make/sun/jpeg/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../.. +MODULE = java2d PACKAGE = sun.awt LIBRARY = jpeg PRODUCT = sun diff --git a/jdk/make/sun/launcher/Makefile b/jdk/make/sun/launcher/Makefile index 1346bc4e200..32b2ec7aa1b 100644 --- a/jdk/make/sun/launcher/Makefile +++ b/jdk/make/sun/launcher/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../.. +MODULE = base PACKAGE = sun.launcher PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/sun/management/Makefile b/jdk/make/sun/management/Makefile index bb7ad8935c9..516cd0dc599 100644 --- a/jdk/make/sun/management/Makefile +++ b/jdk/make/sun/management/Makefile @@ -28,6 +28,8 @@ # BUILDDIR = ../.. +MODULE = management + include $(BUILDDIR)/common/Defs.gmk MGMT_LIBDIR = $(LIBDIR)/management @@ -45,6 +47,8 @@ else endif SUBDIRS += jmxremote +include $(BUILDDIR)/common/Subdirs.gmk + all build clean clobber:: $(SUBDIRS-loop) @@ -56,17 +60,17 @@ jmxremotefiles: $(MGMT_LIBDIR)/jmxremote.password.template $(MGMT_LIBDIR)/jmxrem $(MGMT_LIBDIR)/management.properties: $(MGMT_LIB_SRC)/management.properties $(install-file) - $(CHMOD) 644 $@ + $(call chmod-file, 644) $(MGMT_LIBDIR)/snmp.acl.template: $(MGMT_LIB_SRC)/snmp.acl.template $(install-file) - $(CHMOD) 444 $@ + $(call chmod-file, 444) $(MGMT_LIBDIR)/jmxremote.password.template: $(MGMT_LIB_SRC)/jmxremote.password.template $(install-file) - $(CHMOD) 444 $@ + $(call chmod-file, 444) $(MGMT_LIBDIR)/jmxremote.access: $(MGMT_LIB_SRC)/jmxremote.access $(install-file) - $(CHMOD) 644 $@ + $(call chmod-file, 644) diff --git a/jdk/make/sun/native2ascii/Makefile b/jdk/make/sun/native2ascii/Makefile index 766e90fc545..1cd1ab9b155 100644 --- a/jdk/make/sun/native2ascii/Makefile +++ b/jdk/make/sun/native2ascii/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../.. +MODULE = tools PACKAGE = sun.tools.native2ascii PRODUCT = sun OTHER_JAVACFLAGS += -Xlint:serial -Werror diff --git a/jdk/make/sun/net/Makefile b/jdk/make/sun/net/Makefile index d5d3dd16a2b..7ddc94f04b2 100644 --- a/jdk/make/sun/net/Makefile +++ b/jdk/make/sun/net/Makefile @@ -29,6 +29,8 @@ PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk SUBDIRS = others spi +include $(BUILDDIR)/common/Subdirs.gmk + all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/sun/net/others/Makefile b/jdk/make/sun/net/others/Makefile index 2adf6048b7b..0896c7ef679 100644 --- a/jdk/make/sun/net/others/Makefile +++ b/jdk/make/sun/net/others/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../../.. +MODULE = base PACKAGE = sun.net PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/sun/net/spi/Makefile b/jdk/make/sun/net/spi/Makefile index 7fa860032e6..7ecefa88ff2 100644 --- a/jdk/make/sun/net/spi/Makefile +++ b/jdk/make/sun/net/spi/Makefile @@ -26,7 +26,9 @@ BUILDDIR = ../../.. include $(BUILDDIR)/common/Defs.gmk -SUBDIRS = nameservice +SUBDIRS_misc = nameservice +include $(BUILDDIR)/common/Subdirs.gmk + all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/sun/net/spi/nameservice/Makefile b/jdk/make/sun/net/spi/nameservice/Makefile index 4c9aba37a8f..f7df0b79ae7 100644 --- a/jdk/make/sun/net/spi/nameservice/Makefile +++ b/jdk/make/sun/net/spi/nameservice/Makefile @@ -27,6 +27,8 @@ BUILDDIR = ../../../.. include $(BUILDDIR)/common/Defs.gmk SUBDIRS = dns +include $(BUILDDIR)/common/Subdirs.gmk + all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/sun/net/spi/nameservice/dns/Makefile b/jdk/make/sun/net/spi/nameservice/dns/Makefile index d86a3c69f00..746f168b457 100644 --- a/jdk/make/sun/net/spi/nameservice/dns/Makefile +++ b/jdk/make/sun/net/spi/nameservice/dns/Makefile @@ -28,6 +28,9 @@ # BUILDDIR = ../../../../.. + +# dns should probably be its own module +MODULE = net-dns PACKAGE = sun.net.spi.nameservice.dns PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/sun/nio/Makefile b/jdk/make/sun/nio/Makefile index 4b46a1fb76d..538c0bc37bb 100644 --- a/jdk/make/sun/nio/Makefile +++ b/jdk/make/sun/nio/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -23,88 +23,14 @@ # have any questions. # -# -# Makefile for character converters. -# - BUILDDIR = ../.. - PACKAGE = sun.nio PRODUCT = sun - -# This re-directs all the class files to a separate location -CLASSDESTDIR = $(TEMPDIR)/classes - -OTHER_JAVACFLAGS += -Xlint:serial -Werror include $(BUILDDIR)/common/Defs.gmk -# -# Files -# -include FILES_java.gmk -AUTO_FILES_JAVA_DIRS = sun/nio/cs/ext +SUBDIRS = cs +include $(BUILDDIR)/common/Subdirs.gmk -# For Cygwin, command line arguments that are paths must be converted to -# windows style paths. These paths cannot be used as targets, however, because -# the ":" in them will interfere with GNU Make rules, generating "multiple -# target pattern" errors. +all build clean clobber:: + $(SUBDIRS-loop) -# this define is for the rule: -CHARSETS_JAR = $(LIBDIR)/charsets.jar - -# extcs -FILES_genout_extcs = $(FILES_gen_extcs:%.java=$(GENSRCDIR)/%.java) - -# -# Rules -# -include $(BUILDDIR)/common/Classes.gmk - -build: $(FILES_genout_extcs) $(CHARSETS_JAR) - -# -# Extra rules to build character converters. - -SERVICE_DESCRIPTION = java.nio.charset.spi.CharsetProvider -SERVICE_DESCRIPTION_PATH = META-INF/services/$(SERVICE_DESCRIPTION) - -GENCSDATASRC = $(BUILDDIR)/tools/CharsetMapping -GENCSSRCDIR = $(BUILDDIR)/tools/src/build/tools/charsetmapping -GENCSEXT = $(GENSRCDIR)/sun/nio/cs/ext - -FILES_MAP = $(GENCSDATASRC)/sjis0213.map -FILES_DAT = $(CLASSDESTDIR)/sun/nio/cs/ext/sjis0213.dat -CHARSETMAPPING_JARFILE = $(BUILDTOOLJARDIR)/charsetmapping.jar - -$(FILES_DAT): $(FILES_MAP) - @$(prep-target) - $(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) \ - $(FILES_MAP) $(FILES_DAT) sjis0213 - - -$(FILES_genout_extcs): \ - $(GENCSDATASRC)/SingleByte-X.java.template \ - $(GENCSDATASRC)/DoubleByte-X.java.template \ - $(GENCSDATASRC)/extsbcs $(GENCSDATASRC)/dbcs - @$(prep-target) - $(RM) -r $(GENCSEXT) - $(MKDIR) -p $(GENCSEXT) - $(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) extsbcs - $(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) euctw \ - $(GENCSSRCDIR)/GenerateEUC_TW.java - $(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) dbcs - -$(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH): \ - $(SHARE_SRC)/classes/sun/nio/cs/ext/$(SERVICE_DESCRIPTION_PATH) - $(install-file) - -$(CHARSETS_JAR): $(FILES_class) $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH) $(FILES_DAT) - $(BOOT_JAR_CMD) cf0 $(CHARSETS_JAR) \ - -C $(CLASSDESTDIR) sun \ - -C $(CLASSDESTDIR) $(SERVICE_DESCRIPTION_PATH) \ - $(BOOT_JAR_JFLAGS) - @$(java-vm-cleanup) - -clean:: - $(RM) -r $(CLASSDESTDIR) - $(RM) $(CHARSETS_JAR) diff --git a/jdk/make/sun/nio/FILES_java.gmk b/jdk/make/sun/nio/cs/FILES_java.gmk similarity index 100% rename from jdk/make/sun/nio/FILES_java.gmk rename to jdk/make/sun/nio/cs/FILES_java.gmk diff --git a/jdk/make/sun/nio/cs/Makefile b/jdk/make/sun/nio/cs/Makefile new file mode 100644 index 00000000000..c2e9c0b8ef2 --- /dev/null +++ b/jdk/make/sun/nio/cs/Makefile @@ -0,0 +1,112 @@ +# +# Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# +# Makefile for character converters. +# + +BUILDDIR = ../../.. + +# charsets should be separated from nio module +MODULE = charsets +PACKAGE = sun.nio +PRODUCT = sun + +# This re-directs all the class files to a separate location +CLASSDESTDIR = $(TEMPDIR)/classes + +OTHER_JAVACFLAGS += -Xlint:serial -Werror +include $(BUILDDIR)/common/Defs.gmk + +# +# Files +# +include FILES_java.gmk +AUTO_FILES_JAVA_DIRS = sun/nio/cs/ext + +# For Cygwin, command line arguments that are paths must be converted to +# windows style paths. These paths cannot be used as targets, however, because +# the ":" in them will interfere with GNU Make rules, generating "multiple +# target pattern" errors. + +# this define is for the rule: +CHARSETS_JAR = $(LIBDIR)/charsets.jar + +# extcs +FILES_genout_extcs = $(FILES_gen_extcs:%.java=$(GENSRCDIR)/%.java) + +# +# Rules +# +include $(BUILDDIR)/common/Classes.gmk + +build: $(FILES_genout_extcs) $(CHARSETS_JAR) + +# +# Extra rules to build character converters. + +SERVICE_DESCRIPTION = java.nio.charset.spi.CharsetProvider +SERVICE_DESCRIPTION_PATH = META-INF/services/$(SERVICE_DESCRIPTION) + +GENCSDATASRC = $(BUILDDIR)/tools/CharsetMapping +GENCSSRCDIR = $(BUILDDIR)/tools/src/build/tools/charsetmapping +GENCSEXT = $(GENSRCDIR)/sun/nio/cs/ext + +FILES_MAP = $(GENCSDATASRC)/sjis0213.map +FILES_DAT = $(CLASSDESTDIR)/sun/nio/cs/ext/sjis0213.dat +CHARSETMAPPING_JARFILE = $(BUILDTOOLJARDIR)/charsetmapping.jar + +$(FILES_DAT): $(FILES_MAP) + @$(prep-target) + $(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) \ + $(FILES_MAP) $(FILES_DAT) sjis0213 + + +$(FILES_genout_extcs): \ + $(GENCSDATASRC)/SingleByte-X.java.template \ + $(GENCSDATASRC)/DoubleByte-X.java.template \ + $(GENCSDATASRC)/extsbcs $(GENCSDATASRC)/dbcs + @$(prep-target) + $(RM) -r $(GENCSEXT) + $(MKDIR) -p $(GENCSEXT) + $(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) extsbcs + $(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) euctw \ + $(GENCSSRCDIR)/GenerateEUC_TW.java + $(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) dbcs + +$(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH): \ + $(SHARE_SRC)/classes/sun/nio/cs/ext/$(SERVICE_DESCRIPTION_PATH) + $(install-file) + +$(CHARSETS_JAR): $(FILES_class) $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH) $(FILES_DAT) + $(BOOT_JAR_CMD) cf0 $(CHARSETS_JAR) \ + -C $(CLASSDESTDIR) sun \ + -C $(CLASSDESTDIR) $(SERVICE_DESCRIPTION_PATH) \ + $(BOOT_JAR_JFLAGS) + @$(java-vm-cleanup) + +clean:: + $(RM) -r $(CLASSDESTDIR) + $(RM) $(CHARSETS_JAR) diff --git a/jdk/make/sun/org/Makefile b/jdk/make/sun/org/Makefile index 7d3496aa95b..ddfb2c5fcf5 100644 --- a/jdk/make/sun/org/Makefile +++ b/jdk/make/sun/org/Makefile @@ -32,6 +32,8 @@ PRODUCT = org include $(BUILDDIR)/common/Defs.gmk SUBDIRS = mozilla +include $(BUILDDIR)/common/Subdirs.gmk + all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/sun/org/mozilla/Makefile b/jdk/make/sun/org/mozilla/Makefile index 47f467f16ac..2eadf61de0c 100644 --- a/jdk/make/sun/org/mozilla/Makefile +++ b/jdk/make/sun/org/mozilla/Makefile @@ -32,6 +32,8 @@ PRODUCT = org include $(BUILDDIR)/common/Defs.gmk SUBDIRS = javascript +include $(BUILDDIR)/common/Subdirs.gmk + all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/sun/org/mozilla/javascript/Makefile b/jdk/make/sun/org/mozilla/javascript/Makefile index 2e74c02fdd5..1750fadc6cb 100644 --- a/jdk/make/sun/org/mozilla/javascript/Makefile +++ b/jdk/make/sun/org/mozilla/javascript/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../../../.. +MODULE = scripting-rhino PACKAGE = sun.org.mozilla.javascript.internal PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/sun/pisces/Makefile b/jdk/make/sun/pisces/Makefile index 3f3a3228b95..73f07f5090b 100644 --- a/jdk/make/sun/pisces/Makefile +++ b/jdk/make/sun/pisces/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../.. +MODULE = java2d PACKAGE = sun.pisces PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/sun/rmi/Makefile b/jdk/make/sun/rmi/Makefile index 59179b0c0f0..3acbd21de39 100644 --- a/jdk/make/sun/rmi/Makefile +++ b/jdk/make/sun/rmi/Makefile @@ -43,6 +43,8 @@ ifeq ($(PLATFORM), windows) SUBDIRS += cgi endif # PLATFORM +include $(BUILDDIR)/common/Subdirs.gmk + # Then do the rest all build clean clobber :: $(SUBDIRS-loop) diff --git a/jdk/make/sun/rmi/cgi/Makefile b/jdk/make/sun/rmi/cgi/Makefile index 0ed90ca2bd5..4b69bc0a523 100644 --- a/jdk/make/sun/rmi/cgi/Makefile +++ b/jdk/make/sun/rmi/cgi/Makefile @@ -28,6 +28,8 @@ # BUILDDIR = ../../.. +# java-rmi.cgi is a JDK tool +MODULE = tools PACKAGE = sun.rmi PRODUCT = sun PROGRAM = java-rmi diff --git a/jdk/make/sun/rmi/oldtools/Makefile b/jdk/make/sun/rmi/oldtools/Makefile index ad610ffca41..b59d4fcf077 100644 --- a/jdk/make/sun/rmi/oldtools/Makefile +++ b/jdk/make/sun/rmi/oldtools/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../../.. +MODULE = oldjavac PRODUCT = oldjavac include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/sun/rmi/registry/Makefile b/jdk/make/sun/rmi/registry/Makefile index c5254a7f3c9..bfb6cb55ed8 100644 --- a/jdk/make/sun/rmi/registry/Makefile +++ b/jdk/make/sun/rmi/registry/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../../.. +MODULE = rmi PACKAGE = sun.rmi.registry PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk @@ -48,3 +49,7 @@ RESOURCE_BUNDLES_UNCOMPILED_PROPERTIES = $(PKGDIR)/resources/rmiregistry.propert # include $(BUILDDIR)/common/Classes.gmk +build: rmiregistry + +rmiregistry: + $(call make-launcher, rmiregistry, sun.rmi.registry.RegistryImpl, , ) diff --git a/jdk/make/sun/rmi/rmi/Makefile b/jdk/make/sun/rmi/rmi/Makefile index c351d87f0eb..844f51bcc34 100644 --- a/jdk/make/sun/rmi/rmi/Makefile +++ b/jdk/make/sun/rmi/rmi/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../../.. +MODULE = rmi PACKAGE = sun.rmi PRODUCT = sun LIBRARY = rmi @@ -124,7 +125,7 @@ bin: $(BINDIR)/java-rmi.cgi $(BINDIR)/java-rmi.cgi: $(PLATFORM_SRC)/bin/java-rmi.cgi.sh $(install-file) - $(CHMOD) a+x $@ + $(call chmod-file, a+x) bin.clean: $(RM) $(BINDIR)/java-rmi.cgi diff --git a/jdk/make/sun/rmi/rmic/Makefile b/jdk/make/sun/rmi/rmic/Makefile index a09a170f86f..ae73a2d28e3 100644 --- a/jdk/make/sun/rmi/rmic/Makefile +++ b/jdk/make/sun/rmi/rmic/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../../.. +MODULE = rmic PACKAGE = sun.rmi.rmic PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/sun/rmi/rmid/Makefile b/jdk/make/sun/rmi/rmid/Makefile index 845b103220d..23f223ec66b 100644 --- a/jdk/make/sun/rmi/rmid/Makefile +++ b/jdk/make/sun/rmi/rmid/Makefile @@ -29,11 +29,12 @@ # BUILDDIR = ../../.. +MODULE = rmi-activation PACKAGE = sun.rmi.activation PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk -build: stubs +build: stubs rmid # # Resources @@ -75,4 +76,5 @@ stubs: $(FILES_stubs) # include $(BUILDDIR)/common/Classes.gmk - +rmid: + $(call make-launcher, rmid, sun.rmi.server.Activation, , ) diff --git a/jdk/make/sun/security/Makefile b/jdk/make/sun/security/Makefile index 92371cc60cb..1950c892623 100644 --- a/jdk/make/sun/security/Makefile +++ b/jdk/make/sun/security/Makefile @@ -67,8 +67,10 @@ ifdef DISABLE_INTREE_EC INTREE_EC = endif -SUBDIRS = $(INTREE_EC) other action util tools jgss krb5 smartcardio \ - $(PKCS11) $(JGSS_WRAPPER) $(MSCAPI) +SUBDIRS = $(INTREE_EC) other action util krb5 +SUBDIRS_misc = jgss $(PKCS11) $(JGSS_WRAPPER) $(MSCAPI) smartcardio +SUBDIRS_tools = tools +include $(BUILDDIR)/common/Subdirs.gmk all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/make/sun/security/ec/Makefile b/jdk/make/sun/security/ec/Makefile index 53a3e3e9e51..95b9e8d30d6 100644 --- a/jdk/make/sun/security/ec/Makefile +++ b/jdk/make/sun/security/ec/Makefile @@ -89,6 +89,7 @@ # BUILDDIR = ../../.. +MODULE = security-sunec PACKAGE = sun.security.ec PRODUCT = sun @@ -308,7 +309,7 @@ $(JAR_DESTFILE): $(UNSIGNED_DIR)/sunec.jar else $(JAR_DESTFILE): $(SIGNED_DIR)/sunec.jar endif - $(install-file) + $(install-non-module-file) ifndef OPENJDK install-prebuilt: diff --git a/jdk/make/sun/security/jgss/wrapper/Makefile b/jdk/make/sun/security/jgss/wrapper/Makefile index f5b75dbeb48..8be00aa6c20 100644 --- a/jdk/make/sun/security/jgss/wrapper/Makefile +++ b/jdk/make/sun/security/jgss/wrapper/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../../../.. +MODULE = security-kerberos PACKAGE = sun.security.jgss.wrapper PRODUCT = sun diff --git a/jdk/make/sun/security/krb5/Makefile b/jdk/make/sun/security/krb5/Makefile index aac29eb5611..c835666ea9e 100644 --- a/jdk/make/sun/security/krb5/Makefile +++ b/jdk/make/sun/security/krb5/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../../.. +MODULE = security-kerberos PACKAGE = sun.security.krb5 PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk @@ -77,3 +78,10 @@ ifeq ($(PLATFORM), windows) else OTHER_LDLIBS = -ldl $(JVMLIB) endif + +build: +ifeq ($(PLATFORM),windows) + $(call make-launcher, kinit, sun.security.krb5.internal.tools.Kinit, , ) + $(call make-launcher, klist, sun.security.krb5.internal.tools.Klist, , ) + $(call make-launcher, ktab, sun.security.krb5.internal.tools.Ktab, , ) +endif diff --git a/jdk/make/sun/security/mscapi/Makefile b/jdk/make/sun/security/mscapi/Makefile index c16d130504f..2cc8ea53614 100644 --- a/jdk/make/sun/security/mscapi/Makefile +++ b/jdk/make/sun/security/mscapi/Makefile @@ -89,6 +89,7 @@ # BUILDDIR = ../../.. +MODULE = security-sunmscapi PACKAGE = sun.security.mscapi LIBRARY = sunmscapi PRODUCT = sun @@ -271,7 +272,7 @@ $(JAR_DESTFILE): $(UNSIGNED_DIR)/sunmscapi.jar else $(JAR_DESTFILE): $(SIGNED_DIR)/sunmscapi.jar endif - $(install-file) + $(install-non-module-file) ifndef OPENJDK install-prebuilt: diff --git a/jdk/make/sun/security/pkcs11/Makefile b/jdk/make/sun/security/pkcs11/Makefile index 9a4a4089be4..f4be8d7a507 100644 --- a/jdk/make/sun/security/pkcs11/Makefile +++ b/jdk/make/sun/security/pkcs11/Makefile @@ -89,6 +89,7 @@ # BUILDDIR = ../../.. +MODULE = security-sunpkcs11 PACKAGE = sun.security.pkcs11 LIBRARY = j2pkcs11 PRODUCT = sun @@ -161,6 +162,16 @@ else OTHER_LDLIBS = -ldl $(JVMLIB) endif +# Other config files +SUNPKCS11_CFG = + +ifeq ($(PLATFORM), solaris) +SUNPKCS11_CFG = sunpkcs11-cfg +endif # PLATFORM + +SUNPKCS11_CFG_SRC = $(TOPDIR)/src/share/lib/security/sunpkcs11-solaris.cfg +SUNPKCS11_CFG_BUILD = $(LIBDIR)/security/sunpkcs11-solaris.cfg + # # We use a variety of subdirectories in the $(TEMPDIR) depending on what # part of the build we're doing. Both OPENJDK/JDK builds are initially @@ -174,12 +185,17 @@ UNSIGNED_DIR = $(TEMPDIR)/unsigned # ifdef OPENJDK -all: build-jar install-jar +all: $(SUNPKCS11_CFG) build-jar install-jar else -all: build-jar install-prebuilt +all: $(SUNPKCS11_CFG) build-jar install-prebuilt $(build-warning) endif +sunpkcs11-cfg: $(SUNPKCS11_CFG_BUILD) + +$(SUNPKCS11_CFG_BUILD): $(SUNPKCS11_CFG_SRC) + $(install-file) + include $(BUILDDIR)/javax/crypto/Defs-jce.gmk @@ -271,7 +287,7 @@ $(JAR_DESTFILE): $(UNSIGNED_DIR)/sunpkcs11.jar else $(JAR_DESTFILE): $(SIGNED_DIR)/sunpkcs11.jar endif - $(install-file) + $(install-non-module-file) ifndef OPENJDK install-prebuilt: @@ -287,6 +303,7 @@ endif clobber clean:: $(RM) -r $(JAR_DESTFILE) $(TEMPDIR) $(JCE_BUILD_DIR) + $(RM) $(SUNPKCS11_CFG_BUILD) .PHONY: build-jar jar install-jar ifndef OPENJDK diff --git a/jdk/make/sun/security/smartcardio/Makefile b/jdk/make/sun/security/smartcardio/Makefile index 55686411967..097cd40c7a9 100644 --- a/jdk/make/sun/security/smartcardio/Makefile +++ b/jdk/make/sun/security/smartcardio/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../../.. +MODULE = security-smartcardio PACKAGE = sun.security.smartcardio LIBRARY = j2pcsc PRODUCT = sun diff --git a/jdk/make/sun/security/tools/Makefile b/jdk/make/sun/security/tools/Makefile index 0a8ffabe15c..3380d20e6d8 100644 --- a/jdk/make/sun/security/tools/Makefile +++ b/jdk/make/sun/security/tools/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../../.. +MODULE = security-tools PACKAGE = sun.security.tools PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk @@ -44,3 +45,7 @@ RESOURCE_BUNDLES_JAVA = sun/security/tools/JarSignerResources.java # include $(BUILDDIR)/common/Classes.gmk +build: + $(call make-launcher, keytool, sun.security.tools.KeyTool, , ) + $(call make-launcher, policytool, sun.security.tools.PolicyTool, , ) + diff --git a/jdk/make/sun/serialver/Makefile b/jdk/make/sun/serialver/Makefile index 0906d3e3e14..29c3cceba48 100644 --- a/jdk/make/sun/serialver/Makefile +++ b/jdk/make/sun/serialver/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../.. +MODULE = serialver PACKAGE = sun.tools.serialver PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/sun/splashscreen/Makefile b/jdk/make/sun/splashscreen/Makefile index 305df2fc2e0..65b3fc388cc 100644 --- a/jdk/make/sun/splashscreen/Makefile +++ b/jdk/make/sun/splashscreen/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../.. +MODULE = awt PACKAGE = sun.awt LIBRARY = splashscreen PRODUCT = sun diff --git a/jdk/make/sun/text/Makefile b/jdk/make/sun/text/Makefile index 37b8522156a..005587df7a1 100644 --- a/jdk/make/sun/text/Makefile +++ b/jdk/make/sun/text/Makefile @@ -29,6 +29,7 @@ BUILDDIR = ../.. +MODULE = localedata PACKAGE = sun.text PRODUCT = sun diff --git a/jdk/make/sun/tools/Makefile b/jdk/make/sun/tools/Makefile index 3c4d4c98d7d..a6e926daf40 100644 --- a/jdk/make/sun/tools/Makefile +++ b/jdk/make/sun/tools/Makefile @@ -28,6 +28,7 @@ # BUILDDIR = ../.. +MODULE = tools PACKAGE = sun.tools PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk diff --git a/jdk/make/sun/tracing/Makefile b/jdk/make/sun/tracing/Makefile index 5c3711f0054..f9f4439cdeb 100644 --- a/jdk/make/sun/tracing/Makefile +++ b/jdk/make/sun/tracing/Makefile @@ -33,6 +33,8 @@ PRODUCT = sun include $(BUILDDIR)/common/Defs.gmk SUBDIRS = dtrace +include $(BUILDDIR)/common/Subdirs.gmk + all build: $(SUBDIRS-loop) clean clobber:: diff --git a/jdk/make/sun/tracing/dtrace/Makefile b/jdk/make/sun/tracing/dtrace/Makefile index cf0dc9a978f..16f09e71978 100644 --- a/jdk/make/sun/tracing/dtrace/Makefile +++ b/jdk/make/sun/tracing/dtrace/Makefile @@ -27,6 +27,7 @@ # Makefile for building dtrace extension # BUILDDIR = ../../.. +MODULE = tracing PACKAGE = sun.tracing.dtrace LIBRARY = jsdt PRODUCT = sun diff --git a/jdk/make/sun/xawt/Makefile b/jdk/make/sun/xawt/Makefile index 3cb408d9907..f9636cd3e66 100644 --- a/jdk/make/sun/xawt/Makefile +++ b/jdk/make/sun/xawt/Makefile @@ -24,6 +24,7 @@ # BUILDDIR = ../.. +MODULE = awt PACKAGE = sun.awt.X11 LIBRARY = mawt LIBRARY_OUTPUT = xawt diff --git a/jdk/make/sun/xawt/mapfile-vers b/jdk/make/sun/xawt/mapfile-vers index d880ebb4f77..82fe94f63ec 100644 --- a/jdk/make/sun/xawt/mapfile-vers +++ b/jdk/make/sun/xawt/mapfile-vers @@ -126,6 +126,8 @@ SUNWprivate_1.1 { Java_sun_awt_X11_XlibWrapper_ServerVendor; Java_sun_awt_X11_XlibWrapper_VendorRelease; Java_sun_awt_X11_XlibWrapper_IsXsunKPBehavior; + Java_sun_awt_X11_XlibWrapper_IsSunKeyboard; + Java_sun_awt_X11_XlibWrapper_IsKanaKeyboard; Java_sun_awt_X11_XlibWrapper_SetToolkitErrorHandler; Java_sun_awt_X11_XlibWrapper_XSetErrorHandler; Java_sun_awt_X11_XlibWrapper_CallErrorHandler; @@ -306,6 +308,7 @@ SUNWprivate_1.1 { Java_sun_awt_X11_XlibWrapper_XkbTranslateKeyCode; Java_sun_awt_X11_XlibWrapper_XGetModifierMapping; Java_sun_awt_X11_XlibWrapper_XFreeModifiermap; + Java_sun_awt_X11_XlibWrapper_XRefreshKeyboardMapping; Java_sun_awt_X11_XlibWrapper_XChangeActivePointerGrab; Java_sun_awt_X11_XlibWrapper_XNextSecondaryLoopEvent; Java_sun_awt_X11_XlibWrapper_ExitSecondaryLoop; diff --git a/jdk/make/tools/Makefile b/jdk/make/tools/Makefile index d92550cdd95..24c0fb19cb6 100644 --- a/jdk/make/tools/Makefile +++ b/jdk/make/tools/Makefile @@ -56,6 +56,8 @@ ifndef DISABLE_NIMBUS SUBDIRS += generate_nimbus endif +include $(BUILDDIR)/common/Subdirs.gmk + all build clean clobber:: $(SUBDIRS-loop) diff --git a/jdk/src/share/bin/java.c b/jdk/src/share/bin/java.c index 2494ce1ea2e..8f9d2edee1c 100644 --- a/jdk/src/share/bin/java.c +++ b/jdk/src/share/bin/java.c @@ -93,6 +93,7 @@ static int numOptions, maxOptions; * Prototypes for functions internal to launcher. */ static void SetClassPath(const char *s); +static void SetModulesBootClassPath(const char *s); static void SelectVersion(int argc, char **argv, char **main_class); static jboolean ParseArguments(int *pargc, char ***pargv, char **pjarfile, char **pclassname, int *pret, const char *jvmpath); @@ -277,6 +278,9 @@ JLI_Launch(int argc, char ** argv, /* main argc, argc */ return(ret); } + /* Set bootclasspath for modules */ + SetModulesBootClassPath(jrepath); + /* Override class path if -jar flag was specified */ if (jarfile != 0) { SetClassPath(jarfile); @@ -693,6 +697,44 @@ SetClassPath(const char *s) JLI_MemFree((char *) s); } +/* + * Set the bootclasspath for modules. + * A temporary workaround until jigsaw is integrated into JDK 7. + */ +static void +SetModulesBootClassPath(const char *jrepath) +{ + char *def, *s; + char pathname[MAXPATHLEN]; + const char separator[] = { FILE_SEPARATOR, '\0' }; + const char *orig = jrepath; + static const char format[] = "-Xbootclasspath/p:%s"; + struct stat statbuf; + + /* return if jre/lib/rt.jar exists */ + sprintf(pathname, "%s%slib%srt.jar", jrepath, separator, separator); + if (stat(pathname, &statbuf) == 0) { + return; + } + + /* return if jre/classes exists */ + sprintf(pathname, "%s%sclasses", jrepath, separator); + if (stat(pathname, &statbuf) == 0) { + return; + } + + /* modularized jre */ + sprintf(pathname, "%s%slib%s*", jrepath, separator, separator); + s = (char *) JLI_WildcardExpandClasspath(pathname); + def = JLI_MemAlloc(sizeof(format) + - 2 /* strlen("%s") */ + + JLI_StrLen(s)); + sprintf(def, format, s); + AddOption(def, NULL); + if (s != orig) + JLI_MemFree((char *) s); +} + /* * The SelectVersion() routine ensures that an appropriate version of * the JRE is running. The specification for the appropriate version diff --git a/jdk/src/share/classes/com/sun/beans/WeakCache.java b/jdk/src/share/classes/com/sun/beans/WeakCache.java index 461c48e1fd3..3aa6373dc46 100644 --- a/jdk/src/share/classes/com/sun/beans/WeakCache.java +++ b/jdk/src/share/classes/com/sun/beans/WeakCache.java @@ -81,4 +81,11 @@ public final class WeakCache { this.map.remove(key); } } + + /** + * Removes all of the mappings from this cache. + */ + public void clear() { + this.map.clear(); + } } diff --git a/jdk/src/share/classes/com/sun/crypto/provider/HmacCore.java b/jdk/src/share/classes/com/sun/crypto/provider/HmacCore.java index 87d9e04bc0e..5592a3e2a55 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/HmacCore.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/HmacCore.java @@ -36,7 +36,7 @@ import java.security.spec.*; /** * This class constitutes the core of HMAC- algorithms, where - * can be SHA1 or MD5, etc. + * can be SHA1 or MD5, etc. See RFC 2104 for spec. * * It also contains the implementation classes for the SHA-256, * SHA-384, and SHA-512 HMACs. @@ -116,7 +116,7 @@ final class HmacCore implements Cloneable { } byte[] secret = key.getEncoded(); - if (secret == null || secret.length == 0) { + if (secret == null) { throw new InvalidKeyException("Missing key data"); } diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java b/jdk/src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java index 2613a025e40..90ed410b831 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,21 +25,19 @@ package com.sun.crypto.provider; -import java.io.*; +import java.io.ObjectStreamException; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; import java.util.Arrays; import java.security.KeyRep; import java.security.GeneralSecurityException; -import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.security.spec.InvalidKeySpecException; import javax.crypto.Mac; import javax.crypto.SecretKey; import javax.crypto.spec.PBEKeySpec; -import javax.crypto.spec.SecretKeySpec; /** * This class represents a PBE key derived using PBKDF2 defined @@ -123,7 +121,7 @@ final class PBKDF2KeyImpl implements javax.crypto.interfaces.PBEKey { this.key = deriveKey(prf, passwdBytes, salt, iterCount, keyLength); } - private static byte[] deriveKey(Mac prf, byte[] password, byte[] salt, + private static byte[] deriveKey(final Mac prf, final byte[] password, byte[] salt, int iterCount, int keyLengthInBit) { int keyLength = keyLengthInBit/8; byte[] key = new byte[keyLength]; @@ -133,7 +131,34 @@ final class PBKDF2KeyImpl implements javax.crypto.interfaces.PBEKey { int intR = keyLength - (intL - 1)*hlen; // residue byte[] ui = new byte[hlen]; byte[] ti = new byte[hlen]; - SecretKey macKey = new SecretKeySpec(password, prf.getAlgorithm()); + // SecretKeySpec cannot be used, since password can be empty here. + SecretKey macKey = new SecretKey() { + @Override + public String getAlgorithm() { + return prf.getAlgorithm(); + } + @Override + public String getFormat() { + return "RAW"; + } + @Override + public byte[] getEncoded() { + return password; + } + @Override + public int hashCode() { + return Arrays.hashCode(password) * 41 + + prf.getAlgorithm().toLowerCase().hashCode(); + } + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (this.getClass() != obj.getClass()) return false; + SecretKey sk = (SecretKey)obj; + return prf.getAlgorithm().equalsIgnoreCase(sk.getAlgorithm()) && + Arrays.equals(password, sk.getEncoded()); + } + }; prf.init(macKey); byte[] ibytes = new byte[4]; @@ -230,7 +255,7 @@ final class PBKDF2KeyImpl implements javax.crypto.interfaces.PBEKey { * @throws ObjectStreamException if a new object representing * this PBE key could not be created */ - private Object writeReplace() throws java.io.ObjectStreamException { + private Object writeReplace() throws ObjectStreamException { return new KeyRep(KeyRep.Type.SECRET, getAlgorithm(), getFormat(), getEncoded()); } diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java index 58d61dc909a..c29f69a1765 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java @@ -24,7 +24,6 @@ */ package com.sun.java.swing.plaf.gtk; -import sun.swing.plaf.synth.SynthUI; import sun.awt.UNIXToolkit; import javax.swing.plaf.synth.*; diff --git a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java index dedf1da5ab5..d472bbbe51d 100644 --- a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java +++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageReader.java @@ -27,7 +27,6 @@ package com.sun.java.util.jar.pack; import java.io.*; import java.util.*; -import java.util.logging.Level; import com.sun.java.util.jar.pack.Package.Class; import com.sun.java.util.jar.pack.Package.File; import com.sun.java.util.jar.pack.Package.InnerClass; @@ -162,7 +161,7 @@ class PackageReader extends BandStructure { ok = true; } catch (Exception ee) { - Utils.log.log(Level.WARNING, "Error on input: "+ee, ee); + Utils.log.warning("Error on input: "+ee, ee); if (verbose > 0) Utils.log.info("Stream offsets:"+ " served="+in.getBytesServed()+ diff --git a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java index a93cc293d23..2128c93cf3c 100644 --- a/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java +++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/PackageWriter.java @@ -27,7 +27,6 @@ package com.sun.java.util.jar.pack; import java.io.*; import java.util.*; -import java.util.logging.Level; import com.sun.java.util.jar.pack.Package.Class; import com.sun.java.util.jar.pack.Package.File; import com.sun.java.util.jar.pack.Package.InnerClass; @@ -84,7 +83,7 @@ class PackageWriter extends BandStructure { ok = true; } catch (Exception ee) { - Utils.log.log(Level.WARNING, "Error on output: "+ee, ee); + Utils.log.warning("Error on output: "+ee, ee); //if (verbose > 0) ee.printStackTrace(); // Write partial output only if we are verbose. if (verbose > 0) finalOut.close(); diff --git a/jdk/src/share/classes/com/sun/java/util/jar/pack/Utils.java b/jdk/src/share/classes/com/sun/java/util/jar/pack/Utils.java index c595e799a40..f33828fe261 100644 --- a/jdk/src/share/classes/com/sun/java/util/jar/pack/Utils.java +++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/Utils.java @@ -28,9 +28,10 @@ package com.sun.java.util.jar.pack; import java.util.*; import java.util.jar.*; import java.util.zip.*; -import java.util.logging.*; import java.io.*; +import sun.util.logging.PlatformLogger; + class Utils { static final String COM_PREFIX = "com.sun.java.util.jar.pack."; static final String METAINF = "META-INF"; @@ -130,31 +131,53 @@ class Utils { = Boolean.getBoolean(Utils.COM_PREFIX+"nolog"); - static final Logger log - = new Logger("java.util.jar.Pack200", null) { - public void log(LogRecord record) { - int verbose = currentPropMap().getInteger(DEBUG_VERBOSE); - if (verbose > 0) { - if (nolog && - record.getLevel().intValue() < Level.WARNING.intValue()) { - System.out.println(record.getMessage()); - } else { - super.log(record); - } - } - } + static class Pack200Logger { + private final String name; + private PlatformLogger log; + Pack200Logger(String name) { + this.name = name; + } - public void fine(String msg) { - int verbose = currentPropMap().getInteger(DEBUG_VERBOSE); - if (verbose > 0) { - System.out.println(msg); + private synchronized PlatformLogger getLogger() { + if (log == null) { + log = PlatformLogger.getLogger(name); + } + return log; + } + + public void warning(String msg, Object param) { + int verbose = currentPropMap().getInteger(DEBUG_VERBOSE); + if (verbose > 0) { + getLogger().warning(msg, param); + } + } + + public void warning(String msg) { + warning(msg, null); + } + + public void info(String msg) { + int verbose = currentPropMap().getInteger(DEBUG_VERBOSE); + if (verbose > 0) { + if (nolog) { + System.out.println(msg); + } else { + getLogger().info(msg); } } - }; - static { - LogManager.getLogManager().addLogger(log); + } + + public void fine(String msg) { + int verbose = currentPropMap().getInteger(DEBUG_VERBOSE); + if (verbose > 0) { + System.out.println(msg); + } + } } + static final Pack200Logger log + = new Pack200Logger("java.util.jar.Pack200"); + // Returns the Max Version String of this implementation static String getVersionString() { return "Pack200, Vendor: Sun Microsystems, Version: " + diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/Filter.java b/jdk/src/share/classes/com/sun/jndi/ldap/Filter.java index 17f5eb22038..1dfc46c2431 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/Filter.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/Filter.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ import java.io.IOException; /** * LDAP (RFC-1960) and LDAPv3 (RFC-2254) search filters. * + * @author Xuelei Fan * @author Vincent Ryan * @author Jagane Sundar * @author Rosanna Lee @@ -258,7 +259,7 @@ final class Filter { byte[] answer = new byte[j]; System.arraycopy(tbuf, 0, answer, 0, j); if (dbg) { - Ber.dumpBER(System.err, null, answer, 0, j); + Ber.dumpBER(System.err, "", answer, 0, j); } return answer; } @@ -330,7 +331,7 @@ final class Filter { } - valueStart = eq + 1; // value starts after equal sign + valueStart = eq + 1; // value starts after equal sign valueEnd = filtEnd; typeStart = filtStart; // beginning of string @@ -355,20 +356,199 @@ final class Filter { break; default: typeEnd = eq; + //initializing ftype to make the compiler happy + ftype = 0x00; + break; + } + + if (dbg) { + System.err.println("type: " + typeStart + ", " + typeEnd); + System.err.println("value: " + valueStart + ", " + valueEnd); + } + + // check validity of type + // + // RFC4512 defines the type as the following ABNF: + // attr = attributedescription + // attributedescription = attributetype options + // attributetype = oid + // oid = descr / numericoid + // descr = keystring + // keystring = leadkeychar *keychar + // leadkeychar = ALPHA + // keychar = ALPHA / DIGIT / HYPHEN + // numericoid = number 1*( DOT number ) + // number = DIGIT / ( LDIGIT 1*DIGIT ) + // options = *( SEMI option ) + // option = 1*keychar + // + // And RFC4515 defines the extensible type as the following ABNF: + // attr [dnattrs] [matchingrule] / [dnattrs] matchingrule + int optionsStart = -1; + int extensibleStart = -1; + if ((filter[typeStart] >= '0' && filter[typeStart] <= '9') || + (filter[typeStart] >= 'A' && filter[typeStart] <= 'Z') || + (filter[typeStart] >= 'a' && filter[typeStart] <= 'z')) { + + boolean isNumericOid = + filter[typeStart] >= '0' && filter[typeStart] <= '9'; + for (int i = typeStart + 1; i < typeEnd; i++) { + // ';' is an indicator of attribute options + if (filter[i] == ';') { + if (isNumericOid && filter[i - 1] == '.') { + throw new InvalidSearchFilterException( + "invalid attribute description"); + } + + // attribute options + optionsStart = i; + break; + } + + // ':' is an indicator of extensible rules + if (filter[i] == ':' && ftype == LDAP_FILTER_EXT) { + if (isNumericOid && filter[i - 1] == '.') { + throw new InvalidSearchFilterException( + "invalid attribute description"); + } + + // extensible matching + extensibleStart = i; + break; + } + + if (isNumericOid) { + // numeric object identifier + if ((filter[i] == '.' && filter[i - 1] == '.') || + (filter[i] != '.' && + !(filter[i] >= '0' && filter[i] <= '9'))) { + throw new InvalidSearchFilterException( + "invalid attribute description"); + } + } else { + // descriptor + if (filter[i] != '-' && + !(filter[i] >= '0' && filter[i] <= '9') && + !(filter[i] >= 'A' && filter[i] <= 'Z') && + !(filter[i] >= 'a' && filter[i] <= 'z')) { + throw new InvalidSearchFilterException( + "invalid attribute description"); + } + } + } + } else if (ftype == LDAP_FILTER_EXT && filter[typeStart] == ':') { + // extensible matching + extensibleStart = typeStart; + } else { + throw new InvalidSearchFilterException( + "invalid attribute description"); + } + + // check attribute options + if (optionsStart > 0) { + for (int i = optionsStart + 1; i < typeEnd; i++) { + if (filter[i] == ';') { + if (filter[i - 1] == ';') { + throw new InvalidSearchFilterException( + "invalid attribute description"); + } + continue; + } + + // ':' is an indicator of extensible rules + if (filter[i] == ':' && ftype == LDAP_FILTER_EXT) { + if (filter[i - 1] == ';') { + throw new InvalidSearchFilterException( + "invalid attribute description"); + } + + // extensible matching + extensibleStart = i; + break; + } + + if (filter[i] != '-' && + !(filter[i] >= '0' && filter[i] <= '9') && + !(filter[i] >= 'A' && filter[i] <= 'Z') && + !(filter[i] >= 'a' && filter[i] <= 'z')) { + throw new InvalidSearchFilterException( + "invalid attribute description"); + } + } + } + + // check extensible matching + if (extensibleStart > 0) { + boolean isMatchingRule = false; + for (int i = extensibleStart + 1; i < typeEnd; i++) { + if (filter[i] == ':') { + throw new InvalidSearchFilterException( + "invalid attribute description"); + } else if ((filter[i] >= '0' && filter[i] <= '9') || + (filter[i] >= 'A' && filter[i] <= 'Z') || + (filter[i] >= 'a' && filter[i] <= 'z')) { + boolean isNumericOid = filter[i] >= '0' && filter[i] <= '9'; + i++; + for (int j = i; j < typeEnd; j++, i++) { + // allows no more than two extensible rules + if (filter[j] == ':') { + if (isMatchingRule) { + throw new InvalidSearchFilterException( + "invalid attribute description"); + } + if (isNumericOid && filter[j - 1] == '.') { + throw new InvalidSearchFilterException( + "invalid attribute description"); + } + + isMatchingRule = true; + break; + } + + if (isNumericOid) { + // numeric object identifier + if ((filter[j] == '.' && filter[j - 1] == '.') || + (filter[j] != '.' && + !(filter[j] >= '0' && filter[j] <= '9'))) { + throw new InvalidSearchFilterException( + "invalid attribute description"); + } + } else { + // descriptor + if (filter[j] != '-' && + !(filter[j] >= '0' && filter[j] <= '9') && + !(filter[j] >= 'A' && filter[j] <= 'Z') && + !(filter[j] >= 'a' && filter[j] <= 'z')) { + throw new InvalidSearchFilterException( + "invalid attribute description"); + } + } + } + } else { + throw new InvalidSearchFilterException( + "invalid attribute description"); + } + } + } + + // ensure the latest byte is not isolated + if (filter[typeEnd - 1] == '.' || filter[typeEnd - 1] == ';' || + filter[typeEnd - 1] == ':') { + throw new InvalidSearchFilterException( + "invalid attribute description"); + } + + if (typeEnd == eq) { // filter type is of "equal" if (findUnescaped(filter, '*', valueStart, valueEnd) == -1) { ftype = LDAP_FILTER_EQUALITY; - } else if (filter[valueStart] == '*' && valueStart == (valueEnd - 1)) { + } else if (filter[valueStart] == '*' && + valueStart == (valueEnd - 1)) { ftype = LDAP_FILTER_PRESENT; } else { encodeSubstringFilter(ber, filter, typeStart, typeEnd, valueStart, valueEnd); return; } - break; - } - if (dbg) { - System.err.println("type: " + typeStart + ", " + typeEnd); - System.err.println("value: " + valueStart + ", " + valueEnd); } if (ftype == LDAP_FILTER_PRESENT) { @@ -379,7 +559,7 @@ final class Filter { } else { ber.beginSeq(ftype); ber.encodeOctetString(filter, Ber.ASN_OCTET_STR, - typeStart, typeEnd-typeStart); + typeStart, typeEnd - typeStart); ber.encodeOctetString( unescapeFilterValue(filter, valueStart, valueEnd), Ber.ASN_OCTET_STR); @@ -623,7 +803,8 @@ final class Filter { // //////////////////////////////////////////////////////////////////////////// - private static final boolean dbg = false; + // private static final boolean dbg = false; + private static final boolean dbg = true; private static int dbgIndent = 0; private static void dprint(String msg) { diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java b/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java index 00cdf1ee6a7..b56aea82e42 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java @@ -33,10 +33,10 @@ import java.lang.reflect.InvocationTargetException; import java.util.Hashtable; import java.util.Properties; import java.util.Enumeration; -import java.applet.Applet; import org.omg.CORBA.ORB; +import javax.naming.Context; import javax.naming.ConfigurationException; /** @@ -191,16 +191,48 @@ public class CorbaUtils { } // Get Applet from environment - Applet applet = null; if (env != null) { - applet = (Applet) env.get("java.naming.applet"); + Object applet = env.get(Context.APPLET); + if (applet != null) { + // Create ORBs for an applet + return initAppletORB(applet, orbProp); + } } - // Create ORBs using applet and orbProp - if (applet != null) { - return ORB.init(applet, orbProp); - } else { - return ORB.init(new String[0], orbProp); + // Create ORBs using orbProp for a standalone application + return ORB.init(new String[0], orbProp); + } + + /** + * This method returns a new ORB instance for the given applet + * without creating a static dependency on java.applet. + */ + private static ORB initAppletORB(Object applet, Properties orbProp) { + try { + Class appletClass = Class.forName("java.applet.Applet", true, null); + if (!appletClass.isInstance(applet)) { + throw new ClassCastException(applet.getClass().getName()); + } + + // invoke the static method ORB.init(applet, orbProp); + Method method = ORB.class.getMethod("init", appletClass, Properties.class); + return (ORB) method.invoke(null, applet, orbProp); + } catch (ClassNotFoundException e) { + // java.applet.Applet doesn't exist and the applet parameter is + // non-null; so throw CCE + throw new ClassCastException(applet.getClass().getName()); + } catch (NoSuchMethodException e) { + throw new AssertionError(e); + } catch (InvocationTargetException e) { + Throwable cause = e.getCause(); + if (cause instanceof RuntimeException) { + throw (RuntimeException) cause; + } else if (cause instanceof Error) { + throw (Error) cause; + } + throw new AssertionError(e); + } catch (IllegalAccessException iae) { + throw new AssertionError(iae); } } diff --git a/jdk/src/share/classes/com/sun/media/sound/MidiDeviceReceiver.java b/jdk/src/share/classes/com/sun/media/sound/MidiDeviceReceiver.java new file mode 100644 index 00000000000..60bca739318 --- /dev/null +++ b/jdk/src/share/classes/com/sun/media/sound/MidiDeviceReceiver.java @@ -0,0 +1,41 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +package com.sun.media.sound; + +import javax.sound.midi.MidiDevice; +import javax.sound.midi.Receiver; + +/** + * A Receiver with reference to it's MidiDevice object. + * + * @author Karl Helgason + */ +public interface MidiDeviceReceiver extends Receiver { + + /** Obtains the MidiDevice object associated with this Receiver. + */ + public MidiDevice getMidiDevice(); + +} diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftAudioBuffer.java b/jdk/src/share/classes/com/sun/media/sound/SoftAudioBuffer.java index ccc94899f61..fc3bb4c7322 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftAudioBuffer.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftAudioBuffer.java @@ -48,6 +48,30 @@ public class SoftAudioBuffer { converter = AudioFloatConverter.getConverter(format); } + public void swap(SoftAudioBuffer swap) + { + int bak_size = size; + float[] bak_buffer = buffer; + boolean bak_empty = empty; + AudioFormat bak_format = format; + AudioFloatConverter bak_converter = converter; + byte[] bak_converter_buffer = converter_buffer; + + size = swap.size; + buffer = swap.buffer; + empty = swap.empty; + format = swap.format; + converter = swap.converter; + converter_buffer = swap.converter_buffer; + + swap.size = bak_size; + swap.buffer = bak_buffer; + swap.empty = bak_empty; + swap.format = bak_format; + swap.converter = bak_converter; + swap.converter_buffer = bak_converter_buffer; + } + public AudioFormat getFormat() { return format; } diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftChannel.java b/jdk/src/share/classes/com/sun/media/sound/SoftChannel.java index 96a575f2c8e..dcd04ed54ac 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftChannel.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftChannel.java @@ -218,6 +218,15 @@ public class SoftChannel implements MidiChannel, ModelDirectedPlayer { } private int findFreeVoice(int x) { + if(x == -1) + { + // x = -1 means that there where no available voice + // last time we called findFreeVoice + // and it hasn't changed because no audio has been + // rendered in the meantime. + // Therefore we have to return -1. + return -1; + } for (int i = x; i < voices.length; i++) if (!voices[i].active) return i; @@ -328,7 +337,7 @@ public class SoftChannel implements MidiChannel, ModelDirectedPlayer { } protected void initVoice(SoftVoice voice, SoftPerformer p, int voiceID, - int noteNumber, int velocity, ModelConnectionBlock[] connectionBlocks, + int noteNumber, int velocity, int delay, ModelConnectionBlock[] connectionBlocks, ModelChannelMixer channelmixer, boolean releaseTriggered) { if (voice.active) { // Voice is active , we must steal the voice @@ -363,7 +372,7 @@ public class SoftChannel implements MidiChannel, ModelDirectedPlayer { voice.objects.put("midi_cc", co_midi_cc); voice.objects.put("midi_rpn", co_midi_rpn); voice.objects.put("midi_nrpn", co_midi_nrpn); - voice.noteOn(noteNumber, velocity); + voice.noteOn(noteNumber, velocity, delay); voice.setMute(mute); voice.setSoloMute(solomute); if (releaseTriggered) @@ -399,14 +408,21 @@ public class SoftChannel implements MidiChannel, ModelDirectedPlayer { } public void noteOn(int noteNumber, int velocity) { + noteOn(noteNumber, velocity, 0); + } + + /* A special noteOn with delay parameter, which is used to + * start note within control buffers. + */ + protected void noteOn(int noteNumber, int velocity, int delay) { noteNumber = restrict7Bit(noteNumber); velocity = restrict7Bit(velocity); - noteOn_internal(noteNumber, velocity); + noteOn_internal(noteNumber, velocity, delay); if (current_mixer != null) current_mixer.noteOn(noteNumber, velocity); } - private void noteOn_internal(int noteNumber, int velocity) { + private void noteOn_internal(int noteNumber, int velocity, int delay) { if (velocity == 0) { noteOff_internal(noteNumber, 64); @@ -490,6 +506,7 @@ public class SoftChannel implements MidiChannel, ModelDirectedPlayer { int tunedKey = (int)(Math.round(tuning.getTuning()[noteNumber]/100.0)); play_noteNumber = noteNumber; play_velocity = velocity; + play_delay = delay; play_releasetriggered = false; lastVelocity[noteNumber] = velocity; current_director.noteOn(tunedKey, velocity); @@ -594,6 +611,7 @@ public class SoftChannel implements MidiChannel, ModelDirectedPlayer { play_noteNumber = noteNumber; play_velocity = lastVelocity[noteNumber]; play_releasetriggered = true; + play_delay = 0; current_director.noteOff(tunedKey, velocity); } @@ -604,12 +622,14 @@ public class SoftChannel implements MidiChannel, ModelDirectedPlayer { private int voiceNo = 0; private int play_noteNumber = 0; private int play_velocity = 0; + private int play_delay = 0; private boolean play_releasetriggered = false; public void play(int performerIndex, ModelConnectionBlock[] connectionBlocks) { int noteNumber = play_noteNumber; int velocity = play_velocity; + int delay = play_delay; boolean releasetriggered = play_releasetriggered; SoftPerformer p = current_instrument.getPerformers()[performerIndex]; @@ -633,7 +653,7 @@ public class SoftChannel implements MidiChannel, ModelDirectedPlayer { if (voiceNo == -1) return; - initVoice(voices[voiceNo], p, prevVoiceID, noteNumber, velocity, + initVoice(voices[voiceNo], p, prevVoiceID, noteNumber, velocity, delay, connectionBlocks, current_mixer, releasetriggered); } diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftLimiter.java b/jdk/src/share/classes/com/sun/media/sound/SoftLimiter.java index 7ba0ac66002..cad04ecfd44 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftLimiter.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftLimiter.java @@ -79,7 +79,7 @@ public class SoftLimiter implements SoftAudioProcessor { if (silentcounter > 60) { if (!mix) { bufferLout.clear(); - bufferRout.clear(); + if (bufferRout != null) bufferRout.clear(); } return; } diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftMainMixer.java b/jdk/src/share/classes/com/sun/media/sound/SoftMainMixer.java index b62d1d480af..2d627674fa8 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftMainMixer.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftMainMixer.java @@ -26,7 +26,6 @@ package com.sun.media.sound; import java.io.IOException; import java.io.InputStream; -import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; import java.util.Set; @@ -46,28 +45,37 @@ import javax.sound.sampled.AudioSystem; */ public class SoftMainMixer { + // A private class thats contains a ModelChannelMixer and it's private buffers. + // This becomes necessary when we want to have separate delay buffers for each channel mixer. + private class SoftChannelMixerContainer + { + ModelChannelMixer mixer; + SoftAudioBuffer[] buffers; + } + public final static int CHANNEL_LEFT = 0; public final static int CHANNEL_RIGHT = 1; public final static int CHANNEL_MONO = 2; - public final static int CHANNEL_EFFECT1 = 3; - public final static int CHANNEL_EFFECT2 = 4; - public final static int CHANNEL_EFFECT3 = 5; - public final static int CHANNEL_EFFECT4 = 6; + public final static int CHANNEL_DELAY_LEFT = 3; + public final static int CHANNEL_DELAY_RIGHT = 4; + public final static int CHANNEL_DELAY_MONO = 5; + public final static int CHANNEL_EFFECT1 = 6; + public final static int CHANNEL_EFFECT2 = 7; + public final static int CHANNEL_DELAY_EFFECT1 = 8; + public final static int CHANNEL_DELAY_EFFECT2 = 9; public final static int CHANNEL_LEFT_DRY = 10; public final static int CHANNEL_RIGHT_DRY = 11; public final static int CHANNEL_SCRATCH1 = 12; public final static int CHANNEL_SCRATCH2 = 13; - public final static int CHANNEL_CHANNELMIXER_LEFT = 14; - public final static int CHANNEL_CHANNELMIXER_RIGHT = 15; - public final static int CHANNEL_CHANNELMIXER_MONO = 16; protected boolean active_sensing_on = false; private long msec_last_activity = -1; private boolean pusher_silent = false; private int pusher_silent_count = 0; - private long msec_pos = 0; + private long sample_pos = 0; protected boolean readfully = true; private Object control_mutex; private SoftSynthesizer synth; + private float samplerate = 44100; private int nrofchannels = 2; private SoftVoice[] voicestatus = null; private SoftAudioBuffer[] buffers; @@ -75,7 +83,10 @@ public class SoftMainMixer { private SoftAudioProcessor chorus; private SoftAudioProcessor agc; private long msec_buffer_len = 0; + private int buffer_len = 0; protected TreeMap midimessages = new TreeMap(); + private int delay_midievent = 0; + private int max_delay_midievent = 0; double last_volume_left = 1.0; double last_volume_right = 1.0; private double[] co_master_balance = new double[1]; @@ -83,9 +94,9 @@ public class SoftMainMixer { private double[] co_master_coarse_tuning = new double[1]; private double[] co_master_fine_tuning = new double[1]; private AudioInputStream ais; - private Set registeredMixers = null; + private Set registeredMixers = null; private Set stoppedMixers = null; - private ModelChannelMixer[] cur_registeredMixers = null; + private SoftChannelMixerContainer[] cur_registeredMixers = null; protected SoftControl co_master = new SoftControl() { double[] balance = co_master_balance; @@ -413,26 +424,68 @@ public class SoftMainMixer { Iterator> iter = midimessages.entrySet().iterator(); while (iter.hasNext()) { Entry entry = iter.next(); - if (entry.getKey() > (timeStamp + 100)) + if (entry.getKey() >= (timeStamp + msec_buffer_len)) return; + long msec_delay = entry.getKey() - timeStamp; + delay_midievent = (int)(msec_delay * (samplerate / 1000000.0) + 0.5); + if(delay_midievent > max_delay_midievent) + delay_midievent = max_delay_midievent; + if(delay_midievent < 0) + delay_midievent = 0; processMessage(entry.getValue()); iter.remove(); } + delay_midievent = 0; } protected void processAudioBuffers() { + + if(synth.weakstream != null && synth.weakstream.silent_samples != 0) + { + sample_pos += synth.weakstream.silent_samples; + synth.weakstream.silent_samples = 0; + } + for (int i = 0; i < buffers.length; i++) { - buffers[i].clear(); + if(i != CHANNEL_DELAY_LEFT && + i != CHANNEL_DELAY_RIGHT && + i != CHANNEL_DELAY_MONO && + i != CHANNEL_DELAY_EFFECT1 && + i != CHANNEL_DELAY_EFFECT2) + buffers[i].clear(); + } + + if(!buffers[CHANNEL_DELAY_LEFT].isSilent()) + { + buffers[CHANNEL_LEFT].swap(buffers[CHANNEL_DELAY_LEFT]); + } + if(!buffers[CHANNEL_DELAY_RIGHT].isSilent()) + { + buffers[CHANNEL_RIGHT].swap(buffers[CHANNEL_DELAY_RIGHT]); + } + if(!buffers[CHANNEL_DELAY_MONO].isSilent()) + { + buffers[CHANNEL_MONO].swap(buffers[CHANNEL_DELAY_MONO]); + } + if(!buffers[CHANNEL_DELAY_EFFECT1].isSilent()) + { + buffers[CHANNEL_EFFECT1].swap(buffers[CHANNEL_DELAY_EFFECT1]); + } + if(!buffers[CHANNEL_DELAY_EFFECT2].isSilent()) + { + buffers[CHANNEL_EFFECT2].swap(buffers[CHANNEL_DELAY_EFFECT2]); } double volume_left; double volume_right; - ModelChannelMixer[] act_registeredMixers; + SoftChannelMixerContainer[] act_registeredMixers; // perform control logic synchronized (control_mutex) { + long msec_pos = (long)(sample_pos * (1000000.0 / samplerate)); + processMessages(msec_pos); if (active_sensing_on) { @@ -450,7 +503,7 @@ public class SoftMainMixer { for (int i = 0; i < voicestatus.length; i++) if (voicestatus[i].active) voicestatus[i].processControlLogic(); - msec_pos += msec_buffer_len; + sample_pos += buffer_len; double volume = co_master_volume[0]; volume_left = volume; @@ -469,7 +522,7 @@ public class SoftMainMixer { if (cur_registeredMixers == null) { if (registeredMixers != null) { cur_registeredMixers = - new ModelChannelMixer[registeredMixers.size()]; + new SoftChannelMixerContainer[registeredMixers.size()]; registeredMixers.toArray(cur_registeredMixers); } } @@ -483,44 +536,61 @@ public class SoftMainMixer { if (act_registeredMixers != null) { - // Reroute default left,right output - // to channelmixer left,right input/output + // Make backup of left,right,mono channels SoftAudioBuffer leftbak = buffers[CHANNEL_LEFT]; SoftAudioBuffer rightbak = buffers[CHANNEL_RIGHT]; SoftAudioBuffer monobak = buffers[CHANNEL_MONO]; - buffers[CHANNEL_LEFT] = buffers[CHANNEL_CHANNELMIXER_LEFT]; - buffers[CHANNEL_RIGHT] = buffers[CHANNEL_CHANNELMIXER_RIGHT]; - buffers[CHANNEL_MONO] = buffers[CHANNEL_CHANNELMIXER_MONO]; + SoftAudioBuffer delayleftbak = buffers[CHANNEL_DELAY_LEFT]; + SoftAudioBuffer delayrightbak = buffers[CHANNEL_DELAY_RIGHT]; + SoftAudioBuffer delaymonobak = buffers[CHANNEL_DELAY_MONO]; int bufferlen = buffers[CHANNEL_LEFT].getSize(); float[][] cbuffer = new float[nrofchannels][]; - cbuffer[0] = buffers[CHANNEL_LEFT].array(); - if (nrofchannels != 1) - cbuffer[1] = buffers[CHANNEL_RIGHT].array(); - float[][] obuffer = new float[nrofchannels][]; obuffer[0] = leftbak.array(); if (nrofchannels != 1) obuffer[1] = rightbak.array(); - for (ModelChannelMixer cmixer : act_registeredMixers) { - for (int i = 0; i < cbuffer.length; i++) - Arrays.fill(cbuffer[i], 0); + for (SoftChannelMixerContainer cmixer : act_registeredMixers) { + + // Reroute default left,right output + // to channelmixer left,right input/output + buffers[CHANNEL_LEFT] = cmixer.buffers[CHANNEL_LEFT]; + buffers[CHANNEL_RIGHT] = cmixer.buffers[CHANNEL_RIGHT]; + buffers[CHANNEL_MONO] = cmixer.buffers[CHANNEL_MONO]; + buffers[CHANNEL_DELAY_LEFT] = cmixer.buffers[CHANNEL_DELAY_LEFT]; + buffers[CHANNEL_DELAY_RIGHT] = cmixer.buffers[CHANNEL_DELAY_RIGHT]; + buffers[CHANNEL_DELAY_MONO] = cmixer.buffers[CHANNEL_DELAY_MONO]; + + buffers[CHANNEL_LEFT].clear(); + buffers[CHANNEL_RIGHT].clear(); buffers[CHANNEL_MONO].clear(); + + if(!buffers[CHANNEL_DELAY_LEFT].isSilent()) + { + buffers[CHANNEL_LEFT].swap(buffers[CHANNEL_DELAY_LEFT]); + } + if(!buffers[CHANNEL_DELAY_RIGHT].isSilent()) + { + buffers[CHANNEL_RIGHT].swap(buffers[CHANNEL_DELAY_RIGHT]); + } + if(!buffers[CHANNEL_DELAY_MONO].isSilent()) + { + buffers[CHANNEL_MONO].swap(buffers[CHANNEL_DELAY_MONO]); + } + + cbuffer[0] = buffers[CHANNEL_LEFT].array(); + if (nrofchannels != 1) + cbuffer[1] = buffers[CHANNEL_RIGHT].array(); + boolean hasactivevoices = false; for (int i = 0; i < voicestatus.length; i++) if (voicestatus[i].active) - if (voicestatus[i].channelmixer == cmixer) { + if (voicestatus[i].channelmixer == cmixer.mixer) { voicestatus[i].processAudioLogic(buffers); hasactivevoices = true; } - if (!cmixer.process(cbuffer, 0, bufferlen)) { - synchronized (control_mutex) { - registeredMixers.remove(cmixer); - cur_registeredMixers = null; - } - } if(!buffers[CHANNEL_MONO].isSilent()) { @@ -542,6 +612,13 @@ public class SoftMainMixer { } } + if (!cmixer.mixer.process(cbuffer, 0, bufferlen)) { + synchronized (control_mutex) { + registeredMixers.remove(cmixer); + cur_registeredMixers = null; + } + } + for (int i = 0; i < cbuffer.length; i++) { float[] cbuff = cbuffer[i]; float[] obuff = obuffer[i]; @@ -554,7 +631,7 @@ public class SoftMainMixer { if (stoppedMixers != null) { if (stoppedMixers.contains(cmixer)) { stoppedMixers.remove(cmixer); - cmixer.stop(); + cmixer.mixer.stop(); } } } @@ -565,6 +642,9 @@ public class SoftMainMixer { buffers[CHANNEL_LEFT] = leftbak; buffers[CHANNEL_RIGHT] = rightbak; buffers[CHANNEL_MONO] = monobak; + buffers[CHANNEL_DELAY_LEFT] = delayleftbak; + buffers[CHANNEL_DELAY_RIGHT] = delayrightbak; + buffers[CHANNEL_DELAY_MONO] = delaymonobak; } @@ -650,14 +730,23 @@ public class SoftMainMixer { if(buffers[CHANNEL_LEFT].isSilent() && buffers[CHANNEL_RIGHT].isSilent()) { - pusher_silent_count++; - if(pusher_silent_count > 5) + + int midimessages_size; + synchronized (control_mutex) { + midimessages_size = midimessages.size(); + } + + if(midimessages_size == 0) { - pusher_silent_count = 0; - synchronized (control_mutex) { - pusher_silent = true; - if(synth.weakstream != null) - synth.weakstream.setInputStream(null); + pusher_silent_count++; + if(pusher_silent_count > 5) + { + pusher_silent_count = 0; + synchronized (control_mutex) { + pusher_silent = true; + if(synth.weakstream != null) + synth.weakstream.setInputStream(null); + } } } } @@ -672,13 +761,18 @@ public class SoftMainMixer { // Must only we called within control_mutex synchronization public void activity() { - msec_last_activity = msec_pos; + long silent_samples = 0; if(pusher_silent) { pusher_silent = false; if(synth.weakstream != null) + { synth.weakstream.setInputStream(ais); + silent_samples = synth.weakstream.silent_samples; + } } + msec_last_activity = (long)((sample_pos + silent_samples) + * (1000000.0 / samplerate)); } public void stopMixer(ModelChannelMixer mixer) { @@ -689,15 +783,22 @@ public class SoftMainMixer { public void registerMixer(ModelChannelMixer mixer) { if (registeredMixers == null) - registeredMixers = new HashSet(); - registeredMixers.add(mixer); + registeredMixers = new HashSet(); + SoftChannelMixerContainer mixercontainer = new SoftChannelMixerContainer(); + mixercontainer.buffers = new SoftAudioBuffer[6]; + for (int i = 0; i < mixercontainer.buffers.length; i++) { + mixercontainer.buffers[i] = + new SoftAudioBuffer(buffer_len, synth.getFormat()); + } + mixercontainer.mixer = mixer; + registeredMixers.add(mixercontainer); cur_registeredMixers = null; } public SoftMainMixer(SoftSynthesizer synth) { this.synth = synth; - msec_pos = 0; + sample_pos = 0; co_master_balance[0] = 0.5; co_master_volume[0] = 1; @@ -705,14 +806,18 @@ public class SoftMainMixer { co_master_fine_tuning[0] = 0.5; msec_buffer_len = (long) (1000000.0 / synth.getControlRate()); - + samplerate = synth.getFormat().getSampleRate(); nrofchannels = synth.getFormat().getChannels(); int buffersize = (int) (synth.getFormat().getSampleRate() / synth.getControlRate()); + buffer_len = buffersize; + + max_delay_midievent = buffersize; + control_mutex = synth.control_mutex; - buffers = new SoftAudioBuffer[17]; + buffers = new SoftAudioBuffer[14]; for (int i = 0; i < buffers.length; i++) { buffers[i] = new SoftAudioBuffer(buffersize, synth.getFormat()); } @@ -994,7 +1099,10 @@ public class SoftMainMixer { switch (cmd) { case ShortMessage.NOTE_ON: - softchannel.noteOn(data1, data2); + if(delay_midievent != 0) + softchannel.noteOn(data1, data2, delay_midievent); + else + softchannel.noteOn(data1, data2); break; case ShortMessage.NOTE_OFF: softchannel.noteOff(data1, data2); @@ -1021,7 +1129,15 @@ public class SoftMainMixer { } public long getMicrosecondPosition() { - return msec_pos; + if(pusher_silent) + { + if(synth.weakstream != null) + { + return (long)((sample_pos + synth.weakstream.silent_samples) + * (1000000.0 / samplerate)); + } + } + return (long)(sample_pos * (1000000.0 / samplerate)); } public void close() { diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftReceiver.java b/jdk/src/share/classes/com/sun/media/sound/SoftReceiver.java index e7f1edcfae6..fa533836c7b 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftReceiver.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftReceiver.java @@ -26,8 +26,8 @@ package com.sun.media.sound; import java.util.TreeMap; +import javax.sound.midi.MidiDevice; import javax.sound.midi.MidiMessage; -import javax.sound.midi.Receiver; import javax.sound.midi.ShortMessage; /** @@ -35,7 +35,7 @@ import javax.sound.midi.ShortMessage; * * @author Karl Helgason */ -public class SoftReceiver implements Receiver { +public class SoftReceiver implements MidiDeviceReceiver { protected boolean open = true; private Object control_mutex; @@ -51,6 +51,10 @@ public class SoftReceiver implements Receiver { this.midimessages = mainmixer.midimessages; } + public MidiDevice getMidiDevice() { + return synth; + } + public void send(MidiMessage message, long timeStamp) { synchronized (control_mutex) { @@ -60,6 +64,7 @@ public class SoftReceiver implements Receiver { if (timeStamp != -1) { synchronized (control_mutex) { + mainmixer.activity(); while (midimessages.get(timeStamp) != null) timeStamp++; if (message instanceof ShortMessage diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java b/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java index ab46b2dc9a9..6f867f7ebab 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java @@ -66,6 +66,8 @@ public class SoftSynthesizer implements AudioSynthesizer, public SoftAudioPusher pusher = null; public AudioInputStream jitter_stream = null; public SourceDataLine sourceDataLine = null; + public volatile long silent_samples = 0; + private int framesize = 0; private WeakReference weak_stream_link; private AudioFloatConverter converter; private float[] silentbuffer = null; @@ -101,6 +103,8 @@ public class SoftSynthesizer implements AudioSynthesizer, silentbuffer = new float[flen]; converter.toByteArray(silentbuffer, flen, b, off); + silent_samples += (long)((len / framesize)); + if(pusher != null) if(weak_stream_link.get() == null) { @@ -136,6 +140,7 @@ public class SoftSynthesizer implements AudioSynthesizer, weak_stream_link = new WeakReference(stream); converter = AudioFloatConverter.getConverter(stream.getFormat()); samplesize = stream.getFormat().getFrameSize() / stream.getFormat().getChannels(); + framesize = stream.getFormat().getFrameSize(); } public AudioInputStream getAudioInputStream() diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftVoice.java b/jdk/src/share/classes/com/sun/media/sound/SoftVoice.java index cec2e3047ac..13f9d366947 100644 --- a/jdk/src/share/classes/com/sun/media/sound/SoftVoice.java +++ b/jdk/src/share/classes/com/sun/media/sound/SoftVoice.java @@ -43,6 +43,7 @@ public class SoftVoice extends VoiceStatus { private int noteOn_noteNumber = 0; private int noteOn_velocity = 0; private int noteOff_velocity = 0; + private int delay = 0; protected ModelChannelMixer channelmixer = null; protected double tunedKey = 0; protected SoftTuning tuning = null; @@ -294,7 +295,7 @@ public class SoftVoice extends VoiceStatus { tunedKey = tuning.getTuning(noteNumber) / 100.0; } - protected void noteOn(int noteNumber, int velocity) { + protected void noteOn(int noteNumber, int velocity, int delay) { sustain = false; sostenuto = false; @@ -308,6 +309,7 @@ public class SoftVoice extends VoiceStatus { noteOn_noteNumber = noteNumber; noteOn_velocity = velocity; + this.delay = delay; lastMuteValue = 0; lastSoloMuteValue = 0; @@ -562,7 +564,7 @@ public class SoftVoice extends VoiceStatus { if (stealer_channel != null) { stealer_channel.initVoice(this, stealer_performer, - stealer_voiceID, stealer_noteNumber, stealer_velocity, + stealer_voiceID, stealer_noteNumber, stealer_velocity, 0, stealer_extendedConnectionBlocks, stealer_channelmixer, stealer_releaseTriggered); stealer_releaseTriggered = false; @@ -733,23 +735,55 @@ public class SoftVoice extends VoiceStatus { } protected void mixAudioStream(SoftAudioBuffer in, SoftAudioBuffer out, + SoftAudioBuffer dout, float amp_from, float amp_to) { int bufferlen = in.getSize(); if (amp_from < 0.000000001 && amp_to < 0.000000001) return; - if (amp_from == amp_to) { - float[] fout = out.array(); - float[] fin = in.array(); - for (int i = 0; i < bufferlen; i++) - fout[i] += fin[i] * amp_to; - } else { - float amp = amp_from; - float amp_delta = (amp_to - amp_from) / bufferlen; - float[] fout = out.array(); - float[] fin = in.array(); - for (int i = 0; i < bufferlen; i++) { - amp += amp_delta; - fout[i] += fin[i] * amp; + if(dout != null && delay != 0) + { + if (amp_from == amp_to) { + float[] fout = out.array(); + float[] fin = in.array(); + int j = 0; + for (int i = delay; i < bufferlen; i++) + fout[i] += fin[j++] * amp_to; + fout = dout.array(); + for (int i = 0; i < delay; i++) + fout[i] += fin[j++] * amp_to; + } else { + float amp = amp_from; + float amp_delta = (amp_to - amp_from) / bufferlen; + float[] fout = out.array(); + float[] fin = in.array(); + int j = 0; + for (int i = delay; i < bufferlen; i++) { + amp += amp_delta; + fout[i] += fin[j++] * amp; + } + fout = dout.array(); + for (int i = 0; i < delay; i++) { + amp += amp_delta; + fout[i] += fin[j++] * amp; + } + } + } + else + { + if (amp_from == amp_to) { + float[] fout = out.array(); + float[] fin = in.array(); + for (int i = 0; i < bufferlen; i++) + fout[i] += fin[i] * amp_to; + } else { + float amp = amp_from; + float amp_delta = (amp_to - amp_from) / bufferlen; + float[] fout = out.array(); + float[] fin = in.array(); + for (int i = 0; i < bufferlen; i++) { + amp += amp_delta; + fout[i] += fin[i] * amp; + } } } @@ -785,6 +819,13 @@ public class SoftVoice extends VoiceStatus { SoftAudioBuffer mono = buffer[SoftMainMixer.CHANNEL_MONO]; SoftAudioBuffer eff1 = buffer[SoftMainMixer.CHANNEL_EFFECT1]; SoftAudioBuffer eff2 = buffer[SoftMainMixer.CHANNEL_EFFECT2]; + + SoftAudioBuffer dleft = buffer[SoftMainMixer.CHANNEL_DELAY_LEFT]; + SoftAudioBuffer dright = buffer[SoftMainMixer.CHANNEL_DELAY_RIGHT]; + SoftAudioBuffer dmono = buffer[SoftMainMixer.CHANNEL_DELAY_MONO]; + SoftAudioBuffer deff1 = buffer[SoftMainMixer.CHANNEL_DELAY_EFFECT1]; + SoftAudioBuffer deff2 = buffer[SoftMainMixer.CHANNEL_DELAY_EFFECT2]; + SoftAudioBuffer leftdry = buffer[SoftMainMixer.CHANNEL_LEFT_DRY]; SoftAudioBuffer rightdry = buffer[SoftMainMixer.CHANNEL_RIGHT_DRY]; @@ -799,42 +840,42 @@ public class SoftVoice extends VoiceStatus { if (nrofchannels == 1) { out_mixer_left = (out_mixer_left + out_mixer_right) / 2; - mixAudioStream(leftdry, left, last_out_mixer_left, out_mixer_left); + mixAudioStream(leftdry, left, dleft, last_out_mixer_left, out_mixer_left); if (rightdry != null) - mixAudioStream(rightdry, left, last_out_mixer_left, + mixAudioStream(rightdry, left, dleft, last_out_mixer_left, out_mixer_left); } else { if(rightdry == null && last_out_mixer_left == last_out_mixer_right && out_mixer_left == out_mixer_right) { - mixAudioStream(leftdry, mono, last_out_mixer_left, out_mixer_left); + mixAudioStream(leftdry, mono, dmono, last_out_mixer_left, out_mixer_left); } else { - mixAudioStream(leftdry, left, last_out_mixer_left, out_mixer_left); + mixAudioStream(leftdry, left, dleft, last_out_mixer_left, out_mixer_left); if (rightdry != null) - mixAudioStream(rightdry, right, last_out_mixer_right, + mixAudioStream(rightdry, right, dright, last_out_mixer_right, out_mixer_right); else - mixAudioStream(leftdry, right, last_out_mixer_right, + mixAudioStream(leftdry, right, dright, last_out_mixer_right, out_mixer_right); } } if (rightdry == null) { - mixAudioStream(leftdry, eff1, last_out_mixer_effect1, + mixAudioStream(leftdry, eff1, deff1, last_out_mixer_effect1, out_mixer_effect1); - mixAudioStream(leftdry, eff2, last_out_mixer_effect2, + mixAudioStream(leftdry, eff2, deff2, last_out_mixer_effect2, out_mixer_effect2); } else { - mixAudioStream(leftdry, eff1, last_out_mixer_effect1 * 0.5f, + mixAudioStream(leftdry, eff1, deff1, last_out_mixer_effect1 * 0.5f, out_mixer_effect1 * 0.5f); - mixAudioStream(leftdry, eff2, last_out_mixer_effect2 * 0.5f, + mixAudioStream(leftdry, eff2, deff2, last_out_mixer_effect2 * 0.5f, out_mixer_effect2 * 0.5f); - mixAudioStream(rightdry, eff1, last_out_mixer_effect1 * 0.5f, + mixAudioStream(rightdry, eff1, deff1, last_out_mixer_effect1 * 0.5f, out_mixer_effect1 * 0.5f); - mixAudioStream(rightdry, eff2, last_out_mixer_effect2 * 0.5f, + mixAudioStream(rightdry, eff2, deff2, last_out_mixer_effect2 * 0.5f, out_mixer_effect2 * 0.5f); } diff --git a/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java b/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java index a4075ba0974..9d3e6765134 100644 --- a/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java +++ b/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java @@ -34,8 +34,6 @@ import java.util.*; import java.security.AccessController; import java.security.CodeSource; -import java.security.Identity; -import java.security.IdentityScope; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.Permission; @@ -267,7 +265,7 @@ public class PolicyFile extends javax.security.auth.Policy { private boolean initialized = false; private boolean expandProperties = true; - private boolean ignoreIdentityScope = false; + private boolean ignoreIdentityScope = true; // for use with the reflection API @@ -459,9 +457,6 @@ public class PolicyFile extends javax.security.auth.Policy { } } - /** the scope to check */ - private static IdentityScope scope = null; - /** * Checks public key. If it is marked as trusted in * the identity database, add it to the policy diff --git a/jdk/src/share/classes/java/awt/AlphaComposite.java b/jdk/src/share/classes/java/awt/AlphaComposite.java index 622690cddef..978d9da2948 100644 --- a/jdk/src/share/classes/java/awt/AlphaComposite.java +++ b/jdk/src/share/classes/java/awt/AlphaComposite.java @@ -614,14 +614,15 @@ public final class AlphaComposite implements Composite { } private AlphaComposite(int rule, float alpha) { - if (alpha < 0.0f || alpha > 1.0f) { - throw new IllegalArgumentException("alpha value out of range"); - } if (rule < MIN_RULE || rule > MAX_RULE) { throw new IllegalArgumentException("unknown composite rule"); } - this.rule = rule; - this.extraAlpha = alpha; + if (alpha >= 0.0f && alpha <= 1.0f) { + this.rule = rule; + this.extraAlpha = alpha; + } else { + throw new IllegalArgumentException("alpha value out of range"); + } } /** diff --git a/jdk/src/share/classes/java/awt/Component.java b/jdk/src/share/classes/java/awt/Component.java index 6a942e9ec5d..702d81b8f9b 100644 --- a/jdk/src/share/classes/java/awt/Component.java +++ b/jdk/src/share/classes/java/awt/Component.java @@ -871,7 +871,7 @@ public abstract class Component implements ImageObserver, MenuContainer, return comp.canBeFocusOwner(); } - public boolean isVisible_NoClientCode(Component comp) { + public boolean isVisible(Component comp) { return comp.isVisible_NoClientCode(); } public void setRequestFocusController @@ -885,6 +885,71 @@ public abstract class Component implements ImageObserver, MenuContainer, public void setAppContext(Component comp, AppContext appContext) { comp.appContext = appContext; } + public Container getParent(Component comp) { + return comp.getParent_NoClientCode(); + } + public void setParent(Component comp, Container parent) { + comp.parent = parent; + } + public void setSize(Component comp, int width, int height) { + comp.width = width; + comp.height = height; + } + public Point getLocation(Component comp) { + return comp.location_NoClientCode(); + } + public void setLocation(Component comp, int x, int y) { + comp.x = x; + comp.y = y; + } + public boolean isEnabled(Component comp) { + return comp.isEnabledImpl(); + } + public boolean isDisplayable(Component comp) { + return comp.peer != null; + } + public Cursor getCursor(Component comp) { + return comp.getCursor_NoClientCode(); + } + public ComponentPeer getPeer(Component comp) { + return comp.peer; + } + public void setPeer(Component comp, ComponentPeer peer) { + comp.peer = peer; + } + public boolean isLightweight(Component comp) { + return (comp.peer instanceof LightweightPeer); + } + public boolean getIgnoreRepaint(Component comp) { + return comp.ignoreRepaint; + } + public int getWidth(Component comp) { + return comp.width; + } + public int getHeight(Component comp) { + return comp.height; + } + public int getX(Component comp) { + return comp.x; + } + public int getY(Component comp) { + return comp.y; + } + public Color getForeground(Component comp) { + return comp.foreground; + } + public Color getBackground(Component comp) { + return comp.background; + } + public void setBackground(Component comp, Color background) { + comp.background = background; + } + public Font getFont(Component comp) { + return comp.getFont_NoClientCode(); + } + public void processEvent(Component comp, AWTEvent e) { + comp.processEvent(e); + } }); } @@ -8021,7 +8086,7 @@ public abstract class Component implements ImageObserver, MenuContainer, Container getNativeContainer() { Container p = parent; while (p != null && p.peer instanceof LightweightPeer) { - p = p.getParent(); + p = p.getParent_NoClientCode(); } return p; } diff --git a/jdk/src/share/classes/java/awt/EventDispatchThread.java b/jdk/src/share/classes/java/awt/EventDispatchThread.java index e0c46a37d33..f546dc386ab 100644 --- a/jdk/src/share/classes/java/awt/EventDispatchThread.java +++ b/jdk/src/share/classes/java/awt/EventDispatchThread.java @@ -104,11 +104,8 @@ class EventDispatchThread extends Thread { } else { stopEvent.dispatch(); } - synchronized (theQueue) { - if (theQueue.getDispatchThread() == this) { - theQueue.detachDispatchThread(); - } - } + + theQueue.detachDispatchThread(this, false); } public void stopDispatching() { @@ -142,35 +139,7 @@ class EventDispatchThread extends Thread { } }); } finally { - /* - * This synchronized block is to secure that the event dispatch - * thread won't die in the middle of posting a new event to the - * associated event queue. It is important because we notify - * that the event dispatch thread is busy after posting a new event - * to its queue, so the EventQueue.dispatchThread reference must - * be valid at that point. - */ - synchronized (theQueue) { - if (theQueue.getDispatchThread() == this) { - theQueue.detachDispatchThread(); - } - /* - * Event dispatch thread dies in case of an uncaught exception. - * A new event dispatch thread for this queue will be started - * only if a new event is posted to it. In case if no more - * events are posted after this thread died all events that - * currently are in the queue will never be dispatched. - */ - /* - * Fix for 4648733. Check both the associated java event - * queue and the PostEventQueue. - */ - if (theQueue.peekEvent() != null || - !SunToolkit.isPostEventQueueEmpty()) { - theQueue.initDispatchThread(); - } - AWTAutoShutdown.getInstance().notifyThreadFree(this); - } + theQueue.detachDispatchThread(this, true); } } diff --git a/jdk/src/share/classes/java/awt/EventQueue.java b/jdk/src/share/classes/java/awt/EventQueue.java index b5635f4a25c..cf1c364b3aa 100644 --- a/jdk/src/share/classes/java/awt/EventQueue.java +++ b/jdk/src/share/classes/java/awt/EventQueue.java @@ -45,6 +45,9 @@ import sun.awt.SunToolkit; import sun.awt.EventQueueItem; import sun.awt.AWTAccessor; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.Lock; + /** * EventQueue is a platform-independent class * that queues events, both from the underlying peer classes @@ -127,6 +130,14 @@ public class EventQueue { */ private EventQueue previousQueue; + /* + * A single lock to synchronize the push()/pop() and related operations with + * all the EventQueues from the AppContext. Synchronization on any particular + * event queue(s) is not enough: we should lock the whole stack. + */ + private final Lock pushPopLock; + private final Condition pushPopCond; + private EventDispatchThread dispatchThread; private final ThreadGroup threadGroup = @@ -158,11 +169,11 @@ public class EventQueue { static { AWTAccessor.setEventQueueAccessor( new AWTAccessor.EventQueueAccessor() { - public EventQueue getNextQueue(EventQueue eventQueue) { - return eventQueue.nextQueue; - } public Thread getDispatchThread(EventQueue eventQueue) { - return eventQueue.dispatchThread; + return eventQueue.getDispatchThread(); + } + public boolean isDispatchThreadImpl(EventQueue eventQueue) { + return eventQueue.isDispatchThreadImpl(); } }); } @@ -179,6 +190,9 @@ public class EventQueue { * may call AppContext.getAppContext() before createNewAppContext() * completes thus causing mess in thread group to appcontext mapping. */ + + pushPopLock = (Lock)AppContext.getAppContext().get(AppContext.EVENT_QUEUE_LOCK_KEY); + pushPopCond = (Condition)AppContext.getAppContext().get(AppContext.EVENT_QUEUE_COND_KEY); } /** @@ -207,7 +221,8 @@ public class EventQueue { */ final void postEventPrivate(AWTEvent theEvent) { theEvent.isPosted = true; - synchronized(this) { + pushPopLock.lock(); + try { if (dispatchThread == null && nextQueue == null) { if (theEvent.getSource() == AWTAutoShutdown.getInstance()) { return; @@ -221,6 +236,8 @@ public class EventQueue { return; } postEvent(theEvent, getPriority(theEvent)); + } finally { + pushPopLock.unlock(); } } @@ -280,9 +297,9 @@ public class EventQueue { if (theEvent.getSource() != AWTAutoShutdown.getInstance()) { AWTAutoShutdown.getInstance().notifyThreadBusy(dispatchThread); } - notifyAll(); + pushPopCond.signalAll(); } else if (notifyID) { - notifyAll(); + pushPopCond.signalAll(); } } else { // The event was not coalesced or has non-Component source. @@ -290,7 +307,7 @@ public class EventQueue { queues[priority].tail.next = newItem; queues[priority].tail = newItem; if (notifyID) { - notifyAll(); + pushPopCond.signalAll(); } } } @@ -482,7 +499,8 @@ public class EventQueue { * event queues are nested with push()/pop(). */ SunToolkit.flushPendingEvents(); - synchronized (this) { + pushPopLock.lock(); + try { for (int i = NUM_PRIORITIES - 1; i >= 0; i--) { if (queues[i].head != null) { EventQueueItem entry = queues[i].head; @@ -495,7 +513,9 @@ public class EventQueue { } } AWTAutoShutdown.getInstance().notifyThreadFree(dispatchThread); - wait(); + pushPopCond.await(); + } finally { + pushPopLock.unlock(); } } while(true); } @@ -508,7 +528,8 @@ public class EventQueue { * event queues are nested with push()/pop(). */ SunToolkit.flushPendingEvents(); - synchronized (this) { + pushPopLock.lock(); + try { for (int i = 0; i < NUM_PRIORITIES; i++) { for (EventQueueItem entry = queues[i].head, prev = null; entry != null; prev = entry, entry = entry.next) @@ -527,9 +548,11 @@ public class EventQueue { } } } - this.waitForID = id; - wait(); - this.waitForID = 0; + waitForID = id; + pushPopCond.await(); + waitForID = 0; + } finally { + pushPopLock.unlock(); } } while(true); } @@ -539,11 +562,16 @@ public class EventQueue { * without removing it. * @return the first event */ - public synchronized AWTEvent peekEvent() { - for (int i = NUM_PRIORITIES - 1; i >= 0; i--) { - if (queues[i].head != null) { - return queues[i].head.event; + public AWTEvent peekEvent() { + pushPopLock.lock(); + try { + for (int i = NUM_PRIORITIES - 1; i >= 0; i--) { + if (queues[i].head != null) { + return queues[i].head.event; + } } + } finally { + pushPopLock.unlock(); } return null; @@ -555,14 +583,19 @@ public class EventQueue { * @return the first event of the specified id or null * if there is no such event */ - public synchronized AWTEvent peekEvent(int id) { - for (int i = NUM_PRIORITIES - 1; i >= 0; i--) { - EventQueueItem q = queues[i].head; - for (; q != null; q = q.next) { - if (q.event.getID() == id) { - return q.event; + public AWTEvent peekEvent(int id) { + pushPopLock.lock(); + try { + for (int i = NUM_PRIORITIES - 1; i >= 0; i--) { + EventQueueItem q = queues[i].head; + for (; q != null; q = q.next) { + if (q.event.getID() == id) { + return q.event; + } } } + } finally { + pushPopLock.unlock(); } return null; @@ -661,17 +694,27 @@ public class EventQueue { public static long getMostRecentEventTime() { return Toolkit.getEventQueue().getMostRecentEventTimeImpl(); } - private synchronized long getMostRecentEventTimeImpl() { - return (Thread.currentThread() == dispatchThread) - ? mostRecentEventTime - : System.currentTimeMillis(); + private long getMostRecentEventTimeImpl() { + pushPopLock.lock(); + try { + return (Thread.currentThread() == dispatchThread) + ? mostRecentEventTime + : System.currentTimeMillis(); + } finally { + pushPopLock.unlock(); + } } /** * @return most recent event time on all threads. */ - synchronized long getMostRecentEventTimeEx() { - return mostRecentEventTime; + long getMostRecentEventTimeEx() { + pushPopLock.lock(); + try { + return mostRecentEventTime; + } finally { + pushPopLock.unlock(); + } } /** @@ -689,10 +732,15 @@ public class EventQueue { public static AWTEvent getCurrentEvent() { return Toolkit.getEventQueue().getCurrentEventImpl(); } - private synchronized AWTEvent getCurrentEventImpl() { - return (Thread.currentThread() == dispatchThread) - ? ((AWTEvent)currentEvent.get()) - : null; + private AWTEvent getCurrentEventImpl() { + pushPopLock.lock(); + try { + return (Thread.currentThread() == dispatchThread) + ? ((AWTEvent)currentEvent.get()) + : null; + } finally { + pushPopLock.unlock(); + } } /** @@ -706,21 +754,22 @@ public class EventQueue { * @throws NullPointerException if newEventQueue is null * @since 1.2 */ - public synchronized void push(EventQueue newEventQueue) { + public void push(EventQueue newEventQueue) { if (eventLog.isLoggable(PlatformLogger.FINE)) { eventLog.fine("EventQueue.push(" + newEventQueue + ")"); } - if (nextQueue != null) { - nextQueue.push(newEventQueue); - return; - } + pushPopLock.lock(); + try { + EventQueue toPush = this; + while (toPush.nextQueue != null) { + toPush = toPush.nextQueue; + } - synchronized (newEventQueue) { // Transfer all events forward to new EventQueue. - while (peekEvent() != null) { + while (toPush.peekEvent() != null) { try { - newEventQueue.postEventPrivate(getNextEvent()); + newEventQueue.postEventPrivate(toPush.getNextEvent()); } catch (InterruptedException ie) { if (eventLog.isLoggable(PlatformLogger.FINE)) { eventLog.fine("Interrupted push", ie); @@ -728,27 +777,30 @@ public class EventQueue { } } - newEventQueue.previousQueue = this; - } - /* - * Stop the event dispatch thread associated with the currently - * active event queue, so that after the new queue is pushed - * on the top this event dispatch thread won't prevent AWT from - * being automatically shut down. - * Use stopDispatchingLater() to avoid deadlock: stopDispatching() - * waits for the dispatch thread to exit, so if the dispatch - * thread attempts to synchronize on this EventQueue object - * it will never exit since we already hold this lock. - */ - if (dispatchThread != null) { - dispatchThread.stopDispatchingLater(); - } + newEventQueue.previousQueue = toPush; - nextQueue = newEventQueue; + /* + * Stop the event dispatch thread associated with the currently + * active event queue, so that after the new queue is pushed + * on the top this event dispatch thread won't prevent AWT from + * being automatically shut down. + * Use stopDispatchingLater() to avoid deadlock: stopDispatching() + * waits for the dispatch thread to exit, which in turn waits + * for the lock in EQ.detachDispatchThread(), which is hold by + * this method. + */ + if (toPush.dispatchThread != null) { + toPush.dispatchThread.stopDispatchingLater(); + } - AppContext appContext = AppContext.getAppContext(); - if (appContext.get(AppContext.EVENT_QUEUE_KEY) == this) { - appContext.put(AppContext.EVENT_QUEUE_KEY, newEventQueue); + toPush.nextQueue = newEventQueue; + + AppContext appContext = AppContext.getAppContext(); + if (appContext.get(AppContext.EVENT_QUEUE_KEY) == toPush) { + appContext.put(AppContext.EVENT_QUEUE_KEY, newEventQueue); + } + } finally { + pushPopLock.unlock(); } } @@ -770,25 +822,24 @@ public class EventQueue { eventLog.fine("EventQueue.pop(" + this + ")"); } - // To prevent deadlock, we lock on the previous EventQueue before - // this one. This uses the same locking order as everything else - // in EventQueue.java, so deadlock isn't possible. - EventQueue prev = previousQueue; - synchronized ((prev != null) ? prev : this) { - synchronized(this) { - if (nextQueue != null) { - nextQueue.pop(); - return; + EventDispatchThread dt = null; + pushPopLock.lock(); + try { + EventQueue toPop = this; + while (toPop.nextQueue != null) { + toPop = toPop.nextQueue; } - if (previousQueue == null) { + EventQueue prev = toPop.previousQueue; + if (prev == null) { throw new EmptyStackException(); } + toPop.previousQueue = null; // Transfer all events back to previous EventQueue. - previousQueue.nextQueue = null; - while (peekEvent() != null) { + prev.nextQueue = null; + while (toPop.peekEvent() != null) { try { - previousQueue.postEventPrivate(getNextEvent()); + prev.postEventPrivate(toPop.getNextEvent()); } catch (InterruptedException ie) { if (eventLog.isLoggable(PlatformLogger.FINE)) { eventLog.fine("Interrupted pop", ie); @@ -797,14 +848,14 @@ public class EventQueue { } AppContext appContext = AppContext.getAppContext(); if (appContext.get(AppContext.EVENT_QUEUE_KEY) == this) { - appContext.put(AppContext.EVENT_QUEUE_KEY, previousQueue); + appContext.put(AppContext.EVENT_QUEUE_KEY, prev); } - previousQueue = null; - } + dt = toPop.dispatchThread; + } finally { + pushPopLock.unlock(); } - EventDispatchThread dt = this.dispatchThread; if (dt != null) { dt.stopDispatching(); // Must be done outside synchronized // block to avoid possible deadlock @@ -833,16 +884,27 @@ public class EventQueue { */ public static boolean isDispatchThread() { EventQueue eq = Toolkit.getEventQueue(); - EventQueue next = eq.nextQueue; - while (next != null) { - eq = next; - next = eq.nextQueue; + return eq.isDispatchThreadImpl(); + } + + final boolean isDispatchThreadImpl() { + EventQueue eq = this; + pushPopLock.lock(); + try { + EventQueue next = eq.nextQueue; + while (next != null) { + eq = next; + next = eq.nextQueue; + } + return (Thread.currentThread() == eq.dispatchThread); + } finally { + pushPopLock.unlock(); } - return (Thread.currentThread() == eq.dispatchThread); } final void initDispatchThread() { - synchronized (this) { + pushPopLock.lock(); + try { AppContext appContext = AppContext.getAppContext(); if (dispatchThread == null && !threadGroup.isDestroyed() && !appContext.isDisposed()) { dispatchThread = (EventDispatchThread) @@ -861,11 +923,45 @@ public class EventQueue { AWTAutoShutdown.getInstance().notifyThreadBusy(dispatchThread); dispatchThread.start(); } + } finally { + pushPopLock.unlock(); } } - final void detachDispatchThread() { - dispatchThread = null; + final void detachDispatchThread(EventDispatchThread edt, boolean restart) { + /* + * This synchronized block is to secure that the event dispatch + * thread won't die in the middle of posting a new event to the + * associated event queue. It is important because we notify + * that the event dispatch thread is busy after posting a new event + * to its queue, so the EventQueue.dispatchThread reference must + * be valid at that point. + */ + pushPopLock.lock(); + try { + EventDispatchThread oldDispatchThread = dispatchThread; + if (dispatchThread == edt) { + dispatchThread = null; + } + if (restart) { + /* + * Event dispatch thread dies in case of an uncaught exception. + * A new event dispatch thread for this queue will be started + * only if a new event is posted to it. In case if no more + * events are posted after this thread died all events that + * currently are in the queue will never be dispatched. + * + * Fix for 4648733. Check both the associated java event + * queue and the PostEventQueue. + */ + if ((peekEvent() != null) || !SunToolkit.isPostEventQueueEmpty()) { + initDispatchThread(); + } + AWTAutoShutdown.getInstance().notifyThreadFree(oldDispatchThread); + } + } finally { + pushPopLock.unlock(); + } } /* @@ -878,7 +974,12 @@ public class EventQueue { * @see java.awt.EventQueue#detachDispatchThread */ final EventDispatchThread getDispatchThread() { - return dispatchThread; + pushPopLock.lock(); + try { + return dispatchThread; + } finally { + pushPopLock.unlock(); + } } /* @@ -895,7 +996,8 @@ public class EventQueue { */ final void removeSourceEvents(Object source, boolean removeAllEvents) { SunToolkit.flushPendingEvents(); - synchronized (this) { + pushPopLock.lock(); + try { for (int i = 0; i < NUM_PRIORITIES; i++) { EventQueueItem entry = queues[i].head; EventQueueItem prev = null; @@ -928,43 +1030,49 @@ public class EventQueue { } queues[i].tail = prev; } + } finally { + pushPopLock.unlock(); } } static void setCurrentEventAndMostRecentTime(AWTEvent e) { Toolkit.getEventQueue().setCurrentEventAndMostRecentTimeImpl(e); } - private synchronized void setCurrentEventAndMostRecentTimeImpl(AWTEvent e) - { - if (Thread.currentThread() != dispatchThread) { - return; - } + private void setCurrentEventAndMostRecentTimeImpl(AWTEvent e) { + pushPopLock.lock(); + try { + if (Thread.currentThread() != dispatchThread) { + return; + } - currentEvent = new WeakReference(e); + currentEvent = new WeakReference(e); - // This series of 'instanceof' checks should be replaced with a - // polymorphic type (for example, an interface which declares a - // getWhen() method). However, this would require us to make such - // a type public, or to place it in sun.awt. Both of these approaches - // have been frowned upon. So for now, we hack. - // - // In tiger, we will probably give timestamps to all events, so this - // will no longer be an issue. - long mostRecentEventTime2 = Long.MIN_VALUE; - if (e instanceof InputEvent) { - InputEvent ie = (InputEvent)e; - mostRecentEventTime2 = ie.getWhen(); - } else if (e instanceof InputMethodEvent) { - InputMethodEvent ime = (InputMethodEvent)e; - mostRecentEventTime2 = ime.getWhen(); - } else if (e instanceof ActionEvent) { - ActionEvent ae = (ActionEvent)e; - mostRecentEventTime2 = ae.getWhen(); - } else if (e instanceof InvocationEvent) { - InvocationEvent ie = (InvocationEvent)e; - mostRecentEventTime2 = ie.getWhen(); + // This series of 'instanceof' checks should be replaced with a + // polymorphic type (for example, an interface which declares a + // getWhen() method). However, this would require us to make such + // a type public, or to place it in sun.awt. Both of these approaches + // have been frowned upon. So for now, we hack. + // + // In tiger, we will probably give timestamps to all events, so this + // will no longer be an issue. + long mostRecentEventTime2 = Long.MIN_VALUE; + if (e instanceof InputEvent) { + InputEvent ie = (InputEvent)e; + mostRecentEventTime2 = ie.getWhen(); + } else if (e instanceof InputMethodEvent) { + InputMethodEvent ime = (InputMethodEvent)e; + mostRecentEventTime2 = ime.getWhen(); + } else if (e instanceof ActionEvent) { + ActionEvent ae = (ActionEvent)e; + mostRecentEventTime2 = ae.getWhen(); + } else if (e instanceof InvocationEvent) { + InvocationEvent ie = (InvocationEvent)e; + mostRecentEventTime2 = ie.getWhen(); + } + mostRecentEventTime = Math.max(mostRecentEventTime, mostRecentEventTime2); + } finally { + pushPopLock.unlock(); } - mostRecentEventTime = Math.max(mostRecentEventTime, mostRecentEventTime2); } /** @@ -1045,15 +1153,18 @@ public class EventQueue { * or starts a new one otherwise. */ private void wakeup(boolean isShutdown) { - synchronized(this) { + pushPopLock.lock(); + try { if (nextQueue != null) { // Forward call to the top of EventQueue stack. nextQueue.wakeup(isShutdown); } else if (dispatchThread != null) { - notifyAll(); + pushPopCond.signalAll(); } else if (!isShutdown) { initDispatchThread(); } + } finally { + pushPopLock.unlock(); } } } diff --git a/jdk/src/share/classes/java/awt/FileDialog.java b/jdk/src/share/classes/java/awt/FileDialog.java index 973ba4e16ee..34cd2f8179a 100644 --- a/jdk/src/share/classes/java/awt/FileDialog.java +++ b/jdk/src/share/classes/java/awt/FileDialog.java @@ -28,6 +28,8 @@ import java.awt.peer.FileDialogPeer; import java.io.FilenameFilter; import java.io.IOException; import java.io.ObjectInputStream; +import java.io.File; +import sun.awt.AWTAccessor; /** * The FileDialog class displays a dialog window @@ -93,6 +95,25 @@ public class FileDialog extends Dialog { */ String file; + /** + * Contains the File instances for all the files that the user selects. + * + * @serial + * @see getFiles + * @since 1.7 + */ + private File[] files; + + /** + * Represents whether the file dialog allows the multiple file selection. + * + * @serial + * @see #setMultipleMode + * @see #isMultipleMode + * @since 1.7 + */ + private boolean multipleMode = false; + /* * The filter used as the file dialog's filename filter. * The file dialog will only be displaying files whose @@ -123,6 +144,26 @@ public class FileDialog extends Dialog { } } + static { + AWTAccessor.setFileDialogAccessor( + new AWTAccessor.FileDialogAccessor() { + public void setFiles(FileDialog fileDialog, String directory, String files[]) { + fileDialog.setFiles(directory, files); + } + public void setFile(FileDialog fileDialog, String file) { + fileDialog.file = ("".equals(file)) ? null : file; + } + public void setDirectory(FileDialog fileDialog, String directory) { + fileDialog.dir = ("".equals(directory)) ? null : directory; + } + public boolean isMultipleMode(FileDialog fileDialog) { + synchronized (fileDialog.getObjectLock()) { + return fileDialog.multipleMode; + } + } + }); + } + /** * Initialize JNI field and method IDs for fields that may be accessed from C. @@ -370,6 +411,51 @@ public class FileDialog extends Dialog { return file; } + /** + * Returns files that the user selects. + *

+ * If the user cancels the file dialog, + * then the method returns an empty array. + * + * @return files that the user selects or an empty array + * if the user cancels the file dialog. + * @see #setFile(String) + * @see #getFile + * @since 1.7 + */ + public File[] getFiles() { + synchronized (getObjectLock()) { + if (files != null) { + return files.clone(); + } else { + return new File[0]; + } + } + } + + /** + * Stores the names of all the files that the user selects. + * + * Note that the method is private and it's intended to be used + * by the peers through the AWTAccessor API. + * + * @param directory the current directory + * @param files the array that contains the short names of + * all the files that the user selects. + * + * @see #getFiles + * @since 1.7 + */ + private void setFiles(String directory, String files[]) { + synchronized (getObjectLock()) { + int filesNumber = (files != null) ? files.length : 0; + this.files = new File[filesNumber]; + for (int i = 0; i < filesNumber; i++) { + this.files[i] = new File(directory, files[i]); + } + } + } + /** * Sets the selected file for this file dialog window to be the * specified file. This file becomes the default file if it is set @@ -380,7 +466,8 @@ public class FileDialog extends Dialog { * as the file. * * @param file the file being set - * @see java.awt.FileDialog#getFile + * @see #getFile + * @see #getFiles */ public void setFile(String file) { this.file = (file != null && file.equals("")) ? null : file; @@ -390,6 +477,34 @@ public class FileDialog extends Dialog { } } + /** + * Enables or disables multiple file selection for the file dialog. + * + * @param enable if {@code true}, multiple file selection is enabled; + * {@code false} - disabled. + * @see #isMultipleMode + * @since 1.7 + */ + public void setMultipleMode(boolean enable) { + synchronized (getObjectLock()) { + this.multipleMode = enable; + } + } + + /** + * Returns whether the file dialog allows the multiple file selection. + * + * @return {@code true} if the file dialog allows the multiple + * file selection; {@code false} otherwise. + * @see #setMultipleMode + * @since 1.7 + */ + public boolean isMultipleMode() { + synchronized (getObjectLock()) { + return multipleMode; + } + } + /** * Determines this file dialog's filename filter. A filename filter * allows the user to specify which files appear in the file dialog diff --git a/jdk/src/share/classes/java/awt/GraphicsEnvironment.java b/jdk/src/share/classes/java/awt/GraphicsEnvironment.java index 392a4478140..860be245ec3 100644 --- a/jdk/src/share/classes/java/awt/GraphicsEnvironment.java +++ b/jdk/src/share/classes/java/awt/GraphicsEnvironment.java @@ -110,7 +110,7 @@ public abstract class GraphicsEnvironment { // long t1 = System.currentTimeMillis(); // System.out.println("GE creation took " + (t1-t0)+ "ms."); if (isHeadless()) { - localEnv = new HeadlessGraphicsEnvironment(localEnv); + ge = new HeadlessGraphicsEnvironment(ge); } } catch (ClassNotFoundException e) { throw new Error("Could not find class: "+nm); diff --git a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java index fd412d8646e..e515e8963fd 100644 --- a/jdk/src/share/classes/java/awt/KeyboardFocusManager.java +++ b/jdk/src/share/classes/java/awt/KeyboardFocusManager.java @@ -53,8 +53,7 @@ import java.util.Set; import java.util.StringTokenizer; import java.util.WeakHashMap; -import java.util.logging.Level; -import java.util.logging.Logger; +import sun.util.logging.PlatformLogger; import sun.awt.AppContext; import sun.awt.HeadlessToolkit; @@ -111,7 +110,7 @@ public abstract class KeyboardFocusManager { // Shared focus engine logger - private static final Logger focusLog = Logger.getLogger("java.awt.focus.KeyboardFocusManager"); + private static final PlatformLogger focusLog = PlatformLogger.getLogger("java.awt.focus.KeyboardFocusManager"); static { /* ensure that the necessary native libraries are loaded */ @@ -154,7 +153,7 @@ public abstract class KeyboardFocusManager */ private static native void initIDs(); - private static final Logger log = Logger.getLogger("java.awt.KeyboardFocusManager"); + private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.KeyboardFocusManager"); /** * The identifier for the Forward focus traversal keys. @@ -504,8 +503,8 @@ public abstract class KeyboardFocusManager if (this == getCurrentKeyboardFocusManager()) { return focusOwner; } else { - if (focusLog.isLoggable(Level.FINER)) { - focusLog.log(Level.FINER, "This manager is " + this + ", current is " + getCurrentKeyboardFocusManager()); + if (focusLog.isLoggable(PlatformLogger.FINER)) { + focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager()); } throw new SecurityException(notPrivileged); } @@ -609,9 +608,9 @@ public abstract class KeyboardFocusManager } void setNativeFocusOwner(Component comp) { - if (focusLog.isLoggable(Level.FINEST)) { - focusLog.log(Level.FINEST, "Calling peer {0} setCurrentFocusOwner for {1}", - new Object[] {String.valueOf(peer), String.valueOf(comp)}); + if (focusLog.isLoggable(PlatformLogger.FINEST)) { + focusLog.finest("Calling peer {0} setCurrentFocusOwner for {1}", + String.valueOf(peer), String.valueOf(comp)); } peer.setCurrentFocusOwner(comp); } @@ -673,8 +672,8 @@ public abstract class KeyboardFocusManager if (this == getCurrentKeyboardFocusManager()) { return permanentFocusOwner; } else { - if (focusLog.isLoggable(Level.FINER)) { - focusLog.log(Level.FINER, "This manager is " + this + ", current is " + getCurrentKeyboardFocusManager()); + if (focusLog.isLoggable(PlatformLogger.FINER)) { + focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager()); } throw new SecurityException(notPrivileged); } @@ -781,8 +780,8 @@ public abstract class KeyboardFocusManager if (this == getCurrentKeyboardFocusManager()) { return focusedWindow; } else { - if (focusLog.isLoggable(Level.FINER)) { - focusLog.log(Level.FINER, "This manager is " + this + ", current is " + getCurrentKeyboardFocusManager()); + if (focusLog.isLoggable(PlatformLogger.FINER)) { + focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager()); } throw new SecurityException(notPrivileged); } @@ -885,8 +884,8 @@ public abstract class KeyboardFocusManager if (this == getCurrentKeyboardFocusManager()) { return activeWindow; } else { - if (focusLog.isLoggable(Level.FINER)) { - focusLog.log(Level.FINER, "This manager is " + this + ", current is " + getCurrentKeyboardFocusManager()); + if (focusLog.isLoggable(PlatformLogger.FINER)) { + focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager()); } throw new SecurityException(notPrivileged); } @@ -919,8 +918,8 @@ public abstract class KeyboardFocusManager Window oldActiveWindow; synchronized (KeyboardFocusManager.class) { oldActiveWindow = getActiveWindow(); - if (focusLog.isLoggable(Level.FINER)) { - focusLog.log(Level.FINER, "Setting global active window to " + activeWindow + ", old active " + oldActiveWindow); + if (focusLog.isLoggable(PlatformLogger.FINER)) { + focusLog.finer("Setting global active window to " + activeWindow + ", old active " + oldActiveWindow); } try { @@ -1215,8 +1214,8 @@ public abstract class KeyboardFocusManager if (this == getCurrentKeyboardFocusManager()) { return currentFocusCycleRoot; } else { - if (focusLog.isLoggable(Level.FINER)) { - focusLog.log(Level.FINER, "This manager is " + this + ", current is " + getCurrentKeyboardFocusManager()); + if (focusLog.isLoggable(PlatformLogger.FINER)) { + focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager()); } throw new SecurityException(notPrivileged); } @@ -2149,9 +2148,9 @@ public abstract class KeyboardFocusManager HeavyweightFocusRequest(Component heavyweight, Component descendant, boolean temporary, CausedFocusEvent.Cause cause) { - if (log.isLoggable(Level.FINE)) { + if (log.isLoggable(PlatformLogger.FINE)) { if (heavyweight == null) { - log.log(Level.FINE, "Assertion (heavyweight != null) failed"); + log.fine("Assertion (heavyweight != null) failed"); } } @@ -2161,12 +2160,12 @@ public abstract class KeyboardFocusManager } boolean addLightweightRequest(Component descendant, boolean temporary, CausedFocusEvent.Cause cause) { - if (log.isLoggable(Level.FINE)) { + if (log.isLoggable(PlatformLogger.FINE)) { if (this == HeavyweightFocusRequest.CLEAR_GLOBAL_FOCUS_OWNER) { - log.log(Level.FINE, "Assertion (this != HeavyweightFocusRequest.CLEAR_GLOBAL_FOCUS_OWNER) failed"); + log.fine("Assertion (this != HeavyweightFocusRequest.CLEAR_GLOBAL_FOCUS_OWNER) failed"); } if (descendant == null) { - log.log(Level.FINE, "Assertion (descendant != null) failed"); + log.fine("Assertion (descendant != null) failed"); } } @@ -2339,12 +2338,12 @@ public abstract class KeyboardFocusManager (Component heavyweight, Component descendant, boolean temporary, boolean focusedWindowChangeAllowed, long time, CausedFocusEvent.Cause cause) { - if (log.isLoggable(Level.FINE)) { + if (log.isLoggable(PlatformLogger.FINE)) { if (heavyweight == null) { - log.log(Level.FINE, "Assertion (heavyweight != null) failed"); + log.fine("Assertion (heavyweight != null) failed"); } if (time == 0) { - log.log(Level.FINE, "Assertion (time != 0) failed"); + log.fine("Assertion (time != 0) failed"); } } @@ -2361,31 +2360,31 @@ public abstract class KeyboardFocusManager Component currentFocusOwner = thisManager.getGlobalFocusOwner(); Component nativeFocusOwner = thisManager.getNativeFocusOwner(); Window nativeFocusedWindow = thisManager.getNativeFocusedWindow(); - if (focusLog.isLoggable(Level.FINER)) { - focusLog.log(Level.FINER, "SNFH for {0} in {1}", - new Object[] {String.valueOf(descendant), String.valueOf(heavyweight)}); + if (focusLog.isLoggable(PlatformLogger.FINER)) { + focusLog.finer("SNFH for {0} in {1}", + String.valueOf(descendant), String.valueOf(heavyweight)); } - if (focusLog.isLoggable(Level.FINEST)) { - focusLog.log(Level.FINEST, "0. Current focus owner {0}", - String.valueOf(currentFocusOwner)); - focusLog.log(Level.FINEST, "0. Native focus owner {0}", - String.valueOf(nativeFocusOwner)); - focusLog.log(Level.FINEST, "0. Native focused window {0}", - String.valueOf(nativeFocusedWindow)); + if (focusLog.isLoggable(PlatformLogger.FINEST)) { + focusLog.finest("0. Current focus owner {0}", + String.valueOf(currentFocusOwner)); + focusLog.finest("0. Native focus owner {0}", + String.valueOf(nativeFocusOwner)); + focusLog.finest("0. Native focused window {0}", + String.valueOf(nativeFocusedWindow)); } synchronized (heavyweightRequests) { HeavyweightFocusRequest hwFocusRequest = getLastHWRequest(); - if (focusLog.isLoggable(Level.FINEST)) { - focusLog.log(Level.FINEST, "Request {0}", String.valueOf(hwFocusRequest)); + if (focusLog.isLoggable(PlatformLogger.FINEST)) { + focusLog.finest("Request {0}", String.valueOf(hwFocusRequest)); } if (hwFocusRequest == null && heavyweight == nativeFocusOwner) { if (descendant == currentFocusOwner) { // Redundant request. - if (focusLog.isLoggable(Level.FINEST)) - focusLog.log(Level.FINEST, "1. SNFH_FAILURE for {0}", - String.valueOf(descendant)); + if (focusLog.isLoggable(PlatformLogger.FINEST)) + focusLog.finest("1. SNFH_FAILURE for {0}", + String.valueOf(descendant)); return SNFH_FAILURE; } @@ -2417,8 +2416,8 @@ public abstract class KeyboardFocusManager // SunToolkit.postPriorityEvent(newFocusOwnerEvent); SunToolkit.postEvent(descendant.appContext, newFocusOwnerEvent); - if (focusLog.isLoggable(Level.FINEST)) - focusLog.log(Level.FINEST, "2. SNFH_HANDLED for {0}", String.valueOf(descendant)); + if (focusLog.isLoggable(PlatformLogger.FINEST)) + focusLog.finest("2. SNFH_HANDLED for {0}", String.valueOf(descendant)); return SNFH_SUCCESS_HANDLED; } else if (hwFocusRequest != null && hwFocusRequest.heavyweight == heavyweight) { @@ -2431,7 +2430,7 @@ public abstract class KeyboardFocusManager manager.enqueueKeyEvents(time, descendant); } - if (focusLog.isLoggable(Level.FINEST)) + if (focusLog.isLoggable(PlatformLogger.FINEST)) focusLog.finest("3. SNFH_HANDLED for lightweight" + descendant + " in " + heavyweight); return SNFH_SUCCESS_HANDLED; @@ -2454,7 +2453,7 @@ public abstract class KeyboardFocusManager (hwFocusRequest != null) ? hwFocusRequest.heavyweight : nativeFocusedWindow)) { - if (focusLog.isLoggable(Level.FINEST)) + if (focusLog.isLoggable(PlatformLogger.FINEST)) focusLog.finest("4. SNFH_FAILURE for " + descendant); return SNFH_FAILURE; } @@ -2464,7 +2463,7 @@ public abstract class KeyboardFocusManager heavyweightRequests.add (new HeavyweightFocusRequest(heavyweight, descendant, temporary, cause)); - if (focusLog.isLoggable(Level.FINEST)) + if (focusLog.isLoggable(PlatformLogger.FINEST)) focusLog.finest("5. SNFH_PROCEED for " + descendant); return SNFH_SUCCESS_PROCEED; } @@ -2855,14 +2854,14 @@ public abstract class KeyboardFocusManager } KeyboardFocusManager manager = getCurrentKeyboardFocusManager(); - if (focusLog.isLoggable(Level.FINER)) { + if (focusLog.isLoggable(PlatformLogger.FINER)) { if (event instanceof FocusEvent || event instanceof WindowEvent) { - focusLog.log(Level.FINER, ">>> {0}", new Object[] {String.valueOf(event)}); + focusLog.finer(">>> {0}", String.valueOf(event)); } - if (focusLog.isLoggable(Level.FINER) && event instanceof KeyEvent) { - focusLog.log(Level.FINER, " focus owner is {0}", - new Object[] {String.valueOf(manager.getGlobalFocusOwner())}); - focusLog.log(Level.FINER, ">>> {0}", new Object[] {String.valueOf(event)}); + if (focusLog.isLoggable(PlatformLogger.FINER) && event instanceof KeyEvent) { + focusLog.finer(" focus owner is {0}", + String.valueOf(manager.getGlobalFocusOwner())); + focusLog.finer(">>> {0}", String.valueOf(event)); } } @@ -2946,9 +2945,9 @@ public abstract class KeyboardFocusManager } } static void removeLastFocusRequest(Component heavyweight) { - if (log.isLoggable(Level.FINE)) { + if (log.isLoggable(PlatformLogger.FINE)) { if (heavyweight == null) { - log.log(Level.FINE, "Assertion (heavyweight != null) failed"); + log.fine("Assertion (heavyweight != null) failed"); } } diff --git a/jdk/src/share/classes/java/awt/Window.java b/jdk/src/share/classes/java/awt/Window.java index c039a717984..a1882030cd2 100644 --- a/jdk/src/share/classes/java/awt/Window.java +++ b/jdk/src/share/classes/java/awt/Window.java @@ -147,6 +147,51 @@ import sun.util.logging.PlatformLogger; */ public class Window extends Container implements Accessible { + /** + * Enumeration of available window types. + * + * A window type defines the generic visual appearance and behavior of a + * top-level window. For example, the type may affect the kind of + * decorations of a decorated {@code Frame} or {@code Dialog} instance. + *

+ * Some platforms may not fully support a certain window type. Depending on + * the level of support, some properties of the window type may be + * disobeyed. + * + * @see #getType + * @see #setType + * @since 1.7 + */ + public static enum Type { + /** + * Represents a normal window. + * + * This is the default type for objects of the {@code Window} class or + * its descendants. Use this type for regular top-level windows. + */ + NORMAL, + + /** + * Represents a utility window. + * + * A utility window is usually a small window such as a toolbar or a + * palette. The native system may render the window with smaller + * title-bar if the window is either a {@code Frame} or a {@code + * Dialog} object, and if it has its decorations enabled. + */ + UTILITY, + + /** + * Represents a popup window. + * + * A popup window is a temporary window such as a drop-down menu or a + * tooltip. On some platforms, windows of that type may be forcibly + * made undecorated even if they are instances of the {@code Frame} or + * {@code Dialog} class, and have decorations enabled. + */ + POPUP + } + /** * This represents the warning message that is * to be displayed in a non secure window. ie : @@ -2717,6 +2762,52 @@ public class Window extends Container implements Accessible { removeFromWindowList(appContext, weakThis); } + /** + * Window type. + * + * Synchronization: ObjectLock + */ + private Type type = Type.NORMAL; + + /** + * Sets the type of the window. + * + * This method can only be called while the window is not displayable. + * + * @throws IllegalComponentStateException if the window + * is displayable. + * @throws IllegalArgumentException if the type is {@code null} + * @see Component#isDisplayable + * @see #getType + * @since 1.7 + */ + public void setType(Type type) { + if (type == null) { + throw new IllegalArgumentException("type should not be null."); + } + synchronized (getTreeLock()) { + if (isDisplayable()) { + throw new IllegalComponentStateException( + "The window is displayable."); + } + synchronized (getObjectLock()) { + this.type = type; + } + } + } + + /** + * Returns the type of the window. + * + * @see #setType + * @since 1.7 + */ + public Type getType() { + synchronized (getObjectLock()) { + return type; + } + } + /** * The window serialized data version. * @@ -3873,6 +3964,18 @@ public class Window extends Container implements Accessible { public void setLWRequestStatus(Window changed, boolean status) { changed.syncLWRequests = status; } + + public boolean isAutoRequestFocus(Window w) { + return w.autoRequestFocus; + } + + public boolean isTrayIconWindow(Window w) { + return w.isTrayIconWindow; + } + + public void setTrayIconWindow(Window w, boolean isTrayIconWindow) { + w.isTrayIconWindow = isTrayIconWindow; + } }); // WindowAccessor } // static diff --git a/jdk/src/share/classes/java/beans/BeanDescriptor.java b/jdk/src/share/classes/java/beans/BeanDescriptor.java index 03c947722a0..0e3ff551b25 100644 --- a/jdk/src/share/classes/java/beans/BeanDescriptor.java +++ b/jdk/src/share/classes/java/beans/BeanDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 1996-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1996-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -101,4 +101,9 @@ public class BeanDescriptor extends FeatureDescriptor { beanClassRef = old.beanClassRef; customizerClassRef = old.customizerClassRef; } + + void appendTo(StringBuilder sb) { + appendTo(sb, "beanClass", this.beanClassRef); + appendTo(sb, "customizerClass", this.customizerClassRef); + } } diff --git a/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java b/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java index 5339aba83e4..9152909816e 100644 --- a/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java +++ b/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -146,6 +146,8 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate { * @param out The code output stream. * @return An expression whose value is oldInstance. * + * @throws NullPointerException if {@code out} is {@code null} + * * @see #DefaultPersistenceDelegate(String[]) */ protected Expression instantiate(Object oldInstance, Encoder out) { @@ -367,6 +369,8 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate { * @param newInstance The instance that is to be modified. * @param out The stream to which any initialization statements should be written. * + * @throws NullPointerException if {@code out} is {@code null} + * * @see java.beans.Introspector#getBeanInfo * @see java.beans.PropertyDescriptor */ diff --git a/jdk/src/share/classes/java/beans/Encoder.java b/jdk/src/share/classes/java/beans/Encoder.java index e7f63397340..1bde88e655e 100644 --- a/jdk/src/share/classes/java/beans/Encoder.java +++ b/jdk/src/share/classes/java/beans/Encoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -112,54 +112,82 @@ public class Encoder { /** * Returns the persistence delegate for the given type. - * The persistence delegate is calculated - * by applying the following of rules in order: - *

    + * The persistence delegate is calculated by applying + * the following rules in order: + *
      *
    1. - * If the type is an array, an internal persistence - * delegate is returned which will instantiate an - * array of the appropriate type and length, initializing - * each of its elements as if they are properties. + * If a persistence delegate is associated with the given type + * by using the {@link #setPersistenceDelegate} method + * it is returned. *
    2. - * If the type is a proxy, an internal persistence - * delegate is returned which will instantiate a - * new proxy instance using the static - * "newProxyInstance" method defined in the - * Proxy class. + * A persistence delegate is then looked up by the name + * composed of the the fully qualified name of the given type + * and the "PersistenceDelegate" postfix. + * For example, a persistence delegate for the {@code Bean} class + * should be named {@code BeanPersistenceDelegate} + * and located in the same package. + *
      +     * public class Bean { ... }
      +     * public class BeanPersistenceDelegate { ... }
      + * The instance of the {@code BeanPersistenceDelegate} class + * is returned for the {@code Bean} class. *
    3. - * If the BeanInfo for this type has a BeanDescriptor - * which defined a "persistenceDelegate" property, this - * value is returned. + * If the type is {@code null}, + * a shared internal persistence delegate is returned + * that encodes {@code null} value. *
    4. - * In all other cases the default persistence delegate - * is returned. The default persistence delegate assumes - * the type is a JavaBean, implying that it has a default constructor - * and that its state may be characterized by the matching pairs - * of "setter" and "getter" methods returned by the Introspector. + * If the type is a {@code enum} declaration, + * a shared internal persistence delegate is returned + * that encodes constants of this enumeration + * by their names. + *
    5. + * If the type is a primitive type or the corresponding wrapper, + * a shared internal persistence delegate is returned + * that encodes values of the given type. + *
    6. + * If the type is an array, + * a shared internal persistence delegate is returned + * that encodes an array of the appropriate type and length, + * and each of its elements as if they are properties. + *
    7. + * If the type is a proxy, + * a shared internal persistence delegate is returned + * that encodes a proxy instance by using + * the {@link java.lang.reflect.Proxy#newProxyInstance} method. + *
    8. + * If the {@link BeanInfo} for this type has a {@link BeanDescriptor} + * which defined a "persistenceDelegate" attribute, + * the value of this named attribute is returned. + *
    9. + * In all other cases the default persistence delegate is returned. + * The default persistence delegate assumes the type is a JavaBean, + * implying that it has a default constructor and that its state + * may be characterized by the matching pairs of "setter" and "getter" + * methods returned by the {@link Introspector} class. * The default constructor is the constructor with the greatest number * of parameters that has the {@link ConstructorProperties} annotation. - * If none of the constructors have the {@code ConstructorProperties} annotation, + * If none of the constructors has the {@code ConstructorProperties} annotation, * then the nullary constructor (constructor with no parameters) will be used. - * For example, in the following the nullary constructor - * for {@code Foo} will be used, while the two parameter constructor - * for {@code Bar} will be used. - * - * public class Foo { + * For example, in the following code fragment, the nullary constructor + * for the {@code Foo} class will be used, + * while the two-parameter constructor + * for the {@code Bar} class will be used. + *
      +     * public class Foo {
            *     public Foo() { ... }
            *     public Foo(int x) { ... }
      -     *   }
      -     *   public class Bar {
      +     * }
      +     * public class Bar {
            *     public Bar() { ... }
            *     @ConstructorProperties({"x"})
            *     public Bar(int x) { ... }
            *     @ConstructorProperties({"x", "y"})
            *     public Bar(int x, int y) { ... }
      -     *   }
      -     * 
      -     * 
+ * } + * * - * @param type The type of the object. - * @return The persistence delegate for this type of object. + * @param type the class of the objects + * @return the persistence delegate for the given type * * @see #setPersistenceDelegate * @see java.beans.Introspector#getBeanInfo @@ -176,21 +204,18 @@ public class Encoder { } /** - * Sets the persistence delegate associated with this type to - * persistenceDelegate. + * Associates the specified persistence delegate with the given type. * - * @param type The class of objects that persistenceDelegate applies to. - * @param persistenceDelegate The persistence delegate for instances of type. + * @param type the class of objects that the specified persistence delegate applies to + * @param delegate the persistence delegate for instances of the given type * * @see #getPersistenceDelegate * @see java.beans.Introspector#getBeanInfo * @see java.beans.BeanInfo#getBeanDescriptor */ - public void setPersistenceDelegate(Class type, - PersistenceDelegate persistenceDelegate) - { + public void setPersistenceDelegate(Class type, PersistenceDelegate delegate) { synchronized (this.finder) { - this.finder.register(type, persistenceDelegate); + this.finder.register(type, delegate); } } diff --git a/jdk/src/share/classes/java/beans/EventSetDescriptor.java b/jdk/src/share/classes/java/beans/EventSetDescriptor.java index 05b62d8caf1..3ab0ab24573 100644 --- a/jdk/src/share/classes/java/beans/EventSetDescriptor.java +++ b/jdk/src/share/classes/java/beans/EventSetDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1996-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,6 @@ package java.beans; import java.lang.ref.Reference; - import java.lang.reflect.Method; /** @@ -357,8 +356,7 @@ public class EventSetDescriptor extends FeatureDescriptor { * @return The method used to register a listener at the event source. */ public synchronized Method getAddListenerMethod() { - return (addMethodDescriptor != null ? - addMethodDescriptor.getMethod() : null); + return getMethod(this.addMethodDescriptor); } private synchronized void setAddListenerMethod(Method method) { @@ -378,8 +376,7 @@ public class EventSetDescriptor extends FeatureDescriptor { * @return The method used to remove a listener at the event source. */ public synchronized Method getRemoveListenerMethod() { - return (removeMethodDescriptor != null ? - removeMethodDescriptor.getMethod() : null); + return getMethod(this.removeMethodDescriptor); } private synchronized void setRemoveListenerMethod(Method method) { @@ -401,8 +398,7 @@ public class EventSetDescriptor extends FeatureDescriptor { * @since 1.4 */ public synchronized Method getGetListenerMethod() { - return (getMethodDescriptor != null ? - getMethodDescriptor.getMethod() : null); + return getMethod(this.getMethodDescriptor); } private synchronized void setGetListenerMethod(Method method) { @@ -522,4 +518,19 @@ public class EventSetDescriptor extends FeatureDescriptor { unicast = old.unicast; inDefaultEventSet = old.inDefaultEventSet; } + + void appendTo(StringBuilder sb) { + appendTo(sb, "unicast", this.unicast); + appendTo(sb, "inDefaultEventSet", this.inDefaultEventSet); + appendTo(sb, "listenerType", this.listenerTypeRef); + appendTo(sb, "getListenerMethod", getMethod(this.getMethodDescriptor)); + appendTo(sb, "addListenerMethod", getMethod(this.addMethodDescriptor)); + appendTo(sb, "removeListenerMethod", getMethod(this.removeMethodDescriptor)); + } + + private static Method getMethod(MethodDescriptor descriptor) { + return (descriptor != null) + ? descriptor.getMethod() + : null; + } } diff --git a/jdk/src/share/classes/java/beans/Expression.java b/jdk/src/share/classes/java/beans/Expression.java index 1eee7e1cb95..35761cae63b 100644 --- a/jdk/src/share/classes/java/beans/Expression.java +++ b/jdk/src/share/classes/java/beans/Expression.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,12 +51,19 @@ public class Expression extends Statement { private Object value = unbound; /** - * Creates a new Statement object with a target, - * methodName and arguments as per the parameters. + * Creates a new {@link Expression} object + * for the specified target object to invoke the method + * specified by the name and by the array of arguments. + *

+ * The {@code target} and the {@code methodName} values should not be {@code null}. + * Otherwise an attempt to execute this {@code Expression} + * will result in a {@code NullPointerException}. + * If the {@code arguments} value is {@code null}, + * an empty array is used as the value of the {@code arguments} property. * - * @param target The target of this expression. - * @param methodName The methodName of this expression. - * @param arguments The arguments of this expression. If null then an empty array will be used. + * @param target the target object of this expression + * @param methodName the name of the method to invoke on the specified target + * @param arguments the array of arguments to invoke the specified method * * @see #getValue */ @@ -66,16 +73,23 @@ public class Expression extends Statement { } /** - * Creates a new Expression object for a method - * that returns a result. The result will never be calculated - * however, since this constructor uses the value - * parameter to set the value property by calling the - * setValue method. + * Creates a new {@link Expression} object with the specified value + * for the specified target object to invoke the method + * specified by the name and by the array of arguments. + * The {@code value} value is used as the value of the {@code value} property, + * so the {@link #getValue} method will return it + * without executing this {@code Expression}. + *

+ * The {@code target} and the {@code methodName} values should not be {@code null}. + * Otherwise an attempt to execute this {@code Expression} + * will result in a {@code NullPointerException}. + * If the {@code arguments} value is {@code null}, + * an empty array is used as the value of the {@code arguments} property. * - * @param value The value of this expression. - * @param target The target of this expression. - * @param methodName The methodName of this expression. - * @param arguments The arguments of this expression. If null then an empty array will be used. + * @param value the value of this expression + * @param target the target object of this expression + * @param methodName the name of the method to invoke on the specified target + * @param arguments the array of arguments to invoke the specified method * * @see #setValue */ diff --git a/jdk/src/share/classes/java/beans/FeatureDescriptor.java b/jdk/src/share/classes/java/beans/FeatureDescriptor.java index 36adbc044d6..58bd79857ba 100644 --- a/jdk/src/share/classes/java/beans/FeatureDescriptor.java +++ b/jdk/src/share/classes/java/beans/FeatureDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1996-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,6 +35,7 @@ import java.lang.reflect.Method; import java.util.Enumeration; import java.util.Hashtable; +import java.util.Map.Entry; /** * The FeatureDescriptor class is the common baseclass for PropertyDescriptor, @@ -393,4 +394,52 @@ public class FeatureDescriptor { private String name; private String displayName; private Hashtable table; + + /** + * Returns a string representation of the object. + * + * @return a string representation of the object + * + * @since 1.7 + */ + public String toString() { + StringBuilder sb = new StringBuilder(getClass().getName()); + sb.append("[name=").append(this.name); + appendTo(sb, "displayName", this.displayName); + appendTo(sb, "shortDescription", this.shortDescription); + appendTo(sb, "preferred", this.preferred); + appendTo(sb, "hidden", this.hidden); + appendTo(sb, "expert", this.expert); + if ((this.table != null) && !this.table.isEmpty()) { + sb.append("; values={"); + for (Entry entry : this.table.entrySet()) { + sb.append(entry.getKey()).append("=").append(entry.getValue()).append("; "); + } + sb.setLength(sb.length() - 2); + sb.append("}"); + } + appendTo(sb); + return sb.append("]").toString(); + } + + void appendTo(StringBuilder sb) { + } + + static void appendTo(StringBuilder sb, String name, Reference reference) { + if (reference != null) { + appendTo(sb, name, reference.get()); + } + } + + static void appendTo(StringBuilder sb, String name, Object value) { + if (value != null) { + sb.append("; ").append(name).append("=").append(value); + } + } + + static void appendTo(StringBuilder sb, String name, boolean value) { + if (value) { + sb.append("; ").append(name); + } + } } diff --git a/jdk/src/share/classes/java/beans/IndexedPropertyChangeEvent.java b/jdk/src/share/classes/java/beans/IndexedPropertyChangeEvent.java index 951cd871fe5..83d6783ee70 100644 --- a/jdk/src/share/classes/java/beans/IndexedPropertyChangeEvent.java +++ b/jdk/src/share/classes/java/beans/IndexedPropertyChangeEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,7 +62,6 @@ public class IndexedPropertyChangeEvent extends PropertyChangeEvent { this.index = index; } - /** * Gets the index of the property that was changed. * @@ -72,4 +71,8 @@ public class IndexedPropertyChangeEvent extends PropertyChangeEvent { public int getIndex() { return index; } + + void appendTo(StringBuilder sb) { + sb.append("; index=").append(getIndex()); + } } diff --git a/jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java b/jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java index e0d2bb4bb4f..3bcf98c42d6 100644 --- a/jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java +++ b/jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 1996-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1996-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,6 @@ package java.beans; import java.lang.ref.Reference; - import java.lang.reflect.Method; /** @@ -117,8 +116,7 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor { * This constructor takes the name of a simple property, and Method * objects for reading and writing the property. * - * @param propertyName The programmatic name of the pro -perty. + * @param propertyName The programmatic name of the property. * @param readMethod The method used for reading the property values as an array. * May be null if the property is write-only or must be indexed. * @param writeMethod The method used for writing the property values as an array. @@ -313,11 +311,14 @@ perty. } /** - * Gets the Class object of the indexed properties' type. - * The returned Class may describe a primitive type such as int. + * Returns the Java type info for the indexed property. + * Note that the {@code Class} object may describe + * primitive Java types such as {@code int}. + * This type is returned by the indexed read method + * or is used as the parameter type of the indexed write method. * - * @return The Class for the indexed properties' type; may return null - * if the type cannot be determined. + * @return the {@code Class} object that represents the Java type info, + * or {@code null} if the type cannot be determined */ public synchronized Class getIndexedPropertyType() { Class type = getIndexedPropertyType0(); @@ -515,20 +516,10 @@ perty. return result; } - /* - public String toString() { - String message = super.toString(); - - message += ", indexedType="; - message += getIndexedPropertyType(); - - message += ", indexedWriteMethod="; - message += indexedWriteMethodName; - - message += ", indexedReadMethod="; - message += indexedReadMethodName; - - return message; + void appendTo(StringBuilder sb) { + super.appendTo(sb); + appendTo(sb, "indexedPropertyType", this.indexedPropertyTypeRef); + appendTo(sb, "indexedReadMethod", this.indexedReadMethodRef); + appendTo(sb, "indexedWriteMethod", this.indexedWriteMethodRef); } - */ } diff --git a/jdk/src/share/classes/java/beans/Introspector.java b/jdk/src/share/classes/java/beans/Introspector.java index 3d56599576d..edf09d7afe5 100644 --- a/jdk/src/share/classes/java/beans/Introspector.java +++ b/jdk/src/share/classes/java/beans/Introspector.java @@ -1,5 +1,5 @@ /* - * Copyright 1996-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1996-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,27 +25,23 @@ package java.beans; +import com.sun.beans.WeakCache; import com.sun.beans.finder.BeanInfoFinder; import com.sun.beans.finder.ClassFinder; import java.lang.ref.Reference; import java.lang.ref.SoftReference; - import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import java.security.AccessController; -import java.security.PrivilegedAction; - -import java.util.Collections; import java.util.Map; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.EventListener; import java.util.List; -import java.util.WeakHashMap; import java.util.TreeMap; +import java.util.WeakHashMap; import sun.awt.AppContext; import sun.reflect.misc.ReflectUtil; @@ -85,20 +81,7 @@ import sun.reflect.misc.ReflectUtil; * patterns to identify property accessors, event sources, or public * methods. We then proceed to analyze the class's superclass and add * in the information from it (and possibly on up the superclass chain). - * *

- * Because the Introspector caches BeanInfo classes for better performance, - * take care if you use it in an application that uses - * multiple class loaders. - * In general, when you destroy a ClassLoader - * that has been used to introspect classes, - * you should use the - * {@link #flushCaches Introspector.flushCaches} - * or - * {@link #flushFromCaches Introspector.flushFromCaches} method - * to flush all of the introspected classes out of the cache. - * - *

* For more information about introspection and design patterns, please * consult the * JavaBeans specification. @@ -112,8 +95,8 @@ public class Introspector { public final static int IGNORE_ALL_BEANINFO = 3; // Static Caches to speed up introspection. - private static Map declaredMethodCache = - Collections.synchronizedMap(new WeakHashMap()); + private static WeakCache, Method[]> declaredMethodCache = + new WeakCache, Method[]>(); private static final Object BEANINFO_CACHE = new Object(); @@ -174,20 +157,21 @@ public class Introspector { if (!ReflectUtil.isPackageAccessible(beanClass)) { return (new Introspector(beanClass, null, USE_ALL_BEANINFO)).getBeanInfo(); } - Map, BeanInfo> map; synchronized (BEANINFO_CACHE) { - map = (Map, BeanInfo>) AppContext.getAppContext().get(BEANINFO_CACHE); - if (map == null) { - map = Collections.synchronizedMap(new WeakHashMap, BeanInfo>()); - AppContext.getAppContext().put(BEANINFO_CACHE, map); + Map, BeanInfo> beanInfoCache = + (Map, BeanInfo>) AppContext.getAppContext().get(BEANINFO_CACHE); + + if (beanInfoCache == null) { + beanInfoCache = new WeakHashMap, BeanInfo>(); + AppContext.getAppContext().put(BEANINFO_CACHE, beanInfoCache); } + BeanInfo beanInfo = beanInfoCache.get(beanClass); + if (beanInfo == null) { + beanInfo = (new Introspector(beanClass, null, USE_ALL_BEANINFO)).getBeanInfo(); + beanInfoCache.put(beanClass, beanInfo); + } + return beanInfo; } - BeanInfo bi = map.get(beanClass); - if (bi == null) { - bi = (new Introspector(beanClass, null, USE_ALL_BEANINFO)).getBeanInfo(); - map.put(beanClass, bi); - } - return bi; } /** @@ -359,11 +343,13 @@ public class Introspector { */ public static void flushCaches() { - Map map = (Map) AppContext.getAppContext().get(BEANINFO_CACHE); - if (map != null) { - map.clear(); + synchronized (BEANINFO_CACHE) { + Map beanInfoCache = (Map) AppContext.getAppContext().get(BEANINFO_CACHE); + if (beanInfoCache != null) { + beanInfoCache.clear(); + } + declaredMethodCache.clear(); } - declaredMethodCache.clear(); } /** @@ -385,11 +371,13 @@ public class Introspector { if (clz == null) { throw new NullPointerException(); } - Map map = (Map) AppContext.getAppContext().get(BEANINFO_CACHE); - if (map != null) { - map.remove(clz); + synchronized (BEANINFO_CACHE) { + Map beanInfoCache = (Map) AppContext.getAppContext().get(BEANINFO_CACHE); + if (beanInfoCache != null) { + beanInfoCache.put(clz, null); + } + declaredMethodCache.put(clz, null); } - declaredMethodCache.remove(clz); } //====================================================================== @@ -1272,41 +1260,26 @@ public class Introspector { /* * Internal method to return *public* methods within a class. */ - private static synchronized Method[] getPublicDeclaredMethods(Class clz) { + private static Method[] getPublicDeclaredMethods(Class clz) { // Looking up Class.getDeclaredMethods is relatively expensive, // so we cache the results. - Method[] result = null; if (!ReflectUtil.isPackageAccessible(clz)) { return new Method[0]; } - final Class fclz = clz; - Reference ref = (Reference)declaredMethodCache.get(fclz); - if (ref != null) { - result = (Method[])ref.get(); - if (result != null) { - return result; - } - } - - // We have to raise privilege for getDeclaredMethods - result = (Method[]) AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - return fclz.getDeclaredMethods(); + synchronized (BEANINFO_CACHE) { + Method[] result = declaredMethodCache.get(clz); + if (result == null) { + result = clz.getMethods(); + for (int i = 0; i < result.length; i++) { + Method method = result[i]; + if (!method.getDeclaringClass().equals(clz)) { + result[i] = null; + } } - }); - - - // Null out any non-public methods. - for (int i = 0; i < result.length; i++) { - Method method = result[i]; - int mods = method.getModifiers(); - if (!Modifier.isPublic(mods)) { - result[i] = null; + declaredMethodCache.put(clz, result); } + return result; } - // Add it to the cache. - declaredMethodCache.put(fclz, new SoftReference(result)); - return result; } //====================================================================== @@ -1488,7 +1461,7 @@ class GenericBeanInfo extends SimpleBeanInfo { private PropertyDescriptor[] properties; private int defaultProperty; private MethodDescriptor[] methods; - private BeanInfo targetBeanInfo; + private final Reference targetBeanInfoRef; public GenericBeanInfo(BeanDescriptor beanDescriptor, EventSetDescriptor[] events, int defaultEvent, @@ -1500,7 +1473,7 @@ class GenericBeanInfo extends SimpleBeanInfo { this.properties = properties; this.defaultProperty = defaultProperty; this.methods = methods; - this.targetBeanInfo = targetBeanInfo; + this.targetBeanInfoRef = new SoftReference(targetBeanInfo); } /** @@ -1539,7 +1512,7 @@ class GenericBeanInfo extends SimpleBeanInfo { methods[i] = new MethodDescriptor(old.methods[i]); } } - targetBeanInfo = old.targetBeanInfo; + this.targetBeanInfoRef = old.targetBeanInfoRef; } public PropertyDescriptor[] getPropertyDescriptors() { @@ -1567,6 +1540,7 @@ class GenericBeanInfo extends SimpleBeanInfo { } public java.awt.Image getIcon(int iconKind) { + BeanInfo targetBeanInfo = this.targetBeanInfoRef.get(); if (targetBeanInfo != null) { return targetBeanInfo.getIcon(iconKind); } diff --git a/jdk/src/share/classes/java/beans/MethodDescriptor.java b/jdk/src/share/classes/java/beans/MethodDescriptor.java index 9916ee9de46..0e04ce3f8c1 100644 --- a/jdk/src/share/classes/java/beans/MethodDescriptor.java +++ b/jdk/src/share/classes/java/beans/MethodDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 1996-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1996-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,9 +27,7 @@ package java.beans; import java.lang.ref.Reference; import java.lang.ref.WeakReference; - import java.lang.reflect.Method; - import java.util.List; import java.util.ArrayList; @@ -166,23 +164,6 @@ public class MethodDescriptor extends FeatureDescriptor { return parameterDescriptors; } - /* - public String toString() { - String message = "name=" + getName(); - Class cls = getClass0(); - if (cls != null) { - message += ", class="; - message += cls.getName(); - } - String[] names = getParamNames(); - if (names != null) { - for (int i = 0; i < names.length; i++) { - message += ", param=" + names[i]; - } - } - return message; - } */ - /* * Package-private constructor * Merge two method descriptors. Where they conflict, give the @@ -233,4 +214,15 @@ public class MethodDescriptor extends FeatureDescriptor { } } + void appendTo(StringBuilder sb) { + appendTo(sb, "method", this.methodRef); + if (this.parameterDescriptors != null) { + sb.append("; parameterDescriptors={"); + for (ParameterDescriptor pd : this.parameterDescriptors) { + sb.append(pd).append(", "); + } + sb.setLength(sb.length() - 2); + sb.append("}"); + } + } } diff --git a/jdk/src/share/classes/java/beans/PersistenceDelegate.java b/jdk/src/share/classes/java/beans/PersistenceDelegate.java index ca837941039..fd9b31a490f 100644 --- a/jdk/src/share/classes/java/beans/PersistenceDelegate.java +++ b/jdk/src/share/classes/java/beans/PersistenceDelegate.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -105,6 +105,8 @@ public abstract class PersistenceDelegate { * * @param oldInstance The instance that will be created by this expression. * @param out The stream to which this expression will be written. + * + * @throws NullPointerException if {@code out} is {@code null} */ public void writeObject(Object oldInstance, Encoder out) { Object newInstance = out.get(oldInstance); @@ -158,6 +160,8 @@ public abstract class PersistenceDelegate { * @param oldInstance The instance that will be created by this expression. * @param out The stream to which this expression will be written. * @return An expression whose value is oldInstance. + * + * @throws NullPointerException if {@code out} is {@code null} */ protected abstract Expression instantiate(Object oldInstance, Encoder out); @@ -196,6 +200,8 @@ public abstract class PersistenceDelegate { * @param oldInstance The instance to be copied. * @param newInstance The instance that is to be modified. * @param out The stream to which any initialization statements should be written. + * + * @throws NullPointerException if {@code out} is {@code null} */ protected void initialize(Class type, Object oldInstance, Object newInstance, diff --git a/jdk/src/share/classes/java/beans/PropertyChangeEvent.java b/jdk/src/share/classes/java/beans/PropertyChangeEvent.java index 3e0c9cef6f9..e8b0a17425e 100644 --- a/jdk/src/share/classes/java/beans/PropertyChangeEvent.java +++ b/jdk/src/share/classes/java/beans/PropertyChangeEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 1996-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1996-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -140,4 +140,25 @@ public class PropertyChangeEvent extends java.util.EventObject { * @see #getPropagationId */ private Object propagationId; + + /** + * Returns a string representation of the object. + * + * @return a string representation of the object + * + * @since 1.7 + */ + public String toString() { + StringBuilder sb = new StringBuilder(getClass().getName()); + sb.append("[propertyName=").append(getPropertyName()); + appendTo(sb); + sb.append("; oldValue=").append(getOldValue()); + sb.append("; newValue=").append(getNewValue()); + sb.append("; propagationId=").append(getPropagationId()); + sb.append("; source=").append(getSource()); + return sb.append("]").toString(); + } + + void appendTo(StringBuilder sb) { + } } diff --git a/jdk/src/share/classes/java/beans/PropertyDescriptor.java b/jdk/src/share/classes/java/beans/PropertyDescriptor.java index 70a539c81fd..e05687d2727 100644 --- a/jdk/src/share/classes/java/beans/PropertyDescriptor.java +++ b/jdk/src/share/classes/java/beans/PropertyDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 1996-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1996-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,6 @@ package java.beans; import java.lang.ref.Reference; - import java.lang.reflect.Method; import java.lang.reflect.Constructor; @@ -164,14 +163,16 @@ public class PropertyDescriptor extends FeatureDescriptor { } /** - * Gets the Class object for the property. + * Returns the Java type info for the property. + * Note that the {@code Class} object may describe + * primitive Java types such as {@code int}. + * This type is returned by the read method + * or is used as the parameter type of the write method. + * Returns {@code null} if the type is an indexed property + * that does not support non-indexed access. * - * @return The Java type info for the property. Note that - * the "Class" object may describe a built-in Java type such as "int". - * The result may be "null" if this is an indexed property that - * does not support non-indexed access. - *

- * This is the type that will be returned by the ReadMethod. + * @return the {@code Class} object that represents the Java type info, + * or {@code null} if the type cannot be determined */ public synchronized Class getPropertyType() { Class type = getPropertyType0(); @@ -708,22 +709,12 @@ public class PropertyDescriptor extends FeatureDescriptor { return baseName; } - /* - public String toString() { - String message = "name=" + getName(); - message += ", class=" + getClass0(); - message += ", type=" + getPropertyType(); - - message += ", writeMethod="; - message += writeMethodName; - - message += ", readMethod="; - message += readMethodName; - - message += ", bound=" + bound; - message += ", constrained=" + constrained; - - return message; + void appendTo(StringBuilder sb) { + appendTo(sb, "bound", this.bound); + appendTo(sb, "constrained", this.constrained); + appendTo(sb, "propertyEditorClass", this.propertyEditorClassRef); + appendTo(sb, "propertyType", this.propertyTypeRef); + appendTo(sb, "readMethod", this.readMethodRef); + appendTo(sb, "writeMethod", this.writeMethodRef); } - */ } diff --git a/jdk/src/share/classes/java/beans/Statement.java b/jdk/src/share/classes/java/beans/Statement.java index 7977d0daeca..a3949642ea8 100644 --- a/jdk/src/share/classes/java/beans/Statement.java +++ b/jdk/src/share/classes/java/beans/Statement.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -74,13 +74,19 @@ public class Statement { ClassLoader loader; /** - * Creates a new Statement object with a target, - * methodName and arguments as per the parameters. - * - * @param target The target of this statement. - * @param methodName The methodName of this statement. - * @param arguments The arguments of this statement. If null then an empty array will be used. + * Creates a new {@link Statement} object + * for the specified target object to invoke the method + * specified by the name and by the array of arguments. + *

+ * The {@code target} and the {@code methodName} values should not be {@code null}. + * Otherwise an attempt to execute this {@code Expression} + * will result in a {@code NullPointerException}. + * If the {@code arguments} value is {@code null}, + * an empty array is used as the value of the {@code arguments} property. * + * @param target the target object of this statement + * @param methodName the name of the method to invoke on the specified target + * @param arguments the array of arguments to invoke the specified method */ @ConstructorProperties({"target", "methodName", "arguments"}) public Statement(Object target, String methodName, Object[] arguments) { @@ -90,27 +96,36 @@ public class Statement { } /** - * Returns the target of this statement. + * Returns the target object of this statement. + * If this method returns {@code null}, + * the {@link #execute} method + * throws a {@code NullPointerException}. * - * @return The target of this statement. + * @return the target object of this statement */ public Object getTarget() { return target; } /** - * Returns the name of the method. + * Returns the name of the method to invoke. + * If this method returns {@code null}, + * the {@link #execute} method + * throws a {@code NullPointerException}. * - * @return The name of the method. + * @return the name of the method */ public String getMethodName() { return methodName; } /** - * Returns the arguments of this statement. + * Returns the arguments for the method to invoke. + * The number of arguments and their types + * must match the method being called. + * {@code null} can be used as a synonym of an empty array. * - * @return the arguments of this statement. + * @return the array of arguments */ public Object[] getArguments() { return arguments; @@ -179,6 +194,9 @@ public class Statement { } Object[] arguments = getArguments(); + if (arguments == null) { + arguments = emptyArray; + } // Class.forName() won't load classes outside // of core from a class inside core. Special // case this method. @@ -310,7 +328,9 @@ public class Statement { Object target = getTarget(); String methodName = getMethodName(); Object[] arguments = getArguments(); - + if (arguments == null) { + arguments = emptyArray; + } StringBuffer result = new StringBuffer(instanceName(target) + "." + methodName + "("); int n = arguments.length; for(int i = 0; i < n; i++) { diff --git a/jdk/src/share/classes/java/beans/XMLEncoder.java b/jdk/src/share/classes/java/beans/XMLEncoder.java index e7884ef631a..e13c8262c88 100644 --- a/jdk/src/share/classes/java/beans/XMLEncoder.java +++ b/jdk/src/share/classes/java/beans/XMLEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -214,8 +214,8 @@ public class XMLEncoder extends Encoder { private Object owner; private int indentation = 0; private boolean internal = false; - private Map valueToExpression; - private Map targetToStatementList; + private Map valueToExpression; + private Map> targetToStatementList; private boolean preambleWritten = false; private NameGenerator nameGenerator; @@ -287,8 +287,8 @@ public class XMLEncoder extends Encoder { this.declaration = declaration; this.indentation = indentation; this.out = new OutputStreamWriter(out, cs.newEncoder()); - valueToExpression = new IdentityHashMap(); - targetToStatementList = new IdentityHashMap(); + valueToExpression = new IdentityHashMap(); + targetToStatementList = new IdentityHashMap>(); nameGenerator = new NameGenerator(); } @@ -331,13 +331,12 @@ public class XMLEncoder extends Encoder { } } - private Vector statementList(Object target) { - Vector list = (Vector)targetToStatementList.get(target); - if (list != null) { - return list; + private List statementList(Object target) { + List list = targetToStatementList.get(target); + if (list == null) { + list = new ArrayList(); + targetToStatementList.put(target, list); } - list = new Vector(); - targetToStatementList.put(target, list); return list; } @@ -363,13 +362,13 @@ public class XMLEncoder extends Encoder { } d.marked = true; Object target = exp.getTarget(); + mark(exp); if (!(target instanceof Class)) { statementList(target).add(exp); // Pending: Why does the reference count need to // be incremented here? d.refs++; } - mark(exp); } private void mark(Statement stm) { @@ -463,9 +462,9 @@ public class XMLEncoder extends Encoder { preambleWritten = true; } indentation++; - Vector roots = statementList(this); - for(int i = 0; i < roots.size(); i++) { - Statement s = (Statement)roots.get(i); + List statements = statementList(this); + while (!statements.isEmpty()) { + Statement s = statements.remove(0); if ("writeObject".equals(s.getMethodName())) { outputValue(s.getArguments()[0], this, true); } @@ -513,7 +512,7 @@ public class XMLEncoder extends Encoder { } private ValueData getValueData(Object o) { - ValueData d = (ValueData)valueToExpression.get(o); + ValueData d = valueToExpression.get(o); if (d == null) { d = new ValueData(); valueToExpression.put(o, d); @@ -619,11 +618,11 @@ public class XMLEncoder extends Encoder { } if (d.name != null) { - writeln(""); - return; + outputXML(isArgument ? "object" : "void", " idref=" + quote(d.name), value); + } + else if (d.exp != null) { + outputStatement(d.exp, outer, isArgument); } - - outputStatement(d.exp, outer, isArgument); } private static String quoteCharCode(int code) { @@ -683,13 +682,6 @@ public class XMLEncoder extends Encoder { String tag = (expression && isArgument) ? "object" : "void"; String attributes = ""; ValueData d = getValueData(value); - if (expression) { - if (d.refs > 1) { - String instanceName = nameGenerator.instanceName(value); - d.name = instanceName; - attributes = attributes + " id=" + quote(instanceName); - } - } // Special cases for targets. if (target == outer) { @@ -706,13 +698,19 @@ public class XMLEncoder extends Encoder { else { d.refs = 2; getValueData(target).refs++; - outputValue(target, outer, false); - if (isArgument) { - outputValue(value, outer, false); + List statements = statementList(target); + if (!statements.contains(exp)) { + statements.add(exp); } + outputValue(target, outer, false); + outputValue(value, outer, isArgument); return; } - + if (expression && (d.refs > 1)) { + String instanceName = nameGenerator.instanceName(value); + d.name = instanceName; + attributes = attributes + " id=" + quote(instanceName); + } // Special cases for methods. if ((!expression && methodName.equals("set") && args.length == 2 && @@ -730,8 +728,11 @@ public class XMLEncoder extends Encoder { else if (!methodName.equals("new") && !methodName.equals("newInstance")) { attributes = attributes + " method=" + quote(methodName); } + outputXML(tag, attributes, value, args); + } - Vector statements = statementList(value); + private void outputXML(String tag, String attributes, Object value, Object... args) { + List statements = statementList(value); // Use XML's short form when there is no body. if (args.length == 0 && statements.size() == 0) { writeln("<" + tag + attributes + "/>"); @@ -745,8 +746,8 @@ public class XMLEncoder extends Encoder { outputValue(args[i], null, true); } - for(int i = 0; i < statements.size(); i++) { - Statement s = (Statement)statements.get(i); + while (!statements.isEmpty()) { + Statement s = statements.remove(0); outputStatement(s, value, false); } diff --git a/jdk/src/share/classes/java/dyn/CallSite.java b/jdk/src/share/classes/java/dyn/CallSite.java index 34624a5a170..b0e5b915579 100644 --- a/jdk/src/share/classes/java/dyn/CallSite.java +++ b/jdk/src/share/classes/java/dyn/CallSite.java @@ -26,6 +26,9 @@ package java.dyn; import sun.dyn.util.BytecodeName; +import sun.dyn.Access; +import sun.dyn.CallSiteImpl; +import sun.dyn.MethodHandleImpl; /** * An {@code invokedynamic} call site, as reified by the @@ -52,15 +55,25 @@ import sun.dyn.util.BytecodeName; * @see Linkage#registerBootstrapMethod(java.lang.Class, java.dyn.MethodHandle) * @author John Rose, JSR 292 EG */ -public class CallSite { +public class CallSite + // Note: This is an implementation inheritance hack, and will be removed + // with a JVM change which moves the required hidden state onto this class. + extends CallSiteImpl +{ + private static final Access IMPL_TOKEN = Access.getToken(); + + /* + // Fields used only by the JVM. Do not use or change. private Object vmmethod; int callerMID, callerBCI; // supplied by the JVM - MethodHandle target; + private MethodHandle target; + final Object caller; // usually a class final String name; final MethodType type; + */ /** * Make a call site given the parameters from a call to the bootstrap method. @@ -72,16 +85,21 @@ public class CallSite { * @param type the method handle type derived from descriptor of the {@code invokedynamic} instruction */ public CallSite(Object caller, String name, MethodType type) { - this.caller = caller; - this.name = name; - this.type = type; + super(IMPL_TOKEN, caller, name, type); } private static void privateInitializeCallSite(CallSite site, int callerMID, int callerBCI) { site.callerMID = callerMID; site.callerBCI = callerBCI; - if (site.target == null) - site.setTarget(site.initialTarget()); + site.ensureTarget(); + } + private void ensureTarget() { + // Note use of super, which accesses the field directly, + // without deferring to possible subclass overrides. + if (super.getTarget() == null) { + super.setTarget(this.initialTarget()); + super.getTarget().type(); // provoke NPE if still null + } } /** @@ -102,10 +120,11 @@ public class CallSite { /** * Report the current linkage state of the call site. (This is mutable.) - * The value maybe null only if the call site is currently unlinked. - * When a linked call site is invoked, the target method is used directly. - * When an unlinked call site is invoked, its bootstrap method receives - * the call, as if via {@link Linkage#bootstrapInvokeDynamic}. + * The value may not be null after the {@code CallSite} object is returned + * from the bootstrap method of the {@code invokedynamic} instruction. + * When an {@code invokedynamic} instruction is executed, the target method + * of its associated {@code call site} object is invoked directly, + * as if via {@link MethodHandle}{@code .invoke}. *

* The interactions of {@code getTarget} with memory are the same * as of a read from an ordinary variable, such as an array element or a @@ -118,7 +137,7 @@ public class CallSite { * @see #setTarget */ public MethodHandle getTarget() { - return target; + return super.getTarget(); } /** @@ -140,13 +159,13 @@ public class CallSite { */ public void setTarget(MethodHandle target) { checkTarget(target); - this.target = target; + super.setTarget(target); } protected void checkTarget(MethodHandle target) { target.type(); // provoke NPE if (!canSetTarget(target)) - throw new WrongMethodTypeException(String.valueOf(target)); + throw new WrongMethodTypeException(String.valueOf(target)+target.type()+" should be of type "+type()); } protected boolean canSetTarget(MethodHandle target) { @@ -219,6 +238,10 @@ public class CallSite { @Override public String toString() { - return "CallSite#"+hashCode()+"["+name+type+" => "+target+"]"; + return "CallSite#"+hashCode()+"["+name+type+" => "+getTarget()+"]"; } + + // Package-local constant: + static final MethodHandle GET_TARGET = MethodHandleImpl.getLookup(IMPL_TOKEN). + findVirtual(CallSite.class, "getTarget", MethodType.methodType(MethodHandle.class)); } diff --git a/jdk/src/share/classes/java/dyn/InvokeDynamic.java b/jdk/src/share/classes/java/dyn/InvokeDynamic.java index 2bec7b7dfe6..bd92f8c5446 100644 --- a/jdk/src/share/classes/java/dyn/InvokeDynamic.java +++ b/jdk/src/share/classes/java/dyn/InvokeDynamic.java @@ -45,6 +45,24 @@ package java.dyn; * class or interface supertype, or an object type; it can never be instantiated. * Logically, it denotes a source of all dynamically typed methods. * It may be viewed as a pure syntactic marker (an importable one) of static calls. + *

+ * Here are some examples of usage: + *

+ * Object x; String s; int i;
+ * x = InvokeDynamic.greet("world"); // greet(Ljava/lang/String;)Ljava/lang/Object;
+ * s = InvokeDynamic.<String>hail(x); // hail(Ljava/lang/Object;)Ljava/lang/String;
+ * InvokeDynamic.<void>cogito(); // cogito()V
+ * i = InvokeDynamic.<int>#"op:+"(2, 3); // "op:+"(II)I
+ * 
+ * Each of the above calls generates a single invokedynamic instruction + * with the name-and-type descriptors indicated in the comments. + * The argument types are taken directly from the actual arguments, + * while the return type is taken from the type parameter. + * (This type parameter may be a primtive, and it defaults to {@code Object}.) + * The final example uses a special syntax for uttering non-Java names. + * Any name legal to the JVM may be given between the double quotes. + * None of these calls is complete without a bootstrap method, + * which must be registered by the static initializer of the enclosing class. * @author John Rose, JSR 292 EG */ public final class InvokeDynamic { diff --git a/jdk/src/share/classes/java/dyn/InvokeDynamicBootstrapError.java b/jdk/src/share/classes/java/dyn/InvokeDynamicBootstrapError.java index 975ba7d3a2d..b6678c386ee 100644 --- a/jdk/src/share/classes/java/dyn/InvokeDynamicBootstrapError.java +++ b/jdk/src/share/classes/java/dyn/InvokeDynamicBootstrapError.java @@ -52,4 +52,16 @@ public class InvokeDynamicBootstrapError extends LinkageError { public InvokeDynamicBootstrapError(String s) { super(s); } + + /** + * Constructs a {@code InvokeDynamicBootstrapError} with the specified + * detail message and cause. + * + * @param s the detail message. + * @param cause the cause. + */ + public InvokeDynamicBootstrapError(String s, Throwable cause) { + super(s); + this.initCause(cause); + } } diff --git a/jdk/src/share/classes/java/dyn/JavaMethodHandle.java b/jdk/src/share/classes/java/dyn/JavaMethodHandle.java index b7432a77521..4c883a53c91 100644 --- a/jdk/src/share/classes/java/dyn/JavaMethodHandle.java +++ b/jdk/src/share/classes/java/dyn/JavaMethodHandle.java @@ -25,6 +25,8 @@ package java.dyn; +import sun.dyn.Access; + /** * A Java method handle extends the basic method handle type with additional * programmer defined methods and fields. @@ -39,31 +41,105 @@ package java.dyn; * of the entry point method handle, with the leading parameter type * omitted. *

- * Here is an example of usage: + * Here is an example of usage, creating a hybrid object/functional datum: *

- *     class Greeter extends JavaMethodHandle {
- *         public void run() { System.out.println("hello, "+greetee); }
- *         private final String greetee;
- *         Greeter(String greetee) {
- *             super(RUN);
- *             this.greetee = greetee;
- *         }
- *         // the entry point function is computed once:
- *         private static final MethodHandle RUN
- *             = MethodHandles.findVirtual(MyMethodHandle.class, "run",
- *                   MethodType.make(void.class));
+ * class Greeter extends JavaMethodHandle {
+ *     private String greeting = "hello";
+ *     public void setGreeting(String s) { greeting = s; }
+ *     public void run() { System.out.println(greeting+", "+greetee); }
+ *     private final String greetee;
+ *     Greeter(String greetee) {
+ *         super(RUN); // alternatively, super("run")
+ *         this.greetee = greetee;
  *     }
- *     Greeter greeter = new Greeter("world");
- *     greeter.run();  // prints "hello, world"
- *     MethodHandle mh = greeter;
- *     mh.invoke();  // also prints "hello, world"
+ *     // the entry point function is computed once:
+ *     private static final MethodHandle RUN
+ *         = MethodHandles.lookup().findVirtual(Greeter.class, "run",
+ *               MethodType.make(void.class));
+ * }
+ * // class Main { public static void main(String... av) { ...
+ * Greeter greeter = new Greeter("world");
+ * greeter.run();  // prints "hello, world"
+ * // Statically typed method handle invocation (most direct):
+ * MethodHandle mh = greeter;
+ * mh.<void>invoke();  // also prints "hello, world"
+ * // Dynamically typed method handle invocation:
+ * MethodHandles.invoke(greeter);  // also prints "hello, world"
+ * greeter.setGreeting("howdy");
+ * mh.invoke();  // prints "howdy, world" (object-like mutable behavior)
  * 
*

- * In this example, the method {@code run} provides the entry point. + * In the example of {@code Greeter}, the method {@code run} provides the entry point. * The entry point need not be a constant value; it may be independently * computed in each call to the constructor. The entry point does not - * even need to be a method on the Java method handle class, though + * even need to be a method on the {@code Greeter} class, though * that is the typical case. + *

+ * The entry point may also be provided symbolically, in which case the the + * {@code JavaMethodHandle} constructor performs the lookup of the entry point. + * This makes it possible to use {@code JavaMethodHandle} to create an anonymous + * inner class: + *

+ * // We can also do this with symbolic names and/or inner classes:
+ * MethodHandles.invoke(new JavaMethodHandle("yow") {
+ *     void yow() { System.out.println("yow, world"); }
+ * });
+ * 
+ *

+ * Here is similar lower-level code which works in terms of a bound method handle. + *

+ *     class Greeter {
+ *         public void run() { System.out.println("hello, "+greetee); }
+ *         private final String greetee;
+ *         Greeter(String greetee) { this.greetee = greetee; }
+ *         // the entry point function is computed once:
+ *         private static final MethodHandle RUN
+ *             = MethodHandles.findVirtual(Greeter.class, "run",
+ *                   MethodType.make(void.class));
+ *     }
+ *     // class Main { public static void main(String... av) { ...
+ *     Greeter greeter = new Greeter("world");
+ *     greeter.run();  // prints "hello, world"
+ *     MethodHandle mh = MethodHanndles.insertArgument(Greeter.RUN, 0, greeter);
+ *     mh.invoke();  // also prints "hello, world"
+ * 
+ * Note that the method handle must be separately created as a view on the base object. + * This increases footprint, complexity, and dynamic indirections. + *

+ * Here is a pure functional value expressed most concisely as an anonymous inner class: + *

+ *     // class Main { public static void main(String... av) { ...
+ *     final String greetee = "world";
+ *     MethodHandle greeter = new JavaMethodHandle("run") {
+ *         private void run() { System.out.println("hello, "+greetee); }
+ *     }
+ *     greeter.invoke();  // prints "hello, world"
+ * 
+ *

+ * Here is an abstract parameterized lvalue, efficiently expressed as a subtype of MethodHandle, + * and instantiated as an anonymous class. The data structure is a handle to 1-D array, + * with a specialized index type (long). It is created by inner class, and uses + * signature-polymorphic APIs throughout. + *

+ *     abstract class AssignableMethodHandle extends JavaMethodHandle {
+ *       private final MethodHandle setter;
+ *       public MethodHandle setter() { return setter; }
+ *       public AssignableMethodHandle(String get, String set) {
+ *         super(get);
+ *         MethodType getType = this.type();
+ *         MethodType setType = getType.insertParameterType(getType.parameterCount(), getType.returnType()).changeReturnType(void.class);
+ *         this.setter = MethodHandles.publicLookup().bind(this, set, setType);
+ *       }
+ *     }
+ *     // class Main { public static void main(String... av) { ...
+ *     final Number[] stuff = { 123, 456 };
+ *     AssignableMethodHandle stuffPtr = new AssignableMethodHandle("get", "set") {
+ *         public Number get(long i)           { return stuff[(int)i]; }
+ *         public void   set(long i, Object x) {        stuff[(int)i] = x; }
+ *     }
+ *     int x = (Integer) stuffPtr.<Number>invoke(1L);  // 456
+ *     stuffPtr.setter().<void>invoke(0L, (Number) 789);  // replaces 123 with 789
+ * 
* @see MethodHandle * @author John Rose, JSR 292 EG */ @@ -72,12 +148,87 @@ public abstract class JavaMethodHandle // with a JVM change which moves the required hidden behavior onto this class. extends sun.dyn.BoundMethodHandle { + private static final Access IMPL_TOKEN = Access.getToken(); + /** - * When creating a, pass in {@code entryPoint}, any method handle which - * can take the current object - * @param entryPoint + * When creating a {@code JavaMethodHandle}, the actual method handle + * invocation behavior will be delegated to the specified {@code entryPoint}. + * This may be any method handle which can take the newly constructed object + * as a leading parameter. + *

+ * The method handle type of {@code this} (i.e, the fully constructed object) + * will be {@code entryPoint}, minus the leading argument. + * The leading argument will be bound to {@code this} on every method + * handle invocation. + * @param entryPoint the method handle to handle calls */ protected JavaMethodHandle(MethodHandle entryPoint) { - super(entryPoint, 0); + super(entryPoint); + } + + /** + * Create a method handle whose entry point is a non-static method + * visible in the exact (most specific) class of + * the newly constructed object. + *

+ * The method is specified by name and type, as if via this expression: + * {@code MethodHandles.lookup().findVirtual(this.getClass(), name, type)}. + * The class defining the method might be an anonymous inner class. + *

+ * The method handle type of {@code this} (i.e, the fully constructed object) + * will be the given method handle type. + * A call to {@code this} will invoke the selected method. + * The receiver argument will be bound to {@code this} on every method + * handle invocation. + *

+ * Rationale: + * Although this constructor may seem to be a mere luxury, + * it is not subsumed by the more general constructor which + * takes any {@code MethodHandle} as the entry point argument. + * In order to convert an entry point name to a method handle, + * the self-class of the object is required (in order to do + * the lookup). The self-class, in turn, is generally not + * available at the time of the constructor invocation, + * due to the rules of Java and the JVM verifier. + * One cannot call {@code this.getClass()}, because + * the value of {@code this} is inaccessible at the point + * of the constructor call. (Changing this would require + * change to the Java language, verifiers, and compilers.) + * In particular, this constructor allows {@code JavaMethodHandle}s + * to be created in combination with the anonymous inner class syntax. + * @param entryPointName the name of the entry point method + * @param type (optional) the desired type of the method handle + */ + protected JavaMethodHandle(String entryPointName, MethodType type) { + super(entryPointName, type, true); + + } + + /** + * Create a method handle whose entry point is a non-static method + * visible in the exact (most specific) class of + * the newly constructed object. + *

+ * The method is specified only by name. + * There must be exactly one method of that name visible in the object class, + * either inherited or locally declared. + * (That is, the method must not be overloaded.) + *

+ * The method handle type of {@code this} (i.e, the fully constructed object) + * will be the same as the type of the selected non-static method. + * The receiver argument will be bound to {@code this} on every method + * handle invocation. + *

ISSUE: This signature wildcarding feature does not correspond to + * any MethodHandles.Lookup API element. Can we eliminate it? + * Alternatively, it is useful for naming non-overloaded methods. + * Shall we make type arguments optional in the Lookup methods, + * throwing an error in cases of ambiguity? + *

+ * For this method's rationale, see the documentation + * for {@link #JavaMethodHandle(String,MethodType)}. + * @param entryPointName the name of the entry point method + */ + protected JavaMethodHandle(String entryPointName) { + super(entryPointName, (MethodType) null, false); } } diff --git a/jdk/src/share/classes/java/dyn/Linkage.java b/jdk/src/share/classes/java/dyn/Linkage.java index cbeeb3351de..ed3e35e9594 100644 --- a/jdk/src/share/classes/java/dyn/Linkage.java +++ b/jdk/src/share/classes/java/dyn/Linkage.java @@ -25,7 +25,9 @@ package java.dyn; +import java.dyn.MethodHandles.Lookup; import java.util.WeakHashMap; +import sun.dyn.Access; import sun.reflect.Reflection; import static sun.dyn.util.VerifyAccess.checkBootstrapPrivilege; @@ -34,6 +36,8 @@ import static sun.dyn.util.VerifyAccess.checkBootstrapPrivilege; * @author John Rose, JSR 292 EG */ public class Linkage { + private static final Access IMPL_TOKEN = Access.getToken(); + private Linkage() {} // do not instantiate /** @@ -53,19 +57,23 @@ public class Linkage { * call to this method. *

  • The given class is already fully initialized. *
  • The given class is in the process of initialization, in another thread. + *
  • The same {@code CallSite} object has already been returned from + * a bootstrap method call to another {@code invokedynamic} call site. * * Because of these rules, a class may install its own bootstrap method in * a static initializer. + * @param callerClass a class that may have {@code invokedynamic} sites + * @param bootstrapMethod the method to use to bootstrap all such sites */ public static - void registerBootstrapMethod(Class callerClass, MethodHandle mh) { + void registerBootstrapMethod(Class callerClass, MethodHandle bootstrapMethod) { Class callc = Reflection.getCallerClass(2); checkBootstrapPrivilege(callc, callerClass, "registerBootstrapMethod"); - checkBSM(mh); + checkBSM(bootstrapMethod); synchronized (bootstrapMethods) { if (bootstrapMethods.containsKey(callerClass)) throw new IllegalStateException("bootstrap method already declared in "+callerClass); - bootstrapMethods.put(callerClass, mh); + bootstrapMethods.put(callerClass, bootstrapMethod); } } @@ -88,8 +96,9 @@ public class Linkage { public static void registerBootstrapMethod(Class runtime, String name) { Class callc = Reflection.getCallerClass(2); + Lookup lookup = new Lookup(IMPL_TOKEN, callc); MethodHandle bootstrapMethod = - MethodHandles.findStaticFrom(callc, runtime, name, BOOTSTRAP_METHOD_TYPE); + lookup.findStatic(runtime, name, BOOTSTRAP_METHOD_TYPE); // FIXME: exception processing wrong here checkBSM(bootstrapMethod); Linkage.registerBootstrapMethod(callc, bootstrapMethod); @@ -106,8 +115,9 @@ public class Linkage { public static void registerBootstrapMethod(String name) { Class callc = Reflection.getCallerClass(2); + Lookup lookup = new Lookup(IMPL_TOKEN, callc); MethodHandle bootstrapMethod = - MethodHandles.findStaticFrom(callc, callc, name, BOOTSTRAP_METHOD_TYPE); + lookup.findStatic(callc, name, BOOTSTRAP_METHOD_TYPE); // FIXME: exception processing wrong here checkBSM(bootstrapMethod); Linkage.registerBootstrapMethod(callc, bootstrapMethod); @@ -116,8 +126,7 @@ public class Linkage { /** * PROVISIONAL API, WORK IN PROGRESS: * Report the bootstrap method registered for a given class. - * Returns null if the class has never yet registered a bootstrap method, - * or if the class has explicitly registered a null bootstrap method. + * Returns null if the class has never yet registered a bootstrap method. * Only callers privileged to set the bootstrap method may inquire * about it, because a bootstrap method is potentially a back-door entry * point into its class. @@ -137,12 +146,12 @@ public class Linkage { * {@code (Class, String, MethodType)} returning a {@code CallSite}. */ public static final MethodType BOOTSTRAP_METHOD_TYPE - = MethodType.make(CallSite.class, - Class.class, String.class, MethodType.class); + = MethodType.methodType(CallSite.class, + Class.class, String.class, MethodType.class); private static final MethodType OLD_BOOTSTRAP_METHOD_TYPE - = MethodType.make(Object.class, - CallSite.class, Object[].class); + = MethodType.methodType(Object.class, + CallSite.class, Object[].class); private static final WeakHashMap bootstrapMethods = new WeakHashMap(); @@ -173,8 +182,8 @@ public class Linkage { /** * PROVISIONAL API, WORK IN PROGRESS: - * Invalidate all invokedynamic call sites associated - * with the given class. + * Invalidate all invokedynamic call sites in the bytecodes + * of any methods of the given class. * (These are exactly those sites which report the given class * via the {@link CallSite#callerClass()} method.) *

    diff --git a/jdk/src/share/classes/java/dyn/LinkagePermission.java b/jdk/src/share/classes/java/dyn/LinkagePermission.java index 6ea86f8b555..b2b2031272d 100644 --- a/jdk/src/share/classes/java/dyn/LinkagePermission.java +++ b/jdk/src/share/classes/java/dyn/LinkagePermission.java @@ -88,7 +88,7 @@ public final class LinkagePermission extends BasicPermission { /** * Create a new LinkagePermission with the given name. * The name is the symbolic name of the LinkagePermission, such as - * "registerBootstrapMethod", "invalidateClass.*", etc. An asterisk + * "registerBootstrapMethod", "invalidateCallerClass.*", etc. An asterisk * may appear at the end of the name, following a ".", or by itself, to * signify a wildcard match. * diff --git a/jdk/src/share/classes/java/dyn/MethodHandle.java b/jdk/src/share/classes/java/dyn/MethodHandle.java index 688a9d3fd70..25aa9862e4c 100644 --- a/jdk/src/share/classes/java/dyn/MethodHandle.java +++ b/jdk/src/share/classes/java/dyn/MethodHandle.java @@ -30,6 +30,9 @@ package java.dyn; import sun.dyn.Access; import sun.dyn.MethodHandleImpl; +import static java.dyn.MethodHandles.invokers; // package-private API +import static sun.dyn.MemberName.newIllegalArgumentException; // utility + /** * A method handle is a typed reference to the entry point of a method. *

    @@ -45,8 +48,9 @@ import sun.dyn.MethodHandleImpl; * Every method handle appears as an object containing a method named * invoke, whose signature exactly matches * the method handle's type. - * A normal Java method call (using the invokevirtual instruction) - * can invoke this method from Java source code (if language support is present). + * A Java method call expression, which compiles to an + * invokevirtual instruction, + * can invoke this method from Java source code. *

    * Every call to a method handle specifies an intended method type, * which must exactly match the type of the method handle. @@ -57,6 +61,10 @@ import sun.dyn.MethodHandleImpl; * The call fails with a {@link WrongMethodTypeException} * if the method does not exist, even if there is an invoke * method of a closely similar signature. + * As with other kinds + * of methods in the JVM, signature matching during method linkage + * is exact, and does not allow for language-level implicit conversions + * such as {@code String} to {@code Object} or {@code short} to {@code int}. *

    * A method handle is an unrestricted capability to call a method. * A method handle can be formed on a non-public method by a class @@ -74,6 +82,15 @@ import sun.dyn.MethodHandleImpl; * (after resolving symbolic type names) must exactly match the method type * of the target method. *

    + * Every invoke method always throws {@link Exception}, + * which is to say that there is no static restriction on what a method handle + * can throw. Since the JVM does not distinguish between checked + * and unchecked exceptions (other than by their class, of course), + * there is no particular effect on bytecode shape from ascribing + * checked exceptions to method handle invocations. But in Java source + * code, methods which perform method handle calls must either explicitly + * throw {@code Exception}, or else must catch all checked exceptions locally. + *

    * Bytecode in an extended JVM can directly obtain a method handle * for any accessible method from a ldc instruction * which refers to a CONSTANT_Methodref or @@ -97,6 +114,59 @@ import sun.dyn.MethodHandleImpl; * can also be created. These do not perform virtual lookup based on * receiver type. Such a method handle simulates the effect of * an invokespecial instruction to the same method. + *

    + * Here are some examples of usage: + *

    + * Object x, y; String s; int i;
    + * MethodType mt; MethodHandle mh;
    + * MethodHandles.Lookup lookup = MethodHandles.lookup();
    + * // mt is {(char,char) => String}
    + * mt = MethodType.make(String.class, char.class, char.class);
    + * mh = lookup.findVirtual(String.class, "replace", mt);
    + * // (Ljava/lang/String;CC)Ljava/lang/String;
    + * s = mh.<String>invoke("daddy",'d','n');
    + * assert(s.equals("nanny"));
    + * // weakly typed invocation (using MHs.invoke)
    + * s = (String) MethodHandles.invoke(mh, "sappy", 'p', 'v');
    + * assert(s.equals("savvy"));
    + * // mt is {Object[] => List}
    + * mt = MethodType.make(java.util.List.class, Object[].class);
    + * mh = lookup.findStatic(java.util.Arrays.class, "asList", mt);
    + * // mt is {(Object,Object,Object) => Object}
    + * mt = MethodType.makeGeneric(3);
    + * mh = MethodHandles.collectArguments(mh, mt);
    + * // mt is {(Object,Object,Object) => Object}
    + * // (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    + * x = mh.invoke((Object)1, (Object)2, (Object)3);
    + * assert(x.equals(java.util.Arrays.asList(1,2,3)));
    + * // mt is { => int}
    + * mt = MethodType.make(int.class);
    + * mh = lookup.findVirtual(java.util.List.class, "size", mt);
    + * // (Ljava/util/List;)I
    + * i = mh.<int>invoke(java.util.Arrays.asList(1,2,3));
    + * assert(i == 3);
    + * 
    + * Each of the above calls generates a single invokevirtual instruction + * with the name {@code invoke} and the type descriptors indicated in the comments. + * The argument types are taken directly from the actual arguments, + * while the return type is taken from the type parameter. + * (This type parameter may be a primitive, and it defaults to {@code Object}.) + *

    + * A note on generic typing: Method handles do not represent + * their function types in terms of Java parameterized (generic) types, + * because there are three mismatches between function types and parameterized + * Java types. + *

      + *
    1. Method types range over all possible arities, + * from no arguments to an arbitrary number of arguments. + * Generics are not variadic, and so cannot represent this.
    2. + *
    3. Method types can specify arguments of primitive types, + * which Java generic types cannot range over.
    4. + *
    5. Higher order functions over method handles (combinators) are + * often generic across a wide range of function types, including + * those of multiple arities. It is impossible to represent such + * genericity with a Java type parameter.
    6. + *
    * * @see MethodType * @see MethodHandles @@ -107,17 +177,19 @@ public abstract class MethodHandle // with a JVM change which moves the required hidden state onto this class. extends MethodHandleImpl { - // interface MethodHandle> - // { T type(); public R invoke(A...); } + private static Access IMPL_TOKEN = Access.getToken(); - final private MethodType type; + // interface MethodHandle + // { MethodType type(); public R invoke(A...) throws X; } + + private MethodType type; /** * Report the type of this method handle. * Every invocation of this method handle must exactly match this type. * @return the method handle type */ - public MethodType type() { + public final MethodType type() { return type; } @@ -130,6 +202,369 @@ public abstract class MethodHandle */ protected MethodHandle(Access token, MethodType type) { super(token); + Access.check(token); this.type = type; } + + private void initType(MethodType type) { + type.getClass(); // elicit NPE + if (this.type != null) throw new InternalError(); + this.type = type; + } + + static { + // This hack allows the implementation package special access to + // the internals of MethodHandle. In particular, the MTImpl has all sorts + // of cached information useful to the implementation code. + MethodHandleImpl.setMethodHandleFriend(IMPL_TOKEN, new MethodHandleImpl.MethodHandleFriend() { + public void initType(MethodHandle mh, MethodType type) { mh.initType(type); } + }); + } + + /** The string of a direct method handle is the simple name of its target method. + * The string of an adapter or bound method handle is the string of its + * target method handle. + * The string of a Java method handle is the string of its entry point method, + * unless the Java method handle overrides the toString method. + */ + @Override + public String toString() { + return MethodHandleImpl.getNameString(IMPL_TOKEN, this); + } + + //// First draft of the "Method Handle Kernel API" discussed at the JVM Language Summit, 9/2009. + //// Implementations here currently delegate to statics in MethodHandles. Some of those statics + //// will be deprecated. Others will be kept as "algorithms" to supply degrees of freedom + //// not present in the Kernel API. + + /** + * PROVISIONAL API, WORK IN PROGRESS: + * Perform an exact invocation. The signature at the call site of {@code invokeExact} must + * exactly match this method handle's {@code type}. + * No conversions are allowed on arguments or return values. + * This is not yet implemented, pending required compiler and JVM support. + */ + public final T invokeExact(Object... arguments) throws Throwable { + // This is an approximate implementation, which discards the caller's signature and refuses the call. + throw new InternalError("not yet implemented"); + } + + /** + * PROVISIONAL API, WORK IN PROGRESS: + * Perform a generic invocation. The signature at the call site of {@code invokeExact} must + * have the same arity as this method handle's {@code type}. + * The same conversions are allowed on arguments or return values as are supported by + * by {@link MethodHandles#convertArguments}. + * If the call site signature exactly matches this method handle's {@code type}, + * the call proceeds as if by {@link #invokeExact}. + * This is not fully implemented, pending required compiler and JVM support. + */ + // This is an approximate implementation, which discards the caller's signature. + // When it is made signature polymorphic, the overloadings will disappear. + public final T invokeGeneric() throws Throwable { + MethodHandle invoker = invokers(this.type()).genericInvoker(); + return invoker.invoke(this); + } + public final T invokeGeneric(Object a0) throws Throwable { + MethodHandle invoker = invokers(this.type()).genericInvoker(); + return invoker.invoke(this, a0); + } + public final T invokeGeneric(Object a0, Object a1) throws Throwable { + MethodHandle invoker = invokers(this.type()).genericInvoker(); + return invoker.invoke(this, a0, a1); + } + public final T invokeGeneric(Object a0, Object a1, Object a2) throws Throwable { + MethodHandle invoker = invokers(this.type()).genericInvoker(); + return invoker.invoke(this, a0, a1, a2); + } + public final T invokeGeneric(Object a0, Object a1, Object a2, Object a3) throws Throwable { + MethodHandle invoker = invokers(this.type()).genericInvoker(); + return invoker.invoke(this, a0, a1, a2, a3); + } + public final T invokeGeneric(Object a0, Object a1, Object a2, Object a3, + Object a4) throws Throwable { + MethodHandle invoker = invokers(this.type()).genericInvoker(); + return invoker.invoke(this, a0, a1, a2, a3, a4); + } + public final T invokeGeneric(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + MethodHandle invoker = invokers(this.type()).genericInvoker(); + return invoker.invoke(this, a0, a1, a2, a3, a4, a5); + } + public final T invokeGeneric(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + MethodHandle invoker = invokers(this.type()).genericInvoker(); + return invoker.invoke(this, a0, a1, a2, a3, a4, a5, a6); + } + public final T invokeGeneric(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + MethodHandle invoker = invokers(this.type()).genericInvoker(); + return invoker.invoke(this, a0, a1, a2, a3, a4, a5, a6, a7); + } + public final T invokeGeneric(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable { + MethodHandle invoker = invokers(this.type()).genericInvoker(); + return invoker.invoke(this, a0, a1, a2, a3, a4, a5, a6, a7, a8); + } + public final T invokeGeneric(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable { + MethodHandle invoker = invokers(this.type()).genericInvoker(); + return invoker.invoke(this, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); + } + + /** + * PROVISIONAL API, WORK IN PROGRESS: + * Perform a varargs invocation, passing the arguments in the given array + * to the method handle, as if via {@link #invokeGeneric} from a call site + * which mentions only the type {@code Object}, and whose arity is the length + * of the argument array. + *

    + * The length of the arguments array must equal the parameter count + * of the target's type. + * The arguments array is spread into separate arguments. + *

    + * In order to match the type of the target, the following argument + * conversions are applied as necessary: + *

      + *
    • reference casting + *
    • unboxing + *
    + * The following conversions are not applied: + *
      + *
    • primitive conversions (e.g., {@code byte} to {@code int} + *
    • varargs conversions other than the initial spread + *
    • any application-specific conversions (e.g., string to number) + *
    + * The result returned by the call is boxed if it is a primitive, + * or forced to null if the return type is void. + *

    + * This call is equivalent to the following code: + *

    +     *   MethodHandle invoker = MethodHandles.genericInvoker(this.type(), 0, true);
    +     *   Object result = invoker.invoke(this, arguments);
    +     * 
    + * @param arguments the arguments to pass to the target + * @return the result returned by the target + * @see MethodHandles#genericInvoker + */ + public final Object invokeVarargs(Object[] arguments) throws Throwable { + int argc = arguments == null ? 0 : arguments.length; + MethodType type = type(); + if (argc <= 10) { + MethodHandle invoker = MethodHandles.invokers(type).genericInvoker(); + switch (argc) { + case 0: return invoker.invoke(this); + case 1: return invoker.invoke(this, + arguments[0]); + case 2: return invoker.invoke(this, + arguments[0], arguments[1]); + case 3: return invoker.invoke(this, + arguments[0], arguments[1], arguments[2]); + case 4: return invoker.invoke(this, + arguments[0], arguments[1], arguments[2], + arguments[3]); + case 5: return invoker.invoke(this, + arguments[0], arguments[1], arguments[2], + arguments[3], arguments[4]); + case 6: return invoker.invoke(this, + arguments[0], arguments[1], arguments[2], + arguments[3], arguments[4], arguments[5]); + case 7: return invoker.invoke(this, + arguments[0], arguments[1], arguments[2], + arguments[3], arguments[4], arguments[5], + arguments[6]); + case 8: return invoker.invoke(this, + arguments[0], arguments[1], arguments[2], + arguments[3], arguments[4], arguments[5], + arguments[6], arguments[7]); + case 9: return invoker.invoke(this, + arguments[0], arguments[1], arguments[2], + arguments[3], arguments[4], arguments[5], + arguments[6], arguments[7], arguments[8]); + case 10: return invoker.invoke(this, + arguments[0], arguments[1], arguments[2], + arguments[3], arguments[4], arguments[5], + arguments[6], arguments[7], arguments[8], + arguments[9]); + } + } + + // more than ten arguments get boxed in a varargs list: + MethodHandle invoker = MethodHandles.invokers(type).varargsInvoker(0); + return invoker.invoke(this, arguments); + } + /** Equivalent to {@code invokeVarargs(arguments.toArray())}. */ + public final Object invokeVarargs(java.util.List arguments) throws Throwable { + return invokeVarargs(arguments.toArray()); + } + + /* --- this is intentionally NOT a javadoc yet --- + * PROVISIONAL API, WORK IN PROGRESS: + * Produce an adapter method handle which adapts the type of the + * current method handle to a new type by pairwise argument conversion. + * The original type and new type must have the same number of arguments. + * The resulting method handle is guaranteed to confess a type + * which is equal to the desired new type. + *

    + * If the original type and new type are equal, returns {@code this}. + *

    + * The following conversions are applied as needed both to + * arguments and return types. Let T0 and T1 be the differing + * new and old parameter types (or old and new return types) + * for corresponding values passed by the new and old method types. + * Given those types T0, T1, one of the following conversions is applied + * if possible: + *

      + *
    • If T0 and T1 are references, and T1 is not an interface type, + * then a cast to T1 is applied. + * (The types do not need to be related in any particular way.) + *
    • If T0 and T1 are references, and T1 is an interface type, + * then the value of type T0 is passed as a T1 without a cast. + * (This treatment of interfaces follows the usage of the bytecode verifier.) + *
    • If T0 and T1 are primitives, then a Java casting + * conversion (JLS 5.5) is applied, if one exists. + *
    • If T0 and T1 are primitives and one is boolean, + * the boolean is treated as a one-bit unsigned integer. + * (This treatment follows the usage of the bytecode verifier.) + * A conversion from another primitive type behaves as if + * it first converts to byte, and then masks all but the low bit. + *
    • If T0 is a primitive and T1 a reference, a boxing + * conversion is applied if one exists, possibly followed by + * an reference conversion to a superclass. + * T1 must be a wrapper class or a supertype of one. + * If T1 is a wrapper class, T0 is converted if necessary + * to T1's primitive type by one of the preceding conversions. + * Otherwise, T0 is boxed, and its wrapper converted to T1. + *
    • If T0 is a reference and T1 a primitive, an unboxing + * conversion is applied if one exists, possibly preceded by + * a reference conversion to a wrapper class. + * T0 must be a wrapper class or a supertype of one. + * If T0 is a wrapper class, its primitive value is converted + * if necessary to T1 by one of the preceding conversions. + * Otherwise, T0 is converted directly to the wrapper type for T1, + * which is then unboxed. + *
    • If the return type T1 is void, any returned value is discarded + *
    • If the return type T0 is void and T1 a reference, a null value is introduced. + *
    • If the return type T0 is void and T1 a primitive, a zero value is introduced. + *
    + *

    + */ + /** + * PROVISIONAL API, WORK IN PROGRESS: + * Produce an adapter method handle which adapts the type of the + * current method handle to a new type by pairwise argument conversion. + * The original type and new type must have the same number of arguments. + * The resulting method handle is guaranteed to confess a type + * which is equal to the desired new type. + *

    + * If the original type and new type are equal, returns {@code this}. + *

    + * This method is equivalent to {@link MethodHandles#convertArguments}. + * @param newType the expected type of the new method handle + * @return a method handle which delegates to {@code this} after performing + * any necessary argument conversions, and arranges for any + * necessary return value conversions + * @throws IllegalArgumentException if the conversion cannot be made + * @see MethodHandles#convertArguments + */ + public final MethodHandle asType(MethodType newType) { + return MethodHandles.convertArguments(this, newType); + } + + /** + * PROVISIONAL API, WORK IN PROGRESS: + * Produce a method handle which adapts, as its target, + * the current method handle. The type of the adapter will be + * the same as the type of the target, except that all but the first + * {@code keepPosArgs} parameters of the target's type are replaced + * by a single array parameter of type {@code Object[]}. + * Thus, if {@code keepPosArgs} is zero, the adapter will take all + * arguments in a single object array. + *

    + * When called, the adapter replaces a trailing array argument + * by the array's elements, each as its own argument to the target. + * (The order of the arguments is preserved.) + * They are converted pairwise by casting and/or unboxing + * (as if by {@link MethodHandles#convertArguments}) + * to the types of the trailing parameters of the target. + * Finally the target is called. + * What the target eventually returns is returned unchanged by the adapter. + *

    + * Before calling the target, the adapter verifies that the array + * contains exactly enough elements to provide a correct argument count + * to the target method handle. + * (The array may also be null when zero elements are required.) + * @param keepPosArgs the number of leading positional arguments to preserve + * @return a new method handle which spreads its final argument, + * before calling the original method handle + * @throws IllegalArgumentException if target does not have at least + * {@code keepPosArgs} parameter types + */ + public final MethodHandle asSpreader(int keepPosArgs) { + MethodType oldType = type(); + int nargs = oldType.parameterCount(); + MethodType newType = oldType.dropParameterTypes(keepPosArgs, nargs); + newType = newType.insertParameterTypes(keepPosArgs, Object[].class); + return MethodHandles.spreadArguments(this, newType); + } + + /** + * PROVISIONAL API, WORK IN PROGRESS: + * Produce a method handle which adapts, as its target, + * the current method handle. The type of the adapter will be + * the same as the type of the target, except that a single trailing + * array parameter of type {@code Object[]} is replaced by + * {@code spreadArrayArgs} parameters of type {@code Object}. + *

    + * When called, the adapter replaces its trailing {@code spreadArrayArgs} + * arguments by a single new {@code Object} array, whose elements + * comprise (in order) the replaced arguments. + * Finally the target is called. + * What the target eventually returns is returned unchanged by the adapter. + *

    + * (The array may also be a shared constant when {@code spreadArrayArgs} is zero.) + * @param spreadArrayArgs the number of arguments to spread from the trailing array + * @return a new method handle which collects some trailing argument + * into an array, before calling the original method handle + * @throws IllegalArgumentException if the last argument of the target + * is not {@code Object[]} + * @throws IllegalArgumentException if {@code spreadArrayArgs} is not + * a legal array size + * @deprecated Provisional and unstable; use {@link MethodHandles#collectArguments}. + */ + public final MethodHandle asCollector(int spreadArrayArgs) { + MethodType oldType = type(); + int nargs = oldType.parameterCount(); + MethodType newType = oldType.dropParameterTypes(nargs-1, nargs); + newType = newType.insertParameterTypes(nargs-1, MethodType.genericMethodType(spreadArrayArgs).parameterArray()); + return MethodHandles.collectArguments(this, newType); + } + + /** + * PROVISIONAL API, WORK IN PROGRESS: + * Produce a method handle which binds the given argument + * to the current method handle as target. + * The type of the bound handle will be + * the same as the type of the target, except that a single leading + * reference parameter will be omitted. + *

    + * When called, the bound handle inserts the given value {@code x} + * as a new leading argument to the target. The other arguments are + * also passed unchanged. + * What the target eventually returns is returned unchanged by the bound handle. + *

    + * The reference {@code x} must be convertible to the first parameter + * type of the target. + * @param x the value to bind to the first argument of the target + * @return a new method handle which collects some trailing argument + * into an array, before calling the original method handle + * @throws IllegalArgumentException if the target does not have a + * leading parameter type that is a reference type + * @throws ClassCastException if {@code x} cannot be converted + * to the leading parameter type of the target + * @deprecated Provisional and unstable; use {@link MethodHandles#insertArguments}. + */ + public final MethodHandle bindTo(Object x) { + return MethodHandles.insertArguments(this, 0, x); + } } diff --git a/jdk/src/share/classes/java/dyn/MethodHandles.java b/jdk/src/share/classes/java/dyn/MethodHandles.java index 3a9f7ed3e97..06ac809a974 100644 --- a/jdk/src/share/classes/java/dyn/MethodHandles.java +++ b/jdk/src/share/classes/java/dyn/MethodHandles.java @@ -34,6 +34,7 @@ import sun.dyn.util.Wrapper; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.Modifier; +import java.util.List; import java.util.ArrayList; import java.util.Arrays; import sun.dyn.Invokers; @@ -44,17 +45,14 @@ import static sun.dyn.MemberName.newNoAccessException; /** * Fundamental operations and utilities for MethodHandle. + * They fall into several categories: + *

      + *
    • Reifying methods and fields. This is subject to access checks. + *
    • Invoking method handles on dynamically typed arguments and/or varargs arrays. + *
    • Combining or transforming pre-existing method handles into new ones. + *
    • Miscellaneous emulation of common JVM operations or control flow patterns. + *
    *

    - * API Note: The matching of method types in this API cannot - * be completely checked by Java's generic type system for three reasons: - *

      - *
    1. Method types range over all possible arities, - * from no arguments to an arbitrary number of arguments. - * Generics are not variadic, and so cannot represent this.
    2. - *
    3. Method types can specify arguments of primitive types, - * which Java generic types cannot range over.
    4. - *
    5. Method types can optionally specify varargs (ellipsis).
    6. - *
    * @author John Rose, JSR 292 EG */ public class MethodHandles { @@ -68,12 +66,22 @@ public class MethodHandles { //// Method handle creation from ordinary methods. + /** Create a {@link Lookup} lookup object on the caller. + * + */ public static Lookup lookup() { return new Lookup(); } + /** Version of lookup which is trusted minimally. + * It can only be used to create method handles to + * publicly accessible members. + */ + public static Lookup publicLookup() { + return Lookup.PUBLIC_LOOKUP; + } + /** - * PROVISIONAL API, WORK IN PROGRESS: * A factory object for creating method handles, when the creation * requires access checking. Method handles do not perform * access checks when they are called; this is a major difference @@ -121,7 +129,8 @@ public class MethodHandles { /** Which class is performing the lookup? It is this class against * which checks are performed for visibility and access permissions. *

    - * This value is null if and only if this lookup is {@link #PUBLIC_LOOKUP}. + * This value is null if and only if this lookup was produced + * by {@link MethodHandles#publicLookup}. */ public Class lookupClass() { return lookupClass; @@ -135,23 +144,46 @@ public class MethodHandles { * an access$N method. */ Lookup() { - Class caller = getCallerClassAtEntryPoint(); - // make sure we haven't accidentally picked up this class: - checkUnprivilegedlookupClass(caller); - this.lookupClass = caller; + this(IMPL_TOKEN, getCallerClassAtEntryPoint()); + } + + Lookup(Access token, Class lookupClass) { + // make sure we haven't accidentally picked up a privileged class: + checkUnprivilegedlookupClass(lookupClass); + this.lookupClass = lookupClass; + } + + /** + * Create a lookup on the specified class. + * The result is guaranteed to have no more access privileges + * than the original. + */ + public Lookup in(Class newLookupClass) { + if (this == PUBLIC_LOOKUP) return PUBLIC_LOOKUP; + if (newLookupClass == null) return PUBLIC_LOOKUP; + if (newLookupClass == lookupClass) return this; + if (this != IMPL_LOOKUP) { + if (!VerifyAccess.isSamePackage(lookupClass, newLookupClass)) + throw newNoAccessException(new MemberName(newLookupClass), this); + checkUnprivilegedlookupClass(newLookupClass); + } + return new Lookup(newLookupClass); } private Lookup(Class lookupClass) { this.lookupClass = lookupClass; } + // Make sure outer class is initialized first. + static { IMPL_TOKEN.getClass(); } + private static final Class PUBLIC_ONLY = sun.dyn.empty.Empty.class; /** Version of lookup which is trusted minimally. * It can only be used to create method handles to * publicly accessible members. */ - public static final Lookup PUBLIC_LOOKUP = new Lookup(PUBLIC_ONLY); + static final Lookup PUBLIC_LOOKUP = new Lookup(PUBLIC_ONLY); /** Package-private version of lookup which is trusted. */ static final Lookup IMPL_LOOKUP = new Lookup(null); @@ -178,12 +210,16 @@ public class MethodHandles { // 0: Reflection.getCC, 1: getCallerClassAtEntryPoint, // 2: Lookup., 3: MethodHandles.*, 4: caller // Note: This should be the only use of getCallerClass in this file. + assert(Reflection.getCallerClass(CALLER_DEPTH-1) == MethodHandles.class); return Reflection.getCallerClass(CALLER_DEPTH); } /** * Produce a method handle for a static method. * The type of the method handle will be that of the method. + * (Since static methods do not take receivers, there is no + * additional receiver argument inserted into the method handle type, + * as there would be with {@linkplain #findVirtual} or {@linkplain #findSpecial}.) * The method and all its argument types must be accessible to the lookup class. * If the method's class has not yet been initialized, that is done * immediately, before the method handle is returned. @@ -196,10 +232,11 @@ public class MethodHandles { */ public MethodHandle findStatic(Class defc, String name, MethodType type) throws NoAccessException { - MemberName method = IMPL_NAMES.resolveOrFail(new MemberName(defc, name, type, Modifier.STATIC), true, lookupClass); - checkStatic(true, method, lookupClass); + MemberName method = IMPL_NAMES.resolveOrFail(new MemberName(defc, name, type, Modifier.STATIC), true, lookupClass()); + VerifyAccess.checkName(method, this); + checkStatic(true, method, this); //throw NoSuchMethodException - return MethodHandleImpl.findMethod(IMPL_TOKEN, method, false, lookupClass); + return MethodHandleImpl.findMethod(IMPL_TOKEN, method, false, lookupClass()); } /** @@ -228,9 +265,10 @@ public class MethodHandles { * @exception NoAccessException if the method does not exist or access checking fails */ public MethodHandle findVirtual(Class defc, String name, MethodType type) throws NoAccessException { - MemberName method = IMPL_NAMES.resolveOrFail(new MemberName(defc, name, type), true, lookupClass); - checkStatic(false, method, lookupClass); - return MethodHandleImpl.findMethod(IMPL_TOKEN, method, true, lookupClass); + MemberName method = IMPL_NAMES.resolveOrFail(new MemberName(defc, name, type), true, lookupClass()); + VerifyAccess.checkName(method, this); + checkStatic(false, method, this); + return MethodHandleImpl.findMethod(IMPL_TOKEN, method, true, lookupClass()); } /** @@ -259,15 +297,17 @@ public class MethodHandles { */ public MethodHandle findSpecial(Class defc, String name, MethodType type, Class specialCaller) throws NoAccessException { - checkSpecialCaller(specialCaller, lookupClass); - MemberName method = IMPL_NAMES.resolveOrFail(new MemberName(defc, name, type), false, specialCaller); - checkStatic(false, method, lookupClass); + checkSpecialCaller(specialCaller, this); + Lookup slookup = this.in(specialCaller); + MemberName method = IMPL_NAMES.resolveOrFail(new MemberName(defc, name, type), false, slookup.lookupClass()); + VerifyAccess.checkName(method, this); + checkStatic(false, method, this); if (name.equals("")) { throw newNoAccessException("cannot directly invoke a constructor", method, null); } else if (defc.isInterface() || !defc.isAssignableFrom(specialCaller)) { - throw newNoAccessException("method must be in a superclass of lookup class", method, lookupClass); + throw newNoAccessException("method must be in a superclass of lookup class", method, slookup.lookupClass()); } - return MethodHandleImpl.findMethod(IMPL_TOKEN, method, false, specialCaller); + return MethodHandleImpl.findMethod(IMPL_TOKEN, method, false, slookup.lookupClass()); } /** @@ -275,13 +315,19 @@ public class MethodHandles { * The receiver must have a supertype {@code defc} in which a method * of the given name and type is accessible to the lookup class. * The method and all its argument types must be accessible to the lookup class. - * The type of the method handle will be that of the method. - * The given receiver will be bound into the method handle. + * The type of the method handle will be that of the method, + * without any insertion of an additional receiver parameter. + * The given receiver will be bound into the method handle, + * so that every call to the method handle will invoke the + * requested method on the given receiver. *

    - * Equivalent to the following expression: + * This is equivalent to the following expression: * - * {@link #insertArgument}({@link #findVirtual}(defc, name, type), receiver) + * {@link #insertArguments}({@link #findVirtual}(defc, name, type), receiver) * + * where {@code defc} is either {@code receiver.getClass()} or a super + * type of that class, in which the requested method is accessible + * to the lookup class. * @param receiver the object from which the method is accessed * @param name the name of the method * @param type the type of the method, with the receiver argument omitted @@ -292,16 +338,18 @@ public class MethodHandles { public MethodHandle bind(Object receiver, String name, MethodType type) throws NoAccessException { Class rcvc = receiver.getClass(); // may get NPE MemberName reference = new MemberName(rcvc, name, type); - MemberName method = IMPL_NAMES.resolveOrFail(reference, true, lookupClass); - checkStatic(false, method, lookupClass); - MethodHandle dmh = MethodHandleImpl.findMethod(IMPL_TOKEN, method, true, lookupClass); + MemberName method = IMPL_NAMES.resolveOrFail(reference, true, lookupClass()); + VerifyAccess.checkName(method, this); + checkStatic(false, method, this); + MethodHandle dmh = MethodHandleImpl.findMethod(IMPL_TOKEN, method, true, lookupClass()); MethodHandle bmh = MethodHandleImpl.bindReceiver(IMPL_TOKEN, dmh, receiver); if (bmh == null) - throw newNoAccessException(method, lookupClass); + throw newNoAccessException(method, this); return bmh; } /** + * PROVISIONAL API, WORK IN PROGRESS: * Make a direct method handle to m, if the lookup class has permission. * If m is non-static, the receiver argument is treated as an initial argument. * If m is virtual, overriding is respected on every call. @@ -316,10 +364,11 @@ public class MethodHandles { * @exception NoAccessException if access checking fails */ public MethodHandle unreflect(Method m) throws NoAccessException { - return unreflectImpl(new MemberName(m), m.isAccessible(), true, lookupClass); + return unreflectImpl(new MemberName(m), m.isAccessible(), true, false, this); } /** + * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle for a reflected method. * It will bypass checks for overriding methods on the receiver, * as if by the {@code invokespecial} instruction. @@ -333,37 +382,41 @@ public class MethodHandles { * @exception NoAccessException if access checking fails */ public MethodHandle unreflectSpecial(Method m, Class specialCaller) throws NoAccessException { - checkSpecialCaller(specialCaller, lookupClass); + checkSpecialCaller(specialCaller, this); + Lookup slookup = this.in(specialCaller); MemberName mname = new MemberName(m); - checkStatic(false, mname, lookupClass); - return unreflectImpl(mname, m.isAccessible(), false, specialCaller); + checkStatic(false, mname, this); + return unreflectImpl(mname, m.isAccessible(), false, false, slookup); } /** + * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle for a reflected constructor. - * The type of the method handle will be that of the constructor. + * The type of the method handle will be that of the constructor, + * with the return type changed to the declaring class. * The method handle will perform a {@code newInstance} operation, * creating a new instance of the constructor's class on the * arguments passed to the method handle. *

    * If the constructor's {@code accessible} flag is not set, - * access checking is performed immediately on behalf of the lookup class, - * as if {@code invokespecial} instruction were being linked. + * access checking is performed immediately on behalf of the lookup class. * @param ctor the reflected constructor * @return a method handle which can invoke the reflected constructor * @exception NoAccessException if access checking fails */ public MethodHandle unreflectConstructor(Constructor ctor) throws NoAccessException { MemberName m = new MemberName(ctor); - return unreflectImpl(m, ctor.isAccessible(), false, lookupClass); + return unreflectImpl(m, ctor.isAccessible(), false, false, this); } /** * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle giving read access to a reflected field. * The type of the method handle will have a return type of the field's - * value type. Its sole argument will be the field's containing class - * (but only if it is non-static). + * value type. + * If the field is static, the method handle will take no arguments. + * Otherwise, its single argument will be the instance containing + * the field. * If the method's {@code accessible} flag is not set, * access checking is performed immediately on behalf of the lookup class. * @param f the reflected field @@ -371,16 +424,18 @@ public class MethodHandles { * @exception NoAccessException if access checking fails */ public MethodHandle unreflectGetter(Field f) throws NoAccessException { - return MethodHandleImpl.accessField(IMPL_TOKEN, new MemberName(f), false, lookupClass); + MemberName m = new MemberName(f); + return unreflectImpl(m, f.isAccessible(), false, false, this); } /** * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle giving write access to a reflected field. * The type of the method handle will have a void return type. - * Its last argument will be the field's value type. - * Its other argument will be the field's containing class - * (but only if it is non-static). + * If the field is static, the method handle will take a single + * argument, of the field's value type, the value to be stored. + * Otherwise, the two arguments will be the instance containing + * the field, and the value to be stored. * If the method's {@code accessible} flag is not set, * access checking is performed immediately on behalf of the lookup class. * @param f the reflected field @@ -388,59 +443,75 @@ public class MethodHandles { * @exception NoAccessException if access checking fails */ public MethodHandle unreflectSetter(Field f) throws NoAccessException { - return MethodHandleImpl.accessField(IMPL_TOKEN, new MemberName(f), true, lookupClass); + MemberName m = new MemberName(f); + return unreflectImpl(m, f.isAccessible(), false, true, this); } } static /*must not be public*/ - MethodHandle findStaticFrom(Class lookupClass, + MethodHandle findStaticFrom(Lookup lookup, Class defc, String name, MethodType type) throws NoAccessException { - MemberName method = IMPL_NAMES.resolveOrFail(new MemberName(defc, name, type, Modifier.STATIC), true, lookupClass); - checkStatic(true, method, lookupClass); - return MethodHandleImpl.findMethod(IMPL_TOKEN, method, false, lookupClass); + MemberName method = IMPL_NAMES.resolveOrFail(new MemberName(defc, name, type, Modifier.STATIC), true, lookup.lookupClass()); + VerifyAccess.checkName(method, lookup); + checkStatic(true, method, lookup); + return MethodHandleImpl.findMethod(IMPL_TOKEN, method, false, lookup.lookupClass()); } - static void checkStatic(boolean wantStatic, MemberName m, Class lookupClass) { + static void checkStatic(boolean wantStatic, MemberName m, Lookup lookup) { if (wantStatic != m.isStatic()) { String message = wantStatic ? "expected a static method" : "expected a non-static method"; - throw newNoAccessException(message, m, lookupClass); + throw newNoAccessException(message, m, lookup.lookupClass()); } } - static void checkSpecialCaller(Class specialCaller, Class lookupClass) { - if (lookupClass == Lookup.IMPL_LOOKUP.lookupClass()) + static void checkSpecialCaller(Class specialCaller, Lookup lookup) { + if (lookup == Lookup.IMPL_LOOKUP) return; // privileged action - if (lookupClass == null || // public-only access - !VerifyAccess.isSamePackageMember(specialCaller, lookupClass)) - throw newNoAccessException("no private access", new MemberName(specialCaller), lookupClass); + assert(lookup.lookupClass() != null); + if (!VerifyAccess.isSamePackageMember(specialCaller, lookup.lookupClass())) + throw newNoAccessException("no private access", new MemberName(specialCaller), lookup.lookupClass()); } // Helper for creating handles on reflected methods and constructors. static MethodHandle unreflectImpl(MemberName m, boolean isAccessible, - boolean doDispatch, Class lookupClass) { - MethodType mtype = m.getInvocationType(); + boolean doDispatch, boolean isSetter, Lookup lookup) { + MethodType narrowMethodType = null; Class defc = m.getDeclaringClass(); + boolean isSpecialInvoke = m.isInvocable() && !doDispatch; int mods = m.getModifiers(); if (m.isStatic()) { if (!isAccessible && - VerifyAccess.isAccessible(defc, mods, false, lookupClass) == null) - throw newNoAccessException(m, lookupClass); + VerifyAccess.isAccessible(defc, mods, lookup.lookupClass(), false) == null) + throw newNoAccessException(m, lookup); } else { Class constraint; if (isAccessible) { // abbreviated access check for "unlocked" method - constraint = doDispatch ? defc : lookupClass; + constraint = doDispatch ? defc : lookup.lookupClass(); } else { - constraint = VerifyAccess.isAccessible(defc, mods, doDispatch, lookupClass); + constraint = VerifyAccess.isAccessible(defc, mods, lookup.lookupClass(), isSpecialInvoke); + } + if (constraint == null) { + throw newNoAccessException(m, lookup); } if (constraint != defc && !constraint.isAssignableFrom(defc)) { if (!defc.isAssignableFrom(constraint)) - throw newNoAccessException("receiver must be in caller class", m, lookupClass); - mtype = mtype.changeParameterType(0, constraint); + throw newNoAccessException("receiver must be in caller class", m, lookup.lookupClass()); + if (m.isInvocable()) + narrowMethodType = m.getInvocationType().changeParameterType(0, constraint); + else if (m.isField()) + narrowMethodType = (!isSetter + ? MethodType.methodType(m.getFieldType(), constraint) + : MethodType.methodType(void.class, constraint, m.getFieldType())); } } - return MethodHandleImpl.findMethod(IMPL_TOKEN, m, doDispatch, lookupClass); + if (m.isInvocable()) + return MethodHandleImpl.findMethod(IMPL_TOKEN, m, doDispatch, lookup.lookupClass()); + else if (m.isField()) + return MethodHandleImpl.accessField(IMPL_TOKEN, m, isSetter, lookup.lookupClass()); + else + throw new InternalError(); } /** @@ -472,138 +543,104 @@ public class MethodHandles { return MethodHandleImpl.accessArrayElement(IMPL_TOKEN, arrayClass, true); } - /// method handle invocation (reflective style) /** - * PROVISIONAL API, WORK IN PROGRESS: - * Call the {@code invoke} method of a given method handle, - * with arguments that exactly match the parameter types of the method handle. - * The length of the arguments array must equal the parameter count - * of the target's type. - * The arguments array is spread into separate arguments, and - * basic reference and unboxing conversions are applied. - *

    - * In order to match the type of the target, the following argument - * conversions are applied as necessary: - *

      - *
    • reference casting - *
    • unboxing - *
    - * The following conversions are not applied: - *
      - *
    • primitive conversions (e.g., {@code byte} to {@code int} - *
    • varargs conversions other than the initial spread - *
    • any application-specific conversions (e.g., string to number) - *
    - * The result returned by the call is boxed if it is a primitive, - * or forced to null if the return type is void. - *

    - * This call is a convenience method for the following code: - *

    -     *   MethodHandle invoker = MethodHandles.genericInvoker(target.type(), 0, true);
    -     *   Object result = invoker.invoke(arguments);
    -     * 
    - * @param target the method handle to invoke - * @param arguments the arguments to pass to the target - * @return the result returned by the target + * @deprecated Alias for MethodHandle.invokeVarargs. */ + @Deprecated public static - Object invoke(MethodHandle target, Object... arguments) { - int argc = arguments == null ? 0 : arguments.length; - MethodType type = target.type(); - if (argc <= 4) { - MethodHandle invoker = invokers(type).genericInvoker(); - switch (argc) { - case 0: return invoker.invoke(target); - case 1: return invoker.invoke(target, - arguments[0]); - case 2: return invoker.invoke(target, - arguments[0], arguments[1]); - case 3: return invoker.invoke(target, - arguments[0], arguments[1], arguments[2]); - case 4: return invoker.invoke(target, - arguments[0], arguments[1], arguments[2], arguments[3]); - } - } - MethodHandle invoker = invokers(type).varargsInvoker(); - return invoker.invoke(target, arguments); + Object invokeVarargs(MethodHandle target, Object... arguments) throws Throwable { + return target.invokeVarargs(arguments); } + /** + * @deprecated Alias for MethodHandle.invokeVarargs. + */ + @Deprecated public static - Object invoke_0(MethodHandle target) { - MethodHandle invoker = invokers(target.type()).genericInvoker(); - return invoker.invoke(target); - } - public static - Object invoke_1(MethodHandle target, Object a0) { - MethodHandle invoker = invokers(target.type()).genericInvoker(); - return invoker.invoke(target, a0); - } - public static - Object invoke_2(MethodHandle target, Object a0, Object a1) { - MethodHandle invoker = invokers(target.type()).genericInvoker(); - return invoker.invoke(target, a0, a1); - } - public static - Object invoke_3(MethodHandle target, Object a0, Object a1, Object a2) { - MethodHandle invoker = invokers(target.type()).genericInvoker(); - return invoker.invoke(target, a0, a1, a2); - } - public static - Object invoke_4(MethodHandle target, Object a0, Object a1, Object a2, Object a3) { - MethodHandle invoker = invokers(target.type()).genericInvoker(); - return invoker.invoke(target, a0, a1, a2, a3); + Object invoke(MethodHandle target, Object... arguments) throws Throwable { + return target.invokeVarargs(arguments); } /** * PROVISIONAL API, WORK IN PROGRESS: - * Give a method handle which will invoke any method handle of the + * Produce a method handle which will invoke any method handle of the * given type on a standard set of {@code Object} type arguments. - * The the resulting invoker will be a method handle with the following + * The resulting invoker will be a method handle with the following * arguments: *
      *
    • a single {@code MethodHandle} target - *
    • zero or more {@code Object} values - *
    • an optional {@code Object[]} array containing more arguments + *
    • zero or more {@code Object} values (one for each argument in {@code type}) *
    - * The invoker will spread the varargs array (if present), apply - * reference casts as necessary, and unbox primitive arguments. + * The invoker will apply reference casts as necessary and unbox primitive arguments, + * as if by {@link #convertArguments}. * The return value of the invoker will be an {@code Object} reference, * boxing a primitive value if the original type returns a primitive, * and always null if the original type returns void. *

    - * This is a convenience method equivalent to the following code: - *

    +     * This method is equivalent to the following code (though it may be more efficient):
    +     * 

          * MethodHandle invoker = exactInvoker(type);
    -     * MethodType genericType = MethodType.makeGeneric(objectArgCount, varargs);
    +     * MethodType genericType = type.generic();
          * genericType = genericType.insertParameterType(0, MethodHandle.class);
    -     * if (!varargs)
    -     *     return convertArguments(invoker, genericType);
    -     * else
    -     *     return spreadArguments(invoker, genericType);
    -     * 
    - * @param type the desired target type - * @param objectArgCount number of fixed (non-varargs) {@code Object} arguments - * @param varargs if true, the invoker will accept a final {@code Object[]} argument + * return convertArguments(invoker, genericType); + *
    + * @param type the type of target methods which the invoker will apply to * @return a method handle suitable for invoking any method handle of the given type */ static public - MethodHandle genericInvoker(MethodType type, int objectArgCount, boolean varargs) { + MethodHandle genericInvoker(MethodType type) { return invokers(type).genericInvoker(); } /** * PROVISIONAL API, WORK IN PROGRESS: - * Give a method handle which will take a invoke any method handle of the + * Produce a method handle which will invoke any method handle of the + * given type on a standard set of {@code Object} type arguments + * and a single trailing {@code Object[]} array. + * The resulting invoker will be a method handle with the following + * arguments: + *
      + *
    • a single {@code MethodHandle} target + *
    • zero or more {@code Object} values (counted by {@code objectArgCount}) + *
    • an {@code Object[]} array containing more arguments + *
    + * The invoker will spread the varargs array, apply + * reference casts as necessary, and unbox primitive arguments. + * The return value of the invoker will be an {@code Object} reference, + * boxing a primitive value if the original type returns a primitive, + * and always null if the original type returns void. + *

    + * This method is equivalent to the following code (though it may be more efficient): + *

    +     * MethodHandle invoker = exactInvoker(type);
    +     * MethodType vaType = MethodType.makeGeneric(objectArgCount, true);
    +     * vaType = vaType.insertParameterType(0, MethodHandle.class);
    +     * return spreadArguments(invoker, vaType);
    +     * 
    + * @param type the desired target type + * @param objectArgCount number of fixed (non-varargs) {@code Object} arguments + * @return a method handle suitable for invoking any method handle of the given type + */ + static public + MethodHandle varargsInvoker(MethodType type, int objectArgCount) { + if (objectArgCount < 0 || objectArgCount > type.parameterCount()) + throw new IllegalArgumentException("bad argument count "+objectArgCount); + return invokers(type).varargsInvoker(objectArgCount); + } + + /** + * PROVISIONAL API, WORK IN PROGRESS: + * Produce a method handle which will take a invoke any method handle of the * given type. The resulting invoker will have a type which is * exactly equal to the desired type, except that it will accept * an additional leading argument of type {@code MethodHandle}. *

    - * This is a convenience method equivalent to the following code: - *

    -     *     MethodHandles.lookup().findVirtual(MethodHandle.class, "invoke", type);
    -     * 
    + * This method is equivalent to the following code (though it may be more efficient): + *

    +     * lookup().findVirtual(MethodHandle.class, "invoke", type);
    +     * 
    * @param type the desired target type * @return a method handle suitable for invoking any method handle of the given type */ @@ -612,7 +649,30 @@ public class MethodHandles { return invokers(type).exactInvoker(); } - static private Invokers invokers(MethodType type) { + /** + * PROVISIONAL API, WORK IN PROGRESS: + * Produce a method handle equivalent to an invokedynamic instruction + * which has been linked to the given call site. + * Along with {@link Lookup#findVirtual}, {@link Lookup#findStatic}, + * and {@link Lookup#findSpecial}, this completes the emulation + * of the JVM's {@code invoke} instructions. + *

    This method is equivalent to the following code: + *

    +     * MethodHandle getTarget, invoker, result;
    +     * getTarget = lookup().bind(site, "getTarget", methodType(MethodHandle.class));
    +     * invoker = exactInvoker(site.type());
    +     * result = foldArguments(invoker, getTarget)
    +     * 
    + * @return a method handle which always invokes the call site's target + */ + public static + MethodHandle dynamicInvoker(CallSite site) { + MethodHandle getTarget = MethodHandleImpl.bindReceiver(IMPL_TOKEN, CallSite.GET_TARGET, site); + MethodHandle invoker = exactInvoker(site.type()); + return foldArguments(invoker, getTarget); + } + + static Invokers invokers(MethodType type) { return MethodTypeImpl.invokers(IMPL_TOKEN, type); } @@ -688,14 +748,11 @@ public class MethodHandles { /// method handle modification (creation from other method handles) /** - * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle which adapts the type of the - * given method handle to a new type, by pairwise argument conversion, - * and/or varargs conversion. - * The original type and new type must have the same number of - * arguments, or else one or both them the must be varargs types. + * given method handle to a new type by pairwise argument conversion. + * The original type and new type must have the same number of arguments. * The resulting method handle is guaranteed to confess a type - * which is equal to the desired new type, with any varargs property erased. + * which is equal to the desired new type. *

    * If the original type and new type are equal, returns target. *

    @@ -703,26 +760,15 @@ public class MethodHandles { * arguments and return types. Let T0 and T1 be the differing * new and old parameter types (or old and new return types) * for corresponding values passed by the new and old method types. - *

    - * If an ordinary (non-varargs) parameter of the new type is - * to be boxed in a varargs parameter of the old type of type T1[], - * then T1 is the element type of the varargs array. - * Otherwise, if a varargs parameter of the new type of type T0[] - * is to be spread into one or more outgoing old type parameters, - * then T0 is the element type of the - * If the new type is varargs and the old type is not, the varargs - * argument will be checked and must be a non-null array of exactly - * the right length. If there are no parameters in the old type - * corresponding to the new varargs parameter, the varargs argument - * is also allowed to be null. - *

    * Given those types T0, T1, one of the following conversions is applied * if possible: *

      - *
    • If T0 and T1 are references, then a cast to T2 is applied, - * where T2 is Object if T1 is an interface, else T1. - * (The types do not need to be related in any particular way. - * The treatment of interfaces follows the usage of the bytecode verifier.) + *
    • If T0 and T1 are references, and T1 is not an interface type, + * then a cast to T1 is applied. + * (The types do not need to be related in any particular way.) + *
    • If T0 and T1 are references, and T1 is an interface type, + * then the value of type T0 is passed as a T1 without a cast. + * (This treatment of interfaces follows the usage of the bytecode verifier.) *
    • If T0 and T1 are primitives, then a Java casting * conversion (JLS 5.5) is applied, if one exists. *
    • If T0 and T1 are primitives and one is boolean, @@ -745,16 +791,17 @@ public class MethodHandles { * if necessary to T1 by one of the preceding conversions. * Otherwise, T0 is converted directly to the wrapper type for T1, * which is then unboxed. - *
    • If T1 is void, any returned value is discarded - *
    • If T0 is void and T1 a reference, a null value is introduced. - *
    • If T0 is void and T1 a primitive, a zero value is introduced. + *
    • If the return type T1 is void, any returned value is discarded + *
    • If the return type T0 is void and T1 a reference, a null value is introduced. + *
    • If the return type T0 is void and T1 a primitive, a zero value is introduced. *
    * @param target the method handle to invoke after arguments are retyped * @param newType the expected type of the new method handle * @return a method handle which delegates to {@code target} after performing * any necessary argument conversions, and arranges for any * necessary return value conversions - * @throws WrongMethodTypeException if the conversion cannot be made + * @throws IllegalArgumentException if the conversion cannot be made + * @see MethodHandle#asType */ public static MethodHandle convertArguments(MethodHandle target, MethodType newType) { @@ -872,23 +919,17 @@ public class MethodHandles { * PROVISIONAL API, WORK IN PROGRESS: * Produce a method handle which adapts the type of the * given method handle to a new type, by collecting a series of - * trailing arguments into an array. - * The resulting method handle is guaranteed to confess a type - * which is equal to the desired new type. + * trailing arguments as elements to a single argument array. *

    - * This method is inverse to {@link #spreadArguments}. + * This method may be used as an inverse to {@link #spreadArguments}. * The final parameter type of the old type must be an array type T[], * which is the type of what is called the spread argument. * The trailing arguments of the new type which correspond to * the spread argument are all converted to type T and collected * into an array before the original method is called. - *

    - * ISSUE: Unify this with combineArguments. CollectArguments - * is combineArguments with (a) new Object[]{...} as a combiner, - * and (b) the combined arguments dropped, in favor of the combined result. * @param target the method handle to invoke after the argument is prepended * @param newType the expected type of the new method handle - * @return a new method handle which collects some trailings argument + * @return a new method handle which collects some trailing argument * into an array, before calling the original method handle */ public static @@ -900,50 +941,72 @@ public class MethodHandles { int numCollect = (inargs - collectPos); if (collectPos < 0 || numCollect < 0) throw newIllegalArgumentException("wrong number of arguments"); - return MethodHandleImpl.collectArguments(IMPL_TOKEN, target, newType, collectPos); + MethodHandle res = MethodHandleImpl.collectArguments(IMPL_TOKEN, target, newType, collectPos, null); + if (res == null) { + throw newIllegalArgumentException("cannot collect from "+newType+" to " +oldType); + } + return res; } /** * PROVISIONAL API, WORK IN PROGRESS: - * Produce a method handle which calls the original method handle, - * after inserting the given argument at the given position. - * The type of the new method handle will drop the corresponding argument - * type from the original handle's type. + * Produce a method handle which calls the original method handle {@code target}, + * after inserting the given argument(s) at the given position. + * The formal parameters to {@code target} which will be supplied by those + * arguments are called bound parameters, because the new method + * will contain bindings for those parameters take from {@code values}. + * The type of the new method handle will drop the types for the bound + * parameters from the original target type, since the new method handle + * will no longer require those arguments to be supplied by its callers. *

    - * The given argument object must match the dropped argument type. - * If the dropped argument type is a primitive, the argument object - * must be a wrapper, and is unboxed to produce the primitive. + * Each given argument object must match the corresponding bound parameter type. + * If a bound parameter type is a primitive, the argument object + * must be a wrapper, and will be unboxed to produce the primitive value. *

    * The pos may range between zero and N (inclusively), - * where N is the number of argument types in target, - * meaning to insert the new argument as the first or last (respectively), - * or somewhere in between. + * where N is the number of argument types in resulting method handle + * (after bound parameter types are dropped). * @param target the method handle to invoke after the argument is inserted * @param pos where to insert the argument (zero for the first) - * @param value the argument to insert + * @param values the series of arguments to insert * @return a new method handle which inserts an additional argument, * before calling the original method handle */ public static - MethodHandle insertArgument(MethodHandle target, int pos, Object value) { + MethodHandle insertArguments(MethodHandle target, int pos, Object... values) { + int insCount = values.length; MethodType oldType = target.type(); ArrayList> ptypes = new ArrayList>(oldType.parameterList()); int outargs = oldType.parameterCount(); - int inargs = outargs - 1; - if (pos < 0 || pos >= outargs) + int inargs = outargs - insCount; + if (inargs < 0) + throw newIllegalArgumentException("too many values to insert"); + if (pos < 0 || pos > inargs) throw newIllegalArgumentException("no argument type to append"); - Class valueType = ptypes.remove(pos); - value = checkValue(valueType, value); - if (pos == 0 && !valueType.isPrimitive()) { - // At least for now, make bound method handles a special case. - // This lets us get by with minimal JVM support, at the expense - // of generating signature-specific adapters as Java bytecodes. - MethodHandle bmh = MethodHandleImpl.bindReceiver(IMPL_TOKEN, target, value); - if (bmh != null) return bmh; - // else fall through to general adapter machinery + MethodHandle result = target; + for (int i = 0; i < insCount; i++) { + Object value = values[i]; + Class valueType = oldType.parameterType(pos+i); + value = checkValue(valueType, value); + if (pos == 0 && !valueType.isPrimitive()) { + // At least for now, make bound method handles a special case. + MethodHandle bmh = MethodHandleImpl.bindReceiver(IMPL_TOKEN, result, value); + if (bmh != null) { + result = bmh; + continue; + } + // else fall through to general adapter machinery + } + result = MethodHandleImpl.bindArgument(IMPL_TOKEN, result, pos, value); } - return MethodHandleImpl.bindArgument(IMPL_TOKEN, target, pos, value); + return result; + } + + @Deprecated // "use MethodHandles.insertArguments instead" + public static + MethodHandle insertArgument(MethodHandle target, int pos, Object value) { + return insertArguments(target, pos, value); } /** @@ -953,10 +1016,25 @@ public class MethodHandles { * The type of the new method handle will insert the given argument * type(s), at that position, into the original handle's type. *

    - * The pos may range between zero and N-1, + * The pos may range between zero and N, * where N is the number of argument types in target, * meaning to drop the first or last argument (respectively), * or an argument somewhere in between. + *

    + * Example: + *

    +     *   MethodHandle cat = MethodHandles.lookup().
    +     *     findVirtual(String.class, "concat", String.class, String.class);
    +     *   System.out.println(cat.<String>invoke("x", "y")); // xy
    +     *   MethodHandle d0 = dropArguments(cat, 0, String.class);
    +     *   System.out.println(d0.<String>invoke("x", "y", "z")); // xy
    +     *   MethodHandle d1 = dropArguments(cat, 1, String.class);
    +     *   System.out.println(d1.<String>invoke("x", "y", "z")); // xz
    +     *   MethodHandle d2 = dropArguments(cat, 2, String.class);
    +     *   System.out.println(d2.<String>invoke("x", "y", "z")); // yz
    +     *   MethodHandle d12 = dropArguments(cat, 1, String.class, String.class);
    +     *   System.out.println(d12.<String>invoke("w", "x", "y", "z")); // wz
    +     * 
    * @param target the method handle to invoke after the argument is dropped * @param valueTypes the type(s) of the argument to drop * @param pos which argument to drop (zero for the first) @@ -964,20 +1042,150 @@ public class MethodHandles { * before calling the original method handle */ public static - MethodHandle dropArguments(MethodHandle target, int pos, Class... valueTypes) { - if (valueTypes.length == 0) return target; + MethodHandle dropArguments(MethodHandle target, int pos, List> valueTypes) { + if (valueTypes.size() == 0) return target; MethodType oldType = target.type(); int outargs = oldType.parameterCount(); - int inargs = outargs + valueTypes.length; + int inargs = outargs + valueTypes.size(); if (pos < 0 || pos >= inargs) throw newIllegalArgumentException("no argument type to remove"); ArrayList> ptypes = new ArrayList>(oldType.parameterList()); - ptypes.addAll(pos, Arrays.asList(valueTypes)); - MethodType newType = MethodType.make(oldType.returnType(), ptypes); + ptypes.addAll(pos, valueTypes); + MethodType newType = MethodType.methodType(oldType.returnType(), ptypes); return MethodHandleImpl.dropArguments(IMPL_TOKEN, target, newType, pos); } + public static + MethodHandle dropArguments(MethodHandle target, int pos, Class... valueTypes) { + return dropArguments(target, pos, Arrays.asList(valueTypes)); + } + + /** + * PROVISIONAL API, WORK IN PROGRESS: + * Adapt a target method handle {@code target} by pre-processing + * one or more of its arguments, each with its own unary filter function, + * and then calling the target with each pre-processed argument + * replaced by the result of its corresponding filter function. + *

    + * The pre-processing is performed by one or more method handles, + * specified in the non-null elements of the {@code filters} array. + * (If there are no such elements, the original target is returned.) + * Each filter (that is, each non-null element of {@code filters}) + * is applied to the corresponding argument of the adapter. + *

    + * If a filter {@code F} applies to the {@code N}th argument of + * the method handle, then {@code F} must be a method handle which + * takes exactly one argument. The type of {@code F}'s sole argument + * replaces the corresponding argument type of the target + * in the resulting adapted method handle. + * The return type of {@code F} must be identical to the corresponding + * parameter type of the target. + *

    + * It is an error if there are non-null elements of {@code filters} + * which do not correspond to argument positions in the target. + * The actual length of the target array may be any number, it need + * not be the same as the parameter count of the target type. + * (This provides an easy way to filter just the first argument or two + * of a target method handle.) + *

    Here is pseudocode for the resulting adapter: + *

    +     * // there are N arguments in the A sequence
    +     * T target(A[N]...);
    +     * [i<N] V[i] filter[i](B[i]) = filters[i] ?: identity;
    +     * T adapter(B[N]... b) {
    +     *   A[N] a...;
    +     *   [i<N] a[i] = filter[i](b[i]);
    +     *   return target(a...);
    +     * }
    +     * 
    + * @param target the method handle to invoke after arguments are filtered + * @param filters method handles to call initially on filtered arguments + * @return method handle which incorporates the specified argument filtering logic + * @throws IllegalArgumentException if a non-null element of {@code filters} + * does not match a corresponding argument type of {@code target} + */ + public static + MethodHandle filterArguments(MethodHandle target, MethodHandle... filters) { + MethodType targetType = target.type(); + MethodHandle adapter = target; + MethodType adapterType = targetType; + int pos = -1, maxPos = targetType.parameterCount(); + for (MethodHandle filter : filters) { + pos += 1; + if (filter == null) continue; + if (pos >= maxPos) + throw newIllegalArgumentException("too many filters"); + MethodType filterType = filter.type(); + if (filterType.parameterCount() != 1 + || filterType.returnType() != targetType.parameterType(pos)) + throw newIllegalArgumentException("target and filter types do not match"); + adapterType = adapterType.changeParameterType(pos, filterType.parameterType(0)); + adapter = MethodHandleImpl.filterArgument(IMPL_TOKEN, adapter, pos, filter); + } + MethodType midType = adapter.type(); + if (midType != adapterType) + adapter = MethodHandleImpl.convertArguments(IMPL_TOKEN, adapter, adapterType, midType, null); + return adapter; + } + + /** + * PROVISIONAL API, WORK IN PROGRESS: + * Adapt a target method handle {@code target} by pre-processing + * some of its arguments, and then calling the target with + * the result of the pre-processing, plus all original arguments. + *

    + * The pre-processing is performed by a second method handle, the {@code combiner}. + * The first {@code N} arguments passed to the adapter, + * are copied to the combiner, which then produces a result. + * (Here, {@code N} is defined as the parameter count of the adapter.) + * After this, control passes to the {@code target}, with both the result + * of the combiner, and all the original incoming arguments. + *

    + * The first argument type of the target must be identical with the + * return type of the combiner. + * The resulting adapter is the same type as the target, except that the + * initial argument type of the target is dropped. + *

    + * (Note that {@link #dropArguments} can be used to remove any arguments + * that either the {@code combiner} or {@code target} does not wish to receive. + * If some of the incoming arguments are destined only for the combiner, + * consider using {@link #collectArguments} instead, since those + * arguments will not need to be live on the stack on entry to the + * target.) + *

    + * The first argument of the target must be identical with the + * return value of the combiner. + *

    Here is pseudocode for the resulting adapter: + *

    +     * // there are N arguments in the A sequence
    +     * T target(V, A[N]..., B...);
    +     * V combiner(A...);
    +     * T adapter(A... a, B... b) {
    +     *   V v = combiner(a...);
    +     *   return target(v, a..., b...);
    +     * }
    +     * 
    + * @param target the method handle to invoke after arguments are combined + * @param combiner method handle to call initially on the incoming arguments + * @return method handle which incorporates the specified argument folding logic + * @throws IllegalArgumentException if the first argument type of + * {@code target} is not the same as {@code combiner}'s return type, + * or if the next {@code foldArgs} argument types of {@code target} + * are not identical with the argument types of {@code combiner} + */ + public static + MethodHandle foldArguments(MethodHandle target, MethodHandle combiner) { + MethodType targetType = target.type(); + MethodType combinerType = combiner.type(); + int foldArgs = combinerType.parameterCount(); + boolean ok = (targetType.parameterCount() >= 1 + foldArgs); + if (!ok) + throw misMatchedTypes("target and combiner types", targetType, combinerType); + MethodType newType = targetType.dropParameterTypes(0, 1); + return MethodHandleImpl.foldArguments(IMPL_TOKEN, target, newType, combiner); + } + /** * PROVISIONAL API, WORK IN PROGRESS: * Make a method handle which adapts a target method handle, @@ -985,18 +1193,18 @@ public class MethodHandles { * If the guard fails, a fallback handle is called instead. * All three method handles must have the same corresponding * argument and return types, except that the return type - * of the test must be boolean. + * of the test must be boolean, and the test is allowed + * to have fewer arguments than the other two method handles. *

    Here is pseudocode for the resulting adapter: *

    -     * signature T(A...);
          * boolean test(A...);
    -     * T target(A...);
    -     * T fallback(A...);
    -     * T adapter(A... a) {
    +     * T target(A...,B...);
    +     * T fallback(A...,B...);
    +     * T adapter(A... a,B... b) {
          *   if (test(a...))
    -     *     return target(a...);
    +     *     return target(a..., b...);
          *   else
    -     *     return fallback(a...);
    +     *     return fallback(a..., b...);
          * }
          * 
    * @param test method handle used for test, must return boolean @@ -1011,10 +1219,23 @@ public class MethodHandles { MethodHandle guardWithTest(MethodHandle test, MethodHandle target, MethodHandle fallback) { - if (target.type() != fallback.type()) - throw newIllegalArgumentException("target and fallback types do not match"); - if (target.type().changeReturnType(boolean.class) != test.type()) - throw newIllegalArgumentException("target and test types do not match"); + MethodType gtype = test.type(); + MethodType ttype = target.type(); + MethodType ftype = fallback.type(); + if (ttype != ftype) + throw misMatchedTypes("target and fallback types", ttype, ftype); + MethodType gtype2 = ttype.changeReturnType(boolean.class); + if (gtype2 != gtype) { + if (gtype.returnType() != boolean.class) + throw newIllegalArgumentException("guard type is not a predicate "+gtype); + int gpc = gtype.parameterCount(), tpc = ttype.parameterCount(); + if (gpc < tpc) { + test = dropArguments(test, gpc, ttype.parameterList().subList(gpc, tpc)); + gtype = test.type(); + } + if (gtype2 != gtype) + throw misMatchedTypes("target and test types", ttype, gtype); + } /* { MethodHandle invoke = findVirtual(MethodHandle.class, "invoke", target.type()); static MethodHandle choose(boolean z, MethodHandle t, MethodHandle f) { @@ -1027,7 +1248,7 @@ public class MethodHandles { } // choose = \z.(z ? target : fallback) MethodHandle choose = findVirtual(MethodHandles.class, "choose", - MethodType.make(boolean.class, MethodHandle.class, MethodHandle.class)); + MethodType.methodType(boolean.class, MethodHandle.class, MethodHandle.class)); choose = appendArgument(choose, target); choose = appendArgument(choose, fallback); MethodHandle dispatch = compose(choose, test); @@ -1038,67 +1259,88 @@ public class MethodHandles { return MethodHandleImpl.makeGuardWithTest(IMPL_TOKEN, test, target, fallback); } - /** - * PROVISIONAL API, WORK IN PROGRESS: - * Adapt a target method handle {@code target} by first processing - * its arguments, and then calling the target. - * The initial processing is performed by a second method handle, the {@code combiner}. - * After this, control passes to the {@code target}, with the same arguments. - *

    - * The return value of the {@code combiner} is inserted into the argument list - * for the {@code target} at the indicated position {@code pos}, if it is non-negative. - * Except for this inserted argument (if any), the argument types of - * the target {@code target} and the {@code combiner} must be identical. - *

    - * (Note that {@link #dropArguments} can be used to remove any arguments - * that either the {@code combiner} or {@code target} does not wish to receive.) - *

    - * The combiner handle must have the same argument types as the - * target handle, but must return {@link MethodHandle} instead of - * the ultimate return type. The returned method handle, in turn, - * is required to have exactly the given final method type. - *

    Here is pseudocode for the resulting adapter: - *

    -     * signature V(A[pos]..., B...);
    -     * signature T(A[pos]..., V, B...);
    -     * T target(A... a, V v, B... b);
    -     * V combiner(A..., B...);
    -     * T adapter(A... a, B... b) {
    -     *   V v = combiner(a..., b...);
    -     *   return target(a..., v, b...);
    -     * }
    -     * 
    - * @param target the method handle to invoke after arguments are combined - * @param pos where the return value of {@code combiner} is to - * be inserted as an argument to {@code target} - * @param combiner method handle to call initially on the incoming arguments - * @return method handle which incorporates the specified dispatch logic - * @throws IllegalArgumentException if {@code combiner} does not itself - * return either void or the {@code pos}-th argument of {@code target}, - * or does not have the same argument types as {@code target} - * (minus the inserted argument) - */ - public static - MethodHandle combineArguments(MethodHandle target, int pos, MethodHandle combiner) { - MethodType mhType = target.type(); - Class combineType = combiner.type().returnType(); - MethodType incomingArgs; - if (pos < 0) { - // No inserted argument; target & combiner must have same argument types. - incomingArgs = mhType; - if (!incomingArgs.changeReturnType(combineType).equals(combiner.type())) - throw newIllegalArgumentException("target and combiner types do not match"); - } else { - // Inserted argument. - if (pos >= mhType.parameterCount() - || mhType.parameterType(pos) != combineType) - throw newIllegalArgumentException("inserted combiner argument does not match target"); - incomingArgs = mhType.dropParameterType(pos); - } - if (!incomingArgs.changeReturnType(combineType).equals(combiner.type())) { - throw newIllegalArgumentException("target and combiner types do not match"); - } - return MethodHandleImpl.combineArguments(IMPL_TOKEN, target, combiner, pos); + static RuntimeException misMatchedTypes(String what, MethodType t1, MethodType t2) { + return newIllegalArgumentException(what + " must match: " + t1 + " != " + t2); } + /** + * PROVISIONAL API, WORK IN PROGRESS: + * Make a method handle which adapts a target method handle, + * by running it inside an exception handler. + * If the target returns normally, the adapter returns that value. + * If an exception matching the specified type is thrown, the fallback + * handle is called instead on the exception, plus the original arguments. + *

    + * The handler must have leading parameter of {@code exType} or a supertype, + * followed by arguments which correspond (how? TBD) to + * all the parameters of the target. + * The target and handler must return the same type. + *

    Here is pseudocode for the resulting adapter: + *

    +     * T target(A...);
    +     * T handler(ExType, A...);
    +     * T adapter(A... a) {
    +     *   try {
    +     *     return target(a...);
    +     *   } catch (ExType ex) {
    +     *     return handler(ex, a...);
    +     *   }
    +     * }
    +     * 
    + * @param target method handle to call + * @param exType the type of exception which the handler will catch + * @param handler method handle to call if a matching exception is thrown + * @return method handle which incorporates the specified try/catch logic + * @throws IllegalArgumentException if {@code handler} does not accept + * the given exception type, or if the method handle types do + * not match in their return types and their + * corresponding parameters + */ + public static + MethodHandle catchException(MethodHandle target, + Class exType, + MethodHandle handler) { + MethodType targetType = target.type(); + MethodType handlerType = handler.type(); + boolean ok = (targetType.parameterCount() == + handlerType.parameterCount() - 1); +// for (int i = 0; ok && i < numExArgs; i++) { +// if (targetType.parameterType(i) != handlerType.parameterType(1+i)) +// ok = false; +// } + if (!ok) + throw newIllegalArgumentException("target and handler types do not match"); + return MethodHandleImpl.makeGuardWithCatch(IMPL_TOKEN, target, exType, handler); + } + + /** + * Produce a method handle which will throw exceptions of the given {@code exType}. + * The method handle will accept a single argument of {@code exType}, + * and immediately throw it as an exception. + * The method type will nominally specify a return of {@code returnType}. + * The return type may be anything convenient: It doesn't matter to the + * method handle's behavior, since it will never return normally. + */ + public static + MethodHandle throwException(Class returnType, Class exType) { + return MethodHandleImpl.throwException(IMPL_TOKEN, MethodType.methodType(returnType, exType)); + } + + /** Alias for {@link MethodType#methodType}. */ + @Deprecated // "use MethodType.methodType instead" + public static MethodType methodType(Class rtype) { + return MethodType.methodType(rtype); + } + + /** Alias for {@link MethodType#methodType}. */ + @Deprecated // "use MethodType.methodType instead" + public static MethodType methodType(Class rtype, Class ptype) { + return MethodType.methodType(rtype, ptype); + } + + /** Alias for {@link MethodType#methodType}. */ + @Deprecated // "use MethodType.methodType instead" + public static MethodType methodType(Class rtype, Class ptype0, Class... ptypes) { + return MethodType.methodType(rtype, ptype0, ptypes); + } } diff --git a/jdk/src/share/classes/java/dyn/MethodType.java b/jdk/src/share/classes/java/dyn/MethodType.java index 8e340de18f0..2ca02089d20 100644 --- a/jdk/src/share/classes/java/dyn/MethodType.java +++ b/jdk/src/share/classes/java/dyn/MethodType.java @@ -32,7 +32,7 @@ import java.util.List; import sun.dyn.Access; import sun.dyn.Invokers; import sun.dyn.MethodTypeImpl; -import sun.dyn.util.BytecodeSignature; +import sun.dyn.util.BytecodeDescriptor; import static sun.dyn.MemberName.newIllegalArgumentException; /** @@ -63,7 +63,7 @@ class MethodType { static { // This hack allows the implementation package special access to - // the internals of MethodType. In particular, the Form has all sorts + // the internals of MethodType. In particular, the MTImpl has all sorts // of cached information useful to the implementation code. MethodTypeImpl.setMethodTypeFriend(IMPL_TOKEN, new MethodTypeImpl.MethodTypeFriend() { public Class[] ptypes(MethodType mt) { return mt.ptypes; } @@ -114,51 +114,76 @@ class MethodType { * @throws IllegalArgumentException if any of the ptypes is void */ public static - MethodType make(Class rtype, Class[] ptypes) { + MethodType methodType(Class rtype, Class[] ptypes) { return makeImpl(rtype, ptypes, false); } - - /** Convenience method for {@link #make(java.lang.Class, java.lang.Class[])}. */ - public static - MethodType make(Class rtype, List> ptypes) { - return makeImpl(rtype, ptypes.toArray(NO_PTYPES), true); + @Deprecated public static + MethodType make(Class rtype, Class[] ptypes) { + return methodType(rtype, ptypes); } - /** Convenience method for {@link #make(java.lang.Class, java.lang.Class[])}. + /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. */ + public static + MethodType methodType(Class rtype, List> ptypes) { + boolean notrust = false; // random List impl. could return evil ptypes array + return makeImpl(rtype, ptypes.toArray(NO_PTYPES), notrust); + } + @Deprecated public static + MethodType make(Class rtype, List> ptypes) { + return methodType(rtype, ptypes); + } + + /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. * The leading parameter type is prepended to the remaining array. */ public static - MethodType make(Class rtype, Class ptype0, Class... ptypes) { + MethodType methodType(Class rtype, Class ptype0, Class... ptypes) { Class[] ptypes1 = new Class[1+ptypes.length]; ptypes1[0] = ptype0; System.arraycopy(ptypes, 0, ptypes1, 1, ptypes.length); return makeImpl(rtype, ptypes1, true); } + @Deprecated public static + MethodType make(Class rtype, Class ptype0, Class... ptypes) { + return methodType(rtype, ptype0, ptypes); + } - /** Convenience method for {@link #make(java.lang.Class, java.lang.Class[])}. + /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. * The resulting method has no parameter types. */ public static - MethodType make(Class rtype) { + MethodType methodType(Class rtype) { return makeImpl(rtype, NO_PTYPES, true); } + @Deprecated public static + MethodType make(Class rtype) { + return methodType(rtype); + } - /** Convenience method for {@link #make(java.lang.Class, java.lang.Class[])}. + /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. * The resulting method has the single given parameter type. */ public static - MethodType make(Class rtype, Class ptype0) { + MethodType methodType(Class rtype, Class ptype0) { return makeImpl(rtype, new Class[]{ ptype0 }, true); } + @Deprecated public static + MethodType make(Class rtype, Class ptype0) { + return methodType(rtype, ptype0); + } - /** Convenience method for {@link #make(java.lang.Class, java.lang.Class[])}. + /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. * The resulting method has the same parameter types as {@code ptypes}, * and the specified return type. */ public static - MethodType make(Class rtype, MethodType ptypes) { + MethodType methodType(Class rtype, MethodType ptypes) { return makeImpl(rtype, ptypes.ptypes, true); } + @Deprecated public static + MethodType make(Class rtype, MethodType ptypes) { + return methodType(rtype, ptypes); + } /** * Sole factory method to find or create an interned method type. @@ -202,15 +227,16 @@ class MethodType { private static final MethodType[] objectOnlyTypes = new MethodType[20]; /** - * Convenience method for {@link #make(java.lang.Class, java.lang.Class[], boolean)}. - * All parameters and the return type will be Object, except the final varargs parameter if any. + * Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. + * All parameters and the return type will be {@code Object}, + * except the final varargs parameter if any, which will be {@code Object[]}. * @param objectArgCount number of parameters (excluding the varargs parameter if any) - * @param varargs whether there will be a varargs parameter, of type Object[] + * @param varargs whether there will be a varargs parameter, of type {@code Object[]} * @return a totally generic method type, given only its count of parameters and varargs - * @see #makeGeneric(int) + * @see #genericMethodType(int) */ public static - MethodType makeGeneric(int objectArgCount, boolean varargs) { + MethodType genericMethodType(int objectArgCount, boolean varargs) { MethodType mt; int ivarargs = (!varargs ? 0 : 1); int ootIndex = objectArgCount*2 + ivarargs; @@ -227,19 +253,27 @@ class MethodType { } return mt; } + @Deprecated public static + MethodType makeGeneric(int objectArgCount, boolean varargs) { + return genericMethodType(objectArgCount, varargs); + } /** * All parameters and the return type will be Object. * @param objectArgCount number of parameters * @return a totally generic method type, given only its count of parameters - * @see #makeGeneric(int, boolean) + * @see #genericMethodType(int, boolean) */ public static + MethodType genericMethodType(int objectArgCount) { + return genericMethodType(objectArgCount, false); + } + @Deprecated public static MethodType makeGeneric(int objectArgCount) { - return makeGeneric(objectArgCount, false); + return genericMethodType(objectArgCount); } - /** Convenience method for {@link #make(java.lang.Class, java.lang.Class[], boolean)}. + /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. * @param num the index (zero-based) of the parameter type to change * @param nptype a new parameter type to replace the old one with * @return the same type, except with the selected parameter changed @@ -251,11 +285,10 @@ class MethodType { return makeImpl(rtype, nptypes, true); } - /** Convenience method for {@link #make(java.lang.Class, java.lang.Class[], boolean)}. - * @param num the position (zero-based) of the inserted parameter type - * @param nptype a new parameter type to insert into the parameter list - * @return the same type, except with the selected parameter inserted + /** Convenience method for {@link #insertParameterTypes}. + * @deprecated Use {@link #insertParameterTypes} instead. */ + @Deprecated public MethodType insertParameterType(int num, Class nptype) { int len = ptypes.length; Class[] nptypes = Arrays.copyOfRange(ptypes, 0, len+1); @@ -264,23 +297,73 @@ class MethodType { return makeImpl(rtype, nptypes, true); } - /** Convenience method for {@link #make(java.lang.Class, java.lang.Class[], boolean)}. - * @param num the index (zero-based) of the parameter type to remove - * @return the same type, except with the selected parameter removed + /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. + * @param num the position (zero-based) of the inserted parameter type(s) + * @param ptypesToInsert zero or more a new parameter types to insert into the parameter list + * @return the same type, except with the selected parameter(s) inserted */ - public MethodType dropParameterType(int num) { + public MethodType insertParameterTypes(int num, Class... ptypesToInsert) { int len = ptypes.length; + if (num < 0 || num > len) + throw newIllegalArgumentException("num="+num); //SPECME + int ilen = ptypesToInsert.length; + if (ilen == 0) return this; + Class[] nptypes = Arrays.copyOfRange(ptypes, 0, len+ilen); + System.arraycopy(nptypes, num, nptypes, num+ilen, len-num); + System.arraycopy(ptypesToInsert, 0, nptypes, num, ilen); + return makeImpl(rtype, nptypes, true); + } + + /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. + * @param num the position (zero-based) of the inserted parameter type(s) + * @param ptypesToInsert zero or more a new parameter types to insert into the parameter list + * @return the same type, except with the selected parameter(s) inserted + */ + public MethodType insertParameterTypes(int num, List> ptypesToInsert) { + return insertParameterTypes(num, ptypesToInsert.toArray(NO_PTYPES)); + } + + /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. + * @param start the index (zero-based) of the first parameter type to remove + * @param end the index (greater than {@code start}) of the first parameter type after not to remove + * @return the same type, except with the selected parameter(s) removed + */ + public MethodType dropParameterTypes(int start, int end) { + int len = ptypes.length; + if (!(0 <= start && start <= end && end <= len)) + throw newIllegalArgumentException("start="+start+" end="+end); //SPECME + if (start == end) return this; Class[] nptypes; - if (num == 0) { - nptypes = Arrays.copyOfRange(ptypes, 1, len); + if (start == 0) { + if (end == len) { + // drop all parameters + nptypes = NO_PTYPES; + } else { + // drop initial parameter(s) + nptypes = Arrays.copyOfRange(ptypes, end, len); + } } else { - nptypes = Arrays.copyOfRange(ptypes, 0, len-1); - System.arraycopy(ptypes, num+1, nptypes, num, (len-1)-num); + if (end == len) { + // drop trailing parameter(s) + nptypes = Arrays.copyOfRange(ptypes, 0, start); + } else { + int tail = len - end; + nptypes = Arrays.copyOfRange(ptypes, 0, start + tail); + System.arraycopy(ptypes, end, nptypes, start, tail); + } } return makeImpl(rtype, nptypes, true); } - /** Convenience method for {@link #make(java.lang.Class, java.lang.Class[], boolean)}. + /** Convenience method for {@link #dropParameterTypes}. + * @deprecated Use {@link #dropParameterTypes} instead. + */ + @Deprecated + public MethodType dropParameterType(int num) { + return dropParameterTypes(num, num+1); + } + + /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. * @param nrtype a return parameter type to replace the old one with * @return the same type, except with the return type change */ @@ -291,6 +374,7 @@ class MethodType { /** Convenience method. * Report if this type contains a primitive argument or return value. + * The return type {@code void} counts as a primitive. * @return true if any of the types are primitives */ public boolean hasPrimitives() { @@ -300,39 +384,47 @@ class MethodType { /** Convenience method. * Report if this type contains a wrapper argument or return value. * Wrappers are types which box primitive values, such as {@link Integer}. + * The reference type {@code java.lang.Void} counts as a wrapper. * @return true if any of the types are wrappers */ public boolean hasWrappers() { return unwrap() != this; } - /** Convenience method for {@link #make(java.lang.Class, java.lang.Class[])}. - * Erase all reference types to Object. + /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. + * Erase all reference types to {@code Object}. + * All primitive types (including {@code void}) will remain unchanged. * @return a version of the original type with all reference types replaced */ public MethodType erase() { return form.erasedType(); } - /** Convenience method for {@link #makeGeneric(int)}. - * Convert all types, both reference and primitive, to Object. + /** Convenience method for {@link #genericMethodType(int)}. + * Convert all types, both reference and primitive, to {@code Object}. + * The expression {@code type.wrap().erase()} produces the same value + * as {@code type.generic()}. * @return a version of the original type with all types replaced */ public MethodType generic() { - return makeGeneric(parameterCount()); + return genericMethodType(parameterCount()); } - /** Convenience method for {@link #make(java.lang.Class, java.lang.Class[])}. + /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. * Convert all primitive types to their corresponding wrapper types. + * All reference types (including wrapper types) will remain unchanged. * A {@code void} return type is changed to the type {@code java.lang.Void}. + * The expression {@code type.wrap().erase()} produces the same value + * as {@code type.generic()}. * @return a version of the original type with all primitive types replaced */ public MethodType wrap() { return hasPrimitives() ? wrapWithPrims(this) : this; } - /** Convenience method for {@link #make(java.lang.Class, java.lang.Class[])}. + /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. * Convert all wrapper types to their corresponding primitive types. + * All primitive types (including {@code void}) will remain unchanged. * A return type of {@code java.lang.Void} is changed to {@code void}. * @return a version of the original type with all wrapper types replaced */ @@ -391,6 +483,7 @@ class MethodType { /** * Convenience method to present the arguments as an array. + * Changes to the array will not result in changes to the type. * @return the parameter types (as a fresh copy if necessary) */ public Class[] parameterArray() { @@ -491,7 +584,7 @@ class MethodType { return form.parameterSlotCount(); } - /** Number of JVM stack slots which carry all parameters after + /** Number of JVM stack slots which carry all parameters including and after * the given position, which must be in the range of 0 to * {@code parameterCount} inclusive. Successive parameters are * more shallowly stacked, and parameters are indexed in the bytecodes @@ -532,7 +625,7 @@ class MethodType { return form.returnSlotCount(); } - /** Convenience method for {@link #make(java.lang.Class, java.lang.Class[])}. + /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}. * Find or create an instance (interned) of the given method type. * Any class or interface name embedded in the signature string * will be resolved by calling {@link ClassLoader#loadClass(java.lang.String)} @@ -544,16 +637,16 @@ class MethodType { *

    * This method is included for the benfit of applications that must * generate bytecodes that process method handles and invokedynamic. - * @param bytecodeSignature a bytecode-level signature string "(T...)T" + * @param descriptor a bytecode-level signature string "(T...)T" * @param loader the class loader in which to look up the types * @return a method type matching the bytecode-level signature * @throws IllegalArgumentException if the string is not well-formed * @throws TypeNotPresentException if a named type cannot be found */ - public static MethodType fromBytecodeString(String bytecodeSignature, ClassLoader loader) + public static MethodType fromMethodDescriptorString(String descriptor, ClassLoader loader) throws IllegalArgumentException, TypeNotPresentException { - List> types = BytecodeSignature.parseMethod(bytecodeSignature, loader); + List> types = BytecodeDescriptor.parseMethod(descriptor, loader); Class rtype = types.remove(types.size() - 1); Class[] ptypes = types.toArray(NO_PTYPES); return makeImpl(rtype, ptypes, true); @@ -565,11 +658,21 @@ class MethodType { *

    * This method is included for the benfit of applications that must * generate bytecodes that process method handles and invokedynamic. - * {@link #fromBytecodeString(java.lang.String, java.lang.ClassLoader)}, + * {@link #fromMethodDescriptorString(java.lang.String, java.lang.ClassLoader)}, * because the latter requires a suitable class loader argument. * @return the bytecode signature representation */ + public String toMethodDescriptorString() { + return BytecodeDescriptor.unparse(this); + } + + /** Temporary alias for toMethodDescriptorString; delete after M3. */ public String toBytecodeString() { - return BytecodeSignature.unparse(this); + return toMethodDescriptorString(); + } + /** Temporary alias for fromMethodDescriptorString; delete after M3. */ + public static MethodType fromBytecodeString(String descriptor, ClassLoader loader) + throws IllegalArgumentException, TypeNotPresentException { + return fromMethodDescriptorString(descriptor, loader); } } diff --git a/jdk/src/share/classes/java/dyn/package-info.java b/jdk/src/share/classes/java/dyn/package-info.java index 858d0e9bcbf..df82633c211 100644 --- a/jdk/src/share/classes/java/dyn/package-info.java +++ b/jdk/src/share/classes/java/dyn/package-info.java @@ -24,6 +24,7 @@ */ /** + * PROVISIONAL API, WORK IN PROGRESS: * This package contains dynamic language support provided directly by * the Java core class libraries and virtual machine. * @author John Rose, JSR 292 EG diff --git a/jdk/src/share/classes/java/lang/ClassLoader.java b/jdk/src/share/classes/java/lang/ClassLoader.java index 323240b395c..bb4ea98694b 100644 --- a/jdk/src/share/classes/java/lang/ClassLoader.java +++ b/jdk/src/share/classes/java/lang/ClassLoader.java @@ -175,15 +175,8 @@ import sun.security.util.SecurityConstants; public abstract class ClassLoader { private static native void registerNatives(); - - // Set of classes which are registered as parallel capable class loaders - private static final Set> parallelLoaders - = Collections.newSetFromMap(Collections.synchronizedMap - (new WeakHashMap, Boolean>())); - static { registerNatives(); - parallelLoaders.add(ClassLoader.class); } // The parent class loader for delegation @@ -191,6 +184,52 @@ public abstract class ClassLoader { // must be added *after* it. private final ClassLoader parent; + /** + * Encapsulates the set of parallel capable loader types. + */ + private static class ParallelLoaders { + private ParallelLoaders() {} + + // the set of parallel capable loader types + private static final Set> loaderTypes = + Collections.newSetFromMap( + new WeakHashMap, Boolean>()); + static { + synchronized (loaderTypes) { loaderTypes.add(ClassLoader.class); } + } + + /** + * Registers the given class loader type as parallel capabale. + * Returns {@code true} is successfully registered; {@code false} if + * loader's super class is not registered. + */ + static boolean register(Class c) { + synchronized (loaderTypes) { + if (loaderTypes.contains(c.getSuperclass())) { + // register the class loader as parallel capable + // if and only if all of its super classes are. + // Note: given current classloading sequence, if + // the immediate super class is parallel capable, + // all the super classes higher up must be too. + loaderTypes.add(c); + return true; + } else { + return false; + } + } + } + + /** + * Returns {@code true} if the given class loader type is + * registered as parallel capable. + */ + static boolean isRegistered(Class c) { + synchronized (loaderTypes) { + return loaderTypes.contains(c); + } + } + } + // Maps class name to the corresponding lock object when the current // class loader is parallel capable. // Note: VM also uses this field to decide if the current class loader @@ -237,7 +276,7 @@ public abstract class ClassLoader { private ClassLoader(Void unused, ClassLoader parent) { this.parent = parent; - if (parallelLoaders.contains(this.getClass())) { + if (ParallelLoaders.isRegistered(this.getClass())) { parallelLockMap = new ConcurrentHashMap(); package2certs = new ConcurrentHashMap(); domains = @@ -1194,24 +1233,7 @@ public abstract class ClassLoader { * @since 1.7 */ protected static boolean registerAsParallelCapable() { - Class caller = getCaller(1); - Class superCls = caller.getSuperclass(); - boolean result = false; - // Explicit synchronization needed for composite action - synchronized (parallelLoaders) { - if (!parallelLoaders.contains(caller)) { - if (parallelLoaders.contains(superCls)) { - // register the immediate caller as parallel capable - // if and only if all of its super classes are. - // Note: given current classloading sequence, if - // the immediate super class is parallel capable, - // all the super classes higher up must be too. - result = true; - parallelLoaders.add(caller); - } - } else result = true; - } - return result; + return ParallelLoaders.register(getCaller(1)); } /** @@ -2174,4 +2196,3 @@ class SystemClassLoaderAction return sys; } } - diff --git a/jdk/src/share/classes/java/lang/Deprecated.java b/jdk/src/share/classes/java/lang/Deprecated.java index 427b77baac8..28909e19e77 100644 --- a/jdk/src/share/classes/java/lang/Deprecated.java +++ b/jdk/src/share/classes/java/lang/Deprecated.java @@ -26,6 +26,7 @@ package java.lang; import java.lang.annotation.*; +import static java.lang.annotation.ElementType.*; /** * A program element annotated @Deprecated is one that programmers @@ -38,5 +39,6 @@ import java.lang.annotation.*; */ @Documented @Retention(RetentionPolicy.RUNTIME) +@Target(value={CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE}) public @interface Deprecated { } diff --git a/jdk/src/share/classes/java/lang/Error.java b/jdk/src/share/classes/java/lang/Error.java index c1ab7a89297..a5af32668e8 100644 --- a/jdk/src/share/classes/java/lang/Error.java +++ b/jdk/src/share/classes/java/lang/Error.java @@ -26,27 +26,31 @@ package java.lang; /** - * An Error is a subclass of Throwable + * An {@code Error} is a subclass of {@code Throwable} * that indicates serious problems that a reasonable application * should not try to catch. Most such errors are abnormal conditions. - * The ThreadDeath error, though a "normal" condition, - * is also a subclass of Error because most applications + * The {@code ThreadDeath} error, though a "normal" condition, + * is also a subclass of {@code Error} because most applications * should not try to catch it. *

    - * A method is not required to declare in its throws - * clause any subclasses of Error that might be thrown + * A method is not required to declare in its {@code throws} + * clause any subclasses of {@code Error} that might be thrown * during the execution of the method but not caught, since these * errors are abnormal conditions that should never occur. * + * That is, {@code Error} and its subclasses are regarded as unchecked + * exceptions for the purposes of compile-time checking of exceptions. + * * @author Frank Yellin * @see java.lang.ThreadDeath + * @jls3 11.2 Compile-Time Checking of Exceptions * @since JDK1.0 */ public class Error extends Throwable { static final long serialVersionUID = 4980196508277280342L; /** - * Constructs a new error with null as its detail message. + * Constructs a new error with {@code null} as its detail message. * The cause is not initialized, and may subsequently be initialized by a * call to {@link #initCause}. */ @@ -69,7 +73,7 @@ public class Error extends Throwable { /** * Constructs a new error with the specified detail message and * cause.

    Note that the detail message associated with - * cause is not automatically incorporated in + * {@code cause} is not automatically incorporated in * this error's detail message. * * @param message the detail message (which is saved for later retrieval diff --git a/jdk/src/share/classes/java/lang/Exception.java b/jdk/src/share/classes/java/lang/Exception.java index 70b99ae9be6..bdb1c7d3687 100644 --- a/jdk/src/share/classes/java/lang/Exception.java +++ b/jdk/src/share/classes/java/lang/Exception.java @@ -26,19 +26,27 @@ package java.lang; /** - * The class Exception and its subclasses are a form of - * Throwable that indicates conditions that a reasonable + * The class {@code Exception} and its subclasses are a form of + * {@code Throwable} that indicates conditions that a reasonable * application might want to catch. * + *

    The class {@code Exception} and any subclasses that are not also + * subclasses of {@link RuntimeException} are checked + * exceptions. Checked exceptions need to be declared in a + * method or constructor's {@code throws} clause if they can be thrown + * by the execution of the method or constructor and propagate outside + * the method or constructor boundary. + * * @author Frank Yellin * @see java.lang.Error + * @jls3 11.2 Compile-Time Checking of Exceptions * @since JDK1.0 */ public class Exception extends Throwable { static final long serialVersionUID = -3387516993124229948L; /** - * Constructs a new exception with null as its detail message. + * Constructs a new exception with {@code null} as its detail message. * The cause is not initialized, and may subsequently be initialized by a * call to {@link #initCause}. */ @@ -61,7 +69,7 @@ public class Exception extends Throwable { /** * Constructs a new exception with the specified detail message and * cause.

    Note that the detail message associated with - * cause is not automatically incorporated in + * {@code cause} is not automatically incorporated in * this exception's detail message. * * @param message the detail message (which is saved for later retrieval diff --git a/jdk/src/share/classes/java/lang/Iterable.java b/jdk/src/share/classes/java/lang/Iterable.java index 9463feeab4f..0b1e9548a52 100644 --- a/jdk/src/share/classes/java/lang/Iterable.java +++ b/jdk/src/share/classes/java/lang/Iterable.java @@ -27,8 +27,12 @@ package java.lang; import java.util.Iterator; -/** Implementing this interface allows an object to be the target of - * the "foreach" statement. +/** + * Implementing this interface allows an object to be the target of + * the "foreach" statement. + * + * @param the type of elements returned by the iterator + * * @since 1.5 */ public interface Iterable { diff --git a/jdk/src/share/classes/java/lang/RuntimeException.java b/jdk/src/share/classes/java/lang/RuntimeException.java index e3378485bdf..d510e2c5898 100644 --- a/jdk/src/share/classes/java/lang/RuntimeException.java +++ b/jdk/src/share/classes/java/lang/RuntimeException.java @@ -26,22 +26,24 @@ package java.lang; /** - * RuntimeException is the superclass of those + * {@code RuntimeException} is the superclass of those * exceptions that can be thrown during the normal operation of the * Java Virtual Machine. - *

    - * A method is not required to declare in its throws - * clause any subclasses of RuntimeException that might - * be thrown during the execution of the method but not caught. * + *

    {@code RuntimeException} and its subclasses are unchecked + * exceptions. Unchecked exceptions do not need to be + * declared in a method or constructor's {@code throws} clause if they + * can be thrown by the execution of the method or constructor and + * propagate outside the method or constructor boundary. * * @author Frank Yellin + * @jls3 11.2 Compile-Time Checking of Exceptions * @since JDK1.0 */ public class RuntimeException extends Exception { static final long serialVersionUID = -7034897190745766939L; - /** Constructs a new runtime exception with null as its + /** Constructs a new runtime exception with {@code null} as its * detail message. The cause is not initialized, and may subsequently be * initialized by a call to {@link #initCause}. */ @@ -63,7 +65,7 @@ public class RuntimeException extends Exception { /** * Constructs a new runtime exception with the specified detail message and * cause.

    Note that the detail message associated with - * cause is not automatically incorporated in + * {@code cause} is not automatically incorporated in * this runtime exception's detail message. * * @param message the detail message (which is saved for later retrieval diff --git a/jdk/src/share/classes/java/lang/StrictMath.java b/jdk/src/share/classes/java/lang/StrictMath.java index dad91405741..704be3e310e 100644 --- a/jdk/src/share/classes/java/lang/StrictMath.java +++ b/jdk/src/share/classes/java/lang/StrictMath.java @@ -26,6 +26,7 @@ package java.lang; import java.util.Random; import sun.misc.FpUtils; +import sun.misc.DoubleConsts; /** * The class {@code StrictMath} contains methods for performing basic @@ -316,7 +317,9 @@ public final class StrictMath { * floating-point value that is greater than or equal to * the argument and is equal to a mathematical integer. */ - public static native double ceil(double a); + public static double ceil(double a) { + return floorOrCeil(a, -0.0, 1.0, 1.0); + } /** * Returns the largest (closest to positive infinity) @@ -333,7 +336,54 @@ public final class StrictMath { * floating-point value that less than or equal to the argument * and is equal to a mathematical integer. */ - public static native double floor(double a); + public static double floor(double a) { + return floorOrCeil(a, -1.0, 0.0, -1.0); + } + + /** + * Internal method to share logic between floor and ceil. + * + * @param a the value to be floored or ceiled + * @param negativeBoundary result for values in (-1, 0) + * @param positiveBoundary result for values in (0, 1) + * @param increment value to add when the argument is non-integral + */ + private static double floorOrCeil(double a, + double negativeBoundary, + double positiveBoundary, + double sign) { + int exponent = Math.getExponent(a); + + if (exponent < 0) { + /* + * Absolute value of argument is less than 1. + * floorOrceil(-0.0) => -0.0 + * floorOrceil(+0.0) => +0.0 + */ + return ((a == 0.0) ? a : + ( (a < 0.0) ? negativeBoundary : positiveBoundary) ); + } else if (exponent >= 52) { + /* + * Infinity, NaN, or a value so large it must be integral. + */ + return a; + } + // Else the argument is either an integral value already XOR it + // has to be rounded to one. + assert exponent >= 0 && exponent <= 51; + + long doppel = Double.doubleToRawLongBits(a); + long mask = DoubleConsts.SIGNIF_BIT_MASK >> exponent; + + if ( (mask & doppel) == 0L ) + return a; // integral value + else { + double result = Double.longBitsToDouble(doppel & (~mask)); + if (sign*a > 0.0) + result = result + sign; + return result; + } + } /** * Returns the {@code double} value that is closest in value diff --git a/jdk/src/share/classes/java/lang/String.java b/jdk/src/share/classes/java/lang/String.java index 6aaf7684bf3..2aead0f545d 100644 --- a/jdk/src/share/classes/java/lang/String.java +++ b/jdk/src/share/classes/java/lang/String.java @@ -1492,7 +1492,7 @@ public final class String */ public int hashCode() { int h = hash; - if (h == 0) { + if (h == 0 && count > 0) { int off = offset; char val[] = value; int len = count; diff --git a/jdk/src/share/classes/java/lang/SuppressWarnings.java b/jdk/src/share/classes/java/lang/SuppressWarnings.java index b999bce2685..cc98d68b1c0 100644 --- a/jdk/src/share/classes/java/lang/SuppressWarnings.java +++ b/jdk/src/share/classes/java/lang/SuppressWarnings.java @@ -26,7 +26,6 @@ package java.lang; import java.lang.annotation.*; -import java.lang.annotation.ElementType; import static java.lang.annotation.ElementType.*; /** @@ -45,7 +44,7 @@ import static java.lang.annotation.ElementType.*; * @since 1.5 * @author Josh Bloch */ -@Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE}) +@Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE, TYPE_PARAMETER}) @Retention(RetentionPolicy.SOURCE) public @interface SuppressWarnings { /** diff --git a/jdk/src/share/classes/java/lang/System.java b/jdk/src/share/classes/java/lang/System.java index b0c46528cbd..3d55a2eaea4 100644 --- a/jdk/src/share/classes/java/lang/System.java +++ b/jdk/src/share/classes/java/lang/System.java @@ -619,6 +619,20 @@ public final class System { return props; } + /** + * Returns the system-dependent line separator string. It always + * returns the same value - the initial value of the {@linkplain + * #getProperty(String) system property} {@code line.separator}. + * + *

    On UNIX systems, it returns {@code "\n"}; on Microsoft + * Windows systems it returns {@code "\r\n"}. + */ + public static String lineSeparator() { + return lineSeparator; + } + + private static String lineSeparator; + /** * Sets the system properties to the Properties * argument. @@ -1104,6 +1118,7 @@ public final class System { private static void initializeSystemClass() { props = new Properties(); initProperties(props); + lineSeparator = props.getProperty("line.separator"); sun.misc.Version.init(); // Workaround until DownloadManager initialization is revisited. @@ -1192,7 +1207,7 @@ public final class System { } /* returns the class of the caller. */ - static Class getCallerClass() { + static Class getCallerClass() { // NOTE use of more generic Reflection.getCallerClass() return Reflection.getCallerClass(3); } diff --git a/jdk/src/share/classes/java/lang/Throwable.java b/jdk/src/share/classes/java/lang/Throwable.java index c4e75d250ff..ebc7fe7ceab 100644 --- a/jdk/src/share/classes/java/lang/Throwable.java +++ b/jdk/src/share/classes/java/lang/Throwable.java @@ -34,6 +34,11 @@ import java.io.*; * this class or one of its subclasses can be the argument type in a * catch clause. * + * For the purposes of compile-time checking of exceptions, {@code + * Throwable} and any subclass of {@code Throwable} that is not also a + * subclass of either {@link RuntimeException} or {@link Error} are + * regarded as checked exceptions. + * *

    Instances of two subclasses, {@link java.lang.Error} and * {@link java.lang.Exception}, are conventionally used to indicate * that exceptional situations have occurred. Typically, these instances @@ -142,6 +147,7 @@ import java.io.*; * @author unascribed * @author Josh Bloch (Added exception chaining and programmatic access to * stack trace in 1.4.) + * @jls3 11.2 Compile-Time Checking of Exceptions * @since JDK1.0 */ public class Throwable implements Serializable { diff --git a/jdk/src/share/classes/java/lang/management/PlatformManagedObject.java b/jdk/src/share/classes/java/lang/management/PlatformManagedObject.java index 5f68635d4fe..ca5edbeb518 100644 --- a/jdk/src/share/classes/java/lang/management/PlatformManagedObject.java +++ b/jdk/src/share/classes/java/lang/management/PlatformManagedObject.java @@ -32,7 +32,7 @@ import javax.management.ObjectName; * for monitoring and managing a component in the Java platform. * Each platform managed object has a unique * object name - * for the {@linkplain ManagementFactory.getPlatformMBeanServer + * for the {@linkplain ManagementFactory#getPlatformMBeanServer * platform MBeanServer} access. * All platform MXBeans will implement this interface. * diff --git a/jdk/src/share/classes/java/net/SocketInputStream.java b/jdk/src/share/classes/java/net/SocketInputStream.java index 63ef40ecb79..e8086559f19 100644 --- a/jdk/src/share/classes/java/net/SocketInputStream.java +++ b/jdk/src/share/classes/java/net/SocketInputStream.java @@ -118,6 +118,10 @@ class SocketInputStream extends FileInputStream * @exception IOException If an I/O error has occurred. */ public int read(byte b[], int off, int length) throws IOException { + return read(b, off, length, impl.getTimeout()); + } + + int read(byte b[], int off, int length, int timeout) throws IOException { int n; // EOF already encountered @@ -143,7 +147,7 @@ class SocketInputStream extends FileInputStream // acquire file descriptor and do the read FileDescriptor fd = impl.acquireFD(); try { - n = socketRead0(fd, b, off, length, impl.getTimeout()); + n = socketRead0(fd, b, off, length, timeout); if (n > 0) { return n; } @@ -161,7 +165,7 @@ class SocketInputStream extends FileInputStream impl.setConnectionResetPending(); impl.acquireFD(); try { - n = socketRead0(fd, b, off, length, impl.getTimeout()); + n = socketRead0(fd, b, off, length, timeout); if (n > 0) { return n; } diff --git a/jdk/src/share/classes/java/net/SocksSocketImpl.java b/jdk/src/share/classes/java/net/SocksSocketImpl.java index 383ac2fcbf6..d4da9c98c17 100644 --- a/jdk/src/share/classes/java/net/SocksSocketImpl.java +++ b/jdk/src/share/classes/java/net/SocksSocketImpl.java @@ -98,11 +98,31 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { super.connect(new InetSocketAddress(host, port), timeout); } + private static int remainingMillis(long deadlineMillis) throws IOException { + if (deadlineMillis == 0L) + return 0; + + final long remaining = deadlineMillis - System.currentTimeMillis(); + if (remaining > 0) + return (int) remaining; + + throw new SocketTimeoutException(); + } + private int readSocksReply(InputStream in, byte[] data) throws IOException { + return readSocksReply(in, data, 0L); + } + + private int readSocksReply(InputStream in, byte[] data, long deadlineMillis) throws IOException { int len = data.length; int received = 0; for (int attempts = 0; received < len && attempts < 3; attempts++) { - int count = in.read(data, received, len - received); + int count; + try { + count = ((SocketInputStream)in).read(data, received, len - received, remainingMillis(deadlineMillis)); + } catch (SocketTimeoutException e) { + throw new SocketTimeoutException("Connect timed out"); + } if (count < 0) throw new SocketException("Malformed reply from SOCKS server"); received += count; @@ -115,6 +135,12 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { */ private boolean authenticate(byte method, InputStream in, BufferedOutputStream out) throws IOException { + return authenticate(method, in, out, 0L); + } + + private boolean authenticate(byte method, InputStream in, + BufferedOutputStream out, + long deadlineMillis) throws IOException { // No Authentication required. We're done then! if (method == NO_AUTH) return true; @@ -162,7 +188,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { out.write(0); out.flush(); byte[] data = new byte[2]; - int i = readSocksReply(in, data); + int i = readSocksReply(in, data, deadlineMillis); if (i != 2 || data[1] != 0) { /* RFC 1929 specifies that the connection MUST be closed if authentication fails */ @@ -201,18 +227,18 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { // out.write(outToken); // out.flush(); // data = new byte[2]; -// i = readSocksReply(in, data); +// i = readSocksReply(in, data, deadlineMillis); // if (i != 2 || data[1] == 0xff) { // in.close(); // out.close(); // return false; // } -// i = readSocksReply(in, data); +// i = readSocksReply(in, data, deadlineMillis); // int len = 0; // len = ((int)data[0] & 0xff) << 8; // len += data[1]; // data = new byte[len]; -// i = readSocksReply(in, data); +// i = readSocksReply(in, data, deadlineMillis); // if (i == len) // return true; // in.close(); @@ -231,7 +257,8 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { } private void connectV4(InputStream in, OutputStream out, - InetSocketAddress endpoint) throws IOException { + InetSocketAddress endpoint, + long deadlineMillis) throws IOException { if (!(endpoint.getAddress() instanceof Inet4Address)) { throw new SocketException("SOCKS V4 requires IPv4 only addresses"); } @@ -249,7 +276,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { out.write(0); out.flush(); byte[] data = new byte[8]; - int n = readSocksReply(in, data); + int n = readSocksReply(in, data, deadlineMillis); if (n != 8) throw new SocketException("Reply from SOCKS server has bad length: " + n); if (data[0] != 0 && data[0] != 4) @@ -296,6 +323,15 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { */ @Override protected void connect(SocketAddress endpoint, int timeout) throws IOException { + final long deadlineMillis; + + if (timeout == 0) { + deadlineMillis = 0L; + } else { + long finish = System.currentTimeMillis() + timeout; + deadlineMillis = finish < 0 ? Long.MAX_VALUE : finish; + } + SecurityManager security = System.getSecurityManager(); if (endpoint == null || !(endpoint instanceof InetSocketAddress)) throw new IllegalArgumentException("Unsupported address type"); @@ -322,7 +358,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { /* * No default proxySelector --> direct connection */ - super.connect(epoint, timeout); + super.connect(epoint, remainingMillis(deadlineMillis)); return; } URI uri; @@ -345,13 +381,13 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { java.util.Iterator iProxy = null; iProxy = sel.select(uri).iterator(); if (iProxy == null || !(iProxy.hasNext())) { - super.connect(epoint, timeout); + super.connect(epoint, remainingMillis(deadlineMillis)); return; } while (iProxy.hasNext()) { p = iProxy.next(); if (p == null || p == Proxy.NO_PROXY) { - super.connect(epoint, timeout); + super.connect(epoint, remainingMillis(deadlineMillis)); return; } if (p.type() != Proxy.Type.SOCKS) @@ -364,7 +400,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { // Connects to the SOCKS server try { - privilegedConnect(server, serverPort, timeout); + privilegedConnect(server, serverPort, remainingMillis(deadlineMillis)); // Worked, let's get outta here break; } catch (IOException e) { @@ -388,7 +424,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { } else { // Connects to the SOCKS server try { - privilegedConnect(server, serverPort, timeout); + privilegedConnect(server, serverPort, remainingMillis(deadlineMillis)); } catch (IOException e) { throw new SocketException(e.getMessage()); } @@ -403,7 +439,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { // DOMAIN type of addresses (unresolved addresses here) if (epoint.isUnresolved()) throw new UnknownHostException(epoint.toString()); - connectV4(in, out, epoint); + connectV4(in, out, epoint, deadlineMillis); return; } @@ -414,7 +450,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { out.write(USER_PASSW); out.flush(); byte[] data = new byte[2]; - int i = readSocksReply(in, data); + int i = readSocksReply(in, data, deadlineMillis); if (i != 2 || ((int)data[0]) != PROTO_VERS) { // Maybe it's not a V5 sever after all // Let's try V4 before we give up @@ -422,12 +458,12 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { // DOMAIN type of addresses (unresolved addresses here) if (epoint.isUnresolved()) throw new UnknownHostException(epoint.toString()); - connectV4(in, out, epoint); + connectV4(in, out, epoint, deadlineMillis); return; } if (((int)data[1]) == NO_METHODS) throw new SocketException("SOCKS : No acceptable methods"); - if (!authenticate(data[1], in, out)) { + if (!authenticate(data[1], in, out, deadlineMillis)) { throw new SocketException("SOCKS : authentication failed"); } out.write(PROTO_VERS); @@ -457,7 +493,7 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { } out.flush(); data = new byte[4]; - i = readSocksReply(in, data); + i = readSocksReply(in, data, deadlineMillis); if (i != 4) throw new SocketException("Reply from SOCKS server has bad length"); SocketException ex = null; @@ -469,33 +505,33 @@ class SocksSocketImpl extends PlainSocketImpl implements SocksConsts { switch(data[3]) { case IPV4: addr = new byte[4]; - i = readSocksReply(in, addr); + i = readSocksReply(in, addr, deadlineMillis); if (i != 4) throw new SocketException("Reply from SOCKS server badly formatted"); data = new byte[2]; - i = readSocksReply(in, data); + i = readSocksReply(in, data, deadlineMillis); if (i != 2) throw new SocketException("Reply from SOCKS server badly formatted"); break; case DOMAIN_NAME: len = data[1]; byte[] host = new byte[len]; - i = readSocksReply(in, host); + i = readSocksReply(in, host, deadlineMillis); if (i != len) throw new SocketException("Reply from SOCKS server badly formatted"); data = new byte[2]; - i = readSocksReply(in, data); + i = readSocksReply(in, data, deadlineMillis); if (i != 2) throw new SocketException("Reply from SOCKS server badly formatted"); break; case IPV6: len = data[1]; addr = new byte[len]; - i = readSocksReply(in, addr); + i = readSocksReply(in, addr, deadlineMillis); if (i != len) throw new SocketException("Reply from SOCKS server badly formatted"); data = new byte[2]; - i = readSocksReply(in, data); + i = readSocksReply(in, data, deadlineMillis); if (i != 2) throw new SocketException("Reply from SOCKS server badly formatted"); break; diff --git a/jdk/src/share/classes/java/nio/X-Buffer.java.template b/jdk/src/share/classes/java/nio/X-Buffer.java.template index 9fc8185b646..e3431a02dfe 100644 --- a/jdk/src/share/classes/java/nio/X-Buffer.java.template +++ b/jdk/src/share/classes/java/nio/X-Buffer.java.template @@ -32,24 +32,24 @@ import java.io.IOException; #end[char] /** - * $A$ $fulltype$ buffer. + * $A$ $type$ buffer. * *

    This class defines {#if[byte]?six:four} categories of operations upon - * $fulltype$ buffers: + * $type$ buffers: * *

      * *
    • Absolute and relative {@link #get() get} and * {@link #put($type$) put} methods that read and write - * single $fulltype$s;

    • + * single $type$s;

      * *
    • Relative {@link #get($type$[]) bulk get} - * methods that transfer contiguous sequences of $fulltype$s from this buffer + * methods that transfer contiguous sequences of $type$s from this buffer * into an array; {#if[!byte]?and}

    • * *
    • Relative {@link #put($type$[]) bulk put} - * methods that transfer contiguous sequences of $fulltype$s from $a$ - * $fulltype$ array{#if[char]?, a string,} or some other $fulltype$ + * methods that transfer contiguous sequences of $type$s from $a$ + * $type$ array{#if[char]?, a string,} or some other $type$ * buffer into this buffer;{#if[!byte]? and}

    • * #if[byte] @@ -67,22 +67,22 @@ import java.io.IOException; * *
    • Methods for {@link #compact compacting}, {@link * #duplicate duplicating}, and {@link #slice - * slicing} $a$ $fulltype$ buffer.

    • + * slicing} $a$ $type$ buffer.

      * *
    * - *

    $Fulltype$ buffers can be created either by {@link #allocate + *

    $Type$ buffers can be created either by {@link #allocate * allocation}, which allocates space for the buffer's * #if[byte] * * content, or by {@link #wrap($type$[]) wrapping} an - * existing $fulltype$ array {#if[char]?or string} into a buffer. + * existing $type$ array {#if[char]?or string} into a buffer. * #else[byte] * * content, by {@link #wrap($type$[]) wrapping} an existing - * $fulltype$ array {#if[char]?or string} into a buffer, or by creating a + * $type$ array {#if[char]?or string} into a buffer, or by creating a * view of an existing byte buffer. * #end[byte] @@ -189,12 +189,12 @@ import java.io.IOException; * #if[!byte] * - *

    Like a byte buffer, $a$ $fulltype$ buffer is either Like a byte buffer, $a$ $type$ buffer is either direct or non-direct. A - * $fulltype$ buffer created via the wrap methods of this class will - * be non-direct. $A$ $fulltype$ buffer created as a view of a byte buffer will + * $type$ buffer created via the wrap methods of this class will + * be non-direct. $A$ $type$ buffer created as a view of a byte buffer will * be direct if, and only if, the byte buffer itself is direct. Whether or not - * $a$ $fulltype$ buffer is direct may be determined by invoking the {@link + * $a$ $type$ buffer is direct may be determined by invoking the {@link * #isDirect isDirect} method.

    * #end[!byte] @@ -287,7 +287,7 @@ public abstract class $Type$Buffer #if[byte] /** - * Allocates a new direct $fulltype$ buffer. + * Allocates a new direct $type$ buffer. * *

    The new buffer's position will be zero, its limit will be its * capacity, its mark will be undefined, and each of its elements will be @@ -295,9 +295,9 @@ public abstract class $Type$Buffer * {@link #hasArray backing array} is unspecified. * * @param capacity - * The new buffer's capacity, in $fulltype$s + * The new buffer's capacity, in $type$s * - * @return The new $fulltype$ buffer + * @return The new $type$ buffer * * @throws IllegalArgumentException * If the capacity is a negative integer @@ -309,7 +309,7 @@ public abstract class $Type$Buffer #end[byte] /** - * Allocates a new $fulltype$ buffer. + * Allocates a new $type$ buffer. * *

    The new buffer's position will be zero, its limit will be its * capacity, its mark will be undefined, and each of its elements will be @@ -318,9 +318,9 @@ public abstract class $Type$Buffer * offset} will be zero. * * @param capacity - * The new buffer's capacity, in $fulltype$s + * The new buffer's capacity, in $type$s * - * @return The new $fulltype$ buffer + * @return The new $type$ buffer * * @throws IllegalArgumentException * If the capacity is a negative integer @@ -332,9 +332,9 @@ public abstract class $Type$Buffer } /** - * Wraps $a$ $fulltype$ array into a buffer. + * Wraps $a$ $type$ array into a buffer. * - *

    The new buffer will be backed by the given $fulltype$ array; + *

    The new buffer will be backed by the given $type$ array; * that is, modifications to the buffer will cause the array to be modified * and vice versa. The new buffer's capacity will be * array.length, its position will be offset, its limit @@ -356,7 +356,7 @@ public abstract class $Type$Buffer * array.length - offset. * The new buffer's limit will be set to offset + length. * - * @return The new $fulltype$ buffer + * @return The new $type$ buffer * * @throws IndexOutOfBoundsException * If the preconditions on the offset and length @@ -373,9 +373,9 @@ public abstract class $Type$Buffer } /** - * Wraps $a$ $fulltype$ array into a buffer. + * Wraps $a$ $type$ array into a buffer. * - *

    The new buffer will be backed by the given $fulltype$ array; + *

    The new buffer will be backed by the given $type$ array; * that is, modifications to the buffer will cause the array to be modified * and vice versa. The new buffer's capacity and limit will be * array.length, its position will be zero, and its mark will be @@ -386,7 +386,7 @@ public abstract class $Type$Buffer * @param array * The array that will back this buffer * - * @return The new $fulltype$ buffer + * @return The new $type$ buffer */ public static $Type$Buffer wrap($type$[] array) { return wrap(array, 0, array.length); @@ -486,7 +486,7 @@ public abstract class $Type$Buffer #end[char] /** - * Creates a new $fulltype$ buffer whose content is a shared subsequence of + * Creates a new $type$ buffer whose content is a shared subsequence of * this buffer's content. * *

    The content of the new buffer will start at this buffer's current @@ -495,17 +495,17 @@ public abstract class $Type$Buffer * values will be independent. * *

    The new buffer's position will be zero, its capacity and its limit - * will be the number of $fulltype$s remaining in this buffer, and its mark + * will be the number of $type$s remaining in this buffer, and its mark * will be undefined. The new buffer will be direct if, and only if, this * buffer is direct, and it will be read-only if, and only if, this buffer * is read-only.

    * - * @return The new $fulltype$ buffer + * @return The new $type$ buffer */ public abstract $Type$Buffer slice(); /** - * Creates a new $fulltype$ buffer that shares this buffer's content. + * Creates a new $type$ buffer that shares this buffer's content. * *

    The content of the new buffer will be that of this buffer. Changes * to this buffer's content will be visible in the new buffer, and vice @@ -517,12 +517,12 @@ public abstract class $Type$Buffer * and only if, this buffer is direct, and it will be read-only if, and * only if, this buffer is read-only.

    * - * @return The new $fulltype$ buffer + * @return The new $type$ buffer */ public abstract $Type$Buffer duplicate(); /** - * Creates a new, read-only $fulltype$ buffer that shares this buffer's + * Creates a new, read-only $type$ buffer that shares this buffer's * content. * *

    The content of the new buffer will be that of this buffer. Changes @@ -537,7 +537,7 @@ public abstract class $Type$Buffer *

    If this buffer is itself read-only then this method behaves in * exactly the same way as the {@link #duplicate duplicate} method.

    * - * @return The new, read-only $fulltype$ buffer + * @return The new, read-only $type$ buffer */ public abstract $Type$Buffer asReadOnlyBuffer(); @@ -545,10 +545,10 @@ public abstract class $Type$Buffer // -- Singleton get/put methods -- /** - * Relative get method. Reads the $fulltype$ at this buffer's + * Relative get method. Reads the $type$ at this buffer's * current position, and then increments the position.

    * - * @return The $fulltype$ at the buffer's current position + * @return The $type$ at the buffer's current position * * @throws BufferUnderflowException * If the buffer's current position is not smaller than its limit @@ -558,11 +558,11 @@ public abstract class $Type$Buffer /** * Relative put method  (optional operation). * - *

    Writes the given $fulltype$ into this buffer at the current + *

    Writes the given $type$ into this buffer at the current * position, and then increments the position.

    * * @param $x$ - * The $fulltype$ to be written + * The $type$ to be written * * @return This buffer * @@ -575,13 +575,13 @@ public abstract class $Type$Buffer public abstract $Type$Buffer put($type$ $x$); /** - * Absolute get method. Reads the $fulltype$ at the given + * Absolute get method. Reads the $type$ at the given * index.

    * * @param index - * The index from which the $fulltype$ will be read + * The index from which the $type$ will be read * - * @return The $fulltype$ at the given index + * @return The $type$ at the given index * * @throws IndexOutOfBoundsException * If index is negative @@ -592,14 +592,14 @@ public abstract class $Type$Buffer /** * Absolute put method  (optional operation). * - *

    Writes the given $fulltype$ into this buffer at the given + *

    Writes the given $type$ into this buffer at the given * index.

    * * @param index - * The index at which the $fulltype$ will be written + * The index at which the $type$ will be written * * @param $x$ - * The $fulltype$ value to be written + * The $type$ value to be written * * @return This buffer * @@ -618,14 +618,14 @@ public abstract class $Type$Buffer /** * Relative bulk get method. * - *

    This method transfers $fulltype$s from this buffer into the given - * destination array. If there are fewer $fulltype$s remaining in the + *

    This method transfers $type$s from this buffer into the given + * destination array. If there are fewer $type$s remaining in the * buffer than are required to satisfy the request, that is, if * length > remaining(), then no - * $fulltype$s are transferred and a {@link BufferUnderflowException} is + * $type$s are transferred and a {@link BufferUnderflowException} is * thrown. * - *

    Otherwise, this method copies length $fulltype$s from this + *

    Otherwise, this method copies length $type$s from this * buffer into the given array, starting at the current position of this * buffer and at the given offset in the array. The position of this * buffer is then incremented by length. @@ -638,26 +638,26 @@ public abstract class $Type$Buffer * for (int i = off; i < off + len; i++) * dst[i] = src.get(); * - * except that it first checks that there are sufficient $fulltype$s in + * except that it first checks that there are sufficient $type$s in * this buffer and it is potentially much more efficient.

    * * @param dst - * The array into which $fulltype$s are to be written + * The array into which $type$s are to be written * * @param offset - * The offset within the array of the first $fulltype$ to be + * The offset within the array of the first $type$ to be * written; must be non-negative and no larger than * dst.length * * @param length - * The maximum number of $fulltype$s to be written to the given + * The maximum number of $type$s to be written to the given * array; must be non-negative and no larger than * dst.length - offset * * @return This buffer * * @throws BufferUnderflowException - * If there are fewer than length $fulltype$s + * If there are fewer than length $type$s * remaining in this buffer * * @throws IndexOutOfBoundsException @@ -677,7 +677,7 @@ public abstract class $Type$Buffer /** * Relative bulk get method. * - *

    This method transfers $fulltype$s from this buffer into the given + *

    This method transfers $type$s from this buffer into the given * destination array. An invocation of this method of the form * src.get(a) behaves in exactly the same way as the invocation * @@ -687,7 +687,7 @@ public abstract class $Type$Buffer * @return This buffer * * @throws BufferUnderflowException - * If there are fewer than length $fulltype$s + * If there are fewer than length $type$s * remaining in this buffer */ public $Type$Buffer get($type$[] dst) { @@ -700,15 +700,15 @@ public abstract class $Type$Buffer /** * Relative bulk put method  (optional operation). * - *

    This method transfers the $fulltype$s remaining in the given source - * buffer into this buffer. If there are more $fulltype$s remaining in the + *

    This method transfers the $type$s remaining in the given source + * buffer into this buffer. If there are more $type$s remaining in the * source buffer than in this buffer, that is, if * src.remaining() > remaining(), - * then no $fulltype$s are transferred and a {@link + * then no $type$s are transferred and a {@link * BufferOverflowException} is thrown. * *

    Otherwise, this method copies - * n = src.remaining() $fulltype$s from the given + * n = src.remaining() $type$s from the given * buffer into this buffer, starting at each buffer's current position. * The positions of both buffers are then incremented by n. * @@ -723,14 +723,14 @@ public abstract class $Type$Buffer * buffer and it is potentially much more efficient.

    * * @param src - * The source buffer from which $fulltype$s are to be read; + * The source buffer from which $type$s are to be read; * must not be this buffer * * @return This buffer * * @throws BufferOverflowException * If there is insufficient space in this buffer - * for the remaining $fulltype$s in the source buffer + * for the remaining $type$s in the source buffer * * @throws IllegalArgumentException * If the source buffer is this buffer @@ -752,14 +752,14 @@ public abstract class $Type$Buffer /** * Relative bulk put method  (optional operation). * - *

    This method transfers $fulltype$s into this buffer from the given - * source array. If there are more $fulltype$s to be copied from the array + *

    This method transfers $type$s into this buffer from the given + * source array. If there are more $type$s to be copied from the array * than remain in this buffer, that is, if * length > remaining(), then no - * $fulltype$s are transferred and a {@link BufferOverflowException} is + * $type$s are transferred and a {@link BufferOverflowException} is * thrown. * - *

    Otherwise, this method copies length $fulltype$s from the + *

    Otherwise, this method copies length $type$s from the * given array into this buffer, starting at the given offset in the array * and at the current position of this buffer. The position of this buffer * is then incremented by length. @@ -776,14 +776,14 @@ public abstract class $Type$Buffer * buffer and it is potentially much more efficient.

    * * @param src - * The array from which $fulltype$s are to be read + * The array from which $type$s are to be read * * @param offset - * The offset within the array of the first $fulltype$ to be read; + * The offset within the array of the first $type$ to be read; * must be non-negative and no larger than array.length * * @param length - * The number of $fulltype$s to be read from the given array; + * The number of $type$s to be read from the given array; * must be non-negative and no larger than * array.length - offset * @@ -813,7 +813,7 @@ public abstract class $Type$Buffer * Relative bulk put method  (optional operation). * *

    This method transfers the entire content of the given source - * $fulltype$ array into this buffer. An invocation of this method of the + * $type$ array into this buffer. An invocation of this method of the * form dst.put(a) behaves in exactly the same way as the * invocation * @@ -837,15 +837,15 @@ public abstract class $Type$Buffer /** * Relative bulk put method  (optional operation). * - *

    This method transfers $fulltype$s from the given string into this - * buffer. If there are more $fulltype$s to be copied from the string than + *

    This method transfers $type$s from the given string into this + * buffer. If there are more $type$s to be copied from the string than * remain in this buffer, that is, if * end - start > remaining(), - * then no $fulltype$s are transferred and a {@link + * then no $type$s are transferred and a {@link * BufferOverflowException} is thrown. * *

    Otherwise, this method copies - * n = end - start $fulltype$s + * n = end - start $type$s * from the given string into this buffer, starting at the given * start index and at the current position of this buffer. The * position of this buffer is then incremented by n. @@ -862,15 +862,15 @@ public abstract class $Type$Buffer * buffer and it is potentially much more efficient.

    * * @param src - * The string from which $fulltype$s are to be read + * The string from which $type$s are to be read * * @param start - * The offset within the string of the first $fulltype$ to be read; + * The offset within the string of the first $type$ to be read; * must be non-negative and no larger than * string.length() * * @param end - * The offset within the string of the last $fulltype$ to be read, + * The offset within the string of the last $type$ to be read, * plus one; must be non-negative and no larger than * string.length() * @@ -921,7 +921,7 @@ public abstract class $Type$Buffer // -- Other stuff -- /** - * Tells whether or not this buffer is backed by an accessible $fulltype$ + * Tells whether or not this buffer is backed by an accessible $type$ * array. * *

    If this method returns true then the {@link #array() array} @@ -936,7 +936,7 @@ public abstract class $Type$Buffer } /** - * Returns the $fulltype$ array that backs this + * Returns the $type$ array that backs this * buffer  (optional operation). * *

    Modifications to this buffer's content will cause the returned @@ -993,17 +993,17 @@ public abstract class $Type$Buffer /** * Compacts this buffer  (optional operation). * - *

    The $fulltype$s between the buffer's current position and its limit, + *

    The $type$s between the buffer's current position and its limit, * if any, are copied to the beginning of the buffer. That is, the - * $fulltype$ at index p = position() is copied - * to index zero, the $fulltype$ at index p + 1 is copied - * to index one, and so forth until the $fulltype$ at index + * $type$ at index p = position() is copied + * to index zero, the $type$ at index p + 1 is copied + * to index one, and so forth until the $type$ at index * limit() - 1 is copied to index * n = limit() - 1 - p. * The buffer's position is then set to n+1 and its limit is set to * its capacity. The mark, if defined, is discarded. * - *

    The buffer's position is set to the number of $fulltype$s copied, + *

    The buffer's position is set to the number of $type$s copied, * rather than to zero, so that an invocation of this method can be * followed immediately by an invocation of another relative put * method.

    @@ -1032,7 +1032,7 @@ public abstract class $Type$Buffer public abstract $Type$Buffer compact(); /** - * Tells whether or not this $fulltype$ buffer is direct.

    + * Tells whether or not this $type$ buffer is direct.

    * * @return true if, and only if, this buffer is direct */ @@ -1098,6 +1098,13 @@ public abstract class $Type$Buffer * *
  • The two sequences of remaining elements, considered * independently of their starting positions, are pointwise equal. +#if[floatingPointType] + * This method considers two $type$ elements {@code a} and {@code b} + * to be equal if + * {@code (a == b) || ($Fulltype$.isNaN(a) && $Fulltype$.isNaN(b))}. + * The values {@code -0.0} and {@code +0.0} are considered to be + * equal, unlike {@link $Fulltype$#equals(Object)}. +#end[floatingPointType] *

  • * * @@ -1118,24 +1125,37 @@ public abstract class $Type$Buffer if (this.remaining() != that.remaining()) return false; int p = this.position(); - for (int i = this.limit() - 1, j = that.limit() - 1; i >= p; i--, j--) { - $type$ v1 = this.get(i); - $type$ v2 = that.get(j); - if (v1 != v2) { - if ((v1 != v1) && (v2 != v2)) // For float and double - continue; + for (int i = this.limit() - 1, j = that.limit() - 1; i >= p; i--, j--) + if (!equals(this.get(i), that.get(j))) return false; - } - } return true; } + private static boolean equals($type$ x, $type$ y) { +#if[floatingPointType] + return (x == y) || ($Fulltype$.isNaN(x) && $Fulltype$.isNaN(y)); +#else[floatingPointType] + return x == y; +#end[floatingPointType] + } + /** * Compares this buffer to another. * *

    Two $type$ buffers are compared by comparing their sequences of * remaining elements lexicographically, without regard to the starting * position of each sequence within its corresponding buffer. +#if[floatingPointType] + * Pairs of {@code $type$} elements are compared as if by invoking + * {@link $Fulltype$#compare($type$,$type$)}, except that + * {@code -0.0} and {@code 0.0} are considered to be equal. + * {@code $Fulltype$.NaN} is considered by this method to be equal + * to itself and greater than all other {@code $type$} values + * (including {@code $Fulltype$.POSITIVE_INFINITY}). +#else[floatingPointType] + * Pairs of {@code $type$} elements are compared as if by invoking + * {@link $Fulltype$#compare($type$,$type$)}. +#end[floatingPointType] * *

    A $type$ buffer is not comparable to any other type of object. * @@ -1145,20 +1165,23 @@ public abstract class $Type$Buffer public int compareTo($Type$Buffer that) { int n = this.position() + Math.min(this.remaining(), that.remaining()); for (int i = this.position(), j = that.position(); i < n; i++, j++) { - $type$ v1 = this.get(i); - $type$ v2 = that.get(j); - if (v1 == v2) - continue; - if ((v1 != v1) && (v2 != v2)) // For float and double - continue; - if (v1 < v2) - return -1; - return +1; + int cmp = compare(this.get(i), that.get(j)); + if (cmp != 0) + return cmp; } return this.remaining() - that.remaining(); } - + private static int compare($type$ x, $type$ y) { +#if[floatingPointType] + return ((x < y) ? -1 : + (x > y) ? +1 : + (x == y) ? 0 : + $Fulltype$.isNaN(x) ? ($Fulltype$.isNaN(y) ? 0 : +1) : -1); +#else[floatingPointType] + return $Fulltype$.compare(x, y); +#end[floatingPointType] + } // -- Other char stuff -- @@ -1326,7 +1349,7 @@ public abstract class $Type$Buffer } /** - * Appends the specified $fulltype$ to this + * Appends the specified $type$ to this * buffer  (optional operation). * *

    An invocation of this method of the form dst.append($x$) @@ -1336,7 +1359,7 @@ public abstract class $Type$Buffer * dst.put($x$) * * @param $x$ - * The 16-bit $fulltype$ to append + * The 16-bit $type$ to append * * @return This buffer * @@ -1362,10 +1385,10 @@ public abstract class $Type$Buffer /** * Retrieves this buffer's byte order. * - *

    The byte order of $a$ $fulltype$ buffer created by allocation or by + *

    The byte order of $a$ $type$ buffer created by allocation or by * wrapping an existing $type$ array is the {@link * ByteOrder#nativeOrder native order} of the underlying - * hardware. The byte order of $a$ $fulltype$ buffer created as a view of a byte buffer is that of the * byte buffer at the moment that the view is created.

    * diff --git a/jdk/src/share/classes/java/nio/channels/Selector.java b/jdk/src/share/classes/java/nio/channels/Selector.java index 46709d16fe1..e31555c122d 100644 --- a/jdk/src/share/classes/java/nio/channels/Selector.java +++ b/jdk/src/share/classes/java/nio/channels/Selector.java @@ -25,6 +25,7 @@ package java.nio.channels; +import java.io.Closeable; import java.io.IOException; import java.nio.channels.spi.SelectorProvider; import java.util.Set; @@ -202,7 +203,7 @@ import java.util.Set; * @see SelectionKey */ -public abstract class Selector { +public abstract class Selector implements Closeable { /** * Initializes a new instance of this class. diff --git a/jdk/src/share/classes/java/rmi/activation/Activatable.java b/jdk/src/share/classes/java/rmi/activation/Activatable.java index 07879812774..de02b0d6e31 100644 --- a/jdk/src/share/classes/java/rmi/activation/Activatable.java +++ b/jdk/src/share/classes/java/rmi/activation/Activatable.java @@ -73,7 +73,7 @@ public abstract class Activatable extends RemoteServer { * can be handled properly. * *

    This method invokes the {@link - * exportObject(Remote,String,MarshalledObject,boolean,port) + * #exportObject(Remote,String,MarshalledObject,boolean,int) * exportObject} method with this object, and the specified location, * data, restart mode, and port. Subsequent calls to {@link #getID} * will return the activation identifier returned from the call to @@ -120,7 +120,7 @@ public abstract class Activatable extends RemoteServer { * can be handled properly. * *

    This method invokes the {@link - * exportObject(Remote,String,MarshalledObject,boolean,port,RMIClientSocketFactory,RMIServerSocketFactory) + * #exportObject(Remote,String,MarshalledObject,boolean,int,RMIClientSocketFactory,RMIServerSocketFactory) * exportObject} method with this object, and the specified location, * data, restart mode, port, and client and server socket factories. * Subsequent calls to {@link #getID} will return the activation @@ -312,7 +312,7 @@ public abstract class Activatable extends RemoteServer { * separately, so that exceptions can be handled properly. * *

    This method invokes the {@link - * exportObject(Remote,String,MarshalledObject,boolean,port,RMIClientSocketFactory,RMIServerSocketFactory) + * #exportObject(Remote,String,MarshalledObject,boolean,int,RMIClientSocketFactory,RMIServerSocketFactory) * exportObject} method with the specified object, location, data, * restart mode, and port, and null for both client and * server socket factories, and then returns the resulting activation diff --git a/jdk/src/share/classes/java/rmi/registry/LocateRegistry.java b/jdk/src/share/classes/java/rmi/registry/LocateRegistry.java index d32e4035749..b65feca8c80 100644 --- a/jdk/src/share/classes/java/rmi/registry/LocateRegistry.java +++ b/jdk/src/share/classes/java/rmi/registry/LocateRegistry.java @@ -187,7 +187,7 @@ public final class LocateRegistry { * host that accepts requests on the specified port. * *

    The Registry instance is exported as if the static - * {@link UnicastRemoteObject.exportObject(Remote,int) + * {@link UnicastRemoteObject#exportObject(Remote,int) * UnicastRemoteObject.exportObject} method is invoked, passing the * Registry instance and the specified port as * arguments, except that the Registry instance is @@ -213,7 +213,7 @@ public final class LocateRegistry { * *

    The Registry instance is exported as if * the static {@link - * UnicastRemoteObject.exportObject(Remote,int,RMIClientSocketFactory,RMIServerSocketFactory) + * UnicastRemoteObject#exportObject(Remote,int,RMIClientSocketFactory,RMIServerSocketFactory) * UnicastRemoteObject.exportObject} method is invoked, passing the * Registry instance, the specified port, the * specified RMIClientSocketFactory, and the specified diff --git a/jdk/src/share/classes/java/rmi/server/RemoteObjectInvocationHandler.java b/jdk/src/share/classes/java/rmi/server/RemoteObjectInvocationHandler.java index 59de6cfad02..06647bac951 100644 --- a/jdk/src/share/classes/java/rmi/server/RemoteObjectInvocationHandler.java +++ b/jdk/src/share/classes/java/rmi/server/RemoteObjectInvocationHandler.java @@ -138,7 +138,6 @@ public class RemoteObjectInvocationHandler * instance * @throws Throwable the exception to throw from the method invocation * on the proxy instance - * @see **/ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable diff --git a/jdk/src/share/classes/java/security/IdentityScope.java b/jdk/src/share/classes/java/security/IdentityScope.java index 0ebc396fa78..7ed92156895 100644 --- a/jdk/src/share/classes/java/security/IdentityScope.java +++ b/jdk/src/share/classes/java/security/IdentityScope.java @@ -129,7 +129,8 @@ class IdentityScope extends Identity { /** * Returns the system's identity scope. * - * @return the system's identity scope. + * @return the system's identity scope, or {@code null} if none has been + * set. * * @see #setSystemScope */ diff --git a/jdk/src/share/classes/java/security/cert/CertPathValidatorException.java b/jdk/src/share/classes/java/security/cert/CertPathValidatorException.java index c1ca1d2b8de..86b0b45e276 100644 --- a/jdk/src/share/classes/java/security/cert/CertPathValidatorException.java +++ b/jdk/src/share/classes/java/security/cert/CertPathValidatorException.java @@ -216,7 +216,7 @@ public class CertPathValidatorException extends GeneralSecurityException { /** * Returns the reason that the validation failed. The reason is * associated with the index of the certificate returned by - * {@link getIndex}. + * {@link #getIndex}. * * @return the reason that the validation failed, or * BasicReason.UNSPECIFIED if a reason has not been diff --git a/jdk/src/share/classes/java/security/cert/PKIXParameters.java b/jdk/src/share/classes/java/security/cert/PKIXParameters.java index 7608d9f7b39..f9f95ce7841 100644 --- a/jdk/src/share/classes/java/security/cert/PKIXParameters.java +++ b/jdk/src/share/classes/java/security/cert/PKIXParameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -663,15 +663,23 @@ public class PKIXParameters implements CertPathParameters { */ public Object clone() { try { - Object copy = super.clone(); - // Must clone these because addCertStore, et al. modify them + PKIXParameters copy = (PKIXParameters)super.clone(); + + // must clone these because addCertStore, et al. modify them if (certStores != null) { - certStores = new ArrayList(certStores); + copy.certStores = new ArrayList(certStores); } if (certPathCheckers != null) { - certPathCheckers = - new ArrayList(certPathCheckers); + copy.certPathCheckers = + new ArrayList(certPathCheckers.size()); + for (PKIXCertPathChecker checker : certPathCheckers) { + copy.certPathCheckers.add( + (PKIXCertPathChecker)checker.clone()); + } } + + // other class fields are immutable to public, don't bother + // to clone the read-only fields. return copy; } catch (CloneNotSupportedException e) { /* Cannot happen */ diff --git a/jdk/src/share/classes/java/text/Bidi.java b/jdk/src/share/classes/java/text/Bidi.java index e4db4b2d086..504021ff143 100644 --- a/jdk/src/share/classes/java/text/Bidi.java +++ b/jdk/src/share/classes/java/text/Bidi.java @@ -121,9 +121,9 @@ public final class Bidi { * * @param paragraph a paragraph of text with optional character and paragraph attribute information * - * @see TextAttribute#BIDI_EMBEDDING - * @see TextAttribute#NUMERIC_SHAPING - * @see TextAttribute#RUN_DIRECTION + * @see java.awt.font.TextAttribute#BIDI_EMBEDDING + * @see java.awt.font.TextAttribute#NUMERIC_SHAPING + * @see java.awt.font.TextAttribute#RUN_DIRECTION */ public Bidi(AttributedCharacterIterator paragraph) { if (paragraph == null) { diff --git a/jdk/src/share/classes/java/text/CollationElementIterator.java b/jdk/src/share/classes/java/text/CollationElementIterator.java index 53c821dd771..db0e011249c 100644 --- a/jdk/src/share/classes/java/text/CollationElementIterator.java +++ b/jdk/src/share/classes/java/text/CollationElementIterator.java @@ -232,7 +232,7 @@ public final class CollationElementIterator buffer = makeReorderedBuffer(consonant, value, buffer, true); value = buffer[0]; expIndex = 1; - } else { + } else if (consonant != NormalizerBase.DONE) { text.previous(); } } @@ -242,7 +242,7 @@ public final class CollationElementIterator buffer = makeReorderedBuffer(consonant, value, buffer, true); value = buffer[0]; expIndex = 1; - } else { + } else if (consonant != NormalizerBase.DONE) { text.previous(); } } diff --git a/jdk/src/share/classes/java/text/RuleBasedBreakIterator.java b/jdk/src/share/classes/java/text/RuleBasedBreakIterator.java index 8f0e6cb7015..4e46560d08a 100644 --- a/jdk/src/share/classes/java/text/RuleBasedBreakIterator.java +++ b/jdk/src/share/classes/java/text/RuleBasedBreakIterator.java @@ -621,6 +621,8 @@ class RuleBasedBreakIterator extends BreakIterator { return handleNext(); } + private int cachedLastKnownBreak = BreakIterator.DONE; + /** * Advances the iterator backwards, to the last boundary preceding this one. * @return The position of the last boundary position preceding this one. @@ -638,8 +640,16 @@ class RuleBasedBreakIterator extends BreakIterator { // the current position), but not necessarily the last one before // where we started int start = current(); - getPrevious(); - int lastResult = handlePrevious(); + int lastResult = cachedLastKnownBreak; + if (lastResult >= start || lastResult <= BreakIterator.DONE) { + getPrevious(); + lastResult = handlePrevious(); + } else { + //it might be better to check if handlePrevious() give us closer + //safe value but handlePrevious() is slow too + //So, this has to be done carefully + text.setIndex(lastResult); + } int result = lastResult; // iterate forward from the known break position until we pass our @@ -653,6 +663,7 @@ class RuleBasedBreakIterator extends BreakIterator { // set the current iteration position to be the last break position // before where we started, and then return that value text.setIndex(lastResult); + cachedLastKnownBreak = lastResult; return lastResult; } @@ -757,7 +768,8 @@ class RuleBasedBreakIterator extends BreakIterator { // then we can just use next() to get our return value text.setIndex(offset); if (offset == text.getBeginIndex()) { - return handleNext(); + cachedLastKnownBreak = handleNext(); + return cachedLastKnownBreak; } // otherwise, we have to sync up first. Use handlePrevious() to back @@ -767,10 +779,19 @@ class RuleBasedBreakIterator extends BreakIterator { // position at or before our starting position. Advance forward // from here until we've passed the starting position. The position // we stop on will be the first break position after the specified one. - int result = handlePrevious(); + int result = cachedLastKnownBreak; + if (result >= offset || result <= BreakIterator.DONE) { + result = handlePrevious(); + } else { + //it might be better to check if handlePrevious() give us closer + //safe value but handlePrevious() is slow too + //So, this has to be done carefully + text.setIndex(result); + } while (result != BreakIterator.DONE && result <= offset) { result = handleNext(); } + cachedLastKnownBreak = result; return result; } @@ -865,6 +886,8 @@ class RuleBasedBreakIterator extends BreakIterator { text = new SafeCharIterator(newText); } text.first(); + + cachedLastKnownBreak = BreakIterator.DONE; } diff --git a/jdk/src/share/classes/java/util/Collection.java b/jdk/src/share/classes/java/util/Collection.java index e7cb3c91e0c..c79e0cde309 100644 --- a/jdk/src/share/classes/java/util/Collection.java +++ b/jdk/src/share/classes/java/util/Collection.java @@ -103,6 +103,8 @@ package java.util; * * Java Collections Framework. * + * @param the type of elements in this collection + * * @author Josh Bloch * @author Neal Gafter * @see Set diff --git a/jdk/src/share/classes/java/util/Date.java b/jdk/src/share/classes/java/util/Date.java index ffeb2e185df..36e3ac71166 100644 --- a/jdk/src/share/classes/java/util/Date.java +++ b/jdk/src/share/classes/java/util/Date.java @@ -953,7 +953,7 @@ public class Date * without affecting its internal state. */ static final long getMillisOf(Date date) { - if (date.cdate == null) { + if (date.cdate == null || date.cdate.isNormalized()) { return date.fastTime; } BaseCalendar.Date d = (BaseCalendar.Date) date.cdate.clone(); diff --git a/jdk/src/share/classes/java/util/DualPivotQuicksort.java b/jdk/src/share/classes/java/util/DualPivotQuicksort.java index b368d0b95b1..eedb2389134 100644 --- a/jdk/src/share/classes/java/util/DualPivotQuicksort.java +++ b/jdk/src/share/classes/java/util/DualPivotQuicksort.java @@ -36,12 +36,12 @@ package java.util; * @author Jon Bentley * @author Josh Bloch * - * @version 2009.11.16 m765.827.v12a + * @version 2009.11.29 m765.827.12i */ final class DualPivotQuicksort { /** - * Suppresses default constructor. + * Prevents instantiation. */ private DualPivotQuicksort() {} @@ -84,7 +84,7 @@ final class DualPivotQuicksort { * Sorts the specified range of the array into ascending order. The range * to be sorted extends from the index {@code fromIndex}, inclusive, to * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex}, - * the range to be sorted is empty. + * the range to be sorted is empty (and the call is a no-op). * * @param a the array to be sorted * @param fromIndex the index of the first element, inclusive, to be sorted @@ -101,8 +101,8 @@ final class DualPivotQuicksort { /** * Sorts the specified range of the array into ascending order. This * method differs from the public {@code sort} method in that the - * {@code right} index is inclusive, and it does no range checking on - * {@code left} or {@code right}. + * {@code right} index is inclusive, and it does no range checking + * on {@code left} or {@code right}. * * @param a the array to be sorted * @param left the index of the first element, inclusive, to be sorted @@ -111,13 +111,13 @@ final class DualPivotQuicksort { private static void doSort(int[] a, int left, int right) { // Use insertion sort on tiny arrays if (right - left + 1 < INSERTION_SORT_THRESHOLD) { - for (int k = left + 1; k <= right; k++) { - int ak = a[k]; + for (int i = left + 1; i <= right; i++) { + int ai = a[i]; int j; - for (j = k - 1; j >= left && ak < a[j]; j--) { + for (j = i - 1; j >= left && ai < a[j]; j--) { a[j + 1] = a[j]; } - a[j + 1] = ak; + a[j + 1] = ai; } } else { // Use Dual-Pivot Quicksort on large arrays dualPivotQuicksort(a, left, right); @@ -162,7 +162,7 @@ final class DualPivotQuicksort { * second terciles of the array. Note that pivot1 <= pivot2. * * The pivots are stored in local variables, and the first and - * the last of the sorted elements are moved to the locations + * the last of the elements to be sorted are moved to the locations * formerly occupied by the pivots. When partitioning is complete, * the pivots are swapped back into their final positions, and * excluded from subsequent sorting. @@ -170,27 +170,26 @@ final class DualPivotQuicksort { int pivot1 = ae2; a[e2] = a[left]; int pivot2 = ae4; a[e4] = a[right]; - /* - * Partitioning - * - * left part center part right part - * ------------------------------------------------------------ - * [ < pivot1 | pivot1 <= && <= pivot2 | ? | > pivot2 ] - * ------------------------------------------------------------ - * ^ ^ ^ - * | | | - * less k great - */ - // Pointers int less = left + 1; // The index of first element of center part int great = right - 1; // The index before first element of right part - boolean pivotsDiffer = pivot1 != pivot2; + boolean pivotsDiffer = (pivot1 != pivot2); if (pivotsDiffer) { /* + * Partitioning: + * + * left part center part right part + * +------------------------------------------------------------+ + * | < pivot1 | pivot1 <= && <= pivot2 | ? | > pivot2 | + * +------------------------------------------------------------+ + * ^ ^ ^ + * | | | + * less k great + * * Invariants: + * * all in (left, less) < pivot1 * pivot1 <= all in [less, k) <= pivot2 * all in (great, right) > pivot2 @@ -200,37 +199,37 @@ final class DualPivotQuicksort { outer: for (int k = less; k <= great; k++) { int ak = a[k]; - if (ak < pivot1) { - if (k > less) { + if (ak < pivot1) { // Move a[k] to left part + if (k != less) { a[k] = a[less]; a[less] = ak; } less++; - } else if (ak > pivot2) { + } else if (ak > pivot2) { // Move a[k] to right part while (a[great] > pivot2) { - if (k == great--) { + if (great-- == k) { break outer; } } - a[k] = a[great]; - a[great--] = ak; - - if ((ak = a[k]) < pivot1) { + if (a[great] < pivot1) { a[k] = a[less]; - a[less++] = ak; + a[less++] = a[great]; + a[great--] = ak; + } else { // pivot1 <= a[great] <= pivot2 + a[k] = a[great]; + a[great--] = ak; } } } } else { // Pivots are equal /* - * Partition degenerates to the traditional 3-way - * (or "Dutch National Flag") partition: + * Partition degenerates to the traditional 3-way, + * or "Dutch National Flag", partition: * * left part center part right part - * ------------------------------------------------- - * [ < pivot | == pivot | ? | > pivot ] - * ------------------------------------------------- - * + * +----------------------------------------------+ + * | < pivot | == pivot | ? | > pivot | + * +----------------------------------------------+ * ^ ^ ^ * | | | * less k great @@ -243,30 +242,34 @@ final class DualPivotQuicksort { * * Pointer k is the first index of ?-part */ - outer: for (int k = less; k <= great; k++) { int ak = a[k]; if (ak == pivot1) { continue; } - if (ak < pivot1) { - if (k > less) { + if (ak < pivot1) { // Move a[k] to left part + if (k != less) { a[k] = a[less]; a[less] = ak; } less++; - } else { // a[k] > pivot + } else { // (a[k] > pivot1) - Move a[k] to right part + /* + * We know that pivot1 == a[e3] == pivot2. Thus, we know + * that great will still be >= k when the following loop + * terminates, even though we don't test for it explicitly. + * In other words, a[e3] acts as a sentinel for great. + */ while (a[great] > pivot1) { - if (k == great--) { - break outer; - } + great--; } - a[k] = a[great]; - a[great--] = ak; - - if ((ak = a[k]) < pivot1) { + if (a[great] < pivot1) { a[k] = a[less]; - a[less++] = ak; + a[less++] = a[great]; + a[great--] = ak; + } else { // a[great] == pivot1 + a[k] = pivot1; + a[great--] = ak; } } } @@ -289,26 +292,55 @@ final class DualPivotQuicksort { } /* - * If center part is too large (comprises > 5/6 of - * the array), swap internal pivot values to ends + * If center part is too large (comprises > 2/3 of the array), + * swap internal pivot values to ends */ - if (less < e1 && e5 < great) { + if (less < e1 && great > e5) { while (a[less] == pivot1) { less++; } while (a[great] == pivot2) { great--; } - for (int k = less + 1; k <= great; ) { + + /* + * Partitioning: + * + * left part center part right part + * +----------------------------------------------------------+ + * | == pivot1 | pivot1 < && < pivot2 | ? | == pivot2 | + * +----------------------------------------------------------+ + * ^ ^ ^ + * | | | + * less k great + * + * Invariants: + * + * all in (*, less) == pivot1 + * pivot1 < all in [less, k) < pivot2 + * all in (great, *) == pivot2 + * + * Pointer k is the first index of ?-part + */ + outer: + for (int k = less; k <= great; k++) { int ak = a[k]; - if (ak == pivot1) { - a[k++] = a[less]; - a[less++] = pivot1; - } else if (ak == pivot2) { - a[k] = a[great]; + if (ak == pivot2) { // Move a[k] to right part + while (a[great] == pivot2) { + if (great-- == k) { + break outer; + } + } + if (a[great] == pivot1) { + a[k] = a[less]; + a[less++] = pivot1; + } else { // pivot1 < a[great] < pivot2 + a[k] = a[great]; + } a[great--] = pivot2; - } else { - k++; + } else if (ak == pivot1) { // Move a[k] to left part + a[k] = a[less]; + a[less++] = pivot1; } } } @@ -330,7 +362,7 @@ final class DualPivotQuicksort { * Sorts the specified range of the array into ascending order. The range * to be sorted extends from the index {@code fromIndex}, inclusive, to * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex}, - * the range to be sorted is empty. + * the range to be sorted is empty (and the call is a no-op). * * @param a the array to be sorted * @param fromIndex the index of the first element, inclusive, to be sorted @@ -357,13 +389,13 @@ final class DualPivotQuicksort { private static void doSort(long[] a, int left, int right) { // Use insertion sort on tiny arrays if (right - left + 1 < INSERTION_SORT_THRESHOLD) { - for (int k = left + 1; k <= right; k++) { - long ak = a[k]; + for (int i = left + 1; i <= right; i++) { + long ai = a[i]; int j; - for (j = k - 1; j >= left && ak < a[j]; j--) { + for (j = i - 1; j >= left && ai < a[j]; j--) { a[j + 1] = a[j]; } - a[j + 1] = ak; + a[j + 1] = ai; } } else { // Use Dual-Pivot Quicksort on large arrays dualPivotQuicksort(a, left, right); @@ -408,7 +440,7 @@ final class DualPivotQuicksort { * second terciles of the array. Note that pivot1 <= pivot2. * * The pivots are stored in local variables, and the first and - * the last of the sorted elements are moved to the locations + * the last of the elements to be sorted are moved to the locations * formerly occupied by the pivots. When partitioning is complete, * the pivots are swapped back into their final positions, and * excluded from subsequent sorting. @@ -416,27 +448,26 @@ final class DualPivotQuicksort { long pivot1 = ae2; a[e2] = a[left]; long pivot2 = ae4; a[e4] = a[right]; - /* - * Partitioning - * - * left part center part right part - * ------------------------------------------------------------ - * [ < pivot1 | pivot1 <= && <= pivot2 | ? | > pivot2 ] - * ------------------------------------------------------------ - * ^ ^ ^ - * | | | - * less k great - */ - // Pointers int less = left + 1; // The index of first element of center part int great = right - 1; // The index before first element of right part - boolean pivotsDiffer = pivot1 != pivot2; + boolean pivotsDiffer = (pivot1 != pivot2); if (pivotsDiffer) { /* + * Partitioning: + * + * left part center part right part + * +------------------------------------------------------------+ + * | < pivot1 | pivot1 <= && <= pivot2 | ? | > pivot2 | + * +------------------------------------------------------------+ + * ^ ^ ^ + * | | | + * less k great + * * Invariants: + * * all in (left, less) < pivot1 * pivot1 <= all in [less, k) <= pivot2 * all in (great, right) > pivot2 @@ -446,37 +477,37 @@ final class DualPivotQuicksort { outer: for (int k = less; k <= great; k++) { long ak = a[k]; - if (ak < pivot1) { - if (k > less) { + if (ak < pivot1) { // Move a[k] to left part + if (k != less) { a[k] = a[less]; a[less] = ak; } less++; - } else if (ak > pivot2) { + } else if (ak > pivot2) { // Move a[k] to right part while (a[great] > pivot2) { - if (k == great--) { + if (great-- == k) { break outer; } } - a[k] = a[great]; - a[great--] = ak; - - if ((ak = a[k]) < pivot1) { + if (a[great] < pivot1) { a[k] = a[less]; - a[less++] = ak; + a[less++] = a[great]; + a[great--] = ak; + } else { // pivot1 <= a[great] <= pivot2 + a[k] = a[great]; + a[great--] = ak; } } } } else { // Pivots are equal /* - * Partition degenerates to the traditional 3-way - * (or "Dutch National Flag") partition: + * Partition degenerates to the traditional 3-way, + * or "Dutch National Flag", partition: * * left part center part right part - * ------------------------------------------------- - * [ < pivot | == pivot | ? | > pivot ] - * ------------------------------------------------- - * + * +----------------------------------------------+ + * | < pivot | == pivot | ? | > pivot | + * +----------------------------------------------+ * ^ ^ ^ * | | | * less k great @@ -489,30 +520,34 @@ final class DualPivotQuicksort { * * Pointer k is the first index of ?-part */ - outer: for (int k = less; k <= great; k++) { long ak = a[k]; if (ak == pivot1) { continue; } - if (ak < pivot1) { - if (k > less) { + if (ak < pivot1) { // Move a[k] to left part + if (k != less) { a[k] = a[less]; a[less] = ak; } less++; - } else { // a[k] > pivot + } else { // (a[k] > pivot1) - Move a[k] to right part + /* + * We know that pivot1 == a[e3] == pivot2. Thus, we know + * that great will still be >= k when the following loop + * terminates, even though we don't test for it explicitly. + * In other words, a[e3] acts as a sentinel for great. + */ while (a[great] > pivot1) { - if (k == great--) { - break outer; - } + great--; } - a[k] = a[great]; - a[great--] = ak; - - if ((ak = a[k]) < pivot1) { + if (a[great] < pivot1) { a[k] = a[less]; - a[less++] = ak; + a[less++] = a[great]; + a[great--] = ak; + } else { // a[great] == pivot1 + a[k] = pivot1; + a[great--] = ak; } } } @@ -535,26 +570,55 @@ final class DualPivotQuicksort { } /* - * If center part is too large (comprises > 5/6 of - * the array), swap internal pivot values to ends + * If center part is too large (comprises > 2/3 of the array), + * swap internal pivot values to ends */ - if (less < e1 && e5 < great) { + if (less < e1 && great > e5) { while (a[less] == pivot1) { less++; } while (a[great] == pivot2) { great--; } - for (int k = less + 1; k <= great; ) { + + /* + * Partitioning: + * + * left part center part right part + * +----------------------------------------------------------+ + * | == pivot1 | pivot1 < && < pivot2 | ? | == pivot2 | + * +----------------------------------------------------------+ + * ^ ^ ^ + * | | | + * less k great + * + * Invariants: + * + * all in (*, less) == pivot1 + * pivot1 < all in [less, k) < pivot2 + * all in (great, *) == pivot2 + * + * Pointer k is the first index of ?-part + */ + outer: + for (int k = less; k <= great; k++) { long ak = a[k]; - if (ak == pivot1) { - a[k++] = a[less]; - a[less++] = pivot1; - } else if (ak == pivot2) { - a[k] = a[great]; + if (ak == pivot2) { // Move a[k] to right part + while (a[great] == pivot2) { + if (great-- == k) { + break outer; + } + } + if (a[great] == pivot1) { + a[k] = a[less]; + a[less++] = pivot1; + } else { // pivot1 < a[great] < pivot2 + a[k] = a[great]; + } a[great--] = pivot2; - } else { - k++; + } else if (ak == pivot1) { // Move a[k] to left part + a[k] = a[less]; + a[less++] = pivot1; } } } @@ -576,7 +640,7 @@ final class DualPivotQuicksort { * Sorts the specified range of the array into ascending order. The range * to be sorted extends from the index {@code fromIndex}, inclusive, to * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex}, - * the range to be sorted is empty. + * the range to be sorted is empty (and the call is a no-op). * * @param a the array to be sorted * @param fromIndex the index of the first element, inclusive, to be sorted @@ -606,13 +670,13 @@ final class DualPivotQuicksort { private static void doSort(short[] a, int left, int right) { // Use insertion sort on tiny arrays if (right - left + 1 < INSERTION_SORT_THRESHOLD) { - for (int k = left + 1; k <= right; k++) { - short ak = a[k]; + for (int i = left + 1; i <= right; i++) { + short ai = a[i]; int j; - for (j = k - 1; j >= left && ak < a[j]; j--) { + for (j = i - 1; j >= left && ai < a[j]; j--) { a[j + 1] = a[j]; } - a[j + 1] = ak; + a[j + 1] = ai; } } else if (right-left+1 > COUNTING_SORT_THRESHOLD_FOR_SHORT_OR_CHAR) { // Use counting sort on huge arrays @@ -671,7 +735,7 @@ final class DualPivotQuicksort { * second terciles of the array. Note that pivot1 <= pivot2. * * The pivots are stored in local variables, and the first and - * the last of the sorted elements are moved to the locations + * the last of the elements to be sorted are moved to the locations * formerly occupied by the pivots. When partitioning is complete, * the pivots are swapped back into their final positions, and * excluded from subsequent sorting. @@ -679,27 +743,26 @@ final class DualPivotQuicksort { short pivot1 = ae2; a[e2] = a[left]; short pivot2 = ae4; a[e4] = a[right]; - /* - * Partitioning - * - * left part center part right part - * ------------------------------------------------------------ - * [ < pivot1 | pivot1 <= && <= pivot2 | ? | > pivot2 ] - * ------------------------------------------------------------ - * ^ ^ ^ - * | | | - * less k great - */ - // Pointers int less = left + 1; // The index of first element of center part int great = right - 1; // The index before first element of right part - boolean pivotsDiffer = pivot1 != pivot2; + boolean pivotsDiffer = (pivot1 != pivot2); if (pivotsDiffer) { /* + * Partitioning: + * + * left part center part right part + * +------------------------------------------------------------+ + * | < pivot1 | pivot1 <= && <= pivot2 | ? | > pivot2 | + * +------------------------------------------------------------+ + * ^ ^ ^ + * | | | + * less k great + * * Invariants: + * * all in (left, less) < pivot1 * pivot1 <= all in [less, k) <= pivot2 * all in (great, right) > pivot2 @@ -709,37 +772,37 @@ final class DualPivotQuicksort { outer: for (int k = less; k <= great; k++) { short ak = a[k]; - if (ak < pivot1) { - if (k > less) { + if (ak < pivot1) { // Move a[k] to left part + if (k != less) { a[k] = a[less]; a[less] = ak; } less++; - } else if (ak > pivot2) { + } else if (ak > pivot2) { // Move a[k] to right part while (a[great] > pivot2) { - if (k == great--) { + if (great-- == k) { break outer; } } - a[k] = a[great]; - a[great--] = ak; - - if ((ak = a[k]) < pivot1) { + if (a[great] < pivot1) { a[k] = a[less]; - a[less++] = ak; + a[less++] = a[great]; + a[great--] = ak; + } else { // pivot1 <= a[great] <= pivot2 + a[k] = a[great]; + a[great--] = ak; } } } } else { // Pivots are equal /* - * Partition degenerates to the traditional 3-way - * (or "Dutch National Flag") partition: + * Partition degenerates to the traditional 3-way, + * or "Dutch National Flag", partition: * * left part center part right part - * ------------------------------------------------- - * [ < pivot | == pivot | ? | > pivot ] - * ------------------------------------------------- - * + * +----------------------------------------------+ + * | < pivot | == pivot | ? | > pivot | + * +----------------------------------------------+ * ^ ^ ^ * | | | * less k great @@ -752,30 +815,34 @@ final class DualPivotQuicksort { * * Pointer k is the first index of ?-part */ - outer: for (int k = less; k <= great; k++) { short ak = a[k]; if (ak == pivot1) { continue; } - if (ak < pivot1) { - if (k > less) { + if (ak < pivot1) { // Move a[k] to left part + if (k != less) { a[k] = a[less]; a[less] = ak; } less++; - } else { // a[k] > pivot + } else { // (a[k] > pivot1) - Move a[k] to right part + /* + * We know that pivot1 == a[e3] == pivot2. Thus, we know + * that great will still be >= k when the following loop + * terminates, even though we don't test for it explicitly. + * In other words, a[e3] acts as a sentinel for great. + */ while (a[great] > pivot1) { - if (k == great--) { - break outer; - } + great--; } - a[k] = a[great]; - a[great--] = ak; - - if ((ak = a[k]) < pivot1) { + if (a[great] < pivot1) { a[k] = a[less]; - a[less++] = ak; + a[less++] = a[great]; + a[great--] = ak; + } else { // a[great] == pivot1 + a[k] = pivot1; + a[great--] = ak; } } } @@ -798,26 +865,55 @@ final class DualPivotQuicksort { } /* - * If center part is too large (comprises > 5/6 of - * the array), swap internal pivot values to ends + * If center part is too large (comprises > 2/3 of the array), + * swap internal pivot values to ends */ - if (less < e1 && e5 < great) { + if (less < e1 && great > e5) { while (a[less] == pivot1) { less++; } while (a[great] == pivot2) { great--; } - for (int k = less + 1; k <= great; ) { + + /* + * Partitioning: + * + * left part center part right part + * +----------------------------------------------------------+ + * | == pivot1 | pivot1 < && < pivot2 | ? | == pivot2 | + * +----------------------------------------------------------+ + * ^ ^ ^ + * | | | + * less k great + * + * Invariants: + * + * all in (*, less) == pivot1 + * pivot1 < all in [less, k) < pivot2 + * all in (great, *) == pivot2 + * + * Pointer k is the first index of ?-part + */ + outer: + for (int k = less; k <= great; k++) { short ak = a[k]; - if (ak == pivot1) { - a[k++] = a[less]; - a[less++] = pivot1; - } else if (ak == pivot2) { - a[k] = a[great]; + if (ak == pivot2) { // Move a[k] to right part + while (a[great] == pivot2) { + if (great-- == k) { + break outer; + } + } + if (a[great] == pivot1) { + a[k] = a[less]; + a[less++] = pivot1; + } else { // pivot1 < a[great] < pivot2 + a[k] = a[great]; + } a[great--] = pivot2; - } else { - k++; + } else if (ak == pivot1) { // Move a[k] to left part + a[k] = a[less]; + a[less++] = pivot1; } } } @@ -839,7 +935,7 @@ final class DualPivotQuicksort { * Sorts the specified range of the array into ascending order. The range * to be sorted extends from the index {@code fromIndex}, inclusive, to * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex}, - * the range to be sorted is empty. + * the range to be sorted is empty (and the call is a no-op). * * @param a the array to be sorted * @param fromIndex the index of the first element, inclusive, to be sorted @@ -869,13 +965,13 @@ final class DualPivotQuicksort { private static void doSort(char[] a, int left, int right) { // Use insertion sort on tiny arrays if (right - left + 1 < INSERTION_SORT_THRESHOLD) { - for (int k = left + 1; k <= right; k++) { - char ak = a[k]; + for (int i = left + 1; i <= right; i++) { + char ai = a[i]; int j; - for (j = k - 1; j >= left && ak < a[j]; j--) { + for (j = i - 1; j >= left && ai < a[j]; j--) { a[j + 1] = a[j]; } - a[j + 1] = ak; + a[j + 1] = ai; } } else if (right-left+1 > COUNTING_SORT_THRESHOLD_FOR_SHORT_OR_CHAR) { // Use counting sort on huge arrays @@ -932,7 +1028,7 @@ final class DualPivotQuicksort { * second terciles of the array. Note that pivot1 <= pivot2. * * The pivots are stored in local variables, and the first and - * the last of the sorted elements are moved to the locations + * the last of the elements to be sorted are moved to the locations * formerly occupied by the pivots. When partitioning is complete, * the pivots are swapped back into their final positions, and * excluded from subsequent sorting. @@ -940,27 +1036,26 @@ final class DualPivotQuicksort { char pivot1 = ae2; a[e2] = a[left]; char pivot2 = ae4; a[e4] = a[right]; - /* - * Partitioning - * - * left part center part right part - * ------------------------------------------------------------ - * [ < pivot1 | pivot1 <= && <= pivot2 | ? | > pivot2 ] - * ------------------------------------------------------------ - * ^ ^ ^ - * | | | - * less k great - */ - // Pointers int less = left + 1; // The index of first element of center part int great = right - 1; // The index before first element of right part - boolean pivotsDiffer = pivot1 != pivot2; + boolean pivotsDiffer = (pivot1 != pivot2); if (pivotsDiffer) { /* + * Partitioning: + * + * left part center part right part + * +------------------------------------------------------------+ + * | < pivot1 | pivot1 <= && <= pivot2 | ? | > pivot2 | + * +------------------------------------------------------------+ + * ^ ^ ^ + * | | | + * less k great + * * Invariants: + * * all in (left, less) < pivot1 * pivot1 <= all in [less, k) <= pivot2 * all in (great, right) > pivot2 @@ -970,37 +1065,37 @@ final class DualPivotQuicksort { outer: for (int k = less; k <= great; k++) { char ak = a[k]; - if (ak < pivot1) { - if (k > less) { + if (ak < pivot1) { // Move a[k] to left part + if (k != less) { a[k] = a[less]; a[less] = ak; } less++; - } else if (ak > pivot2) { + } else if (ak > pivot2) { // Move a[k] to right part while (a[great] > pivot2) { - if (k == great--) { + if (great-- == k) { break outer; } } - a[k] = a[great]; - a[great--] = ak; - - if ((ak = a[k]) < pivot1) { + if (a[great] < pivot1) { a[k] = a[less]; - a[less++] = ak; + a[less++] = a[great]; + a[great--] = ak; + } else { // pivot1 <= a[great] <= pivot2 + a[k] = a[great]; + a[great--] = ak; } } } } else { // Pivots are equal /* - * Partition degenerates to the traditional 3-way - * (or "Dutch National Flag") partition: + * Partition degenerates to the traditional 3-way, + * or "Dutch National Flag", partition: * * left part center part right part - * ------------------------------------------------- - * [ < pivot | == pivot | ? | > pivot ] - * ------------------------------------------------- - * + * +----------------------------------------------+ + * | < pivot | == pivot | ? | > pivot | + * +----------------------------------------------+ * ^ ^ ^ * | | | * less k great @@ -1013,30 +1108,34 @@ final class DualPivotQuicksort { * * Pointer k is the first index of ?-part */ - outer: for (int k = less; k <= great; k++) { char ak = a[k]; if (ak == pivot1) { continue; } - if (ak < pivot1) { - if (k > less) { + if (ak < pivot1) { // Move a[k] to left part + if (k != less) { a[k] = a[less]; a[less] = ak; } less++; - } else { // a[k] > pivot + } else { // (a[k] > pivot1) - Move a[k] to right part + /* + * We know that pivot1 == a[e3] == pivot2. Thus, we know + * that great will still be >= k when the following loop + * terminates, even though we don't test for it explicitly. + * In other words, a[e3] acts as a sentinel for great. + */ while (a[great] > pivot1) { - if (k == great--) { - break outer; - } + great--; } - a[k] = a[great]; - a[great--] = ak; - - if ((ak = a[k]) < pivot1) { + if (a[great] < pivot1) { a[k] = a[less]; - a[less++] = ak; + a[less++] = a[great]; + a[great--] = ak; + } else { // a[great] == pivot1 + a[k] = pivot1; + a[great--] = ak; } } } @@ -1059,26 +1158,55 @@ final class DualPivotQuicksort { } /* - * If center part is too large (comprises > 5/6 of - * the array), swap internal pivot values to ends + * If center part is too large (comprises > 2/3 of the array), + * swap internal pivot values to ends */ - if (less < e1 && e5 < great) { + if (less < e1 && great > e5) { while (a[less] == pivot1) { less++; } while (a[great] == pivot2) { great--; } - for (int k = less + 1; k <= great; ) { + + /* + * Partitioning: + * + * left part center part right part + * +----------------------------------------------------------+ + * | == pivot1 | pivot1 < && < pivot2 | ? | == pivot2 | + * +----------------------------------------------------------+ + * ^ ^ ^ + * | | | + * less k great + * + * Invariants: + * + * all in (*, less) == pivot1 + * pivot1 < all in [less, k) < pivot2 + * all in (great, *) == pivot2 + * + * Pointer k is the first index of ?-part + */ + outer: + for (int k = less; k <= great; k++) { char ak = a[k]; - if (ak == pivot1) { - a[k++] = a[less]; - a[less++] = pivot1; - } else if (ak == pivot2) { - a[k] = a[great]; + if (ak == pivot2) { // Move a[k] to right part + while (a[great] == pivot2) { + if (great-- == k) { + break outer; + } + } + if (a[great] == pivot1) { + a[k] = a[less]; + a[less++] = pivot1; + } else { // pivot1 < a[great] < pivot2 + a[k] = a[great]; + } a[great--] = pivot2; - } else { - k++; + } else if (ak == pivot1) { // Move a[k] to left part + a[k] = a[less]; + a[less++] = pivot1; } } } @@ -1100,7 +1228,7 @@ final class DualPivotQuicksort { * Sorts the specified range of the array into ascending order. The range * to be sorted extends from the index {@code fromIndex}, inclusive, to * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex}, - * the range to be sorted is empty. + * the range to be sorted is empty (and the call is a no-op). * * @param a the array to be sorted * @param fromIndex the index of the first element, inclusive, to be sorted @@ -1130,13 +1258,13 @@ final class DualPivotQuicksort { private static void doSort(byte[] a, int left, int right) { // Use insertion sort on tiny arrays if (right - left + 1 < INSERTION_SORT_THRESHOLD) { - for (int k = left + 1; k <= right; k++) { - byte ak = a[k]; + for (int i = left + 1; i <= right; i++) { + byte ai = a[i]; int j; - for (j = k - 1; j >= left && ak < a[j]; j--) { + for (j = i - 1; j >= left && ai < a[j]; j--) { a[j + 1] = a[j]; } - a[j + 1] = ak; + a[j + 1] = ai; } } else if (right - left + 1 > COUNTING_SORT_THRESHOLD_FOR_BYTE) { // Use counting sort on huge arrays @@ -1195,7 +1323,7 @@ final class DualPivotQuicksort { * second terciles of the array. Note that pivot1 <= pivot2. * * The pivots are stored in local variables, and the first and - * the last of the sorted elements are moved to the locations + * the last of the elements to be sorted are moved to the locations * formerly occupied by the pivots. When partitioning is complete, * the pivots are swapped back into their final positions, and * excluded from subsequent sorting. @@ -1203,27 +1331,26 @@ final class DualPivotQuicksort { byte pivot1 = ae2; a[e2] = a[left]; byte pivot2 = ae4; a[e4] = a[right]; - /* - * Partitioning - * - * left part center part right part - * ------------------------------------------------------------ - * [ < pivot1 | pivot1 <= && <= pivot2 | ? | > pivot2 ] - * ------------------------------------------------------------ - * ^ ^ ^ - * | | | - * less k great - */ - // Pointers int less = left + 1; // The index of first element of center part int great = right - 1; // The index before first element of right part - boolean pivotsDiffer = pivot1 != pivot2; + boolean pivotsDiffer = (pivot1 != pivot2); if (pivotsDiffer) { /* + * Partitioning: + * + * left part center part right part + * +------------------------------------------------------------+ + * | < pivot1 | pivot1 <= && <= pivot2 | ? | > pivot2 | + * +------------------------------------------------------------+ + * ^ ^ ^ + * | | | + * less k great + * * Invariants: + * * all in (left, less) < pivot1 * pivot1 <= all in [less, k) <= pivot2 * all in (great, right) > pivot2 @@ -1233,37 +1360,37 @@ final class DualPivotQuicksort { outer: for (int k = less; k <= great; k++) { byte ak = a[k]; - if (ak < pivot1) { - if (k > less) { + if (ak < pivot1) { // Move a[k] to left part + if (k != less) { a[k] = a[less]; a[less] = ak; } less++; - } else if (ak > pivot2) { + } else if (ak > pivot2) { // Move a[k] to right part while (a[great] > pivot2) { - if (k == great--) { + if (great-- == k) { break outer; } } - a[k] = a[great]; - a[great--] = ak; - - if ((ak = a[k]) < pivot1) { + if (a[great] < pivot1) { a[k] = a[less]; - a[less++] = ak; + a[less++] = a[great]; + a[great--] = ak; + } else { // pivot1 <= a[great] <= pivot2 + a[k] = a[great]; + a[great--] = ak; } } } } else { // Pivots are equal /* - * Partition degenerates to the traditional 3-way - * (or "Dutch National Flag") partition: + * Partition degenerates to the traditional 3-way, + * or "Dutch National Flag", partition: * * left part center part right part - * ------------------------------------------------- - * [ < pivot | == pivot | ? | > pivot ] - * ------------------------------------------------- - * + * +----------------------------------------------+ + * | < pivot | == pivot | ? | > pivot | + * +----------------------------------------------+ * ^ ^ ^ * | | | * less k great @@ -1276,30 +1403,34 @@ final class DualPivotQuicksort { * * Pointer k is the first index of ?-part */ - outer: for (int k = less; k <= great; k++) { byte ak = a[k]; if (ak == pivot1) { continue; } - if (ak < pivot1) { - if (k > less) { + if (ak < pivot1) { // Move a[k] to left part + if (k != less) { a[k] = a[less]; a[less] = ak; } less++; - } else { // a[k] > pivot + } else { // (a[k] > pivot1) - Move a[k] to right part + /* + * We know that pivot1 == a[e3] == pivot2. Thus, we know + * that great will still be >= k when the following loop + * terminates, even though we don't test for it explicitly. + * In other words, a[e3] acts as a sentinel for great. + */ while (a[great] > pivot1) { - if (k == great--) { - break outer; - } + great--; } - a[k] = a[great]; - a[great--] = ak; - - if ((ak = a[k]) < pivot1) { + if (a[great] < pivot1) { a[k] = a[less]; - a[less++] = ak; + a[less++] = a[great]; + a[great--] = ak; + } else { // a[great] == pivot1 + a[k] = pivot1; + a[great--] = ak; } } } @@ -1322,26 +1453,55 @@ final class DualPivotQuicksort { } /* - * If center part is too large (comprises > 5/6 of - * the array), swap internal pivot values to ends + * If center part is too large (comprises > 2/3 of the array), + * swap internal pivot values to ends */ - if (less < e1 && e5 < great) { + if (less < e1 && great > e5) { while (a[less] == pivot1) { less++; } while (a[great] == pivot2) { great--; } - for (int k = less + 1; k <= great; ) { + + /* + * Partitioning: + * + * left part center part right part + * +----------------------------------------------------------+ + * | == pivot1 | pivot1 < && < pivot2 | ? | == pivot2 | + * +----------------------------------------------------------+ + * ^ ^ ^ + * | | | + * less k great + * + * Invariants: + * + * all in (*, less) == pivot1 + * pivot1 < all in [less, k) < pivot2 + * all in (great, *) == pivot2 + * + * Pointer k is the first index of ?-part + */ + outer: + for (int k = less; k <= great; k++) { byte ak = a[k]; - if (ak == pivot1) { - a[k++] = a[less]; - a[less++] = pivot1; - } else if (ak == pivot2) { - a[k] = a[great]; + if (ak == pivot2) { // Move a[k] to right part + while (a[great] == pivot2) { + if (great-- == k) { + break outer; + } + } + if (a[great] == pivot1) { + a[k] = a[less]; + a[less++] = pivot1; + } else { // pivot1 < a[great] < pivot2 + a[k] = a[great]; + } a[great--] = pivot2; - } else { - k++; + } else if (ak == pivot1) { // Move a[k] to left part + a[k] = a[less]; + a[less++] = pivot1; } } } @@ -1371,7 +1531,7 @@ final class DualPivotQuicksort { * Sorts the specified range of the array into ascending order. The range * to be sorted extends from the index {@code fromIndex}, inclusive, to * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex}, - * the range to be sorted is empty. + * the range to be sorted is empty and the call is a no-op). * *

    The {@code <} relation does not provide a total order on all float * values: {@code -0.0f == 0.0f} is {@code true} and a {@code Float.NaN} @@ -1485,13 +1645,13 @@ final class DualPivotQuicksort { private static void doSort(float[] a, int left, int right) { // Use insertion sort on tiny arrays if (right - left + 1 < INSERTION_SORT_THRESHOLD) { - for (int k = left + 1; k <= right; k++) { - float ak = a[k]; + for (int i = left + 1; i <= right; i++) { + float ai = a[i]; int j; - for (j = k - 1; j >= left && ak < a[j]; j--) { + for (j = i - 1; j >= left && ai < a[j]; j--) { a[j + 1] = a[j]; } - a[j + 1] = ak; + a[j + 1] = ai; } } else { // Use Dual-Pivot Quicksort on large arrays dualPivotQuicksort(a, left, right); @@ -1536,7 +1696,7 @@ final class DualPivotQuicksort { * second terciles of the array. Note that pivot1 <= pivot2. * * The pivots are stored in local variables, and the first and - * the last of the sorted elements are moved to the locations + * the last of the elements to be sorted are moved to the locations * formerly occupied by the pivots. When partitioning is complete, * the pivots are swapped back into their final positions, and * excluded from subsequent sorting. @@ -1544,27 +1704,26 @@ final class DualPivotQuicksort { float pivot1 = ae2; a[e2] = a[left]; float pivot2 = ae4; a[e4] = a[right]; - /* - * Partitioning - * - * left part center part right part - * ------------------------------------------------------------ - * [ < pivot1 | pivot1 <= && <= pivot2 | ? | > pivot2 ] - * ------------------------------------------------------------ - * ^ ^ ^ - * | | | - * less k great - */ - // Pointers int less = left + 1; // The index of first element of center part int great = right - 1; // The index before first element of right part - boolean pivotsDiffer = pivot1 != pivot2; + boolean pivotsDiffer = (pivot1 != pivot2); if (pivotsDiffer) { /* + * Partitioning: + * + * left part center part right part + * +------------------------------------------------------------+ + * | < pivot1 | pivot1 <= && <= pivot2 | ? | > pivot2 | + * +------------------------------------------------------------+ + * ^ ^ ^ + * | | | + * less k great + * * Invariants: + * * all in (left, less) < pivot1 * pivot1 <= all in [less, k) <= pivot2 * all in (great, right) > pivot2 @@ -1574,37 +1733,37 @@ final class DualPivotQuicksort { outer: for (int k = less; k <= great; k++) { float ak = a[k]; - if (ak < pivot1) { - if (k > less) { + if (ak < pivot1) { // Move a[k] to left part + if (k != less) { a[k] = a[less]; a[less] = ak; } less++; - } else if (ak > pivot2) { + } else if (ak > pivot2) { // Move a[k] to right part while (a[great] > pivot2) { - if (k == great--) { + if (great-- == k) { break outer; } } - a[k] = a[great]; - a[great--] = ak; - - if ((ak = a[k]) < pivot1) { + if (a[great] < pivot1) { a[k] = a[less]; - a[less++] = ak; + a[less++] = a[great]; + a[great--] = ak; + } else { // pivot1 <= a[great] <= pivot2 + a[k] = a[great]; + a[great--] = ak; } } } } else { // Pivots are equal /* - * Partition degenerates to the traditional 3-way - * (or "Dutch National Flag") partition: + * Partition degenerates to the traditional 3-way, + * or "Dutch National Flag", partition: * * left part center part right part - * ------------------------------------------------- - * [ < pivot | == pivot | ? | > pivot ] - * ------------------------------------------------- - * + * +----------------------------------------------+ + * | < pivot | == pivot | ? | > pivot | + * +----------------------------------------------+ * ^ ^ ^ * | | | * less k great @@ -1617,30 +1776,34 @@ final class DualPivotQuicksort { * * Pointer k is the first index of ?-part */ - outer: for (int k = less; k <= great; k++) { float ak = a[k]; if (ak == pivot1) { continue; } - if (ak < pivot1) { - if (k > less) { + if (ak < pivot1) { // Move a[k] to left part + if (k != less) { a[k] = a[less]; a[less] = ak; } less++; - } else { // a[k] > pivot + } else { // (a[k] > pivot1) - Move a[k] to right part + /* + * We know that pivot1 == a[e3] == pivot2. Thus, we know + * that great will still be >= k when the following loop + * terminates, even though we don't test for it explicitly. + * In other words, a[e3] acts as a sentinel for great. + */ while (a[great] > pivot1) { - if (k == great--) { - break outer; - } + great--; } - a[k] = a[great]; - a[great--] = ak; - - if ((ak = a[k]) < pivot1) { + if (a[great] < pivot1) { a[k] = a[less]; - a[less++] = ak; + a[less++] = a[great]; + a[great--] = ak; + } else { // a[great] == pivot1 + a[k] = pivot1; + a[great--] = ak; } } } @@ -1663,26 +1826,55 @@ final class DualPivotQuicksort { } /* - * If center part is too large (comprises > 5/6 of - * the array), swap internal pivot values to ends + * If center part is too large (comprises > 2/3 of the array), + * swap internal pivot values to ends */ - if (less < e1 && e5 < great) { + if (less < e1 && great > e5) { while (a[less] == pivot1) { less++; } while (a[great] == pivot2) { great--; } - for (int k = less + 1; k <= great; ) { + + /* + * Partitioning: + * + * left part center part right part + * +----------------------------------------------------------+ + * | == pivot1 | pivot1 < && < pivot2 | ? | == pivot2 | + * +----------------------------------------------------------+ + * ^ ^ ^ + * | | | + * less k great + * + * Invariants: + * + * all in (*, less) == pivot1 + * pivot1 < all in [less, k) < pivot2 + * all in (great, *) == pivot2 + * + * Pointer k is the first index of ?-part + */ + outer: + for (int k = less; k <= great; k++) { float ak = a[k]; - if (ak == pivot1) { - a[k++] = a[less]; - a[less++] = pivot1; - } else if (ak == pivot2) { - a[k] = a[great]; + if (ak == pivot2) { // Move a[k] to right part + while (a[great] == pivot2) { + if (great-- == k) { + break outer; + } + } + if (a[great] == pivot1) { + a[k] = a[less]; + a[less++] = pivot1; + } else { // pivot1 < a[great] < pivot2 + a[k] = a[great]; + } a[great--] = pivot2; - } else { - k++; + } else if (ak == pivot1) { // Move a[k] to left part + a[k] = a[less]; + a[less++] = pivot1; } } } @@ -1712,7 +1904,7 @@ final class DualPivotQuicksort { * Sorts the specified range of the array into ascending order. The range * to be sorted extends from the index {@code fromIndex}, inclusive, to * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex}, - * the range to be sorted is empty. + * the range to be sorted is empty (and the call is a no-op). * *

    The {@code <} relation does not provide a total order on all double * values: {@code -0.0d == 0.0d} is {@code true} and a {@code Double.NaN} @@ -1826,13 +2018,13 @@ final class DualPivotQuicksort { private static void doSort(double[] a, int left, int right) { // Use insertion sort on tiny arrays if (right - left + 1 < INSERTION_SORT_THRESHOLD) { - for (int k = left + 1; k <= right; k++) { - double ak = a[k]; + for (int i = left + 1; i <= right; i++) { + double ai = a[i]; int j; - for (j = k - 1; j >= left && ak < a[j]; j--) { + for (j = i - 1; j >= left && ai < a[j]; j--) { a[j + 1] = a[j]; } - a[j + 1] = ak; + a[j + 1] = ai; } } else { // Use Dual-Pivot Quicksort on large arrays dualPivotQuicksort(a, left, right); @@ -1877,7 +2069,7 @@ final class DualPivotQuicksort { * second terciles of the array. Note that pivot1 <= pivot2. * * The pivots are stored in local variables, and the first and - * the last of the sorted elements are moved to the locations + * the last of the elements to be sorted are moved to the locations * formerly occupied by the pivots. When partitioning is complete, * the pivots are swapped back into their final positions, and * excluded from subsequent sorting. @@ -1885,27 +2077,26 @@ final class DualPivotQuicksort { double pivot1 = ae2; a[e2] = a[left]; double pivot2 = ae4; a[e4] = a[right]; - /* - * Partitioning - * - * left part center part right part - * ------------------------------------------------------------ - * [ < pivot1 | pivot1 <= && <= pivot2 | ? | > pivot2 ] - * ------------------------------------------------------------ - * ^ ^ ^ - * | | | - * less k great - */ - // Pointers int less = left + 1; // The index of first element of center part int great = right - 1; // The index before first element of right part - boolean pivotsDiffer = pivot1 != pivot2; + boolean pivotsDiffer = (pivot1 != pivot2); if (pivotsDiffer) { /* + * Partitioning: + * + * left part center part right part + * +------------------------------------------------------------+ + * | < pivot1 | pivot1 <= && <= pivot2 | ? | > pivot2 | + * +------------------------------------------------------------+ + * ^ ^ ^ + * | | | + * less k great + * * Invariants: + * * all in (left, less) < pivot1 * pivot1 <= all in [less, k) <= pivot2 * all in (great, right) > pivot2 @@ -1915,37 +2106,37 @@ final class DualPivotQuicksort { outer: for (int k = less; k <= great; k++) { double ak = a[k]; - if (ak < pivot1) { - if (k > less) { + if (ak < pivot1) { // Move a[k] to left part + if (k != less) { a[k] = a[less]; a[less] = ak; } less++; - } else if (ak > pivot2) { + } else if (ak > pivot2) { // Move a[k] to right part while (a[great] > pivot2) { - if (k == great--) { + if (great-- == k) { break outer; } } - a[k] = a[great]; - a[great--] = ak; - - if ((ak = a[k]) < pivot1) { + if (a[great] < pivot1) { a[k] = a[less]; - a[less++] = ak; + a[less++] = a[great]; + a[great--] = ak; + } else { // pivot1 <= a[great] <= pivot2 + a[k] = a[great]; + a[great--] = ak; } } } } else { // Pivots are equal /* - * Partition degenerates to the traditional 3-way - * (or "Dutch National Flag") partition: + * Partition degenerates to the traditional 3-way, + * or "Dutch National Flag", partition: * * left part center part right part - * ------------------------------------------------- - * [ < pivot | == pivot | ? | > pivot ] - * ------------------------------------------------- - * + * +----------------------------------------------+ + * | < pivot | == pivot | ? | > pivot | + * +----------------------------------------------+ * ^ ^ ^ * | | | * less k great @@ -1958,30 +2149,34 @@ final class DualPivotQuicksort { * * Pointer k is the first index of ?-part */ - outer: for (int k = less; k <= great; k++) { double ak = a[k]; if (ak == pivot1) { continue; } - if (ak < pivot1) { - if (k > less) { + if (ak < pivot1) { // Move a[k] to left part + if (k != less) { a[k] = a[less]; a[less] = ak; } less++; - } else { // a[k] > pivot + } else { // (a[k] > pivot1) - Move a[k] to right part + /* + * We know that pivot1 == a[e3] == pivot2. Thus, we know + * that great will still be >= k when the following loop + * terminates, even though we don't test for it explicitly. + * In other words, a[e3] acts as a sentinel for great. + */ while (a[great] > pivot1) { - if (k == great--) { - break outer; - } + great--; } - a[k] = a[great]; - a[great--] = ak; - - if ((ak = a[k]) < pivot1) { + if (a[great] < pivot1) { a[k] = a[less]; - a[less++] = ak; + a[less++] = a[great]; + a[great--] = ak; + } else { // a[great] == pivot1 + a[k] = pivot1; + a[great--] = ak; } } } @@ -2004,26 +2199,55 @@ final class DualPivotQuicksort { } /* - * If center part is too large (comprises > 5/6 of - * the array), swap internal pivot values to ends + * If center part is too large (comprises > 2/3 of the array), + * swap internal pivot values to ends */ - if (less < e1 && e5 < great) { + if (less < e1 && great > e5) { while (a[less] == pivot1) { less++; } while (a[great] == pivot2) { great--; } - for (int k = less + 1; k <= great; ) { + + /* + * Partitioning: + * + * left part center part right part + * +----------------------------------------------------------+ + * | == pivot1 | pivot1 < && < pivot2 | ? | == pivot2 | + * +----------------------------------------------------------+ + * ^ ^ ^ + * | | | + * less k great + * + * Invariants: + * + * all in (*, less) == pivot1 + * pivot1 < all in [less, k) < pivot2 + * all in (great, *) == pivot2 + * + * Pointer k is the first index of ?-part + */ + outer: + for (int k = less; k <= great; k++) { double ak = a[k]; - if (ak == pivot1) { - a[k++] = a[less]; - a[less++] = pivot1; - } else if (ak == pivot2) { - a[k] = a[great]; + if (ak == pivot2) { // Move a[k] to right part + while (a[great] == pivot2) { + if (great-- == k) { + break outer; + } + } + if (a[great] == pivot1) { + a[k] = a[less]; + a[less++] = pivot1; + } else { // pivot1 < a[great] < pivot2 + a[k] = a[great]; + } a[great--] = pivot2; - } else { - k++; + } else if (ak == pivot1) { // Move a[k] to left part + a[k] = a[less]; + a[less++] = pivot1; } } } diff --git a/jdk/src/share/classes/java/util/Formatter.java b/jdk/src/share/classes/java/util/Formatter.java index 59ff1da0711..46a6431298c 100644 --- a/jdk/src/share/classes/java/util/Formatter.java +++ b/jdk/src/share/classes/java/util/Formatter.java @@ -2552,9 +2552,6 @@ public final class Formatter implements Closeable, Flushable { private boolean dt = false; private char c; - // cache the line separator - private String ls; - private int index(String s) { if (s != null) { try { @@ -2702,9 +2699,7 @@ public final class Formatter implements Closeable, Flushable { printHashCode(arg); break; case Conversion.LINE_SEPARATOR: - if (ls == null) - ls = System.getProperty("line.separator"); - a.append(ls); + a.append(System.lineSeparator()); break; case Conversion.PERCENT_SIGN: a.append('%'); diff --git a/jdk/src/share/classes/java/util/Iterator.java b/jdk/src/share/classes/java/util/Iterator.java index 16b9c431506..fd9725de850 100644 --- a/jdk/src/share/classes/java/util/Iterator.java +++ b/jdk/src/share/classes/java/util/Iterator.java @@ -41,6 +41,8 @@ package java.util; * * Java Collections Framework. * + * @param the type of elements returned by this iterator + * * @author Josh Bloch * @see Collection * @see ListIterator diff --git a/jdk/src/share/classes/java/util/List.java b/jdk/src/share/classes/java/util/List.java index 4ce27c82289..a05fe305681 100644 --- a/jdk/src/share/classes/java/util/List.java +++ b/jdk/src/share/classes/java/util/List.java @@ -89,6 +89,8 @@ package java.util; * * Java Collections Framework. * + * @param the type of elements in this list + * * @author Josh Bloch * @author Neal Gafter * @see Collection diff --git a/jdk/src/share/classes/java/util/NavigableMap.java b/jdk/src/share/classes/java/util/NavigableMap.java index 592a20dbe6d..7761b0742c5 100644 --- a/jdk/src/share/classes/java/util/NavigableMap.java +++ b/jdk/src/share/classes/java/util/NavigableMap.java @@ -298,7 +298,7 @@ public interface NavigableMap extends SortedMap { * Returns a view of the portion of this map whose keys range from * {@code fromKey} to {@code toKey}. If {@code fromKey} and * {@code toKey} are equal, the returned map is empty unless - * {@code fromExclusive} and {@code toExclusive} are both true. The + * {@code fromInclusive} and {@code toInclusive} are both true. The * returned map is backed by this map, so changes in the returned map are * reflected in this map, and vice-versa. The returned map supports all * optional map operations that this map supports. diff --git a/jdk/src/share/classes/java/util/NavigableSet.java b/jdk/src/share/classes/java/util/NavigableSet.java index b96299e1547..d4f0b2ccd7c 100644 --- a/jdk/src/share/classes/java/util/NavigableSet.java +++ b/jdk/src/share/classes/java/util/NavigableSet.java @@ -192,7 +192,7 @@ public interface NavigableSet extends SortedSet { * Returns a view of the portion of this set whose elements range from * {@code fromElement} to {@code toElement}. If {@code fromElement} and * {@code toElement} are equal, the returned set is empty unless {@code - * fromExclusive} and {@code toExclusive} are both true. The returned set + * fromInclusive} and {@code toInclusive} are both true. The returned set * is backed by this set, so changes in the returned set are reflected in * this set, and vice-versa. The returned set supports all optional set * operations that this set supports. diff --git a/jdk/src/share/classes/java/util/Objects.java b/jdk/src/share/classes/java/util/Objects.java index 3ef61bde98d..8b009243eb9 100644 --- a/jdk/src/share/classes/java/util/Objects.java +++ b/jdk/src/share/classes/java/util/Objects.java @@ -119,7 +119,7 @@ public final class Objects { * * @param values the values to be hashed * @return a hash value of the sequence of input values - * @see Arrays#hashCode + * @see Arrays#hashCode(Object[]) * @see List#hashCode */ public static int hash(Object... values) { diff --git a/jdk/src/share/classes/java/util/logging/PlatformLoggingMXBean.java b/jdk/src/share/classes/java/util/logging/PlatformLoggingMXBean.java index f994e285bcd..b27339461cb 100644 --- a/jdk/src/share/classes/java/util/logging/PlatformLoggingMXBean.java +++ b/jdk/src/share/classes/java/util/logging/PlatformLoggingMXBean.java @@ -51,7 +51,7 @@ import java.lang.management.PlatformManagedObject; * The {@link PlatformManagedObject#getObjectName} method * can be used to obtain its {@code ObjectName}. * - * @See java.lang.management.PlatformManagedObject + * @see java.lang.management.PlatformManagedObject * * @author Mandy Chung * @since 1.7 diff --git a/jdk/src/share/classes/java/util/regex/Pattern.java b/jdk/src/share/classes/java/util/regex/Pattern.java index a69c8da669f..7bf6a1d7890 100644 --- a/jdk/src/share/classes/java/util/regex/Pattern.java +++ b/jdk/src/share/classes/java/util/regex/Pattern.java @@ -860,6 +860,14 @@ public final class Pattern */ private transient int patternLength; + /** + * If the Start node might possibly match supplementary characters. + * It is set to true during compiling if + * (1) There is supplementary char in pattern, or + * (2) There is complement node of Category or Block + */ + private transient boolean hasSupplementary; + /** * Compiles the given regular expression into a pattern.

    * @@ -1481,7 +1489,7 @@ loop: for(int x=0, offset=0; x= Character.MIN_SUPPLEMENTARY_CODE_POINT || isSurrogate(ch); + return ch >= Character.MIN_SUPPLEMENTARY_CODE_POINT || + Character.isSurrogate((char)ch); } /** @@ -1885,7 +1894,7 @@ loop: for(int x=0, offset=0; x= Character.MIN_HIGH_SURROGATE && c <= Character.MAX_LOW_SURROGATE; - } - private static final int countChars(CharSequence seq, int index, int lengthInCodePoints) { // optimization @@ -3174,20 +3183,17 @@ loop: for(int x=0, offset=0; xThis method uses {@link #NO_FLUSH} as its compression flush mode. @@ -353,7 +353,7 @@ class Deflater { /** * Compresses the input data and fills specified buffer with compressed * data. Returns actual number of bytes of compressed data. A return value - * of 0 indicates that {@link needsInput() needsInput} should be called + * of 0 indicates that {@link #needsInput() needsInput} should be called * in order to determine if more input data is required. * *

    This method uses {@link #NO_FLUSH} as its compression flush mode. diff --git a/jdk/src/share/classes/java/util/zip/DeflaterOutputStream.java b/jdk/src/share/classes/java/util/zip/DeflaterOutputStream.java index 238de92e815..109f698199b 100644 --- a/jdk/src/share/classes/java/util/zip/DeflaterOutputStream.java +++ b/jdk/src/share/classes/java/util/zip/DeflaterOutputStream.java @@ -66,7 +66,7 @@ class DeflaterOutputStream extends FilterOutputStream { * @param def the compressor ("deflater") * @param size the output buffer size * @param syncFlush - * if {@code true} the {@link flush()} method of this + * if {@code true} the {@link #flush()} method of this * instance flushes the compressor with flush mode * {@link Deflater#SYNC_FLUSH} before flushing the output * stream, otherwise only flushes the output stream @@ -114,7 +114,7 @@ class DeflaterOutputStream extends FilterOutputStream { * @param out the output stream * @param def the compressor ("deflater") * @param syncFlush - * if {@code true} the {@link flush()} method of this + * if {@code true} the {@link #flush()} method of this * instance flushes the compressor with flush mode * {@link Deflater#SYNC_FLUSH} before flushing the output * stream, otherwise only flushes the output stream @@ -151,7 +151,7 @@ class DeflaterOutputStream extends FilterOutputStream { * * @param out the output stream * @param syncFlush - * if {@code true} the {@link flush()} method of this + * if {@code true} the {@link #flush()} method of this * instance flushes the compressor with flush mode * {@link Deflater#SYNC_FLUSH} before flushing the output * stream, otherwise only flushes the output stream @@ -262,10 +262,10 @@ class DeflaterOutputStream extends FilterOutputStream { /** * Flushes the compressed output stream. * - * If {@link DeflaterOutputStream(OutputStream, Deflater, int, boolean) + * If {@link #DeflaterOutputStream(OutputStream, Deflater, int, boolean) * syncFlush} is {@code true} when this compressed output stream is - * constructed this method flushes the underlying {@code compressor} - * first with the flush mode {@link Deflater#SYNC_FLUSH} to force + * constructed, this method first flushes the underlying {@code compressor} + * with the flush mode {@link Deflater#SYNC_FLUSH} to force * all pending data to be flushed out to the output stream and then * flushes the output stream. Otherwise this method only flushes the * output stream without flushing the {@code compressor}. diff --git a/jdk/src/share/classes/java/util/zip/ZipFile.java b/jdk/src/share/classes/java/util/zip/ZipFile.java index 583d7dcfe1a..6eabd7b9805 100644 --- a/jdk/src/share/classes/java/util/zip/ZipFile.java +++ b/jdk/src/share/classes/java/util/zip/ZipFile.java @@ -36,6 +36,8 @@ import java.util.Enumeration; import java.util.Set; import java.util.HashSet; import java.util.NoSuchElementException; +import java.security.AccessController; +import sun.security.action.GetPropertyAction; import static java.util.zip.ZipConstants64.*; /** @@ -78,6 +80,17 @@ class ZipFile implements ZipConstants, Closeable { private static native void initIDs(); + private static final boolean usemmap; + + static { + // A system prpperty to disable mmap use to avoid vm crash when + // in-use zip file is accidently overwritten by others. + String prop = AccessController.doPrivileged( + new GetPropertyAction("sun.zip.disableMemoryMapping")); + usemmap = (prop == null || + !(prop.length() == 0 || prop.equalsIgnoreCase("true"))); + } + /** * Opens a zip file for reading. * @@ -196,7 +209,7 @@ class ZipFile implements ZipConstants, Closeable { throw new NullPointerException("charset is null"); this.zc = ZipCoder.get(charset); long t0 = System.nanoTime(); - jzfile = open(name, mode, file.lastModified()); + jzfile = open(name, mode, file.lastModified(), usemmap); sun.misc.PerfCounter.getZipFileOpenTime().addElapsedTimeFrom(t0); sun.misc.PerfCounter.getZipFileCount().increment(); this.name = name; @@ -673,8 +686,8 @@ class ZipFile implements ZipConstants, Closeable { } - private static native long open(String name, int mode, long lastModified) - throws IOException; + private static native long open(String name, int mode, long lastModified, + boolean usemmap) throws IOException; private static native int getTotal(long jzfile); private static native int read(long jzfile, long jzentry, long pos, byte[] b, int off, int len); diff --git a/jdk/src/share/classes/javax/accessibility/AccessibleContext.java b/jdk/src/share/classes/javax/accessibility/AccessibleContext.java index fbe7e9b1d6f..d4a093f72ec 100644 --- a/jdk/src/share/classes/javax/accessibility/AccessibleContext.java +++ b/jdk/src/share/classes/javax/accessibility/AccessibleContext.java @@ -296,7 +296,7 @@ public abstract class AccessibleContext { * * @see #getAccessibleText * @see #addPropertyChangeListener - * @see #AccessibleText.AccessibleTextSequence + * @see AccessibleTextSequence */ public static final String ACCESSIBLE_TEXT_PROPERTY = "AccessibleText"; @@ -311,7 +311,7 @@ public abstract class AccessibleContext { * * @see #getAccessibleText * @see #addPropertyChangeListener - * @see #AccessibleText.AccessibleTextSequence + * @see AccessibleTextSequence * * @since 1.5 */ @@ -334,7 +334,7 @@ public abstract class AccessibleContext { * * @see #getAccessibleText * @see #addPropertyChangeListener - * @see #AccessibleText.AccessibleAttributeSequence + * @see AccessibleAttributeSequence * * @since 1.5 */ diff --git a/jdk/src/share/classes/javax/accessibility/AccessibleExtendedText.java b/jdk/src/share/classes/javax/accessibility/AccessibleExtendedText.java index 4868ab85e8f..f7a04252136 100644 --- a/jdk/src/share/classes/javax/accessibility/AccessibleExtendedText.java +++ b/jdk/src/share/classes/javax/accessibility/AccessibleExtendedText.java @@ -45,7 +45,6 @@ import javax.swing.text.*; * @see Accessible#getAccessibleContext * @see AccessibleContext * @see AccessibleContext#getAccessibleText - * @see AccessibleText.AccessibleTextChunk * * @author Peter Korn * @author Lynn Monsanto diff --git a/jdk/src/share/classes/javax/accessibility/AccessibleKeyBinding.java b/jdk/src/share/classes/javax/accessibility/AccessibleKeyBinding.java index cdf4c493a62..e50e9f54259 100644 --- a/jdk/src/share/classes/javax/accessibility/AccessibleKeyBinding.java +++ b/jdk/src/share/classes/javax/accessibility/AccessibleKeyBinding.java @@ -32,16 +32,11 @@ package javax.accessibility; * the standard mechanism for an assistive technology to determine the * key bindings which exist for this object. * Any object that has such key bindings should support this - * interface. Applications can determine if an object supports the - * AccessibleKeyBinding interface by first obtaining its AccessibleContext - * (see @link Accessible} and then calling the - * {@link AccessibleContext#getAccessibleKeyBinding} method. If the return - * value is not null, the object supports this interface. + * interface. * * @see Accessible * @see Accessible#getAccessibleContext * @see AccessibleContext - * @see AccessibleContext#getAccessibleKeyBinding * * @author Lynn Monsanto * @since 1.4 @@ -58,21 +53,7 @@ public interface AccessibleKeyBinding { /** * Returns a key binding for this object. The value returned is an * java.lang.Object which must be cast to appropriate type depending - * on the underlying implementation of the key. For example, if the - * Object returned is a javax.swing.KeyStroke, the user of this - * method should do the following: - * - * Component c = - * AccessibleContext ac = c.getAccessibleContext(); - * AccessibleKeyBinding akb = ac.getAccessibleKeyBinding(); - * for (int i = 0; i < akb.getAccessibleKeyBindingCount(); i++) { - * Object o = akb.getAccessibleKeyBinding(i); - * if (o instanceof javax.swing.KeyStroke) { - * javax.swing.KeyStroke keyStroke = (javax.swing.KeyStroke)o; - * - * } - * } - * + * on the underlying implementation of the key. * * @param i zero-based index of the key bindings * @return a javax.lang.Object which specifies the key binding diff --git a/jdk/src/share/classes/javax/naming/InitialContext.java b/jdk/src/share/classes/javax/naming/InitialContext.java index 0e105d0f840..b9cc6e545dc 100644 --- a/jdk/src/share/classes/javax/naming/InitialContext.java +++ b/jdk/src/share/classes/javax/naming/InitialContext.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -198,6 +198,8 @@ public class InitialContext implements Context { * *

    This constructor will not modify environment * or save a reference to it, but may save a clone. + * Caller should not modify mutable keys and values in + * environment after it has been passed to the constructor. * * @param environment * environment used to create the initial context. diff --git a/jdk/src/share/classes/javax/naming/directory/InitialDirContext.java b/jdk/src/share/classes/javax/naming/directory/InitialDirContext.java index d96643acf4b..1a3aac6407e 100644 --- a/jdk/src/share/classes/javax/naming/directory/InitialDirContext.java +++ b/jdk/src/share/classes/javax/naming/directory/InitialDirContext.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -86,6 +86,8 @@ public class InitialDirContext extends InitialContext implements DirContext { * *

    This constructor will not modify environment * or save a reference to it, but may save a clone. + * Caller should not modify mutable keys and values in + * environment after it has been passed to the constructor. * * @param environment * environment used to create the initial DirContext. diff --git a/jdk/src/share/classes/javax/naming/ldap/InitialLdapContext.java b/jdk/src/share/classes/javax/naming/ldap/InitialLdapContext.java index 896cae8ccaf..757d29e7f78 100644 --- a/jdk/src/share/classes/javax/naming/ldap/InitialLdapContext.java +++ b/jdk/src/share/classes/javax/naming/ldap/InitialLdapContext.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -110,6 +110,8 @@ public class InitialLdapContext extends InitialDirContext implements LdapContext * *

    This constructor will not modify its parameters or * save references to them, but may save a clone or copy. + * Caller should not modify mutable keys and values in + * environment after it has been passed to the constructor. * *

    connCtls is used as the underlying context instance's * connection request controls. See the class description diff --git a/jdk/src/share/classes/javax/swing/AbstractListModel.java b/jdk/src/share/classes/javax/swing/AbstractListModel.java index b0c67b7f795..8aa6b24c2a7 100644 --- a/jdk/src/share/classes/javax/swing/AbstractListModel.java +++ b/jdk/src/share/classes/javax/swing/AbstractListModel.java @@ -42,9 +42,11 @@ import java.util.EventListener; * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * + * @param the type of the elements of this model + * * @author Hans Muller */ -public abstract class AbstractListModel implements ListModel, Serializable +public abstract class AbstractListModel implements ListModel, Serializable { protected EventListenerList listenerList = new EventListenerList(); diff --git a/jdk/src/share/classes/javax/swing/DefaultListCellRenderer.java b/jdk/src/share/classes/javax/swing/DefaultListCellRenderer.java index 2cb42272ae8..e5242520ff0 100644 --- a/jdk/src/share/classes/javax/swing/DefaultListCellRenderer.java +++ b/jdk/src/share/classes/javax/swing/DefaultListCellRenderer.java @@ -71,7 +71,7 @@ import sun.swing.DefaultLookup; * @author Hans Muller */ public class DefaultListCellRenderer extends JLabel - implements ListCellRenderer, Serializable + implements ListCellRenderer, Serializable { /** @@ -111,7 +111,7 @@ public class DefaultListCellRenderer extends JLabel } public Component getListCellRendererComponent( - JList list, + JList list, Object value, int index, boolean isSelected, diff --git a/jdk/src/share/classes/javax/swing/DefaultListModel.java b/jdk/src/share/classes/javax/swing/DefaultListModel.java index 01a9f206604..af460a8918d 100644 --- a/jdk/src/share/classes/javax/swing/DefaultListModel.java +++ b/jdk/src/share/classes/javax/swing/DefaultListModel.java @@ -48,11 +48,13 @@ import javax.swing.event.*; * has been added to the java.beans package. * Please see {@link java.beans.XMLEncoder}. * + * @param the type of the elements of this model + * * @author Hans Muller */ -public class DefaultListModel extends AbstractListModel +public class DefaultListModel extends AbstractListModel { - private Vector delegate = new Vector(); + private Vector delegate = new Vector(); /** * Returns the number of components in this list. @@ -83,7 +85,7 @@ public class DefaultListModel extends AbstractListModel * list * @see #get(int) */ - public Object getElementAt(int index) { + public E getElementAt(int index) { return delegate.elementAt(index); } @@ -175,7 +177,7 @@ public class DefaultListModel extends AbstractListModel * @return an enumeration of the components of this list * @see Vector#elements() */ - public Enumeration elements() { + public Enumeration elements() { return delegate.elements(); } @@ -260,7 +262,7 @@ public class DefaultListModel extends AbstractListModel * @see #get(int) * @see Vector#elementAt(int) */ - public Object elementAt(int index) { + public E elementAt(int index) { return delegate.elementAt(index); } @@ -271,7 +273,7 @@ public class DefaultListModel extends AbstractListModel * @return the first component of this list * @see Vector#firstElement() */ - public Object firstElement() { + public E firstElement() { return delegate.firstElement(); } @@ -283,13 +285,13 @@ public class DefaultListModel extends AbstractListModel * @return the last component of the list * @see Vector#lastElement() */ - public Object lastElement() { + public E lastElement() { return delegate.lastElement(); } /** * Sets the component at the specified index of this - * list to be the specified object. The previous component at that + * list to be the specified element. The previous component at that * position is discarded. *

    * Throws an ArrayIndexOutOfBoundsException if the index @@ -300,13 +302,13 @@ public class DefaultListModel extends AbstractListModel * List interface defined in the 1.2 Collections framework. * * - * @param obj what the component is to be set to + * @param element what the component is to be set to * @param index the specified index * @see #set(int,Object) * @see Vector#setElementAt(Object,int) */ - public void setElementAt(Object obj, int index) { - delegate.setElementAt(obj, index); + public void setElementAt(E element, int index) { + delegate.setElementAt(element, index); fireContentsChanged(this, index, index); } @@ -331,7 +333,7 @@ public class DefaultListModel extends AbstractListModel } /** - * Inserts the specified object as a component in this list at the + * Inserts the specified element as a component in this list at the * specified index. *

    * Throws an ArrayIndexOutOfBoundsException if the index @@ -342,26 +344,26 @@ public class DefaultListModel extends AbstractListModel * List interface defined in the 1.2 Collections framework. * * - * @param obj the component to insert + * @param element the component to insert * @param index where to insert the new component * @exception ArrayIndexOutOfBoundsException if the index was invalid * @see #add(int,Object) * @see Vector#insertElementAt(Object,int) */ - public void insertElementAt(Object obj, int index) { - delegate.insertElementAt(obj, index); + public void insertElementAt(E element, int index) { + delegate.insertElementAt(element, index); fireIntervalAdded(this, index, index); } /** * Adds the specified component to the end of this list. * - * @param obj the component to be added + * @param element the component to be added * @see Vector#addElement(Object) */ - public void addElement(Object obj) { + public void addElement(E element) { int index = delegate.size(); - delegate.addElement(obj); + delegate.addElement(element); fireIntervalAdded(this, index, index); } @@ -441,7 +443,7 @@ public class DefaultListModel extends AbstractListModel * * @param index index of element to return */ - public Object get(int index) { + public E get(int index) { return delegate.elementAt(index); } @@ -457,8 +459,8 @@ public class DefaultListModel extends AbstractListModel * @param element element to be stored at the specified position * @return the element previously at the specified position */ - public Object set(int index, Object element) { - Object rv = delegate.elementAt(index); + public E set(int index, E element) { + E rv = delegate.elementAt(index); delegate.setElementAt(element, index); fireContentsChanged(this, index, index); return rv; @@ -474,7 +476,7 @@ public class DefaultListModel extends AbstractListModel * @param index index at which the specified element is to be inserted * @param element element to be inserted */ - public void add(int index, Object element) { + public void add(int index, E element) { delegate.insertElementAt(element, index); fireIntervalAdded(this, index, index); } @@ -488,9 +490,10 @@ public class DefaultListModel extends AbstractListModel * (index < 0 || index >= size()). * * @param index the index of the element to removed + * @return the element previously at the specified position */ - public Object remove(int index) { - Object rv = delegate.elementAt(index); + public E remove(int index) { + E rv = delegate.elementAt(index); delegate.removeElementAt(index); fireIntervalRemoved(this, index, index); return rv; diff --git a/jdk/src/share/classes/javax/swing/JList.java b/jdk/src/share/classes/javax/swing/JList.java index 6c06c5ea682..8a86bda547d 100644 --- a/jdk/src/share/classes/javax/swing/JList.java +++ b/jdk/src/share/classes/javax/swing/JList.java @@ -25,11 +25,24 @@ package javax.swing; +import java.awt.Color; +import java.awt.Component; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.GraphicsEnvironment; +import java.awt.HeadlessException; +import java.awt.Insets; +import java.awt.Point; +import java.awt.Rectangle; import java.awt.event.*; -import java.awt.*; import java.util.Vector; import java.util.Locale; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; @@ -59,28 +72,30 @@ import static sun.swing.SwingUtilities2.Section.*; * constructor that automatically builds a read-only {@code ListModel} instance * for you: *

    + * {@code
      * // Create a JList that displays strings from an array
      *
      * String[] data = {"one", "two", "three", "four"};
    - * JList myList = new JList(data);
    + * JList myList = new JList(data);
      *
      * // Create a JList that displays the superclasses of JList.class, by
      * // creating it with a Vector populated with this data
      *
    - * Vector superClasses = new Vector();
    - * Class rootClass = javax.swing.JList.class;
    - * for(Class cls = rootClass; cls != null; cls = cls.getSuperclass()) {
    + * Vector> superClasses = new Vector>();
    + * Class rootClass = javax.swing.JList.class;
    + * for(Class cls = rootClass; cls != null; cls = cls.getSuperclass()) {
      *     superClasses.addElement(cls);
      * }
    - * JList myList = new JList(superClasses);
    + * JList> myList = new JList>(superClasses);
      *
      * // The automatically created model is stored in JList's "model"
      * // property, which you can retrieve
      *
    - * ListModel model = myList.getModel();
    + * ListModel> model = myList.getModel();
      * for(int i = 0; i < model.getSize(); i++) {
      *     System.out.println(model.getElementAt(i));
      * }
    + * }
      * 
    *

    * A {@code ListModel} can be supplied directly to a {@code JList} by way of a @@ -103,12 +118,14 @@ import static sun.swing.SwingUtilities2.Section.*; * notifying listeners. For example, a read-only implementation of * {@code AbstractListModel}: *

    + * {@code
      * // This list model has about 2^16 elements.  Enjoy scrolling.
      *
    - * ListModel bigData = new AbstractListModel() {
    + * ListModel bigData = new AbstractListModel() {
      *     public int getSize() { return Short.MAX_VALUE; }
    - *     public Object getElementAt(int index) { return "Index " + index; }
    + *     public String getElementAt(int index) { return "Index " + index; }
      * };
    + * }
      * 
    *

    * The selection state of a {@code JList} is managed by another separate @@ -150,9 +167,10 @@ import static sun.swing.SwingUtilities2.Section.*; * component to render, is installed by the lists's {@code ListUI}. You can * substitute your own renderer using code like this: *

    + * {@code
      *  // Display an icon and a string for each object in the list.
      *
    - * class MyCellRenderer extends JLabel implements ListCellRenderer {
    + * class MyCellRenderer extends JLabel implements ListCellRenderer {
      *     final static ImageIcon longIcon = new ImageIcon("long.gif");
      *     final static ImageIcon shortIcon = new ImageIcon("short.gif");
      *
    @@ -160,7 +178,7 @@ import static sun.swing.SwingUtilities2.Section.*;
      *     // We just reconfigure the JLabel each time we're called.
      *
      *     public Component getListCellRendererComponent(
    - *       JList list,              // the list
    + *       JList list,           // the list
      *       Object value,            // value to display
      *       int index,               // cell index
      *       boolean isSelected,      // is the cell selected
    @@ -184,6 +202,7 @@ import static sun.swing.SwingUtilities2.Section.*;
      * }
      *
      * myList.setCellRenderer(new MyCellRenderer());
    + * }
      * 
      * 

    * Another job for the cell renderer is in helping to determine sizing @@ -195,7 +214,8 @@ import static sun.swing.SwingUtilities2.Section.*; * automatically based on a single prototype value: * *

    - * JList bigDataList = new JList(bigData);
    + * {@code
    + * JList bigDataList = new JList(bigData);
      *
      * // We don't want the JList implementation to compute the width
      * // or height of all of the list cells, so we give it a string
    @@ -204,6 +224,7 @@ import static sun.swing.SwingUtilities2.Section.*;
      * // properties.
      *
      * bigDataList.setPrototypeCellValue("Index 1234567890");
    + * }
      * 
    *

    * {@code JList} doesn't implement scrolling directly. To create a list that @@ -260,13 +281,15 @@ import static sun.swing.SwingUtilities2.Section.*; * @see ListCellRenderer * @see DefaultListCellRenderer * + * @param the type of the elements of this list + * * @beaninfo * attribute: isContainer false * description: A component which allows for the selection of one or more objects from a list. * * @author Hans Muller */ -public class JList extends JComponent implements Scrollable, Accessible +public class JList extends JComponent implements Scrollable, Accessible { /** * @see #getUIClassID @@ -301,15 +324,15 @@ public class JList extends JComponent implements Scrollable, Accessible private int fixedCellWidth = -1; private int fixedCellHeight = -1; private int horizontalScrollIncrement = -1; - private Object prototypeCellValue; + private E prototypeCellValue; private int visibleRowCount = 8; private Color selectionForeground; private Color selectionBackground; private boolean dragEnabled; private ListSelectionModel selectionModel; - private ListModel dataModel; - private ListCellRenderer cellRenderer; + private ListModel dataModel; + private ListCellRenderer cellRenderer; private ListSelectionListener selectionListener; /** @@ -402,7 +425,7 @@ public class JList extends JComponent implements Scrollable, Accessible * @param dataModel the model for the list * @exception IllegalArgumentException if the model is {@code null} */ - public JList(ListModel dataModel) + public JList(ListModel dataModel) { if (dataModel == null) { throw new IllegalArgumentException("dataModel must be non null"); @@ -437,12 +460,12 @@ public class JList extends JComponent implements Scrollable, Accessible * @param listData the array of Objects to be loaded into the data model, * {@code non-null} */ - public JList(final Object[] listData) + public JList(final E[] listData) { this ( - new AbstractListModel() { + new AbstractListModel() { public int getSize() { return listData.length; } - public Object getElementAt(int i) { return listData[i]; } + public E getElementAt(int i) { return listData[i]; } } ); } @@ -462,11 +485,11 @@ public class JList extends JComponent implements Scrollable, Accessible * @param listData the Vector to be loaded into the * data model, {@code non-null} */ - public JList(final Vector listData) { + public JList(final Vector listData) { this ( - new AbstractListModel() { + new AbstractListModel() { public int getSize() { return listData.size(); } - public Object getElementAt(int i) { return listData.elementAt(i); } + public E getElementAt(int i) { return listData.elementAt(i); } } ); } @@ -477,9 +500,9 @@ public class JList extends JComponent implements Scrollable, Accessible */ public JList() { this ( - new AbstractListModel() { + new AbstractListModel() { public int getSize() { return 0; } - public Object getElementAt(int i) { return "No Data Model"; } + public E getElementAt(int i) { throw new IndexOutOfBoundsException("No Data Model"); } } ); } @@ -526,7 +549,7 @@ public class JList extends JComponent implements Scrollable, Accessible public void updateUI() { setUI((ListUI)UIManager.getUI(this)); - ListCellRenderer renderer = getCellRenderer(); + ListCellRenderer renderer = getCellRenderer(); if (renderer instanceof Component) { SwingUtilities.updateComponentTreeUI((Component)renderer); } @@ -560,8 +583,8 @@ public class JList extends JComponent implements Scrollable, Accessible */ private void updateFixedCellSize() { - ListCellRenderer cr = getCellRenderer(); - Object value = getPrototypeCellValue(); + ListCellRenderer cr = getCellRenderer(); + E value = getPrototypeCellValue(); if ((cr != null) && (value != null)) { Component c = cr.getListCellRendererComponent(this, value, 0, false, false); @@ -592,7 +615,7 @@ public class JList extends JComponent implements Scrollable, Accessible * @return the value of the {@code prototypeCellValue} property * @see #setPrototypeCellValue */ - public Object getPrototypeCellValue() { + public E getPrototypeCellValue() { return prototypeCellValue; } @@ -632,8 +655,8 @@ public class JList extends JComponent implements Scrollable, Accessible * attribute: visualUpdate true * description: The cell prototype value, used to compute cell width and height. */ - public void setPrototypeCellValue(Object prototypeCellValue) { - Object oldValue = this.prototypeCellValue; + public void setPrototypeCellValue(E prototypeCellValue) { + E oldValue = this.prototypeCellValue; this.prototypeCellValue = prototypeCellValue; /* If the prototypeCellValue has changed and is non-null, @@ -727,7 +750,7 @@ public class JList extends JComponent implements Scrollable, Accessible * @see #setCellRenderer */ @Transient - public ListCellRenderer getCellRenderer() { + public ListCellRenderer getCellRenderer() { return cellRenderer; } @@ -755,8 +778,8 @@ public class JList extends JComponent implements Scrollable, Accessible * attribute: visualUpdate true * description: The component used to draw the cells. */ - public void setCellRenderer(ListCellRenderer cellRenderer) { - ListCellRenderer oldValue = this.cellRenderer; + public void setCellRenderer(ListCellRenderer cellRenderer) { + ListCellRenderer oldValue = this.cellRenderer; this.cellRenderer = cellRenderer; /* If the cellRenderer has changed and prototypeCellValue @@ -1455,7 +1478,7 @@ public class JList extends JComponent implements Scrollable, Accessible * @since 1.4 */ public int getNextMatch(String prefix, int startIndex, Position.Bias bias) { - ListModel model = getModel(); + ListModel model = getModel(); int max = model.getSize(); if (prefix == null) { throw new IllegalArgumentException(); @@ -1469,16 +1492,16 @@ public class JList extends JComponent implements Scrollable, Accessible int increment = (bias == Position.Bias.Forward) ? 1 : -1; int index = startIndex; do { - Object o = model.getElementAt(index); + E element = model.getElementAt(index); - if (o != null) { + if (element != null) { String string; - if (o instanceof String) { - string = ((String)o).toUpperCase(); + if (element instanceof String) { + string = ((String)element).toUpperCase(); } else { - string = o.toString(); + string = element.toString(); if (string != null) { string = string.toUpperCase(); } @@ -1516,7 +1539,7 @@ public class JList extends JComponent implements Scrollable, Accessible if(event != null) { Point p = event.getPoint(); int index = locationToIndex(p); - ListCellRenderer r = getCellRenderer(); + ListCellRenderer r = getCellRenderer(); Rectangle cellBounds; if (index != -1 && r != null && (cellBounds = @@ -1634,7 +1657,7 @@ public class JList extends JComponent implements Scrollable, Accessible * list of items * @see #setModel */ - public ListModel getModel() { + public ListModel getModel() { return dataModel; } @@ -1656,11 +1679,11 @@ public class JList extends JComponent implements Scrollable, Accessible * attribute: visualUpdate true * description: The object that contains the data to be drawn by this JList. */ - public void setModel(ListModel model) { + public void setModel(ListModel model) { if (model == null) { throw new IllegalArgumentException("model must be non null"); } - ListModel oldValue = dataModel; + ListModel oldValue = dataModel; dataModel = model; firePropertyChange("model", oldValue, dataModel); clearSelection(); @@ -1668,7 +1691,7 @@ public class JList extends JComponent implements Scrollable, Accessible /** - * Constructs a read-only ListModel from an array of objects, + * Constructs a read-only ListModel from an array of items, * and calls {@code setModel} with this model. *

    * Attempts to pass a {@code null} value to this method results in @@ -1676,15 +1699,15 @@ public class JList extends JComponent implements Scrollable, Accessible * references the given array directly. Attempts to modify the array * after invoking this method results in undefined behavior. * - * @param listData an array of {@code Objects} containing the items to + * @param listData an array of {@code E} containing the items to * display in the list * @see #setModel */ - public void setListData(final Object[] listData) { + public void setListData(final E[] listData) { setModel ( - new AbstractListModel() { + new AbstractListModel() { public int getSize() { return listData.length; } - public Object getElementAt(int i) { return listData[i]; } + public E getElementAt(int i) { return listData[i]; } } ); } @@ -1703,11 +1726,11 @@ public class JList extends JComponent implements Scrollable, Accessible * display in the list * @see #setModel */ - public void setListData(final Vector listData) { + public void setListData(final Vector listData) { setModel ( - new AbstractListModel() { + new AbstractListModel() { public int getSize() { return listData.size(); } - public Object getElementAt(int i) { return listData.elementAt(i); } + public E getElementAt(int i) { return listData.elementAt(i); } } ); } @@ -2235,10 +2258,13 @@ public class JList extends JComponent implements Scrollable, Accessible * @see #isSelectedIndex * @see #getModel * @see #addListSelectionListener + * + * @deprecated As of JDK 1.7, replaced by {@link #getSelectedValuesList()} */ + @Deprecated public Object[] getSelectedValues() { ListSelectionModel sm = getSelectionModel(); - ListModel dm = getModel(); + ListModel dm = getModel(); int iMin = sm.getMinSelectionIndex(); int iMax = sm.getMaxSelectionIndex(); @@ -2259,6 +2285,37 @@ public class JList extends JComponent implements Scrollable, Accessible return rv; } + /** + * Returns a list of all the selected items, in increasing order based + * on their indices in the list. + * + * @return the selected items, or an empty list if nothing is selected + * @see #isSelectedIndex + * @see #getModel + * @see #addListSelectionListener + * + * @since 1.7 + */ + public List getSelectedValuesList() { + ListSelectionModel sm = getSelectionModel(); + ListModel dm = getModel(); + + int iMin = sm.getMinSelectionIndex(); + int iMax = sm.getMaxSelectionIndex(); + + if ((iMin < 0) || (iMax < 0)) { + return Collections.emptyList(); + } + + List selectedItems = new ArrayList(); + for(int i = iMin; i <= iMax; i++) { + if (sm.isSelectedIndex(i)) { + selectedItems.add(dm.getElementAt(i)); + } + } + return selectedItems; + } + /** * Returns the smallest selected cell index; the selection when only @@ -2291,7 +2348,7 @@ public class JList extends JComponent implements Scrollable, Accessible * @see #getModel * @see #addListSelectionListener */ - public Object getSelectedValue() { + public E getSelectedValue() { int i = getMinSelectionIndex(); return (i == -1) ? null : getModel().getElementAt(i); } @@ -2309,7 +2366,7 @@ public class JList extends JComponent implements Scrollable, Accessible setSelectedIndex(-1); else if(!anObject.equals(getSelectedValue())) { int i,c; - ListModel dm = getModel(); + ListModel dm = getModel(); for(i=0,c=dm.getSize();i parent = null; private int indexInParent; private Component component = null; private AccessibleContext accessibleContext = null; - private ListModel listModel; - private ListCellRenderer cellRenderer = null; + private ListModel listModel; + private ListCellRenderer cellRenderer = null; - public AccessibleJListChild(JList parent, int indexInParent) { + public AccessibleJListChild(JList parent, int indexInParent) { this.parent = parent; this.setAccessibleParent(parent); this.indexInParent = indexInParent; @@ -3175,7 +3232,7 @@ public class JList extends JComponent implements Scrollable, Accessible if ((parent != null) && (listModel != null) && cellRenderer != null) { - Object value = listModel.getElementAt(index); + E value = listModel.getElementAt(index); boolean isSelected = parent.isSelectedIndex(index); boolean isFocussed = parent.isFocusOwner() && (index == parent.getLeadSelectionIndex()); diff --git a/jdk/src/share/classes/javax/swing/JTable.java b/jdk/src/share/classes/javax/swing/JTable.java index 5489c380f1a..236e59102c1 100644 --- a/jdk/src/share/classes/javax/swing/JTable.java +++ b/jdk/src/share/classes/javax/swing/JTable.java @@ -1337,7 +1337,11 @@ public class JTable extends JComponent implements TableModelListener, Scrollable return (TableCellRenderer)renderer; } else { - return getDefaultRenderer(columnClass.getSuperclass()); + Class c = columnClass.getSuperclass(); + if (c == null && columnClass != Object.class) { + c = Object.class; + } + return getDefaultRenderer(c); } } } @@ -2502,10 +2506,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable Color old = this.selectionForeground; this.selectionForeground = selectionForeground; firePropertyChange("selectionForeground", old, selectionForeground); - if ( !selectionForeground.equals(old) ) - { - repaint(); - } + repaint(); } /** @@ -2543,10 +2544,7 @@ public class JTable extends JComponent implements TableModelListener, Scrollable Color old = this.selectionBackground; this.selectionBackground = selectionBackground; firePropertyChange("selectionBackground", old, selectionBackground); - if ( !selectionBackground.equals(old) ) - { - repaint(); - } + repaint(); } /** diff --git a/jdk/src/share/classes/javax/swing/ListCellRenderer.java b/jdk/src/share/classes/javax/swing/ListCellRenderer.java index 6abd53fe7c8..de195b08b68 100644 --- a/jdk/src/share/classes/javax/swing/ListCellRenderer.java +++ b/jdk/src/share/classes/javax/swing/ListCellRenderer.java @@ -33,12 +33,13 @@ import java.awt.Component; * the cells in a JList. For example, to use a JLabel as a * ListCellRenderer, you would write something like this: *

    - * class MyCellRenderer extends JLabel implements ListCellRenderer {
    + * {@code
    + * class MyCellRenderer extends JLabel implements ListCellRenderer {
      *     public MyCellRenderer() {
      *         setOpaque(true);
      *     }
      *
    - *     public Component getListCellRendererComponent(JList list,
    + *     public Component getListCellRendererComponent(JList list,
      *                                                   Object value,
      *                                                   int index,
      *                                                   boolean isSelected,
    @@ -75,14 +76,17 @@ import java.awt.Component;
      *         return this;
      *     }
      * }
    + * }
      * 
      *
    + * @param  the type of values this renderer can be used for
    + *
      * @see JList
      * @see DefaultListCellRenderer
      *
      * @author Hans Muller
      */
    -public interface ListCellRenderer
    +public interface ListCellRenderer
     {
         /**
          * Return a component that has been configured to display the specified
    @@ -104,8 +108,8 @@ public interface ListCellRenderer
          * @see ListModel
          */
         Component getListCellRendererComponent(
    -        JList list,
    -        Object value,
    +        JList list,
    +        E value,
             int index,
             boolean isSelected,
             boolean cellHasFocus);
    diff --git a/jdk/src/share/classes/javax/swing/ListModel.java b/jdk/src/share/classes/javax/swing/ListModel.java
    index e5bb5d03cbf..1d064734917 100644
    --- a/jdk/src/share/classes/javax/swing/ListModel.java
    +++ b/jdk/src/share/classes/javax/swing/ListModel.java
    @@ -35,10 +35,12 @@ import javax.swing.event.ListDataListener;
      * length of the data model must be reported to all of the
      * ListDataListeners.
      *
    + * @param  the type of the elements of this model
    + *
      * @author Hans Muller
      * @see JList
      */
    -public interface ListModel
    +public interface ListModel
     {
       /**
        * Returns the length of the list.
    @@ -51,7 +53,7 @@ public interface ListModel
        * @param index the requested index
        * @return the value at index
        */
    -  Object getElementAt(int index);
    +  E getElementAt(int index);
     
       /**
        * Adds a listener to the list that's notified each time a change
    diff --git a/jdk/src/share/classes/javax/swing/MultiUIDefaults.java b/jdk/src/share/classes/javax/swing/MultiUIDefaults.java
    index 20eeeafa24a..4319ef47367 100644
    --- a/jdk/src/share/classes/javax/swing/MultiUIDefaults.java
    +++ b/jdk/src/share/classes/javax/swing/MultiUIDefaults.java
    @@ -27,6 +27,7 @@ package javax.swing;
     
     import java.util.Enumeration;
     import java.util.HashSet;
    +import java.util.Iterator;
     import java.util.Locale;
     import java.util.Map.Entry;
     import java.util.Set;
    @@ -89,11 +90,7 @@ class MultiUIDefaults extends UIDefaults
     
         @Override
         public int size() {
    -        int n = super.size();
    -        for (UIDefaults table : tables) {
    -            n += (table != null) ? table.size() : 0;
    -        }
    -        return n;
    +        return entrySet().size();
         }
     
         @Override
    @@ -104,40 +101,26 @@ class MultiUIDefaults extends UIDefaults
         @Override
         public Enumeration keys()
         {
    -        Enumeration[] enums = new Enumeration[1 + tables.length];
    -        enums[0] = super.keys();
    -        for(int i = 0; i < tables.length; i++) {
    -            UIDefaults table = tables[i];
    -            if (table != null) {
    -                enums[i + 1] = table.keys();
    -            }
    -        }
    -        return new MultiUIDefaultsEnumerator(enums);
    +        return new MultiUIDefaultsEnumerator(
    +                MultiUIDefaultsEnumerator.Type.KEYS, entrySet());
         }
     
         @Override
         public Enumeration elements()
         {
    -        Enumeration[] enums = new Enumeration[1 + tables.length];
    -        enums[0] = super.elements();
    -        for(int i = 0; i < tables.length; i++) {
    -            UIDefaults table = tables[i];
    -            if (table != null) {
    -                enums[i + 1] = table.elements();
    -            }
    -        }
    -        return new MultiUIDefaultsEnumerator(enums);
    +        return new MultiUIDefaultsEnumerator(
    +                MultiUIDefaultsEnumerator.Type.ELEMENTS, entrySet());
         }
     
         @Override
         public Set> entrySet() {
             Set> set = new HashSet>();
    -        if (tables == null) return set;
    -        for (UIDefaults table : tables) {
    -            if (table != null) {
    -                set.addAll(table.entrySet());
    +        for (int i = tables.length - 1; i >= 0; i--) {
    +            if (tables[i] != null) {
    +                set.addAll(tables[i].entrySet());
                 }
             }
    +        set.addAll(super.entrySet());
             return set;
         }
     
    @@ -152,50 +135,46 @@ class MultiUIDefaults extends UIDefaults
     
         private static class MultiUIDefaultsEnumerator implements Enumeration
         {
    -        Enumeration[] enums;
    -        int n = 0;
    +        public static enum Type { KEYS, ELEMENTS };
    +        private Iterator> iterator;
    +        private Type type;
     
    -        MultiUIDefaultsEnumerator(Enumeration[] enums) {
    -            this.enums = enums;
    +        MultiUIDefaultsEnumerator(Type type, Set> entries) {
    +            this.type = type;
    +            this.iterator = entries.iterator();
             }
     
             public boolean hasMoreElements() {
    -            for(int i = n; i < enums.length; i++) {
    -                Enumeration e = enums[i];
    -                if ((e != null) && (e.hasMoreElements())) {
    -                    return true;
    -                }
    -            }
    -            return false;
    +            return iterator.hasNext();
             }
     
             public Object nextElement() {
    -            for(; n < enums.length; n++) {
    -                Enumeration e = enums[n];
    -                if ((e != null) && (e.hasMoreElements())) {
    -                    return e.nextElement();
    -                }
    +            switch (type) {
    +                case KEYS: return iterator.next().getKey();
    +                case ELEMENTS: return iterator.next().getValue();
    +                default: return null;
                 }
    -            return null;
             }
         }
     
         @Override
         public Object remove(Object key)
         {
    -        Object value = super.remove(key);
    -        if (value != null) {
    -            return value;
    -        }
    -
    -        for (UIDefaults table : tables) {
    -            value = (table != null) ? table.remove(key) : null;
    -            if (value != null) {
    -                return value;
    +        Object value = null;
    +        for (int i = tables.length - 1; i >= 0; i--) {
    +            if (tables[i] != null) {
    +                Object v = tables[i].remove(key);
    +                if (v != null) {
    +                    value = v;
    +                }
                 }
             }
    +        Object v = super.remove(key);
    +        if (v != null) {
    +            value = v;
    +        }
     
    -        return null;
    +        return value;
         }
     
         @Override
    diff --git a/jdk/src/share/classes/javax/swing/Popup.java b/jdk/src/share/classes/javax/swing/Popup.java
    index 0d1f2d53f19..bd6e6fff8b5 100644
    --- a/jdk/src/share/classes/javax/swing/Popup.java
    +++ b/jdk/src/share/classes/javax/swing/Popup.java
    @@ -227,12 +227,8 @@ public class Popup {
             HeavyWeightWindow(Window parent) {
                 super(parent);
                 setFocusableWindowState(false);
    -            Toolkit tk = Toolkit.getDefaultToolkit();
    -            if (tk instanceof SunToolkit) {
    -                // all the short-lived windows like Popups should be
    -                // OverrideRedirect on X11 platforms
    -                ((SunToolkit)tk).setOverrideRedirect(this);
    -            }
    +            setType(Window.Type.POPUP);
    +
                 // Popups are typically transient and most likely won't benefit
                 // from true double buffering.  Turn it off here.
                 getRootPane().setUseTrueDoubleBuffering(false);
    diff --git a/jdk/src/share/classes/javax/swing/TransferHandler.java b/jdk/src/share/classes/javax/swing/TransferHandler.java
    index cb1e2ccb907..5ea41ed3292 100644
    --- a/jdk/src/share/classes/javax/swing/TransferHandler.java
    +++ b/jdk/src/share/classes/javax/swing/TransferHandler.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright 2000-2006 Sun Microsystems, Inc.  All Rights Reserved.
    + * Copyright 2000-2009 Sun Microsystems, Inc.  All Rights Reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -627,6 +627,69 @@ public class TransferHandler implements Serializable {
             this(null);
         }
     
    +
    +    /**
    +     * image for the {@code startDrag} method
    +     *
    +     * @see java.awt.dnd.DragGestureEvent#startDrag(Cursor dragCursor, Image dragImage, Point imageOffset, Transferable transferable, DragSourceListener dsl)
    +     */
    +    private  Image dragImage;
    +
    +    /**
    +     * anchor offset for the {@code startDrag} method
    +     *
    +     * @see java.awt.dnd.DragGestureEvent#startDrag(Cursor dragCursor, Image dragImage, Point imageOffset, Transferable transferable, DragSourceListener dsl)
    +     */
    +    private  Point dragImageOffset;
    +
    +    /**
    +     * Sets the drag image parameter. The image has to be prepared
    +     * for rendering by the moment of the call. The image is stored
    +     * by reference because of some performance reasons.
    +     *
    +     * @param img an image to drag
    +     */
    +    public void setDragImage(Image img) {
    +        dragImage = img;
    +    }
    +
    +    /**
    +     * Returns the drag image. If there is no image to drag,
    +     * the returned value is {@code null}.
    +     *
    +     * @return the reference to the drag image
    +     */
    +    public Image getDragImage() {
    +        return dragImage;
    +    }
    +
    +    /**
    +     * Sets an anchor offset for the image to drag.
    +     * It can not be {@code null}.
    +     *
    +     * @param p a {@code Point} object that corresponds
    +     * to coordinates of an anchor offset of the image
    +     * relative to the upper left corner of the image
    +     */
    +    public void setDragImageOffset(Point p) {
    +        dragImageOffset = new Point(p);
    +    }
    +
    +    /**
    +     * Returns an anchor offset for the image to drag.
    +     *
    +     * @return a {@code Point} object that corresponds
    +     * to coordinates of an anchor offset of the image
    +     * relative to the upper left corner of the image.
    +     * The point {@code (0,0)} returns by default.
    +     */
    +    public Point getDragImageOffset() {
    +        if (dragImageOffset == null) {
    +            return new Point(0,0);
    +        }
    +        return new Point(dragImageOffset);
    +    }
    +
         /**
          * Causes the Swing drag support to be initiated.  This is called by
          * the various UI implementations in the javax.swing.plaf.basic
    @@ -1522,7 +1585,12 @@ public class TransferHandler implements Serializable {
                     scrolls = c.getAutoscrolls();
                     c.setAutoscrolls(false);
                     try {
    -                    dge.startDrag(null, t, this);
    +                    Image im = th.getDragImage();
    +                    if (im == null) {
    +                        dge.startDrag(null, t, this);
    +                    } else {
    +                        dge.startDrag(null, im, th.getDragImageOffset(), t, this);
    +                    }
                         return;
                     } catch (RuntimeException re) {
                         c.setAutoscrolls(scrolls);
    diff --git a/jdk/src/share/classes/javax/swing/plaf/ComponentUI.java b/jdk/src/share/classes/javax/swing/plaf/ComponentUI.java
    index 6bcf7e6966c..087e9760177 100644
    --- a/jdk/src/share/classes/javax/swing/plaf/ComponentUI.java
    +++ b/jdk/src/share/classes/javax/swing/plaf/ComponentUI.java
    @@ -60,13 +60,13 @@ public abstract class ComponentUI {
         }
     
         /**
    -     * Configures the specified component appropriate for the look and feel.
    +     * Configures the specified component appropriately for the look and feel.
          * This method is invoked when the ComponentUI instance is being installed
          * as the UI delegate on the specified component.  This method should
          * completely configure the component for the look and feel,
          * including the following:
          * 
      - *
    1. Install any default property values for color, fonts, borders, + *
    2. Install default property values for color, fonts, borders, * icons, opacity, etc. on the component. Whenever possible, * property values initialized by the client program should not * be overridden. @@ -116,7 +116,7 @@ public abstract class ComponentUI { } /** - * Paints the specified component appropriate for the look and feel. + * Paints the specified component appropriately for the look and feel. * This method is invoked from the ComponentUI.update method when * the specified component is being painted. Subclasses should override * this method and use the specified Graphics object to @@ -134,15 +134,15 @@ public abstract class ComponentUI { } /** - * Notifies this UI delegate that it's time to paint the specified + * Notifies this UI delegate that it is time to paint the specified * component. This method is invoked by JComponent * when the specified component is being painted. - * By default this method will fill the specified component with - * its background color (if its opaque property is - * true) and then immediately call paint. - * In general this method need not be overridden by subclasses; - * all look-and-feel rendering code should reside in the paint - * method. + * + *

      By default this method fills the specified component with + * its background color if its {@code opaque} property is {@code true}, + * and then immediately calls {@code paint}. In general this method need + * not be overridden by subclasses; all look-and-feel rendering code should + * reside in the {@code paint} method. * * @param g the Graphics context in which to paint * @param c the component being painted; diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java index ded1d6a017d..22949be0580 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java @@ -24,14 +24,10 @@ */ package javax.swing.plaf.basic; -import javax.swing.*; +import javax.swing.ComboBoxEditor; +import javax.swing.JTextField; import javax.swing.border.Border; - -import javax.swing.text.AttributeSet; -import javax.swing.text.BadLocationException; -import javax.swing.text.PlainDocument; - -import java.awt.*; +import java.awt.Component; import java.awt.event.*; import java.lang.reflect.Method; @@ -73,12 +69,17 @@ public class BasicComboBoxEditor implements ComboBoxEditor,FocusListener { * @param anObject the displayed value of the editor */ public void setItem(Object anObject) { - if ( anObject != null ) { - editor.setText(anObject.toString()); + String text; + if ( anObject != null ) { + text = anObject.toString(); oldValue = anObject; } else { - editor.setText(""); + text = ""; + } + // workaround for 4530952 + if (! text.equals(editor.getText())) { + editor.setText(text); } } diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java index 3b2fa972e64..06de6fe44ea 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java @@ -30,7 +30,6 @@ import java.awt.event.*; import javax.swing.*; import javax.accessibility.*; import javax.swing.plaf.*; -import javax.swing.border.*; import javax.swing.text.*; import javax.swing.event.*; import java.beans.PropertyChangeListener; @@ -189,19 +188,20 @@ public class BasicComboBoxUI extends ComboBoxUI { /** * Indicates whether or not the combo box button should be square. * If square, then the width and height are equal, and are both set to - * the height of the combo (minus appropriate insets). + * the height of the combo minus appropriate insets. + * + * @since 1.7 */ - private boolean squareButton = true; + protected boolean squareButton = true; /** - * Optional: if specified, these insets act as padding around the cell - * renderer when laying out and painting the "selected" item in the - * combo box. BasicComboBoxUI uses a single combo box renderer for rendering - * both the main combo box item and also all the items in the dropdown - * for the combo box. padding allows you to specify addition insets in - * addition to those specified by the cell renderer. + * If specified, these insets act as padding around the cell renderer when + * laying out and painting the "selected" item in the combo box. These + * insets add to those specified by the cell renderer. + * + * @since 1.7 */ - private Insets padding; + protected Insets padding; // Used for calculating the default size. private static ListCellRenderer getDefaultListCellRenderer() { @@ -345,7 +345,7 @@ public class BasicComboBoxUI extends ComboBoxUI { } /** - * Create and install the listeners for the combo box and its model. + * Creates and installs listeners for the combo box and its model. * This method is called when the UI is installed. */ protected void installListeners() { @@ -379,8 +379,8 @@ public class BasicComboBoxUI extends ComboBoxUI { } /** - * Uninstalls the default colors, default font, default renderer, and default - * editor into the JComboBox. + * Uninstalls the default colors, default font, default renderer, + * and default editor from the combo box. */ protected void uninstallDefaults() { LookAndFeel.installColorsAndFont( comboBox, @@ -391,7 +391,7 @@ public class BasicComboBoxUI extends ComboBoxUI { } /** - * Remove the installed listeners from the combo box and its model. + * Removes the installed listeners from the combo box and its model. * The number and types of listeners removed and in this method should be * the same that was added in installListeners */ @@ -839,7 +839,7 @@ public class BasicComboBoxUI extends ComboBoxUI { } /** - * Creates an button which will be used as the control to show or hide + * Creates a button which will be used as the control to show or hide * the popup portion of the combo box. * * @return a button which represents the popup control @@ -1392,12 +1392,17 @@ public class BasicComboBoxUI extends ComboBoxUI { } /** - * This has been refactored out in hopes that it may be investigated and - * simplified for the next major release. adding/removing - * the component to the currentValuePane and changing the font may be - * redundant operations. + * Returns the size a component would have if used as a cell renderer. + * + * @param comp a {@code Component} to check + * @return size of the component + * @since 1.7 */ - private Dimension getSizeForComponent(Component comp) { + protected Dimension getSizeForComponent(Component comp) { + // This has been refactored out in hopes that it may be investigated and + // simplified for the next major release. adding/removing + // the component to the currentValuePane and changing the font may be + // redundant operations. currentValuePane.add(comp); comp.setFont(comboBox.getFont()); Dimension d = comp.getPreferredSize(); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java index 2e663fb8449..c7a6bc33ce1 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java @@ -141,11 +141,10 @@ public class BasicLabelUI extends LabelUI implements PropertyChangeListener } /** - * Paint the label text in the foreground color, if the label - * is opaque then paint the entire background with the background - * color. The Label text is drawn by paintEnabledText() or - * paintDisabledText(). The locations of the label parts are computed - * by layoutCL. + * Paints the label text with the foreground color, if the label is opaque + * then paints the entire background with the background color. The Label + * text is drawn by {@link #paintEnabledText} or {@link #paintDisabledText}. + * The locations of the label parts are computed by {@link #layoutCL}. * * @see #paintEnabledText * @see #paintDisabledText diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java index 1d3ee7b3509..f28ff0445a8 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicListUI.java @@ -685,7 +685,7 @@ public class BasicListUI extends ListUI /** - * Create and install the listeners for the JList, its model, and its + * Creates and installs the listeners for the JList, its model, and its * selectionModel. This method is called at installUI() time. * * @see #installUI @@ -728,7 +728,7 @@ public class BasicListUI extends ListUI /** - * Remove the listeners for the JList, its model, and its + * Removes the listeners from the JList, its model, and its * selectionModel. All of the listener fields, are reset to * null here. This method is called at uninstallUI() time, * it should be kept in sync with installListeners. @@ -764,8 +764,8 @@ public class BasicListUI extends ListUI /** - * Initialize JList properties, e.g. font, foreground, and background, - * and add the CellRendererPane. The font, foreground, and background + * Initializes list properties such as font, foreground, and background, + * and adds the CellRendererPane. The font, foreground, and background * properties are only set if their current value is either null * or a UIResource, other properties are set if the current * value is null. @@ -820,9 +820,9 @@ public class BasicListUI extends ListUI /** - * Set the JList properties that haven't been explicitly overridden to - * null. A property is considered overridden if its current value - * is not a UIResource. + * Sets the list properties that have not been explicitly overridden to + * {@code null}. A property is considered overridden if its current value + * is not a {@code UIResource}. * * @see #installDefaults * @see #uninstallUI diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java index 61c70c9bb0b..899c88bd428 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java @@ -32,7 +32,6 @@ import java.beans.PropertyChangeListener; import javax.swing.*; import javax.swing.event.*; -import javax.swing.border.*; import javax.swing.plaf.*; import javax.swing.text.View; @@ -54,7 +53,12 @@ public class BasicMenuItemUI extends MenuItemUI protected Color disabledForeground; protected Color acceleratorForeground; protected Color acceleratorSelectionForeground; - private String acceleratorDelimiter; + + /** + * Accelerator delimiter string, such as {@code '+'} in {@code 'Ctrl+C'}. + * @since 1.7 + */ + protected String acceleratorDelimiter; protected int defaultTextIconGap; protected Font acceleratorFont; diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java index b22a58795e6..2b006568f73 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java @@ -93,10 +93,13 @@ public class BasicScrollBarUI * scrollbar. */ private boolean supportsAbsolutePositioning; - /** Hint as to what width (when vertical) or height (when horizontal) + /** + * Hint as to what width (when vertical) or height (when horizontal) * should be. + * + * @since 1.7 */ - private int scrollBarWidth; + protected int scrollBarWidth; private Handler handler; @@ -117,18 +120,18 @@ public class BasicScrollBarUI * number. If negative, then an overlap between the button and track will occur, * which is useful for shaped buttons. * - * TODO This should be made protected in a feature release + * @since 1.7 */ - private int incrGap; + protected int incrGap; /** * Distance between the decrement button and the track. This may be a negative * number. If negative, then an overlap between the button and track will occur, * which is useful for shaped buttons. * - * TODO This should be made protected in a feature release + * @since 1.7 */ - private int decrGap; + protected int decrGap; static void loadActionMap(LazyActionMap map) { map.put(new Actions(Actions.POSITIVE_UNIT_INCREMENT)); @@ -586,7 +589,7 @@ public class BasicScrollBarUI /** - * Return the smallest acceptable size for the thumb. If the scrollbar + * Returns the smallest acceptable size for the thumb. If the scrollbar * becomes so small that this size isn't available, the thumb will be * hidden. *

      @@ -601,7 +604,7 @@ public class BasicScrollBarUI } /** - * Return the largest acceptable size for the thumb. To create a fixed + * Returns the largest acceptable size for the thumb. To create a fixed * size thumb one make this method and getMinimumThumbSize * return the same value. *

      diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java index 02bb547d318..b43249e5b7a 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java @@ -169,15 +169,13 @@ public class BasicSliderUI extends SliderUI{ + c + " when it only knows about " + slider + "."); - LookAndFeel.uninstallBorder(slider); - scrollTimer.stop(); scrollTimer = null; + uninstallDefaults(slider); uninstallListeners( slider ); uninstallKeyboardActions(slider); - focusInsets = null; insetCache = null; leftToRightCache = true; focusRect = null; @@ -210,6 +208,12 @@ public class BasicSliderUI extends SliderUI{ if (focusInsets == null) focusInsets = new InsetsUIResource(2,2,2,2); } + protected void uninstallDefaults(JSlider slider) { + LookAndFeel.uninstallBorder(slider); + + focusInsets = null; + } + protected TrackListener createTrackListener(JSlider slider) { return new TrackListener(); } @@ -1409,9 +1413,10 @@ public class BasicSliderUI extends SliderUI{ } /** - * Returns a value give a y position. If yPos is past the track at the top or the - * bottom it will set the value to the min or max of the slider, depending if the - * slider is inverted or not. + * Returns the value at the y position. If {@code yPos} is beyond the + * track at the the bottom or the top, this method sets the value to either + * the minimum or maximum value of the slider, depending on if the slider + * is inverted or not. */ public int valueForYPosition( int yPos ) { int value; @@ -1440,9 +1445,10 @@ public class BasicSliderUI extends SliderUI{ } /** - * Returns a value give an x position. If xPos is past the track at the left or the - * right it will set the value to the min or max of the slider, depending if the - * slider is inverted or not. + * Returns the value at the x position. If {@code xPos} is beyond the + * track at the left or the right, this method sets the value to either the + * minimum or maximum value of the slider, depending on if the slider is + * inverted or not. */ public int valueForXPosition( int xPos ) { int value; @@ -1569,20 +1575,8 @@ public class BasicSliderUI extends SliderUI{ offset = 0; scrollTimer.stop(); - // This is the way we have to determine snap-to-ticks. It's - // hard to explain but since ChangeEvents don't give us any - // idea what has changed we don't have a way to stop the thumb - // bounds from being recalculated. Recalculating the thumb - // bounds moves the thumb over the current value (i.e., snapping - // to the ticks). - if (slider.getSnapToTicks() /*|| slider.getSnapToValue()*/ ) { - isDragging = false; - slider.setValueIsAdjusting(false); - } - else { - slider.setValueIsAdjusting(false); - isDragging = false; - } + isDragging = false; + slider.setValueIsAdjusting(false); slider.repaint(); } diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java index 3a522317741..201c9e9313d 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java @@ -268,7 +268,7 @@ public class BasicSpinnerUI extends SpinnerUI } /** - * Create a LayoutManager that manages the editor, + * Creates a LayoutManager that manages the editor, * nextButton, and previousButton * children of the JSpinner. These three children must be * added with a constraint that identifies their role: @@ -286,7 +286,7 @@ public class BasicSpinnerUI extends SpinnerUI /** - * Create a PropertyChangeListener that can be + * Creates a PropertyChangeListener that can be * added to the JSpinner itself. Typically, this listener * will call replaceEditor when the "editor" property changes, * since it's the SpinnerUI's responsibility to @@ -302,16 +302,13 @@ public class BasicSpinnerUI extends SpinnerUI /** - * Create a component that will replace the spinner models value - * with the object returned by spinner.getPreviousValue. - * By default the previousButton is a JButton. This - * method invokes installPreviousButtonListeners to - * install the necessary listeners to update the JSpinner's - * model in response to a user gesture. If a previousButton isn't needed - * (in a subclass) then override this method to return null. + * Creates a decrement button, i.e. component that replaces the spinner + * value with the object returned by spinner.getPreviousValue. + * By default the previousButton is a {@code JButton}. If the + * decrement button is not needed this method should return {@code null}. * - * @return a component that will replace the spinners model with the - * next value in the sequence, or null + * @return a component that will replace the spinner's value with the + * previous value in the sequence, or {@code null} * @see #installUI * @see #createNextButton * @see #installPreviousButtonListeners @@ -325,15 +322,13 @@ public class BasicSpinnerUI extends SpinnerUI /** - * Create a component that will replace the spinner models value - * with the object returned by spinner.getNextValue. - * By default the nextButton is a JButton - * who's ActionListener updates it's JSpinner - * ancestors model. If a nextButton isn't needed (in a subclass) - * then override this method to return null. + * Creates an increment button, i.e. component that replaces the spinner + * value with the object returned by spinner.getNextValue. + * By default the nextButton is a {@code JButton}. If the + * increment button is not needed this method should return {@code null}. * - * @return a component that will replace the spinners model with the - * next value in the sequence, or null + * @return a component that will replace the spinner's value with the + * next value in the sequence, or {@code null} * @see #installUI * @see #createPreviousButton * @see #installNextButtonListeners diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java index 0be46948712..9d15ba91850 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java @@ -829,7 +829,7 @@ public class BasicSplitPaneUI extends SplitPaneUI /** * Returns the default non continuous layout divider, which is an - * instanceof Canvas that fills the background in dark gray. + * instance of {@code Canvas} that fills in the background with dark gray. */ protected Component createDefaultNonContinuousLayoutDivider() { return new Canvas() { @@ -1041,11 +1041,11 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * Messaged after the JSplitPane the receiver is providing the look - * and feel for paints its children. + * Called when the specified split pane has finished painting + * its children. */ - public void finishedPaintingChildren(JSplitPane jc, Graphics g) { - if(jc == splitPane && getLastDragLocation() != -1 && + public void finishedPaintingChildren(JSplitPane sp, Graphics g) { + if(sp == splitPane && getLastDragLocation() != -1 && !isContinuousLayout() && !draggingHW) { Dimension size = splitPane.getSize(); @@ -1062,7 +1062,7 @@ public class BasicSplitPaneUI extends SplitPaneUI /** - * Messaged to paint the look and feel. + * @inheritDoc */ public void paint(Graphics g, JComponent jc) { if (!painted && splitPane.getDividerLocation()<0) { diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java index de4700faf06..a29a7fb1314 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java @@ -306,7 +306,7 @@ public class BasicTableHeaderUI extends TableHeaderUI { } /** - * Initialize JTableHeader properties, e.g. font, foreground, and background. + * Initializes JTableHeader properties such as font, foreground, and background. * The font, foreground, and background properties are only set if their * current value is either null or a UIResource, other properties are set * if the current value is null. @@ -403,9 +403,9 @@ public class BasicTableHeaderUI extends TableHeaderUI { } /** - * This method gets called every time the rollover column in the table - * header is updated. Every look and feel supporting rollover effect - * in table header should override this method and repaint the header. + * This method gets called every time when a rollover column in the table + * header is updated. Every look and feel that supports a rollover effect + * in a table header should override this method and repaint the header. * * @param oldColumn the index of the previous rollover column or -1 if the * mouse was not over a column @@ -736,7 +736,6 @@ public class BasicTableHeaderUI extends TableHeaderUI { } private Dimension createHeaderSize(long width) { - TableColumnModel columnModel = header.getColumnModel(); // None of the callers include the intercell spacing, do it here. if (width > Integer.MAX_VALUE) { width = Integer.MAX_VALUE; diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java index cef9166355f..0a035fc4636 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java @@ -37,6 +37,7 @@ import javax.swing.text.*; import javax.swing.event.*; import javax.swing.border.Border; import javax.swing.plaf.UIResource; +import javax.swing.plaf.synth.SynthUI; import sun.swing.DefaultLookup; import sun.awt.AppContext; import javax.swing.plaf.basic.DragRecognitionSupport.BeforeDrag; @@ -221,8 +222,7 @@ public abstract class BasicTextUI extends TextUI implements ViewFactory { // is ==, which is the case for the windows look and feel. // Until an appropriate solution is found, the code is being // reverted to what it was before the original fix. - if (this instanceof sun.swing.plaf.synth.SynthUI || - (c instanceof JTextArea)) { + if (this instanceof SynthUI || (c instanceof JTextArea)) { return; } Color background = c.getBackground(); @@ -289,7 +289,7 @@ public abstract class BasicTextUI extends TextUI implements ViewFactory { protected abstract String getPropertyPrefix(); /** - * Initializes component properties, e.g. font, foreground, + * Initializes component properties, such as font, foreground, * background, caret color, selection color, selected text color, * disabled text color, and border color. The font, foreground, and * background properties are only set if their current value is either null @@ -377,9 +377,9 @@ public abstract class BasicTextUI extends TextUI implements ViewFactory { } /** - * Sets the component properties that haven't been explicitly overridden to - * null. A property is considered overridden if its current value - * is not a UIResource. + * Sets the component properties that have not been explicitly overridden + * to {@code null}. A property is considered overridden if its current + * value is not a {@code UIResource}. * * @see #installDefaults * @see #uninstallUI @@ -756,18 +756,18 @@ public abstract class BasicTextUI extends TextUI implements ViewFactory { * things. *

        *
      1. - * Set the associated component to opaque (can be changed + * Sets the associated component to opaque (can be changed * easily by a subclass or on JTextComponent directly), * which is the most common case. This will cause the * component's background color to be painted. *
      2. - * Install the default caret and highlighter into the + * Installs the default caret and highlighter into the * associated component. *
      3. - * Attach to the editor and model. If there is no + * Attaches to the editor and model. If there is no * model, a default one is created. *
      4. - * create the view factory and the view hierarchy used + * Creates the view factory and the view hierarchy used * to represent the model. *
      * @@ -784,7 +784,7 @@ public abstract class BasicTextUI extends TextUI implements ViewFactory { // This is a workaround as these should not override what synth has // set them to - if (!(this instanceof sun.swing.plaf.synth.SynthUI)){ + if (! (this instanceof SynthUI)) { // common case is background painted... this can // easily be changed by subclasses or from outside // of the component. @@ -857,9 +857,9 @@ public abstract class BasicTextUI extends TextUI implements ViewFactory { * To prevent this from happening twice, this method is * reimplemented to simply paint. *

      - * NOTE: Superclass is also not thread-safe in - * it's rendering of the background, although that's not - * an issue with the default rendering. + * NOTE: NOTE: Superclass is also not thread-safe in its + * rendering of the background, although that is not an issue with the + * default rendering. */ public void update(Graphics g, JComponent c) { paint(g, c); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java index 0eafa7e3b6b..dd29df81b68 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java @@ -669,7 +669,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants /** * Sets the border of the component to have a rollover border which - * was created by createRolloverBorder. + * was created by the {@link #createRolloverBorder} method. * * @param c component which will have a rollover border installed * @see #createRolloverBorder @@ -709,7 +709,7 @@ public class BasicToolBarUI extends ToolBarUI implements SwingConstants /** * Sets the border of the component to have a non-rollover border which - * was created by createNonRolloverBorder. + * was created by the {@link #createNonRolloverBorder} method. * * @param c component which will have a non-rollover border installed * @see #createNonRolloverBorder diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java index 22fa61f00dc..0679db798f7 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java @@ -30,16 +30,12 @@ import javax.swing.event.*; import java.awt.*; import java.awt.event.*; import java.awt.datatransfer.*; -import java.awt.dnd.*; import java.beans.*; -import java.io.*; import java.util.Enumeration; import java.util.Hashtable; -import java.util.TooManyListenersException; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; -import javax.swing.plaf.ActionMapUIResource; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.UIResource; import javax.swing.plaf.TreeUI; @@ -1244,11 +1240,26 @@ public class BasicTreeUI extends TreeUI drawingCache.clear(); } - private boolean isDropLine(JTree.DropLocation loc) { + /** + * Tells if a {@code DropLocation} should be indicated by a line between + * nodes. This is meant for {@code javax.swing.DropMode.INSERT} and + * {@code javax.swing.DropMode.ON_OR_INSERT} drop modes. + * + * @param loc a {@code DropLocation} + * @return {@code true} if the drop location should be shown as a line + * @since 1.7 + */ + protected boolean isDropLine(JTree.DropLocation loc) { return loc != null && loc.getPath() != null && loc.getChildIndex() != -1; } - private void paintDropLine(Graphics g) { + /** + * Paints the drop line. + * + * @param g {@code Graphics} object to draw on + * @since 1.7 + */ + protected void paintDropLine(Graphics g) { JTree.DropLocation loc = tree.getDropLocation(); if (!isDropLine(loc)) { return; @@ -1262,7 +1273,14 @@ public class BasicTreeUI extends TreeUI } } - private Rectangle getDropLineRect(JTree.DropLocation loc) { + /** + * Returns a ubounding box for the drop line. + * + * @param loc a {@code DropLocation} + * @return bounding box for the drop line + * @since 1.7 + */ + protected Rectangle getDropLineRect(JTree.DropLocation loc) { Rectangle rect; TreePath path = loc.getPath(); int index = loc.getChildIndex(); @@ -1684,7 +1702,7 @@ public class BasicTreeUI extends TreeUI treeState.setExpandedState(path, true); } } - updateLeadRow(); + updateLeadSelectionRow(); updateSize(); } } @@ -2425,11 +2443,21 @@ public class BasicTreeUI extends TreeUI return tree.getLeadSelectionPath(); } - private void updateLeadRow() { + /** + * Updates the lead row of the selection. + * @since 1.7 + */ + protected void updateLeadSelectionRow() { leadRow = getRowForPath(tree, getLeadSelectionPath()); } - private int getLeadSelectionRow() { + /** + * Returns the lead row of the selection. + * + * @return selection lead row + * @since 1.7 + */ + protected int getLeadSelectionRow() { return leadRow; } @@ -3345,7 +3373,7 @@ public class BasicTreeUI extends TreeUI if (changeName == JTree.LEAD_SELECTION_PATH_PROPERTY) { if (!ignoreLAChange) { - updateLeadRow(); + updateLeadSelectionRow(); repaintPath((TreePath)event.getOldValue()); repaintPath((TreePath)event.getNewValue()); } @@ -3763,7 +3791,7 @@ public class BasicTreeUI extends TreeUI completeEditing(); if(path != null && tree.isVisible(path)) { treeState.setExpandedState(path, false); - updateLeadRow(); + updateLeadSelectionRow(); updateSize(); } } @@ -3823,7 +3851,7 @@ public class BasicTreeUI extends TreeUI if(treeState != null && e != null) { treeState.treeNodesInserted(e); - updateLeadRow(); + updateLeadSelectionRow(); TreePath path = e.getTreePath(); @@ -3848,7 +3876,7 @@ public class BasicTreeUI extends TreeUI if(treeState != null && e != null) { treeState.treeNodesRemoved(e); - updateLeadRow(); + updateLeadSelectionRow(); TreePath path = e.getTreePath(); @@ -3862,7 +3890,7 @@ public class BasicTreeUI extends TreeUI if(treeState != null && e != null) { treeState.treeStructureChanged(e); - updateLeadRow(); + updateLeadSelectionRow(); TreePath pPath = e.getTreePath(); diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/DefaultMenuLayout.java b/jdk/src/share/classes/javax/swing/plaf/basic/DefaultMenuLayout.java index 5acae97eded..f0e925876e2 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/DefaultMenuLayout.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/DefaultMenuLayout.java @@ -34,7 +34,7 @@ import java.awt.Dimension; /** * The default layout manager for Popup menus and menubars. This * class is an extension of BoxLayout which adds the UIResource tag - * so that plauggable L&Fs can distinguish it from user-installed + * so that pluggable L&Fs can distinguish it from user-installed * layout managers on menus. * * @author Georges Saab diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template b/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template index caff0b212a0..10894b5f047 100644 --- a/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template +++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/Defaults.template @@ -90,6 +90,10 @@ final class ${LAF_NAME}Defaults { */ private Map registeredRegions = new HashMap(); + + private Map> overridesCache = + new WeakHashMap>(); + /** * Our fallback style to avoid NPEs if the proper style cannot be found in * this class. Not sure if relying on DefaultSynthStyle is the best choice. @@ -251,7 +255,11 @@ ${UI_DEFAULT_INIT} } //return the style, if found, or the default style if not found - return foundStyle == null ? defaultStyle : foundStyle.getStyle(comp); + return foundStyle == null ? defaultStyle : foundStyle.getStyle(comp, r); + } + + public void clearOverridesCache(JComponent c) { + overridesCache.remove(c); } /* @@ -457,15 +465,6 @@ ${UI_DEFAULT_INIT} * Cached shared style. */ private NimbusStyle style; - /** - * A weakly referenced hash map such that if the reference JComponent - * key is garbage collected then the entry is removed from the map. - * This cache exists so that when a JComponent has nimbus overrides - * in its client map, a unique style will be created and returned - * for that JComponent instance, always. In such a situation each - * JComponent instance must have its own instance of NimbusStyle. - */ - private WeakHashMap> overridesCache; /** * Create a new LazyStyle. @@ -513,17 +512,21 @@ ${UI_DEFAULT_INIT} * Gets the style. Creates it if necessary. * @return the style */ - SynthStyle getStyle(JComponent c) { + SynthStyle getStyle(JComponent c, Region r) { // if the component has overrides, it gets its own unique style // instead of the shared style. if (c.getClientProperty("Nimbus.Overrides") != null) { - if (overridesCache == null) - overridesCache = new WeakHashMap>(); - WeakReference ref = overridesCache.get(c); - NimbusStyle s = ref == null ? null : ref.get(); + Map map = overridesCache.get(c); + SynthStyle s = null; + if (map == null) { + map = new HashMap(); + overridesCache.put(c, map); + } else { + s = map.get(r); + } if (s == null) { s = new NimbusStyle(prefix, c); - overridesCache.put(c, new WeakReference(s)); + map.put(r, s); } return s; } diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusLookAndFeel.java index 3f100bc811b..883727ae65f 100644 --- a/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusLookAndFeel.java +++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusLookAndFeel.java @@ -257,12 +257,44 @@ public class NimbusLookAndFeel extends SynthLookAndFeel { /** * @inheritDoc - * @return true + * @return {@code true} */ @Override public boolean shouldUpdateStyleOnAncestorChanged() { return true; } + /** + * @inheritDoc + * + *

      Overridden to return {@code true} when one of the following + * properties change: + *

        + *
      • {@code "Nimbus.Overrides"} + *
      • {@code "Nimbus.Overrides.InheritDefaults"} + *
      • {@code "JComponent.sizeVariant"} + *
      + * + * @since 1.7 + */ + @Override + protected boolean shouldUpdateStyleOnEvent(PropertyChangeEvent ev) { + String eName = ev.getPropertyName(); + + // These properties affect style cached inside NimbusDefaults (6860433) + if ("name" == eName || + "ancestor" == eName || + "Nimbus.Overrides" == eName || + "Nimbus.Overrides.InheritDefaults" == eName || + "JComponent.sizeVariant" == eName) { + + JComponent c = (JComponent) ev.getSource(); + defaults.clearOverridesCache(c); + return true; + } + + return super.shouldUpdateStyleOnEvent(ev); + } + /** *

      Registers a third party component with the NimbusLookAndFeel.

      * diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/package.html b/jdk/src/share/classes/javax/swing/plaf/nimbus/package.html index 4453cc163fe..bac256c2667 100644 --- a/jdk/src/share/classes/javax/swing/plaf/nimbus/package.html +++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/package.html @@ -88,12 +88,11 @@ encouraged.

      Note: Most of the Swing API is not thread safe. For details, see -Threads and Swing, +Concurrency in Swing, a section in The Java Tutorial. + target="_top">The Java Tutorial. @since 1.7 @serial exclude diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthBorder.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthBorder.java index 0d3fc851f05..96b7c23c02c 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthBorder.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthBorder.java @@ -29,7 +29,6 @@ import javax.swing.*; import javax.swing.text.JTextComponent; import javax.swing.border.*; import javax.swing.plaf.UIResource; -import sun.swing.plaf.synth.SynthUI; /** * SynthBorder is a border that delegates to a Painter. The Insets diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthButtonUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthButtonUI.java index c395f54eb41..dfa358475cb 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthButtonUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthButtonUI.java @@ -25,40 +25,49 @@ package javax.swing.plaf.synth; -import java.awt.*; -import java.awt.event.*; -import java.io.Serializable; import javax.swing.*; -import javax.swing.border.*; import java.awt.*; -import java.awt.event.*; import java.beans.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.BasicButtonUI; import javax.swing.plaf.basic.BasicHTML; import javax.swing.text.View; -import sun.swing.plaf.synth.SynthUI; -import sun.swing.plaf.synth.DefaultSynthStyle; /** - * Synth's ButtonUI implementation. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JButton}. * * @author Scott Violet + * @since 1.7 */ -class SynthButtonUI extends BasicButtonUI implements +public class SynthButtonUI extends BasicButtonUI implements PropertyChangeListener, SynthUI { private SynthStyle style; + /** + * Creates a new UI object for the given component. + * + * @param c component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent c) { return new SynthButtonUI(); } + /** + * @inheritDoc + */ + @Override protected void installDefaults(AbstractButton b) { updateStyle(b); LookAndFeel.installProperty(b, "rolloverEnabled", Boolean.TRUE); } + /** + * @inheritDoc + */ + @Override protected void installListeners(AbstractButton b) { super.installListeners(b); b.addPropertyChangeListener(this); @@ -99,11 +108,19 @@ class SynthButtonUI extends BasicButtonUI implements context.dispose(); } + /** + * @inheritDoc + */ + @Override protected void uninstallListeners(AbstractButton b) { super.uninstallListeners(b); b.removePropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults(AbstractButton b) { SynthContext context = getContext(b, ENABLED); @@ -112,20 +129,20 @@ class SynthButtonUI extends BasicButtonUI implements style = null; } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { return getContext(c, getComponentState(c)); } SynthContext getContext(JComponent c, int state) { - Region region = getRegion(c); + Region region = SynthLookAndFeel.getRegion(c); return SynthContext.getContext(SynthContext.class, c, region, style, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - /** * Returns the current state of the passed in AbstractButton. */ @@ -164,6 +181,10 @@ class SynthButtonUI extends BasicButtonUI implements return state; } + /** + * @inheritDoc + */ + @Override public int getBaseline(JComponent c, int width, int height) { if (c == null) { throw new NullPointerException("Component must be non-null"); @@ -215,6 +236,19 @@ class SynthButtonUI extends BasicButtonUI implements // Paint Methods // ******************************** + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -224,6 +258,16 @@ class SynthButtonUI extends BasicButtonUI implements context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -231,6 +275,13 @@ class SynthButtonUI extends BasicButtonUI implements context.dispose(); } + /** + * Paints the specified component. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { AbstractButton b = (AbstractButton)context.getComponent(); @@ -253,19 +304,22 @@ class SynthButtonUI extends BasicButtonUI implements } } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintButtonBorder(context, g, x, y, w, h); } /** - * Returns the default icon. This should NOT callback + * Returns the default icon. This should not callback * to the JComponent. * - * @param b AbstractButton the icon is associated with + * @param b button the icon is associated with * @return default icon */ - protected Icon getDefaultIcon(AbstractButton b) { SynthContext context = getContext(b); Icon icon = context.getStyle().getIcon(context, getPropertyPrefix() + "icon"); @@ -274,7 +328,11 @@ class SynthButtonUI extends BasicButtonUI implements } /** - * Returns the Icon to use in painting the button. + * Returns the Icon to use for painting the button. The icon is chosen with + * respect to the current state of the button. + * + * @param b button the icon is associated with + * @return an icon */ protected Icon getIcon(AbstractButton b) { Icon icon = b.getIcon(); @@ -374,7 +432,7 @@ class SynthButtonUI extends BasicButtonUI implements /** * Returns the amount to shift the text/icon when painting. */ - protected int getTextShiftOffset(SynthContext state) { + private int getTextShiftOffset(SynthContext state) { AbstractButton button = (AbstractButton)state.getComponent(); ButtonModel model = button.getModel(); @@ -389,6 +447,11 @@ class SynthButtonUI extends BasicButtonUI implements // ******************************** // Layout Methods // ******************************** + + /** + * @inheritDoc + */ + @Override public Dimension getMinimumSize(JComponent c) { if (c.getComponentCount() > 0 && c.getLayout() != null) { return null; @@ -406,6 +469,10 @@ class SynthButtonUI extends BasicButtonUI implements return size; } + /** + * @inheritDoc + */ + @Override public Dimension getPreferredSize(JComponent c) { if (c.getComponentCount() > 0 && c.getLayout() != null) { return null; @@ -423,6 +490,10 @@ class SynthButtonUI extends BasicButtonUI implements return size; } + /** + * @inheritDoc + */ + @Override public Dimension getMaximumSize(JComponent c) { if (c.getComponentCount() > 0 && c.getLayout() != null) { return null; @@ -442,7 +513,8 @@ class SynthButtonUI extends BasicButtonUI implements } /** - * Returns the Icon used in calculating the pref/min/max size. + * Returns the Icon used in calculating the + * preferred/minimum/maximum size. */ protected Icon getSizingIcon(AbstractButton b) { Icon icon = getEnabledIcon(b, b.getIcon()); @@ -452,6 +524,10 @@ class SynthButtonUI extends BasicButtonUI implements return icon; } + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent e) { if (SynthLookAndFeel.shouldUpdateStyle(e)) { updateStyle((AbstractButton)e.getSource()); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthCheckBoxMenuItemUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthCheckBoxMenuItemUI.java index c440bfcd0b1..6601adfaeb9 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthCheckBoxMenuItemUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthCheckBoxMenuItemUI.java @@ -27,56 +27,50 @@ package javax.swing.plaf.synth; import java.awt.*; -import java.awt.event.*; import javax.swing.*; import javax.swing.plaf.*; -import javax.swing.border.*; -import java.io.Serializable; /** - * Synth's CheckBoxMenuItemUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JCheckBoxMenuItem}. * * @author Leif Samuelsson * @author Georges Saab * @author David Karlton * @author Arnaud Weber + * @since 1.7 */ -class SynthCheckBoxMenuItemUI extends SynthMenuItemUI { +public class SynthCheckBoxMenuItemUI extends SynthMenuItemUI { + /** + * Creates a new UI object for the given component. + * + * @param c component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent c) { return new SynthCheckBoxMenuItemUI(); } + /** + * @inheritDoc + */ + @Override protected String getPropertyPrefix() { return "CheckBoxMenuItem"; } - public void processMouseEvent(JMenuItem item, MouseEvent e, - MenuElement path[], MenuSelectionManager manager) { - Point p = e.getPoint(); - if (p.x >= 0 && p.x < item.getWidth() && p.y >= 0 && p.y < item.getHeight()) { - if (e.getID() == MouseEvent.MOUSE_RELEASED) { - manager.clearSelectedPath(); - item.doClick(0); - } else { - manager.setSelectedPath(path); - } - } else if (item.getModel().isArmed()) { - int c = path.length - 1; - MenuElement newPath[] = new MenuElement[c]; - for (int i = 0; i < c; i++) { - newPath[i] = path[i]; - } - manager.setSelectedPath(newPath); - } - } - + @Override void paintBackground(SynthContext context, Graphics g, JComponent c) { context.getPainter().paintCheckBoxMenuItemBackground(context, g, 0, 0, c.getWidth(), c.getHeight()); } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintCheckBoxMenuItemBorder(context, g, x, y, w, h); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthCheckBoxUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthCheckBoxUI.java index 15fae42629f..7794fd601f7 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthCheckBoxUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthCheckBoxUI.java @@ -25,36 +25,51 @@ package javax.swing.plaf.synth; -import javax.swing.*; -import java.awt.*; -import java.awt.event.*; -import javax.swing.plaf.*; -import java.io.Serializable; +import javax.swing.JComponent; +import java.awt.Graphics; +import javax.swing.plaf.ComponentUI; /** - * Synth's CheckBoxUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JCheckBox}. * * @author Jeff Dinkins + * @since 1.7 */ -class SynthCheckBoxUI extends SynthRadioButtonUI { +public class SynthCheckBoxUI extends SynthRadioButtonUI { // ******************************** // Create PLAF // ******************************** + /** + * Creates a new UI object for the given component. + * + * @param b component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent b) { return new SynthCheckBoxUI(); } + /** + * @inheritDoc + */ + @Override protected String getPropertyPrefix() { return "CheckBox."; } + @Override void paintBackground(SynthContext context, Graphics g, JComponent c) { context.getPainter().paintCheckBoxBackground(context, g, 0, 0, c.getWidth(), c.getHeight()); } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintCheckBoxBorder(context, g, x, y, w, h); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthColorChooserUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthColorChooserUI.java index 8a8dbf63220..e430ce6345e 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthColorChooserUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthColorChooserUI.java @@ -28,34 +28,39 @@ package javax.swing.plaf.synth; import javax.swing.*; import javax.swing.colorchooser.*; -import javax.swing.event.*; -import javax.swing.border.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.BasicColorChooserUI; -import java.util.*; import java.awt.*; -import java.awt.image.*; -import java.awt.event.*; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; -import java.io.Serializable; -import sun.swing.plaf.synth.SynthUI; /** - * Synth's ColorChooserUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JColorChooser}. * * @author Tom Santos * @author Steve Wilson + * @since 1.7 */ -class SynthColorChooserUI extends BasicColorChooserUI implements +public class SynthColorChooserUI extends BasicColorChooserUI implements PropertyChangeListener, SynthUI { private SynthStyle style; + /** + * Creates a new UI object for the given component. + * + * @param c component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent c) { return new SynthColorChooserUI(); } + /** + * @inheritDoc + */ + @Override protected AbstractColorChooserPanel[] createDefaultChoosers() { SynthContext context = getContext(chooser, ENABLED); AbstractColorChooserPanel[] panels = (AbstractColorChooserPanel[]) @@ -68,6 +73,10 @@ class SynthColorChooserUI extends BasicColorChooserUI implements return panels; } + /** + * @inheritDoc + */ + @Override protected void installDefaults() { super.installDefaults(); updateStyle(chooser); @@ -79,6 +88,10 @@ class SynthColorChooserUI extends BasicColorChooserUI implements context.dispose(); } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults() { SynthContext context = getContext(chooser, ENABLED); @@ -88,16 +101,28 @@ class SynthColorChooserUI extends BasicColorChooserUI implements super.uninstallDefaults(); } + /** + * @inheritDoc + */ + @Override protected void installListeners() { super.installListeners(); chooser.addPropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override protected void uninstallListeners() { chooser.removePropertyChangeListener(this); super.uninstallListeners(); } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { return getContext(c, getComponentState(c)); } @@ -107,14 +132,23 @@ class SynthColorChooserUI extends BasicColorChooserUI implements SynthLookAndFeel.getRegion(c), style, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - private int getComponentState(JComponent c) { return SynthLookAndFeel.getComponentState(c); } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -125,6 +159,16 @@ class SynthColorChooserUI extends BasicColorChooserUI implements context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -132,14 +176,30 @@ class SynthColorChooserUI extends BasicColorChooserUI implements context.dispose(); } + /** + * Paints the specified component. + * This implementation does not perform any actions. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintColorChooserBorder(context, g, x, y,w,h); } + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent e) { if (SynthLookAndFeel.shouldUpdateStyle(e)) { updateStyle((JColorChooser)e.getSource()); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java index 7687a0d7bcb..038c5ad644e 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java @@ -27,21 +27,21 @@ package javax.swing.plaf.synth; import java.awt.*; import java.awt.event.*; -import java.lang.reflect.*; import javax.swing.*; import javax.swing.plaf.*; import javax.swing.event.*; import javax.swing.plaf.basic.*; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; -import sun.swing.plaf.synth.SynthUI; /** - * Synth's ComboBoxUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JComboBox}. * * @author Scott Violet + * @since 1.7 */ -class SynthComboBoxUI extends BasicComboBoxUI implements +public class SynthComboBoxUI extends BasicComboBoxUI implements PropertyChangeListener, SynthUI { private SynthStyle style; private boolean useListColors; @@ -93,12 +93,11 @@ class SynthComboBoxUI extends BasicComboBoxUI implements private boolean forceOpaque = false; /** - * NOTE: This serves the same purpose as the same field in BasicComboBoxUI. - * It is here because I could not give the padding field in - * BasicComboBoxUI protected access in an update release. + * Creates a new UI object for the given component. + * + * @param c component to create UI object for + * @return the UI object */ - private Insets padding; - public static ComponentUI createUI(JComponent c) { return new SynthComboBoxUI(); } @@ -118,21 +117,6 @@ class SynthComboBoxUI extends BasicComboBoxUI implements @Override protected void installDefaults() { - //NOTE: This next line of code was added because, since squareButton in - //BasicComboBoxUI is private, I need to have some way of reading it from UIManager. - //This is an incomplete solution (since it implies that squareButons, - //once set, cannot be reset per state. Probably ok, but not always ok). - //This line of code should be removed at the same time that squareButton - //is made protected in the super class. - super.installDefaults(); - - //This is here instead of in updateStyle because the value for padding - //needs to remain consistent with the value for padding in - //BasicComboBoxUI. I wouldn't have this value here at all if not - //for the fact that I cannot make "padding" protected in any way - //for an update release. This *should* be fixed in Java 7 - padding = UIManager.getInsets("ComboBox.padding"); - updateStyle(comboBox); } @@ -142,6 +126,7 @@ class SynthComboBoxUI extends BasicComboBoxUI implements style = SynthLookAndFeel.updateStyle(context, this); if (style != oldStyle) { + padding = (Insets) style.get(context, "ComboBox.padding"); popupInsets = (Insets)style.get(context, "ComboBox.popupInsets"); useListColors = style.getBoolean(context, "ComboBox.rendererUseListColors", true); @@ -149,6 +134,8 @@ class SynthComboBoxUI extends BasicComboBoxUI implements "ComboBox.buttonWhenNotEditable", false); pressedWhenPopupVisible = style.getBoolean(context, "ComboBox.pressedWhenPopupVisible", false); + squareButton = style.getBoolean(context, + "ComboBox.squareButton", true); if (oldStyle != null) { uninstallKeyboardActions(); @@ -164,6 +151,9 @@ class SynthComboBoxUI extends BasicComboBoxUI implements } } + /** + * @inheritDoc + */ @Override protected void installListeners() { comboBox.addPropertyChangeListener(this); @@ -172,6 +162,9 @@ class SynthComboBoxUI extends BasicComboBoxUI implements super.installListeners(); } + /** + * @inheritDoc + */ @Override public void uninstallUI(JComponent c) { if (popup instanceof SynthComboPopup) { @@ -181,6 +174,9 @@ class SynthComboBoxUI extends BasicComboBoxUI implements buttonHandler = null; } + /** + * @inheritDoc + */ @Override protected void uninstallDefaults() { SynthContext context = getContext(comboBox, ENABLED); @@ -190,6 +186,9 @@ class SynthComboBoxUI extends BasicComboBoxUI implements style = null; } + /** + * @inheritDoc + */ @Override protected void uninstallListeners() { editorFocusHandler.unregister(); @@ -200,6 +199,9 @@ class SynthComboBoxUI extends BasicComboBoxUI implements super.uninstallListeners(); } + /** + * @inheritDoc + */ @Override public SynthContext getContext(JComponent c) { return getContext(c, getComponentState(c)); @@ -210,10 +212,6 @@ class SynthComboBoxUI extends BasicComboBoxUI implements SynthLookAndFeel.getRegion(c), style, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - private int getComponentState(JComponent c) { // currently we have a broken situation where if a developer // takes the border from a JComboBox and sets it on a JTextField @@ -252,6 +250,9 @@ class SynthComboBoxUI extends BasicComboBoxUI implements } } + /** + * @inheritDoc + */ @Override protected ComboPopup createPopup() { SynthComboPopup p = new SynthComboPopup(comboBox); @@ -259,11 +260,17 @@ class SynthComboBoxUI extends BasicComboBoxUI implements return p; } + /** + * @inheritDoc + */ @Override protected ListCellRenderer createRenderer() { return new SynthComboBoxRenderer(); } + /** + * @inheritDoc + */ @Override protected ComboBoxEditor createEditor() { return new SynthComboBoxEditor(); @@ -273,6 +280,9 @@ class SynthComboBoxUI extends BasicComboBoxUI implements // end UI Initialization //====================== + /** + * @inheritDoc + */ @Override public void propertyChange(PropertyChangeEvent e) { if (SynthLookAndFeel.shouldUpdateStyle(e)) { @@ -280,6 +290,9 @@ class SynthComboBoxUI extends BasicComboBoxUI implements } } + /** + * @inheritDoc + */ @Override protected JButton createArrowButton() { SynthArrowButton button = new SynthArrowButton(SwingConstants.SOUTH); @@ -291,6 +304,18 @@ class SynthComboBoxUI extends BasicComboBoxUI implements //================================= // begin ComponentUI Implementation + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -302,6 +327,15 @@ class SynthComboBoxUI extends BasicComboBoxUI implements context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -310,6 +344,13 @@ class SynthComboBoxUI extends BasicComboBoxUI implements context.dispose(); } + /** + * Paints the specified component. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { hasFocus = comboBox.hasFocus(); if ( !comboBox.isEditable() ) { @@ -318,6 +359,9 @@ class SynthComboBoxUI extends BasicComboBoxUI implements } } + /** + * @inheritDoc + */ @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { @@ -375,7 +419,7 @@ class SynthComboBoxUI extends BasicComboBoxUI implements } /** - * Return the default size of an empty display area of the combo box using + * Returns the default size of an empty display area of the combo box using * the current renderer and font. * * This method was overridden to use SynthComboBoxRenderer instead of @@ -393,23 +437,6 @@ class SynthComboBoxUI extends BasicComboBoxUI implements return new Dimension(d.width, d.height); } - /** - * This has been refactored out in hopes that it may be investigated and - * simplified for the next major release. adding/removing - * the component to the currentValuePane and changing the font may be - * redundant operations. - * - * NOTE: This method was copied in its entirety from BasicComboBoxUI. Might - * want to make it protected in BasicComboBoxUI in Java 7 - */ - private Dimension getSizeForComponent(Component comp) { - currentValuePane.add(comp); - comp.setFont(comboBox.getFont()); - Dimension d = comp.getPreferredSize(); - currentValuePane.remove(comp); - return d; - } - /** * From BasicComboBoxRenderer v 1.18. * @@ -478,85 +505,17 @@ class SynthComboBoxUI extends BasicComboBoxUI implements } - /** - * From BasicCombBoxEditor v 1.24. - */ - private static class SynthComboBoxEditor implements - ComboBoxEditor, UIResource { - protected JTextField editor; - private Object oldValue; + private static class SynthComboBoxEditor + extends BasicComboBoxEditor.UIResource { - public SynthComboBoxEditor() { - editor = new JTextField("",9); - editor.setName("ComboBox.textField"); - } - - @Override - public Component getEditorComponent() { - return editor; - } - - /** - * Sets the item that should be edited. - * - * @param anObject the displayed value of the editor - */ - @Override - public void setItem(Object anObject) { - String text; - - if ( anObject != null ) { - text = anObject.toString(); - oldValue = anObject; - } else { - text = ""; - } - // workaround for 4530952 - if (!text.equals(editor.getText())) { - editor.setText(text); - } - } - - @Override - public Object getItem() { - Object newValue = editor.getText(); - - if (oldValue != null && !(oldValue instanceof String)) { - // The original value is not a string. Should return the value in it's - // original type. - if (newValue.equals(oldValue.toString())) { - return oldValue; - } else { - // Must take the value from the editor and get the value and cast it to the new type. - Class cls = oldValue.getClass(); - try { - Method method = cls.getMethod("valueOf", new Class[]{String.class}); - newValue = method.invoke(oldValue, new Object[] { editor.getText()}); - } catch (Exception ex) { - // Fail silently and return the newValue (a String object) - } - } - } - return newValue; - } - - @Override - public void selectAll() { - editor.selectAll(); - editor.requestFocus(); - } - - @Override - public void addActionListener(ActionListener l) { - editor.addActionListener(l); - } - - @Override - public void removeActionListener(ActionListener l) { - editor.removeActionListener(l); + @Override public JTextField createEditorComponent() { + JTextField f = new JTextField("", 9); + f.setName("ComboBox.textField"); + return f; } } + /** * Handles all the logic for treating the combo as a button when it is * not editable, and when shouldActLikeButton() is true. This class is a @@ -620,7 +579,7 @@ class SynthComboBoxUI extends BasicComboBoxUI implements //------------------------------------------------------------------ /** - * {@inheritDoc} + * @inheritDoc * * Ensures that isPressed() will return true if the combo is pressed, * or the arrowButton is pressed, or if the combo popup is @@ -634,7 +593,7 @@ class SynthComboBoxUI extends BasicComboBoxUI implements } /** - * {@inheritDoc} + * @inheritDoc * * Ensures that the armed state is in sync with the pressed state * if shouldActLikeButton is true. Without this method, the arrow @@ -649,7 +608,7 @@ class SynthComboBoxUI extends BasicComboBoxUI implements } /** - * {@inheritDoc} + * @inheritDoc * * Ensures that isRollover() will return true if the combo is * rolled over, or the arrowButton is rolled over. @@ -660,7 +619,7 @@ class SynthComboBoxUI extends BasicComboBoxUI implements } /** - * {@inheritDoc} + * @inheritDoc * * Forwards pressed states to the internal "pressed" field */ @@ -671,7 +630,7 @@ class SynthComboBoxUI extends BasicComboBoxUI implements } /** - * {@inheritDoc} + * @inheritDoc * * Forwards rollover states to the internal "over" field */ diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthDefaultLookup.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthDefaultLookup.java index 34ad3f0049d..e87f70efcce 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthDefaultLookup.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthDefaultLookup.java @@ -27,7 +27,6 @@ package javax.swing.plaf.synth; import sun.swing.DefaultLookup; import javax.swing.JComponent; import javax.swing.plaf.ComponentUI; -import sun.swing.plaf.synth.SynthUI; /** * SynthDefaultLookup redirects all lookup calls to the SynthContext. diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopIconUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopIconUI.java index 333a68ae76a..91bd34c7f69 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopIconUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopIconUI.java @@ -28,36 +28,44 @@ package javax.swing.plaf.synth; import java.awt.*; import java.awt.event.*; import javax.swing.*; -import javax.swing.event.*; -import javax.swing.border.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.BasicDesktopIconUI; import java.beans.*; -import java.io.Serializable; -import sun.swing.plaf.synth.SynthUI; /** - * Synth L&F for a minimized window on a desktop. + * Provides the Synth L&F UI delegate for a minimized internal frame on a desktop. * * @author Joshua Outwater + * @since 1.7 */ -class SynthDesktopIconUI extends BasicDesktopIconUI implements SynthUI, - ActionListener, PropertyChangeListener { +public class SynthDesktopIconUI extends BasicDesktopIconUI + implements SynthUI, PropertyChangeListener { private SynthStyle style; + private Handler handler = new Handler(); + /** + * Creates a new UI object for the given component. + * + * @param c component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent c) { return new SynthDesktopIconUI(); } + /** + * @inheritDoc + */ + @Override protected void installComponents() { if (UIManager.getBoolean("InternalFrame.useTaskBar")) { iconPane = new JToggleButton(frame.getTitle(), frame.getFrameIcon()) { - public String getToolTipText() { + @Override public String getToolTipText() { return getText(); } - public JPopupMenu getComponentPopupMenu() { + @Override public JPopupMenu getComponentPopupMenu() { return frame.getComponentPopupMenu(); } }; @@ -73,24 +81,37 @@ class SynthDesktopIconUI extends BasicDesktopIconUI implements SynthUI, desktopIcon.add(iconPane, BorderLayout.CENTER); } + /** + * @inheritDoc + */ + @Override protected void installListeners() { super.installListeners(); desktopIcon.addPropertyChangeListener(this); if (iconPane instanceof JToggleButton) { frame.addPropertyChangeListener(this); - ((JToggleButton)iconPane).addActionListener(this); + ((JToggleButton)iconPane).addActionListener(handler); } } + /** + * @inheritDoc + */ + @Override protected void uninstallListeners() { if (iconPane instanceof JToggleButton) { + ((JToggleButton)iconPane).removeActionListener(handler); frame.removePropertyChangeListener(this); } desktopIcon.removePropertyChangeListener(this); super.uninstallListeners(); } + /** + * @inheritDoc + */ + @Override protected void installDefaults() { updateStyle(desktopIcon); } @@ -101,6 +122,10 @@ class SynthDesktopIconUI extends BasicDesktopIconUI implements SynthUI, context.dispose(); } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults() { SynthContext context = getContext(desktopIcon, ENABLED); style.uninstallDefaults(context); @@ -108,12 +133,16 @@ class SynthDesktopIconUI extends BasicDesktopIconUI implements SynthUI, style = null; } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { return getContext(c, getComponentState(c)); } private SynthContext getContext(JComponent c, int state) { - Region region = getRegion(c); + Region region = SynthLookAndFeel.getRegion(c); return SynthContext.getContext(SynthContext.class, c, region, style, state); } @@ -122,10 +151,19 @@ class SynthDesktopIconUI extends BasicDesktopIconUI implements SynthUI, return SynthLookAndFeel.getComponentState(c); } - Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -136,6 +174,16 @@ class SynthDesktopIconUI extends BasicDesktopIconUI implements SynthUI, context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -143,33 +191,25 @@ class SynthDesktopIconUI extends BasicDesktopIconUI implements SynthUI, context.dispose(); } + /** + * Paints the specified component. This implementation does nothing. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintDesktopIconBorder(context, g, x, y, w, h); } - public void actionPerformed(ActionEvent evt) { - if (evt.getSource() instanceof JToggleButton) { - // Either iconify the frame or deiconify and activate it. - JToggleButton button = (JToggleButton)evt.getSource(); - try { - boolean selected = button.isSelected(); - if (!selected && !frame.isIconifiable()) { - button.setSelected(true); - } else { - frame.setIcon(!selected); - if (selected) { - frame.setSelected(true); - } - } - } catch (PropertyVetoException e2) { - } - } - } - public void propertyChange(PropertyChangeEvent evt) { if (evt.getSource() instanceof JInternalFrame.JDesktopIcon) { if (SynthLookAndFeel.shouldUpdateStyle(evt)) { @@ -191,4 +231,25 @@ class SynthDesktopIconUI extends BasicDesktopIconUI implements SynthUI, } } } + + private final class Handler implements ActionListener { + public void actionPerformed(ActionEvent evt) { + if (evt.getSource() instanceof JToggleButton) { + // Either iconify the frame or deiconify and activate it. + JToggleButton button = (JToggleButton)evt.getSource(); + try { + boolean selected = button.isSelected(); + if (!selected && !frame.isIconifiable()) { + button.setSelected(true); + } else { + frame.setIcon(!selected); + if (selected) { + frame.setSelected(true); + } + } + } catch (PropertyVetoException e2) { + } + } + } + } } diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java index b793f2b380f..fce28bc8dfc 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java @@ -29,34 +29,38 @@ import javax.swing.*; import javax.swing.border.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.BasicDesktopPaneUI; - import java.beans.*; - import java.awt.event.*; -import java.awt.Dimension; -import java.awt.Insets; -import java.awt.Graphics; -import java.awt.KeyboardFocusManager; import java.awt.*; -import java.util.Vector; -import sun.swing.plaf.synth.SynthUI; /** - * Synth L&F for a desktop. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JDesktopPane}. * * @author Joshua Outwater * @author Steve Wilson + * @since 1.7 */ -class SynthDesktopPaneUI extends BasicDesktopPaneUI implements +public class SynthDesktopPaneUI extends BasicDesktopPaneUI implements PropertyChangeListener, SynthUI { private SynthStyle style; private TaskBar taskBar; private DesktopManager oldDesktopManager; + /** + * Creates a new UI object for the given component. + * + * @param c component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent c) { return new SynthDesktopPaneUI(); } + /** + * @inheritDoc + */ + @Override protected void installListeners() { super.installListeners(); desktop.addPropertyChangeListener(this); @@ -68,6 +72,10 @@ class SynthDesktopPaneUI extends BasicDesktopPaneUI implements } } + /** + * @inheritDoc + */ + @Override protected void installDefaults() { updateStyle(desktop); @@ -114,6 +122,10 @@ class SynthDesktopPaneUI extends BasicDesktopPaneUI implements context.dispose(); } + /** + * @inheritDoc + */ + @Override protected void uninstallListeners() { if (taskBar != null) { desktop.removeComponentListener(taskBar); @@ -123,6 +135,10 @@ class SynthDesktopPaneUI extends BasicDesktopPaneUI implements super.uninstallListeners(); } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults() { SynthContext context = getContext(desktop, ENABLED); @@ -147,6 +163,10 @@ class SynthDesktopPaneUI extends BasicDesktopPaneUI implements } } + /** + * @inheritDoc + */ + @Override protected void installDesktopManager() { if (UIManager.getBoolean("InternalFrame.useTaskBar")) { desktopManager = oldDesktopManager = desktop.getDesktopManager(); @@ -159,6 +179,10 @@ class SynthDesktopPaneUI extends BasicDesktopPaneUI implements } } + /** + * @inheritDoc + */ + @Override protected void uninstallDesktopManager() { if (oldDesktopManager != null && !(oldDesktopManager instanceof UIResource)) { desktopManager = desktop.getDesktopManager(); @@ -397,7 +421,10 @@ class SynthDesktopPaneUI extends BasicDesktopPaneUI implements } } - + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { return getContext(c, getComponentState(c)); } @@ -407,14 +434,23 @@ class SynthDesktopPaneUI extends BasicDesktopPaneUI implements SynthLookAndFeel.getRegion(c), style, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - private int getComponentState(JComponent c) { return SynthLookAndFeel.getComponentState(c); } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -425,6 +461,16 @@ class SynthDesktopPaneUI extends BasicDesktopPaneUI implements context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -432,14 +478,29 @@ class SynthDesktopPaneUI extends BasicDesktopPaneUI implements context.dispose(); } + /** + * Paints the specified component. This implementation does nothing. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintDesktopPaneBorder(context, g, x, y, w, h); } + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent evt) { if (SynthLookAndFeel.shouldUpdateStyle(evt)) { updateStyle((JDesktopPane)evt.getSource()); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthEditorPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthEditorPaneUI.java index e864944fad5..68c3b40970f 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthEditorPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthEditorPaneUI.java @@ -31,47 +31,52 @@ import javax.swing.text.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.BasicEditorPaneUI; import java.beans.PropertyChangeEvent; -import sun.swing.plaf.synth.SynthUI; /** - * Provides the look and feel for a JEditorPane in the - * Synth look and feel. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JEditorPane}. * * @author Shannon Hickey + * @since 1.7 */ -class SynthEditorPaneUI extends BasicEditorPaneUI implements SynthUI { +public class SynthEditorPaneUI extends BasicEditorPaneUI implements SynthUI { private SynthStyle style; /* * I would prefer to use UIResource instad of this. * Unfortunately Boolean is a final class */ private Boolean localTrue = Boolean.TRUE; - private Boolean localFalse = Boolean.FALSE; /** - * Creates a UI for the JTextPane. + * Creates a new UI object for the given component. * - * @param c the JTextPane component - * @return the UI + * @param c component to create UI object for + * @return the UI object */ public static ComponentUI createUI(JComponent c) { return new SynthEditorPaneUI(); } + /** + * @inheritDoc + */ + @Override protected void installDefaults() { // Installs the text cursor on the component super.installDefaults(); JComponent c = getComponent(); Object clientProperty = c.getClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES); - if (clientProperty == null - || clientProperty == localFalse) { - c.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, - localTrue); + if (clientProperty == null) { + c.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, localTrue); } updateStyle(getComponent()); } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults() { SynthContext context = getContext(getComponent(), ENABLED); JComponent c = getComponent(); @@ -84,7 +89,7 @@ class SynthEditorPaneUI extends BasicEditorPaneUI implements SynthUI { Object clientProperty = c.getClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES); if (clientProperty == localTrue) { - getComponent().putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, + c.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.FALSE); } super.uninstallDefaults(); @@ -100,6 +105,7 @@ class SynthEditorPaneUI extends BasicEditorPaneUI implements SynthUI { * * @param evt the property change event */ + @Override protected void propertyChange(PropertyChangeEvent evt) { if (SynthLookAndFeel.shouldUpdateStyle(evt)) { updateStyle((JTextComponent)evt.getSource()); @@ -124,6 +130,10 @@ class SynthEditorPaneUI extends BasicEditorPaneUI implements SynthUI { context.dispose(); } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { return getContext(c, getComponentState(c)); } @@ -137,6 +147,19 @@ class SynthEditorPaneUI extends BasicEditorPaneUI implements SynthUI { return SynthLookAndFeel.getComponentState(c); } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -146,10 +169,21 @@ class SynthEditorPaneUI extends BasicEditorPaneUI implements SynthUI { context.dispose(); } + /** + * Paints the specified component. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { super.paint(g, getComponent()); } + /** + * @inheritDoc + */ + @Override protected void paintBackground(Graphics g) { // Overriden to do nothing, all our painting is done from update/paint. } @@ -159,6 +193,10 @@ class SynthEditorPaneUI extends BasicEditorPaneUI implements SynthUI { c.getWidth(), c.getHeight()); } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintEditorPaneBorder(context, g, x, y, w, h); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthFormattedTextFieldUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthFormattedTextFieldUI.java index 6d0204d27ad..6ea91e7bf3c 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthFormattedTextFieldUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthFormattedTextFieldUI.java @@ -24,16 +24,17 @@ */ package javax.swing.plaf.synth; -import java.awt.*; -import javax.swing.*; +import java.awt.Graphics; +import javax.swing.JComponent; import javax.swing.plaf.ComponentUI; /** - * Provides the look and feel implementation for - * JFormattedTextField. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JFormattedTextField}. * + * @since 1.7 */ -class SynthFormattedTextFieldUI extends SynthTextFieldUI { +public class SynthFormattedTextFieldUI extends SynthTextFieldUI { /** * Creates a UI for a JFormattedTextField. * @@ -51,15 +52,24 @@ class SynthFormattedTextFieldUI extends SynthTextFieldUI { * * @return the name "FormattedTextField" */ + @Override protected String getPropertyPrefix() { return "FormattedTextField"; } + /** + * @inheritDoc + */ + @Override void paintBackground(SynthContext context, Graphics g, JComponent c) { context.getPainter().paintFormattedTextFieldBackground(context, g, 0, 0, c.getWidth(), c.getHeight()); } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintFormattedTextFieldBorder(context, g, x, y, diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameTitlePane.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameTitlePane.java index 51e9d1497d6..d0fe4acb764 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameTitlePane.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameTitlePane.java @@ -30,14 +30,9 @@ import java.awt.event.*; import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.BasicInternalFrameTitlePane; -import javax.swing.border.*; -import javax.swing.event.InternalFrameEvent; -import java.util.EventListener; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; -import java.beans.VetoableChangeListener; import java.beans.PropertyVetoException; -import sun.swing.plaf.synth.SynthUI; import sun.swing.SwingUtilities2; /** diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameUI.java index a89fba5e8eb..28625a666cc 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthInternalFrameUI.java @@ -27,52 +27,61 @@ package javax.swing.plaf.synth; import java.awt.*; import java.awt.event.*; -import java.awt.peer.LightweightPeer; - import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.BasicInternalFrameUI; -import javax.swing.event.*; - import java.beans.*; -import java.io.Serializable; -import sun.swing.plaf.synth.SynthUI; /** - * Synth's InternalFrameUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JInternalFrame}. * * @author David Kloba * @author Joshua Outwater * @author Rich Schiavi + * @since 1.7 */ -class SynthInternalFrameUI extends BasicInternalFrameUI implements SynthUI, - PropertyChangeListener { +public class SynthInternalFrameUI extends BasicInternalFrameUI + implements SynthUI, PropertyChangeListener { private SynthStyle style; - private static DesktopManager sharedDesktopManager; - private boolean componentListenerAdded = false; - - private Rectangle parentBounds; - + /** + * Creates a new UI object for the given component. + * + * @param b component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent b) { return new SynthInternalFrameUI((JInternalFrame)b); } - public SynthInternalFrameUI(JInternalFrame b) { + protected SynthInternalFrameUI(JInternalFrame b) { super(b); } + /** + * @inheritDoc + */ + @Override public void installDefaults() { frame.setLayout(internalFrameLayout = createLayoutManager()); updateStyle(frame); } + /** + * @inheritDoc + */ + @Override protected void installListeners() { super.installListeners(); frame.addPropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override protected void uninstallComponents() { if (frame.getComponentPopupMenu() instanceof UIResource) { frame.setComponentPopupMenu(null); @@ -80,6 +89,10 @@ class SynthInternalFrameUI extends BasicInternalFrameUI implements SynthUI, super.uninstallComponents(); } + /** + * @inheritDoc + */ + @Override protected void uninstallListeners() { frame.removePropertyChangeListener(this); super.uninstallListeners(); @@ -104,6 +117,10 @@ class SynthInternalFrameUI extends BasicInternalFrameUI implements SynthUI, context.dispose(); } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults() { SynthContext context = getContext(frame, ENABLED); style.uninstallDefaults(context); @@ -115,6 +132,10 @@ class SynthInternalFrameUI extends BasicInternalFrameUI implements SynthUI, } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { return getContext(c, getComponentState(c)); } @@ -124,24 +145,28 @@ class SynthInternalFrameUI extends BasicInternalFrameUI implements SynthUI, SynthLookAndFeel.getRegion(c), style, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - - public int getComponentState(JComponent c) { + private int getComponentState(JComponent c) { return SynthLookAndFeel.getComponentState(c); } + /** + * @inheritDoc + */ + @Override protected JComponent createNorthPane(JInternalFrame w) { titlePane = new SynthInternalFrameTitlePane(w); titlePane.setName("InternalFrame.northPane"); return titlePane; } + /** + * @inheritDoc + */ + @Override protected ComponentListener createComponentListener() { if (UIManager.getBoolean("InternalFrame.useTaskBar")) { return new ComponentHandler() { - public void componentResized(ComponentEvent e) { + @Override public void componentResized(ComponentEvent e) { if (frame != null && frame.isMaximum()) { JDesktopPane desktop = (JDesktopPane)e.getSource(); for (Component comp : desktop.getComponents()) { @@ -168,6 +193,19 @@ class SynthInternalFrameUI extends BasicInternalFrameUI implements SynthUI, } } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -178,6 +216,16 @@ class SynthInternalFrameUI extends BasicInternalFrameUI implements SynthUI, context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -185,15 +233,30 @@ class SynthInternalFrameUI extends BasicInternalFrameUI implements SynthUI, context.dispose(); } + /** + * Paints the specified component. This implementation does nothing. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintInternalFrameBorder(context, g, x, y, w, h); } + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent evt) { SynthStyle oldStyle = style; JInternalFrame f = (JInternalFrame)evt.getSource(); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthLabelUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthLabelUI.java index f46f4d261f1..e39bf41c1bc 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthLabelUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthLabelUI.java @@ -29,38 +29,37 @@ import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; import javax.swing.text.View; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.Component; -import java.awt.Container; import java.awt.Dimension; import java.awt.Rectangle; import java.awt.Insets; -import java.awt.Color; import java.awt.Graphics; -import java.awt.Font; import java.awt.FontMetrics; import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import sun.swing.plaf.synth.SynthUI; /** - * Synth's LabelUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JLabel}. * * @author Scott Violet + * @since 1.7 */ -class SynthLabelUI extends BasicLabelUI implements SynthUI { +public class SynthLabelUI extends BasicLabelUI implements SynthUI { private SynthStyle style; /** * Returns the LabelUI implementation used for the skins look and feel. + * + * @param c component to create UI object for + * @return the UI object */ public static ComponentUI createUI(JComponent c){ return new SynthLabelUI(); } - + /** + * @inheritDoc + */ + @Override protected void installDefaults(JLabel c) { updateStyle(c); } @@ -71,6 +70,10 @@ class SynthLabelUI extends BasicLabelUI implements SynthUI { context.dispose(); } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults(JLabel c){ SynthContext context = getContext(c, ENABLED); @@ -79,6 +82,10 @@ class SynthLabelUI extends BasicLabelUI implements SynthUI { style = null; } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { return getContext(c, getComponentState(c)); } @@ -88,10 +95,6 @@ class SynthLabelUI extends BasicLabelUI implements SynthUI { SynthLookAndFeel.getRegion(c), style, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - private int getComponentState(JComponent c) { int state = SynthLookAndFeel.getComponentState(c); if (SynthLookAndFeel.selectedUI == this && @@ -101,6 +104,10 @@ class SynthLabelUI extends BasicLabelUI implements SynthUI { return state; } + /** + * @inheritDoc + */ + @Override public int getBaseline(JComponent c, int width, int height) { if (c == null) { throw new NullPointerException("Component must be non-null"); @@ -149,10 +156,18 @@ class SynthLabelUI extends BasicLabelUI implements SynthUI { } /** - * Notifies this UI delegate that it's time to paint the specified - * component. This method is invoked by JComponent - * when the specified component is being painted. + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -163,6 +178,16 @@ class SynthLabelUI extends BasicLabelUI implements SynthUI { context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -170,6 +195,13 @@ class SynthLabelUI extends BasicLabelUI implements SynthUI { context.dispose(); } + /** + * Paints the specified component. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { JLabel label = (JLabel)context.getComponent(); Icon icon = (label.isEnabled()) ? label.getIcon() : @@ -185,11 +217,19 @@ class SynthLabelUI extends BasicLabelUI implements SynthUI { label.getIconTextGap(), label.getDisplayedMnemonicIndex(), 0); } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintLabelBorder(context, g, x, y, w, h); } + /** + * @inheritDoc + */ + @Override public Dimension getPreferredSize(JComponent c) { JLabel label = (JLabel)c; Icon icon = (label.isEnabled()) ? label.getIcon() : @@ -207,7 +247,10 @@ class SynthLabelUI extends BasicLabelUI implements SynthUI { return size; } - + /** + * @inheritDoc + */ + @Override public Dimension getMinimumSize(JComponent c) { JLabel label = (JLabel)c; Icon icon = (label.isEnabled()) ? label.getIcon() : @@ -225,6 +268,10 @@ class SynthLabelUI extends BasicLabelUI implements SynthUI { return size; } + /** + * @inheritDoc + */ + @Override public Dimension getMaximumSize(JComponent c) { JLabel label = (JLabel)c; Icon icon = (label.isEnabled()) ? label.getIcon() : @@ -242,7 +289,10 @@ class SynthLabelUI extends BasicLabelUI implements SynthUI { return size; } - + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent e) { super.propertyChange(e); if (SynthLookAndFeel.shouldUpdateStyle(e)) { diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthListUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthListUI.java index 09907613f3f..dbfdbdad54a 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthListUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthListUI.java @@ -27,38 +27,48 @@ package javax.swing.plaf.synth; import javax.swing.*; import javax.swing.border.*; -import javax.swing.event.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; -import javax.swing.text.Position; - import java.awt.*; -import java.awt.event.*; -import java.awt.datatransfer.Transferable; -import java.awt.dnd.*; - -import java.util.ArrayList; -import java.util.TooManyListenersException; - import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; -import sun.swing.plaf.synth.SynthUI; /** - * Synth's ListUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JList}. * * @author Scott Violet + * @since 1.7 */ -class SynthListUI extends BasicListUI implements PropertyChangeListener, - SynthUI { +public class SynthListUI extends BasicListUI + implements PropertyChangeListener, SynthUI { private SynthStyle style; private boolean useListColors; private boolean useUIBorder; + /** + * Creates a new UI object for the given component. + * + * @param list component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent list) { return new SynthListUI(); } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -69,27 +79,47 @@ class SynthListUI extends BasicListUI implements PropertyChangeListener, paint(g, c); } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintListBorder(context, g, x, y, w, h); } + /** + * @inheritDoc + */ + @Override protected void installListeners() { super.installListeners(); list.addPropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent e) { if (SynthLookAndFeel.shouldUpdateStyle(e)) { updateStyle((JList)e.getSource()); } } + /** + * @inheritDoc + */ + @Override protected void uninstallListeners() { super.uninstallListeners(); list.removePropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override protected void installDefaults() { if (list.getCellRenderer() == null || (list.getCellRenderer() instanceof UIResource)) { @@ -135,6 +165,10 @@ class SynthListUI extends BasicListUI implements PropertyChangeListener, context.dispose(); } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults() { super.uninstallDefaults(); @@ -145,6 +179,10 @@ class SynthListUI extends BasicListUI implements PropertyChangeListener, style = null; } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { return getContext(c, getComponentState(c)); } @@ -154,27 +192,23 @@ class SynthListUI extends BasicListUI implements PropertyChangeListener, SynthLookAndFeel.getRegion(c), style, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - private int getComponentState(JComponent c) { return SynthLookAndFeel.getComponentState(c); } private class SynthListCellRenderer extends DefaultListCellRenderer.UIResource { - public String getName() { + @Override public String getName() { return "List.cellRenderer"; } - public void setBorder(Border b) { + @Override public void setBorder(Border b) { if (useUIBorder || b instanceof SynthBorder) { super.setBorder(b); } } - public Component getListCellRendererComponent(JList list, Object value, + @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { if (!useListColors && (isSelected || cellHasFocus)) { SynthLookAndFeel.setSelectedUI((SynthLabelUI)SynthLookAndFeel. @@ -190,7 +224,7 @@ class SynthListUI extends BasicListUI implements PropertyChangeListener, return this; } - public void paint(Graphics g) { + @Override public void paint(Graphics g) { super.paint(g); SynthLookAndFeel.resetSelectedUI(); } diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java index 976ec0adc66..1db09641cc9 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java @@ -234,44 +234,9 @@ public class SynthLookAndFeel extends BasicLookAndFeel { * shouldUpdateStyleOnAncestorChanged as necessary. */ static boolean shouldUpdateStyle(PropertyChangeEvent event) { - String eName = event.getPropertyName(); - if ("name" == eName) { - // Always update on a name change - return true; - } - else if ("componentOrientation" == eName) { - // Always update on a component orientation change - return true; - } - else if ("ancestor" == eName && event.getNewValue() != null) { - // Only update on an ancestor change when getting a valid - // parent and the LookAndFeel wants this. - LookAndFeel laf = UIManager.getLookAndFeel(); - return (laf instanceof SynthLookAndFeel && - ((SynthLookAndFeel)laf). - shouldUpdateStyleOnAncestorChanged()); - } - // Note: The following two nimbus based overrides should be refactored - // to be in the Nimbus LAF. Due to constraints in an update release, - // we couldn't actually provide the public API necessary to allow - // NimbusLookAndFeel (a subclass of SynthLookAndFeel) to provide its - // own rules for shouldUpdateStyle. - else if ("Nimbus.Overrides" == eName) { - // Always update when the Nimbus.Overrides client property has - // been changed - return true; - } - else if ("Nimbus.Overrides.InheritDefaults" == eName) { - // Always update when the Nimbus.Overrides.InheritDefaults - // client property has changed - return true; - } - else if ("JComponent.sizeVariant" == eName) { - // Always update when the JComponent.sizeVariant - // client property has changed - return true; - } - return false; + LookAndFeel laf = UIManager.getLookAndFeel(); + return (laf instanceof SynthLookAndFeel && + ((SynthLookAndFeel) laf).shouldUpdateStyleOnEvent(event)); } /** @@ -303,12 +268,6 @@ public class SynthLookAndFeel extends BasicLookAndFeel { * @param c Component to update style for. */ public static void updateStyles(Component c) { - _updateStyles(c); - c.repaint(); - } - - // Implementation for updateStyles - private static void _updateStyles(Component c) { if (c instanceof JComponent) { // Yes, this is hacky. A better solution is to get the UI // and cast, but JComponent doesn't expose a getter for the UI @@ -332,6 +291,7 @@ public class SynthLookAndFeel extends BasicLookAndFeel { updateStyles(child); } } + c.repaint(); } /** @@ -788,6 +748,27 @@ public class SynthLookAndFeel extends BasicLookAndFeel { return false; } + /** + * Returns whether or not the UIs should update their styles when a + * particular event occurs. + * + * @param ev a {@code PropertyChangeEvent} + * @return whether or not the UIs should update their styles + * @since 1.7 + */ + protected boolean shouldUpdateStyleOnEvent(PropertyChangeEvent ev) { + String eName = ev.getPropertyName(); + if ("name" == eName || "componentOrientation" == eName) { + return true; + } + if ("ancestor" == eName && ev.getNewValue() != null) { + // Only update on an ancestor change when getting a valid + // parent and the LookAndFeel wants this. + return shouldUpdateStyleOnAncestorChanged(); + } + return false; + } + /** * Returns the antialiasing information as specified by the host desktop. * Antialiasing might be forced off if the desktop is GNOME and the user diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuBarUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuBarUI.java index c7be3f7f445..5ebc827a16c 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuBarUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuBarUI.java @@ -25,45 +25,49 @@ package javax.swing.plaf.synth; import javax.swing.*; -import javax.swing.event.*; -import java.awt.Color; -import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; import java.awt.Graphics; -import java.awt.Insets; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.event.*; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; - -import javax.swing.border.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; -import sun.swing.plaf.synth.SynthUI; /** - * Synth's MenuBarUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JMenuBar}. * * @author Scott Violet + * @since 1.7 */ -class SynthMenuBarUI extends BasicMenuBarUI implements PropertyChangeListener, - SynthUI { +public class SynthMenuBarUI extends BasicMenuBarUI + implements PropertyChangeListener, SynthUI { private SynthStyle style; + /** + * Creates a new UI object for the given component. + * + * @param x component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent x) { return new SynthMenuBarUI(); } + /** + * @inheritDoc + */ + @Override protected void installDefaults() { if (menuBar.getLayout() == null || menuBar.getLayout() instanceof UIResource) { - menuBar.setLayout(new DefaultMenuLayout(menuBar,BoxLayout.LINE_AXIS)); + menuBar.setLayout(new SynthMenuLayout(menuBar,BoxLayout.LINE_AXIS)); } updateStyle(menuBar); } + /** + * @inheritDoc + */ + @Override protected void installListeners() { super.installListeners(); menuBar.addPropertyChangeListener(this); @@ -82,6 +86,10 @@ class SynthMenuBarUI extends BasicMenuBarUI implements PropertyChangeListener, context.dispose(); } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults() { SynthContext context = getContext(menuBar, ENABLED); @@ -90,11 +98,19 @@ class SynthMenuBarUI extends BasicMenuBarUI implements PropertyChangeListener, style = null; } + /** + * @inheritDoc + */ + @Override protected void uninstallListeners() { super.uninstallListeners(); menuBar.removePropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { return getContext(c, getComponentState(c)); } @@ -104,14 +120,23 @@ class SynthMenuBarUI extends BasicMenuBarUI implements PropertyChangeListener, SynthLookAndFeel.getRegion(c), style, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - private int getComponentState(JComponent c) { return SynthLookAndFeel.getComponentState(c); } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -122,6 +147,16 @@ class SynthMenuBarUI extends BasicMenuBarUI implements PropertyChangeListener, context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -129,14 +164,29 @@ class SynthMenuBarUI extends BasicMenuBarUI implements PropertyChangeListener, context.dispose(); } + /** + * Paints the specified component. This implementation does nothing. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintMenuBarBorder(context, g, x, y, w, h); } + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent e) { if (SynthLookAndFeel.shouldUpdateStyle(e)) { updateStyle((JMenuBar)e.getSource()); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuItemUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuItemUI.java index 3bcc044a12e..51b68ff92b4 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuItemUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuItemUI.java @@ -24,41 +24,44 @@ */ package javax.swing.plaf.synth; -import javax.swing.plaf.basic.BasicHTML; import java.awt.*; -import java.awt.event.*; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; - import javax.swing.*; -import javax.swing.event.*; -import javax.swing.border.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; -import javax.swing.text.View; -import sun.swing.plaf.synth.*; import sun.swing.MenuItemLayoutHelper; /** - * Synth's MenuItemUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JMenuItem}. * * @author Georges Saab * @author David Karlton * @author Arnaud Weber * @author Fredrik Lagerblad + * @since 1.7 */ -class SynthMenuItemUI extends BasicMenuItemUI implements +public class SynthMenuItemUI extends BasicMenuItemUI implements PropertyChangeListener, SynthUI { private SynthStyle style; private SynthStyle accStyle; - private String acceleratorDelimiter; - + /** + * Creates a new UI object for the given component. + * + * @param c component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent c) { return new SynthMenuItemUI(); } + /** + * @inheritDoc + */ + @Override public void uninstallUI(JComponent c) { super.uninstallUI(c); // Remove values from the parent's Client Properties. @@ -69,10 +72,18 @@ class SynthMenuItemUI extends BasicMenuItemUI implements } } + /** + * @inheritDoc + */ + @Override protected void installDefaults() { updateStyle(menuItem); } + /** + * @inheritDoc + */ + @Override protected void installListeners() { super.installListeners(); menuItem.addPropertyChangeListener(this); @@ -122,6 +133,10 @@ class SynthMenuItemUI extends BasicMenuItemUI implements accContext.dispose(); } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults() { SynthContext context = getContext(menuItem, ENABLED); style.uninstallDefaults(context); @@ -137,11 +152,19 @@ class SynthMenuItemUI extends BasicMenuItemUI implements super.uninstallDefaults(); } + /** + * @inheritDoc + */ + @Override protected void uninstallListeners() { super.uninstallListeners(); menuItem.removePropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { return getContext(c, getComponentState(c)); } @@ -151,7 +174,7 @@ class SynthMenuItemUI extends BasicMenuItemUI implements SynthLookAndFeel.getRegion(c), style, state); } - public SynthContext getContext(JComponent c, Region region) { + SynthContext getContext(JComponent c, Region region) { return getContext(c, region, getComponentState(c, region)); } @@ -160,10 +183,6 @@ class SynthMenuItemUI extends BasicMenuItemUI implements region, accStyle, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - private int getComponentState(JComponent c) { int state; @@ -186,6 +205,10 @@ class SynthMenuItemUI extends BasicMenuItemUI implements return getComponentState(c); } + /** + * @inheritDoc + */ + @Override protected Dimension getPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, @@ -203,6 +226,19 @@ class SynthMenuItemUI extends BasicMenuItemUI implements } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -212,6 +248,16 @@ class SynthMenuItemUI extends BasicMenuItemUI implements context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -219,6 +265,13 @@ class SynthMenuItemUI extends BasicMenuItemUI implements context.dispose(); } + /** + * Paints the specified component. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { SynthContext accContext = getContext(menuItem, Region.MENU_ITEM_ACCELERATOR); @@ -236,11 +289,19 @@ class SynthMenuItemUI extends BasicMenuItemUI implements SynthGraphicsUtils.paintBackground(context, g, c); } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintMenuItemBorder(context, g, x, y, w, h); } + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent e) { if (SynthLookAndFeel.shouldUpdateStyle(e)) { updateStyle((JMenuItem)e.getSource()); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/DefaultMenuLayout.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuLayout.java similarity index 69% rename from jdk/src/share/classes/javax/swing/plaf/synth/DefaultMenuLayout.java rename to jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuLayout.java index 1757a2e661a..f821c22f4f8 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/DefaultMenuLayout.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuLayout.java @@ -25,44 +25,29 @@ package javax.swing.plaf.synth; -import javax.swing.*; -import javax.swing.plaf.UIResource; - +import javax.swing.plaf.basic.DefaultMenuLayout; +import javax.swing.JPopupMenu; import java.awt.Container; import java.awt.Dimension; /** - * The default layout manager for Popup menus and menubars. This - * class is an extension of BoxLayout which adds the UIResource tag - * so that plauggable L&Fs can distinguish it from user-installed - * layout managers on menus. - * - * Derived from javax.swing.plaf.basic.DefaultMenuLayout + * @inheritDoc * * @author Georges Saab */ -class DefaultMenuLayout extends BoxLayout implements UIResource { - public DefaultMenuLayout(Container target, int axis) { +class SynthMenuLayout extends DefaultMenuLayout { + public SynthMenuLayout(Container target, int axis) { super(target, axis); } public Dimension preferredLayoutSize(Container target) { if (target instanceof JPopupMenu) { JPopupMenu popupMenu = (JPopupMenu) target; - popupMenu.putClientProperty( SynthMenuItemLayoutHelper.MAX_ACC_OR_ARROW_WIDTH, null); - sun.swing.MenuItemLayoutHelper.clearUsedClientProperties(popupMenu); - - if (popupMenu.getComponentCount() == 0) { - return new Dimension(0, 0); - } } - // Make BoxLayout recalculate cached preferred sizes - super.invalidateLayout(target); - return super.preferredLayoutSize(target); } } diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuUI.java index 78835abf141..2f3c2d44704 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthMenuUI.java @@ -25,40 +25,48 @@ package javax.swing.plaf.synth; import java.awt.*; -import java.awt.event.*; import java.beans.*; import javax.swing.*; -import javax.swing.event.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; -import javax.swing.border.*; -import java.util.Arrays; -import java.util.ArrayList; -import sun.swing.plaf.synth.SynthUI; import sun.swing.MenuItemLayoutHelper; /** - * Synth's MenuUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JMenu}. * * @author Georges Saab * @author David Karlton * @author Arnaud Weber + * @since 1.7 */ -class SynthMenuUI extends BasicMenuUI implements PropertyChangeListener, - SynthUI { +public class SynthMenuUI extends BasicMenuUI + implements PropertyChangeListener, SynthUI { private SynthStyle style; private SynthStyle accStyle; - private String acceleratorDelimiter; - + /** + * Creates a new UI object for the given component. + * + * @param x component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent x) { return new SynthMenuUI(); } + /** + * @inheritDoc + */ + @Override protected void installDefaults() { updateStyle(menuItem); } + /** + * @inheritDoc + */ + @Override protected void installListeners() { super.installListeners(); menuItem.addPropertyChangeListener(this); @@ -111,6 +119,10 @@ class SynthMenuUI extends BasicMenuUI implements PropertyChangeListener, accContext.dispose(); } + /** + * @inheritDoc + */ + @Override public void uninstallUI(JComponent c) { super.uninstallUI(c); // Remove values from the parent's Client Properties. @@ -121,6 +133,10 @@ class SynthMenuUI extends BasicMenuUI implements PropertyChangeListener, } } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults() { SynthContext context = getContext(menuItem, ENABLED); style.uninstallDefaults(context); @@ -136,22 +152,30 @@ class SynthMenuUI extends BasicMenuUI implements PropertyChangeListener, super.uninstallDefaults(); } + /** + * @inheritDoc + */ + @Override protected void uninstallListeners() { super.uninstallListeners(); menuItem.removePropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { return getContext(c, getComponentState(c)); } SynthContext getContext(JComponent c, int state) { - Region region = getRegion(c); + Region region = SynthLookAndFeel.getRegion(c); return SynthContext.getContext(SynthContext.class, c, region, style, state); } - public SynthContext getContext(JComponent c, Region region) { + SynthContext getContext(JComponent c, Region region) { return getContext(c, region, getComponentState(c, region)); } @@ -160,10 +184,6 @@ class SynthMenuUI extends BasicMenuUI implements PropertyChangeListener, region, accStyle, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - private int getComponentState(JComponent c) { int state; @@ -186,6 +206,10 @@ class SynthMenuUI extends BasicMenuUI implements PropertyChangeListener, return getComponentState(c); } + /** + * @inheritDoc + */ + @Override protected Dimension getPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, @@ -202,7 +226,19 @@ class SynthMenuUI extends BasicMenuUI implements PropertyChangeListener, return value; } - + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -213,6 +249,16 @@ class SynthMenuUI extends BasicMenuUI implements PropertyChangeListener, context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -220,6 +266,13 @@ class SynthMenuUI extends BasicMenuUI implements PropertyChangeListener, context.dispose(); } + /** + * Paints the specified component. This implementation does nothing. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { SynthContext accContext = getContext(menuItem, Region.MENU_ITEM_ACCELERATOR); @@ -232,11 +285,19 @@ class SynthMenuUI extends BasicMenuUI implements PropertyChangeListener, accContext.dispose(); } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintMenuBorder(context, g, x, y, w, h); } + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent e) { if (SynthLookAndFeel.shouldUpdateStyle(e)) { updateStyle((JMenu)e.getSource()); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthOptionPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthOptionPaneUI.java index eb0512a95ab..abef2bb2239 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthOptionPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthOptionPaneUI.java @@ -28,34 +28,45 @@ package javax.swing.plaf.synth; import java.awt.*; import java.beans.*; import javax.swing.*; -import javax.swing.event.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; import sun.swing.DefaultLookup; -import sun.swing.plaf.synth.SynthUI; /** - * Synth's OptionPaneUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JOptionPane}. * * @author James Gosling * @author Scott Violet * @author Amy Fowler + * @since 1.7 */ -class SynthOptionPaneUI extends BasicOptionPaneUI implements +public class SynthOptionPaneUI extends BasicOptionPaneUI implements PropertyChangeListener, SynthUI { private SynthStyle style; /** - * Creates a new BasicOptionPaneUI instance. - */ + * Creates a new UI object for the given component. + * + * @param x component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent x) { return new SynthOptionPaneUI(); } + /** + * @inheritDoc + */ + @Override protected void installDefaults() { updateStyle(optionPane); } + /** + * @inheritDoc + */ + @Override protected void installListeners() { super.installListeners(); optionPane.addPropertyChangeListener(this); @@ -80,6 +91,10 @@ class SynthOptionPaneUI extends BasicOptionPaneUI implements context.dispose(); } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults() { SynthContext context = getContext(optionPane, ENABLED); @@ -88,11 +103,19 @@ class SynthOptionPaneUI extends BasicOptionPaneUI implements style = null; } + /** + * @inheritDoc + */ + @Override protected void uninstallListeners() { super.uninstallListeners(); optionPane.removePropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override protected void installComponents() { optionPane.add(createMessageArea()); @@ -108,6 +131,10 @@ class SynthOptionPaneUI extends BasicOptionPaneUI implements optionPane.applyComponentOrientation(optionPane.getComponentOrientation()); } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { return getContext(c, getComponentState(c)); } @@ -117,14 +144,23 @@ class SynthOptionPaneUI extends BasicOptionPaneUI implements SynthLookAndFeel.getRegion(c), style, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - private int getComponentState(JComponent c) { return SynthLookAndFeel.getComponentState(c); } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -135,6 +171,16 @@ class SynthOptionPaneUI extends BasicOptionPaneUI implements context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -142,30 +188,50 @@ class SynthOptionPaneUI extends BasicOptionPaneUI implements context.dispose(); } + /** + * Paints the specified component. This implementation does nothing. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintOptionPaneBorder(context, g, x, y, w, h); } + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent e) { if (SynthLookAndFeel.shouldUpdateStyle(e)) { updateStyle((JOptionPane)e.getSource()); } } + /** + * @inheritDoc + */ + @Override protected boolean getSizeButtonsToSameWidth() { return DefaultLookup.getBoolean(optionPane, this, "OptionPane.sameSizeButtons", true); } /** - * Messaged from installComponents to create a Container containing the - * body of the message. The icon is the created by calling - * addIcon. + * Called from {@link #installComponents} to create a {@code Container} + * containing the body of the message. The icon is the created by calling + * {@link #addIcon}. */ + @Override protected Container createMessageArea() { JPanel top = new JPanel(); top.setName("OptionPane.messageArea"); @@ -206,6 +272,10 @@ class SynthOptionPaneUI extends BasicOptionPaneUI implements return top; } + /** + * @inheritDoc + */ + @Override protected Container createSeparator() { JSeparator separator = new JSeparator(SwingConstants.HORIZONTAL); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthPainter.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthPainter.java index 1646bdad62d..aee3979cb55 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthPainter.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthPainter.java @@ -25,7 +25,6 @@ package javax.swing.plaf.synth; import java.awt.*; -import javax.swing.*; /** * SynthPainter is used for painting portions of diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthPanelUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthPanelUI.java index 6979b9be048..8ec19849790 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthPanelUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthPanelUI.java @@ -25,29 +25,37 @@ package javax.swing.plaf.synth; -import java.awt.*; import javax.swing.*; -import javax.swing.border.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.BasicPanelUI; import java.awt.*; -import java.awt.event.*; import java.beans.*; -import sun.swing.plaf.synth.SynthUI; /** - * Synth's PanelUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JPanel}. * * @author Steve Wilson + * @since 1.7 */ -class SynthPanelUI extends BasicPanelUI implements PropertyChangeListener, - SynthUI { +public class SynthPanelUI extends BasicPanelUI + implements PropertyChangeListener, SynthUI { private SynthStyle style; + /** + * Creates a new UI object for the given component. + * + * @param c component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent c) { return new SynthPanelUI(); } + /** + * @inheritDoc + */ + @Override public void installUI(JComponent c) { JPanel p = (JPanel)c; @@ -55,6 +63,10 @@ class SynthPanelUI extends BasicPanelUI implements PropertyChangeListener, installListeners(p); } + /** + * @inheritDoc + */ + @Override public void uninstallUI(JComponent c) { JPanel p = (JPanel)c; @@ -62,18 +74,36 @@ class SynthPanelUI extends BasicPanelUI implements PropertyChangeListener, super.uninstallUI(c); } + /** + * Installs listeners into the panel. + * + * @param p the {@code JPanel} object + */ protected void installListeners(JPanel p) { p.addPropertyChangeListener(this); } + /** + * Uninstalls listeners from the panel. + * + * @param p the {@code JPanel} object + */ protected void uninstallListeners(JPanel p) { p.removePropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override protected void installDefaults(JPanel p) { updateStyle(p); } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults(JPanel p) { SynthContext context = getContext(p, ENABLED); @@ -88,6 +118,10 @@ class SynthPanelUI extends BasicPanelUI implements PropertyChangeListener, context.dispose(); } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { return getContext(c, getComponentState(c)); } @@ -97,14 +131,23 @@ class SynthPanelUI extends BasicPanelUI implements PropertyChangeListener, SynthLookAndFeel.getRegion(c), style, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - private int getComponentState(JComponent c) { return SynthLookAndFeel.getComponentState(c); } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -115,6 +158,16 @@ class SynthPanelUI extends BasicPanelUI implements PropertyChangeListener, context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -122,15 +175,30 @@ class SynthPanelUI extends BasicPanelUI implements PropertyChangeListener, context.dispose(); } + /** + * Paints the specified component. This implementation does nothing. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { // do actual painting } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintPanelBorder(context, g, x, y, w, h); } + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent pce) { if (SynthLookAndFeel.shouldUpdateStyle(pce)) { updateStyle((JPanel)pce.getSource()); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthPasswordFieldUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthPasswordFieldUI.java index 52c7a4d7435..a25457df798 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthPasswordFieldUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthPasswordFieldUI.java @@ -25,21 +25,19 @@ package javax.swing.plaf.synth; -import java.awt.*; +import java.awt.Graphics; import javax.swing.*; import javax.swing.text.*; -import javax.swing.plaf.*; +import javax.swing.plaf.ComponentUI; /** - * Provides the Synth look and feel for a password field. - * The only difference from the standard text field is that - * the view of the text is simply a string of the echo - * character as specified in JPasswordField, rather than the - * real text contained in the field. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JPasswordField}. * * @author Shannon Hickey + * @since 1.7 */ -class SynthPasswordFieldUI extends SynthTextFieldUI { +public class SynthPasswordFieldUI extends SynthTextFieldUI { /** * Creates a UI for a JPasswordField. @@ -58,6 +56,7 @@ class SynthPasswordFieldUI extends SynthTextFieldUI { * * @return the name ("PasswordField") */ + @Override protected String getPropertyPrefix() { return "PasswordField"; } @@ -68,20 +67,33 @@ class SynthPasswordFieldUI extends SynthTextFieldUI { * @param elem the element * @return the view */ + @Override public View create(Element elem) { return new PasswordView(elem); } + /** + * @inheritDoc + */ + @Override void paintBackground(SynthContext context, Graphics g, JComponent c) { context.getPainter().paintPasswordFieldBackground(context, g, 0, 0, c.getWidth(), c.getHeight()); } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintPasswordFieldBorder(context, g, x, y, w, h); } + /** + * @inheritDoc + */ + @Override protected void installKeyboardActions() { super.installKeyboardActions(); ActionMap map = SwingUtilities.getUIActionMap(getComponent()); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthPopupMenuUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthPopupMenuUI.java index 50d1c2781ac..4abaa215a93 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthPopupMenuUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthPopupMenuUI.java @@ -26,49 +26,43 @@ package javax.swing.plaf.synth; import javax.swing.*; -import javax.swing.event.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; -import javax.swing.border.*; - -import java.applet.Applet; - -import java.awt.Component; -import java.awt.Container; -import java.awt.Dimension; import java.awt.Graphics; -import java.awt.KeyboardFocusManager; -import java.awt.Window; -import java.awt.event.*; -import java.awt.AWTEvent; -import java.awt.Toolkit; - import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; -import java.util.*; -import sun.swing.plaf.synth.SynthUI; - /** - * Synth's PopupMenuUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JPopupMenu}. * * @author Georges Saab * @author David Karlton * @author Arnaud Weber + * @since 1.7 */ -class SynthPopupMenuUI extends BasicPopupMenuUI implements - PropertyChangeListener, SynthUI { +public class SynthPopupMenuUI extends BasicPopupMenuUI + implements PropertyChangeListener, SynthUI { private SynthStyle style; + /** + * Creates a new UI object for the given component. + * + * @param x component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent x) { return new SynthPopupMenuUI(); } + /** + * @inheritDoc + */ + @Override public void installDefaults() { if (popupMenu.getLayout() == null || popupMenu.getLayout() instanceof UIResource) { - popupMenu.setLayout(new DefaultMenuLayout( - popupMenu, BoxLayout.Y_AXIS)); + popupMenu.setLayout(new SynthMenuLayout(popupMenu, BoxLayout.Y_AXIS)); } updateStyle(popupMenu); } @@ -86,11 +80,19 @@ class SynthPopupMenuUI extends BasicPopupMenuUI implements context.dispose(); } + /** + * @inheritDoc + */ + @Override protected void installListeners() { super.installListeners(); popupMenu.addPropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults() { SynthContext context = getContext(popupMenu, ENABLED); @@ -103,11 +105,19 @@ class SynthPopupMenuUI extends BasicPopupMenuUI implements } } + /** + * @inheritDoc + */ + @Override protected void uninstallListeners() { super.uninstallListeners(); popupMenu.removePropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { return getContext(c, getComponentState(c)); } @@ -117,14 +127,23 @@ class SynthPopupMenuUI extends BasicPopupMenuUI implements SynthLookAndFeel.getRegion(c), style, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - private int getComponentState(JComponent c) { return SynthLookAndFeel.getComponentState(c); } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -135,6 +154,16 @@ class SynthPopupMenuUI extends BasicPopupMenuUI implements context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -142,14 +171,29 @@ class SynthPopupMenuUI extends BasicPopupMenuUI implements context.dispose(); } + /** + * Paints the specified component. This implementation does nothing. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintPopupMenuBorder(context, g, x, y, w, h); } + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent e) { if (SynthLookAndFeel.shouldUpdateStyle(e)) { updateStyle(popupMenu); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthProgressBarUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthProgressBarUI.java index c6a75375bf7..1211cfb6487 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthProgressBarUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthProgressBarUI.java @@ -32,16 +32,17 @@ import javax.swing.plaf.*; import javax.swing.plaf.basic.BasicProgressBarUI; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; -import sun.swing.plaf.synth.SynthUI; import sun.swing.SwingUtilities2; /** - * Synth's ProgressBarUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JProgressBar}. * * @author Joshua Outwater + * @since 1.7 */ -class SynthProgressBarUI extends BasicProgressBarUI implements SynthUI, - PropertyChangeListener { +public class SynthProgressBarUI extends BasicProgressBarUI + implements SynthUI, PropertyChangeListener { private SynthStyle style; private int progressPadding; private boolean rotateText; // added for Nimbus LAF @@ -49,22 +50,37 @@ class SynthProgressBarUI extends BasicProgressBarUI implements SynthUI, private boolean tileWhenIndeterminate; //whether to tile indeterminate painting private int tileWidth; //the width of each tile + /** + * Creates a new UI object for the given component. + * + * @param x component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent x) { return new SynthProgressBarUI(); } + /** + * @inheritDoc + */ @Override protected void installListeners() { super.installListeners(); progressBar.addPropertyChangeListener(this); } + /** + * @inheritDoc + */ @Override protected void uninstallListeners() { super.uninstallListeners(); progressBar.removePropertyChangeListener(this); } + /** + * @inheritDoc + */ @Override protected void installDefaults() { updateStyle(progressBar); @@ -101,6 +117,9 @@ class SynthProgressBarUI extends BasicProgressBarUI implements SynthUI, context.dispose(); } + /** + * @inheritDoc + */ @Override protected void uninstallDefaults() { SynthContext context = getContext(progressBar, ENABLED); @@ -110,6 +129,10 @@ class SynthProgressBarUI extends BasicProgressBarUI implements SynthUI, style = null; } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { return getContext(c, getComponentState(c)); } @@ -119,14 +142,13 @@ class SynthProgressBarUI extends BasicProgressBarUI implements SynthUI, SynthLookAndFeel.getRegion(c), style, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - private int getComponentState(JComponent c) { return SynthLookAndFeel.getComponentState(c); } + /** + * @inheritDoc + */ @Override public int getBaseline(JComponent c, int width, int height) { super.getBaseline(c, width, height); @@ -142,6 +164,9 @@ class SynthProgressBarUI extends BasicProgressBarUI implements SynthUI, return -1; } + /** + * @inheritDoc + */ @Override protected Rectangle getBox(Rectangle r) { if (tileWhenIndeterminate) { @@ -151,6 +176,9 @@ class SynthProgressBarUI extends BasicProgressBarUI implements SynthUI, } } + /** + * @inheritDoc + */ @Override protected void setAnimationIndex(int newValue) { if (paintOutsideClip) { @@ -164,6 +192,18 @@ class SynthProgressBarUI extends BasicProgressBarUI implements SynthUI, } } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -176,6 +216,15 @@ class SynthProgressBarUI extends BasicProgressBarUI implements SynthUI, context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -184,6 +233,13 @@ class SynthProgressBarUI extends BasicProgressBarUI implements SynthUI, context.dispose(); } + /** + * Paints the specified component. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { JProgressBar pBar = (JProgressBar)context.getComponent(); int x = 0, y = 0, width = 0, height = 0; @@ -261,8 +317,14 @@ class SynthProgressBarUI extends BasicProgressBarUI implements SynthUI, } } - protected void paintText(SynthContext context, Graphics g, - String title) { + /** + * Paints the component's text. + * + * @param context context for the component being painted + * @param g {@code Graphics} object used for painting + * @param title the text to paint + */ + protected void paintText(SynthContext context, Graphics g, String title) { if (progressBar.isStringPainted()) { SynthStyle style = context.getStyle(); Font font = style.getFont(context); @@ -323,12 +385,20 @@ class SynthProgressBarUI extends BasicProgressBarUI implements SynthUI, } } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintProgressBarBorder(context, g, x, y, w, h, progressBar.getOrientation()); } + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent e) { if (SynthLookAndFeel.shouldUpdateStyle(e) || "indeterminate".equals(e.getPropertyName())) { @@ -336,6 +406,9 @@ class SynthProgressBarUI extends BasicProgressBarUI implements SynthUI, } } + /** + * @inheritDoc + */ @Override public Dimension getPreferredSize(JComponent c) { Dimension size = null; @@ -398,5 +471,5 @@ class SynthProgressBarUI extends BasicProgressBarUI implements SynthUI, size.height += border.top + border.bottom; return size; - } + } } diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthRadioButtonMenuItemUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthRadioButtonMenuItemUI.java index fd814acf1a9..8fb7c39da41 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthRadioButtonMenuItemUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthRadioButtonMenuItemUI.java @@ -27,49 +27,46 @@ package javax.swing.plaf.synth; import javax.swing.*; import java.awt.*; -import java.awt.event.*; import javax.swing.plaf.*; -import javax.swing.border.*; /** - * Synth's RadioButtonMenuItemUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JRadioButtonMenuItem}. * * @author Georges Saab * @author David Karlton + * @since 1.7 */ -class SynthRadioButtonMenuItemUI extends SynthMenuItemUI { +public class SynthRadioButtonMenuItemUI extends SynthMenuItemUI { + + /** + * Creates a new UI object for the given component. + * + * @param b component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent b) { return new SynthRadioButtonMenuItemUI(); } + /** + * @inheritDoc + */ + @Override protected String getPropertyPrefix() { return "RadioButtonMenuItem"; } - public void processMouseEvent(JMenuItem item,MouseEvent e,MenuElement path[],MenuSelectionManager manager) { - Point p = e.getPoint(); - if(p.x >= 0 && p.x < item.getWidth() && - p.y >= 0 && p.y < item.getHeight()) { - if(e.getID() == MouseEvent.MOUSE_RELEASED) { - manager.clearSelectedPath(); - item.doClick(0); - item.setArmed(false); - } else - manager.setSelectedPath(path); - } else if(item.getModel().isArmed()) { - MenuElement newPath[] = new MenuElement[path.length-1]; - int i,c; - for(i=0,c=path.length-1;iIn general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -98,6 +124,16 @@ class SynthRootPaneUI extends BasicRootPaneUI implements SynthUI { context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -105,9 +141,20 @@ class SynthRootPaneUI extends BasicRootPaneUI implements SynthUI { context.dispose(); } + /** + * Paints the specified component. This implementation does nothing. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintRootPaneBorder(context, g, x, y, w, h); @@ -118,6 +165,7 @@ class SynthRootPaneUI extends BasicRootPaneUI implements SynthUI { * indicates the defaultButton has changed, this will * reinstall the keyboard actions. */ + @Override public void propertyChange(PropertyChangeEvent e) { if (SynthLookAndFeel.shouldUpdateStyle(e)) { updateStyle((JRootPane)e.getSource()); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java index 6a4b2d7da83..f3115cde3b9 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollBarUI.java @@ -30,49 +30,46 @@ import java.beans.*; import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; -import sun.swing.plaf.synth.SynthUI; /** - * Synth's ScrollBarUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JScrollBar}. * * @author Scott Violet + * @since 1.7 */ -class SynthScrollBarUI extends BasicScrollBarUI implements - PropertyChangeListener, SynthUI { +public class SynthScrollBarUI extends BasicScrollBarUI + implements PropertyChangeListener, SynthUI { private SynthStyle style; private SynthStyle thumbStyle; private SynthStyle trackStyle; private boolean validMinimumThumbSize; - private int scrollBarWidth; - - //These two variables should be removed when the corrosponding ones in BasicScrollBarUI are made protected - private int incrGap; - private int decrGap; public static ComponentUI createUI(JComponent c) { return new SynthScrollBarUI(); } + /** + * @inheritDoc + */ + @Override protected void installDefaults() { - //NOTE: This next line of code was added because, since incrGap and decrGap in - //BasicScrollBarUI are private, I need to have some way of updating them. - //This is an incomplete solution (since it implies that the incrGap and decrGap - //are set once, and not reset per state. Probably ok, but not always ok). - //This line of code should be removed at the same time that incrGap and - //decrGap are removed and made protected in the super class. - super.installDefaults(); - trackHighlight = NO_HIGHLIGHT; if (scrollbar.getLayout() == null || (scrollbar.getLayout() instanceof UIResource)) { scrollbar.setLayout(this); } + configureScrollBarColors(); updateStyle(scrollbar); } + /** + * @inheritDoc + */ + @Override protected void configureScrollBarColors() { } @@ -137,16 +134,28 @@ class SynthScrollBarUI extends BasicScrollBarUI implements context.dispose(); } + /** + * @inheritDoc + */ + @Override protected void installListeners() { super.installListeners(); scrollbar.addPropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override protected void uninstallListeners() { super.uninstallListeners(); scrollbar.removePropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults(){ SynthContext context = getContext(scrollbar, ENABLED); style.uninstallDefaults(context); @@ -166,9 +175,12 @@ class SynthScrollBarUI extends BasicScrollBarUI implements super.uninstallDefaults(); } - + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { - return getContext(c, getComponentState(c)); + return getContext(c, SynthLookAndFeel.getComponentState(c)); } private SynthContext getContext(JComponent c, int state) { @@ -176,14 +188,6 @@ class SynthScrollBarUI extends BasicScrollBarUI implements SynthLookAndFeel.getRegion(c), style, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - - private int getComponentState(JComponent c) { - return SynthLookAndFeel.getComponentState(c); - } - private SynthContext getContext(JComponent c, Region region) { return getContext(c, region, getComponentState(c, region)); } @@ -206,6 +210,10 @@ class SynthScrollBarUI extends BasicScrollBarUI implements return SynthLookAndFeel.getComponentState(c); } + /** + * @inheritDoc + */ + @Override public boolean getSupportsAbsolutePositioning() { SynthContext context = getContext(scrollbar); boolean value = style.getBoolean(context, @@ -214,6 +222,19 @@ class SynthScrollBarUI extends BasicScrollBarUI implements return value; } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -225,6 +246,16 @@ class SynthScrollBarUI extends BasicScrollBarUI implements context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -232,6 +263,13 @@ class SynthScrollBarUI extends BasicScrollBarUI implements context.dispose(); } + /** + * Paints the specified component. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { SynthContext subcontext = getContext(scrollbar, Region.SCROLL_BAR_TRACK); @@ -243,31 +281,49 @@ class SynthScrollBarUI extends BasicScrollBarUI implements subcontext.dispose(); } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintScrollBarBorder(context, g, x, y, w, h, scrollbar.getOrientation()); } - protected void paintTrack(SynthContext ss, Graphics g, + /** + * Paints the scrollbar track. + * + * @param context context for the component being painted + * @param g {@code Graphics} object used for painting + * @param trackBounds bounding box for the track + */ + protected void paintTrack(SynthContext context, Graphics g, Rectangle trackBounds) { - SynthLookAndFeel.updateSubregion(ss, g, trackBounds); - ss.getPainter().paintScrollBarTrackBackground(ss, g, trackBounds.x, + SynthLookAndFeel.updateSubregion(context, g, trackBounds); + context.getPainter().paintScrollBarTrackBackground(context, g, trackBounds.x, trackBounds.y, trackBounds.width, trackBounds.height, scrollbar.getOrientation()); - ss.getPainter().paintScrollBarTrackBorder(ss, g, trackBounds.x, + context.getPainter().paintScrollBarTrackBorder(context, g, trackBounds.x, trackBounds.y, trackBounds.width, trackBounds.height, scrollbar.getOrientation()); } - protected void paintThumb(SynthContext ss, Graphics g, + /** + * Paints the scrollbar thumb. + * + * @param context context for the component being painted + * @param g {@code Graphics} object used for painting + * @param thumbBounds bounding box for the thumb + */ + protected void paintThumb(SynthContext context, Graphics g, Rectangle thumbBounds) { - SynthLookAndFeel.updateSubregion(ss, g, thumbBounds); + SynthLookAndFeel.updateSubregion(context, g, thumbBounds); int orientation = scrollbar.getOrientation(); - ss.getPainter().paintScrollBarThumbBackground(ss, g, thumbBounds.x, + context.getPainter().paintScrollBarThumbBackground(context, g, thumbBounds.x, thumbBounds.y, thumbBounds.width, thumbBounds.height, orientation); - ss.getPainter().paintScrollBarThumbBorder(ss, g, thumbBounds.x, + context.getPainter().paintScrollBarThumbBorder(context, g, thumbBounds.x, thumbBounds.y, thumbBounds.width, thumbBounds.height, orientation); } @@ -288,6 +344,7 @@ class SynthScrollBarUI extends BasicScrollBarUI implements * @see #getMaximumSize * @see #getMinimumSize */ + @Override public Dimension getPreferredSize(JComponent c) { Insets insets = c.getInsets(); return (scrollbar.getOrientation() == JScrollBar.VERTICAL) @@ -295,6 +352,10 @@ class SynthScrollBarUI extends BasicScrollBarUI implements : new Dimension(48, scrollBarWidth + insets.top + insets.bottom); } + /** + * @inheritDoc + */ + @Override protected Dimension getMinimumThumbSize() { if (!validMinimumThumbSize) { if (scrollbar.getOrientation() == JScrollBar.VERTICAL) { @@ -308,6 +369,10 @@ class SynthScrollBarUI extends BasicScrollBarUI implements return minimumThumbSize; } + /** + * @inheritDoc + */ + @Override protected JButton createDecreaseButton(int orientation) { SynthArrowButton synthArrowButton = new SynthArrowButton(orientation) { @Override @@ -333,6 +398,10 @@ class SynthScrollBarUI extends BasicScrollBarUI implements return synthArrowButton; } + /** + * @inheritDoc + */ + @Override protected JButton createIncreaseButton(int orientation) { SynthArrowButton synthArrowButton = new SynthArrowButton(orientation) { @Override @@ -360,6 +429,10 @@ class SynthScrollBarUI extends BasicScrollBarUI implements return synthArrowButton; } + /** + * @inheritDoc + */ + @Override protected void setThumbRollover(boolean active) { if (isThumbRollover() != active) { scrollbar.repaint(getThumbBounds()); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollPaneUI.java index 1dfdad63cd8..fbc6cbae099 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthScrollPaneUI.java @@ -40,24 +40,41 @@ import java.awt.event.ContainerEvent; import java.awt.event.FocusListener; import java.awt.event.FocusEvent; -import sun.swing.plaf.synth.SynthUI; - - /** - * Synth's ScrollPaneUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JScrollPane}. * * @author Scott Violet + * @since 1.7 */ -class SynthScrollPaneUI extends BasicScrollPaneUI implements - PropertyChangeListener, SynthUI { +public class SynthScrollPaneUI extends BasicScrollPaneUI + implements PropertyChangeListener, SynthUI { private SynthStyle style; private boolean viewportViewHasFocus = false; private ViewportViewFocusHandler viewportViewFocusHandler; + /** + * Creates a new UI object for the given component. + * + * @param x component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent x) { return new SynthScrollPaneUI(); } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -69,6 +86,15 @@ class SynthScrollPaneUI extends BasicScrollPaneUI implements context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -77,6 +103,13 @@ class SynthScrollPaneUI extends BasicScrollPaneUI implements context.dispose(); } + /** + * Paints the specified component. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { Border vpBorder = scrollpane.getViewportBorder(); if (vpBorder != null) { @@ -85,12 +118,18 @@ class SynthScrollPaneUI extends BasicScrollPaneUI implements } } - + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintScrollPaneBorder(context, g, x, y, w, h); } + /** + * @inheritDoc + */ @Override protected void installDefaults(JScrollPane scrollpane) { updateStyle(scrollpane); @@ -114,7 +153,9 @@ class SynthScrollPaneUI extends BasicScrollPaneUI implements context.dispose(); } - + /** + * @inheritDoc + */ @Override protected void installListeners(JScrollPane c) { super.installListeners(c); @@ -129,6 +170,9 @@ class SynthScrollPaneUI extends BasicScrollPaneUI implements } } + /** + * @inheritDoc + */ @Override protected void uninstallDefaults(JScrollPane c) { SynthContext context = getContext(c, ENABLED); @@ -141,7 +185,9 @@ class SynthScrollPaneUI extends BasicScrollPaneUI implements } } - + /** + * @inheritDoc + */ @Override protected void uninstallListeners(JComponent c) { super.uninstallListeners(c); @@ -156,7 +202,10 @@ class SynthScrollPaneUI extends BasicScrollPaneUI implements } } - + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { return getContext(c, getComponentState(c)); } @@ -166,12 +215,6 @@ class SynthScrollPaneUI extends BasicScrollPaneUI implements SynthLookAndFeel.getRegion(c), style, state); } - - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - - private int getComponentState(JComponent c) { int baseState = SynthLookAndFeel.getComponentState(c); if (viewportViewFocusHandler!=null && viewportViewHasFocus){ diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSeparatorUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSeparatorUI.java index 39828f919db..ed21bbb93e1 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSeparatorUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSeparatorUI.java @@ -34,33 +34,51 @@ import javax.swing.plaf.ComponentUI; import javax.swing.plaf.SeparatorUI; import javax.swing.plaf.UIResource; import javax.swing.plaf.DimensionUIResource; -import sun.swing.plaf.synth.SynthUI; /** - * A Synth L&F implementation of SeparatorUI. This implementation - * is a "combined" view/controller. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JSeparator}. * * @author Shannon Hickey * @author Joshua Outwater + * @since 1.7 */ -class SynthSeparatorUI extends SeparatorUI implements PropertyChangeListener, - SynthUI { +public class SynthSeparatorUI extends SeparatorUI + implements PropertyChangeListener, SynthUI { private SynthStyle style; + /** + * Creates a new UI object for the given component. + * + * @param c component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent c) { return new SynthSeparatorUI(); } + /** + * @inheritDoc + */ + @Override public void installUI(JComponent c) { installDefaults((JSeparator)c); installListeners((JSeparator)c); } - public void uninstallDefaults(JComponent c) { + /** + * @inheritDoc + */ + @Override + public void uninstallUI(JComponent c) { uninstallListeners((JSeparator)c); uninstallDefaults((JSeparator)c); } + /** + * Installs default setting. This method is called when a + * {@code LookAndFeel} is installed. + */ public void installDefaults(JSeparator c) { updateStyle(c); } @@ -88,6 +106,10 @@ class SynthSeparatorUI extends SeparatorUI implements PropertyChangeListener, context.dispose(); } + /** + * Uninstalls default setting. This method is called when a + * {@code LookAndFeel} is uninstalled. + */ public void uninstallDefaults(JSeparator c) { SynthContext context = getContext(c, ENABLED); @@ -96,14 +118,35 @@ class SynthSeparatorUI extends SeparatorUI implements PropertyChangeListener, style = null; } + /** + * Installs listeners. This method is called when a + * {@code LookAndFeel} is installed. + */ public void installListeners(JSeparator c) { c.addPropertyChangeListener(this); } + /** + * Uninstalls listeners. This method is called when a + * {@code LookAndFeel} is uninstalled. + */ public void uninstallListeners(JSeparator c) { c.removePropertyChangeListener(this); } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -116,6 +159,16 @@ class SynthSeparatorUI extends SeparatorUI implements PropertyChangeListener, context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -123,6 +176,13 @@ class SynthSeparatorUI extends SeparatorUI implements PropertyChangeListener, context.dispose(); } + /** + * Paints the specified component. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { JSeparator separator = (JSeparator)context.getComponent(); context.getPainter().paintSeparatorForeground(context, g, 0, 0, @@ -130,6 +190,10 @@ class SynthSeparatorUI extends SeparatorUI implements PropertyChangeListener, separator.getOrientation()); } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { JSeparator separator = (JSeparator)context.getComponent(); @@ -137,6 +201,10 @@ class SynthSeparatorUI extends SeparatorUI implements PropertyChangeListener, separator.getOrientation()); } + /** + * @inheritDoc + */ + @Override public Dimension getPreferredSize(JComponent c) { SynthContext context = getContext(c); @@ -155,16 +223,28 @@ class SynthSeparatorUI extends SeparatorUI implements PropertyChangeListener, return size; } + /** + * @inheritDoc + */ + @Override public Dimension getMinimumSize(JComponent c) { return getPreferredSize(c); } + /** + * @inheritDoc + */ + @Override public Dimension getMaximumSize(JComponent c) { return new Dimension(Short.MAX_VALUE, Short.MAX_VALUE); } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { - return getContext(c, getComponentState(c)); + return getContext(c, SynthLookAndFeel.getComponentState(c)); } private SynthContext getContext(JComponent c, int state) { @@ -172,14 +252,6 @@ class SynthSeparatorUI extends SeparatorUI implements PropertyChangeListener, SynthLookAndFeel.getRegion(c), style, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - - private int getComponentState(JComponent c) { - return SynthLookAndFeel.getComponentState(c); - } - public void propertyChange(PropertyChangeEvent evt) { if (SynthLookAndFeel.shouldUpdateStyle(evt)) { updateStyle((JSeparator)evt.getSource()); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java index 78d0bb1aaed..073026e2772 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java @@ -38,20 +38,20 @@ import java.util.Enumeration; import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.BasicSliderUI; -import sun.swing.plaf.synth.SynthUI; import sun.swing.SwingUtilities2; /** - * Synth's SliderUI. + * Provides the Synth L&F UI delegate for + * {@link JSlider}. * * @author Joshua Outwater + * @since 1.7 */ -class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, - SynthUI { - protected Dimension contentDim = new Dimension(); - protected Rectangle valueRect = new Rectangle(); - protected boolean paintValue; +public class SynthSliderUI extends BasicSliderUI + implements PropertyChangeListener, SynthUI { + private Rectangle valueRect = new Rectangle(); + private boolean paintValue; /** * When a JSlider is used as a renderer in a JTable, its layout is not @@ -65,7 +65,7 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, * the slider has not changed sizes since being last layed out. If necessary * we recompute the layout. */ - private Dimension lastSize = null; + private Dimension lastSize; private int trackHeight; private int trackBorder; @@ -83,19 +83,33 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, /////////////////////////////////////////////////// // ComponentUI Interface Implementation methods /////////////////////////////////////////////////// + /** + * Creates a new UI object for the given component. + * + * @param c component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent c) { return new SynthSliderUI((JSlider)c); } - public SynthSliderUI(JSlider c) { + protected SynthSliderUI(JSlider c) { super(c); } + /** + * @inheritDoc + */ + @Override protected void installDefaults(JSlider slider) { updateStyle(slider); } - protected void uninstallDefaults() { + /** + * Uninstalls default setting. This method is called when a + * {@code LookAndFeel} is uninstalled. + */ + protected void uninstallDefaults(JSlider slider) { SynthContext context = getContext(slider, ENABLED); style.uninstallDefaults(context); context.dispose(); @@ -112,11 +126,19 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, sliderThumbStyle = null; } + /** + * @inheritDoc + */ + @Override protected void installListeners(JSlider slider) { super.installListeners(slider); slider.addPropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override protected void uninstallListeners(JSlider slider) { slider.removePropertyChangeListener(this); super.uninstallListeners(slider); @@ -177,6 +199,10 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, context.dispose(); } + /** + * @inheritDoc + */ + @Override protected TrackListener createTrackListener(JSlider s) { return new SynthTrackListener(); } @@ -204,6 +230,10 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, } } + /** + * @inheritDoc + */ + @Override public int getBaseline(JComponent c, int width, int height) { if (c == null) { throw new NullPointerException("Component must be non-null"); @@ -271,9 +301,13 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, return -1; } + /** + * @inheritDoc + */ + @Override public Dimension getPreferredSize(JComponent c) { recalculateIfInsetsChanged(); - Dimension d = new Dimension(contentDim); + Dimension d = new Dimension(contentRect.width, contentRect.height); if (slider.getOrientation() == JSlider.VERTICAL) { d.height = 200; } else { @@ -285,9 +319,13 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, return d; } + /** + * @inheritDoc + */ + @Override public Dimension getMinimumSize(JComponent c) { recalculateIfInsetsChanged(); - Dimension d = new Dimension(contentDim); + Dimension d = new Dimension(contentRect.width, contentRect.height); if (slider.getOrientation() == JSlider.VERTICAL) { d.height = thumbRect.height + insetCache.top + insetCache.bottom; } else { @@ -296,19 +334,23 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, return d; } + /** + * @inheritDoc + */ + @Override protected void calculateGeometry() { + calculateThumbSize(); layout(); calculateThumbLocation(); } + /** + * Lays out the slider. + */ protected void layout() { SynthContext context = getContext(slider); SynthGraphicsUtils synthGraphics = style.getGraphicsUtils(context); - // Set the thumb size. - Dimension size = getThumbSize(); - thumbRect.setSize(size.width, size.height); - // Get the insets for the track. Insets trackInsets = new Insets(0, 0, 0, 0); SynthContext trackContext = getContext(slider, Region.SLIDER_TRACK); @@ -336,10 +378,10 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, labelRect.height = getHeightOfTallestLabel(); } - contentDim.height = valueRect.height + trackRect.height + contentRect.height = valueRect.height + trackRect.height + trackInsets.top + trackInsets.bottom + tickRect.height + labelRect.height + 4; - contentDim.width = slider.getWidth() - insetCache.left + contentRect.width = slider.getWidth() - insetCache.left - insetCache.right; // Check if any of the labels will paint out of bounds. @@ -348,7 +390,7 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, // Calculate the track rectangle. It is necessary for // xPositionForValue to return correct values. trackRect.x = insetCache.left; - trackRect.width = contentDim.width; + trackRect.width = contentRect.width; Dictionary dictionary = slider.getLabelTable(); if (dictionary != null) { @@ -381,9 +423,9 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, valueRect.x = trackRect.x = tickRect.x = labelRect.x = (insetCache.left + pad); valueRect.width = trackRect.width = tickRect.width = - labelRect.width = (contentDim.width - (pad * 2)); + labelRect.width = (contentRect.width - (pad * 2)); - int centerY = slider.getHeight() / 2 - contentDim.height / 2; + int centerY = slider.getHeight() / 2 - contentRect.height / 2; valueRect.y = centerY; centerY += valueRect.height + 2; @@ -430,18 +472,18 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, int w1 = trackInsets.left + trackRect.width / 2; int w2 = trackRect.width / 2 + trackInsets.right + tickRect.width + labelRect.width; - contentDim.width = Math.max(w1, l) + Math.max(w2, l) + + contentRect.width = Math.max(w1, l) + Math.max(w2, l) + 2 + insetCache.left + insetCache.right; - contentDim.height = slider.getHeight() - + contentRect.height = slider.getHeight() - insetCache.top - insetCache.bottom; // Layout the components. trackRect.y = tickRect.y = labelRect.y = valueRect.y + valueRect.height; trackRect.height = tickRect.height = labelRect.height = - contentDim.height - valueRect.height; + contentRect.height - valueRect.height; - int startX = slider.getWidth() / 2 - contentDim.width / 2; + int startX = slider.getWidth() / 2 - contentRect.width / 2; if (SynthLookAndFeel.isLeftToRight(slider)) { if (l > w1) { startX += (l - w1); @@ -491,6 +533,10 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, return pad; } + /** + * @inheritDoc + */ + @Override protected void calculateThumbLocation() { super.calculateThumbLocation(); if (slider.getOrientation() == JSlider.HORIZONTAL) { @@ -504,35 +550,10 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, } } - protected void calculateTickRect() { - if (slider.getOrientation() == JSlider.HORIZONTAL) { - tickRect.x = trackRect.x; - tickRect.y = trackRect.y + trackRect.height + 2 + getTickLength(); - tickRect.width = trackRect.width; - tickRect.height = getTickLength(); - - if (!slider.getPaintTicks()) { - --tickRect.y; - tickRect.height = 0; - } - } else { - if (SynthLookAndFeel.isLeftToRight(slider)) { - tickRect.x = trackRect.x + trackRect.width; - tickRect.width = getTickLength(); - } else { - tickRect.width = getTickLength(); - tickRect.x = trackRect.x - tickRect.width; - } - tickRect.y = trackRect.y; - tickRect.height = trackRect.height; - - if (!slider.getPaintTicks()) { - --tickRect.x; - tickRect.width = 0; - } - } - } - + /** + * @inheritDoc + */ + @Override public void setThumbLocation(int x, int y) { super.setThumbLocation(x, y); // Value rect is tied to the thumb location. We need to repaint when @@ -542,6 +563,10 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, setThumbActive(false); } + /** + * @inheritDoc + */ + @Override protected int xPositionForValue(int value) { int min = slider.getMinimum(); int max = slider.getMaximum(); @@ -567,6 +592,10 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, return xPosition; } + /** + * @inheritDoc + */ + @Override protected int yPositionForValue(int value, int trackY, int trackHeight) { int min = slider.getMinimum(); int max = slider.getMaximum(); @@ -593,10 +622,9 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, } /** - * Returns a value give a y position. If yPos is past the track at the - * top or the bottom it will set the value to the min or max of the - * slider, depending if the slider is inverted or not. + * @inheritDoc */ + @Override public int valueForYPosition(int yPos) { int value; int minValue = slider.getMinimum(); @@ -623,10 +651,9 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, } /** - * Returns a value give an x position. If xPos is past the track at the - * left or the right it will set the value to the min or max of the - * slider, depending if the slider is inverted or not. + * @inheritDoc */ + @Override public int valueForXPosition(int xPos) { int value; int minValue = slider.getMinimum(); @@ -652,6 +679,10 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, return value; } + /** + * @inheritDoc + */ + @Override protected Dimension getThumbSize() { Dimension size = new Dimension(); @@ -665,6 +696,10 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, return size; } + /** + * @inheritDoc + */ + @Override protected void recalculateIfInsetsChanged() { SynthContext context = getContext(slider); Insets newInsets = style.getInsets(context, null); @@ -678,20 +713,20 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, context.dispose(); } - public Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { - return getContext(c, getComponentState(c)); + return getContext(c, SynthLookAndFeel.getComponentState(c)); } - public SynthContext getContext(JComponent c, int state) { + private SynthContext getContext(JComponent c, int state) { return SynthContext.getContext(SynthContext.class, c, SynthLookAndFeel.getRegion(c), style, state); } - public SynthContext getContext(JComponent c, Region subregion) { + private SynthContext getContext(JComponent c, Region subregion) { return getContext(c, subregion, getComponentState(c, subregion)); } @@ -707,10 +742,6 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, return SynthContext.getContext(klass, c, subregion, style, state); } - public int getComponentState(JComponent c) { - return SynthLookAndFeel.getComponentState(c); - } - private int getComponentState(JComponent c, Region region) { if (region == Region.SLIDER_THUMB && thumbActive &&c.isEnabled()) { int state = thumbPressed ? PRESSED : MOUSE_OVER; @@ -720,6 +751,19 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, return SynthLookAndFeel.getComponentState(c); } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); SynthLookAndFeel.update(context, g); @@ -730,13 +774,30 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); paint(context, g); context.dispose(); } - public void paint(SynthContext context, Graphics g) { + /** + * Paints the specified component. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ + protected void paint(SynthContext context, Graphics g) { recalculateIfInsetsChanged(); recalculateIfOrientationChanged(); Rectangle clip = g.getClipBounds(); @@ -755,8 +816,8 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, // For horizontal sliders, make sure value is not painted // outside slider bounds. if (slider.getOrientation() == JSlider.HORIZONTAL) { - if (valueRect.x + labelWidth > insetCache.left + contentDim.width) { - valueRect.x = (insetCache.left + contentDim.width) - labelWidth; + if (valueRect.x + labelWidth > insetCache.left + contentRect.width) { + valueRect.x = (insetCache.left + contentRect.width) - labelWidth; } valueRect.x = Math.max(valueRect.x, 0); } @@ -768,13 +829,17 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, valueRect.y, -1); } - SynthContext subcontext = getContext(slider, Region.SLIDER_TRACK); - paintTrack(subcontext, g, trackRect); - subcontext.dispose(); + if (slider.getPaintTrack() && clip.intersects(trackRect)) { + SynthContext subcontext = getContext(slider, Region.SLIDER_TRACK); + paintTrack(subcontext, g, trackRect); + subcontext.dispose(); + } - subcontext = getContext(slider, Region.SLIDER_THUMB); - paintThumb(subcontext, g, thumbRect); - subcontext.dispose(); + if (clip.intersects(thumbRect)) { + SynthContext subcontext = getContext(slider, Region.SLIDER_THUMB); + paintThumb(subcontext, g, thumbRect); + subcontext.dispose(); + } if (slider.getPaintTicks() && clip.intersects(tickRect)) { paintTicks(g); @@ -785,13 +850,24 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, } } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintSliderBorder(context, g, x, y, w, h, slider.getOrientation()); } - public void paintThumb(SynthContext context, Graphics g, + /** + * Paints the slider thumb. + * + * @param context context for the component being painted + * @param g {@code Graphics} object used for painting + * @param thumbBounds bounding box for the thumb + */ + protected void paintThumb(SynthContext context, Graphics g, Rectangle thumbBounds) { int orientation = slider.getOrientation(); SynthLookAndFeel.updateSubregion(context, g, thumbBounds); @@ -803,7 +879,14 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, thumbBounds.height, orientation); } - public void paintTrack(SynthContext context, Graphics g, + /** + * Paints the slider track. + * + * @param context context for the component being painted + * @param g {@code Graphics} object used for painting + * @param trackBounds bounding box for the track + */ + protected void paintTrack(SynthContext context, Graphics g, Rectangle trackBounds) { int orientation = slider.getOrientation(); SynthLookAndFeel.updateSubregion(context, g, trackBounds); @@ -815,6 +898,10 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, trackBounds.height, orientation); } + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent e) { if (SynthLookAndFeel.shouldUpdateStyle(e)) { updateStyle((JSlider)e.getSource()); @@ -827,23 +914,23 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, /** * Track mouse movements. */ - protected class SynthTrackListener extends TrackListener { + private class SynthTrackListener extends TrackListener { - public void mouseExited(MouseEvent e) { + @Override public void mouseExited(MouseEvent e) { setThumbActive(false); } - public void mousePressed(MouseEvent e) { + @Override public void mousePressed(MouseEvent e) { super.mousePressed(e); setThumbPressed(thumbRect.contains(e.getX(), e.getY())); } - public void mouseReleased(MouseEvent e) { + @Override public void mouseReleased(MouseEvent e) { super.mouseReleased(e); updateThumbState(e.getX(), e.getY(), false); } - public void mouseDragged(MouseEvent e) { + @Override public void mouseDragged(MouseEvent e) { int thumbMiddle; if (!slider.isEnabled()) { @@ -914,7 +1001,7 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, } } - public void mouseMoved(MouseEvent e) { + @Override public void mouseMoved(MouseEvent e) { updateThumbState(e.getX(), e.getY()); } } diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSpinnerUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSpinnerUI.java index d0dd44b8963..109b62d2a5f 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSpinnerUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSpinnerUI.java @@ -26,22 +26,21 @@ package javax.swing.plaf.synth; import java.awt.*; import java.awt.event.*; - import javax.swing.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.BasicSpinnerUI; - import java.beans.*; -import sun.swing.plaf.synth.SynthUI; /** - * Synth's SpinnerUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JSpinner}. * * @author Hans Muller * @author Joshua Outwater + * @since 1.7 */ -class SynthSpinnerUI extends BasicSpinnerUI implements PropertyChangeListener, - SynthUI { +public class SynthSpinnerUI extends BasicSpinnerUI + implements PropertyChangeListener, SynthUI { private SynthStyle style; /** * A FocusListener implementation which causes the entire spinner to be @@ -65,6 +64,9 @@ class SynthSpinnerUI extends BasicSpinnerUI implements PropertyChangeListener, return new SynthSpinnerUI(); } + /** + * @inheritDoc + */ @Override protected void installListeners() { super.installListeners(); @@ -79,12 +81,7 @@ class SynthSpinnerUI extends BasicSpinnerUI implements PropertyChangeListener, } /** - * Removes the propertyChangeListener added - * by installListeners. - *

      - * This method is called by uninstallUI. - * - * @see #installListeners + * @inheritDoc */ @Override protected void uninstallListeners() { @@ -100,7 +97,7 @@ class SynthSpinnerUI extends BasicSpinnerUI implements PropertyChangeListener, } /** - * Initialize the JSpinner border, + * Initializes the JSpinner border, * foreground, and background, properties * based on the corresponding "Spinner.*" properties from defaults table. * The JSpinners layout is set to the value returned by @@ -112,6 +109,7 @@ class SynthSpinnerUI extends BasicSpinnerUI implements PropertyChangeListener, * @see LookAndFeel#installBorder * @see LookAndFeel#installColors */ + @Override protected void installDefaults() { LayoutManager layout = spinner.getLayout(); @@ -144,6 +142,7 @@ class SynthSpinnerUI extends BasicSpinnerUI implements PropertyChangeListener, * @see #installDefaults * @see #uninstallUI */ + @Override protected void uninstallDefaults() { if (spinner.getLayout() instanceof UIResource) { spinner.setLayout(null); @@ -156,25 +155,19 @@ class SynthSpinnerUI extends BasicSpinnerUI implements PropertyChangeListener, style = null; } - + /** + * @inheritDoc + */ + @Override protected LayoutManager createLayout() { return new SpinnerLayout(); } /** - * Create a component that will replace the spinner models value - * with the object returned by spinner.getPreviousValue. - * By default the previousButton is a JButton - * who's ActionListener updates it's JSpinner - * ancestors model. If a previousButton isn't needed (in a subclass) - * then override this method to return null. - * - * @return a component that will replace the spinners model with the - * next value in the sequence, or null - * @see #installUI - * @see #createNextButton + * @inheritDoc */ + @Override protected Component createPreviousButton() { JButton b = new SynthArrowButton(SwingConstants.SOUTH); b.setName("Spinner.previousButton"); @@ -184,18 +177,9 @@ class SynthSpinnerUI extends BasicSpinnerUI implements PropertyChangeListener, /** - * Create a component that will replace the spinner models value - * with the object returned by spinner.getNextValue. - * By default the nextButton is a JButton - * who's ActionListener updates it's JSpinner - * ancestors model. If a nextButton isn't needed (in a subclass) - * then override this method to return null. - * - * @return a component that will replace the spinners model with the - * next value in the sequence, or null - * @see #installUI - * @see #createPreviousButton + * @inheritDoc */ + @Override protected Component createNextButton() { JButton b = new SynthArrowButton(SwingConstants.NORTH); b.setName("Spinner.nextButton"); @@ -227,6 +211,7 @@ class SynthSpinnerUI extends BasicSpinnerUI implements PropertyChangeListener, * @see #replaceEditor * @see JSpinner#getEditor */ + @Override protected JComponent createEditor() { JComponent editor = spinner.getEditor(); editor.setName("Spinner.editor"); @@ -250,6 +235,7 @@ class SynthSpinnerUI extends BasicSpinnerUI implements PropertyChangeListener, * @see #createEditor * @see #createPropertyChangeListener */ + @Override protected void replaceEditor(JComponent oldEditor, JComponent newEditor) { spinner.remove(oldEditor); spinner.add(newEditor, "Editor"); @@ -283,8 +269,12 @@ class SynthSpinnerUI extends BasicSpinnerUI implements PropertyChangeListener, } } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { - return getContext(c, getComponentState(c)); + return getContext(c, SynthLookAndFeel.getComponentState(c)); } private SynthContext getContext(JComponent c, int state) { @@ -292,17 +282,19 @@ class SynthSpinnerUI extends BasicSpinnerUI implements PropertyChangeListener, SynthLookAndFeel.getRegion(c), style, state); } - - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - - - private int getComponentState(JComponent c) { - return SynthLookAndFeel.getComponentState(c); - } - - + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -314,6 +306,16 @@ class SynthSpinnerUI extends BasicSpinnerUI implements PropertyChangeListener, } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -321,10 +323,20 @@ class SynthSpinnerUI extends BasicSpinnerUI implements PropertyChangeListener, context.dispose(); } - + /** + * Paints the specified component. This implementation does nothing. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintSpinnerBorder(context, g, x, y, w, h); @@ -426,9 +438,11 @@ class SynthSpinnerUI extends BasicSpinnerUI implements PropertyChangeListener, } } - + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent e) { - String propertyName = e.getPropertyName(); JSpinner spinner = (JSpinner)(e.getSource()); SpinnerUI spinnerUI = spinner.getUI(); @@ -444,34 +458,13 @@ class SynthSpinnerUI extends BasicSpinnerUI implements PropertyChangeListener, /** Listen to editor text field focus changes and repaint whole spinner */ private class EditorFocusHandler implements FocusListener{ /** Invoked when a editor text field gains the keyboard focus. */ - public void focusGained(FocusEvent e) { + @Override public void focusGained(FocusEvent e) { spinner.repaint(); } /** Invoked when a editor text field loses the keyboard focus. */ - public void focusLost(FocusEvent e) { + @Override public void focusLost(FocusEvent e) { spinner.repaint(); } } - - /** Override the arrowbuttons focus handling to follow the text fields focus */ - private class SpinnerArrowButton extends SynthArrowButton{ - public SpinnerArrowButton(int direction) { - super(direction); - } - - @Override - public boolean isFocusOwner() { - if (spinner == null){ - return super.isFocusOwner(); - } else if (spinner.getEditor() instanceof JSpinner.DefaultEditor){ - return ((JSpinner.DefaultEditor)spinner.getEditor()) - .getTextField().isFocusOwner(); - } else if (spinner.getEditor()!= null) { - return spinner.getEditor().isFocusOwner(); - } else { - return super.isFocusOwner(); - } - } - } } diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java index 6cf4da962a2..68217774e51 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java @@ -31,19 +31,19 @@ import java.awt.event.*; import java.beans.*; import java.util.*; import javax.swing.*; -import javax.swing.event.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; -import sun.swing.plaf.synth.SynthUI; /** - * Synth's SplitPaneUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JSplitPane}. * * @author Scott Violet + * @since 1.7 */ -class SynthSplitPaneUI extends BasicSplitPaneUI implements - PropertyChangeListener, SynthUI { +public class SynthSplitPaneUI extends BasicSplitPaneUI + implements PropertyChangeListener, SynthUI { /** * Keys to use for forward focus traversal when the JComponent is * managing focus. @@ -68,6 +68,9 @@ class SynthSplitPaneUI extends BasicSplitPaneUI implements /** * Creates a new SynthSplitPaneUI instance + * + * @param x component to create UI object for + * @return the UI object */ public static ComponentUI createUI(JComponent x) { return new SynthSplitPaneUI(); @@ -76,6 +79,7 @@ class SynthSplitPaneUI extends BasicSplitPaneUI implements /** * Installs the UI defaults. */ + @Override protected void installDefaults() { updateStyle(splitPane); @@ -161,6 +165,7 @@ class SynthSplitPaneUI extends BasicSplitPaneUI implements /** * Installs the event listeners for the UI. */ + @Override protected void installListeners() { super.installListeners(); splitPane.addPropertyChangeListener(this); @@ -169,6 +174,7 @@ class SynthSplitPaneUI extends BasicSplitPaneUI implements /** * Uninstalls the UI defaults. */ + @Override protected void uninstallDefaults() { SynthContext context = getContext(splitPane, ENABLED); @@ -186,16 +192,20 @@ class SynthSplitPaneUI extends BasicSplitPaneUI implements /** - * Uninstalls the event listeners for the UI. + * Uninstalls the event listeners from the UI. */ + @Override protected void uninstallListeners() { super.uninstallListeners(); splitPane.removePropertyChangeListener(this); } - + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { - return getContext(c, getComponentState(c)); + return getContext(c, SynthLookAndFeel.getComponentState(c)); } private SynthContext getContext(JComponent c, int state) { @@ -203,14 +213,6 @@ class SynthSplitPaneUI extends BasicSplitPaneUI implements SynthLookAndFeel.getRegion(c), style, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - - private int getComponentState(JComponent c) { - return SynthLookAndFeel.getComponentState(c); - } - SynthContext getContext(JComponent c, Region region) { return getContext(c, region, getComponentState(c, region)); } @@ -233,7 +235,10 @@ class SynthSplitPaneUI extends BasicSplitPaneUI implements return state; } - + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent e) { if (SynthLookAndFeel.shouldUpdateStyle(e)) { updateStyle((JSplitPane)e.getSource()); @@ -243,6 +248,7 @@ class SynthSplitPaneUI extends BasicSplitPaneUI implements /** * Creates the default divider. */ + @Override public BasicSplitPaneDivider createDefaultDivider() { SynthSplitPaneDivider divider = new SynthSplitPaneDivider(this); @@ -250,6 +256,10 @@ class SynthSplitPaneUI extends BasicSplitPaneUI implements return divider; } + /** + * @inheritDoc + */ + @Override protected Component createDefaultNonContinuousLayoutDivider() { return new Canvas() { public void paint(Graphics g) { @@ -258,6 +268,19 @@ class SynthSplitPaneUI extends BasicSplitPaneUI implements }; } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -268,6 +291,16 @@ class SynthSplitPaneUI extends BasicSplitPaneUI implements context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -275,13 +308,23 @@ class SynthSplitPaneUI extends BasicSplitPaneUI implements context.dispose(); } + /** + * Paints the specified component. This implementation does nothing. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { // This is done to update package private variables in // BasicSplitPaneUI super.paint(g, splitPane); } - + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintSplitPaneBorder(context, g, x, y, w, h); @@ -299,6 +342,10 @@ class SynthSplitPaneUI extends BasicSplitPaneUI implements context.dispose(); } + /** + * @inheritDoc + */ + @Override public void finishedPaintingChildren(JSplitPane jc, Graphics g) { if(jc == splitPane && getLastDragLocation() != -1 && !isContinuousLayout() && !draggingHW) { diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthStyle.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthStyle.java index 52e9ef11b08..521addc21bc 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthStyle.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthStyle.java @@ -33,7 +33,6 @@ import javax.swing.text.DefaultEditorKit; import java.util.HashMap; import java.util.Map; import javax.swing.text.JTextComponent; -import sun.swing.plaf.synth.SynthUI; /** * SynthStyle is a set of style properties. diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthStyleFactory.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthStyleFactory.java index 562c0286067..8a0f88f3d65 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthStyleFactory.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthStyleFactory.java @@ -24,10 +24,7 @@ */ package javax.swing.plaf.synth; -import java.awt.*; -import java.util.*; -import javax.swing.plaf.*; -import javax.swing.*; +import javax.swing.JComponent; /** * Factory used for obtaining SynthStyles. Each of the diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java index cef94e151d1..387f1ddce53 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java @@ -34,19 +34,21 @@ import java.awt.*; import java.awt.event.*; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; -import sun.swing.plaf.synth.SynthUI; import sun.swing.SwingUtilities2; /** - * A Synth L&F implementation of TabbedPaneUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JTabbedPane}. + * + *

      Looks up the {@code selectedTabPadInsets} property from the Style, + * which represents additional insets for the selected tab. * * @author Scott Violet + * @since 1.7 */ -/** - * Looks up 'selectedTabPadInsets' from the Style, which will be additional - * insets for the selected tab. - */ -class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyChangeListener { +public class SynthTabbedPaneUI extends BasicTabbedPaneUI + implements PropertyChangeListener, SynthUI { + /** *

      If non-zero, tabOverlap indicates the amount that the tab bounds * should be altered such that they would overlap with a tab on either the @@ -90,8 +92,8 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh private SynthStyle tabAreaStyle; private SynthStyle tabContentStyle; - private Rectangle textRect; - private Rectangle iconRect; + private Rectangle textRect = new Rectangle(); + private Rectangle iconRect = new Rectangle(); private Rectangle tabAreaBounds = new Rectangle(); @@ -103,19 +105,24 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh private boolean selectedTabIsPressed = false; + /** + * Creates a new UI object for the given component. + * + * @param c component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent c) { return new SynthTabbedPaneUI(); } - SynthTabbedPaneUI() { - textRect = new Rectangle(); - iconRect = new Rectangle(); - } - private boolean scrollableTabLayoutEnabled() { return (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT); } + /** + * @inheritDoc + */ + @Override protected void installDefaults() { updateStyle(tabPane); } @@ -175,16 +182,28 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh tabContentStyle.getInsets(tabContentContext, null); } + /** + * @inheritDoc + */ + @Override protected void installListeners() { super.installListeners(); tabPane.addPropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override protected void uninstallListeners() { super.uninstallListeners(); tabPane.removePropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults() { SynthContext context = getContext(tabPane, ENABLED); style.uninstallDefaults(context); @@ -207,19 +226,19 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh tabContentStyle = null; } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { - return getContext(c, getComponentState(c)); + return getContext(c, SynthLookAndFeel.getComponentState(c)); } - public SynthContext getContext(JComponent c, int state) { + private SynthContext getContext(JComponent c, int state) { return SynthContext.getContext(SynthContext.class, c, SynthLookAndFeel.getRegion(c),style, state); } - public SynthContext getContext(JComponent c, Region subregion) { - return getContext(c, subregion, getComponentState(c)); - } - private SynthContext getContext(JComponent c, Region subregion, int state){ SynthStyle style = null; Class klass = SynthContext.class; @@ -236,14 +255,10 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh return SynthContext.getContext(klass, c, subregion, style, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - - private int getComponentState(JComponent c) { - return SynthLookAndFeel.getComponentState(c); - } - + /** + * @inheritDoc + */ + @Override protected JButton createScrollButton(int direction) { // added for Nimbus LAF so that it can use the basic arrow buttons // UIManager is queried directly here because this is called before @@ -256,6 +271,10 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh return new SynthScrollableTabButton(direction); } + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent e) { if (SynthLookAndFeel.shouldUpdateStyle(e)) { updateStyle(tabPane); @@ -313,6 +332,9 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh }; } + /** + * @inheritDoc + */ @Override protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected) { if (nudgeSelectedLabel) { @@ -322,6 +344,9 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh } } + /** + * @inheritDoc + */ @Override protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected) { if (nudgeSelectedLabel) { @@ -331,6 +356,19 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh } } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -341,6 +379,10 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh context.dispose(); } + /** + * @inheritDoc + */ + @Override protected int getBaseline(int tab) { if (tabPane.getTabComponentAt(tab) != null || getTextViewForTab(tab) != null) { @@ -361,11 +403,25 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh return textRect.y + metrics.getAscent() + getBaselineOffset(); } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintTabbedPaneBorder(context, g, x, y, w, h); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -373,6 +429,13 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh context.dispose(); } + /** + * Paints the specified component. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { int selectedIndex = tabPane.getSelectedIndex(); int tabPlacement = tabPane.getTabPlacement(); @@ -426,6 +489,10 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh } + /** + * @inheritDoc + */ + @Override protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) { // This can be invoked from ScrollabeTabPanel @@ -439,7 +506,7 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh new Rectangle(x, y, width, height)); } - protected void paintTabArea(SynthContext ss, Graphics g, + private void paintTabArea(SynthContext ss, Graphics g, int tabPlacement, int selectedIndex, Rectangle tabAreaBounds) { Rectangle clipRect = g.getClipBounds(); @@ -493,6 +560,10 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh } } + /** + * @inheritDoc + */ + @Override protected void setRolloverTab(int index) { int oldRolloverTab = getRolloverTab(); super.setRolloverTab(index); @@ -519,7 +590,7 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh } } - protected void paintTab(SynthContext ss, Graphics g, + private void paintTab(SynthContext ss, Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect) { Rectangle tabRect = rects[tabIndex]; @@ -587,7 +658,7 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh } } - protected void layoutLabel(SynthContext ss, int tabPlacement, + private void layoutLabel(SynthContext ss, int tabPlacement, FontMetrics metrics, int tabIndex, String title, Icon icon, Rectangle tabRect, Rectangle iconRect, @@ -614,7 +685,7 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh textRect.y += yNudge; } - protected void paintText(SynthContext ss, + private void paintText(SynthContext ss, Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, @@ -636,7 +707,7 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh } - protected void paintContentBorder(SynthContext ss, Graphics g, + private void paintContentBorder(SynthContext ss, Graphics g, int tabPlacement, int selectedIndex) { int width = tabPane.getWidth(); int height = tabPane.getHeight(); @@ -683,7 +754,10 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh } } - + /** + * @inheritDoc + */ + @Override protected int calculateMaxTabHeight(int tabPlacement) { FontMetrics metrics = getFontMetrics(tabContext.getStyle().getFont( tabContext)); @@ -696,6 +770,10 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh return result; } + /** + * @inheritDoc + */ + @Override protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics) { Icon icon = getIconForTab(tabIndex); @@ -723,6 +801,10 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh return width; } + /** + * @inheritDoc + */ + @Override protected int calculateMaxTabWidth(int tabPlacement) { FontMetrics metrics = getFontMetrics(tabContext.getStyle().getFont( tabContext)); @@ -735,17 +817,25 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh return result; } + /** + * @inheritDoc + */ + @Override protected Insets getTabInsets(int tabPlacement, int tabIndex) { updateTabContext(tabIndex, false, false, false, (getFocusIndex() == tabIndex)); return tabInsets; } + /** + * @inheritDoc + */ + @Override protected FontMetrics getFontMetrics() { return getFontMetrics(tabContext.getStyle().getFont(tabContext)); } - protected FontMetrics getFontMetrics(Font font) { + private FontMetrics getFontMetrics(Font font) { return tabPane.getFontMetrics(font); } @@ -787,7 +877,8 @@ class SynthTabbedPaneUI extends BasicTabbedPaneUI implements SynthUI, PropertyCh * Overridden to create a TabbedPaneLayout subclass which takes into * account tabOverlap. */ - @Override protected LayoutManager createLayoutManager() { + @Override + protected LayoutManager createLayoutManager() { if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { return super.createLayoutManager(); } else { /* WRAP_TAB_LAYOUT */ diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableHeaderUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableHeaderUI.java index b37d9f1262d..f0104b42af1 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableHeaderUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableHeaderUI.java @@ -32,19 +32,18 @@ import javax.swing.border.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; import javax.swing.table.*; - -import sun.swing.DefaultLookup; -import sun.swing.plaf.synth.*; import sun.swing.table.*; /** - * SynthTableHeaderUI implementation + * Provides the Synth L&F UI delegate for + * {@link javax.swing.table.JTableHeader}. * * @author Alan Chung * @author Philip Milne + * @since 1.7 */ -class SynthTableHeaderUI extends BasicTableHeaderUI implements - PropertyChangeListener, SynthUI { +public class SynthTableHeaderUI extends BasicTableHeaderUI + implements PropertyChangeListener, SynthUI { // // Instance Variables @@ -54,10 +53,20 @@ class SynthTableHeaderUI extends BasicTableHeaderUI implements private SynthStyle style; + /** + * Creates a new UI object for the given component. + * + * @param h component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent h) { return new SynthTableHeaderUI(); } + /** + * @inheritDoc + */ + @Override protected void installDefaults() { prevRenderer = header.getDefaultRenderer(); if (prevRenderer instanceof UIResource) { @@ -79,11 +88,19 @@ class SynthTableHeaderUI extends BasicTableHeaderUI implements context.dispose(); } + /** + * @inheritDoc + */ + @Override protected void installListeners() { super.installListeners(); header.addPropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults() { if (header.getDefaultRenderer() instanceof HeaderRenderer) { header.setDefaultRenderer(prevRenderer); @@ -96,11 +113,28 @@ class SynthTableHeaderUI extends BasicTableHeaderUI implements style = null; } + /** + * @inheritDoc + */ + @Override protected void uninstallListeners() { header.removePropertyChangeListener(this); super.uninstallListeners(); } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -111,6 +145,16 @@ class SynthTableHeaderUI extends BasicTableHeaderUI implements context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -118,10 +162,21 @@ class SynthTableHeaderUI extends BasicTableHeaderUI implements context.dispose(); } + /** + * Paints the specified component. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { super.paint(g, context.getComponent()); } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintTableHeaderBorder(context, g, x, y, w, h); @@ -129,8 +184,12 @@ class SynthTableHeaderUI extends BasicTableHeaderUI implements // // SynthUI // + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { - return getContext(c, getComponentState(c)); + return getContext(c, SynthLookAndFeel.getComponentState(c)); } private SynthContext getContext(JComponent c, int state) { @@ -138,26 +197,25 @@ class SynthTableHeaderUI extends BasicTableHeaderUI implements SynthLookAndFeel.getRegion(c), style, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - - private int getComponentState(JComponent c) { - return SynthLookAndFeel.getComponentState(c); - } - - public void propertyChange(PropertyChangeEvent evt) { - if (SynthLookAndFeel.shouldUpdateStyle(evt)) { - updateStyle((JTableHeader)evt.getSource()); - } - } - + /** + * @inheritDoc + */ @Override protected void rolloverColumnUpdated(int oldColumn, int newColumn) { header.repaint(header.getHeaderRect(oldColumn)); header.repaint(header.getHeaderRect(newColumn)); } + /** + * @inheritDoc + */ + @Override + public void propertyChange(PropertyChangeEvent evt) { + if (SynthLookAndFeel.shouldUpdateStyle(evt)) { + updateStyle((JTableHeader)evt.getSource()); + } + } + private class HeaderRenderer extends DefaultTableCellHeaderRenderer { HeaderRenderer() { setHorizontalAlignment(JLabel.LEADING); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java index dcd6b6275bf..4c16e0b81bc 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java @@ -45,8 +45,7 @@ import javax.swing.JLabel; import javax.swing.JTable; import javax.swing.LookAndFeel; import javax.swing.border.Border; -import javax.swing.plaf.ComponentUI; -import javax.swing.plaf.UIResource; +import javax.swing.plaf.*; import javax.swing.plaf.basic.BasicTableUI; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.JTableHeader; @@ -54,15 +53,15 @@ import javax.swing.table.TableCellRenderer; import javax.swing.table.TableColumn; import javax.swing.table.TableColumnModel; -import sun.swing.plaf.synth.SynthUI; - /** - * SynthTableUI implementation + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JTable}. * * @author Philip Milne + * @since 1.7 */ -class SynthTableUI extends BasicTableUI implements SynthUI, - PropertyChangeListener { +public class SynthTableUI extends BasicTableUI + implements SynthUI, PropertyChangeListener { // // Instance Variables // @@ -88,18 +87,25 @@ class SynthTableUI extends BasicTableUI implements SynthUI, // The installation/uninstall procedures and support // + /** + * Creates a new UI object for the given component. + * + * @param c component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent c) { return new SynthTableUI(); } /** - * Initialize JTable properties, e.g. font, foreground, and background. + * Initializes JTable properties, such as font, foreground, and background. * The font, foreground, and background properties are only set if their * current value is either null or a UIResource, other properties are set * if the current value is null. * * @see #installUI */ + @Override protected void installDefaults() { dateRenderer = installRendererIfPossible(Date.class, null); numberRenderer = installRendererIfPossible(Number.class, null); @@ -151,7 +157,7 @@ class SynthTableUI extends BasicTableUI implements SynthUI, if (gridColor == null) { gridColor = style.getColor(context, ColorType.FOREGROUND); } - table.setGridColor(gridColor); + table.setGridColor(gridColor == null ? new ColorUIResource(Color.GRAY) : gridColor); } useTableColors = style.getBoolean(context, @@ -189,11 +195,16 @@ class SynthTableUI extends BasicTableUI implements SynthUI, /** * Attaches listeners to the JTable. */ + @Override protected void installListeners() { super.installListeners(); table.addPropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults() { table.setDefaultRenderer(Date.class, dateRenderer); table.setDefaultRenderer(Number.class, numberRenderer); @@ -213,6 +224,10 @@ class SynthTableUI extends BasicTableUI implements SynthUI, style = null; } + /** + * @inheritDoc + */ + @Override protected void uninstallListeners() { table.removePropertyChangeListener(this); super.uninstallListeners(); @@ -221,8 +236,13 @@ class SynthTableUI extends BasicTableUI implements SynthUI, // // SynthUI // + + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { - return getContext(c, getComponentState(c)); + return getContext(c, SynthLookAndFeel.getComponentState(c)); } private SynthContext getContext(JComponent c, int state) { @@ -230,18 +250,23 @@ class SynthTableUI extends BasicTableUI implements SynthUI, SynthLookAndFeel.getRegion(c), style, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - - private int getComponentState(JComponent c) { - return SynthLookAndFeel.getComponentState(c); - } - // // Paint methods and support // + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -252,11 +277,25 @@ class SynthTableUI extends BasicTableUI implements SynthUI, context.dispose(); } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintTableBorder(context, g, x, y, w, h); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -264,6 +303,13 @@ class SynthTableUI extends BasicTableUI implements SynthUI, context.dispose(); } + /** + * Paints the specified component. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { Rectangle clip = g.getClipBounds(); @@ -647,6 +693,10 @@ class SynthTableUI extends BasicTableUI implements SynthUI, } } + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent event) { if (SynthLookAndFeel.shouldUpdateStyle(event)) { updateStyle((JTable)event.getSource()); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java index 01947655afe..3c1e2cfec26 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextAreaUI.java @@ -33,7 +33,6 @@ import java.awt.*; import java.awt.event.FocusListener; import java.awt.event.FocusEvent; import java.beans.PropertyChangeEvent; -import sun.swing.plaf.synth.SynthUI; /** * Provides the look and feel for a plain text editor in the @@ -50,40 +49,42 @@ import sun.swing.plaf.synth.SynthUI; * Please see {@link java.beans.XMLEncoder}. * * @author Shannon Hickey + * @since 1.7 */ -class SynthTextAreaUI extends BasicTextAreaUI implements SynthUI, FocusListener { +public class SynthTextAreaUI extends BasicTextAreaUI implements SynthUI { + private Handler handler = new Handler(); private SynthStyle style; /** - * Creates a UI for a JTextArea. + * Creates a UI object for a JTextArea. * * @param ta a text area - * @return the UI + * @return the UI object */ public static ComponentUI createUI(JComponent ta) { return new SynthTextAreaUI(); } - public void focusGained(FocusEvent e) { - getComponent().repaint(); - } - - public void focusLost(FocusEvent e) { - getComponent().repaint(); - } - + /** + * @inheritDoc + */ + @Override protected void installDefaults() { // Installs the text cursor on the component super.installDefaults(); updateStyle(getComponent()); - getComponent().addFocusListener(this); + getComponent().addFocusListener(handler); } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults() { SynthContext context = getContext(getComponent(), ENABLED); getComponent().putClientProperty("caretAspectRatio", null); - getComponent().removeFocusListener(this); + getComponent().removeFocusListener(handler); style.uninstallDefaults(context); context.dispose(); @@ -91,10 +92,6 @@ class SynthTextAreaUI extends BasicTextAreaUI implements SynthUI, FocusListener super.uninstallDefaults(); } - public void installUI(JComponent c) { - super.installUI(c); - } - private void updateStyle(JTextComponent comp) { SynthContext context = getContext(comp, ENABLED); SynthStyle oldStyle = style; @@ -112,8 +109,12 @@ class SynthTextAreaUI extends BasicTextAreaUI implements SynthUI, FocusListener context.dispose(); } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { - return getContext(c, getComponentState(c)); + return getContext(c, SynthLookAndFeel.getComponentState(c)); } private SynthContext getContext(JComponent c, int state) { @@ -121,10 +122,19 @@ class SynthTextAreaUI extends BasicTextAreaUI implements SynthUI, FocusListener SynthLookAndFeel.getRegion(c), style, state); } - private int getComponentState(JComponent c) { - return SynthLookAndFeel.getComponentState(c); - } - + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -135,14 +145,31 @@ class SynthTextAreaUI extends BasicTextAreaUI implements SynthUI, FocusListener context.dispose(); } + /** + * Paints the specified component. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { super.paint(g, getComponent()); } + /** + * @inheritDoc + * + * Overridden to do nothing. + */ + @Override protected void paintBackground(Graphics g) { // Overriden to do nothing, all our painting is done from update/paint. } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintTextAreaBorder(context, g, x, y, w, h); @@ -158,10 +185,21 @@ class SynthTextAreaUI extends BasicTextAreaUI implements SynthUI, FocusListener * * @param evt the property change event */ + @Override protected void propertyChange(PropertyChangeEvent evt) { if (SynthLookAndFeel.shouldUpdateStyle(evt)) { updateStyle((JTextComponent)evt.getSource()); } super.propertyChange(evt); } + + private final class Handler implements FocusListener { + public void focusGained(FocusEvent e) { + getComponent().repaint(); + } + + public void focusLost(FocusEvent e) { + getComponent().repaint(); + } + } } diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java index 225a965d874..68d85013173 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextFieldUI.java @@ -27,7 +27,6 @@ package javax.swing.plaf.synth; import javax.swing.*; import javax.swing.text.*; -import javax.swing.event.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.BasicTextFieldUI; import java.awt.*; @@ -35,11 +34,9 @@ import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.beans.PropertyChangeEvent; -import sun.swing.plaf.synth.SynthUI; /** - * Basis of a look and feel for a JTextField in the Synth - * look and feel. + * Provides the Synth L&F UI delegate for {@link javax.swing.JTextField}. *

      * Warning: * Serialized objects of this class will not be compatible with @@ -51,27 +48,22 @@ import sun.swing.plaf.synth.SynthUI; * Please see {@link java.beans.XMLEncoder}. * * @author Shannon Hickey + * @since 1.7 */ -class SynthTextFieldUI - extends BasicTextFieldUI - implements SynthUI, FocusListener -{ +public class SynthTextFieldUI extends BasicTextFieldUI implements SynthUI { + private Handler handler = new Handler(); private SynthStyle style; /** * Creates a UI for a JTextField. * * @param c the text field - * @return the UI + * @return the UI object */ public static ComponentUI createUI(JComponent c) { return new SynthTextFieldUI(); } - public SynthTextFieldUI() { - super(); - } - private void updateStyle(JTextComponent comp) { SynthContext context = getContext(comp, ENABLED); SynthStyle oldStyle = style; @@ -155,8 +147,12 @@ class SynthTextFieldUI } } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { - return getContext(c, getComponentState(c)); + return getContext(c, SynthLookAndFeel.getComponentState(c)); } private SynthContext getContext(JComponent c, int state) { @@ -164,10 +160,19 @@ class SynthTextFieldUI SynthLookAndFeel.getRegion(c), style, state); } - private int getComponentState(JComponent c) { - return SynthLookAndFeel.getComponentState(c); - } - + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -178,12 +183,16 @@ class SynthTextFieldUI } /** - * Paints the interface. This is routed to the - * paintSafely method under the guarantee that - * the model won't change from the view of this thread - * while it's rendering (if the associated model is - * derived from AbstractDocument). This enables the + * Paints the specified component. + *

      This is routed to the {@link #paintSafely} method under + * the guarantee that the model does not change from the view of this + * thread while it is rendering (if the associated model is + * derived from {@code AbstractDocument}). This enables the * model to potentially be updated asynchronously. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) */ protected void paint(SynthContext context, Graphics g) { super.paint(g, getComponent()); @@ -194,11 +203,20 @@ class SynthTextFieldUI c.getWidth(), c.getHeight()); } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintTextFieldBorder(context, g, x, y, w, h); } + /** + * @inheritDoc + * Overridden to do nothing. + */ + @Override protected void paintBackground(Graphics g) { // Overriden to do nothing, all our painting is done from update/paint. } @@ -214,6 +232,7 @@ class SynthTextFieldUI * * @param evt the property change event */ + @Override protected void propertyChange(PropertyChangeEvent evt) { if (SynthLookAndFeel.shouldUpdateStyle(evt)) { updateStyle((JTextComponent)evt.getSource()); @@ -221,26 +240,26 @@ class SynthTextFieldUI super.propertyChange(evt); } - public void focusGained(FocusEvent e) { - getComponent().repaint(); - } - - public void focusLost(FocusEvent e) { - getComponent().repaint(); - } - + /** + * @inheritDoc + */ + @Override protected void installDefaults() { // Installs the text cursor on the component super.installDefaults(); updateStyle(getComponent()); - getComponent().addFocusListener(this); + getComponent().addFocusListener(handler); } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults() { SynthContext context = getContext(getComponent(), ENABLED); getComponent().putClientProperty("caretAspectRatio", null); - getComponent().removeFocusListener(this); + getComponent().removeFocusListener(handler); style.uninstallDefaults(context); context.dispose(); @@ -248,7 +267,13 @@ class SynthTextFieldUI super.uninstallDefaults(); } - public void installUI(JComponent c) { - super.installUI(c); + private final class Handler implements FocusListener { + public void focusGained(FocusEvent e) { + getComponent().repaint(); + } + + public void focusLost(FocusEvent e) { + getComponent().repaint(); + } } } diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java index ad2e51b4d34..0cef82e2e7a 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java @@ -45,14 +45,15 @@ import java.awt.*; * Please see {@link java.beans.XMLEncoder}. * * @author Shannon Hickey + * @since 1.7 */ -class SynthTextPaneUI extends SynthEditorPaneUI { +public class SynthTextPaneUI extends SynthEditorPaneUI { /** * Creates a UI for the JTextPane. * * @param c the JTextPane object - * @return the UI + * @return the UI object */ public static ComponentUI createUI(JComponent c) { return new SynthTextPaneUI(); @@ -65,10 +66,15 @@ class SynthTextPaneUI extends SynthEditorPaneUI { * * @return the name ("TextPane") */ + @Override protected String getPropertyPrefix() { return "TextPane"; } + /** + * @inheritDoc + */ + @Override public void installUI(JComponent c) { super.installUI(c); updateForeground(c.getForeground()); @@ -86,6 +92,7 @@ class SynthTextPaneUI extends SynthEditorPaneUI { * * @param evt the property change event */ + @Override protected void propertyChange(PropertyChangeEvent evt) { super.propertyChange(evt); @@ -150,11 +157,16 @@ class SynthTextPaneUI extends SynthEditorPaneUI { } } + @Override void paintBackground(SynthContext context, Graphics g, JComponent c) { context.getPainter().paintTextPaneBackground(context, g, 0, 0, c.getWidth(), c.getHeight()); } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintTextPaneBorder(context, g, x, y, w, h); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthToggleButtonUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthToggleButtonUI.java index d4b22baaf2b..ede8113849d 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthToggleButtonUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthToggleButtonUI.java @@ -31,18 +31,30 @@ import javax.swing.JComponent; import javax.swing.plaf.ComponentUI; /** - * Synth's ToggleButtonUI. - *

      + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JToggleButton}. + * * @author Jeff Dinkins + * @since 1.7 */ -class SynthToggleButtonUI extends SynthButtonUI { +public class SynthToggleButtonUI extends SynthButtonUI { // ******************************** // Create PLAF // ******************************** + + /** + * Creates a new UI object for the given component. + * + * @param b component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent b) { return new SynthToggleButtonUI(); } + /** + * @inheritDoc + */ @Override protected String getPropertyPrefix() { return "ToggleButton."; @@ -57,6 +69,9 @@ class SynthToggleButtonUI extends SynthButtonUI { } } + /** + * @inheritDoc + */ @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java index c49536c34e7..3bbfdec4f8a 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java @@ -42,39 +42,53 @@ import javax.swing.JToolBar; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicToolBarUI; import sun.swing.plaf.synth.SynthIcon; -import sun.swing.plaf.synth.SynthUI; /** - * A Synth L&F implementation of ToolBarUI. This implementation - * is a "combined" view/controller. - *

      + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JToolBar}. * + * @since 1.7 */ -class SynthToolBarUI extends BasicToolBarUI implements PropertyChangeListener, - SynthUI { - protected Icon handleIcon = null; - protected Rectangle contentRect = new Rectangle(); +public class SynthToolBarUI extends BasicToolBarUI + implements PropertyChangeListener, SynthUI { + private Icon handleIcon = null; + private Rectangle contentRect = new Rectangle(); private SynthStyle style; private SynthStyle contentStyle; private SynthStyle dragWindowStyle; + /** + * Creates a new UI object for the given component. + * + * @param c component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent c) { return new SynthToolBarUI(); } + /** + * @inheritDoc + */ @Override protected void installDefaults() { toolBar.setLayout(createLayout()); updateStyle(toolBar); } + /** + * @inheritDoc + */ @Override protected void installListeners() { super.installListeners(); toolBar.addPropertyChangeListener(this); } + /** + * @inheritDoc + */ @Override protected void uninstallListeners() { super.uninstallListeners(); @@ -106,6 +120,9 @@ class SynthToolBarUI extends BasicToolBarUI implements PropertyChangeListener, context.dispose(); } + /** + * @inheritDoc + */ @Override protected void uninstallDefaults() { SynthContext context = getContext(toolBar, ENABLED); @@ -131,18 +148,33 @@ class SynthToolBarUI extends BasicToolBarUI implements PropertyChangeListener, toolBar.setLayout(null); } + /** + * @inheritDoc + */ @Override protected void installComponents() {} + /** + * @inheritDoc + */ @Override protected void uninstallComponents() {} + /** + * Creates a {@code LayoutManager} to use with the toolbar. + * + * @return a {@code LayoutManager} instance + */ protected LayoutManager createLayout() { return new SynthToolBarLayoutManager(); } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { - return getContext(c, getComponentState(c)); + return getContext(c, SynthLookAndFeel.getComponentState(c)); } private SynthContext getContext(JComponent c, int state) { @@ -161,18 +193,22 @@ class SynthToolBarUI extends BasicToolBarUI implements PropertyChangeListener, style, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - - private int getComponentState(JComponent c) { - return SynthLookAndFeel.getComponentState(c); - } - private int getComponentState(JComponent c, Region region) { return SynthLookAndFeel.getComponentState(c); } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -185,6 +221,15 @@ class SynthToolBarUI extends BasicToolBarUI implements PropertyChangeListener, context.dispose(); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -193,24 +238,47 @@ class SynthToolBarUI extends BasicToolBarUI implements PropertyChangeListener, context.dispose(); } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintToolBarBorder(context, g, x, y, w, h, toolBar.getOrientation()); } - // Overloaded to do nothing so we can share listeners. + /** + * This implementation does nothing, because the {@code rollover} + * property of the {@code JToolBar} class is not used + * in the Synth Look and Feel. + */ @Override protected void setBorderToNonRollover(Component c) {} - // Overloaded to do nothing so we can share listeners. + /** + * This implementation does nothing, because the {@code rollover} + * property of the {@code JToolBar} class is not used + * in the Synth Look and Feel. + */ @Override protected void setBorderToRollover(Component c) {} - // Overloaded to do nothing so we can share listeners. + /** + * This implementation does nothing, because the {@code rollover} + * property of the {@code JToolBar} class is not used + * in the Synth Look and Feel. + */ @Override protected void setBorderToNormal(Component c) {} + /** + * Paints the toolbar. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { if (handleIcon != null && toolBar.isFloatable()) { int startX = toolBar.getComponentOrientation().isLeftToRight() ? @@ -227,7 +295,14 @@ class SynthToolBarUI extends BasicToolBarUI implements PropertyChangeListener, subcontext.dispose(); } - public void paintContent(SynthContext context, Graphics g, + /** + * Paints the toolbar content. + * + * @param context context for the component being painted + * @param g {@code Graphics} object used for painting + * @param bounds bounding box for the toolbar + */ + protected void paintContent(SynthContext context, Graphics g, Rectangle bounds) { SynthLookAndFeel.updateSubregion(context, g, bounds); context.getPainter().paintToolBarContentBackground(context, g, @@ -238,6 +313,9 @@ class SynthToolBarUI extends BasicToolBarUI implements PropertyChangeListener, toolBar.getOrientation()); } + /** + * @inheritDoc + */ @Override protected void paintDragWindow(Graphics g) { int w = dragWindow.getWidth(); @@ -258,6 +336,10 @@ class SynthToolBarUI extends BasicToolBarUI implements PropertyChangeListener, // PropertyChangeListener // + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent e) { if (SynthLookAndFeel.shouldUpdateStyle(e)) { updateStyle((JToolBar)e.getSource()); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolTipUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolTipUI.java index b129f9bedff..141c54e45da 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolTipUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolTipUI.java @@ -34,23 +34,33 @@ import javax.swing.plaf.basic.BasicHTML; import javax.swing.plaf.basic.BasicToolTipUI; import javax.swing.plaf.ComponentUI; import javax.swing.text.View; -import sun.swing.plaf.synth.SynthUI; /** - * Synth's ToolTipUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JToolTip}. * * @author Joshua Outwater + * @since 1.7 */ -class SynthToolTipUI extends BasicToolTipUI implements PropertyChangeListener, - SynthUI { +public class SynthToolTipUI extends BasicToolTipUI + implements PropertyChangeListener, SynthUI { private SynthStyle style; - + /** + * Creates a new UI object for the given component. + * + * @param c component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent c) { return new SynthToolTipUI(); } + /** + * @inheritDoc + */ + @Override protected void installDefaults(JComponent c) { updateStyle(c); } @@ -61,6 +71,10 @@ class SynthToolTipUI extends BasicToolTipUI implements PropertyChangeListener, context.dispose(); } + /** + * @inheritDoc + */ + @Override protected void uninstallDefaults(JComponent c) { SynthContext context = getContext(c, ENABLED); style.uninstallDefaults(context); @@ -68,14 +82,26 @@ class SynthToolTipUI extends BasicToolTipUI implements PropertyChangeListener, style = null; } + /** + * @inheritDoc + */ + @Override protected void installListeners(JComponent c) { c.addPropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override protected void uninstallListeners(JComponent c) { c.removePropertyChangeListener(this); } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { return getContext(c, getComponentState(c)); } @@ -85,10 +111,6 @@ class SynthToolTipUI extends BasicToolTipUI implements PropertyChangeListener, SynthLookAndFeel.getRegion(c), style, state); } - private Region getRegion(JComponent c) { - return SynthLookAndFeel.getRegion(c); - } - private int getComponentState(JComponent c) { JComponent comp = ((JToolTip)c).getComponent(); @@ -98,6 +120,19 @@ class SynthToolTipUI extends BasicToolTipUI implements PropertyChangeListener, return SynthLookAndFeel.getComponentState(c); } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -108,11 +143,25 @@ class SynthToolTipUI extends BasicToolTipUI implements PropertyChangeListener, context.dispose(); } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintToolTipBorder(context, g, x, y, w, h); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -120,9 +169,15 @@ class SynthToolTipUI extends BasicToolTipUI implements PropertyChangeListener, context.dispose(); } + /** + * Paints the specified component. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { JToolTip tip = (JToolTip)context.getComponent(); - String tipText = tip.getToolTipText(); Insets insets = tip.getInsets(); View v = (View)tip.getClientProperty(BasicHTML.propertyKey); @@ -140,6 +195,10 @@ class SynthToolTipUI extends BasicToolTipUI implements PropertyChangeListener, } } + /** + * @inheritDoc + */ + @Override public Dimension getPreferredSize(JComponent c) { SynthContext context = getContext(c); Insets insets = c.getInsets(); @@ -164,6 +223,10 @@ class SynthToolTipUI extends BasicToolTipUI implements PropertyChangeListener, return prefSize; } + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent e) { if (SynthLookAndFeel.shouldUpdateStyle(e)) { updateStyle((JToolTip)e.getSource()); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java index 47011a865d3..541ab659ce9 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java @@ -48,15 +48,16 @@ import javax.swing.tree.TreeCellRenderer; import javax.swing.tree.TreeModel; import javax.swing.tree.TreePath; import sun.swing.plaf.synth.SynthIcon; -import sun.swing.plaf.synth.SynthUI; /** - * Skinnable TreeUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JTree}. * * @author Scott Violet + * @since 1.7 */ -class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, - SynthUI { +public class SynthTreeUI extends BasicTreeUI + implements PropertyChangeListener, SynthUI { private SynthStyle style; private SynthStyle cellStyle; @@ -67,27 +68,33 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, private Object linesStyle; - private int leadRow; - private int padding; private boolean useTreeColors; - private Icon expandedIconWrapper; + private Icon expandedIconWrapper = new ExpandedIconWrapper(); + /** + * Creates a new UI object for the given component. + * + * @param x component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent x) { return new SynthTreeUI(); } - SynthTreeUI() { - expandedIconWrapper = new ExpandedIconWrapper(); - } - + /** + * @inheritDoc + */ @Override public Icon getExpandedIcon() { return expandedIconWrapper; } + /** + * @inheritDoc + */ @Override protected void installDefaults() { updateStyle(tree); @@ -148,15 +155,21 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, context.dispose(); } + /** + * @inheritDoc + */ @Override protected void installListeners() { super.installListeners(); tree.addPropertyChangeListener(this); } + /** + * @inheritDoc + */ @Override public SynthContext getContext(JComponent c) { - return getContext(c, getComponentState(c)); + return getContext(c, SynthLookAndFeel.getComponentState(c)); } private SynthContext getContext(JComponent c, int state) { @@ -164,14 +177,6 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, SynthLookAndFeel.getRegion(c), style, state); } - private Region getRegion(JTree c) { - return SynthLookAndFeel.getRegion(c); - } - - private int getComponentState(JComponent c) { - return SynthLookAndFeel.getComponentState(c); - } - private SynthContext getContext(JComponent c, Region region) { return getContext(c, region, getComponentState(c, region)); } @@ -187,6 +192,9 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, return ENABLED | SELECTED; } + /** + * @inheritDoc + */ @Override protected TreeCellEditor createDefaultCellEditor() { TreeCellRenderer renderer = tree.getCellRenderer(); @@ -202,11 +210,17 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, return editor; } + /** + * @inheritDoc + */ @Override protected TreeCellRenderer createDefaultCellRenderer() { return new SynthTreeCellRenderer(); } + /** + * @inheritDoc + */ @Override protected void uninstallDefaults() { SynthContext context = getContext(tree, ENABLED); @@ -226,12 +240,27 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, } } + /** + * @inheritDoc + */ @Override protected void uninstallListeners() { super.uninstallListeners(); tree.removePropertyChangeListener(this); } + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -243,11 +272,24 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, context.dispose(); } + /** + * @inheritDoc + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { context.getPainter().paintTreeBorder(context, g, x, y, w, h); } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -256,14 +298,17 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, context.dispose(); } - private void updateLeadRow() { - leadRow = getRowForPath(tree, tree.getLeadSelectionPath()); - } - + /** + * Paints the specified component. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { paintContext = context; - updateLeadRow(); + updateLeadSelectionRow(); Rectangle paintBounds = g.getClipBounds(); Insets insets = tree.getInsets(); @@ -288,7 +333,6 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, boolean isExpanded; boolean hasBeenExpanded; boolean isLeaf; - Rectangle boundsBuffer = new Rectangle(); Rectangle rowBounds = new Rectangle(0, 0, tree.getWidth(),0); Rectangle bounds; TreePath path; @@ -392,83 +436,6 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, rendererPane.removeAll(); } - private boolean isDropLine(JTree.DropLocation loc) { - return loc != null && loc.getPath() != null && loc.getChildIndex() != -1; - } - - private void paintDropLine(Graphics g) { - JTree.DropLocation loc = tree.getDropLocation(); - if (!isDropLine(loc)) { - return; - } - - Color c = (Color)style.get(paintContext, "Tree.dropLineColor"); - if (c != null) { - g.setColor(c); - Rectangle rect = getDropLineRect(loc); - g.fillRect(rect.x, rect.y, rect.width, rect.height); - } - } - - private Rectangle getDropLineRect(JTree.DropLocation loc) { - Rectangle rect; - TreePath path = loc.getPath(); - int index = loc.getChildIndex(); - boolean ltr = tree.getComponentOrientation().isLeftToRight(); - - Insets insets = tree.getInsets(); - - if (tree.getRowCount() == 0) { - rect = new Rectangle(insets.left, - insets.top, - tree.getWidth() - insets.left - insets.right, - 0); - } else { - int row = tree.getRowForPath(path); - TreeModel model = getModel(); - Object root = model.getRoot(); - - if (path.getLastPathComponent() == root - && index >= model.getChildCount(root)) { - - rect = tree.getRowBounds(tree.getRowCount() - 1); - rect.y = rect.y + rect.height; - Rectangle xRect; - - if (!tree.isRootVisible()) { - xRect = tree.getRowBounds(0); - } else if (model.getChildCount(root) == 0){ - xRect = tree.getRowBounds(0); - xRect.x += totalChildIndent; - xRect.width -= totalChildIndent + totalChildIndent; - } else { - TreePath lastChildPath = path.pathByAddingChild( - model.getChild(root, model.getChildCount(root) - 1)); - xRect = tree.getPathBounds(lastChildPath); - } - - rect.x = xRect.x; - rect.width = xRect.width; - } else { - rect = tree.getPathBounds(path.pathByAddingChild( - model.getChild(path.getLastPathComponent(), index))); - } - } - - if (rect.y != 0) { - rect.y--; - } - - if (!ltr) { - rect.x = rect.x + rect.width - 100; - } - - rect.width = 100; - rect.height = 2; - - return rect; - } - private void configureRenderer(SynthContext context) { TreeCellRenderer renderer = tree.getCellRenderer(); @@ -502,6 +469,9 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, } } + /** + * @inheritDoc + */ @Override protected void paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, @@ -516,6 +486,9 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, } } + /** + * @inheritDoc + */ @Override protected void paintHorizontalLine(Graphics g, JComponent c, int y, int left, int right) { @@ -523,6 +496,9 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, paintContext, "Tree.horizontalLine", g, left, y, right, y, linesStyle); } + /** + * @inheritDoc + */ @Override protected void paintVerticalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, @@ -532,6 +508,9 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, } } + /** + * @inheritDoc + */ @Override protected void paintVerticalLine(Graphics g, JComponent c, int x, int top, int bottom) { @@ -539,7 +518,7 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, paintContext, "Tree.verticalLine", g, x, top, x, bottom, linesStyle); } - protected void paintRow(TreeCellRenderer renderer, + private void paintRow(TreeCellRenderer renderer, DefaultTreeCellRenderer dtcr, SynthContext treeContext, SynthContext cellContext, Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, Rectangle rowBounds, @@ -558,7 +537,7 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, state |= SELECTED; } - if (tree.isFocusOwner() && row == leadRow) { + if (tree.isFocusOwner() && row == getLeadSelectionRow()) { state |= FOCUSED; } @@ -583,7 +562,7 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, int leadIndex; if (tree.hasFocus()) { - leadIndex = leadRow; + leadIndex = getLeadSelectionRow(); } else { leadIndex = -1; @@ -625,6 +604,9 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, paintContext.setComponentState(state); } + /** + * @inheritDoc + */ @Override protected void drawCentered(Component c, Graphics graphics, Icon icon, int x, int y) { @@ -636,6 +618,10 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, y - h/2, w, h); } + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent event) { if (SynthLookAndFeel.shouldUpdateStyle(event)) { updateStyle((JTree)event.getSource()); @@ -648,6 +634,24 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, } } + /** + * @inheritDoc + */ + @Override + protected void paintDropLine(Graphics g) { + JTree.DropLocation loc = tree.getDropLocation(); + if (!isDropLine(loc)) { + return; + } + + Color c = (Color)style.get(paintContext, "Tree.dropLineColor"); + if (c != null) { + g.setColor(c); + Rectangle rect = getDropLineRect(loc); + g.fillRect(rect.x, rect.y, rect.width, rect.height); + } + } + private void repaintDropLocation(JTree.DropLocation loc) { if (loc == null) { return; @@ -670,6 +674,9 @@ class SynthTreeUI extends BasicTreeUI implements PropertyChangeListener, } } + /** + * @inheritDoc + */ @Override protected int getRowX(int row, int depth) { return super.getRowX(row, depth) + padding; diff --git a/jdk/src/share/classes/sun/swing/plaf/synth/SynthUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthUI.java similarity index 86% rename from jdk/src/share/classes/sun/swing/plaf/synth/SynthUI.java rename to jdk/src/share/classes/javax/swing/plaf/synth/SynthUI.java index 0d9875f550d..0c14950ba99 100644 --- a/jdk/src/share/classes/sun/swing/plaf/synth/SynthUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthUI.java @@ -22,18 +22,19 @@ * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ -package sun.swing.plaf.synth; +package javax.swing.plaf.synth; import java.awt.Graphics; import javax.swing.JComponent; -import javax.swing.plaf.synth.*; /** * SynthUI is used to fetch the SynthContext for a particular Component. * * @author Scott Violet + * @since 1.7 */ public interface SynthUI extends SynthConstants { + /** * Returns the Context for the specified component. * @@ -44,6 +45,13 @@ public interface SynthUI extends SynthConstants { /** * Paints the border. + * + * @param context a component context + * @param g {@code Graphics} to paint on + * @param x the X coordinate + * @param y the Y coordinate + * @param w width of the border + * @param h height of the border */ public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h); diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthViewportUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthViewportUI.java index fcc1bb1b321..b3c137416d0 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthViewportUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthViewportUI.java @@ -25,40 +25,57 @@ package javax.swing.plaf.synth; -import java.awt.*; import java.beans.*; import javax.swing.*; -import javax.swing.border.*; import javax.swing.plaf.*; import java.awt.*; -import java.awt.event.*; -import sun.swing.plaf.synth.SynthUI; /** - * Synth's ViewportUI. + * Provides the Synth L&F UI delegate for + * {@link javax.swing.JViewport}. * + * @since 1.7 */ -class SynthViewportUI extends ViewportUI implements - PropertyChangeListener, SynthUI { +public class SynthViewportUI extends ViewportUI + implements PropertyChangeListener, SynthUI { private SynthStyle style; + /** + * Creates a new UI object for the given component. + * + * @param c component to create UI object for + * @return the UI object + */ public static ComponentUI createUI(JComponent c) { return new SynthViewportUI(); } + /** + * @inheritDoc + */ + @Override public void installUI(JComponent c) { super.installUI(c); installDefaults(c); installListeners(c); } + /** + * @inheritDoc + */ + @Override public void uninstallUI(JComponent c) { super.uninstallUI(c); uninstallListeners(c); uninstallDefaults(c); } + /** + * Installs defaults for a viewport. + * + * @param c a {@code JViewport} object + */ protected void installDefaults(JComponent c) { updateStyle(c); } @@ -85,14 +102,29 @@ class SynthViewportUI extends ViewportUI implements context.dispose(); } + /** + * Installs listeners into the viewport. + * + * @param c a {@code JViewport} object + */ protected void installListeners(JComponent c) { c.addPropertyChangeListener(this); } + /** + * Uninstalls listeners from the viewport. + * + * @param c a {@code JViewport} object + */ protected void uninstallListeners(JComponent c) { c.removePropertyChangeListener(this); } + /** + * Uninstalls defaults from a viewport. + * + * @param c a {@code JViewport} object + */ protected void uninstallDefaults(JComponent c) { SynthContext context = getContext(c, ENABLED); style.uninstallDefaults(context); @@ -100,8 +132,12 @@ class SynthViewportUI extends ViewportUI implements style = null; } + /** + * @inheritDoc + */ + @Override public SynthContext getContext(JComponent c) { - return getContext(c, getComponentState(c)); + return getContext(c, SynthLookAndFeel.getComponentState(c)); } private SynthContext getContext(JComponent c, int state) { @@ -113,10 +149,19 @@ class SynthViewportUI extends ViewportUI implements return SynthLookAndFeel.getRegion(c); } - private int getComponentState(JComponent c) { - return SynthLookAndFeel.getComponentState(c); - } - + /** + * Notifies this UI delegate to repaint the specified component. + * This method paints the component background, then calls + * the {@link #paint(SynthContext,Graphics)} method. + * + *

      In general, this method does not need to be overridden by subclasses. + * All Look and Feel rendering code should reside in the {@code paint} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void update(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -127,12 +172,33 @@ class SynthViewportUI extends ViewportUI implements context.dispose(); } + /** + * Paints the border. The method is never called, + * because the {@code JViewport} class does not support a border. + * This implementation does nothing. + * + * @param context a component context + * @param g the {@code Graphics} to paint on + * @param x the X coordinate + * @param y the Y coordinate + * @param w width of the border + * @param h height of the border + */ + @Override public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) { - // This does nothing on purpose, JViewport doesn't allow a border - // and therefor this will NEVER be called. } + /** + * Paints the specified component according to the Look and Feel. + *

      This method is not used by Synth Look and Feel. + * Painting is handled by the {@link #paint(SynthContext,Graphics)} method. + * + * @param g the {@code Graphics} object used for painting + * @param c the component being painted + * @see #paint(SynthContext,Graphics) + */ + @Override public void paint(Graphics g, JComponent c) { SynthContext context = getContext(c); @@ -140,9 +206,20 @@ class SynthViewportUI extends ViewportUI implements context.dispose(); } + /** + * Paints the specified component. This implementation does nothing. + * + * @param context context for the component being painted + * @param g the {@code Graphics} object used for painting + * @see #update(Graphics,JComponent) + */ protected void paint(SynthContext context, Graphics g) { } + /** + * @inheritDoc + */ + @Override public void propertyChange(PropertyChangeEvent e) { if (SynthLookAndFeel.shouldUpdateStyle(e)) { updateStyle((JComponent)e.getSource()); diff --git a/jdk/src/share/classes/javax/swing/text/DefaultEditorKit.java b/jdk/src/share/classes/javax/swing/text/DefaultEditorKit.java index 32c5c1fda3b..7651b9f2e7d 100644 --- a/jdk/src/share/classes/javax/swing/text/DefaultEditorKit.java +++ b/jdk/src/share/classes/javax/swing/text/DefaultEditorKit.java @@ -1461,13 +1461,17 @@ public class DefaultEditorKit extends EditorKit { // Make sure the new visible location contains // the location of dot, otherwise Caret will // cause an additional scroll. - adjustScrollIfNecessary(target, newVis, initialY, - newIndex); - if (select) { - target.moveCaretPosition(newIndex); - } - else { - target.setCaretPosition(newIndex); + int newY = getAdjustedY(target, newVis, newIndex); + + if (direction == -1 && newY <= initialY || direction == 1 && newY >= initialY) { + // Change index and correct newVis.y only if won't cause scrolling upward + newVis.y = newY; + + if (select) { + target.moveCaretPosition(newIndex); + } else { + target.setCaretPosition(newIndex); + } } } } catch (BadLocationException ble) { } @@ -1513,34 +1517,27 @@ public class DefaultEditorKit extends EditorKit { } /** - * Adjusts the rectangle that indicates the location to scroll to + * Returns adjustsed {@code y} position that indicates the location to scroll to * after selecting index. */ - private void adjustScrollIfNecessary(JTextComponent text, - Rectangle visible, int initialY, - int index) { + private int getAdjustedY(JTextComponent text, Rectangle visible, int index) { + int result = visible.y; + try { Rectangle dotBounds = text.modelToView(index); - if (dotBounds.y < visible.y || - (dotBounds.y > (visible.y + visible.height)) || - (dotBounds.y + dotBounds.height) > - (visible.y + visible.height)) { - int y; - - if (dotBounds.y < visible.y) { - y = dotBounds.y; - } - else { - y = dotBounds.y + dotBounds.height - visible.height; - } - if ((direction == -1 && y < initialY) || - (direction == 1 && y > initialY)) { - // Only adjust if won't cause scrolling upward. - visible.y = y; + if (dotBounds.y < visible.y) { + result = dotBounds.y; + } else { + if ((dotBounds.y > visible.y + visible.height) || + (dotBounds.y + dotBounds.height > visible.y + visible.height)) { + result = dotBounds.y + dotBounds.height - visible.height; } } - } catch (BadLocationException ble) {} + } catch (BadLocationException ble) { + } + + return result; } /** diff --git a/jdk/src/share/classes/org/ietf/jgss/GSSName.java b/jdk/src/share/classes/org/ietf/jgss/GSSName.java index f29efc74368..acc0ee55afb 100644 --- a/jdk/src/share/classes/org/ietf/jgss/GSSName.java +++ b/jdk/src/share/classes/org/ietf/jgss/GSSName.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -103,11 +103,12 @@ public interface GSSName { * follows: service@hostname.

      * * It represents the following Oid value:
      - * { 1(iso), 3(org), 6(dod), 1(internet), 5(security), - * 6(nametypes), 2(gss-host-based-services) } + * { iso(1) member-body(2) United + * States(840) mit(113554) infosys(1) gssapi(2) generic(1) service_name(4) + * } */ public static final Oid NT_HOSTBASED_SERVICE - = Oid.getInstance("1.3.6.1.5.6.2"); + = Oid.getInstance("1.2.840.113554.1.2.1.4"); /** * Name type to indicate a named user on a local system.

      diff --git a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignature.java b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignature.java index a758486e0cb..092681bd92d 100644 --- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignature.java +++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/DOMXMLSignature.java @@ -326,7 +326,7 @@ public final class DOMXMLSignature extends DOMStructure } // generate references and signature value - List allReferences = new ArrayList(si.getReferences()); + List allReferences = new ArrayList(); // traverse the Signature and register all objects with IDs that // may contain References @@ -356,6 +356,9 @@ public final class DOMXMLSignature extends DOMStructure } } } + // always add SignedInfo references after Manifest references so + // that Manifest reference are digested first + allReferences.addAll(si.getReferences()); // generate/digest each reference for (int i = 0, size = allReferences.size(); i < size; i++) { diff --git a/jdk/src/share/classes/sun/awt/AWTAccessor.java b/jdk/src/share/classes/sun/awt/AWTAccessor.java index c8bbc860877..79a75937c25 100644 --- a/jdk/src/share/classes/sun/awt/AWTAccessor.java +++ b/jdk/src/share/classes/sun/awt/AWTAccessor.java @@ -98,7 +98,7 @@ public final class AWTAccessor { * Returns whether the component is visible without invoking * any client code. */ - boolean isVisible_NoClientCode(Component comp); + boolean isVisible(Component comp); /** * Sets the RequestFocusController. @@ -114,6 +114,112 @@ public final class AWTAccessor { * Sets the appContext of the component. */ void setAppContext(Component comp, AppContext appContext); + + /** + * Returns the parent of the component. + */ + Container getParent(Component comp); + + /** + * Sets the parent of the component to the specified parent. + */ + void setParent(Component comp, Container parent); + + /** + * Resizes the component to the specified width and height. + */ + void setSize(Component comp, int width, int height); + + /** + * Returns the location of the component. + */ + Point getLocation(Component comp); + + /** + * Moves the component to the new location. + */ + void setLocation(Component comp, int x, int y); + + /** + * Determines whether this component is enabled. + */ + boolean isEnabled(Component comp); + + /** + * Determines whether this component is displayable. + */ + boolean isDisplayable(Component comp); + + /** + * Gets the cursor set in the component. + */ + Cursor getCursor(Component comp); + + /** + * Returns the peer of the component. + */ + ComponentPeer getPeer(Component comp); + + /** + * Sets the peer of the component to the specified peer. + */ + void setPeer(Component comp, ComponentPeer peer); + + /** + * Determines whether this component is lightweight. + */ + boolean isLightweight(Component comp); + + /** + * Returns whether or not paint messages received from + * the operating system should be ignored. + */ + boolean getIgnoreRepaint(Component comp); + + /** + * Returns the width of the component. + */ + int getWidth(Component comp); + + /** + * Returns the height of the component. + */ + int getHeight(Component comp); + + /** + * Returns the x coordinate of the component. + */ + int getX(Component comp); + + /** + * Returns the y coordinate of the component. + */ + int getY(Component comp); + + /** + * Gets the foreground color of this component. + */ + Color getForeground(Component comp); + + /** + * Gets the background color of this component. + */ + Color getBackground(Component comp); + + /** + * Sets the background of this component to the specified color. + */ + void setBackground(Component comp, Color background); + + /** + * Gets the font of the component. + */ + Font getFont(Component comp); + + /** + * Processes events occurring on this component. + */ + void processEvent(Component comp, AWTEvent e); } /* @@ -169,6 +275,22 @@ public final class AWTAccessor { * components in the specified window to the specified value. */ void setLWRequestStatus(Window changed, boolean status); + + /** + * Indicates whether this window should receive focus on subsequently + * being shown, or being moved to the front. + */ + boolean isAutoRequestFocus(Window w); + + /** + * Indicates whether the specified window is an utility window for TrayIcon. + */ + boolean isTrayIconWindow(Window w); + + /** + * Marks the specified window as an utility window for TrayIcon. + */ + void setTrayIconWindow(Window w, boolean isTrayIconWindow); } /* @@ -248,14 +370,14 @@ public final class AWTAccessor { * An accessor for the EventQueue class */ public interface EventQueueAccessor { - /* - * Gets the next event queue. - */ - EventQueue getNextQueue(EventQueue eventQueue); /* * Gets the event dispatch thread. */ Thread getDispatchThread(EventQueue eventQueue); + /* + * Checks if the current thread is EDT for the given EQ. + */ + public boolean isDispatchThreadImpl(EventQueue eventQueue); } /* @@ -268,6 +390,30 @@ public final class AWTAccessor { boolean isTrayIconPopup(PopupMenu popupMenu); } + /* + * An accessor for the FileDialog class + */ + public interface FileDialogAccessor { + /* + * Sets the files the user selects + */ + void setFiles(FileDialog fileDialog, String directory, String files[]); + + /* + * Sets the file the user selects + */ + void setFile(FileDialog fileDialog, String file); + + /* + * Sets the directory the user selects + */ + void setDirectory(FileDialog fileDialog, String directory); + + /* + * Returns whether the file dialog allows the multiple file selection. + */ + boolean isMultipleMode(FileDialog fileDialog); + } /* * The java.awt.Component class accessor object. @@ -309,6 +455,11 @@ public final class AWTAccessor { */ private static PopupMenuAccessor popupMenuAccessor; + /* + * The java.awt.FileDialog class accessor object. + */ + private static FileDialogAccessor fileDialogAccessor; + /* * Set an accessor object for the java.awt.Component class. */ @@ -445,4 +596,22 @@ public final class AWTAccessor { } return popupMenuAccessor; } + + /* + * Set an accessor object for the java.awt.FileDialog class. + */ + public static void setFileDialogAccessor(FileDialogAccessor fda) { + fileDialogAccessor = fda; + } + + /* + * Retrieve the accessor object for the java.awt.FileDialog class. + */ + public static FileDialogAccessor getFileDialogAccessor() { + if (fileDialogAccessor == null) { + unsafe.ensureClassInitialized(FileDialog.class); + } + return fileDialogAccessor; + } + } diff --git a/jdk/src/share/classes/sun/awt/AppContext.java b/jdk/src/share/classes/sun/awt/AppContext.java index 3dcabdc6358..882f0e3fe7c 100644 --- a/jdk/src/share/classes/sun/awt/AppContext.java +++ b/jdk/src/share/classes/sun/awt/AppContext.java @@ -43,6 +43,9 @@ import java.util.HashSet; import java.beans.PropertyChangeSupport; import java.beans.PropertyChangeListener; import sun.util.logging.PlatformLogger; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; /** * The AppContext is a table referenced by ThreadGroup which stores @@ -132,10 +135,17 @@ public final class AppContext { /* Since the contents of an AppContext are unique to each Java * session, this class should never be serialized. */ - /* The key to put()/get() the Java EventQueue into/from the AppContext. + /* + * The key to put()/get() the Java EventQueue into/from the AppContext. */ public static final Object EVENT_QUEUE_KEY = new StringBuffer("EventQueue"); + /* + * The keys to store EventQueue push/pop lock and condition. + */ + public final static Object EVENT_QUEUE_LOCK_KEY = new StringBuilder("EventQueue.Lock"); + public final static Object EVENT_QUEUE_COND_KEY = new StringBuilder("EventQueue.Condition"); + /* A map of AppContexts, referenced by ThreadGroup. */ private static final Map threadGroup2appContext = @@ -244,6 +254,13 @@ public final class AppContext { return Thread.currentThread().getContextClassLoader(); } }); + + // Initialize push/pop lock and its condition to be used by all the + // EventQueues within this AppContext + Lock eventQueuePushPopLock = new ReentrantLock(); + put(EVENT_QUEUE_LOCK_KEY, eventQueuePushPopLock); + Condition eventQueuePushPopCond = eventQueuePushPopLock.newCondition(); + put(EVENT_QUEUE_COND_KEY, eventQueuePushPopCond); } private static final ThreadLocal threadAppContext = diff --git a/jdk/src/share/classes/sun/awt/ComponentAccessor.java b/jdk/src/share/classes/sun/awt/ComponentAccessor.java deleted file mode 100644 index d186363e51b..00000000000 --- a/jdk/src/share/classes/sun/awt/ComponentAccessor.java +++ /dev/null @@ -1,483 +0,0 @@ -/* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - */ - -package sun.awt; - -import java.awt.Component; -import java.awt.Container; -import java.awt.AWTEvent; -import java.awt.Font; -import java.awt.Color; -import java.awt.Cursor; -import java.awt.Point; - -import java.awt.peer.ComponentPeer; - -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.InvocationTargetException; - -import sun.util.logging.PlatformLogger; - -import java.security.AccessController; -import java.security.PrivilegedAction; - -/** - * A collection of methods for modifying package private fields in AWT components. - * This class is meant to be used by Peer code only. Previously peer code - * got around this problem by modifying fields from native code. However - * as we move away from native code to Pure-java peers we need this class. - * - * @author Bino George - */ - - -public class ComponentAccessor -{ - private static Class componentClass; - private static Field fieldX; - private static Field fieldY; - private static Field fieldWidth; - private static Field fieldHeight; - private static Method methodGetParentNoClientCode; - private static Method methodGetFontNoClientCode; - private static Method methodProcessEvent; - private static Method methodEnableEvents; - private static Field fieldParent; - private static Field fieldBackground; - private static Field fieldForeground; - private static Field fieldFont; - private static Field fieldPacked; - private static Field fieldIgnoreRepaint; - private static Field fieldPeer; - private static Field fieldVisible; - private static Method methodIsEnabledImpl; - private static Method methodGetCursorNoClientCode; - private static Method methodLocationNoClientCode; - - private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.ComponentAccessor"); - - private ComponentAccessor() { - } - - static { - AccessController.doPrivileged( new PrivilegedAction() { - public Object run() { - try { - componentClass = Class.forName("java.awt.Component"); - fieldX = componentClass.getDeclaredField("x"); - fieldX.setAccessible(true); - fieldY = componentClass.getDeclaredField("y"); - fieldY.setAccessible(true); - fieldWidth = componentClass.getDeclaredField("width"); - fieldWidth.setAccessible(true); - fieldHeight = componentClass.getDeclaredField("height"); - fieldHeight.setAccessible(true); - fieldForeground = componentClass.getDeclaredField("foreground"); - fieldForeground.setAccessible(true); - fieldBackground = componentClass.getDeclaredField("background"); - fieldBackground.setAccessible(true); - fieldFont = componentClass.getDeclaredField("font"); - fieldFont.setAccessible(true); - methodGetParentNoClientCode = componentClass.getDeclaredMethod("getParent_NoClientCode", (Class[]) null); - methodGetParentNoClientCode.setAccessible(true); - methodGetFontNoClientCode = componentClass.getDeclaredMethod("getFont_NoClientCode", (Class[]) null); - methodGetFontNoClientCode.setAccessible(true); - Class[] argTypes = { AWTEvent.class }; - methodProcessEvent = componentClass.getDeclaredMethod("processEvent",argTypes); - methodProcessEvent.setAccessible(true); - Class[] argTypesForMethodEnableEvents = { Long.TYPE }; - methodEnableEvents = componentClass.getDeclaredMethod("enableEvents",argTypesForMethodEnableEvents); - methodEnableEvents.setAccessible(true); - - fieldParent = componentClass.getDeclaredField("parent"); - fieldParent.setAccessible(true); - fieldPacked = componentClass.getDeclaredField("isPacked"); - fieldPacked.setAccessible(true); - fieldIgnoreRepaint = componentClass.getDeclaredField("ignoreRepaint"); - fieldIgnoreRepaint.setAccessible(true); - - fieldPeer = componentClass.getDeclaredField("peer"); - fieldPeer.setAccessible(true); - - fieldVisible = componentClass.getDeclaredField("visible"); - fieldVisible.setAccessible(true); - - methodIsEnabledImpl = componentClass.getDeclaredMethod("isEnabledImpl", (Class[]) null); - methodIsEnabledImpl.setAccessible(true); - - methodGetCursorNoClientCode = componentClass.getDeclaredMethod("getCursor_NoClientCode", (Class[]) null); - methodGetCursorNoClientCode.setAccessible(true); - - methodLocationNoClientCode = componentClass.getDeclaredMethod("location_NoClientCode", (Class[]) null); - methodLocationNoClientCode.setAccessible(true); - } - catch (NoSuchFieldException e) { - log.fine("Unable to initialize ComponentAccessor", e); - } - catch (ClassNotFoundException e) { - log.fine("Unable to initialize ComponentAccessor", e); - } - catch (NoSuchMethodException e) { - log.fine("Unable to initialize ComponentAccessor", e); - } - // to please javac - return null; - } - }); - } - - public static void setX(Component c, int x) - { - try { - fieldX.setInt(c,x); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - } - - public static void setY(Component c, int y) - { - try { - fieldY.setInt(c,y); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - } - - public static void setWidth(Component c, int width) - { - try { - fieldWidth.setInt(c,width); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - } - - public static void setHeight(Component c, int height) - { - try { - fieldHeight.setInt(c,height); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - } - - public static void setBounds(Component c, int x, int y, int width, int height) - { - try { - fieldX.setInt(c,x); - fieldY.setInt(c,y); - fieldWidth.setInt(c,width); - fieldHeight.setInt(c,height); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - } - - public static int getX(Component c) { - try { - return fieldX.getInt(c); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - return 0; - } - - public static int getY(Component c) { - try { - return fieldY.getInt(c); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - return 0; - } - - public static int getWidth(Component c) { - try { - return fieldWidth.getInt(c); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - return 0; - } - - public static int getHeight(Component c) { - try { - return fieldHeight.getInt(c); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - return 0; - } - - public static boolean getIsPacked(Component c) { - try { - return fieldPacked.getBoolean(c); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - return false; - } - - public static Container getParent_NoClientCode(Component c) { - Container parent=null; - - try { - parent = (Container) methodGetParentNoClientCode.invoke(c, (Object[]) null); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - catch (InvocationTargetException e) { - log.fine("Unable to invoke on the Component object", e); - } - - return parent; - } - - public static Font getFont_NoClientCode(Component c) { - Font font=null; - - try { - font = (Font) methodGetFontNoClientCode.invoke(c, (Object[]) null); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - catch (InvocationTargetException e) { - log.fine("Unable to invoke on the Component object", e); - } - - return font; - } - - public static void processEvent(Component c, AWTEvent event) { - Font font=null; - - try { - Object[] args = new Object[1]; - args[0] = event; - methodProcessEvent.invoke(c,args); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - catch (InvocationTargetException e) { - log.fine("Unable to invoke on the Component object", e); - } - } - - public static void enableEvents(Component c, long event_mask) { - try { - Object[] args = new Object[1]; - args[0] = Long.valueOf(event_mask); - methodEnableEvents.invoke(c,args); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - catch (InvocationTargetException e) { - log.fine("Unable to invoke on the Component object", e); - } - } - - public static void setParent(Component c, Container parent) - { - try { - fieldParent.set(c,parent); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - } - - public static Color getForeground(Component c) - { - Color color = null; - try { - color = (Color) fieldForeground.get(c); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - return color; - } - - public static Color getBackground(Component c) - { - Color color = null; - try { - color = (Color) fieldBackground.get(c); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - return color; - } - - public static void setBackground(Component c, Color color) { - try { - fieldBackground.set(c, color); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - } - - public static Font getFont(Component c) - { - Font f = null; - try { - f = (Font) fieldFont.get(c); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - return f; - } - - public static ComponentPeer getPeer(Component c) { - ComponentPeer peer = null; - try { - peer = (ComponentPeer)fieldPeer.get(c); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - return peer; - } - - public static void setPeer(Component c, ComponentPeer peer) { - try { - fieldPeer.set(c, peer); - } catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - } - - public static boolean getIgnoreRepaint(Component comp) { - try { - return fieldIgnoreRepaint.getBoolean(comp); - } - catch (IllegalAccessException e) { - log.fine("Unable to access the Component object", e); - } - - return false; - } - - public static boolean getVisible(Component c) { - try { - return fieldVisible.getBoolean(c); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - return false; - } - - public static boolean isEnabledImpl(Component c) { - boolean enabled = true; - try { - enabled = (Boolean) methodIsEnabledImpl.invoke(c, (Object[]) null); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - catch (InvocationTargetException e) { - log.fine("Unable to invoke on the Component object", e); - } - return enabled; - } - - public static Cursor getCursor_NoClientCode(Component c) { - Cursor cursor = null; - - try { - cursor = (Cursor) methodGetCursorNoClientCode.invoke(c, (Object[]) null); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - catch (InvocationTargetException e) { - log.fine("Unable to invoke on the Component object", e); - } - - return cursor; - } - - public static Point getLocation_NoClientCode(Component c) { - Point loc = null; - - try { - loc = (Point) methodLocationNoClientCode.invoke(c, (Object[]) null); - } - catch (IllegalAccessException e) - { - log.fine("Unable to access the Component object", e); - } - catch (InvocationTargetException e) { - log.fine("Unable to invoke on the Component object", e); - } - - return loc; - } - -} diff --git a/jdk/src/share/classes/sun/awt/ExtendedKeyCodes.java b/jdk/src/share/classes/sun/awt/ExtendedKeyCodes.java index 37dfafb72ed..d6d72ac4ad7 100644 --- a/jdk/src/share/classes/sun/awt/ExtendedKeyCodes.java +++ b/jdk/src/share/classes/sun/awt/ExtendedKeyCodes.java @@ -13,7 +13,7 @@ public class ExtendedKeyCodes { */ // Keycodes declared in KeyEvent.java with corresponding Unicode values. private final static HashMap regularKeyCodesMap = - new HashMap(122, 1.0f); + new HashMap(83, 1.0f); // Keycodes derived from Unicode values. Here should be collected codes // for characters appearing on the primary layer of at least one @@ -22,7 +22,6 @@ public class ExtendedKeyCodes { private final static HashSet extendedKeyCodesSet = new HashSet(501, 1.0f); final public static int getExtendedKeyCodeForChar( int c ) { - int rc = KeyEvent.VK_UNDEFINED; int uc = Character.toUpperCase( c ); int lc = Character.toLowerCase( c ); if (regularKeyCodesMap.containsKey( c )) { @@ -38,22 +37,25 @@ public class ExtendedKeyCodes { }else if (extendedKeyCodesSet.contains( lc )) { return lc; } - return rc; + return KeyEvent.VK_UNDEFINED; } static { - regularKeyCodesMap.put(0x0a, KeyEvent.VK_ENTER); regularKeyCodesMap.put(0x08, KeyEvent.VK_BACK_SPACE); regularKeyCodesMap.put(0x09, KeyEvent.VK_TAB); + regularKeyCodesMap.put(0x0a, KeyEvent.VK_ENTER); regularKeyCodesMap.put(0x1B, KeyEvent.VK_ESCAPE); + regularKeyCodesMap.put(0x20AC, KeyEvent.VK_EURO_SIGN); regularKeyCodesMap.put(0x20, KeyEvent.VK_SPACE); - regularKeyCodesMap.put(0x21, KeyEvent.VK_PAGE_UP); - regularKeyCodesMap.put(0x22, KeyEvent.VK_PAGE_DOWN); - regularKeyCodesMap.put(0x23, KeyEvent.VK_END); - regularKeyCodesMap.put(0x24, KeyEvent.VK_HOME); - regularKeyCodesMap.put(0x25, KeyEvent.VK_LEFT); - regularKeyCodesMap.put(0x26, KeyEvent.VK_UP); - regularKeyCodesMap.put(0x27, KeyEvent.VK_RIGHT); - regularKeyCodesMap.put(0x28, KeyEvent.VK_DOWN); + regularKeyCodesMap.put(0x21, KeyEvent.VK_EXCLAMATION_MARK); + regularKeyCodesMap.put(0x22, KeyEvent.VK_QUOTEDBL); + regularKeyCodesMap.put(0x23, KeyEvent.VK_NUMBER_SIGN); + regularKeyCodesMap.put(0x24, KeyEvent.VK_DOLLAR); + regularKeyCodesMap.put(0x26, KeyEvent.VK_AMPERSAND); + regularKeyCodesMap.put(0x27, KeyEvent.VK_QUOTE); + regularKeyCodesMap.put(0x28, KeyEvent.VK_LEFT_PARENTHESIS); + regularKeyCodesMap.put(0x29, KeyEvent.VK_RIGHT_PARENTHESIS); + regularKeyCodesMap.put(0x2A, KeyEvent.VK_ASTERISK); + regularKeyCodesMap.put(0x2B, KeyEvent.VK_PLUS); regularKeyCodesMap.put(0x2C, KeyEvent.VK_COMMA); regularKeyCodesMap.put(0x2D, KeyEvent.VK_MINUS); regularKeyCodesMap.put(0x2E, KeyEvent.VK_PERIOD); @@ -68,102 +70,59 @@ public class ExtendedKeyCodes { regularKeyCodesMap.put(0x37, KeyEvent.VK_7); regularKeyCodesMap.put(0x38, KeyEvent.VK_8); regularKeyCodesMap.put(0x39, KeyEvent.VK_9); + regularKeyCodesMap.put(0x3A, KeyEvent.VK_COLON); regularKeyCodesMap.put(0x3B, KeyEvent.VK_SEMICOLON); + regularKeyCodesMap.put(0x3C, KeyEvent.VK_LESS); regularKeyCodesMap.put(0x3D, KeyEvent.VK_EQUALS); + regularKeyCodesMap.put(0x3E, KeyEvent.VK_GREATER); + regularKeyCodesMap.put(0x40, KeyEvent.VK_AT); regularKeyCodesMap.put(0x41, KeyEvent.VK_A); - regularKeyCodesMap.put(0x61, KeyEvent.VK_A); regularKeyCodesMap.put(0x42, KeyEvent.VK_B); - regularKeyCodesMap.put(0x62, KeyEvent.VK_B); regularKeyCodesMap.put(0x43, KeyEvent.VK_C); - regularKeyCodesMap.put(0x63, KeyEvent.VK_C); regularKeyCodesMap.put(0x44, KeyEvent.VK_D); - regularKeyCodesMap.put(0x64, KeyEvent.VK_D); regularKeyCodesMap.put(0x45, KeyEvent.VK_E); - regularKeyCodesMap.put(0x65, KeyEvent.VK_E); regularKeyCodesMap.put(0x46, KeyEvent.VK_F); - regularKeyCodesMap.put(0x66, KeyEvent.VK_F); regularKeyCodesMap.put(0x47, KeyEvent.VK_G); - regularKeyCodesMap.put(0x67, KeyEvent.VK_G); regularKeyCodesMap.put(0x48, KeyEvent.VK_H); - regularKeyCodesMap.put(0x68, KeyEvent.VK_H); regularKeyCodesMap.put(0x49, KeyEvent.VK_I); - regularKeyCodesMap.put(0x69, KeyEvent.VK_I); regularKeyCodesMap.put(0x4A, KeyEvent.VK_J); - regularKeyCodesMap.put(0x6A, KeyEvent.VK_J); regularKeyCodesMap.put(0x4B, KeyEvent.VK_K); - regularKeyCodesMap.put(0x6B, KeyEvent.VK_K); regularKeyCodesMap.put(0x4C, KeyEvent.VK_L); - regularKeyCodesMap.put(0x6C, KeyEvent.VK_L); regularKeyCodesMap.put(0x4D, KeyEvent.VK_M); - regularKeyCodesMap.put(0x6D, KeyEvent.VK_M); regularKeyCodesMap.put(0x4E, KeyEvent.VK_N); - regularKeyCodesMap.put(0x6E, KeyEvent.VK_N); regularKeyCodesMap.put(0x4F, KeyEvent.VK_O); - regularKeyCodesMap.put(0x6F, KeyEvent.VK_O); regularKeyCodesMap.put(0x50, KeyEvent.VK_P); - regularKeyCodesMap.put(0x70, KeyEvent.VK_P); regularKeyCodesMap.put(0x51, KeyEvent.VK_Q); - regularKeyCodesMap.put(0x71, KeyEvent.VK_Q); regularKeyCodesMap.put(0x52, KeyEvent.VK_R); - regularKeyCodesMap.put(0x72, KeyEvent.VK_R); regularKeyCodesMap.put(0x53, KeyEvent.VK_S); - regularKeyCodesMap.put(0x73, KeyEvent.VK_S); regularKeyCodesMap.put(0x54, KeyEvent.VK_T); - regularKeyCodesMap.put(0x74, KeyEvent.VK_T); regularKeyCodesMap.put(0x55, KeyEvent.VK_U); - regularKeyCodesMap.put(0x75, KeyEvent.VK_U); regularKeyCodesMap.put(0x56, KeyEvent.VK_V); - regularKeyCodesMap.put(0x76, KeyEvent.VK_V); regularKeyCodesMap.put(0x57, KeyEvent.VK_W); - regularKeyCodesMap.put(0x77, KeyEvent.VK_W); regularKeyCodesMap.put(0x58, KeyEvent.VK_X); - regularKeyCodesMap.put(0x78, KeyEvent.VK_X); regularKeyCodesMap.put(0x59, KeyEvent.VK_Y); - regularKeyCodesMap.put(0x79, KeyEvent.VK_Y); regularKeyCodesMap.put(0x5A, KeyEvent.VK_Z); - regularKeyCodesMap.put(0x7A, KeyEvent.VK_Z); regularKeyCodesMap.put(0x5B, KeyEvent.VK_OPEN_BRACKET); regularKeyCodesMap.put(0x5C, KeyEvent.VK_BACK_SLASH); regularKeyCodesMap.put(0x5D, KeyEvent.VK_CLOSE_BRACKET); -// regularKeyCodesMap.put(0x60, KeyEvent.VK_NUMPAD0); -// regularKeyCodesMap.put(0x61, KeyEvent.VK_NUMPAD1); -// regularKeyCodesMap.put(0x62, KeyEvent.VK_NUMPAD2); -// regularKeyCodesMap.put(0x63, KeyEvent.VK_NUMPAD3); -// regularKeyCodesMap.put(0x64, KeyEvent.VK_NUMPAD4); -// regularKeyCodesMap.put(0x65, KeyEvent.VK_NUMPAD5); -// regularKeyCodesMap.put(0x66, KeyEvent.VK_NUMPAD6); -// regularKeyCodesMap.put(0x67, KeyEvent.VK_NUMPAD7); -// regularKeyCodesMap.put(0x68, KeyEvent.VK_NUMPAD8); -// regularKeyCodesMap.put(0x69, KeyEvent.VK_NUMPAD9); - regularKeyCodesMap.put(0x6A, KeyEvent.VK_MULTIPLY); - regularKeyCodesMap.put(0x6B, KeyEvent.VK_ADD); - regularKeyCodesMap.put(0x6C, KeyEvent.VK_SEPARATER); - regularKeyCodesMap.put(0x6D, KeyEvent.VK_SUBTRACT); - regularKeyCodesMap.put(0x6E, KeyEvent.VK_DECIMAL); - regularKeyCodesMap.put(0x6F, KeyEvent.VK_DIVIDE); - regularKeyCodesMap.put(0x7F, KeyEvent.VK_DELETE); - regularKeyCodesMap.put(0xC0, KeyEvent.VK_BACK_QUOTE); - regularKeyCodesMap.put(0xDE, KeyEvent.VK_QUOTE); - regularKeyCodesMap.put(0x26, KeyEvent.VK_AMPERSAND); - regularKeyCodesMap.put(0x2A, KeyEvent.VK_ASTERISK); - regularKeyCodesMap.put(0x22, KeyEvent.VK_QUOTEDBL); - regularKeyCodesMap.put(0x3C, KeyEvent.VK_LESS); - regularKeyCodesMap.put(0x3E, KeyEvent.VK_GREATER); + regularKeyCodesMap.put(0x5E, KeyEvent.VK_CIRCUMFLEX); + regularKeyCodesMap.put(0x5F, KeyEvent.VK_UNDERSCORE); + regularKeyCodesMap.put(0x60, KeyEvent.VK_BACK_QUOTE); + regularKeyCodesMap.put(0x70, KeyEvent.VK_P); + regularKeyCodesMap.put(0x71, KeyEvent.VK_Q); + regularKeyCodesMap.put(0x72, KeyEvent.VK_R); + regularKeyCodesMap.put(0x73, KeyEvent.VK_S); + regularKeyCodesMap.put(0x74, KeyEvent.VK_T); + regularKeyCodesMap.put(0x75, KeyEvent.VK_U); + regularKeyCodesMap.put(0x76, KeyEvent.VK_V); + regularKeyCodesMap.put(0x77, KeyEvent.VK_W); + regularKeyCodesMap.put(0x78, KeyEvent.VK_X); + regularKeyCodesMap.put(0x79, KeyEvent.VK_Y); + regularKeyCodesMap.put(0x7A, KeyEvent.VK_Z); regularKeyCodesMap.put(0x7B, KeyEvent.VK_BRACELEFT); regularKeyCodesMap.put(0x7D, KeyEvent.VK_BRACERIGHT); - regularKeyCodesMap.put(0x40, KeyEvent.VK_AT); - regularKeyCodesMap.put(0x3A, KeyEvent.VK_COLON); - regularKeyCodesMap.put(0x5E, KeyEvent.VK_CIRCUMFLEX); - regularKeyCodesMap.put(0x24, KeyEvent.VK_DOLLAR); - regularKeyCodesMap.put(0x20AC, KeyEvent.VK_EURO_SIGN); - regularKeyCodesMap.put(0x21, KeyEvent.VK_EXCLAMATION_MARK); + regularKeyCodesMap.put(0x7F, KeyEvent.VK_DELETE); regularKeyCodesMap.put(0xA1, KeyEvent.VK_INVERTED_EXCLAMATION_MARK); - regularKeyCodesMap.put(0x28, KeyEvent.VK_LEFT_PARENTHESIS); - regularKeyCodesMap.put(0x23, KeyEvent.VK_NUMBER_SIGN); - regularKeyCodesMap.put(0x2B, KeyEvent.VK_PLUS); - regularKeyCodesMap.put(0x29, KeyEvent.VK_RIGHT_PARENTHESIS); - regularKeyCodesMap.put(0x5F, KeyEvent.VK_UNDERSCORE); - extendedKeyCodesSet.add(0x01000000+0x0060); extendedKeyCodesSet.add(0x01000000+0x007C); diff --git a/jdk/src/share/classes/sun/awt/GlobalCursorManager.java b/jdk/src/share/classes/sun/awt/GlobalCursorManager.java index ae54c2b014a..8a0eb4dd476 100644 --- a/jdk/src/share/classes/sun/awt/GlobalCursorManager.java +++ b/jdk/src/share/classes/sun/awt/GlobalCursorManager.java @@ -183,7 +183,7 @@ public abstract class GlobalCursorManager { } if (comp instanceof Window) { - p = ComponentAccessor.getLocation_NoClientCode(comp); + p = AWTAccessor.getComponentAccessor().getLocation(comp); } else if (comp instanceof Container) { p = getLocationOnScreen(comp); } @@ -202,7 +202,7 @@ public abstract class GlobalCursorManager { } } - setCursor(comp, ComponentAccessor.getCursor_NoClientCode(comp), useCache); + setCursor(comp, AWTAccessor.getComponentAccessor().getCursor(comp), useCache); } catch (IllegalComponentStateException e) { // Shouldn't happen, but if it does, abort. diff --git a/jdk/src/share/classes/sun/awt/SunToolkit.java b/jdk/src/share/classes/sun/awt/SunToolkit.java index e9bc0450bbd..31f577bd1ea 100644 --- a/jdk/src/share/classes/sun/awt/SunToolkit.java +++ b/jdk/src/share/classes/sun/awt/SunToolkit.java @@ -722,13 +722,7 @@ public abstract class SunToolkit extends Toolkit EventQueue eq = (EventQueue)appContext.get(AppContext.EVENT_QUEUE_KEY); AWTAccessor.EventQueueAccessor accessor = AWTAccessor.getEventQueueAccessor(); - EventQueue next = accessor.getNextQueue(eq); - while (next != null) { - eq = next; - next = accessor.getNextQueue(eq); - } - - return (Thread.currentThread() == accessor.getDispatchThread(eq)); + return accessor.isDispatchThreadImpl(eq); } public Dimension getScreenSize() { @@ -806,17 +800,9 @@ public abstract class SunToolkit extends Toolkit } - /** - * Makes the window OverrideRedirect, on X11 platforms. See - * ICCCM specification for more details about OverrideRedirect - * windows. Implemented in XToolkit, no-op in WToolkit. - */ - public void setOverrideRedirect(Window target) { - } + static final SoftCache imgCache = new SoftCache(); - static SoftCache imgCache = new SoftCache(); - - static synchronized Image getImageFromHash(Toolkit tk, URL url) { + static Image getImageFromHash(Toolkit tk, URL url) { SecurityManager sm = System.getSecurityManager(); if (sm != null) { try { @@ -844,32 +830,36 @@ public abstract class SunToolkit extends Toolkit sm.checkConnect(url.getHost(), url.getPort()); } } - Image img = (Image)imgCache.get(url); - if (img == null) { - try { - img = tk.createImage(new URLImageSource(url)); - imgCache.put(url, img); - } catch (Exception e) { + synchronized (imgCache) { + Image img = (Image)imgCache.get(url); + if (img == null) { + try { + img = tk.createImage(new URLImageSource(url)); + imgCache.put(url, img); + } catch (Exception e) { + } } + return img; } - return img; } - static synchronized Image getImageFromHash(Toolkit tk, + static Image getImageFromHash(Toolkit tk, String filename) { SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkRead(filename); } - Image img = (Image)imgCache.get(filename); - if (img == null) { - try { - img = tk.createImage(new FileImageSource(filename)); - imgCache.put(filename, img); - } catch (Exception e) { + synchronized (imgCache) { + Image img = (Image)imgCache.get(filename); + if (img == null) { + try { + img = tk.createImage(new FileImageSource(filename)); + imgCache.put(filename, img); + } catch (Exception e) { + } } + return img; } - return img; } public Image getImage(String filename) { @@ -1128,6 +1118,18 @@ public abstract class SunToolkit extends Toolkit return Toolkit.getNativeContainer(c); } + /** + * Gives native peers the ability to query the closest HW component. + * If the given component is heavyweight, then it returns this. Otherwise, + * it goes one level up in the hierarchy and tests next component. + */ + public static Component getHeavyweightComponent(Component c) { + while (c != null && AWTAccessor.getComponentAccessor().isLightweight(c)) { + c = AWTAccessor.getComponentAccessor().getParent(c); + } + return c; + } + /** * Returns a new input method window, with behavior as specified in * {@link java.awt.im.spi.InputMethodContext#createInputMethodWindow}. diff --git a/jdk/src/share/classes/sun/awt/WindowAccessor.java b/jdk/src/share/classes/sun/awt/WindowAccessor.java deleted file mode 100644 index e1fb7c4fc64..00000000000 --- a/jdk/src/share/classes/sun/awt/WindowAccessor.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - */ - -package sun.awt; - -import java.awt.Window; - -import java.lang.reflect.Field; - -import sun.util.logging.PlatformLogger; - -import java.security.AccessController; -import java.security.PrivilegedAction; - -public class WindowAccessor { - - private static Class windowClass; - private static Field fieldIsAutoRequestFocus; - private static Field fieldIsTrayIconWindow; - - private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.WindowAccessor"); - - private WindowAccessor() { - } - - static { - AccessController.doPrivileged( new PrivilegedAction() { - public Object run() { - try { - windowClass = Class.forName("java.awt.Window"); - fieldIsAutoRequestFocus = windowClass.getDeclaredField("autoRequestFocus"); - fieldIsAutoRequestFocus.setAccessible(true); - fieldIsTrayIconWindow = windowClass.getDeclaredField("isTrayIconWindow"); - fieldIsTrayIconWindow.setAccessible(true); - - } catch (NoSuchFieldException e) { - log.fine("Unable to initialize WindowAccessor: ", e); - } catch (ClassNotFoundException e) { - log.fine("Unable to initialize WindowAccessor: ", e); - } - return null; - } - }); - } - - public static boolean isAutoRequestFocus(Window w) { - try { - return fieldIsAutoRequestFocus.getBoolean(w); - - } catch (IllegalAccessException e) { - log.fine("Unable to access the Window object", e); - } - return true; - } - - public static boolean isTrayIconWindow(Window w) { - try { - return fieldIsTrayIconWindow.getBoolean(w); - - } catch (IllegalAccessException e) { - log.fine("Unable to access the Window object", e); - } - return false; - } - - public static void setTrayIconWindow(Window w, boolean isTrayIconWindow) { - try { - fieldIsTrayIconWindow.set(w, isTrayIconWindow); - - } catch (IllegalAccessException e) { - log.fine("Unable to access the Window object", e); - } - } -} diff --git a/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java b/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java index 277d3bd9e28..64ff903ac90 100644 --- a/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java +++ b/jdk/src/share/classes/sun/awt/datatransfer/DataTransferer.java @@ -51,6 +51,9 @@ import java.io.Reader; import java.io.SequenceInputStream; import java.io.StringReader; +import java.net.URI; +import java.net.URISyntaxException; + import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; @@ -625,6 +628,14 @@ public abstract class DataTransferer { */ public abstract boolean isImageFormat(long format); + /** + * Determines whether the format is a URI list we can convert to + * a DataFlavor.javaFileListFlavor. + */ + protected boolean isURIListFormat(long format) { + return false; + } + /** * Returns a Map whose keys are all of the possible formats into which the * Transferable's transfer data flavors can be translated. The value of @@ -1297,45 +1308,53 @@ search: if (!DataFlavor.javaFileListFlavor.equals(flavor)) { throw new IOException("data translation failed"); } - final List list = (List)obj; - final ArrayList fileList = new ArrayList(); + final List list = (List)obj; final ProtectionDomain userProtectionDomain = getUserProtectionDomain(contents); - int nFiles = 0; - for (int i = 0; i < list.size(); i++) { - Object o = list.get(i); - if (o instanceof File || o instanceof String) { - nFiles++; + final ArrayList fileList = castToFiles(list, userProtectionDomain); + + bos = convertFileListToBytes(fileList); + + + // Target data is a URI list. Source data must be a + // java.util.List which contains java.io.File or String instances. + } else if (isURIListFormat(format)) { + if (!DataFlavor.javaFileListFlavor.equals(flavor)) { + throw new IOException("data translation failed"); + } + String nat = getNativeForFormat(format); + String targetCharset = null; + if (nat != null) { + try { + targetCharset = new DataFlavor(nat).getParameter("charset"); + } catch (ClassNotFoundException cnfe) { + throw new IOException(cnfe); } } - - try { - AccessController.doPrivileged(new PrivilegedExceptionAction() { - public Object run() throws IOException { - for (Object fileObject : list) - { - File file = castToFile(fileObject); - if (null == System.getSecurityManager() || - !(isFileInWebstartedCache(file) || - isForbiddenToRead(file, userProtectionDomain))) - { - fileList.add(file.getCanonicalPath()); - } - } - return null; - } - }); - } catch (PrivilegedActionException pae) { - throw new IOException(pae.getMessage()); + if (targetCharset == null) { + targetCharset = "UTF-8"; } + final List list = (List)obj; + final ProtectionDomain userProtectionDomain = getUserProtectionDomain(contents); + final ArrayList fileList = castToFiles(list, userProtectionDomain); + final ArrayList uriList = new ArrayList(fileList.size()); + for (String fileObject : fileList) { + final URI uri = new File(fileObject).toURI(); + // Some implementations are fussy about the number of slashes (file:///path/to/file is best) + try { + uriList.add(new URI(uri.getScheme(), "", uri.getPath(), uri.getFragment()).toString()); + } catch (URISyntaxException uriSyntaxException) { + throw new IOException(uriSyntaxException); + } + } - for (int i = 0; i < fileList.size(); i++) - { - byte[] bytes = ((String)fileList.get(i)).getBytes(); - if (i != 0) bos.write(0); + byte[] eoln = "\r\n".getBytes(targetCharset); + for (int i = 0; i < uriList.size(); i++) { + byte[] bytes = uriList.get(i).getBytes(targetCharset); bos.write(bytes, 0, bytes.length); + bos.write(eoln, 0, eoln.length); } // Source data is an InputStream. For arbitrary flavors, just grab the @@ -1385,6 +1404,8 @@ search: return ret; } + protected abstract ByteArrayOutputStream convertFileListToBytes(ArrayList fileList) throws IOException; + private String removeSuspectedData(DataFlavor flavor, final Transferable contents, final String str) throws IOException { @@ -1452,6 +1473,33 @@ search: return true; } + private ArrayList castToFiles(final List files, + final ProtectionDomain userProtectionDomain) throws IOException + { + final ArrayList fileList = new ArrayList(); + try { + AccessController.doPrivileged(new PrivilegedExceptionAction() { + public Object run() throws IOException { + for (Object fileObject : files) + { + File file = castToFile(fileObject); + if (file != null && + (null == System.getSecurityManager() || + !(isFileInWebstartedCache(file) || + isForbiddenToRead(file, userProtectionDomain)))) + { + fileList.add(file.getCanonicalPath()); + } + } + return null; + } + }); + } catch (PrivilegedActionException pae) { + throw new IOException(pae.getMessage()); + } + return fileList; + } + // It is important do not use user's successors // of File class. private File castToFile(Object fileObject) throws IOException { @@ -1460,6 +1508,8 @@ search: filePath = ((File)fileObject).getCanonicalPath(); } else if (fileObject instanceof String) { filePath = (String) fileObject; + } else { + return null; } return new File(filePath); } @@ -1565,6 +1615,29 @@ search: // Turn the list of Files into a List and return return Arrays.asList(files); + // Source data is a URI list. Convert to DataFlavor.javaFileListFlavor + // where possible. + } else if (isURIListFormat(format) && DataFlavor.javaFileListFlavor.equals(flavor)) { + try { + URI uris[] = dragQueryURIs(str, bytes, format, localeTransferable); + if (uris == null) { + return null; + } + ArrayList files = new ArrayList(); + for (URI uri : uris) { + try { + files.add(new File(uri)); + } catch (IllegalArgumentException illegalArg) { + // When converting from URIs to less generic files, + // common practice (Wine, SWT) seems to be to + // silently drop the URIs that aren't local files. + } + } + return files; + } finally { + str.close(); + } + // Target data is a String. Strip terminating NUL bytes. Decode bytes // into characters. Search-and-replace EOLN. } else if (String.class.equals(flavor.getRepresentationClass()) && @@ -1949,6 +2022,19 @@ search: */ protected abstract String[] dragQueryFile(byte[] bytes); + /** + * Decodes URIs from either a byte array or a stream. + */ + protected URI[] dragQueryURIs(InputStream stream, + byte[] bytes, + long format, + Transferable localeTransferable) + throws IOException + { + throw new IOException( + new UnsupportedOperationException("not implemented on this platform")); + } + /** * Translates either a byte array or an input stream which contain * platform-specific image data in the given format into an Image. diff --git a/jdk/src/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java b/jdk/src/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java index a99907b03df..d6826dfabff 100644 --- a/jdk/src/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java +++ b/jdk/src/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,6 +67,8 @@ public abstract class SunDragSourceContextPeer implements DragSourceContextPeer private DragGestureEvent trigger; private Component component; private Cursor cursor; + private Image dragImage; + private Point dragImageOffset; private long nativeCtxt; private DragSourceContext dragSourceContext; private int sourceActions; @@ -120,6 +122,8 @@ public abstract class SunDragSourceContextPeer implements DragSourceContextPeer dragSourceContext = dsc; cursor = c; sourceActions = getDragSourceContext().getSourceActions(); + dragImage = di; + dragImageOffset = p; Transferable transferable = getDragSourceContext().getTransferable(); SortedMap formatMap = DataTransferer.getInstance().getFormatsForTransferable @@ -168,6 +172,31 @@ public abstract class SunDragSourceContextPeer implements DragSourceContextPeer return cursor; } + /** + * Returns the drag image. If there is no image to drag, + * the returned value is {@code null} + * + * @return the reference to the drag image + */ + public Image getDragImage() { + return dragImage; + } + + /** + * Returns an anchor offset for the image to drag. + * + * @return a {@code Point} object that corresponds + * to coordinates of an anchor offset of the image + * relative to the upper left corner of the image. + * The point {@code (0,0)} returns by default. + */ + public Point getDragImageOffset() { + if (dragImageOffset == null) { + return new Point(0,0); + } + return new Point(dragImageOffset); + } + /** * downcall into native code */ @@ -317,6 +346,8 @@ public abstract class SunDragSourceContextPeer implements DragSourceContextPeer startSecondaryEventLoop(); setNativeContext(0); + dragImage = null; + dragImageOffset = null; } public static void setDragDropInProgress(boolean b) diff --git a/jdk/src/share/classes/sun/dyn/AdapterMethodHandle.java b/jdk/src/share/classes/sun/dyn/AdapterMethodHandle.java index 334e0a563a7..3a2013551a3 100644 --- a/jdk/src/share/classes/sun/dyn/AdapterMethodHandle.java +++ b/jdk/src/share/classes/sun/dyn/AdapterMethodHandle.java @@ -30,7 +30,7 @@ import sun.dyn.util.Wrapper; import java.dyn.*; import java.util.Arrays; import static sun.dyn.MethodHandleNatives.Constants.*; -import static sun.dyn.MethodHandleImpl.newIllegalArgumentException; +import static sun.dyn.MemberName.newIllegalArgumentException; /** * This method handle performs simple conversion or checking of a single argument. @@ -302,7 +302,22 @@ public class AdapterMethodHandle extends BoundMethodHandle { */ private static int type2size(int type) { assert(type >= T_BOOLEAN && type <= T_OBJECT); - return (type == T_FLOAT || type == T_DOUBLE) ? 2 : 1; + return (type == T_LONG || type == T_DOUBLE) ? 2 : 1; + } + private static int type2size(Class type) { + return type2size(basicType(type)); + } + + /** The given stackMove is the number of slots pushed. + * It might be negative. Scale it (multiply) by the + * VM's notion of how an address changes with a push, + * to get the raw SP change for stackMove. + * Then shift and mask it into the correct field. + */ + private static long insertStackMove(int stackMove) { + // following variable must be long to avoid sign extension after '<<' + long spChange = stackMove * MethodHandleNatives.JVM_STACK_MOVE_UNIT; + return (spChange & CONV_STACK_MOVE_MASK) << CONV_STACK_MOVE_SHIFT; } /** Construct an adapter conversion descriptor for a single-argument conversion. */ @@ -310,16 +325,16 @@ public class AdapterMethodHandle extends BoundMethodHandle { assert(src == (src & 0xF)); assert(dest == (dest & 0xF)); assert(convOp >= OP_CHECK_CAST && convOp <= OP_PRIM_TO_REF); - long stackMove = type2size(dest) - type2size(src); + int stackMove = type2size(dest) - type2size(src); return ((long) argnum << 32 | (long) convOp << CONV_OP_SHIFT | (int) src << CONV_SRC_TYPE_SHIFT | (int) dest << CONV_DEST_TYPE_SHIFT | - stackMove << CONV_STACK_MOVE_SHIFT + insertStackMove(stackMove) ); } private static long makeConv(int convOp, int argnum, int stackMove) { - assert(convOp >= OP_SWAP_ARGS && convOp <= OP_SPREAD_ARGS); + assert(convOp >= OP_DUP_ARGS && convOp <= OP_SPREAD_ARGS); byte src = 0, dest = 0; if (convOp >= OP_COLLECT_ARGS && convOp <= OP_SPREAD_ARGS) src = dest = T_OBJECT; @@ -327,12 +342,21 @@ public class AdapterMethodHandle extends BoundMethodHandle { (long) convOp << CONV_OP_SHIFT | (int) src << CONV_SRC_TYPE_SHIFT | (int) dest << CONV_DEST_TYPE_SHIFT | - stackMove << CONV_STACK_MOVE_SHIFT + insertStackMove(stackMove) + ); + } + private static long makeSwapConv(int convOp, int srcArg, byte type, int destSlot) { + assert(convOp >= OP_SWAP_ARGS && convOp <= OP_ROT_ARGS); + return ((long) srcArg << 32 | + (long) convOp << CONV_OP_SHIFT | + (int) type << CONV_SRC_TYPE_SHIFT | + (int) type << CONV_DEST_TYPE_SHIFT | + (int) destSlot << CONV_VMINFO_SHIFT ); } private static long makeConv(int convOp) { - assert(convOp == OP_RETYPE_ONLY); - return (long) convOp << CONV_OP_SHIFT; // stackMove, src, dst, argnum all zero + assert(convOp == OP_RETYPE_ONLY || convOp == OP_RETYPE_RAW); + return ((long)-1 << 32) | (convOp << CONV_OP_SHIFT); // stackMove, src, dst all zero } private static int convCode(long conv) { return (int)conv; @@ -348,16 +372,6 @@ public class AdapterMethodHandle extends BoundMethodHandle { /** One of OP_RETYPE_ONLY, etc. */ int conversionOp() { return (conversion & CONV_OP_MASK) >> CONV_OP_SHIFT; } - @Override - public String toString() { - return addTypeString(this, "Adapted[" + basicToString(nonAdapter((MethodHandle)vmtarget)) + "]"); - } - - private static MethodHandle nonAdapter(MethodHandle mh) { - return (MethodHandle) - MethodHandleNatives.getTarget(mh, ETF_DIRECT_HANDLE); - } - /* Return one plus the position of the first non-trivial difference * between the given types. This is not a symmetric operation; * we are considering adapting the targetType to adapterType. @@ -399,14 +413,14 @@ public class AdapterMethodHandle extends BoundMethodHandle { //if (false) return 1; // never adaptable! return -1; // some significant difference } - private static int diffParamTypes(MethodType adapterType, int tstart, - MethodType targetType, int astart, + private static int diffParamTypes(MethodType adapterType, int astart, + MethodType targetType, int tstart, int nargs, boolean raw) { assert(nargs >= 0); int res = 0; for (int i = 0; i < nargs; i++) { - Class src = adapterType.parameterType(tstart+i); - Class dest = targetType.parameterType(astart+i); + Class src = adapterType.parameterType(astart+i); + Class dest = targetType.parameterType(tstart+i); if ((!raw ? VerifyType.canPassUnchecked(src, dest) : VerifyType.canPassRaw(src, dest) @@ -422,7 +436,7 @@ public class AdapterMethodHandle extends BoundMethodHandle { /** Can a retyping adapter (alone) validly convert the target to newType? */ public static boolean canRetypeOnly(MethodType newType, MethodType targetType) { - return canRetypeOnly(newType, targetType, false); + return canRetype(newType, targetType, false); } /** Can a retyping adapter (alone) convert the target to newType? * It is allowed to widen subword types and void to int, to make bitwise @@ -430,14 +444,14 @@ public class AdapterMethodHandle extends BoundMethodHandle { * reference conversions on return. This last feature requires that the * caller be trusted, and perform explicit cast conversions on return values. */ - static boolean canRawRetypeOnly(MethodType newType, MethodType targetType) { - return canRetypeOnly(newType, targetType, true); + public static boolean canRetypeRaw(MethodType newType, MethodType targetType) { + return canRetype(newType, targetType, true); } - static boolean canRetypeOnly(MethodType newType, MethodType targetType, boolean raw) { - if (!convOpSupported(OP_RETYPE_ONLY)) return false; + static boolean canRetype(MethodType newType, MethodType targetType, boolean raw) { + if (!convOpSupported(raw ? OP_RETYPE_RAW : OP_RETYPE_ONLY)) return false; int diff = diffTypes(newType, targetType, raw); // %%% This assert is too strong. Factor diff into VerifyType and reconcile. - assert((diff == 0) == VerifyType.isNullConversion(newType, targetType)); + assert(raw || (diff == 0) == VerifyType.isNullConversion(newType, targetType)); return diff == 0; } @@ -447,19 +461,21 @@ public class AdapterMethodHandle extends BoundMethodHandle { */ public static MethodHandle makeRetypeOnly(Access token, MethodType newType, MethodHandle target) { - return makeRetypeOnly(token, newType, target, false); + return makeRetype(token, newType, target, false); } - public static MethodHandle makeRawRetypeOnly(Access token, + public static MethodHandle makeRetypeRaw(Access token, MethodType newType, MethodHandle target) { - return makeRetypeOnly(token, newType, target, true); + return makeRetype(token, newType, target, true); } - static MethodHandle makeRetypeOnly(Access token, + static MethodHandle makeRetype(Access token, MethodType newType, MethodHandle target, boolean raw) { Access.check(token); - if (!canRetypeOnly(newType, target.type(), raw)) + MethodType oldType = target.type(); + if (oldType == newType) return target; + if (!canRetype(newType, oldType, raw)) return null; // TO DO: clone the target guy, whatever he is, with new type. - return new AdapterMethodHandle(target, newType, makeConv(OP_RETYPE_ONLY)); + return new AdapterMethodHandle(target, newType, makeConv(raw ? OP_RETYPE_RAW : OP_RETYPE_ONLY)); } /** Can a checkcast adapter validly convert the target to newType? @@ -492,7 +508,7 @@ public class AdapterMethodHandle extends BoundMethodHandle { Access.check(token); if (!canCheckCast(newType, target.type(), arg, castType)) return null; - long conv = makeConv(OP_CHECK_CAST, arg, 0); + long conv = makeConv(OP_CHECK_CAST, arg, T_OBJECT, T_OBJECT); return new AdapterMethodHandle(target, newType, conv, castType); } @@ -537,10 +553,9 @@ public class AdapterMethodHandle extends BoundMethodHandle { int arg, Class convType) { Access.check(token); MethodType oldType = target.type(); - Class src = newType.parameterType(arg); - Class dst = oldType.parameterType(arg); if (!canPrimCast(newType, oldType, arg, convType)) return null; + Class src = newType.parameterType(arg); long conv = makeConv(OP_PRIM_TO_PRIM, arg, basicType(src), basicType(convType)); return new AdapterMethodHandle(target, newType, conv); } @@ -607,8 +622,6 @@ public class AdapterMethodHandle extends BoundMethodHandle { return null; } - // TO DO: makeSwapArguments, makeRotateArguments, makeDuplicateArguments - /** Can an adapter simply drop arguments to convert the target to newType? */ public static boolean canDropArguments(MethodType newType, MethodType targetType, int dropArgPos, int dropArgCount) { @@ -643,26 +656,195 @@ public class AdapterMethodHandle extends BoundMethodHandle { Access.check(token); if (dropArgCount == 0) return makeRetypeOnly(IMPL_TOKEN, newType, target); - MethodType mt = target.type(); - int argCount = mt.parameterCount(); - if (!canDropArguments(newType, mt, dropArgPos, dropArgCount)) + if (!canDropArguments(newType, target.type(), dropArgPos, dropArgCount)) return null; - int dropSlotCount, dropSlotPos; - if (dropArgCount >= argCount) { - assert(dropArgPos == argCount-1); - dropSlotPos = 0; - dropSlotCount = mt.parameterSlotCount(); + // in arglist: [0: ...keep1 | dpos: drop... | dpos+dcount: keep2... ] + // out arglist: [0: ...keep1 | dpos: keep2... ] + int keep2InPos = dropArgPos + dropArgCount; + int dropSlot = newType.parameterSlotDepth(keep2InPos); + int keep1InSlot = newType.parameterSlotDepth(dropArgPos); + int slotCount = keep1InSlot - dropSlot; + assert(slotCount >= dropArgCount); + assert(target.type().parameterSlotCount() + slotCount == newType.parameterSlotCount()); + long conv = makeConv(OP_DROP_ARGS, dropArgPos + dropArgCount - 1, -slotCount); + return new AdapterMethodHandle(target, newType, conv); + } + + /** Can an adapter duplicate an argument to convert the target to newType? */ + public static boolean canDupArguments(MethodType newType, MethodType targetType, + int dupArgPos, int dupArgCount) { + if (!convOpSupported(OP_DUP_ARGS)) return false; + if (diffReturnTypes(newType, targetType, false) != 0) + return false; + int nptypes = newType.parameterCount(); + if (dupArgCount < 0 || dupArgPos + dupArgCount > nptypes) + return false; + if (targetType.parameterCount() != nptypes + dupArgCount) + return false; + // parameter types must be the same up to the duplicated arguments + if (diffParamTypes(newType, 0, targetType, 0, nptypes, false) != 0) + return false; + // duplicated types must be, well, duplicates + if (diffParamTypes(newType, dupArgPos, targetType, nptypes, dupArgCount, false) != 0) + return false; + return true; + } + + /** Factory method: Duplicate the selected argument. + * Return null if this is not possible. + */ + public static MethodHandle makeDupArguments(Access token, + MethodType newType, MethodHandle target, + int dupArgPos, int dupArgCount) { + Access.check(token); + if (!canDupArguments(newType, target.type(), dupArgPos, dupArgCount)) + return null; + if (dupArgCount == 0) + return target; + // in arglist: [0: ...keep1 | dpos: dup... | dpos+dcount: keep2... ] + // out arglist: [0: ...keep1 | dpos: dup... | dpos+dcount: keep2... | dup... ] + int keep2InPos = dupArgPos + dupArgCount; + int dupSlot = newType.parameterSlotDepth(keep2InPos); + int keep1InSlot = newType.parameterSlotDepth(dupArgPos); + int slotCount = keep1InSlot - dupSlot; + assert(target.type().parameterSlotCount() - slotCount == newType.parameterSlotCount()); + long conv = makeConv(OP_DUP_ARGS, dupArgPos + dupArgCount - 1, slotCount); + return new AdapterMethodHandle(target, newType, conv); + } + + /** Can an adapter swap two arguments to convert the target to newType? */ + public static boolean canSwapArguments(MethodType newType, MethodType targetType, + int swapArg1, int swapArg2) { + if (!convOpSupported(OP_SWAP_ARGS)) return false; + if (diffReturnTypes(newType, targetType, false) != 0) + return false; + if (swapArg1 >= swapArg2) return false; // caller resp + int nptypes = newType.parameterCount(); + if (targetType.parameterCount() != nptypes) + return false; + if (swapArg1 < 0 || swapArg2 >= nptypes) + return false; + if (diffParamTypes(newType, 0, targetType, 0, swapArg1, false) != 0) + return false; + if (diffParamTypes(newType, swapArg1, targetType, swapArg2, 1, false) != 0) + return false; + if (diffParamTypes(newType, swapArg1+1, targetType, swapArg1+1, swapArg2-swapArg1-1, false) != 0) + return false; + if (diffParamTypes(newType, swapArg2, targetType, swapArg1, 1, false) != 0) + return false; + if (diffParamTypes(newType, swapArg2+1, targetType, swapArg2+1, nptypes-swapArg2-1, false) != 0) + return false; + return true; + } + + /** Factory method: Swap the selected arguments. + * Return null if this is not possible. + */ + public static MethodHandle makeSwapArguments(Access token, + MethodType newType, MethodHandle target, + int swapArg1, int swapArg2) { + Access.check(token); + if (swapArg1 == swapArg2) + return target; + if (swapArg1 > swapArg2) { int t = swapArg1; swapArg1 = swapArg2; swapArg2 = t; } + if (!canSwapArguments(newType, target.type(), swapArg1, swapArg2)) + return null; + Class swapType = newType.parameterType(swapArg1); + // in arglist: [0: ...keep1 | pos1: a1 | pos1+1: keep2... | pos2: a2 | pos2+1: keep3... ] + // out arglist: [0: ...keep1 | pos1: a2 | pos1+1: keep2... | pos2: a1 | pos2+1: keep3... ] + int swapSlot2 = newType.parameterSlotDepth(swapArg2 + 1); + long conv = makeSwapConv(OP_SWAP_ARGS, swapArg1, basicType(swapType), swapSlot2); + return new AdapterMethodHandle(target, newType, conv); + } + + static int positiveRotation(int argCount, int rotateBy) { + assert(argCount > 0); + if (rotateBy >= 0) { + if (rotateBy < argCount) + return rotateBy; + return rotateBy % argCount; + } else if (rotateBy >= -argCount) { + return rotateBy + argCount; } else { - // arglist: [0: keep... | dpos: drop... | dpos+dcount: keep... ] - int lastDroppedArg = dropArgPos + dropArgCount - 1; - int lastKeptArg = dropArgPos - 1; // might be -1, which is OK - dropSlotPos = mt.parameterSlotDepth(1+lastDroppedArg); - int lastKeptSlot = mt.parameterSlotDepth(1+lastKeptArg); - dropSlotCount = lastKeptSlot - dropSlotPos; - assert(dropSlotCount >= dropArgCount); + return (-1-((-1-rotateBy) % argCount)) + argCount; } - long conv = makeConv(OP_DROP_ARGS, dropArgPos, +dropSlotCount); - return new AdapterMethodHandle(target, newType, dropSlotCount, conv); + } + + final static int MAX_ARG_ROTATION = 1; + + /** Can an adapter rotate arguments to convert the target to newType? */ + public static boolean canRotateArguments(MethodType newType, MethodType targetType, + int firstArg, int argCount, int rotateBy) { + if (!convOpSupported(OP_ROT_ARGS)) return false; + if (argCount <= 2) return false; // must be a swap, not a rotate + rotateBy = positiveRotation(argCount, rotateBy); + if (rotateBy == 0) return false; // no rotation + if (rotateBy > MAX_ARG_ROTATION && rotateBy < argCount - MAX_ARG_ROTATION) + return false; // too many argument positions + // Rotate incoming args right N to the out args, N in 1..(argCouunt-1). + if (diffReturnTypes(newType, targetType, false) != 0) + return false; + int nptypes = newType.parameterCount(); + if (targetType.parameterCount() != nptypes) + return false; + if (firstArg < 0 || firstArg >= nptypes) return false; + int argLimit = firstArg + argCount; + if (argLimit > nptypes) return false; + if (diffParamTypes(newType, 0, targetType, 0, firstArg, false) != 0) + return false; + int newChunk1 = argCount - rotateBy, newChunk2 = rotateBy; + // swap new chunk1 with target chunk2 + if (diffParamTypes(newType, firstArg, targetType, argLimit-newChunk1, newChunk1, false) != 0) + return false; + // swap new chunk2 with target chunk1 + if (diffParamTypes(newType, firstArg+newChunk1, targetType, firstArg, newChunk2, false) != 0) + return false; + return true; + } + + /** Factory method: Rotate the selected argument range. + * Return null if this is not possible. + */ + public static MethodHandle makeRotateArguments(Access token, + MethodType newType, MethodHandle target, + int firstArg, int argCount, int rotateBy) { + Access.check(token); + rotateBy = positiveRotation(argCount, rotateBy); + if (!canRotateArguments(newType, target.type(), firstArg, argCount, rotateBy)) + return null; + // Decide whether it should be done as a right or left rotation, + // on the JVM stack. Return the number of stack slots to rotate by, + // positive if right, negative if left. + int limit = firstArg + argCount; + int depth0 = newType.parameterSlotDepth(firstArg); + int depth1 = newType.parameterSlotDepth(limit-rotateBy); + int depth2 = newType.parameterSlotDepth(limit); + int chunk1Slots = depth0 - depth1; assert(chunk1Slots > 0); + int chunk2Slots = depth1 - depth2; assert(chunk2Slots > 0); + // From here on out, it assumes a single-argument shift. + assert(MAX_ARG_ROTATION == 1); + int srcArg, dstArg; + byte basicType; + if (chunk2Slots <= chunk1Slots) { + // Rotate right/down N (rotateBy = +N, N small, c2 small): + // in arglist: [0: ...keep1 | arg1: c1... | limit-N: c2 | limit: keep2... ] + // out arglist: [0: ...keep1 | arg1: c2 | arg1+N: c1... | limit: keep2... ] + srcArg = limit-1; + dstArg = firstArg; + basicType = basicType(newType.parameterType(srcArg)); + assert(chunk2Slots == type2size(basicType)); + } else { + // Rotate left/up N (rotateBy = -N, N small, c1 small): + // in arglist: [0: ...keep1 | arg1: c1 | arg1+N: c2... | limit: keep2... ] + // out arglist: [0: ...keep1 | arg1: c2 ... | limit-N: c1 | limit: keep2... ] + srcArg = firstArg; + dstArg = limit-1; + basicType = basicType(newType.parameterType(srcArg)); + assert(chunk1Slots == type2size(basicType)); + } + int dstSlot = newType.parameterSlotDepth(dstArg + 1); + long conv = makeSwapConv(OP_ROT_ARGS, srcArg, basicType, dstSlot); + return new AdapterMethodHandle(target, newType, conv); } /** Can an adapter spread an argument to convert the target to newType? */ @@ -676,10 +858,10 @@ public class AdapterMethodHandle extends BoundMethodHandle { if (spreadArgPos != 0 && diffParamTypes(newType, 0, targetType, 0, spreadArgPos, false) != 0) return false; int afterPos = spreadArgPos + spreadArgCount; - int afterCount = nptypes - afterPos; + int afterCount = nptypes - (spreadArgPos + 1); if (spreadArgPos < 0 || spreadArgPos >= nptypes || spreadArgCount < 0 || - targetType.parameterCount() != nptypes - 1 + spreadArgCount) + targetType.parameterCount() != afterPos + afterCount) return false; // parameter types after the spread point must also be the same if (afterCount != 0 && diffParamTypes(newType, spreadArgPos+1, targetType, afterPos, afterCount, false) != 0) @@ -697,32 +879,40 @@ public class AdapterMethodHandle extends BoundMethodHandle { return true; } + /** Factory method: Spread selected argument. */ public static MethodHandle makeSpreadArguments(Access token, MethodType newType, MethodHandle target, Class spreadArgType, int spreadArgPos, int spreadArgCount) { Access.check(token); - MethodType mt = target.type(); - int argCount = mt.parameterCount(); - if (!canSpreadArguments(newType, mt, spreadArgType, spreadArgPos, spreadArgCount)) + MethodType targetType = target.type(); + if (!canSpreadArguments(newType, targetType, spreadArgType, spreadArgPos, spreadArgCount)) return null; - int spreadSlotCount, spreadSlotPos; - if (spreadArgCount >= argCount) { - assert(spreadArgPos == argCount-1); - spreadSlotPos = 0; - spreadSlotCount = mt.parameterSlotCount(); - } else { - // arglist: [0: keep... | dpos: spread... | dpos+dcount: keep... ] - int lastSpreadArg = spreadArgPos + spreadArgCount - 1; - int lastKeptArg = spreadArgPos - 1; // might be -1, which is OK - spreadSlotPos = mt.parameterSlotDepth(1+lastSpreadArg); - int lastKeptSlot = mt.parameterSlotDepth(1+lastKeptArg); - spreadSlotCount = lastKeptSlot - spreadSlotPos; - assert(spreadSlotCount >= spreadArgCount); - } - long conv = makeConv(OP_SPREAD_ARGS, spreadArgPos, spreadSlotCount); - return new AdapterMethodHandle(target, newType, conv, spreadArgType); + // in arglist: [0: ...keep1 | spos: spreadArg | spos+1: keep2... ] + // out arglist: [0: ...keep1 | spos: spread... | spos+scount: keep2... ] + int keep2OutPos = spreadArgPos + spreadArgCount; + int spreadSlot = targetType.parameterSlotDepth(keep2OutPos); + int keep1OutSlot = targetType.parameterSlotDepth(spreadArgPos); + int slotCount = keep1OutSlot - spreadSlot; + assert(spreadSlot == newType.parameterSlotDepth(spreadArgPos+1)); + assert(slotCount >= spreadArgCount); + long conv = makeConv(OP_SPREAD_ARGS, spreadArgPos, slotCount-1); + MethodHandle res = new AdapterMethodHandle(target, newType, conv, spreadArgType); + assert(res.type().parameterType(spreadArgPos) == spreadArgType); + return res; } // TO DO: makeCollectArguments, makeFlyby, makeRicochet + + @Override + public String toString() { + return nonAdapter((MethodHandle)vmtarget).toString(); + } + + private static MethodHandle nonAdapter(MethodHandle mh) { + while (mh instanceof AdapterMethodHandle) { + mh = (MethodHandle) mh.vmtarget; + } + return mh; + } } diff --git a/jdk/src/share/classes/sun/dyn/BoundMethodHandle.java b/jdk/src/share/classes/sun/dyn/BoundMethodHandle.java index b0c511c2171..66bf2c97323 100644 --- a/jdk/src/share/classes/sun/dyn/BoundMethodHandle.java +++ b/jdk/src/share/classes/sun/dyn/BoundMethodHandle.java @@ -28,6 +28,10 @@ package sun.dyn; import sun.dyn.util.VerifyType; import sun.dyn.util.Wrapper; import java.dyn.*; +import java.util.List; +import sun.dyn.MethodHandleNatives.Constants; +import static sun.dyn.MethodHandleImpl.IMPL_LOOKUP; +import static sun.dyn.MemberName.newIllegalArgumentException; /** * The flavor of method handle which emulates an invoke instruction @@ -35,18 +39,23 @@ import java.dyn.*; * when the handle is created, not when it is invoked. * @author jrose */ -public class BoundMethodHandle extends MethodHandle { +public class BoundMethodHandle extends MethodHandle { //MethodHandle vmtarget; // next BMH or final DMH or methodOop private final Object argument; // argument to insert private final int vmargslot; // position at which it is inserted + private static final Access IMPL_TOKEN = Access.getToken(); + private static final MemberName.Factory IMPL_NAMES = MemberName.getFactory(IMPL_TOKEN); + // Constructors in this class *must* be package scoped or private. + // Exception: JavaMethodHandle constructors are protected. + // (The link between JMH and BMH is temporary.) /** Bind a direct MH to its receiver (or first ref. argument). * The JVM will pre-dispatch the MH if it is not already static. */ BoundMethodHandle(DirectMethodHandle mh, Object argument) { - super(Access.TOKEN, mh.type().dropParameterType(0)); + super(Access.TOKEN, mh.type().dropParameterTypes(0, 1)); // check the type now, once for all: this.argument = checkReferenceArgument(argument, mh, 0); this.vmargslot = this.type().parameterSlotCount(); @@ -56,32 +65,34 @@ public class BoundMethodHandle extends MethodHandle { } else { this.vmtarget = mh; } - } - - private static final int REF_ARG = 0, PRIM_ARG = 1, SELF_ARG = 2; + } /** Insert an argument into an arbitrary method handle. * If argnum is zero, inserts the first argument, etc. * The argument type must be a reference. */ BoundMethodHandle(MethodHandle mh, Object argument, int argnum) { - this(mh, argument, argnum, mh.type().parameterType(argnum).isPrimitive() ? PRIM_ARG : REF_ARG); + this(mh.type().dropParameterTypes(argnum, argnum+1), + mh, argument, argnum); } /** Insert an argument into an arbitrary method handle. * If argnum is zero, inserts the first argument, etc. */ - BoundMethodHandle(MethodHandle mh, Object argument, int argnum, int whichArg) { - super(Access.TOKEN, mh.type().dropParameterType(argnum)); - if (whichArg == PRIM_ARG) + BoundMethodHandle(MethodType type, MethodHandle mh, Object argument, int argnum) { + super(Access.TOKEN, type); + if (mh.type().parameterType(argnum).isPrimitive()) this.argument = bindPrimitiveArgument(argument, mh, argnum); else { - if (whichArg == SELF_ARG) argument = this; this.argument = checkReferenceArgument(argument, mh, argnum); } - this.vmargslot = this.type().parameterSlotDepth(argnum); + this.vmargslot = type.parameterSlotDepth(argnum); + initTarget(mh, argnum); + } + + private void initTarget(MethodHandle mh, int argnum) { if (MethodHandleNatives.JVM_SUPPORT) { - this.vmtarget = null; // maybe updated by JVM + this.vmtarget = null; // maybe updated by JVM MethodHandleNatives.init(this, mh, argnum); } else { this.vmtarget = mh; @@ -97,29 +108,65 @@ public class BoundMethodHandle extends MethodHandle { assert(this.getClass() == AdapterMethodHandle.class); } - /** Initialize the current object as a method handle, binding it - * as the {@code argnum}th argument of the method handle {@code entryPoint}. - * The invocation type of the resulting method handle will be the - * same as {@code entryPoint}, except that the {@code argnum}th argument - * type will be dropped. - */ - public BoundMethodHandle(MethodHandle entryPoint, int argnum) { - this(entryPoint, null, argnum, SELF_ARG); - - // Note: If the conversion fails, perhaps because of a bad entryPoint, - // the MethodHandle.type field will not be filled in, and therefore - // no MH.invoke call will ever succeed. The caller may retain a pointer - // to the broken method handle, but no harm can be done with it. - } - - /** Initialize the current object as a method handle, binding it + /** Initialize the current object as a Java method handle, binding it * as the first argument of the method handle {@code entryPoint}. * The invocation type of the resulting method handle will be the * same as {@code entryPoint}, except that the first argument * type will be dropped. */ - public BoundMethodHandle(MethodHandle entryPoint) { - this(entryPoint, null, 0, SELF_ARG); + protected BoundMethodHandle(MethodHandle entryPoint) { + super(Access.TOKEN, entryPoint.type().dropParameterTypes(0, 1)); + this.argument = this; // kludge; get rid of + this.vmargslot = this.type().parameterSlotDepth(0); + initTarget(entryPoint, 0); + assert(this instanceof JavaMethodHandle); + } + + /** Initialize the current object as a Java method handle. + */ + protected BoundMethodHandle(String entryPointName, MethodType type, boolean matchArity) { + super(Access.TOKEN, null); + MethodHandle entryPoint + = findJavaMethodHandleEntryPoint(this.getClass(), + entryPointName, type, matchArity); + MethodHandleImpl.initType(this, entryPoint.type().dropParameterTypes(0, 1)); + this.argument = this; // kludge; get rid of + this.vmargslot = this.type().parameterSlotDepth(0); + initTarget(entryPoint, 0); + assert(this instanceof JavaMethodHandle); + } + + private static + MethodHandle findJavaMethodHandleEntryPoint(Class caller, + String name, + MethodType type, + boolean matchArity) { + if (matchArity) type.getClass(); // elicit NPE + List methods = IMPL_NAMES.getMethods(caller, true, name, null, caller); + MethodType foundType = null; + MemberName foundMethod = null; + for (MemberName method : methods) { + MethodType mtype = method.getMethodType(); + if (type != null && type.parameterCount() != mtype.parameterCount()) + continue; + else if (foundType == null) + foundType = mtype; + else if (foundType != mtype) + throw newIllegalArgumentException("more than one method named "+name+" in "+caller.getName()); + // discard overrides + if (foundMethod == null) + foundMethod = method; + else if (foundMethod.getDeclaringClass().isAssignableFrom(method.getDeclaringClass())) + foundMethod = method; + } + if (foundMethod == null) + throw newIllegalArgumentException("no method named "+name+" in "+caller.getName()); + MethodHandle entryPoint = MethodHandleImpl.findMethod(IMPL_TOKEN, foundMethod, true, caller); + if (type != null) { + MethodType epType = type.insertParameterTypes(0, entryPoint.type().parameterType(0)); + entryPoint = MethodHandles.convertArguments(entryPoint, epType); + } + return entryPoint; } /** Make sure the given {@code argument} can be used as {@code argnum}-th @@ -175,6 +222,24 @@ public class BoundMethodHandle extends MethodHandle { @Override public String toString() { - return "Bound[" + super.toString() + "]"; + MethodHandle mh = this; + while (mh instanceof BoundMethodHandle) { + Object info = MethodHandleNatives.getTargetInfo(mh); + if (info instanceof MethodHandle) { + mh = (MethodHandle) info; + } else { + String name = null; + if (info instanceof MemberName) + name = ((MemberName)info).getName(); + if (name != null) + return name; + else + return super.toString(); // , probably + } + assert(mh != this); + if (mh instanceof JavaMethodHandle) + break; // access JMH.toString(), not BMH.toString() + } + return mh.toString(); } } diff --git a/jdk/src/share/classes/sun/dyn/CallSiteImpl.java b/jdk/src/share/classes/sun/dyn/CallSiteImpl.java index c5ac600eacd..247aaf1e83f 100644 --- a/jdk/src/share/classes/sun/dyn/CallSiteImpl.java +++ b/jdk/src/share/classes/sun/dyn/CallSiteImpl.java @@ -26,34 +26,51 @@ package sun.dyn; import java.dyn.*; +import java.util.logging.Level; +import java.util.logging.Logger; /** - * The CallSite privately created by the JVM at every invokedynamic instruction. + * Parts of CallSite known to the JVM. + * FIXME: Merge all this into CallSite proper. * @author jrose */ -class CallSiteImpl extends CallSite { - // Fields used only by the JVM. Do not use or change. +public class CallSiteImpl { + // Field used only by the JVM. Do not use or change. private Object vmmethod; // Values supplied by the JVM: - int callerMID, callerBCI; + protected int callerMID, callerBCI; - private CallSiteImpl(Class caller, String name, MethodType type) { - super(caller, name, type); + private MethodHandle target; + protected final Object caller; // usually a class + protected final String name; + protected final MethodType type; + + /** called only directly from CallSite() */ + protected CallSiteImpl(Access token, Object caller, String name, MethodType type) { + Access.check(token); + this.caller = caller; + this.name = name; + this.type = type; } - @Override - public void setTarget(MethodHandle mh) { - checkTarget(mh); - if (MethodHandleNatives.JVM_SUPPORT) - MethodHandleNatives.linkCallSite(this, (MethodHandle) mh); - else - super.setTarget(mh); + /** native version of setTarget */ + protected void setTarget(MethodHandle mh) { + //System.out.println("setTarget "+this+" := "+mh); + // XXX I don't know how to fix this properly. +// if (false && MethodHandleNatives.JVM_SUPPORT) // FIXME: enable this +// MethodHandleNatives.linkCallSite(this, mh); +// else + this.target = mh; + } + + protected MethodHandle getTarget() { + return target; } private static final MethodHandle PRIVATE_INITIALIZE_CALL_SITE = MethodHandleImpl.IMPL_LOOKUP.findStatic(CallSite.class, "privateInitializeCallSite", - MethodType.make(void.class, CallSite.class, int.class, int.class)); + MethodType.methodType(void.class, CallSite.class, int.class, int.class)); // this is the up-call from the JVM: static CallSite makeSite(Class caller, String name, MethodType type, @@ -61,10 +78,25 @@ class CallSiteImpl extends CallSite { MethodHandle bsm = Linkage.getBootstrapMethod(caller); if (bsm == null) throw new InvokeDynamicBootstrapError("class has no bootstrap method: "+caller); - CallSite site = bsm.invoke(caller, name, type); + CallSite site; + try { + site = bsm.invoke(caller, name, type); + } catch (Throwable ex) { + throw new InvokeDynamicBootstrapError("exception thrown while linking", ex); + } if (site == null) throw new InvokeDynamicBootstrapError("class bootstrap method failed to create a call site: "+caller); - PRIVATE_INITIALIZE_CALL_SITE.invoke(site, callerMID, callerBCI); + if (site.type() != type) + throw new InvokeDynamicBootstrapError("call site type not initialized correctly: "+site); + if (site.callerClass() != caller) + throw new InvokeDynamicBootstrapError("call site caller not initialized correctly: "+site); + if ((Object)site.name() != name) + throw new InvokeDynamicBootstrapError("call site name not initialized correctly: "+site); + try { + PRIVATE_INITIALIZE_CALL_SITE.invoke(site, callerMID, callerBCI); + } catch (Throwable ex) { + throw new InvokeDynamicBootstrapError("call site initialization exception", ex); + } return site; } } diff --git a/jdk/src/share/classes/sun/dyn/FilterGeneric.java b/jdk/src/share/classes/sun/dyn/FilterGeneric.java index a746ad21b95..37c4f40d231 100644 --- a/jdk/src/share/classes/sun/dyn/FilterGeneric.java +++ b/jdk/src/share/classes/sun/dyn/FilterGeneric.java @@ -31,174 +31,159 @@ import java.dyn.MethodType; import java.dyn.NoAccessException; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; +import static sun.dyn.MemberName.newIllegalArgumentException; /** - * "Flyby adapters" which apply arbitrary conversions to arguments + * These adapters apply arbitrary conversions to arguments * on the way to a ultimate target. * For simplicity, these are all generically typed. * @author jrose */ class FilterGeneric { - // type for the outgoing call (will be generic) - private final MethodType targetType; - // position of (first) argument to participate in filtering - private final short argumentPosition; - // number of arguments to participate in filtering - private final short argumentCount; - // how the result interacts with the filtered arguments: Prepend, Append, Replace, Discard - private final char replaceMode; - // prototype adapter (clone and customize for each new target & conversion!) - private final Adapter adapter; - // entry point for adapter (Adapter mh, a...) => ... - private final MethodHandle entryPoint; - // more of them (loosely cached) - private FilterGeneric variations; + // type for the incoming call (will be generic) + private final MethodType entryType; + // prototype adapters (clone and customize for each new target & conversion!) + private final Adapter[] adapters; - /** Compute and cache information common to all unboxing adapters - * that can call out to targets of the erasure-family of the given erased type. + /** Compute and cache information common to all filtering adapters + * with the given generic type */ - // TO DO: Make this private. - FilterGeneric(MethodType targetType, short argumentPosition, short argumentCount, char replaceMode) { - if (argumentCount == 0) { - if (replaceMode == 'P' || replaceMode == 'A') replaceMode = 'R'; - if (replaceMode == 'I') argumentPosition = 0; - } - this.targetType = targetType; - this.argumentPosition = argumentPosition; - this.argumentCount = argumentCount; - this.replaceMode = replaceMode; - validate(targetType, argumentPosition, argumentCount, replaceMode); - Adapter ad = findAdapter(targetType, argumentPosition, argumentCount, replaceMode, filterType()); + FilterGeneric(MethodType entryType) { + this.entryType = entryType; + int tableSize = Kind.LIMIT.invokerIndex(1 + entryType.parameterCount()); + this.adapters = new Adapter[tableSize]; + } + + Adapter getAdapter(Kind kind, int pos) { + int index = kind.invokerIndex(pos); + Adapter ad = adapters[index]; + if (ad != null) return ad; + ad = findAdapter(entryType, kind, pos); if (ad == null) - ad = buildAdapterFromBytecodes(targetType, argumentPosition, argumentCount, replaceMode, filterType()); - this.adapter = ad; - this.entryPoint = ad.prototypeEntryPoint(); + ad = buildAdapterFromBytecodes(entryType, kind, pos); + adapters[index] = ad; + return ad; } - Adapter makeInstance(MethodHandle filter, MethodHandle target) { - return adapter.makeInstance(entryPoint, filter, target); + Adapter makeInstance(Kind kind, int pos, MethodHandle filter, MethodHandle target) { + Adapter ad = getAdapter(kind, pos); + return ad.makeInstance(ad.prototypeEntryPoint(), filter, target); } - /** Build an adapter of the given generic type, which invokes typedTarget - * on the incoming arguments, after unboxing as necessary. - * The return value is boxed if necessary. - * @param genericType the required type of the result - * @param typedTarget the target + /** Build an adapter of the given generic type, which invokes filter + * on the selected incoming argument before passing it to the target. + * @param pos the argument to filter + * @param filter the function to call on the argument + * @param target the target to call with the modified argument list * @return an adapter method handle */ - public static MethodHandle make(MethodHandle target, int pos, MethodHandle filter) { - return FilterGeneric.of(target.type(), (short)pos, (short)1, 'R').makeInstance(filter, target); + public static MethodHandle makeArgumentFilter(int pos, MethodHandle filter, MethodHandle target) { + return make(Kind.value, pos, filter, target); } - /** Return the adapter information for this type's erasure. */ - static FilterGeneric of(MethodType type, short ap, short ac, char mode) { - if (type.generic() != type) - throw new IllegalArgumentException("must be generic: "+type); - validate(type, ap, ac, mode); - MethodTypeImpl form = MethodTypeImpl.of(type); + /** Build an adapter of the given generic type, which invokes a combiner + * on a selected group of leading arguments. + * The result of the combiner is prepended before all those arguments. + * @param combiner the function to call on the selected leading arguments + * @param target the target to call with the modified argument list + * @return an adapter method handle + */ + public static MethodHandle makeArgumentFolder(MethodHandle combiner, MethodHandle target) { + int num = combiner.type().parameterCount(); + return make(Kind.fold, num, combiner, target); + } + + /** Build an adapter of the given generic type, which invokes a filter + * on the incoming arguments, reified as a group. + * The argument may be modified (by side effects in the filter). + * The arguments, possibly modified, are passed on to the target. + * @param filter the function to call on the arguments + * @param target the target to call with the possibly-modified argument list + * @return an adapter method handle + */ + public static MethodHandle makeFlyby(MethodHandle filter, MethodHandle target) { + return make(Kind.flyby, 0, filter, target); + } + + /** Build an adapter of the given generic type, which invokes a collector + * on the selected incoming argument and all following arguments. + * The result of the collector replaces all those arguments. + * @param collector the function to call on the selected trailing arguments + * @param target the target to call with the modified argument list + * @return an adapter method handle + */ + public static MethodHandle makeArgumentCollector(MethodHandle collector, MethodHandle target) { + int pos = target.type().parameterCount() - 1; + return make(Kind.collect, pos, collector, target); + } + + static MethodHandle make(Kind kind, int pos, MethodHandle filter, MethodHandle target) { + FilterGeneric fgen = of(kind, pos, filter.type(), target.type()); + return fgen.makeInstance(kind, pos, filter, target); + } + + /** Return the adapter information for this target and filter type. */ + static FilterGeneric of(Kind kind, int pos, MethodType filterType, MethodType targetType) { + MethodType entryType = entryType(kind, pos, filterType, targetType); + if (entryType.generic() != entryType) + throw newIllegalArgumentException("must be generic: "+entryType); + MethodTypeImpl form = MethodTypeImpl.of(entryType); FilterGeneric filterGen = form.filterGeneric; if (filterGen == null) - form.filterGeneric = filterGen = new FilterGeneric(type, (short)0, (short)1, 'R'); - return find(filterGen, ap, ac, mode); - } - - static FilterGeneric find(FilterGeneric gen, short ap, short ac, char mode) { - for (;;) { - if (gen.argumentPosition == ap && - gen.argumentCount == ac && - gen.replaceMode == mode) { - return gen; - } - FilterGeneric gen2 = gen.variations; - if (gen2 == null) break; - gen = gen2; - } - FilterGeneric gen2 = new FilterGeneric(gen.targetType, ap, ac, mode); - gen.variations = gen2; // OK if this smashes another cached chain - return gen2; - } - - private static void validate(MethodType type, short ap, short ac, char mode) { - int endpos = ap + ac; - switch (mode) { - case 'P': case 'A': case 'R': case 'D': - if (ap >= 0 && ac >= 0 && - endpos >= 0 && endpos <= type.parameterCount()) - return; - default: - throw new InternalError("configuration "+patternName(ap, ac, mode)); - } + form.filterGeneric = filterGen = new FilterGeneric(entryType); + return filterGen; } public String toString() { - return "FilterGeneric/"+patternName()+targetType; + return "FilterGeneric/"+entryType; } - String patternName() { - return patternName(argumentPosition, argumentCount, replaceMode); - } - - static String patternName(short ap, short ac, char mode) { - return ""+mode+ap+(ac>1?"_"+ac:""); - } - - Class filterType() { - return Object.class; // result of filter operation; an uninteresting type - } - - static MethodType targetType(MethodType entryType, short ap, short ac, char mode, - Class arg) { + static MethodType targetType(MethodType entryType, Kind kind, int pos, MethodType filterType) { MethodType type = entryType; - int pos = ap; - switch (mode) { - case 'A': - pos += ac; - case 'P': - type = type.insertParameterType(pos, arg); + switch (kind) { + case value: + case flyby: + break; // no change + case fold: + type = type.insertParameterTypes(0, filterType.returnType()); break; - case 'I': - for (int i = 1; i < ac; i++) - type = type.dropParameterType(pos); - assert(type.parameterType(pos) == arg); - break; - case 'D': + case collect: + type = type.dropParameterTypes(pos, type.parameterCount()); + type = type.insertParameterTypes(pos, filterType.returnType()); break; + default: + throw new InternalError(); } return type; } - static MethodType entryType(MethodType targetType, short ap, short ac, char mode, - Class arg) { + static MethodType entryType(Kind kind, int pos, MethodType filterType, MethodType targetType) { MethodType type = targetType; - int pos = ap; - switch (mode) { - case 'A': - pos += ac; - case 'P': - type = type.dropParameterType(pos); + switch (kind) { + case value: + case flyby: + break; // no change + case fold: + type = type.dropParameterTypes(0, 1); break; - case 'I': - for (int i = 1; i < ac; i++) - type = type.insertParameterType(pos, arg); - assert(type.parameterType(pos) == arg); - break; - case 'D': + case collect: + type = type.dropParameterTypes(pos, pos+1); + type = type.insertParameterTypes(pos, filterType.parameterList()); break; + default: + throw new InternalError(); } return type; } /* Create an adapter that handles spreading calls for the given type. */ - static Adapter findAdapter(MethodType targetType, short ap, short ac, char mode, Class arg) { - MethodType entryType = entryType(targetType, ap, ac, mode, arg); - int argc = targetType.parameterCount(); - String pname = patternName(ap, ac, mode); + static Adapter findAdapter(MethodType entryType, Kind kind, int pos) { + int argc = entryType.parameterCount(); String cname0 = "F"+argc; - String cname1 = "F"+argc+mode; - String cname2 = "F"+argc+pname; - String[] cnames = { cname0, cname1, cname1+"X", cname2 }; - String iname = "invoke_"+pname; - // e.g., F5R; invoke_R3 + String cname1 = "F"+argc+kind.key; + String[] cnames = { cname0, cname1 }; + String iname = kind.invokerName(pos); + // e.g., F5; invoke_C3 for (String cname : cnames) { Class acls = Adapter.findSubClass(cname); if (acls == null) continue; @@ -220,7 +205,10 @@ class FilterGeneric { // Produce an instance configured as a prototype. return ctor.newInstance(entryPoint); } catch (IllegalArgumentException ex) { - } catch (InvocationTargetException ex) { + } catch (InvocationTargetException wex) { + Throwable ex = wex.getTargetException(); + if (ex instanceof Error) throw (Error)ex; + if (ex instanceof RuntimeException) throw (RuntimeException)ex; } catch (InstantiationException ex) { } catch (IllegalAccessException ex) { } @@ -228,7 +216,7 @@ class FilterGeneric { return null; } - static Adapter buildAdapterFromBytecodes(MethodType targetType, short ap, short ac, char mode, Class arg) { + static Adapter buildAdapterFromBytecodes(MethodType entryType, Kind kind, int pos) { throw new UnsupportedOperationException("NYI"); } @@ -242,8 +230,13 @@ class FilterGeneric { * generated once per type erasure family, and reused across adapters. */ static abstract class Adapter extends JavaMethodHandle { - protected final MethodHandle filter; - protected final MethodHandle target; + protected final MethodHandle filter; // transforms one or more arguments + protected final MethodHandle target; // ultimate target + + @Override + public String toString() { + return target.toString(); + } protected boolean isPrototype() { return target == null; } protected Adapter(MethodHandle entryPoint) { @@ -287,52 +280,4221 @@ class FilterGeneric { } } - //* generated classes follow this pattern: - static class F1RX extends Adapter { - protected F1RX(MethodHandle entryPoint) { super(entryPoint); } // to build prototype - protected F1RX(MethodHandle e, MethodHandle f, MethodHandle t) - { super(e, f, t); } - protected F1RX makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) - { return new F1RX(e, f, t); } - protected Object filter(Object a0) { return filter.invoke(a0); } - protected Object target(Object a0) { return target.invoke(a0); } - protected Object invoke_R0(Object a0) { return target(filter(a0)); } + static enum Kind { + value('V'), // filter and replace Nth argument value + fold('F'), // fold first N arguments, prepend result + collect('C'), // collect last N arguments, replace with result + flyby('Y'), // reify entire argument list, filter, pass to target + LIMIT('?'); + static final int COUNT = LIMIT.ordinal(); + + final char key; + Kind(char key) { this.key = key; } + String invokerName(int pos) { return "invoke_"+key+""+pos; } + int invokerIndex(int pos) { return pos * COUNT + ordinal(); } } - static class F2RX extends Adapter { - protected F2RX(MethodHandle entryPoint) { super(entryPoint); } // to build prototype - protected F2RX(MethodHandle e, MethodHandle f, MethodHandle t) + + /* generated classes follow this pattern: + static class F1X extends Adapter { + protected F1X(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F1X(MethodHandle e, MethodHandle f, MethodHandle t) { super(e, f, t); } - protected F2RX makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) - { return new F2RX(e, f, t); } - protected Object filter(Object a0) { return filter.invoke(a0); } - protected Object target(Object a0, Object a1) { return target.invoke(a0, a1); } - protected Object invoke_R0(Object a0, Object a1) { return target(filter(a0), a1); } - protected Object invoke_R1(Object a0, Object a1) { return target(a0, filter(a1)); } + protected F1X makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) + { return new F1X(e, f, t); } + protected Object invoke_V0(Object a0) { return target.invoke(filter.invoke(a0)); } + protected Object invoke_F0(Object a0) { return target.invoke(filter.invoke(), a0); } + protected Object invoke_F1(Object a0) { return target.invoke(filter.invoke(a0), a0); } + protected Object invoke_C0(Object a0) { return target.invoke(filter.invoke(a0)); } + protected Object invoke_C1(Object a0) { return target.invoke(a0, filter.invoke()); } + protected Object invoke_Y0(Object a0) { Object[] av = { a0 }; + filter.invoke(av); return target.invoke(av[0]); } } - static class F3RX extends Adapter { - protected F3RX(MethodHandle entryPoint) { super(entryPoint); } // to build prototype - protected F3RX(MethodHandle e, MethodHandle f, MethodHandle t) + static class F2X extends Adapter { + protected F2X(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F2X(MethodHandle e, MethodHandle f, MethodHandle t) { super(e, f, t); } - protected F3RX makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) - { return new F3RX(e, f, t); } - protected Object filter(Object a0) { return filter.invoke(a0); } - protected Object target(Object a0, Object a1, Object a2) { return target.invoke(a0, a1, a2); } - protected Object invoke_R0(Object a0, Object a1, Object a2) { return target(filter(a0), a1, a2); } - protected Object invoke_R1(Object a0, Object a1, Object a2) { return target(a0, filter(a1), a2); } - protected Object invoke_R2(Object a0, Object a1, Object a2) { return target(a0, a1, filter(a2)); } - } - static class F4RX extends Adapter { - protected F4RX(MethodHandle entryPoint) { super(entryPoint); } // to build prototype - protected F4RX(MethodHandle e, MethodHandle f, MethodHandle t) - { super(e, f, t); } - protected F4RX makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) - { return new F4RX(e, f, t); } - protected Object filter(Object a0) { return filter.invoke(a0); } - protected Object target(Object a0, Object a1, Object a2, Object a3) { return target.invoke(a0, a1, a2, a3); } - protected Object invoke_R0(Object a0, Object a1, Object a2, Object a3) { return target(filter(a0), a1, a2, a3); } - protected Object invoke_R1(Object a0, Object a1, Object a2, Object a3) { return target(a0, filter(a1), a2, a3); } - protected Object invoke_R2(Object a0, Object a1, Object a2, Object a3) { return target(a0, a1, filter(a2), a3); } - protected Object invoke_R3(Object a0, Object a1, Object a2, Object a3) { return target(a0, a1, a2, filter(a3)); } + protected F2X makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) + { return new F2X(e, f, t); } + protected Object invoke_V0(Object a0, Object a1) { return target.invoke(filter.invoke(a0), a1); } + protected Object invoke_V1(Object a0, Object a1) { return target.invoke(a0, filter.invoke(a1)); } + protected Object invoke_F0(Object a0, Object a1) { return target.invoke(filter.invoke(), a0, a1); } + protected Object invoke_F1(Object a0, Object a1) { return target.invoke(filter.invoke(a0), a0, a1); } + protected Object invoke_F2(Object a0, Object a1) { return target.invoke(filter.invoke(a0, a1), a0, a1); } + protected Object invoke_C0(Object a0, Object a1) { return target.invoke(filter.invoke(a0, a1)); } + protected Object invoke_C1(Object a0, Object a1) { return target.invoke(a0, filter.invoke(a1)); } + protected Object invoke_C2(Object a0, Object a1) { return target.invoke(a0, a1, filter.invoke()); } + protected Object invoke_Y0(Object a0, Object a1) { Object[] av = { a0, a1 }; + filter.invoke(av); return target.invoke(av[0], av[1]); } } // */ + + // This one is written by hand: + static class F0 extends Adapter { + protected F0(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F0(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F0 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F0(e, f, t); } + protected Object invoke_F0() throws Throwable { + return target.invoke(filter.invoke()); } + protected Object invoke_C0() throws Throwable { + return target.invoke(filter.invoke()); } + static final Object[] NO_ARGS = { }; + protected Object invoke_Y0() throws Throwable { + filter.invoke(NO_ARGS); // make the flyby + return target.invoke(); } + } + +/* + : 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~ +//{{{ +import java.util.*; +class genclasses { + static String[][] TEMPLATES = { { + "@for@ N=1..20", + " //@each-cat@", + " static class @cat@ extends Adapter {", + " protected @cat@(MethodHandle entryPoint) { super(entryPoint); } // to build prototype", + " protected @cat@(MethodHandle e, MethodHandle f, MethodHandle t) {", + " super(e, f, t); }", + " protected @cat@ makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {", + " return new @cat@(e, f, t); }", + " //@each-P@", + " protected Object invoke_V@P@(@Tvav@) throws Throwable {", + " return target.invoke(@a0_@@Psp@filter.invoke(a@P@)@_aN@); }", + " //@end-P@", + " //@each-P@", + " protected Object invoke_F@P@(@Tvav@) throws Throwable {", + " return target.invoke(filter.invoke(@a0@),", + " @av@); }", + " //@end-P@", + " protected Object invoke_F@N@(@Tvav@) throws Throwable {", + " return target.invoke(filter.invoke(@av@),", + " @av@); }", + " //@each-P@", + " protected Object invoke_C@P@(@Tvav@) throws Throwable {", + " return target.invoke(@a0_@filter.invoke(a@P@@_aN@)); }", + " //@end-P@", + " protected Object invoke_C@N@(@Tvav@) throws Throwable {", + " return target.invoke(@av@, filter.invoke()); }", + " protected Object invoke_Y0(@Tvav@) throws Throwable {", + " Object[] av = { @av@ };", + " filter.invoke(av); // make the flyby", + " return target.invoke(@av[i]@); }", + " }", + } }; + static final String NEWLINE_INDENT = " //\n "; + enum VAR { + cat, N, P, Tvav, av, a0, a0_, _aN, Psp, av_i_; + public final String pattern = "@"+toString().replace('_','.')+"@"; + public String binding = toString(); + static void makeBindings(boolean topLevel, int inargs, int pos) { + assert(-1 <= pos && pos < inargs); + VAR.cat.binding = "F"+inargs; + VAR.N.binding = String.valueOf(inargs); // incoming arg count + VAR.P.binding = String.valueOf(pos); // selected arg position + String[] av = new String[inargs]; + String[] Tvav = new String[inargs]; + String[] av_i_ = new String[inargs]; + for (int i = 0; i < inargs; i++) { + av[i] = arg(i); + av_i_[i] = "av["+i+"]"; + String spc = ""; + if (i > 0 && i % 4 == 0) spc = NEWLINE_INDENT+(pos>9?" ":"")+" "; + Tvav[i] = spc+param("Object", av[i]); + } + VAR.av.binding = comma(av); + VAR.av_i_.binding = comma(av_i_); + VAR.Tvav.binding = comma(Tvav); + if (pos >= 0) { + VAR.Psp.binding = (pos > 0 && pos % 10 == 0) ? NEWLINE_INDENT : ""; + String[] a0 = new String[pos]; + String[] aN = new String[inargs - (pos+1)]; + for (int i = 0; i < pos; i++) { + String spc = ""; + if (i > 0 && i % 10 == 0) spc = NEWLINE_INDENT; + a0[i] = spc+av[i]; + } + VAR.a0.binding = comma(a0); + VAR.a0_.binding = comma(a0, ", "); + for (int i = pos+1; i < inargs; i++) { + String spc = ""; + if (i > 0 && i % 10 == 0) spc = NEWLINE_INDENT; + aN[i - (pos+1)] = spc+av[i]; + } + VAR._aN.binding = comma(", ", aN); + } + } + static String arg(int i) { return "a"+i; } + static String param(String t, String a) { return t+" "+a; } + static String comma(String[] v) { return comma(v, ""); } + static String comma(String[] v, String sep) { return comma("", v, sep); } + static String comma(String sep, String[] v) { return comma(sep, v, ""); } + static String comma(String sep1, String[] v, String sep2) { + if (v.length == 0) return ""; + String res = v[0]; + for (int i = 1; i < v.length; i++) res += ", "+v[i]; + return sep1 + res + sep2; + } + static String transform(String string) { + for (VAR var : values()) + string = string.replaceAll(var.pattern, var.binding); + return string; + } + } + static String[] stringsIn(String[] strings, int beg, int end) { + return Arrays.copyOfRange(strings, beg, Math.min(end, strings.length)); + } + static String[] stringsBefore(String[] strings, int pos) { + return stringsIn(strings, 0, pos); + } + static String[] stringsAfter(String[] strings, int pos) { + return stringsIn(strings, pos, strings.length); + } + static int indexAfter(String[] strings, int pos, String tag) { + return Math.min(indexBefore(strings, pos, tag) + 1, strings.length); + } + static int indexBefore(String[] strings, int pos, String tag) { + for (int i = pos, end = strings.length; ; i++) { + if (i == end || strings[i].endsWith(tag)) return i; + } + } + static int MIN_ARITY, MAX_ARITY; + public static void main(String... av) { + for (String[] template : TEMPLATES) { + int forLinesLimit = indexBefore(template, 0, "@each-cat@"); + String[] forLines = stringsBefore(template, forLinesLimit); + template = stringsAfter(template, forLinesLimit); + for (String forLine : forLines) + expandTemplate(forLine, template); + } + } + static void expandTemplate(String forLine, String[] template) { + String[] params = forLine.split("[^0-9]+"); + if (params[0].length() == 0) params = stringsAfter(params, 1); + System.out.println("//params="+Arrays.asList(params)); + int pcur = 0; + MIN_ARITY = Integer.valueOf(params[pcur++]); + MAX_ARITY = Integer.valueOf(params[pcur++]); + if (pcur != params.length) throw new RuntimeException("bad extra param: "+forLine); + for (int inargs = MIN_ARITY; inargs <= MAX_ARITY; inargs++) { + expandTemplate(template, true, inargs, -1); + } + } + static void expandTemplate(String[] template, boolean topLevel, int inargs, int pos) { + VAR.makeBindings(topLevel, inargs, pos); + for (int i = 0; i < template.length; i++) { + String line = template[i]; + if (line.endsWith("@each-cat@")) { + // ignore + } else if (line.endsWith("@each-P@")) { + int blockEnd = indexAfter(template, i, "@end-P@"); + String[] block = stringsIn(template, i+1, blockEnd-1); + for (int pos1 = Math.max(0,pos); pos1 < inargs; pos1++) + expandTemplate(block, false, inargs, pos1); + VAR.makeBindings(topLevel, inargs, pos); + i = blockEnd-1; continue; + } else { + System.out.println(VAR.transform(line)); + } + } + } +} +//}}} */ +//params=[1, 20] + static class F1 extends Adapter { + protected F1(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F1(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F1 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F1(e, f, t); } + protected Object invoke_V0(Object a0) throws Throwable { + return target.invoke(filter.invoke(a0)); } + protected Object invoke_F0(Object a0) throws Throwable { + return target.invoke(filter.invoke(), + a0); } + protected Object invoke_F1(Object a0) throws Throwable { + return target.invoke(filter.invoke(a0), + a0); } + protected Object invoke_C0(Object a0) throws Throwable { + return target.invoke(filter.invoke(a0)); } + protected Object invoke_C1(Object a0) throws Throwable { + return target.invoke(a0, filter.invoke()); } + protected Object invoke_Y0(Object a0) throws Throwable { + Object[] av = { a0 }; + filter.invoke(av); // make the flyby + return target.invoke(av[0]); } + } + static class F2 extends Adapter { + protected F2(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F2(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F2 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F2(e, f, t); } + protected Object invoke_V0(Object a0, Object a1) throws Throwable { + return target.invoke(filter.invoke(a0), a1); } + protected Object invoke_V1(Object a0, Object a1) throws Throwable { + return target.invoke(a0, filter.invoke(a1)); } + protected Object invoke_F0(Object a0, Object a1) throws Throwable { + return target.invoke(filter.invoke(), + a0, a1); } + protected Object invoke_F1(Object a0, Object a1) throws Throwable { + return target.invoke(filter.invoke(a0), + a0, a1); } + protected Object invoke_F2(Object a0, Object a1) throws Throwable { + return target.invoke(filter.invoke(a0, a1), + a0, a1); } + protected Object invoke_C0(Object a0, Object a1) throws Throwable { + return target.invoke(filter.invoke(a0, a1)); } + protected Object invoke_C1(Object a0, Object a1) throws Throwable { + return target.invoke(a0, filter.invoke(a1)); } + protected Object invoke_C2(Object a0, Object a1) throws Throwable { + return target.invoke(a0, a1, filter.invoke()); } + protected Object invoke_Y0(Object a0, Object a1) throws Throwable { + Object[] av = { a0, a1 }; + filter.invoke(av); // make the flyby + return target.invoke(av[0], av[1]); } + } + static class F3 extends Adapter { + protected F3(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F3(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F3 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F3(e, f, t); } + protected Object invoke_V0(Object a0, Object a1, Object a2) throws Throwable { + return target.invoke(filter.invoke(a0), a1, a2); } + protected Object invoke_V1(Object a0, Object a1, Object a2) throws Throwable { + return target.invoke(a0, filter.invoke(a1), a2); } + protected Object invoke_V2(Object a0, Object a1, Object a2) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2)); } + protected Object invoke_F0(Object a0, Object a1, Object a2) throws Throwable { + return target.invoke(filter.invoke(), + a0, a1, a2); } + protected Object invoke_F1(Object a0, Object a1, Object a2) throws Throwable { + return target.invoke(filter.invoke(a0), + a0, a1, a2); } + protected Object invoke_F2(Object a0, Object a1, Object a2) throws Throwable { + return target.invoke(filter.invoke(a0, a1), + a0, a1, a2); } + protected Object invoke_F3(Object a0, Object a1, Object a2) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2), + a0, a1, a2); } + protected Object invoke_C0(Object a0, Object a1, Object a2) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2)); } + protected Object invoke_C1(Object a0, Object a1, Object a2) throws Throwable { + return target.invoke(a0, filter.invoke(a1, a2)); } + protected Object invoke_C2(Object a0, Object a1, Object a2) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2)); } + protected Object invoke_C3(Object a0, Object a1, Object a2) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke()); } + protected Object invoke_Y0(Object a0, Object a1, Object a2) throws Throwable { + Object[] av = { a0, a1, a2 }; + filter.invoke(av); // make the flyby + return target.invoke(av[0], av[1], av[2]); } + } + static class F4 extends Adapter { + protected F4(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F4(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F4 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F4(e, f, t); } + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3) throws Throwable { + return target.invoke(filter.invoke(a0), a1, a2, a3); } + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3) throws Throwable { + return target.invoke(a0, filter.invoke(a1), a2, a3); } + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2), a3); } + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3)); } + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3) throws Throwable { + return target.invoke(filter.invoke(), + a0, a1, a2, a3); } + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3) throws Throwable { + return target.invoke(filter.invoke(a0), + a0, a1, a2, a3); } + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3) throws Throwable { + return target.invoke(filter.invoke(a0, a1), + a0, a1, a2, a3); } + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2), + a0, a1, a2, a3); } + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3), + a0, a1, a2, a3); } + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3)); } + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3) throws Throwable { + return target.invoke(a0, filter.invoke(a1, a2, a3)); } + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2, a3)); } + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3)); } + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke()); } + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3) throws Throwable { + Object[] av = { a0, a1, a2, a3 }; + filter.invoke(av); // make the flyby + return target.invoke(av[0], av[1], av[2], av[3]); } + } + static class F5 extends Adapter { + protected F5(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F5(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F5 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F5(e, f, t); } + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3, + Object a4) throws Throwable { + return target.invoke(filter.invoke(a0), a1, a2, a3, a4); } + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3, + Object a4) throws Throwable { + return target.invoke(a0, filter.invoke(a1), a2, a3, a4); } + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3, + Object a4) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2), a3, a4); } + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3, + Object a4) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3), a4); } + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3, + Object a4) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4)); } + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3, + Object a4) throws Throwable { + return target.invoke(filter.invoke(), + a0, a1, a2, a3, a4); } + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3, + Object a4) throws Throwable { + return target.invoke(filter.invoke(a0), + a0, a1, a2, a3, a4); } + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3, + Object a4) throws Throwable { + return target.invoke(filter.invoke(a0, a1), + a0, a1, a2, a3, a4); } + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3, + Object a4) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2), + a0, a1, a2, a3, a4); } + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3, + Object a4) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3), + a0, a1, a2, a3, a4); } + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, + Object a4) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4), + a0, a1, a2, a3, a4); } + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3, + Object a4) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4)); } + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3, + Object a4) throws Throwable { + return target.invoke(a0, filter.invoke(a1, a2, a3, a4)); } + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3, + Object a4) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2, a3, a4)); } + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3, + Object a4) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3, a4)); } + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3, + Object a4) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4)); } + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3, + Object a4) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke()); } + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3, + Object a4) throws Throwable { + Object[] av = { a0, a1, a2, a3, a4 }; + filter.invoke(av); // make the flyby + return target.invoke(av[0], av[1], av[2], av[3], av[4]); } + } + static class F6 extends Adapter { + protected F6(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F6(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F6 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F6(e, f, t); } + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + return target.invoke(filter.invoke(a0), a1, a2, a3, a4, a5); } + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + return target.invoke(a0, filter.invoke(a1), a2, a3, a4, a5); } + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2), a3, a4, a5); } + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3), a4, a5); } + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4), a5); } + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5)); } + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + return target.invoke(filter.invoke(), + a0, a1, a2, a3, a4, a5); } + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + return target.invoke(filter.invoke(a0), + a0, a1, a2, a3, a4, a5); } + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + return target.invoke(filter.invoke(a0, a1), + a0, a1, a2, a3, a4, a5); } + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2), + a0, a1, a2, a3, a4, a5); } + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3), + a0, a1, a2, a3, a4, a5); } + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4), + a0, a1, a2, a3, a4, a5); } + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5), + a0, a1, a2, a3, a4, a5); } + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5)); } + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + return target.invoke(a0, filter.invoke(a1, a2, a3, a4, a5)); } + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2, a3, a4, a5)); } + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3, a4, a5)); } + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4, a5)); } + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5)); } + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke()); } + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) throws Throwable { + Object[] av = { a0, a1, a2, a3, a4, a5 }; + filter.invoke(av); // make the flyby + return target.invoke(av[0], av[1], av[2], av[3], av[4], av[5]); } + } + static class F7 extends Adapter { + protected F7(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F7(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F7 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F7(e, f, t); } + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6); } + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6); } + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6); } + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6); } + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6); } + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6); } + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6)); } + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(filter.invoke(), + a0, a1, a2, a3, a4, a5, a6); } + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(filter.invoke(a0), + a0, a1, a2, a3, a4, a5, a6); } + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(filter.invoke(a0, a1), + a0, a1, a2, a3, a4, a5, a6); } + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2), + a0, a1, a2, a3, a4, a5, a6); } + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3), + a0, a1, a2, a3, a4, a5, a6); } + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4), + a0, a1, a2, a3, a4, a5, a6); } + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5), + a0, a1, a2, a3, a4, a5, a6); } + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6), + a0, a1, a2, a3, a4, a5, a6); } + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6)); } + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6)); } + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6)); } + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6)); } + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6)); } + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6)); } + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6)); } + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke()); } + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) throws Throwable { + Object[] av = { a0, a1, a2, a3, a4, a5, a6 }; + filter.invoke(av); // make the flyby + return target.invoke(av[0], av[1], av[2], av[3], av[4], av[5], av[6]); } + } + static class F8 extends Adapter { + protected F8(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F8(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F8 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F8(e, f, t); } + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7); } + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7); } + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7); } + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7); } + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7); } + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7); } + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7); } + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7)); } + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(filter.invoke(), + a0, a1, a2, a3, a4, a5, a6, a7); } + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(filter.invoke(a0), + a0, a1, a2, a3, a4, a5, a6, a7); } + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(filter.invoke(a0, a1), + a0, a1, a2, a3, a4, a5, a6, a7); } + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2), + a0, a1, a2, a3, a4, a5, a6, a7); } + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3), + a0, a1, a2, a3, a4, a5, a6, a7); } + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4), + a0, a1, a2, a3, a4, a5, a6, a7); } + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5), + a0, a1, a2, a3, a4, a5, a6, a7); } + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6), + a0, a1, a2, a3, a4, a5, a6, a7); } + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7), + a0, a1, a2, a3, a4, a5, a6, a7); } + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7)); } + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7)); } + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7)); } + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7)); } + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7)); } + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7)); } + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7)); } + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7)); } + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke()); } + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) throws Throwable { + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7 }; + filter.invoke(av); // make the flyby + return target.invoke(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7]); } + } + static class F9 extends Adapter { + protected F9(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F9(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F9 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F9(e, f, t); } + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8); } + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8); } + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8); } + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8); } + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8); } + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8); } + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8); } + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8); } + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8)); } + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(filter.invoke(), + a0, a1, a2, a3, a4, a5, a6, a7, a8); } + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(filter.invoke(a0), + a0, a1, a2, a3, a4, a5, a6, a7, a8); } + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(filter.invoke(a0, a1), + a0, a1, a2, a3, a4, a5, a6, a7, a8); } + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2), + a0, a1, a2, a3, a4, a5, a6, a7, a8); } + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3), + a0, a1, a2, a3, a4, a5, a6, a7, a8); } + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4), + a0, a1, a2, a3, a4, a5, a6, a7, a8); } + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5), + a0, a1, a2, a3, a4, a5, a6, a7, a8); } + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6), + a0, a1, a2, a3, a4, a5, a6, a7, a8); } + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7), + a0, a1, a2, a3, a4, a5, a6, a7, a8); } + 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 target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8), + a0, a1, a2, a3, a4, a5, a6, a7, a8); } + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8)); } + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8)); } + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8)); } + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8)); } + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8)); } + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8)); } + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8)); } + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8)); } + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke()); } + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) throws Throwable { + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8 }; + filter.invoke(av); // make the flyby + return target.invoke(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8]); } + } + static class F10 extends Adapter { + protected F10(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F10(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F10 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F10(e, f, t); } + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9); } + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9); } + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9); } + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9); } + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9); } + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9); } + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9); } + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9); } + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9); } + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9)); } + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(filter.invoke(), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(filter.invoke(a0), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(filter.invoke(a0, a1), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } + 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 target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9)); } + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9)); } + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9)); } + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9)); } + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9)); } + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9)); } + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9)); } + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9)); } + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9)); } + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke()); } + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) throws Throwable { + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9 }; + filter.invoke(av); // make the flyby + return target.invoke(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9]); } + } + static class F11 extends Adapter { + protected F11(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F11(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F11 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F11(e, f, t); } + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10); } + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9, + a10); } + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9, + a10); } + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9, + a10); } + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9, + a10); } + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9, + a10); } + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9, + a10); } + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9, + a10); } + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9, + a10); } + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9), + a10); } + protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + filter.invoke(a10)); } + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(filter.invoke(), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); } + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(filter.invoke(a0), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); } + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(filter.invoke(a0, a1), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); } + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); } + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); } + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); } + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); } + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); } + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); } + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); } + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); } + protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); } + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10)); } + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10)); } + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9, + a10)); } + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9, + a10)); } + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9, + a10)); } + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9, + a10)); } + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9, + a10)); } + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9, + a10)); } + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9, + a10)); } + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9, + a10)); } + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke(a10)); } + protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, filter.invoke()); } + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10) throws Throwable { + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 }; + filter.invoke(av); // make the flyby + return target.invoke(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10]); } + } + static class F12 extends Adapter { + protected F12(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F12(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F12 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F12(e, f, t); } + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11); } + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11); } + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9, + a10, a11); } + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9, + a10, a11); } + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9, + a10, a11); } + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9, + a10, a11); } + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9, + a10, a11); } + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9, + a10, a11); } + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9, + a10, a11); } + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9), + a10, a11); } + protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + filter.invoke(a10), a11); } + protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, filter.invoke(a11)); } + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(filter.invoke(), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(filter.invoke(a0), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(filter.invoke(a0, a1), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } + protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } + protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11); } + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11)); } + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11)); } + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11)); } + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9, + a10, a11)); } + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9, + a10, a11)); } + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9, + a10, a11)); } + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9, + a10, a11)); } + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9, + a10, a11)); } + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9, + a10, a11)); } + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9, + a10, a11)); } + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke(a10, a11)); } + protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, filter.invoke(a11)); } + protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, filter.invoke()); } + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11) throws Throwable { + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11 }; + filter.invoke(av); // make the flyby + return target.invoke(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11]); } + } + static class F13 extends Adapter { + protected F13(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F13(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F13 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F13(e, f, t); } + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12); } + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12); } + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12); } + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9, + a10, a11, a12); } + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9, + a10, a11, a12); } + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9, + a10, a11, a12); } + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9, + a10, a11, a12); } + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9, + a10, a11, a12); } + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9, + a10, a11, a12); } + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9), + a10, a11, a12); } + protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + filter.invoke(a10), a11, a12); } + protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, filter.invoke(a11), a12); } + protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, filter.invoke(a12)); } + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(filter.invoke(), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); } + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(filter.invoke(a0), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); } + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(filter.invoke(a0, a1), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); } + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); } + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); } + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); } + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); } + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); } + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); } + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); } + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); } + protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); } + protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); } + protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); } + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12)); } + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12)); } + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12)); } + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12)); } + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9, + a10, a11, a12)); } + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9, + a10, a11, a12)); } + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9, + a10, a11, a12)); } + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9, + a10, a11, a12)); } + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9, + a10, a11, a12)); } + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9, + a10, a11, a12)); } + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke(a10, a11, a12)); } + protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, filter.invoke(a11, a12)); } + protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, filter.invoke(a12)); } + protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, filter.invoke()); } + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12) throws Throwable { + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12 }; + filter.invoke(av); // make the flyby + return target.invoke(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]); } + } + static class F14 extends Adapter { + protected F14(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F14(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F14 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F14(e, f, t); } + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13); } + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13); } + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13); } + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13); } + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9, + a10, a11, a12, a13); } + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9, + a10, a11, a12, a13); } + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9, + a10, a11, a12, a13); } + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9, + a10, a11, a12, a13); } + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9, + a10, a11, a12, a13); } + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9), + a10, a11, a12, a13); } + protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + filter.invoke(a10), a11, a12, a13); } + protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, filter.invoke(a11), a12, a13); } + protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, filter.invoke(a12), a13); } + protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, filter.invoke(a13)); } + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(filter.invoke(), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); } + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(filter.invoke(a0), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); } + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(filter.invoke(a0, a1), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); } + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); } + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); } + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); } + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); } + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); } + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); } + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); } + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); } + protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); } + protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); } + protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); } + protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13); } + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13)); } + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13)); } + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13)); } + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13)); } + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13)); } + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9, + a10, a11, a12, a13)); } + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9, + a10, a11, a12, a13)); } + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9, + a10, a11, a12, a13)); } + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9, + a10, a11, a12, a13)); } + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9, + a10, a11, a12, a13)); } + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke(a10, a11, a12, a13)); } + protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, filter.invoke(a11, a12, a13)); } + protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, filter.invoke(a12, a13)); } + protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, filter.invoke(a13)); } + protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, filter.invoke()); } + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13) throws Throwable { + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13 }; + filter.invoke(av); // make the flyby + return target.invoke(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]); } + } + static class F15 extends Adapter { + protected F15(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F15(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F15 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F15(e, f, t); } + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14); } + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14); } + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14); } + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14); } + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14); } + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9, + a10, a11, a12, a13, a14); } + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9, + a10, a11, a12, a13, a14); } + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9, + a10, a11, a12, a13, a14); } + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9, + a10, a11, a12, a13, a14); } + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9), + a10, a11, a12, a13, a14); } + protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + filter.invoke(a10), a11, a12, a13, a14); } + protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, filter.invoke(a11), a12, a13, a14); } + protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, filter.invoke(a12), a13, a14); } + protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, filter.invoke(a13), a14); } + protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, filter.invoke(a14)); } + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(filter.invoke(), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); } + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(filter.invoke(a0), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); } + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(filter.invoke(a0, a1), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); } + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); } + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); } + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); } + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); } + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); } + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); } + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); } + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); } + protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); } + protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); } + protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); } + protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); } + protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14); } + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14)); } + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14)); } + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14)); } + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14)); } + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14)); } + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14)); } + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9, + a10, a11, a12, a13, a14)); } + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9, + a10, a11, a12, a13, a14)); } + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9, + a10, a11, a12, a13, a14)); } + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9, + a10, a11, a12, a13, a14)); } + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke(a10, a11, a12, a13, a14)); } + protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, filter.invoke(a11, a12, a13, a14)); } + protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, filter.invoke(a12, a13, a14)); } + protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, filter.invoke(a13, a14)); } + protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, filter.invoke(a14)); } + protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, filter.invoke()); } + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14) throws Throwable { + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14 }; + filter.invoke(av); // make the flyby + return target.invoke(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]); } + } + static class F16 extends Adapter { + protected F16(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F16(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F16 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F16(e, f, t); } + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15); } + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15); } + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15); } + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15); } + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15); } + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15); } + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9, + a10, a11, a12, a13, a14, a15); } + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9, + a10, a11, a12, a13, a14, a15); } + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9, + a10, a11, a12, a13, a14, a15); } + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9), + a10, a11, a12, a13, a14, a15); } + protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + filter.invoke(a10), a11, a12, a13, a14, a15); } + protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, filter.invoke(a11), a12, a13, a14, a15); } + protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, filter.invoke(a12), a13, a14, a15); } + protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, filter.invoke(a13), a14, a15); } + protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, filter.invoke(a14), a15); } + protected Object invoke_V15(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, filter.invoke(a15)); } + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(filter.invoke(), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); } + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(filter.invoke(a0), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); } + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(filter.invoke(a0, a1), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); } + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); } + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); } + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); } + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); } + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); } + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); } + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); } + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); } + protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); } + protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); } + protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); } + protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); } + protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); } + protected Object invoke_F16(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15); } + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15)); } + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15)); } + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15)); } + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15)); } + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15)); } + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15)); } + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15)); } + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9, + a10, a11, a12, a13, a14, a15)); } + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9, + a10, a11, a12, a13, a14, a15)); } + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9, + a10, a11, a12, a13, a14, a15)); } + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke(a10, a11, a12, a13, a14, a15)); } + protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, filter.invoke(a11, a12, a13, a14, a15)); } + protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, filter.invoke(a12, a13, a14, a15)); } + protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, filter.invoke(a13, a14, a15)); } + protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, filter.invoke(a14, a15)); } + protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, filter.invoke(a15)); } + protected Object invoke_C16(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, filter.invoke()); } + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15) throws Throwable { + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 }; + filter.invoke(av); // make the flyby + return target.invoke(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]); } + } + static class F17 extends Adapter { + protected F17(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F17(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F17 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F17(e, f, t); } + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9, + a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9, + a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9), + a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + filter.invoke(a10), a11, a12, a13, a14, a15, a16); } + protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, filter.invoke(a11), a12, a13, a14, a15, a16); } + protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, filter.invoke(a12), a13, a14, a15, a16); } + protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, filter.invoke(a13), a14, a15, a16); } + protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, filter.invoke(a14), a15, a16); } + protected Object invoke_V15(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, filter.invoke(a15), a16); } + protected Object invoke_V16(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, filter.invoke(a16)); } + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(filter.invoke(), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(filter.invoke(a0), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(filter.invoke(a0, a1), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_F16(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_F17(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16); } + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16)); } + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16)); } + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16)); } + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16)); } + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16)); } + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16)); } + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16)); } + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16)); } + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9, + a10, a11, a12, a13, a14, a15, a16)); } + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9, + a10, a11, a12, a13, a14, a15, a16)); } + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke(a10, a11, a12, a13, a14, a15, a16)); } + protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, filter.invoke(a11, a12, a13, a14, a15, a16)); } + protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, filter.invoke(a12, a13, a14, a15, a16)); } + protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, filter.invoke(a13, a14, a15, a16)); } + protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, filter.invoke(a14, a15, a16)); } + protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, filter.invoke(a15, a16)); } + protected Object invoke_C16(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, filter.invoke(a16)); } + protected Object invoke_C17(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, filter.invoke()); } + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16) throws Throwable { + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16 }; + filter.invoke(av); // make the flyby + return target.invoke(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]); } + } + static class F18 extends Adapter { + protected F18(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F18(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F18 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F18(e, f, t); } + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9, + a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9), + a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + filter.invoke(a10), a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, filter.invoke(a11), a12, a13, a14, a15, a16, a17); } + protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, filter.invoke(a12), a13, a14, a15, a16, a17); } + protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, filter.invoke(a13), a14, a15, a16, a17); } + protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, filter.invoke(a14), a15, a16, a17); } + protected Object invoke_V15(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, filter.invoke(a15), a16, a17); } + protected Object invoke_V16(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, filter.invoke(a16), a17); } + protected Object invoke_V17(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, filter.invoke(a17)); } + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(a0), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(a0, a1), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_F16(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_F17(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_F18(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17); } + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17)); } + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17)); } + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17)); } + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17)); } + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17)); } + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17)); } + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17)); } + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17)); } + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17)); } + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9, + a10, a11, a12, a13, a14, a15, a16, a17)); } + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke(a10, a11, a12, a13, a14, a15, a16, a17)); } + protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, filter.invoke(a11, a12, a13, a14, a15, a16, a17)); } + protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, filter.invoke(a12, a13, a14, a15, a16, a17)); } + protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, filter.invoke(a13, a14, a15, a16, a17)); } + protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, filter.invoke(a14, a15, a16, a17)); } + protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, filter.invoke(a15, a16, a17)); } + protected Object invoke_C16(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, filter.invoke(a16, a17)); } + protected Object invoke_C17(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, filter.invoke(a17)); } + protected Object invoke_C18(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, filter.invoke()); } + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17) throws Throwable { + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17 }; + filter.invoke(av); // make the flyby + return target.invoke(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]); } + } + static class F19 extends Adapter { + protected F19(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F19(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F19 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F19(e, f, t); } + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9), + a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + filter.invoke(a10), a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, filter.invoke(a11), a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, filter.invoke(a12), a13, a14, a15, a16, a17, a18); } + protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, filter.invoke(a13), a14, a15, a16, a17, a18); } + protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, filter.invoke(a14), a15, a16, a17, a18); } + protected Object invoke_V15(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, filter.invoke(a15), a16, a17, a18); } + protected Object invoke_V16(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, filter.invoke(a16), a17, a18); } + protected Object invoke_V17(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, filter.invoke(a17), a18); } + protected Object invoke_V18(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, filter.invoke(a18)); } + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0, a1), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_F16(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_F17(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_F18(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_F19(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18); } + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18)); } + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18)); } + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18)); } + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18)); } + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18)); } + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18)); } + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18)); } + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18)); } + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18)); } + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18)); } + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke(a10, a11, a12, a13, a14, a15, a16, a17, a18)); } + protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, filter.invoke(a11, a12, a13, a14, a15, a16, a17, a18)); } + protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, filter.invoke(a12, a13, a14, a15, a16, a17, a18)); } + protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, filter.invoke(a13, a14, a15, a16, a17, a18)); } + protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, filter.invoke(a14, a15, a16, a17, a18)); } + protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, filter.invoke(a15, a16, a17, a18)); } + protected Object invoke_C16(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, filter.invoke(a16, a17, a18)); } + protected Object invoke_C17(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, filter.invoke(a17, a18)); } + protected Object invoke_C18(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, filter.invoke(a18)); } + protected Object invoke_C19(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, filter.invoke()); } + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18) throws Throwable { + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18 }; + filter.invoke(av); // make the flyby + return target.invoke(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]); } + } + static class F20 extends Adapter { + protected F20(MethodHandle entryPoint) { super(entryPoint); } // to build prototype + protected F20(MethodHandle e, MethodHandle f, MethodHandle t) { + super(e, f, t); } + protected F20 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) { + return new F20(e, f, t); } + protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_V1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_V2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_V3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_V4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_V5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_V6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_V7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_V8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_V9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9), + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_V10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + filter.invoke(a10), a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_V11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, filter.invoke(a11), a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_V12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, filter.invoke(a12), a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_V13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, filter.invoke(a13), a14, a15, a16, a17, a18, a19); } + protected Object invoke_V14(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, filter.invoke(a14), a15, a16, a17, a18, a19); } + protected Object invoke_V15(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, filter.invoke(a15), a16, a17, a18, a19); } + protected Object invoke_V16(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, filter.invoke(a16), a17, a18, a19); } + protected Object invoke_V17(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, filter.invoke(a17), a18, a19); } + protected Object invoke_V18(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, filter.invoke(a18), a19); } + protected Object invoke_V19(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, filter.invoke(a19)); } + protected Object invoke_F0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_F1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_F2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0, a1), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_F3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_F11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_F12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_F13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_F14(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_F15(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_F16(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_F17(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_F18(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_F19(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_F20(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19), + a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19); } + protected Object invoke_C0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); } + protected Object invoke_C1(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); } + protected Object invoke_C2(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); } + protected Object invoke_C3(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); } + protected Object invoke_C4(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); } + protected Object invoke_C5(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); } + protected Object invoke_C6(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); } + protected Object invoke_C7(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); } + protected Object invoke_C8(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); } + protected Object invoke_C9(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); } + protected Object invoke_C10(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke(a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); } + protected Object invoke_C11(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, filter.invoke(a11, a12, a13, a14, a15, a16, a17, a18, a19)); } + protected Object invoke_C12(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, filter.invoke(a12, a13, a14, a15, a16, a17, a18, a19)); } + protected Object invoke_C13(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, filter.invoke(a13, a14, a15, a16, a17, a18, a19)); } + protected Object invoke_C14(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, filter.invoke(a14, a15, a16, a17, a18, a19)); } + protected Object invoke_C15(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, filter.invoke(a15, a16, a17, a18, a19)); } + protected Object invoke_C16(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, filter.invoke(a16, a17, a18, a19)); } + protected Object invoke_C17(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, filter.invoke(a17, a18, a19)); } + protected Object invoke_C18(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, filter.invoke(a18, a19)); } + protected Object invoke_C19(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, filter.invoke(a19)); } + protected Object invoke_C20(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, filter.invoke()); } + protected Object invoke_Y0(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9, Object a10, Object a11, + Object a12, Object a13, Object a14, Object a15, + Object a16, Object a17, Object a18, Object a19) throws Throwable { + Object[] av = { a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19 }; + filter.invoke(av); // make the flyby + return target.invoke(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]); } + } } diff --git a/jdk/src/share/classes/sun/dyn/FilterOneArgument.java b/jdk/src/share/classes/sun/dyn/FilterOneArgument.java index c2fd98e0c09..ac9849c69d9 100644 --- a/jdk/src/share/classes/sun/dyn/FilterOneArgument.java +++ b/jdk/src/share/classes/sun/dyn/FilterOneArgument.java @@ -27,7 +27,6 @@ package sun.dyn; import java.dyn.JavaMethodHandle; import java.dyn.MethodHandle; -import java.dyn.MethodHandles; import java.dyn.MethodType; /** @@ -42,16 +41,21 @@ public class FilterOneArgument extends JavaMethodHandle { protected final MethodHandle filter; // Object -> Object protected final MethodHandle target; // Object -> Object - protected Object entryPoint(Object argument) { - Object filteredArgument = filter.invoke(argument); - return target.invoke(filteredArgument); + @Override + public String toString() { + return target.toString(); } - private static final MethodHandle entryPoint = - MethodHandleImpl.IMPL_LOOKUP.findVirtual(FilterOneArgument.class, "entryPoint", MethodType.makeGeneric(1)); + protected Object invoke(Object argument) throws Throwable { + Object filteredArgument = filter.invoke(argument); + return target.invoke(filteredArgument); + } + + private static final MethodHandle INVOKE = + MethodHandleImpl.IMPL_LOOKUP.findVirtual(FilterOneArgument.class, "invoke", MethodType.genericMethodType(1)); protected FilterOneArgument(MethodHandle filter, MethodHandle target) { - super(entryPoint); + super(INVOKE); this.filter = filter; this.target = target; } @@ -62,10 +66,6 @@ public class FilterOneArgument extends JavaMethodHandle { return new FilterOneArgument(filter, target); } - public String toString() { - return filter + "|>" + target; - } - // MethodHandle make(MethodHandle filter1, MethodHandle filter2, MethodHandle target) { // MethodHandle filter = make(filter1, filter2); // return make(filter, target); diff --git a/jdk/src/share/classes/sun/dyn/FromGeneric.java b/jdk/src/share/classes/sun/dyn/FromGeneric.java index 85f35d65577..a42be3fcd51 100644 --- a/jdk/src/share/classes/sun/dyn/FromGeneric.java +++ b/jdk/src/share/classes/sun/dyn/FromGeneric.java @@ -36,8 +36,8 @@ import sun.dyn.util.ValueConversions; import sun.dyn.util.Wrapper; /** - * Adapters which mediate between incoming calls which are not generic - * and outgoing calls which are. Any call can be represented generically + * Adapters which mediate between incoming calls which are generic + * and outgoing calls which are not. Any call can be represented generically * boxing up its arguments, and (on return) unboxing the return value. *

      * A call is "generic" (in MethodHandle terms) if its MethodType features @@ -50,9 +50,6 @@ import sun.dyn.util.Wrapper; * either binds internally or else takes as a leading argument). * (To stretch the term, adapter-like method handles may have multiple * targets or be polymorphic across multiple call types.) - *

      - * This adapter can sometimes be more directly implemented - * by the JVM's built-in OP_SPREAD_ARGS adapter. * @author jrose */ class FromGeneric { @@ -99,7 +96,7 @@ class FromGeneric { } this.internalType = internalType0; this.adapter = ad; - MethodType tepType = targetType.insertParameterType(0, adapter.getClass()); + MethodType tepType = targetType.insertParameterTypes(0, adapter.getClass()); this.entryPoint = ad.prototypeEntryPoint(); this.returnConversion = computeReturnConversion(targetType, internalType0); this.unboxingInvoker = computeUnboxingInvoker(targetType, internalType0); @@ -146,7 +143,7 @@ class FromGeneric { if (fixArgs == null) throw new InternalError("bad fixArgs"); // reinterpret the calling sequence as raw: - MethodHandle retyper = AdapterMethodHandle.makeRawRetypeOnly(Access.TOKEN, + MethodHandle retyper = AdapterMethodHandle.makeRetypeRaw(Access.TOKEN, Invokers.invokerType(internalType), fixArgs); if (retyper == null) throw new InternalError("bad retyper"); @@ -226,7 +223,10 @@ class FromGeneric { // Produce an instance configured as a prototype. return ctor.newInstance(entryPoint); } catch (IllegalArgumentException ex) { - } catch (InvocationTargetException ex) { + } catch (InvocationTargetException wex) { + Throwable ex = wex.getTargetException(); + if (ex instanceof Error) throw (Error)ex; + if (ex instanceof RuntimeException) throw (RuntimeException)ex; } catch (InstantiationException ex) { } catch (IllegalAccessException ex) { } @@ -260,6 +260,11 @@ class FromGeneric { protected final MethodHandle convert; // raw(R) => Object protected final MethodHandle target; // (any**N) => R + @Override + public String toString() { + return target.toString(); + } + protected boolean isPrototype() { return target == null; } protected Adapter(MethodHandle entryPoint) { this(entryPoint, null, entryPoint, null); @@ -284,11 +289,11 @@ class FromGeneric { // { return new ThisType(entryPoint, convert, target); } /// Conversions on the value returned from the target. - protected Object convert_L(Object result) { return convert.invoke(result); } - protected Object convert_I(int result) { return convert.invoke(result); } - protected Object convert_J(long result) { return convert.invoke(result); } - protected Object convert_F(float result) { return convert.invoke(result); } - protected Object convert_D(double result) { return convert.invoke(result); } + protected Object convert_L(Object result) throws Throwable { return convert.invoke(result); } + protected Object convert_I(int result) throws Throwable { return convert.invoke(result); } + protected Object convert_J(long result) throws Throwable { return convert.invoke(result); } + protected Object convert_F(float result) throws Throwable { return convert.invoke(result); } + protected Object convert_D(double result) throws Throwable { return convert.invoke(result); } static private final String CLASS_PREFIX; // "sun.dyn.FromGeneric$" static { @@ -317,11 +322,11 @@ class FromGeneric { { super(e, i, c, t); } protected xA2 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new xA2(e, i, c, t); } - protected Object invoke_L2(Object a0, Object a1) { return convert_L(invoker.invoke(target, a0, a1)); } - protected Object invoke_I2(Object a0, Object a1) { return convert_I(invoker.invoke(target, a0, a1)); } - protected Object invoke_J2(Object a0, Object a1) { return convert_J(invoker.invoke(target, a0, a1)); } - protected Object invoke_F2(Object a0, Object a1) { return convert_F(invoker.invoke(target, a0, a1)); } - protected Object invoke_D2(Object a0, Object a1) { return convert_D(invoker.invoke(target, a0, a1)); } + protected Object invoke_L2(Object a0, Object a1) throws Throwable { return convert_L(invoker.invoke(target, a0, a1)); } + protected Object invoke_I2(Object a0, Object a1) throws Throwable { return convert_I(invoker.invoke(target, a0, a1)); } + protected Object invoke_J2(Object a0, Object a1) throws Throwable { return convert_J(invoker.invoke(target, a0, a1)); } + protected Object invoke_F2(Object a0, Object a1) throws Throwable { return convert_F(invoker.invoke(target, a0, a1)); } + protected Object invoke_D2(Object a0, Object a1) throws Throwable { return convert_D(invoker.invoke(target, a0, a1)); } } // */ @@ -342,7 +347,7 @@ class genclasses { " protected @cat@ makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t)", " { return new @cat@(e, i, c, t); }", " //@each-R@", - " protected Object invoke_@catN@(@Tvav@) { return convert_@Rc@(invoker.<@R@>invoke(target@av@)); }", + " protected Object invoke_@catN@(@Tvav@) throws Throwable { return convert_@Rc@(invoker.<@R@>invoke(target@av@)); }", " //@end-R@", " }", } }; @@ -498,11 +503,11 @@ class genclasses { { super(e, i, c, t); } protected A0 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A0(e, i, c, t); } - protected Object invoke_L0() { return convert_L(invoker.invoke(target)); } - protected Object invoke_I0() { return convert_I(invoker.invoke(target)); } - protected Object invoke_J0() { return convert_J(invoker.invoke(target)); } - protected Object invoke_F0() { return convert_F(invoker.invoke(target)); } - protected Object invoke_D0() { return convert_D(invoker.invoke(target)); } + protected Object invoke_L0() throws Throwable { return convert_L(invoker.invoke(target)); } + protected Object invoke_I0() throws Throwable { return convert_I(invoker.invoke(target)); } + protected Object invoke_J0() throws Throwable { return convert_J(invoker.invoke(target)); } + protected Object invoke_F0() throws Throwable { return convert_F(invoker.invoke(target)); } + protected Object invoke_D0() throws Throwable { return convert_D(invoker.invoke(target)); } } static class A1 extends Adapter { protected A1(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -510,11 +515,11 @@ class genclasses { { super(e, i, c, t); } protected A1 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A1(e, i, c, t); } - protected Object invoke_L1(Object a0) { return convert_L(invoker.invoke(target, a0)); } - protected Object invoke_I1(Object a0) { return convert_I(invoker.invoke(target, a0)); } - protected Object invoke_J1(Object a0) { return convert_J(invoker.invoke(target, a0)); } - protected Object invoke_F1(Object a0) { return convert_F(invoker.invoke(target, a0)); } - protected Object invoke_D1(Object a0) { return convert_D(invoker.invoke(target, a0)); } + protected Object invoke_L1(Object a0) throws Throwable { return convert_L(invoker.invoke(target, a0)); } + protected Object invoke_I1(Object a0) throws Throwable { return convert_I(invoker.invoke(target, a0)); } + protected Object invoke_J1(Object a0) throws Throwable { return convert_J(invoker.invoke(target, a0)); } + protected Object invoke_F1(Object a0) throws Throwable { return convert_F(invoker.invoke(target, a0)); } + protected Object invoke_D1(Object a0) throws Throwable { return convert_D(invoker.invoke(target, a0)); } } static class A2 extends Adapter { protected A2(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -522,11 +527,11 @@ class genclasses { { super(e, i, c, t); } protected A2 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A2(e, i, c, t); } - protected Object invoke_L2(Object a0, Object a1) { return convert_L(invoker.invoke(target, a0, a1)); } - protected Object invoke_I2(Object a0, Object a1) { return convert_I(invoker.invoke(target, a0, a1)); } - protected Object invoke_J2(Object a0, Object a1) { return convert_J(invoker.invoke(target, a0, a1)); } - protected Object invoke_F2(Object a0, Object a1) { return convert_F(invoker.invoke(target, a0, a1)); } - protected Object invoke_D2(Object a0, Object a1) { return convert_D(invoker.invoke(target, a0, a1)); } + protected Object invoke_L2(Object a0, Object a1) throws Throwable { return convert_L(invoker.invoke(target, a0, a1)); } + protected Object invoke_I2(Object a0, Object a1) throws Throwable { return convert_I(invoker.invoke(target, a0, a1)); } + protected Object invoke_J2(Object a0, Object a1) throws Throwable { return convert_J(invoker.invoke(target, a0, a1)); } + protected Object invoke_F2(Object a0, Object a1) throws Throwable { return convert_F(invoker.invoke(target, a0, a1)); } + protected Object invoke_D2(Object a0, Object a1) throws Throwable { return convert_D(invoker.invoke(target, a0, a1)); } } static class A3 extends Adapter { protected A3(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -534,11 +539,11 @@ class genclasses { { super(e, i, c, t); } protected A3 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A3(e, i, c, t); } - protected Object invoke_L3(Object a0, Object a1, Object a2) { return convert_L(invoker.invoke(target, a0, a1, a2)); } - protected Object invoke_I3(Object a0, Object a1, Object a2) { return convert_I(invoker.invoke(target, a0, a1, a2)); } - protected Object invoke_J3(Object a0, Object a1, Object a2) { return convert_J(invoker.invoke(target, a0, a1, a2)); } - protected Object invoke_F3(Object a0, Object a1, Object a2) { return convert_F(invoker.invoke(target, a0, a1, a2)); } - protected Object invoke_D3(Object a0, Object a1, Object a2) { return convert_D(invoker.invoke(target, a0, a1, a2)); } + protected Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable { return convert_L(invoker.invoke(target, a0, a1, a2)); } + protected Object invoke_I3(Object a0, Object a1, Object a2) throws Throwable { return convert_I(invoker.invoke(target, a0, a1, a2)); } + protected Object invoke_J3(Object a0, Object a1, Object a2) throws Throwable { return convert_J(invoker.invoke(target, a0, a1, a2)); } + protected Object invoke_F3(Object a0, Object a1, Object a2) throws Throwable { return convert_F(invoker.invoke(target, a0, a1, a2)); } + protected Object invoke_D3(Object a0, Object a1, Object a2) throws Throwable { return convert_D(invoker.invoke(target, a0, a1, a2)); } } static class A4 extends Adapter { protected A4(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -546,11 +551,11 @@ class genclasses { { super(e, i, c, t); } protected A4 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A4(e, i, c, t); } - protected Object invoke_L4(Object a0, Object a1, Object a2, Object a3) { return convert_L(invoker.invoke(target, a0, a1, a2, a3)); } - protected Object invoke_I4(Object a0, Object a1, Object a2, Object a3) { return convert_I(invoker.invoke(target, a0, a1, a2, a3)); } - protected Object invoke_J4(Object a0, Object a1, Object a2, Object a3) { return convert_J(invoker.invoke(target, a0, a1, a2, a3)); } - protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3) { return convert_F(invoker.invoke(target, a0, a1, a2, a3)); } - protected Object invoke_D4(Object a0, Object a1, Object a2, Object a3) { return convert_D(invoker.invoke(target, a0, a1, a2, a3)); } + protected Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_L(invoker.invoke(target, a0, a1, a2, a3)); } + protected Object invoke_I4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_I(invoker.invoke(target, a0, a1, a2, a3)); } + protected Object invoke_J4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_J(invoker.invoke(target, a0, a1, a2, a3)); } + protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_F(invoker.invoke(target, a0, a1, a2, a3)); } + protected Object invoke_D4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_D(invoker.invoke(target, a0, a1, a2, a3)); } } static class A5 extends Adapter { protected A5(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -558,11 +563,11 @@ class genclasses { { super(e, i, c, t); } protected A5 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A5(e, i, c, t); } - protected Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) { return convert_L(invoker.invoke(target, a0, a1, a2, a3, a4)); } - protected Object invoke_I5(Object a0, Object a1, Object a2, Object a3, Object a4) { return convert_I(invoker.invoke(target, a0, a1, a2, a3, a4)); } - protected Object invoke_J5(Object a0, Object a1, Object a2, Object a3, Object a4) { return convert_J(invoker.invoke(target, a0, a1, a2, a3, a4)); } - protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, Object a4) { return convert_F(invoker.invoke(target, a0, a1, a2, a3, a4)); } - protected Object invoke_D5(Object a0, Object a1, Object a2, Object a3, Object a4) { return convert_D(invoker.invoke(target, a0, a1, a2, a3, a4)); } + protected Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_L(invoker.invoke(target, a0, a1, a2, a3, a4)); } + protected Object invoke_I5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_I(invoker.invoke(target, a0, a1, a2, a3, a4)); } + protected Object invoke_J5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_J(invoker.invoke(target, a0, a1, a2, a3, a4)); } + protected Object invoke_F5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_F(invoker.invoke(target, a0, a1, a2, a3, a4)); } + protected Object invoke_D5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_D(invoker.invoke(target, a0, a1, a2, a3, a4)); } } static class A6 extends Adapter { protected A6(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -570,11 +575,11 @@ class genclasses { { super(e, i, c, t); } protected A6 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A6(e, i, c, t); } - protected Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) { return convert_L(invoker.invoke(target, a0, a1, a2, a3, a4, a5)); } - protected Object invoke_I6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) { return convert_I(invoker.invoke(target, a0, a1, a2, a3, a4, a5)); } - protected Object invoke_J6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) { return convert_J(invoker.invoke(target, a0, a1, a2, a3, a4, a5)); } - protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) { return convert_F(invoker.invoke(target, a0, a1, a2, a3, a4, a5)); } - protected Object invoke_D6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) { return convert_D(invoker.invoke(target, a0, a1, a2, a3, a4, a5)); } + protected Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_L(invoker.invoke(target, a0, a1, a2, a3, a4, a5)); } + protected Object invoke_I6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_I(invoker.invoke(target, a0, a1, a2, a3, a4, a5)); } + protected Object invoke_J6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_J(invoker.invoke(target, a0, a1, a2, a3, a4, a5)); } + protected Object invoke_F6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_F(invoker.invoke(target, a0, a1, a2, a3, a4, a5)); } + protected Object invoke_D6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_D(invoker.invoke(target, a0, a1, a2, a3, a4, a5)); } } static class A7 extends Adapter { protected A7(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -582,11 +587,11 @@ class genclasses { { super(e, i, c, t); } protected A7 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A7(e, i, c, t); } - protected Object invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) { return convert_L(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6)); } - protected Object invoke_I7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) { return convert_I(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6)); } - protected Object invoke_J7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) { return convert_J(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6)); } - protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) { return convert_F(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6)); } - protected Object invoke_D7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) { return convert_D(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6)); } + protected Object invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_L(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6)); } + protected Object invoke_I7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_I(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6)); } + protected Object invoke_J7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_J(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6)); } + protected Object invoke_F7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_F(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6)); } + protected Object invoke_D7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_D(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6)); } } static class A8 extends Adapter { protected A8(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -594,11 +599,11 @@ class genclasses { { super(e, i, c, t); } protected A8 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A8(e, i, c, t); } - protected Object invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) { return convert_L(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7)); } - protected Object invoke_I8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) { return convert_I(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7)); } - protected Object invoke_J8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) { return convert_J(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7)); } - protected Object invoke_F8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) { return convert_F(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7)); } - protected Object invoke_D8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) { return convert_D(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7)); } + 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(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7)); } + 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(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7)); } + 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(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7)); } + 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(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7)); } + 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(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7)); } } static class A9 extends Adapter { protected A9(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -606,11 +611,11 @@ class genclasses { { super(e, i, c, t); } protected A9 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A9(e, i, c, t); } - protected Object invoke_L9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) { return convert_L(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected Object invoke_I9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) { return convert_I(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected Object invoke_J9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) { return convert_J(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected Object invoke_F9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) { return convert_F(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected Object invoke_D9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) { return convert_D(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } + 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(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } + 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(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } + 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(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } + 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(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } + 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(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); } } static class A10 extends Adapter { protected A10(MethodHandle entryPoint) { super(entryPoint); } // to build prototype @@ -618,10 +623,10 @@ class genclasses { { super(e, i, c, t); } protected A10 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A10(e, i, c, t); } - protected Object invoke_L10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) { return convert_L(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected Object invoke_I10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) { return convert_I(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected Object invoke_J10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) { return convert_J(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected Object invoke_F10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) { return convert_F(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected Object invoke_D10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) { return convert_D(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } + 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(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } + 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(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } + 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(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } + 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(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } + 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(invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } } } diff --git a/jdk/src/share/classes/sun/dyn/Invokers.java b/jdk/src/share/classes/sun/dyn/Invokers.java index eddd437a5d5..c1565852e4c 100644 --- a/jdk/src/share/classes/sun/dyn/Invokers.java +++ b/jdk/src/share/classes/sun/dyn/Invokers.java @@ -44,16 +44,20 @@ public class Invokers { // generic (untyped) invoker for the outgoing call private /*lazy*/ MethodHandle genericInvoker; + // generic (untyped) invoker for the outgoing call; accepts a single Object[] + private final /*lazy*/ MethodHandle[] varargsInvokers; + /** Compute and cache information common to all collecting adapters * that implement members of the erasure-family of the given erased type. */ public Invokers(Access token, MethodType targetType) { Access.check(token); this.targetType = targetType; + this.varargsInvokers = new MethodHandle[targetType.parameterCount()+1]; } public static MethodType invokerType(MethodType targetType) { - return targetType.insertParameterType(0, MethodHandle.class); + return targetType.insertParameterTypes(0, MethodHandle.class); } public MethodHandle exactInvoker() { @@ -76,8 +80,14 @@ public class Invokers { return invoker; } - public MethodHandle varargsInvoker() { - throw new UnsupportedOperationException("NYI"); + public MethodHandle varargsInvoker(int objectArgCount) { + MethodHandle vaInvoker = varargsInvokers[objectArgCount]; + if (vaInvoker != null) return vaInvoker; + MethodHandle gInvoker = genericInvoker(); + MethodType vaType = MethodType.genericMethodType(objectArgCount, true); + vaInvoker = MethodHandles.spreadArguments(gInvoker, invokerType(vaType)); + varargsInvokers[objectArgCount] = vaInvoker; + return vaInvoker; } public String toString() { diff --git a/jdk/src/share/classes/sun/dyn/MemberName.java b/jdk/src/share/classes/sun/dyn/MemberName.java index 26919efa8c5..01af94b5166 100644 --- a/jdk/src/share/classes/sun/dyn/MemberName.java +++ b/jdk/src/share/classes/sun/dyn/MemberName.java @@ -25,7 +25,7 @@ package sun.dyn; -import sun.dyn.util.BytecodeSignature; +import sun.dyn.util.BytecodeDescriptor; import java.dyn.*; import java.lang.reflect.Constructor; import java.lang.reflect.Field; @@ -33,6 +33,7 @@ import java.lang.reflect.Method; import java.lang.reflect.Member; import java.lang.reflect.Modifier; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.List; @@ -93,7 +94,7 @@ public final class MemberName implements Member, Cloneable { } if (type instanceof String) { String sig = (String) type; - MethodType res = MethodType.fromBytecodeString(sig, getClassLoader()); + MethodType res = MethodType.fromMethodDescriptorString(sig, getClassLoader()); this.type = res; return res; } @@ -101,7 +102,7 @@ public final class MemberName implements Member, Cloneable { Object[] typeInfo = (Object[]) type; Class[] ptypes = (Class[]) typeInfo[1]; Class rtype = (Class) typeInfo[0]; - MethodType res = MethodType.make(rtype, ptypes); + MethodType res = MethodType.methodType(rtype, ptypes); this.type = res; return res; } @@ -111,7 +112,7 @@ public final class MemberName implements Member, Cloneable { public MethodType getInvocationType() { MethodType itype = getMethodType(); if (!isStatic()) - itype = itype.insertParameterType(0, clazz); + itype = itype.insertParameterTypes(0, clazz); return itype; } @@ -135,7 +136,7 @@ public final class MemberName implements Member, Cloneable { } if (type instanceof String) { String sig = (String) type; - MethodType mtype = MethodType.fromBytecodeString("()"+sig, getClassLoader()); + MethodType mtype = MethodType.fromMethodDescriptorString("()"+sig, getClassLoader()); Class res = mtype.returnType(); this.type = res; return res; @@ -155,9 +156,9 @@ public final class MemberName implements Member, Cloneable { if (type instanceof String) return (String) type; if (isInvocable()) - return BytecodeSignature.unparse(getMethodType()); + return BytecodeDescriptor.unparse(getMethodType()); else - return BytecodeSignature.unparse(getFieldType()); + return BytecodeDescriptor.unparse(getFieldType()); } public int getModifiers() { @@ -353,6 +354,8 @@ public final class MemberName implements Member, Cloneable { return type.toString(); // class java.lang.String // else it is a field, method, or constructor StringBuilder buf = new StringBuilder(); + if (!isResolved()) + buf.append("*."); if (getDeclaringClass() != null) { buf.append(getName(clazz)); buf.append('.'); @@ -381,7 +384,7 @@ public final class MemberName implements Member, Cloneable { private static String getName(Object obj) { if (obj instanceof Class) return ((Class)obj).getName(); - return obj.toString(); + return String.valueOf(obj); } // Queries to the JVM: @@ -408,6 +411,9 @@ public final class MemberName implements Member, Cloneable { public static NoAccessException newNoAccessException(MemberName name, Class lookupClass) { return newNoAccessException("cannot access", name, lookupClass); } + public static NoAccessException newNoAccessException(MemberName name, MethodHandles.Lookup lookup) { + return newNoAccessException(name, lookup.lookupClass()); + } public static NoAccessException newNoAccessException(String message, MemberName name, Class lookupClass) { message += ": " + name; @@ -436,7 +442,7 @@ public final class MemberName implements Member, Cloneable { matchFlags &= ALLOWED_FLAGS; String matchSig = null; if (matchType != null) { - matchSig = BytecodeSignature.unparse(matchType); + matchSig = BytecodeDescriptor.unparse(matchType); if (matchSig.startsWith("(")) matchFlags &= ~(ALL_KINDS & ~IS_INVOCABLE); else @@ -447,17 +453,18 @@ public final class MemberName implements Member, Cloneable { MemberName[] buf = newMemberBuffer(len1); int totalCount = 0; ArrayList bufs = null; + int bufCount = 0; for (;;) { - int bufCount = MethodHandleNatives.getMembers(defc, + bufCount = MethodHandleNatives.getMembers(defc, matchName, matchSig, matchFlags, lookupClass, totalCount, buf); if (bufCount <= buf.length) { - if (bufCount >= 0) - totalCount += bufCount; + if (bufCount < 0) bufCount = 0; + totalCount += bufCount; break; } - // JVM returned tp us with an intentional overflow! + // JVM returned to us with an intentional overflow! totalCount += buf.length; int excess = bufCount - buf.length; if (bufs == null) bufs = new ArrayList(1); @@ -473,7 +480,7 @@ public final class MemberName implements Member, Cloneable { Collections.addAll(result, buf0); } } - Collections.addAll(result, buf); + result.addAll(Arrays.asList(buf).subList(0, bufCount)); // Signature matching is not the same as type matching, since // one signature might correspond to several types. // So if matchType is a Class or MethodType, refilter the results. diff --git a/jdk/src/share/classes/sun/dyn/MethodHandleImpl.java b/jdk/src/share/classes/sun/dyn/MethodHandleImpl.java index 2dd59deeff0..f8a8bca38d7 100644 --- a/jdk/src/share/classes/sun/dyn/MethodHandleImpl.java +++ b/jdk/src/share/classes/sun/dyn/MethodHandleImpl.java @@ -25,12 +25,25 @@ package sun.dyn; +import java.dyn.JavaMethodHandle; import java.dyn.MethodHandle; import java.dyn.MethodHandles; import java.dyn.MethodHandles.Lookup; import java.dyn.MethodType; +import java.util.logging.Level; +import java.util.logging.Logger; import sun.dyn.util.VerifyType; import java.dyn.NoAccessException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import sun.dyn.empty.Empty; +import sun.dyn.util.ValueConversions; +import sun.dyn.util.Wrapper; +import sun.misc.Unsafe; import static sun.dyn.MemberName.newIllegalArgumentException; import static sun.dyn.MemberName.newNoAccessException; @@ -57,6 +70,25 @@ public abstract class MethodHandleImpl { static final int INT_FIELD = 0; static final long LONG_FIELD = 0; + /** Access methods for the internals of MethodHandle, supplied to + * MethodHandleImpl as a trusted agent. + */ + static public interface MethodHandleFriend { + void initType(MethodHandle mh, MethodType type); + } + public static void setMethodHandleFriend(Access token, MethodHandleFriend am) { + Access.check(token); + if (METHOD_HANDLE_FRIEND != null) + throw new InternalError(); // just once + METHOD_HANDLE_FRIEND = am; + } + static private MethodHandleFriend METHOD_HANDLE_FRIEND; + + // NOT public + static void initType(MethodHandle mh, MethodType type) { + METHOD_HANDLE_FRIEND.initType(mh, type); + } + // type is defined in java.dyn.MethodHandle, which is platform-independent // vmentry (a void* field) is used *only* by by the JVM. @@ -106,8 +138,8 @@ public abstract class MethodHandleImpl { } static { - // Force initialization: - Lookup.PUBLIC_LOOKUP.lookupClass(); + // Force initialization of Lookup, so it calls us back as initLookup: + MethodHandles.publicLookup(); if (IMPL_LOOKUP_INIT == null) throw new InternalError(); } @@ -151,7 +183,7 @@ public abstract class MethodHandleImpl { // adjust the advertised receiver type to be exactly the one requested // (in the case of invokespecial, this will be the calling class) Class recvType = method.getDeclaringClass(); - mtype = mtype.insertParameterType(0, recvType); + mtype = mtype.insertParameterTypes(0, recvType); if (method.isConstructor()) doDispatch = true; // FIXME: JVM has trouble building MH.invoke sites for @@ -170,21 +202,223 @@ public abstract class MethodHandleImpl { public static MethodHandle accessField(Access token, - MemberName member, boolean isSetter, - Class lookupClass) { + MemberName member, boolean isSetter, + Class lookupClass) { Access.check(token); - // FIXME: Use sun.misc.Unsafe to dig up the dirt on the field. - throw new UnsupportedOperationException("Not yet implemented"); + // Use sun. misc.Unsafe to dig up the dirt on the field. + MethodHandle mh = new FieldAccessor(token, member, isSetter); + return mh; } public static MethodHandle accessArrayElement(Access token, - Class arrayClass, boolean isSetter) { + Class arrayClass, boolean isSetter) { Access.check(token); if (!arrayClass.isArray()) throw newIllegalArgumentException("not an array: "+arrayClass); - // FIXME: Use sun.misc.Unsafe to dig up the dirt on the array. - throw new UnsupportedOperationException("Not yet implemented"); + Class elemClass = arrayClass.getComponentType(); + MethodHandle[] mhs = FieldAccessor.ARRAY_CACHE.get(elemClass); + if (mhs == null) { + if (!FieldAccessor.doCache(elemClass)) + return FieldAccessor.ahandle(arrayClass, isSetter); + mhs = new MethodHandle[] { + FieldAccessor.ahandle(arrayClass, false), + FieldAccessor.ahandle(arrayClass, true) + }; + if (mhs[0].type().parameterType(0) == Class.class) { + mhs[0] = MethodHandles.insertArguments(mhs[0], 0, elemClass); + mhs[1] = MethodHandles.insertArguments(mhs[1], 0, elemClass); + } + synchronized (FieldAccessor.ARRAY_CACHE) {} // memory barrier + FieldAccessor.ARRAY_CACHE.put(elemClass, mhs); + } + return mhs[isSetter ? 1 : 0]; + } + + static final class FieldAccessor extends JavaMethodHandle { + private static final Unsafe unsafe = Unsafe.getUnsafe(); + final Object base; // for static refs only + final long offset; + final String name; + + public FieldAccessor(Access token, MemberName field, boolean isSetter) { + super(fhandle(field.getDeclaringClass(), field.getFieldType(), isSetter, field.isStatic())); + this.offset = (long) field.getVMIndex(token); + this.name = field.getName(); + this.base = staticBase(field); + } + public String toString() { return name; } + + int getFieldI(C obj) { return unsafe.getInt(obj, offset); } + void setFieldI(C obj, int x) { unsafe.putInt(obj, offset, x); } + long getFieldJ(C obj) { return unsafe.getLong(obj, offset); } + void setFieldJ(C obj, long x) { unsafe.putLong(obj, offset, x); } + float getFieldF(C obj) { return unsafe.getFloat(obj, offset); } + void setFieldF(C obj, float x) { unsafe.putFloat(obj, offset, x); } + double getFieldD(C obj) { return unsafe.getDouble(obj, offset); } + void setFieldD(C obj, double x) { unsafe.putDouble(obj, offset, x); } + boolean getFieldZ(C obj) { return unsafe.getBoolean(obj, offset); } + void setFieldZ(C obj, boolean x) { unsafe.putBoolean(obj, offset, x); } + byte getFieldB(C obj) { return unsafe.getByte(obj, offset); } + void setFieldB(C obj, byte x) { unsafe.putByte(obj, offset, x); } + short getFieldS(C obj) { return unsafe.getShort(obj, offset); } + void setFieldS(C obj, short x) { unsafe.putShort(obj, offset, x); } + char getFieldC(C obj) { return unsafe.getChar(obj, offset); } + void setFieldC(C obj, char x) { unsafe.putChar(obj, offset, x); } + @SuppressWarnings("unchecked") + V getFieldL(C obj) { return (V) unsafe.getObject(obj, offset); } + @SuppressWarnings("unchecked") + void setFieldL(C obj, V x) { unsafe.putObject(obj, offset, x); } + // cast (V) is OK here, since we wrap convertArguments around the MH. + + static Object staticBase(MemberName field) { + if (!field.isStatic()) return null; + Class c = field.getDeclaringClass(); + java.lang.reflect.Field f; + try { + // FIXME: Should not have to create 'f' to get this value. + f = c.getDeclaredField(field.getName()); + return unsafe.staticFieldBase(f); + } catch (Exception ee) { + Error e = new InternalError(); + e.initCause(ee); + throw e; + } + } + + int getStaticI() { return unsafe.getInt(base, offset); } + void setStaticI(int x) { unsafe.putInt(base, offset, x); } + long getStaticJ() { return unsafe.getLong(base, offset); } + void setStaticJ(long x) { unsafe.putLong(base, offset, x); } + float getStaticF() { return unsafe.getFloat(base, offset); } + void setStaticF(float x) { unsafe.putFloat(base, offset, x); } + double getStaticD() { return unsafe.getDouble(base, offset); } + void setStaticD(double x) { unsafe.putDouble(base, offset, x); } + boolean getStaticZ() { return unsafe.getBoolean(base, offset); } + void setStaticZ(boolean x) { unsafe.putBoolean(base, offset, x); } + byte getStaticB() { return unsafe.getByte(base, offset); } + void setStaticB(byte x) { unsafe.putByte(base, offset, x); } + short getStaticS() { return unsafe.getShort(base, offset); } + void setStaticS(short x) { unsafe.putShort(base, offset, x); } + char getStaticC() { return unsafe.getChar(base, offset); } + void setStaticC(char x) { unsafe.putChar(base, offset, x); } + V getStaticL() { return (V) unsafe.getObject(base, offset); } + void setStaticL(V x) { unsafe.putObject(base, offset, x); } + + static String fname(Class vclass, boolean isSetter, boolean isStatic) { + String stem; + if (!isStatic) + stem = (!isSetter ? "getField" : "setField"); + else + stem = (!isSetter ? "getStatic" : "setStatic"); + return stem + Wrapper.basicTypeChar(vclass); + } + static MethodType ftype(Class cclass, Class vclass, boolean isSetter, boolean isStatic) { + MethodType type; + if (!isStatic) { + if (!isSetter) + return MethodType.methodType(vclass, cclass); + else + return MethodType.methodType(void.class, cclass, vclass); + } else { + if (!isSetter) + return MethodType.methodType(vclass); + else + return MethodType.methodType(void.class, vclass); + } + } + static MethodHandle fhandle(Class cclass, Class vclass, boolean isSetter, boolean isStatic) { + String name = FieldAccessor.fname(vclass, isSetter, isStatic); + if (cclass.isPrimitive()) throw newIllegalArgumentException("primitive "+cclass); + Class ecclass = Object.class; //erase this type + Class evclass = vclass; + if (!evclass.isPrimitive()) evclass = Object.class; + MethodType type = FieldAccessor.ftype(ecclass, evclass, isSetter, isStatic); + MethodHandle mh; + try { + mh = IMPL_LOOKUP.findVirtual(FieldAccessor.class, name, type); + } catch (NoAccessException ee) { + Error e = new InternalError("name,type="+name+type); + e.initCause(ee); + throw e; + } + if (evclass != vclass || (!isStatic && ecclass != cclass)) { + MethodType strongType = FieldAccessor.ftype(cclass, vclass, isSetter, isStatic); + strongType = strongType.insertParameterTypes(0, FieldAccessor.class); + mh = MethodHandles.convertArguments(mh, strongType); + } + return mh; + } + + /// Support for array element access + static final HashMap, MethodHandle[]> ARRAY_CACHE = + new HashMap, MethodHandle[]>(); + // FIXME: Cache on the classes themselves, not here. + static boolean doCache(Class elemClass) { + if (elemClass.isPrimitive()) return true; + ClassLoader cl = elemClass.getClassLoader(); + return cl == null || cl == ClassLoader.getSystemClassLoader(); + } + static int getElementI(int[] a, int i) { return a[i]; } + static void setElementI(int[] a, int i, int x) { a[i] = x; } + static long getElementJ(long[] a, int i) { return a[i]; } + static void setElementJ(long[] a, int i, long x) { a[i] = x; } + static float getElementF(float[] a, int i) { return a[i]; } + static void setElementF(float[] a, int i, float x) { a[i] = x; } + static double getElementD(double[] a, int i) { return a[i]; } + static void setElementD(double[] a, int i, double x) { a[i] = x; } + static boolean getElementZ(boolean[] a, int i) { return a[i]; } + static void setElementZ(boolean[] a, int i, boolean x) { a[i] = x; } + static byte getElementB(byte[] a, int i) { return a[i]; } + static void setElementB(byte[] a, int i, byte x) { a[i] = x; } + static short getElementS(short[] a, int i) { return a[i]; } + static void setElementS(short[] a, int i, short x) { a[i] = x; } + static char getElementC(char[] a, int i) { return a[i]; } + static void setElementC(char[] a, int i, char x) { a[i] = x; } + static Object getElementL(Object[] a, int i) { return a[i]; } + static void setElementL(Object[] a, int i, Object x) { a[i] = x; } + static V getElementL(Class aclass, V[] a, int i) { return aclass.cast(a)[i]; } + static void setElementL(Class aclass, V[] a, int i, V x) { aclass.cast(a)[i] = x; } + + static String aname(Class aclass, boolean isSetter) { + Class vclass = aclass.getComponentType(); + if (vclass == null) throw new IllegalArgumentException(); + return (!isSetter ? "getElement" : "setElement") + Wrapper.basicTypeChar(vclass); + } + static MethodType atype(Class aclass, boolean isSetter) { + Class vclass = aclass.getComponentType(); + if (!isSetter) + return MethodType.methodType(vclass, aclass, int.class); + else + return MethodType.methodType(void.class, aclass, int.class, vclass); + } + static MethodHandle ahandle(Class aclass, boolean isSetter) { + Class vclass = aclass.getComponentType(); + String name = FieldAccessor.aname(aclass, isSetter); + Class caclass = null; + if (!vclass.isPrimitive() && vclass != Object.class) { + caclass = aclass; + aclass = Object[].class; + vclass = Object.class; + } + MethodType type = FieldAccessor.atype(aclass, isSetter); + if (caclass != null) + type = type.insertParameterTypes(0, Class.class); + MethodHandle mh; + try { + mh = IMPL_LOOKUP.findStatic(FieldAccessor.class, name, type); + } catch (NoAccessException ee) { + Error e = new InternalError("name,type="+name+type); + e.initCause(ee); + throw e; + } + if (caclass != null) { + MethodType strongType = FieldAccessor.atype(caclass, isSetter); + mh = MethodHandles.insertArguments(mh, 0, caclass); + mh = MethodHandles.convertArguments(mh, strongType); + } + return mh; + } } /** Bind a predetermined first argument to the given direct method handle. @@ -203,8 +437,11 @@ public abstract class MethodHandleImpl { if (info instanceof DirectMethodHandle) { DirectMethodHandle dmh = (DirectMethodHandle) info; if (receiver == null || - dmh.type().parameterType(0).isAssignableFrom(receiver.getClass())) - target = dmh; + dmh.type().parameterType(0).isAssignableFrom(receiver.getClass())) { + MethodHandle bmh = new BoundMethodHandle(dmh, receiver, 0); + MethodType newType = target.type().dropParameterTypes(0, 1); + return convertArguments(token, bmh, newType, bmh.type(), null); + } } } if (target instanceof DirectMethodHandle) @@ -223,7 +460,7 @@ public abstract class MethodHandleImpl { MethodHandle bindArgument(Access token, MethodHandle target, int argnum, Object receiver) { Access.check(token); - throw new UnsupportedOperationException("NYI"); + return new BoundMethodHandle(target, receiver, argnum); } public static MethodHandle convertArguments(Access token, @@ -232,6 +469,189 @@ public abstract class MethodHandleImpl { MethodType oldType, int[] permutationOrNull) { Access.check(token); + if (permutationOrNull != null) { + int outargs = oldType.parameterCount(), inargs = newType.parameterCount(); + if (permutationOrNull.length != outargs) + throw newIllegalArgumentException("wrong number of arguments in permutation"); + // Make the individual outgoing argument types match up first. + Class[] callTypeArgs = new Class[outargs]; + for (int i = 0; i < outargs; i++) + callTypeArgs[i] = newType.parameterType(permutationOrNull[i]); + MethodType callType = MethodType.methodType(oldType.returnType(), callTypeArgs); + target = convertArguments(token, target, callType, oldType, null); + assert(target != null); + oldType = target.type(); + List goal = new ArrayList(); // i*TOKEN + List state = new ArrayList(); // i*TOKEN + List drops = new ArrayList(); // not tokens + List dups = new ArrayList(); // not tokens + final int TOKEN = 10; // to mark items which are symbolic only + // state represents the argument values coming into target + for (int i = 0; i < outargs; i++) { + state.add(permutationOrNull[i] * TOKEN); + } + // goal represents the desired state + for (int i = 0; i < inargs; i++) { + if (state.contains(i * TOKEN)) { + goal.add(i * TOKEN); + } else { + // adapter must initially drop all unused arguments + drops.add(i); + } + } + // detect duplications + while (state.size() > goal.size()) { + for (int i2 = 0; i2 < state.size(); i2++) { + int arg1 = state.get(i2); + int i1 = state.indexOf(arg1); + if (i1 != i2) { + // found duplicate occurrence at i2 + int arg2 = (inargs++) * TOKEN; + state.set(i2, arg2); + dups.add(goal.indexOf(arg1)); + goal.add(arg2); + } + } + } + assert(state.size() == goal.size()); + int size = goal.size(); + while (!state.equals(goal)) { + // Look for a maximal sequence of adjacent misplaced arguments, + // and try to rotate them into place. + int bestRotArg = -10 * TOKEN, bestRotLen = 0; + int thisRotArg = -10 * TOKEN, thisRotLen = 0; + for (int i = 0; i < size; i++) { + int arg = state.get(i); + // Does this argument match the current run? + if (arg == thisRotArg + TOKEN) { + thisRotArg = arg; + thisRotLen += 1; + if (bestRotLen < thisRotLen) { + bestRotLen = thisRotLen; + bestRotArg = thisRotArg; + } + } else { + // The old sequence (if any) stops here. + thisRotLen = 0; + thisRotArg = -10 * TOKEN; + // But maybe a new one starts here also. + int wantArg = goal.get(i); + final int MAX_ARG_ROTATION = AdapterMethodHandle.MAX_ARG_ROTATION; + if (arg != wantArg && + arg >= wantArg - TOKEN * MAX_ARG_ROTATION && + arg <= wantArg + TOKEN * MAX_ARG_ROTATION) { + thisRotArg = arg; + thisRotLen = 1; + } + } + } + if (bestRotLen >= 2) { + // Do a rotation if it can improve argument positioning + // by at least 2 arguments. This is not always optimal, + // but it seems to catch common cases. + int dstEnd = state.indexOf(bestRotArg); + int srcEnd = goal.indexOf(bestRotArg); + int rotBy = dstEnd - srcEnd; + int dstBeg = dstEnd - (bestRotLen - 1); + int srcBeg = srcEnd - (bestRotLen - 1); + assert((dstEnd | dstBeg | srcEnd | srcBeg) >= 0); // no negs + // Make a span which covers both source and destination. + int rotBeg = Math.min(dstBeg, srcBeg); + int rotEnd = Math.max(dstEnd, srcEnd); + int score = 0; + for (int i = rotBeg; i <= rotEnd; i++) { + if ((int)state.get(i) != (int)goal.get(i)) + score += 1; + } + List rotSpan = state.subList(rotBeg, rotEnd+1); + Collections.rotate(rotSpan, -rotBy); // reverse direction + for (int i = rotBeg; i <= rotEnd; i++) { + if ((int)state.get(i) != (int)goal.get(i)) + score -= 1; + } + if (score >= 2) { + // Improved at least two argument positions. Do it. + List> ptypes = Arrays.asList(oldType.parameterArray()); + Collections.rotate(ptypes.subList(rotBeg, rotEnd+1), -rotBy); + MethodType rotType = MethodType.methodType(oldType.returnType(), ptypes); + MethodHandle nextTarget + = AdapterMethodHandle.makeRotateArguments(token, rotType, target, + rotBeg, rotSpan.size(), rotBy); + if (nextTarget != null) { + //System.out.println("Rot: "+rotSpan+" by "+rotBy); + target = nextTarget; + oldType = rotType; + continue; + } + } + // Else de-rotate, and drop through to the swap-fest. + Collections.rotate(rotSpan, rotBy); + } + + // Now swap like the wind! + List> ptypes = Arrays.asList(oldType.parameterArray()); + for (int i = 0; i < size; i++) { + // What argument do I want here? + int arg = goal.get(i); + if (arg != state.get(i)) { + // Where is it now? + int j = state.indexOf(arg); + Collections.swap(ptypes, i, j); + MethodType swapType = MethodType.methodType(oldType.returnType(), ptypes); + target = AdapterMethodHandle.makeSwapArguments(token, swapType, target, i, j); + if (target == null) throw newIllegalArgumentException("cannot swap"); + assert(target.type() == swapType); + oldType = swapType; + Collections.swap(state, i, j); + } + } + // One pass of swapping must finish the job. + assert(state.equals(goal)); + } + while (!dups.isEmpty()) { + // Grab a contiguous trailing sequence of dups. + int grab = dups.size() - 1; + int dupArgPos = dups.get(grab), dupArgCount = 1; + while (grab - 1 >= 0) { + int dup0 = dups.get(grab - 1); + if (dup0 != dupArgPos - 1) break; + dupArgPos -= 1; + dupArgCount += 1; + grab -= 1; + } + //if (dupArgCount > 1) System.out.println("Dup: "+dups.subList(grab, dups.size())); + dups.subList(grab, dups.size()).clear(); + // In the new target type drop that many args from the tail: + List> ptypes = oldType.parameterList(); + ptypes = ptypes.subList(0, ptypes.size() - dupArgCount); + MethodType dupType = MethodType.methodType(oldType.returnType(), ptypes); + target = AdapterMethodHandle.makeDupArguments(token, dupType, target, dupArgPos, dupArgCount); + if (target == null) + throw newIllegalArgumentException("cannot dup"); + oldType = target.type(); + } + while (!drops.isEmpty()) { + // Grab a contiguous initial sequence of drops. + int dropArgPos = drops.get(0), dropArgCount = 1; + while (dropArgCount < drops.size()) { + int drop1 = drops.get(dropArgCount); + if (drop1 != dropArgPos + dropArgCount) break; + dropArgCount += 1; + } + //if (dropArgCount > 1) System.out.println("Drop: "+drops.subList(0, dropArgCount)); + drops.subList(0, dropArgCount).clear(); + List> dropTypes = newType.parameterList() + .subList(dropArgPos, dropArgPos + dropArgCount); + MethodType dropType = oldType.insertParameterTypes(dropArgPos, dropTypes); + target = AdapterMethodHandle.makeDropArguments(token, dropType, target, dropArgPos, dropArgCount); + if (target == null) throw newIllegalArgumentException("cannot drop"); + oldType = target.type(); + } + } + if (newType == oldType) + return target; + if (oldType.parameterCount() != newType.parameterCount()) + throw newIllegalArgumentException("mismatched parameter count"); MethodHandle res = AdapterMethodHandle.makePairwiseConvert(token, newType, target); if (res != null) return res; @@ -241,7 +661,7 @@ public abstract class MethodHandleImpl { // Use a heavier method: Convert all the arguments to Object, // then back to the desired types. We might have to use Java-based // method handles to do this. - MethodType objType = MethodType.makeGeneric(argc); + MethodType objType = MethodType.genericMethodType(argc); MethodHandle objTarget = AdapterMethodHandle.makePairwiseConvert(token, objType, target); if (objTarget == null) objTarget = FromGeneric.make(target); @@ -272,83 +692,386 @@ public abstract class MethodHandleImpl { Class[] ptypes = oldType.parameterArray(); for (int i = 0; i < spreadCount; i++) ptypes[spreadArg + i] = VerifyType.spreadArgElementType(spreadType, i); - MethodType midType = MethodType.make(newType.returnType(), ptypes); + MethodType midType = MethodType.methodType(newType.returnType(), ptypes); // after spreading, some arguments may need further conversion - target = convertArguments(token, target, midType, oldType, null); - if (target == null) + MethodHandle target2 = convertArguments(token, target, midType, oldType, null); + if (target2 == null) throw new UnsupportedOperationException("NYI: convert "+midType+" =calls=> "+oldType); - res = AdapterMethodHandle.makeSpreadArguments(token, newType, target, spreadArgType, spreadArg, spreadCount); + res = AdapterMethodHandle.makeSpreadArguments(token, newType, target2, spreadArgType, spreadArg, spreadCount); + if (res != null) + return res; + res = SpreadGeneric.make(target2, spreadCount); + if (res != null) + res = convertArguments(token, res, newType, res.type(), null); return res; } public static MethodHandle collectArguments(Access token, MethodHandle target, MethodType newType, - int collectArg) { - if (collectArg > 0) - throw new UnsupportedOperationException("NYI"); - throw new UnsupportedOperationException("NYI"); + int collectArg, + MethodHandle collector) { + MethodType oldType = target.type(); // (a...,c)=>r + if (collector == null) { + int numCollect = newType.parameterCount() - oldType.parameterCount() + 1; + collector = ValueConversions.varargsArray(numCollect); + } + // newType // (a..., b...)=>r + MethodType colType = collector.type(); // (b...)=>c + // oldType // (a..., b...)=>r + assert(newType.parameterCount() == collectArg + colType.parameterCount()); + assert(oldType.parameterCount() == collectArg + 1); + MethodHandle gtarget = convertArguments(token, target, oldType.generic(), oldType, null); + MethodHandle gcollector = convertArguments(token, collector, colType.generic(), colType, null); + if (gtarget == null || gcollector == null) return null; + MethodHandle gresult = FilterGeneric.makeArgumentCollector(gcollector, gtarget); + MethodHandle result = convertArguments(token, gresult, newType, gresult.type(), null); + return result; } + + public static MethodHandle filterArgument(Access token, + MethodHandle target, + int pos, + MethodHandle filter) { + Access.check(token); + MethodType ttype = target.type(), gttype = ttype.generic(); + if (ttype != gttype) { + target = convertArguments(token, target, gttype, ttype, null); + ttype = gttype; + } + MethodType ftype = filter.type(), gftype = ftype.generic(); + if (ftype.parameterCount() != 1) + throw new InternalError(); + if (ftype != gftype) { + filter = convertArguments(token, filter, gftype, ftype, null); + ftype = gftype; + } + if (ftype == ttype) { + // simple unary case + return FilterOneArgument.make(filter, target); + } + return FilterGeneric.makeArgumentFilter(pos, filter, target); + } + + public static MethodHandle foldArguments(Access token, + MethodHandle target, + MethodType newType, + MethodHandle combiner) { + Access.check(token); + MethodType oldType = target.type(); + MethodType ctype = combiner.type(); + MethodHandle gtarget = convertArguments(token, target, oldType.generic(), oldType, null); + MethodHandle gcombiner = convertArguments(token, combiner, ctype.generic(), ctype, null); + if (gtarget == null || gcombiner == null) return null; + MethodHandle gresult = FilterGeneric.makeArgumentFolder(gcombiner, gtarget); + MethodHandle result = convertArguments(token, gresult, newType, gresult.type(), null); + return result; + } + public static MethodHandle dropArguments(Access token, MethodHandle target, MethodType newType, int argnum) { Access.check(token); + int drops = newType.parameterCount() - target.type().parameterCount(); + MethodHandle res = AdapterMethodHandle.makeDropArguments(token, newType, target, argnum, drops); + if (res != null) + return res; throw new UnsupportedOperationException("NYI"); } + private static class GuardWithTest extends JavaMethodHandle { + private final MethodHandle test, target, fallback; + public GuardWithTest(MethodHandle test, MethodHandle target, MethodHandle fallback) { + this(INVOKES[target.type().parameterCount()], test, target, fallback); + } + public GuardWithTest(MethodHandle invoker, + MethodHandle test, MethodHandle target, MethodHandle fallback) { + super(invoker); + this.test = test; + this.target = target; + this.fallback = fallback; + } + @Override + public String toString() { + return target.toString(); + } + private Object invoke_V(Object... av) throws Throwable { + if (test.invoke(av)) + return target.invoke(av); + return fallback.invoke(av); + } + private Object invoke_L0() throws Throwable { + if (test.invoke()) + return target.invoke(); + return fallback.invoke(); + } + private Object invoke_L1(Object a0) throws Throwable { + if (test.invoke(a0)) + return target.invoke(a0); + return fallback.invoke(a0); + } + private Object invoke_L2(Object a0, Object a1) throws Throwable { + if (test.invoke(a0, a1)) + return target.invoke(a0, a1); + return fallback.invoke(a0, a1); + } + private Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable { + if (test.invoke(a0, a1, a2)) + return target.invoke(a0, a1, a2); + return fallback.invoke(a0, a1, a2); + } + private Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable { + if (test.invoke(a0, a1, a2, a3)) + return target.invoke(a0, a1, a2, a3); + return fallback.invoke(a0, a1, a2, a3); + } + private Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { + if (test.invoke(a0, a1, a2, a3, a4)) + return target.invoke(a0, a1, a2, a3, a4); + return fallback.invoke(a0, a1, a2, a3, a4); + } + private Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { + if (test.invoke(a0, a1, a2, a3, a4, a5)) + return target.invoke(a0, a1, a2, a3, a4, a5); + return fallback.invoke(a0, a1, a2, a3, a4, a5); + } + private Object invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { + if (test.invoke(a0, a1, a2, a3, a4, a5, a6)) + return target.invoke(a0, a1, a2, a3, a4, a5, a6); + return fallback.invoke(a0, a1, a2, a3, a4, a5, a6); + } + private Object invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { + if (test.invoke(a0, a1, a2, a3, a4, a5, a6, a7)) + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7); + return fallback.invoke(a0, a1, a2, a3, a4, a5, a6, a7); + } + static MethodHandle[] makeInvokes() { + ArrayList invokes = new ArrayList(); + MethodHandles.Lookup lookup = IMPL_LOOKUP; + for (;;) { + int nargs = invokes.size(); + String name = "invoke_L"+nargs; + MethodHandle invoke = null; + try { + invoke = lookup.findVirtual(GuardWithTest.class, name, MethodType.genericMethodType(nargs)); + } catch (NoAccessException ex) { + } + if (invoke == null) break; + invokes.add(invoke); + } + assert(invokes.size() == 9); // current number of methods + return invokes.toArray(new MethodHandle[0]); + }; + static final MethodHandle[] INVOKES = makeInvokes(); + // For testing use this: + //static final MethodHandle[] INVOKES = Arrays.copyOf(makeInvokes(), 2); + static final MethodHandle VARARGS_INVOKE; + static { + try { + VARARGS_INVOKE = IMPL_LOOKUP.findVirtual(GuardWithTest.class, "invoke_V", MethodType.genericMethodType(0, true)); + } catch (NoAccessException ex) { + throw new InternalError(""); + } + } + } + public static MethodHandle makeGuardWithTest(Access token, - final MethodHandle test, - final MethodHandle target, - final MethodHandle fallback) { + MethodHandle test, + MethodHandle target, + MethodHandle fallback) { Access.check(token); - // %%% This is just a sketch. It needs to be de-boxed. - // Adjust the handles to accept varargs lists. MethodType type = target.type(); - Class rtype = type.returnType(); - if (type.parameterCount() != 1 || type.parameterType(0).isPrimitive()) { - MethodType vatestType = MethodType.make(boolean.class, Object[].class); - MethodType vatargetType = MethodType.make(rtype, Object[].class); - MethodHandle vaguard = makeGuardWithTest(token, - MethodHandles.spreadArguments(test, vatestType), - MethodHandles.spreadArguments(target, vatargetType), - MethodHandles.spreadArguments(fallback, vatargetType)); - return MethodHandles.collectArguments(vaguard, type); + int nargs = type.parameterCount(); + if (nargs < GuardWithTest.INVOKES.length) { + MethodType gtype = type.generic(); + MethodHandle gtest = convertArguments(token, test, gtype.changeReturnType(boolean.class), test.type(), null); + MethodHandle gtarget = convertArguments(token, target, gtype, type, null); + MethodHandle gfallback = convertArguments(token, fallback, gtype, type, null); + if (gtest == null || gtarget == null || gfallback == null) return null; + MethodHandle gguard = new GuardWithTest(gtest, gtarget, gfallback); + return convertArguments(token, gguard, type, gtype, null); + } else { + MethodType gtype = MethodType.genericMethodType(0, true); + MethodHandle gtest = spreadArguments(token, test, gtype.changeReturnType(boolean.class), 0); + MethodHandle gtarget = spreadArguments(token, target, gtype, 0); + MethodHandle gfallback = spreadArguments(token, fallback, gtype, 0); + MethodHandle gguard = new GuardWithTest(GuardWithTest.VARARGS_INVOKE, gtest, gtarget, gfallback); + if (gtest == null || gtarget == null || gfallback == null) return null; + return collectArguments(token, gguard, type, 0, null); } - if (rtype.isPrimitive()) { - MethodType boxtype = type.changeReturnType(Object.class); - MethodHandle boxguard = makeGuardWithTest(token, - test, - MethodHandles.convertArguments(target, boxtype), - MethodHandles.convertArguments(fallback, boxtype)); - return MethodHandles.convertArguments(boxguard, type); + } + + private static class GuardWithCatch extends JavaMethodHandle { + private final MethodHandle target; + private final Class exType; + private final MethodHandle catcher; + public GuardWithCatch(MethodHandle target, Class exType, MethodHandle catcher) { + this(INVOKES[target.type().parameterCount()], target, exType, catcher); } - // Got here? Reduced calling sequence to Object(Object). - class Guarder { - Object invoke(Object x) { - // If javac supports MethodHandle.invoke directly: - //z = vatest.invoke(arguments); - // If javac does not support direct MH.invoke calls: - boolean z = (Boolean) MethodHandles.invoke_1(test, x); - MethodHandle mh = (z ? target : fallback); - return MethodHandles.invoke_1(mh, x); - } - MethodHandle handle() { - MethodType invokeType = MethodType.makeGeneric(0, true); - MethodHandle vh = IMPL_LOOKUP.bind(this, "invoke", invokeType); - return MethodHandles.collectArguments(vh, target.type()); + public GuardWithCatch(MethodHandle invoker, + MethodHandle target, Class exType, MethodHandle catcher) { + super(invoker); + this.target = target; + this.exType = exType; + this.catcher = catcher; + } + @Override + public String toString() { + return target.toString(); + } + private Object invoke_V(Object... av) throws Throwable { + try { + return target.invoke(av); + } catch (Throwable t) { + if (!exType.isInstance(t)) throw t; + return catcher.invoke(t, av); } } - return new Guarder().handle(); + private Object invoke_L0() throws Throwable { + try { + return target.invoke(); + } catch (Throwable t) { + if (!exType.isInstance(t)) throw t; + return catcher.invoke(t); + } + } + private Object invoke_L1(Object a0) throws Throwable { + try { + return target.invoke(a0); + } catch (Throwable t) { + if (!exType.isInstance(t)) throw t; + return catcher.invoke(t, a0); + } + } + private Object invoke_L2(Object a0, Object a1) throws Throwable { + try { + return target.invoke(a0, a1); + } catch (Throwable t) { + if (!exType.isInstance(t)) throw t; + return catcher.invoke(t, a0, a1); + } + } + private Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable { + try { + return target.invoke(a0, a1, a2); + } catch (Throwable t) { + if (!exType.isInstance(t)) throw t; + return catcher.invoke(t, a0, a1, a2); + } + } + private Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable { + try { + return target.invoke(a0, a1, a2, a3); + } catch (Throwable t) { + if (!exType.isInstance(t)) throw t; + return catcher.invoke(t, a0, a1, a2, a3); + } + } + private Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { + try { + return target.invoke(a0, a1, a2, a3, a4); + } catch (Throwable t) { + if (!exType.isInstance(t)) throw t; + return catcher.invoke(t, a0, a1, a2, a3, a4); + } + } + private Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { + try { + return target.invoke(a0, a1, a2, a3, a4, a5); + } catch (Throwable t) { + if (!exType.isInstance(t)) throw t; + return catcher.invoke(t, a0, a1, a2, a3, a4, a5); + } + } + private Object invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { + try { + return target.invoke(a0, a1, a2, a3, a4, a5, a6); + } catch (Throwable t) { + if (!exType.isInstance(t)) throw t; + return catcher.invoke(t, a0, a1, a2, a3, a4, a5, a6); + } + } + private Object invoke_L8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { + try { + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7); + } catch (Throwable t) { + if (!exType.isInstance(t)) throw t; + return catcher.invoke(t, a0, a1, a2, a3, a4, a5, a6, a7); + } + } + static MethodHandle[] makeInvokes() { + ArrayList invokes = new ArrayList(); + MethodHandles.Lookup lookup = IMPL_LOOKUP; + for (;;) { + int nargs = invokes.size(); + String name = "invoke_L"+nargs; + MethodHandle invoke = null; + try { + invoke = lookup.findVirtual(GuardWithCatch.class, name, MethodType.genericMethodType(nargs)); + } catch (NoAccessException ex) { + } + if (invoke == null) break; + invokes.add(invoke); + } + assert(invokes.size() == 9); // current number of methods + return invokes.toArray(new MethodHandle[0]); + }; + static final MethodHandle[] INVOKES = makeInvokes(); + // For testing use this: + //static final MethodHandle[] INVOKES = Arrays.copyOf(makeInvokes(), 2); + static final MethodHandle VARARGS_INVOKE; + static { + try { + VARARGS_INVOKE = IMPL_LOOKUP.findVirtual(GuardWithCatch.class, "invoke_V", MethodType.genericMethodType(0, true)); + } catch (NoAccessException ex) { + throw new InternalError(""); + } + } + } + + + public static + MethodHandle makeGuardWithCatch(Access token, + MethodHandle target, + Class exType, + MethodHandle catcher) { + Access.check(token); + MethodType type = target.type(); + MethodType ctype = catcher.type(); + int nargs = type.parameterCount(); + if (nargs < GuardWithCatch.INVOKES.length) { + MethodType gtype = type.generic(); + MethodType gcatchType = gtype.insertParameterTypes(0, Throwable.class); + MethodHandle gtarget = convertArguments(token, target, gtype, type, null); + MethodHandle gcatcher = convertArguments(token, catcher, gcatchType, ctype, null); + MethodHandle gguard = new GuardWithCatch(gtarget, exType, gcatcher); + if (gtarget == null || gcatcher == null || gguard == null) return null; + return convertArguments(token, gguard, type, gtype, null); + } else { + MethodType gtype = MethodType.genericMethodType(0, true); + MethodType gcatchType = gtype.insertParameterTypes(0, Throwable.class); + MethodHandle gtarget = spreadArguments(token, target, gtype, 0); + MethodHandle gcatcher = spreadArguments(token, catcher, gcatchType, 1); + MethodHandle gguard = new GuardWithCatch(GuardWithCatch.VARARGS_INVOKE, gtarget, exType, gcatcher); + if (gtarget == null || gcatcher == null || gguard == null) return null; + return collectArguments(token, gguard, type, 0, null); + } } public static - MethodHandle combineArguments(Access token, MethodHandle target, MethodHandle checker, int pos) { + MethodHandle throwException(Access token, MethodType type) { Access.check(token); - throw new UnsupportedOperationException("Not yet implemented"); + return AdapterMethodHandle.makeRetypeRaw(token, type, THROW_EXCEPTION); } - protected static String basicToString(MethodHandle target) { + static final MethodHandle THROW_EXCEPTION + = IMPL_LOOKUP.findStatic(MethodHandleImpl.class, "throwException", + MethodType.methodType(Empty.class, Throwable.class)); + static Empty throwException(T t) throws T { throw t; } + + public static String getNameString(Access token, MethodHandle target) { + Access.check(token); MemberName name = null; if (target != null) name = MethodHandleNatives.getMethodName(target); @@ -357,17 +1080,30 @@ public abstract class MethodHandleImpl { return name.getName(); } - protected static String addTypeString(MethodHandle target, String name) { - if (target == null) return name; - return name+target.type(); - } - static RuntimeException newIllegalArgumentException(String string) { - return new IllegalArgumentException(string); + public static String addTypeString(MethodHandle target) { + if (target == null) return "null"; + return target.toString() + target.type(); } - @Override - public String toString() { - MethodHandle self = (MethodHandle) this; - return addTypeString(self, basicToString(self)); + public static void checkSpreadArgument(Object av, int n) { + if (av == null ? n != 0 : ((Object[])av).length != n) + throw newIllegalArgumentException("Array is not of length "+n); + } + + public static void raiseException(int code, Object actual, Object required) { + String message; + // disregard the identity of the actual object, if it is not a class: + if (!(actual instanceof Class) && !(actual instanceof MethodType)) + actual = actual.getClass(); + if (actual != null) + message = "required "+required+" but encountered "+actual; + else + message = "required "+required; + switch (code) { + case 192: // checkcast + throw new ClassCastException(message); + default: + throw new InternalError("unexpected code "+code+": "+message); + } } } diff --git a/jdk/src/share/classes/sun/dyn/MethodHandleNatives.java b/jdk/src/share/classes/sun/dyn/MethodHandleNatives.java index fc2d82aa8ff..0ede3c2f706 100644 --- a/jdk/src/share/classes/sun/dyn/MethodHandleNatives.java +++ b/jdk/src/share/classes/sun/dyn/MethodHandleNatives.java @@ -25,6 +25,7 @@ package sun.dyn; +import java.dyn.CallSite; import java.dyn.MethodHandle; import java.dyn.MethodType; import java.lang.reflect.AccessibleObject; @@ -60,7 +61,7 @@ class MethodHandleNatives { static native void init(MethodType self); /** Tell the JVM that we need to change the target of an invokedynamic. */ - static native void linkCallSite(CallSiteImpl site, MethodHandle target); + static native void linkCallSite(CallSite site, MethodHandle target); /** Fetch the vmtarget field. * It will be sanitized as necessary to avoid exposing non-Java references. @@ -84,8 +85,7 @@ class MethodHandleNatives { } /** Fetch the target of this method handle. - * If it directly targets a method, return a tuple of method info. - * The info is of the form new Object[]{defclass, name, sig, refclass}. + * If it directly targets a method, return a MemberName for the method. * If it is chained to another method handle, return that handle. */ static Object getTargetInfo(MethodHandle self) { @@ -123,7 +123,7 @@ class MethodHandleNatives { registerNatives(); JVM_SUPPORT_ = true; JVM_PUSH_LIMIT_ = getConstant(Constants.GC_JVM_PUSH_LIMIT); - JVM_STACK_MOVE_UNIT_ = getConstant(Constants.GC_JVM_STACK_MOVE_LIMIT); + JVM_STACK_MOVE_UNIT_ = getConstant(Constants.GC_JVM_STACK_MOVE_UNIT); //sun.reflect.Reflection.registerMethodsToFilter(MethodHandleImpl.class, "init"); } catch (UnsatisfiedLinkError ee) { // ignore; if we use init() methods later we'll see linkage errors @@ -149,7 +149,7 @@ class MethodHandleNatives { // MethodHandleImpl static final int // for getConstant GC_JVM_PUSH_LIMIT = 0, - GC_JVM_STACK_MOVE_LIMIT = 1; + GC_JVM_STACK_MOVE_UNIT = 1; static final int ETF_HANDLE_OR_METHOD_NAME = 0, // all available data (immediate MH or method) ETF_DIRECT_HANDLE = 1, // ultimate method handle (will be a DMH, may be self) @@ -178,19 +178,20 @@ class MethodHandleNatives { */ static final int OP_RETYPE_ONLY = 0x0, // no argument changes; straight retype - OP_CHECK_CAST = 0x1, // ref-to-ref conversion; requires a Class argument - OP_PRIM_TO_PRIM = 0x2, // converts from one primitive to another - OP_REF_TO_PRIM = 0x3, // unboxes a wrapper to produce a primitive - OP_PRIM_TO_REF = 0x4, // boxes a primitive into a wrapper (NYI) - OP_SWAP_ARGS = 0x5, // swap arguments (vminfo is 2nd arg) - OP_ROT_ARGS = 0x6, // rotate arguments (vminfo is displaced arg) - OP_DUP_ARGS = 0x7, // duplicates one or more arguments (at TOS) - OP_DROP_ARGS = 0x8, // remove one or more argument slots - OP_COLLECT_ARGS = 0x9, // combine one or more arguments into a varargs (NYI) - OP_SPREAD_ARGS = 0xA, // expand in place a varargs array (of known size) - OP_FLYBY = 0xB, // operate first on reified argument list (NYI) - OP_RICOCHET = 0xC, // run an adapter chain on the return value (NYI) - CONV_OP_LIMIT = 0xD; // limit of CONV_OP enumeration + OP_RETYPE_RAW = 0x1, // no argument changes; straight retype + OP_CHECK_CAST = 0x2, // ref-to-ref conversion; requires a Class argument + OP_PRIM_TO_PRIM = 0x3, // converts from one primitive to another + OP_REF_TO_PRIM = 0x4, // unboxes a wrapper to produce a primitive + OP_PRIM_TO_REF = 0x5, // boxes a primitive into a wrapper (NYI) + OP_SWAP_ARGS = 0x6, // swap arguments (vminfo is 2nd arg) + OP_ROT_ARGS = 0x7, // rotate arguments (vminfo is displaced arg) + OP_DUP_ARGS = 0x8, // duplicates one or more arguments (at TOS) + OP_DROP_ARGS = 0x9, // remove one or more argument slots + OP_COLLECT_ARGS = 0xA, // combine one or more arguments into a varargs (NYI) + OP_SPREAD_ARGS = 0xB, // expand in place a varargs array (of known size) + OP_FLYBY = 0xC, // operate first on reified argument list (NYI) + OP_RICOCHET = 0xD, // run an adapter chain on the return value (NYI) + CONV_OP_LIMIT = 0xE; // limit of CONV_OP enumeration /** Shift and mask values for decoding the AMH.conversion field. * These numbers are shared with the JVM for creating AMHs. */ @@ -209,6 +210,7 @@ class MethodHandleNatives { // TODO: The following expression should be replaced by // a JVM query. ((1<[] ptypes(MethodType mt); @@ -150,7 +151,7 @@ public class MethodTypeImpl { this.argToSlotTable = argToSlotTab; this.slotToArgTable = slotToArgTab; - if (pslotCount >= 256) throw new IllegalArgumentException("too many arguments"); + if (pslotCount >= 256) throw newIllegalArgumentException("too many arguments"); // send a few bits down to the JVM: this.vmslots = parameterSlotCount(); @@ -378,10 +379,10 @@ public class MethodTypeImpl { static MethodTypeImpl findForm(MethodType mt) { MethodType erased = canonicalize(mt, ERASE, ERASE); if (erased == null) { - // It is already erased. Make a new MethodTypeForm. + // It is already erased. Make a new MethodTypeImpl. return METHOD_TYPE_FRIEND.newMethodTypeForm(mt); } else { - // Share the MethodTypeForm with the erased version. + // Share the MethodTypeImpl with the erased version. return METHOD_TYPE_FRIEND.form(erased); } } diff --git a/jdk/src/share/classes/sun/dyn/SpreadGeneric.java b/jdk/src/share/classes/sun/dyn/SpreadGeneric.java new file mode 100644 index 00000000000..264479e2336 --- /dev/null +++ b/jdk/src/share/classes/sun/dyn/SpreadGeneric.java @@ -0,0 +1,682 @@ +/* + * Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package sun.dyn; + +import java.dyn.JavaMethodHandle; +import java.dyn.MethodHandle; +import java.dyn.MethodHandles; +import java.dyn.MethodType; +import java.dyn.NoAccessException; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import sun.dyn.util.ValueConversions; +import static sun.dyn.MemberName.newIllegalArgumentException; + +/** + * Generic spread adapter. + * Expands a final argument into multiple (zero or more) arguments, keeping the others the same. + * @author jrose + */ +class SpreadGeneric { + // type for the outgoing call + private final MethodType targetType; + // number of arguments to spread + private final int spreadCount; + // prototype adapter (clone and customize for each new target!) + private final Adapter adapter; + // entry point for adapter (Adapter mh, a...) => ... + private final MethodHandle entryPoint; + + /** Compute and cache information common to all spreading adapters + * that accept calls of the given (generic) type. + */ + private SpreadGeneric(MethodType targetType, int spreadCount) { + assert(targetType == targetType.generic()); + this.targetType = targetType; + this.spreadCount = spreadCount; + // the target invoker will generally need casts on reference arguments + MethodHandle[] ep = { null }; + Adapter ad = findAdapter(this, ep); + if (ad != null) { + this.adapter = ad; + this.entryPoint = ep[0]; + return; + } + this.adapter = buildAdapterFromBytecodes(targetType, spreadCount, ep); + this.entryPoint = ep[0]; + } + + /** From targetType remove the last spreadCount arguments, and instead + * append a simple Object argument. + */ + static MethodType preSpreadType(MethodType targetType, int spreadCount) { + @SuppressWarnings("unchecked") + ArrayList> params = new ArrayList(targetType.parameterList()); + int outargs = params.size(); + params.subList(outargs - spreadCount, outargs).clear(); + params.add(Object.class); + return MethodType.methodType(targetType.returnType(), params); + } + + MethodHandle makeInstance(MethodHandle target) { + MethodType type = target.type(); + if (type != targetType) { + throw new UnsupportedOperationException("NYI type="+type); + } + return adapter.makeInstance(this, target); + } + + /** Build an adapter of the given generic type, which invokes typedTarget + * on the incoming arguments, after unboxing as necessary. + * The return value is boxed if necessary. + * @param genericType the required type of the result + * @param typedTarget the target + * @return an adapter method handle + */ + public static MethodHandle make(MethodHandle target, int spreadCount) { + MethodType type = target.type(); + MethodType gtype = type.generic(); + if (type == gtype) { + return SpreadGeneric.of(type, spreadCount).makeInstance(target); + } else { + MethodHandle gtarget = FromGeneric.make(target); + assert(gtarget.type() == gtype); + MethodHandle gspread = SpreadGeneric.of(gtype, spreadCount).makeInstance(gtarget); + return ToGeneric.make(preSpreadType(type, spreadCount), gspread); + } + } + + /** Return the adapter information for this type's erasure. */ + static SpreadGeneric of(MethodType targetType, int spreadCount) { + if (targetType != targetType.generic()) + throw new UnsupportedOperationException("NYI type="+targetType); + MethodTypeImpl form = MethodTypeImpl.of(targetType); + int outcount = form.parameterCount(); + assert(spreadCount <= outcount); + SpreadGeneric[] spreadGens = form.spreadGeneric; + if (spreadGens == null) + form.spreadGeneric = spreadGens = new SpreadGeneric[outcount+1]; + SpreadGeneric spreadGen = spreadGens[spreadCount]; + if (spreadGen == null) + spreadGens[spreadCount] = spreadGen = new SpreadGeneric(form.erasedType(), spreadCount); + return spreadGen; + } + + public String toString() { + return getClass().getSimpleName()+targetType+"["+spreadCount+"]"; + } + + // This mini-api is called from an Adapter to manage the spread. + /** A check/coercion that happens once before any selections. */ + protected Object check(Object av, int n) { + MethodHandleImpl.checkSpreadArgument(av, n); + return av; + } + + /** The selection operator for spreading; note that it takes Object not Object[]. */ + protected Object select(Object av, int n) { + return ((Object[])av)[n]; + } + /* + protected int select_I(Object av, int n) { + // maybe return ((int[])select)[n] + throw new UnsupportedOperationException("subclass resp."); + } + protected int select_J(Object av, int n) { + // maybe return ((long[])select)[n] + throw new UnsupportedOperationException("subclass resp."); + } + // */ + + /* Create an adapter that handles spreading calls for the given type. */ + static Adapter findAdapter(SpreadGeneric outer, MethodHandle[] ep) { + MethodType targetType = outer.targetType; + int spreadCount = outer.spreadCount; + int outargs = targetType.parameterCount(); + int inargs = outargs - spreadCount; + if (inargs < 0) return null; + MethodType entryType = MethodType.genericMethodType(inargs + 1); // 1 for av + String cname1 = "S" + outargs; + String[] cnames = { cname1 }; + String iname = "invoke_S"+spreadCount; + // e.g., D5I2, D5, L5I2, L5; invoke_D5 + for (String cname : cnames) { + Class acls = Adapter.findSubClass(cname); + if (acls == null) continue; + // see if it has the required invoke method + MethodHandle entryPoint = null; + try { + entryPoint = MethodHandleImpl.IMPL_LOOKUP.findSpecial(acls, iname, entryType, acls); + } catch (NoAccessException ex) { + } + if (entryPoint == null) continue; + Constructor ctor = null; + try { + ctor = acls.getDeclaredConstructor(SpreadGeneric.class); + } catch (NoSuchMethodException ex) { + } catch (SecurityException ex) { + } + if (ctor == null) continue; + try { + // Produce an instance configured as a prototype. + Adapter ad = ctor.newInstance(outer); + ep[0] = entryPoint; + return ad; + } catch (IllegalArgumentException ex) { + } catch (InvocationTargetException wex) { + Throwable ex = wex.getTargetException(); + if (ex instanceof Error) throw (Error)ex; + if (ex instanceof RuntimeException) throw (RuntimeException)ex; + } catch (InstantiationException ex) { + } catch (IllegalAccessException ex) { + } + } + return null; + } + + static Adapter buildAdapterFromBytecodes(MethodType targetType, + int spreadCount, MethodHandle[] ep) { + throw new UnsupportedOperationException("NYI"); + } + + /** + * This adapter takes some untyped arguments, and returns an untyped result. + * Internally, it applies the invoker to the target, which causes the + * objects to be unboxed; the result is a raw type in L/I/J/F/D. + * This result is passed to convert, which is responsible for + * converting the raw result into a boxed object. + * The invoker is kept separate from the target because it can be + * generated once per type erasure family, and reused across adapters. + */ + static abstract class Adapter extends JavaMethodHandle { + /* + * class X<> extends Adapter { + * (Object**N)=>R target; + * static int S = N-M; + * Object invoke(Object**M a, Object v) = target(a..., v[0]...v[S-1]); + * } + */ + protected final SpreadGeneric outer; + protected final MethodHandle target; // (any**N) => R + + @Override + public String toString() { + return target.toString(); + } + + static final MethodHandle NO_ENTRY = ValueConversions.identity(); + + protected boolean isPrototype() { return target == null; } + protected Adapter(SpreadGeneric outer) { + super(NO_ENTRY); + this.outer = outer; + this.target = null; + assert(isPrototype()); + } + + protected Adapter(SpreadGeneric outer, MethodHandle target) { + super(outer.entryPoint); + this.outer = outer; + this.target = target; + } + + /** Make a copy of self, with new fields. */ + protected abstract Adapter makeInstance(SpreadGeneric outer, MethodHandle target); + // { return new ThisType(outer, target); } + + protected Object check(Object av, int n) { + return outer.check(av, n); + } + protected Object select(Object av, int n) { + return outer.select(av, n); + } + + static private final String CLASS_PREFIX; // "sun.dyn.SpreadGeneric$" + static { + String aname = Adapter.class.getName(); + String sname = Adapter.class.getSimpleName(); + if (!aname.endsWith(sname)) throw new InternalError(); + CLASS_PREFIX = aname.substring(0, aname.length() - sname.length()); + } + /** Find a sibing class of Adapter. */ + static Class findSubClass(String name) { + String cname = Adapter.CLASS_PREFIX + name; + try { + return Class.forName(cname).asSubclass(Adapter.class); + } catch (ClassNotFoundException ex) { + return null; + } catch (ClassCastException ex) { + return null; + } + } + } + + /* generated classes follow this pattern: + static class xS2 extends Adapter { + protected xS2(SpreadGeneric outer) { super(outer); } // to build prototype + protected xS2(SpreadGeneric outer, MethodHandle t) { super(outer, t); } + protected xS2 makeInstance(SpreadGeneric outer, MethodHandle t) { return new xS2(outer, t); } + protected Object invoke_S0(Object a0, Object a1, Object av) throws Throwable { av = super.check(av,0); + return target.invoke(a0, a1)); } + protected Object invoke_S1(Object a0, Object av) throws Throwable { av = super.check(av,1); + return target.invoke(a0, + super.select(av,0)); } + protected Object invoke_S2(Object a0, Object av) throws Throwable { av = super.check(av,1); + return target.invoke( + super.select(av,0), super.select(av,1)); } + } + // */ + +/* +: 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~ +//{{{ +import java.util.*; +class genclasses { + static String[][] TEMPLATES = { { + "@for@ N=0..10", + " //@each-cat@", + " static class @cat@ extends Adapter {", + " protected @cat@(SpreadGeneric outer) { super(outer); } // to build prototype", + " protected @cat@(SpreadGeneric outer, MethodHandle t) { super(outer, t); }", + " protected @cat@ makeInstance(SpreadGeneric outer, MethodHandle t) { return new @cat@(outer, t); }", + " protected Object invoke_S0(@Tvav,@Object av) throws Throwable { av = super.check(av, 0);", + " return target.invoke(@av@); }", + " //@each-S@", + " protected Object invoke_S@S@(@Tvav,@Object av) throws Throwable { av = super.check(av, @S@);", + " return target.invoke(@av,@@sv@); }", + " //@end-S@", + " }", + } }; + static final String NEWLINE_INDENT = "\n "; + enum VAR { + cat, N, S, av, av_, Tvav_, sv; + public final String pattern = "@"+toString().replace('_','.')+"@"; + public String binding = toString(); + static void makeBindings(boolean topLevel, int outargs, int spread) { + int inargs = outargs - spread; + VAR.cat.binding = "S"+outargs; + VAR.N.binding = String.valueOf(outargs); // outgoing arg count + VAR.S.binding = String.valueOf(spread); // spread count + String[] av = new String[inargs]; + String[] Tvav = new String[inargs]; + for (int i = 0; i < inargs; i++) { + av[i] = arg(i); + Tvav[i] = param("Object", av[i]); + } + VAR.av.binding = comma(av); + VAR.av_.binding = comma(av, ", "); + VAR.Tvav_.binding = comma(Tvav, ", "); + String[] sv = new String[spread]; + for (int i = 0; i < spread; i++) { + String spc = ""; + if (i % 4 == 0) spc = NEWLINE_INDENT; + sv[i] = spc+"super.select(av,"+i+")"; + } + VAR.sv.binding = comma(sv); + } + static String arg(int i) { return "a"+i; } + static String param(String t, String a) { return t+" "+a; } + static String comma(String[] v) { return comma(v, ""); } + static String comma(String[] v, String sep) { + if (v.length == 0) return ""; + String res = v[0]; + for (int i = 1; i < v.length; i++) res += ", "+v[i]; + return res + sep; + } + static String transform(String string) { + for (VAR var : values()) + string = string.replaceAll(var.pattern, var.binding); + return string; + } + } + static String[] stringsIn(String[] strings, int beg, int end) { + return Arrays.copyOfRange(strings, beg, Math.min(end, strings.length)); + } + static String[] stringsBefore(String[] strings, int pos) { + return stringsIn(strings, 0, pos); + } + static String[] stringsAfter(String[] strings, int pos) { + return stringsIn(strings, pos, strings.length); + } + static int indexAfter(String[] strings, int pos, String tag) { + return Math.min(indexBefore(strings, pos, tag) + 1, strings.length); + } + static int indexBefore(String[] strings, int pos, String tag) { + for (int i = pos, end = strings.length; ; i++) { + if (i == end || strings[i].endsWith(tag)) return i; + } + } + static int MIN_ARITY, MAX_ARITY; + public static void main(String... av) { + for (String[] template : TEMPLATES) { + int forLinesLimit = indexBefore(template, 0, "@each-cat@"); + String[] forLines = stringsBefore(template, forLinesLimit); + template = stringsAfter(template, forLinesLimit); + for (String forLine : forLines) + expandTemplate(forLine, template); + } + } + static void expandTemplate(String forLine, String[] template) { + String[] params = forLine.split("[^0-9]+"); + if (params[0].length() == 0) params = stringsAfter(params, 1); + System.out.println("//params="+Arrays.asList(params)); + int pcur = 0; + MIN_ARITY = Integer.valueOf(params[pcur++]); + MAX_ARITY = Integer.valueOf(params[pcur++]); + if (pcur != params.length) throw new RuntimeException("bad extra param: "+forLine); + for (int outargs = MIN_ARITY; outargs <= MAX_ARITY; outargs++) { + expandTemplate(template, true, outargs, 0); + } + } + static void expandTemplate(String[] template, boolean topLevel, int outargs, int spread) { + VAR.makeBindings(topLevel, outargs, spread); + for (int i = 0; i < template.length; i++) { + String line = template[i]; + if (line.endsWith("@each-cat@")) { + // ignore + } else if (line.endsWith("@each-S@")) { + int blockEnd = indexAfter(template, i, "@end-S@"); + String[] block = stringsIn(template, i+1, blockEnd-1); + for (int spread1 = spread+1; spread1 <= outargs; spread1++) + expandTemplate(block, false, outargs, spread1); + VAR.makeBindings(topLevel, outargs, spread); + i = blockEnd-1; continue; + } else { + System.out.println(VAR.transform(line)); + } + } + } +} +//}}} */ +//params=[0, 10] + static class S0 extends Adapter { + protected S0(SpreadGeneric outer) { super(outer); } // to build prototype + protected S0(SpreadGeneric outer, MethodHandle t) { super(outer, t); } + protected S0 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S0(outer, t); } + protected Object invoke_S0(Object av) throws Throwable { av = super.check(av, 0); + return target.invoke(); } + } + static class S1 extends Adapter { + protected S1(SpreadGeneric outer) { super(outer); } // to build prototype + protected S1(SpreadGeneric outer, MethodHandle t) { super(outer, t); } + protected S1 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S1(outer, t); } + protected Object invoke_S0(Object a0, Object av) throws Throwable { av = super.check(av, 0); + return target.invoke(a0); } + protected Object invoke_S1(Object av) throws Throwable { av = super.check(av, 1); + return target.invoke( + super.select(av,0)); } + } + static class S2 extends Adapter { + protected S2(SpreadGeneric outer) { super(outer); } // to build prototype + protected S2(SpreadGeneric outer, MethodHandle t) { super(outer, t); } + protected S2 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S2(outer, t); } + protected Object invoke_S0(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 0); + return target.invoke(a0, a1); } + protected Object invoke_S1(Object a0, Object av) throws Throwable { av = super.check(av, 1); + return target.invoke(a0, + super.select(av,0)); } + protected Object invoke_S2(Object av) throws Throwable { av = super.check(av, 2); + return target.invoke( + super.select(av,0), super.select(av,1)); } + } + static class S3 extends Adapter { + protected S3(SpreadGeneric outer) { super(outer); } // to build prototype + protected S3(SpreadGeneric outer, MethodHandle t) { super(outer, t); } + protected S3 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S3(outer, t); } + protected Object invoke_S0(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 0); + return target.invoke(a0, a1, a2); } + protected Object invoke_S1(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 1); + return target.invoke(a0, a1, + super.select(av,0)); } + protected Object invoke_S2(Object a0, Object av) throws Throwable { av = super.check(av, 2); + return target.invoke(a0, + super.select(av,0), super.select(av,1)); } + protected Object invoke_S3(Object av) throws Throwable { av = super.check(av, 3); + return target.invoke( + super.select(av,0), super.select(av,1), super.select(av,2)); } + } + static class S4 extends Adapter { + protected S4(SpreadGeneric outer) { super(outer); } // to build prototype + protected S4(SpreadGeneric outer, MethodHandle t) { super(outer, t); } + protected S4 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S4(outer, t); } + protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 0); + return target.invoke(a0, a1, a2, a3); } + protected Object invoke_S1(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 1); + return target.invoke(a0, a1, a2, + super.select(av,0)); } + protected Object invoke_S2(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 2); + return target.invoke(a0, a1, + super.select(av,0), super.select(av,1)); } + protected Object invoke_S3(Object a0, Object av) throws Throwable { av = super.check(av, 3); + return target.invoke(a0, + super.select(av,0), super.select(av,1), super.select(av,2)); } + protected Object invoke_S4(Object av) throws Throwable { av = super.check(av, 4); + return target.invoke( + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); } + } + static class S5 extends Adapter { + protected S5(SpreadGeneric outer) { super(outer); } // to build prototype + protected S5(SpreadGeneric outer, MethodHandle t) { super(outer, t); } + protected S5 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S5(outer, t); } + protected Object invoke_S0(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 0); + return target.invoke(a0, a1, a2, a3, a4); } + protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 1); + return target.invoke(a0, a1, a2, a3, + super.select(av,0)); } + protected Object invoke_S2(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 2); + return target.invoke(a0, a1, a2, + super.select(av,0), super.select(av,1)); } + protected Object invoke_S3(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 3); + return target.invoke(a0, a1, + super.select(av,0), super.select(av,1), super.select(av,2)); } + protected Object invoke_S4(Object a0, Object av) throws Throwable { av = super.check(av, 4); + return target.invoke(a0, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); } + protected Object invoke_S5(Object av) throws Throwable { av = super.check(av, 5); + return target.invoke( + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4)); } + } + static class S6 extends Adapter { + protected S6(SpreadGeneric outer) { super(outer); } // to build prototype + protected S6(SpreadGeneric outer, MethodHandle t) { super(outer, t); } + protected S6 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S6(outer, t); } + 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); + return target.invoke(a0, a1, a2, a3, a4, a5); } + protected Object invoke_S1(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 1); + return target.invoke(a0, a1, a2, a3, a4, + super.select(av,0)); } + protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 2); + return target.invoke(a0, a1, a2, a3, + super.select(av,0), super.select(av,1)); } + protected Object invoke_S3(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 3); + return target.invoke(a0, a1, a2, + super.select(av,0), super.select(av,1), super.select(av,2)); } + protected Object invoke_S4(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 4); + return target.invoke(a0, a1, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); } + protected Object invoke_S5(Object a0, Object av) throws Throwable { av = super.check(av, 5); + return target.invoke(a0, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4)); } + protected Object invoke_S6(Object av) throws Throwable { av = super.check(av, 6); + return target.invoke( + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4), super.select(av,5)); } + } + static class S7 extends Adapter { + protected S7(SpreadGeneric outer) { super(outer); } // to build prototype + protected S7(SpreadGeneric outer, MethodHandle t) { super(outer, t); } + protected S7 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S7(outer, t); } + 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); + return target.invoke(a0, a1, a2, a3, a4, a5, a6); } + 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); + return target.invoke(a0, a1, a2, a3, a4, a5, + super.select(av,0)); } + protected Object invoke_S2(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 2); + return target.invoke(a0, a1, a2, a3, a4, + super.select(av,0), super.select(av,1)); } + protected Object invoke_S3(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 3); + return target.invoke(a0, a1, a2, a3, + super.select(av,0), super.select(av,1), super.select(av,2)); } + protected Object invoke_S4(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 4); + return target.invoke(a0, a1, a2, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); } + protected Object invoke_S5(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 5); + return target.invoke(a0, a1, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4)); } + protected Object invoke_S6(Object a0, Object av) throws Throwable { av = super.check(av, 6); + return target.invoke(a0, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4), super.select(av,5)); } + protected Object invoke_S7(Object av) throws Throwable { av = super.check(av, 7); + return target.invoke( + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4), super.select(av,5), super.select(av,6)); } + } + static class S8 extends Adapter { + protected S8(SpreadGeneric outer) { super(outer); } // to build prototype + protected S8(SpreadGeneric outer, MethodHandle t) { super(outer, t); } + protected S8 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S8(outer, t); } + 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); + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7); } + 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); + return target.invoke(a0, a1, a2, a3, a4, a5, a6, + super.select(av,0)); } + 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); + return target.invoke(a0, a1, a2, a3, a4, a5, + super.select(av,0), super.select(av,1)); } + protected Object invoke_S3(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 3); + return target.invoke(a0, a1, a2, a3, a4, + super.select(av,0), super.select(av,1), super.select(av,2)); } + protected Object invoke_S4(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 4); + return target.invoke(a0, a1, a2, a3, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); } + protected Object invoke_S5(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 5); + return target.invoke(a0, a1, a2, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4)); } + protected Object invoke_S6(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 6); + return target.invoke(a0, a1, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4), super.select(av,5)); } + protected Object invoke_S7(Object a0, Object av) throws Throwable { av = super.check(av, 7); + return target.invoke(a0, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4), super.select(av,5), super.select(av,6)); } + protected Object invoke_S8(Object av) throws Throwable { av = super.check(av, 8); + return target.invoke( + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7)); } + } + static class S9 extends Adapter { + protected S9(SpreadGeneric outer) { super(outer); } // to build prototype + protected S9(SpreadGeneric outer, MethodHandle t) { super(outer, t); } + protected S9 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S9(outer, t); } + 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); + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8); } + 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); + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, + super.select(av,0)); } + 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); + return target.invoke(a0, a1, a2, a3, a4, a5, a6, + super.select(av,0), super.select(av,1)); } + 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); + return target.invoke(a0, a1, a2, a3, a4, a5, + super.select(av,0), super.select(av,1), super.select(av,2)); } + protected Object invoke_S4(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 4); + return target.invoke(a0, a1, a2, a3, a4, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); } + protected Object invoke_S5(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 5); + return target.invoke(a0, a1, a2, a3, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4)); } + protected Object invoke_S6(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 6); + return target.invoke(a0, a1, a2, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4), super.select(av,5)); } + protected Object invoke_S7(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 7); + return target.invoke(a0, a1, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4), super.select(av,5), super.select(av,6)); } + protected Object invoke_S8(Object a0, Object av) throws Throwable { av = super.check(av, 8); + return target.invoke(a0, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7)); } + protected Object invoke_S9(Object av) throws Throwable { av = super.check(av, 9); + return target.invoke( + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7), + super.select(av,8)); } + } + static class S10 extends Adapter { + protected S10(SpreadGeneric outer) { super(outer); } // to build prototype + protected S10(SpreadGeneric outer, MethodHandle t) { super(outer, t); } + protected S10 makeInstance(SpreadGeneric outer, MethodHandle t) { return new S10(outer, t); } + 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); + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } + 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); + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, + super.select(av,0)); } + 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); + return target.invoke(a0, a1, a2, a3, a4, a5, a6, a7, + super.select(av,0), super.select(av,1)); } + 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); + return target.invoke(a0, a1, a2, a3, a4, a5, a6, + super.select(av,0), super.select(av,1), super.select(av,2)); } + 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); + return target.invoke(a0, a1, a2, a3, a4, a5, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); } + protected Object invoke_S5(Object a0, Object a1, Object a2, Object a3, Object a4, Object av) throws Throwable { av = super.check(av, 5); + return target.invoke(a0, a1, a2, a3, a4, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4)); } + protected Object invoke_S6(Object a0, Object a1, Object a2, Object a3, Object av) throws Throwable { av = super.check(av, 6); + return target.invoke(a0, a1, a2, a3, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4), super.select(av,5)); } + protected Object invoke_S7(Object a0, Object a1, Object a2, Object av) throws Throwable { av = super.check(av, 7); + return target.invoke(a0, a1, a2, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4), super.select(av,5), super.select(av,6)); } + protected Object invoke_S8(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 8); + return target.invoke(a0, a1, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7)); } + protected Object invoke_S9(Object a0, Object av) throws Throwable { av = super.check(av, 9); + return target.invoke(a0, + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7), + super.select(av,8)); } + protected Object invoke_S10(Object av) throws Throwable { av = super.check(av, 10); + return target.invoke( + super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3), + super.select(av,4), super.select(av,5), super.select(av,6), super.select(av,7), + super.select(av,8), super.select(av,9)); } + } +} diff --git a/jdk/src/share/classes/sun/dyn/ToGeneric.java b/jdk/src/share/classes/sun/dyn/ToGeneric.java index fd04d753e74..03c374b1c5c 100644 --- a/jdk/src/share/classes/sun/dyn/ToGeneric.java +++ b/jdk/src/share/classes/sun/dyn/ToGeneric.java @@ -34,6 +34,7 @@ import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import sun.dyn.util.ValueConversions; import sun.dyn.util.Wrapper; +import static sun.dyn.MemberName.newIllegalArgumentException; /** * Adapters which mediate between incoming calls which are not generic @@ -68,7 +69,7 @@ class ToGeneric { // conversion which unboxes a primitive return value private final MethodHandle returnConversion; - /** Compute and cache information common to all collecting adapters + /** Compute and cache information common to all generifying (boxing) adapters * that implement members of the erasure-family of the given erased type. */ private ToGeneric(MethodType entryType) { @@ -111,30 +112,48 @@ class ToGeneric { // primitive arguments according to their "raw" types int/long MethodType intsAtEnd = MethodTypeImpl.of(primsAtEnd).primsAsInts(); ad = findAdapter(rawEntryTypeInit = intsAtEnd); - if (ad == null) { + MethodHandle rawEntryPoint; + if (ad != null) { + rawEntryPoint = ad.prototypeEntryPoint(); + } else { // Perhaps the adapter is available only for longs. // If so, we can use it, but there will have to be a little // more stack motion on each call. MethodType longsAtEnd = MethodTypeImpl.of(primsAtEnd).primsAsLongs(); ad = findAdapter(rawEntryTypeInit = longsAtEnd); - if (ad == null) { + if (ad != null) { + MethodType eptWithLongs = longsAtEnd.insertParameterTypes(0, ad.getClass()); + MethodType eptWithInts = intsAtEnd.insertParameterTypes(0, ad.getClass()); + rawEntryPoint = ad.prototypeEntryPoint(); + MethodType midType = eptWithLongs; // will change longs to ints + for (int i = 0, nargs = midType.parameterCount(); i < nargs; i++) { + if (midType.parameterType(i) != eptWithInts.parameterType(i)) { + assert(midType.parameterType(i) == long.class); + assert(eptWithInts.parameterType(i) == int.class); + MethodType nextType = midType.changeParameterType(i, int.class); + rawEntryPoint = MethodHandle.convertArguments(Access.TOKEN, + rawEntryPoint, nextType, midType, null); + midType = nextType; + } + } + assert(midType == eptWithInts); + } else { // If there is no statically compiled adapter, // build one by means of dynamic bytecode generation. ad = buildAdapterFromBytecodes(rawEntryTypeInit = intsAtEnd); + rawEntryPoint = ad.prototypeEntryPoint(); } } - MethodHandle rawEntryPoint = ad.prototypeEntryPoint(); - MethodType tepType = entryType.insertParameterType(0, ad.getClass()); + MethodType tepType = entryType.insertParameterTypes(0, ad.getClass()); this.entryPoint = - AdapterMethodHandle.makeRawRetypeOnly(Access.TOKEN, tepType, rawEntryPoint); + AdapterMethodHandle.makeRetypeRaw(Access.TOKEN, tepType, rawEntryPoint); if (this.entryPoint == null) throw new UnsupportedOperationException("cannot retype to "+entryType - +" from "+rawEntryPoint.type().dropParameterType(0)); + +" from "+rawEntryPoint.type().dropParameterTypes(0, 1)); this.returnConversion = computeReturnConversion(entryType, rawEntryTypeInit, false); this.rawEntryType = rawEntryTypeInit; this.adapter = ad; - this.invoker = makeRawArgumentFilter(invoker0, - rawEntryPoint.type().dropParameterType(0), entryType); + this.invoker = makeRawArgumentFilter(invoker0, rawEntryTypeInit, entryType); } /** A generic argument list will be created by a call of type 'raw'. @@ -157,8 +176,8 @@ class ToGeneric { if (filteredInvoker == null) throw new UnsupportedOperationException("NYI"); } MethodHandle reboxer = ValueConversions.rebox(dst, false); - FilterGeneric gen = new FilterGeneric(filteredInvoker.type(), (short)(1+i), (short)1, 'R'); - filteredInvoker = gen.makeInstance(reboxer, filteredInvoker); + filteredInvoker = FilterGeneric.makeArgumentFilter(1+i, reboxer, filteredInvoker); + if (filteredInvoker == null) throw new InternalError(); } if (filteredInvoker == null) return invoker; return AdapterMethodHandle.makeRetypeOnly(Access.TOKEN, invoker.type(), filteredInvoker); @@ -209,9 +228,9 @@ class ToGeneric { if (convert == null) convert = computeReturnConversion(type, rawEntryType, true); // retype erased reference arguments (the cast makes it safe to do this) - MethodType tepType = type.insertParameterType(0, adapter.getClass()); + MethodType tepType = type.insertParameterTypes(0, adapter.getClass()); MethodHandle typedEntryPoint = - AdapterMethodHandle.makeRawRetypeOnly(Access.TOKEN, tepType, entryPoint); + AdapterMethodHandle.makeRetypeRaw(Access.TOKEN, tepType, entryPoint); return adapter.makeInstance(typedEntryPoint, invoker, convert, genericTarget); } @@ -225,7 +244,7 @@ class ToGeneric { public static MethodHandle make(MethodType type, MethodHandle genericTarget) { MethodType gtype = genericTarget.type(); if (type.generic() != gtype) - throw new IllegalArgumentException(); + throw newIllegalArgumentException("type must be generic"); if (type == gtype) return genericTarget; return ToGeneric.of(type).makeInstance(type, genericTarget); } @@ -283,7 +302,10 @@ class ToGeneric { try { return ctor.newInstance(entryPoint); } catch (IllegalArgumentException ex) { - } catch (InvocationTargetException ex) { + } catch (InvocationTargetException wex) { + Throwable ex = wex.getTargetException(); + if (ex instanceof Error) throw (Error)ex; + if (ex instanceof RuntimeException) throw (RuntimeException)ex; } catch (InstantiationException ex) { } catch (IllegalAccessException ex) { } @@ -317,6 +339,11 @@ class ToGeneric { protected final MethodHandle target; // Object... -> Object protected final MethodHandle convert; // Object -> R + @Override + public String toString() { + return target.toString(); + } + protected boolean isPrototype() { return target == null; } /* Prototype constructor. */ protected Adapter(MethodHandle entryPoint) { @@ -344,33 +371,33 @@ class ToGeneric { // { return new ThisType(entryPoint, convert, target); } // Code to run when the arguments (<= 4) have all been boxed. - protected Object target() { return invoker.invoke(target); } - protected Object target(Object a0) { return invoker.invoke(target, a0); } + protected Object target() throws Throwable { return invoker.invoke(target); } + protected Object target(Object a0) throws Throwable { return invoker.invoke(target, a0); } protected Object target(Object a0, Object a1) - { return invoker.invoke(target, a0, a1); } + throws Throwable { return invoker.invoke(target, a0, a1); } protected Object target(Object a0, Object a1, Object a2) - { return invoker.invoke(target, a0, a1, a2); } + throws Throwable { return invoker.invoke(target, a0, a1, a2); } protected Object target(Object a0, Object a1, Object a2, Object a3) - { return invoker.invoke(target, a0, a1, a2, a3); } + throws Throwable { return invoker.invoke(target, a0, a1, a2, a3); } /* - protected Object target_0(Object... av) { return invoker.invoke(target, av); } + protected Object target_0(Object... av) throws Throwable { return invoker.invoke(target, av); } protected Object target_1(Object a0, Object... av) - { return invoker.invoke(target, a0, (Object)av); } + throws Throwable { return invoker.invoke(target, a0, (Object)av); } protected Object target_2(Object a0, Object a1, Object... av) - { return invoker.invoke(target, a0, a1, (Object)av); } + throws Throwable { return invoker.invoke(target, a0, a1, (Object)av); } protected Object target_3(Object a0, Object a1, Object a2, Object... av) - { return invoker.invoke(target, a0, a1, a2, (Object)av); } + throws Throwable { return invoker.invoke(target, a0, a1, a2, (Object)av); } protected Object target_4(Object a0, Object a1, Object a2, Object a3, Object... av) - { return invoker.invoke(target, a0, a1, a2, a3, (Object)av); } + throws Throwable { return invoker.invoke(target, a0, a1, a2, a3, (Object)av); } // */ // (For more than 4 arguments, generate the code in the adapter itself.) // Code to run when the generic target has finished and produced a value. - protected Object return_L(Object res) { return convert.invoke(res); } - protected int return_I(Object res) { return convert.invoke(res); } - protected long return_J(Object res) { return convert.invoke(res); } - protected float return_F(Object res) { return convert.invoke(res); } - protected double return_D(Object res) { return convert.invoke(res); } + protected Object return_L(Object res) throws Throwable { return convert.invoke(res); } + protected int return_I(Object res) throws Throwable { return convert.invoke(res); } + protected long return_J(Object res) throws Throwable { return convert.invoke(res); } + protected float return_F(Object res) throws Throwable { return convert.invoke(res); } + protected double return_D(Object res) throws Throwable { return convert.invoke(res); } static private final String CLASS_PREFIX; // "sun.dyn.ToGeneric$" static { @@ -397,25 +424,25 @@ class ToGeneric { protected A1(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A1(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A1 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A1(e, i, c, t); } - protected Object target(Object a0) { return invoker.invoke(target, a0); } - protected Object targetA1(Object a0) { return target(a0); } - protected Object targetA1(int a0) { return target(a0); } - protected Object targetA1(long a0) { return target(a0); } - protected Object invoke_L(Object a0) { return return_L(targetA1(a0)); } - protected int invoke_I(Object a0) { return return_I(targetA1(a0)); } - protected long invoke_J(Object a0) { return return_J(targetA1(a0)); } - protected float invoke_F(Object a0) { return return_F(targetA1(a0)); } - protected double invoke_D(Object a0) { return return_D(targetA1(a0)); } - protected Object invoke_L(int a0) { return return_L(targetA1(a0)); } - protected int invoke_I(int a0) { return return_I(targetA1(a0)); } - protected long invoke_J(int a0) { return return_J(targetA1(a0)); } - protected float invoke_F(int a0) { return return_F(targetA1(a0)); } - protected double invoke_D(int a0) { return return_D(targetA1(a0)); } - protected Object invoke_L(long a0) { return return_L(targetA1(a0)); } - protected int invoke_I(long a0) { return return_I(targetA1(a0)); } - protected long invoke_J(long a0) { return return_J(targetA1(a0)); } - protected float invoke_F(long a0) { return return_F(targetA1(a0)); } - protected double invoke_D(long a0) { return return_D(targetA1(a0)); } + protected Object target(Object a0) throws Throwable { return invoker.invoke(target, a0); } + protected Object targetA1(Object a0) throws Throwable { return target(a0); } + protected Object targetA1(int a0) throws Throwable { return target(a0); } + protected Object targetA1(long a0) throws Throwable { return target(a0); } + protected Object invoke_L(Object a0) throws Throwable { return return_L(targetA1(a0)); } + protected int invoke_I(Object a0) throws Throwable { return return_I(targetA1(a0)); } + protected long invoke_J(Object a0) throws Throwable { return return_J(targetA1(a0)); } + protected float invoke_F(Object a0) throws Throwable { return return_F(targetA1(a0)); } + protected double invoke_D(Object a0) throws Throwable { return return_D(targetA1(a0)); } + protected Object invoke_L(int a0) throws Throwable { return return_L(targetA1(a0)); } + protected int invoke_I(int a0) throws Throwable { return return_I(targetA1(a0)); } + protected long invoke_J(int a0) throws Throwable { return return_J(targetA1(a0)); } + protected float invoke_F(int a0) throws Throwable { return return_F(targetA1(a0)); } + protected double invoke_D(int a0) throws Throwable { return return_D(targetA1(a0)); } + protected Object invoke_L(long a0) throws Throwable { return return_L(targetA1(a0)); } + protected int invoke_I(long a0) throws Throwable { return return_I(targetA1(a0)); } + protected long invoke_J(long a0) throws Throwable { return return_J(targetA1(a0)); } + protected float invoke_F(long a0) throws Throwable { return return_F(targetA1(a0)); } + protected double invoke_D(long a0) throws Throwable { return return_D(targetA1(a0)); } } // */ @@ -435,13 +462,13 @@ class genclasses { " protected @cat@(MethodHandle entryPoint) { super(entryPoint); } // to build prototype", " protected @cat@(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); }", " protected @cat@ makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new @cat@(e, i, c, t); }", - " protected Object target(@Ovav@) { return invoker.invoke(target, @av@); }", + " protected Object target(@Ovav@) throws Throwable { return invoker.invoke(target, @av@); }", " //@each-Tv@", - " protected Object target@cat@(@Tvav@) { return target(@av@); }", + " protected Object target@cat@(@Tvav@) throws Throwable { return target(@av@); }", " //@end-Tv@", " //@each-Tv@", " //@each-R@", - " protected @R@ invoke_@Rc@(@Tvav@) { return return_@Rc@(target@cat@(@av@)); }", + " protected @R@ invoke_@Rc@(@Tvav@) throws Throwable { return return_@Rc@(target@cat@(@av@)); }", " //@end-R@", " //@end-Tv@", " }", @@ -595,424 +622,424 @@ class genclasses { protected A0(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A0(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A0 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A0(e, i, c, t); } - protected Object target() { return invoker.invoke(target); } - protected Object targetA0() { return target(); } - protected Object invoke_L() { return return_L(targetA0()); } - protected int invoke_I() { return return_I(targetA0()); } - protected long invoke_J() { return return_J(targetA0()); } - protected float invoke_F() { return return_F(targetA0()); } - protected double invoke_D() { return return_D(targetA0()); } + protected Object target() throws Throwable { return invoker.invoke(target); } + protected Object targetA0() throws Throwable { return target(); } + protected Object invoke_L() throws Throwable { return return_L(targetA0()); } + protected int invoke_I() throws Throwable { return return_I(targetA0()); } + protected long invoke_J() throws Throwable { return return_J(targetA0()); } + protected float invoke_F() throws Throwable { return return_F(targetA0()); } + protected double invoke_D() throws Throwable { return return_D(targetA0()); } } static class A1 extends Adapter { protected A1(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A1(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A1 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A1(e, i, c, t); } - protected Object target(Object a0) { return invoker.invoke(target, a0); } - protected Object targetA1(Object a0) { return target(a0); } - protected Object targetA1(int a0) { return target(a0); } - protected Object targetA1(long a0) { return target(a0); } - protected Object invoke_L(Object a0) { return return_L(targetA1(a0)); } - protected int invoke_I(Object a0) { return return_I(targetA1(a0)); } - protected long invoke_J(Object a0) { return return_J(targetA1(a0)); } - protected float invoke_F(Object a0) { return return_F(targetA1(a0)); } - protected double invoke_D(Object a0) { return return_D(targetA1(a0)); } - protected Object invoke_L(int a0) { return return_L(targetA1(a0)); } - protected int invoke_I(int a0) { return return_I(targetA1(a0)); } - protected long invoke_J(int a0) { return return_J(targetA1(a0)); } - protected float invoke_F(int a0) { return return_F(targetA1(a0)); } - protected double invoke_D(int a0) { return return_D(targetA1(a0)); } - protected Object invoke_L(long a0) { return return_L(targetA1(a0)); } - protected int invoke_I(long a0) { return return_I(targetA1(a0)); } - protected long invoke_J(long a0) { return return_J(targetA1(a0)); } - protected float invoke_F(long a0) { return return_F(targetA1(a0)); } - protected double invoke_D(long a0) { return return_D(targetA1(a0)); } + protected Object target(Object a0) throws Throwable { return invoker.invoke(target, a0); } + protected Object targetA1(Object a0) throws Throwable { return target(a0); } + protected Object targetA1(int a0) throws Throwable { return target(a0); } + protected Object targetA1(long a0) throws Throwable { return target(a0); } + protected Object invoke_L(Object a0) throws Throwable { return return_L(targetA1(a0)); } + protected int invoke_I(Object a0) throws Throwable { return return_I(targetA1(a0)); } + protected long invoke_J(Object a0) throws Throwable { return return_J(targetA1(a0)); } + protected float invoke_F(Object a0) throws Throwable { return return_F(targetA1(a0)); } + protected double invoke_D(Object a0) throws Throwable { return return_D(targetA1(a0)); } + protected Object invoke_L(int a0) throws Throwable { return return_L(targetA1(a0)); } + protected int invoke_I(int a0) throws Throwable { return return_I(targetA1(a0)); } + protected long invoke_J(int a0) throws Throwable { return return_J(targetA1(a0)); } + protected float invoke_F(int a0) throws Throwable { return return_F(targetA1(a0)); } + protected double invoke_D(int a0) throws Throwable { return return_D(targetA1(a0)); } + protected Object invoke_L(long a0) throws Throwable { return return_L(targetA1(a0)); } + protected int invoke_I(long a0) throws Throwable { return return_I(targetA1(a0)); } + protected long invoke_J(long a0) throws Throwable { return return_J(targetA1(a0)); } + protected float invoke_F(long a0) throws Throwable { return return_F(targetA1(a0)); } + protected double invoke_D(long a0) throws Throwable { return return_D(targetA1(a0)); } } static class A2 extends Adapter { protected A2(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A2(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A2 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A2(e, i, c, t); } - protected Object target(Object a0, Object a1) { return invoker.invoke(target, a0, a1); } - protected Object targetA2(Object a0, Object a1) { return target(a0, a1); } - protected Object targetA2(Object a0, int a1) { return target(a0, a1); } - protected Object targetA2(int a0, int a1) { return target(a0, a1); } - protected Object targetA2(Object a0, long a1) { return target(a0, a1); } - protected Object targetA2(long a0, long a1) { return target(a0, a1); } - protected Object invoke_L(Object a0, Object a1) { return return_L(targetA2(a0, a1)); } - protected int invoke_I(Object a0, Object a1) { return return_I(targetA2(a0, a1)); } - protected long invoke_J(Object a0, Object a1) { return return_J(targetA2(a0, a1)); } - protected float invoke_F(Object a0, Object a1) { return return_F(targetA2(a0, a1)); } - protected double invoke_D(Object a0, Object a1) { return return_D(targetA2(a0, a1)); } - protected Object invoke_L(Object a0, int a1) { return return_L(targetA2(a0, a1)); } - protected int invoke_I(Object a0, int a1) { return return_I(targetA2(a0, a1)); } - protected long invoke_J(Object a0, int a1) { return return_J(targetA2(a0, a1)); } - protected float invoke_F(Object a0, int a1) { return return_F(targetA2(a0, a1)); } - protected double invoke_D(Object a0, int a1) { return return_D(targetA2(a0, a1)); } - protected Object invoke_L(int a0, int a1) { return return_L(targetA2(a0, a1)); } - protected int invoke_I(int a0, int a1) { return return_I(targetA2(a0, a1)); } - protected long invoke_J(int a0, int a1) { return return_J(targetA2(a0, a1)); } - protected float invoke_F(int a0, int a1) { return return_F(targetA2(a0, a1)); } - protected double invoke_D(int a0, int a1) { return return_D(targetA2(a0, a1)); } - protected Object invoke_L(Object a0, long a1) { return return_L(targetA2(a0, a1)); } - protected int invoke_I(Object a0, long a1) { return return_I(targetA2(a0, a1)); } - protected long invoke_J(Object a0, long a1) { return return_J(targetA2(a0, a1)); } - protected float invoke_F(Object a0, long a1) { return return_F(targetA2(a0, a1)); } - protected double invoke_D(Object a0, long a1) { return return_D(targetA2(a0, a1)); } - protected Object invoke_L(long a0, long a1) { return return_L(targetA2(a0, a1)); } - protected int invoke_I(long a0, long a1) { return return_I(targetA2(a0, a1)); } - protected long invoke_J(long a0, long a1) { return return_J(targetA2(a0, a1)); } - protected float invoke_F(long a0, long a1) { return return_F(targetA2(a0, a1)); } - protected double invoke_D(long a0, long a1) { return return_D(targetA2(a0, a1)); } + protected Object target(Object a0, Object a1) throws Throwable { return invoker.invoke(target, a0, a1); } + protected Object targetA2(Object a0, Object a1) throws Throwable { return target(a0, a1); } + protected Object targetA2(Object a0, int a1) throws Throwable { return target(a0, a1); } + protected Object targetA2(int a0, int a1) throws Throwable { return target(a0, a1); } + protected Object targetA2(Object a0, long a1) throws Throwable { return target(a0, a1); } + protected Object targetA2(long a0, long a1) throws Throwable { return target(a0, a1); } + protected Object invoke_L(Object a0, Object a1) throws Throwable { return return_L(targetA2(a0, a1)); } + protected int invoke_I(Object a0, Object a1) throws Throwable { return return_I(targetA2(a0, a1)); } + protected long invoke_J(Object a0, Object a1) throws Throwable { return return_J(targetA2(a0, a1)); } + protected float invoke_F(Object a0, Object a1) throws Throwable { return return_F(targetA2(a0, a1)); } + protected double invoke_D(Object a0, Object a1) throws Throwable { return return_D(targetA2(a0, a1)); } + protected Object invoke_L(Object a0, int a1) throws Throwable { return return_L(targetA2(a0, a1)); } + protected int invoke_I(Object a0, int a1) throws Throwable { return return_I(targetA2(a0, a1)); } + protected long invoke_J(Object a0, int a1) throws Throwable { return return_J(targetA2(a0, a1)); } + protected float invoke_F(Object a0, int a1) throws Throwable { return return_F(targetA2(a0, a1)); } + protected double invoke_D(Object a0, int a1) throws Throwable { return return_D(targetA2(a0, a1)); } + protected Object invoke_L(int a0, int a1) throws Throwable { return return_L(targetA2(a0, a1)); } + protected int invoke_I(int a0, int a1) throws Throwable { return return_I(targetA2(a0, a1)); } + protected long invoke_J(int a0, int a1) throws Throwable { return return_J(targetA2(a0, a1)); } + protected float invoke_F(int a0, int a1) throws Throwable { return return_F(targetA2(a0, a1)); } + protected double invoke_D(int a0, int a1) throws Throwable { return return_D(targetA2(a0, a1)); } + protected Object invoke_L(Object a0, long a1) throws Throwable { return return_L(targetA2(a0, a1)); } + protected int invoke_I(Object a0, long a1) throws Throwable { return return_I(targetA2(a0, a1)); } + protected long invoke_J(Object a0, long a1) throws Throwable { return return_J(targetA2(a0, a1)); } + protected float invoke_F(Object a0, long a1) throws Throwable { return return_F(targetA2(a0, a1)); } + protected double invoke_D(Object a0, long a1) throws Throwable { return return_D(targetA2(a0, a1)); } + protected Object invoke_L(long a0, long a1) throws Throwable { return return_L(targetA2(a0, a1)); } + protected int invoke_I(long a0, long a1) throws Throwable { return return_I(targetA2(a0, a1)); } + protected long invoke_J(long a0, long a1) throws Throwable { return return_J(targetA2(a0, a1)); } + protected float invoke_F(long a0, long a1) throws Throwable { return return_F(targetA2(a0, a1)); } + protected double invoke_D(long a0, long a1) throws Throwable { return return_D(targetA2(a0, a1)); } } static class A3 extends Adapter { protected A3(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A3(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A3 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A3(e, i, c, t); } - protected Object target(Object a0, Object a1, Object a2) { return invoker.invoke(target, a0, a1, a2); } - protected Object targetA3(Object a0, Object a1, Object a2) { return target(a0, a1, a2); } - protected Object targetA3(Object a0, Object a1, int a2) { return target(a0, a1, a2); } - protected Object targetA3(Object a0, int a1, int a2) { return target(a0, a1, a2); } - protected Object targetA3(int a0, int a1, int a2) { return target(a0, a1, a2); } - protected Object targetA3(Object a0, Object a1, long a2) { return target(a0, a1, a2); } - protected Object targetA3(Object a0, long a1, long a2) { return target(a0, a1, a2); } - protected Object targetA3(long a0, long a1, long a2) { return target(a0, a1, a2); } - protected Object invoke_L(Object a0, Object a1, Object a2) { return return_L(targetA3(a0, a1, a2)); } - protected int invoke_I(Object a0, Object a1, Object a2) { return return_I(targetA3(a0, a1, a2)); } - protected long invoke_J(Object a0, Object a1, Object a2) { return return_J(targetA3(a0, a1, a2)); } - protected float invoke_F(Object a0, Object a1, Object a2) { return return_F(targetA3(a0, a1, a2)); } - protected double invoke_D(Object a0, Object a1, Object a2) { return return_D(targetA3(a0, a1, a2)); } - protected Object invoke_L(Object a0, Object a1, int a2) { return return_L(targetA3(a0, a1, a2)); } - protected int invoke_I(Object a0, Object a1, int a2) { return return_I(targetA3(a0, a1, a2)); } - protected long invoke_J(Object a0, Object a1, int a2) { return return_J(targetA3(a0, a1, a2)); } - protected float invoke_F(Object a0, Object a1, int a2) { return return_F(targetA3(a0, a1, a2)); } - protected double invoke_D(Object a0, Object a1, int a2) { return return_D(targetA3(a0, a1, a2)); } - protected Object invoke_L(Object a0, int a1, int a2) { return return_L(targetA3(a0, a1, a2)); } - protected int invoke_I(Object a0, int a1, int a2) { return return_I(targetA3(a0, a1, a2)); } - protected long invoke_J(Object a0, int a1, int a2) { return return_J(targetA3(a0, a1, a2)); } - protected float invoke_F(Object a0, int a1, int a2) { return return_F(targetA3(a0, a1, a2)); } - protected double invoke_D(Object a0, int a1, int a2) { return return_D(targetA3(a0, a1, a2)); } - protected Object invoke_L(int a0, int a1, int a2) { return return_L(targetA3(a0, a1, a2)); } - protected int invoke_I(int a0, int a1, int a2) { return return_I(targetA3(a0, a1, a2)); } - protected long invoke_J(int a0, int a1, int a2) { return return_J(targetA3(a0, a1, a2)); } - protected float invoke_F(int a0, int a1, int a2) { return return_F(targetA3(a0, a1, a2)); } - protected double invoke_D(int a0, int a1, int a2) { return return_D(targetA3(a0, a1, a2)); } - protected Object invoke_L(Object a0, Object a1, long a2) { return return_L(targetA3(a0, a1, a2)); } - protected int invoke_I(Object a0, Object a1, long a2) { return return_I(targetA3(a0, a1, a2)); } - protected long invoke_J(Object a0, Object a1, long a2) { return return_J(targetA3(a0, a1, a2)); } - protected float invoke_F(Object a0, Object a1, long a2) { return return_F(targetA3(a0, a1, a2)); } - protected double invoke_D(Object a0, Object a1, long a2) { return return_D(targetA3(a0, a1, a2)); } - protected Object invoke_L(Object a0, long a1, long a2) { return return_L(targetA3(a0, a1, a2)); } - protected int invoke_I(Object a0, long a1, long a2) { return return_I(targetA3(a0, a1, a2)); } - protected long invoke_J(Object a0, long a1, long a2) { return return_J(targetA3(a0, a1, a2)); } - protected float invoke_F(Object a0, long a1, long a2) { return return_F(targetA3(a0, a1, a2)); } - protected double invoke_D(Object a0, long a1, long a2) { return return_D(targetA3(a0, a1, a2)); } - protected Object invoke_L(long a0, long a1, long a2) { return return_L(targetA3(a0, a1, a2)); } - protected int invoke_I(long a0, long a1, long a2) { return return_I(targetA3(a0, a1, a2)); } - protected long invoke_J(long a0, long a1, long a2) { return return_J(targetA3(a0, a1, a2)); } - protected float invoke_F(long a0, long a1, long a2) { return return_F(targetA3(a0, a1, a2)); } - protected double invoke_D(long a0, long a1, long a2) { return return_D(targetA3(a0, a1, a2)); } + protected Object target(Object a0, Object a1, Object a2) throws Throwable { return invoker.invoke(target, a0, a1, a2); } + protected Object targetA3(Object a0, Object a1, Object a2) throws Throwable { return target(a0, a1, a2); } + protected Object targetA3(Object a0, Object a1, int a2) throws Throwable { return target(a0, a1, a2); } + protected Object targetA3(Object a0, int a1, int a2) throws Throwable { return target(a0, a1, a2); } + protected Object targetA3(int a0, int a1, int a2) throws Throwable { return target(a0, a1, a2); } + protected Object targetA3(Object a0, Object a1, long a2) throws Throwable { return target(a0, a1, a2); } + protected Object targetA3(Object a0, long a1, long a2) throws Throwable { return target(a0, a1, a2); } + protected Object targetA3(long a0, long a1, long a2) throws Throwable { return target(a0, a1, a2); } + protected Object invoke_L(Object a0, Object a1, Object a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); } + protected int invoke_I(Object a0, Object a1, Object a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); } + protected long invoke_J(Object a0, Object a1, Object a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); } + protected float invoke_F(Object a0, Object a1, Object a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); } + protected double invoke_D(Object a0, Object a1, Object a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); } + protected Object invoke_L(Object a0, Object a1, int a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); } + protected int invoke_I(Object a0, Object a1, int a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); } + protected long invoke_J(Object a0, Object a1, int a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); } + protected float invoke_F(Object a0, Object a1, int a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); } + protected double invoke_D(Object a0, Object a1, int a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); } + protected Object invoke_L(Object a0, int a1, int a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); } + protected int invoke_I(Object a0, int a1, int a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); } + protected long invoke_J(Object a0, int a1, int a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); } + protected float invoke_F(Object a0, int a1, int a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); } + protected double invoke_D(Object a0, int a1, int a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); } + protected Object invoke_L(int a0, int a1, int a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); } + protected int invoke_I(int a0, int a1, int a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); } + protected long invoke_J(int a0, int a1, int a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); } + protected float invoke_F(int a0, int a1, int a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); } + protected double invoke_D(int a0, int a1, int a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); } + protected Object invoke_L(Object a0, Object a1, long a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); } + protected int invoke_I(Object a0, Object a1, long a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); } + protected long invoke_J(Object a0, Object a1, long a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); } + protected float invoke_F(Object a0, Object a1, long a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); } + protected double invoke_D(Object a0, Object a1, long a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); } + protected Object invoke_L(Object a0, long a1, long a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); } + protected int invoke_I(Object a0, long a1, long a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); } + protected long invoke_J(Object a0, long a1, long a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); } + protected float invoke_F(Object a0, long a1, long a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); } + protected double invoke_D(Object a0, long a1, long a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); } + protected Object invoke_L(long a0, long a1, long a2) throws Throwable { return return_L(targetA3(a0, a1, a2)); } + protected int invoke_I(long a0, long a1, long a2) throws Throwable { return return_I(targetA3(a0, a1, a2)); } + protected long invoke_J(long a0, long a1, long a2) throws Throwable { return return_J(targetA3(a0, a1, a2)); } + protected float invoke_F(long a0, long a1, long a2) throws Throwable { return return_F(targetA3(a0, a1, a2)); } + protected double invoke_D(long a0, long a1, long a2) throws Throwable { return return_D(targetA3(a0, a1, a2)); } } //params=[4, 5, 2, 99, 99, 99] static class A4 extends Adapter { protected A4(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A4(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A4 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A4(e, i, c, t); } - protected Object target(Object a0, Object a1, Object a2, Object a3) { return invoker.invoke(target, a0, a1, a2, a3); } - protected Object targetA4(Object a0, Object a1, Object a2, Object a3) { return target(a0, a1, a2, a3); } - protected Object targetA4(Object a0, Object a1, Object a2, int a3) { return target(a0, a1, a2, a3); } - protected Object targetA4(Object a0, Object a1, int a2, int a3) { return target(a0, a1, a2, a3); } - protected Object targetA4(Object a0, int a1, int a2, int a3) { return target(a0, a1, a2, a3); } - protected Object targetA4(int a0, int a1, int a2, int a3) { return target(a0, a1, a2, a3); } - protected Object targetA4(Object a0, Object a1, Object a2, long a3) { return target(a0, a1, a2, a3); } - protected Object targetA4(Object a0, Object a1, long a2, long a3) { return target(a0, a1, a2, a3); } - protected Object targetA4(Object a0, long a1, long a2, long a3) { return target(a0, a1, a2, a3); } - protected Object targetA4(long a0, long a1, long a2, long a3) { return target(a0, a1, a2, a3); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3) { return return_L(targetA4(a0, a1, a2, a3)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3) { return return_I(targetA4(a0, a1, a2, a3)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3) { return return_J(targetA4(a0, a1, a2, a3)); } - protected Object invoke_L(Object a0, Object a1, Object a2, int a3) { return return_L(targetA4(a0, a1, a2, a3)); } - protected int invoke_I(Object a0, Object a1, Object a2, int a3) { return return_I(targetA4(a0, a1, a2, a3)); } - protected long invoke_J(Object a0, Object a1, Object a2, int a3) { return return_J(targetA4(a0, a1, a2, a3)); } - protected Object invoke_L(Object a0, Object a1, int a2, int a3) { return return_L(targetA4(a0, a1, a2, a3)); } - protected int invoke_I(Object a0, Object a1, int a2, int a3) { return return_I(targetA4(a0, a1, a2, a3)); } - protected long invoke_J(Object a0, Object a1, int a2, int a3) { return return_J(targetA4(a0, a1, a2, a3)); } - protected Object invoke_L(Object a0, int a1, int a2, int a3) { return return_L(targetA4(a0, a1, a2, a3)); } - protected int invoke_I(Object a0, int a1, int a2, int a3) { return return_I(targetA4(a0, a1, a2, a3)); } - protected long invoke_J(Object a0, int a1, int a2, int a3) { return return_J(targetA4(a0, a1, a2, a3)); } - protected Object invoke_L(int a0, int a1, int a2, int a3) { return return_L(targetA4(a0, a1, a2, a3)); } - protected int invoke_I(int a0, int a1, int a2, int a3) { return return_I(targetA4(a0, a1, a2, a3)); } - protected long invoke_J(int a0, int a1, int a2, int a3) { return return_J(targetA4(a0, a1, a2, a3)); } - protected Object invoke_L(Object a0, Object a1, Object a2, long a3) { return return_L(targetA4(a0, a1, a2, a3)); } - protected int invoke_I(Object a0, Object a1, Object a2, long a3) { return return_I(targetA4(a0, a1, a2, a3)); } - protected long invoke_J(Object a0, Object a1, Object a2, long a3) { return return_J(targetA4(a0, a1, a2, a3)); } - protected Object invoke_L(Object a0, Object a1, long a2, long a3) { return return_L(targetA4(a0, a1, a2, a3)); } - protected int invoke_I(Object a0, Object a1, long a2, long a3) { return return_I(targetA4(a0, a1, a2, a3)); } - protected long invoke_J(Object a0, Object a1, long a2, long a3) { return return_J(targetA4(a0, a1, a2, a3)); } - protected Object invoke_L(Object a0, long a1, long a2, long a3) { return return_L(targetA4(a0, a1, a2, a3)); } - protected int invoke_I(Object a0, long a1, long a2, long a3) { return return_I(targetA4(a0, a1, a2, a3)); } - protected long invoke_J(Object a0, long a1, long a2, long a3) { return return_J(targetA4(a0, a1, a2, a3)); } - protected Object invoke_L(long a0, long a1, long a2, long a3) { return return_L(targetA4(a0, a1, a2, a3)); } - protected int invoke_I(long a0, long a1, long a2, long a3) { return return_I(targetA4(a0, a1, a2, a3)); } - protected long invoke_J(long a0, long a1, long a2, long a3) { return return_J(targetA4(a0, a1, a2, a3)); } + protected Object target(Object a0, Object a1, Object a2, Object a3) throws Throwable { return invoker.invoke(target, a0, a1, a2, a3); } + protected Object targetA4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return target(a0, a1, a2, a3); } + protected Object targetA4(Object a0, Object a1, Object a2, int a3) throws Throwable { return target(a0, a1, a2, a3); } + protected Object targetA4(Object a0, Object a1, int a2, int a3) throws Throwable { return target(a0, a1, a2, a3); } + protected Object targetA4(Object a0, int a1, int a2, int a3) throws Throwable { return target(a0, a1, a2, a3); } + protected Object targetA4(int a0, int a1, int a2, int a3) throws Throwable { return target(a0, a1, a2, a3); } + protected Object targetA4(Object a0, Object a1, Object a2, long a3) throws Throwable { return target(a0, a1, a2, a3); } + protected Object targetA4(Object a0, Object a1, long a2, long a3) throws Throwable { return target(a0, a1, a2, a3); } + protected Object targetA4(Object a0, long a1, long a2, long a3) throws Throwable { return target(a0, a1, a2, a3); } + protected Object targetA4(long a0, long a1, long a2, long a3) throws Throwable { return target(a0, a1, a2, a3); } + protected Object invoke_L(Object a0, Object a1, Object a2, Object a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); } + protected int invoke_I(Object a0, Object a1, Object a2, Object a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); } + protected long invoke_J(Object a0, Object a1, Object a2, Object a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); } + protected Object invoke_L(Object a0, Object a1, Object a2, int a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); } + protected int invoke_I(Object a0, Object a1, Object a2, int a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); } + protected long invoke_J(Object a0, Object a1, Object a2, int a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); } + protected Object invoke_L(Object a0, Object a1, int a2, int a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); } + protected int invoke_I(Object a0, Object a1, int a2, int a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); } + protected long invoke_J(Object a0, Object a1, int a2, int a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); } + protected Object invoke_L(Object a0, int a1, int a2, int a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); } + protected int invoke_I(Object a0, int a1, int a2, int a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); } + protected long invoke_J(Object a0, int a1, int a2, int a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); } + protected Object invoke_L(int a0, int a1, int a2, int a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); } + protected int invoke_I(int a0, int a1, int a2, int a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); } + protected long invoke_J(int a0, int a1, int a2, int a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); } + protected Object invoke_L(Object a0, Object a1, Object a2, long a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); } + protected int invoke_I(Object a0, Object a1, Object a2, long a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); } + protected long invoke_J(Object a0, Object a1, Object a2, long a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); } + protected Object invoke_L(Object a0, Object a1, long a2, long a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); } + protected int invoke_I(Object a0, Object a1, long a2, long a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); } + protected long invoke_J(Object a0, Object a1, long a2, long a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); } + protected Object invoke_L(Object a0, long a1, long a2, long a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); } + protected int invoke_I(Object a0, long a1, long a2, long a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); } + protected long invoke_J(Object a0, long a1, long a2, long a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); } + protected Object invoke_L(long a0, long a1, long a2, long a3) throws Throwable { return return_L(targetA4(a0, a1, a2, a3)); } + protected int invoke_I(long a0, long a1, long a2, long a3) throws Throwable { return return_I(targetA4(a0, a1, a2, a3)); } + protected long invoke_J(long a0, long a1, long a2, long a3) throws Throwable { return return_J(targetA4(a0, a1, a2, a3)); } } static class A5 extends Adapter { protected A5(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A5(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A5 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A5(e, i, c, t); } - protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4) { return invoker.invoke(target, a0, a1, a2, a3, a4); } - protected Object targetA5(Object a0, Object a1, Object a2, Object a3, Object a4) { return target(a0, a1, a2, a3, a4); } - protected Object targetA5(Object a0, Object a1, Object a2, Object a3, int a4) { return target(a0, a1, a2, a3, a4); } - protected Object targetA5(Object a0, Object a1, Object a2, int a3, int a4) { return target(a0, a1, a2, a3, a4); } - protected Object targetA5(Object a0, Object a1, int a2, int a3, int a4) { return target(a0, a1, a2, a3, a4); } - protected Object targetA5(Object a0, int a1, int a2, int a3, int a4) { return target(a0, a1, a2, a3, a4); } - protected Object targetA5(int a0, int a1, int a2, int a3, int a4) { return target(a0, a1, a2, a3, a4); } - protected Object targetA5(Object a0, Object a1, Object a2, Object a3, long a4) { return target(a0, a1, a2, a3, a4); } - protected Object targetA5(Object a0, Object a1, Object a2, long a3, long a4) { return target(a0, a1, a2, a3, a4); } - protected Object targetA5(Object a0, Object a1, long a2, long a3, long a4) { return target(a0, a1, a2, a3, a4); } - protected Object targetA5(Object a0, long a1, long a2, long a3, long a4) { return target(a0, a1, a2, a3, a4); } - protected Object targetA5(long a0, long a1, long a2, long a3, long a4) { return target(a0, a1, a2, a3, a4); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4) { return return_L(targetA5(a0, a1, a2, a3, a4)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4) { return return_I(targetA5(a0, a1, a2, a3, a4)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4) { return return_J(targetA5(a0, a1, a2, a3, a4)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, int a4) { return return_L(targetA5(a0, a1, a2, a3, a4)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, int a4) { return return_I(targetA5(a0, a1, a2, a3, a4)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, int a4) { return return_J(targetA5(a0, a1, a2, a3, a4)); } - protected Object invoke_L(Object a0, Object a1, Object a2, int a3, int a4) { return return_L(targetA5(a0, a1, a2, a3, a4)); } - protected int invoke_I(Object a0, Object a1, Object a2, int a3, int a4) { return return_I(targetA5(a0, a1, a2, a3, a4)); } - protected long invoke_J(Object a0, Object a1, Object a2, int a3, int a4) { return return_J(targetA5(a0, a1, a2, a3, a4)); } - protected Object invoke_L(Object a0, Object a1, int a2, int a3, int a4) { return return_L(targetA5(a0, a1, a2, a3, a4)); } - protected int invoke_I(Object a0, Object a1, int a2, int a3, int a4) { return return_I(targetA5(a0, a1, a2, a3, a4)); } - protected long invoke_J(Object a0, Object a1, int a2, int a3, int a4) { return return_J(targetA5(a0, a1, a2, a3, a4)); } - protected Object invoke_L(Object a0, int a1, int a2, int a3, int a4) { return return_L(targetA5(a0, a1, a2, a3, a4)); } - protected int invoke_I(Object a0, int a1, int a2, int a3, int a4) { return return_I(targetA5(a0, a1, a2, a3, a4)); } - protected long invoke_J(Object a0, int a1, int a2, int a3, int a4) { return return_J(targetA5(a0, a1, a2, a3, a4)); } - protected Object invoke_L(int a0, int a1, int a2, int a3, int a4) { return return_L(targetA5(a0, a1, a2, a3, a4)); } - protected int invoke_I(int a0, int a1, int a2, int a3, int a4) { return return_I(targetA5(a0, a1, a2, a3, a4)); } - protected long invoke_J(int a0, int a1, int a2, int a3, int a4) { return return_J(targetA5(a0, a1, a2, a3, a4)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long a4) { return return_L(targetA5(a0, a1, a2, a3, a4)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, long a4) { return return_I(targetA5(a0, a1, a2, a3, a4)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, long a4) { return return_J(targetA5(a0, a1, a2, a3, a4)); } - protected Object invoke_L(Object a0, Object a1, Object a2, long a3, long a4) { return return_L(targetA5(a0, a1, a2, a3, a4)); } - protected int invoke_I(Object a0, Object a1, Object a2, long a3, long a4) { return return_I(targetA5(a0, a1, a2, a3, a4)); } - protected long invoke_J(Object a0, Object a1, Object a2, long a3, long a4) { return return_J(targetA5(a0, a1, a2, a3, a4)); } - protected Object invoke_L(Object a0, Object a1, long a2, long a3, long a4) { return return_L(targetA5(a0, a1, a2, a3, a4)); } - protected int invoke_I(Object a0, Object a1, long a2, long a3, long a4) { return return_I(targetA5(a0, a1, a2, a3, a4)); } - protected long invoke_J(Object a0, Object a1, long a2, long a3, long a4) { return return_J(targetA5(a0, a1, a2, a3, a4)); } - protected Object invoke_L(Object a0, long a1, long a2, long a3, long a4) { return return_L(targetA5(a0, a1, a2, a3, a4)); } - protected int invoke_I(Object a0, long a1, long a2, long a3, long a4) { return return_I(targetA5(a0, a1, a2, a3, a4)); } - protected long invoke_J(Object a0, long a1, long a2, long a3, long a4) { return return_J(targetA5(a0, a1, a2, a3, a4)); } - protected Object invoke_L(long a0, long a1, long a2, long a3, long a4) { return return_L(targetA5(a0, a1, a2, a3, a4)); } - protected int invoke_I(long a0, long a1, long a2, long a3, long a4) { return return_I(targetA5(a0, a1, a2, a3, a4)); } - protected long invoke_J(long a0, long a1, long a2, long a3, long a4) { return return_J(targetA5(a0, a1, a2, a3, a4)); } + protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return invoker.invoke(target, a0, a1, a2, a3, a4); } + protected Object targetA5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return target(a0, a1, a2, a3, a4); } + protected Object targetA5(Object a0, Object a1, Object a2, Object a3, int a4) throws Throwable { return target(a0, a1, a2, a3, a4); } + protected Object targetA5(Object a0, Object a1, Object a2, int a3, int a4) throws Throwable { return target(a0, a1, a2, a3, a4); } + protected Object targetA5(Object a0, Object a1, int a2, int a3, int a4) throws Throwable { return target(a0, a1, a2, a3, a4); } + protected Object targetA5(Object a0, int a1, int a2, int a3, int a4) throws Throwable { return target(a0, a1, a2, a3, a4); } + protected Object targetA5(int a0, int a1, int a2, int a3, int a4) throws Throwable { return target(a0, a1, a2, a3, a4); } + protected Object targetA5(Object a0, Object a1, Object a2, Object a3, long a4) throws Throwable { return target(a0, a1, a2, a3, a4); } + protected Object targetA5(Object a0, Object a1, Object a2, long a3, long a4) throws Throwable { return target(a0, a1, a2, a3, a4); } + protected Object targetA5(Object a0, Object a1, long a2, long a3, long a4) throws Throwable { return target(a0, a1, a2, a3, a4); } + protected Object targetA5(Object a0, long a1, long a2, long a3, long a4) throws Throwable { return target(a0, a1, a2, a3, a4); } + protected Object targetA5(long a0, long a1, long a2, long a3, long a4) throws Throwable { return target(a0, a1, a2, a3, a4); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } } //params=[6, 10, 2, 99, 0, 99] static class A6 extends Adapter { protected A6(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A6(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A6 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A6(e, i, c, t); } - protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) { return invoker.invoke(target, a0, a1, a2, a3, a4, a5); } - protected Object targetA6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) { return target(a0, a1, a2, a3, a4, a5); } - protected Object targetA6(Object a0, Object a1, Object a2, Object a3, Object a4, long a5) { return target(a0, a1, a2, a3, a4, a5); } - protected Object targetA6(Object a0, Object a1, Object a2, Object a3, long a4, long a5) { return target(a0, a1, a2, a3, a4, a5); } - protected Object targetA6(Object a0, Object a1, Object a2, long a3, long a4, long a5) { return target(a0, a1, a2, a3, a4, a5); } - protected Object targetA6(Object a0, Object a1, long a2, long a3, long a4, long a5) { return target(a0, a1, a2, a3, a4, a5); } - protected Object targetA6(Object a0, long a1, long a2, long a3, long a4, long a5) { return target(a0, a1, a2, a3, a4, a5); } - protected Object targetA6(long a0, long a1, long a2, long a3, long a4, long a5) { return target(a0, a1, a2, a3, a4, a5); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, long a5) { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, long a5) { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, long a5) { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long a4, long a5) { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, long a4, long a5) { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, long a4, long a5) { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); } - protected Object invoke_L(Object a0, Object a1, Object a2, long a3, long a4, long a5) { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); } - protected int invoke_I(Object a0, Object a1, Object a2, long a3, long a4, long a5) { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); } - protected long invoke_J(Object a0, Object a1, Object a2, long a3, long a4, long a5) { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); } - protected Object invoke_L(Object a0, Object a1, long a2, long a3, long a4, long a5) { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); } - protected int invoke_I(Object a0, Object a1, long a2, long a3, long a4, long a5) { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); } - protected long invoke_J(Object a0, Object a1, long a2, long a3, long a4, long a5) { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); } - protected Object invoke_L(Object a0, long a1, long a2, long a3, long a4, long a5) { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); } - protected int invoke_I(Object a0, long a1, long a2, long a3, long a4, long a5) { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); } - protected long invoke_J(Object a0, long a1, long a2, long a3, long a4, long a5) { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); } - protected Object invoke_L(long a0, long a1, long a2, long a3, long a4, long a5) { return return_L(targetA6(a0, a1, a2, a3, a4, a5)); } - protected int invoke_I(long a0, long a1, long a2, long a3, long a4, long a5) { return return_I(targetA6(a0, a1, a2, a3, a4, a5)); } - protected long invoke_J(long a0, long a1, long a2, long a3, long a4, long a5) { return return_J(targetA6(a0, a1, a2, a3, a4, a5)); } + protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return invoker.invoke(target, a0, a1, a2, a3, a4, a5); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } } static class A7 extends Adapter { protected A7(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A7(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A7 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A7(e, i, c, t); } - protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) { return invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6); } - protected Object targetA7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) { return target(a0, a1, a2, a3, a4, a5, a6); } - protected Object targetA7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6) { return target(a0, a1, a2, a3, a4, a5, a6); } - protected Object targetA7(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6) { return target(a0, a1, a2, a3, a4, a5, a6); } - protected Object targetA7(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6) { return target(a0, a1, a2, a3, a4, a5, a6); } - protected Object targetA7(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6) { return target(a0, a1, a2, a3, a4, a5, a6); } - protected Object targetA7(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6) { return target(a0, a1, a2, a3, a4, a5, a6); } - protected Object targetA7(Object a0, long a1, long a2, long a3, long a4, long a5, long a6) { return target(a0, a1, a2, a3, a4, a5, a6); } - protected Object targetA7(long a0, long a1, long a2, long a3, long a4, long a5, long a6) { return target(a0, a1, a2, a3, a4, a5, a6); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6) { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6) { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6) { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6) { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6) { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6) { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6) { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6) { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6) { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected Object invoke_L(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6) { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected int invoke_I(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6) { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected long invoke_J(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6) { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected Object invoke_L(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6) { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected int invoke_I(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6) { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected long invoke_J(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6) { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected Object invoke_L(Object a0, long a1, long a2, long a3, long a4, long a5, long a6) { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected int invoke_I(Object a0, long a1, long a2, long a3, long a4, long a5, long a6) { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected long invoke_J(Object a0, long a1, long a2, long a3, long a4, long a5, long a6) { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected Object invoke_L(long a0, long a1, long a2, long a3, long a4, long a5, long a6) { return return_L(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected int invoke_I(long a0, long a1, long a2, long a3, long a4, long a5, long a6) { return return_I(targetA7(a0, a1, a2, a3, a4, a5, a6)); } - protected long invoke_J(long a0, long a1, long a2, long a3, long a4, long a5, long a6) { return return_J(targetA7(a0, a1, a2, a3, a4, a5, a6)); } + protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } } static class A8 extends Adapter { protected A8(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A8(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A8 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A8(e, i, c, t); } - protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) { return invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7); } - protected Object targetA8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) { return target(a0, a1, a2, a3, a4, a5, a6, a7); } - protected Object targetA8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7) { return target(a0, a1, a2, a3, a4, a5, a6, a7); } - protected Object targetA8(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7) { return target(a0, a1, a2, a3, a4, a5, a6, a7); } - protected Object targetA8(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7) { return target(a0, a1, a2, a3, a4, a5, a6, a7); } - protected Object targetA8(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7) { return target(a0, a1, a2, a3, a4, a5, a6, a7); } - protected Object targetA8(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7) { return target(a0, a1, a2, a3, a4, a5, a6, a7); } - protected Object targetA8(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7) { return target(a0, a1, a2, a3, a4, a5, a6, a7); } - protected Object targetA8(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) { return target(a0, a1, a2, a3, a4, a5, a6, a7); } - protected Object targetA8(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) { return target(a0, a1, a2, a3, a4, a5, a6, a7); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7) { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7) { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7) { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7) { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7) { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7) { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7) { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7) { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7) { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7) { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7) { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7) { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected Object invoke_L(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7) { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected int invoke_I(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7) { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected long invoke_J(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7) { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected Object invoke_L(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7) { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected int invoke_I(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7) { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected long invoke_J(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7) { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected Object invoke_L(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected int invoke_I(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected long invoke_J(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected Object invoke_L(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) { return return_L(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected int invoke_I(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) { return return_I(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } - protected long invoke_J(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7) { return return_J(targetA8(a0, a1, a2, a3, a4, a5, a6, a7)); } + protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7) throws Throwable { return invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } } static class A9 extends Adapter { protected A9(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A9(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A9 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A9(e, i, c, t); } - protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) { return invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8); } - protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); } - protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); } - protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); } - protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); } - protected Object targetA9(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); } - protected Object targetA9(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); } - protected Object targetA9(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); } - protected Object targetA9(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); } - protected Object targetA9(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); } - protected Object targetA9(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8) { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8) { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8) { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8) { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8) { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8) { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8) { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8) { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8) { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8) { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8) { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8) { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8) { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8) { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8) { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8) { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected Object invoke_L(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8) { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected int invoke_I(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8) { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected long invoke_J(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8) { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected Object invoke_L(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected int invoke_I(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected long invoke_J(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected Object invoke_L(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected int invoke_I(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected long invoke_J(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected Object invoke_L(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) { return return_L(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected int invoke_I(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) { return return_I(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } - protected long invoke_J(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8) { return return_J(targetA9(a0, a1, a2, a3, a4, a5, a6, a7, a8)); } + 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.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } } static class A10 extends Adapter { protected A10(MethodHandle entryPoint) { super(entryPoint); } // to build prototype protected A10(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { super(e, i, c, t); } protected A10 makeInstance(MethodHandle e, MethodHandle i, MethodHandle c, MethodHandle t) { return new A10(e, i, c, t); } - protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) { return invoker.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } - protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } - protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, long a9) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } - protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8, long a9) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } - protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8, long a9) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } - protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8, long a9) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } - protected Object targetA10(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8, long a9) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } - protected Object targetA10(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8, long a9) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } - protected Object targetA10(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } - protected Object targetA10(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } - protected Object targetA10(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } - protected Object targetA10(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) { return target(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, long a9) { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, long a9) { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, Object a8, long a9) { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8, long a9) { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8, long a9) { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7, long a8, long a9) { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8, long a9) { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8, long a9) { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, long a7, long a8, long a9) { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8, long a9) { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8, long a9) { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, long a6, long a7, long a8, long a9) { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8, long a9) { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8, long a9) { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, Object a4, long a5, long a6, long a7, long a8, long a9) { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected Object invoke_L(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8, long a9) { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected int invoke_I(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8, long a9) { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected long invoke_J(Object a0, Object a1, Object a2, Object a3, long a4, long a5, long a6, long a7, long a8, long a9) { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected Object invoke_L(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected int invoke_I(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected long invoke_J(Object a0, Object a1, Object a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected Object invoke_L(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected int invoke_I(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected long invoke_J(Object a0, Object a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected Object invoke_L(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected int invoke_I(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected long invoke_J(Object a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected Object invoke_L(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) { return return_L(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected int invoke_I(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) { return return_I(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } - protected long invoke_J(long a0, long a1, long a2, long a3, long a4, long a5, long a6, long a7, long a8, long a9) { return return_J(targetA10(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); } + 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.invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } + 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)); } } } diff --git a/jdk/src/share/classes/sun/dyn/empty/Empty.java b/jdk/src/share/classes/sun/dyn/empty/Empty.java index 4fb72d0be67..df1ce6b7819 100644 --- a/jdk/src/share/classes/sun/dyn/empty/Empty.java +++ b/jdk/src/share/classes/sun/dyn/empty/Empty.java @@ -29,6 +29,10 @@ package sun.dyn.empty; * An empty class in an empty package. * Used as a proxy for unprivileged code, since making access checks * against it will only succeed against public methods in public types. + *

      + * This class also stands (internally to sun.dyn) for the type of a + * value that cannot be produced, because the expression of this type + * always returns abnormally. (Cf. Nothing in the closures proposal.) * @author jrose */ public class Empty { diff --git a/jdk/src/share/classes/sun/dyn/util/BytecodeSignature.java b/jdk/src/share/classes/sun/dyn/util/BytecodeDescriptor.java similarity index 98% rename from jdk/src/share/classes/sun/dyn/util/BytecodeSignature.java rename to jdk/src/share/classes/sun/dyn/util/BytecodeDescriptor.java index 37d8708cb29..290f2fb431b 100644 --- a/jdk/src/share/classes/sun/dyn/util/BytecodeSignature.java +++ b/jdk/src/share/classes/sun/dyn/util/BytecodeDescriptor.java @@ -33,9 +33,9 @@ import java.util.List; * Utility routines for dealing with bytecode-level signatures. * @author jrose */ -public class BytecodeSignature { +public class BytecodeDescriptor { - private BytecodeSignature() { } // cannot instantiate + private BytecodeDescriptor() { } // cannot instantiate public static List> parseMethod(String bytecodeSignature, ClassLoader loader) { return parseMethod(bytecodeSignature, 0, bytecodeSignature.length(), loader); diff --git a/jdk/src/share/classes/sun/dyn/util/BytecodeName.java b/jdk/src/share/classes/sun/dyn/util/BytecodeName.java index 2abe780a5ef..e037e699530 100644 --- a/jdk/src/share/classes/sun/dyn/util/BytecodeName.java +++ b/jdk/src/share/classes/sun/dyn/util/BytecodeName.java @@ -298,6 +298,8 @@ public class BytecodeName { * The name {@code <init>} will be parsed into { '<', "init", '>'}} * The name {@code foo/bar$:baz} will be parsed into * {@code {"foo", '/', "bar", '$', ':', "baz"}}. + * The name {@code ::\=:foo:\=bar\!baz} will be parsed into + * {@code {':', ':', "", ':', "foo", ':', "bar:baz"}}. */ public static Object[] parseBytecodeName(String s) { int slen = s.length(); @@ -315,7 +317,7 @@ public class BytecodeName { if (lasti < i) { // normal component if (pass != 0) - res[fillp] = s.substring(lasti, i); + res[fillp] = toSourceName(s.substring(lasti, i)); fillp++; lasti = i+1; } @@ -323,13 +325,14 @@ public class BytecodeName { if (pass != 0) res[fillp] = DANGEROUS_CHARS_CA[whichDC]; fillp++; + lasti = i+1; } } if (pass != 0) break; // between passes, build the result array - res = new String[fillp]; - if (fillp <= 1) { - if (fillp != 0) res[0] = s; + res = new Object[fillp]; + if (fillp <= 1 && lasti == 0) { + if (fillp != 0) res[0] = toSourceName(s); break; } } @@ -348,9 +351,19 @@ public class BytecodeName { * @throws NullPointerException if any component is null */ public static String unparseBytecodeName(Object[] components) { - for (Object c : components) { - if (c instanceof String) - checkSafeBytecodeName((String) c); // may fail + Object[] components0 = components; + for (int i = 0; i < components.length; i++) { + Object c = components[i]; + if (c instanceof String) { + String mc = toBytecodeName((String) c); + if (i == 0 && components.length == 1) + return mc; // usual case + if ((Object)mc != c) { + if (components == components0) + components = components.clone(); + components[i] = c = mc; + } + } } return appendAll(components); } @@ -381,6 +394,14 @@ public class BytecodeName { * If the bytecode name contains dangerous characters, * assume that they are being used as punctuation, * and pass them through unchanged. + * Non-empty runs of non-dangerous characters are demangled + * if necessary, and the resulting names are quoted if + * they are not already valid Java identifiers, or if + * they contain a dangerous character (i.e., dollar sign "$"). + * Single quotes are used when quoting. + * Within quoted names, embedded single quotes and backslashes + * are further escaped by prepended backslashes. + * * @param s the original bytecode name (which may be qualified) * @return a human-readable presentation */ @@ -389,10 +410,10 @@ public class BytecodeName { for (int i = 0; i < components.length; i++) { if (!(components[i] instanceof String)) continue; - String c = (String) components[i]; - // pretty up the name by demangling it - String sn = toSourceName(c); - if ((Object)sn != c || !isJavaIdent(sn)) { + String sn = (String) components[i]; + // note that the name is already demangled! + //sn = toSourceName(sn); + if (!isJavaIdent(sn) || sn.indexOf('$') >=0 ) { components[i] = quoteDisplay(sn); } } @@ -401,10 +422,10 @@ public class BytecodeName { private static boolean isJavaIdent(String s) { int slen = s.length(); if (slen == 0) return false; - if (!Character.isUnicodeIdentifierStart(s.charAt(0))) + if (!Character.isJavaIdentifierStart(s.charAt(0))) return false; for (int i = 1; i < slen; i++) { - if (!Character.isUnicodeIdentifierPart(s.charAt(0))) + if (!Character.isJavaIdentifierPart(s.charAt(i))) return false; } return true; @@ -602,110 +623,5 @@ public class BytecodeName { return -1; } - // test driver - static void main(String[] av) { - // If verbose is enabled, quietly check everything. - // Otherwise, print the output for the user to check. - boolean verbose = false; - int maxlen = 0; - - while (av.length > 0 && av[0].startsWith("-")) { - String flag = av[0].intern(); - av = java.util.Arrays.copyOfRange(av, 1, av.length); // Java 1.6 or later - if (flag == "-" || flag == "--") break; - else if (flag == "-q") - verbose = false; - else if (flag == "-v") - verbose = true; - else if (flag.startsWith("-l")) - maxlen = Integer.valueOf(flag.substring(2)); - else - throw new Error("Illegal flag argument: "+flag); - } - - if (maxlen == 0) - maxlen = (verbose ? 2 : 4); - if (verbose) System.out.println("Note: maxlen = "+maxlen); - - switch (av.length) { - case 0: av = new String[] { - DANGEROUS_CHARS.substring(0) + - REPLACEMENT_CHARS.substring(0, 1) + - NULL_ESCAPE + "x" - }; // and fall through: - case 1: - char[] cv = av[0].toCharArray(); - av = new String[cv.length]; - int avp = 0; - for (char c : cv) { - String s = String.valueOf(c); - if (c == 'x') s = "foo"; // tradition... - av[avp++] = s; - } - } - if (verbose) - System.out.println("Note: Verbose output mode enabled. Use '-q' to suppress."); - Tester t = new Tester(); - t.maxlen = maxlen; - t.verbose = verbose; - t.tokens = av; - t.test("", 0); - } - - static class Tester { - boolean verbose; - int maxlen; - java.util.Map map = new java.util.HashMap(); - String[] tokens; - - void test(String stringSoFar, int tokensSoFar) { - test(stringSoFar); - if (tokensSoFar <= maxlen) { - for (String token : tokens) { - if (token.length() == 0) continue; // skip empty tokens - if (stringSoFar.indexOf(token) != stringSoFar.lastIndexOf(token)) - continue; // there are already two occs. of this token - if (token.charAt(0) == ESCAPE_C && token.length() == 1 && maxlen < 4) - test(stringSoFar+token, tokensSoFar); // want lots of \'s - else if (tokensSoFar < maxlen) - test(stringSoFar+token, tokensSoFar+1); - } - } - } - - void test(String s) { - // for small batches, do not test the null string - if (s.length() == 0 && maxlen >=1 && maxlen <= 2) return; - String bn = testSourceName(s); - if (bn == null) return; - if (bn == s) { - //if (verbose) System.out.println(s+" == id"); - } else { - if (verbose) System.out.println(s+" => "+bn+" "+toDisplayName(bn)); - String bnbn = testSourceName(bn); - if (bnbn == null) return; - if (verbose) System.out.println(bn+" => "+bnbn+" "+toDisplayName(bnbn)); - /* - String bn3 = testSourceName(bnbn); - if (bn3 == null) return; - if (verbose) System.out.println(bnbn+" => "+bn3); - */ - } - } - - String testSourceName(String s) { - if (map.containsKey(s)) return null; - String bn = toBytecodeName(s); - map.put(s, bn); - String sn = toSourceName(bn); - if (!sn.equals(s)) { - String bad = (s+" => "+bn+" != "+sn); - if (!verbose) throw new Error("Bad mangling: "+bad); - System.out.println("*** "+bad); - return null; - } - return bn; - } - } } diff --git a/jdk/src/share/classes/sun/dyn/util/ValueConversions.java b/jdk/src/share/classes/sun/dyn/util/ValueConversions.java index 817c1c5cc29..9a8bd8fdadd 100644 --- a/jdk/src/share/classes/sun/dyn/util/ValueConversions.java +++ b/jdk/src/share/classes/sun/dyn/util/ValueConversions.java @@ -27,7 +27,10 @@ package sun.dyn.util; import java.dyn.*; import java.dyn.MethodHandles.Lookup; +import java.util.ArrayList; +import java.util.Arrays; import java.util.EnumMap; +import java.util.List; import sun.dyn.Access; import sun.dyn.AdapterMethodHandle; import sun.dyn.MethodHandleImpl; @@ -37,6 +40,7 @@ public class ValueConversions { private static final Lookup IMPL_LOOKUP = MethodHandleImpl.getLookup(IMPL_TOKEN); private static EnumMap[] newWrapperCaches(int n) { + @SuppressWarnings("unchecked") EnumMap[] caches = (EnumMap[]) new EnumMap[n]; // unchecked warning expected here for (int i = 0; i < n; i++) @@ -114,7 +118,7 @@ public class ValueConversions { } private static MethodType unboxType(Wrapper wrap, boolean raw) { - return MethodType.make(rawWrapper(wrap, raw).primitiveType(), wrap.wrapperType()); + return MethodType.methodType(rawWrapper(wrap, raw).primitiveType(), wrap.wrapperType()); } private static final EnumMap[] @@ -240,7 +244,7 @@ public class ValueConversions { private static MethodType boxType(Wrapper wrap, boolean raw) { // be exact, since return casts are hard to compose Class boxType = wrap.wrapperType(); - return MethodType.make(boxType, rawWrapper(wrap, raw).primitiveType()); + return MethodType.methodType(boxType, rawWrapper(wrap, raw).primitiveType()); } private static Wrapper rawWrapper(Wrapper wrap, boolean raw) { @@ -305,29 +309,47 @@ public class ValueConversions { /// Kludges for when raw values get accidentally boxed. + static int unboxRawInteger(Object x) { + if (x instanceof Integer) + return unboxInteger(x); + else + return (int) unboxLong(x); + } + + static Integer reboxRawInteger(Object x) { + if (x instanceof Integer) + return (Integer) x; + else + return (int) unboxLong(x); + } + static Byte reboxRawByte(Object x) { if (x instanceof Byte) return (Byte) x; - return boxByteRaw(unboxInteger(x)); + return boxByteRaw(unboxRawInteger(x)); } static Short reboxRawShort(Object x) { if (x instanceof Short) return (Short) x; - return boxShortRaw(unboxInteger(x)); + return boxShortRaw(unboxRawInteger(x)); } static Boolean reboxRawBoolean(Object x) { if (x instanceof Boolean) return (Boolean) x; - return boxBooleanRaw(unboxInteger(x)); + return boxBooleanRaw(unboxRawInteger(x)); } static Character reboxRawCharacter(Object x) { if (x instanceof Character) return (Character) x; - return boxCharacterRaw(unboxInteger(x)); + return boxCharacterRaw(unboxRawInteger(x)); } static Float reboxRawFloat(Object x) { if (x instanceof Float) return (Float) x; - return boxFloatRaw(unboxInteger(x)); + return boxFloatRaw(unboxRawInteger(x)); + } + + static Long reboxRawLong(Object x) { + return (Long) x; //never a rebox } static Double reboxRawDouble(Object x) { @@ -337,12 +359,21 @@ public class ValueConversions { private static MethodType reboxType(Wrapper wrap) { Class boxType = wrap.wrapperType(); - return MethodType.make(boxType, Object.class); + return MethodType.methodType(boxType, Object.class); } private static final EnumMap[] REBOX_CONVERSIONS = newWrapperCaches(2); + /** + * Becase we normalize primitive types to reduce the number of signatures, + * primitives are sometimes manipulated under an "erased" type, + * either int (for types other than long/double) or long (for all types). + * When the erased primitive value is then boxed into an Integer or Long, + * the final boxed primitive is sometimes required. This transformation + * is called a "rebox". It takes an Integer or Long and produces some + * other boxed value. + */ public static MethodHandle rebox(Wrapper wrap, boolean exact) { EnumMap cache = REBOX_CONVERSIONS[exact?1:0]; MethodHandle mh = cache.get(wrap); @@ -355,9 +386,6 @@ public class ValueConversions { mh = IDENTITY; break; case VOID: throw new IllegalArgumentException("cannot rebox a void"); - case INT: case LONG: - mh = cast(wrap.wrapperType(), exact); - break; } if (mh != null) { cache.put(wrap, mh); @@ -384,13 +412,21 @@ public class ValueConversions { /// Width-changing conversions between int and long. static long widenInt(int x) { - return x; + return (long) x; + } + + static Long widenBoxedInt(Integer x) { + return (long)(int)x; } static int narrowLong(long x) { return (int) x; } + static Integer narrowBoxedLong(Long x) { + return (int)(long) x; + } + /// Constant functions static void ignore(Object x) { @@ -432,7 +468,7 @@ public class ValueConversions { return mh; } // slow path - MethodType type = MethodType.make(wrap.primitiveType()); + MethodType type = MethodType.methodType(wrap.primitiveType()); switch (wrap) { case VOID: mh = EMPTY; @@ -500,11 +536,11 @@ public class ValueConversions { private static final MethodHandle IDENTITY, CAST_REFERENCE, ALWAYS_NULL, ALWAYS_ZERO, ZERO_OBJECT, IGNORE, EMPTY; static { try { - MethodType idType = MethodType.makeGeneric(1); - MethodType castType = idType.insertParameterType(0, Class.class); + MethodType idType = MethodType.genericMethodType(1); + MethodType castType = idType.insertParameterTypes(0, Class.class); MethodType alwaysZeroType = idType.changeReturnType(int.class); MethodType ignoreType = idType.changeReturnType(void.class); - MethodType zeroObjectType = MethodType.makeGeneric(0); + MethodType zeroObjectType = MethodType.genericMethodType(0); IDENTITY = IMPL_LOOKUP.findStatic(ValueConversions.class, "identity", idType); //CAST_REFERENCE = IMPL_LOOKUP.findVirtual(Class.class, "cast", idType); CAST_REFERENCE = IMPL_LOOKUP.findStatic(ValueConversions.class, "castReference", castType); @@ -512,7 +548,7 @@ public class ValueConversions { ALWAYS_ZERO = IMPL_LOOKUP.findStatic(ValueConversions.class, "alwaysZero", alwaysZeroType); ZERO_OBJECT = IMPL_LOOKUP.findStatic(ValueConversions.class, "zeroObject", zeroObjectType); IGNORE = IMPL_LOOKUP.findStatic(ValueConversions.class, "ignore", ignoreType); - EMPTY = IMPL_LOOKUP.findStatic(ValueConversions.class, "empty", ignoreType.dropParameterType(0)); + EMPTY = IMPL_LOOKUP.findStatic(ValueConversions.class, "empty", ignoreType.dropParameterTypes(0, 1)); } catch (RuntimeException ex) { throw ex; } @@ -543,10 +579,10 @@ public class ValueConversions { else if (VerifyType.isNullType(type)) mh = ALWAYS_NULL; else - mh = MethodHandles.insertArgument(CAST_REFERENCE, 0, type); + mh = MethodHandles.insertArguments(CAST_REFERENCE, 0, type); if (exact) { - MethodType xmt = MethodType.make(type, Object.class); - mh = AdapterMethodHandle.makeRawRetypeOnly(IMPL_TOKEN, xmt, mh); + MethodType xmt = MethodType.methodType(type, Object.class); + mh = AdapterMethodHandle.makeRetypeRaw(IMPL_TOKEN, xmt, mh); } if (cache != null) cache.put(wrap, mh); @@ -560,4 +596,127 @@ public class ValueConversions { private static MethodHandle retype(MethodType type, MethodHandle mh) { return AdapterMethodHandle.makeRetypeOnly(IMPL_TOKEN, type, mh); } + + private static final Object[] NO_ARGS_ARRAY = {}; + private static Object[] makeArray(Object... args) { return args; } + private static Object[] array() { return NO_ARGS_ARRAY; } + private static Object[] array(Object a0) + { return makeArray(a0); } + private static Object[] array(Object a0, Object a1) + { return makeArray(a0, a1); } + private static Object[] array(Object a0, Object a1, Object a2) + { return makeArray(a0, a1, a2); } + private static Object[] array(Object a0, Object a1, Object a2, Object a3) + { return makeArray(a0, a1, a2, a3); } + private static Object[] array(Object a0, Object a1, Object a2, Object a3, + Object a4) + { return makeArray(a0, a1, a2, a3, a4); } + private static Object[] array(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) + { return makeArray(a0, a1, a2, a3, a4, a5); } + private static Object[] array(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) + { return makeArray(a0, a1, a2, a3, a4, a5, a6); } + private static Object[] array(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) + { return makeArray(a0, a1, a2, a3, a4, a5, a6, a7); } + private static Object[] array(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) + { return makeArray(a0, a1, a2, a3, a4, a5, a6, a7, a8); } + private static Object[] array(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) + { return makeArray(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } + static MethodHandle[] makeArrays() { + ArrayList arrays = new ArrayList(); + MethodHandles.Lookup lookup = IMPL_LOOKUP; + for (;;) { + int nargs = arrays.size(); + MethodType type = MethodType.genericMethodType(nargs).changeReturnType(Object[].class); + String name = "array"; + MethodHandle array = null; + try { + array = lookup.findStatic(ValueConversions.class, name, type); + } catch (NoAccessException ex) { + } + if (array == null) break; + arrays.add(array); + } + assert(arrays.size() == 11); // current number of methods + return arrays.toArray(new MethodHandle[0]); + } + static final MethodHandle[] ARRAYS = makeArrays(); + + /** Return a method handle that takes the indicated number of Object + * arguments and returns an Object array of them, as if for varargs. + */ + public static MethodHandle varargsArray(int nargs) { + if (nargs < ARRAYS.length) + return ARRAYS[nargs]; + // else need to spin bytecode or do something else fancy + throw new UnsupportedOperationException("NYI"); + } + + private static final List NO_ARGS_LIST = Arrays.asList(NO_ARGS_ARRAY); + private static List makeList(Object... args) { return Arrays.asList(args); } + private static List list() { return NO_ARGS_LIST; } + private static List list(Object a0) + { return makeList(a0); } + private static List list(Object a0, Object a1) + { return makeList(a0, a1); } + private static List list(Object a0, Object a1, Object a2) + { return makeList(a0, a1, a2); } + private static List list(Object a0, Object a1, Object a2, Object a3) + { return makeList(a0, a1, a2, a3); } + private static List list(Object a0, Object a1, Object a2, Object a3, + Object a4) + { return makeList(a0, a1, a2, a3, a4); } + private static List list(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) + { return makeList(a0, a1, a2, a3, a4, a5); } + private static List list(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) + { return makeList(a0, a1, a2, a3, a4, a5, a6); } + private static List list(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) + { return makeList(a0, a1, a2, a3, a4, a5, a6, a7); } + private static List list(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) + { return makeList(a0, a1, a2, a3, a4, a5, a6, a7, a8); } + private static List list(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) + { return makeList(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } + static MethodHandle[] makeLists() { + ArrayList arrays = new ArrayList(); + MethodHandles.Lookup lookup = IMPL_LOOKUP; + for (;;) { + int nargs = arrays.size(); + MethodType type = MethodType.genericMethodType(nargs).changeReturnType(List.class); + String name = "list"; + MethodHandle array = null; + try { + array = lookup.findStatic(ValueConversions.class, name, type); + } catch (NoAccessException ex) { + } + if (array == null) break; + arrays.add(array); + } + assert(arrays.size() == 11); // current number of methods + return arrays.toArray(new MethodHandle[0]); + } + static final MethodHandle[] LISTS = makeLists(); + + /** Return a method handle that takes the indicated number of Object + * arguments and returns List. + */ + public static MethodHandle varargsList(int nargs) { + if (nargs < LISTS.length) + return LISTS[nargs]; + // else need to spin bytecode or do something else fancy + throw new UnsupportedOperationException("NYI"); + } } + diff --git a/jdk/src/share/classes/sun/dyn/util/VerifyAccess.java b/jdk/src/share/classes/sun/dyn/util/VerifyAccess.java index 8bee85017ba..aec90d54e6c 100644 --- a/jdk/src/share/classes/sun/dyn/util/VerifyAccess.java +++ b/jdk/src/share/classes/sun/dyn/util/VerifyAccess.java @@ -26,8 +26,12 @@ package sun.dyn.util; import java.dyn.LinkagePermission; +import java.dyn.MethodHandles.Lookup; +import java.dyn.NoAccessException; import java.lang.reflect.Modifier; -import sun.dyn.Access; +import sun.dyn.MemberName; +import sun.dyn.MethodHandleImpl; +import sun.dyn.empty.Empty; /** * This class centralizes information about the JVM's linkage access control. @@ -45,21 +49,21 @@ public class VerifyAccess { *

      * Some circumstances require an additional check on the * leading parameter (the receiver) of the method, if it is non-static. - * In the case of {@code invokespecial} ({@code doDispatch} is false), + * In the case of {@code invokespecial} ({@code isSpecialInvoke} is true), * the leading parameter must be the accessing class or a subclass. * In the case of a call to a {@code protected} method outside the same * package, the same constraint applies. * @param m the proposed callee - * @param doDispatch if false, a non-static m will be invoked as if by {@code invokespecial} + * @param isSpecialInvoke if true, a non-static method m is checked as if for {@code invokespecial} * @param lookupClass the class for which the access check is being made * @return null if the method is not accessible, else a receiver type constraint, else {@code Object.class} */ public static Class isAccessible(Class defc, int mods, - boolean doDispatch, Class lookupClass) { + Class lookupClass, boolean isSpecialInvoke) { if (!isAccessible(defc, lookupClass)) return null; Class constraint = Object.class; - if (!doDispatch && !Modifier.isStatic(mods)) { + if (isSpecialInvoke && !Modifier.isStatic(mods)) { constraint = lookupClass; } if (Modifier.isPublic(mods)) @@ -166,4 +170,38 @@ public class VerifyAccess { if (isSamePackage(requestingClass, subjectClass)) return; security.checkPermission(new LinkagePermission(permissionName, requestingClass)); } + + private static RuntimeException checkNameFailed(MemberName self, Lookup lookup, String comment) { + return new NoAccessException("cannot access from "+lookup+": "+self.toString()+": "+comment); + } + public static void checkName(MemberName self, Lookup lookup) { + Class lc = lookup.lookupClass(); + if (lc == null) return; // lookup is privileged + Class dc = self.getDeclaringClass(); + int samepkg = 0; + // First check the containing class. Must be public or local. + if (!Modifier.isPublic(dc.getModifiers())) { + if (lc != Empty.class) + samepkg = (isSamePackage(dc, lc) ? 1 : -1); + if (samepkg <= 0) + throw checkNameFailed(self, lookup, "class is not public"); + } + // At this point dc is known to be accessible. + if (self.isPublic()) { + return; + } else if (lc == Empty.class) { + throw checkNameFailed(self, lookup, "member is not public"); + } else if (self.isProtected()) { + if (dc.isAssignableFrom(lc)) return; + } else if (self.isPrivate()) { + if (isSamePackageMember(dc, lc)) return; + throw checkNameFailed(self, lookup, "member is private"); + } + // Fall-through handles the package-private and protected cases. + if (samepkg == 0) + samepkg = (isSamePackage(dc, lc) ? 1 : -1); + if (samepkg > 0) return; + throw checkNameFailed(self, lookup, + self.isProtected() ? "member is protected" : "member is private to package"); + } } diff --git a/jdk/src/share/classes/sun/dyn/util/VerifyType.java b/jdk/src/share/classes/sun/dyn/util/VerifyType.java index 9d12c74afa9..14b0827c00e 100644 --- a/jdk/src/share/classes/sun/dyn/util/VerifyType.java +++ b/jdk/src/share/classes/sun/dyn/util/VerifyType.java @@ -26,6 +26,7 @@ package sun.dyn.util; import java.dyn.MethodType; +import sun.dyn.empty.Empty; /** * This class centralizes information about the JVM verifier @@ -73,29 +74,28 @@ public class VerifyType { } /** - * Is the given type either java.lang.Void or java.lang.Null? - * These types serve as markers for bare nulls and therefore - * may be promoted to any type. This is secure, since + * Is the given type java.lang.Null or an equivalent null-only type? */ public static boolean isNullType(Class type) { if (type == null) return false; - return type == NULL_CLASS_1 || type == NULL_CLASS_2; + return type == NULL_CLASS + // This one may also be used as a null type. + // TO DO: Decide if we really want to legitimize it here. + // Probably we do, unless java.lang.Null really makes it into Java 7 + //|| type == Void.class + // Locally known null-only class: + || type == Empty.class + ; } - private static final Class NULL_CLASS_1, NULL_CLASS_2; + private static final Class NULL_CLASS; static { - Class nullClass1 = null, nullClass2 = null; + Class nullClass = null; try { - nullClass1 = Class.forName("java.lang.Null"); + nullClass = Class.forName("java.lang.Null"); } catch (ClassNotFoundException ex) { // OK, we'll cope } - NULL_CLASS_1 = nullClass1; - - // This one may also be used as a null type. - // TO DO: Decide if we really want to legitimize it here. - // Probably we do, unless java.lang.Null really makes it into Java 7 - nullClass2 = Void.class; - NULL_CLASS_2 = nullClass2; + NULL_CLASS = nullClass; } /** @@ -191,6 +191,11 @@ public class VerifyType { // to be captured as a garbage int. // Caller promises that the actual value will be disregarded. return dst == int.class ? 1 : 0; + if (isNullType(src)) + // Special permission for raw conversions: allow a null + // to be reinterpreted as anything. For objects, it is safe, + // and for primitives you get a garbage value (probably zero). + return 1; if (!src.isPrimitive()) return 0; Wrapper sw = Wrapper.forPrimitiveType(src); diff --git a/jdk/src/share/classes/sun/dyn/util/Wrapper.java b/jdk/src/share/classes/sun/dyn/util/Wrapper.java index 556fda3bc7b..84747080de7 100644 --- a/jdk/src/share/classes/sun/dyn/util/Wrapper.java +++ b/jdk/src/share/classes/sun/dyn/util/Wrapper.java @@ -141,13 +141,19 @@ public enum Wrapper { * @throws IllegalArgumentException for unexpected types */ public static Wrapper forPrimitiveType(Class type) { + Wrapper w = findPrimitiveType(type); + if (w != null) return w; + if (type.isPrimitive()) + throw new InternalError(); // redo hash function + throw newIllegalArgumentException("not primitive: "+type); + } + + static Wrapper findPrimitiveType(Class type) { Wrapper w = FROM_PRIM[hashPrim(type)]; if (w != null && w.primitiveType == type) { return w; } - if (type.isPrimitive()) - throw new InternalError(); // redo hash function - throw newIllegalArgumentException("not primitive: "+type); + return null; } /** Return the wrapper that wraps values into the given wrapper type. @@ -160,7 +166,7 @@ public enum Wrapper { Wrapper w = findWrapperType(type); if (w != null) return w; for (Wrapper x : values()) - if (w.wrapperType == type) + if (x.wrapperType == type) throw new InternalError(); // redo hash function throw newIllegalArgumentException("not wrapper: "+type); } @@ -244,8 +250,10 @@ public enum Wrapper { public Class wrapperType() { return wrapperType; } /** What is the wrapper type for this wrapper? - * The example type must be the wrapper type, + * Otherwise, the example type must be the wrapper type, * or the corresponding primitive type. + * (For {@code OBJECT}, the example type can be any non-primitive, + * and is normalized to {@code Object.class}.) * The resulting class type has the same type parameter. */ public Class wrapperType(Class exampleType) { @@ -290,6 +298,16 @@ public enum Wrapper { return type.isPrimitive(); } + /** What is the bytecode signature character for this type? + * All non-primitives, including array types, report as 'L', the signature character for references. + */ + public static char basicTypeChar(Class type) { + if (!type.isPrimitive()) + return 'L'; + else + return forPrimitiveType(type).basicTypeChar(); + } + /** What is the bytecode signature character for this wrapper's * primitive type? */ @@ -309,7 +327,7 @@ public enum Wrapper { /** Cast a wrapped value to the given type, which may be either a primitive or wrapper type. * Performs standard primitive conversions, including truncation and float conversions. * The given type must be compatible with this wrapper. That is, it must either - * be the wrapper type (or a subtype, in the case of {@code OBJECT} or else + * be the wrapper type (or a subtype, in the case of {@code OBJECT}) or else * it must be the wrapper's primitive type. * @throws ClassCastException if the given type is not compatible with this wrapper */ @@ -326,9 +344,17 @@ public enum Wrapper { * If the target type is a primitive, change it to a wrapper. */ static Class forceType(Class type, Class exampleType) { + boolean z = (type == exampleType || + type.isPrimitive() && forPrimitiveType(type) == findWrapperType(exampleType) || + exampleType.isPrimitive() && forPrimitiveType(exampleType) == findWrapperType(type) || + type == Object.class && !exampleType.isPrimitive()); + if (!z) + System.out.println(type+" <= "+exampleType); assert(type == exampleType || - type == asWrapperType(exampleType) || - type == Object.class && exampleType.isInterface()); + type.isPrimitive() && forPrimitiveType(type) == findWrapperType(exampleType) || + exampleType.isPrimitive() && forPrimitiveType(exampleType) == findWrapperType(type) || + type == Object.class && !exampleType.isPrimitive()); + @SuppressWarnings("unchecked") Class result = (Class) type; // unchecked warning is expected here return result; } diff --git a/jdk/src/share/classes/sun/font/FontManagerFactory.java b/jdk/src/share/classes/sun/font/FontManagerFactory.java index 44bfe68c541..a85fe3c007c 100644 --- a/jdk/src/share/classes/sun/font/FontManagerFactory.java +++ b/jdk/src/share/classes/sun/font/FontManagerFactory.java @@ -68,38 +68,34 @@ public final class FontManagerFactory { return instance; } - String fmClassName = AccessController.doPrivileged( - new GetPropertyAction("sun.font.fontmanager", - DEFAULT_CLASS)); + AccessController.doPrivileged(new PrivilegedAction() { - try { - @SuppressWarnings("unchecked") - ClassLoader cl = (ClassLoader) - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - return ClassLoader.getSystemClassLoader(); - } - }); + public Object run() { + try { + String fmClassName = + System.getProperty("sun.font.fontmanager", + DEFAULT_CLASS); + ClassLoader cl = ClassLoader.getSystemClassLoader(); + Class fmClass = Class.forName(fmClassName, true, cl); + instance = (FontManager) fmClass.newInstance(); + } catch (ClassNotFoundException ex) { + InternalError err = new InternalError(); + err.initCause(ex); + throw err; - @SuppressWarnings("unchecked") - Class fmClass = Class.forName(fmClassName, true, cl); - instance = (FontManager) fmClass.newInstance(); + } catch (InstantiationException ex) { + InternalError err = new InternalError(); + err.initCause(ex); + throw err; - } catch (ClassNotFoundException ex) { - InternalError err = new InternalError(); - err.initCause(ex); - throw err; - - } catch (InstantiationException ex) { - InternalError err = new InternalError(); - err.initCause(ex); - throw err; - - } catch (IllegalAccessException ex) { - InternalError err = new InternalError(); - err.initCause(ex); - throw err; - } + } catch (IllegalAccessException ex) { + InternalError err = new InternalError(); + err.initCause(ex); + throw err; + } + return null; + } + }); return instance; } diff --git a/jdk/src/share/classes/sun/font/FontUtilities.java b/jdk/src/share/classes/sun/font/FontUtilities.java index 0c492b4c732..6d10874deef 100644 --- a/jdk/src/share/classes/sun/font/FontUtilities.java +++ b/jdk/src/share/classes/sun/font/FontUtilities.java @@ -32,9 +32,9 @@ import java.io.FileInputStream; import java.io.InputStreamReader; import java.security.AccessController; +import java.security.PrivilegedAction; import javax.swing.plaf.FontUIResource; -import sun.security.action.GetPropertyAction; import sun.util.logging.PlatformLogger; /** @@ -42,79 +42,82 @@ import sun.util.logging.PlatformLogger; */ public final class FontUtilities { - public static final boolean isSolaris; + public static boolean isSolaris; - public static final boolean isLinux; + public static boolean isLinux; - public static final boolean isSolaris8; + public static boolean isSolaris8; - public static final boolean isSolaris9; + public static boolean isSolaris9; - public static final boolean isOpenSolaris; + public static boolean isOpenSolaris; - public static final boolean useT2K; + public static boolean useT2K; - public static final boolean isWindows; + public static boolean isWindows; - public static final boolean isOpenJDK; + public static boolean isOpenJDK; static final String LUCIDA_FILE_NAME = "LucidaSansRegular.ttf"; // This static initializer block figures out the OS constants. static { - String osName = AccessController.doPrivileged( - new GetPropertyAction("os.name", "unknownOS")); - isSolaris = osName.startsWith("SunOS"); + AccessController.doPrivileged(new PrivilegedAction () { + public Object run() { + String osName = System.getProperty("os.name", "unknownOS"); + isSolaris = osName.startsWith("SunOS"); - isLinux = osName.startsWith("Linux"); + isLinux = osName.startsWith("Linux"); - String t2kStr = AccessController.doPrivileged( - new GetPropertyAction("sun.java2d.font.scaler")); - if (t2kStr != null) { - useT2K = "t2k".equals(t2kStr); - } else { - useT2K = false; - } - if (isSolaris) { - String version = AccessController.doPrivileged( - new GetPropertyAction("os.version", "0.0")); - isSolaris8 = version.startsWith("5.8"); - isSolaris9 = version.startsWith("5.9"); - float ver = Float.parseFloat(version); - if (ver > 5.10f) { - File f = new File("/etc/release"); - String line = null; - try { - FileInputStream fis = new FileInputStream(f); - InputStreamReader isr = new InputStreamReader( - fis, "ISO-8859-1"); - BufferedReader br = new BufferedReader(isr); - line = br.readLine(); - fis.close(); - } catch (Exception ex) { - // Nothing to do here. - } - if (line != null && line.indexOf("OpenSolaris") >= 0) { - isOpenSolaris = true; + String t2kStr = System.getProperty("sun.java2d.font.scaler"); + if (t2kStr != null) { + useT2K = "t2k".equals(t2kStr); } else { + useT2K = false; + } + if (isSolaris) { + String version = System.getProperty("os.version", "0.0"); + isSolaris8 = version.startsWith("5.8"); + isSolaris9 = version.startsWith("5.9"); + float ver = Float.parseFloat(version); + if (ver > 5.10f) { + File f = new File("/etc/release"); + String line = null; + try { + FileInputStream fis = new FileInputStream(f); + InputStreamReader isr = new InputStreamReader( + fis, "ISO-8859-1"); + BufferedReader br = new BufferedReader(isr); + line = br.readLine(); + fis.close(); + } catch (Exception ex) { + // Nothing to do here. + } + if (line != null && line.indexOf("OpenSolaris") >= 0) { + isOpenSolaris = true; + } else { + isOpenSolaris = false; + } + } else { + isOpenSolaris = false; + } + } else { + isSolaris8 = false; + isSolaris9 = false; isOpenSolaris = false; } - } else { - isOpenSolaris= false; + isWindows = osName.startsWith("Windows"); + String jreLibDirName = System.getProperty("java.home", "") + + File.separator + "lib"; + String jreFontDirName = + jreLibDirName + File.separator + "fonts"; + File lucidaFile = new File(jreFontDirName + File.separator + + LUCIDA_FILE_NAME); + isOpenJDK = !lucidaFile.exists(); + return null; } - } else { - isSolaris8 = false; - isSolaris9 = false; - isOpenSolaris = false; - } - isWindows = osName.startsWith("Windows"); - String jreLibDirName = AccessController.doPrivileged( - new GetPropertyAction("java.home","")) + File.separator + "lib"; - String jreFontDirName = jreLibDirName + File.separator + "fonts"; - File lucidaFile = - new File(jreFontDirName + File.separator + LUCIDA_FILE_NAME); - isOpenJDK = !lucidaFile.exists(); + }); } /** diff --git a/jdk/src/share/classes/sun/font/StandardGlyphVector.java b/jdk/src/share/classes/sun/font/StandardGlyphVector.java index 347a44b88b7..9d26d91e444 100644 --- a/jdk/src/share/classes/sun/font/StandardGlyphVector.java +++ b/jdk/src/share/classes/sun/font/StandardGlyphVector.java @@ -396,12 +396,19 @@ public class StandardGlyphVector extends GlyphVector { // !!! not cached, assume TextLayout will cache if necessary public Rectangle2D getVisualBounds() { - if (glyphs.length == 0) { - return new Rectangle2D.Float(0, 0, 0, 0); + Rectangle2D result = null; + for (int i = 0; i < glyphs.length; ++i) { + Rectangle2D glyphVB = getGlyphVisualBounds(i).getBounds2D(); + if (!glyphVB.isEmpty()) { + if (result == null) { + result = glyphVB; + } else { + Rectangle2D.union(result, glyphVB, result); + } + } } - Rectangle2D result = getGlyphVisualBounds(0).getBounds2D(); - for (int i = 1; i < glyphs.length; ++i) { - Rectangle2D.union(result, getGlyphVisualBounds(i).getBounds2D(), result); + if (result == null) { + result = new Rectangle2D.Float(0, 0, 0, 0); } return result; } @@ -1787,8 +1794,19 @@ public class StandardGlyphVector extends GlyphVector { gp.transform(sgv.invdtx); result = gp.getBounds2D(); } - result.setRect(result.getMinX() + x + dx, result.getMinY() + y + dy, - result.getWidth(), result.getHeight()); + /* Since x is the logical advance of the glyph to this point. + * Because of the way that Rectangle.union is specified, this + * means that subsequent unioning of a rect including that + * will be affected, even if the glyph is empty. So skip such + * cases. This alone isn't a complete solution since x==0 + * may also not be what is wanted. The code that does the + * unioning also needs to be aware to ignore empty glyphs. + */ + if (!result.isEmpty()) { + result.setRect(result.getMinX() + x + dx, + result.getMinY() + y + dy, + result.getWidth(), result.getHeight()); + } return result; } diff --git a/jdk/src/share/classes/sun/font/SunFontManager.java b/jdk/src/share/classes/sun/font/SunFontManager.java index a10c549532b..923f1cc475b 100644 --- a/jdk/src/share/classes/sun/font/SunFontManager.java +++ b/jdk/src/share/classes/sun/font/SunFontManager.java @@ -3058,7 +3058,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE { return; } /* Use lock specific to the font system */ - synchronized (lucidaFontName) { + synchronized (this) { if (FontUtilities.debugFonts()) { Thread.dumpStack(); FontUtilities.getLogger() @@ -3194,7 +3194,7 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE { return; } /* Use lock specific to the font system */ - synchronized (lucidaFontName) { + synchronized (this) { if (FontUtilities.debugFonts()) { Thread.dumpStack(); FontUtilities.getLogger().info("loadAllFontFiles() called"); diff --git a/jdk/src/share/classes/sun/io/ByteToCharUTF8.java b/jdk/src/share/classes/sun/io/ByteToCharUTF8.java index 47da36bb4c9..bff6935a16d 100644 --- a/jdk/src/share/classes/sun/io/ByteToCharUTF8.java +++ b/jdk/src/share/classes/sun/io/ByteToCharUTF8.java @@ -113,7 +113,7 @@ public class ByteToCharUTF8 extends ByteToCharConverter { savedSize = 1; } else { savedSize = 2; - savedBytes[1] = (byte)input[byteOff++]; + savedBytes[1] = input[byteOff++]; } break; } @@ -135,11 +135,11 @@ public class ByteToCharUTF8 extends ByteToCharConverter { savedSize = 1; } else if (byteOff + 1 >= inEnd) { savedSize = 2; - savedBytes[1] = (byte)input[byteOff++]; + savedBytes[1] = input[byteOff++]; } else { savedSize = 3; - savedBytes[1] = (byte)input[byteOff++]; - savedBytes[2] = (byte)input[byteOff++]; + savedBytes[1] = input[byteOff++]; + savedBytes[2] = input[byteOff++]; } break; } @@ -154,10 +154,10 @@ public class ByteToCharUTF8 extends ByteToCharConverter { throw new MalformedInputException(); } // this byte sequence is UTF16 character - int ucs4 = (int)(0x07 & byte1) << 18 | - (int)(0x3f & byte2) << 12 | - (int)(0x3f & byte3) << 6 | - (int)(0x3f & byte4); + int ucs4 = (0x07 & byte1) << 18 | + (0x3f & byte2) << 12 | + (0x3f & byte3) << 6 | + (0x3f & byte4); outputChar[0] = (char)((ucs4 - 0x10000) / 0x400 + 0xd800); outputChar[1] = (char)((ucs4 - 0x10000) % 0x400 + 0xdc00); outputSize = 2; diff --git a/jdk/src/share/classes/sun/io/CharToByteUnicode.java b/jdk/src/share/classes/sun/io/CharToByteUnicode.java index 6409a7177cb..598cd026930 100644 --- a/jdk/src/share/classes/sun/io/CharToByteUnicode.java +++ b/jdk/src/share/classes/sun/io/CharToByteUnicode.java @@ -46,7 +46,7 @@ public class CharToByteUnicode extends CharToByteConverter { protected int byteOrder = UNKNOWN; public CharToByteUnicode() { - String enc = (String) java.security.AccessController.doPrivileged( + String enc = java.security.AccessController.doPrivileged( new sun.security.action.GetPropertyAction("sun.io.unicode.encoding", "UnicodeBig")); if (enc.equals("UnicodeBig")) diff --git a/jdk/src/share/classes/sun/io/CharacterEncoding.java b/jdk/src/share/classes/sun/io/CharacterEncoding.java index 73099d9acff..2a5ebefd0bd 100644 --- a/jdk/src/share/classes/sun/io/CharacterEncoding.java +++ b/jdk/src/share/classes/sun/io/CharacterEncoding.java @@ -50,11 +50,11 @@ public class CharacterEncoding { private static boolean sjisIsMS932; - private static Map aliasTable; + private static Map aliasTable; private static volatile boolean installedAll; static { - aliasTable = new HashMap(460, 1.0f); /* MDA */ + aliasTable = new HashMap<>(460, 1.0f); /* MDA */ aliasTable.put("us-ascii", "ASCII"); aliasTable.put("ascii", "ASCII"); @@ -119,11 +119,11 @@ public class CharacterEncoding { } // need to use Locale.US so we can load ISO converters in tr_TR locale String lower = name.toLowerCase(Locale.US); - String val = (String) aliasTable.get(lower); + String val = aliasTable.get(lower); if (val == null && !installedAll) { installAll(); - val = (String) aliasTable.get(lower); + val = aliasTable.get(lower); } return val; } @@ -131,7 +131,7 @@ public class CharacterEncoding { private static synchronized void installAll() { if (!installedAll) { GetPropertyAction a = new GetPropertyAction("sun.nio.cs.map"); - String map = ((String)AccessController.doPrivileged(a)); + String map = AccessController.doPrivileged(a); if (map != null) { sjisIsMS932 = map.equalsIgnoreCase("Windows-31J/Shift_JIS"); } else { @@ -857,9 +857,9 @@ public class CharacterEncoding { * Auto Detect converter. */ static String getSJISName() { - String encodeName = (String) AccessController.doPrivileged( - new PrivilegedAction() { - public Object run() { + String encodeName = AccessController.doPrivileged( + new PrivilegedAction() { + public String run() { String osName = System.getProperty("os.name"); if (osName.equals("Solaris") || osName.equals("SunOS")){ return "PCK"; @@ -880,9 +880,9 @@ public class CharacterEncoding { static String getEUCJPName() { - String encodeName = (String) AccessController.doPrivileged( - new PrivilegedAction() { - public Object run() { + String encodeName = AccessController.doPrivileged( + new PrivilegedAction() { + public String run() { String osName = System.getProperty("os.name"); if (osName.equals("Solaris") || osName.equals("SunOS")) return "eucJP-open"; diff --git a/jdk/src/share/classes/sun/io/Converters.java b/jdk/src/share/classes/sun/io/Converters.java index 9b6959b5d61..377ca8f9d3e 100644 --- a/jdk/src/share/classes/sun/io/Converters.java +++ b/jdk/src/share/classes/sun/io/Converters.java @@ -85,10 +85,11 @@ public class Converters { * this code can be involved in the startup sequence it's important to keep * the footprint down. */ - private static SoftReference[][] classCache - = new SoftReference[][] { - new SoftReference[CACHE_SIZE], - new SoftReference[CACHE_SIZE] + @SuppressWarnings("unchecked") + private static SoftReference[][] classCache + = (SoftReference[][]) new SoftReference[][] { + new SoftReference[CACHE_SIZE], + new SoftReference[CACHE_SIZE] }; private static void moveToFront(Object[] oa, int i) { @@ -98,28 +99,28 @@ public class Converters { oa[0] = ob; } - private static Class cache(int type, Object encoding) { - SoftReference[] srs = classCache[type]; + private static Class cache(int type, Object encoding) { + SoftReference[] srs = classCache[type]; for (int i = 0; i < CACHE_SIZE; i++) { - SoftReference sr = srs[i]; + SoftReference sr = srs[i]; if (sr == null) continue; - Object[] oa = (Object[])sr.get(); + Object[] oa = sr.get(); if (oa == null) { srs[i] = null; continue; } if (oa[1].equals(encoding)) { moveToFront(srs, i); - return (Class)oa[0]; + return (Class)oa[0]; } } return null; } - private static Class cache(int type, Object encoding, Class c) { - SoftReference[] srs = classCache[type]; - srs[CACHE_SIZE - 1] = new SoftReference(new Object[] { c, encoding }); + private static Class cache(int type, Object encoding, Class c) { + SoftReference[] srs = classCache[type]; + srs[CACHE_SIZE - 1] = new SoftReference(new Object[] { c, encoding }); moveToFront(srs, CACHE_SIZE - 1); return c; } @@ -129,12 +130,12 @@ public class Converters { */ public static boolean isCached(int type, String encoding) { synchronized (lock) { - SoftReference[] srs = classCache[type]; + SoftReference[] srs = classCache[type]; for (int i = 0; i < CACHE_SIZE; i++) { - SoftReference sr = srs[i]; + SoftReference sr = srs[i]; if (sr == null) continue; - Object[] oa = (Object[])sr.get(); + Object[] oa = sr.get(); if (oa == null) { srs[i] = null; continue; @@ -152,9 +153,9 @@ public class Converters { private static String getConverterPackageName() { String cp = converterPackageName; if (cp != null) return cp; - java.security.PrivilegedAction pa = + java.security.PrivilegedAction pa = new sun.security.action.GetPropertyAction("file.encoding.pkg"); - cp = (String)java.security.AccessController.doPrivileged(pa); + cp = java.security.AccessController.doPrivileged(pa); if (cp != null) { /* Property is set, so take it as the true converter package */ converterPackageName = cp; @@ -168,9 +169,9 @@ public class Converters { public static String getDefaultEncodingName() { synchronized (lock) { if (defaultEncoding == null) { - java.security.PrivilegedAction pa = + java.security.PrivilegedAction pa = new sun.security.action.GetPropertyAction("file.encoding"); - defaultEncoding = (String)java.security.AccessController.doPrivileged(pa); + defaultEncoding = java.security.AccessController.doPrivileged(pa); } } return defaultEncoding; @@ -194,7 +195,7 @@ public class Converters { * encoding, or throw an UnsupportedEncodingException if no such class can * be found */ - private static Class getConverterClass(int type, String encoding) + private static Class getConverterClass(int type, String encoding) throws UnsupportedEncodingException { String enc = null; @@ -241,7 +242,7 @@ public class Converters { * Instantiate the given converter class, or throw an * UnsupportedEncodingException if it cannot be instantiated */ - private static Object newConverter(String enc, Class c) + private static Object newConverter(String enc, Class c) throws UnsupportedEncodingException { try { @@ -261,7 +262,7 @@ public class Converters { static Object newConverter(int type, String enc) throws UnsupportedEncodingException { - Class c; + Class c; synchronized (lock) { c = cache(type, enc); if (c == null) { @@ -279,9 +280,9 @@ public class Converters { * not yet defined, return a class that implements the fallback default * encoding, which is just ISO 8859-1. */ - private static Class getDefaultConverterClass(int type) { + private static Class getDefaultConverterClass(int type) { boolean fillCache = false; - Class c; + Class c; /* First check the class cache */ c = cache(type, DEFAULT_NAME); @@ -325,7 +326,7 @@ public class Converters { * encoding cannot be determined. */ static Object newDefaultConverter(int type) { - Class c; + Class c; synchronized (lock) { c = getDefaultConverterClass(type); } diff --git a/jdk/src/share/classes/sun/management/Flag.java b/jdk/src/share/classes/sun/management/Flag.java index 44b4139e329..772b5688681 100644 --- a/jdk/src/share/classes/sun/management/Flag.java +++ b/jdk/src/share/classes/sun/management/Flag.java @@ -68,27 +68,42 @@ class Flag { } static Flag getFlag(String name) { - Flag[] fs = new Flag[1]; String[] names = new String[1]; names[0] = name; - int count = getFlags(names, fs, 1); - if (count == 1) { - return fs[0]; - } else { + + List flags = getFlags(names, 1); + if (flags.isEmpty()) { return null; + } else { + // flags should have only one element + return flags.get(0); } } static List getAllFlags() { int numFlags = getInternalFlagCount(); - Flag[] fs = new Flag[numFlags]; // Get all internal flags with names = null - int count = getFlags(null, fs, numFlags); - return Arrays.asList(fs); + return getFlags(null, numFlags); + } + + private static List getFlags(String[] names, int numFlags) { + Flag[] flags = new Flag[numFlags]; + int count = getFlags(names, flags, numFlags); + + List result = new ArrayList(); + for (Flag f : flags) { + if (f != null) { + result.add(f); + } + } + return result; } private static native String[] getAllFlagNames(); + // getFlags sets each element in the given flags array + // with a Flag object only if the name is valid and the + // type is supported. The flags array may contain null elements. private static native int getFlags(String[] names, Flag[] flags, int count); private static native int getInternalFlagCount(); diff --git a/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java b/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java index 31fe2ba61a4..bc4e48819f6 100644 --- a/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java +++ b/jdk/src/share/classes/sun/net/ftp/impl/FtpClient.java @@ -671,6 +671,10 @@ public class FtpClient extends sun.net.ftp.FtpClient { } if (!issueCommand(cmd)) { s.close(); + if (getLastReplyCode() == FtpReplyCode.FILE_UNAVAILABLE) { + // Ensure backward compatibility + throw new FileNotFoundException(cmd); + } throw new sun.net.ftp.FtpProtocolException(cmd + ":" + getResponseString(), getLastReplyCode()); } return s; @@ -688,7 +692,16 @@ public class FtpClient extends sun.net.ftp.FtpClient { Socket clientSocket; if (passiveMode) { - return openPassiveDataConnection(cmd); + try { + return openPassiveDataConnection(cmd); + } catch (sun.net.ftp.FtpProtocolException e) { + // If Passive mode failed, fall back on PORT + // Otherwise throw exception + String errmsg = e.getMessage(); + if (!errmsg.startsWith("PASV") && !errmsg.startsWith("EPSV")) { + throw e; + } + } } ServerSocket portSocket; InetAddress myAddress; diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/AuthenticationInfo.java b/jdk/src/share/classes/sun/net/www/protocol/http/AuthenticationInfo.java index 1fbf5def0a6..6115401ff02 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/http/AuthenticationInfo.java +++ b/jdk/src/share/classes/sun/net/www/protocol/http/AuthenticationInfo.java @@ -111,7 +111,7 @@ public abstract class AuthenticationInfo extends AuthCacheValue implements Clone * at the same time, then all but the first will block until * the first completes its authentication. */ - static private HashMap requests = new HashMap (); + static private HashMap requests = new HashMap<>(); /* check if a request for this destination is in progress * return false immediately if not. Otherwise block until @@ -125,7 +125,7 @@ public abstract class AuthenticationInfo extends AuthCacheValue implements Clone synchronized (requests) { Thread t, c; c = Thread.currentThread(); - if ((t=(Thread)requests.get(key))==null) { + if ((t = requests.get(key)) == null) { requests.put (key, c); return false; } @@ -147,8 +147,11 @@ public abstract class AuthenticationInfo extends AuthCacheValue implements Clone */ static private void requestCompleted (String key) { synchronized (requests) { - boolean waspresent = requests.remove (key) != null; - assert waspresent; + Thread thread = requests.get(key); + if (thread != null && thread == Thread.currentThread()) { + boolean waspresent = requests.remove(key) != null; + assert waspresent; + } requests.notifyAll(); } } diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java index 732e9b3dce3..ac5eb2d281c 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java +++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java @@ -423,7 +423,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { // Try keep-alive only on first attempt if (!failedOnce && http.getHttpKeepAliveSet()) { - if (http.usingProxy) { + if (http.usingProxy && tunnelState() != TunnelState.TUNNELING) { requests.setIfNotSet("Proxy-Connection", "keep-alive"); } else { requests.setIfNotSet("Connection", "keep-alive"); diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/spnego/NegotiateCallbackHandler.java b/jdk/src/share/classes/sun/net/www/protocol/http/spnego/NegotiateCallbackHandler.java index f2c0f6cc254..1dd442ddfca 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/http/spnego/NegotiateCallbackHandler.java +++ b/jdk/src/share/classes/sun/net/www/protocol/http/spnego/NegotiateCallbackHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,43 +45,50 @@ public class NegotiateCallbackHandler implements CallbackHandler { private String username; private char[] password; + /** + * Authenticator asks for username and password in a single prompt, + * but CallbackHandler checks one by one. So, no matter which callback + * gets handled first, make sure Authenticator is only called once. + */ + private boolean answered; + private final HttpCallerInfo hci; public NegotiateCallbackHandler(HttpCallerInfo hci) { this.hci = hci; } + private void getAnswer() { + if (!answered) { + answered = true; + PasswordAuthentication passAuth = + Authenticator.requestPasswordAuthentication( + hci.host, hci.addr, hci.port, hci.protocol, + hci.prompt, hci.scheme, hci.url, hci.authType); + /** + * To be compatible with existing callback handler implementations, + * when the underlying Authenticator is canceled, username and + * password are assigned null. No exception is thrown. + */ + if (passAuth != null) { + username = passAuth.getUserName(); + password = passAuth.getPassword(); + } + } + } + public void handle(Callback[] callbacks) throws UnsupportedCallbackException, IOException { for (int i=0; i classMap + = new TreeMap<>(ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER); /* Maps alias names to canonical names */ - private Map aliasMap - = new TreeMap(ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER); + private Map aliasMap + = new TreeMap<>(ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER); /* Maps canonical names to alias-name arrays */ - private Map aliasNameMap - = new TreeMap(ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER); + private Map aliasNameMap + = new TreeMap<>(ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER); /* Maps canonical names to soft references that hold cached instances */ - private Map cache - = new TreeMap(ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER); + private Map> cache + = new TreeMap<>(ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER); private String packagePrefix; @@ -79,13 +79,13 @@ public class AbstractCharsetProvider /* Add an entry to the given map, but only if no mapping yet exists * for the given name. */ - private static void put(Map m, String name, Object value) { + private static void put(Map m, K name, V value) { if (!m.containsKey(name)) m.put(name, value); } - private static void remove(Map m, String name) { - Object x = m.remove(name); + private static void remove(Map m, K name) { + V x = m.remove(name); assert (x != null); } @@ -116,22 +116,22 @@ public class AbstractCharsetProvider protected void init() { } private String canonicalize(String charsetName) { - String acn = (String)aliasMap.get(charsetName); + String acn = aliasMap.get(charsetName); return (acn != null) ? acn : charsetName; } private Charset lookup(String csn) { // Check cache first - SoftReference sr = (SoftReference)cache.get(csn); + SoftReference sr = cache.get(csn); if (sr != null) { - Charset cs = (Charset)sr.get(); + Charset cs = sr.get(); if (cs != null) return cs; } // Do we even support this charset? - String cln = (String)classMap.get(csn); + String cln = classMap.get(csn); if (cln == null) return null; @@ -139,12 +139,12 @@ public class AbstractCharsetProvider // Instantiate the charset and cache it try { - Class c = Class.forName(packagePrefix + "." + cln, - true, - this.getClass().getClassLoader()); + Class c = Class.forName(packagePrefix + "." + cln, + true, + this.getClass().getClassLoader()); Charset cs = (Charset)c.newInstance(); - cache.put(csn, new SoftReference(cs)); + cache.put(csn, new SoftReference(cs)); return cs; } catch (ClassNotFoundException x) { return null; @@ -164,21 +164,21 @@ public class AbstractCharsetProvider public final Iterator charsets() { - final ArrayList ks; + final ArrayList ks; synchronized (this) { init(); - ks = new ArrayList(classMap.keySet()); + ks = new ArrayList<>(classMap.keySet()); } return new Iterator() { - Iterator i = ks.iterator(); + Iterator i = ks.iterator(); public boolean hasNext() { return i.hasNext(); } public Charset next() { - String csn = (String)i.next(); + String csn = i.next(); return lookup(csn); } @@ -191,7 +191,7 @@ public class AbstractCharsetProvider public final String[] aliases(String charsetName) { synchronized (this) { init(); - return (String[])aliasNameMap.get(charsetName); + return aliasNameMap.get(charsetName); } } diff --git a/jdk/src/share/classes/sun/nio/cs/Surrogate.java b/jdk/src/share/classes/sun/nio/cs/Surrogate.java index 4791255435b..5f48f07fa0b 100644 --- a/jdk/src/share/classes/sun/nio/cs/Surrogate.java +++ b/jdk/src/share/classes/sun/nio/cs/Surrogate.java @@ -78,8 +78,8 @@ public class Surrogate { * Tells whether or not the given UCS-4 character is in the Basic * Multilingual Plane, and can be represented using a single char. */ - public static boolean isBMP(int uc) { - return (int) (char) uc == uc; + public static boolean isBMPCodePoint(int uc) { + return uc >> 16 == 0; } /** @@ -290,7 +290,7 @@ public class Surrogate { * error() will return a descriptive result object */ public int generate(int uc, int len, CharBuffer dst) { - if (Surrogate.isBMP(uc)) { + if (Surrogate.isBMPCodePoint(uc)) { if (Surrogate.is(uc)) { error = CoderResult.malformedForLength(len); return -1; @@ -334,7 +334,7 @@ public class Surrogate { * error() will return a descriptive result object */ public int generate(int uc, int len, char[] da, int dp, int dl) { - if (Surrogate.isBMP(uc)) { + if (Surrogate.isBMPCodePoint(uc)) { if (Surrogate.is(uc)) { error = CoderResult.malformedForLength(len); return -1; diff --git a/jdk/src/share/classes/sun/nio/fs/AbstractPath.java b/jdk/src/share/classes/sun/nio/fs/AbstractPath.java index 71204bd0a2e..e81e3eb1f98 100644 --- a/jdk/src/share/classes/sun/nio/fs/AbstractPath.java +++ b/jdk/src/share/classes/sun/nio/fs/AbstractPath.java @@ -256,8 +256,8 @@ abstract class AbstractPath extends Path { } if (option == null) throw new NullPointerException(); - throw new IllegalArgumentException("'" + option + - "' is not a valid copy option"); + throw new UnsupportedOperationException("'" + option + + "' is not a recognized copy option"); } return result; } @@ -279,9 +279,21 @@ abstract class AbstractPath extends Path { if (attrs.isSymbolicLink()) throw new IOException("Copying of symbolic links not supported"); - // delete target file - if (opts.replaceExisting) - target.deleteIfExists(); + // check if target exists + boolean exists; + if (opts.replaceExisting) { + try { + target.deleteIfExists(); + exists = false; + } catch (DirectoryNotEmptyException x) { + // let exception translate to FileAlreadyExistsException (6895012) + exists = true; + } + } else { + exists = target.exists(); + } + if (exists) + throw new FileAlreadyExistsException(target.toString()); // create directory or file if (attrs.isDirectory()) { @@ -318,7 +330,7 @@ abstract class AbstractPath extends Path { ReadableByteChannel rbc = newByteChannel(); try { // open target file for writing - SeekableByteChannel sbc = target.newByteChannel(CREATE, WRITE); + SeekableByteChannel sbc = target.newByteChannel(CREATE_NEW, WRITE); // simple copy loop try { diff --git a/jdk/src/share/classes/sun/nio/fs/AbstractWatchKey.java b/jdk/src/share/classes/sun/nio/fs/AbstractWatchKey.java index 8e33f81ed84..9faf78cec82 100644 --- a/jdk/src/share/classes/sun/nio/fs/AbstractWatchKey.java +++ b/jdk/src/share/classes/sun/nio/fs/AbstractWatchKey.java @@ -59,10 +59,15 @@ abstract class AbstractWatchKey extends WatchKey { // pending events private List> events; + // maps a context to the last event for the context (iff the last queued + // event for the context is an ENTRY_MODIFY event). + private Map> lastModifyEvents; + protected AbstractWatchKey(AbstractWatchService watcher) { this.watcher = watcher; this.state = State.READY; this.events = new ArrayList>(); + this.lastModifyEvents = new HashMap>(); } final AbstractWatchService watcher() { @@ -86,33 +91,58 @@ abstract class AbstractWatchKey extends WatchKey { */ @SuppressWarnings("unchecked") final void signalEvent(WatchEvent.Kind kind, Object context) { + boolean isModify = (kind == StandardWatchEventKind.ENTRY_MODIFY); synchronized (this) { int size = events.size(); - if (size > 1) { - // don't let list get too big - if (size >= MAX_EVENT_LIST_SIZE) { - kind = StandardWatchEventKind.OVERFLOW; - context = null; + if (size > 0) { + // if the previous event is an OVERFLOW event or this is a + // repeated event then we simply increment the counter + WatchEvent prev = events.get(size-1); + if ((prev.kind() == StandardWatchEventKind.OVERFLOW) || + ((kind == prev.kind() && + Objects.equals(context, prev.context())))) + { + ((Event)prev).increment(); + return; } - // repeated event - WatchEvent prev = events.get(size-1); - if (kind == prev.kind()) { - boolean isRepeat; - if (context == null) { - isRepeat = (prev.context() == null); + // if this is a modify event and the last entry for the context + // is a modify event then we simply increment the count + if (!lastModifyEvents.isEmpty()) { + if (isModify) { + WatchEvent ev = lastModifyEvents.get(context); + if (ev != null) { + assert ev.kind() == StandardWatchEventKind.ENTRY_MODIFY; + ((Event)ev).increment(); + return; + } } else { - isRepeat = context.equals(prev.context()); - } - if (isRepeat) { - ((Event)prev).increment(); - return; + // not a modify event so remove from the map as the + // last event will no longer be a modify event. + lastModifyEvents.remove(context); } } + + // if the list has reached the limit then drop pending events + // and queue an OVERFLOW event + if (size >= MAX_EVENT_LIST_SIZE) { + kind = StandardWatchEventKind.OVERFLOW; + isModify = false; + context = null; + } } // non-repeated event - events.add(new Event((WatchEvent.Kind)kind, context)); + Event ev = + new Event((WatchEvent.Kind)kind, context); + if (isModify) { + lastModifyEvents.put(context, ev); + } else if (kind == StandardWatchEventKind.OVERFLOW) { + // drop all pending events + events.clear(); + lastModifyEvents.clear(); + } + events.add(ev); signal(); } } @@ -122,6 +152,7 @@ abstract class AbstractWatchKey extends WatchKey { synchronized (this) { List> result = events; events = new ArrayList>(); + lastModifyEvents.clear(); return result; } } diff --git a/jdk/src/share/classes/sun/security/jgss/GSSManagerImpl.java b/jdk/src/share/classes/sun/security/jgss/GSSManagerImpl.java index eeb23fc940a..5a8143e30f0 100644 --- a/jdk/src/share/classes/sun/security/jgss/GSSManagerImpl.java +++ b/jdk/src/share/classes/sun/security/jgss/GSSManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -89,6 +89,11 @@ public class GSSManagerImpl extends GSSManager { Oid[] retVal = new Oid[mechs.length]; int pos = 0; + // Compatibility with RFC 2853 old NT_HOSTBASED_SERVICE value. + if (nameType.equals(GSSNameImpl.oldHostbasedServiceName)) { + nameType = GSSName.NT_HOSTBASED_SERVICE; + } + // Iterate thru all mechs in GSS for (int i = 0; i < mechs.length; i++) { // what nametypes does this mech support? diff --git a/jdk/src/share/classes/sun/security/jgss/GSSNameImpl.java b/jdk/src/share/classes/sun/security/jgss/GSSNameImpl.java index c1834d81dbb..1e47fdfa33e 100644 --- a/jdk/src/share/classes/sun/security/jgss/GSSNameImpl.java +++ b/jdk/src/share/classes/sun/security/jgss/GSSNameImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,6 +81,29 @@ import sun.security.util.DerOutputStream; public class GSSNameImpl implements GSSName { + /** + * The old Oid used in RFC 2853. Now supported as + * input parameters in: + * + * 1. The four overloaded GSSManager.createName(*) methods + * 2. GSSManager.getMechsForName(Oid) + * + * Note that even if a GSSName is created with this old Oid, + * its internal name type and getStringNameType() output are + * always the new value. + */ + final static Oid oldHostbasedServiceName; + + static { + Oid tmp = null; + try { + tmp = new Oid("1.3.6.1.5.6.2"); + } catch (Exception e) { + // should never happen + } + oldHostbasedServiceName = tmp; + } + private GSSManagerImpl gssManager = null; /* @@ -134,6 +157,9 @@ public class GSSNameImpl implements GSSName { Oid mech) throws GSSException { + if (oldHostbasedServiceName.equals(appNameType)) { + appNameType = GSSName.NT_HOSTBASED_SERVICE; + } if (appName == null) throw new GSSExceptionImpl(GSSException.BAD_NAME, "Cannot import null name"); diff --git a/jdk/src/share/classes/sun/security/jgss/GSSUtil.java b/jdk/src/share/classes/sun/security/jgss/GSSUtil.java index a59bf5dfab2..c2c87b5096d 100644 --- a/jdk/src/share/classes/sun/security/jgss/GSSUtil.java +++ b/jdk/src/share/classes/sun/security/jgss/GSSUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -66,9 +66,6 @@ public class GSSUtil { public static final Oid NT_GSS_KRB5_PRINCIPAL = GSSUtil.createOid("1.2.840.113554.1.2.2.1"); - public static final Oid NT_HOSTBASED_SERVICE2 = - GSSUtil.createOid("1.2.840.113554.1.2.1.4"); - private static final String DEFAULT_HANDLER = "auth.login.defaultCallbackHandler"; diff --git a/jdk/src/share/classes/sun/security/jgss/wrapper/GSSNameElement.java b/jdk/src/share/classes/sun/security/jgss/wrapper/GSSNameElement.java index d96a47b522d..2bab4bc8cc5 100644 --- a/jdk/src/share/classes/sun/security/jgss/wrapper/GSSNameElement.java +++ b/jdk/src/share/classes/sun/security/jgss/wrapper/GSSNameElement.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,8 +55,7 @@ public class GSSNameElement implements GSSNameSpi { static final GSSNameElement DEF_ACCEPTOR = new GSSNameElement(); private static Oid getNativeNameType(Oid nameType, GSSLibStub stub) { - if (GSSUtil.NT_GSS_KRB5_PRINCIPAL.equals(nameType) || - GSSName.NT_HOSTBASED_SERVICE.equals(nameType)) { + if (GSSUtil.NT_GSS_KRB5_PRINCIPAL.equals(nameType)) { Oid[] supportedNTs = null; try { supportedNTs = stub.inquireNamesForMech(); @@ -83,15 +82,9 @@ public class GSSNameElement implements GSSNameSpi { if (supportedNTs[i].equals(nameType)) return nameType; } // Special handling the specified name type - if (GSSUtil.NT_GSS_KRB5_PRINCIPAL.equals(nameType)) { - SunNativeProvider.debug("Override " + nameType + - " with mechanism default(null)"); - return null; // Use mechanism specific default - } else { - SunNativeProvider.debug("Override " + nameType + - " with " + GSSUtil.NT_HOSTBASED_SERVICE2); - return GSSUtil.NT_HOSTBASED_SERVICE2; - } + SunNativeProvider.debug("Override " + nameType + + " with mechanism default(null)"); + return null; // Use mechanism specific default } } return nameType; diff --git a/jdk/src/share/classes/sun/security/krb5/Config.java b/jdk/src/share/classes/sun/security/krb5/Config.java index 283e0d28cbf..3cc209c9f21 100644 --- a/jdk/src/share/classes/sun/security/krb5/Config.java +++ b/jdk/src/share/classes/sun/security/krb5/Config.java @@ -109,6 +109,7 @@ public class Config { public static synchronized void refresh() throws KrbException { singleton = new Config(); KeyTab.refresh(); + KrbKdcReq.KdcAccessibility.reset(); } diff --git a/jdk/src/share/classes/sun/security/krb5/EncryptionKey.java b/jdk/src/share/classes/sun/security/krb5/EncryptionKey.java index adf2cd8ace1..15d6d78c04d 100644 --- a/jdk/src/share/classes/sun/security/krb5/EncryptionKey.java +++ b/jdk/src/share/classes/sun/security/krb5/EncryptionKey.java @@ -511,6 +511,23 @@ public class EncryptionKey return findKey(etype, null, keys); } + /** + * Determines if a kvno matches another kvno. Used in the method + * findKey(type, kvno, keys). Always returns true if either input + * is null or zero, in case any side does not have kvno info available. + * + * Note: zero is included because N/A is not a legal value for kvno + * in javax.security.auth.kerberos.KerberosKey. Therefore, the info + * that the kvno is N/A might be lost when converting between this + * class and KerberosKey. + */ + private static boolean versionMatches(Integer v1, Integer v2) { + if (v1 == null || v1 == 0 || v2 == null || v2 == 0) { + return true; + } + return v1.equals(v2); + } + /** * Find a key with given etype and kvno * @param kvno if null, return any (first?) key @@ -525,15 +542,20 @@ public class EncryptionKey } int ktype; + boolean etypeFound = false; for (int i = 0; i < keys.length; i++) { ktype = keys[i].getEType(); if (EType.isSupported(ktype)) { Integer kv = keys[i].getKeyVersionNumber(); - if (etype == ktype && (kvno == null || kvno.equals(kv))) { - return keys[i]; + if (etype == ktype) { + etypeFound = true; + if (versionMatches(kvno, kv)) { + return keys[i]; + } } } } + // Key not found. // allow DES key to be used for the DES etypes if ((etype == EncryptedData.ETYPE_DES_CBC_CRC || @@ -543,12 +565,16 @@ public class EncryptionKey if (ktype == EncryptedData.ETYPE_DES_CBC_CRC || ktype == EncryptedData.ETYPE_DES_CBC_MD5) { Integer kv = keys[i].getKeyVersionNumber(); - if (kvno == null || kvno.equals(kv)) { + etypeFound = true; + if (versionMatches(kvno, kv)) { return new EncryptionKey(etype, keys[i].getBytes()); } } } } + if (etypeFound) { + throw new KrbException(Krb5.KRB_AP_ERR_BADKEYVER); + } return null; } } diff --git a/jdk/src/share/classes/sun/security/krb5/KrbKdcReq.java b/jdk/src/share/classes/sun/security/krb5/KrbKdcReq.java index b915ff99711..389fd04be4e 100644 --- a/jdk/src/share/classes/sun/security/krb5/KrbKdcReq.java +++ b/jdk/src/share/classes/sun/security/krb5/KrbKdcReq.java @@ -31,25 +31,26 @@ package sun.security.krb5; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.Security; +import java.util.Locale; import sun.security.krb5.internal.Krb5; import sun.security.krb5.internal.UDPClient; import sun.security.krb5.internal.TCPClient; import java.io.IOException; -import java.io.InterruptedIOException; import java.net.SocketTimeoutException; -import java.net.UnknownHostException; import java.util.StringTokenizer; import java.security.AccessController; import java.security.PrivilegedExceptionAction; import java.security.PrivilegedActionException; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.HashSet; public abstract class KrbKdcReq { - /** - * Default port for a KDC. - */ - private static final int DEFAULT_KDC_PORT = Krb5.KDC_INET_DEFAULT_PORT; - // Currently there is no option to specify retries // in the kerberos configuration file @@ -66,7 +67,48 @@ public abstract class KrbKdcReq { private static int udpPrefLimit = -1; + private static final String BAD_POLICY_KEY = "krb5.kdc.bad.policy"; + + /** + * What to do when a KDC is unavailable, specified in the + * java.security file with key krb5.kdc.bad.policy. + * Possible values can be TRY_LAST or TRY_LESS + */ + private enum BpType { + NONE, TRY_LAST, TRY_LESS + } + private static int tryLessMaxRetries = 1; + private static int tryLessTimeout = 5000; + + private static final BpType badPolicy; + static { + String value = AccessController.doPrivileged( + new PrivilegedAction() { + public String run() { + return Security.getProperty(BAD_POLICY_KEY); + } + }); + if (value != null) { + value = value.toLowerCase(Locale.ENGLISH); + String[] ss = value.split(":"); + if ("tryless".equals(ss[0])) { + if (ss.length > 1) { + String[] params = ss[1].split(","); + tryLessMaxRetries = Integer.parseInt(params[0]); + if (params.length > 1) { + tryLessTimeout = Integer.parseInt(params[1]); + } + } + badPolicy = BpType.TRY_LESS; + } else if ("trylast".equals(ss[0])) { + badPolicy = BpType.TRY_LAST; + } else { + badPolicy = BpType.NONE; + } + } else { + badPolicy = BpType.NONE; + } /* * Get default timeout. @@ -131,22 +173,16 @@ public abstract class KrbKdcReq { } } - /* - * Get timeout. - */ - - int timeout = getKdcTimeout(realm); - String kdcList = cfg.getKDCList(realm); if (kdcList == null) { throw new KrbException("Cannot get kdc for realm " + realm); } String tempKdc = null; // may include the port number also - StringTokenizer st = new StringTokenizer(kdcList); - while (st.hasMoreTokens()) { - tempKdc = st.nextToken(); + for (String tmp: KdcAccessibility.list(kdcList)) { + tempKdc = tmp; try { send(realm,tempKdc,useTCP); + KdcAccessibility.removeBad(tempKdc); break; } catch (Exception e) { if (DEBUG) { @@ -154,6 +190,7 @@ public abstract class KrbKdcReq { tempKdc); e.printStackTrace(System.out); } + KdcAccessibility.addBad(tempKdc); savedException = e; } } @@ -174,16 +211,21 @@ public abstract class KrbKdcReq { if (obuf == null) return; - PrivilegedActionException savedException = null; - int port = Krb5.KDC_INET_DEFAULT_PORT; - /* - * Get timeout. - */ + int port = Krb5.KDC_INET_DEFAULT_PORT; + int retries = DEFAULT_KDC_RETRY_LIMIT; int timeout = getKdcTimeout(realm); - /* - * Get port number for this KDC. - */ + + if (badPolicy == BpType.TRY_LESS && + KdcAccessibility.isBad(tempKdc)) { + if (retries > tryLessMaxRetries) { + retries = tryLessMaxRetries; // less retries + } + if (timeout > tryLessTimeout) { + timeout = tryLessTimeout; // less time + } + } + String kdc = null; String portStr = null; @@ -225,12 +267,12 @@ public abstract class KrbKdcReq { + port + ", timeout=" + timeout + ", number of retries =" - + DEFAULT_KDC_RETRY_LIMIT + + retries + ", #bytes=" + obuf.length); } KdcCommunication kdcCommunication = - new KdcCommunication(kdc, port, useTCP, timeout, obuf); + new KdcCommunication(kdc, port, useTCP, timeout, retries, obuf); try { ibuf = AccessController.doPrivileged(kdcCommunication); if (DEBUG) { @@ -258,14 +300,16 @@ public abstract class KrbKdcReq { private int port; private boolean useTCP; private int timeout; + private int retries; private byte[] obuf; public KdcCommunication(String kdc, int port, boolean useTCP, - int timeout, byte[] obuf) { + int timeout, int retries, byte[] obuf) { this.kdc = kdc; this.port = port; this.useTCP = useTCP; this.timeout = timeout; + this.retries = retries; this.obuf = obuf; } @@ -294,7 +338,7 @@ public abstract class KrbKdcReq { } else { // For each KDC we try DEFAULT_KDC_RETRY_LIMIT (3) times to // get the response - for (int i=1; i <= DEFAULT_KDC_RETRY_LIMIT; i++) { + for (int i=1; i <= retries; i++) { UDPClient kdcClient = new UDPClient(kdc, port, timeout); if (DEBUG) { @@ -310,7 +354,7 @@ public abstract class KrbKdcReq { * Send the data to the kdc. */ - kdcClient.send(obuf); + kdcClient.send(obuf); /* * And get a response. @@ -323,7 +367,7 @@ public abstract class KrbKdcReq { System.out.println ("SocketTimeOutException with " + "attempt: " + i); } - if (i == DEFAULT_KDC_RETRY_LIMIT) { + if (i == retries) { ibuf = null; throw se; } @@ -385,4 +429,67 @@ public abstract class KrbKdcReq { return -1; } + + /** + * Maintains a KDC accessible list. Unavailable KDCs are put into a + * blacklist, when a KDC in the blacklist is available, it's removed + * from there. No insertion order in the blacklist. + * + * There are two methods to deal with KDCs in the blacklist. 1. Only try + * them when there's no KDC not on the blacklist. 2. Still try them, but + * with lesser number of retries and smaller timeout value. + */ + static class KdcAccessibility { + // Known bad KDCs + private static Set bads = new HashSet(); + + private static synchronized void addBad(String kdc) { + if (DEBUG) { + System.out.println(">>> KdcAccessibility: add " + kdc); + } + bads.add(kdc); + } + + private static synchronized void removeBad(String kdc) { + if (DEBUG) { + System.out.println(">>> KdcAccessibility: remove " + kdc); + } + bads.remove(kdc); + } + + private static synchronized boolean isBad(String kdc) { + return bads.contains(kdc); + } + + public static synchronized void reset() { + if (DEBUG) { + System.out.println(">>> KdcAccessibility: reset"); + } + bads.clear(); + } + + // Returns a preferred KDC list by putting the bad ones at the end + private static synchronized String[] list(String kdcList) { + StringTokenizer st = new StringTokenizer(kdcList); + List list = new ArrayList(); + if (badPolicy == BpType.TRY_LAST) { + List badkdcs = new ArrayList(); + while (st.hasMoreTokens()) { + String t = st.nextToken(); + if (bads.contains(t)) badkdcs.add(t); + else list.add(t); + } + // Bad KDCs are put at last + list.addAll(badkdcs); + } else { + // All KDCs are returned in their original order, + // This include TRY_LESS and NONE + while (st.hasMoreTokens()) { + list.add(st.nextToken()); + } + } + return list.toArray(new String[list.size()]); + } + } } + diff --git a/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java b/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java index b7da802af13..63d14cf69a2 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java @@ -1,5 +1,5 @@ /* - * Portions Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Portions Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,9 +36,9 @@ import sun.security.krb5.Config; import sun.security.krb5.EncryptedData; import sun.security.krb5.EncryptionKey; import sun.security.krb5.KrbException; -import sun.security.krb5.Asn1Exception; import sun.security.krb5.KrbCryptoException; import javax.crypto.*; +import java.util.Arrays; import java.util.List; import java.util.ArrayList; @@ -48,6 +48,23 @@ import java.util.ArrayList; public abstract class EType { private static final boolean DEBUG = Krb5.DEBUG; + private static final boolean ALLOW_WEAK_CRYPTO; + + static { + boolean allowed = true; + try { + Config cfg = Config.getInstance(); + String temp = cfg.getDefault("allow_weak_crypto", "libdefaults"); + if (temp != null && temp.equals("false")) allowed = false; + } catch (Exception exc) { + if (DEBUG) { + System.out.println ("Exception in getting allow_weak_crypto, " + + "using default value " + + exc.getMessage()); + } + } + ALLOW_WEAK_CRYPTO = allowed; + } public static EType getInstance (int eTypeConst) throws KdcErrException { @@ -163,6 +180,10 @@ public abstract class EType { return result; } + // Note: the first 2 entries of BUILTIN_ETYPES and BUILTIN_ETYPES_NOAES256 + // should be kept DES-related. They will be removed when allow_weak_crypto + // is set to false. + private static final int[] BUILTIN_ETYPES = new int[] { EncryptedData.ETYPE_DES_CBC_MD5, EncryptedData.ETYPE_DES_CBC_CRC, @@ -189,10 +210,17 @@ public abstract class EType { } catch (Exception e) { // should not happen } + int[] result; if (allowed < 256) { - return BUILTIN_ETYPES_NOAES256; + result = BUILTIN_ETYPES_NOAES256; + } else { + result = BUILTIN_ETYPES; } - return BUILTIN_ETYPES; + if (!ALLOW_WEAK_CRYPTO) { + // The first 2 etypes are now weak ones + return Arrays.copyOfRange(result, 2, result.length); + } + return result; } /** @@ -207,9 +235,7 @@ public abstract class EType { if (DEBUG) { System.out.println("Exception while getting " + configName + exc.getMessage()); - System.out.println("Using defaults " + - "des-cbc-md5, des-cbc-crc, des3-cbc-sha1," + - " aes128cts, aes256cts, rc4-hmac"); + System.out.println("Using default builtin etypes"); } return getBuiltInDefaults(); } diff --git a/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTabEntry.java b/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTabEntry.java index 3eb08b5df43..49c99fcb9d3 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTabEntry.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTabEntry.java @@ -75,7 +75,7 @@ public class KeyTabEntry implements KeyTabConstants { public String getKeyString() { StringBuffer sb = new StringBuffer("0x"); for (int i = 0; i < keyblock.length; i++) { - sb.append(Integer.toHexString(keyblock[i]&0xff)); + sb.append(String.format("%02x", keyblock[i]&0xff)); } return sb.toString(); } diff --git a/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTabInputStream.java b/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTabInputStream.java index 900c3cc52d8..c347c848f95 100644 --- a/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTabInputStream.java +++ b/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTabInputStream.java @@ -1,5 +1,5 @@ /* - * Portions Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. + * Portions Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,7 @@ import java.io.InputStream; public class KeyTabInputStream extends KrbDataInputStream implements KeyTabConstants { boolean DEBUG = Krb5.DEBUG; - static int index; + int index; public KeyTabInputStream(InputStream is) { super(is); diff --git a/jdk/src/share/classes/sun/security/pkcs/PKCS10.java b/jdk/src/share/classes/sun/security/pkcs/PKCS10.java index 595eed7c6af..ef51273e9b2 100644 --- a/jdk/src/share/classes/sun/security/pkcs/PKCS10.java +++ b/jdk/src/share/classes/sun/security/pkcs/PKCS10.java @@ -44,7 +44,6 @@ import sun.security.util.*; import sun.security.x509.AlgorithmId; import sun.security.x509.X509Key; import sun.security.x509.X500Name; -import sun.security.x509.X500Signer; /** * A PKCS #10 certificate request is created and sent to a Certificate @@ -183,13 +182,13 @@ public class PKCS10 { * Create the signed certificate request. This will later be * retrieved in either string or binary format. * - * @param requester identifies the signer (by X.500 name) - * and provides the private key used to sign. + * @param subject identifies the signer (by X.500 name). + * @param signature private key and signing algorithm to use. * @exception IOException on errors. * @exception CertificateException on certificate handling errors. * @exception SignatureException on signature handling errors. */ - public void encodeAndSign(X500Signer requester) + public void encodeAndSign(X500Name subject, Signature signature) throws CertificateException, IOException, SignatureException { DerOutputStream out, scratch; byte[] certificateRequestInfo; @@ -198,7 +197,7 @@ public class PKCS10 { if (encoded != null) throw new SignatureException("request is already signed"); - subject = requester.getSigner(); + this.subject = subject; /* * Encode cert request info, wrap in a sequence for signing @@ -217,14 +216,20 @@ public class PKCS10 { /* * Sign it ... */ - requester.update(certificateRequestInfo, 0, + signature.update(certificateRequestInfo, 0, certificateRequestInfo.length); - sig = requester.sign(); + sig = signature.sign(); /* * Build guts of SIGNED macro */ - requester.getAlgorithmId().encode(scratch); // sig algorithm + AlgorithmId algId = null; + try { + algId = AlgorithmId.getAlgorithmId(signature.getAlgorithm()); + } catch (NoSuchAlgorithmException nsae) { + throw new SignatureException(nsae); + } + algId.encode(scratch); // sig algorithm scratch.putBitString(sig); // sig /* diff --git a/jdk/src/share/classes/sun/security/pkcs11/P11ECKeyFactory.java b/jdk/src/share/classes/sun/security/pkcs11/P11ECKeyFactory.java index 82da96674e7..a582e47a924 100644 --- a/jdk/src/share/classes/sun/security/pkcs11/P11ECKeyFactory.java +++ b/jdk/src/share/classes/sun/security/pkcs11/P11ECKeyFactory.java @@ -40,6 +40,8 @@ import static sun.security.pkcs11.TemplateManager.*; import sun.security.pkcs11.wrapper.*; import static sun.security.pkcs11.wrapper.PKCS11Constants.*; +import sun.security.util.DerValue; + /** * EC KeyFactory implemenation. * @@ -201,7 +203,16 @@ final class P11ECKeyFactory extends P11KeyFactory { private PublicKey generatePublic(ECPoint point, ECParameterSpec params) throws PKCS11Exception { byte[] encodedParams = ECParameters.encodeParameters(params); - byte[] encodedPoint = ECParameters.encodePoint(point, params.getCurve()); + byte[] encodedPoint = null; + DerValue pkECPoint = new DerValue(DerValue.tag_OctetString, + ECParameters.encodePoint(point, params.getCurve())); + + try { + encodedPoint = pkECPoint.toByteArray(); + } catch (IOException e) { + throw new IllegalArgumentException("Could not DER encode point", e); + } + CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] { new CK_ATTRIBUTE(CKA_CLASS, CKO_PUBLIC_KEY), new CK_ATTRIBUTE(CKA_KEY_TYPE, CKK_EC), diff --git a/jdk/src/share/classes/sun/security/pkcs11/P11Key.java b/jdk/src/share/classes/sun/security/pkcs11/P11Key.java index c70642d3531..b3704299713 100644 --- a/jdk/src/share/classes/sun/security/pkcs11/P11Key.java +++ b/jdk/src/share/classes/sun/security/pkcs11/P11Key.java @@ -45,6 +45,8 @@ import sun.security.internal.interfaces.TlsMasterSecret; import sun.security.pkcs11.wrapper.*; import static sun.security.pkcs11.wrapper.PKCS11Constants.*; +import sun.security.util.DerValue; + /** * Key implementation classes. * @@ -998,10 +1000,18 @@ abstract class P11Key implements Key { }; fetchAttributes(attributes); try { + params = P11ECKeyFactory.decodeParameters + (attributes[1].getByteArray()); + DerValue wECPoint = new DerValue(attributes[0].getByteArray()); + if (wECPoint.getTag() != DerValue.tag_OctetString) + throw new IOException("Unexpected tag: " + + wECPoint.getTag()); params = P11ECKeyFactory.decodeParameters (attributes[1].getByteArray()); w = P11ECKeyFactory.decodePoint - (attributes[0].getByteArray(), params.getCurve()); + (wECPoint.getDataBytes(), params.getCurve()); + + } catch (Exception e) { throw new RuntimeException("Could not parse key values", e); } diff --git a/jdk/src/share/classes/sun/security/pkcs11/P11SecureRandom.java b/jdk/src/share/classes/sun/security/pkcs11/P11SecureRandom.java index de830226be8..bcf72806ea1 100644 --- a/jdk/src/share/classes/sun/security/pkcs11/P11SecureRandom.java +++ b/jdk/src/share/classes/sun/security/pkcs11/P11SecureRandom.java @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ package sun.security.pkcs11; import java.util.*; - +import java.io.*; import java.security.*; import sun.security.pkcs11.wrapper.*; @@ -61,9 +61,28 @@ final class P11SecureRandom extends SecureRandomSpi { // buffer, if mixing is used private byte[] mixBuffer; - // bytes remaining in buffer, if mixing is used + // bytes remaining in mixBuffer, if mixing is used private int buffered; + /* + * we buffer data internally for efficiency but limit the lifetime + * to avoid using stale bits. + */ + // lifetime in ms, currently 100 ms (0.1 s) + private static final long MAX_IBUFFER_TIME = 100; + + // size of the internal buffer + private static final int IBUFFER_SIZE = 32; + + // internal buffer for the random bits + private transient byte[] iBuffer = new byte[IBUFFER_SIZE]; + + // number of bytes remain in iBuffer + private transient int ibuffered = 0; + + // time that data was read into iBuffer + private transient long lastRead = 0L; + P11SecureRandom(Token token) { this.token = token; } @@ -104,16 +123,29 @@ final class P11SecureRandom extends SecureRandomSpi { if ((bytes == null) || (bytes.length == 0)) { return; } - Session session = null; - try { - session = token.getOpSession(); - token.p11.C_GenerateRandom(session.id(), bytes); - mix(bytes); - } catch (PKCS11Exception e) { - throw new ProviderException("nextBytes() failed", e); - } finally { - token.releaseSession(session); + if (bytes.length <= IBUFFER_SIZE) { + int ofs = 0; + synchronized (iBuffer) { + while (ofs < bytes.length) { + long time = System.currentTimeMillis(); + // refill the internal buffer if empty or stale + if ((ibuffered == 0) || + !(time - lastRead < MAX_IBUFFER_TIME)) { + lastRead = time; + implNextBytes(iBuffer); + ibuffered = IBUFFER_SIZE; + } + // copy the buffered bytes into 'bytes' + while ((ofs < bytes.length) && (ibuffered > 0)) { + bytes[ofs++] = iBuffer[IBUFFER_SIZE - ibuffered--]; + } + } + } + } else { + // avoid using the buffer - just fill bytes directly + implNextBytes(bytes); } + } // see JCA spec @@ -143,4 +175,26 @@ final class P11SecureRandom extends SecureRandomSpi { } } + // fill up the specified buffer with random bytes, and mix them + private void implNextBytes(byte[] bytes) { + Session session = null; + try { + session = token.getOpSession(); + token.p11.C_GenerateRandom(session.id(), bytes); + mix(bytes); + } catch (PKCS11Exception e) { + throw new ProviderException("nextBytes() failed", e); + } finally { + token.releaseSession(session); + } + } + + private void readObject(ObjectInputStream in) + throws IOException, ClassNotFoundException { + in.defaultReadObject(); + // assign default values to non-null transient fields + iBuffer = new byte[IBUFFER_SIZE]; + ibuffered = 0; + lastRead = 0L; + } } diff --git a/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java b/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java index 3f7cc908016..b7c7f5f0e7c 100644 --- a/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java +++ b/jdk/src/share/classes/sun/security/pkcs11/P11Signature.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,8 +30,7 @@ import java.math.BigInteger; import java.nio.ByteBuffer; import java.security.*; -import java.security.interfaces.ECPublicKey; - +import java.security.interfaces.*; import sun.nio.ch.DirectBuffer; import sun.security.util.*; @@ -88,7 +87,7 @@ final class P11Signature extends SignatureSpi { // mechanism id private final long mechanism; - // digest algorithm OID, if we do RSA padding ourselves + // digest algorithm OID, if we encode RSA signature ourselves private final ObjectIdentifier digestOID; // type, one of T_* below @@ -103,7 +102,7 @@ final class P11Signature extends SignatureSpi { // associated session, if any private Session session; - // mode, on of M_* below + // mode, one of M_* below private int mode; // flag indicating whether an operation is initialized @@ -137,6 +136,9 @@ final class P11Signature extends SignatureSpi { this.token = token; this.algorithm = algorithm; this.mechanism = mechanism; + byte[] buffer = null; + ObjectIdentifier digestOID = null; + MessageDigest md = null; switch ((int)mechanism) { case (int)CKM_MD2_RSA_PKCS: case (int)CKM_MD5_RSA_PKCS: @@ -146,34 +148,25 @@ final class P11Signature extends SignatureSpi { case (int)CKM_SHA512_RSA_PKCS: keyAlgorithm = "RSA"; type = T_UPDATE; - digestOID = null; buffer = new byte[1]; - md = null; break; case (int)CKM_DSA_SHA1: keyAlgorithm = "DSA"; type = T_UPDATE; - digestOID = null; buffer = new byte[1]; - md = null; break; case (int)CKM_ECDSA_SHA1: keyAlgorithm = "EC"; type = T_UPDATE; - digestOID = null; buffer = new byte[1]; - md = null; break; case (int)CKM_DSA: keyAlgorithm = "DSA"; - digestOID = null; if (algorithm.equals("DSA")) { type = T_DIGEST; md = MessageDigest.getInstance("SHA-1"); - buffer = null; } else if (algorithm.equals("RawDSA")) { type = T_RAW; - md = null; buffer = new byte[20]; } else { throw new ProviderException(algorithm); @@ -181,10 +174,8 @@ final class P11Signature extends SignatureSpi { break; case (int)CKM_ECDSA: keyAlgorithm = "EC"; - digestOID = null; if (algorithm.equals("NONEwithECDSA")) { type = T_RAW; - md = null; buffer = new byte[RAW_ECDSA_MAX]; } else { String digestAlg; @@ -201,14 +192,12 @@ final class P11Signature extends SignatureSpi { } type = T_DIGEST; md = MessageDigest.getInstance(digestAlg); - buffer = null; } break; case (int)CKM_RSA_PKCS: case (int)CKM_RSA_X_509: keyAlgorithm = "RSA"; type = T_DIGEST; - buffer = null; if (algorithm.equals("MD5withRSA")) { md = MessageDigest.getInstance("MD5"); digestOID = AlgorithmId.MD5_oid; @@ -234,6 +223,9 @@ final class P11Signature extends SignatureSpi { default: throw new ProviderException("Unknown mechanism: " + mechanism); } + this.buffer = buffer; + this.digestOID = digestOID; + this.md = md; session = token.getOpSession(); } @@ -326,9 +318,52 @@ final class P11Signature extends SignatureSpi { } } + private void checkRSAKeyLength(int len) throws InvalidKeyException { + RSAPadding padding; + try { + padding = RSAPadding.getInstance + (RSAPadding.PAD_BLOCKTYPE_1, (len + 7) >> 3); + } catch (InvalidAlgorithmParameterException iape) { + throw new InvalidKeyException(iape.getMessage()); + } + int maxDataSize = padding.getMaxDataSize(); + int encodedLength; + if (algorithm.equals("MD5withRSA") || + algorithm.equals("MD2withRSA")) { + encodedLength = 34; + } else if (algorithm.equals("SHA1withRSA")) { + encodedLength = 35; + } else if (algorithm.equals("SHA256withRSA")) { + encodedLength = 51; + } else if (algorithm.equals("SHA384withRSA")) { + encodedLength = 67; + } else if (algorithm.equals("SHA512withRSA")) { + encodedLength = 83; + } else { + throw new ProviderException("Unknown signature algo: " + algorithm); + } + if (encodedLength > maxDataSize) { + throw new InvalidKeyException + ("Key is too short for this signature algorithm"); + } + } + // see JCA spec protected void engineInitVerify(PublicKey publicKey) throws InvalidKeyException { + if (publicKey == null) { + throw new InvalidKeyException("Key must not be null"); + } + // Need to check RSA key length whenever a new key is set + if (keyAlgorithm.equals("RSA") && publicKey != p11Key) { + int keyLen; + if (publicKey instanceof P11Key) { + keyLen = ((P11Key) publicKey).keyLength(); + } else { + keyLen = ((RSAKey) publicKey).getModulus().bitLength(); + } + checkRSAKeyLength(keyLen); + } cancelOperation(); mode = M_VERIFY; p11Key = P11KeyFactory.convertKey(token, publicKey, keyAlgorithm); @@ -338,6 +373,19 @@ final class P11Signature extends SignatureSpi { // see JCA spec protected void engineInitSign(PrivateKey privateKey) throws InvalidKeyException { + if (privateKey == null) { + throw new InvalidKeyException("Key must not be null"); + } + // Need to check RSA key length whenever a new key is set + if (keyAlgorithm.equals("RSA") && privateKey != p11Key) { + int keyLen; + if (privateKey instanceof P11Key) { + keyLen = ((P11Key) privateKey).keyLength; + } else { + keyLen = ((RSAKey) privateKey).getModulus().bitLength(); + } + checkRSAKeyLength(keyLen); + } cancelOperation(); mode = M_SIGN; p11Key = P11KeyFactory.convertKey(token, privateKey, keyAlgorithm); diff --git a/jdk/src/share/classes/sun/security/provider/IdentityDatabase.java b/jdk/src/share/classes/sun/security/provider/IdentityDatabase.java deleted file mode 100644 index 0c118161c8a..00000000000 --- a/jdk/src/share/classes/sun/security/provider/IdentityDatabase.java +++ /dev/null @@ -1,427 +0,0 @@ -/* - * Copyright 1996-2006 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - */ - -package sun.security.provider; - -import java.io.*; -import java.util.*; -import java.security.*; - -/** - * An implementation of IdentityScope as a persistent identity - * database. - * - * @see Identity - * @see Key - * - * @author Benjamin Renaud - */ -public -class IdentityDatabase extends IdentityScope implements Serializable { - - /** use serialVersionUID from JDK 1.1. for interoperability */ - private static final long serialVersionUID = 4923799573357658384L; - - /* Are we debugging? */ - private static final boolean debug = false; - - /* Are we printing out error messages? */ - private static final boolean error = true; - - /* The source file, if any, for this database.*/ - File sourceFile; - - /* The private representation of the database.*/ - Hashtable identities; - - IdentityDatabase() throws InvalidParameterException { - this("restoring..."); - } - - /** - * Construct a new, empty database with a specified source file. - * - * @param file the source file. - */ - public IdentityDatabase(File file) throws InvalidParameterException { - this(file.getName()); - sourceFile = file; - } - - /** - * Construct a new, empty database. - */ - public IdentityDatabase(String name) throws InvalidParameterException { - super(name); - identities = new Hashtable(); - } - - /** - * Initialize an identity database from a stream. The stream should - * contain data to initialized a serialized IdentityDatabase - * object. - * - * @param is the input stream from which to restore the database. - * - * @exception IOException if a stream IO exception occurs - */ - public static IdentityDatabase fromStream(InputStream is) - throws IOException { - IdentityDatabase db = null; - try { - ObjectInputStream ois = new ObjectInputStream(is); - db = (IdentityDatabase)ois.readObject(); - } catch (ClassNotFoundException e) { - // this can't happen. - debug("This should not be happening.", e); - error( - "The version of the database is obsolete. Cannot initialize."); - - } catch (InvalidClassException e) { - // this may happen in developers workspaces happen. - debug("This should not be happening.", e); - error("Unable to initialize system identity scope: " + - " InvalidClassException. \nThis is most likely due to " + - "a serialization versioning problem: a class used in " + - "key management was obsoleted"); - - } catch (StreamCorruptedException e) { - debug("The serialization stream is corrupted. Unable to load.", e); - error("Unable to initialize system identity scope." + - " StreamCorruptedException."); - } - - if (db == null) { - db = new IdentityDatabase("uninitialized"); - } - - return db; - } - - /** - * Initialize an IdentityDatabase from file. - * - * @param f the filename where the identity database is stored. - * - * @exception IOException a file-related exception occurs (e.g. - * the directory of the file passed does not exists, etc. - * - * @IOException if a file IO exception occurs. - */ - public static IdentityDatabase fromFile(File f) throws IOException { - FileInputStream fis = new FileInputStream(f); - IdentityDatabase edb = fromStream(fis); - edb.sourceFile = f; - return edb; - } - - - - /** - * @return the number of identities in the database. - */ - public int size() { - return identities.size(); - } - - - /** - * @param name the name of the identity to be retrieved. - * - * @return the identity named name, or null if there are - * no identities named name in the database. - */ - public Identity getIdentity(String name) { - Identity id = identities.get(name); - if (id instanceof Signer) { - localCheck("get.signer"); - } - return id; - } - - /** - * Get an identity by key. - * - * @param name the key of the identity to be retrieved. - * - * @return the identity with a given key, or null if there are no - * identities with that key in the database. - */ - public Identity getIdentity(PublicKey key) { - if (key == null) { - return null; - } - Enumeration e = identities(); - while (e.hasMoreElements()) { - Identity i = e.nextElement(); - PublicKey k = i.getPublicKey(); - if (k != null && keyEqual(k, key)) { - if (i instanceof Signer) { - localCheck("get.signer"); - } - return i; - } - } - return null; - } - - private boolean keyEqual(Key key1, Key key2) { - if (key1 == key2) { - return true; - } else { - return MessageDigest.isEqual(key1.getEncoded(), key2.getEncoded()); - } - } - - /** - * Adds an identity to the database. - * - * @param identity the identity to be added. - * - * @exception KeyManagementException if a name or key clash - * occurs, or if another exception occurs. - */ - public void addIdentity(Identity identity) - throws KeyManagementException { - localCheck("add.identity"); - Identity byName = getIdentity(identity.getName()); - Identity byKey = getIdentity(identity.getPublicKey()); - String msg = null; - - if (byName != null) { - msg = "name conflict"; - } - if (byKey != null) { - msg = "key conflict"; - } - if (msg != null) { - throw new KeyManagementException(msg); - } - identities.put(identity.getName(), identity); - } - - /** - * Removes an identity to the database. - */ - public void removeIdentity(Identity identity) - throws KeyManagementException { - localCheck("remove.identity"); - String name = identity.getName(); - if (identities.get(name) == null) { - throw new KeyManagementException("there is no identity named " + - name + " in " + this); - } - identities.remove(name); - } - - /** - * @return an enumeration of all identities in the database. - */ - public Enumeration identities() { - return identities.elements(); - } - - /** - * Set the source file for this database. - */ - void setSourceFile(File f) { - sourceFile = f; - } - - /** - * @return the source file for this database. - */ - File getSourceFile() { - return sourceFile; - } - - /** - * Save the database in its current state to an output stream. - * - * @param os the output stream to which the database should be serialized. - * - * @exception IOException if an IO exception is raised by stream - * operations. - */ - public void save(OutputStream os) throws IOException { - try { - ObjectOutputStream oos = new ObjectOutputStream(os); - oos.writeObject(this); - oos.flush(); - } catch (InvalidClassException e) { - debug("This should not be happening.", e); - return; - } - } - - /** - * Save the database to a file. - * - * @exception IOException if an IO exception is raised by stream - * operations. - */ - void save(File f) throws IOException { - setSourceFile(f); - FileOutputStream fos = new FileOutputStream(f); - save(fos); - } - - /** - * Saves the database to the default source file. - * - * @exception KeyManagementException when there is no default source - * file specified for this database. - */ - public void save() throws IOException { - if (sourceFile == null) { - throw new IOException("this database has no source file"); - } - save(sourceFile); - } - - /** - * This method returns the file from which to initialize the - * system database. - */ - private static File systemDatabaseFile() { - - // First figure out where the identity database is hiding, if anywhere. - String dbPath = Security.getProperty("identity.database"); - // if nowhere, it's the canonical place. - if (dbPath == null) { - dbPath = System.getProperty("user.home") + File.separatorChar + - "identitydb.obj"; - } - return new File(dbPath); - } - - - /* This block initializes the system database, if there is one. */ - static { - java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Void run() { - initializeSystem(); - return null; - } - }); - } - - /** - * This method initializes the system's identity database. The - * canonical location is - * /identitydatabase.obj. This is settable through - * the identity.database property. */ - private static void initializeSystem() { - - IdentityDatabase systemDatabase; - File dbFile = systemDatabaseFile(); - - // Second figure out if it's there, and if it isn't, create one. - try { - if (dbFile.exists()) { - debug("loading system database from file: " + dbFile); - systemDatabase = fromFile(dbFile); - } else { - systemDatabase = new IdentityDatabase(dbFile); - } - IdentityScope.setSystemScope(systemDatabase); - debug("System database initialized: " + systemDatabase); - } catch (IOException e) { - debug("Error initializing identity database: " + dbFile, e); - return; - } catch (InvalidParameterException e) { - debug("Error trying to instantiate a system identities db in " + - dbFile, e); - return; - } - } - - /* - private static File securityPropFile(String filename) { - // maybe check for a system property which will specify where to - // look. - String sep = File.separator; - return new File(System.getProperty("java.home") + - sep + "lib" + sep + "security" + - sep + filename); - } - */ - - public String toString() { - return "sun.security.provider.IdentityDatabase, source file: " + - sourceFile; - } - - - private static void debug(String s) { - if (debug) { - System.err.println(s); - } - } - - private static void debug(String s, Throwable t) { - if (debug) { - t.printStackTrace(); - System.err.println(s); - } - } - - private static void error(String s) { - if (error) { - System.err.println(s); - } - } - - void localCheck(String directive) { - SecurityManager security = System.getSecurityManager(); - if (security != null) { - directive = this.getClass().getName() + "." + - directive + "." + localFullName(); - security.checkSecurityAccess(directive); - } - } - - /** - * Returns a parsable name for identity: identityName.scopeName - */ - String localFullName() { - String parsable = getName(); - if (getScope() != null) { - parsable += "." +getScope().getName(); - } - return parsable; - } - - /** - * Serialization write. - */ - private synchronized void writeObject (java.io.ObjectOutputStream stream) - throws IOException { - localCheck("serialize.identity.database"); - stream.writeObject(identities); - stream.writeObject(sourceFile); - } -} diff --git a/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java b/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java index 70de46e6160..072336e7164 100644 --- a/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java +++ b/jdk/src/share/classes/sun/security/provider/JavaKeyStore.java @@ -29,9 +29,9 @@ import java.io.*; import java.security.*; import java.security.cert.Certificate; import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; import java.security.cert.CertificateException; import java.util.*; +import sun.misc.IOUtils; import sun.security.pkcs.EncryptedPrivateKeyInfo; @@ -677,50 +677,39 @@ abstract class JavaKeyStore extends KeyStoreSpi { entry.date = new Date(dis.readLong()); // Read the private key - try { - entry.protectedPrivKey = new byte[dis.readInt()]; - } catch (OutOfMemoryError e) { - throw new IOException("Keysize too big"); - } - dis.readFully(entry.protectedPrivKey); + entry.protectedPrivKey = + IOUtils.readFully(dis, dis.readInt(), true); // Read the certificate chain int numOfCerts = dis.readInt(); - try { - if (numOfCerts > 0) { - entry.chain = new Certificate[numOfCerts]; - } - } catch (OutOfMemoryError e) { - throw new IOException - ("Too many certificates in chain"); - } - for (int j = 0; j < numOfCerts; j++) { - if (xVersion == 2) { - // read the certificate type, and instantiate a - // certificate factory of that type (reuse - // existing factory if possible) - String certType = dis.readUTF(); - if (cfs.containsKey(certType)) { - // reuse certificate factory - cf = cfs.get(certType); - } else { - // create new certificate factory - cf = CertificateFactory.getInstance(certType); - // store the certificate factory so we can - // reuse it later - cfs.put(certType, cf); + if (numOfCerts > 0) { + List certs = new ArrayList<>( + numOfCerts > 10 ? 10 : numOfCerts); + for (int j = 0; j < numOfCerts; j++) { + if (xVersion == 2) { + // read the certificate type, and instantiate a + // certificate factory of that type (reuse + // existing factory if possible) + String certType = dis.readUTF(); + if (cfs.containsKey(certType)) { + // reuse certificate factory + cf = cfs.get(certType); + } else { + // create new certificate factory + cf = CertificateFactory.getInstance(certType); + // store the certificate factory so we can + // reuse it later + cfs.put(certType, cf); + } } + // instantiate the certificate + encoded = IOUtils.readFully(dis, dis.readInt(), true); + bais = new ByteArrayInputStream(encoded); + certs.add(cf.generateCertificate(bais)); + bais.close(); } - // instantiate the certificate - try { - encoded = new byte[dis.readInt()]; - } catch (OutOfMemoryError e) { - throw new IOException("Certificate too big"); - } - dis.readFully(encoded); - bais = new ByteArrayInputStream(encoded); - entry.chain[j] = cf.generateCertificate(bais); - bais.close(); + // We can be sure now that numOfCerts of certs are read + entry.chain = certs.toArray(new Certificate[numOfCerts]); } // Add the entry to the list @@ -753,12 +742,7 @@ abstract class JavaKeyStore extends KeyStoreSpi { cfs.put(certType, cf); } } - try { - encoded = new byte[dis.readInt()]; - } catch (OutOfMemoryError e) { - throw new IOException("Certificate too big"); - } - dis.readFully(encoded); + encoded = IOUtils.readFully(dis, dis.readInt(), true); bais = new ByteArrayInputStream(encoded); entry.cert = cf.generateCertificate(bais); bais.close(); diff --git a/jdk/src/share/classes/sun/security/provider/PolicyFile.java b/jdk/src/share/classes/sun/security/provider/PolicyFile.java index 2a18ac6ab92..d96b8a8d423 100644 --- a/jdk/src/share/classes/sun/security/provider/PolicyFile.java +++ b/jdk/src/share/classes/sun/security/provider/PolicyFile.java @@ -298,16 +298,13 @@ public class PolicyFile extends java.security.Policy { private static final int DEFAULT_CACHE_SIZE = 1; - /** the scope to check */ - private static IdentityScope scope = null; - // contains the policy grant entries, PD cache, and alias mapping private AtomicReference policyInfo = new AtomicReference(); private boolean constructed = false; private boolean expandProperties = true; - private boolean ignoreIdentityScope = false; + private boolean ignoreIdentityScope = true; private boolean allowSystemProperties = true; private boolean notUtf8 = false; private URL url; @@ -2030,85 +2027,9 @@ public class PolicyFile extends java.security.Policy { private boolean checkForTrustedIdentity(final Certificate cert, PolicyInfo myInfo) { - if (cert == null) - return false; - - // see if we are ignoring the identity scope or not - if (ignoreIdentityScope) - return false; - - // try to initialize scope - synchronized(PolicyFile.class) { - if (scope == null) { - IdentityScope is = IdentityScope.getSystemScope(); - - if (is instanceof sun.security.provider.IdentityDatabase) { - scope = is; - } else { - // leave scope null - } - } - } - - if (scope == null) { - ignoreIdentityScope = true; - return false; - } - - // need privileged block for getIdentity in case we are trying - // to get a signer - final Identity id = AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Identity run() { - return scope.getIdentity(cert.getPublicKey()); - } - }); - - if (isTrusted(id)) { - if (debug != null) { - debug.println("Adding policy entry for trusted Identity: "); - //needed for identity toString! - AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Void run() { - debug.println(" identity = " + id); - return null; - } - }); - debug.println(""); - } - - // add it to the policy for future reference - Certificate certs[] = new Certificate[] {cert}; - PolicyEntry pe = new PolicyEntry(new CodeSource(null, certs)); - pe.add(SecurityConstants.ALL_PERMISSION); - - myInfo.identityPolicyEntries.add(pe); - - // add it to the mapping as well so - // we don't have to go through this again - myInfo.aliasMapping.put(cert, id.getName()); - - return true; - } return false; } - private static boolean isTrusted(Identity id) { - if (id instanceof SystemIdentity) { - SystemIdentity sysid = (SystemIdentity)id; - if (sysid.isTrusted()) { - return true; - } - } else if (id instanceof SystemSigner) { - SystemSigner sysid = (SystemSigner)id; - if (sysid.isTrusted()) { - return true; - } - } - return false; - } - /** * Each entry in the policy configuration file is represented by a * PolicyEntry object.

      diff --git a/jdk/src/share/classes/sun/security/provider/SystemIdentity.java b/jdk/src/share/classes/sun/security/provider/SystemIdentity.java deleted file mode 100644 index 7759bbca9aa..00000000000 --- a/jdk/src/share/classes/sun/security/provider/SystemIdentity.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 1996-2000 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - */ - -package sun.security.provider; - -import java.io.Serializable; -import java.util.Enumeration; -import java.security.*; - -/** - * An identity with a very simple trust mechanism. - * - * @author Benjamin Renaud - */ - -public class SystemIdentity extends Identity implements Serializable { - - /** use serialVersionUID from JDK 1.1. for interoperability */ - private static final long serialVersionUID = 9060648952088498478L; - - /* This should be changed to ACL */ - boolean trusted = false; - - /* Free form additional information about this identity. */ - private String info; - - public SystemIdentity(String name, IdentityScope scope) - throws InvalidParameterException, KeyManagementException { - super(name, scope); - } - - /** - * Is this identity trusted by sun.* facilities? - */ - public boolean isTrusted() { - return trusted; - } - - /** - * Set the trust status of this identity. - */ - protected void setTrusted(boolean trusted) { - this.trusted = trusted; - } - - void setIdentityInfo(String info) { - super.setInfo(info); - } - - String getIndentityInfo() { - return super.getInfo(); - } - - /** - * Call back method into a protected method for package friends. - */ - void setIdentityPublicKey(PublicKey key) throws KeyManagementException { - setPublicKey(key); - } - - /** - * Call back method into a protected method for package friends. - */ - void addIdentityCertificate(Certificate cert) - throws KeyManagementException { - addCertificate(cert); - } - - void clearCertificates() throws KeyManagementException { - Certificate[] certs = certificates(); - for (int i = 0; i < certs.length; i++) { - removeCertificate(certs[i]); - } - } - - public String toString() { - String trustedString = "not trusted"; - if (trusted) { - trustedString = "trusted"; - } - return super.toString() + "[" + trustedString + "]"; - } - - -} diff --git a/jdk/src/share/classes/sun/security/provider/SystemSigner.java b/jdk/src/share/classes/sun/security/provider/SystemSigner.java deleted file mode 100644 index 4bd2ee8db23..00000000000 --- a/jdk/src/share/classes/sun/security/provider/SystemSigner.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 1996-2000 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - */ - -package sun.security.provider; - -import java.util.*; -import java.security.*; - -/** - * SunSecurity signer. Like SystemIdentity, it has a trust bit, which - * can be set by SunSecurity classes, and a set of accessors for other - * classes in sun.security.*. - * - * @author Benjamin Renaud - */ - -public class SystemSigner extends Signer { - - /** use serialVersionUID from JDK 1.1. for interoperability */ - private static final long serialVersionUID = -2127743304301557711L; - - /* Is this signer trusted */ - private boolean trusted = false; - - /** - * Construct a signer with a given name. - */ - public SystemSigner(String name) { - super(name); - } - - /** - * Construct a signer with a name and a scope. - * - * @param name the signer's name. - * - * @param scope the scope for this signer. - */ - public SystemSigner(String name, IdentityScope scope) - throws KeyManagementException { - - super(name, scope); - } - - /* Set the trust status of this signer */ - void setTrusted(boolean trusted) { - this.trusted = trusted; - } - - /** - * Returns true if this signer is trusted. - */ - public boolean isTrusted() { - return trusted; - } - - /* friendly callback for set keys */ - void setSignerKeyPair(KeyPair pair) - throws InvalidParameterException, KeyException { - setKeyPair(pair); - } - - /* friendly callback for getting private keys */ - PrivateKey getSignerPrivateKey() { - return getPrivateKey(); - } - - void setSignerInfo(String s) { - setInfo(s); - } - - /** - * Call back method into a protected method for package friends. - */ - void addSignerCertificate(Certificate cert) throws KeyManagementException { - addCertificate(cert); - } - - void clearCertificates() throws KeyManagementException { - Certificate[] certs = certificates(); - for (int i = 0; i < certs.length; i++) { - removeCertificate(certs[i]); - } - } - - public String toString() { - String trustedString = "not trusted"; - if (trusted) { - trustedString = "trusted"; - } - return super.toString() + "[" + trustedString + "]"; - } -} diff --git a/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java b/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java index e7b148fbc7c..c80888f9c1e 100644 --- a/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java +++ b/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java @@ -574,10 +574,18 @@ public final class OCSPResponse { (singleExtDer.length); for (int i = 0; i < singleExtDer.length; i++) { Extension ext = new Extension(singleExtDer[i]); - singleExtensions.put(ext.getId(), ext); if (DEBUG != null) { DEBUG.println("OCSP single extension: " + ext); } + // We don't support any extensions yet. Therefore, if it + // is critical we must throw an exception because we + // don't know how to process it. + if (ext.isCritical()) { + throw new IOException( + "Unsupported OCSP critical extension: " + + ext.getExtensionId()); + } + singleExtensions.put(ext.getId(), ext); } } else { singleExtensions = Collections.emptyMap(); diff --git a/jdk/src/share/classes/sun/security/ssl/krb5/KerberosClientKeyExchangeImpl.java b/jdk/src/share/classes/sun/security/ssl/krb5/KerberosClientKeyExchangeImpl.java index d0f95758c49..28af066e260 100644 --- a/jdk/src/share/classes/sun/security/ssl/krb5/KerberosClientKeyExchangeImpl.java +++ b/jdk/src/share/classes/sun/security/ssl/krb5/KerberosClientKeyExchangeImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,11 +50,12 @@ import sun.security.krb5.internal.EncTicketPart; import sun.security.krb5.internal.crypto.KeyUsage; import sun.security.jgss.krb5.Krb5Util; +import sun.security.krb5.KrbException; +import sun.security.krb5.internal.Krb5; import sun.security.ssl.Debug; import sun.security.ssl.HandshakeInStream; import sun.security.ssl.HandshakeOutStream; -import sun.security.ssl.KerberosClientKeyExchange; import sun.security.ssl.ProtocolVersion; /** @@ -188,7 +189,14 @@ public final class KerberosClientKeyExchangeImpl // See if we have the right key to decrypt the ticket to get // the session key. int encPartKeyType = encPart.getEType(); - KerberosKey dkey = findKey(encPartKeyType, serverKeys); + Integer encPartKeyVersion = encPart.getKeyVersionNumber(); + KerberosKey dkey = null; + try { + dkey = findKey(encPartKeyType, encPartKeyVersion, serverKeys); + } catch (KrbException ke) { // a kvno mismatch + throw new IOException( + "Cannot find key matching version number", ke); + } if (dkey == null) { // %%% Should print string repr of etype throw new IOException( @@ -355,12 +363,34 @@ public final class KerberosClientKeyExchangeImpl return localPrincipal; } - private static KerberosKey findKey(int etype, KerberosKey[] keys) { + /** + * Determines if a kvno matches another kvno. Used in the method + * findKey(etype, version, keys). Always returns true if either input + * is null or zero, in case any side does not have kvno info available. + * + * Note: zero is included because N/A is not a legal value for kvno + * in javax.security.auth.kerberos.KerberosKey. Therefore, the info + * that the kvno is N/A might be lost when converting between + * EncryptionKey and KerberosKey. + */ + private static boolean versionMatches(Integer v1, int v2) { + if (v1 == null || v1 == 0 || v2 == 0) { + return true; + } + return v1.equals(v2); + } + + private static KerberosKey findKey(int etype, Integer version, + KerberosKey[] keys) throws KrbException { int ktype; + boolean etypeFound = false; for (int i = 0; i < keys.length; i++) { ktype = keys[i].getKeyType(); if (etype == ktype) { - return keys[i]; + etypeFound = true; + if (versionMatches(version, keys[i].getVersionNumber())) { + return keys[i]; + } } } // Key not found. @@ -370,14 +400,20 @@ public final class KerberosClientKeyExchangeImpl for (int i = 0; i < keys.length; i++) { ktype = keys[i].getKeyType(); if (ktype == EncryptedData.ETYPE_DES_CBC_CRC || - ktype == EncryptedData.ETYPE_DES_CBC_MD5) { - return new KerberosKey(keys[i].getPrincipal(), - keys[i].getEncoded(), - etype, - keys[i].getVersionNumber()); + ktype == EncryptedData.ETYPE_DES_CBC_MD5) { + etypeFound = true; + if (versionMatches(version, keys[i].getVersionNumber())) { + return new KerberosKey(keys[i].getPrincipal(), + keys[i].getEncoded(), + etype, + keys[i].getVersionNumber()); + } } } } + if (etypeFound) { + throw new KrbException(Krb5.KRB_AP_ERR_BADKEYVER); + } return null; } } diff --git a/jdk/src/share/classes/sun/security/tools/JarSigner.java b/jdk/src/share/classes/sun/security/tools/JarSigner.java index 005d8aa1bfd..5c824c5712f 100644 --- a/jdk/src/share/classes/sun/security/tools/JarSigner.java +++ b/jdk/src/share/classes/sun/security/tools/JarSigner.java @@ -118,8 +118,6 @@ public class JarSigner { KeyStore store; // the keystore specified by -keystore // or the default keystore, never null - IdentityScope scope; - String keystore; // key store file boolean nullStream = false; // null keystore input stream (NONE) boolean token = false; // token-based keystore @@ -212,7 +210,6 @@ public class JarSigner { if (verify) { try { loadKeyStore(keystore, false); - scope = IdentityScope.getSystemScope(); } catch (Exception e) { if ((keystore != null) || (storepass != null)) { System.out.println(rb.getString("jarsigner error: ") + @@ -984,13 +981,6 @@ public class JarSigner { result |= IN_KEYSTORE; } } - if (!found && (scope != null)) { - Identity id = scope.getIdentity(c.getPublicKey()); - if (id != null) { - result |= IN_SCOPE; - storeHash.put(c, "[" + id.getName() + "]"); - } - } if (ckaliases.contains(alias)) { result |= SIGNED_BY_ALIAS; } diff --git a/jdk/src/share/classes/sun/security/tools/KeyTool.java b/jdk/src/share/classes/sun/security/tools/KeyTool.java index b3b0f7365ab..d3031ad77f0 100644 --- a/jdk/src/share/classes/sun/security/tools/KeyTool.java +++ b/jdk/src/share/classes/sun/security/tools/KeyTool.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,6 @@ import java.security.UnrecoverableEntryException; import java.security.UnrecoverableKeyException; import java.security.Principal; import java.security.Provider; -import java.security.Identity; import java.security.cert.Certificate; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; @@ -57,9 +56,6 @@ import java.net.URLClassLoader; import sun.misc.BASE64Encoder; import sun.security.util.ObjectIdentifier; import sun.security.pkcs.PKCS10; -import sun.security.provider.IdentityDatabase; -import sun.security.provider.SystemSigner; -import sun.security.provider.SystemIdentity; import sun.security.provider.X509Factory; import sun.security.util.DerOutputStream; import sun.security.util.Password; @@ -81,6 +77,7 @@ import sun.security.x509.*; import static java.security.KeyStore.*; import static sun.security.tools.KeyTool.Command.*; +import static sun.security.tools.KeyTool.Option.*; /** * This tool manages keystores. @@ -154,77 +151,77 @@ public final class KeyTool { enum Command { CERTREQ("Generates a certificate request", - "-alias", "-sigalg", "-file", "-keypass", "-keystore", - "-storepass", "-storetype", "-providername", "-providerclass", - "-providerarg", "-providerpath", "-v", "-protected"), + ALIAS, SIGALG, FILEOUT, KEYPASS, KEYSTORE, DNAME, + STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS, + PROVIDERARG, PROVIDERPATH, V, PROTECTED), CHANGEALIAS("Changes an entry's alias", - "-alias", "-destalias", "-keypass", "-keystore", "-storepass", - "-storetype", "-providername", "-providerclass", "-providerarg", - "-providerpath", "-v", "-protected"), + ALIAS, DESTALIAS, KEYPASS, KEYSTORE, STOREPASS, + STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, + PROVIDERPATH, V, PROTECTED), DELETE("Deletes an entry", - "-alias", "-keystore", "-storepass", "-storetype", - "-providername", "-providerclass", "-providerarg", - "-providerpath", "-v", "-protected"), + ALIAS, KEYSTORE, STOREPASS, STORETYPE, + PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, + PROVIDERPATH, V, PROTECTED), EXPORTCERT("Exports certificate", - "-rfc", "-alias", "-file", "-keystore", "-storepass", - "-storetype", "-providername", "-providerclass", "-providerarg", - "-providerpath", "-v", "-protected"), + RFC, ALIAS, FILEOUT, KEYSTORE, STOREPASS, + STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, + PROVIDERPATH, V, PROTECTED), GENKEYPAIR("Generates a key pair", - "-alias", "-keyalg", "-keysize", "-sigalg", "-destalias", - "-startdate", "-ext", "-validity", "-keypass", "-keystore", - "-storepass", "-storetype", "-providername", "-providerclass", - "-providerarg", "-providerpath", "-v", "-protected"), + ALIAS, KEYALG, KEYSIZE, SIGALG, DESTALIAS, DNAME, + STARTDATE, EXT, VALIDITY, KEYPASS, KEYSTORE, + STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS, + PROVIDERARG, PROVIDERPATH, V, PROTECTED), GENSECKEY("Generates a secret key", - "-alias", "-keypass", "-keyalg", "-keysize", "-keystore", - "-storepass", "-storetype", "-providername", "-providerclass", - "-providerarg", "-providerpath", "-v", "-protected"), + ALIAS, KEYPASS, KEYALG, KEYSIZE, KEYSTORE, + STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS, + PROVIDERARG, PROVIDERPATH, V, PROTECTED), GENCERT("Generates certificate from a certificate request", - "-rfc", "-infile", "-outfile", "-alias", "-sigalg", - "-startdate", "-ext", "-validity", "-keypass", "-keystore", - "-storepass", "-storetype", "-providername", "-providerclass", - "-providerarg", "-providerpath", "-v", "-protected"), + RFC, INFILE, OUTFILE, ALIAS, SIGALG, DNAME, + STARTDATE, EXT, VALIDITY, KEYPASS, KEYSTORE, + STOREPASS, STORETYPE, PROVIDERNAME, PROVIDERCLASS, + PROVIDERARG, PROVIDERPATH, V, PROTECTED), IDENTITYDB("Imports entries from a JDK 1.1.x-style identity database", - "-file", "-storetype", "-keystore", "-storepass", "-providername", - "-providerclass", "-providerarg", "-providerpath", "-v"), + FILEIN, STORETYPE, KEYSTORE, STOREPASS, PROVIDERNAME, + PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V), IMPORTCERT("Imports a certificate or a certificate chain", - "-noprompt", "-trustcacerts", "-protected", "-alias", "-file", - "-keypass", "-keystore", "-storepass", "-storetype", - "-providername", "-providerclass", "-providerarg", - "-providerpath", "-v"), + NOPROMPT, TRUSTCACERTS, PROTECTED, ALIAS, FILEIN, + KEYPASS, KEYSTORE, STOREPASS, STORETYPE, + PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, + PROVIDERPATH, V), IMPORTKEYSTORE("Imports one or all entries from another keystore", - "-srckeystore", "-destkeystore", "-srcstoretype", - "-deststoretype", "-srcstorepass", "-deststorepass", - "-srcprotected", "-srcprovidername", "-destprovidername", - "-srcalias", "-destalias", "-srckeypass", "-destkeypass", - "-noprompt", "-providerclass", "-providerarg", "-providerpath", - "-v"), + SRCKEYSTORE, DESTKEYSTORE, SRCSTORETYPE, + DESTSTORETYPE, SRCSTOREPASS, DESTSTOREPASS, + SRCPROTECTED, SRCPROVIDERNAME, DESTPROVIDERNAME, + SRCALIAS, DESTALIAS, SRCKEYPASS, DESTKEYPASS, + NOPROMPT, PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, + V), KEYCLONE("Clones a key entry", - "-alias", "-destalias", "-keypass", "-new", "-storetype", - "-keystore", "-storepass", "-providername", "-providerclass", - "-providerarg", "-providerpath", "-v"), + ALIAS, DESTALIAS, KEYPASS, NEW, STORETYPE, + KEYSTORE, STOREPASS, PROVIDERNAME, PROVIDERCLASS, + PROVIDERARG, PROVIDERPATH, V), KEYPASSWD("Changes the key password of an entry", - "-alias", "-keypass", "-new", "-keystore", "-storepass", - "-storetype", "-providername", "-providerclass", "-providerarg", - "-providerpath", "-v"), + ALIAS, KEYPASS, NEW, KEYSTORE, STOREPASS, + STORETYPE, PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, + PROVIDERPATH, V), LIST("Lists entries in a keystore", - "-rfc", "-alias", "-keystore", "-storepass", "-storetype", - "-providername", "-providerclass", "-providerarg", - "-providerpath", "-v", "-protected"), + RFC, ALIAS, KEYSTORE, STOREPASS, STORETYPE, + PROVIDERNAME, PROVIDERCLASS, PROVIDERARG, + PROVIDERPATH, V, PROTECTED), PRINTCERT("Prints the content of a certificate", - "-rfc", "-file", "-sslserver", "-jarfile", "-v"), + RFC, FILEIN, SSLSERVER, JARFILE, V), PRINTCERTREQ("Prints the content of a certificate request", - "-file", "-v"), + FILEIN, V), SELFCERT("Generates a self-signed certificate", - "-alias", "-sigalg", "-dname", "-startdate", "-validity", "-keypass", - "-storetype", "-keystore", "-storepass", "-providername", - "-providerclass", "-providerarg", "-providerpath", "-v"), + ALIAS, SIGALG, DNAME, STARTDATE, VALIDITY, KEYPASS, + STORETYPE, KEYSTORE, STOREPASS, PROVIDERNAME, + PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V), STOREPASSWD("Changes the store password of a keystore", - "-new", "-keystore", "-storepass", "-storetype", "-providername", - "-providerclass", "-providerarg", "-providerpath", "-v"); + NEW, KEYSTORE, STOREPASS, STORETYPE, PROVIDERNAME, + PROVIDERCLASS, PROVIDERARG, PROVIDERPATH, V); final String description; - final String[] options; - Command(String d, String... o) { + final Option[] options; + Command(String d, Option... o) { description = d; options = o; } @@ -234,50 +231,60 @@ public final class KeyTool { } }; - private static String[][] options = { - // name, arg, description - {"-alias", "", "alias name of the entry to process"}, - {"-destalias", "", "destination alias"}, - {"-destkeypass", "", "destination key password"}, - {"-destkeystore", "", "destination keystore name"}, - {"-destprotected", null, "destination keystore password protected"}, - {"-destprovidername", "", "destination keystore provider name"}, - {"-deststorepass", "", "destination keystore password"}, - {"-deststoretype", "", "destination keystore type"}, - {"-dname", "", "distinguished name"}, - {"-ext", "", "X.509 extension"}, - {"-file", "", "output file name"}, - {"-file", "", "input file name"}, - {"-infile", "", "input file name"}, - {"-keyalg", "", "key algorithm name"}, - {"-keypass", "", "key password"}, - {"-keysize", "", "key bit size"}, - {"-keystore", "", "keystore name"}, - {"-new", "", "new password"}, - {"-noprompt", null, "do not prompt"}, - {"-outfile", "", "output file name"}, - {"-protected", null, "password through protected mechanism"}, - {"-providerarg", "", "provider argument"}, - {"-providerclass", "", "provider class name"}, - {"-providername", "", "provider name"}, - {"-providerpath", "", "provider classpath"}, - {"-rfc", null, "output in RFC style"}, - {"-sigalg", "", "signature algorithm name"}, - {"-srcalias", "", "source alias"}, - {"-srckeypass", "", "source keystore password"}, - {"-srckeystore", "", "source keystore name"}, - {"-srcprotected", null, "source keystore password protected"}, - {"-srcprovidername", "", "source keystore provider name"}, - {"-srcstorepass", "", "source keystore password"}, - {"-srcstoretype", "", "source keystore type"}, - {"-sslserver", "", "SSL server host and port"}, - {"-jarfile", "", "signed jar file"}, - {"-startdate", "", "certificate validity start date/time"}, - {"-storepass", "", "keystore password"}, - {"-storetype", "", "keystore type"}, - {"-trustcacerts", null, "trust certificates from cacerts"}, - {"-v", null, "verbose output"}, - {"-validity", "", "validity number of days"}, + enum Option { + ALIAS("alias", "", "alias name of the entry to process"), + DESTALIAS("destalias", "", "destination alias"), + DESTKEYPASS("destkeypass", "", "destination key password"), + DESTKEYSTORE("destkeystore", "", "destination keystore name"), + DESTPROTECTED("destprotected", null, "destination keystore password protected"), + DESTPROVIDERNAME("destprovidername", "", "destination keystore provider name"), + DESTSTOREPASS("deststorepass", "", "destination keystore password"), + DESTSTORETYPE("deststoretype", "", "destination keystore type"), + DNAME("dname", "", "distinguished name"), + EXT("ext", "", "X.509 extension"), + FILEOUT("file", "", "output file name"), + FILEIN("file", "", "input file name"), + INFILE("infile", "", "input file name"), + KEYALG("keyalg", "", "key algorithm name"), + KEYPASS("keypass", "", "key password"), + KEYSIZE("keysize", "", "key bit size"), + KEYSTORE("keystore", "", "keystore name"), + NEW("new", "", "new password"), + NOPROMPT("noprompt", null, "do not prompt"), + OUTFILE("outfile", "", "output file name"), + PROTECTED("protected", null, "password through protected mechanism"), + PROVIDERARG("providerarg", "", "provider argument"), + PROVIDERCLASS("providerclass", "", "provider class name"), + PROVIDERNAME("providername", "", "provider name"), + PROVIDERPATH("providerpath", "", "provider classpath"), + RFC("rfc", null, "output in RFC style"), + SIGALG("sigalg", "", "signature algorithm name"), + SRCALIAS("srcalias", "", "source alias"), + SRCKEYPASS("srckeypass", "", "source keystore password"), + SRCKEYSTORE("srckeystore", "", "source keystore name"), + SRCPROTECTED("srcprotected", null, "source keystore password protected"), + SRCPROVIDERNAME("srcprovidername", "", "source keystore provider name"), + SRCSTOREPASS("srcstorepass", "", "source keystore password"), + SRCSTORETYPE("srcstoretype", "", "source keystore type"), + SSLSERVER("sslserver", "", "SSL server host and port"), + JARFILE("jarfile", "", "signed jar file"), + STARTDATE("startdate", "", "certificate validity start date/time"), + STOREPASS("storepass", "", "keystore password"), + STORETYPE("storetype", "", "keystore type"), + TRUSTCACERTS("trustcacerts", null, "trust certificates from cacerts"), + V("v", null, "verbose output"), + VALIDITY("validity", "", "validity number of days"); + + final String name, arg, description; + Option(String name, String arg, String description) { + this.name = name; + this.arg = arg; + this.description = description; + } + @Override + public String toString() { + return "-" + name; + } }; private static final Class[] PARAM_STRING = { String.class }; @@ -348,10 +355,10 @@ public final class KeyTool { // Check if the last option needs an arg if (i == args.length - 1) { - for (String[] option: options) { + for (Option option: Option.values()) { // Only options with an arg need to be checked - if (collator.compare(flags, option[0]) == 0) { - if (option[1] != null) errorNeedArgument(flags); + if (collator.compare(flags, option.toString()) == 0) { + if (option.arg != null) errorNeedArgument(flags); break; } } @@ -1163,18 +1170,16 @@ public final class KeyTool { Signature signature = Signature.getInstance(sigAlgName); signature.initSign(privateKey); - X500Signer signer = new X500Signer(signature, issuer); - X509CertInfo info = new X509CertInfo(); info.set(X509CertInfo.VALIDITY, interval); info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber( new java.util.Random().nextInt() & 0x7fffffff)); info.set(X509CertInfo.VERSION, - new CertificateVersion(CertificateVersion.V3)); + new CertificateVersion(CertificateVersion.V3)); info.set(X509CertInfo.ALGORITHM_ID, - new CertificateAlgorithmId(signer.getAlgorithmId())); - info.set(X509CertInfo.ISSUER, - new CertificateIssuerName(signer.getSigner())); + new CertificateAlgorithmId( + AlgorithmId.getAlgorithmId(sigAlgName))); + info.set(X509CertInfo.ISSUER, new CertificateIssuerName(issuer)); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); boolean canRead = false; @@ -1249,7 +1254,7 @@ public final class KeyTool { request.getAttributes().setAttribute(X509CertInfo.EXTENSIONS, new PKCS10Attribute(PKCS9Attribute.EXTENSION_REQUEST_OID, ext)); - // Construct an X500Signer object, so that we can sign the request + // Construct a Signature object, so that we can sign the request if (sigAlgName == null) { sigAlgName = getCompatibleSigAlgName(privKey.getAlgorithm()); } @@ -1259,10 +1264,9 @@ public final class KeyTool { X500Name subject = dname == null? new X500Name(((X509Certificate)cert).getSubjectDN().toString()): new X500Name(dname); - X500Signer signer = new X500Signer(signature, subject); // Sign the request and base-64 encode it - request.encodeAndSign(signer); + request.encodeAndSign(subject, signature); request.print(out); } @@ -1564,75 +1568,8 @@ public final class KeyTool { private void doImportIdentityDatabase(InputStream in) throws Exception { - byte[] encoded; - ByteArrayInputStream bais; - java.security.cert.X509Certificate newCert; - java.security.cert.Certificate[] chain = null; - PrivateKey privKey; - boolean modified = false; - - IdentityDatabase idb = IdentityDatabase.fromStream(in); - for (Enumeration enum_ = idb.identities(); - enum_.hasMoreElements();) { - Identity id = enum_.nextElement(); - newCert = null; - // only store trusted identities in keystore - if ((id instanceof SystemSigner && ((SystemSigner)id).isTrusted()) - || (id instanceof SystemIdentity - && ((SystemIdentity)id).isTrusted())) { - // ignore if keystore entry with same alias name already exists - if (keyStore.containsAlias(id.getName())) { - MessageFormat form = new MessageFormat - (rb.getString("Keystore entry for already exists")); - Object[] source = {id.getName()}; - System.err.println(form.format(source)); - continue; - } - java.security.Certificate[] certs = id.certificates(); - if (certs!=null && certs.length>0) { - // we can only store one user cert per identity. - // convert old-style to new-style cert via the encoding - DerOutputStream dos = new DerOutputStream(); - certs[0].encode(dos); - encoded = dos.toByteArray(); - bais = new ByteArrayInputStream(encoded); - newCert = (X509Certificate)cf.generateCertificate(bais); - bais.close(); - - // if certificate is self-signed, make sure it verifies - if (isSelfSigned(newCert)) { - PublicKey pubKey = newCert.getPublicKey(); - try { - newCert.verify(pubKey); - } catch (Exception e) { - // ignore this cert - continue; - } - } - - if (id instanceof SystemSigner) { - MessageFormat form = new MessageFormat(rb.getString - ("Creating keystore entry for ...")); - Object[] source = {id.getName()}; - System.err.println(form.format(source)); - if (chain==null) { - chain = new java.security.cert.Certificate[1]; - } - chain[0] = newCert; - privKey = ((SystemSigner)id).getPrivateKey(); - keyStore.setKeyEntry(id.getName(), privKey, storePass, - chain); - } else { - keyStore.setCertificateEntry(id.getName(), newCert); - } - kssave = true; - } - } - } - if (!kssave) { - System.err.println(rb.getString - ("No entries from identity database added")); - } + System.err.println(rb.getString + ("No entries from identity database added")); } /** @@ -3866,21 +3803,13 @@ public final class KeyTool { // Length of left side of options list int lenLeft = 0; for (int j=0; j lenLeft) { - lenLeft = left[j].length(); - } - right[j] = rb.getString(opt[2]); - found = true; - break; - } - } - if (!found) { - throw new RuntimeException("ERROR: CANNOT FIND " + command.options[j]); + Option opt = command.options[j]; + left[j] = opt.toString(); + if (opt.arg != null) left[j] += " " + opt.arg; + if (left[j].length() > lenLeft) { + lenLeft = left[j].length(); } + right[j] = rb.getString(opt.description); } for (int j=0; jSuch certificates normally are used to identify a "Certificate - * Authority" (CA). Accordingly, they will not always be accepted by - * other parties. However, such certificates are also useful when - * you are bootstrapping your security infrastructure, or deploying - * system prototypes. - * - * @deprecated Use the new - * - * @param myname X.500 name of the subject (who is also the issuer) - * @param validity how long the certificate should be valid, in seconds - */ - @Deprecated - public X509Cert getSelfCert (X500Name myname, long validity) - throws InvalidKeyException, SignatureException, NoSuchAlgorithmException - { - X509Certificate cert; - - try { - cert = getSelfCertificate(myname, validity); - return new X509Cert(cert.getEncoded()); - } catch (CertificateException e) { - throw new SignatureException(e.getMessage()); - } catch (NoSuchProviderException e) { - throw new NoSuchAlgorithmException(e.getMessage()); - } catch (IOException e) { - throw new SignatureException(e.getMessage()); - } - } - - /** * Returns a self-signed X.509v3 certificate for the public key. * The certificate is immediately valid. No extensions. @@ -248,13 +213,10 @@ public final class CertAndKeyGen { throws CertificateException, InvalidKeyException, SignatureException, NoSuchAlgorithmException, NoSuchProviderException { - X500Signer issuer; X509CertImpl cert; Date lastDate; try { - issuer = getSigner (myname); - lastDate = new Date (); lastDate.setTime (firstDate.getTime () + validity * 1000); @@ -267,14 +229,13 @@ public final class CertAndKeyGen { new CertificateVersion(CertificateVersion.V3)); info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber( new java.util.Random().nextInt() & 0x7fffffff)); - AlgorithmId algID = issuer.getAlgorithmId(); + AlgorithmId algID = AlgorithmId.getAlgorithmId(sigAlg); info.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algID)); info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(myname)); info.set(X509CertInfo.KEY, new CertificateX509Key(publicKey)); info.set(X509CertInfo.VALIDITY, interval); - info.set(X509CertInfo.ISSUER, - new CertificateIssuerName(issuer.getSigner())); + info.set(X509CertInfo.ISSUER, new CertificateIssuerName(myname)); cert = new X509CertImpl(info); cert.sign(privateKey, this.sigAlg); @@ -315,7 +276,9 @@ public final class CertAndKeyGen { PKCS10 req = new PKCS10 (publicKey); try { - req.encodeAndSign (getSigner (myname)); + Signature signature = Signature.getInstance(sigAlg); + signature.initSign (privateKey); + req.encodeAndSign(myname, signature); } catch (CertificateException e) { throw new SignatureException (sigAlg + " CertificateException"); @@ -330,18 +293,6 @@ public final class CertAndKeyGen { return req; } - private X500Signer getSigner (X500Name me) - throws InvalidKeyException, NoSuchAlgorithmException - { - Signature signature = Signature.getInstance(sigAlg); - - // XXX should have a way to pass prng to the signature - // algorithm ... appropriate for DSS/DSA, not RSA - - signature.initSign (privateKey); - return new X500Signer (signature, me); - } - private SecureRandom prng; private String sigAlg; private KeyPairGenerator keyGen; diff --git a/jdk/src/share/classes/sun/security/x509/X500Signer.java b/jdk/src/share/classes/sun/security/x509/X500Signer.java deleted file mode 100644 index b51b31d329e..00000000000 --- a/jdk/src/share/classes/sun/security/x509/X500Signer.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 1996-2003 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - */ - -package sun.security.x509; - -import java.security.Signature; -import java.security.SignatureException; -import java.security.Signer; -import java.security.NoSuchAlgorithmException; - -/** - * This class provides a binding between a Signature object and an - * authenticated X.500 name (from an X.509 certificate chain), which - * is needed in many public key signing applications. - * - *

      The name of the signer is important, both because knowing it is the - * whole point of the signature, and because the associated X.509 certificate - * is always used to verify the signature. - * - *

      The X.509 certificate chain is temporarily not associated with - * the signer, but this omission will be resolved. - * - * - * @author David Brownell - * @author Amit Kapoor - * @author Hemma Prafullchandra - */ -public final class X500Signer extends Signer -{ - private static final long serialVersionUID = -8609982645394364834L; - - /** - * Called for each chunk of the data being signed. That - * is, you can present the data in many chunks, so that - * it doesn't need to be in a single sequential buffer. - * - * @param buf buffer holding the next chunk of the data to be signed - * @param offset starting point of to-be-signed data - * @param len how many bytes of data are to be signed - * @exception SignatureException on errors. - */ - public void update(byte buf[], int offset, int len) - throws SignatureException { - sig.update (buf, offset, len); - } - - /** - * Produces the signature for the data processed by update(). - * - * @exception SignatureException on errors. - */ - public byte[] sign() throws SignatureException { - return sig.sign(); - } - - /** - * Returns the algorithm used to sign. - */ - public AlgorithmId getAlgorithmId() { - return algid; - } - - /** - * Returns the name of the signing agent. - */ - public X500Name getSigner() { - return agent; - } - - /* - * Constructs a binding between a signature and an X500 name - * from an X.509 certificate. - */ - // package private ----hmmmmm ????? - public X500Signer(Signature sig, X500Name agent) { - if (sig == null || agent == null) - throw new IllegalArgumentException ("null parameter"); - - this.sig = sig; - this.agent = agent; - - try { - this.algid = AlgorithmId.getAlgorithmId(sig.getAlgorithm()); - - } catch (NoSuchAlgorithmException e) { - throw new RuntimeException("internal error! " + e.getMessage()); - } - } - - private Signature sig; - private X500Name agent; // XXX should be X509CertChain - private AlgorithmId algid; -} diff --git a/jdk/src/share/classes/sun/security/x509/X509Cert.java b/jdk/src/share/classes/sun/security/x509/X509Cert.java deleted file mode 100644 index e90014c0493..00000000000 --- a/jdk/src/share/classes/sun/security/x509/X509Cert.java +++ /dev/null @@ -1,892 +0,0 @@ -/* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - */ - -package sun.security.x509; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; -import java.math.BigInteger; -import java.security.*; -import java.util.Date; -import java.util.Enumeration; - -import sun.security.util.*; // DER - -/** - * @author David Brownell - * - * @see CertAndKeyGen - * @deprecated Use the new X509Certificate class. - * This class is only restored for backwards compatibility. - */ -@Deprecated -public class X509Cert implements Certificate, Serializable { - - static final long serialVersionUID = -52595524744692374L; - - /* - * NOTE: All fields are marked transient, because we do not want them to - * be included in the class description when we serialize an object of - * this class. We override "writeObject" and "readObject" to use the - * ASN.1 encoding of a certificate as the serialized form, instead of - * calling the default routines which would operate on the field values. - * - * MAKE SURE TO MARK ANY FIELDS THAT ARE ADDED IN THE FUTURE AS TRANSIENT. - */ - - /* The algorithm id */ - transient protected AlgorithmId algid; - - /* - * Certificate data, and its envelope - */ - transient private byte rawCert []; - transient private byte signature []; - transient private byte signedCert []; - - /* - * X509.v1 data (parsed) - */ - transient private X500Name subject; // from subject - transient private PublicKey pubkey; - - transient private Date notafter; // from CA (constructor) - transient private Date notbefore; - - transient private int version; // from CA (signAndEncode) - transient private BigInteger serialnum; - transient private X500Name issuer; - transient private AlgorithmId issuerSigAlg; - - /* - * flag to indicate whether or not this certificate has already been parsed - * (through a call to one of the constructors or the "decode" or - * "readObject" methods). This is to ensure that certificates are - * immutable. - */ - transient private boolean parsed=false; - - /* - * X509.v2 extensions - */ - - /* - * X509.v3 extensions - */ - - /* - * Other extensions ... Netscape, Verisign, SET, etc - */ - - - /** - * Construct a uninitialized X509 Cert on which - * decode must later be called (or which may be deserialized). - */ - // XXX deprecated, delete this - public X509Cert() { } - - - /** - * Unmarshals a certificate from its encoded form, parsing the - * encoded bytes. This form of constructor is used by agents which - * need to examine and use certificate contents. That is, this is - * one of the more commonly used constructors. Note that the buffer - * must include only a certificate, and no "garbage" may be left at - * the end. If you need to ignore data at the end of a certificate, - * use another constructor. - * - * @param cert the encoded bytes, with no terminatu (CONSUMED) - * @exception IOException when the certificate is improperly encoded. - */ - public X509Cert(byte cert []) throws IOException - { - DerValue in = new DerValue (cert); - parse (in); - if (in.data.available () != 0) - throw new CertParseError ("garbage at end"); - signedCert = cert; - } - - - /** - * Unmarshals a certificate from its encoded form, parsing the - * encoded bytes. This form of constructor is used by agents which - * need to examine and use certificate contents. That is, this is - * one of the most commonly used constructors. - * - * @param buf the buffer holding the encoded bytes - * @param offset the offset in the buffer where the bytes begin - * @param len how many bytes of certificate exist - * - * @exception IOException when the certificate is improperly encoded. - */ - public X509Cert(byte buf [], int offset, int len) throws IOException - { - DerValue in = new DerValue (buf, offset, len); - - parse (in); - if (in.data.available () != 0) - throw new CertParseError ("garbage at end"); - signedCert = new byte [len]; - System.arraycopy (buf, offset, signedCert, 0, len); - } - - - /** - * Unmarshal a certificate from its encoded form, parsing a DER value. - * This form of constructor is used by agents which need to examine - * and use certificate contents. - * - * @param derVal the der value containing the encoded cert. - * @exception IOException when the certificate is improperly encoded. - */ - public X509Cert(DerValue derVal) throws IOException - { - parse (derVal); - if (derVal.data.available () != 0) - throw new CertParseError ("garbage at end"); - signedCert = derVal.toByteArray (); - } - - - /** - * Partially constructs a certificate from descriptive parameters. - * This constructor may be used by Certificate Authority (CA) code, - * which later signs and encodes the - * certificate. Also, self-signed certificates serve as CA certificates, - * and are sometimes used as certificate requests. - * - *

      Until the certificate has been signed and encoded, some of - * the mandatory fields in the certificate will not be available - * via accessor functions: the serial number, issuer name and signing - * algorithm, and of course the signed certificate. The fields passed - * to this constructor are available, and must be non-null. - * - *

      Note that the public key being signed is generally independent of - * the signature algorithm being used. So for example Diffie-Hellman - * keys (which do not support signatures) can be placed in X.509 - * certificates when some other signature algorithm (e.g. DSS/DSA, - * or one of the RSA based algorithms) is used. - * - * @see CertAndKeyGen - * - * @param subjectName the X.500 distinguished name being certified - * @param subjectPublicKey the public key being certified. This - * must be an "X509Key" implementing the "PublicKey" interface. - * @param notBefore the first time the certificate is valid - * @param notAfter the last time the certificate is valid - * - * @exception CertException if the public key is inappropriate - */ - public X509Cert(X500Name subjectName, X509Key subjectPublicKey, - Date notBefore, Date notAfter) throws CertException - { - subject = subjectName; - - if (!(subjectPublicKey instanceof PublicKey)) - throw new CertException (CertException.err_INVALID_PUBLIC_KEY, - "Doesn't implement PublicKey interface"); - - // The X509 cert API requires X509 keys, else things break. - pubkey = subjectPublicKey; - notbefore = notBefore; - notafter = notAfter; - version = 0; - } - - - /** - * Decode an X.509 certificate from an input stream. - * - * @param in an input stream holding at least one certificate - * @exception IOException when the certificate is improperly encoded, or - * if it has already been parsed. - */ - public void decode(InputStream in) throws IOException - { - DerValue val = new DerValue(in); - parse(val); - signedCert = val.toByteArray(); - } - - - /** - * Appends the certificate to an output stream. - * - * @param out an input stream to which the certificate is appended. - * @exception IOException when appending fails. - */ - public void encode (OutputStream out) throws IOException - { out.write (getSignedCert ()); } - - - /** - * Compares two certificates. This is false if the - * certificates are not both X.509 certs, otherwise it - * compares them as binary data. - * - * @param other the object being compared with this one - * @return true iff the certificates are equivalent - */ - public boolean equals (Object other) - { - if (other instanceof X509Cert) - return equals ((X509Cert) other); - else - return false; - } - - - /** - * Compares two certificates, returning false if any data - * differs between the two. - * - * @param other the object being compared with this one - * @return true iff the certificates are equivalent - */ - public boolean equals (X509Cert src) - { - if (this == src) - return true; - if (signedCert == null || src.signedCert == null) - return false; - if (signedCert.length != src.signedCert.length) - return false; - for (int i = 0; i < signedCert.length; i++) - if (signedCert [i] != src.signedCert [i]) - return false; - return true; - } - - - /** Returns the "X.509" format identifier. */ - public String getFormat () // for Certificate - { return "X.509"; } - - - /** Returns getIssuerName */ - public Principal getGuarantor () // for Certificate - { return getIssuerName (); } - - - /** Returns getSubjectName */ - public Principal getPrincipal () - { return getSubjectName (); } - - - /** - * Throws an exception if the certificate is invalid because it is - * now outside of the certificate's validity period, or because it - * was not signed using the verification key provided. Successfully - * verifying a certificate does not indicate that one should - * trust the entity which it represents. - * - *

      Note that since this class represents only a single X.509 - * certificate, it cannot know anything about the certificate chain - * which is used to provide the verification key and to establish trust. - * Other code must manage and use those cert chains. - * - *

      For now, you must walk the cert chain being used to verify any - * given cert. Start at the root, which is a self-signed certificate; - * verify it using the key inside the certificate. Then use that to - * verify the next certificate in the chain, issued by that CA. In - * this manner, verify each certificate until you reach the particular - * certificate you wish to verify. You should not use a certificate - * if any of the verification operations for its certificate chain - * were unsuccessful. - * - * - * @param issuerPublicKey the public key of the issuing CA - * @exception CertException when the certificate is not valid. - */ - public void verify (PublicKey issuerPublicKey) - throws CertException - { - Date now = new Date (); - - if (now.before (notbefore)) - throw new CertException (CertException.verf_INVALID_NOTBEFORE); - if (now.after (notafter)) - throw new CertException (CertException.verf_INVALID_EXPIRED); - if (signedCert == null) - throw new CertException (CertException.verf_INVALID_SIG, - "?? certificate is not signed yet ??"); - - // - // Verify the signature ... - // - String algName = null; - - try { - Signature sigVerf = null; - - algName = issuerSigAlg.getName(); - sigVerf = Signature.getInstance(algName); - sigVerf.initVerify (issuerPublicKey); - sigVerf.update (rawCert, 0, rawCert.length); - - if (!sigVerf.verify (signature)) { - throw new CertException (CertException.verf_INVALID_SIG, - "Signature ... by <" + issuer + "> for <" + subject + ">"); - } - - // Gag -- too many catch clauses, let most through. - - } catch (NoSuchAlgorithmException e) { - throw new CertException (CertException.verf_INVALID_SIG, - "Unsupported signature algorithm (" + algName + ")"); - - } catch (InvalidKeyException e) { - // e.printStackTrace(); - throw new CertException (CertException.err_INVALID_PUBLIC_KEY, - "Algorithm (" + algName + ") rejected public key"); - - } catch (SignatureException e) { - throw new CertException (CertException.verf_INVALID_SIG, - "Signature by <" + issuer + "> for <" + subject + ">"); - } - } - - - /** - * Creates an X.509 certificate, and signs it using the issuer - * passed (associating a signature algorithm and an X.500 name). - * This operation is used to implement the certificate generation - * functionality of a certificate authority. - * - * @see #getSignedCert - * @see #getSigner - * @see CertAndKeyGen - * - * @param serial the serial number of the certificate (non-null) - * @param issuer the certificate issuer (CA) (non-null) - * @return the signed certificate, as returned by getSignedCert - * - * @exception IOException if any of the data could not be encoded, - * or when any mandatory data was omitted - * @exception SignatureException on signing failures - */ - public byte [] - encodeAndSign ( - BigInteger serial, - X500Signer issuer - ) throws IOException, SignatureException - { - rawCert = null; - - /* - * Get the remaining cert parameters, and make sure we have enough. - * - * We deduce version based on what attribute data are available - * For now, we have no attributes, so we always deduce X.509v1 ! - */ - version = 0; - serialnum = serial; - this.issuer = issuer.getSigner (); - issuerSigAlg = issuer.getAlgorithmId (); - - if (subject == null || pubkey == null - || notbefore == null || notafter == null) - throw new IOException ("not enough cert parameters"); - - /* - * Encode the raw cert, create its signature and put it - * into the envelope. - */ - rawCert = DERencode (); - signedCert = sign (issuer, rawCert); - return signedCert; - } - - - /** - * Returns an X500Signer that may be used to create signatures. Those - * signature may in turn be verified using this certificate (or a - * copy of it). - * - *

      NOTE: If the private key is by itself capable of - * creating signatures, this fact may not be recognized at this time. - * Specifically, the case of DSS/DSA keys which get their algorithm - * parameters from higher in the certificate chain is not supportable - * without using an X509CertChain API, and there is no current support - * for other sources of algorithm parameters. - * - * @param algorithm the signature algorithm to be used. Note that a - * given public/private key pair may support several such algorithms. - * @param privateKey the private key used to create the signature, - * which must correspond to the public key in this certificate - * @return the Signer object - * - * @exception NoSuchAlgorithmException if the signature - * algorithm is not supported - * @exception InvalidKeyException if either the key in the certificate, - * or the private key parameter, does not support the requested - * signature algorithm - */ - public X500Signer getSigner (AlgorithmId algorithmId, - PrivateKey privateKey) - throws NoSuchAlgorithmException, InvalidKeyException - { - String algorithm; - Signature sig; - - if (privateKey instanceof Key) { - Key key = (Key)privateKey; - algorithm = key.getAlgorithm(); - } else { - throw new InvalidKeyException("private key not a key!"); - } - - sig = Signature.getInstance(algorithmId.getName()); - - if (!pubkey.getAlgorithm ().equals (algorithm)) { - - throw new InvalidKeyException( "Private key algorithm " + - algorithm + - " incompatible with certificate " + - pubkey.getAlgorithm()); - } - sig.initSign (privateKey); - return new X500Signer (sig, subject); - } - - - /** - * Returns a signature object that may be used to verify signatures - * created using a specified signature algorithm and the public key - * contained in this certificate. - * - *

      NOTE: If the public key in this certificate is not by - * itself capable of verifying signatures, this may not be recognized - * at this time. Specifically, the case of DSS/DSA keys which get - * their algorithm parameters from higher in the certificate chain - * is not supportable without using an X509CertChain API, and there - * is no current support for other sources of algorithm parameters. - * - * @param algorithm the algorithm of the signature to be verified - * @return the Signature object - * @exception NoSuchAlgorithmException if the signature - * algorithm is not supported - * @exception InvalidKeyException if the key in the certificate - * does not support the requested signature algorithm - */ - public Signature getVerifier(String algorithm) - throws NoSuchAlgorithmException, InvalidKeyException - { - String algName; - Signature sig; - - sig = Signature.getInstance(algorithm); - sig.initVerify (pubkey); - return sig; - } - - - - /** - * Return the signed X.509 certificate as a byte array. - * The bytes are in standard DER marshaled form. - * Null is returned in the case of a partially constructed cert. - */ - public byte [] getSignedCert () - { return signedCert.clone(); } - - - /** - * Returns the certificate's serial number. - * Null is returned in the case of a partially constructed cert. - */ - public BigInteger getSerialNumber () - { return serialnum; } - - - /** - * Returns the subject's X.500 distinguished name. - */ - public X500Name getSubjectName () - { return subject; } - - - /** - * Returns the certificate issuer's X.500 distinguished name. - * Null is returned in the case of a partially constructed cert. - */ - public X500Name getIssuerName () - { return issuer; } - - - /** - * Returns the algorithm used by the issuer to sign the certificate. - * Null is returned in the case of a partially constructed cert. - */ - public AlgorithmId getIssuerAlgorithmId () - { return issuerSigAlg; } - - - /** - * Returns the first time the certificate is valid. - */ - public Date getNotBefore () - { return new Date(notbefore.getTime()); } - - - /** - * Returns the last time the certificate is valid. - */ - public Date getNotAfter () - { return new Date(notafter.getTime()); } - - - /** - * Returns the subject's public key. Note that some public key - * algorithms support an optional certificate generation policy - * where the keys in the certificates are not in themselves sufficient - * to perform a public key operation. Those keys need to be augmented - * by algorithm parameters, which the certificate generation policy - * chose not to place in the certificate. - * - *

      Two such public key algorithms are: DSS/DSA, where algorithm - * parameters could be acquired from a CA certificate in the chain - * of issuers; and Diffie-Hellman, with a similar solution although - * the CA then needs both a Diffie-Hellman certificate and a signature - * capable certificate. - */ - public PublicKey getPublicKey () - { return pubkey; } - - - /** - * Returns the X.509 version number of this certificate, zero based. - * That is, "2" indicates an X.509 version 3 (1993) certificate, - * and "0" indicates X.509v1 (1988). - * Zero is returned in the case of a partially constructed cert. - */ - public int getVersion () - { return version; } - - - /** - * Calculates a hash code value for the object. Objects - * which are equal will also have the same hashcode. - */ - public int hashCode () - { - int retval = 0; - - for (int i = 0; i < signedCert.length; i++) - retval += signedCert [i] * i; - return retval; - } - - - /** - * Returns a printable representation of the certificate. This does not - * contain all the information available to distinguish this from any - * other certificate. The certificate must be fully constructed - * before this function may be called; in particular, if you are - * creating certificates you must call encodeAndSign() before calling - * this function. - */ - public String toString () - { - String s; - - if (subject == null || pubkey == null - || notbefore == null || notafter == null - || issuer == null || issuerSigAlg == null - || serialnum == null) - throw new NullPointerException ("X.509 cert is incomplete"); - - s = " X.509v" + (version + 1) + " certificate,\n"; - s += " Subject is " + subject + "\n"; - s += " Key: " + pubkey; - s += " Validity <" + notbefore + "> until <" + notafter + ">\n"; - s += " Issuer is " + issuer + "\n"; - s += " Issuer signature used " + issuerSigAlg.toString () + "\n"; - s += " Serial number = " + Debug.toHexString(serialnum) + "\n"; - - // optional v2, v3 extras - - return "[\n" + s + "]"; - } - - - /** - * Returns a printable representation of the certificate. - * - * @param detailed true iff lots of detail is requested - */ - public String toString (boolean detailed) - { return toString (); } - - - /************************************************************/ - - /* - * Cert is a SIGNED ASN.1 macro, a three elment sequence: - * - * - Data to be signed (ToBeSigned) -- the "raw" cert - * - Signature algorithm (SigAlgId) - * - The signature bits - * - * This routine unmarshals the certificate, saving the signature - * parts away for later verification. - */ - private void parse (DerValue val) throws IOException - { - if (parsed == true) { - throw new IOException("Certificate already parsed"); - } - - DerValue seq [] = new DerValue [3]; - - seq [0] = val.data.getDerValue (); - seq [1] = val.data.getDerValue (); - seq [2] = val.data.getDerValue (); - - if (val.data.available () != 0) - throw new CertParseError ("signed overrun, bytes = " - + val.data.available ()); - if (seq [0].tag != DerValue.tag_Sequence) - throw new CertParseError ("signed fields invalid"); - - rawCert = seq [0].toByteArray (); // XXX slow; fixme! - - - issuerSigAlg = AlgorithmId.parse (seq [1]); - signature = seq [2].getBitString (); - - if (seq [1].data.available () != 0) { - // XXX why was this error check commented out? - // It was originally part of the next check. - throw new CertParseError ("algid field overrun"); - } - - if (seq [2].data.available () != 0) - throw new CertParseError ("signed fields overrun"); - - /* - * Let's have fun parsing the cert itself. - */ - DerInputStream in; - DerValue tmp; - - in = seq [0].data; - - /* - * Version -- this is optional (default zero). If it's there it's - * the first field and is specially tagged. - * - * Both branches leave "tmp" holding a value for the serial - * number that comes next. - */ - version = 0; - tmp = in.getDerValue (); - if (tmp.isConstructed () && tmp.isContextSpecific ()) { - version = tmp.data.getInteger(); - if (tmp.data.available () != 0) - throw new IOException ("X.509 version, bad format"); - tmp = in.getDerValue (); - } - - /* - * serial number ... an integer - */ - serialnum = tmp.getBigInteger (); - - /* - * algorithm type for CA's signature ... needs to match the - * one on the envelope, and that's about it! different IDs - * may represent a signature attack. In general we want to - * inherit parameters. - */ - tmp = in.getDerValue (); - { - AlgorithmId algid; - - - algid = AlgorithmId.parse(tmp); - - if (!algid.equals (issuerSigAlg)) - throw new CertParseError ("CA Algorithm mismatch!"); - - this.algid = algid; - } - - /* - * issuer name - */ - issuer = new X500Name (in); - - /* - * validity: SEQUENCE { start date, end date } - */ - tmp = in.getDerValue (); - if (tmp.tag != DerValue.tag_Sequence) - throw new CertParseError ("corrupt validity field"); - - notbefore = tmp.data.getUTCTime (); - notafter = tmp.data.getUTCTime (); - if (tmp.data.available () != 0) - throw new CertParseError ("excess validity data"); - - /* - * subject name and public key - */ - subject = new X500Name (in); - - tmp = in.getDerValue (); - pubkey = X509Key.parse (tmp); - - /* - * XXX for v2 and later, a bunch of tagged options follow - */ - - if (in.available () != 0) { - /* - * Until we parse V2/V3 data ... ignore it. - * - // throw new CertParseError ("excess cert data"); - System.out.println ( - "@end'o'cert, optional V2/V3 data unparsed: " - + in.available () - + " bytes" - ); - */ - } - - parsed = true; - } - - - /* - * Encode only the parts that will later be signed. - */ - private byte [] DERencode () throws IOException - { - DerOutputStream raw = new DerOutputStream (); - - encode (raw); - return raw.toByteArray (); - } - - - /* - * Marshal the contents of a "raw" certificate into a DER sequence. - */ - private void encode (DerOutputStream out) throws IOException - { - DerOutputStream tmp = new DerOutputStream (); - - /* - * encode serial number, issuer signing algorithm, - * and issuer name into the data we'll return - */ - tmp.putInteger (serialnum); - issuerSigAlg.encode (tmp); - issuer.encode (tmp); - - /* - * Validity is a two element sequence ... encode the - * elements, then wrap them into the data we'll return - */ - { - DerOutputStream seq = new DerOutputStream (); - - seq.putUTCTime (notbefore); - seq.putUTCTime (notafter); - tmp.write (DerValue.tag_Sequence, seq); - } - - /* - * Encode subject (principal) and associated key - */ - subject.encode (tmp); - tmp.write(pubkey.getEncoded()); - - /* - * Wrap the data; encoding of the "raw" cert is now complete. - */ - out.write (DerValue.tag_Sequence, tmp); - } - - - /* - * Calculate the signature of the "raw" certificate, - * and marshal the cert with the signature and a - * description of the signing algorithm. - */ - private byte [] sign (X500Signer issuer, byte data []) - throws IOException, SignatureException - { - /* - * Encode the to-be-signed data, then the algorithm used - * to create the signature. - */ - DerOutputStream out = new DerOutputStream (); - DerOutputStream tmp = new DerOutputStream (); - - tmp.write (data); - issuer.getAlgorithmId ().encode(tmp); - - - /* - * Create and encode the signature itself. - */ - issuer.update (data, 0, data.length); - signature = issuer.sign (); - tmp.putBitString (signature); - - /* - * Wrap the signed data in a SEQUENCE { data, algorithm, sig } - */ - out.write (DerValue.tag_Sequence, tmp); - return out.toByteArray (); - } - - - /** - * Serialization write ... X.509 certificates serialize as - * themselves, and they're parsed when they get read back. - * (Actually they serialize as some type data from the - * serialization subsystem, then the cert data.) - */ - private void writeObject (java.io.ObjectOutputStream stream) - throws IOException - { encode(stream); } - - /** - * Serialization read ... X.509 certificates serialize as - * themselves, and they're parsed when they get read back. - */ - private void readObject (ObjectInputStream stream) - throws IOException - { decode(stream); } -} diff --git a/jdk/src/share/classes/sun/text/resources/FormatData_be.java b/jdk/src/share/classes/sun/text/resources/FormatData_be.java index 27b02622b20..6912fe9e23b 100644 --- a/jdk/src/share/classes/sun/text/resources/FormatData_be.java +++ b/jdk/src/share/classes/sun/text/resources/FormatData_be.java @@ -63,7 +63,7 @@ public class FormatData_be extends ListResourceBundle { "\u0436\u043d\u0456\u045e\u043d\u044f", // august "\u0432\u0435\u0440\u0430\u0441\u043d\u044f", // september "\u043a\u0430\u0441\u0442\u0440\u044b\u0447\u043d\u0456\u043a\u0430", // october - "\u043b\u0438\u0441\u0442\u0430\u043f\u0430\u0434\u0430", // november + "\u043b\u0456\u0441\u0442\u0430\u043f\u0430\u0434\u0430", // november "\u0441\u043d\u0435\u0436\u043d\u044f", // december "" // month 13 if applicable } @@ -80,7 +80,7 @@ public class FormatData_be extends ListResourceBundle { "\u0436\u043d\u0432", // abb august "\u0432\u0440\u0441", // abb september "\u043a\u0441\u0442", // abb october - "\u043b\u0441\u0442", // abb november + "\u043b\u0456\u0441", // abb november "\u0441\u043d\u0436", // abb december "" // abb month 13 if applicable } diff --git a/jdk/src/share/classes/sun/text/resources/FormatData_de.java b/jdk/src/share/classes/sun/text/resources/FormatData_de.java index 028c17344fe..745216aedad 100644 --- a/jdk/src/share/classes/sun/text/resources/FormatData_de.java +++ b/jdk/src/share/classes/sun/text/resources/FormatData_de.java @@ -130,7 +130,7 @@ public class FormatData_de extends ListResourceBundle { }, { "DateTimePatterns", new String[] { - "H.mm' Uhr 'z", // full time pattern + "HH:mm' Uhr 'z", // full time pattern "HH:mm:ss z", // long time pattern "HH:mm:ss", // medium time pattern "HH:mm", // short time pattern diff --git a/jdk/src/share/classes/sun/text/resources/FormatData_et.java b/jdk/src/share/classes/sun/text/resources/FormatData_et.java index 9413c3da6c6..bc699f75a75 100644 --- a/jdk/src/share/classes/sun/text/resources/FormatData_et.java +++ b/jdk/src/share/classes/sun/text/resources/FormatData_et.java @@ -50,35 +50,35 @@ public class FormatData_et extends ListResourceBundle { return new Object[][] { { "MonthNames", new String[] { - "Jaanuar", // january - "Veebruar", // february - "M\u00e4rts", // march - "Aprill", // april - "Mai", // may - "Juuni", // june - "Juuli", // july - "August", // august - "September", // september - "Oktoober", // october - "November", // november - "Detsember", // december + "jaanuar", // january + "veebruar", // february + "m\u00e4rts", // march + "aprill", // april + "mai", // may + "juuni", // june + "juuli", // july + "august", // august + "september", // september + "oktoober", // october + "november", // november + "detsember", // december "" // month 13 if applicable } }, { "MonthAbbreviations", new String[] { - "Jaan", // abb january - "Veebr", // abb february - "M\u00e4rts", // abb march - "Apr", // abb april - "Mai", // abb may - "Juuni", // abb june - "Juuli", // abb july - "Aug", // abb august - "Sept", // abb september - "Okt", // abb october - "Nov", // abb november - "Dets", // abb december + "jaan", // abb january + "veebr", // abb february + "m\u00e4rts", // abb march + "apr", // abb april + "mai", // abb may + "juuni", // abb june + "juuli", // abb july + "aug", // abb august + "sept", // abb september + "okt", // abb october + "nov", // abb november + "dets", // abb december "" // abb month 13 if applicable } }, diff --git a/jdk/src/share/classes/sun/text/resources/FormatData_fi.java b/jdk/src/share/classes/sun/text/resources/FormatData_fi.java index 73956ee588c..bad7e14bbb0 100644 --- a/jdk/src/share/classes/sun/text/resources/FormatData_fi.java +++ b/jdk/src/share/classes/sun/text/resources/FormatData_fi.java @@ -133,6 +133,12 @@ public class FormatData_fi extends ListResourceBundle { } }, { "DateTimePatternChars", "GanjkHmsSEDFwWxhKzZ" }, + { "AmPmMarkers", + new String[] { + "ap.", // am marker + "ip." // pm marker + } + }, }; } } diff --git a/jdk/src/share/classes/sun/text/resources/FormatData_hr_HR.java b/jdk/src/share/classes/sun/text/resources/FormatData_hr_HR.java index b6d39d332fa..0498f93a006 100644 --- a/jdk/src/share/classes/sun/text/resources/FormatData_hr_HR.java +++ b/jdk/src/share/classes/sun/text/resources/FormatData_hr_HR.java @@ -55,6 +55,19 @@ public class FormatData_hr_HR extends ListResourceBundle { "#,##0%" // percent pattern } }, + { "DateTimePatterns", + new String[] { + "HH:mm:ss z", // full time pattern + "HH:mm:ss z", // long time pattern + "HH:mm:ss", // medium time pattern + "HH:mm", // short time pattern + "yyyy. MMMM dd", // full date pattern + "yyyy. MMMM dd", // long date pattern + "dd.MM.yyyy.", // medium date pattern + "dd.MM.yy.", // short date pattern + "{1} {0}" // date-time pattern + } + } }; } } diff --git a/jdk/src/share/classes/sun/text/resources/FormatData_hu_HU.java b/jdk/src/share/classes/sun/text/resources/FormatData_hu_HU.java index d0e5a182749..1d205068d51 100644 --- a/jdk/src/share/classes/sun/text/resources/FormatData_hu_HU.java +++ b/jdk/src/share/classes/sun/text/resources/FormatData_hu_HU.java @@ -51,7 +51,7 @@ public class FormatData_hu_HU extends ListResourceBundle { { "NumberPatterns", new String[] { "#,##0.###;-#,##0.###", // decimal pattern - "\u00A4#,##0.##;-\u00A4#,##0.##", // currency pattern + "#,##0.## \u00A4;-#,##0.## \u00A4", // currency pattern "#,##0%" // percent pattern } }, diff --git a/jdk/src/share/classes/sun/text/resources/FormatData_lt.java b/jdk/src/share/classes/sun/text/resources/FormatData_lt.java index e3631389b07..55de246ded0 100644 --- a/jdk/src/share/classes/sun/text/resources/FormatData_lt.java +++ b/jdk/src/share/classes/sun/text/resources/FormatData_lt.java @@ -113,7 +113,7 @@ public class FormatData_lt extends ListResourceBundle { { "NumberElements", new String[] { ",", // decimal separator - ".", // group (thousands) separator + "\u00a0", // group (thousands) separator ";", // list separator "%", // percent sign "0", // native 0 digit @@ -133,7 +133,7 @@ public class FormatData_lt extends ListResourceBundle { "HH.mm", // short time pattern "EEEE, yyyy, MMMM d", // full date pattern "EEEE, yyyy, MMMM d", // long date pattern - "yyyy.M.d", // medium date pattern + "yyyy-MM-dd", // medium date pattern "yy.M.d", // short date pattern "{1} {0}" // date-time pattern } diff --git a/jdk/src/share/classes/sun/text/resources/FormatData_ro.java b/jdk/src/share/classes/sun/text/resources/FormatData_ro.java index 6dde8dcaf53..cf6a182bf57 100644 --- a/jdk/src/share/classes/sun/text/resources/FormatData_ro.java +++ b/jdk/src/share/classes/sun/text/resources/FormatData_ro.java @@ -90,7 +90,7 @@ public class FormatData_ro extends ListResourceBundle { "miercuri", // Wednesday "joi", // Thursday "vineri", // Friday - "s\u00eemb\u0103t\u0103" // Saturday + "s\u00e2mb\u0103t\u0103" // Saturday } }, { "DayAbbreviations", diff --git a/jdk/src/share/classes/sun/text/resources/FormatData_uk.java b/jdk/src/share/classes/sun/text/resources/FormatData_uk.java index 90f34237c13..2db4665b796 100644 --- a/jdk/src/share/classes/sun/text/resources/FormatData_uk.java +++ b/jdk/src/share/classes/sun/text/resources/FormatData_uk.java @@ -113,7 +113,7 @@ public class FormatData_uk extends ListResourceBundle { { "NumberElements", new String[] { ",", // decimal separator - ".", // group (thousands) separator + "\u00a0", // group (thousands) separator ";", // list separator "%", // percent sign "0", // native 0 digit diff --git a/jdk/src/share/classes/sun/tools/jar/JarVerifierStream.java b/jdk/src/share/classes/sun/tools/jar/JarVerifierStream.java deleted file mode 100644 index 52a48d18dd3..00000000000 --- a/jdk/src/share/classes/sun/tools/jar/JarVerifierStream.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - */ - -package sun.tools.jar; - -import java.io.*; -import java.util.*; -import java.util.zip.*; -import java.util.jar.*; -import java.security.cert.Certificate; -import java.security.AccessController; -import java.security.cert.X509Certificate; -import java.security.PublicKey; -import java.security.Principal; -import sun.security.provider.SystemIdentity; - -/** - * This is OBSOLETE. DO NOT USE THIS. Use - * java.util.jar.JarEntry.getCertificates instead. It has to stay here - * because some apps (namely HJ and HJV) call directly into it. - * - * This class is stripped down greatly from JDK 1.1.x. - * - * @author Roland Schemers - */ -public class JarVerifierStream extends ZipInputStream { - - private JarEntry current; - private Hashtable> verified - = new Hashtable>(); - private JarInputStream jis; - private sun.tools.jar.Manifest man = null; - - /** - * construct a JarVerfierStream from an input stream. - */ - public JarVerifierStream(InputStream is) - throws IOException - { - super(is); - jis = new JarInputStream(is); - } - - public void close() - throws IOException - { - jis.close(); - } - - public void closeEntry() throws IOException { - jis.closeEntry(); - } - - /** - * This method scans to see which entry we're parsing and - * keeps various state information depending on what type of - * file is being parsed. Files it treats specially are:

        - * - *
      • Manifest files. At any point, this stream can be queried - * for a manifest. If it is present, a Manifest object will be - * returned. - * - *
      • Block Signature file. Like with the manifest, the stream - * can be queried at any time for all blocks parsed thus far. - * - *
      - */ - public synchronized ZipEntry getNextEntry() throws IOException { - current = (JarEntry) jis.getNextEntry(); - return current; - } - - /** - * read a single byte. - */ - public int read() throws IOException { - int n = jis.read(); - if (n == -1) { - addIds(); - } - return n; - } - - /** - * read an array of bytes. - */ - public int read(byte[] b, int off, int len) throws IOException { - int n = jis.read(b, off, len); - if (n == -1) { - addIds(); - } - return n; - } - - private void addIds() - { - - if (current != null) { - Certificate[] certs = current.getCertificates(); - if (certs != null) { - Vector ids = getIds(certs); - if (ids != null) { - verified.put(current.getName(), ids); - } - } - } - } - - /** - * Returns a Hashtable mapping filenames to vectors of identities. - */ - public Hashtable getVerifiedSignatures() { - /* we may want to return a copy of this at some point. - For now we simply trust the caller */ - if (verified.isEmpty()) - return null; - else - return verified; - } - - /** - * Returns an enumeration of PKCS7 blocks. This looks bogus, - * but Hotjava just checks to see if enumeration is not null - * to see if anything was signed! - */ - public Enumeration getBlocks() { - if (verified.isEmpty()) { - return null; - } else { - return new Enumeration() { - public boolean hasMoreElements() { return false; } - public Object nextElement() { return null; } - }; - } - } - - /** - * This method used to be called by various versions of - * AppletResourceLoader, even though they didn't do anything with - * the result. We leave them and return null for backwards compatability. - */ - public Hashtable getNameToHash() { - return null; - } - - /** - * Convert java.util.jar.Manifest object to a sun.tools.jar.Manifest - * object. - */ - - public sun.tools.jar.Manifest getManifest() { - if (man == null) { - try { - java.util.jar.Manifest jman = jis.getManifest(); - if (jman == null) - return null; - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - jman.write(baos); - byte[] data = baos.toByteArray(); - man = new sun.tools.jar.Manifest(data); - } catch (IOException ioe) { - // return null - } - } - return man; - } - - static class CertCache { - Certificate [] certs; - Vector ids; - - boolean equals(Certificate[] certs) { - if (this.certs == null) { - if (certs!= null) - return false; - else - return true; - } - - if (certs == null) - return false; - - boolean match; - - for (int i = 0; i < certs.length; i++) { - match = false; - for (int j = 0; j < this.certs.length; j++) { - if (certs[i].equals(this.certs[j])) { - match = true; - break; - } - } - if (!match) return false; - } - - for (int i = 0; i < this.certs.length; i++) { - match = false; - for (int j = 0; j < certs.length; j++) { - if (this.certs[i].equals(certs[j])) { - match = true; - break; - } - } - if (!match) return false; - } - return true; - } - } - - private ArrayList certCache = null; - - - /** - * Returns the Identity vector for the given array of Certificates - */ - protected Vector getIds(Certificate[] certs) { - if (certs == null) - return null; - - if (certCache == null) - certCache = new ArrayList(); - CertCache cc; - for (int i = 0; i < certCache.size(); i++) { - cc = certCache.get(i); - if (cc.equals(certs)) { - return cc.ids; - } - } - cc = new CertCache(); - cc.certs = certs; - - if (certs.length > 0) { - for (int i=0; i() { - public Void run() - throws java.security.KeyManagementException - { - id.addCertificate(oldC); - return null; - } - }); - } catch (java.security.PrivilegedActionException pae) { - throw (java.security.KeyManagementException) - pae.getException(); - } - if (cc.ids == null) - cc.ids = new Vector(); - cc.ids.addElement(id); - } catch (java.security.KeyManagementException kme) { - // ignore if we can't create Identity - } catch (IOException ioe) { - // ignore if we can't parse - } catch (java.security.cert.CertificateEncodingException cee) { - // ignore if we can't encode - } - } - } - certCache.add(cc); - return cc.ids; - } -} diff --git a/jdk/src/share/classes/sun/util/logging/PlatformLogger.java b/jdk/src/share/classes/sun/util/logging/PlatformLogger.java index 6fb5050dd02..aed067c384d 100644 --- a/jdk/src/share/classes/sun/util/logging/PlatformLogger.java +++ b/jdk/src/share/classes/sun/util/logging/PlatformLogger.java @@ -535,6 +535,10 @@ public class PlatformLogger { } void doLog(int level, String msg, Object... params) { + int paramsNumber = (params != null) ? params.length : 0; + for (int i = 0; i < paramsNumber; i++) { + params[i] = String.valueOf(params[i]); + } LoggingSupport.log(javaLogger, levelObjects.get(level), msg, params); } diff --git a/jdk/src/share/classes/sun/util/resources/CalendarData_ro.properties b/jdk/src/share/classes/sun/util/resources/CalendarData_ro.properties index d6d95b6698e..3b6d6903439 100644 --- a/jdk/src/share/classes/sun/util/resources/CalendarData_ro.properties +++ b/jdk/src/share/classes/sun/util/resources/CalendarData_ro.properties @@ -35,9 +35,5 @@ # This notice and attribution to Taligent may not be removed. # Taligent is a registered trademark of Taligent, Inc. - -# This bundle is empty because the data of the base bundle -# is adequate for this locale. -# The bundle is necessary to prevent the resource -# bundle lookup from falling back to the default -# locale. +firstDayOfWeek=2 +minimalDaysInFirstWeek=1 diff --git a/jdk/src/share/classes/sun/util/resources/CalendarData_sl.properties b/jdk/src/share/classes/sun/util/resources/CalendarData_sl.properties index d6d95b6698e..ea7ad985223 100644 --- a/jdk/src/share/classes/sun/util/resources/CalendarData_sl.properties +++ b/jdk/src/share/classes/sun/util/resources/CalendarData_sl.properties @@ -36,8 +36,4 @@ # Taligent is a registered trademark of Taligent, Inc. -# This bundle is empty because the data of the base bundle -# is adequate for this locale. -# The bundle is necessary to prevent the resource -# bundle lookup from falling back to the default -# locale. +firstDayOfWeek=2 diff --git a/jdk/src/share/classes/sun/util/resources/CurrencyNames_en_CA.properties b/jdk/src/share/classes/sun/util/resources/CurrencyNames_en_CA.properties index 62c976ff100..e902e799d82 100644 --- a/jdk/src/share/classes/sun/util/resources/CurrencyNames_en_CA.properties +++ b/jdk/src/share/classes/sun/util/resources/CurrencyNames_en_CA.properties @@ -36,3 +36,4 @@ # Taligent is a registered trademark of Taligent, Inc. CAD=$ +USD=US$ diff --git a/jdk/src/share/classes/sun/util/resources/CurrencyNames_tr_TR.properties b/jdk/src/share/classes/sun/util/resources/CurrencyNames_tr_TR.properties index 4f9c764c5d2..51ed4758556 100644 --- a/jdk/src/share/classes/sun/util/resources/CurrencyNames_tr_TR.properties +++ b/jdk/src/share/classes/sun/util/resources/CurrencyNames_tr_TR.properties @@ -36,4 +36,4 @@ # Taligent is a registered trademark of Taligent, Inc. TRL=TL -TRY=YTL +TRY=TL diff --git a/jdk/src/share/classes/sun/util/resources/CurrencyNames_uk_UA.properties b/jdk/src/share/classes/sun/util/resources/CurrencyNames_uk_UA.properties index 20ed61b81b7..f83822dd221 100644 --- a/jdk/src/share/classes/sun/util/resources/CurrencyNames_uk_UA.properties +++ b/jdk/src/share/classes/sun/util/resources/CurrencyNames_uk_UA.properties @@ -35,4 +35,4 @@ # This notice and attribution to Taligent may not be removed. # Taligent is a registered trademark of Taligent, Inc. -UAH=\u0433\u0440\u0432. +UAH=\u0433\u0440\u043b. diff --git a/jdk/src/share/classes/sun/util/resources/LocaleNames_es.properties b/jdk/src/share/classes/sun/util/resources/LocaleNames_es.properties index 302629c0503..d7cd4eacb66 100644 --- a/jdk/src/share/classes/sun/util/resources/LocaleNames_es.properties +++ b/jdk/src/share/classes/sun/util/resources/LocaleNames_es.properties @@ -38,7 +38,7 @@ # language names # key is ISO 639 language code -aa=afarense +aa=afar ab=abjasio ae=av\u00e9stico af=afrikaans @@ -47,16 +47,16 @@ am=am\u00e1rico an=aragon\u00e9s ar=\u00e1rabe as=asam\u00e9s -av=avaro +av=avar ay=aimara -az=azerbaiyano -ba=bashkiro +az=azer\u00ed +ba=bashkir be=bielorruso bg=b\u00falgaro -bh=bihar\u00ed +bh=bihari bi=bislama bm=bambara -bn=bengal\u00e9s +bn=bengal\u00ed bo=tibetano br=bret\u00f3n bs=bosnio @@ -66,37 +66,37 @@ ch=chamorro co=corso cr=cree cs=checo -cu=glagol\u00edtico +cu=eslavo eclesi\u00e1stico cv=chuvash cy=gal\u00e9s da=dan\u00e9s de=alem\u00e1n dv=divehi -dz=butan\u00e9s +dz=dzongkha ee=ewe el=griego en=ingl\u00e9s eo=esperanto es=espa\u00f1ol et=estonio -eu=vascuence -fa=farsi -ff=fulb\u00e9 +eu=vasco +fa=persa +ff=fula fi=fin\u00e9s -fj=fijiano -fo=faro\u00e9s +fj=fidjiano +fo=fero\u00e9s fr=franc\u00e9s -fy=frisio +fy=fris\u00f3n ga=irland\u00e9s gd=ga\u00e9lico escoc\u00e9s gl=gallego gn=guaran\u00ed -gu=gujarat\u00ed -gv=manx +gu=gujarati +gv=ga\u00e9lico man\u00e9s ha=hausa he=hebreo -hi=hind\u00fa -ho=hiri Motu +hi=hindi +ho=hiri motu hr=croata ht=haitiano hu=h\u00fangaro @@ -104,10 +104,10 @@ hy=armenio hz=herero ia=interlingua id=indonesio -ie=interlingua -ig=ibo -ii=yi de sichuan -ik=inupiak +ie=interlingue +ig=igbo +ii=sichuan yi +ik=inupiaq in=indonesio io=ido is=island\u00e9s @@ -118,20 +118,20 @@ ja=japon\u00e9s ji=y\u00eddish jv=javan\u00e9s ka=georgiano -kg=kikongo -ki=gikuyu -kj=kwanyama -kk=kazajio +kg=kongo +ki=kikuyu +kj=kuanyama +kk=kazajo kl=groenland\u00e9s -km=camboyano -kn=kanada +km=jemer +kn=canar\u00e9s ko=coreano kr=kanuri -ks=cachemir\u00ed -ku=curdo +ks=cachemiro +ku=kurdo kv=komi kw=c\u00f3rnico -ky=kirgu\u00eds +ky=kirghiz la=lat\u00edn lb=luxemburgu\u00e9s lg=ganda @@ -139,7 +139,7 @@ li=limburgu\u00e9s ln=lingala lo=laosiano lt=lituano -lu=tshiluba +lu=luba-katanga lv=let\u00f3n mg=malgache mh=marshal\u00e9s @@ -148,82 +148,82 @@ mk=macedonio ml=malayalam mn=mongol mo=moldavo -mr=m\u00e1rata +mr=marathi ms=malayo mt=malt\u00e9s my=birmano na=nauruano -nb=noruego (bokm\u00e5l) -nd=ndebele (norte) +nb=bokmal noruego +nd=ndebele septentrional ne=nepal\u00ed ng=ndonga nl=neerland\u00e9s -nn=noruego (nynorsk) +nn=nynorsk noruego no=noruego -nr=ndebele (sur) +nr=ndebele meridional nv=navajo ny=nyanja oc=occitano oj=ojibwa om=oromo or=oriya -os=osetio +os=os\u00e9tico pa=punjab\u00ed pi=pali pl=polaco ps=pashto pt=portugu\u00e9s qu=quechua -rm=retorromano -rn=rund\u00ed +rm=retorrom\u00e1nico +rn=kiroundi ro=rumano ru=ruso -rw=ruand\u00e9s +rw=kinyarwanda sa=s\u00e1nscrito sc=sardo -sd=sindino -se=sami del norte +sd=sindhi +se=sami septentrional sg=sango si=cingal\u00e9s sk=eslovaco -sl=eslovenio +sl=esloveno sm=samoano -sn=son\u00e9s +sn=shona so=somal\u00ed sq=alban\u00e9s sr=serbio -ss=suaziland\u00e9s -st=sesot\u00e9s -su=sudan\u00e9s +ss=siswati +st=sesotho +su=sundan\u00e9s sv=sueco -sw=suajili +sw=swahili ta=tamil te=telugu -tg=tajik +tg=tayiko th=tailand\u00e9s -ti=tigri\u00f1es +ti=tigri\u00f1a tk=turcomano tl=tagalo -tn=sechuan\u00e9s -to=tongu\u00e9s +tn=setchwana +to=tongano tr=turco ts=tsonga tt=t\u00e1rtaro -tw=tui -ty=taitiano -ug=uighur -uk=ucranio +tw=twi +ty=tahitiano +ug=uigur +uk=ucraniano ur=urdu -uz=uzbeco +uz=uzbeko ve=venda vi=vietnamita -vo=volapuk +vo=volap\u00fck wa=val\u00f3n wo=uolof xh=xhosa yi=y\u00eddish yo=yoruba -za=chuang +za=zhuang zh=chino zu=zul\u00fa diff --git a/jdk/src/share/classes/sun/util/resources/LocaleNames_fi.properties b/jdk/src/share/classes/sun/util/resources/LocaleNames_fi.properties index a055e55acd8..831b1a9cd7a 100644 --- a/jdk/src/share/classes/sun/util/resources/LocaleNames_fi.properties +++ b/jdk/src/share/classes/sun/util/resources/LocaleNames_fi.properties @@ -49,7 +49,7 @@ el=kreikka en=englanti es=espanja fi=suomi -fr=franska +fr=ranska he=heprea iw=heprea hi=hindi @@ -80,7 +80,7 @@ DE=Saksa DK=Tanska ES=Espanja FI=Suomi -FR=Franska +FR=Ranska GB=Iso-Britannia GR=Kreikka IE=Irlanti diff --git a/jdk/src/share/classes/sun/util/resources/LocaleNames_nl.properties b/jdk/src/share/classes/sun/util/resources/LocaleNames_nl.properties index 1f5bb150cc4..da85201e674 100644 --- a/jdk/src/share/classes/sun/util/resources/LocaleNames_nl.properties +++ b/jdk/src/share/classes/sun/util/resources/LocaleNames_nl.properties @@ -34,14 +34,436 @@ # This notice and attribution to Taligent may not be removed. # Taligent is a registered trademark of Taligent, Inc. - # language names # key is ISO 639 language code +aa=Afar +ab=Abchazisch +ae=Avestisch +af=Afrikaans +ak=Akan +am=Amhaars +an=Aragonees +ar=Arabisch +as=Assamees +av=Avarisch +ay=Aymara +az=Azerbeidzjaans +ba=Basjkiers +be=Wit-Russisch +bg=Bulgaars +bh=Bihari +bi=Bislama +bm=Bambara +bn=Bengalees +bo=Tibetaans +br=Bretons +bs=Bosnisch +ca=Catalaans +ce=Chechen +ch=Chamorro +co=Corsicaans +cr=Cree +cs=Tsjechisch +cu=Kerkslavisch +cv=Tsjoevasjisch +cy=Welsh +da=Deens +de=Duits +dv=Divehi +dz=Dzongkha +ee=Ewe +el=Grieks +en=Engels +eo=Esperanto +es=Spaans +et=Estlands +eu=Baskisch +fa=Perzisch +ff=Fulah +fi=Fins +fj=Fijisch +fo=Faer\u00f6ers +fr=Frans +fy=Fries +ga=Iers +gd=Schots Gaelic +gl=Galicisch +gn=Guarani +gu=Gujarati +gv=Manx +ha=Hausa +he=Hebreeuws +hi=Hindi +ho=Hiri Motu +hr=Kroatisch +ht=Ha\u00eftiaans +hu=Hongaars +hy=Armeens +hz=Herero +ia=Interlingua +id=Indonesisch +ie=Interlingue +ig=Igbo +ii=Sichuan Yi +ik=Inupiaq +io=Ido +is=IJslands +it=Italiaans +iu=Inuktitut +ja=Japans +jv=Javaans +ka=Georgisch +kg=Kongo +ki=Kikuyu +kj=Kuanyama +kk=Kazachs +kl=Kalaallisut +km=Khmer +kn=Kannada +ko=Koreaans +kr=Kanuri +ks=Kashmiri +ku=Koerdisch +kv=Komi +kw=Cornish +ky=Kirgizisch +la=Latijn +lb=Luxemburgs +lg=Ganda +li=Limburgs +ln=Lingala +lo=Lao +lt=Litouws +lu=Luba-Katanga +lv=Letlands +mg=Malagasisch +mh=Marshallees +mi=Maori +mk=Macedonisch +ml=Malayalam +mn=Mongools +mo=Moldavisch +mr=Marathi +ms=Maleis +mt=Maltees +my=Birmees +na=Nauru +nb=Noors - Bokm\u00e5l +nd=Noord-Ndbele +ne=Nepalees +ng=Ndonga nl=Nederlands +nn=Noors - Nynorsk +no=Noors +nr=Zuid-Ndbele +nv=Navajo +ny=Nyanja +oc=Occitaans +oj=Ojibwa +om=Oromo +or=Oriya +os=Ossetisch +pa=Punjabi +pi=Pali +pl=Pools +ps=Pasjtoe +pt=Portugees +qu=Quechua +rm=Reto-Romaans +rn=Rundi +ro=Roemeens +ru=Russisch +rw=Kinyarwanda +sa=Sanskriet +sc=Sardinisch +sd=Sindhi +se=Noord-Samisch +sg=Sango +si=Singalees +sk=Slowaaks +sl=Sloveens +sm=Samoaans +sn=Shona +so=Somalisch +sq=Albanees +sr=Servisch +ss=Swati +st=Zuid-Sotho +su=Soendanees +sv=Zweeds +sw=Swahili +ta=Tamil +te=Teloegoe +tg=Tadzjieks +th=Thais +ti=Tigrinya +tk=Turkmeens +tl=Tagalog +tn=Tswana +to=Tonga +tr=Turks +ts=Tsonga +tt=Tataars +tw=Twi +ty=Tahitisch +ug=Oeigoers +uk=Oekra\u00efens +ur=Urdu +uz=Oezbeeks +ve=Venda +vi=Vietnamees +vo=Volap\u00fck +wa=Wallonisch +wo=Wolof +xh=Xhosa +yi=Jiddisch +yo=Yoruba +za=Zhuang +zh=Chinees +zu=Zulu # country names # key is ISO 3166 country code -NL=Nederland +AD=Andorra +AE=Verenigde Arabische Emiraten +AF=Afghanistan +AG=Antigua en Barbuda +AI=Anguilla +AL=Albani\u00eb +AM=Armeni\u00eb +AN=Nederlandse Antillen +AO=Angola +AQ=Antarctica +AR=Argentini\u00eb +AS=Amerikaans Samoa +AT=Oostenrijk +AU=Australi\u00eb +AW=Aruba +AX=Alandeilanden +AZ=Azerbeidzjan +BA=Bosni\u00eb en Herzegovina +BB=Barbados +BD=Bangladesh BE=Belgi\u00eb +BF=Burkina Faso +BG=Bulgarije +BH=Bahrein +BI=Burundi +BJ=Benin +BM=Bermuda +BN=Brunei +BO=Bolivia +BR=Brazili\u00eb +BS=Bahama\u2019s +BT=Bhutan +BV=Bouveteiland +BW=Botswana +BY=Wit-Rusland +BZ=Belize +CA=Canada +CC=Cocoseilanden +CD=Congo-Kinshasa +CF=Centraal-Afrikaanse Republiek +CG=Congo +CH=Zwitserland +CI=Ivoorkust +CK=Cookeilanden +CL=Chili +CM=Kameroen +CN=China +CO=Colombia +CR=Costa Rica +CS=Servi\u00eb en Montenegro +CU=Cuba +CV=Kaapverdi\u00eb +CX=Christmaseiland +CY=Cyprus +CZ=Tsjechi\u00eb +DE=Duitsland +DJ=Djibouti +DK=Denemarken +DM=Dominica +DO=Dominicaanse Republiek +DZ=Algerije +EC=Ecuador +EE=Estland +EG=Egypte +EH=Westelijke Sahara +ER=Eritrea +ES=Spanje +ET=Ethiopi\u00eb +FI=Finland +FJ=Fiji +FK=Falklandeilanden +FM=Micronesi\u00eb +FO=Faer\u00f6er +FR=Frankrijk +GA=Gabon +GB=Verenigd Koninkrijk +GD=Grenada +GE=Georgi\u00eb +GF=Frans-Guyana +GH=Ghana +GI=Gibraltar +GL=Groenland +GM=Gambia +GN=Guinee +GP=Guadeloupe +GQ=Equatoriaal-Guinea +GR=Griekenland +GS=Zuid-Georgi\u00eb en Zuidelijke Sandwicheilanden +GT=Guatemala +GU=Guam +GW=Guinee-Bissau +GY=Guyana +HK=Hongkong SAR van China +HM=Heard- en McDonaldeilanden +HN=Honduras +HR=Kroati\u00eb +HT=Ha\u00efti +HU=Hongarije +ID=Indonesi\u00eb +IE=Ierland +IL=Isra\u00ebl +IN=India +IO=Britse Gebieden in de Indische Oceaan +IQ=Irak +IR=Iran +IS=IJsland +IT=Itali\u00eb +JM=Jamaica +JO=Jordani\u00eb +JP=Japan +KE=Kenia +KG=Kirgizi\u00eb +KH=Cambodja +KI=Kiribati +KM=Comoren +KN=Saint Kitts en Nevis +KP=Noord-Korea +KR=Zuid-Korea +KW=Koeweit +KY=Caymaneilanden +KZ=Kazachstan +LA=Laos +LB=Libanon +LC=Saint Lucia +LI=Liechtenstein +LK=Sri Lanka +LR=Liberia +LS=Lesotho +LT=Litouwen +LU=Luxemburg +LV=Letland +LY=Libi\u00eb +MA=Marokko +MC=Monaco +MD=Moldavi\u00eb +ME=Montenegro +MG=Madagaskar +MH=Marshalleilanden +MK=Macedoni\u00eb +ML=Mali +MM=Myanmar +MN=Mongoli\u00eb +MO=Macao SAR van China +MP=Noordelijke Marianeneilanden +MQ=Martinique +MR=Mauritani\u00eb +MS=Montserrat +MT=Malta +MU=Mauritius +MV=Maldiven +MW=Malawi +MX=Mexico +MY=Maleisi\u00eb +MZ=Mozambique +NA=Namibi\u00eb +NC=Nieuw-Caledoni\u00eb +NE=Niger +NF=Norfolkeiland +NG=Nigeria +NI=Nicaragua +NL=Nederland +NO=Noorwegen +NP=Nepal +NR=Nauru +NU=Niue +NZ=Nieuw-Zeeland +OM=Oman +PA=Panama +PE=Peru +PF=Frans-Polynesi\u00eb +PG=Papoea-Nieuw-Guinea +PH=Filipijnen +PK=Pakistan +PL=Polen +PM=Saint Pierre en Miquelon +PN=Pitcairn +PR=Puerto Rico +PS=Palestijns Gebied +PT=Portugal +PW=Palau +PY=Paraguay +QA=Qatar +RE=R\u00e9union +RO=Roemeni\u00eb +RS=Servi\u00eb +RU=Rusland +RW=Rwanda +SA=Saoedi-Arabi\u00eb +SB=Salomonseilanden +SC=Seychellen +SD=Soedan +SE=Zweden +SG=Singapore +SH=Sint-Helena +SI=Sloveni\u00eb +SJ=Svalbard en Jan Mayen +SK=Slowakije +SL=Sierra Leone +SM=San Marino +SN=Senegal +SO=Somali\u00eb +SR=Suriname +ST=Sao Tom\u00e9 en Principe +SV=El Salvador +SY=Syri\u00eb +SZ=Swaziland +TC=Turks- en Caicoseilanden +TD=Tsjaad +TF=Franse Gebieden in de zuidelijke Indische Oceaan +TG=Togo +TH=Thailand +TJ=Tadzjikistan +TK=Tokelau +TL=Oost-Timor +TM=Turkmenistan +TN=Tunesi\u00eb +TO=Tonga +TR=Turkije +TT=Trinidad en Tobago +TV=Tuvalu +TW=Taiwan +TZ=Tanzania +UA=Oekra\u00efne +UG=Oeganda +UM=Amerikaanse kleinere afgelegen eilanden +US=Verenigde Staten +UY=Uruguay +UZ=Oezbekistan +VA=Vaticaanstad +VC=Saint Vincent en de Grenadines +VE=Venezuela +VG=Britse Maagdeneilanden +VI=Amerikaanse Maagdeneilanden +VN=Vietnam +VU=Vanuatu +WF=Wallis en Futuna +WS=Samoa +YE=Jemen +YT=Mayotte +ZA=Zuid-Afrika +ZM=Zambia diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames.java index ef9dfdc8c5a..a347db8ccc1 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames.java @@ -384,6 +384,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { {"America/Manaus", AMT}, {"America/Marigot", AST}, {"America/Martinique", AST}, + {"America/Matamoros", CST}, {"America/Mazatlan", MST}, {"America/Mendoza", AGT}, {"America/Menominee", CST}, @@ -403,6 +404,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { {"America/Noronha", NORONHA}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, {"America/Paramaribo", new String[] {"Suriname Time", "SRT", @@ -419,6 +421,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { {"America/Resolute", RST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, + {"America/Santa_Isabel", PST}, {"America/Santarem", BRT}, {"America/Santiago", CLT}, {"America/Santo_Domingo", AST}, diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_de.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_de.java index 896d72a5c53..43a0fd4ac9d 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_de.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_de.java @@ -71,8 +71,8 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { "Bhutanische Sommerzeit", "BTST"}; String CAT[] = new String[] {"Zentralafrikanische Zeit", "CAT", "Zentralafrikanische Sommerzeit", "CAST"}; - String CET[] = new String[] {"Zentraleurop\u00e4ische Zeit", "CET", - "Zentraleurop\u00e4ische Sommerzeit", "CEST"}; + String CET[] = new String[] {"Mitteleurop\u00e4ische Zeit", "MEZ", + "Mitteleurop\u00e4ische Sommerzeit", "MESZ"}; String CHAST[] = new String[] {"Chatham Normalzeit", "CHAST", "Chatham Sommerzeit", "CHADT"}; String CIT[] = new String[] {"Zentralindonesische Zeit", "CIT", @@ -83,8 +83,8 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { "Zentrale Sommerzeit", "CDT"}; String CTT[] = new String[] {"Chinesische Normalzeit", "CST", "Chinesische Sommerzeit", "CDT"}; - String CUBA[] = new String[] {"Cuba Standard Time", "CST", - "Cuba Daylight Time", "CDT"}; + String CUBA[] = new String[] {"Kubanische Normalzeit", "CST", + "Kubanische Sommerzeit", "CDT"}; String DARWIN[] = new String[] {"Zentrale Normalzeit (Northern Territory)", "CST", "Zentrale Sommerzeit (Northern Territory)", "CST"}; String DUBLIN[] = new String[] {"Greenwich Zeit", "GMT", @@ -93,8 +93,8 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { "Ostafrikanische Sommerzeit", "EAST"}; String EASTER[] = new String[] {"Osterinseln Zeit", "EAST", "Osterinseln Sommerzeit", "EASST"}; - String EET[] = new String[] {"Osteurop\u00e4ische Zeit", "EET", - "Osteurop\u00e4ische Sommerzeit", "EEST"}; + String EET[] = new String[] {"Osteurop\u00e4ische Zeit", "OEZ", + "Osteurop\u00e4ische Sommerzeit", "OESZ"}; String EGT[] = new String[] {"Ostgr\u00f6nl\u00e4ndische Zeit", "EGT", "Ostgr\u00f6nl\u00e4ndische Sommerzeit", "EGST"}; String EST[] = new String[] {"\u00d6stliche Normalzeit", "EST", @@ -173,12 +173,12 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { "Truk Sommerzeit", "TRUST"}; String ULAT[]= new String[] {"Ulaanbaatar Zeit", "ULAT", "Ulaanbaatar Sommerzeit", "ULAST"}; - String WART[] = new String[] {"Argentinische Zeit", "WART", - "Argentinische Sommerzeit", "WARST"}; + String WART[] = new String[] {"Westargentinische Zeit", "WART", + "Westargentinische Sommerzeit", "WARST"}; String WAT[] = new String[] {"Westafrikanische Zeit", "WAT", "Westafrikanische Sommerzeit", "WAST"}; - String WET[] = new String[] {"Westeurop\u00e4ische Zeit", "WET", - "Westeurop\u00e4ische Sommerzeit", "WEST"}; + String WET[] = new String[] {"Westeurop\u00e4ische Zeit", "WEZ", + "Westeurop\u00e4ische Sommerzeit", "WESZ"}; String WIT[] = new String[] {"Westindonesische Zeit", "WIT", "Westindonesische Sommerzeit", "WIST"}; String WST_AUS[] = new String[] {"Westliche Normalzeit (Australien)", "WST", @@ -384,6 +384,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { {"America/Manaus", AMT}, {"America/Marigot", AST}, {"America/Martinique", AST}, + {"America/Matamoros", CST}, {"America/Mazatlan", MST}, {"America/Mendoza", AGT}, {"America/Menominee", CST}, @@ -403,6 +404,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { {"America/Noronha", NORONHA}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, {"America/Paramaribo", new String[] {"Suriname Zeit", "SRT", @@ -419,6 +421,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { {"America/Resolute", RST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, + {"America/Santa_Isabel", PST}, {"America/Santarem", BRT}, {"America/Santiago", CLT}, {"America/Santo_Domingo", AST}, @@ -594,8 +597,8 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { {"Australia/Canberra", EST_NSW}, {"Australia/Currie", EST_NSW}, {"Australia/Darwin", DARWIN}, - {"Australia/Eucla", new String[] {"Central Western Standard Time (Australia)", "CWST", - "Central Western Summer Time (Australia)", "CWST"}}, + {"Australia/Eucla", new String[] {"Zentral-Westliche Normalzeit (Australien)", "CWST", + "Zentral-Westliche Sommerzeit (Australien)", "CWST"}}, {"Australia/Hobart", TASMANIA}, {"Australia/LHI", LORD_HOWE}, {"Australia/Lindeman", BRISBANE}, diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_es.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_es.java index 20605d1187a..b2db45753ac 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_es.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_es.java @@ -83,8 +83,8 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { "Hora de verano Central", "CDT"}; String CTT[] = new String[] {"Hora est\u00e1ndar de China", "CST", "Hora de verano de China", "CDT"}; - String CUBA[] = new String[] {"Cuba Standard Time", "CST", - "Cuba Daylight Time", "CDT"}; + String CUBA[] = new String[] {"Hora est\u00e1ndar de Cuba", "CST", + "Hora de verano de Cuba", "CDT"}; String DARWIN[] = new String[] {"Hora est\u00e1ndar Central (territorio del Norte)", "CST", "Hora de verano Central (territorio del Norte)", "CST"}; String DUBLIN[] = new String[] {"Hora del Meridiano de Greenwich", "GMT", @@ -173,8 +173,8 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { "Hora de verano de Truk", "TRUST"}; String ULAT[]= new String[] {"Hora de Ulan Bator", "ULAT", "Hora de verano de Ulan Bator", "ULAST"}; - String WART[] = new String[] {"Hora de Argentina", "WART", - "Hora de verano de Argentina", "WARST"}; + String WART[] = new String[] {"Hora de Argentina Occidental", "WART", + "Hora de verano de Argentina Occidental", "WARST"}; String WAT[] = new String[] {"Hora de \u00c1frica Occidental", "WAT", "Hora de verano de \u00c1frica Occidental", "WAST"}; String WET[] = new String[] {"Hora de Europa Occidental", "WET", @@ -384,6 +384,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { {"America/Manaus", AMT}, {"America/Marigot", AST}, {"America/Martinique", AST}, + {"America/Matamoros", CST}, {"America/Mazatlan", MST}, {"America/Mendoza", AGT}, {"America/Menominee", CST}, @@ -403,6 +404,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { {"America/Noronha", NORONHA}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, {"America/Paramaribo", new String[] {"Hora de Surinam", "SRT", @@ -419,6 +421,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { {"America/Resolute", RST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, + {"America/Santa_Isabel", PST}, {"America/Santarem", BRT}, {"America/Santiago", CLT}, {"America/Santo_Domingo", AST}, @@ -595,8 +598,8 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { {"Australia/Canberra", EST_NSW}, {"Australia/Currie", EST_NSW}, {"Australia/Darwin", DARWIN}, - {"Australia/Eucla", new String[] {"Central Western Standard Time (Australia)", "CWST", - "Central Western Summer Time (Australia)", "CWST"}}, + {"Australia/Eucla", new String[] {"Hora est\u00e1ndar de Australia Central y Occidental", "CWST", + "Hora de verano de Australia Central y Occidental", "CWST"}}, {"Australia/Hobart", TASMANIA}, {"Australia/LHI", LORD_HOWE}, {"Australia/Lindeman", BRISBANE}, diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_fr.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_fr.java index e3f8205584a..9e10e617637 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_fr.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_fr.java @@ -83,8 +83,8 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { "Heure avanc\u00e9e du Centre", "CDT"} ; String CTT[] = new String[] {"Heure normale de Chine", "CST", "Heure avanc\u00e9e de Chine", "CDT"} ; - String CUBA[] = new String[] {"Cuba Standard Time", "CST", - "Cuba Daylight Time", "CDT"}; + String CUBA[] = new String[] {"Heure standard de Cuba", "CST", + "Heure d'\u00e9t\u00e9 de Cuba", "CDT"}; String DARWIN[] = new String[] {"Heure standard d'Australie centrale (Territoire du Nord)", "CST", "Heure d'\u00e9t\u00e9 d'Australie centrale (Territoire du Nord)", "CST"}; String DUBLIN[] = new String[] {"Heure du m\u00e9ridien de Greenwich", "GMT", @@ -173,8 +173,8 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { "Heure d'\u00e9t\u00e9 de Truk", "TRUST"}; String ULAT[]= new String[] {"Heure de l'Ulaanbaatar", "ULAT", "Heure d'\u00e9t\u00e9 de l'Ulaanbaatar", "ULAST"} ; - String WART[] = new String[] {"Heure D'Argentine", "WART", - "Heure d'\u00e9t\u00e9 D'Argentine", "WARST"} ; + String WART[] = new String[] {"Heure D'Argentine de l'Ouest", "WART", + "Heure d'\u00e9t\u00e9 D'Argentine de l'Ouest", "WARST"} ; String WAT[] = new String[] {"Heure d'Afrique de l'Ouest", "WAT", "Heure d'\u00e9t\u00e9 d'Afrique de l'Ouest", "WAST"} ; String WET[] = new String[] {"Heure d'Europe de l'Ouest", "WET", @@ -384,6 +384,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { {"America/Manaus", AMT}, {"America/Marigot", AST}, {"America/Martinique", AST}, + {"America/Matamoros", CST}, {"America/Mazatlan", MST}, {"America/Mendoza", AGT}, {"America/Menominee", CST}, @@ -403,6 +404,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { {"America/Noronha", NORONHA}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, {"America/Paramaribo", new String[] {"Heure du Surinam", "SRT", @@ -419,6 +421,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { {"America/Resolute", RST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, + {"America/Santa_Isabel", PST}, {"America/Santarem", BRT}, {"America/Santiago", CLT}, {"America/Santo_Domingo", AST}, @@ -594,8 +597,8 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { {"Australia/Canberra", EST_NSW}, {"Australia/Currie", EST_NSW}, {"Australia/Darwin", DARWIN}, - {"Australia/Eucla", new String[] {"Central Western Standard Time (Australia)", "CWST", - "Central Western Summer Time (Australia)", "CWST"}}, + {"Australia/Eucla", new String[] {"Heure standard de l'Australie occidentale (centre)", "CWST", + "Heure d'\u00e9t\u00e9 de l'Australie occidentale (centre)", "CWST"}}, {"Australia/Hobart", TASMANIA}, {"Australia/LHI", LORD_HOWE}, {"Australia/Lindeman", BRISBANE}, diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_it.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_it.java index e464618f2af..f9dd1015061 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_it.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_it.java @@ -83,8 +83,8 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { "Ora legale USA centrale", "CDT"}; String CTT[] = new String[] {"Ora solare della Cina", "CST", "Ora legale della Cina", "CDT"}; - String CUBA[] = new String[] {"Cuba Standard Time", "CST", - "Cuba Daylight Time", "CDT"}; + String CUBA[] = new String[] {"Ora solare Cuba", "CST", + "Ora legale Cuba", "CDT"}; String DARWIN[] = new String[] {"Ora centrale standard (Territori del Nord)", "CST", "Ora estiva centrale (Territori del Nord)", "CST"}; String DUBLIN[] = new String[] {"Ora media di Greenwich", "GMT", @@ -173,8 +173,8 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { "Ora estiva di Truk", "TRUST"}; String ULAT[]= new String[] {"Ora di Ulaanbaatar", "ULAT", "Ora estiva di Ulaanbaatar", "ULAST"}; - String WART[] = new String[] {"Ora dell'Argentina", "WART", - "Ora estiva dell'Argentina", "WARST"}; + String WART[] = new String[] {"Ora dell'Argentina occidentale", "WART", + "Ora estiva dell'Argentina occidentale", "WARST"}; String WAT[] = new String[] {"Ora dell'Africa occidentale", "WAT", "Ora estiva dell'Africa occidentale", "WAST"}; String WET[] = new String[] {"Ora dell'Europa occidentale", "WET", @@ -384,6 +384,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { {"America/Manaus", AMT}, {"America/Marigot", AST}, {"America/Martinique", AST}, + {"America/Matamoros", CST}, {"America/Mazatlan", MST}, {"America/Mendoza", AGT}, {"America/Menominee", CST}, @@ -403,6 +404,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { {"America/Noronha", NORONHA}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, {"America/Paramaribo", new String[] {"Ora di Suriname", "SRT", @@ -419,6 +421,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { {"America/Resolute", RST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, + {"America/Santa_Isabel", PST}, {"America/Santarem", BRT}, {"America/Santiago", CLT}, {"America/Santo_Domingo", AST}, @@ -594,8 +597,8 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { {"Australia/Canberra", EST_NSW}, {"Australia/Currie", EST_NSW}, {"Australia/Darwin", DARWIN}, - {"Australia/Eucla", new String[] {"Central Western Standard Time (Australia)", "CWST", - "Central Western Summer Time (Australia)", "CWST"}}, + {"Australia/Eucla", new String[] {"Ora solare Australia centrorientale", "CWST", + "Ora estiva Australia centrorientale", "CWST"}}, {"Australia/Hobart", TASMANIA}, {"Australia/LHI", LORD_HOWE}, {"Australia/Lindeman", BRISBANE}, diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_ja.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_ja.java index 1292e4b8045..61443ce6d21 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_ja.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_ja.java @@ -83,8 +83,8 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { "\u4e2d\u90e8\u590f\u6642\u9593", "CDT"}; String CTT[] = new String[] {"\u4e2d\u56fd\u6a19\u6e96\u6642", "CST", "\u4e2d\u56fd\u590f\u6642\u9593", "CDT"}; - String CUBA[] = new String[] {"Cuba Standard Time", "CST", - "Cuba Daylight Time", "CDT"}; + String CUBA[] = new String[] {"\u30ad\u30e5\u30fc\u30d0\u6a19\u6e96\u6642", "CST", + "\u30ad\u30e5\u30fc\u30d0\u590f\u6642\u9593", "CDT"}; String DARWIN[] = new String[] {"\u4e2d\u90e8\u6a19\u6e96\u6642 (\u30ce\u30fc\u30b6\u30f3\u30c6\u30ea\u30c8\u30ea\u30fc)", "CST", "\u4e2d\u90e8\u590f\u6642\u9593 (\u30ce\u30fc\u30b6\u30f3\u30c6\u30ea\u30c8\u30ea\u30fc)", "CST"}; String DUBLIN[] = new String[] {"\u30b0\u30ea\u30cb\u30c3\u30b8\u6a19\u6e96\u6642", "GMT", @@ -173,8 +173,8 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { "\u30c8\u30e9\u30c3\u30af\u590f\u6642\u9593", "TRUST"}; String ULAT[]= new String[] {"\u30a6\u30e9\u30fc\u30f3\u30d0\u30fc\u30c8\u30eb\u6642\u9593", "ULAT", "\u30a6\u30e9\u30fc\u30f3\u30d0\u30fc\u30c8\u30eb\u590f\u6642\u9593", "ULAST"}; - String WART[] = new String[] {"\u30a2\u30eb\u30bc\u30f3\u30c1\u30f3\u6642\u9593", "WART", - "\u30a2\u30eb\u30bc\u30f3\u30c1\u30f3\u590f\u6642\u9593", "WARST"}; + String WART[] = new String[] {"\u897f\u30a2\u30eb\u30bc\u30f3\u30c1\u30f3\u6642\u9593", "WART", + "\u897f\u30a2\u30eb\u30bc\u30f3\u30c1\u30f3\u590f\u6642\u9593", "WARST"}; String WAT[] = new String[] {"\u897f\u30a2\u30d5\u30ea\u30ab\u6642\u9593", "WAT", "\u897f\u30a2\u30d5\u30ea\u30ab\u590f\u6642\u9593", "WAST"}; String WET[] = new String[] {"\u897f\u30e8\u30fc\u30ed\u30c3\u30d1\u6642\u9593", "WET", @@ -384,6 +384,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { {"America/Manaus", AMT}, {"America/Marigot", AST}, {"America/Martinique", AST}, + {"America/Matamoros", CST}, {"America/Mazatlan", MST}, {"America/Mendoza", AGT}, {"America/Menominee", CST}, @@ -403,6 +404,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { {"America/Noronha", NORONHA}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, {"America/Paramaribo", new String[] {"\u30b9\u30ea\u30ca\u30e0\u6642\u9593", "SRT", @@ -419,6 +421,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { {"America/Resolute", RST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, + {"America/Santa_Isabel", PST}, {"America/Santarem", BRT}, {"America/Santiago", CLT}, {"America/Santo_Domingo", AST}, @@ -594,8 +597,8 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { {"Australia/Canberra", EST_NSW}, {"Australia/Currie", EST_NSW}, {"Australia/Darwin", DARWIN}, - {"Australia/Eucla", new String[] {"Central Western Standard Time (Australia)", "CWST", - "Central Western Summer Time (Australia)", "CWST"}}, + {"Australia/Eucla", new String[] {"\u4e2d\u897f\u90e8\u6a19\u6e96\u6642 (\u30aa\u30fc\u30b9\u30c8\u30e9\u30ea\u30a2)", "CWST", + "\u4e2d\u897f\u90e8\u590f\u6642\u9593 (\u30aa\u30fc\u30b9\u30c8\u30e9\u30ea\u30a2)", "CWST"}}, {"Australia/Hobart", TASMANIA}, {"Australia/LHI", LORD_HOWE}, {"Australia/Lindeman", BRISBANE}, diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_ko.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_ko.java index f69e08b250e..7d45aab21df 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_ko.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_ko.java @@ -83,8 +83,8 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { "\uc911\ubd80 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "CDT"}; String CTT[] = new String[] {"\uc911\uad6d \ud45c\uc900\uc2dc", "CST", "\uc911\uad6d \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "CDT"}; - String CUBA[] = new String[] {"Cuba Standard Time", "CST", - "Cuba Daylight Time", "CDT"}; + String CUBA[] = new String[] {"\ucfe0\ubc14 \ud45c\uc900\uc2dc", "CST", + "\ucfe0\ubc14 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "CDT"}; String DARWIN[] = new String[] {"\uc911\ubd80 \ud45c\uc900\uc2dc(\ub178\ub358 \uc9c0\uc5ed)", "CST", "\uc911\ubd80 \uc77c\uad11\uc808\uc57d\uc2dc\uac04(\ub178\ub358 \uc9c0\uc5ed)", "CST"}; String DUBLIN[] = new String[] {"\uadf8\ub9ac\ub2c8\uce58 \ud45c\uc900\uc2dc", "GMT", @@ -173,8 +173,8 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { "\ud2b8\ub8e8\ud06c \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "TRUST"}; String ULAT[]= new String[] {"\uc6b8\ub780\ubc14\ud0c0\ub974 \uc2dc\uac04", "ULAT", "\uc6b8\ub780\ubc14\ud0c0\ub974 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "ULAST"}; - String WART[] = new String[] {"\uc544\ub974\ud5e8\ud2f0\ub098 \uc2dc\uac04", "WART", - "\uc544\ub974\ud5e8\ud2f0\ub098 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "WARST"}; + String WART[] = new String[] {"\uc11c\ubd80 \uc544\ub974\ud5e8\ud2f0\ub098 \uc2dc\uac04", "WART", + "\uc11c\ubd80 \uc544\ub974\ud5e8\ud2f0\ub098 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "WARST"}; String WAT[] = new String[] {"\uc11c\ubd80 \uc544\ud504\ub9ac\uce74 \uc2dc\uac04", "WAT", "\uc11c\ubd80 \uc544\ud504\ub9ac\uce74 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "WAST"}; String WET[] = new String[] {"\uc11c\uc720\ub7fd \uc2dc\uac04", "WET", @@ -384,6 +384,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { {"America/Manaus", AMT}, {"America/Marigot", AST}, {"America/Martinique", AST}, + {"America/Matamoros", CST}, {"America/Mazatlan", MST}, {"America/Mendoza", AGT}, {"America/Menominee", CST}, @@ -403,6 +404,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { {"America/Noronha", NORONHA}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, {"America/Paramaribo", new String[] {"\uc218\ub9ac\ub0a8 \uc2dc\uac04", "SRT", @@ -419,6 +421,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { {"America/Resolute", RST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, + {"America/Santa_Isabel", PST}, {"America/Santarem", BRT}, {"America/Santiago", CLT}, {"America/Santo_Domingo", AST}, @@ -594,8 +597,8 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { {"Australia/Canberra", EST_NSW}, {"Australia/Currie", EST_NSW}, {"Australia/Darwin", DARWIN}, - {"Australia/Eucla", new String[] {"Central Western Standard Time (Australia)", "CWST", - "Central Western Summer Time (Australia)", "CWST"}}, + {"Australia/Eucla", new String[] {"\uc911\uc11c\ubd80 \ud45c\uc900\uc2dc(\uc624\uc2a4\ud2b8\ub808\uc77c\ub9ac\uc544)", "CWST", + "\uc911\uc11c\ubd80 \uc77c\uad11\uc808\uc57d\uc2dc\uac04(\uc624\uc2a4\ud2b8\ub808\uc77c\ub9ac\uc544)", "CWST"}}, {"Australia/Hobart", TASMANIA}, {"Australia/LHI", LORD_HOWE}, {"Australia/Lindeman", BRISBANE}, diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_sv.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_sv.java index 35ce2d11c51..aa9f4eeec34 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_sv.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_sv.java @@ -45,8 +45,8 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { protected final Object[][] getContents() { String ACT[] = new String[] {"Acre, normaltid", "ACT", "Acre, sommartid", "ACST"}; - String ADELAIDE[] = new String[] {"Central Standard Time (S\u00f6dra Australien)", "CST", - "Central Summer Time (S\u00f6dra Australien)", "CST"}; + String ADELAIDE[] = new String[] {"Central normaltid (S\u00f6dra Australien)", "CST", + "Central sommartid (S\u00f6dra Australien)", "CST"}; String AGT[] = new String[] {"Argentina, normaltid", "ART", "Argentina, sommartid", "ARST"}; String AKST[] = new String[] {"Alaska, normaltid", "AKST", @@ -61,10 +61,10 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { "Atlantisk sommartid", "ADT"}; String BDT[] = new String[] {"Bangladesh, normaltid", "BDT", "Bangladesh, sommartid", "BDST"}; - String BRISBANE[] = new String[] {"Eastern Standard Time (Queensland)", "EST", - "Eastern Summer Time (Queensland)", "EST"}; - String BROKEN_HILL[] = new String[] {"Central Standard Time (S\u00f6dra Australien/Nya Sydwales)", "CST", - "Central Summer Time (S\u00f6dra Australien/Nya Sydwales)", "CST"}; + String BRISBANE[] = new String[] {"\u00d6stlig normaltid (Queensland)", "EST", + "\u00d6stlig sommartid (Queensland)", "EST"}; + String BROKEN_HILL[] = new String[] {"Central normaltid (S\u00f6dra Australien/Nya Sydwales)", "CST", + "Central sommartid (S\u00f6dra Australien/Nya Sydwales)", "CST"}; String BRT[] = new String[] {"Brasilien, normaltid", "BRT", "Brasilien, sommartid", "BRST"}; String BTT[] = new String[] {"Bhutan, normaltid", "BTT", @@ -83,10 +83,10 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { "Central sommartid", "CDT"}; String CTT[] = new String[] {"Kina, normaltid", "CST", "Kina, sommartid", "CDT"}; - String CUBA[] = new String[] {"Cuba Standard Time", "CST", - "Cuba Daylight Time", "CDT"}; - String DARWIN[] = new String[] {"Central Standard Time (Nordterritoriet)", "CST", - "Central Summer Time (Nordterritoriet)", "CST"}; + String CUBA[] = new String[] {"Kuba, normaltid", "CST", + "Kuba, sommartid", "CDT"}; + String DARWIN[] = new String[] {"Central normaltid (Nordterritoriet)", "CST", + "Central sommartid (Nordterritoriet)", "CST"}; String DUBLIN[] = new String[] {"Greenwichtid", "GMT", "Irland, sommartid", "IST"}; String EAT[] = new String[] {"\u00d6stafrikansk tid", "EAT", @@ -99,8 +99,8 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { "\u00d6stgr\u00f6nl\u00e4ndsk sommartid", "EGST"}; String EST[] = new String[] {"Eastern, normaltid", "EST", "Eastern, sommartid", "EDT"}; - String EST_NSW[] = new String[] {"Eastern Standard Time (Nya Sydwales)", "EST", - "Eastern Summer Time (Nya Sydwales)", "EST"}; + String EST_NSW[] = new String[] {"Eastern, normaltid (Nya Sydwales)", "EST", + "Eastern, sommartid (Nya Sydwales)", "EST"}; String GHMT[] = new String[] {"Ghana, normaltid", "GMT", "Ghana, sommartid", "GHST"}; String GAMBIER[] = new String[] {"Gambier, normaltid", "GAMT", @@ -163,34 +163,34 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { "Salomon\u00f6arna, sommartid", "SBST"}; String SGT[] = new String[] {"Singapore, normaltid", "SGT", "Singapore, sommartid", "SGST"}; - String SLST[] = new String[] {"Greenwich Mean Time", "GMT", + String SLST[] = new String[] {"Greenwichtid", "GMT", "Sierra Leone, sommartid", "SLST"}; - String TASMANIA[] = new String[] {"Eastern Standard Time (Tasmanien)", "EST", - "Eastern Summer Time (Tasmanien)", "EST"}; + String TASMANIA[] = new String[] {"Eastern, normaltid (Tasmanien)", "EST", + "Eastern, sommartid (Tasmanien)", "EST"}; String TMT[] = new String[] {"Turkmenistan, normaltid", "TMT", "Turkmenistan, sommartid", "TMST"}; String TRUT[] = new String[] {"Truk, normaltid", "TRUT", "Truk, sommartid", "TRUST"}; String ULAT[]= new String[] {"Ulaanbaatar, normaltid", "ULAT", "Ulaanbaatar, sommartid", "ULAST"}; - String WART[] = new String[] {"Argentina, normaltid", "WART", - "Argentina, sommartid", "WARST"}; + String WART[] = new String[] {"V\u00e4stargentina, normaltid", "WART", + "V\u00e4stargentina, sommartid", "WARST"}; String WAT[] = new String[] {"V\u00e4stafrikansk tid", "WAT", "V\u00e4stafrikansk sommartid", "WAST"}; String WET[] = new String[] {"V\u00e4steuropeisk tid", "WET", "V\u00e4steuropeisk sommartid", "WEST"}; String WIT[] = new String[] {"V\u00e4stindonesisk tid", "WIT", "V\u00e4stindonesisk sommartid", "WIST"}; - String WST_AUS[] = new String[] {"Western Standard Time (Australien)", "WST", - "Western Summer Time (Australien)", "WST"}; + String WST_AUS[] = new String[] {"V\u00e4stlig normaltid (Australien)", "WST", + "V\u00e4stlig sommartid (Australien)", "WST"}; String SAMOA[] = new String[] {"Samoa, normaltid", "SST", "Samoa, sommartid", "SDT"}; String WST_SAMOA[] = new String[] {"V\u00e4stsamoansk tid", "WST", "V\u00e4stsamoansk sommartid", "WSST"}; String ChST[] = new String[] {"Chamorro, normaltid", "ChST", "Chamorro, sommartid", "ChDT"}; - String VICTORIA[] = new String[] {"Eastern Standard Time (Victoria)", "EST", - "Eastern Summer Time (Victoria)", "EST"}; + String VICTORIA[] = new String[] {"\u00d6stlig normaltid (Victoria)", "EST", + "\u00d6stlig sommartid (Victoria)", "EST"}; String UTC[] = new String[] {"Koordinerad universell tid", "UTC", "Koordinerad universell tid", "UTC"}; String UZT[] = new String[] {"Uzbekistan, normaltid", "UZT", @@ -384,6 +384,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { {"America/Manaus", AMT}, {"America/Marigot", AST}, {"America/Martinique", AST}, + {"America/Matamoros", CST}, {"America/Mazatlan", MST}, {"America/Mendoza", AGT}, {"America/Menominee", CST}, @@ -403,6 +404,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { {"America/Noronha", NORONHA}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, {"America/Paramaribo", new String[] {"Surinam, normaltid", "SRT", @@ -419,6 +421,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { {"America/Resolute", RST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, + {"America/Santa_Isabel", PST}, {"America/Santarem", BRT}, {"America/Santiago", CLT}, {"America/Santo_Domingo", AST}, @@ -594,8 +597,8 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { {"Australia/Canberra", EST_NSW}, {"Australia/Currie", EST_NSW}, {"Australia/Darwin", DARWIN}, - {"Australia/Eucla", new String[] {"Central Western Standard Time (Australia)", "CWST", - "Central Western Summer Time (Australia)", "CWST"}}, + {"Australia/Eucla", new String[] {"Central v\u00e4stlig normaltid (Australien)", "CWST", + "Central v\u00e4stlig sommartid (Australien)", "CWST"}}, {"Australia/Hobart", TASMANIA}, {"Australia/LHI", LORD_HOWE}, {"Australia/Lindeman", BRISBANE}, diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_zh_CN.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_zh_CN.java index 70cdbd0a987..ee21ad35209 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_zh_CN.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_zh_CN.java @@ -83,8 +83,8 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { "\u4e2d\u592e\u590f\u4ee4\u65f6", "CDT"}; String CTT[] = new String[] {"\u4e2d\u56fd\u6807\u51c6\u65f6\u95f4", "CST", "\u4e2d\u56fd\u590f\u4ee4\u65f6", "CDT"}; - String CUBA[] = new String[] {"Cuba Standard Time", "CST", - "Cuba Daylight Time", "CDT"}; + String CUBA[] = new String[] {"\u53e4\u5df4\u6807\u51c6\u65f6\u95f4", "CST", + "\u53e4\u5df4\u590f\u4ee4\u65f6", "CDT"}; String DARWIN[] = new String[] {"\u4e2d\u592e\u6807\u51c6\u65f6\u95f4\uff08\u5317\u9886\u5730\uff09", "CST", "\u4e2d\u592e\u590f\u4ee4\u65f6\uff08\u5317\u9886\u5730\uff09", "CST"}; String DUBLIN[] = new String[] {"\u683c\u6797\u5a01\u6cbb\u65f6\u95f4", "GMT", @@ -173,8 +173,8 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { "\u7279\u9c81\u514b\u590f\u4ee4\u65f6", "TRUST"}; String ULAT[]= new String[] {"\u5e93\u4f26\u65f6\u95f4", "ULAT", "\u5e93\u4f26\u590f\u4ee4\u65f6", "ULAST"}; - String WART[] = new String[] {"\u963f\u6839\u5ef7\u65f6\u95f4", "WART", - "\u963f\u6839\u5ef7\u590f\u4ee4\u65f6", "WARST"}; + String WART[] = new String[] {"\u897f\u963f\u6839\u5ef7\u65f6\u95f4", "WART", + "\u897f\u963f\u6839\u5ef7\u590f\u4ee4\u65f6", "WARST"}; String WAT[] = new String[] {"\u897f\u975e\u65f6\u95f4", "WAT", "\u897f\u975e\u590f\u4ee4\u65f6", "WAST"}; String WET[] = new String[] {"\u897f\u6b27\u65f6\u95f4", "WET", @@ -384,6 +384,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { {"America/Manaus", AMT}, {"America/Marigot", AST}, {"America/Martinique", AST}, + {"America/Matamoros", CST}, {"America/Mazatlan", MST}, {"America/Mendoza", AGT}, {"America/Menominee", CST}, @@ -403,6 +404,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { {"America/Noronha", NORONHA}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, {"America/Paramaribo", new String[] {"\u82cf\u5229\u5357\u65f6\u95f4", "SRT", @@ -419,6 +421,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { {"America/Resolute", RST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, + {"America/Santa_Isabel", PST}, {"America/Santarem", BRT}, {"America/Santiago", CLT}, {"America/Santo_Domingo", AST}, @@ -594,8 +597,8 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { {"Australia/Canberra", EST_NSW}, {"Australia/Currie", EST_NSW}, {"Australia/Darwin", DARWIN}, - {"Australia/Eucla", new String[] {"Central Western Standard Time (Australia)", "CWST", - "Central Western Summer Time (Australia)", "CWST"}}, + {"Australia/Eucla", new String[] {"\u4e2d\u897f\u90e8\u6807\u51c6\u65f6\u95f4\uff08\u6fb3\u5927\u5229\u4e9a\uff09", "CWST", + "\u4e2d\u897f\u90e8\u590f\u4ee4\u65f6\uff08\u6fb3\u5927\u5229\u4e9a\uff09", "CWST"}}, {"Australia/Hobart", TASMANIA}, {"Australia/LHI", LORD_HOWE}, {"Australia/Lindeman", BRISBANE}, diff --git a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_zh_TW.java b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_zh_TW.java index f5b89286ed0..189e55f1893 100644 --- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames_zh_TW.java +++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames_zh_TW.java @@ -83,8 +83,8 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { "\u4e2d\u592e\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "CDT"}; String CTT[] = new String[] {"\u4e2d\u570b\u6a19\u6e96\u6642\u9593", "CST", "\u4e2d\u570b\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "CDT"}; - String CUBA[] = new String[] {"Cuba Standard Time", "CST", - "Cuba Daylight Time", "CDT"}; + String CUBA[] = new String[] {"\u53e4\u5df4\u6a19\u6e96\u6642\u9593", "CST", + "\u53e4\u5df4\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "CDT"}; String DARWIN[] = new String[] {"\u4e2d\u90e8\u6a19\u6e96\u6642\u9593 (\u5317\u90e8\u5404\u5730\u5340)", "CST", "\u4e2d\u90e8\u590f\u4ee4\u6642\u9593 (\u5317\u90e8\u5404\u5730\u5340)", "CST"}; String DUBLIN[] = new String[] {"\u683c\u6797\u5a01\u6cbb\u5e73\u5747\u6642\u9593", "GMT", @@ -173,8 +173,8 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { "\u7279\u9b6f\u514b\u590f\u4ee4\u6642\u9593", "TRUST"}; String ULAT[]= new String[] {"\u5eab\u502b\u6642\u9593", "ULAT", "\u5eab\u502b\u590f\u4ee4\u6642\u9593", "ULAST"}; - String WART[] = new String[] {"\u963f\u6839\u5ef7\u6642\u9593", "WART", - "\u963f\u6839\u5ef7\u590f\u4ee4\u6642\u9593", "WARST"}; + String WART[] = new String[] {"\u897f\u963f\u6839\u5ef7\u6642\u9593", "WART", + "\u897f\u963f\u6839\u5ef7\u590f\u4ee4\u6642\u9593", "WARST"}; String WAT[] = new String[] {"\u897f\u975e\u6642\u9593", "WAT", "\u897f\u975e\u590f\u4ee4\u6642\u9593", "WAST"}; String WET[] = new String[] {"\u897f\u6b50\u6642\u9593", "WET", @@ -384,6 +384,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { {"America/Manaus", AMT}, {"America/Marigot", AST}, {"America/Martinique", AST}, + {"America/Matamoros", CST}, {"America/Mazatlan", MST}, {"America/Mendoza", AGT}, {"America/Menominee", CST}, @@ -403,6 +404,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { {"America/Noronha", NORONHA}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, {"America/Paramaribo", new String[] {"\u8607\u5229\u5357\u6642\u9593", "SRT", @@ -419,6 +421,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { {"America/Resolute", RST}, {"America/Rio_Branco", AMT}, {"America/Rosario", AGT}, + {"America/Santa_Isabel", PST}, {"America/Santarem", BRT}, {"America/Santiago", CLT}, {"America/Santo_Domingo", AST}, @@ -551,7 +554,8 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { {"Asia/Samarkand", UZT}, {"Asia/Seoul", KST}, {"Asia/Singapore", SGT}, - {"Asia/Taipei", CTT}, + {"Asia/Taipei", new String[] {"\u53f0\u7063\u6a19\u6e96\u6642\u9593", "TST", + "\u53f0\u7063\u590f\u4ee4\u6642\u9593", "TDT"}}, {"Asia/Tel_Aviv", ISRAEL}, {"Asia/Tashkent", UZT}, {"Asia/Tbilisi", new String[] {"\u55ac\u6cbb\u4e9e\u6642\u9593", "GET", @@ -594,8 +598,8 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { {"Australia/Canberra", EST_NSW}, {"Australia/Currie", EST_NSW}, {"Australia/Darwin", DARWIN}, - {"Australia/Eucla", new String[] {"Central Western Standard Time (Australia)", "CWST", - "Central Western Summer Time (Australia)", "CWST"}}, + {"Australia/Eucla", new String[] {"\u4e2d\u897f\u90e8\u6a19\u6e96\u6642\u9593 (\u6fb3\u5927\u5229\u4e9e)", "CWST", + "\u4e2d\u897f\u90e8\u65e5\u5149\u7bc0\u7d04\u6642\u9593 (\u6fb3\u5927\u5229\u4e9e)", "CWST"}}, {"Australia/Hobart", TASMANIA}, {"Australia/LHI", LORD_HOWE}, {"Australia/Lindeman", BRISBANE}, diff --git a/jdk/src/share/demo/jvmti/compiledMethodLoad/README.txt b/jdk/src/share/demo/jvmti/compiledMethodLoad/README.txt new file mode 100644 index 00000000000..f34fa1fc108 --- /dev/null +++ b/jdk/src/share/demo/jvmti/compiledMethodLoad/README.txt @@ -0,0 +1,42 @@ +# +# Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# - Neither the name of Sun Microsystems nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +compiledMethodLoad + +This agent library traces CompiledMethodLoad events along +with the HotSpot specific compile_info parameter. + +You can use this agent library as follows: + + java -agentlib:compiledMethodLoad ... + +See ${JAVA_HOME}/demo/jvmti/index.html for help running and building agents. + diff --git a/jdk/src/share/demo/jvmti/compiledMethodLoad/compiledMethodLoad.c b/jdk/src/share/demo/jvmti/compiledMethodLoad/compiledMethodLoad.c new file mode 100644 index 00000000000..9eec1b45e28 --- /dev/null +++ b/jdk/src/share/demo/jvmti/compiledMethodLoad/compiledMethodLoad.c @@ -0,0 +1,268 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Sun Microsystems nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include + +#include "jni.h" +#include "jvmti.h" +#include "jvmticmlr.h" + +#include "agent_util.h" + +/* Global static data */ +static char OUTPUT_FILE[] = "compiledMethodLoad.txt"; +static FILE *fp; +static jvmtiEnv *jvmti; +static jrawMonitorID lock; + +/* print a jvmtiCompiledMethodLoadDummyRecord */ +void +print_dummy_record(jvmtiCompiledMethodLoadDummyRecord* record, + jvmtiEnv* jvmti, FILE* fp) { + + if (record != NULL) { + fprintf(fp, "Dummy record detected containing message: %s\n", + (char *)record->message); + } +} + +/* print the specified stack frames */ +void +print_stack_frames(PCStackInfo* record, jvmtiEnv *jvmti, FILE* fp) { + if (record != NULL && record->methods != NULL) { + int i; + + for (i = 0; i < record->numstackframes; i++) { + jvmtiError err; + char* method_name = NULL; + char* class_name = NULL; + char* method_signature = NULL; + char* class_signature = NULL; + char* generic_ptr_method = NULL; + char* generic_ptr_class = NULL; + jmethodID id; + jclass declaringclassptr; + id = record->methods[i]; + + err = (*jvmti)->GetMethodDeclaringClass(jvmti, id, + &declaringclassptr); + check_jvmti_error(jvmti, err, "get method declaring class"); + + err = (*jvmti)->GetClassSignature(jvmti, declaringclassptr, + &class_signature, &generic_ptr_class); + check_jvmti_error(jvmti, err, "get class signature"); + + err = (*jvmti)->GetMethodName(jvmti, id, &method_name, + &method_signature, &generic_ptr_method); + check_jvmti_error(jvmti, err, "get method name"); + + fprintf(fp, "%s::%s %s %s @%d\n", class_signature, method_name, + method_signature, + generic_ptr_method == NULL ? "" : generic_ptr_method, + record->bcis[i]); + + if (method_name != NULL) { + err = (*jvmti)->Deallocate(jvmti, (unsigned char*)method_name); + check_jvmti_error(jvmti, err, "deallocate method_name"); + } + if (method_signature != NULL) { + err = (*jvmti)->Deallocate(jvmti, + (unsigned char*)method_signature); + check_jvmti_error(jvmti, err, "deallocate method_signature"); + } + if (generic_ptr_method != NULL) { + err = (*jvmti)->Deallocate(jvmti, + (unsigned char*)generic_ptr_method); + check_jvmti_error(jvmti, err, "deallocate generic_ptr_method"); + } + if (class_name != NULL) { + err = (*jvmti)->Deallocate(jvmti, (unsigned char*)class_name); + check_jvmti_error(jvmti, err, "deallocate class_name"); + } + if (class_signature != NULL) { + err = (*jvmti)->Deallocate(jvmti, + (unsigned char*)class_signature); + check_jvmti_error(jvmti, err, "deallocate class_signature"); + } + if (generic_ptr_class != NULL) { + err = (*jvmti)->Deallocate(jvmti, + (unsigned char*)generic_ptr_class); + check_jvmti_error(jvmti, err, "deallocate generic_ptr_class"); + } + } + } +} + +/* print a jvmtiCompiledMethodLoadInlineRecord */ +void +print_inline_info_record(jvmtiCompiledMethodLoadInlineRecord* record, + jvmtiEnv *jvmti, FILE* fp) { + + if (record != NULL && record->pcinfo != NULL) { + int numpcs = record->numpcs; + int i; + + for (i = 0; i < numpcs; i++) { + PCStackInfo pcrecord = (record->pcinfo[i]); + fprintf(fp, "PcDescriptor(pc=0x%lx):\n", (jint)(pcrecord.pc)); + print_stack_frames(&pcrecord, jvmti, fp); + } + } +} + +/* decode kind of CompiledMethodLoadRecord and print */ +void +print_records(jvmtiCompiledMethodLoadRecordHeader* list, jvmtiEnv *jvmti, + FILE* fp) +{ + jvmtiCompiledMethodLoadRecordHeader* curr = list; + fprintf(fp, "\nPrinting PC Descriptors\n\n"); + while (curr != NULL) { + switch (curr->kind) { + case JVMTI_CMLR_DUMMY: + print_dummy_record((jvmtiCompiledMethodLoadDummyRecord *)curr, + jvmti, fp); + break; + + case JVMTI_CMLR_INLINE_INFO: + print_inline_info_record( + (jvmtiCompiledMethodLoadInlineRecord *)curr, jvmti, fp); + break; + + default: + fprintf(fp, "Warning: unrecognized record: kind=%d\n", curr->kind); + break; + } + + curr = (jvmtiCompiledMethodLoadRecordHeader *)curr->next; + } +} + +/* Callback for JVMTI_EVENT_COMPILED_METHOD_LOAD */ +void JNICALL +compiled_method_load(jvmtiEnv *jvmti, jmethodID method, jint code_size, + const void* code_addr, jint map_length, const jvmtiAddrLocationMap* map, + const void* compile_info) +{ + jvmtiError err; + char* name = NULL; + char* signature = NULL; + char* generic_ptr = NULL; + jvmtiCompiledMethodLoadRecordHeader* pcs; + + err = (*jvmti)->RawMonitorEnter(jvmti, lock); + check_jvmti_error(jvmti, err, "raw monitor enter"); + + err = (*jvmti)->GetMethodName(jvmti, method, &name, &signature, + &generic_ptr); + check_jvmti_error(jvmti, err, "get method name"); + + fprintf(fp, "\nCompiled method load event\n"); + fprintf(fp, "Method name %s %s %s\n\n", name, signature, + generic_ptr == NULL ? "" : generic_ptr); + pcs = (jvmtiCompiledMethodLoadRecordHeader *)compile_info; + if (pcs != NULL) { + print_records(pcs, jvmti, fp); + } + + if (name != NULL) { + err = (*jvmti)->Deallocate(jvmti, (unsigned char*)name); + check_jvmti_error(jvmti, err, "deallocate name"); + } + if (signature != NULL) { + err = (*jvmti)->Deallocate(jvmti, (unsigned char*)signature); + check_jvmti_error(jvmti, err, "deallocate signature"); + } + if (generic_ptr != NULL) { + err = (*jvmti)->Deallocate(jvmti, (unsigned char*)generic_ptr); + check_jvmti_error(jvmti, err, "deallocate generic_ptr"); + } + + err = (*jvmti)->RawMonitorExit(jvmti, lock); + check_jvmti_error(jvmti, err, "raw monitor exit"); +} + +/* Agent_OnLoad() is called first, we prepare for a COMPILED_METHOD_LOAD + * event here. + */ +JNIEXPORT jint JNICALL +Agent_OnLoad(JavaVM *vm, char *options, void *reserved) +{ + jint rc; + jvmtiError err; + jvmtiCapabilities capabilities; + jvmtiEventCallbacks callbacks; + + fp = fopen(OUTPUT_FILE, "w"); + if (fp == NULL) { + fatal_error("ERROR: %s: Unable to create output file\n", OUTPUT_FILE); + return -1; + } + + /* Get JVMTI environment */ + rc = (*vm)->GetEnv(vm, (void **)&jvmti, JVMTI_VERSION); + if (rc != JNI_OK) { + fatal_error( + "ERROR: Unable to create jvmtiEnv, GetEnv failed, error=%d\n", rc); + return -1; + } + + /* add JVMTI capabilities */ + memset(&capabilities,0, sizeof(capabilities)); + capabilities.can_generate_compiled_method_load_events = 1; + err = (*jvmti)->AddCapabilities(jvmti, &capabilities); + check_jvmti_error(jvmti, err, "add capabilities"); + + /* set JVMTI callbacks for events */ + memset(&callbacks, 0, sizeof(callbacks)); + callbacks.CompiledMethodLoad = &compiled_method_load; + err = (*jvmti)->SetEventCallbacks(jvmti, &callbacks, sizeof(callbacks)); + check_jvmti_error(jvmti, err, "set event callbacks"); + + /* enable JVMTI events */ + err = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, + JVMTI_EVENT_COMPILED_METHOD_LOAD, NULL); + check_jvmti_error(jvmti, err, "set event notify"); + + /* create coordination monitor */ + err = (*jvmti)->CreateRawMonitor(jvmti, "agent lock", &lock); + check_jvmti_error(jvmti, err, "create raw monitor"); + + return 0; +} + +/* Agent_OnUnload() is called last */ +JNIEXPORT void JNICALL +Agent_OnUnload(JavaVM *vm) +{ +} diff --git a/jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt b/jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt new file mode 100644 index 00000000000..a759dc71751 --- /dev/null +++ b/jdk/src/share/demo/jvmti/compiledMethodLoad/sample.makefile.txt @@ -0,0 +1,148 @@ +# +# Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# - Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# - Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# - Neither the name of Sun Microsystems nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +######################################################################## +# +# Sample GNU Makefile for building JVMTI Demo compiledMethodLoad +# +# Example uses: +# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparc] +# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparcv9] +# gnumake JDK= OSNAME=linux [OPT=true] +# gnumake JDK= OSNAME=win32 [OPT=true] +# +######################################################################## + +# Source lists +LIBNAME=compiledMethodLoad +SOURCES=compiledMethodLoad.c ../agent_util/agent_util.c + +# Solaris Sun C Compiler Version 5.5 +ifeq ($(OSNAME), solaris) + # Sun Solaris Compiler options needed + COMMON_FLAGS=-mt -KPIC + # Options that help find errors + COMMON_FLAGS+= -Xa -v -xstrconst -xc99=%none + # Check LIBARCH for any special compiler options + LIBARCH=$(shell uname -p) + ifeq ($(LIBARCH), sparc) + COMMON_FLAGS+=-xarch=v8 -xregs=no%appl + endif + ifeq ($(LIBARCH), sparcv9) + COMMON_FLAGS+=-xarch=v9 -xregs=no%appl + endif + ifeq ($(OPT), true) + CFLAGS=-xO2 $(COMMON_FLAGS) + else + CFLAGS=-g $(COMMON_FLAGS) + endif + # Object files needed to create library + OBJECTS=$(SOURCES:%.c=%.o) + # Library name and options needed to build it + LIBRARY=lib$(LIBNAME).so + LDFLAGS=-z defs -ztext + # Libraries we are dependent on + LIBRARIES= -lc + # Building a shared library + LINK_SHARED=$(LINK.c) -G -o $@ +endif + +# Linux GNU C Compiler +ifeq ($(OSNAME), linux) + # GNU Compiler options needed to build it + COMMON_FLAGS=-fno-strict-aliasing -fPIC -fno-omit-frame-pointer + # Options that help find errors + COMMON_FLAGS+= -W -Wall -Wno-unused -Wno-parentheses + ifeq ($(OPT), true) + CFLAGS=-O2 $(COMMON_FLAGS) + else + CFLAGS=-g $(COMMON_FLAGS) + endif + # Object files needed to create library + OBJECTS=$(SOURCES:%.c=%.o) + # Library name and options needed to build it + LIBRARY=lib$(LIBNAME).so + LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text + # Libraries we are dependent on + LIBRARIES=-lc + # Building a shared library + LINK_SHARED=$(LINK.c) -shared -o $@ +endif + +# Windows Microsoft C/C++ Optimizing Compiler Version 12 +ifeq ($(OSNAME), win32) + CC=cl + # Compiler options needed to build it + COMMON_FLAGS=-Gy -DWIN32 + # Options that help find errors + COMMON_FLAGS+=-W0 -WX + ifeq ($(OPT), true) + CFLAGS= -Ox -Op -Zi $(COMMON_FLAGS) + else + CFLAGS= -Od -Zi $(COMMON_FLAGS) + endif + # Object files needed to create library + OBJECTS=$(SOURCES:%.c=%.obj) + # Library name and options needed to build it + LIBRARY=$(LIBNAME).dll + LDFLAGS= + # Libraries we are dependent on + LIBRARIES= + # Building a shared library + LINK_SHARED=link -dll -out:$@ +endif + +# Common -I options +CFLAGS += -I. +CFLAGS += -I../agent_util +CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME) + +# Default rule +all: $(LIBRARY) + +# Build native library +$(LIBRARY): $(OBJECTS) + $(LINK_SHARED) $(OBJECTS) $(LIBRARIES) + +# Cleanup the built bits +clean: + rm -f $(LIBRARY) $(OBJECTS) + +# Simple tester +test: all + LD_LIBRARY_PATH=`pwd` $(JDK)/bin/java -agentlib:$(LIBNAME) -version + +# Compilation rule only needed on Windows +ifeq ($(OSNAME), win32) +%.obj: %.c + $(COMPILE.c) $< +endif + diff --git a/jdk/src/share/demo/jvmti/index.html b/jdk/src/share/demo/jvmti/index.html index 87da6cc1171..b3efe373d45 100644 --- a/jdk/src/share/demo/jvmti/index.html +++ b/jdk/src/share/demo/jvmti/index.html @@ -99,6 +99,13 @@ version string supplied in the jvmti.h file, with the version number supplied by the VM at runtime. +
    3. +compiledMethodLoad +
      +This is a small agent that traces CompiledMethodLoad events along +with the HotSpot specific compile_info parameter. +
    4. +
    5. mtrace
      diff --git a/jdk/src/share/javavm/export/jvmticmlr.h b/jdk/src/share/javavm/export/jvmticmlr.h new file mode 100644 index 00000000000..d2713954f6f --- /dev/null +++ b/jdk/src/share/javavm/export/jvmticmlr.h @@ -0,0 +1,115 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * This header file defines the data structures sent by the VM + * through the JVMTI CompiledMethodLoad callback function via the + * "void * compile_info" parameter. The memory pointed to by the + * compile_info parameter may not be referenced after returning from + * the CompiledMethodLoad callback. These are VM implementation + * specific data structures that may evolve in future releases. A + * JVMTI agent should interpret a non-NULL compile_info as a pointer + * to a region of memory containing a list of records. In a typical + * usage scenario, a JVMTI agent would cast each record to a + * jvmtiCompiledMethodLoadRecordHeader, a struct that represents + * arbitrary information. This struct contains a kind field to indicate + * the kind of information being passed, and a pointer to the next + * record. If the kind field indicates inlining information, then the + * agent would cast the record to a jvmtiCompiledMethodLoadInlineRecord. + * This record contains an array of PCStackInfo structs, which indicate + * for every pc address what are the methods on the invocation stack. + * The "methods" and "bcis" fields in each PCStackInfo struct specify a + * 1-1 mapping between these inlined methods and their bytecode indices. + * This can be used to derive the proper source lines of the inlined + * methods. + */ + +#ifndef _JVMTI_CMLR_H_ +#define _JVMTI_CMLR_H_ + +enum { + JVMTI_CMLR_MAJOR_VERSION_1 = 0x00000001, + JVMTI_CMLR_MINOR_VERSION_0 = 0x00000000, + + JVMTI_CMLR_MAJOR_VERSION = 0x00000001, + JVMTI_CMLR_MINOR_VERSION = 0x00000000 + + /* + * This comment is for the "JDK import from HotSpot" sanity check: + * version: 1.0.0 + */ +}; + +typedef enum { + JVMTI_CMLR_DUMMY = 1, + JVMTI_CMLR_INLINE_INFO = 2 +} jvmtiCMLRKind; + +/* + * Record that represents arbitrary information passed through JVMTI + * CompiledMethodLoadEvent void pointer. + */ +typedef struct _jvmtiCompiledMethodLoadRecordHeader { + jvmtiCMLRKind kind; /* id for the kind of info passed in the record */ + jint majorinfoversion; /* major and minor info version values. Init'ed */ + jint minorinfoversion; /* to current version value in jvmtiExport.cpp. */ + + struct _jvmtiCompiledMethodLoadRecordHeader* next; +} jvmtiCompiledMethodLoadRecordHeader; + +/* + * Record that gives information about the methods on the compile-time + * stack at a specific pc address of a compiled method. Each element in + * the methods array maps to same element in the bcis array. + */ +typedef struct _PCStackInfo { + void* pc; /* the pc address for this compiled method */ + jint numstackframes; /* number of methods on the stack */ + jmethodID* methods; /* array of numstackframes method ids */ + jint* bcis; /* array of numstackframes bytecode indices */ +} PCStackInfo; + +/* + * Record that contains inlining information for each pc address of + * an nmethod. + */ +typedef struct _jvmtiCompiledMethodLoadInlineRecord { + jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */ + jint numpcs; /* number of pc descriptors in this nmethod */ + PCStackInfo* pcinfo; /* array of numpcs pc descriptors */ +} jvmtiCompiledMethodLoadInlineRecord; + +/* + * Dummy record used to test that we can pass records with different + * information through the void pointer provided that they can be cast + * to a jvmtiCompiledMethodLoadRecordHeader. + */ + +typedef struct _jvmtiCompiledMethodLoadDummyRecord { + jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */ + char message[50]; +} jvmtiCompiledMethodLoadDummyRecord; + +#endif diff --git a/jdk/src/share/lib/security/java.security b/jdk/src/share/lib/security/java.security index b975f25e1e5..1c9404f60af 100644 --- a/jdk/src/share/lib/security/java.security +++ b/jdk/src/share/lib/security/java.security @@ -55,10 +55,10 @@ security.provider.9=sun.security.smartcardio.SunPCSC # # Select the source of seed data for SecureRandom. By default an -# attempt is made to use the entropy gathering device specified by +# attempt is made to use the entropy gathering device specified by # the securerandom.source property. If an exception occurs when -# accessing the URL then the traditional system/thread activity -# algorithm is used. +# accessing the URL then the traditional system/thread activity +# algorithm is used. # # On Solaris and Linux systems, if file:/dev/urandom is specified and it # exists, a special SecureRandom implementation is activated by default. @@ -72,7 +72,7 @@ securerandom.source=file:/dev/urandom # The entropy gathering device is described as a URL and can also # be specified with the system property "java.security.egd". For example, # -Djava.security.egd=file:/dev/urandom -# Specifying this system property will override the securerandom.source +# Specifying this system property will override the securerandom.source # setting. # @@ -117,11 +117,6 @@ policy.ignoreIdentityScope=false # keystore.type=jks -# -# Class to instantiate as the system scope: -# -system.scope=sun.security.provider.IdentityDatabase - # # List of comma-separated packages that start with or equal this string # will cause a security exception to be thrown when @@ -149,7 +144,7 @@ package.access=sun.,com.sun.imageio. security.overridePropertiesFile=true # -# Determines the default key and trust manager factory algorithms for +# Determines the default key and trust manager factory algorithms for # the javax.net.ssl package. # ssl.KeyManagerFactory.algorithm=SunX509 @@ -168,10 +163,10 @@ ssl.TrustManagerFactory.algorithm=PKIX # is to cache for 30 seconds. # # NOTE: setting this to anything other than the default value can have -# serious security implications. Do not set it unless +# serious security implications. Do not set it unless # you are sure you are not exposed to DNS spoofing attack. # -#networkaddress.cache.ttl=-1 +#networkaddress.cache.ttl=-1 # The Java-level namelookup cache policy for failed lookups: # @@ -183,7 +178,7 @@ ssl.TrustManagerFactory.algorithm=PKIX # the WINS name service in addition to DNS, name service lookups # that fail may take a noticeably long time to return (approx. 5 seconds). # For this reason the default caching policy is to maintain these -# results for 10 seconds. +# results for 10 seconds. # # networkaddress.cache.negative.ttl=10 @@ -192,7 +187,7 @@ networkaddress.cache.negative.ttl=10 # Properties to configure OCSP for certificate revocation checking # -# Enable OCSP +# Enable OCSP # # By default, OCSP is not used for certificate revocation checking. # This property enables the use of OCSP when set to the value "true". @@ -201,7 +196,7 @@ networkaddress.cache.negative.ttl=10 # # Example, # ocsp.enable=true - + # # Location of the OCSP responder # @@ -213,15 +208,15 @@ networkaddress.cache.negative.ttl=10 # # Example, # ocsp.responderURL=http://ocsp.example.net:80 - + # # Subject name of the OCSP responder's certificate # # By default, the certificate of the OCSP responder is that of the issuer # of the certificate being validated. This property identifies the certificate -# of the OCSP responder when the default does not apply. Its value is a string -# distinguished name (defined in RFC 2253) which identifies a certificate in -# the set of certificates supplied during cert path validation. In cases where +# of the OCSP responder when the default does not apply. Its value is a string +# distinguished name (defined in RFC 2253) which identifies a certificate in +# the set of certificates supplied during cert path validation. In cases where # the subject name alone is not sufficient to uniquely identify the certificate # then both the "ocsp.responderCertIssuerName" and # "ocsp.responderCertSerialNumber" properties must be used instead. When this @@ -237,14 +232,14 @@ networkaddress.cache.negative.ttl=10 # of the certificate being validated. This property identifies the certificate # of the OCSP responder when the default does not apply. Its value is a string # distinguished name (defined in RFC 2253) which identifies a certificate in -# the set of certificates supplied during cert path validation. When this -# property is set then the "ocsp.responderCertSerialNumber" property must also -# be set. When the "ocsp.responderCertSubjectName" property is set then this +# the set of certificates supplied during cert path validation. When this +# property is set then the "ocsp.responderCertSerialNumber" property must also +# be set. When the "ocsp.responderCertSubjectName" property is set then this # property is ignored. # # Example, # ocsp.responderCertIssuerName="CN=Enterprise CA, O=XYZ Corp" - + # # Serial number of the OCSP responder's certificate # @@ -259,4 +254,31 @@ networkaddress.cache.negative.ttl=10 # # Example, # ocsp.responderCertSerialNumber=2A:FF:00 - + +# +# Policy for failed Kerberos KDC lookups: +# +# When a KDC is unavailable (network error, service failure, etc), it is +# put inside a blacklist and accessed less often for future requests. The +# value (case-insensitive) for this policy can be: +# +# tryLast +# KDCs in the blacklist are always tried after those not on the list. +# +# tryLess[:max_retries,timeout] +# KDCs in the blacklist are still tried by their order in the configuration, +# but with smaller max_retries and timeout values. max_retries and timeout +# are optional numerical parameters (default 1 and 5000, which means once +# and 5 seconds). Please notes that if any of the values defined here is +# more than what is defined in krb5.conf, it will be ignored. +# +# Whenever a KDC is detected as available, it is removed from the blacklist. +# The blacklist is reset when krb5.conf is reloaded. You can add +# refreshKrb5Config=true to a JAAS configuration file so that krb5.conf is +# reloaded whenever a JAAS authentication is attempted. +# +# Example, +# krb5.kdc.bad.policy = tryLast +# krb5.kdc.bad.policy = tryLess:2,2000 +krb5.kdc.bad.policy = tryLast + diff --git a/jdk/src/share/native/java/lang/StrictMath.c b/jdk/src/share/native/java/lang/StrictMath.c index 2bf12e3b71e..01024b309d3 100644 --- a/jdk/src/share/native/java/lang/StrictMath.c +++ b/jdk/src/share/native/java/lang/StrictMath.c @@ -94,18 +94,6 @@ Java_java_lang_StrictMath_cbrt(JNIEnv *env, jclass unused, jdouble d) return (jdouble) jcbrt((double)d); } -JNIEXPORT jdouble JNICALL -Java_java_lang_StrictMath_ceil(JNIEnv *env, jclass unused, jdouble d) -{ - return (jdouble) jceil((double)d); -} - -JNIEXPORT jdouble JNICALL -Java_java_lang_StrictMath_floor(JNIEnv *env, jclass unused, jdouble d) -{ - return (jdouble) jfloor((double)d); -} - JNIEXPORT jdouble JNICALL Java_java_lang_StrictMath_atan2(JNIEnv *env, jclass unused, jdouble d1, jdouble d2) { diff --git a/jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h b/jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h index 906bcf94916..874b964871b 100644 --- a/jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h +++ b/jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h @@ -29,7 +29,7 @@ #ifdef __NEWVALID /* special setup for Sun test regime */ #if defined(i386) || defined(i486) || \ defined(intel) || defined(x86) || \ - defined(i86pc) || defined(_M_IA64) + defined(i86pc) || defined(_M_IA64) || defined(ia64) #define _LITTLE_ENDIAN #endif #endif diff --git a/jdk/src/share/native/java/net/net_util.c b/jdk/src/share/native/java/net/net_util.c index 5634e736a34..c2464b24119 100644 --- a/jdk/src/share/native/java/net/net_util.c +++ b/jdk/src/share/native/java/net/net_util.c @@ -162,10 +162,11 @@ NET_SockaddrToInetAddress(JNIEnv *env, struct sockaddr *him, int *port) { JNIEXPORT jint JNICALL NET_SockaddrEqualsInetAddress(JNIEnv *env, struct sockaddr *him, jobject iaObj) { - jint family = (*env)->GetIntField(env, iaObj, ia_familyID) == IPv4? - AF_INET : AF_INET6; + jint family = AF_INET; #ifdef AF_INET6 + family = (*env)->GetIntField(env, iaObj, ia_familyID) == IPv4? + AF_INET : AF_INET6; if (him->sa_family == AF_INET6) { #ifdef WIN32 struct SOCKADDR_IN6 *him6 = (struct SOCKADDR_IN6 *)him; diff --git a/jdk/src/share/native/java/util/zip/ZipFile.c b/jdk/src/share/native/java/util/zip/ZipFile.c index f1da2a7bba7..6699d08e6db 100644 --- a/jdk/src/share/native/java/util/zip/ZipFile.c +++ b/jdk/src/share/native/java/util/zip/ZipFile.c @@ -81,7 +81,8 @@ ThrowZipException(JNIEnv *env, const char *msg) JNIEXPORT jlong JNICALL Java_java_util_zip_ZipFile_open(JNIEnv *env, jclass cls, jstring name, - jint mode, jlong lastModified) + jint mode, jlong lastModified, + jboolean usemmap) { const char *path = JNU_GetStringPlatformChars(env, name, 0); char *msg = 0; @@ -109,7 +110,7 @@ Java_java_util_zip_ZipFile_open(JNIEnv *env, jclass cls, jstring name, goto finally; } #endif - zip = ZIP_Put_In_Cache(path, zfd, &msg, lastModified); + zip = ZIP_Put_In_Cache0(path, zfd, &msg, lastModified, usemmap); } if (zip != 0) { diff --git a/jdk/src/share/native/java/util/zip/zip_util.c b/jdk/src/share/native/java/util/zip/zip_util.c index e6d2ef00452..986f0aaa669 100644 --- a/jdk/src/share/native/java/util/zip/zip_util.c +++ b/jdk/src/share/native/java/util/zip/zip_util.c @@ -251,11 +251,16 @@ freeZip(jzfile *zip) if (zip->lock != NULL) MDESTROY(zip->lock); free(zip->name); freeCEN(zip); + #ifdef USE_MMAP - if (zip->maddr != NULL) munmap((char *)zip->maddr, zip->mlen); -#else - free(zip->cencache.data); + if (zip->usemmap) { + if (zip->maddr != NULL) + munmap((char *)zip->maddr, zip->mlen); + } else #endif + { + free(zip->cencache.data); + } if (zip->comment != NULL) free(zip->comment); if (zip->zfd != -1) ZFILE_Close(zip->zfd); @@ -585,49 +590,53 @@ readCEN(jzfile *zip, jint knownTotal) ZIP_FORMAT_ERROR("invalid END header (bad central directory offset)"); #ifdef USE_MMAP - /* On Solaris & Linux prior to JDK 6, we used to mmap the whole jar file to - * read the jar file contents. However, this greatly increased the perceived - * footprint numbers because the mmap'ed pages were adding into the totals shown - * by 'ps' and 'top'. We switched to mmaping only the central directory of jar - * file while calling 'read' to read the rest of jar file. Here are a list of - * reasons apart from above of why we are doing so: - * 1. Greatly reduces mmap overhead after startup complete; - * 2. Avoids dual path code maintainance; - * 3. Greatly reduces risk of address space (not virtual memory) exhaustion. - */ - if (pagesize == 0) { - pagesize = (jlong)sysconf(_SC_PAGESIZE); - if (pagesize == 0) goto Catch; - } - if (cenpos > pagesize) { - offset = cenpos & ~(pagesize - 1); - } else { - offset = 0; - } - /* When we are not calling recursively, knownTotal is -1. */ - if (knownTotal == -1) { - void* mappedAddr; - /* Mmap the CEN and END part only. We have to figure - out the page size in order to make offset to be multiples of - page size. - */ - zip->mlen = cenpos - offset + cenlen + endhdrlen; - zip->offset = offset; - mappedAddr = mmap64(0, zip->mlen, PROT_READ, MAP_SHARED, zip->zfd, (off64_t) offset); - zip->maddr = (mappedAddr == (void*) MAP_FAILED) ? NULL : - (unsigned char*)mappedAddr; - - if (zip->maddr == NULL) { - jio_fprintf(stderr, "mmap failed for CEN and END part of zip file\n"); - goto Catch; + if (zip->usemmap) { + /* On Solaris & Linux prior to JDK 6, we used to mmap the whole jar file to + * read the jar file contents. However, this greatly increased the perceived + * footprint numbers because the mmap'ed pages were adding into the totals shown + * by 'ps' and 'top'. We switched to mmaping only the central directory of jar + * file while calling 'read' to read the rest of jar file. Here are a list of + * reasons apart from above of why we are doing so: + * 1. Greatly reduces mmap overhead after startup complete; + * 2. Avoids dual path code maintainance; + * 3. Greatly reduces risk of address space (not virtual memory) exhaustion. + */ + if (pagesize == 0) { + pagesize = (jlong)sysconf(_SC_PAGESIZE); + if (pagesize == 0) goto Catch; } - } - cenbuf = zip->maddr + cenpos - offset; -#else - if ((cenbuf = malloc((size_t) cenlen)) == NULL || - (readFullyAt(zip->zfd, cenbuf, cenlen, cenpos) == -1)) - goto Catch; + if (cenpos > pagesize) { + offset = cenpos & ~(pagesize - 1); + } else { + offset = 0; + } + /* When we are not calling recursively, knownTotal is -1. */ + if (knownTotal == -1) { + void* mappedAddr; + /* Mmap the CEN and END part only. We have to figure + out the page size in order to make offset to be multiples of + page size. + */ + zip->mlen = cenpos - offset + cenlen + endhdrlen; + zip->offset = offset; + mappedAddr = mmap64(0, zip->mlen, PROT_READ, MAP_SHARED, zip->zfd, (off64_t) offset); + zip->maddr = (mappedAddr == (void*) MAP_FAILED) ? NULL : + (unsigned char*)mappedAddr; + + if (zip->maddr == NULL) { + jio_fprintf(stderr, "mmap failed for CEN and END part of zip file\n"); + goto Catch; + } + } + cenbuf = zip->maddr + cenpos - offset; + } else #endif + { + if ((cenbuf = malloc((size_t) cenlen)) == NULL || + (readFullyAt(zip->zfd, cenbuf, cenlen, cenpos) == -1)) + goto Catch; + } + cenend = cenbuf + cenlen; /* Initialize zip file data structures based on the total number @@ -700,9 +709,11 @@ readCEN(jzfile *zip, jint knownTotal) cenpos = -1; Finally: -#ifndef USE_MMAP - free(cenbuf); +#ifdef USE_MMAP + if (!zip->usemmap) #endif + free(cenbuf); + return cenpos; } @@ -782,8 +793,16 @@ ZIP_Get_From_Cache(const char *name, char **pmsg, jlong lastModified) * If a zip error occurs, then *pmsg will be set to the error message text if * pmsg != 0. Otherwise, *pmsg will be set to NULL. */ + jzfile * ZIP_Put_In_Cache(const char *name, ZFILE zfd, char **pmsg, jlong lastModified) +{ + return ZIP_Put_In_Cache0(name, zfd, pmsg, lastModified, JNI_TRUE); +} + +jzfile * +ZIP_Put_In_Cache0(const char *name, ZFILE zfd, char **pmsg, jlong lastModified, + jboolean usemmap) { static char errbuf[256]; jlong len; @@ -793,6 +812,9 @@ ZIP_Put_In_Cache(const char *name, ZFILE zfd, char **pmsg, jlong lastModified) return NULL; } +#ifdef USE_MMAP + zip->usemmap = usemmap; +#endif zip->refs = 1; zip->lastModified = lastModified; @@ -877,8 +899,6 @@ ZIP_Close(jzfile *zip) return; } -#ifndef USE_MMAP - /* Empirically, most CEN headers are smaller than this. */ #define AMPLE_CEN_HEADER_SIZE 160 @@ -928,7 +948,6 @@ sequentialAccessReadCENHeader(jzfile *zip, jlong cenpos) cache->pos = cenpos; return cen; } -#endif /* not USE_MMAP */ typedef enum { ACCESS_RANDOM, ACCESS_SEQUENTIAL } AccessHint; @@ -953,14 +972,17 @@ newEntry(jzfile *zip, jzcell *zc, AccessHint accessHint) ze->comment = NULL; #ifdef USE_MMAP - cen = (char*) zip->maddr + zc->cenpos - zip->offset; -#else - if (accessHint == ACCESS_RANDOM) - cen = readCENHeader(zip, zc->cenpos, AMPLE_CEN_HEADER_SIZE); - else - cen = sequentialAccessReadCENHeader(zip, zc->cenpos); - if (cen == NULL) goto Catch; + if (zip->usemmap) { + cen = (char*) zip->maddr + zc->cenpos - zip->offset; + } else #endif + { + if (accessHint == ACCESS_RANDOM) + cen = readCENHeader(zip, zc->cenpos, AMPLE_CEN_HEADER_SIZE); + else + cen = sequentialAccessReadCENHeader(zip, zc->cenpos); + if (cen == NULL) goto Catch; + } nlen = CENNAM(cen); elen = CENEXT(cen); @@ -976,7 +998,6 @@ newEntry(jzfile *zip, jzcell *zc, AccessHint accessHint) if ((ze->name = malloc(nlen + 1)) == NULL) goto Catch; memcpy(ze->name, cen + CENHDR, nlen); ze->name[nlen] = '\0'; - if (elen > 0) { char *extra = cen + CENHDR + nlen; @@ -1037,9 +1058,10 @@ newEntry(jzfile *zip, jzcell *zc, AccessHint accessHint) ze = NULL; Finally: -#ifndef USE_MMAP - if (cen != NULL && accessHint == ACCESS_RANDOM) free(cen); +#ifdef USE_MMAP + if (!zip->usemmap) #endif + if (cen != NULL && accessHint == ACCESS_RANDOM) free(cen); return ze; } diff --git a/jdk/src/share/native/java/util/zip/zip_util.h b/jdk/src/share/native/java/util/zip/zip_util.h index 114fe842fcb..44765b2ca3e 100644 --- a/jdk/src/share/native/java/util/zip/zip_util.h +++ b/jdk/src/share/native/java/util/zip/zip_util.h @@ -45,9 +45,6 @@ * Header sizes including signatures */ -#ifdef USE_MMAP -#define SIGSIZ 4 -#endif #define LOCHDR 30 #define EXTHDR 16 #define CENHDR 46 @@ -211,9 +208,9 @@ typedef struct jzfile { /* Zip file */ jlong mlen; /* length (in bytes) mmaped */ jlong offset; /* offset of the mmapped region from the start of the file. */ -#else - cencache cencache; /* CEN header cache */ + jboolean usemmap; /* if mmap is used. */ #endif + cencache cencache; /* CEN header cache */ ZFILE zfd; /* open file descriptor */ void *lock; /* read lock */ char *comment; /* zip file comment */ @@ -259,6 +256,9 @@ ZIP_Get_From_Cache(const char *name, char **pmsg, jlong lastModified); jzfile * ZIP_Put_In_Cache(const char *name, ZFILE zfd, char **pmsg, jlong lastModified); +jzfile * +ZIP_Put_In_Cache0(const char *name, ZFILE zfd, char **pmsg, jlong lastModified, jboolean usemmap); + void JNICALL ZIP_Close(jzfile *zip); diff --git a/jdk/src/share/native/java/util/zip/zlib-1.2.3/zutil.h b/jdk/src/share/native/java/util/zip/zlib-1.2.3/zutil.h index 55e8f36db6e..7f26e625927 100644 --- a/jdk/src/share/native/java/util/zip/zlib-1.2.3/zutil.h +++ b/jdk/src/share/native/java/util/zip/zlib-1.2.3/zutil.h @@ -220,7 +220,8 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # endif # ifdef WIN32 /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ -# if !defined(vsnprintf) && !defined(NO_vsnprintf) +# if !defined(vsnprintf) && !defined(NO_vsnprintf) && (!defined(_MSC_VER) || (_MSC_VER < 1500)) + /* Only needed before Visual Studio 2008 */ # define vsnprintf _vsnprintf # endif # endif diff --git a/jdk/src/share/native/sun/management/Flag.c b/jdk/src/share/native/sun/management/Flag.c index b642c5e0519..e488d13e8f6 100644 --- a/jdk/src/share/native/sun/management/Flag.c +++ b/jdk/src/share/native/sun/management/Flag.c @@ -84,6 +84,7 @@ Java_sun_management_Flag_getFlags jint num_flags, i, index; jmmVMGlobal* globals; + size_t gsize; const char* class_name = "sun/management/Flag"; const char* signature = "(Ljava/lang/String;Ljava/lang/Object;ZZLcom/sun/management/VMOption$Origin;)V"; jobject origin; @@ -100,12 +101,14 @@ Java_sun_management_Flag_getFlags return 0; } - globals = (jmmVMGlobal*) malloc(count * sizeof(jmmVMGlobal)); + gsize = count * sizeof(jmmVMGlobal); + globals = (jmmVMGlobal*) malloc(gsize); if (globals == NULL) { JNU_ThrowOutOfMemoryError(env, 0); return 0; } + memset(globals, 0, gsize); num_flags = jmm_interface->GetVMGlobals(env, names, globals, count); if (num_flags == 0) { free(globals); diff --git a/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java b/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java index d0abaa0a97a..bc51b69b296 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java +++ b/jdk/src/solaris/classes/sun/awt/X11/InfoWindow.java @@ -45,6 +45,7 @@ public abstract class InfoWindow extends Window { protected InfoWindow(Frame parent, Color borderColor) { super(parent); + setType(Window.Type.POPUP); container = new Container() { @Override public Insets getInsets() { @@ -188,21 +189,22 @@ public abstract class InfoWindow extends Window { * WARNING: this method is executed on Toolkit thread! */ private void display() { - String tooltipString = liveArguments.getTooltipString(); - if (tooltipString == null) { - return; - } else if (tooltipString.length() > TOOLTIP_MAX_LENGTH) { - textLabel.setText(tooltipString.substring(0, TOOLTIP_MAX_LENGTH)); - } else { - textLabel.setText(tooltipString); - } - // Execute on EDT to avoid deadlock (see 6280857). SunToolkit.executeOnEventHandlerThread(target, new Runnable() { public void run() { if (liveArguments.isDisposed()) { return; } + + String tooltipString = liveArguments.getTooltipString(); + if (tooltipString == null) { + return; + } else if (tooltipString.length() > TOOLTIP_MAX_LENGTH) { + textLabel.setText(tooltipString.substring(0, TOOLTIP_MAX_LENGTH)); + } else { + textLabel.setText(tooltipString); + } + Point pointer = (Point)AccessController.doPrivileged(new PrivilegedAction() { public Object run() { if (!isPointerOverTrayIcon(liveArguments.getBounds())) { diff --git a/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java index a0ca6efb43d..78bc4e02c16 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java @@ -212,27 +212,6 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget return true; } - static XComponentPeer getNativeContainer(Component comp) { - if (comp == null) { - return null; - } - - synchronized(comp.getTreeLock()) { - while (comp != null && (ComponentAccessor.getPeer(comp) instanceof LightweightPeer)) { - comp = ComponentAccessor.getParent_NoClientCode(comp); - } - - if (comp != null) { - ComponentPeer peer = ComponentAccessor.getPeer(comp); - if (peer != null && peer instanceof XComponentPeer) { - return (XComponentPeer)peer; - } - } - } - - return null; - } - /************************************************* * FOCUS STUFF *************************************************/ @@ -508,13 +487,14 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget } XWindowPeer getParentTopLevel() { - Container parent = (target instanceof Container) ? ((Container)target) : (ComponentAccessor.getParent_NoClientCode(target)); + AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor(); + Container parent = (target instanceof Container) ? ((Container)target) : (compAccessor.getParent(target)); // Search for parent window while (parent != null && !(parent instanceof Window)) { - parent = ComponentAccessor.getParent_NoClientCode(parent); + parent = compAccessor.getParent(parent); } if (parent != null) { - return (XWindowPeer)ComponentAccessor.getPeer(parent); + return (XWindowPeer)compAccessor.getPeer(parent); } else { return null; } @@ -828,7 +808,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget public void endLayout() { if (!paintPending && !paintArea.isEmpty() - && !ComponentAccessor.getIgnoreRepaint(target)) + && !AWTAccessor.getComponentAccessor().getIgnoreRepaint(target)) { // if not waiting for native painting repaint damaged area postEvent(new PaintEvent(target, PaintEvent.PAINT, @@ -1239,11 +1219,11 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget // End of multi-buffering public void notifyTextComponentChange(boolean add){ - Container parent = ComponentAccessor.getParent_NoClientCode(target); + Container parent = AWTAccessor.getComponentAccessor().getParent(target); while(!(parent == null || parent instanceof java.awt.Frame || parent instanceof java.awt.Dialog)) { - parent = ComponentAccessor.getParent_NoClientCode(parent); + parent = AWTAccessor.getComponentAccessor().getParent(parent); } /* FIX ME - FIX ME need to implement InputMethods diff --git a/jdk/src/solaris/classes/sun/awt/X11/XContentWindow.java b/jdk/src/solaris/classes/sun/awt/X11/XContentWindow.java index 0c4cf626e0f..d55dc42b0bc 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XContentWindow.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XContentWindow.java @@ -32,7 +32,7 @@ import java.awt.event.ComponentEvent; import sun.util.logging.PlatformLogger; -import sun.awt.ComponentAccessor; +import sun.awt.AWTAccessor; /** * This class implements window which serves as content window for decorated frames. @@ -135,8 +135,7 @@ public final class XContentWindow extends XWindow { // NOTE: This method may be called by privileged threads. // DO NOT INVOKE CLIENT CODE ON THIS THREAD! public void handleResize(Rectangle bounds) { - ComponentAccessor.setWidth((Component)target, bounds.width); - ComponentAccessor.setHeight((Component)target, bounds.height); + AWTAccessor.getComponentAccessor().setSize((Component)target, bounds.width, bounds.height); postEvent(new ComponentEvent(target, ComponentEvent.COMPONENT_RESIZED)); } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDataTransferer.java b/jdk/src/solaris/classes/sun/awt/X11/XDataTransferer.java index c82f6b11b51..b08eed94dc2 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDataTransferer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDataTransferer.java @@ -28,14 +28,21 @@ package sun.awt.X11; import java.awt.Image; import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.UnsupportedFlavorException; import java.awt.image.BufferedImage; import java.awt.image.ColorModel; import java.awt.image.WritableRaster; +import java.io.BufferedReader; import java.io.InputStream; +import java.io.InputStreamReader; import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; + import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -48,6 +55,8 @@ import javax.imageio.spi.ImageWriterSpi; import sun.awt.datatransfer.DataTransferer; import sun.awt.datatransfer.ToolkitThreadBlockedHandler; +import java.io.ByteArrayOutputStream; + /** * Platform-specific support for the data transfer subsystem. */ @@ -108,6 +117,22 @@ public class XDataTransferer extends DataTransferer { return super.getCharsetForTextFormat(lFormat); } + protected boolean isURIListFormat(long format) { + String nat = getNativeForFormat(format); + if (nat == null) { + return false; + } + try { + DataFlavor df = new DataFlavor(nat); + if (df.getPrimaryType().equals("text") && df.getSubType().equals("uri-list")) { + return true; + } + } catch (Exception e) { + // Not a MIME format. + } + return false; + } + public boolean isFileFormat(long format) { return format == FILE_NAME_ATOM.getAtom() || format == DT_NET_FILE_ATOM.getAtom(); @@ -170,6 +195,19 @@ public class XDataTransferer extends DataTransferer { } } + protected ByteArrayOutputStream convertFileListToBytes(ArrayList fileList) + throws IOException + { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + for (int i = 0; i < fileList.size(); i++) + { + byte[] bytes = fileList.get(i).getBytes(); + if (i != 0) bos.write(0); + bos.write(bytes, 0, bytes.length); + } + return bos; + } + /** * Translates either a byte array or an input stream which contain * platform-specific image data in the given format into an Image. @@ -215,6 +253,52 @@ public class XDataTransferer extends DataTransferer { } } + protected URI[] dragQueryURIs(InputStream stream, + byte[] bytes, + long format, + Transferable localeTransferable) + throws IOException { + + String charset = null; + if (localeTransferable != null && + isLocaleDependentTextFormat(format) && + localeTransferable.isDataFlavorSupported(javaTextEncodingFlavor)) { + try { + charset = new String( + (byte[])localeTransferable.getTransferData(javaTextEncodingFlavor), + "UTF-8" + ); + } catch (UnsupportedFlavorException cannotHappen) { + } + } else { + charset = getCharsetForTextFormat(format); + } + if (charset == null) { + // Only happens when we have a custom text type. + charset = getDefaultTextCharset(); + } + + BufferedReader reader = null; + try { + reader = new BufferedReader(new InputStreamReader(stream, charset)); + String line; + ArrayList uriList = new ArrayList(); + URI uri; + while ((line = reader.readLine()) != null) { + try { + uri = new URI(line); + } catch (URISyntaxException uriSyntaxException) { + throw new IOException(uriSyntaxException); + } + uriList.add(uri); + } + return uriList.toArray(new URI[uriList.size()]); + } finally { + if (reader != null) + reader.close(); + } + } + /** * Returns true if and only if the name of the specified format Atom * constitutes a valid MIME type with the specified primary type. diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java index a855ade0464..50d50dd02de 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java @@ -32,7 +32,7 @@ import java.awt.event.WindowEvent; import sun.util.logging.PlatformLogger; -import sun.awt.ComponentAccessor; +import sun.awt.AWTAccessor; import sun.awt.SunToolkit; abstract class XDecoratedPeer extends XWindowPeer { @@ -167,10 +167,11 @@ abstract class XDecoratedPeer extends XWindowPeer { } public Graphics getGraphics() { + AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor(); return getGraphics(content.surfaceData, - ComponentAccessor.getForeground(target), - ComponentAccessor.getBackground(target), - ComponentAccessor.getFont_NoClientCode(target)); + compAccessor.getForeground(target), + compAccessor.getBackground(target), + compAccessor.getFont(target)); } public void setTitle(String title) { @@ -404,8 +405,7 @@ abstract class XDecoratedPeer extends XWindowPeer { public void handleMoved(WindowDimensions dims) { Point loc = dims.getLocation(); - ComponentAccessor.setX((Component)target, loc.x); - ComponentAccessor.setY((Component)target, loc.y); + AWTAccessor.getComponentAccessor().setLocation((Component)target, loc.x, loc.y); postEvent(new ComponentEvent(target, ComponentEvent.COMPONENT_MOVED)); } @@ -511,8 +511,8 @@ abstract class XDecoratedPeer extends XWindowPeer { // its location changes. Point oldLocation = getLocation(); - Point newLocation = new Point(ComponentAccessor.getX((Component)target), - ComponentAccessor.getY((Component)target)); + Point newLocation = new Point(AWTAccessor.getComponentAccessor().getX((Component)target), + AWTAccessor.getComponentAccessor().getY((Component)target)); if (!newLocation.equals(oldLocation)) { handleMoved(newDimensions); @@ -710,10 +710,7 @@ abstract class XDecoratedPeer extends XWindowPeer { updateChildrenSizes(); // Bounds of the window - Rectangle targetBounds = new Rectangle(ComponentAccessor.getX((Component)target), - ComponentAccessor.getY((Component)target), - ComponentAccessor.getWidth((Component)target), - ComponentAccessor.getHeight((Component)target)); + Rectangle targetBounds = AWTAccessor.getComponentAccessor().getBounds((Component)target); Point newLocation = targetBounds.getLocation(); if (xe.get_send_event() || runningWM == XWM.NO_WM || XWM.isNonReparentingWM()) { @@ -1042,10 +1039,11 @@ abstract class XDecoratedPeer extends XWindowPeer { } final void dumpTarget() { - int getWidth = ComponentAccessor.getWidth((Component)target); - int getHeight = ComponentAccessor.getHeight((Component)target); - int getTargetX = ComponentAccessor.getX((Component)target); - int getTargetY = ComponentAccessor.getY((Component)target); + AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor(); + int getWidth = compAccessor.getWidth((Component)target); + int getHeight = compAccessor.getHeight((Component)target); + int getTargetX = compAccessor.getX((Component)target); + int getTargetY = compAccessor.getY((Component)target); System.err.println(">>> Target: " + getTargetX + ", " + getTargetY + ", " + getWidth + ", " + getHeight); } @@ -1099,9 +1097,9 @@ abstract class XDecoratedPeer extends XWindowPeer { return false; } + @Override boolean isOverrideRedirect() { -// return false; - return ((XToolkit)Toolkit.getDefaultToolkit()).isOverrideRedirect((Window)target); + return Window.Type.POPUP.equals(getWindowType()); } public boolean requestWindowFocus(long time, boolean timeProvided) { @@ -1208,7 +1206,7 @@ abstract class XDecoratedPeer extends XWindowPeer { Window owner = XWindowPeer.getDecoratedOwner(actualFocusedWindow); if (owner != null && owner == target) { - setActualFocusedWindow((XWindowPeer) ComponentAccessor.getPeer(actualFocusedWindow)); + setActualFocusedWindow((XWindowPeer) AWTAccessor.getComponentAccessor().getPeer(actualFocusedWindow)); } } super.handleWindowFocusOut(oppositeWindow, serial); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDialogPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XDialogPeer.java index ef7bfdaa03c..6b1da251044 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDialogPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDialogPeer.java @@ -28,7 +28,7 @@ import java.util.*; import java.awt.*; import java.awt.peer.*; import java.awt.event.*; -import sun.awt.ComponentAccessor; +import sun.awt.AWTAccessor; import sun.awt.*; @@ -117,7 +117,7 @@ class XDialogPeer extends XDecoratedPeer implements DialogPeer { try { javaToplevels = XWindowPeer.collectJavaToplevels(); for (Window w : toBlock) { - XWindowPeer wp = (XWindowPeer)ComponentAccessor.getPeer(w); + XWindowPeer wp = (XWindowPeer)AWTAccessor.getComponentAccessor().getPeer(w); if (wp != null) { wp.setModalBlocked((Dialog)target, true, javaToplevels); } @@ -139,7 +139,7 @@ class XDialogPeer extends XDecoratedPeer implements DialogPeer { XWindowPeer focusedWindowPeer = null; if (focusedWindow != null) { - focusedWindowPeer = (XWindowPeer)ComponentAccessor.getPeer(focusedWindow); + focusedWindowPeer = (XWindowPeer)AWTAccessor.getComponentAccessor().getPeer(focusedWindow); } else { /* * For the case when a potential blocked window is not yet focused diff --git a/jdk/src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java index 5188fe7169b..da84049febb 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java @@ -39,11 +39,10 @@ import java.util.*; import sun.util.logging.PlatformLogger; -import sun.awt.ComponentAccessor; - import sun.awt.dnd.SunDragSourceContextPeer; import sun.awt.dnd.SunDropTargetContextPeer; import sun.awt.SunToolkit; +import sun.awt.AWTAccessor; /** * The XDragSourceContextPeer class is the class responsible for handling @@ -117,7 +116,7 @@ public final class XDragSourceContextPeer XWindowPeer wpeer = null; for (c = component; c != null && !(c instanceof Window); - c = ComponentAccessor.getParent_NoClientCode(c)); + c = AWTAccessor.getComponentAccessor().getParent(c)); if (c instanceof Window) { wpeer = (XWindowPeer)c.getPeer(); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XEmbedChildProxy.java b/jdk/src/solaris/classes/sun/awt/X11/XEmbedChildProxy.java index 47b4da501e0..baf3a14f075 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedChildProxy.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedChildProxy.java @@ -27,7 +27,7 @@ package sun.awt.X11; import java.awt.Component; import java.awt.Toolkit; -import sun.awt.ComponentAccessor; +import sun.awt.AWTAccessor; public class XEmbedChildProxy extends Component { long handle; @@ -39,8 +39,9 @@ public class XEmbedChildProxy extends Component { public void addNotify() { synchronized(getTreeLock()) { - if (ComponentAccessor.getPeer(this) == null) { - ComponentAccessor.setPeer(this, ((XToolkit)Toolkit.getDefaultToolkit()).createEmbedProxy(this)); + if (AWTAccessor.getComponentAccessor().getPeer(this) == null) { + AWTAccessor.getComponentAccessor(). + setPeer(this,((XToolkit)Toolkit.getDefaultToolkit()).createEmbedProxy(this)); } super.addNotify(); } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java b/jdk/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java index f79de9cf927..0874502db1f 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java @@ -133,7 +133,7 @@ public class XEmbedClientHelper extends XEmbedHelper implements XEventDispatcher } void handleFocusIn(int detail) { if (embedded.focusAllowedFor()) { - embedded.handleWindowFocusInSync(0); + embedded.handleWindowFocusIn(0); } switch(detail) { case XEMBED_FOCUS_CURRENT: @@ -205,7 +205,7 @@ public class XEmbedClientHelper extends XEmbedHelper implements XEventDispatcher // embedded is an active window before sending WINDOW_LOST_FOCUS // to shared code if (XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow() == embedded.target) { - embedded.handleWindowFocusOutSync(null, 0); + embedded.handleWindowFocusOut(null, 0); } } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XEmbedHelper.java b/jdk/src/solaris/classes/sun/awt/X11/XEmbedHelper.java index 57267039bd1..c60b4a53092 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XEmbedHelper.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbedHelper.java @@ -216,7 +216,12 @@ public class XEmbedHelper { XToolkit.awtLock(); try { - keycode = XWindow.getAWTKeyCodeForKeySym((int)keysym); + XKeysym.Keysym2JavaKeycode kc = XKeysym.getJavaKeycode( keysym ); + if(kc == null) { + keycode = java.awt.event.KeyEvent.VK_UNDEFINED; + }else{ + keycode = kc.getJavaKeycode(); + } } finally { XToolkit.awtUnlock(); } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java index a50437a1ee8..24acdee5721 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java @@ -37,6 +37,7 @@ import javax.swing.plaf.ComponentUI; import java.security.AccessController; import java.security.PrivilegedAction; import sun.util.logging.PlatformLogger; +import sun.awt.AWTAccessor; class XFileDialogPeer extends XDialogPeer implements FileDialogPeer, ActionListener, ItemListener, KeyEventDispatcher, XChoicePeerListener { private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XFileDialogPeer"); @@ -171,6 +172,10 @@ class XFileDialogPeer extends XDialogPeer implements FileDialogPeer, ActionListe filterField = new TextField(); selectionField = new TextField(); + boolean isMultipleMode = + AWTAccessor.getFileDialogAccessor().isMultipleMode(target); + fileList.setMultipleMode(isMultipleMode); + // the insets used by the components in the fileDialog Insets noInset = new Insets(0, 0, 0, 0); Insets textFieldInset = new Insets(0, 8, 0, 8); @@ -380,7 +385,8 @@ class XFileDialogPeer extends XDialogPeer implements FileDialogPeer, ActionListe * handle the selection event */ void handleSelection(String file) { - int index = file.lastIndexOf('/'); + + int index = file.lastIndexOf(java.io.File.separatorChar); if (index == -1) { savedDir = this.dir; @@ -389,8 +395,12 @@ class XFileDialogPeer extends XDialogPeer implements FileDialogPeer, ActionListe savedDir = file.substring(0, index+1); savedFile = file.substring(index+1); } - target.setDirectory(savedDir); - target.setFile(savedFile); + + AWTAccessor.FileDialogAccessor fileDialogAccessor = AWTAccessor.getFileDialogAccessor(); + + fileDialogAccessor.setDirectory(target, savedDir); + fileDialogAccessor.setFile(target, savedFile); + fileDialogAccessor.setFiles(target, savedDir, fileList.getSelectedItems()); } /** @@ -404,8 +414,13 @@ class XFileDialogPeer extends XDialogPeer implements FileDialogPeer, ActionListe setFilterField(null); directoryList.clear(); fileList.clear(); - target.setFile(null); - target.setDirectory(null); + + AWTAccessor.FileDialogAccessor fileDialogAccessor = AWTAccessor.getFileDialogAccessor(); + + fileDialogAccessor.setDirectory(target, null); + fileDialogAccessor.setFile(target, null); + fileDialogAccessor.setFiles(target, null, null); + handleQuitButton(); } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XGlobalCursorManager.java b/jdk/src/solaris/classes/sun/awt/X11/XGlobalCursorManager.java index 43ae1f89004..244c0ac6aff 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XGlobalCursorManager.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XGlobalCursorManager.java @@ -31,7 +31,7 @@ import java.awt.peer.LightweightPeer; import java.lang.ref.WeakReference; import java.lang.reflect.Field; import java.lang.reflect.Method; -import sun.awt.ComponentAccessor; +import sun.awt.AWTAccessor; import sun.awt.GlobalCursorManager; import sun.awt.SunToolkit; @@ -94,11 +94,11 @@ public final class XGlobalCursorManager extends GlobalCursorManager { nc = nativeContainer.get(); } } else { - nc = getNativeContainer(comp); + nc = SunToolkit.getHeavyweightComponent(comp); } if (nc != null) { - ComponentPeer nc_peer = ComponentAccessor.getPeer(nc); + ComponentPeer nc_peer = AWTAccessor.getComponentAccessor().getPeer(nc); if (nc_peer instanceof XComponentPeer) { synchronized (this) { nativeContainer = new WeakReference(nc); @@ -133,13 +133,6 @@ public final class XGlobalCursorManager extends GlobalCursorManager { updateGrabbedCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } - private Component getNativeContainer(Component comp) { - while (comp != null && ComponentAccessor.getPeer(comp) instanceof LightweightPeer) { - comp = ComponentAccessor.getParent_NoClientCode(comp); - } - return comp; - } - protected void getCursorPos(Point p) { if (!((XToolkit)Toolkit.getDefaultToolkit()).getLastCursorPos(p)) { @@ -186,27 +179,29 @@ public final class XGlobalCursorManager extends GlobalCursorManager { } private Cursor getCapableCursor(Component comp) { + AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor(); + Component c = comp; while ((c != null) && !(c instanceof Window) - && ComponentAccessor.isEnabledImpl(c) - && ComponentAccessor.getVisible(c) - && ComponentAccessor.getPeer(c) != null) + && compAccessor.isEnabled(c) + && compAccessor.isVisible(c) + && compAccessor.isDisplayable(c)) { - c = ComponentAccessor.getParent_NoClientCode(c); + c = compAccessor.getParent(c); } if (c instanceof Window) { - return (ComponentAccessor.isEnabledImpl(c) - && ComponentAccessor.getVisible(c) - && (ComponentAccessor.getPeer(c) != null) - && ComponentAccessor.isEnabledImpl(comp)) + return (compAccessor.isEnabled(c) + && compAccessor.isVisible(c) + && compAccessor.isDisplayable(c) + && compAccessor.isEnabled(comp)) ? - ComponentAccessor.getCursor_NoClientCode(comp) + compAccessor.getCursor(comp) : Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR); } else if (c == null) { return null; } - return getCapableCursor(ComponentAccessor.getParent_NoClientCode(c)); + return getCapableCursor(compAccessor.getParent(c)); } /* This methods needs to be called from within XToolkit.awtLock / XToolkit.awtUnlock section. */ diff --git a/jdk/src/solaris/classes/sun/awt/X11/XKeysym.java b/jdk/src/solaris/classes/sun/awt/X11/XKeysym.java index abf3c65c547..e81c6ce323e 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XKeysym.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XKeysym.java @@ -69,6 +69,8 @@ public class XKeysym { static Hashtable javaKeycode2KeysymHash = new Hashtable(); static long keysym_lowercase = unsafe.allocateMemory(Native.getLongSize()); static long keysym_uppercase = unsafe.allocateMemory(Native.getLongSize()); + static Keysym2JavaKeycode kanaLock = new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_KANA_LOCK, + java.awt.event.KeyEvent.KEY_LOCATION_STANDARD); private static PlatformLogger keyEventLog = PlatformLogger.getLogger("sun.awt.X11.kye.XKeysym"); public static char convertKeysym( long ks, int state ) { @@ -214,12 +216,35 @@ public class XKeysym { } return keysym; } + + /** + Return java.awt.KeyEvent constant meaning (Java) keycode, derived from X keysym. + Some keysyms maps to more than one keycode, these would require extra processing. + */ + static Keysym2JavaKeycode getJavaKeycode( long keysym ) { + if(keysym == XKeySymConstants.XK_Mode_switch){ + /* XK_Mode_switch on solaris maps either to VK_ALT_GRAPH (default) or VK_KANA_LOCK */ + if( XToolkit.isKanaKeyboard() ) { + return kanaLock; + } + }else if(keysym == XKeySymConstants.XK_L1){ + /* if it is Sun keyboard, trick hash to return VK_STOP else VK_F11 (default) */ + if( XToolkit.isSunKeyboard() ) { + keysym = XKeySymConstants.SunXK_Stop; + } + }else if(keysym == XKeySymConstants.XK_L2) { + /* if it is Sun keyboard, trick hash to return VK_AGAIN else VK_F12 (default) */ + if( XToolkit.isSunKeyboard() ) { + keysym = XKeySymConstants.SunXK_Again; + } + } + + return keysym2JavaKeycodeHash.get( keysym ); + } /** Return java.awt.KeyEvent constant meaning (Java) keycode, derived from X Window KeyEvent. Algorithm is, extract via XKeycodeToKeysym a proper keysym according to Xlib spec rules and err exceptions, then search a java keycode in a table. - Some keysyms maps to more than one keycode, these would require extra processing. If someone - points me to such a keysym. */ static Keysym2JavaKeycode getJavaKeycode( XKeyEvent ev ) { // get from keysym2JavaKeycodeHash. @@ -234,7 +259,7 @@ public class XKeysym { keysym = xkeycode2keysym(ev, ndx); } - Keysym2JavaKeycode jkc = keysym2JavaKeycodeHash.get( keysym ); + Keysym2JavaKeycode jkc = getJavaKeycode( keysym ); return jkc; } static int getJavaKeycodeOnly( XKeyEvent ev ) { @@ -259,7 +284,7 @@ public class XKeysym { ndx = 0; keysym = xkeycode2keysym_noxkb(ev, ndx); } - Keysym2JavaKeycode jkc = keysym2JavaKeycodeHash.get( keysym ); + Keysym2JavaKeycode jkc = getJavaKeycode( keysym ); return jkc == null ? java.awt.event.KeyEvent.VK_UNDEFINED : jkc.getJavaKeycode(); } static long javaKeycode2Keysym( int jkey ) { diff --git a/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java b/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java index 86252721be5..a06f24ff62d 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XNETProtocol.java @@ -252,8 +252,11 @@ final class XNETProtocol extends XProtocol implements XStateProtocol, XLayerProt XAtom XA_NET_WM_STATE_SKIP_TASKBAR = XAtom.get("_NET_WM_STATE_SKIP_TASKBAR"); XAtom XA_NET_WM_STATE_SKIP_PAGER = XAtom.get("_NET_WM_STATE_SKIP_PAGER"); - XAtom XA_NET_WM_WINDOW_TYPE = XAtom.get("_NET_WM_WINDOW_TYPE"); - XAtom XA_NET_WM_WINDOW_TYPE_DIALOG = XAtom.get("_NET_WM_WINDOW_TYPE_DIALOG"); + public final XAtom XA_NET_WM_WINDOW_TYPE = XAtom.get("_NET_WM_WINDOW_TYPE"); + public final XAtom XA_NET_WM_WINDOW_TYPE_NORMAL = XAtom.get("_NET_WM_WINDOW_TYPE_NORMAL"); + public final XAtom XA_NET_WM_WINDOW_TYPE_DIALOG = XAtom.get("_NET_WM_WINDOW_TYPE_DIALOG"); + public final XAtom XA_NET_WM_WINDOW_TYPE_UTILITY = XAtom.get("_NET_WM_WINDOW_TYPE_UTILITY"); + public final XAtom XA_NET_WM_WINDOW_TYPE_POPUP_MENU = XAtom.get("_NET_WM_WINDOW_TYPE_POPUP_MENU"); XAtom XA_NET_WM_WINDOW_OPACITY = XAtom.get("_NET_WM_WINDOW_OPACITY"); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java index d0b2da84d06..51cc74ce6d8 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java @@ -60,7 +60,7 @@ import javax.swing.text.JTextComponent; import javax.swing.plaf.BorderUIResource; import java.awt.im.InputMethodRequests; import sun.awt.CausedFocusEvent; -import sun.awt.ComponentAccessor; +import sun.awt.AWTAccessor; class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { @@ -119,13 +119,14 @@ class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { textPane.setVisible(true); textPane.validate(); - foreground = ComponentAccessor.getForeground(target); + AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor(); + foreground = compAccessor.getForeground(target); if (foreground == null) { foreground = SystemColor.textText; } setForeground(foreground); - background = ComponentAccessor.getBackground(target); + background = compAccessor.getBackground(target); if (background == null) { if (target.isEditable()) background = SystemColor.text; else background = SystemColor.control; @@ -134,8 +135,8 @@ class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { if (!target.isBackgroundSet()) { // This is a way to set the background color of the TextArea - // without calling setBackground - go through reflection - ComponentAccessor.setBackground(target, background); + // without calling setBackground - go through accessor + compAccessor.setBackground(target, background); } if (!target.isForegroundSet()) { target.setForeground(SystemColor.textText); @@ -311,13 +312,13 @@ class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { } void handleJavaKeyEvent(KeyEvent e) { - ComponentAccessor.processEvent(jtext,e); + AWTAccessor.getComponentAccessor().processEvent(jtext,e); } public boolean handlesWheelScrolling() { return true; } void handleJavaMouseWheelEvent(MouseWheelEvent e) { - ComponentAccessor.processEvent(textPane,e); + AWTAccessor.getComponentAccessor().processEvent(textPane,e); } public void handleJavaMouseEvent( MouseEvent e ) { @@ -1111,7 +1112,7 @@ class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { this.xwin = xwin; setDoubleBuffered(true); jt.addFocusListener(this); - ComponentAccessor.setParent(this,parent); + AWTAccessor.getComponentAccessor().setParent(this,parent); setViewportBorder(new BevelBorder(false,SystemColor.controlDkShadow,SystemColor.controlLtHighlight) ); this.jtext = jt; setFocusable(false); @@ -1308,7 +1309,7 @@ class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { c = current.getButton(); p = toLocalSpace( c, p ); } - ComponentAccessor.processEvent( c, newMouseEvent( c, p, event ) ); + AWTAccessor.getComponentAccessor().processEvent( c, newMouseEvent( c, p, event ) ); break; } } diff --git a/jdk/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java index 981478fd789..f8726e41899 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XTextFieldPeer.java @@ -55,7 +55,7 @@ import java.awt.im.InputMethodRequests; import sun.util.logging.PlatformLogger; import sun.awt.CausedFocusEvent; -import sun.awt.ComponentAccessor; +import sun.awt.AWTAccessor; public class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.X11.XTextField"); @@ -115,13 +115,14 @@ public class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { setBounds(x, y, width, height, SET_BOUNDS); - foreground = ComponentAccessor.getForeground(target); + AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor(); + foreground = compAccessor.getForeground(target); if (foreground == null) foreground = SystemColor.textText; setForeground(foreground); - background = ComponentAccessor.getBackground(target); + background = compAccessor.getBackground(target); if (background == null) { if (((TextField)target).isEditable()) background = SystemColor.text; else background = SystemColor.control; @@ -130,8 +131,8 @@ public class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { if (!target.isBackgroundSet()) { // This is a way to set the background color of the TextArea - // without calling setBackground - go through reflection - ComponentAccessor.setBackground(target, background); + // without calling setBackground - go through accessor + compAccessor.setBackground(target, background); } if (!target.isForegroundSet()) { target.setForeground(SystemColor.textText); @@ -392,7 +393,7 @@ public class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { } void handleJavaKeyEvent(KeyEvent e) { - ComponentAccessor.processEvent(xtext,e); + AWTAccessor.getComponentAccessor().processEvent(xtext,e); } @@ -620,7 +621,7 @@ public class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { this.peer = peer; setDoubleBuffered(true); setFocusable(false); - ComponentAccessor.setParent(this,parent); + AWTAccessor.getComponentAccessor().setParent(this,parent); setBackground(peer.getPeerBackground()); setForeground(peer.getPeerForeground()); setFont(peer.getPeerFont()); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java index 1103ee6cdb9..8676c6affb9 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java @@ -109,11 +109,6 @@ public final class XToolkit extends UNIXToolkit implements Runnable { static int awt_multiclick_time; static boolean securityWarningEnabled; - // WeakSet should be used here, but there is no such class - // in JDK (at least in JDK6 and earlier versions) - private WeakHashMap overrideRedirectWindows = - new WeakHashMap(); - private static int screenWidth = -1, screenHeight = -1; // Dimensions of default screen static long awt_defaultFg; // Pixel private static XMouseInfoPeer xPeer; @@ -538,6 +533,16 @@ public final class XToolkit extends UNIXToolkit implements Runnable { processGlobalMotionEvent(ev); } + if( ev.get_type() == XConstants.MappingNotify ) { + // The 'window' field in this event is unused. + // This application itself does nothing to initiate such an event + // (no calls of XChangeKeyboardMapping etc.). + // SunRay server sends this event to the application once on every + // keyboard (not just layout) change which means, quite seldom. + XlibWrapper.XRefreshKeyboardMapping(ev.pData); + resetKeyboardSniffer(); + setupModifierMap(); + } XBaseWindow.dispatchToWindow(ev); Collection dispatchers = null; @@ -631,7 +636,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { Component owner = XKeyboardFocusManagerPeer.getCurrentNativeFocusOwner(); if (owner != null) { - XWindow ownerWindow = (XWindow) ComponentAccessor.getPeer(owner); + XWindow ownerWindow = (XWindow) AWTAccessor.getComponentAccessor().getPeer(owner); if (ownerWindow != null) { w = ownerWindow.getContentWindow(); } @@ -1316,19 +1321,6 @@ public final class XToolkit extends UNIXToolkit implements Runnable { } } - @Override - public void setOverrideRedirect(Window target) { - synchronized (overrideRedirectWindows) { - overrideRedirectWindows.put(target, true); - } - } - - public boolean isOverrideRedirect(Window target) { - synchronized (overrideRedirectWindows) { - return overrideRedirectWindows.containsKey(target); - } - } - static void dumpPeers() { if (log.isLoggable(PlatformLogger.FINE)) { log.fine("Mapped windows:"); @@ -1457,7 +1449,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { * (which is assigned to the virtual pointer) reports the maximum * capabilities of the mouse pointer (i.e. 32 physical buttons). */ - private native synchronized int getNumberOfButtonsImpl(); + private native int getNumberOfButtonsImpl(); @Override public int getNumberOfButtons(){ @@ -2130,6 +2122,11 @@ public final class XToolkit extends UNIXToolkit implements Runnable { static final int XSUN_KP_BEHAVIOR = 1; static final int XORG_KP_BEHAVIOR = 2; + static final int IS_SUN_KEYBOARD = 1; + static final int IS_NONSUN_KEYBOARD = 2; + static final int IS_KANA_KEYBOARD = 1; + static final int IS_NONKANA_KEYBOARD = 2; + static int awt_IsXsunKPBehavior = 0; static boolean awt_UseXKB = false; @@ -2159,6 +2156,33 @@ public final class XToolkit extends UNIXToolkit implements Runnable { awtUnlock(); } } + + static int sunOrNotKeyboard = 0; + static int kanaOrNotKeyboard = 0; + static void resetKeyboardSniffer() { + sunOrNotKeyboard = 0; + kanaOrNotKeyboard = 0; + } + static boolean isSunKeyboard() { + if( sunOrNotKeyboard == 0 ) { + if( XlibWrapper.IsSunKeyboard( getDisplay() )) { + sunOrNotKeyboard = IS_SUN_KEYBOARD; + }else{ + sunOrNotKeyboard = IS_NONSUN_KEYBOARD; + } + } + return (sunOrNotKeyboard == IS_SUN_KEYBOARD); + } + static boolean isKanaKeyboard() { + if( kanaOrNotKeyboard == 0 ) { + if( XlibWrapper.IsKanaKeyboard( getDisplay() )) { + kanaOrNotKeyboard = IS_KANA_KEYBOARD; + }else{ + kanaOrNotKeyboard = IS_NONKANA_KEYBOARD; + } + } + return (kanaOrNotKeyboard == IS_KANA_KEYBOARD); + } static boolean isXKBenabled() { awtLock(); try { diff --git a/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java index da4a6b0d43d..f4b29f7d52a 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java @@ -295,7 +295,7 @@ public class XTrayIconPeer implements TrayIconPeer, } public static void suppressWarningString(Window w) { - WindowAccessor.setTrayIconWindow(w, true); + AWTAccessor.getWindowAccessor().setTrayIconWindow(w, true); } public void setToolTip(String tooltip) { @@ -483,12 +483,6 @@ public class XTrayIconPeer implements TrayIconPeer, } } - static boolean isTrayIconStuffWindow(Window w) { - return (w instanceof InfoWindow.Tooltip) || - (w instanceof InfoWindow.Balloon) || - (w instanceof XTrayIconEmbeddedFrame); - } - // *************************************** // Special embedded frame for tray icon // *************************************** diff --git a/jdk/src/solaris/classes/sun/awt/X11/XWindow.java b/jdk/src/solaris/classes/sun/awt/X11/XWindow.java index 58d1fe8bd7c..e482d69aad8 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XWindow.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XWindow.java @@ -325,9 +325,9 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { if (!(target instanceof Container) || win == null || win.getTarget() == null) { return false; } - Container parent = ComponentAccessor.getParent_NoClientCode(win.target); + Container parent = AWTAccessor.getComponentAccessor().getParent(win.target); while (parent != null && parent != target) { - parent = ComponentAccessor.getParent_NoClientCode(parent); + parent = AWTAccessor.getComponentAccessor().getParent(parent); } return (parent == target); } @@ -560,10 +560,11 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { int h = xe.get_height(); Component target = (Component)getEventSource(); + AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor(); - if (!ComponentAccessor.getIgnoreRepaint(target) - && ComponentAccessor.getWidth(target) != 0 - && ComponentAccessor.getHeight(target) != 0) + if (!compAccessor.getIgnoreRepaint(target) + && compAccessor.getWidth(target) != 0 + && compAccessor.getHeight(target) != 0) { handleExposeEvent(target, x, y, w, h); } @@ -950,7 +951,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { XAwtState.setComponentMouseEntered(null); } } else { - ((XComponentPeer) ComponentAccessor.getPeer(target)) + ((XComponentPeer) AWTAccessor.getComponentAccessor().getPeer(target)) .pSetCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } } @@ -1387,7 +1388,7 @@ public class XWindow extends XBaseWindow implements X11ComponentPeer { Component comp = target; while (comp != null && !(comp instanceof Window)) { - comp = ComponentAccessor.getParent_NoClientCode(comp); + comp = AWTAccessor.getComponentAccessor().getParent(comp); } // applets, embedded, etc - translate directly diff --git a/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java index 52e7a531188..0b917c56b1f 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XWindowPeer.java @@ -35,17 +35,21 @@ import java.awt.image.BufferedImage; import java.awt.peer.ComponentPeer; import java.awt.peer.WindowPeer; +import java.io.UnsupportedEncodingException; + +import java.security.AccessController; +import java.security.PrivilegedAction; + import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.Set; import java.util.Vector; +import java.util.concurrent.atomic.AtomicBoolean; + import sun.util.logging.PlatformLogger; -import sun.awt.AWTAccessor; -import sun.awt.ComponentAccessor; -import sun.awt.WindowAccessor; import sun.awt.AWTAccessor; import sun.awt.DisplayChangedListener; import sun.awt.SunToolkit; @@ -90,6 +94,8 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, private boolean mustControlStackPosition = false; // Am override-redirect not on top private XEventDispatcher rootPropertyEventDispatcher = null; + private static final AtomicBoolean isStartupNotificationRemoved = new AtomicBoolean(); + /* * Focus related flags */ @@ -97,6 +103,18 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, private boolean isBeforeFirstMapNotify = false; // Is the window (being shown) between // setVisible(true) & handleMapNotify(). + /** + * The type of the window. + * + * The type is supposed to be immutable while the peer object exists. + * The value gets initialized in the preInit() method. + */ + private Window.Type windowType = Window.Type.NORMAL; + + public final Window.Type getWindowType() { + return windowType; + } + // It need to be accessed from XFramePeer. protected Vector toplevelStateListeners = new Vector(); XWindowPeer(XCreateWindowParams params) { @@ -128,6 +146,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, void preInit(XCreateWindowParams params) { target = (Component)params.get(TARGET); + windowType = ((Window)target).getType(); params.put(REPARENTED, Boolean.valueOf(isOverrideRedirect() || isSimpleWindow())); super.preInit(params); @@ -233,7 +252,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, if (((Window)target).getWarningString() != null) { // accessSystemTray permission allows to display TrayIcon, TrayIcon tooltip // and TrayIcon balloon windows without a warning window. - if (!WindowAccessor.isTrayIconWindow((Window)target)) { + if (!AWTAccessor.getWindowAccessor().isTrayIconWindow((Window)target)) { warningWindow = new XWarningWindow((Window)target, getWindow(), this); } } @@ -525,7 +544,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, boolean isAutoRequestFocus() { if (XToolkit.isToolkitThread()) { - return WindowAccessor.isAutoRequestFocus((Window)target); + return AWTAccessor.getWindowAccessor().isAutoRequestFocus((Window)target); } else { return ((Window)target).isAutoRequestFocus(); } @@ -1065,10 +1084,11 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, if (warningWindow != null) { // We can't use the coordinates stored in the XBaseWindow since // they are zeros for decorated frames. - int x = ComponentAccessor.getX(target); - int y = ComponentAccessor.getY(target); - int width = ComponentAccessor.getWidth(target); - int height = ComponentAccessor.getHeight(target); + AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor(); + int x = compAccessor.getX(target); + int y = compAccessor.getY(target); + int width = compAccessor.getWidth(target); + int height = compAccessor.getHeight(target); warningWindow.reposition(x, y, width, height); } } @@ -1119,9 +1139,8 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, } boolean isOverrideRedirect() { - return (XWM.getWMID() == XWM.OPENLOOK_WM ? true : false) || - ((XToolkit)Toolkit.getDefaultToolkit()).isOverrideRedirect((Window)target) || - XTrayIconPeer.isTrayIconStuffWindow((Window)target); + return XWM.getWMID() == XWM.OPENLOOK_WM || + Window.Type.POPUP.equals(getWindowType()); } final boolean isOLWMDecorBug() { @@ -1152,7 +1171,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, if (isSimpleWindow()) { if (target == XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow()) { Window owner = getDecoratedOwner((Window)target); - ((XWindowPeer)ComponentAccessor.getPeer(owner)).requestWindowFocus(); + ((XWindowPeer)AWTAccessor.getComponentAccessor().getPeer(owner)).requestWindowFocus(); } } } @@ -1183,7 +1202,77 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, } } + private void removeStartupNotification() { + if (isStartupNotificationRemoved.getAndSet(true)) { + return; + } + + final String desktopStartupId = AccessController.doPrivileged(new PrivilegedAction() { + public String run() { + return XToolkit.getEnv("DESKTOP_STARTUP_ID"); + } + }); + if (desktopStartupId == null) { + return; + } + + final StringBuilder messageBuilder = new StringBuilder("remove: ID="); + messageBuilder.append('"'); + for (int i = 0; i < desktopStartupId.length(); i++) { + if (desktopStartupId.charAt(i) == '"' || desktopStartupId.charAt(i) == '\\') { + messageBuilder.append('\\'); + } + messageBuilder.append(desktopStartupId.charAt(i)); + } + messageBuilder.append('"'); + messageBuilder.append('\0'); + final byte[] message; + try { + message = messageBuilder.toString().getBytes("UTF-8"); + } catch (UnsupportedEncodingException cannotHappen) { + return; + } + + XClientMessageEvent req = null; + + XToolkit.awtLock(); + try { + final XAtom netStartupInfoBeginAtom = XAtom.get("_NET_STARTUP_INFO_BEGIN"); + final XAtom netStartupInfoAtom = XAtom.get("_NET_STARTUP_INFO"); + + req = new XClientMessageEvent(); + req.set_type(XConstants.ClientMessage); + req.set_window(getWindow()); + req.set_message_type(netStartupInfoBeginAtom.getAtom()); + req.set_format(8); + + for (int pos = 0; pos < message.length; pos += 20) { + final int msglen = Math.min(message.length - pos, 20); + int i = 0; + for (; i < msglen; i++) { + XlibWrapper.unsafe.putByte(req.get_data() + i, message[pos + i]); + } + for (; i < 20; i++) { + XlibWrapper.unsafe.putByte(req.get_data() + i, (byte)0); + } + XlibWrapper.XSendEvent(XToolkit.getDisplay(), + XlibWrapper.RootWindow(XToolkit.getDisplay(), getScreenNumber()), + false, + XConstants.PropertyChangeMask, + req.pData); + req.set_message_type(netStartupInfoAtom.getAtom()); + } + } finally { + XToolkit.awtUnlock(); + if (req != null) { + req.dispose(); + } + } + } + public void handleMapNotifyEvent(XEvent xev) { + removeStartupNotification(); + // See 6480534. isUnhiding |= isWMStateNetHidden(); @@ -1309,7 +1398,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, XToolkit.awtLock(); try { if (isReparented() && delayedModalBlocking) { - addToTransientFors((XDialogPeer) ComponentAccessor.getPeer(modalBlocker)); + addToTransientFors((XDialogPeer) AWTAccessor.getComponentAccessor().getPeer(modalBlocker)); delayedModalBlocking = false; } } finally { @@ -1393,7 +1482,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, try { // State lock should always be after awtLock synchronized(getStateLock()) { - XDialogPeer blockerPeer = (XDialogPeer) ComponentAccessor.getPeer(d); + XDialogPeer blockerPeer = (XDialogPeer) AWTAccessor.getComponentAccessor().getPeer(d); if (blocked) { log.fine("{0} is blocked by {1}", this, blockerPeer); modalBlocker = d; @@ -1673,7 +1762,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, // current chain iterator in the order from next to prev XWindowPeer chainToSplit = prevTransientFor; while (chainToSplit != null) { - XWindowPeer blocker = (XWindowPeer) ComponentAccessor.getPeer(chainToSplit.modalBlocker); + XWindowPeer blocker = (XWindowPeer) AWTAccessor.getComponentAccessor().getPeer(chainToSplit.modalBlocker); if (thisChainBlockers.contains(blocker)) { // add to this dialog's chain setToplevelTransientFor(thisChain, chainToSplit, true, false); @@ -1701,7 +1790,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, static Window getDecoratedOwner(Window window) { while ((null != window) && !(window instanceof Frame || window instanceof Dialog)) { - window = (Window) ComponentAccessor.getParent_NoClientCode(window); + window = (Window) AWTAccessor.getComponentAccessor().getParent(window); } return window; } @@ -1734,7 +1823,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, } focusLog.fine("Parent window is not active"); - XDecoratedPeer wpeer = (XDecoratedPeer)ComponentAccessor.getPeer(ownerWindow); + XDecoratedPeer wpeer = (XDecoratedPeer)AWTAccessor.getComponentAccessor().getPeer(ownerWindow); if (wpeer != null && wpeer.requestWindowFocus(this, time, timeProvided)) { focusLog.fine("Parent window accepted focus request - generating focus for this window"); return true; @@ -1747,12 +1836,49 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, void setActualFocusedWindow(XWindowPeer actualFocusedWindow) { } + /** + * Applies the current window type. + */ + private void applyWindowType() { + XNETProtocol protocol = XWM.getWM().getNETProtocol(); + if (protocol == null) { + return; + } + + XAtom typeAtom = null; + + switch (getWindowType()) + { + case NORMAL: + typeAtom = protocol.XA_NET_WM_WINDOW_TYPE_NORMAL; + break; + case UTILITY: + typeAtom = protocol.XA_NET_WM_WINDOW_TYPE_UTILITY; + break; + case POPUP: + typeAtom = protocol.XA_NET_WM_WINDOW_TYPE_POPUP_MENU; + break; + } + + if (typeAtom != null) { + XAtomList wtype = new XAtomList(); + wtype.add(typeAtom); + protocol.XA_NET_WM_WINDOW_TYPE. + setAtomListProperty(getWindow(), wtype); + } else { + protocol.XA_NET_WM_WINDOW_TYPE. + DeleteProperty(getWindow()); + } + } + + @Override public void xSetVisible(boolean visible) { if (log.isLoggable(PlatformLogger.FINE)) log.fine("Setting visible on " + this + " to " + visible); XToolkit.awtLock(); try { this.visible = visible; if (visible) { + applyWindowType(); XlibWrapper.XMapRaised(XToolkit.getDisplay(), getWindow()); } else { XlibWrapper.XUnmapWindow(XToolkit.getDisplay(), getWindow()); @@ -2018,18 +2144,20 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, // Outside this toplevel hierarchy // According to the specification of UngrabEvent, post it // when press occurs outside of the window and not on its owned windows - grabLog.fine("Generating UngrabEvent on {0} because not inside of shell", this); - postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource())); - return; + if (xbe.get_type() == XConstants.ButtonPress) { + grabLog.fine("Generating UngrabEvent on {0} because not inside of shell", this); + postEventToEventQueue(new sun.awt.UngrabEvent(getEventSource())); + return; + } } // First, get the toplevel XWindowPeer toplevel = target.getToplevelXWindow(); if (toplevel != null) { Window w = (Window)toplevel.target; while (w != null && toplevel != this && !(toplevel instanceof XDialogPeer)) { - w = (Window) ComponentAccessor.getParent_NoClientCode(w); + w = (Window) AWTAccessor.getComponentAccessor().getParent(w); if (w != null) { - toplevel = (XWindowPeer) ComponentAccessor.getPeer(w); + toplevel = (XWindowPeer) AWTAccessor.getComponentAccessor().getPeer(w); } } if (w == null || (w != this.target && w instanceof Dialog)) { diff --git a/jdk/src/solaris/classes/sun/awt/X11/XlibWrapper.java b/jdk/src/solaris/classes/sun/awt/X11/XlibWrapper.java index 3ef2f69ae85..551e256427c 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XlibWrapper.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XlibWrapper.java @@ -353,6 +353,8 @@ static native String XSetLocaleModifiers(String modifier_list); static native String ServerVendor(long display); static native int VendorRelease(long display); static native boolean IsXsunKPBehavior(long display); + static native boolean IsSunKeyboard(long display); + static native boolean IsKanaKeyboard(long display); static native void XBell(long display, int percent); @@ -513,8 +515,9 @@ static native String XSetLocaleModifiers(String modifier_list); long keysym_uppercase); static native long XGetModifierMapping(long display); - static native void XFreeModifiermap(long keymap); + static native void XRefreshKeyboardMapping(long event); + static native void XChangeActivePointerGrab(long display, int mask, long cursor, long time); diff --git a/jdk/src/solaris/classes/sun/awt/X11/keysym2ucs.h b/jdk/src/solaris/classes/sun/awt/X11/keysym2ucs.h index 32ecd66c987..e7c2c40b9a4 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/keysym2ucs.h +++ b/jdk/src/solaris/classes/sun/awt/X11/keysym2ucs.h @@ -107,6 +107,8 @@ tojava // Another use for reverse lookup: query keyboard state, for some key tojava static Hashtable javaKeycode2KeysymHash = new Hashtable(); tojava static long keysym_lowercase = unsafe.allocateMemory(Native.getLongSize()); tojava static long keysym_uppercase = unsafe.allocateMemory(Native.getLongSize()); +tojava static Keysym2JavaKeycode kanaLock = new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_KANA_LOCK, +tojava java.awt.event.KeyEvent.KEY_LOCATION_STANDARD); tojava private static PlatformLogger keyEventLog = PlatformLogger.getLogger("sun.awt.X11.kye.XKeysym"); tojava public static char convertKeysym( long ks, int state ) { tojava @@ -252,12 +254,35 @@ tojava } tojava } tojava return keysym; tojava } +tojava +tojava /** +tojava Return java.awt.KeyEvent constant meaning (Java) keycode, derived from X keysym. +tojava Some keysyms maps to more than one keycode, these would require extra processing. +tojava */ +tojava static Keysym2JavaKeycode getJavaKeycode( long keysym ) { +tojava if(keysym == XKeySymConstants.XK_Mode_switch){ +tojava /* XK_Mode_switch on solaris maps either to VK_ALT_GRAPH (default) or VK_KANA_LOCK */ +tojava if( XToolkit.isKanaKeyboard() ) { +tojava return kanaLock; +tojava } +tojava }else if(keysym == XKeySymConstants.XK_L1){ +tojava /* if it is Sun keyboard, trick hash to return VK_STOP else VK_F11 (default) */ +tojava if( XToolkit.isSunKeyboard() ) { +tojava keysym = XKeySymConstants.SunXK_Stop; +tojava } +tojava }else if(keysym == XKeySymConstants.XK_L2) { +tojava /* if it is Sun keyboard, trick hash to return VK_AGAIN else VK_F12 (default) */ +tojava if( XToolkit.isSunKeyboard() ) { +tojava keysym = XKeySymConstants.SunXK_Again; +tojava } +tojava } +tojava +tojava return keysym2JavaKeycodeHash.get( keysym ); +tojava } tojava /** tojava Return java.awt.KeyEvent constant meaning (Java) keycode, derived from X Window KeyEvent. tojava Algorithm is, extract via XKeycodeToKeysym a proper keysym according to Xlib spec rules and tojava err exceptions, then search a java keycode in a table. -tojava Some keysyms maps to more than one keycode, these would require extra processing. If someone -tojava points me to such a keysym. tojava */ tojava static Keysym2JavaKeycode getJavaKeycode( XKeyEvent ev ) { tojava // get from keysym2JavaKeycodeHash. @@ -272,7 +297,7 @@ tojava ndx = 0; tojava keysym = xkeycode2keysym(ev, ndx); tojava } tojava -tojava Keysym2JavaKeycode jkc = keysym2JavaKeycodeHash.get( keysym ); +tojava Keysym2JavaKeycode jkc = getJavaKeycode( keysym ); tojava return jkc; tojava } tojava static int getJavaKeycodeOnly( XKeyEvent ev ) { @@ -297,7 +322,7 @@ tojava // we only need primary-layer keysym to derive a java keycode tojava ndx = 0; tojava keysym = xkeycode2keysym_noxkb(ev, ndx); tojava } -tojava Keysym2JavaKeycode jkc = keysym2JavaKeycodeHash.get( keysym ); +tojava Keysym2JavaKeycode jkc = getJavaKeycode( keysym ); tojava return jkc == null ? java.awt.event.KeyEvent.VK_UNDEFINED : jkc.getJavaKeycode(); tojava } tojava static long javaKeycode2Keysym( int jkey ) { diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpChannelImpl.java b/jdk/src/solaris/classes/sun/nio/ch/SctpChannelImpl.java index d7842570a2c..2d577c2e1b1 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpChannelImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/SctpChannelImpl.java @@ -38,7 +38,6 @@ import java.nio.channels.SelectionKey; import java.nio.channels.ClosedChannelException; import java.nio.channels.ConnectionPendingException; import java.nio.channels.NoConnectionPendingException; -import java.nio.channels.AlreadyBoundException; import java.nio.channels.AlreadyConnectedException; import java.nio.channels.NotYetBoundException; import java.nio.channels.NotYetConnectedException; @@ -54,7 +53,6 @@ import com.sun.nio.sctp.MessageInfo; import com.sun.nio.sctp.NotificationHandler; import com.sun.nio.sctp.SctpChannel; import com.sun.nio.sctp.SctpSocketOption; -import sun.nio.ch.NativeDispatcher; import sun.nio.ch.PollArrayWrapper; import sun.nio.ch.SelChImpl; import static com.sun.nio.sctp.SctpStandardSocketOption.*; @@ -69,9 +67,6 @@ import static sun.nio.ch.SctpResultContainer.SHUTDOWN; public class SctpChannelImpl extends SctpChannel implements SelChImpl { - /* Used to make native close and preClose calls */ - private static NativeDispatcher nd; - private final FileDescriptor fd; private final int fdVal; @@ -182,7 +177,7 @@ public class SctpChannelImpl extends SctpChannel synchronized (stateLock) { ensureOpenAndUnconnected(); if (isBound()) - throw new AlreadyBoundException(); + SctpNet.throwAlreadyBoundException(); InetSocketAddress isa = (local == null) ? new InetSocketAddress(0) : Net.checkAddress(local); Net.bind(fd, isa.getAddress(), isa.getPort()); @@ -234,7 +229,7 @@ public class SctpChannelImpl extends SctpChannel if (add) { for (InetSocketAddress addr : localAddresses) { if (addr.getAddress().equals(address)) { - throw new AlreadyBoundException(); + SctpNet.throwAlreadyBoundException(); } } } else { /*removing */ @@ -370,7 +365,7 @@ public class SctpChannelImpl extends SctpChannel InetAddress ia = isa.getAddress(); if (ia.isAnyLocalAddress()) ia = InetAddress.getLocalHost(); - n = Net.connect(fd, ia, isa.getPort()); + n = SctpNet.connect(fdVal, ia, isa.getPort()); if ( (n == IOStatus.INTERRUPTED) && isOpen()) continue; @@ -556,7 +551,7 @@ public class SctpChannelImpl extends SctpChannel @Override public void implCloseSelectableChannel() throws IOException { synchronized (stateLock) { - nd.preClose(fd); + SctpNet.preClose(fdVal); if (receiverThread != 0) NativeThread.signal(receiverThread); @@ -662,7 +657,7 @@ public class SctpChannelImpl extends SctpChannel /* Postpone the kill if there is a waiting reader * or writer thread. */ if (receiverThread == 0 && senderThread == 0) { - nd.close(fd); + SctpNet.close(fdVal); state = ChannelState.KILLED; } else { state = ChannelState.KILLPENDING; @@ -874,8 +869,8 @@ public class SctpChannelImpl extends SctpChannel public HandlerResult handleNotification( AssociationChangeNotification not, T unused) { if (not.event().equals( - AssociationChangeNotification.AssocChangeEvent.COMM_UP)) { - assert association == null; + AssociationChangeNotification.AssocChangeEvent.COMM_UP) && + association == null) { SctpAssocChange sac = (SctpAssocChange) not; association = new SctpAssociationImpl (sac.assocId(), sac.maxInStreams(), sac.maxOutStreams()); @@ -987,17 +982,17 @@ public class SctpChannelImpl extends SctpChannel SocketAddress target = messageInfo.address(); boolean unordered = messageInfo.isUnordered(); int ppid = messageInfo.payloadProtocolID(); - int pos = src.position(); - int lim = src.limit(); - - assert (pos <= lim && streamNumber >= 0); - int rem = (pos <= lim ? lim - pos : 0); if (src instanceof DirectBuffer) - return sendFromNativeBuffer(fd, src, rem, pos, target, streamNumber, + return sendFromNativeBuffer(fd, src, target, streamNumber, unordered, ppid); /* Substitute a native buffer */ + int pos = src.position(); + int lim = src.limit(); + assert (pos <= lim && streamNumber >= 0); + + int rem = (pos <= lim ? lim - pos : 0); ByteBuffer bb = Util.getTemporaryDirectBuffer(rem); try { bb.put(src); @@ -1005,7 +1000,7 @@ public class SctpChannelImpl extends SctpChannel /* Do not update src until we see how many bytes were written */ src.position(pos); - int n = sendFromNativeBuffer(fd, bb, rem, pos, target, streamNumber, + int n = sendFromNativeBuffer(fd, bb, target, streamNumber, unordered, ppid); if (n > 0) { /* now update src */ @@ -1019,13 +1014,16 @@ public class SctpChannelImpl extends SctpChannel private int sendFromNativeBuffer(int fd, ByteBuffer bb, - int rem, - int pos, SocketAddress target, int streamNumber, boolean unordered, int ppid) throws IOException { + int pos = bb.position(); + int lim = bb.limit(); + assert (pos <= lim); + int rem = (pos <= lim ? lim - pos : 0); + int written = send0(fd, ((DirectBuffer)bb).address() + pos, rem, target, -1 /*121*/, streamNumber, unordered, ppid); if (written > 0) @@ -1097,6 +1095,5 @@ public class SctpChannelImpl extends SctpChannel java.security.AccessController.doPrivileged( new sun.security.action.LoadLibraryAction("sctp")); initIDs(); - nd = new SctpSocketDispatcher(); } } diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java b/jdk/src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java index b8457fdba27..45a360ddfee 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java @@ -38,7 +38,6 @@ import java.util.HashSet; import java.util.HashMap; import java.nio.ByteBuffer; import java.nio.channels.SelectionKey; -import java.nio.channels.AlreadyBoundException; import java.nio.channels.ClosedChannelException; import java.nio.channels.NotYetBoundException; import java.nio.channels.spi.SelectorProvider; @@ -63,9 +62,6 @@ import static sun.nio.ch.SctpResultContainer.*; public class SctpMultiChannelImpl extends SctpMultiChannel implements SelChImpl { - /* Used to make native close and preClose calls */ - private static NativeDispatcher nd; - private final FileDescriptor fd; private final int fdVal; @@ -140,7 +136,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel synchronized (stateLock) { ensureOpen(); if (isBound()) - throw new AlreadyBoundException(); + SctpNet.throwAlreadyBoundException(); InetSocketAddress isa = (local == null) ? new InetSocketAddress(0) : Net.checkAddress(local); @@ -155,7 +151,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel if (isa.getAddress().isAnyLocalAddress()) wildcard = true; - Net.listen(fd, backlog < 1 ? 50 : backlog); + SctpNet.listen(fdVal, backlog < 1 ? 50 : backlog); } } } @@ -196,7 +192,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel if (add) { for (InetSocketAddress addr : localAddresses) { if (addr.getAddress().equals(address)) { - throw new AlreadyBoundException(); + SctpNet.throwAlreadyBoundException(); } } } else { /*removing */ @@ -284,7 +280,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel @Override public void implCloseSelectableChannel() throws IOException { synchronized (stateLock) { - nd.preClose(fd); + SctpNet.preClose(fdVal); if (receiverThread != 0) NativeThread.signal(receiverThread); @@ -375,7 +371,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel /* Postpone the kill if there is a thread sending or receiving. */ if (receiverThread == 0 && senderThread == 0) { - nd.close(fd); + SctpNet.close(fdVal); state = ChannelState.KILLED; } else { state = ChannelState.KILLPENDING; @@ -846,16 +842,17 @@ public class SctpMultiChannelImpl extends SctpMultiChannel int streamNumber = messageInfo.streamNumber(); boolean unordered = messageInfo.isUnordered(); int ppid = messageInfo.payloadProtocolID(); - int pos = src.position(); - int lim = src.limit(); - assert (pos <= lim && streamNumber >= 0); - int rem = (pos <= lim ? lim - pos : 0); if (src instanceof DirectBuffer) - return sendFromNativeBuffer(fd, src, rem, pos, target, assocId, + return sendFromNativeBuffer(fd, src, target, assocId, streamNumber, unordered, ppid); /* Substitute a native buffer */ + int pos = src.position(); + int lim = src.limit(); + assert (pos <= lim && streamNumber >= 0); + + int rem = (pos <= lim ? lim - pos : 0); ByteBuffer bb = Util.getTemporaryDirectBuffer(rem); try { bb.put(src); @@ -863,7 +860,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel /* Do not update src until we see how many bytes were written */ src.position(pos); - int n = sendFromNativeBuffer(fd, bb, rem, pos, target, assocId, + int n = sendFromNativeBuffer(fd, bb, target, assocId, streamNumber, unordered, ppid); if (n > 0) { /* now update src */ @@ -877,14 +874,17 @@ public class SctpMultiChannelImpl extends SctpMultiChannel private int sendFromNativeBuffer(int fd, ByteBuffer bb, - int rem, - int pos, SocketAddress target, int assocId, int streamNumber, boolean unordered, int ppid) throws IOException { + int pos = bb.position(); + int lim = bb.limit(); + assert (pos <= lim); + int rem = (pos <= lim ? lim - pos : 0); + int written = send0(fd, ((DirectBuffer)bb).address() + pos, rem, target, assocId, streamNumber, unordered, ppid); if (written > 0) @@ -981,6 +981,5 @@ public class SctpMultiChannelImpl extends SctpMultiChannel Util.load(); /* loads nio & net native libraries */ java.security.AccessController.doPrivileged( new sun.security.action.LoadLibraryAction("sctp")); - nd = new SctpSocketDispatcher(); } } diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpNet.java b/jdk/src/solaris/classes/sun/nio/ch/SctpNet.java index f4cd5005f15..39019e7fd0a 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpNet.java +++ b/jdk/src/solaris/classes/sun/nio/ch/SctpNet.java @@ -29,6 +29,7 @@ import java.io.IOException; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.SocketAddress; +import java.nio.channels.AlreadyBoundException; import java.util.Set; import java.util.HashSet; import java.security.AccessController; @@ -52,8 +53,29 @@ public class SctpNet { return false; } + static boolean throwAlreadyBoundException() throws IOException { + throw new AlreadyBoundException(); + } + + static void listen(int fd, int backlog) throws IOException { + listen0(fd, backlog); + } + + static int connect(int fd, InetAddress remote, int remotePort) + throws IOException { + return connect0(fd, remote, remotePort); + } + + static void close(int fd) throws IOException { + close0(fd); + } + + static void preClose(int fd) throws IOException { + preClose0(fd); + } + /** - * @param oneToone + * @param oneToOne * if {@code true} returns a one-to-one sctp socket, otherwise * returns a one-to-many sctp socket */ @@ -240,6 +262,15 @@ public class SctpNet { /* Native Methods */ static native int socket0(boolean oneToOne) throws IOException; + static native void listen0(int fd, int backlog) throws IOException; + + static native int connect0(int fd, InetAddress remote, int remotePort) + throws IOException; + + static native void close0(int fd) throws IOException; + + static native void preClose0(int fd) throws IOException; + static native void bindx(int fd, InetAddress[] addrs, int port, int length, boolean add, boolean preferIPv6) throws IOException; @@ -271,5 +302,11 @@ public class SctpNet { throws IOException; static native void shutdown0(int fd, int assocId); + + static native void init(); + + static { + init(); + } } diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpServerChannelImpl.java b/jdk/src/solaris/classes/sun/nio/ch/SctpServerChannelImpl.java index 5381591b7f0..740905a0941 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpServerChannelImpl.java +++ b/jdk/src/solaris/classes/sun/nio/ch/SctpServerChannelImpl.java @@ -33,7 +33,6 @@ import java.util.Collections; import java.util.Set; import java.util.HashSet; import java.nio.channels.SelectionKey; -import java.nio.channels.AlreadyBoundException; import java.nio.channels.ClosedChannelException; import java.nio.channels.NotYetBoundException; import java.nio.channels.spi.SelectorProvider; @@ -49,9 +48,6 @@ import com.sun.nio.sctp.SctpStandardSocketOption; public class SctpServerChannelImpl extends SctpServerChannel implements SelChImpl { - /* Used to make native close and preClose calls */ - private static NativeDispatcher nd; - private final FileDescriptor fd; private final int fdVal; @@ -103,7 +99,7 @@ public class SctpServerChannelImpl extends SctpServerChannel if (!isOpen()) throw new ClosedChannelException(); if (isBound()) - throw new AlreadyBoundException(); + SctpNet.throwAlreadyBoundException(); InetSocketAddress isa = (local == null) ? new InetSocketAddress(0) : Net.checkAddress(local); @@ -118,7 +114,7 @@ public class SctpServerChannelImpl extends SctpServerChannel if (isa.getAddress().isAnyLocalAddress()) wildcard = true; - Net.listen(fd, backlog < 1 ? 50 : backlog); + SctpNet.listen(fdVal, backlog < 1 ? 50 : backlog); } } return this; @@ -156,7 +152,7 @@ public class SctpServerChannelImpl extends SctpServerChannel if (add) { for (InetSocketAddress addr : localAddresses) { if (addr.getAddress().equals(address)) { - throw new AlreadyBoundException(); + SctpNet.throwAlreadyBoundException(); } } } else { /*removing */ @@ -261,7 +257,7 @@ public class SctpServerChannelImpl extends SctpServerChannel @Override public void implCloseSelectableChannel() throws IOException { synchronized (stateLock) { - nd.preClose(fd); + SctpNet.preClose(fdVal); if (thread != 0) NativeThread.signal(thread); if (!isRegistered()) @@ -282,7 +278,7 @@ public class SctpServerChannelImpl extends SctpServerChannel // Postpone the kill if there is a thread in accept if (thread == 0) { - nd.close(fd); + SctpNet.close(fdVal); state = ChannelState.KILLED; } else { state = ChannelState.KILLPENDING; @@ -423,7 +419,6 @@ public class SctpServerChannelImpl extends SctpServerChannel Util.load(); // loads nio & net native libraries java.security.AccessController.doPrivileged( new sun.security.action.LoadLibraryAction("sctp")); - nd = new SctpSocketDispatcher(); initIDs(); } } diff --git a/jdk/src/solaris/classes/sun/nio/fs/UnixPath.java b/jdk/src/solaris/classes/sun/nio/fs/UnixPath.java index 2741915e55d..389034da197 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/UnixPath.java +++ b/jdk/src/solaris/classes/sun/nio/fs/UnixPath.java @@ -624,8 +624,11 @@ class UnixPath public boolean endsWith(Path other) { UnixPath that = checkPath(other); + int thisLen = path.length; + int thatLen = that.path.length; + // other path is longer - if (that.path.length > path.length) + if (thatLen > thisLen) return false; // other path is absolute so this path must be absolute @@ -643,10 +646,10 @@ class UnixPath if (thatOffsetCount == thisOffsetCount) { if (thisOffsetCount == 0) return true; - int expectedLen = path.length; + int expectedLen = thisLen; if (this.isAbsolute() && !that.isAbsolute()) expectedLen--; - if (that.path.length != expectedLen) + if (thatLen != expectedLen) return false; } else { // this path has more elements so given path must be relative @@ -658,7 +661,9 @@ class UnixPath // compare bytes int thisPos = offsets[thisOffsetCount - thatOffsetCount]; int thatPos = that.offsets[0]; - while (thatPos < that.path.length) { + if ((thatLen - thatPos) != (thisLen - thisPos)) + return false; + while (thatPos < thatLen) { if (this.path[thisPos++] != that.path[thatPos++]) return false; } diff --git a/jdk/src/solaris/lib/flavormap.properties b/jdk/src/solaris/lib/flavormap.properties index e96da314c93..223002a69aa 100644 --- a/jdk/src/solaris/lib/flavormap.properties +++ b/jdk/src/solaris/lib/flavormap.properties @@ -73,5 +73,6 @@ UTF8_STRING=text/plain;charset=UTF-8;eoln="\n";terminators=0 TEXT=text/plain;eoln="\n";terminators=0 STRING=text/plain;charset=iso8859-1;eoln="\n";terminators=0 FILE_NAME=application/x-java-file-list;class=java.util.List +text/uri-list=application/x-java-file-list;class=java.util.List PNG=image/x-java-image;class=java.awt.Image JFIF=image/x-java-image;class=java.awt.Image diff --git a/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_PCM.c b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_PCM.c index e179ab025cb..fd1102dd421 100644 --- a/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_PCM.c +++ b/jdk/src/solaris/native/com/sun/media/sound/PLATFORM_API_LinuxOS_ALSA_PCM.c @@ -143,8 +143,12 @@ void DAUDIO_GetFormats(INT32 mixerIndex, INT32 deviceID, int isSource, void* cre ERROR1("snd_pcm_hw_params_malloc returned error %d\n", ret); } else { ret = snd_pcm_hw_params_any(handle, hwParams); - if (ret != 0) { - ERROR1("snd_pcm_hw_params_any returned error %d\n", ret); + /* snd_pcm_hw_params_any can return a positive value on success too */ + if (ret < 0) { + ERROR1("snd_pcm_hw_params_any returned error %d\n", ret); + } else { + /* for the logic following this code, set ret to 0 to indicate success */ + ret = 0; } } snd_pcm_hw_params_get_format_mask(hwParams, formatMask); diff --git a/jdk/src/solaris/native/java/io/UnixFileSystem_md.c b/jdk/src/solaris/native/java/io/UnixFileSystem_md.c index 175c5f35bf2..df8240fbfbc 100644 --- a/jdk/src/solaris/native/java/io/UnixFileSystem_md.c +++ b/jdk/src/solaris/native/java/io/UnixFileSystem_md.c @@ -414,9 +414,9 @@ Java_java_io_UnixFileSystem_getSpace(JNIEnv *env, jobject this, jlong rv = 0L; WITH_FIELD_PLATFORM_STRING(env, file, ids.path, path) { - struct statvfs fsstat; - memset(&fsstat, 0, sizeof(struct statvfs)); - if (statvfs(path, &fsstat) == 0) { + struct statvfs64 fsstat; + memset(&fsstat, 0, sizeof(fsstat)); + if (statvfs64(path, &fsstat) == 0) { switch(t) { case java_io_FileSystem_SPACE_TOTAL: rv = jlong_mul(long_to_jlong(fsstat.f_frsize), diff --git a/jdk/src/solaris/native/java/net/Inet4AddressImpl.c b/jdk/src/solaris/native/java/net/Inet4AddressImpl.c index 5621961f376..ab6c7ae2d30 100644 --- a/jdk/src/solaris/native/java/net/Inet4AddressImpl.c +++ b/jdk/src/solaris/native/java/net/Inet4AddressImpl.c @@ -46,11 +46,6 @@ #define HENT_BUF_SIZE 1024 #define BIG_HENT_BUF_SIZE 10240 /* a jumbo-sized one */ -#ifndef __GLIBC__ -/* gethostname() is in libc.so but I can't find a header file for it */ -extern int gethostname(char *buf, int buf_len); -#endif - /************************************************************************ * Inet4AddressImpl */ diff --git a/jdk/src/solaris/native/java/net/Inet6AddressImpl.c b/jdk/src/solaris/native/java/net/Inet6AddressImpl.c index f9dcfef4fbe..2d5fff2918d 100644 --- a/jdk/src/solaris/native/java/net/Inet6AddressImpl.c +++ b/jdk/src/solaris/native/java/net/Inet6AddressImpl.c @@ -49,10 +49,6 @@ #define NI_MAXHOST 1025 #endif -#ifndef __GLIBC__ -/* gethostname() is in libc.so but I can't find a header file for it */ -extern int gethostname(char *buf, int buf_len); -#endif /************************************************************************ * Inet6AddressImpl @@ -360,8 +356,6 @@ Java_java_net_Inet6AddressImpl_lookupAllHostAddr(JNIEnv *env, jobject this, } } -#endif /* AF_INET6 */ - cleanupAndReturn: { struct addrinfo *iterator, *tmp; @@ -374,7 +368,6 @@ cleanupAndReturn: JNU_ReleaseStringPlatformChars(env, host, hostname); } -#ifdef AF_INET6 if (NET_addrtransAvailable()) (*freeaddrinfo_ptr)(res); #endif /* AF_INET6 */ diff --git a/jdk/src/solaris/native/java/net/NetworkInterface.c b/jdk/src/solaris/native/java/net/NetworkInterface.c index 9580c816455..dc2bccc7fdf 100644 --- a/jdk/src/solaris/native/java/net/NetworkInterface.c +++ b/jdk/src/solaris/native/java/net/NetworkInterface.c @@ -253,8 +253,12 @@ JNIEXPORT jobject JNICALL Java_java_net_NetworkInterface_getByInetAddress0 (JNIEnv *env, jclass cls, jobject iaObj) { netif *ifs, *curr; +#ifdef AF_INET6 int family = (*env)->GetIntField(env, iaObj, ni_iafamilyID) == IPv4? AF_INET : AF_INET6; +#else + int family = AF_INET; +#endif jobject obj = NULL; jboolean match = JNI_FALSE; @@ -1528,6 +1532,7 @@ JNIEXPORT jint JNICALL Java_java_net_NetworkInterface_getMTU0(JNIEnv *env, jclas strcpy((caddr_t)&(lifr.lifr_name), name_utf); if (ioctl(sock, SIOCGLIFMTU, (caddr_t)&lifr) >= 0) { ret = lifr.lifr_mtu; +#ifdef AF_INET6 } else { /* Try wIth an IPv6 socket in case the interface has only IPv6 addresses assigned to it */ close(sock); @@ -1547,6 +1552,12 @@ JNIEXPORT jint JNICALL Java_java_net_NetworkInterface_getMTU0(JNIEnv *env, jclas "IOCTL failed"); } } +#else + } else { + NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", + "IOCTL failed"); + } +#endif #endif close(sock); } diff --git a/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c b/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c index dc804be4575..0fb06a9f78b 100644 --- a/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c +++ b/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c @@ -605,8 +605,12 @@ Java_java_net_PlainDatagramSocketImpl_peek(JNIEnv *env, jobject this, } iaObj = NET_SockaddrToInetAddress(env, (struct sockaddr *)&remote_addr, &port); +#ifdef AF_INET6 family = (*env)->GetIntField(env, iaObj, ia_familyID) == IPv4? AF_INET : AF_INET6; +#else + family = AF_INET; +#endif if (family == AF_INET) { /* this api can't handle IPV6 addresses */ int address = (*env)->GetIntField(env, iaObj, ia_addressID); (*env)->SetIntField(env, addressObj, ia_addressID, address); @@ -812,9 +816,9 @@ Java_java_net_PlainDatagramSocketImpl_receive0(JNIEnv *env, jobject this, jboolean retry; #ifdef __linux__ jboolean connected = JNI_FALSE; - jobject connectedAddress; - jint connectedPort; - jlong prevTime; + jobject connectedAddress = NULL; + jint connectedPort = 0; + jlong prevTime = 0; #endif if (IS_NULL(fdObj)) { @@ -1186,6 +1190,7 @@ static void mcast_set_if_by_if_v4(JNIEnv *env, jobject this, int fd, jobject val * Set outgoing multicast interface designated by a NetworkInterface. * Throw exception if failed. */ +#ifdef AF_INET6 static void mcast_set_if_by_if_v6(JNIEnv *env, jobject this, int fd, jobject value) { static jfieldID ni_indexID; int index; @@ -1222,6 +1227,7 @@ static void mcast_set_if_by_if_v6(JNIEnv *env, jobject this, int fd, jobject val } #endif } +#endif /* AF_INET6 */ /* * Set outgoing multicast interface designated by an InetAddress. @@ -1251,6 +1257,7 @@ static void mcast_set_if_by_addr_v4(JNIEnv *env, jobject this, int fd, jobject v * Set outgoing multicast interface designated by an InetAddress. * Throw exception if failed. */ +#ifdef AF_INET6 static void mcast_set_if_by_addr_v6(JNIEnv *env, jobject this, int fd, jobject value) { static jclass ni_class; if (ni_class == NULL) { @@ -1272,6 +1279,7 @@ static void mcast_set_if_by_addr_v6(JNIEnv *env, jobject this, int fd, jobject v mcast_set_if_by_if_v6(env, this, fd, value); } +#endif /* * Sets the multicast interface. @@ -1307,6 +1315,7 @@ static void setMulticastInterface(JNIEnv *env, jobject this, int fd, /* * value is an InetAddress. */ +#ifdef AF_INET6 #ifdef __solaris__ if (ipv6_available()) { mcast_set_if_by_addr_v6(env, this, fd, value); @@ -1320,12 +1329,16 @@ static void setMulticastInterface(JNIEnv *env, jobject this, int fd, mcast_set_if_by_addr_v6(env, this, fd, value); } #endif +#else + mcast_set_if_by_addr_v4(env, this, fd, value); +#endif /* AF_INET6 */ } if (opt == java_net_SocketOptions_IP_MULTICAST_IF2) { /* * value is a NetworkInterface. */ +#ifdef AF_INET6 #ifdef __solaris__ if (ipv6_available()) { mcast_set_if_by_if_v6(env, this, fd, value); @@ -1339,6 +1352,9 @@ static void setMulticastInterface(JNIEnv *env, jobject this, int fd, mcast_set_if_by_if_v6(env, this, fd, value); } #endif +#else + mcast_set_if_by_if_v4(env, this, fd, value); +#endif /* AF_INET6 */ } } @@ -1368,6 +1384,7 @@ static void mcast_set_loop_v4(JNIEnv *env, jobject this, int fd, jobject value) /* * Enable/disable local loopback of multicast datagrams. */ +#ifdef AF_INET6 static void mcast_set_loop_v6(JNIEnv *env, jobject this, int fd, jobject value) { jclass cls; jfieldID fid; @@ -1397,12 +1414,14 @@ static void mcast_set_loop_v6(JNIEnv *env, jobject this, int fd, jobject value) } #endif } +#endif /* AF_INET6 */ /* * Sets the multicast loopback mode. */ static void setMulticastLoopbackMode(JNIEnv *env, jobject this, int fd, jint opt, jobject value) { +#ifdef AF_INET6 #ifdef __solaris__ if (ipv6_available()) { mcast_set_loop_v6(env, this, fd, value); @@ -1416,6 +1435,9 @@ static void setMulticastLoopbackMode(JNIEnv *env, jobject this, int fd, mcast_set_loop_v6(env, this, fd, value); } #endif +#else + mcast_set_loop_v4(env, this, fd, value); +#endif /* AF_INET6 */ } /* @@ -1838,7 +1860,7 @@ Java_java_net_PlainDatagramSocketImpl_socketGetOption(JNIEnv *env, jobject this, if (opt == java_net_SocketOptions_SO_BINDADDR) { /* find out local IP address */ SOCKADDR him; - int len = 0; + socklen_t len = 0; int port; jobject iaObj; @@ -1941,6 +1963,7 @@ static void setTTL(JNIEnv *env, int fd, jint ttl) { /* * Set hops limit for a socket. Throw exception if failed. */ +#ifdef AF_INET6 static void setHopLimit(JNIEnv *env, int fd, jint ttl) { int ittl = (int)ttl; if (JVM_SetSockOpt(fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, @@ -1949,6 +1972,7 @@ static void setHopLimit(JNIEnv *env, int fd, jint ttl) { "Error setting socket option"); } } +#endif /* * Class: java_net_PlainDatagramSocketImpl @@ -1971,6 +1995,7 @@ Java_java_net_PlainDatagramSocketImpl_setTimeToLive(JNIEnv *env, jobject this, fd = (*env)->GetIntField(env, fdObj, IO_fd_fdID); } /* setsockopt to be correct ttl */ +#ifdef AF_INET6 #ifdef __solaris__ if (ipv6_available()) { setHopLimit(env, fd, ttl); @@ -1986,7 +2011,10 @@ Java_java_net_PlainDatagramSocketImpl_setTimeToLive(JNIEnv *env, jobject this, (*env)->SetIntField(env, this, pdsi_ttlID, ttl); } } -#endif +#endif // __linux__ +#else + setTTL(env, fd, ttl); +#endif /* AF_INET6 */ } /* diff --git a/jdk/src/solaris/native/java/net/net_util_md.c b/jdk/src/solaris/native/java/net/net_util_md.c index cfc86a8842f..620a70d6393 100644 --- a/jdk/src/solaris/native/java/net/net_util_md.c +++ b/jdk/src/solaris/native/java/net/net_util_md.c @@ -319,8 +319,6 @@ jint IPv6_supported() #endif /* __solaris */ -#endif /* AF_INET6 */ - /* * OK we may have the stack available in the kernel, * we should also check if the APIs are available. @@ -354,6 +352,7 @@ jint IPv6_supported() close(fd); return JNI_TRUE; +#endif /* AF_INET6 */ } void diff --git a/jdk/src/solaris/native/java/net/net_util_md.h b/jdk/src/solaris/native/java/net/net_util_md.h index 3e581781a5b..1614c7ae30d 100644 --- a/jdk/src/solaris/native/java/net/net_util_md.h +++ b/jdk/src/solaris/native/java/net/net_util_md.h @@ -133,7 +133,7 @@ extern jint NET_Wait(JNIEnv *env, jint fd, jint flags, jint timeout); #else -#define SOCKADDR union { struct sockaddr_in him4 } +#define SOCKADDR union { struct sockaddr_in him4; } #define SOCKADDR_LEN sizeof(SOCKADDR) #endif diff --git a/jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c b/jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c index eefc522e918..4610b4b2b8c 100644 --- a/jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c +++ b/jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c @@ -44,6 +44,7 @@ * The GConf-2 settings used are: * - /system/http_proxy/use_http_proxy boolean * - /system/http_proxy/use_authentcation boolean + * - /system/http_proxy/use_same_proxy boolean * - /system/http_proxy/host string * - /system/http_proxy/authentication_user string * - /system/http_proxy/authentication_password string @@ -158,6 +159,7 @@ Java_sun_net_spi_DefaultProxySelector_getSystemProxy(JNIEnv *env, char *mode = NULL; int pport = 0; int use_proxy; + int use_same_proxy = 0; const char* urlhost; jobject isa = NULL; jobject proxy = NULL; @@ -179,6 +181,15 @@ Java_sun_net_spi_DefaultProxySelector_getSystemProxy(JNIEnv *env, * entries. */ + use_same_proxy = (*my_get_bool_func)(gconf_client, "/system/http_proxy/use_same_proxy", NULL); + if (use_same_proxy) { + use_proxy = (*my_get_bool_func)(gconf_client, "/system/http_proxy/use_http_proxy", NULL); + if (use_proxy) { + phost = (*my_get_string_func)(gconf_client, "/system/http_proxy/host", NULL); + pport = (*my_get_int_func)(gconf_client, "/system/http_proxy/port", NULL); + } + } + /** * HTTP: * /system/http_proxy/use_http_proxy (boolean) @@ -188,8 +199,10 @@ Java_sun_net_spi_DefaultProxySelector_getSystemProxy(JNIEnv *env, if (strcasecmp(cproto, "http") == 0) { use_proxy = (*my_get_bool_func)(gconf_client, "/system/http_proxy/use_http_proxy", NULL); if (use_proxy) { - phost = (*my_get_string_func)(gconf_client, "/system/http_proxy/host", NULL); - pport = (*my_get_int_func)(gconf_client, "/system/http_proxy/port", NULL); + if (!use_same_proxy) { + phost = (*my_get_string_func)(gconf_client, "/system/http_proxy/host", NULL); + pport = (*my_get_int_func)(gconf_client, "/system/http_proxy/port", NULL); + } CHECK_NULL(type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID)); } } @@ -203,8 +216,10 @@ Java_sun_net_spi_DefaultProxySelector_getSystemProxy(JNIEnv *env, if (strcasecmp(cproto, "https") == 0) { mode = (*my_get_string_func)(gconf_client, "/system/proxy/mode", NULL); if (mode != NULL && (strcasecmp(mode,"manual") == 0)) { - phost = (*my_get_string_func)(gconf_client, "/system/proxy/secure_host", NULL); - pport = (*my_get_int_func)(gconf_client, "/system/proxy/secure_port", NULL); + if (!use_same_proxy) { + phost = (*my_get_string_func)(gconf_client, "/system/proxy/secure_host", NULL); + pport = (*my_get_int_func)(gconf_client, "/system/proxy/secure_port", NULL); + } use_proxy = (phost != NULL); if (use_proxy) type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID); @@ -220,8 +235,10 @@ Java_sun_net_spi_DefaultProxySelector_getSystemProxy(JNIEnv *env, if (strcasecmp(cproto, "ftp") == 0) { mode = (*my_get_string_func)(gconf_client, "/system/proxy/mode", NULL); if (mode != NULL && (strcasecmp(mode,"manual") == 0)) { - phost = (*my_get_string_func)(gconf_client, "/system/proxy/ftp_host", NULL); - pport = (*my_get_int_func)(gconf_client, "/system/proxy/ftp_port", NULL); + if (!use_same_proxy) { + phost = (*my_get_string_func)(gconf_client, "/system/proxy/ftp_host", NULL); + pport = (*my_get_int_func)(gconf_client, "/system/proxy/ftp_port", NULL); + } use_proxy = (phost != NULL); if (use_proxy) type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID); @@ -237,8 +254,10 @@ Java_sun_net_spi_DefaultProxySelector_getSystemProxy(JNIEnv *env, if (strcasecmp(cproto, "gopher") == 0) { mode = (*my_get_string_func)(gconf_client, "/system/proxy/mode", NULL); if (mode != NULL && (strcasecmp(mode,"manual") == 0)) { - phost = (*my_get_string_func)(gconf_client, "/system/proxy/gopher_host", NULL); - pport = (*my_get_int_func)(gconf_client, "/system/proxy/gopher_port", NULL); + if (!use_same_proxy) { + phost = (*my_get_string_func)(gconf_client, "/system/proxy/gopher_host", NULL); + pport = (*my_get_int_func)(gconf_client, "/system/proxy/gopher_port", NULL); + } use_proxy = (phost != NULL); if (use_proxy) type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_httpID); @@ -254,8 +273,10 @@ Java_sun_net_spi_DefaultProxySelector_getSystemProxy(JNIEnv *env, if (strcasecmp(cproto, "socks") == 0) { mode = (*my_get_string_func)(gconf_client, "/system/proxy/mode", NULL); if (mode != NULL && (strcasecmp(mode,"manual") == 0)) { - phost = (*my_get_string_func)(gconf_client, "/system/proxy/socks_host", NULL); - pport = (*my_get_int_func)(gconf_client, "/system/proxy/socks_port", NULL); + if (!use_same_proxy) { + phost = (*my_get_string_func)(gconf_client, "/system/proxy/socks_host", NULL); + pport = (*my_get_int_func)(gconf_client, "/system/proxy/socks_port", NULL); + } use_proxy = (phost != NULL); if (use_proxy) type_proxy = (*env)->GetStaticObjectField(env, ptype_class, ptype_socksID); diff --git a/jdk/src/solaris/native/sun/net/spi/SdpProvider.c b/jdk/src/solaris/native/sun/net/spi/SdpProvider.c index 00d7f4ba6dc..26b5f16f2de 100644 --- a/jdk/src/solaris/native/sun/net/spi/SdpProvider.c +++ b/jdk/src/solaris/native/sun/net/spi/SdpProvider.c @@ -44,7 +44,11 @@ JNIEXPORT void JNICALL Java_sun_net_spi_SdpProvider_convert(JNIEnv *env, jclass cls, jint fd) { #ifdef PROTO_SDP +#ifdef AF_INET6 int domain = ipv6_available() ? AF_INET6 : AF_INET; +#else + int domain = AF_INET; +#endif int s = socket(domain, SOCK_STREAM, PROTO_SDP); if (s < 0) { JNU_ThrowIOExceptionWithLastError(env, "socket"); diff --git a/jdk/src/solaris/native/sun/nio/ch/Net.c b/jdk/src/solaris/native/sun/nio/ch/Net.c index 79031de6b59..a386c1024e0 100644 --- a/jdk/src/solaris/native/sun/nio/ch/Net.c +++ b/jdk/src/solaris/native/sun/nio/ch/Net.c @@ -124,6 +124,7 @@ struct my_group_source_req { * Copy IPv6 group, interface index, and IPv6 source address * into group_source_req structure. */ +#ifdef AF_INET6 static void initGroupSourceReq(JNIEnv* env, jbyteArray group, jint index, jbyteArray source, struct my_group_source_req* req) { @@ -139,7 +140,7 @@ static void initGroupSourceReq(JNIEnv* env, jbyteArray group, jint index, sin6->sin6_family = AF_INET6; COPY_INET6_ADDRESS(env, source, (jbyte*)&(sin6->sin6_addr)); } - +#endif JNIEXPORT void JNICALL Java_sun_nio_ch_Net_initIDs(JNIEnv *env, jclass clazz) @@ -159,7 +160,11 @@ Java_sun_nio_ch_Net_socket0(JNIEnv *env, jclass cl, jboolean preferIPv6, { int fd; int type = (stream ? SOCK_STREAM : SOCK_DGRAM); +#ifdef AF_INET6 int domain = (ipv6_available() && preferIPv6) ? AF_INET6 : AF_INET; +#else + int domain = AF_INET; +#endif fd = socket(domain, type, 0); if (fd < 0) { @@ -176,7 +181,7 @@ Java_sun_nio_ch_Net_socket0(JNIEnv *env, jclass cl, jboolean preferIPv6, return -1; } } -#ifdef __linux__ +#if defined(__linux__) && defined(AF_INET6) /* By default, Linux uses the route default */ if (domain == AF_INET6 && type == SOCK_DGRAM) { int arg = 1; @@ -424,6 +429,7 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_Net_joinOrDrop6(JNIEnv *env, jobject this, jboolean join, jobject fdo, jbyteArray group, jint index, jbyteArray source) { +#ifdef AF_INET6 struct ipv6_mreq mreq6; struct my_group_source_req req; int opt, n, optlen; @@ -454,12 +460,17 @@ Java_sun_nio_ch_Net_joinOrDrop6(JNIEnv *env, jobject this, jboolean join, jobjec handleSocketError(env, errno); } return 0; +#else + JNU_ThrowInternalError(env, "Should not get here"); + return IOS_THROWN; +#endif /* AF_INET6 */ } JNIEXPORT jint JNICALL Java_sun_nio_ch_Net_blockOrUnblock6(JNIEnv *env, jobject this, jboolean block, jobject fdo, jbyteArray group, jint index, jbyteArray source) { +#ifdef AF_INET6 struct my_group_source_req req; int n; int opt = (block) ? MCAST_BLOCK_SOURCE : MCAST_UNBLOCK_SOURCE; @@ -474,6 +485,10 @@ Java_sun_nio_ch_Net_blockOrUnblock6(JNIEnv *env, jobject this, jboolean block, j handleSocketError(env, errno); } return 0; +#else + JNU_ThrowInternalError(env, "Should not get here"); + return IOS_THROWN; +#endif } JNIEXPORT void JNICALL diff --git a/jdk/src/solaris/native/sun/nio/ch/SctpNet.c b/jdk/src/solaris/native/sun/nio/ch/SctpNet.c index 85611bd0d9d..3f61c56e3eb 100644 --- a/jdk/src/solaris/native/sun/nio/ch/SctpNet.c +++ b/jdk/src/solaris/native/sun/nio/ch/SctpNet.c @@ -48,6 +48,9 @@ JNIEXPORT jint JNICALL JNI_OnLoad return JNI_VERSION_1_2; } +static int preCloseFD = -1; /* File descriptor to which we dup other fd's + before closing them for real */ + /** * Loads the native sctp library that contains the socket extension * functions, as well as locating the individual functions. @@ -107,6 +110,55 @@ jboolean loadSocketExtensionFuncs return JNI_TRUE; } +jint +handleSocketError(JNIEnv *env, jint errorValue) +{ + char *xn; + switch (errorValue) { + case EINPROGRESS: /* Non-blocking connect */ + return 0; + case EPROTO: + xn= JNU_JAVANETPKG "ProtocolException"; + break; + case ECONNREFUSED: + xn = JNU_JAVANETPKG "ConnectException"; + break; + case ETIMEDOUT: + xn = JNU_JAVANETPKG "ConnectException"; + break; + case EHOSTUNREACH: + xn = JNU_JAVANETPKG "NoRouteToHostException"; + break; + case EADDRINUSE: /* Fall through */ + case EADDRNOTAVAIL: + xn = JNU_JAVANETPKG "BindException"; + break; + default: + xn = JNU_JAVANETPKG "SocketException"; + break; + } + errno = errorValue; + JNU_ThrowByNameWithLastError(env, xn, "NioSocketError"); + return IOS_THROWN; +} + +/* + * Class: sun_nio_ch_SctpNet + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL +Java_sun_nio_ch_SctpNet_init + (JNIEnv *env, jclass cl) { + int sp[2]; + if (socketpair(PF_UNIX, SOCK_STREAM, 0, sp) < 0) { + JNU_ThrowIOExceptionWithLastError(env, "socketpair failed"); + return; + } + preCloseFD = sp[0]; + close(sp[1]); +} + /* * Class: sun_nio_ch_SctpNet * Method: socket0 @@ -116,14 +168,18 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpNet_socket0 (JNIEnv *env, jclass klass, jboolean oneToOne) { int fd; struct sctp_event_subscribe event; +#ifdef AF_INET6 + int domain = ipv6_available() ? AF_INET6 : AF_INET; +#else + int domain = AF_INET; +#endif /* Try to load the socket API extension functions */ if (!funcsLoaded && !loadSocketExtensionFuncs(env)) { return 0; } - fd = socket(ipv6_available() ? AF_INET6 : AF_INET, - (oneToOne ? SOCK_STREAM : SOCK_SEQPACKET), IPPROTO_SCTP); + fd = socket(domain, (oneToOne ? SOCK_STREAM : SOCK_SEQPACKET), IPPROTO_SCTP); if (fd < 0) { return handleSocketError(env, errno); @@ -184,6 +240,76 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_bindx free(sap); } +/* + * Class: sun_nio_ch_SctpNet + * Method: listen0 + * Signature: (II)V + */ +JNIEXPORT void JNICALL +Java_sun_nio_ch_SctpNet_listen0 + (JNIEnv *env, jclass cl, jint fd, jint backlog) { + if (listen(fd, backlog) < 0) + handleSocketError(env, errno); +} + +/* + * Class: sun_nio_ch_SctpNet + * Method: connect0 + * Signature: (ILjava/net/InetAddress;I)I + */ +JNIEXPORT jint JNICALL +Java_sun_nio_ch_SctpNet_connect0 + (JNIEnv *env, jclass clazz, int fd, jobject iao, jint port) { + SOCKADDR sa; + int sa_len = SOCKADDR_LEN; + int rv; + + if (NET_InetAddressToSockaddr(env, iao, port, (struct sockaddr *) &sa, + &sa_len, JNI_TRUE) != 0) { + return IOS_THROWN; + } + + rv = connect(fd, (struct sockaddr *)&sa, sa_len); + if (rv != 0) { + if (errno == EINPROGRESS) { + return IOS_UNAVAILABLE; + } else if (errno == EINTR) { + return IOS_INTERRUPTED; + } + return handleSocketError(env, errno); + } + return 1; +} + +/* + * Class: sun_nio_ch_SctpNet + * Method: close0 + * Signature: (I)V + */ +JNIEXPORT void JNICALL +Java_sun_nio_ch_SctpNet_close0 + (JNIEnv *env, jclass clazz, jint fd) { + if (fd != -1) { + int rv = close(fd); + if (rv < 0) + JNU_ThrowIOExceptionWithLastError(env, "Close failed"); + } +} + +/* + * Class: sun_nio_ch_SctpNet + * Method: preClose0 + * Signature: (I)V + */ +JNIEXPORT void JNICALL +Java_sun_nio_ch_SctpNet_preClose0 + (JNIEnv *env, jclass clazz, jint fd) { + if (preCloseFD >= 0) { + if (dup2(preCloseFD, fd) < 0) + JNU_ThrowIOExceptionWithLastError(env, "dup2 failed"); + } +} + void initializeISA (JNIEnv* env) { if (isaCls == 0) { @@ -394,7 +520,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setIntOption0 arglen = sizeof(arg); } - if (setsockopt(fd, klevel, kopt, parg, arglen) < 0) { + if (NET_SetSockOpt(fd, klevel, kopt, parg, arglen) < 0) { JNU_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "sun_nio_ch_SctpNet.setIntOption0"); } @@ -427,7 +553,7 @@ JNIEXPORT int JNICALL Java_sun_nio_ch_SctpNet_getIntOption0 arglen = sizeof(result); } - if (getsockopt(fd, klevel, kopt, arg, &arglen) < 0) { + if (NET_GetSockOpt(fd, klevel, kopt, arg, &arglen) < 0) { JNU_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "sun.nio.ch.Net.getIntOption"); return -1; diff --git a/jdk/src/solaris/native/sun/xawt/XlibWrapper.c b/jdk/src/solaris/native/sun/xawt/XlibWrapper.c index 93fc0971c46..9607b6022d5 100644 --- a/jdk/src/solaris/native/sun/xawt/XlibWrapper.c +++ b/jdk/src/solaris/native/sun/xawt/XlibWrapper.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -1214,6 +1215,48 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_X11_XlibWrapper_IsXsunKPBehavior } } + +JNIEXPORT jboolean JNICALL Java_sun_awt_X11_XlibWrapper_IsSunKeyboard +(JNIEnv *env, jclass clazz, jlong display) +{ + int xx; + AWT_CHECK_HAVE_LOCK(); + xx = XKeysymToKeycode((Display*)jlong_to_ptr(display), SunXK_F37); + return (!xx) ? JNI_FALSE : JNI_TRUE; +} + +JNIEXPORT jboolean JNICALL Java_sun_awt_X11_XlibWrapper_IsKanaKeyboard +(JNIEnv *env, jclass clazz, jlong display) +{ + int xx; + AWT_CHECK_HAVE_LOCK(); + static jboolean result = JNI_FALSE; + + int32_t minKeyCode, maxKeyCode, keySymsPerKeyCode; + KeySym *keySyms, *keySymsStart, keySym; + int32_t i; + int32_t kanaCount = 0; + + // There's no direct way to determine whether the keyboard has + // a kana lock key. From available keyboard mapping tables, it looks + // like only keyboards with the kana lock key can produce keysyms + // for kana characters. So, as an indirect test, we check for those. + XDisplayKeycodes((Display*)jlong_to_ptr(display), &minKeyCode, &maxKeyCode); + keySyms = XGetKeyboardMapping((Display*)jlong_to_ptr(display), minKeyCode, maxKeyCode - minKeyCode + 1, &keySymsPerKeyCode); + keySymsStart = keySyms; + for (i = 0; i < (maxKeyCode - minKeyCode + 1) * keySymsPerKeyCode; i++) { + keySym = *keySyms++; + if ((keySym & 0xff00) == 0x0400) { + kanaCount++; + } + } + XFree(keySymsStart); + + // use a (somewhat arbitrary) minimum so we don't get confused by a stray function key + result = kanaCount > 10; + return result ? JNI_TRUE : JNI_FALSE; +} + JavaVM* jvm = NULL; static int ToolkitErrorHandler(Display * dpy, XErrorEvent * event) { if (jvm != NULL) { @@ -1261,6 +1304,7 @@ JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_CallErrorHandler return (*(XErrorHandler)jlong_to_ptr(handler))((Display*) jlong_to_ptr(display), (XErrorEvent*) jlong_to_ptr(event_ptr)); } + /* * Class: sun_awt_X11_XlibWrapper * Method: PrintXErrorEvent @@ -1853,6 +1897,17 @@ Java_sun_awt_X11_XlibWrapper_XFreeModifiermap(JNIEnv *env, jclass clazz, AWT_CHECK_HAVE_LOCK(); XFreeModifiermap((XModifierKeymap*) jlong_to_ptr(keymap)); } +/* + * Class: sun_awt_X11_XlibWrapper + * Method: XRefreshKeyboardMapping + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_sun_awt_X11_XlibWrapper_XRefreshKeyboardMapping +(JNIEnv *env, jclass clazz, jlong event_ptr) +{ + AWT_CHECK_HAVE_LOCK(); + XRefreshKeyboardMapping((XMappingEvent*) jlong_to_ptr(event_ptr)); +} JNIEXPORT void JNICALL Java_sun_awt_X11_XlibWrapper_XChangeActivePointerGrab(JNIEnv *env, jclass clazz, diff --git a/jdk/src/windows/classes/sun/awt/windows/WCanvasPeer.java b/jdk/src/windows/classes/sun/awt/windows/WCanvasPeer.java index fc5fc107643..6682ffa85d3 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WCanvasPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WCanvasPeer.java @@ -28,8 +28,6 @@ import java.awt.*; import java.awt.peer.*; import java.lang.ref.WeakReference; import java.lang.reflect.Method; -import sun.awt.AWTAccessor; -import sun.awt.ComponentAccessor; import sun.awt.SunToolkit; import sun.awt.Win32GraphicsDevice; import sun.awt.PaintEventDispatcher; diff --git a/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java b/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java index e5c51d7b77f..f508d5d9a88 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WComponentPeer.java @@ -57,7 +57,7 @@ import sun.awt.event.IgnorePaintEvent; import java.awt.dnd.DropTarget; import java.awt.dnd.peer.DropTargetPeer; -import sun.awt.ComponentAccessor; +import sun.awt.AWTAccessor; import sun.util.logging.PlatformLogger; @@ -817,7 +817,7 @@ public abstract class WComponentPeer extends WObjectPeer } private void postPaintIfNecessary(int x, int y, int w, int h) { - if ( !ComponentAccessor.getIgnoreRepaint( (Component) target) ) { + if ( !AWTAccessor.getComponentAccessor().getIgnoreRepaint( (Component) target) ) { PaintEvent event = PaintEventDispatcher.getPaintEventDispatcher(). createPaintEvent((Component)target, x, y, w, h); if (event != null) { diff --git a/jdk/src/windows/classes/sun/awt/windows/WDataTransferer.java b/jdk/src/windows/classes/sun/awt/windows/WDataTransferer.java index b996974ff18..cb248d9bba6 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WDataTransferer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WDataTransferer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,6 +56,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.IOException; import java.io.UnsupportedEncodingException; +import java.io.File; import java.net.URL; @@ -72,6 +73,10 @@ import sun.awt.datatransfer.ToolkitThreadBlockedHandler; import sun.awt.image.ImageRepresentation; import sun.awt.image.ToolkitImage; +import java.util.ArrayList; + +import java.io.ByteArrayOutputStream; + /** * Platform-specific support for the data transfer subsystem. * @@ -126,6 +131,10 @@ public class WDataTransferer extends DataTransferer { public static final long CF_PNG = registerClipboardFormat("PNG"); public static final long CF_JFIF = registerClipboardFormat("JFIF"); + public static final long CF_FILEGROUPDESCRIPTORW = registerClipboardFormat("FileGroupDescriptorW"); + public static final long CF_FILEGROUPDESCRIPTORA = registerClipboardFormat("FileGroupDescriptor"); + //CF_FILECONTENTS supported as mandatory associated clipboard + private static final Long L_CF_LOCALE = (Long) predefinedClipboardNameMap.get(predefinedClipboardNames[CF_LOCALE]); @@ -199,6 +208,30 @@ public class WDataTransferer extends DataTransferer { str = new HTMLCodec(str, EHTMLReadMode.HTML_READ_SELECTION); } + if (format == CF_FILEGROUPDESCRIPTORA || format == CF_FILEGROUPDESCRIPTORW) { + if (null != str ) { + str.close(); + } + if (bytes == null || !DataFlavor.javaFileListFlavor.equals(flavor)) { + throw new IOException("data translation failed"); + } + String st = new String(bytes, 0, bytes.length, "UTF-16LE"); + String[] filenames = st.split("\0"); + if( 0 == filenames.length ){ + return null; + } + + // Convert the strings to File objects + File[] files = new File[filenames.length]; + for (int i = 0; i < filenames.length; ++i) { + files[i] = new File(filenames[i]); + //They are temp-files from memory Stream, so they have to be removed on exit + files[i].deleteOnExit(); + } + // Turn the list of Files into a List and return + return Arrays.asList(files); + } + if (format == CFSTR_INETURL && URL.class.equals(flavor.getRepresentationClass())) { @@ -229,7 +262,7 @@ public class WDataTransferer extends DataTransferer { } public boolean isFileFormat(long format) { - return format == CF_HDROP; + return format == CF_HDROP || format == CF_FILEGROUPDESCRIPTORA || format == CF_FILEGROUPDESCRIPTORW; } protected Long getFormatForNativeAsLong(String str) { @@ -342,6 +375,33 @@ public class WDataTransferer extends DataTransferer { return imageDataToPlatformImageBytes(imageData, width, height, format); } + private static final byte [] UNICODE_NULL_TERMINATOR = new byte [] {0,0}; + + protected ByteArrayOutputStream convertFileListToBytes(ArrayList fileList) + throws IOException + { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + + if(fileList.isEmpty()) { + //store empty unicode string (null terminator) + bos.write(UNICODE_NULL_TERMINATOR); + } else { + for (int i = 0; i < fileList.size(); i++) { + byte[] bytes = fileList.get(i).getBytes(getDefaultUnicodeEncoding()); + //store unicode string with null terminator + bos.write(bytes, 0, bytes.length); + bos.write(UNICODE_NULL_TERMINATOR); + } + } + + // According to MSDN the byte array have to be double NULL-terminated. + // The array contains Unicode characters, so each NULL-terminator is + // a pair of bytes + + bos.write(UNICODE_NULL_TERMINATOR); + return bos; + } + /** * Returns a byte array which contains data special for the given format * and for the given image data. diff --git a/jdk/src/windows/classes/sun/awt/windows/WDialogPeer.java b/jdk/src/windows/classes/sun/awt/windows/WDialogPeer.java index 4424f1cc813..918cd035e47 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WDialogPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WDialogPeer.java @@ -53,7 +53,12 @@ class WDialogPeer extends WWindowPeer implements DialogPeer { } } - native void create(WComponentPeer parent); + native void createAwtDialog(WComponentPeer parent); + void create(WComponentPeer parent) { + preCreate(parent); + createAwtDialog(parent); + } + native void showModal(); native void endModal(); @@ -93,7 +98,7 @@ class WDialogPeer extends WWindowPeer implements DialogPeer { public void blockWindows(java.util.List toBlock) { for (Window w : toBlock) { - WWindowPeer wp = (WWindowPeer)ComponentAccessor.getPeer(w); + WWindowPeer wp = (WWindowPeer)AWTAccessor.getComponentAccessor().getPeer(w); if (wp != null) { wp.setModalBlocked((Dialog)target, true); } diff --git a/jdk/src/windows/classes/sun/awt/windows/WDragSourceContextPeer.java b/jdk/src/windows/classes/sun/awt/windows/WDragSourceContextPeer.java index 1cb45d1aace..ed9ceee2ddf 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WDragSourceContextPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WDragSourceContextPeer.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,10 @@ package sun.awt.windows; import java.awt.Component; import java.awt.Cursor; +import java.awt.Image; +import java.awt.Point; +import java.awt.image.BufferedImage; +import java.awt.image.DataBufferInt; import java.awt.datatransfer.Transferable; @@ -88,11 +92,56 @@ final class WDragSourceContextPeer extends SunDragSourceContextPeer { throw new InvalidDnDOperationException("failed to create native peer"); } - setNativeContext(nativeCtxtLocal); + int[] imageData = null; + Point op = null; + Image im = getDragImage(); + int imageWidth = -1; + int imageHeight = -1; + if (im != null) { + //image is ready (partial images are ok) + try{ + imageWidth = im.getWidth(null); + imageHeight = im.getHeight(null); + if (imageWidth < 0 || imageHeight < 0) { + throw new InvalidDnDOperationException("drag image is not ready"); + } + //We could get an exception from user code here. + //"im" and "dragImageOffset" are user-defined objects + op = getDragImageOffset(); //op could not be null here + BufferedImage bi = new BufferedImage( + imageWidth, + imageHeight, + BufferedImage.TYPE_INT_ARGB); + bi.getGraphics().drawImage(im, 0, 0, null); + + //we can get out-of-memory here + imageData = ((DataBufferInt)bi.getData().getDataBuffer()).getData(); + } catch (Throwable ex) { + throw new InvalidDnDOperationException("drag image creation problem: " + ex.getMessage()); + } + } + + //We shouldn't have user-level exceptions since now. + //Any exception leads to corrupted D'n'D state. + setNativeContext(nativeCtxtLocal); WDropTargetContextPeer.setCurrentJVMLocalSourceTransferable(trans); - doDragDrop(getNativeContext(), getCursor()); + if (imageData != null) { + doDragDrop( + getNativeContext(), + getCursor(), + imageData, + imageWidth, imageHeight, + op.x, op.y); + } else { + doDragDrop( + getNativeContext(), + getCursor(), + null, + -1, -1, + 0, 0); + } } /** @@ -110,7 +159,12 @@ final class WDragSourceContextPeer extends SunDragSourceContextPeer { * downcall into native code */ - native void doDragDrop(long nativeCtxt, Cursor cursor); + native void doDragDrop( + long nativeCtxt, + Cursor cursor, + int[] imageData, + int imgWidth, int imgHight, + int offsetX, int offsetY); protected native void setNativeCursor(long nativeCtxt, Cursor c, int cType); diff --git a/jdk/src/windows/classes/sun/awt/windows/WFileDialogPeer.java b/jdk/src/windows/classes/sun/awt/windows/WFileDialogPeer.java index 9575b2475d6..e5843dda7d5 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WFileDialogPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WFileDialogPeer.java @@ -35,7 +35,7 @@ import java.util.ResourceBundle; import java.util.MissingResourceException; import java.util.Vector; import sun.awt.AppContext; -import sun.awt.ComponentAccessor; +import sun.awt.AWTAccessor; public class WFileDialogPeer extends WWindowPeer implements FileDialogPeer { @@ -117,26 +117,57 @@ public class WFileDialogPeer extends WWindowPeer implements FileDialogPeer { } } - // NOTE: This method is called by privileged threads. - // DO NOT INVOKE CLIENT CODE ON THIS THREAD! - void handleSelected(final String file) { - final FileDialog fileDialog = (FileDialog)target; - WToolkit.executeOnEventHandlerThread(fileDialog, new Runnable() { - public void run() { - int index = file.lastIndexOf(java.io.File.separatorChar);/*2509*//*ibm*/ - String dir; + /* + * The function converts the file names (the buffer parameter) + * in the Windows format into the Java format and saves the results + * into the FileDialog instance. + * + * If it's the multi-select mode, the buffer contains the current + * directory followed by the short names of the files. + * The directory and file name strings are NULL separated. + * If it's the single-select mode, the buffer doesn't have the NULL + * separator between the path and the file name. + * + * NOTE: This method is called by privileged threads. + * DO NOT INVOKE CLIENT CODE ON THIS THREAD! + */ + void handleSelected(final char[] buffer) + { + String[] wFiles = (new String(buffer)).split("\0"); // NULL is the delimiter + boolean multiple = (wFiles.length > 1); - if (index == -1) { - dir = "."+java.io.File.separator; - fileDialog.setFile(file); - } - else { - dir = file.substring(0, index + 1); - fileDialog.setFile(file.substring(index + 1)); - } - fileDialog.setDirectory(dir); - fileDialog.hide(); + String jDirectory = null; + String jFile = null; + String jFiles[] = null; + + if (multiple) { + jDirectory = wFiles[0]; + jFiles = new String[wFiles.length - 1]; + System.arraycopy(wFiles, 1, jFiles, 0, jFiles.length); + jFile = jFiles[1]; // choose any file + } else { + int index = wFiles[0].lastIndexOf(java.io.File.separatorChar); + if (index == -1) { + jDirectory = "."+java.io.File.separator; + jFile = wFiles[0]; + } else { + jDirectory = wFiles[0].substring(0, index + 1); + jFile = wFiles[0].substring(index + 1); } + jFiles = new String[] { jFile }; + } + + final FileDialog fileDialog = (FileDialog)target; + AWTAccessor.FileDialogAccessor fileDialogAccessor = AWTAccessor.getFileDialogAccessor(); + + fileDialogAccessor.setDirectory(fileDialog, jDirectory); + fileDialogAccessor.setFile(fileDialog, jFile); + fileDialogAccessor.setFiles(fileDialog, jDirectory, jFiles); + + WToolkit.executeOnEventHandlerThread(fileDialog, new Runnable() { + public void run() { + fileDialog.hide(); + } }); } // handleSelected() @@ -144,11 +175,14 @@ public class WFileDialogPeer extends WWindowPeer implements FileDialogPeer { // DO NOT INVOKE CLIENT CODE ON THIS THREAD! void handleCancel() { final FileDialog fileDialog = (FileDialog)target; + + AWTAccessor.getFileDialogAccessor().setFile(fileDialog, null); + AWTAccessor.getFileDialogAccessor().setFiles(fileDialog, null, null); + WToolkit.executeOnEventHandlerThread(fileDialog, new Runnable() { - public void run() { - fileDialog.setFile(null); - fileDialog.hide(); - } + public void run() { + fileDialog.hide(); + } }); } // handleCancel() @@ -187,7 +221,7 @@ public class WFileDialogPeer extends WWindowPeer implements FileDialogPeer { public void blockWindows(java.util.List toBlock) { for (Window w : toBlock) { - WWindowPeer wp = (WWindowPeer)ComponentAccessor.getPeer(w); + WWindowPeer wp = (WWindowPeer)AWTAccessor.getComponentAccessor().getPeer(w); if (wp != null) { blockWindow(wp); } @@ -244,4 +278,9 @@ public class WFileDialogPeer extends WWindowPeer implements FileDialogPeer { public void createScreenSurface(boolean isResize) {} @Override public void replaceSurfaceData() {} + + public boolean isMultipleMode() { + FileDialog fileDialog = (FileDialog)target; + return AWTAccessor.getFileDialogAccessor().isMultipleMode(fileDialog); + } } diff --git a/jdk/src/windows/classes/sun/awt/windows/WFramePeer.java b/jdk/src/windows/classes/sun/awt/windows/WFramePeer.java index 86bde26582b..c89d154132a 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WFramePeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WFramePeer.java @@ -136,6 +136,7 @@ class WFramePeer extends WWindowPeer implements FramePeer { native void createAwtFrame(WComponentPeer parent); void create(WComponentPeer parent) { + preCreate(parent); createAwtFrame(parent); } diff --git a/jdk/src/windows/classes/sun/awt/windows/WPrintDialogPeer.java b/jdk/src/windows/classes/sun/awt/windows/WPrintDialogPeer.java index d4ec57302fa..f507ce19568 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WPrintDialogPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WPrintDialogPeer.java @@ -31,7 +31,7 @@ import java.awt.peer.ComponentPeer; import java.awt.dnd.DropTarget; import java.util.Vector; import sun.awt.AppContext; -import sun.awt.ComponentAccessor; +import sun.awt.AWTAccessor; public class WPrintDialogPeer extends WWindowPeer implements DialogPeer { @@ -103,7 +103,7 @@ public class WPrintDialogPeer extends WWindowPeer implements DialogPeer { public void blockWindows(java.util.List toBlock) { for (Window w : toBlock) { - WWindowPeer wp = (WWindowPeer)ComponentAccessor.getPeer(w); + WWindowPeer wp = (WWindowPeer)AWTAccessor.getComponentAccessor().getPeer(w); if (wp != null) { blockWindow(wp); } diff --git a/jdk/src/windows/classes/sun/awt/windows/WToolkit.java b/jdk/src/windows/classes/sun/awt/windows/WToolkit.java index 465c8ef3ab9..b822cf654d2 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WToolkit.java +++ b/jdk/src/windows/classes/sun/awt/windows/WToolkit.java @@ -895,6 +895,8 @@ public class WToolkit extends SunToolkit implements Runnable { Integer.valueOf(50)); desktopProperties.put("DnD.Autoscroll.interval", Integer.valueOf(50)); + desktopProperties.put("DnD.isDragImageSupported", + Boolean.TRUE); desktopProperties.put("Shell.shellFolderManager", "sun.awt.shell.Win32ShellFolderManager2"); } diff --git a/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java b/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java index 6189738da20..9a39d509f2b 100644 --- a/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java +++ b/jdk/src/windows/classes/sun/awt/windows/WWindowPeer.java @@ -199,7 +199,17 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer, } native void createAwtWindow(WComponentPeer parent); + + private volatile Window.Type windowType = Window.Type.NORMAL; + + // This method must be called for Window, Dialog, and Frame before creating + // the hwnd + void preCreate(WComponentPeer parent) { + windowType = ((Window)target).getType(); + } + void create(WComponentPeer parent) { + preCreate(parent); createAwtWindow(parent); } diff --git a/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java b/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java index 0b43ab0d516..e14ac2fc659 100644 --- a/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java +++ b/jdk/src/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java @@ -445,20 +445,17 @@ public class WindowsAsynchronousFileChannelImpl // allocate OVERLAPPED overlapped = ioCache.add(result); - // synchronize on result to allow this thread handle the case - // where the read completes immediately. - synchronized (result) { - n = readFile(handle, address, rem, position, overlapped); - if (n == IOStatus.UNAVAILABLE) { - // I/O is pending - return; - } - // read completed immediately: - // 1. update buffer position - // 2. release waiters - updatePosition(n); + // initiate read + n = readFile(handle, address, rem, position, overlapped); + if (n == IOStatus.UNAVAILABLE) { + // I/O is pending + return; + } else if (n == IOStatus.EOF) { result.setResult(n); + } else { + throw new InternalError("Unexpected result: " + n); } + } catch (Throwable x) { // failed to initiate read result.setFailure(toIOException(x)); @@ -466,12 +463,9 @@ public class WindowsAsynchronousFileChannelImpl end(); } - // read failed or EOF so completion port will not be notified - if (n < 0 && overlapped != 0L) { + // release resources + if (overlapped != 0L) ioCache.remove(overlapped); - } - - // return direct buffer to cache if substituted releaseBufferIfSubstituted(); // invoke completion handler @@ -634,20 +628,15 @@ public class WindowsAsynchronousFileChannelImpl // allocate an OVERLAPPED structure overlapped = ioCache.add(result); - // synchronize on result to allow this thread handle the case - // where the read completes immediately. - synchronized (result) { - n = writeFile(handle, address, rem, position, overlapped); - if (n == IOStatus.UNAVAILABLE) { - // I/O is pending - return; - } - // read completed immediately: - // 1. update buffer position - // 2. release waiters - updatePosition(n); - result.setResult(n); + // initiate the write + n = writeFile(handle, address, rem, position, overlapped); + if (n == IOStatus.UNAVAILABLE) { + // I/O is pending + return; + } else { + throw new InternalError("Unexpected result: " + n); } + } catch (Throwable x) { // failed to initiate read: result.setFailure(toIOException(x)); diff --git a/jdk/src/windows/lib/flavormap.properties b/jdk/src/windows/lib/flavormap.properties index 0a083515448..c80f1cf90f0 100644 --- a/jdk/src/windows/lib/flavormap.properties +++ b/jdk/src/windows/lib/flavormap.properties @@ -73,3 +73,5 @@ LOCALE=application/x-java-text-encoding;class="[B" UniformResourceLocator=application/x-java-url;class=java.net.URL UniformResourceLocator=text/uri-list;eoln="\r\n";terminators=1 UniformResourceLocator=text/plain;eoln="\r\n";terminators=1 +FileGroupDescriptorW=application/x-java-file-list;class=java.util.List +FileGroupDescriptor=application/x-java-file-list;class=java.util.List diff --git a/jdk/src/windows/lib/tzmappings b/jdk/src/windows/lib/tzmappings index ec2732f64fb..05309c9aef8 100644 --- a/jdk/src/windows/lib/tzmappings +++ b/jdk/src/windows/lib/tzmappings @@ -92,7 +92,7 @@ Bangkok Standard Time:14,15::Asia/Bangkok: North Asia Standard Time:14,15::Asia/Krasnoyarsk: SE Asia:14,15::Asia/Bangkok: SE Asia Standard Time:14,15::Asia/Bangkok: -North Asia East Standard Time:16,17::Asia/Ulaanbaatar: +North Asia East Standard Time:16,17:RU:Asia/Irkutsk: Singapore:16,17:SG:Asia/Singapore: Singapore Standard Time:16,17:SG:Asia/Singapore: Taipei:16,17::Asia/Taipei: @@ -184,4 +184,5 @@ Venezuela Standard Time:915,915::America/Caracas: Kamchatka Standard Time:916,916:RU:Asia/Kamchatka: Paraguay Standard Time:917,917:PY:America/Asuncion: Western Brazilian Standard Time:918,918:BR:America/Rio_Branco: -Armenian Standard Time:919,919:AM:Asia/Yerevan: +Ulaanbaatar Standard Time:919,919::Asia/Ulaanbaatar: +Armenian Standard Time:920,920:AM:Asia/Yerevan: diff --git a/jdk/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp b/jdk/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp index b60ff058641..12e3f688a95 100644 --- a/jdk/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp +++ b/jdk/src/windows/native/com/sun/media/sound/PLATFORM_API_WinOS_DirectSound.cpp @@ -485,7 +485,7 @@ DWORD WINAPI __stdcall DS_StartBufferHelper::ThreadProc(void *param) } if (data.line2Start->isSource) { data.startResult = - data.line2Start->playBuffer->Play(0, 0, DSCBSTART_LOOPING); + data.line2Start->playBuffer->Play(0, 0, DSBPLAY_LOOPING); } else { data.startResult = data.line2Start->captureBuffer->Start(DSCBSTART_LOOPING); diff --git a/jdk/src/windows/native/java/net/NetworkInterface_winXP.c b/jdk/src/windows/native/java/net/NetworkInterface_winXP.c index 0fcfa9fddef..e8402f6b6b0 100644 --- a/jdk/src/windows/native/java/net/NetworkInterface_winXP.c +++ b/jdk/src/windows/native/java/net/NetworkInterface_winXP.c @@ -172,7 +172,7 @@ int getAllInterfacesAndAddresses (JNIEnv *env, netif **netifPP) DWORD ret; IP_ADAPTER_ADDRESSES *ptr, *adapters=0; ULONG len=ipinflen, count=0; - netif *nif=0, *dup_nif, *last=0, *loopif=0; + netif *nif=0, *dup_nif, *last=0, *loopif=0, *curr; int tun=0, net=0; *netifPP = 0; @@ -197,6 +197,20 @@ int getAllInterfacesAndAddresses (JNIEnv *env, netif **netifPP) last = nif; } + // Retrieve IPv4 addresses with the IP Helper API + curr = *netifPP; + while (curr != NULL) { + netaddr *netaddrP; + ret = enumAddresses_win(env, curr, &netaddrP); + if ((*env)->ExceptionOccurred(env)) { + free_netaddr(netaddrP); + return -1; + } + curr->addrs = netaddrP; + curr->naddrs += ret; + curr = curr->next; + } + ret = getAdapters (env, &adapters); if (ret != ERROR_SUCCESS) { goto err; @@ -350,6 +364,14 @@ static int getAddrsFromAdapter(IP_ADAPTER_ADDRESSES *ptr, netaddr **netaddrPP) { /* address is only usable if dad state is preferred or deprecated */ if (uni_addr->DadState == IpDadStateDeprecated || uni_addr->DadState == IpDadStatePreferred) { + sock = uni_addr->Address.lpSockaddr; + + // IPv4 addresses already retrieved with enumAddresses_win + if (sock->sa_family == AF_INET) { + uni_addr = uni_addr->Next; + continue; + } + curr = (netaddr *)calloc (1, sizeof (netaddr)); if (curr == 0) { return -1; @@ -361,15 +383,9 @@ static int getAddrsFromAdapter(IP_ADAPTER_ADDRESSES *ptr, netaddr **netaddrPP) { prev->next = curr; } prev = curr; - sock = uni_addr->Address.lpSockaddr; SOCKETADDRESS_COPY (&curr->addr, sock); if (prefix != NULL) { curr->mask = (short)prefix->PrefixLength; - if (sock->sa_family == AF_INET) { - sock = prefix->Address.lpSockaddr; - SOCKETADDRESS_COPY(&curr->brdcast, sock); - curr->brdcast.him4.sin_addr.s_addr |= htonl((0xffffffff >> curr->mask)); - } prefix = prefix->Next; } count ++; diff --git a/jdk/src/windows/native/java/net/SocketInputStream.c b/jdk/src/windows/native/java/net/SocketInputStream.c index 54c9a8a88fe..bbf6a9ac6fc 100644 --- a/jdk/src/windows/native/java/net/SocketInputStream.c +++ b/jdk/src/windows/native/java/net/SocketInputStream.c @@ -121,6 +121,9 @@ Java_java_net_SocketInputStream_socketRead0(JNIEnv *env, jobject this, newfd = (*env)->GetIntField(env, fdObj, IO_fd_fdID); if (newfd == -1) { NET_ThrowSocketException(env, "Socket Closed"); + if (bufP != BUF) { + free(bufP); + } return -1; } } diff --git a/jdk/src/windows/native/sun/nio/ch/WindowsAsynchronousFileChannelImpl.c b/jdk/src/windows/native/sun/nio/ch/WindowsAsynchronousFileChannelImpl.c index d8346ba3e7a..cf742116c79 100644 --- a/jdk/src/windows/native/sun/nio/ch/WindowsAsynchronousFileChannelImpl.c +++ b/jdk/src/windows/native/sun/nio/ch/WindowsAsynchronousFileChannelImpl.c @@ -39,7 +39,6 @@ Java_sun_nio_ch_WindowsAsynchronousFileChannelImpl_readFile(JNIEnv* env, jclass jlong handle, jlong address, jint len, jlong offset, jlong ov) { BOOL res; - DWORD nread = 0; OVERLAPPED* lpOverlapped = (OVERLAPPED*)jlong_to_ptr(ov); lpOverlapped->Offset = (DWORD)offset; @@ -49,7 +48,7 @@ Java_sun_nio_ch_WindowsAsynchronousFileChannelImpl_readFile(JNIEnv* env, jclass res = ReadFile((HANDLE) jlong_to_ptr(handle), (LPVOID) jlong_to_ptr(address), (DWORD)len, - &nread, + NULL, lpOverlapped); if (res == 0) { @@ -62,7 +61,7 @@ Java_sun_nio_ch_WindowsAsynchronousFileChannelImpl_readFile(JNIEnv* env, jclass return IOS_THROWN; } - return (jint)nread; + return IOS_UNAVAILABLE; } JNIEXPORT jint JNICALL @@ -70,7 +69,6 @@ Java_sun_nio_ch_WindowsAsynchronousFileChannelImpl_writeFile(JNIEnv* env, jclass jlong handle, jlong address, jint len, jlong offset, jlong ov) { BOOL res; - DWORD nwritten = 0; OVERLAPPED* lpOverlapped = (OVERLAPPED*)jlong_to_ptr(ov); lpOverlapped->Offset = (DWORD)offset; @@ -80,18 +78,18 @@ Java_sun_nio_ch_WindowsAsynchronousFileChannelImpl_writeFile(JNIEnv* env, jclass res = WriteFile((HANDLE)jlong_to_ptr(handle), (LPVOID) jlong_to_ptr(address), (DWORD)len, - &nwritten, + NULL, lpOverlapped); if (res == 0) { int error = GetLastError(); - if (error == ERROR_IO_PENDING) { + if (error == ERROR_IO_PENDING) return IOS_UNAVAILABLE; - } JNU_ThrowIOExceptionWithLastError(env, "WriteFile failed"); return IOS_THROWN; } - return (jint)nwritten; + + return IOS_UNAVAILABLE; } JNIEXPORT jint JNICALL diff --git a/jdk/src/windows/native/sun/windows/awt.h b/jdk/src/windows/native/sun/windows/awt.h index cd4791fd257..bc9a0cca62f 100644 --- a/jdk/src/windows/native/sun/windows/awt.h +++ b/jdk/src/windows/native/sun/windows/awt.h @@ -1,5 +1,5 @@ /* - * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1996-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -233,4 +233,122 @@ extern JavaVM *jvm; #define CHECK_ISNOT_TOOLKIT_THREAD() #endif + +struct EnvHolder +{ + JavaVM *m_pVM; + JNIEnv *m_env; + bool m_isOwner; + EnvHolder( + JavaVM *pVM, + LPCSTR name = "COM holder", + jint ver = JNI_VERSION_1_2) + : m_pVM(pVM), + m_env((JNIEnv *)JNU_GetEnv(pVM, ver)), + m_isOwner(false) + { + if (NULL == m_env) { + JavaVMAttachArgs attachArgs; + attachArgs.version = ver; + attachArgs.name = const_cast(name); + attachArgs.group = NULL; + jint status = m_pVM->AttachCurrentThread( + (void**)&m_env, + &attachArgs); + m_isOwner = (NULL!=m_env); + } + } + ~EnvHolder() { + if (m_isOwner) { + m_pVM->DetachCurrentThread(); + } + } + operator bool() const { return NULL!=m_env; } + bool operator !() const { return NULL==m_env; } + operator JNIEnv*() const { return m_env; } + JNIEnv* operator ->() const { return m_env; } +}; + +template +class JLocalRef { + JNIEnv* m_env; + T m_localJRef; + +public: + JLocalRef(JNIEnv* env, T localJRef = NULL) + : m_env(env), + m_localJRef(localJRef) + {} + T Detach() { + T ret = m_localJRef; + m_localJRef = NULL; + return ret; + } + void Attach(T newValue) { + if (m_localJRef) { + m_env->DeleteLocalRef((jobject)m_localJRef); + } + m_localJRef = newValue; + } + + operator T() { return m_localJRef; } + operator bool() { return NULL!=m_localJRef; } + bool operator !() { return NULL==m_localJRef; } + + ~JLocalRef() { + if (m_localJRef) { + m_env->DeleteLocalRef((jobject)m_localJRef); + } + } +}; + +typedef JLocalRef JLObject; +typedef JLocalRef JLString; +typedef JLocalRef JLClass; + +/* + * Class to encapsulate the extraction of the java string contents + * into a buffer and the cleanup of the buffer + */ + class JavaStringBuffer +{ +protected: + LPWSTR m_pStr; + jsize m_dwSize; + +public: + JavaStringBuffer(jsize cbTCharCount) { + m_dwSize = cbTCharCount; + m_pStr = (LPWSTR)safe_Malloc( (m_dwSize+1)*sizeof(WCHAR) ); + } + + JavaStringBuffer(JNIEnv *env, jstring text) { + if (NULL == text) { + m_pStr = L""; + m_dwSize = 0; + } else { + m_dwSize = env->GetStringLength(text); + m_pStr = (LPWSTR)safe_Malloc( (m_dwSize+1)*sizeof(WCHAR) ); + env->GetStringRegion(text, 0, m_dwSize, reinterpret_cast(m_pStr)); + m_pStr[m_dwSize] = 0; + } + } + + + ~JavaStringBuffer() { + free(m_pStr); + } + + void Resize(jsize cbTCharCount) { + m_dwSize = cbTCharCount; + m_pStr = (LPWSTR)safe_Realloc(m_pStr, (m_dwSize+1)*sizeof(WCHAR) ); + } + //we are in UNICODE now, so LPWSTR:=:LPTSTR + operator LPWSTR() { return m_pStr; } + operator LPARAM() { return (LPARAM)m_pStr; } + void *GetData() { return (void *)m_pStr; } + jsize GetSize() { return m_dwSize; } +}; + + #endif /* _AWT_H_ */ diff --git a/jdk/src/windows/native/sun/windows/awt_Component.cpp b/jdk/src/windows/native/sun/windows/awt_Component.cpp index b2767bac72c..d98f241a145 100644 --- a/jdk/src/windows/native/sun/windows/awt_Component.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Component.cpp @@ -378,7 +378,9 @@ LRESULT CALLBACK AwtComponent::WndProc(HWND hWnd, UINT message, TRY; AwtComponent * self = AwtComponent::GetComponentImpl(hWnd); - if (self == NULL || self->GetHWnd() != hWnd) { + if (self == NULL || self->GetHWnd() != hWnd || + message == WM_UNDOCUMENTED_CLIENTSHUTDOWN) // handle log-off gracefully + { return ComCtl32Util::GetInstance().DefWindowProc(NULL, hWnd, message, wParam, lParam); } else { return self->WindowProc(message, wParam, lParam); diff --git a/jdk/src/windows/native/sun/windows/awt_DCHolder.cpp b/jdk/src/windows/native/sun/windows/awt_DCHolder.cpp new file mode 100644 index 00000000000..47f3ba6f3e8 --- /dev/null +++ b/jdk/src/windows/native/sun/windows/awt_DCHolder.cpp @@ -0,0 +1,107 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +#include "awt.h" +#include "awt_ole.h" +#include "awt_DCHolder.h" // main symbols + + +//////////////////////// +// struct DCHolder + +DCHolder::DCHolder() +: m_hMemoryDC(NULL), + m_iWidth(0), + m_iHeight(0), + m_bForImage(FALSE), + m_hBitmap(NULL), + m_hOldBitmap(NULL), + m_pPoints(NULL) +{} + +void DCHolder::Create( + HDC hRelDC, + int iWidth, + int iHeght, + BOOL bForImage +){ + OLE_DECL + m_iWidth = iWidth; + m_iHeight = iHeght; + m_bForImage = bForImage; + m_hMemoryDC = ::CreateCompatibleDC(hRelDC); + //NB: can not throw an error in non-safe stack!!! Just conversion and logging! + //OLE_WINERROR2HR just set OLE_HR without any throw! + if (!m_hMemoryDC) { + OLE_THROW_LASTERROR(_T("CreateCompatibleDC")) + } + m_hBitmap = m_bForImage + ? CreateJavaContextBitmap(hRelDC, m_iWidth, m_iHeight, &m_pPoints) + : ::CreateCompatibleBitmap(hRelDC, m_iWidth, m_iHeight); + if (!m_hBitmap) { + OLE_THROW_LASTERROR(_T("CreateCompatibleBitmap")) + } + m_hOldBitmap = (HBITMAP)::SelectObject(m_hMemoryDC, m_hBitmap); + if (!m_hOldBitmap) { + OLE_THROW_LASTERROR(_T("SelectBMObject")) + } +} + +DCHolder::~DCHolder(){ + if (m_hOldBitmap) { + ::SelectObject(m_hMemoryDC, m_hOldBitmap); + } + if (m_hBitmap) { + ::DeleteObject(m_hBitmap); + } + if (m_hMemoryDC) { + ::DeleteDC(m_hMemoryDC); + } +}; + + +HBITMAP DCHolder::CreateJavaContextBitmap( + HDC hdc, + int iWidth, + int iHeight, + void **ppPoints) +{ + BITMAPINFO bitmapInfo = {0}; + bitmapInfo.bmiHeader.biWidth = iWidth; + bitmapInfo.bmiHeader.biHeight = -iHeight; + bitmapInfo.bmiHeader.biPlanes = 1; + bitmapInfo.bmiHeader.biBitCount = 32; + bitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bitmapInfo.bmiHeader.biCompression = BI_RGB; + + return ::CreateDIBSection( + hdc, + (BITMAPINFO *)&bitmapInfo, + DIB_RGB_COLORS, + (void **)ppPoints, + NULL, + 0 + ); +} diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpSocketDispatcher.java b/jdk/src/windows/native/sun/windows/awt_DCHolder.h similarity index 50% rename from jdk/src/solaris/classes/sun/nio/ch/SctpSocketDispatcher.java rename to jdk/src/windows/native/sun/windows/awt_DCHolder.h index 937a7392496..1e5ec0ed660 100644 --- a/jdk/src/solaris/classes/sun/nio/ch/SctpSocketDispatcher.java +++ b/jdk/src/windows/native/sun/windows/awt_DCHolder.h @@ -22,47 +22,51 @@ * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ -package sun.nio.ch; -import java.io.IOException; -import java.io.FileDescriptor; +#ifndef _AWT_DCHolder_H +#define _AWT_DCHolder_H -/** - * Only used for {@code close} and {@code preclose}. All other methods - * throw {@code IOException}. - */ -class SctpSocketDispatcher extends NativeDispatcher { - @Override - @SuppressWarnings("unused") - int read(FileDescriptor fd, long address, int len) throws IOException { - throw new IOException("Operation Unsupported"); +struct DCHolder +{ + HDC m_hMemoryDC; + int m_iWidth; + int m_iHeight; + BOOL m_bForImage; + HBITMAP m_hBitmap; + HBITMAP m_hOldBitmap; + void *m_pPoints; + + DCHolder(); + ~DCHolder(); + + void Create( + HDC hRelDC, + int iWidth, + int iHeght, + BOOL bForImage); + + operator HDC() + { + if (NULL == m_hOldBitmap && NULL != m_hBitmap) { + m_hOldBitmap = (HBITMAP)::SelectObject(m_hMemoryDC, m_hBitmap); + } + return m_hMemoryDC; } - @Override - @SuppressWarnings("unused") - long readv(FileDescriptor fd, long address, int len) throws IOException { - throw new IOException("Operation Unsupported"); + operator HBITMAP() + { + if (NULL != m_hOldBitmap) { + m_hBitmap = (HBITMAP)::SelectObject(m_hMemoryDC, m_hOldBitmap); + m_hOldBitmap = NULL; + } + return m_hBitmap; } - @Override - @SuppressWarnings("unused") - int write(FileDescriptor fd, long address, int len) throws IOException { - throw new IOException("Operation Unsupported"); - } + static HBITMAP CreateJavaContextBitmap( + HDC hdc, + int iWidth, + int iHeight, + void **ppPoints); +}; - @Override - @SuppressWarnings("unused") - long writev(FileDescriptor fd, long address, int len) throws IOException { - throw new IOException("Operation Unsupported"); - } - - @Override - void close(FileDescriptor fd) throws IOException { - FileDispatcherImpl.close0(fd); - } - - @Override - void preClose(FileDescriptor fd) throws IOException { - FileDispatcherImpl.preClose0(fd); - } -} +#endif //_AWT_DCHolder_H diff --git a/jdk/src/windows/native/sun/windows/awt_Dialog.cpp b/jdk/src/windows/native/sun/windows/awt_Dialog.cpp index c0637237da4..4d21489d2eb 100644 --- a/jdk/src/windows/native/sun/windows/awt_Dialog.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Dialog.cpp @@ -760,7 +760,7 @@ extern "C" { * Signature: (Lsun/awt/windows/WComponentPeer;)V */ JNIEXPORT void JNICALL -Java_sun_awt_windows_WDialogPeer_create(JNIEnv *env, jobject self, +Java_sun_awt_windows_WDialogPeer_createAwtDialog(JNIEnv *env, jobject self, jobject parent) { TRY; diff --git a/jdk/src/windows/native/sun/windows/awt_DnDDS.cpp b/jdk/src/windows/native/sun/windows/awt_DnDDS.cpp index bb2ac566493..cfd3e97a2e1 100644 --- a/jdk/src/windows/native/sun/windows/awt_DnDDS.cpp +++ b/jdk/src/windows/native/sun/windows/awt_DnDDS.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,30 @@ * have any questions. */ -#include "awt.h" +#pragma push_macro("bad_alloc") +//"bad_alloc" would be introduced in STL as "std::zbad_alloc" and discarded by linker +//by this action we avoid the conflict with AWT implementation of "bad_alloc" +//we need inclusion for STL "new" oprators set. +#define bad_alloc zbad_alloc +#include +#pragma pop_macro("bad_alloc") +//"bad_alloc" is undefined from here + +//we need to include any STL container before inclusion due to +//"new" re-redefinition that is in conflict with in-place new allocator +//applied in STL. +#if defined(_DEBUG) || defined(DEBUG) + //forward declaration of "new" operator from + extern void * operator new(size_t size, const char * filename, int linenumber); + //"new" operator definition that is consistent with re-defined + //in "delete" operator + void * operator new(size_t size) {return operator new(size, "stl", 1);} +#endif +#include + +#include +#include + #include "jlong.h" #include "awt_DataTransferer.h" #include "awt_DnDDS.h" @@ -37,8 +60,14 @@ #include "sun_awt_dnd_SunDragSourceContextPeer.h" #include "sun_awt_windows_WDragSourceContextPeer.h" -#include -#include +#include "awt_ole.h" +#include "awt_DCHolder.h" + +bool operator < (const FORMATETC &fr, const FORMATETC &fl) { + return memcmp(&fr, &fl, sizeof(FORMATETC)) < 0; +} + +typedef std::map CDataMap; #define GALLOCFLG (GMEM_DDESHARE | GMEM_MOVEABLE | GMEM_ZEROINIT) #define JAVA_BUTTON_MASK (java_awt_event_InputEvent_BUTTON1_DOWN_MASK | \ @@ -50,19 +79,155 @@ DWORD __cdecl convertActionsToDROPEFFECT(jint actions); jint __cdecl convertDROPEFFECTToActions(DWORD effects); } +class PictureDragHelper +{ +private: + static CDataMap st; + static IDragSourceHelper *pHelper; +public: + static HRESULT Create( + JNIEnv* env, + jintArray imageData, + int imageWidth, + int imageHeight, + int anchorX, + int anchorY, + IDataObject *pIDataObject) + { + if (NULL == imageData) { + return S_FALSE; + } + OLE_TRY + OLE_HRT( CoCreateInstance( + CLSID_DragDropHelper, + NULL, + CLSCTX_ALL, + IID_IDragSourceHelper, + (LPVOID*)&pHelper)) + + jintArray ia = imageData; + jsize iPointCoint = env->GetArrayLength(ia); + + DCHolder ph; + ph.Create(NULL, imageWidth, imageHeight, TRUE); + env->GetIntArrayRegion(ia, 0, iPointCoint, (jint*)ph.m_pPoints); + + SHDRAGIMAGE sdi; + sdi.sizeDragImage.cx = imageWidth; + sdi.sizeDragImage.cy = imageHeight; + sdi.ptOffset.x = anchorX; + sdi.ptOffset.y = anchorY; + sdi.crColorKey = 0xFFFFFFFF; + sdi.hbmpDragImage = ph; + + // this call assures that the bitmap will be dragged around + OLE_HR = pHelper->InitializeFromBitmap( + &sdi, + pIDataObject + ); + // in case of an error we need to destroy the image, else the helper object takes ownership + if (FAILED(OLE_HR)) { + DeleteObject(sdi.hbmpDragImage); + } + OLE_CATCH + OLE_RETURN_HR + } + + static void Destroy() + { + if (NULL!=pHelper) { + CleanFormatMap(); + pHelper->Release(); + pHelper = NULL; + } + } + + static void CleanFormatMap() + { + for (CDataMap::iterator i = st.begin(); st.end() != i; i = st.erase(i)) { + ::ReleaseStgMedium(&i->second); + } + } + static void SetData(const FORMATETC &format, const STGMEDIUM &medium) + { + CDataMap::iterator i = st.find(format); + if (st.end() != i) { + ::ReleaseStgMedium(&i->second); + i->second = medium; + } else { + st[format] = medium; + } + } + static const FORMATETC *FindFormat(const FORMATETC &format) + { + static FORMATETC fm = {0}; + CDataMap::iterator i = st.find(format); + if (st.end() != i) { + return &i->first; + } + for (i = st.begin(); st.end() != i; ++i) { + if (i->first.cfFormat==format.cfFormat) { + return &i->first; + } + } + return NULL; + } + static STGMEDIUM *FindData(const FORMATETC &format) + { + CDataMap::iterator i = st.find(format); + if (st.end() != i) { + return &i->second; + } + for (i = st.begin(); st.end() != i; ++i) { + const FORMATETC &f = i->first; + if (f.cfFormat==format.cfFormat && (f.tymed == (f.tymed & format.tymed))) { + return &i->second; + } + } + return NULL; + } +}; + + +CDataMap PictureDragHelper::st; +IDragSourceHelper *PictureDragHelper::pHelper = NULL; + +extern const CLIPFORMAT CF_PERFORMEDDROPEFFECT = ::RegisterClipboardFormat(CFSTR_PERFORMEDDROPEFFECT); +extern const CLIPFORMAT CF_FILEGROUPDESCRIPTORW = ::RegisterClipboardFormat(CFSTR_FILEDESCRIPTORW); +extern const CLIPFORMAT CF_FILEGROUPDESCRIPTORA = ::RegisterClipboardFormat(CFSTR_FILEDESCRIPTORA); +extern const CLIPFORMAT CF_FILECONTENTS = ::RegisterClipboardFormat(CFSTR_FILECONTENTS); + typedef struct { AwtDragSource* dragSource; jobject cursor; + jintArray imageData; + jint imageWidth; + jint imageHeight; + jint x; + jint y; } StartDragRec; /** * StartDrag */ -void AwtDragSource::StartDrag(AwtDragSource* self, jobject cursor) { +void AwtDragSource::StartDrag( + AwtDragSource* self, + jobject cursor, + jintArray imageData, + jint imageWidth, + jint imageHeight, + jint x, + jint y) +{ StartDragRec* sdrp = new StartDragRec; sdrp->dragSource = self; + sdrp->imageData = imageData; sdrp->cursor = cursor; + sdrp->imageWidth = imageWidth; + sdrp->imageHeight = imageHeight; + sdrp->x = x; + sdrp->y = y; AwtToolkit::GetInstance().WaitForSingleObject(self->m_mutex); @@ -82,6 +247,17 @@ void AwtDragSource::_DoDragDrop(void* param) { JNIEnv* env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); jobject peer = env->NewLocalRef(dragSource->GetPeer()); + if (sdrp->imageData) { + PictureDragHelper::Create( + env, + sdrp->imageData, + sdrp->imageWidth, + sdrp->imageHeight, + sdrp->x, + sdrp->y, + (IDataObject*)dragSource); + env->DeleteGlobalRef(sdrp->imageData); + } dragSource->SetCursor(sdrp->cursor); env->DeleteGlobalRef(sdrp->cursor); delete sdrp; @@ -116,6 +292,7 @@ void AwtDragSource::_DoDragDrop(void* param) { DASSERT(AwtDropTarget::IsCurrentDnDDataObject(dragSource)); AwtDropTarget::SetCurrentDnDDataObject(NULL); + PictureDragHelper::Destroy(); dragSource->Release(); } @@ -268,7 +445,10 @@ void AwtDragSource::LoadCache(jlongArray formats) { idx++; // now make a copy, but with a TYMED of HGLOBAL - memcpy(m_types + idx, m_types + idx - 1, sizeof(FORMATETC)); + m_types[idx] = m_types[idx-1]; + m_types[idx].tymed = TYMED_HGLOBAL; + idx++; + break; case CF_HDROP: m_types[idx].tymed = TYMED_HGLOBAL; idx++; @@ -348,6 +528,14 @@ AwtDragSource::MatchFormatEtc(FORMATETC __RPC_FAR *pFormatEtcIn, FORMATETC *cacheEnt) { TRY; + const FORMATETC *pFormat = PictureDragHelper::FindFormat(*pFormatEtcIn); + if (NULL != pFormat) { + if (NULL != cacheEnt) { + *cacheEnt = *pFormat; + } + return S_OK; + } + if ((pFormatEtcIn->tymed & (TYMED_HGLOBAL | TYMED_ISTREAM | TYMED_ENHMF | TYMED_MFPICT)) == 0) { return DV_E_TYMED; @@ -357,8 +545,7 @@ AwtDragSource::MatchFormatEtc(FORMATETC __RPC_FAR *pFormatEtcIn, return DV_E_DVASPECT; } - FORMATETC tmp; - memcpy(&tmp, pFormatEtcIn, sizeof(FORMATETC)); + FORMATETC tmp = *pFormatEtcIn; static const DWORD supportedTymeds[] = { TYMED_ISTREAM, TYMED_HGLOBAL, TYMED_ENHMF, TYMED_MFPICT }; @@ -367,22 +554,22 @@ AwtDragSource::MatchFormatEtc(FORMATETC __RPC_FAR *pFormatEtcIn, for (int i = 0; i < nSupportedTymeds; i++) { /* * Fix for BugTraq Id 4426805. - * Match only if the tymed is supported by the requestor. + * Match only if the tymed is supported by the requester. */ if ((pFormatEtcIn->tymed & supportedTymeds[i]) == 0) { continue; } tmp.tymed = supportedTymeds[i]; - FORMATETC *cp = (FORMATETC *)bsearch((const void *)&tmp, + pFormat = (const FORMATETC *)bsearch((const void *)&tmp, (const void *)m_types, (size_t) m_ntypes, (size_t) sizeof(FORMATETC), _compar ); - if (cp != (FORMATETC *)NULL) { + if (NULL != pFormat) { if (cacheEnt != (FORMATETC *)NULL) { - memcpy(cacheEnt, cp, sizeof(FORMATETC)); + *cacheEnt = *pFormat; } return S_OK; } @@ -481,7 +668,7 @@ HRESULT __stdcall AwtDragSource::QueryContinueDrag(BOOL fEscapeKeyPressed, DWOR //CR 6480706 - MS Bug on hold HCURSOR hNeedCursor; - if( + if ( m_bRestoreNodropCustomCursor && m_cursor != NULL && (hNeedCursor = m_cursor->GetHCursor()) != ::GetCursor() ) @@ -579,6 +766,19 @@ HRESULT __stdcall AwtDragSource::GiveFeedback(DWORD dwEffect) { HRESULT __stdcall AwtDragSource::GetData(FORMATETC __RPC_FAR *pFormatEtc, STGMEDIUM __RPC_FAR *pmedium) { TRY; + STGMEDIUM *pPicMedia = PictureDragHelper::FindData(*pFormatEtc); + if (NULL != pPicMedia) { + *pmedium = *pPicMedia; + //return outside, so AddRef the instance of pstm or hGlobal! + if (pmedium->tymed == TYMED_ISTREAM) { + pmedium->pstm->AddRef(); + pmedium->pUnkForRelease = (IUnknown *)NULL; + } else if (pmedium->tymed == TYMED_HGLOBAL) { + AddRef(); + pmedium->pUnkForRelease = (IDropSource *)this; + } + return S_OK; + } HRESULT res = GetProcessId(pFormatEtc, pmedium); if (res == S_OK) { @@ -648,7 +848,7 @@ HRESULT __stdcall AwtDragSource::GetData(FORMATETC __RPC_FAR *pFormatEtc, dropfiles->pt.x = m_dropPoint.x; dropfiles->pt.y = m_dropPoint.y; dropfiles->fNC = m_fNC; - dropfiles->fWide = FALSE; // good guess! + dropfiles->fWide = TRUE; // good guess! dataout += sizeof(DROPFILES); } @@ -815,7 +1015,7 @@ HRESULT __stdcall AwtDragSource::GetDataHere(FORMATETC __RPC_FAR *pFormatEtc, dropfiles->pt.x = m_dropPoint.x; dropfiles->pt.y = m_dropPoint.y; dropfiles->fNC = m_fNC; - dropfiles->fWide = FALSE; // good guess! + dropfiles->fWide = TRUE; // good guess! dataout += sizeof(DROPFILES); } @@ -870,8 +1070,6 @@ HRESULT __stdcall AwtDragSource::GetCanonicalFormatEtc(FORMATETC __RPC_FAR *pFo */ HRESULT __stdcall AwtDragSource::SetData(FORMATETC __RPC_FAR *pFormatEtc, STGMEDIUM __RPC_FAR *pmedium, BOOL fRelease) { - static CLIPFORMAT CF_PERFORMEDDROPEFFECT = ::RegisterClipboardFormat(CFSTR_PERFORMEDDROPEFFECT); - if (pFormatEtc->cfFormat == CF_PERFORMEDDROPEFFECT && pmedium->tymed == TYMED_HGLOBAL) { m_dwPerformedDropEffect = *(DWORD*)::GlobalLock(pmedium->hGlobal); ::GlobalUnlock(pmedium->hGlobal); @@ -880,6 +1078,12 @@ HRESULT __stdcall AwtDragSource::SetData(FORMATETC __RPC_FAR *pFormatEtc, STGMED } return S_OK; } + + if (fRelease) { + //we are copying pmedium as a structure for further use, so no any release! + PictureDragHelper::SetData(*pFormatEtc, *pmedium); + return S_OK; + } return E_UNEXPECTED; } @@ -1538,12 +1742,28 @@ Java_sun_awt_windows_WDragSourceContextPeer_createDragSource( * doDragDrop */ -JNIEXPORT void JNICALL Java_sun_awt_windows_WDragSourceContextPeer_doDragDrop(JNIEnv* env, jobject self, jlong nativeCtxt, jobject cursor) { +JNIEXPORT void JNICALL Java_sun_awt_windows_WDragSourceContextPeer_doDragDrop( + JNIEnv* env, + jobject self, + jlong nativeCtxt, + jobject cursor, + jintArray imageData, + jint imageWidth, jint imageHeight, + jint x, jint y) +{ TRY; cursor = env->NewGlobalRef(cursor); + if (NULL != imageData) { + imageData = (jintArray)env->NewGlobalRef(imageData); + } - AwtDragSource::StartDrag((AwtDragSource*)nativeCtxt, cursor); + AwtDragSource::StartDrag( + (AwtDragSource*)nativeCtxt, + cursor, + imageData, + imageWidth, imageHeight, + x, y); CATCH_BAD_ALLOC; } diff --git a/jdk/src/windows/native/sun/windows/awt_DnDDS.h b/jdk/src/windows/native/sun/windows/awt_DnDDS.h index 305683a3647..0c32ae966c9 100644 --- a/jdk/src/windows/native/sun/windows/awt_DnDDS.h +++ b/jdk/src/windows/native/sun/windows/awt_DnDDS.h @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -84,7 +84,14 @@ class AwtDragSource : virtual public IDropSource, virtual public IDataObject { // AwtDragSource - static void StartDrag(AwtDragSource* self, jobject cursor); + static void StartDrag( + AwtDragSource* self, + jobject cursor, + jintArray imageData, + jint imageWidth, + jint imageHeight, + jint x, + jint y); HRESULT ChangeCursor(); void SetCursor(jobject cursor); @@ -268,4 +275,9 @@ class AwtDragSource : virtual public IDropSource, virtual public IDataObject { static jfieldID awtIEmods; }; +extern const CLIPFORMAT CF_PERFORMEDDROPEFFECT; +extern const CLIPFORMAT CF_FILEGROUPDESCRIPTORA; +extern const CLIPFORMAT CF_FILEGROUPDESCRIPTORW; +extern const CLIPFORMAT CF_FILECONTENTS; + #endif /* AWT_DND_DS_H */ diff --git a/jdk/src/windows/native/sun/windows/awt_DnDDT.cpp b/jdk/src/windows/native/sun/windows/awt_DnDDT.cpp index fce80f468b2..76c4499646b 100644 --- a/jdk/src/windows/native/sun/windows/awt_DnDDT.cpp +++ b/jdk/src/windows/native/sun/windows/awt_DnDDT.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,24 +24,27 @@ */ #include "awt.h" +#include +#include +#include + #include "awt_DataTransferer.h" -#include "awt_DnDDT.h" -#include "awt_DnDDS.h" #include "awt_Toolkit.h" #include "java_awt_dnd_DnDConstants.h" #include "sun_awt_windows_WDropTargetContextPeer.h" #include "awt_Container.h" +#include "alloc.h" +#include "awt_ole.h" +#include "awt_DnDDT.h" +#include "awt_DnDDS.h" -#include -#include // forwards extern "C" { -DWORD __cdecl convertActionsToDROPEFFECT(jint actions); -jint __cdecl convertDROPEFFECTToActions(DWORD effects); - -DWORD __cdecl mapModsToDROPEFFECT(DWORD, DWORD); + DWORD __cdecl convertActionsToDROPEFFECT(jint actions); + jint __cdecl convertDROPEFFECTToActions(DWORD effects); + DWORD __cdecl mapModsToDROPEFFECT(DWORD, DWORD); } // extern "C" @@ -64,6 +67,7 @@ AwtDropTarget::AwtDropTarget(JNIEnv* env, AwtComponent* component) { m_dtcp = NULL; m_cfFormats = NULL; m_mutex = ::CreateMutex(NULL, FALSE, NULL); + m_pIDropTargetHelper = NULL; } /** @@ -129,6 +133,13 @@ ULONG __stdcall AwtDropTarget::Release() { HRESULT __stdcall AwtDropTarget::DragEnter(IDataObject __RPC_FAR *pDataObj, DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect) { TRY; + if (NULL != m_pIDropTargetHelper) { + m_pIDropTargetHelper->DragEnter( + m_window, + pDataObj, + (LPPOINT)&pt, + *pdwEffect); + } AwtInterfaceLocker _lk(this); @@ -200,6 +211,12 @@ HRESULT __stdcall AwtDropTarget::DragEnter(IDataObject __RPC_FAR *pDataObj, DWOR HRESULT __stdcall AwtDropTarget::DragOver(DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect) { TRY; + if (NULL != m_pIDropTargetHelper) { + m_pIDropTargetHelper->DragOver( + (LPPOINT)&pt, + *pdwEffect + ); + } AwtInterfaceLocker _lk(this); @@ -250,6 +267,9 @@ HRESULT __stdcall AwtDropTarget::DragOver(DWORD grfKeyState, POINTL pt, DWORD __ HRESULT __stdcall AwtDropTarget::DragLeave() { TRY_NO_VERIFY; + if (NULL != m_pIDropTargetHelper) { + m_pIDropTargetHelper->DragLeave(); + } AwtInterfaceLocker _lk(this); @@ -288,7 +308,13 @@ HRESULT __stdcall AwtDropTarget::DragLeave() { HRESULT __stdcall AwtDropTarget::Drop(IDataObject __RPC_FAR *pDataObj, DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect) { TRY; - + if (NULL != m_pIDropTargetHelper) { + m_pIDropTargetHelper->Drop( + pDataObj, + (LPPOINT)&pt, + *pdwEffect + ); + } AwtInterfaceLocker _lk(this); JNIEnv* env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); @@ -410,9 +436,22 @@ void AwtDropTarget::RegisterTarget(WORD show) { // if we are'nt yet visible, defer until the parent is! if (show) { - res = ::RegisterDragDrop(m_window, (IDropTarget*)this); + OLE_TRY + OLE_HRT(CoCreateInstance( + CLSID_DragDropHelper, + NULL, + CLSCTX_ALL, + IID_IDropTargetHelper, + (LPVOID*)&m_pIDropTargetHelper + )) + OLE_HRT(::RegisterDragDrop(m_window, (IDropTarget*)this)) + OLE_CATCH + res = OLE_HR; } else { res = ::RevokeDragDrop(m_window); + if (NULL != m_pIDropTargetHelper) { + m_pIDropTargetHelper->Release(); + } } if (res == S_OK) m_registered = show; @@ -454,303 +493,489 @@ void AwtDropTarget::_GetData(void* param) { * Returns the data object being transferred. */ -jobject AwtDropTarget::GetData(jlong fmt) { - JNIEnv* env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); - if (env->EnsureLocalCapacity(1) < 0) { - return (jobject)NULL; - } - +HRESULT AwtDropTarget::ExtractNativeData( + jlong fmt, + LONG lIndex, + STGMEDIUM *pmedium) +{ FORMATETC format = { (unsigned short)fmt }; - STGMEDIUM stgmedium; - HRESULT hResult = E_FAIL; + HRESULT hr = E_INVALIDARG; - static const DWORD supportedTymeds[] = { TYMED_ISTREAM, TYMED_ENHMF, - TYMED_GDI, TYMED_MFPICT, - TYMED_FILE, TYMED_HGLOBAL }; - static const int nSupportedTymeds = 6; - - for (int i = 0; i < nSupportedTymeds; i++) { + static const DWORD supportedTymeds[] = { + TYMED_ISTREAM, + TYMED_ENHMF, + TYMED_GDI, + TYMED_MFPICT, + TYMED_FILE, + TYMED_HGLOBAL + }; + for (int i = 0; i < sizeof(supportedTymeds)/sizeof(supportedTymeds[0]); ++i) { // Only TYMED_HGLOBAL is supported for CF_LOCALE. if (fmt == CF_LOCALE && supportedTymeds[i] != TYMED_HGLOBAL) { continue; } format.tymed = supportedTymeds[i]; + FORMATETC *cpp = (FORMATETC *)bsearch( + (const void *)&format, + (const void *)m_formats, + (size_t)m_nformats, + (size_t)sizeof(FORMATETC), + _compar); - FORMATETC *cpp = (FORMATETC *)bsearch((const void *)&format, - (const void *)m_formats, - (size_t) m_nformats, - (size_t) sizeof(FORMATETC), - _compar - ); - - if (cpp == (FORMATETC *)NULL) { + if (NULL == cpp) { continue; } - memcpy(&format, cpp, sizeof(FORMATETC)); + format = *cpp; + format.lindex = lIndex; - hResult = m_dataObject->GetData(&format, &stgmedium); - - if (hResult == S_OK) { - break; + hr = m_dataObject->GetData(&format, pmedium); + if (SUCCEEDED(hr)) { + return hr; } } + return hr; +} - // Failed to retrieve data. - if (hResult != S_OK) { - return (jobject)NULL; +HRESULT CheckRetValue( + JNIEnv* env, + jobject ret) +{ + if (!JNU_IsNull(env, safe_ExceptionOccurred(env))) { + return E_UNEXPECTED; + } else if (JNU_IsNull(env, ret)) { + return E_INVALIDARG; } + return S_OK; +} +jobject AwtDropTarget::ConvertNativeData(JNIEnv* env, jlong fmt, STGMEDIUM *pmedium) /*throw std::bad_alloc */ +{ jobject ret = NULL; jbyteArray paletteDataLocal = NULL; - - switch (stgmedium.tymed) { + HRESULT hr = S_OK; + switch (pmedium->tymed) { case TYMED_HGLOBAL: { if (fmt == CF_LOCALE) { - LCID *lcid = (LCID *)::GlobalLock(stgmedium.hGlobal); - if (lcid == NULL) { - ::ReleaseStgMedium(&stgmedium); - return NULL; + LCID *lcid = (LCID *)::GlobalLock(pmedium->hGlobal); + if (NULL == lcid) { + hr = E_INVALIDARG; + } else { + try{ + ret = AwtDataTransferer::LCIDToTextEncoding(env, *lcid); + hr = CheckRetValue(env, ret); + } catch (std::bad_alloc&) { + hr = E_OUTOFMEMORY; + } + ::GlobalUnlock(pmedium->hGlobal); } - try { - ret = AwtDataTransferer::LCIDToTextEncoding(env, *lcid); - } catch (...) { - ::GlobalUnlock(stgmedium.hGlobal); - ::ReleaseStgMedium(&stgmedium); - throw; - } - ::GlobalUnlock(stgmedium.hGlobal); - ::ReleaseStgMedium(&stgmedium); } else { ::SetLastError(0); // clear error // Warning C4244. // Cast SIZE_T (__int64 on 64-bit/unsigned int on 32-bit) // to jsize (long). - SIZE_T globalSize = ::GlobalSize(stgmedium.hGlobal); + SIZE_T globalSize = ::GlobalSize(pmedium->hGlobal); jsize size = (globalSize <= INT_MAX) ? (jsize)globalSize : INT_MAX; if (size == 0 && ::GetLastError() != 0) { - ::SetLastError(0); // clear error - ::ReleaseStgMedium(&stgmedium); - return (jobject)NULL; // failed + hr = E_INVALIDARG; + } else { + jbyteArray bytes = env->NewByteArray(size); + if (NULL == bytes) { + hr = E_OUTOFMEMORY; + } else { + LPVOID data = ::GlobalLock(pmedium->hGlobal); + if (NULL == data) { + hr = E_INVALIDARG; + } else { + env->SetByteArrayRegion(bytes, 0, size, (jbyte *)data); + ret = bytes; + //bytes is not null here => no CheckRetValue call + ::GlobalUnlock(pmedium->hGlobal); + } + } } - - jbyteArray bytes = env->NewByteArray(size); - if (bytes == NULL) { - ::ReleaseStgMedium(&stgmedium); - throw std::bad_alloc(); - } - - LPVOID data = ::GlobalLock(stgmedium.hGlobal); - env->SetByteArrayRegion(bytes, 0, size, (jbyte *)data); - ::GlobalUnlock(stgmedium.hGlobal); - ::ReleaseStgMedium(&stgmedium); - - ret = bytes; } break; } case TYMED_FILE: { - jobject local = JNU_NewStringPlatform(env, stgmedium.lpszFileName); + jobject local = JNU_NewStringPlatform( + env, + pmedium->lpszFileName); jstring fileName = (jstring)env->NewGlobalRef(local); env->DeleteLocalRef(local); STGMEDIUM *stgm = NULL; try { + //on success stgm would be deallocated by JAVA call freeStgMedium stgm = (STGMEDIUM *)safe_Malloc(sizeof(STGMEDIUM)); + memcpy(stgm, pmedium, sizeof(STGMEDIUM)); + // Warning C4311. + // Cast pointer to jlong (__int64). + ret = call_dTCgetfs(env, fileName, (jlong)stgm); + hr = CheckRetValue(env, ret); } catch (std::bad_alloc&) { - env->DeleteGlobalRef(fileName); - ::ReleaseStgMedium(&stgmedium); - throw; + hr = E_OUTOFMEMORY; } - memcpy(stgm, &stgmedium, sizeof(STGMEDIUM)); - - // Warning C4311. - // Cast pointer to jlong (__int64). - ret = call_dTCgetfs(env, fileName, (jlong)stgm); - try { - if (JNU_IsNull(env, ret) || - !JNU_IsNull(env, safe_ExceptionOccurred(env))) { - env->DeleteGlobalRef(fileName); - free((void*)stgm); - ::ReleaseStgMedium(&stgmedium); - return (jobject)NULL; - } - } catch (std::bad_alloc&) { + if (FAILED(hr)) { + //free just on error env->DeleteGlobalRef(fileName); - free((void*)stgm); - ::ReleaseStgMedium(&stgmedium); - throw; + free(stgm); } break; } - case TYMED_ISTREAM: { - WDTCPIStreamWrapper* istream = new WDTCPIStreamWrapper(&stgmedium); - - // Warning C4311. - // Cast pointer to jlong (__int64). - ret = call_dTCgetis(env, (jlong)istream); - try { - if (JNU_IsNull(env, ret) || - !JNU_IsNull(env, safe_ExceptionOccurred(env))) { - istream->Close(); - return (jobject)NULL; - } - } catch (std::bad_alloc&) { - istream->Close(); - throw; - } - break; + WDTCPIStreamWrapper* istream = NULL; + try { + istream = new WDTCPIStreamWrapper(pmedium); + // Warning C4311. + // Cast pointer to jlong (__int64). + ret = call_dTCgetis(env, (jlong)istream); + hr = CheckRetValue(env, ret); + } catch (std::bad_alloc&) { + hr = E_OUTOFMEMORY; + } + if (FAILED(hr) && NULL!=istream) { + //free just on error + istream->Close(); + } + break; } - case TYMED_GDI: // Currently support only CF_PALETTE for TYMED_GDI. - switch (fmt) { - case CF_PALETTE: { - ret = AwtDataTransferer::GetPaletteBytes(stgmedium.hBitmap, - 0, TRUE); - break; + if (CF_PALETTE == fmt) { + ret = AwtDataTransferer::GetPaletteBytes( + pmedium->hBitmap, + 0, + TRUE); + hr = CheckRetValue(env, ret); } - } - ::ReleaseStgMedium(&stgmedium); break; case TYMED_MFPICT: case TYMED_ENHMF: { HENHMETAFILE hEnhMetaFile = NULL; - LPBYTE lpEmfBits = NULL; - - if (stgmedium.tymed == TYMED_MFPICT) { + if (pmedium->tymed == TYMED_MFPICT ) { + //let's create ENHMF from MFPICT to simplify treatment LPMETAFILEPICT lpMetaFilePict = - (LPMETAFILEPICT)::GlobalLock(stgmedium.hMetaFilePict); - UINT uSize = ::GetMetaFileBitsEx(lpMetaFilePict->hMF, 0, NULL); - DASSERT(uSize != 0); - - try { - LPBYTE lpMfBits = (LPBYTE)safe_Malloc(uSize); - VERIFY(::GetMetaFileBitsEx(lpMetaFilePict->hMF, uSize, - lpMfBits) == uSize); - hEnhMetaFile = ::SetWinMetaFileBits(uSize, - lpMfBits, - NULL, - lpMetaFilePict); - free(lpMfBits); - } catch (...) { - ::GlobalUnlock(stgmedium.hMetaFilePict); - throw; + (LPMETAFILEPICT)::GlobalLock(pmedium->hMetaFilePict); + if (NULL == lpMetaFilePict) { + hr = E_INVALIDARG; + } else { + UINT uSize = ::GetMetaFileBitsEx(lpMetaFilePict->hMF, 0, NULL); + if (0 == uSize) { + hr = E_INVALIDARG; + } else { + try{ + LPBYTE lpMfBits = (LPBYTE)safe_Malloc(uSize); + VERIFY(::GetMetaFileBitsEx( + lpMetaFilePict->hMF, + uSize, + lpMfBits) == uSize); + hEnhMetaFile = ::SetWinMetaFileBits( + uSize, + lpMfBits, + NULL, + lpMetaFilePict); + free(lpMfBits); + } catch (std::bad_alloc&) { + hr = E_OUTOFMEMORY; + } + } + ::GlobalUnlock(pmedium->hMetaFilePict); } - ::GlobalUnlock(stgmedium.hMetaFilePict); } else { - hEnhMetaFile = stgmedium.hEnhMetaFile; + hEnhMetaFile = pmedium->hEnhMetaFile; } - try { - paletteDataLocal = - AwtDataTransferer::GetPaletteBytes(hEnhMetaFile, - OBJ_ENHMETAFILE, - FALSE); + if (NULL == hEnhMetaFile) { + hr = E_INVALIDARG; + } else { + try { + paletteDataLocal = AwtDataTransferer::GetPaletteBytes( + hEnhMetaFile, + OBJ_ENHMETAFILE, + FALSE); + //paletteDataLocal can be NULL here - it is not a error! - UINT uEmfSize = ::GetEnhMetaFileBits(hEnhMetaFile, 0, NULL); - DASSERT(uEmfSize != 0); + UINT uEmfSize = ::GetEnhMetaFileBits(hEnhMetaFile, 0, NULL); + DASSERT(uEmfSize != 0); - lpEmfBits = (LPBYTE)safe_Malloc(uEmfSize); - VERIFY(::GetEnhMetaFileBits(hEnhMetaFile, uEmfSize, - lpEmfBits) == uEmfSize); + LPBYTE lpEmfBits = (LPBYTE)safe_Malloc(uEmfSize); + //no chance to throw exception before catch => no more try-blocks + //and no leaks on lpEmfBits - if (stgmedium.tymed == TYMED_MFPICT) { - ::DeleteEnhMetaFile(hEnhMetaFile); - } else { - ::ReleaseStgMedium(&stgmedium); - } - hEnhMetaFile = NULL; + VERIFY(::GetEnhMetaFileBits( + hEnhMetaFile, + uEmfSize, + lpEmfBits) == uEmfSize); - jbyteArray bytes = env->NewByteArray(uEmfSize); - if (bytes == NULL) { - throw std::bad_alloc(); - } - - env->SetByteArrayRegion(bytes, 0, uEmfSize, (jbyte*)lpEmfBits); - free(lpEmfBits); - lpEmfBits = NULL; - - ret = bytes; - } catch (...) { - if (!JNU_IsNull(env, paletteDataLocal)) { - env->DeleteLocalRef(paletteDataLocal); - paletteDataLocal = NULL; - } - if (hEnhMetaFile != NULL) { - if (stgmedium.tymed == TYMED_MFPICT) { - ::DeleteEnhMetaFile(hEnhMetaFile); + jbyteArray bytes = env->NewByteArray(uEmfSize); + if (NULL == bytes) { + hr = E_OUTOFMEMORY; } else { - ::ReleaseStgMedium(&stgmedium); + env->SetByteArrayRegion(bytes, 0, uEmfSize, (jbyte*)lpEmfBits); + ret = bytes; + //bytes is not null here => no CheckRetValue call } - hEnhMetaFile = NULL; - } - if (lpEmfBits != NULL) { free(lpEmfBits); - lpEmfBits = NULL; + } catch (std::bad_alloc&) { + hr = E_OUTOFMEMORY; + } + if (pmedium->tymed == TYMED_MFPICT) { + //because we create it manually + ::DeleteEnhMetaFile(hEnhMetaFile); } - throw; } break; } case TYMED_ISTORAGE: default: - ::ReleaseStgMedium(&stgmedium); - return (jobject)NULL; + hr = E_NOTIMPL; + break; } - if (ret == NULL) { - return (jobject)NULL; + if (FAILED(hr)) { + //clear exception garbage for hr = E_UNEXPECTED + ret = NULL; + } else { + switch (fmt) { + case CF_METAFILEPICT: + case CF_ENHMETAFILE: + // If we failed to retrieve palette entries from metafile, + // fall through and try CF_PALETTE format. + case CF_DIB: { + if (JNU_IsNull(env, paletteDataLocal)) { + jobject paletteData = GetData(CF_PALETTE); + + if (JNU_IsNull(env, paletteData)) { + paletteDataLocal = + AwtDataTransferer::GetPaletteBytes(NULL, 0, TRUE); + } else { + // GetData() returns a global ref. + // We want to deal with local ref. + paletteDataLocal = (jbyteArray)env->NewLocalRef(paletteData); + env->DeleteGlobalRef(paletteData); + } + } + DASSERT(!JNU_IsNull(env, paletteDataLocal) && + !JNU_IsNull(env, ret)); + + jobject concat = AwtDataTransferer::ConcatData(env, paletteDataLocal, ret); + env->DeleteLocalRef(ret); + ret = concat; + hr = CheckRetValue(env, ret); + break; + } + } } - switch (fmt) { - case CF_METAFILEPICT: - case CF_ENHMETAFILE: - // If we failed to retrieve palette entries from metafile, - // fall through and try CF_PALETTE format. - case CF_DIB: { - if (JNU_IsNull(env, paletteDataLocal)) { - jobject paletteData = GetData(CF_PALETTE); + if (!JNU_IsNull(env, paletteDataLocal) ) { + env->DeleteLocalRef(paletteDataLocal); + } + jobject global = NULL; + if (SUCCEEDED(hr)) { + global = env->NewGlobalRef(ret); + env->DeleteLocalRef(ret); + } else if (E_UNEXPECTED == hr) { + //internal Java non-GPF exception + env->ExceptionDescribe(); + env->ExceptionClear(); + } else if (E_OUTOFMEMORY == hr) { + throw std::bad_alloc(); + } //NULL returns for all other cases + return global; +} - if (JNU_IsNull(env, paletteData)) { - paletteDataLocal = - AwtDataTransferer::GetPaletteBytes(NULL, 0, TRUE); - } else { - // GetData() returns a global ref. - // We want to deal with local ref. - paletteDataLocal = (jbyteArray)env->NewLocalRef(paletteData); - env->DeleteGlobalRef(paletteData); +HRESULT AwtDropTarget::SaveIndexToFile(LPCTSTR pFileName, UINT lIndex) +{ + OLE_TRY + STGMEDIUM stgmedium; + OLE_HRT( ExtractNativeData(CF_FILECONTENTS, lIndex, &stgmedium) ); + OLE_NEXT_TRY + IStreamPtr spSrc; + if (TYMED_HGLOBAL == stgmedium.tymed) { + OLE_HRT( CreateStreamOnHGlobal( + stgmedium.hGlobal, + FALSE, + &spSrc + )); + } else if(TYMED_ISTREAM == stgmedium.tymed) { + spSrc = stgmedium.pstm; + } + if (NULL == spSrc) { + OLE_HRT(E_INVALIDARG); + } + IStreamPtr spDst; + OLE_HRT(SHCreateStreamOnFile( + pFileName, + STGM_WRITE | STGM_CREATE, + &spDst + )); + STATSTG si = {0}; + OLE_HRT( spSrc->Stat(&si, STATFLAG_NONAME ) ); + OLE_HRT( spSrc->CopyTo(spDst, si.cbSize, NULL, NULL) ); + OLE_CATCH + ::ReleaseStgMedium(&stgmedium); + OLE_CATCH + OLE_RETURN_HR; +} + + +HRESULT GetTempPathWithSlash(JNIEnv *env, _bstr_t &bsTempPath) /*throws _com_error*/ +{ + static _bstr_t _bsPath; + + OLE_TRY + if (0 == _bsPath.length()) { + BOOL bSafeEmergency = TRUE; + TCHAR szPath[MAX_PATH*2]; + JLClass systemCls(env, env->FindClass("java/lang/System")); + if (systemCls) { + jmethodID idGetProperty = env->GetStaticMethodID( + systemCls, + "getProperty", + "(Ljava/lang/String;)Ljava/lang/String;"); + if (0 != idGetProperty) { + static TCHAR param[] = _T("java.io.tmpdir"); + JLString tempdir(env, JNU_NewStringPlatform(env, param)); + if (tempdir) { + JLString jsTempPath(env, (jstring)env->CallStaticObjectMethod( + systemCls, + idGetProperty, + (jstring)tempdir + )); + if (jsTempPath) { + _bsPath = (LPCWSTR)JavaStringBuffer(env, jsTempPath); + OLE_HRT(SHGetFolderPath( + NULL, + CSIDL_WINDOWS, + NULL, + 0, + szPath)); + _tcscat(szPath, _T("\\")); + //Dead environment block leads to fact that windows folder becomes temporary path. + //For example while jtreg execution %TEMP%, %TMP% and etc. aren't defined. + bSafeEmergency = ( 0 == _tcsicmp(_bsPath, szPath) ); + } + } } } - DASSERT(!JNU_IsNull(env, paletteDataLocal) && - !JNU_IsNull(env, ret)); - - jobject concat = AwtDataTransferer::ConcatData(env, paletteDataLocal, ret); - - if (!JNU_IsNull(env, safe_ExceptionOccurred(env))) { - env->ExceptionDescribe(); - env->ExceptionClear(); - env->DeleteLocalRef(ret); - env->DeleteLocalRef(paletteDataLocal); - return (jobject)NULL; + if (bSafeEmergency) { + OLE_HRT(SHGetFolderPath( + NULL, + CSIDL_INTERNET_CACHE|CSIDL_FLAG_CREATE, + NULL, + 0, + szPath)); + _tcscat(szPath, _T("\\")); + _bsPath = szPath; } - - env->DeleteLocalRef(ret); - env->DeleteLocalRef(paletteDataLocal); - ret = concat; - - break; - } } + OLE_CATCH + bsTempPath = _bsPath; + OLE_RETURN_HR +} - jobject global = env->NewGlobalRef(ret); - env->DeleteLocalRef(ret); +jobject AwtDropTarget::ConvertMemoryMappedData(JNIEnv* env, jlong fmt, STGMEDIUM *pmedium) /*throw std::bad_alloc */ +{ + jobject retObj = NULL; + OLE_TRY + if (TYMED_HGLOBAL != pmedium->tymed) { + OLE_HRT(E_INVALIDARG); + } + FILEGROUPDESCRIPTORA *pfgdHead = (FILEGROUPDESCRIPTORA *)::GlobalLock(pmedium->hGlobal); + if (NULL == pfgdHead) { + OLE_HRT(E_INVALIDARG); + } + OLE_NEXT_TRY + if (0 == pfgdHead->cItems) { + OLE_HRT(E_INVALIDARG); + } + IStreamPtr spFileNames; + OLE_HRT( CreateStreamOnHGlobal( + NULL, + TRUE, + &spFileNames + )); + + _bstr_t sbTempDir; + OLE_HRT( GetTempPathWithSlash(env, sbTempDir) ); + FILEDESCRIPTORA *pfgdA = pfgdHead->fgd; + FILEDESCRIPTORW *pfgdW = (FILEDESCRIPTORW *)pfgdA; + for (UINT i = 0; i < pfgdHead->cItems; ++i) { + _bstr_t stFullName(sbTempDir); + if(CF_FILEGROUPDESCRIPTORA == fmt) { + stFullName += pfgdA->cFileName; //as CHAR + ++pfgdA; + } else { + stFullName += pfgdW->cFileName; //as WCHAR + ++pfgdW; + } + OLE_HRT(SaveIndexToFile( + stFullName, + i)); + //write to stream with zero terminator + OLE_HRT( spFileNames->Write((LPCTSTR)stFullName, (stFullName.length() + 1)*sizeof(TCHAR), NULL) ); + } + OLE_HRT( spFileNames->Write(_T(""), sizeof(TCHAR), NULL) ); + STATSTG st; + OLE_HRT( spFileNames->Stat(&st, STATFLAG_NONAME) ); + + //empty lists was forbidden: pfgdHead->cItems > 0 + jbyteArray bytes = env->NewByteArray(st.cbSize.LowPart); + if (NULL == bytes) { + OLE_HRT(E_OUTOFMEMORY); + } else { + HGLOBAL glob; + OLE_HRT(GetHGlobalFromStream(spFileNames, &glob)); + jbyte *pFileListWithDoubleZeroTerminator = (jbyte *)::GlobalLock(glob); + env->SetByteArrayRegion(bytes, 0, st.cbSize.LowPart, pFileListWithDoubleZeroTerminator); + ::GlobalUnlock(pFileListWithDoubleZeroTerminator); + retObj = bytes; + } + //std::bad_alloc could happen in JStringBuffer + //no leaks due to wrapper + OLE_CATCH_BAD_ALLOC + ::GlobalUnlock(pmedium->hGlobal); + OLE_CATCH + jobject global = NULL; + if (SUCCEEDED(OLE_HR)) { + global = env->NewGlobalRef(retObj); + env->DeleteLocalRef(retObj); + } else if (E_OUTOFMEMORY == OLE_HR) { + throw std::bad_alloc(); + } return global; } +jobject AwtDropTarget::GetData(jlong fmt) +{ + JNIEnv* env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); + if (env->EnsureLocalCapacity(1) < 0) { + return (jobject)NULL; + } + jobject ret = NULL; + OLE_TRY + STGMEDIUM stgmedium; + OLE_HRT( ExtractNativeData(fmt, -1, &stgmedium) ); + OLE_NEXT_TRY + if (CF_FILEGROUPDESCRIPTORA == fmt || + CF_FILEGROUPDESCRIPTORW == fmt) + { + ret = ConvertMemoryMappedData(env, fmt, &stgmedium); + } else { + ret = ConvertNativeData(env, fmt, &stgmedium); + } + OLE_CATCH_BAD_ALLOC + ::ReleaseStgMedium(&stgmedium); + OLE_CATCH + if (E_OUTOFMEMORY == OLE_HR) { + throw std::bad_alloc(); + } + return ret; +} + /** * */ @@ -791,14 +1016,14 @@ void AwtDropTarget::LoadCache(IDataObject* pDataObj) { ULONG actual = 1; res = pEnumFormatEtc->Next((ULONG)1, &tmp, &actual); - - if (res == S_FALSE) break; + if (res == S_FALSE) + break; if (!(tmp.cfFormat >= 1 && tmp.ptd == NULL && - tmp.lindex == -1 && + (tmp.lindex == -1 || CF_FILECONTENTS==tmp.cfFormat) && tmp.dwAspect == DVASPECT_CONTENT && - (tmp.tymed == TYMED_HGLOBAL || + ( tmp.tymed == TYMED_HGLOBAL || tmp.tymed == TYMED_FILE || tmp.tymed == TYMED_ISTREAM || tmp.tymed == TYMED_GDI || @@ -806,7 +1031,8 @@ void AwtDropTarget::LoadCache(IDataObject* pDataObj) { tmp.tymed == TYMED_ENHMF ) // but not ISTORAGE ) - ) continue; + ) + continue; if (m_dataObject->QueryGetData(&tmp) != S_OK) continue; @@ -1005,6 +1231,7 @@ WDTCPIStreamWrapper::WDTCPIStreamWrapper(STGMEDIUM* stgmedium) { m_stgmedium = *stgmedium; m_istream = stgmedium->pstm; + m_istream->AddRef(); m_mutex = ::CreateMutex(NULL, FALSE, NULL); if (javaIOExceptionClazz == (jclass)NULL) { @@ -1024,7 +1251,7 @@ WDTCPIStreamWrapper::WDTCPIStreamWrapper(STGMEDIUM* stgmedium) { WDTCPIStreamWrapper::~WDTCPIStreamWrapper() { ::CloseHandle(m_mutex); - + m_istream->Release(); ::ReleaseStgMedium(&m_stgmedium); } diff --git a/jdk/src/windows/native/sun/windows/awt_DnDDT.h b/jdk/src/windows/native/sun/windows/awt_DnDDT.h index 1505859d52e..f1870e8308d 100644 --- a/jdk/src/windows/native/sun/windows/awt_DnDDT.h +++ b/jdk/src/windows/native/sun/windows/awt_DnDDT.h @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,7 @@ #define AWT_DND_DT_H #include - +#include #include #include @@ -106,6 +106,11 @@ class AwtDropTarget : virtual public IDropTarget { virtual void UnloadCache(); + virtual HRESULT ExtractNativeData(jlong fmt, LONG lIndex, STGMEDIUM *pmedium); + virtual HRESULT SaveIndexToFile(LPCTSTR pFileName, UINT lIndex); + virtual jobject ConvertNativeData(JNIEnv* env, jlong fmt, STGMEDIUM *pmedium); + virtual jobject ConvertMemoryMappedData(JNIEnv* env, jlong fmt, STGMEDIUM *pmedium); + private: typedef struct _RegisterTargetRec { AwtDropTarget* dropTarget; @@ -152,11 +157,12 @@ class AwtDropTarget : virtual public IDropTarget { // external COM references - IDataObject __RPC_FAR *m_dataObject; + IDataObject *m_dataObject; + IDropTargetHelper *m_pIDropTargetHelper; // static members - static IDataObject __RPC_FAR *sm_pCurrentDnDDataObject; + static IDataObject *sm_pCurrentDnDDataObject; // method references diff --git a/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp b/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp index 080e8d42741..8d81cf8aa26 100644 --- a/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp +++ b/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp @@ -44,6 +44,7 @@ jmethodID AwtFileDialog::setHWndMID; jmethodID AwtFileDialog::handleSelectedMID; jmethodID AwtFileDialog::handleCancelMID; jmethodID AwtFileDialog::checkFilenameFilterMID; +jmethodID AwtFileDialog::isMultipleModeMID; /* FileDialog ids */ jfieldID AwtFileDialog::modeID; @@ -57,6 +58,13 @@ static TCHAR s_fileFilterString[MAX_FILTER_STRING]; /* Non-localized suffix of the filter string */ static const TCHAR s_additionalString[] = TEXT(" (*.*)\0*.*\0"); +// Default limit of the output buffer. +#define SINGLE_MODE_BUFFER_LIMIT MAX_PATH+1 +#define MULTIPLE_MODE_BUFFER_LIMIT 32768 + +// The name of the property holding the pointer to the OPENFILENAME structure. +static LPCTSTR OpenFileNameProp = TEXT("AWT_OFN"); + /***********************************************************************/ void @@ -140,6 +148,8 @@ FileDialogHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) FileDialogWndProc); ::SetProp(parent, NativeDialogWndProcProp, reinterpret_cast(lpfnWndProc)); + ::SetProp(parent, OpenFileNameProp, (void *)lParam); + break; } case WM_DESTROY: { @@ -149,6 +159,7 @@ FileDialogHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) lpfnWndProc); ::RemoveProp(parent, ModalDialogPeerProp); ::RemoveProp(parent, NativeDialogWndProcProp); + ::RemoveProp(parent, OpenFileNameProp); break; } case WM_NOTIFY: { @@ -174,6 +185,30 @@ FileDialogHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) // to unblock all the windows blocked by this dialog as it will // be closed soon env->CallVoidMethod(peer, AwtFileDialog::setHWndMID, (jlong)0); + } else if (notifyEx->hdr.code == CDN_SELCHANGE) { + // reallocate the buffer if the buffer is too small + LPOPENFILENAME lpofn = (LPOPENFILENAME)GetProp(parent, OpenFileNameProp); + + UINT nLength = CommDlg_OpenSave_GetSpec(parent, NULL, 0) + + CommDlg_OpenSave_GetFolderPath(parent, NULL, 0); + + if (lpofn->nMaxFile < nLength) + { + // allocate new buffer + LPTSTR newBuffer = new TCHAR[nLength]; + + if (newBuffer) { + memset(newBuffer, 0, nLength * sizeof(TCHAR)); + LPTSTR oldBuffer = lpofn->lpstrFile; + lpofn->lpstrFile = newBuffer; + lpofn->nMaxFile = nLength; + // free the previously allocated buffer + if (oldBuffer) { + delete[] oldBuffer; + } + + } + } } } break; @@ -193,7 +228,6 @@ AwtFileDialog::Show(void *p) WCHAR unicodeChar = L' '; LPTSTR fileBuffer = NULL; LPTSTR currentDirectory = NULL; - OPENFILENAME ofn; jint mode = 0; BOOL result = FALSE; DWORD dlgerr; @@ -204,6 +238,10 @@ AwtFileDialog::Show(void *p) jobject target = NULL; jobject parent = NULL; AwtComponent* awtParent = NULL; + jboolean multipleMode = JNI_FALSE; + + OPENFILENAME ofn; + memset(&ofn, 0, sizeof(ofn)); /* * There's a situation (see bug 4906972) when InvokeFunction (by which this method is called) @@ -233,7 +271,16 @@ AwtFileDialog::Show(void *p) (jstring)env->GetObjectField(target, AwtFileDialog::dirID); JavaStringBuffer directoryBuffer(env, directory); - fileBuffer = new TCHAR[MAX_PATH+1]; + multipleMode = env->CallBooleanMethod(peer, AwtFileDialog::isMultipleModeMID); + + UINT bufferLimit; + if (multipleMode == JNI_TRUE) { + bufferLimit = MULTIPLE_MODE_BUFFER_LIMIT; + } else { + bufferLimit = SINGLE_MODE_BUFFER_LIMIT; + } + LPTSTR fileBuffer = new TCHAR[bufferLimit]; + memset(fileBuffer, 0, bufferLimit * sizeof(TCHAR)); file = (jstring)env->GetObjectField(target, AwtFileDialog::fileID); if (file != NULL) { @@ -244,8 +291,6 @@ AwtFileDialog::Show(void *p) fileBuffer[0] = _T('\0'); } - memset(&ofn, 0, sizeof(ofn)); - ofn.lStructSize = sizeof(ofn); ofn.lpstrFilter = s_fileFilterString; ofn.nFilterIndex = 1; @@ -265,19 +310,23 @@ AwtFileDialog::Show(void *p) ofn.hwndOwner = NULL; } ofn.lpstrFile = fileBuffer; - ofn.nMaxFile = MAX_PATH; + ofn.nMaxFile = bufferLimit; ofn.lpstrTitle = titleBuffer; ofn.lpstrInitialDir = directoryBuffer; ofn.Flags = OFN_LONGNAMES | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY | OFN_ENABLEHOOK | OFN_EXPLORER | OFN_ENABLESIZING; fileFilter = env->GetObjectField(peer, AwtFileDialog::fileFilterID); - if (!JNU_IsNull(env,fileFilter)) { - ofn.Flags |= OFN_ENABLEINCLUDENOTIFY; - } + if (!JNU_IsNull(env,fileFilter)) { + ofn.Flags |= OFN_ENABLEINCLUDENOTIFY; + } ofn.lCustData = (LPARAM)peer; ofn.lpfnHook = (LPOFNHOOKPROC)FileDialogHookProc; + if (multipleMode == JNI_TRUE) { + ofn.Flags |= OFN_ALLOWMULTISELECT; + } + // Save current directory, so we can reset if it changes. currentDirectory = new TCHAR[MAX_PATH+1]; @@ -318,11 +367,12 @@ AwtFileDialog::Show(void *p) // Report result to peer. if (result) { - jstring tmpJString = (_tcslen(ofn.lpstrFile) == 0 ? - JNU_NewStringPlatform(env, L"") : - JNU_NewStringPlatform(env, ofn.lpstrFile)); - env->CallVoidMethod(peer, AwtFileDialog::handleSelectedMID, tmpJString); - env->DeleteLocalRef(tmpJString); + jint length = (jint)GetBufferLength(ofn.lpstrFile, ofn.nMaxFile); + jcharArray jnames = env->NewCharArray(length); + env->SetCharArrayRegion(jnames, 0, length, (jchar*)ofn.lpstrFile); + + env->CallVoidMethod(peer, AwtFileDialog::handleSelectedMID, jnames); + env->DeleteLocalRef(jnames); } else { env->CallVoidMethod(peer, AwtFileDialog::handleCancelMID); } @@ -338,7 +388,8 @@ AwtFileDialog::Show(void *p) env->DeleteGlobalRef(peer); delete[] currentDirectory; - delete[] fileBuffer; + if (ofn.lpstrFile) + delete[] ofn.lpstrFile; throw; } @@ -351,7 +402,8 @@ AwtFileDialog::Show(void *p) env->DeleteGlobalRef(peer); delete[] currentDirectory; - delete[] fileBuffer; + if (ofn.lpstrFile) + delete[] ofn.lpstrFile; } BOOL @@ -416,6 +468,18 @@ void AwtFileDialog::_ToBack(void *param) env->DeleteGlobalRef(self); } +// Returns the length of the double null terminated output buffer +UINT AwtFileDialog::GetBufferLength(LPTSTR buffer, UINT limit) +{ + UINT index = 0; + while ((index < limit) && + (buffer[index] != NULL || buffer[index+1] != NULL)) + { + index++; + } + return index; +} + /************************************************************************ * WFileDialogPeer native methods */ @@ -434,11 +498,12 @@ Java_sun_awt_windows_WFileDialogPeer_initIDs(JNIEnv *env, jclass cls) AwtFileDialog::setHWndMID = env->GetMethodID(cls, "setHWnd", "(J)V"); AwtFileDialog::handleSelectedMID = - env->GetMethodID(cls, "handleSelected", "(Ljava/lang/String;)V"); + env->GetMethodID(cls, "handleSelected", "([C)V"); AwtFileDialog::handleCancelMID = env->GetMethodID(cls, "handleCancel", "()V"); AwtFileDialog::checkFilenameFilterMID = env->GetMethodID(cls, "checkFilenameFilter", "(Ljava/lang/String;)Z"); + AwtFileDialog::isMultipleModeMID = env->GetMethodID(cls, "isMultipleMode", "()Z"); /* java.awt.FileDialog fields */ cls = env->FindClass("java/awt/FileDialog"); @@ -455,6 +520,7 @@ Java_sun_awt_windows_WFileDialogPeer_initIDs(JNIEnv *env, jclass cls) DASSERT(AwtFileDialog::setHWndMID != NULL); DASSERT(AwtFileDialog::handleSelectedMID != NULL); DASSERT(AwtFileDialog::handleCancelMID != NULL); + DASSERT(AwtFileDialog::isMultipleModeMID != NULL); DASSERT(AwtFileDialog::modeID != NULL); DASSERT(AwtFileDialog::dirID != NULL); diff --git a/jdk/src/windows/native/sun/windows/awt_FileDialog.h b/jdk/src/windows/native/sun/windows/awt_FileDialog.h index 82638d30752..d20a355d2c0 100644 --- a/jdk/src/windows/native/sun/windows/awt_FileDialog.h +++ b/jdk/src/windows/native/sun/windows/awt_FileDialog.h @@ -49,6 +49,7 @@ public: static jmethodID handleSelectedMID; static jmethodID handleCancelMID; static jmethodID checkFilenameFilterMID; + static jmethodID isMultipleModeMID; /* java.awt.FileDialog field and method ids */ static jfieldID modeID; @@ -68,6 +69,9 @@ public: static void _DisposeOrHide(void *param); static void _ToFront(void *param); static void _ToBack(void *param); + +private: + static UINT GetBufferLength(LPTSTR buffer, UINT limit); }; #endif /* FILE_DIALOG_H */ diff --git a/jdk/src/windows/native/sun/windows/awt_MenuItem.cpp b/jdk/src/windows/native/sun/windows/awt_MenuItem.cpp index 51fc47718cb..33abb66330e 100644 --- a/jdk/src/windows/native/sun/windows/awt_MenuItem.cpp +++ b/jdk/src/windows/native/sun/windows/awt_MenuItem.cpp @@ -114,6 +114,7 @@ void AwtMenuItem::Dispose() if (m_peerObject != NULL) { JNI_SET_PDATA(m_peerObject, NULL); env->DeleteGlobalRef(m_peerObject); + m_peerObject = NULL; } AwtObject::Dispose(); diff --git a/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp b/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp index b612bd1bf16..d5756e6bf2b 100644 --- a/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1996-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -289,24 +289,6 @@ jmethodID AwtToolkit::getDefaultToolkitMID; jmethodID AwtToolkit::getFontMetricsMID; jmethodID AwtToolkit::insetsMID; -/************************************************************************ - * JavaStringBuffer method - */ - -JavaStringBuffer::JavaStringBuffer(JNIEnv *env, jstring jstr) { - if (jstr != NULL) { - int length = env->GetStringLength(jstr); - buffer = new TCHAR[length + 1]; - LPCTSTR tmp = JNU_GetStringPlatformChars(env, jstr, NULL); - _tcscpy(buffer, tmp); - JNU_ReleaseStringPlatformChars(env, jstr, tmp); - } else { - buffer = new TCHAR[1]; - buffer[0] = _T('\0'); - } -} - - /************************************************************************ * AwtToolkit methods */ @@ -1518,6 +1500,7 @@ HICON AwtToolkit::GetAwtIconSm() return defaultIconSm; } +// The icon at index 0 must be gray. See AwtWindow::GetSecurityWarningIcon() HICON AwtToolkit::GetSecurityWarningIcon(UINT index, UINT w, UINT h) { //Note: should not exceed 10 because of the current implementation. diff --git a/jdk/src/windows/native/sun/windows/awt_Toolkit.h b/jdk/src/windows/native/sun/windows/awt_Toolkit.h index efaf9ff8432..066efce37d8 100644 --- a/jdk/src/windows/native/sun/windows/awt_Toolkit.h +++ b/jdk/src/windows/native/sun/windows/awt_Toolkit.h @@ -1,5 +1,5 @@ /* - * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1996-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -466,20 +466,6 @@ public: void UninstallMouseLowLevelHook(); }; -/* - * Class to encapsulate the extraction of the java string contents - * into a buffer and the cleanup of the buffer - */ -class JavaStringBuffer { - public: - JavaStringBuffer(JNIEnv *env, jstring jstr); - INLINE ~JavaStringBuffer() { delete[] buffer; } - INLINE operator LPTSTR() { return buffer; } - INLINE operator LPARAM() { return (LPARAM)buffer; } /* for SendMessage */ - - private: - LPTSTR buffer; -}; /* creates an instance of T and assigns it to the argument, but only if the argument is initially NULL. Supposed to be thread-safe. diff --git a/jdk/src/windows/native/sun/windows/awt_Window.cpp b/jdk/src/windows/native/sun/windows/awt_Window.cpp index 8bb5c900219..c6ff055877e 100644 --- a/jdk/src/windows/native/sun/windows/awt_Window.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Window.cpp @@ -163,9 +163,11 @@ jfieldID AwtWindow::sysXID; jfieldID AwtWindow::sysYID; jfieldID AwtWindow::sysWID; jfieldID AwtWindow::sysHID; +jfieldID AwtWindow::windowTypeID; jmethodID AwtWindow::getWarningStringMID; jmethodID AwtWindow::calculateSecurityWarningPositionMID; +jmethodID AwtWindow::windowTypeNameMID; int AwtWindow::ms_instanceCounter = 0; HHOOK AwtWindow::ms_hCBTFilter; @@ -216,6 +218,9 @@ AwtWindow::AwtWindow() { hContentBitmap = NULL; ::InitializeCriticalSection(&contentBitmapCS); + + m_windowType = Type::NORMAL; + m_alwaysOnTop = false; } AwtWindow::~AwtWindow() @@ -348,10 +353,10 @@ void AwtWindow::RepositionSecurityWarning(JNIEnv *env) RECT rect; CalculateWarningWindowBounds(env, &rect); - ::SetWindowPos(warningWindow, HWND_NOTOPMOST, + ::SetWindowPos(warningWindow, IsAlwaysOnTop() ? HWND_TOPMOST : GetHWnd(), rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, - SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOZORDER | + SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOOWNERZORDER ); } @@ -475,6 +480,9 @@ void AwtWindow::CreateHWnd(JNIEnv *env, LPCWSTR title, } env->DeleteLocalRef(target); + InitType(env, peer); + TweakStyle(windowStyle, windowExStyle); + AwtCanvas::CreateHWnd(env, title, windowStyle, windowExStyle, @@ -645,7 +653,10 @@ void AwtWindow::UnregisterWarningWindowClass() HICON AwtWindow::GetSecurityWarningIcon() { - HICON ico = AwtToolkit::GetInstance().GetSecurityWarningIcon(securityWarningAnimationStage, + // It is assumed that the icon at index 0 is gray + const UINT index = securityAnimationKind == akShow ? + securityWarningAnimationStage : 0; + HICON ico = AwtToolkit::GetInstance().GetSecurityWarningIcon(index, warningWindowWidth, warningWindowHeight); return ico; } @@ -821,7 +832,9 @@ void AwtWindow::StartSecurityAnimation(AnimationKind kind) securityAnimationTimerElapse, NULL); if (securityAnimationKind == akShow) { - ::SetWindowPos(warningWindow, HWND_NOTOPMOST, 0, 0, 0, 0, + ::SetWindowPos(warningWindow, + IsAlwaysOnTop() ? HWND_TOPMOST : GetHWnd(), + 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW | SWP_NOOWNERZORDER); @@ -982,6 +995,50 @@ void AwtWindow::_RepositionSecurityWarning(void* param) delete rsws; } +void AwtWindow::InitType(JNIEnv *env, jobject peer) +{ + jobject type = env->GetObjectField(peer, windowTypeID); + if (type == NULL) { + return; + } + + jstring value = (jstring)env->CallObjectMethod(type, windowTypeNameMID); + if (value == NULL) { + env->DeleteLocalRef(type); + return; + } + + const char* valueNative = env->GetStringUTFChars(value, 0); + if (valueNative == NULL) { + env->DeleteLocalRef(value); + env->DeleteLocalRef(type); + return; + } + + if (strcmp(valueNative, "UTILITY") == 0) { + m_windowType = Type::UTILITY; + } else if (strcmp(valueNative, "POPUP") == 0) { + m_windowType = Type::POPUP; + } + + env->ReleaseStringUTFChars(value, valueNative); + env->DeleteLocalRef(value); + env->DeleteLocalRef(type); +} + +void AwtWindow::TweakStyle(DWORD & style, DWORD & exStyle) +{ + switch (GetType()) { + case Type::UTILITY: + exStyle |= WS_EX_TOOLWINDOW; + break; + case Type::POPUP: + style &= ~WS_OVERLAPPED; + style |= WS_POPUP; + break; + } +} + /* Create a new AwtWindow object and window. */ AwtWindow* AwtWindow::Create(jobject self, jobject parent) { @@ -2216,6 +2273,7 @@ void AwtWindow::_SetAlwaysOnTop(void *param) if (::IsWindow(w->GetHWnd())) { w->SendMessage(WM_AWT_SETALWAYSONTOP, (WPARAM)value, (LPARAM)w); + w->m_alwaysOnTop = (bool)value; } ret: env->DeleteGlobalRef(self); @@ -3008,6 +3066,11 @@ Java_java_awt_Window_initIDs(JNIEnv *env, jclass cls) AwtWindow::calculateSecurityWarningPositionMID = env->GetMethodID(cls, "calculateSecurityWarningPosition", "(DDDD)Ljava/awt/geom/Point2D;"); + jclass windowTypeClass = env->FindClass("java/awt/Window$Type"); + AwtWindow::windowTypeNameMID = + env->GetMethodID(windowTypeClass, "name", "()Ljava/lang/String;"); + env->DeleteLocalRef(windowTypeClass); + CATCH_BAD_ALLOC; } @@ -3035,6 +3098,9 @@ Java_sun_awt_windows_WWindowPeer_initIDs(JNIEnv *env, jclass cls) AwtWindow::sysWID = env->GetFieldID(cls, "sysW", "I"); AwtWindow::sysHID = env->GetFieldID(cls, "sysH", "I"); + AwtWindow::windowTypeID = env->GetFieldID(cls, "windowType", + "Ljava/awt/Window$Type;"); + CATCH_BAD_ALLOC; } diff --git a/jdk/src/windows/native/sun/windows/awt_Window.h b/jdk/src/windows/native/sun/windows/awt_Window.h index 001062835e3..32be9d0d96b 100644 --- a/jdk/src/windows/native/sun/windows/awt_Window.h +++ b/jdk/src/windows/native/sun/windows/awt_Window.h @@ -63,8 +63,11 @@ public: static jfieldID sysWID; static jfieldID sysHID; + static jfieldID windowTypeID; + static jmethodID getWarningStringMID; static jmethodID calculateSecurityWarningPositionMID; + static jmethodID windowTypeNameMID; AwtWindow(); virtual ~AwtWindow(); @@ -362,10 +365,28 @@ protected: void EnableTranslucency(BOOL enable); + // Native representation of the java.awt.Window.Type enum + enum Type { + NORMAL, UTILITY, POPUP + }; + + inline Type GetType() { return m_windowType; } + private: int m_screenNum; void InitOwner(AwtWindow *owner); + + Type m_windowType; + void InitType(JNIEnv *env, jobject peer); + + // Tweak the style according to the type of the window + void TweakStyle(DWORD & style, DWORD & exStyle); + + // Set in _SetAlwaysOnTop() + bool m_alwaysOnTop; +public: + inline bool IsAlwaysOnTop() { return m_alwaysOnTop; } }; #endif /* AWT_WINDOW_H */ diff --git a/jdk/src/windows/native/sun/windows/awt_ole.cpp b/jdk/src/windows/native/sun/windows/awt_ole.cpp new file mode 100644 index 00000000000..38ea914df99 --- /dev/null +++ b/jdk/src/windows/native/sun/windows/awt_ole.cpp @@ -0,0 +1,86 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +#include "awt_ole.h" +#include +#include + +namespace SUN_DBG_NS{ + //WIN32 debug channel approach + //inline void DbgOut(LPCTSTR lpStr) { ::OutputDebugString(lpStr); } + + //Java debug channel approach + inline void DbgOut(LPCTSTR lpStr) { DTRACE_PRINT(_B(lpStr)); } + + LPCTSTR CreateTimeStamp(LPTSTR lpBuffer, size_t iBufferSize) + { + struct _timeb tb; + _ftime(&tb); + size_t len = _tcsftime(lpBuffer, iBufferSize, _T("%b %d %H:%M:%S"), localtime(&tb.time)); + if (len && len+4 < iBufferSize) { + if (_sntprintf(lpBuffer+len, iBufferSize-len-1, _T(".%03d"), tb.millitm) < 0) { + lpBuffer[iBufferSize-len-1] = 0; + } + } + return lpBuffer; + } + + #define DTRACE_BUF_LEN 1024 + void snvTrace(LPCTSTR lpszFormat, va_list argList) + { + TCHAR szBuffer[DTRACE_BUF_LEN]; + if (_vsntprintf( szBuffer, DTRACE_BUF_LEN, lpszFormat, argList ) < 0) { + szBuffer[DTRACE_BUF_LEN-1] = 0; + } + TCHAR szTime[32]; + CreateTimeStamp(szTime, sizeof(szTime)); + _tcscat(szTime, _T(" ")); + TCHAR szBuffer1[DTRACE_BUF_LEN]; + size_t iFormatLen = _tcslen(lpszFormat); + BOOL bErrorReport = iFormatLen>6 && _tcscmp(lpszFormat + iFormatLen - 6, _T("[%08x]"))==0; + size_t iTimeLen = _tcslen(szTime); + if (_sntprintf( + szBuffer1 + iTimeLen, + DTRACE_BUF_LEN - iTimeLen - 1, //reserver for \n + _T("P:%04d T:%04d ") TRACE_SUFFIX _T("%s%s"), + ::GetCurrentProcessId(), + ::GetCurrentThreadId(), + bErrorReport?_T("Error:"):_T(""), + szBuffer) < 0) + { + _tcscpy(szBuffer1 + DTRACE_BUF_LEN - 5, _T("...")); //reserver for \n + } + memcpy(szBuffer1, szTime, iTimeLen*sizeof(TCHAR)); + _tcscat(szBuffer1, _T("\n")); + DbgOut( szBuffer1 ); + } + void snTrace(LPCTSTR lpszFormat, ... ) + { + va_list argList; + va_start(argList, lpszFormat); + snvTrace(lpszFormat, argList); + va_end(argList); + } +}//SUN_DBG_NS namespace end diff --git a/jdk/src/windows/native/sun/windows/awt_ole.h b/jdk/src/windows/native/sun/windows/awt_ole.h new file mode 100644 index 00000000000..5d738b23038 --- /dev/null +++ b/jdk/src/windows/native/sun/windows/awt_ole.h @@ -0,0 +1,194 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +#ifndef AWT_OLE_H +#define AWT_OLE_H + +#include "awt.h" +#include +#include +#include + +#ifdef _DEBUG + #define _SUN_DEBUG +#endif + + +#ifndef SUN_DBG_NS + #ifdef _LIB + #define SUN_DBG_NS SUN_dbg_lib + #else + #define SUN_DBG_NS SUN_dbg_glb + #endif //_LIB +#endif //SUN_DBG_NS + + +#ifndef TRACE_SUFFIX + #define TRACE_SUFFIX +#endif + +namespace SUN_DBG_NS{ + LPCTSTR CreateTimeStamp(LPTSTR lpBuffer, size_t iBufferSize); + inline void snTraceEmp(LPCTSTR, ...) { } + void snvTrace(LPCTSTR lpszFormat, va_list argList); + void snTrace(LPCTSTR lpszFormat, ... ); +}//SUN_DBG_NS namespace end + +#define STRACE1 SUN_DBG_NS::snTrace +#ifdef _SUN_DEBUG + #define STRACE SUN_DBG_NS::snTrace +#else + #define STRACE SUN_DBG_NS::snTraceEmp +#endif +#define STRACE0 SUN_DBG_NS::snTraceEmp + +struct CLogEntryPoint1 { + LPCTSTR m_lpTitle; + CLogEntryPoint1(LPCTSTR lpTitle):m_lpTitle(lpTitle) { STRACE(_T("{%s"), m_lpTitle); } + ~CLogEntryPoint1(){ STRACE(_T("}%s"), m_lpTitle); } +}; +struct CLogEntryPoint0 { + LPCTSTR m_lpTitle; + CLogEntryPoint0(LPCTSTR lpTitle):m_lpTitle(lpTitle) { STRACE0(_T("{%s"), m_lpTitle); } + ~CLogEntryPoint0(){ STRACE0(_T("}%s"), m_lpTitle); } +}; + +#define SEP1(msg) CLogEntryPoint1 _ep1_(msg); +#define SEP0(msg) CLogEntryPoint0 _ep0_(msg); +#ifdef _SUN_DEBUG + #define SEP(msg) CLogEntryPoint1 _ep1_(msg); +#else + #define SEP(msg) CLogEntryPoint0 _ep0_(msg); +#endif + + +#define OLE_BAD_COOKIE ((DWORD)-1) + +#define OLE_TRACENOTIMPL(msg)\ + STRACE(_T("Warning:%s"), msg);\ + return E_NOTIMPL; + +#define OLE_TRACEOK(msg)\ + STRACE0(_T("Info:%s"), msg);\ + return S_OK; + + +#define OLE_DECL\ + HRESULT _hr_ = S_OK; + +#define OLE_NEXT_TRY\ + try { + +#define OLE_TRY\ + OLE_DECL\ + try { + +#define OLE_HRT(fnc)\ + _hr_ = fnc;\ + if (FAILED(_hr_)) {\ + STRACE1(_T("Error:%08x in ") _T(#fnc), _hr_);\ + _com_raise_error(_hr_);\ + } + +#define OLE_WINERROR2HR(msg, erCode)\ + _hr_ = erCode;\ + STRACE1(_T("OSError:%d in ") msg, _hr_);\ + _hr_ = HRESULT_FROM_WIN32(_hr_); + +#define OLE_THROW_LASTERROR(msg)\ + OLE_WINERROR2HR(msg, ::GetLastError())\ + _com_raise_error(_hr_); + +#define OLE_CHECK_NOTNULL(x)\ + if (!(x)) {\ + STRACE1(_T("Null pointer:") _T(#x));\ + _com_raise_error(_hr_ = E_POINTER);\ + } + +#define OLE_CHECK_NOTNULLSP(x)\ + if (!bool(x)) {\ + STRACE1(_T("Null pointer:") _T(#x));\ + _com_raise_error(_hr_ = E_POINTER);\ + } + +#define OLE_HRW32(fnc)\ + _hr_ = fnc;\ + if (ERROR_SUCCESS != _hr_) {\ + STRACE1(_T("OSError:%d in ") _T(#fnc), _hr_);\ + _com_raise_error(_hr_ = HRESULT_FROM_WIN32(_hr_));\ + } + +#define OLE_HRW32_BOOL(fnc)\ + if (!fnc) {\ + OLE_THROW_LASTERROR(_T(#fnc))\ + } + +#define OLE_CATCH\ + } catch (_com_error &e) {\ + _hr_ = e.Error();\ + STRACE1(_T("COM Error:%08x %s"), _hr_, e.ErrorMessage());\ + } + +#define OLE_CATCH_BAD_ALLOC\ + } catch (_com_error &e) {\ + _hr_ = e.Error();\ + STRACE1(_T("COM Error:%08x %s"), _hr_, e.ErrorMessage());\ + } catch (std::bad_alloc&) {\ + _hr_ = E_OUTOFMEMORY;\ + STRACE1(_T("Error: Out of Memory"));\ + } + +#define OLE_CATCH_ALL\ + } catch (_com_error &e) {\ + _hr_ = e.Error();\ + STRACE1(_T("COM Error:%08x %s"), _hr_, e.ErrorMessage());\ + } catch(...) {\ + _hr_ = E_FAIL;\ + STRACE1(_T("Error: General Pritection Failor"));\ + } + +#define OLE_RETURN_SUCCESS return SUCCEEDED(_hr_); +#define OLE_RETURN_HR return _hr_; +#define OLE_HR _hr_ + +#define _B(x) _bstr_t(x) +#define _BT(x) (LPCTSTR)_bstr_t(x) +#define _V(x) _variant_t(x) +#define _VV(vrt) _variant_t(vrt, false) +#define _VE _variant_t() +#define _VB(b) _variant_t(bool(b)) + +struct OLEHolder +{ + OLEHolder() + : m_hr(::OleInitialize(NULL)) + {} + + ~OLEHolder(){} + operator bool() const { return S_OK==SUCCEEDED(m_hr); } + HRESULT m_hr; +}; + +#endif//AWT_OLE_H diff --git a/jdk/src/windows/native/sun/windows/awtmsg.h b/jdk/src/windows/native/sun/windows/awtmsg.h index 6eb06b01db5..6f62d75e37b 100644 --- a/jdk/src/windows/native/sun/windows/awtmsg.h +++ b/jdk/src/windows/native/sun/windows/awtmsg.h @@ -253,4 +253,8 @@ enum { #define WM_UNDOCUMENTED_CLICKMENUBAR 0x0313 #endif +#ifndef WM_UNDOCUMENTED_CLIENTSHUTDOWN +#define WM_UNDOCUMENTED_CLIENTSHUTDOWN 0x003b +#endif + #endif // AWTMSG_H diff --git a/jdk/test/Makefile b/jdk/test/Makefile index 25f0dc1ed6f..20bd55408d0 100644 --- a/jdk/test/Makefile +++ b/jdk/test/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1995-2009 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1995-2010 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -37,25 +37,19 @@ GET= AWK = awk CAT = cat CD = cd -CHMOD = chmod CP = cp CUT = cut ECHO = echo EGREP = egrep EXPAND = expand -EXPR = expr -KILL = /usr/bin/kill MKDIR = mkdir -NOHUP = nohup PWD = pwd SED = sed -SLEEP = sleep SORT = sort TEE = tee UNAME = uname UNIQ = uniq WC = wc -XHOST = xhost ZIP = zip # Get OS name from uname @@ -76,6 +70,10 @@ endif ifeq ($(UNAME_S), Linux) OS_NAME = linux OS_ARCH := $(shell $(UNAME) -m) + # Check for unknown arch, try uname -p if uname -m says unknown + ifeq ($(OS_ARCH),unknown) + OS_ARCH := $(shell $(UNAME) -p) + endif OS_VERSION := $(shell $(UNAME) -r) endif ifndef OS_NAME @@ -99,16 +97,26 @@ endif # Only want major and minor numbers from os version OS_VERSION := $(shell $(ECHO) "$(OS_VERSION)" | $(CUT) -d'.' -f1,2) -# Try and use names i586, x64, and ia64 consistently -OS_ARCH:=$(subst X64,x64,$(OS_ARCH)) -OS_ARCH:=$(subst AMD64,x64,$(OS_ARCH)) -OS_ARCH:=$(subst amd64,x64,$(OS_ARCH)) -OS_ARCH:=$(subst x86_64,x64,$(OS_ARCH)) -OS_ARCH:=$(subst EM64T,x64,$(OS_ARCH)) -OS_ARCH:=$(subst em64t,x64,$(OS_ARCH)) -OS_ARCH:=$(subst intel64,x64,$(OS_ARCH)) -OS_ARCH:=$(subst Intel64,x64,$(OS_ARCH)) -OS_ARCH:=$(subst INTEL64,x64,$(OS_ARCH)) +# Name to use for x86_64 arch (historically amd64, but should change someday) +OS_ARCH_X64_NAME:=amd64 +#OS_ARCH_X64_NAME:=x64 + +# Alternate arch names (in case this arch is known by a second name) +# PROBLEM_LISTS may use either name. +OS_ARCH2-amd64:=x64 +#OS_ARCH2-x64:=amd64 + +# Try and use the arch names consistently +OS_ARCH:=$(subst x64,$(OS_ARCH_X64_NAME),$(OS_ARCH)) +OS_ARCH:=$(subst X64,$(OS_ARCH_X64_NAME),$(OS_ARCH)) +OS_ARCH:=$(subst AMD64,$(OS_ARCH_X64_NAME),$(OS_ARCH)) +OS_ARCH:=$(subst amd64,$(OS_ARCH_X64_NAME),$(OS_ARCH)) +OS_ARCH:=$(subst x86_64,$(OS_ARCH_X64_NAME),$(OS_ARCH)) +OS_ARCH:=$(subst EM64T,$(OS_ARCH_X64_NAME),$(OS_ARCH)) +OS_ARCH:=$(subst em64t,$(OS_ARCH_X64_NAME),$(OS_ARCH)) +OS_ARCH:=$(subst intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH)) +OS_ARCH:=$(subst Intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH)) +OS_ARCH:=$(subst INTEL64,$(OS_ARCH_X64_NAME),$(OS_ARCH)) OS_ARCH:=$(subst IA64,ia64,$(OS_ARCH)) OS_ARCH:=$(subst X86,i586,$(OS_ARCH)) OS_ARCH:=$(subst x86,i586,$(OS_ARCH)) @@ -116,17 +124,32 @@ OS_ARCH:=$(subst i386,i586,$(OS_ARCH)) OS_ARCH:=$(subst i486,i586,$(OS_ARCH)) OS_ARCH:=$(subst i686,i586,$(OS_ARCH)) -# Check for ARCH_DATA_MODEL, adjust OS_ARCH accordingly +# Default ARCH_DATA_MODEL settings +ARCH_DATA_MODEL-i586 = 32 +ARCH_DATA_MODEL-$(OS_ARCH_X64_NAME) = 64 +ARCH_DATA_MODEL-ia64 = 64 +ARCH_DATA_MODEL-sparc = 32 +ARCH_DATA_MODEL-sparcv9 = 64 + +# If ARCH_DATA_MODEL is not defined, try and pick a reasonable default +ifndef ARCH_DATA_MODEL + ARCH_DATA_MODEL:=$(ARCH_DATA_MODEL-$(OS_ARCH)) +endif ifndef ARCH_DATA_MODEL ARCH_DATA_MODEL=32 endif + +# Platform directory name +PLATFORM_OS = $(OS_NAME)-$(OS_ARCH) + +# Check ARCH_DATA_MODEL, adjust OS_ARCH accordingly on solaris ARCH_DATA_MODEL_ERROR= \ - ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) cannot be used with $(OS_NAME)-$(ARCH) + ARCH_DATA_MODEL=$(ARCH_DATA_MODEL) cannot be used with $(PLATFORM_OS) ifeq ($(ARCH_DATA_MODEL),64) - ifeq ($(OS_NAME)-$(OS_ARCH),solaris-i586) - OS_ARCH=x64 + ifeq ($(PLATFORM_OS),solaris-i586) + OS_ARCH=$(OS_ARCH_X64_NAME) endif - ifeq ($(OS_NAME)-$(OS_ARCH),solaris-sparc) + ifeq ($(PLATFORM_OS),solaris-sparc) OS_ARCH=sparcv9 endif ifeq ($(OS_ARCH),i586) @@ -137,7 +160,7 @@ ifeq ($(ARCH_DATA_MODEL),64) endif else ifeq ($(ARCH_DATA_MODEL),32) - ifeq ($(OS_ARCH),x64) + ifeq ($(OS_ARCH),$(OS_ARCH_X64_NAME)) x:=$(warning "WARNING: $(ARCH_DATA_MODEL_ERROR)") endif ifeq ($(OS_ARCH),ia64) @@ -151,6 +174,12 @@ else endif endif +# Alternate OS_ARCH name (defaults to OS_ARCH) +OS_ARCH2:=$(OS_ARCH2-$(OS_ARCH)) +ifeq ($(OS_ARCH2),) + OS_ARCH2:=$(OS_ARCH) +endif + # Root of this test area (important to use full paths in some places) TEST_ROOT := $(shell $(PWD)) @@ -158,21 +187,21 @@ TEST_ROOT := $(shell $(PWD)) ifdef ALT_OUTPUTDIR ABS_OUTPUTDIR = $(ALT_OUTPUTDIR) else - ABS_OUTPUTDIR = $(TEST_ROOT)/../build/$(OS_NAME)-$(OS_ARCH) + ABS_OUTPUTDIR = $(TEST_ROOT)/../build/$(PLATFORM_OS) endif -ABS_BUILD_ROOT = $(ABS_OUTPUTDIR) -ABS_TEST_OUTPUT_DIR := $(ABS_BUILD_ROOT)/testoutput/$(UNIQUE_DIR) +ABS_PLATFORM_BUILD_ROOT = $(ABS_OUTPUTDIR) +ABS_TEST_OUTPUT_DIR := $(ABS_PLATFORM_BUILD_ROOT)/testoutput/$(UNIQUE_DIR) # Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test) ifndef PRODUCT_HOME # Try to use j2sdk-image if it exists - ABS_JDK_IMAGE = $(ABS_BUILD_ROOT)/j2sdk-image - PRODUCT_HOME := \ - $(shell \ - if [ -d $(ABS_JDK_IMAGE) ] ; then \ - $(ECHO) "$(ABS_JDK_IMAGE)"; \ - else \ - $(ECHO) "$(ABS_BUILD_ROOT)"; \ + ABS_JDK_IMAGE = $(ABS_PLATFORM_BUILD_ROOT)/j2sdk-image + PRODUCT_HOME := \ + $(shell \ + if [ -d $(ABS_JDK_IMAGE) ] ; then \ + $(ECHO) "$(ABS_JDK_IMAGE)"; \ + else \ + $(ECHO) "$(ABS_PLATFORM_BUILD_ROOT)"; \ fi) PRODUCT_HOME := $(PRODUCT_HOME) endif @@ -211,66 +240,6 @@ ifdef JPRT_ARCHIVE_BUNDLE ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE) endif -# DISPLAY settings for virtual frame buffer -START_XVFB = start-Xvfb.sh -NOHUP_OUTPUT = $(ABS_TEST_OUTPUT_DIR)/start-Xvfb.nohup-output.txt -DISPLAY_PID_FILE=$(ABS_TEST_OUTPUT_DIR)/xvfb-display-number.txt -DISPLAY_SLEEP_TIME=10 -DISPLAY_MAX_SLEEPS=10 -ifeq ($(OS_NAME),solaris) - VIRTUAL_FRAME_BUFFER = true -endif -ifeq ($(OS_NAME),linux) - VIRTUAL_FRAME_BUFFER = true -endif - -# Does not work yet, display dies as soon as it gets used. :^( -VIRTUAL_FRAME_BUFFER = false - -# Are we using a VIRTUAL_FRAME_BUFFER (Xvfb) -ifeq ($(VIRTUAL_FRAME_BUFFER),true) - - PREP_DISPLAY = \ - $(CP) $(START_XVFB) $(ABS_TEST_OUTPUT_DIR); \ - $(CHMOD) a+x $(ABS_TEST_OUTPUT_DIR)/$(START_XVFB); \ - ( $(CD) $(ABS_TEST_OUTPUT_DIR) && \ - $(NOHUP) $(ABS_TEST_OUTPUT_DIR)/$(START_XVFB) $(DISPLAY_PID_FILE) > $(NOHUP_OUTPUT) 2>&1 && \ - $(SLEEP) $(DISPLAY_SLEEP_TIME) ) & \ - count=1; \ - while [ ! -s $(DISPLAY_PID_FILE) ] ; do \ - $(ECHO) "Sleeping $(DISPLAY_SLEEP_TIME) more seconds, DISPLAY not ready"; \ - $(SLEEP) $(DISPLAY_SLEEP_TIME); \ - count=`$(EXPR) $${count} '+' 1`; \ - if [ $${count} -gt $(DISPLAY_MAX_SLEEPS) ] ; then \ - $(ECHO) "ERROR: DISPLAY not ready, giving up on DISPLAY"; \ - exit 9; \ - fi; \ - done ; \ - DISPLAY=":`$(CAT) $(DISPLAY_PID_FILE)`"; \ - export DISPLAY; \ - $(CAT) $(NOHUP_OUTPUT); \ - $(ECHO) "Prepared DISPLAY=$${DISPLAY}"; \ - $(XHOST) || \ - ( $(ECHO) "ERROR: No display" ; exit 8) - - KILL_DISPLAY = \ - ( \ - DISPLAY=":`$(CAT) $(DISPLAY_PID_FILE)`"; \ - export DISPLAY; \ - if [ -s "$(DISPLAY_PID_FILE)" ] ; then \ - $(KILL) `$(CAT) $(DISPLAY_PID_FILE)` > /dev/null 2>&1; \ - $(KILL) -9 `$(CAT) $(DISPLAY_PID_FILE)` > /dev/null 2>&1; \ - fi; \ - $(ECHO) "Killed DISPLAY=$${DISPLAY}"; \ - ) - -else - - PREP_DISPLAY = $(ECHO) "VIRTUAL_FRAME_BUFFER=$(VIRTUAL_FRAME_BUFFER)" - KILL_DISPLAY = $(ECHO) "VIRTUAL_FRAME_BUFFER=$(VIRTUAL_FRAME_BUFFER)" - -endif - # How to create the test bundle (pass or fail, we want to create this) # Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed. ZIP_UP_RESULTS = ( $(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)` \ @@ -291,7 +260,7 @@ TESTEXIT = \ fi ; \ testExitCode=`$(CAT) $(EXITCODE)`; \ $(ECHO) "EXIT CODE: $${testExitCode}"; \ - exit ${testExitCode} + exit $${testExitCode} BUNDLE_UP_AND_EXIT = \ ( \ @@ -300,7 +269,7 @@ BUNDLE_UP_AND_EXIT = \ $(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \ $(ECHO) "$${jtregExitCode}" > $(EXITCODE); \ if [ -r "$${_summary}" ] ; then \ - $(ECHO) "Summary: $${_summary}" > $(STATS_TXT); \ + $(ECHO) "Summary: $(UNIQUE_DIR)" > $(STATS_TXT); \ $(EXPAND) $${_summary} | $(EGREP) -v ' Not run\.' > $(RUNLIST); \ $(EGREP) ' Passed\.' $(RUNLIST) \ | $(EGREP) -v ' Error\.' \ @@ -327,7 +296,7 @@ BUNDLE_UP_AND_EXIT = \ $(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \ fi; \ $(CAT) $(STATS_TXT); \ - $(ZIP_UP_RESULTS) && $(KILL_DISPLAY) ; \ + $(ZIP_UP_RESULTS) ; \ $(TESTEXIT) \ ) @@ -370,7 +339,8 @@ ifndef USE_JTREG_SAMEVM endif # With samevm, you cannot use -javaoptions? ifeq ($(USE_JTREG_SAMEVM),true) - EXTRA_JTREG_OPTIONS += -samevm $(JAVA_ARGS) $(JAVA_ARGS:%=-vmoption:%) + JTREG_SAMEVM_OPTION = -samevm + EXTRA_JTREG_OPTIONS += $(JTREG_SAMEVM_OPTION) $(JAVA_ARGS) $(JAVA_ARGS:%=-vmoption:%) JTREG_TEST_OPTIONS = $(JAVA_VM_ARGS:%=-vmoption:%) else JTREG_TEST_OPTIONS = $(JAVA_ARGS:%=-javaoptions:%) $(JAVA_VM_ARGS:%=-vmoption:%) @@ -390,8 +360,10 @@ $(EXCLUDELIST): $(PROBLEM_LISTS) $(TESTDIRS) @$(RM) $@ $@.temp1 $@.temp2 @(($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-all' ) ;\ ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_ARCH)' ) ;\ + ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_ARCH2)' ) ;\ ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_VERSION)') ;\ ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH)' ) ;\ + ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH2)' ) ;\ ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-all' ) ;\ ($(ECHO) "#") ;\ ) | $(SED) -e 's@^[\ ]*@@' \ @@ -418,8 +390,9 @@ $(ECHO) "Running tests in othervm mode: $(call TestDirs, $?)" $(MAKE) TESTDIRS="$(call TestDirs, $?)" USE_JTREG_SAMEVM=false UNIQUE_DIR=$@ jtreg_tests endef define SummaryInfo -$(ECHO) "Summary for: $?" +$(ECHO) "########################################################" $(CAT) $(?:%=$(ABS_TEST_OUTPUT_DIR)/%/$(STATS_TXT_NAME)) +$(ECHO) "########################################################" endef # ------------------------------------------------------------------ @@ -446,10 +419,14 @@ JDK_ALL_TARGETS += jdk_beans2 jdk_beans2: java/beans/Beans java/beans/EventHandler java/beans/XMLDecoder \ java/beans/PropertyEditor $(call RunOthervmBatch) + +# Stable othervm testruns (minus items from PROBLEM_LIST) +# Using samevm has serious problems with these tests JDK_ALL_TARGETS += jdk_beans3 jdk_beans3: java/beans/XMLEncoder $(call RunOthervmBatch) +# All beans tests jdk_beans: jdk_beans1 jdk_beans2 jdk_beans3 @$(SummaryInfo) @@ -475,6 +452,7 @@ JDK_ALL_TARGETS += jdk_management2 jdk_management2: com/sun/jmx com/sun/management sun/management $(call RunOthervmBatch) +# All management tests jdk_management: jdk_management1 jdk_management2 @$(SummaryInfo) @@ -506,10 +484,14 @@ JDK_ALL_TARGETS += jdk_nio2 jdk_nio2: java/nio/Buffer java/nio/ByteOrder \ java/nio/channels java/nio/BufferPoolMXBean java/nio/MappedByteBuffer $(call RunOthervmBatch) + +# Stable othervm testruns (minus items from PROBLEM_LIST) +# Using samevm has serious problems with these tests JDK_ALL_TARGETS += jdk_nio3 jdk_nio3: com/sun/nio sun/nio $(call RunOthervmBatch) +# All nio tests jdk_nio: jdk_nio1 jdk_nio2 jdk_nio3 @$(SummaryInfo) @@ -529,10 +511,14 @@ jdk_security1: java/security JDK_ALL_TARGETS += jdk_security2 jdk_security2: javax/crypto com/sun/crypto $(call RunOthervmBatch) + +# Stable othervm testruns (minus items from PROBLEM_LIST) +# Using samevm has serious problems with these tests JDK_ALL_TARGETS += jdk_security3 jdk_security3: com/sun/security lib/security javax/security sun/security $(call RunOthervmBatch) +# All security tests jdk_security: jdk_security1 jdk_security2 jdk_security3 @$(SummaryInfo) @@ -547,15 +533,18 @@ JDK_ALL_TARGETS += jdk_text jdk_text: java/text sun/text $(call RunSamevmBatch) -# Stable othervm testruns (minus items from PROBLEM_LIST) -# Using samevm has serious problems with these tests +# Stable samevm testruns (minus items from PROBLEM_LIST) JDK_ALL_TARGETS += jdk_tools1 jdk_tools1: com/sun/jdi $(call RunSamevmBatch) + +# Stable othervm testruns (minus items from PROBLEM_LIST) +# Using samevm has serious problems with these tests JDK_ALL_TARGETS += jdk_tools2 jdk_tools2: com/sun/tools sun/jvmstat sun/tools tools vm com/sun/servicetag com/sun/tracing $(call RunOthervmBatch) +# All tools tests jdk_tools: jdk_tools1 jdk_tools2 @$(SummaryInfo) @@ -567,7 +556,9 @@ jdk_util: java/util sun/util # ------------------------------------------------------------------ # Run all tests -jdk_all: $(filter-out jdk_awt jdk_rmi jdk_swing, $(JDK_ALL_TARGETS)) +FILTER_OUT_LIST=jdk_awt jdk_rmi jdk_swing +JDK_ALL_STABLE_TARGETS := $(filter-out $(FILTER_OUT_LIST), $(JDK_ALL_TARGETS)) +jdk_all: $(JDK_ALL_STABLE_TARGETS) @$(SummaryInfo) # These are all phony targets @@ -581,16 +572,22 @@ JTREG = $(JT_HOME)/win32/bin/jtreg JTREG_BASIC_OPTIONS += $(EXTRA_JTREG_OPTIONS) # Only run automatic tests JTREG_BASIC_OPTIONS += -a +# Always turn on assertions +JTREG_ASSERT_OPTION = -ea -esa +JTREG_BASIC_OPTIONS += $(JTREG_ASSERT_OPTION) # Report details on all failed or error tests, times too JTREG_BASIC_OPTIONS += -v:fail,error,time # Retain all files for failing tests JTREG_BASIC_OPTIONS += -retain:fail,error # Ignore tests are not run and completely silent about it -JTREG_BASIC_OPTIONS += -ignore:quiet -# Multiple by 2 the timeout numbers -JTREG_BASIC_OPTIONS += -timeoutFactor:2 +JTREG_IGNORE_OPTION = -ignore:quiet +JTREG_BASIC_OPTIONS += $(JTREG_IGNORE_OPTION) +# Multiple by 4 the timeout numbers +JTREG_TIMEOUT_OPTION = -timeoutFactor:4 +JTREG_BASIC_OPTIONS += $(JTREG_TIMEOUT_OPTION) # Boost the max memory for jtreg to avoid gc thrashing -JTREG_BASIC_OPTIONS += -J-Xmx512m +JTREG_MEMORY_OPTION = -J-Xmx512m +JTREG_BASIC_OPTIONS += $(JTREG_MEMORY_OPTION) # Make sure jtreg exists $(JTREG): $(JT_HOME) @@ -603,7 +600,6 @@ jtreg_tests: prep $(PRODUCT_HOME) $(JTREG) $(EXCLUDELIST) ( \ ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \ export JT_HOME; \ - $(PREP_DISPLAY) && \ $(shell $(GETMIXEDPATH) "$(JTREG)") \ $(JTREG_BASIC_OPTIONS) \ -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport \ diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index 2edcfd4d595..bc30709bc9b 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -1,6 +1,6 @@ ########################################################################### # -# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2009-2010 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -431,6 +431,17 @@ java/lang/ClassLoader/deadlock/TestCrossDelegate.sh generic-all # jdk_management +# Fails on linux: KO: StringMonitor notification missed or not emitted +javax/management/monitor/NonComparableAttributeValueTest.java generic-all + +# Port conflict? Fails with communication error +sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh generic-all + +# Fails on Windows 2000, Test failed for iiop java.lang.NullPointerException +# at org.omg.stub.javax.management.remote.rmi._RMIConnectionImpl_Tie._invoke(Unknown Source) +# at com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:653) +javax/management/remote/mandatory/connection/ReconnectTest.java generic-all + # Solaris 10 sparc, NPE from org.omg.stub.javax.management.remote.rmi._RMIConnectionImpl_Tie._invoke javax/management/remote/mandatory/threads/ExecutorTest.java generic-all @@ -494,10 +505,6 @@ javax/management/monitor/AttributeArbitraryDataTypeTest.java generic-all # Problems with rounding add failures on solaris-sparcv9 and -server java/math/BigDecimal/AddTests.java solaris-sparcv9 -# Problems on windows with samevm, missing inputstream close()? -# Also times out on solaris-sparcv9 -server -java/math/BigInteger/BigIntegerTest.java generic-all - # Should be samevm? But seems problematic with samevm on windows java/math/BigInteger/ModPow65537.java generic-all @@ -570,6 +577,7 @@ javax/print/attribute/ChromaticityValues.java generic-all javax/print/attribute/GetCopiesSupported.java generic-all javax/print/attribute/SidesPageRangesTest.java generic-all javax/print/attribute/SupportedPrintableAreas.java generic-all +javax/print/attribute/AttributeTest.java generic-all # Only print test left, excluding just because all print tests have been javax/print/attribute/MediaMappingsTest.java generic-all @@ -581,6 +589,13 @@ javax/print/attribute/MediaMappingsTest.java generic-all # Suspect many of these tests auffer from using fixed ports, no concrete # evidence. +# Times out on Windows X64 +sun/net/www/http/KeepAliveStream/KeepAliveStreamCloseWithWrongContentLength.java generic-all + +# Dies on Solaris 10 sparc and sparcv9, Linux -ea -esa with +# Interrupted or IO exception, maybe writing to non-unique named file? +com/sun/net/httpserver/bugs/B6373555.java generic-all + # Fails on OpenSolaris, BindException unexpected java/net/BindException/Test.java generic-all @@ -628,9 +643,6 @@ java/net/ipv6tests/TcpTest.java generic-all # Linux i586, fails with unexpected output java/net/MulticastSocket/NoLoopbackPackets.java linux-i586 -# Times out on windows x64, fails with samevm on solaris 11 i586 -java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java generic-all - # Address already in use java/net/DatagramSocket/DatagramTimeout.java generic-all @@ -642,7 +654,6 @@ java/net/Socket/DeadlockTest.java generic-all java/net/Socket/AccurateTimeout.java generic-all java/net/Socket/asyncClose/BrokenPipe.java generic-all java/net/Socket/CloseAvailable.java generic-all -java/net/Socket/FDClose.java generic-all # Linux X64 address already in use, samevm issues java/net/Socket/LingerTest.java generic-all @@ -682,8 +693,6 @@ java/net/URLConnection/TimeoutTest.java generic-all java/net/URLConnection/ZeroContentLength.java generic-all # Solaris 11 i586 fails with samevm, not sure why -java/net/Authenticator/B4769350.java generic-all -java/net/HttpURLConnection/HttpResponseCode.java generic-all java/net/ResponseCache/B6181108.java generic-all java/net/ResponseCache/ResponseCacheTest.java generic-all java/net/URL/GetContent.java generic-all @@ -717,6 +726,9 @@ sun/net/www/http/KeepAliveCache/KeepAliveTimerThread.java generic-all # Connection refused, windows samevm sun/net/www/protocol/http/DigestTest.java generic-all +# Fails on Fedora 9 32bit & 64bit & Solaris 10, wrong proxy for http://localhost/index.html +java/net/ProxySelector/B6737819.java generic-all + ############################################################################ # jdk_nio @@ -724,6 +736,43 @@ sun/net/www/protocol/http/DigestTest.java generic-all # Suspect many of these tests auffer from using fixed ports, no concrete # evidence. +# Failing on Solaris x86 and Linux x86, filed 6934585 +java/nio/channels/AsynchronousSocketChannel/Basic.java generic-all + +# Occasionally Failing with java.lang.AssertionError on Windows X64 +# at sun.nio.ch.PendingIoCache.clearPendingIoMap(PendingIoCache.java:144) +#java/nio/channels/FileChannel/ReleaseOnCloseDeadlock.java windows-all + +# Some kind of sleep/wake problem on Windows X64 +java/nio/channels/Selector/Wakeup.java windows-all + +# Fails with -ea -esa, Assertion error, but only on Solaris 10 machines? +com/sun/nio/sctp/SctpChannel/Send.java generic-all +com/sun/nio/sctp/SctpChannel/Shutdown.java generic-all + +# Fails on Windows 2000, Can't delete test directory .\x.SetLastModified.dir +# at SetLastModified.main(SetLastModified.java:107) +java/io/File/SetLastModified.java generic-all + +# Fails on Solaris 10 x64, address already in use +java/nio/channels/DatagramChannel/SRTest.java generic-all + +# Fails on Solaris 10 x86, times out +java/nio/channels/DatagramChannel/Sender.java generic-all + +# Fails on Fedora 9 x86, address in use +java/nio/channels/Selector/SelectWrite.java generic-all + +# Fails on Fedora 9 32bit times out +java/nio/channels/DatagramChannel/EmptyBuffer.java generic-all + +# Fails on Windows 2000, ExceptionInInitializerError +# in WindowsAsynchronousServerSocketChannelImpl.java:316 +java/nio/channels/AsynchronousChannelGroup/Unbounded.java generic-all + +# Fails on Windows 2000, times out +java/nio/channels/FileChannel/Transfer.java generic-all + # Fails on OpenSolaris, IllegalStateException: Cannot add or remove addresses # from a channel that is bound to the wildcard address com/sun/nio/sctp/SctpChannel/Bind.java generic-all @@ -893,6 +942,69 @@ java/rmi/server/UnicastRemoteObject/unexportObject/UnexportLeak.java generic-all # jdk_security +# Failing on Solaris i586, 3/9/2010, not a -samevm issue (jdk_security3) +sun/security/pkcs11/Secmod/AddPrivateKey.java solaris-i586 +sun/security/pkcs11/ec/ReadCertificates.java solaris-i586 +sun/security/pkcs11/ec/ReadPKCS12.java solaris-i586 +sun/security/pkcs11/ec/TestCurves.java solaris-i586 +sun/security/pkcs11/ec/TestECDSA.java solaris-i586 +sun/security/pkcs11/ec/TestECGenSpec.java solaris-i586 +sun/security/pkcs11/ec/TestKeyFactory.java solaris-i586 + +# Unknown problem, could be a jtreg -samevm issue? +# Error while cleaning up threads after test +java/security/Security/SynchronizedAccess.java generic-all + +# Failing on Solaris X64 (-d64 -server) with: +# GSSException: Failure unspecified at GSS-API level +# (Mechanism level: Specified version of key is not available (44)) +sun/security/krb5/auto/BasicKrb5Test.java generic-all + +# Solaris X86 failures, readjar.jks: No such file or directory +sun/security/tools/keytool/readjar.sh generic-all + +# Fails with -ea -esa, but only on Solaris sparc? Suspect it is timing out +sun/security/tools/keytool/standard.sh generic-all + +# Fails on Solaris 10 X64, address already in use +sun/security/krb5/auto/HttpNegotiateServer.java generic-all + +# Fails on almost all platforms +# java.lang.UnsupportedClassVersionError: SerialTest : +# Unsupported major.minor version 51.0 +# at java.lang.ClassLoader.defineClass1(Native Method) +sun/security/util/Oid/S11N.sh generic-all + +# Fails on Fedora 9 32bit +# GSSException: Failure unspecified at GSS-API level (Mechanism level: +# Invalid argument (400) - Cannot find key of appropriate type to decrypt +# AP REP - DES CBC mode with MD5) +# at sun.security.jgss.krb5.Krb5Context.acceptSecContext(Krb5Context.java:778) +sun/security/krb5/auto/NonMutualSpnego.java generic-all + +# Fails on Solaris 10 sparc, GSSException: Failure unspecified at GSS-API level +# Also fails on Windows 2000 similar way +sun/security/krb5/auto/ok-as-delegate.sh generic-all + +# Fails on Windows 2000, GSSException: Failure unspecified at GSS-API level +# (Mechanism level: Request is a replay (34)) +sun/security/krb5/auto/ok-as-delegate-xrealm.sh generic-all + +# Fails on Windows 2000, ExceptionInInitializerError +sun/security/mscapi/AccessKeyStore.sh generic-all + +# Fails on Windows 2000, UnsatisfiedLinkError: libnspr4.dll: Access is denied +sun/security/pkcs11/KeyAgreement/TestDH.java generic-all + +# Fails on Windows 2000, UnsatisfiedLinkError: libnspr4.dll: Access is denied +sun/security/pkcs11/fips/ClientJSSEServerJSSE.java generic-all + +# Fails on Solaris 10, KrbException: Additional pre-authentication required (25) +sun/security/krb5/auto/basic.sh generic-all + +# Fails on Fedora 9 64bit, PKCS11Exception: CKR_DEVICE_ERROR +sun/security/pkcs11/KeyAgreement/TestDH.java generic-all + # Run too slow on Solaris 10 sparc sun/security/ssl/com/sun/net/ssl/internal/ssl/InputRecord/SSLSocketTimeoutNulls.java solaris-sparc sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/ClientTimeout.java solaris-sparc @@ -1088,6 +1200,16 @@ java/text/Bidi/Bug6665028.java linux-x64 # So most if not all tools tests are now being run with "othervm" mode. # Some of these tools tests have a tendency to use fixed ports, bad idea. +# Fails with -ea -esa on Solaris, Assertion error (Solaris specific test) +com/sun/tracing/BasicFunctionality.java generic-all + +# Fails on Fedora 9 32bit, jps output differs problem +sun/tools/jstatd/jstatdDefaults.sh generic-all + +# Fails on Linux Fedora 9 32bit, Could not read data for remote JVM 16133 +# jstat output differs from expected output +sun/tools/jstatd/jstatdExternalRegistry.sh generic-all + # Output of jps differs from expected output. # Invalid argument count on solaris-sparc and x64 sun/tools/jstatd/jstatdPort.sh generic-all @@ -1099,6 +1221,11 @@ sun/tools/jps/jps-lm.sh generic-all sun/tools/jps/jps-Vvml_2.sh generic-all sun/tools/jps/jps-m_2.sh generic-all +# Fails on Solaris 10 sparcv9, shell exits with 1 +# Turning off use of shared archive because of choice of garbage collector or large pages +# Could not synchronize with target +sun/tools/jps/jps-v_1.sh generic-all + # Fails on OpenSolaris "Could not synchronize with target" sun/tools/jps/jps-Defaults.sh generic-all sun/tools/jps/jps-V_2.sh generic-all @@ -1160,6 +1287,19 @@ tools/jar/index/MetaInf.java windows-all # jdk_util +# Fails with assertion error on windows +# 11 separate stacktraces created... file reuse problem? +java/util/zip/ZipFile/ReadLongZipFileName.java generic-all + +# Recent failure on all platforms +sun/util/resources/TimeZone/Bug6317929.java generic-all + +# Fails with -ea -esa on all platforms with Assertion error +java/util/ResourceBundle/Test4300693.java generic-all + +# Failing on all -client 32bit platforms starting with b77? See 6908348. +java/util/concurrent/BlockingQueue/CancelledProducerConsumerLoops.java generic-all + # Assert error, failures, on Linux Fedora 9 -server # Windows samevm failure, assert error "Passed = 134, failed = 2" java/util/Arrays/ArrayObjectMethods.java generic-all diff --git a/jdk/test/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java b/jdk/test/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java index 369947fc510..08a15113c22 100644 --- a/jdk/test/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java +++ b/jdk/test/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java @@ -28,7 +28,12 @@ * LoginContext * @author Brad Wetmore * - * @run main/othervm -Xmx2m TestProviderLeak + * @run main/othervm -Xmx2m -XX:OldSize=1m -XX:NewSize=512k TestProviderLeak + * + * The original test invocation is below, but had to use the above + * workaround for bug 6923123. + * + * run main/othervm -Xmx2m TestProviderLeak */ /* diff --git a/jdk/test/com/sun/jdi/NoLaunchOptionTest.java b/jdk/test/com/sun/jdi/NoLaunchOptionTest.java index b65b375c85e..14e6acd2c5d 100644 --- a/jdk/test/com/sun/jdi/NoLaunchOptionTest.java +++ b/jdk/test/com/sun/jdi/NoLaunchOptionTest.java @@ -31,6 +31,9 @@ * @build VMConnection * @run main/othervm NoLaunchOptionTest */ + +import java.net.ServerSocket; + public class NoLaunchOptionTest extends Object { private Process subprocess; private int subprocessStatus; @@ -121,12 +124,19 @@ public class NoLaunchOptionTest extends Object { } public static void main(String[] args) throws Exception { + // find a free port + ServerSocket ss = new ServerSocket(0); + int port = ss.getLocalPort(); + ss.close(); + String address = String.valueOf(port); + String javaExe = System.getProperty("java.home") + java.io.File.separator + "bin" + java.io.File.separator + "java"; String targetClass = "NotAClass"; String cmds [] = {javaExe, - "-agentlib:jdwp=transport=dt_socket,address=8000," + + "-agentlib:jdwp=transport=dt_socket,address=" + + address + "," + "onthrow=java.lang.ClassNotFoundException,suspend=n", targetClass}; NoLaunchOptionTest myTest = new NoLaunchOptionTest(); diff --git a/jdk/test/com/sun/jdi/OptionTest.java b/jdk/test/com/sun/jdi/OptionTest.java index e3d6eb60b2d..f6124d3e02a 100644 --- a/jdk/test/com/sun/jdi/OptionTest.java +++ b/jdk/test/com/sun/jdi/OptionTest.java @@ -32,6 +32,9 @@ * @run compile -g VMConnection.java * @run main/othervm OptionTest */ + +import java.net.ServerSocket; + public class OptionTest extends Object { private Process subprocess; private int subprocessStatus; @@ -122,12 +125,18 @@ public class OptionTest extends Object { } public static void main(String[] args) throws Exception { + // find a free port + ServerSocket ss = new ServerSocket(0); + int port = ss.getLocalPort(); + ss.close(); + String address = String.valueOf(port); + String javaExe = System.getProperty("java.home") + java.io.File.separator + "bin" + java.io.File.separator + "java"; String targetClass = "HelloWorld"; String baseOptions = "transport=dt_socket" + - ",address=8000" + + ",address=" + address + ",server=y" + ",suspend=n"; diff --git a/jdk/test/com/sun/jdi/ProcessAttachTest.sh b/jdk/test/com/sun/jdi/ProcessAttachTest.sh index 38ce59fc240..e1ec05996f7 100644 --- a/jdk/test/com/sun/jdi/ProcessAttachTest.sh +++ b/jdk/test/com/sun/jdi/ProcessAttachTest.sh @@ -54,10 +54,14 @@ JAVA="${TESTJAVA}/bin/java" OS=`uname -s` case "$OS" in - Windows* | CYGWIN_NT*) + Windows*) PS=";" OS="Windows" ;; + CYGWIN*) + PS=";" + OS="CYGWIN" + ;; * ) PS=":" ;; @@ -67,16 +71,23 @@ startDebuggee() { OUTPUTFILE=${TESTCLASSES}/Debuggee.out ${JAVA} "$@" > ${OUTPUTFILE} & - pid="$!" + startpid="$!" + pid="${startpid}" + # CYGWIN startpid is not the native windows PID we want, get the WINPID + if [ "${OS}" = "CYGWIN" ]; then + sleep 2 + ps -l -p ${startpid} + pid=`ps -l -p ${startpid} | tail -1 | awk '{print $4;}'` + fi + # MKS creates an intermediate shell to launch ${JAVA} so - # ${pid} is not the actual pid. We have put in a small sleep + # ${startpid} is not the actual pid. We have put in a small sleep # to give the intermediate shell process time to launch the # "java" process. if [ "$OS" = "Windows" ]; then sleep 2 - realpid=`ps -o pid,ppid,comm|grep ${pid}|grep "java"|cut -c1-6` - pid=${realpid} + pid=`ps -o pid,ppid,comm|grep ${startpid}|grep "java"|cut -c1-6` fi echo "Waiting for Debuggee to initialize..." @@ -91,7 +102,7 @@ startDebuggee() echo "Waiting $attempts second(s) ..." done - echo "Debuggee is process $pid" + echo "Debuggee is process $pid (startpid=${startpid})" } stopDebuggee() @@ -100,7 +111,7 @@ stopDebuggee() if [ $? != 0 ] ; then echo "Error: ShutdownDebuggee failed" failures=`expr $failures + 1` - kill -9 $pid + kill -9 ${startpid} fi } @@ -123,7 +134,7 @@ startDebuggee \ -agentlib:jdwp=transport=dt_socket,server=y,suspend=n \ -classpath "${TESTCLASSES}" ProcessAttachDebuggee "${PORTFILE}" -$JAVA -classpath ${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar \ +$JAVA -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \ ProcessAttachDebugger $pid 2>&1 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi @@ -141,7 +152,7 @@ startDebuggee \ -agentlib:jdwp=transport=dt_socket,server=y,suspend=y \ -classpath "${TESTCLASSES}" ProcessAttachDebuggee "${PORTFILE}" -$JAVA -classpath ${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar \ +$JAVA -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \ ProcessAttachDebugger $pid 2>&1 # The debuggee is suspended and doesn't run until the debugger diff --git a/jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh b/jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh index 6331d562987..c9570cd0b35 100644 --- a/jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh +++ b/jdk/test/com/sun/jdi/connect/spi/JdiLoadedByCustomLoader.sh @@ -51,7 +51,7 @@ case "$OS" in Linux ) PS=":" ;; - Windows* ) + Windows* | CYGWIN*) PS=";" ;; * ) @@ -71,7 +71,7 @@ SOMEOTHERDIR="${TESTCLASSES}"/someotherdir $JAVAC -d "${TESTCLASSES}" "${TESTSRC}"/JdiLoadedByCustomLoader.java mkdir "${SOMEOTHERDIR}" -$JAVAC -d "${SOMEOTHERDIR}" -classpath ${TESTSRC}${PS}${TESTJAVA}/lib/tools.jar \ +$JAVAC -d "${SOMEOTHERDIR}" -classpath "${TESTSRC}${PS}${TESTJAVA}/lib/tools.jar" \ "${TESTSRC}"/ListConnectors.java # Run the test diff --git a/jdk/test/com/sun/jndi/ldap/InvalidLdapFilters.java b/jdk/test/com/sun/jndi/ldap/InvalidLdapFilters.java new file mode 100644 index 00000000000..023841f8e96 --- /dev/null +++ b/jdk/test/com/sun/jndi/ldap/InvalidLdapFilters.java @@ -0,0 +1,311 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/** + * @test + * @bug 6916202 + * @summary More cases of invalid ldap filters accepted and processed + * @run main/othervm InvalidLdapFilters valid (cn=Babs) + * @run main/othervm InvalidLdapFilters valid (&(cn=Bob)) + * @run main/othervm InvalidLdapFilters valid (&(objectClass=*)(uid=*)) + * @run main/othervm InvalidLdapFilters valid (|(cn=Bob)) + * @run main/othervm InvalidLdapFilters valid (|(objectClass=*)(uid=*)) + * @run main/othervm InvalidLdapFilters valid (!(cn=Tim)) + * @run main/othervm InvalidLdapFilters valid (!(!(cn=Tim))) + * @run main/othervm InvalidLdapFilters valid (!(&(objectClass=*)(uid=*))) + * @run main/othervm InvalidLdapFilters valid (!(|(objectClass=*)(uid=*))) + * @run main/othervm InvalidLdapFilters valid (o=univ*of*mich*) + * @run main/othervm InvalidLdapFilters valid (seeAlso=) + * @run main/othervm InvalidLdapFilters valid (cn:caseExactMatch:=Flintstone) + * @run main/othervm InvalidLdapFilters valid (cn:=Betty) + * @run main/othervm InvalidLdapFilters valid (sn:dn:2.4.6.8.10:=Barney) + * @run main/othervm InvalidLdapFilters valid (o:dn:=Ace) + * @run main/othervm InvalidLdapFilters valid (:1.2.3:=Wilma) + * @run main/othervm InvalidLdapFilters valid (:DN:2.4.6.8.10:=Dino) + * @run main/othervm InvalidLdapFilters valid (1.2.3=abc) + * @run main/othervm InvalidLdapFilters valid (cn;lang-de;lang-en=abc) + * @run main/othervm InvalidLdapFilters valid (owner=abc) + * @run main/othervm InvalidLdapFilters valid (sn;lang-en:dn:2.4.6.8.10:=Barney) + * @run main/othervm InvalidLdapFilters valid + (&(objectClass=Person)(|(sn=Jensen)(cn=Bab*))) + * @run main/othervm InvalidLdapFilters invalid "(&(cn=Robert Dean)))" + * @run main/othervm InvalidLdapFilters invalid (&|(cn=Bob)) + * @run main/othervm InvalidLdapFilters invalid (&&(cn=Bob)) + * @run main/othervm InvalidLdapFilters invalid (|&(cn=Bob)) + * @run main/othervm InvalidLdapFilters invalid (||(cn=Bob)) + * @run main/othervm InvalidLdapFilters invalid (:1.2.:=Wilma) + * @run main/othervm InvalidLdapFilters invalid (::DN:2.4.6.8.10:=Dino) + * @run main/othervm InvalidLdapFilters invalid (:DN::2.4.6.8.10:=Dino) + * @run main/othervm InvalidLdapFilters invalid (:DN:2.4.6.8.10::=Dino) + * @run main/othervm InvalidLdapFilters invalid (:DN:2.4.6..8.10:=Dino) + * @run main/othervm InvalidLdapFilters invalid (:DN:2.4.6.8.:=Dino) + * @run main/othervm InvalidLdapFilters invalid (1.2.;::=abc) + * @run main/othervm InvalidLdapFilters invalid (1.2.3;::=abc) + * @run main/othervm InvalidLdapFilters invalid (1.2.3;x;=abc) + * @run main/othervm InvalidLdapFilters invalid (1.2.3:x::=abc) + * @run main/othervm InvalidLdapFilters invalid (1.2.3:x=abc) + * @run main/othervm InvalidLdapFilters invalid (sn;:dn:2.4.6.8.10:=Barney) + * @run main/othervm InvalidLdapFilters invalid "\"((objectClass=*)&(uid=*))\"" + * @run main/othervm InvalidLdapFilters invalid "&(objectClass=*)(uid=*)" + * @run main/othervm InvalidLdapFilters invalid "(:DN:2.4.6.8.10:cn:=Dino)" + * @run main/othervm InvalidLdapFilters invalid "(:DN:2.4.6.8.10:cn=Dino)" + * @run main/othervm InvalidLdapFilters invalid + "((objectCategory=person)(cn=u)(!(cn=u2*)))" + * @run main/othervm InvalidLdapFilters invalid + "((&(objectClass=user)(cn=andy*)(cn=steve*)(cn=bob*)))" + * + * @author Xuelei Fan + */ + +import java.io.*; +import javax.naming.*; +import javax.naming.directory.*; +import java.util.Properties; +import java.util.Hashtable; + +import java.net.Socket; +import java.net.ServerSocket; + +public class InvalidLdapFilters { + // Should we run the client or server in a separate thread? + // + // Both sides can throw exceptions, but do you have a preference + // as to which side should be the main thread. + static boolean separateServerThread = true; + + // use any free port by default + volatile int serverPort = 0; + + // Is the server ready to serve? + volatile static boolean serverReady = false; + + // Define the server side of the test. + // + // If the server prematurely exits, serverReady will be set to true + // to avoid infinite hangs. + void doServerSide() throws Exception { + ServerSocket serverSock = new ServerSocket(serverPort); + + // signal client, it's ready to accecpt connection + serverPort = serverSock.getLocalPort(); + serverReady = true; + + // accept a connection + Socket socket = serverSock.accept(); + System.out.println("Server: Connection accepted"); + + InputStream is = socket.getInputStream(); + OutputStream os = socket.getOutputStream(); + + // read the bindRequest + while (is.read() != -1) { + // ignore + is.skip(is.available()); + break; + } + + byte[] bindResponse = {0x30, 0x0C, 0x02, 0x01, 0x01, 0x61, 0x07, 0x0A, + 0x01, 0x00, 0x04, 0x00, 0x04, 0x00}; + // write bindResponse + os.write(bindResponse); + os.flush(); + + // ignore any more request. + while (is.read() != -1) { + // ignore + is.skip(is.available()); + } + + is.close(); + os.close(); + socket.close(); + serverSock.close(); + } + + // Define the client side of the test. + // + // If the server prematurely exits, serverReady will be set to true + // to avoid infinite hangs. + void doClientSide() throws Exception { + // Wait for server to get started. + while (!serverReady) { + Thread.sleep(50); + } + + // set up the environment for creating the initial context + Hashtable env = new Hashtable(); + env.put(Context.INITIAL_CONTEXT_FACTORY, + "com.sun.jndi.ldap.LdapCtxFactory"); + env.put(Context.PROVIDER_URL, "ldap://localhost:" + serverPort); + env.put("com.sun.jndi.ldap.read.timeout", "1000"); + + // env.put(Context.SECURITY_AUTHENTICATION, "simple"); + // env.put(Context.SECURITY_PRINCIPAL,"cn=root"); + // env.put(Context.SECURITY_CREDENTIALS,"root"); + + // create initial context + DirContext context = new InitialDirContext(env); + + // searching + SearchControls scs = new SearchControls(); + scs.setSearchScope(SearchControls.SUBTREE_SCOPE); + + try { + NamingEnumeration answer = + context.search("o=sun,c=us", searchFilter, scs); + } catch (InvalidSearchFilterException isfe) { + if (filterIsValid) { + // unexpected filter exception. + throw new Exception("Unexpected ISFE", isfe); + } else { + // ignore, it is the expected filter exception. + System.out.println("Expected exception: " + isfe.getMessage()); + } + } catch (NamingException ne) { + // maybe a read timeout exception, as the server does not response. + if (filterIsValid) { + System.out.println("Expected exception: " + ne.getMessage()); + } else { + throw new Exception("Not an InvalidSearchFilterException", ne); + } + } + + context.close(); + } + + private static boolean filterIsValid; + private static String searchFilter; + + private static void parseArguments(String[] args) { + System.out.println("arguments length: " + args.length); + if (args[0].equals("valid")) { + filterIsValid = true; + } + + searchFilter = args[1]; + } + + /* + * ============================================================ + * The remainder is just support stuff + */ + + // client and server thread + Thread clientThread = null; + Thread serverThread = null; + + // client and server exceptions + volatile Exception serverException = null; + volatile Exception clientException = null; + + void startServer(boolean newThread) throws Exception { + if (newThread) { + serverThread = new Thread() { + public void run() { + try { + doServerSide(); + } catch (Exception e) { + /* + * Our server thread just died. + * + * Release the client, if not active already... + */ + System.err.println("Server died..."); + System.err.println(e); + serverReady = true; + serverException = e; + } + } + }; + serverThread.start(); + } else { + doServerSide(); + } + } + + void startClient(boolean newThread) throws Exception { + if (newThread) { + clientThread = new Thread() { + public void run() { + try { + doClientSide(); + } catch (Exception e) { + /* + * Our client thread just died. + */ + System.err.println("Client died..."); + clientException = e; + } + } + }; + clientThread.start(); + } else { + doClientSide(); + } + } + + // Primary constructor, used to drive remainder of the test. + InvalidLdapFilters() throws Exception { + if (separateServerThread) { + startServer(true); + startClient(false); + } else { + startClient(true); + startServer(false); + } + + /* + * Wait for other side to close down. + */ + if (separateServerThread) { + serverThread.join(); + } else { + clientThread.join(); + } + + /* + * When we get here, the test is pretty much over. + * + * If the main thread excepted, that propagates back + * immediately. If the other thread threw an exception, we + * should report back. + */ + if (serverException != null) { + System.out.print("Server Exception:"); + throw serverException; + } + if (clientException != null) { + System.out.print("Client Exception:"); + throw clientException; + } + } + + public static void main(String[] args) throws Exception { + // parse the customized arguments + parseArguments(args); + + // start the test + new InvalidLdapFilters(); + } + +} diff --git a/jdk/test/com/sun/nio/sctp/SctpChannel/Connect.java b/jdk/test/com/sun/nio/sctp/SctpChannel/Connect.java index 78cb52770ba..33f4441d356 100644 --- a/jdk/test/com/sun/nio/sctp/SctpChannel/Connect.java +++ b/jdk/test/com/sun/nio/sctp/SctpChannel/Connect.java @@ -192,6 +192,18 @@ public class Connect { testCCE(new Callable() { public Void call() throws IOException { cceChannel.finishConnect(); return null; } }); + + /* TEST 8: IOException: Connection refused. Exercises handleSocketError. + * Assumption: no sctp socket listening on 3456 */ + SocketAddress addr = new InetSocketAddress("localhost", 3456); + channel = SctpChannel.open(); + try { + channel.connect(addr); + fail("should have thrown ConnectException: Connection refused"); + } catch (IOException ioe) { + pass(); + } + } catch (IOException ioe) { unexpected(ioe); } finally { diff --git a/jdk/test/com/sun/nio/sctp/SctpChannel/Send.java b/jdk/test/com/sun/nio/sctp/SctpChannel/Send.java index 3cee201d739..3a62147e9dc 100644 --- a/jdk/test/com/sun/nio/sctp/SctpChannel/Send.java +++ b/jdk/test/com/sun/nio/sctp/SctpChannel/Send.java @@ -112,9 +112,6 @@ public class Send { /* Receive CommUp */ channel.receive(buffer, null, handler); - /* save for TEST 8 */ - Association association = channel.association(); - /* TEST 2: send small message */ int streamNumber = 0; debug("sending on stream number: " + streamNumber); @@ -250,6 +247,29 @@ public class Send { pass(); debug("OK, caught " + e); } + + /* TEST 9: Send from heap buffer to force implementation to + * substitute with a native buffer, then check that its position + * is updated correctly */ + buffer.clear(); + info = MessageInfo.createOutgoing(null, 0); + buffer.put(Util.SMALL_MESSAGE.getBytes("ISO-8859-1")); + buffer.flip(); + final int offset = 1; + buffer.position(offset); + remaining = buffer.remaining(); + + debug("sending small message: " + buffer); + try { + sent = channel.send(buffer, info); + + check(sent == remaining, "sent should be equal to remaining"); + check(buffer.position() == (offset + sent), + "buffers position should have been incremented by sent"); + } catch (IllegalArgumentException iae) { + fail(iae + ", Error updating buffers position"); + } + } catch (IOException ioe) { unexpected(ioe); } finally { @@ -335,6 +355,30 @@ public class Send { /* TEST 7 ++ */ sc2 = ssc.accept(); + /* TEST 9 */ + ByteBuffer expected = ByteBuffer.allocate(Util.SMALL_BUFFER); + expected.put(Util.SMALL_MESSAGE.getBytes("ISO-8859-1")); + expected.flip(); + final int offset = 1; + expected.position(offset); + buffer.clear(); + do { + info = sc2.receive(buffer, null, null); + if (info == null) { + fail("Server: unexpected null from receive"); + return; + } + } while (!info.isComplete()); + + buffer.flip(); + check(info != null, "info is null"); + check(info.streamNumber() == 0, "message not sent on the correct stream"); + check(info.bytes() == expected.remaining(), + "bytes received not equal to message length"); + check(info.bytes() == buffer.remaining(), "bytes != remaining"); + check(expected.equals(buffer), + "received message not the same as sent message"); + clientFinishedLatch.await(10L, TimeUnit.SECONDS); serverFinishedLatch.countDown(); } catch (IOException ioe) { diff --git a/jdk/test/com/sun/nio/sctp/SctpChannel/SocketOptionTests.java b/jdk/test/com/sun/nio/sctp/SctpChannel/SocketOptionTests.java index d5715b17198..f5814a17bc5 100644 --- a/jdk/test/com/sun/nio/sctp/SctpChannel/SocketOptionTests.java +++ b/jdk/test/com/sun/nio/sctp/SctpChannel/SocketOptionTests.java @@ -104,7 +104,9 @@ public class SocketOptionTests { sc.setOption(SCTP_NODELAY, true); checkOption(sc, SCTP_NODELAY, true); sc.setOption(SO_SNDBUF, 16*1024); + checkOption(sc, SO_SNDBUF, 16*1024); sc.setOption(SO_RCVBUF, 16*1024); + checkOption(sc, SO_RCVBUF, 16*1024); checkOption(sc, SO_LINGER, -1); /* default should be negative */ sc.setOption(SO_LINGER, 2000); checkOption(sc, SO_LINGER, 2000); diff --git a/jdk/test/com/sun/nio/sctp/SctpMultiChannel/Send.java b/jdk/test/com/sun/nio/sctp/SctpMultiChannel/Send.java index b7d1379d174..1f56c5df67e 100644 --- a/jdk/test/com/sun/nio/sctp/SctpMultiChannel/Send.java +++ b/jdk/test/com/sun/nio/sctp/SctpMultiChannel/Send.java @@ -185,6 +185,27 @@ public class Send { /* TEST 5: getRemoteAddresses(Association) */ channel.getRemoteAddresses(assoc); + /* TEST 6: Send from heap buffer to force implementation to + * substitute with a native buffer, then check that its position + * is updated correctly */ + info = MessageInfo.createOutgoing(assoc, null, 0); + buffer.clear(); + buffer.put(Util.SMALL_MESSAGE.getBytes("ISO-8859-1")); + buffer.flip(); + final int offset = 1; + buffer.position(offset); + remaining = buffer.remaining(); + + try { + sent = channel.send(buffer, info); + + check(sent == remaining, "sent should be equal to remaining"); + check(buffer.position() == (offset + sent), + "buffers position should have been incremented by sent"); + } catch (IllegalArgumentException iae) { + fail(iae + ", Error updating buffers position"); + } + } catch (IOException ioe) { unexpected(ioe); } finally { @@ -284,6 +305,30 @@ public class Send { bytes = serverChannel.send(buffer, info); debug("Server: sent " + bytes + "bytes"); + /* TEST 6 */ + ByteBuffer expected = ByteBuffer.allocate(Util.SMALL_BUFFER); + expected.put(Util.SMALL_MESSAGE.getBytes("ISO-8859-1")); + expected.flip(); + final int offset = 1; + expected.position(offset); + buffer.clear(); + do { + info = serverChannel.receive(buffer, null, null); + if (info == null) { + fail("Server: unexpected null from receive"); + return; + } + } while (!info.isComplete()); + + buffer.flip(); + check(info != null, "info is null"); + check(info.streamNumber() == 0, "message not sent on the correct stream"); + check(info.bytes() == expected.remaining(), + "bytes received not equal to message length"); + check(info.bytes() == buffer.remaining(), "bytes != remaining"); + check(expected.equals(buffer), + "received message not the same as sent message"); + clientFinishedLatch.await(10L, TimeUnit.SECONDS); serverFinishedLatch.countDown(); } catch (IOException ioe) { diff --git a/jdk/test/com/sun/tools/attach/ApplicationSetup.sh b/jdk/test/com/sun/tools/attach/ApplicationSetup.sh index fa8509ec394..0bd7a1b5693 100644 --- a/jdk/test/com/sun/tools/attach/ApplicationSetup.sh +++ b/jdk/test/com/sun/tools/attach/ApplicationSetup.sh @@ -49,7 +49,11 @@ startApplication() # "java" process. if [ "$OS" = "Windows" ]; then sleep 2 - realpid=`ps -o pid,ppid,comm|grep ${pid}|grep "java"|cut -c1-6` + if [ "${isCygwin}" = "true" ] ; then + realpid=`ps -p ${pid} | tail -1 | awk '{print $4;}'` + else + realpid=`ps -o pid,ppid,comm|grep ${pid}|grep "java"|cut -c1-6` + fi pid=${realpid} fi @@ -57,7 +61,7 @@ startApplication() attempts=0 while true; do sleep 1 - port=`tail -1 ${OUTPUTFILE}` + port=`tail -1 ${OUTPUTFILE} | sed -e 's@\\r@@g' ` if [ ! -z "$port" ]; then # In case of errors wait time for output to be flushed sleep 1 diff --git a/jdk/test/com/sun/tools/attach/BasicTests.sh b/jdk/test/com/sun/tools/attach/BasicTests.sh index a960b40e15d..f5c4076581e 100644 --- a/jdk/test/com/sun/tools/attach/BasicTests.sh +++ b/jdk/test/com/sun/tools/attach/BasicTests.sh @@ -48,7 +48,7 @@ failures=0 echo "Running tests ..." -$JAVA -classpath ${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar \ +$JAVA -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \ BasicTests $pid $agent $badagent $redefineagent 2>&1 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi diff --git a/jdk/test/com/sun/tools/attach/CommonSetup.sh b/jdk/test/com/sun/tools/attach/CommonSetup.sh index 1520ca72b57..66d90fafddd 100644 --- a/jdk/test/com/sun/tools/attach/CommonSetup.sh +++ b/jdk/test/com/sun/tools/attach/CommonSetup.sh @@ -49,6 +49,12 @@ case "$OS" in OS="Windows" FS="\\" ;; + CYGWIN* ) + PS=";" + OS="Windows" + FS="\\" + isCygwin=true + ;; * ) echo "Unrecognized system!" exit 1; diff --git a/jdk/test/com/sun/tools/attach/PermissionTests.sh b/jdk/test/com/sun/tools/attach/PermissionTests.sh index 908e93ec077..54a7e61a7e0 100644 --- a/jdk/test/com/sun/tools/attach/PermissionTests.sh +++ b/jdk/test/com/sun/tools/attach/PermissionTests.sh @@ -48,7 +48,7 @@ startApplication echo "Deny test" # deny -$JAVA -classpath ${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar \ +$JAVA -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \ -Djava.security.manager \ -Djava.security.policy=${TESTSRC}/java.policy.deny \ PermissionTest $pid true 2>&1 @@ -56,7 +56,7 @@ if [ $? != 0 ]; then failures=`expr $failures + 1`; fi # allow echo "Allow test" -$JAVA -classpath ${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar \ +$JAVA -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \ -Djava.security.manager \ -Djava.security.policy=${TESTSRC}/java.policy.allow \ PermissionTest $pid false 2>&1 diff --git a/jdk/test/com/sun/tools/attach/ProviderTests.sh b/jdk/test/com/sun/tools/attach/ProviderTests.sh index caca75af0e7..36a90b13535 100644 --- a/jdk/test/com/sun/tools/attach/ProviderTests.sh +++ b/jdk/test/com/sun/tools/attach/ProviderTests.sh @@ -46,6 +46,6 @@ $JAR -cf ${TESTCLASSES}/SimpleProvider.jar \ echo "Running test ..." $JAVA -classpath \ - ${TESTCLASSES}${PS}${TESTCLASSES}/SimpleProvider.jar${PS}${TESTJAVA}/lib/tools.jar \ + "${TESTCLASSES}${PS}${TESTCLASSES}/SimpleProvider.jar${PS}${TESTJAVA}/lib/tools.jar" \ ProviderTest diff --git a/jdk/test/demo/jvmti/compiledMethodLoad/CompiledMethodLoadTest.java b/jdk/test/demo/jvmti/compiledMethodLoad/CompiledMethodLoadTest.java new file mode 100644 index 00000000000..de0d1b962a8 --- /dev/null +++ b/jdk/test/demo/jvmti/compiledMethodLoad/CompiledMethodLoadTest.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + + +/* @test + * @bug 6580131 + * @summary Test jvmti demo compiledMethodLoad + * + * @compile ../DemoRun.java ../Hello.java + * @build CompiledMethodLoadTest + * @run main CompiledMethodLoadTest Hello + */ + +public class CompiledMethodLoadTest { + + public static void main(String args[]) throws Exception { + DemoRun demo; + + /* Run demo that uses JVMTI compiledMethodLoad agent (no options) */ + demo = new DemoRun("compiledMethodLoad", "" /* options to compiledMethodLoad */ ); + demo.runit(args[0]); + + /* Make sure patterns in output look ok */ + if (demo.output_contains("ERROR")) { + throw new RuntimeException("Test failed - ERROR seen in output"); + } + + /* Must be a pass. */ + System.out.println("Test passed - cleanly terminated"); + } +} diff --git a/jdk/test/demo/jvmti/heapTracker/HeapTrackerTest.java b/jdk/test/demo/jvmti/heapTracker/HeapTrackerTest.java index 20e05de4f4a..9f0b70a4ab0 100644 --- a/jdk/test/demo/jvmti/heapTracker/HeapTrackerTest.java +++ b/jdk/test/demo/jvmti/heapTracker/HeapTrackerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2004-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ public class HeapTrackerTest { /* Make sure patterns in output look ok */ if (demo.output_contains("ERROR")) { - throw new RuntimeException("Test failed - ERROR seen in oputput"); + throw new RuntimeException("Test failed - ERROR seen in output"); } /* Must be a pass. */ diff --git a/jdk/test/demo/jvmti/hprof/CpuTimesDefineClassTest.java b/jdk/test/demo/jvmti/hprof/CpuTimesDefineClassTest.java index 63cfcb3e5c4..922aafc19ee 100644 --- a/jdk/test/demo/jvmti/hprof/CpuTimesDefineClassTest.java +++ b/jdk/test/demo/jvmti/hprof/CpuTimesDefineClassTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2004-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,7 @@ public class CpuTimesDefineClassTest { /* Make sure patterns in output look ok */ if (hprof.output_contains("ERROR")) { - throw new RuntimeException("Test failed - ERROR seen in oputput"); + throw new RuntimeException("Test failed - ERROR seen in output"); } /* Must be a pass. */ diff --git a/jdk/test/demo/jvmti/hprof/CpuTimesTest.java b/jdk/test/demo/jvmti/hprof/CpuTimesTest.java index a99d384494b..3e378d414f8 100644 --- a/jdk/test/demo/jvmti/hprof/CpuTimesTest.java +++ b/jdk/test/demo/jvmti/hprof/CpuTimesTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2004-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ public class CpuTimesTest { /* Make sure patterns in output look ok */ if (hprof.output_contains("ERROR")) { - throw new RuntimeException("Test failed - ERROR seen in oputput"); + throw new RuntimeException("Test failed - ERROR seen in output"); } /* Must be a pass. */ diff --git a/jdk/test/demo/jvmti/minst/MinstTest.java b/jdk/test/demo/jvmti/minst/MinstTest.java index 70c64344a64..fbc9adfce5b 100644 --- a/jdk/test/demo/jvmti/minst/MinstTest.java +++ b/jdk/test/demo/jvmti/minst/MinstTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2006-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ public class MinstTest { /* Make sure patterns in output look ok */ if (demo.output_contains("ERROR")) { - throw new RuntimeException("Test failed - ERROR seen in oputput"); + throw new RuntimeException("Test failed - ERROR seen in output"); } /* Must be a pass. */ diff --git a/jdk/test/demo/jvmti/mtrace/TraceJFrame.java b/jdk/test/demo/jvmti/mtrace/TraceJFrame.java index 34def2770c2..d80c578c4a9 100644 --- a/jdk/test/demo/jvmti/mtrace/TraceJFrame.java +++ b/jdk/test/demo/jvmti/mtrace/TraceJFrame.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2004-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ public class TraceJFrame { /* Make sure patterns in output look ok */ if (demo.output_contains("ERROR")) { - throw new RuntimeException("Test failed - ERROR seen in oputput"); + throw new RuntimeException("Test failed - ERROR seen in output"); } /* Must be a pass. */ diff --git a/jdk/test/java/awt/AlphaComposite/TestAlphaCompositeForNaN.java b/jdk/test/java/awt/AlphaComposite/TestAlphaCompositeForNaN.java new file mode 100644 index 00000000000..2b9fb6e2f2e --- /dev/null +++ b/jdk/test/java/awt/AlphaComposite/TestAlphaCompositeForNaN.java @@ -0,0 +1,22 @@ +/* + * @test + * @bug 6918065 + * @summary Test for passing NaN as alpha + * should throw IllegalArgumentException + */ + +import java.awt.*; + +public class TestAlphaCompositeForNaN { + public static void main(String[] args) { + try { + AlphaComposite a = AlphaComposite.getInstance(AlphaComposite.DST, Float.NaN); + System.out.println("Failed"); + throw new RuntimeException(a + " failed to throw IllegalArgumentException for alpha = " + Float.NaN); + } + catch (IllegalArgumentException ie) { + System.out.println("Passed"); + System.out.println("Caught " + ie); + } + } +} diff --git a/jdk/test/java/awt/EventQueue/PushPopDeadlock2/PushPopTest.java b/jdk/test/java/awt/EventQueue/PushPopDeadlock2/PushPopTest.java new file mode 100644 index 00000000000..dbc30c1f668 --- /dev/null +++ b/jdk/test/java/awt/EventQueue/PushPopDeadlock2/PushPopTest.java @@ -0,0 +1,103 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + @test + @bug 4913324 + @author Oleg Sukhodolsky: area=eventqueue + @run main/timeout=30 PushPopTest +*/ + +import java.awt.*; +import java.awt.event.*; +import java.util.EmptyStackException; +import sun.awt.SunToolkit; + +public class PushPopTest { + + public static Frame frame; + public static void main(String[] args) { + frame = new Frame(""); + frame.pack(); + + Runnable dummy = new Runnable() { + public void run() { + System.err.println("Dummy is here."); + } + }; + EventQueue seq = Toolkit.getDefaultToolkit().getSystemEventQueue(); + MyEventQueue1 eq1 = new MyEventQueue1(); + MyEventQueue2 eq2 = new MyEventQueue2(); + EventQueue.invokeLater(dummy); + + seq.push(eq1); + EventQueue.invokeLater(dummy); + + eq1.push(eq2); + EventQueue.invokeLater(dummy); + Runnable runnable = new Runnable() { + public void run() { + System.err.println("Dummy from SunToolkit"); + } + }; + InvocationEvent ie = new InvocationEvent(eq2, runnable, null, false); + System.err.println(ie); + SunToolkit.postEvent(SunToolkit.targetToAppContext(frame), ie); + eq1.pop(); + frame.dispose(); + } +} + +class MyEventQueue1 extends EventQueue { + + public void pop() throws EmptyStackException { + super.pop(); + } +} + +class MyEventQueue2 extends EventQueue { + + protected void pop() throws EmptyStackException { + System.err.println("pop2()"); + Thread.dumpStack(); + try { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + Runnable runnable = new Runnable() { + public void run() { + System.err.println("Dummy from here"); + } + }; + InvocationEvent ie = new InvocationEvent(MyEventQueue2.this, runnable, null, false); + SunToolkit.postEvent(SunToolkit.targetToAppContext(PushPopTest.frame), ie); + postEvent(ie); + } + }); + } catch (InterruptedException ie) { + ie.printStackTrace(); + } catch (java.lang.reflect.InvocationTargetException ie) { + ie.printStackTrace(); + } + super.pop(); + } +} diff --git a/jdk/test/java/awt/FileDialog/MultipleMode/MultipleMode.html b/jdk/test/java/awt/FileDialog/MultipleMode/MultipleMode.html new file mode 100644 index 00000000000..a52ee581eba --- /dev/null +++ b/jdk/test/java/awt/FileDialog/MultipleMode/MultipleMode.html @@ -0,0 +1,20 @@ + + + + MultipleMode + + + +

      MultipleMode
      Bug ID: 6467204

      + +

      See the dialog box (usually in upper left corner) for instructions

      + + + + diff --git a/jdk/test/java/awt/FileDialog/MultipleMode/MultipleMode.java b/jdk/test/java/awt/FileDialog/MultipleMode/MultipleMode.java new file mode 100644 index 00000000000..b231b9e9c84 --- /dev/null +++ b/jdk/test/java/awt/FileDialog/MultipleMode/MultipleMode.java @@ -0,0 +1,289 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + test + @bug 6467204 + @summary Need to implement "extended" native FileDialog for JFileChooser + @author dmitry.cherepanov@sun.com area=awt.filedialog + @run applet/manual=yesno MultipleMode.html +*/ + +// Note there is no @ in front of test above. This is so that the +// harness will not mistake this file as a test file. It should +// only see the html file as a test file. (the harness runs all +// valid test files, so it would run this test twice if this file +// were valid as well as the html file.) +// Also, note the area= after Your Name in the author tag. Here, you +// should put which functional area the test falls in. See the +// AWT-core home page -> test areas and/or -> AWT team for a list of +// areas. +// There are several places where ManualYesNoTest appear. It is +// recommended that these be changed by a global search and replace, +// such as ESC-% in xemacs. + + + +/** + * MultipleMode.java + * + * summary: + */ + +import java.applet.Applet; +import java.awt.*; +import java.awt.event.*; +import java.io.File; + + +//Manual tests should run as applet tests if possible because they +// get their environments cleaned up, including AWT threads, any +// test created threads, and any system resources used by the test +// such as file descriptors. (This is normally not a problem as +// main tests usually run in a separate VM, however on some platforms +// such as the Mac, separate VMs are not possible and non-applet +// tests will cause problems). Also, you don't have to worry about +// synchronisation stuff in Applet tests the way you do in main +// tests... + + +public class MultipleMode extends Applet +{ + //Declare things used in the test, like buttons and labels here + + public void init() + { + //Create instructions for the user here, as well as set up + // the environment -- set the layout manager, add buttons, + // etc. + this.setLayout (new BorderLayout ()); + + String[] instructions = + { + " 1. Turn the 'multiple' checkbox off and press the 'open' button ", + " 2. Verify that the file dialog doesn't allow the multiple file selection ", + " 3. Select any file and close the file dialog ", + " 4. The results will be displayed, verify the results ", + " 5. Turn the 'multiple' checkbox on and press the 'open' button ", + " 6. Verify that the file dialog allows the multiple file selection ", + " 7. Select several files and close the file dialog ", + " 8. The results will be displayed, verify the results " + }; + Sysout.createDialogWithInstructions( instructions ); + + }//End init() + + public void start () + { + final Checkbox mode = new Checkbox("multiple", true); + Button open = new Button("open"); + open.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + FileDialog d = new FileDialog((Frame)null); + d.setMultipleMode(mode.getState()); + d.setVisible(true); + + // print the results + Sysout.println("DIR:"); + Sysout.println(d.getDirectory()); + Sysout.println("FILE:"); + Sysout.println(d.getFile()); + Sysout.println("FILES:"); + File files[] = d.getFiles(); + for (File f : files) { + Sysout.println(String.valueOf(f)); + } + } + }); + + setLayout(new FlowLayout()); + add(mode); + add(open); + + //Get things going. Request focus, set size, et cetera + setSize (200,200); + setVisible(true); + validate(); + + }// start() + + //The rest of this class is the actions which perform the test... + + //Use Sysout.println to communicate with the user NOT System.out!! + //Sysout.println ("Something Happened!"); + +}// class ManualYesNoTest + +/* Place other classes related to the test after this line */ + + + + + +/**************************************************** + Standard Test Machinery + DO NOT modify anything below -- it's a standard + chunk of code whose purpose is to make user + interaction uniform, and thereby make it simpler + to read and understand someone else's test. + ****************************************************/ + +/** + This is part of the standard test machinery. + It creates a dialog (with the instructions), and is the interface + for sending text messages to the user. + To print the instructions, send an array of strings to Sysout.createDialog + WithInstructions method. Put one line of instructions per array entry. + To display a message for the tester to see, simply call Sysout.println + with the string to be displayed. + This mimics System.out.println but works within the test harness as well + as standalone. + */ + +class Sysout +{ + private static TestDialog dialog; + private static boolean numbering = false; + private static int messageNumber = 0; + + public static void createDialogWithInstructions( String[] instructions ) + { + dialog = new TestDialog( new Frame(), "Instructions" ); + dialog.printInstructions( instructions ); + dialog.setVisible(true); + println( "Any messages for the tester will display here." ); + } + + public static void createDialog( ) + { + dialog = new TestDialog( new Frame(), "Instructions" ); + String[] defInstr = { "Instructions will appear here. ", "" } ; + dialog.printInstructions( defInstr ); + dialog.setVisible(true); + println( "Any messages for the tester will display here." ); + } + + /* Enables message counting for the tester. */ + public static void enableNumbering(boolean enable){ + numbering = enable; + } + + public static void printInstructions( String[] instructions ) + { + dialog.printInstructions( instructions ); + } + + + public static void println( String messageIn ) + { + if (numbering) { + messageIn = "" + messageNumber + " " + messageIn; + messageNumber++; + } + dialog.displayMessage( messageIn ); + } + +}// Sysout class + +/** + This is part of the standard test machinery. It provides a place for the + test instructions to be displayed, and a place for interactive messages + to the user to be displayed. + To have the test instructions displayed, see Sysout. + To have a message to the user be displayed, see Sysout. + Do not call anything in this dialog directly. + */ +class TestDialog extends Dialog +{ + + TextArea instructionsText; + TextArea messageText; + int maxStringLength = 80; + + //DO NOT call this directly, go through Sysout + public TestDialog( Frame frame, String name ) + { + super( frame, name ); + int scrollBoth = TextArea.SCROLLBARS_BOTH; + instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); + add( "North", instructionsText ); + + messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); + add("Center", messageText); + + pack(); + + setVisible(true); + }// TestDialog() + + //DO NOT call this directly, go through Sysout + public void printInstructions( String[] instructions ) + { + //Clear out any current instructions + instructionsText.setText( "" ); + + //Go down array of instruction strings + + String printStr, remainingStr; + for( int i=0; i < instructions.length; i++ ) + { + //chop up each into pieces maxSringLength long + remainingStr = instructions[ i ]; + while( remainingStr.length() > 0 ) + { + //if longer than max then chop off first max chars to print + if( remainingStr.length() >= maxStringLength ) + { + //Try to chop on a word boundary + int posOfSpace = remainingStr. + lastIndexOf( ' ', maxStringLength - 1 ); + + if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; + + printStr = remainingStr.substring( 0, posOfSpace + 1 ); + remainingStr = remainingStr.substring( posOfSpace + 1 ); + } + //else just print + else + { + printStr = remainingStr; + remainingStr = ""; + } + + instructionsText.append( printStr + "\n" ); + + }// while + + }// for + + }//printInstructions() + + //DO NOT call this directly, go through Sysout + public void displayMessage( String messageIn ) + { + messageText.append( messageIn + "\n" ); + System.out.println(messageIn); + } + +}// TestDialog class diff --git a/jdk/test/java/awt/FontClass/FontPrivilege.java b/jdk/test/java/awt/FontClass/FontPrivilege.java new file mode 100644 index 00000000000..c0442874509 --- /dev/null +++ b/jdk/test/java/awt/FontClass/FontPrivilege.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 5010310 6319835 6904882 + * @summary test fonts can be created in the presence of a security manager + * @run main/othervm/secure=java.lang.SecurityManager FontPrivilege + */ + +import java.awt.Font; + +public class FontPrivilege { + + public static void main(String[] args) throws Exception { + new Font("Helvetica", Font.PLAIN, 12).getFamily(); + new Font("foo bar", Font.PLAIN, 12).getFamily(); + } +} diff --git a/jdk/test/java/awt/GraphicsEnvironment/TestGetDefScreenDevice.java b/jdk/test/java/awt/GraphicsEnvironment/TestGetDefScreenDevice.java new file mode 100644 index 00000000000..33c7eb92ce7 --- /dev/null +++ b/jdk/test/java/awt/GraphicsEnvironment/TestGetDefScreenDevice.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6896335 + * @summary Test GraphicsEnvironment.getDefaultScreenDevice() in headless mode + * @run main/othervm -Djava.awt.headless=true TestGetDefScreenDevice + */ + +import java.awt.*; +public class TestGetDefScreenDevice { + + public static void main(String[] args) throws Exception { + GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); + try { + ge.getDefaultScreenDevice(); + throw new Exception("Failed. HeadlessException not thrown"); + } catch (HeadlessException he) { + // OK, test passed. + } + } +} diff --git a/jdk/test/java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java b/jdk/test/java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java index 10028be30d5..ac963e7622d 100644 --- a/jdk/test/java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java +++ b/jdk/test/java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java @@ -50,13 +50,7 @@ test import java.applet.Applet; import java.awt.*; -import java.lang.reflect.InvocationTargetException; import java.awt.event.*; -import java.awt.peer.DialogPeer; -import java.awt.peer.ComponentPeer; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; -import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import test.java.awt.regtesthelpers.Util; @@ -94,11 +88,13 @@ public class TestDialogTypeAhead extends Applet } }, AWTEvent.KEY_EVENT_MASK); + KeyboardFocusManager.setCurrentKeyboardFocusManager(new TestKFM()); + this.setLayout (new BorderLayout ()); f = new Frame("frame"); b = new Button("press"); - d = new TestDialog(f, "dialog", true, robotSema); + d = new Dialog(f, "dialog", true); ok = new Button("ok"); d.add(ok); d.pack(); @@ -170,6 +166,11 @@ public class TestDialogTypeAhead extends Applet } catch (InterruptedException ie) { throw new RuntimeException("Interrupted!"); } + if (!robotSema.getState()) { + throw new RuntimeException("robotSema hasn't been triggered"); + } + + System.err.println("typing ahead"); robot.keyPress(KeyEvent.VK_SPACE); robot.keyRelease(KeyEvent.VK_SPACE); waitForIdle(); @@ -278,65 +279,14 @@ public class TestDialogTypeAhead extends Applet } } - // Fix for 6446952. - // In the process of showing the dialog we have to catch peer.show() call - // so that to trigger key events just before it gets invoked. - // We base on the fact that a modal dialog sets type-ahead markers - // before it calls 'show' on the peer. - // Posting the key events before dialog.setVisible(true) would be actually not - // good because it would be Ok to dispatch them to the current focus owner, - // not to the dialog. - class TestDialog extends Dialog { - ComponentPeer origDialogPeer; - ComponentPeer proxyInstPeer; - Semaphore trigger; + class TestKFM extends DefaultKeyboardFocusManager { + protected synchronized void enqueueKeyEvents(long after, + Component untilFocused) + { + super.enqueueKeyEvents(after, untilFocused); - TestDialog(Frame owner, String title, boolean modal, Semaphore trigger) { - super(owner, title, modal); - this.trigger = trigger; - } - public ComponentPeer getPeer() { - ComponentPeer ret = super.getPeer(); - if (ret == proxyInstPeer) { - return origDialogPeer; - } else { - return ret; - } - } - - public void addNotify() { - super.addNotify(); - replacePeer(); - } - - void replacePeer() { - origDialogPeer = getPeer(); - - InvocationHandler handler = new InvocationHandler() { - public Object invoke(Object proxy, Method method, Object[] args) { - if (method.getName() == "show") { - trigger.raise(); - } - - Object ret = null; - try { - ret = method.invoke(origDialogPeer, args); - } catch (IllegalAccessException iae) { - throw new Error("Test error.", iae); - } catch (InvocationTargetException ita) { - throw new Error("Test error.", ita); - } - return ret; - } - }; - - proxyInstPeer = (DialogPeer)Proxy.newProxyInstance( - DialogPeer.class.getClassLoader(), new Class[] {DialogPeer.class}, handler); - - try { - Util.getField(Component.class, "peer").set(d, proxyInstPeer); - } catch (IllegalAccessException iae) { - throw new Error("Test error.", iae); + if (untilFocused == TestDialogTypeAhead.this.ok) { + TestDialogTypeAhead.this.robotSema.raise(); } } } diff --git a/jdk/test/java/awt/PrintJob/Security/SecurityDialogTest.java b/jdk/test/java/awt/PrintJob/Security/SecurityDialogTest.java new file mode 100644 index 00000000000..bf8c86f3106 --- /dev/null +++ b/jdk/test/java/awt/PrintJob/Security/SecurityDialogTest.java @@ -0,0 +1,105 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/** + * @test + * @bug 6195901 6195923 6195928 6195933 6491273 6888734 + * @summary No SecurityException should be thrown when printing to a file + using the given policy. + Print to file option should be selected. + * @run main/othervm/policy=policy SecurityDialogTest + */ +import java.awt.*; +import java.awt.event.*; +import java.util.*; +import java.io.*; + + +public class SecurityDialogTest extends Frame implements ActionListener { + // Declare things used in the test, like buttons and labels here + + Button nativeDlg, setSecurity; + boolean isNative = true; + + public SecurityDialogTest() { + + nativeDlg = new Button("Print Dialog"); + nativeDlg.addActionListener(this); + setSecurity = new Button("Toggle Dialog"); + setSecurity.addActionListener(this); + add("South", nativeDlg); + add("North", setSecurity); + setSize(300, 300); + setVisible(true); + } + + public static void main(String args[]) { + System.out.println("Native dialog is the default"); + SecurityDialogTest test = new SecurityDialogTest(); + } + + public void actionPerformed(ActionEvent e) { + + if (e.getSource() == setSecurity) { + if (isNative) { + isNative = false; + System.out.println("Common dialog is the default"); + + } else { + isNative = true; + System.out.println("Native dialog is the default"); + } + return; + } + + JobAttributes ja = new JobAttributes(); + PageAttributes pa = new PageAttributes(); + + if (isNative) { + ja.setDialog(JobAttributes.DialogType.NATIVE); + } else { + ja.setDialog(JobAttributes.DialogType.COMMON); + } + ja.setDestination(JobAttributes.DestinationType.FILE); + ja.setFileName("mohan.ps"); + + + PrintJob pjob = getToolkit().getPrintJob(this, null, ja, pa); + + if (pjob != null) { + Graphics pg = pjob.getGraphics(); + System.out.println("PJOB: " + pjob); + if (pg != null) { + System.out.println("Printer Graphics: " + pg); + this.printAll(pg); + pg.dispose(); + } else { + System.out.println("Printer Graphics is null"); + } + pjob.end(); + System.out.println("DONE"); + } else { + System.out.println("PJOB is null"); + } + } +} diff --git a/jdk/test/java/awt/PrintJob/Security/policy b/jdk/test/java/awt/PrintJob/Security/policy new file mode 100644 index 00000000000..da2ab38ed31 --- /dev/null +++ b/jdk/test/java/awt/PrintJob/Security/policy @@ -0,0 +1,32 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* AUTOMATICALLY GENERATED ON Thu Jan 03 15:48:39 PST 2002*/ +/* DO NOT EDIT */ + +grant { + permission java.io.FilePermission "<>", "read,write"; + permission java.lang.RuntimePermission "queuePrintJob"; + permission java.lang.RuntimePermission "setSecurityManager"; +}; + diff --git a/jdk/test/java/awt/TextArea/UsingWithMouse/SelectionAutoscrollTest.java b/jdk/test/java/awt/TextArea/UsingWithMouse/SelectionAutoscrollTest.java index 08ad5d1211f..5c7a70a03a5 100644 --- a/jdk/test/java/awt/TextArea/UsingWithMouse/SelectionAutoscrollTest.java +++ b/jdk/test/java/awt/TextArea/UsingWithMouse/SelectionAutoscrollTest.java @@ -56,6 +56,7 @@ public class SelectionAutoscrollTest extends Applet { TextArea textArea; Robot robot; final int desiredSelectionEnd = ('z'-'a'+1)*2; // 52 + final static int SCROLL_DELAY = 10; // ms public void start () { createObjects(); @@ -126,6 +127,8 @@ public class SelectionAutoscrollTest extends Applet { moveMouseBelowTextArea( tremble%2!=0 ); Util.waitForIdle( robot ); + // it is needed to add some small delay on Gnome + waitUntilScrollIsPerformed(robot); } robot.mouseRelease( MouseEvent.BUTTON1_MASK ); @@ -141,9 +144,19 @@ public class SelectionAutoscrollTest extends Applet { void moveMouseBelowTextArea( boolean shift ) { Dimension d = textArea.getSize(); Point l = textArea.getLocationOnScreen(); + int x = (int)(l.x+d.width*.5); int y = (int)(l.y+d.height*1.5); if( shift ) y+=15; - robot.mouseMove( (int)(l.x+d.width*.5), y ); + robot.mouseMove( x, y ); + } + + void waitUntilScrollIsPerformed(Robot robot) { + try { + Thread.sleep( SCROLL_DELAY ); + } + catch( Exception e ) { + throw new RuntimeException( e ); + } } void checkResults() { diff --git a/jdk/test/java/awt/Window/WindowType/WindowType.java b/jdk/test/java/awt/Window/WindowType/WindowType.java new file mode 100644 index 00000000000..9f277973fa5 --- /dev/null +++ b/jdk/test/java/awt/Window/WindowType/WindowType.java @@ -0,0 +1,61 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + @test + @bug 6402325 + @summary Test showing windows of different types + @author anthony.petrov@sun.com: area=awt.toplevel + @library ../../regtesthelpers + @build Util + @run main WindowType +*/ + +import java.awt.*; +import test.java.awt.regtesthelpers.Util; + +/** + * WindowType.java + * Summary: Test showing windows of different types. + */ +public class WindowType { + private static void test(Window window, Window.Type type) { + window.setType(type); + + window.setVisible(true); + Util.waitForIdle(null); + window.setVisible(false); + } + + private static void test(Window.Type type) { + test(new Window((Frame)null), type); + test(new Frame(), type); + test(new Dialog((Frame)null), type); + } + + public static void main(String[] args) { + test(Window.Type.NORMAL); + test(Window.Type.UTILITY); + test(Window.Type.POPUP); + } +} diff --git a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.inline.hpp b/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/AbsoluteComponentCenterCalculator.java similarity index 63% rename from hotspot/src/share/vm/gc_implementation/g1/ptrQueue.inline.hpp rename to jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/AbsoluteComponentCenterCalculator.java index c3ff2260ffd..83bb3dfecd3 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/ptrQueue.inline.hpp +++ b/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/AbsoluteComponentCenterCalculator.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -19,23 +19,16 @@ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. - * */ -void PtrQueue::handle_zero_index() { - assert(0 == _index, "Precondition."); - // This thread records the full buffer and allocates a new one (while - // holding the lock if there is one). - void** buf = _buf; - _buf = qset()->allocate_buffer(); - _sz = qset()->buffer_size(); - _index = _sz; - assert(0 <= _index && _index <= _sz, "Invariant."); - if (buf != NULL) { - if (_lock) { - locking_enqueue_completed_buffer(buf); - } else { - qset()->enqueue_complete_buffer(buf); +import java.awt.*; + +class AbsoluteComponentCenterCalculator { + private AbsoluteComponentCenterCalculator () {} + public static int calculateXCenterCoordinate(Component component) { + return (int)component.getLocationOnScreen().getX()+(component.getWidth()/2); + } + public static int calculateYCenterCoordinate(Component component) { + return (int)component.getLocationOnScreen().getY()+(component.getHeight()/2); } - } } diff --git a/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/DragUnicodeBetweenJVMTest.html b/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/DragUnicodeBetweenJVMTest.html new file mode 100644 index 00000000000..49fbaced533 --- /dev/null +++ b/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/DragUnicodeBetweenJVMTest.html @@ -0,0 +1,25 @@ + + + + REG: DnD of File-List between JVM is broken for non ASCII file names - Win32 + + + +

      DragUnicodeBetweenJVMTest
      Bug ID: 5098433

      + +

      This is an AUTOMATIC test, simply wait for completion

      + + + + diff --git a/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/DragUnicodeBetweenJVMTest.java b/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/DragUnicodeBetweenJVMTest.java new file mode 100644 index 00000000000..e64f15b63f2 --- /dev/null +++ b/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/DragUnicodeBetweenJVMTest.java @@ -0,0 +1,193 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + test + @bug 5098433 + @summary REG: DnD of File-List between JVM is broken for non ASCII file names - Win32 + @author Denis Fokin: area=dnd + @library ../../regtesthelpers + @library ../../regtesthelpers/process + @build Util + @build ProcessResults ProcessCommunicator + + + @run applet/othervm DragUnicodeBetweenJVMTest.html +*/ + +/** + * DragUnicodeBetweenJVMTest.java + * + * summary: The test drags a list of files (DataFlavor.javaFileListFlavor) from one jvm to another. + * The files have Unicode names. The list on target side must be equal to + * the list on the source side. + */ + + +import java.awt.*; +import java.awt.event.*; +import java.applet.Applet; + +import test.java.awt.regtesthelpers.process.ProcessCommunicator; +import test.java.awt.regtesthelpers.process.ProcessResults; +import test.java.awt.regtesthelpers.Util; +import static java.lang.Thread.sleep; + +public class DragUnicodeBetweenJVMTest extends Applet +{ + + public void init() { + setLayout(new BorderLayout()); + }//End init() + + public void start() { + + String toolkit = Toolkit.getDefaultToolkit().getClass().getName(); + if (!toolkit.equals("sun.awt.windows.WToolkit")){ + System.out.println("This test is for Windows only. Passed."); + return; + } + else{ + System.out.println("Toolkit = " + toolkit); + } + + final Frame sourceFrame = new Frame("Source frame"); + final SourcePanel sourcePanel = new SourcePanel(); + sourceFrame.add(sourcePanel); + sourceFrame.pack(); + sourceFrame.addWindowListener( new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + sourceFrame.dispose(); + } + }); + sourceFrame.setVisible(true); + + Util.waitForIdle(null); + + NextFramePositionCalculator positionCalculator = new NextFramePositionCalculator(sourceFrame); + + String [] args = new String [] { + String.valueOf(positionCalculator.getNextLocationX()), + String.valueOf(positionCalculator.getNextLocationY()), + String.valueOf(AbsoluteComponentCenterCalculator.calculateXCenterCoordinate(sourcePanel)), + String.valueOf(AbsoluteComponentCenterCalculator.calculateYCenterCoordinate(sourcePanel)), + }; + + + ProcessResults processResults = + // ProcessCommunicator.executeChildProcess(this.getClass()," -cp \"C:\\Documents and Settings\\df153228\\IdeaProjects\\UnicodeTestDebug\\out\\production\\UnicodeTestDebug\" -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 ", args); + ProcessCommunicator.executeChildProcess(this.getClass(), args); + + verifyTestResults(processResults); + + }// start() + + + + private static void verifyTestResults(ProcessResults processResults) { + if ( InterprocessMessages.FILES_ON_TARGET_ARE_CORRUPTED == + processResults.getExitValue()) + { + processResults.printProcessErrorOutput(System.err); + throw new RuntimeException("TEST IS FAILED: Target has recieved" + + " broken file list."); + } + processResults.verifyStdErr(System.err); + processResults.verifyProcessExitValue(System.err); + processResults.printProcessStandartOutput(System.out); + } + + //We cannot make an instance of the applet without the default constructor + public DragUnicodeBetweenJVMTest () { + super(); + } + + //We need in this constructor to pass frame position between JVMs + public DragUnicodeBetweenJVMTest (Point targetFrameLocation, Point dragSourcePoint) + throws InterruptedException + { + final Frame targetFrame = new Frame("Target frame"); + final TargetPanel targetPanel = new TargetPanel(targetFrame); + targetFrame.add(targetPanel); + targetFrame.addWindowListener( new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + targetFrame.dispose(); + } + }); + targetFrame.setLocation(targetFrameLocation); + targetFrame.pack(); + targetFrame.setVisible(true); + + doTest(dragSourcePoint, targetPanel); + } + + private void doTest(Point dragSourcePoint, TargetPanel targetPanel) { + Util.waitForIdle(null); + + final Robot robot = Util.createRobot(); + + robot.mouseMove((int)dragSourcePoint.getX(),(int)dragSourcePoint.getY()); + try { + sleep(100); + robot.mousePress(InputEvent.BUTTON1_MASK); + sleep(100); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + sleep(100); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + Util.drag(robot, dragSourcePoint, new Point (AbsoluteComponentCenterCalculator.calculateXCenterCoordinate(targetPanel), + AbsoluteComponentCenterCalculator.calculateYCenterCoordinate(targetPanel)), + InputEvent.BUTTON1_MASK); + } + + + enum InterprocessArguments { + TARGET_FRAME_X_POSITION_ARGUMENT, + TARGET_FRAME_Y_POSITION_ARGUMENT, + DRAG_SOURCE_POINT_X_ARGUMENT, + DRAG_SOURCE_POINT_Y_ARGUMENT; + + int extract (String [] args) { + return Integer.parseInt(args[this.ordinal()]); + } + } + + public static void main (String [] args) { + Point dragSourcePoint = new Point(InterprocessArguments.DRAG_SOURCE_POINT_X_ARGUMENT.extract(args), + InterprocessArguments.DRAG_SOURCE_POINT_Y_ARGUMENT.extract(args)); + Point targetFrameLocation = new Point(InterprocessArguments.TARGET_FRAME_X_POSITION_ARGUMENT.extract(args), + InterprocessArguments.TARGET_FRAME_Y_POSITION_ARGUMENT.extract(args)); + + try { + new DragUnicodeBetweenJVMTest(targetFrameLocation, dragSourcePoint); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + + +} diff --git a/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/FileListTransferable.java b/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/FileListTransferable.java new file mode 100644 index 00000000000..f2dcf607c4c --- /dev/null +++ b/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/FileListTransferable.java @@ -0,0 +1,68 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.io.IOException; +import java.io.File; +import java.util.Arrays; +import java.util.List; + +class FileListTransferable implements Transferable { + + public static File [] files = new File [] { + new File ("\u042f\u0020\u0441\u0440\u0430\u0437\u0443\u0020\u0441\u043c\u0430\u0437\u0430\u043b" + + "\u0020\u043a\u0430\u0440\u0442\u0443\u0020\u0431\u0443\u0434\u043d\u044f"), + new File ("\u043f\u043b\u0435\u0441\u043d\u0443\u0432\u0448\u0438\u0020\u043a\u0440\u0430\u0441" + + "\u043a\u0443\u0020\u0438\u0437\u0020\u0441\u0442\u0430\u043a\u0430\u043d\u0430"), + new File ("\u044f\u0020\u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0020\u043d\u0430\u0020\u0431" + + "\u043b\u044e\u0434\u0435\u0020\u0441\u0442\u0443\u0434\u043d\u044f"), + new File ("\u043a\u043e\u0441\u044b\u0435\u0020\u0441\u043a\u0443\u043b\u044b\u0020\u043e\u043a" + + "\u0435\u0430\u043d\u0430"), + new File ("\u041d\u0430\u0020\u0447\u0435\u0448\u0443\u0435\u0020\u0436\u0435\u0441\u0442\u044f" + + "\u043d\u043e\u0439\u0020\u0440\u044b\u0431\u044b"), + new File ("\u043f\u0440\u043e\u0447\u0435\u043b\u0020\u044f\u0020\u0437\u043e\u0432\u044b\u0020" + + "\u043d\u043e\u0432\u044b\u0445\u0020\u0433\u0443\u0431"), + new File ("\u0410\u0020\u0432\u044b"), + new File ("\u043d\u043e\u043a\u0442\u044e\u0440\u043d\u0020\u0441\u044b\u0433\u0440\u0430\u0442" + + "\u044c"), + new File ("\u043c\u043e\u0433\u043b\u0438\u0020\u0431\u044b"), + new File ("\u043d\u0430\u0020\u0444\u043b\u0435\u0439\u0442\u0435\u0020\u0432\u043e\u0434\u043e" + + "\u0441\u0442\u043e\u0447\u043d\u044b\u0445\u0020\u0442\u0440\u0443\u0431"), + }; + + public DataFlavor[] getTransferDataFlavors() { + return new DataFlavor [] {DataFlavor.javaFileListFlavor}; + } + + public boolean isDataFlavorSupported(DataFlavor flavor) { + return flavor.equals(DataFlavor.javaFileListFlavor) ; + } + + public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { + List list = Arrays.asList(files); + return list; + + } +} diff --git a/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/InterprocessMessages.java b/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/InterprocessMessages.java new file mode 100644 index 00000000000..33bb9a3cbd0 --- /dev/null +++ b/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/InterprocessMessages.java @@ -0,0 +1,28 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +interface InterprocessMessages { + final static int EXECUTION_IS_SUCCESSFULL = 0; + final static int FILES_ON_TARGET_ARE_CORRUPTED = 212; +} + diff --git a/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/NextFramePositionCalculator.java b/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/NextFramePositionCalculator.java new file mode 100644 index 00000000000..7d55be76e91 --- /dev/null +++ b/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/NextFramePositionCalculator.java @@ -0,0 +1,43 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.awt.*; + + +class NextFramePositionCalculator { + + private final Frame currentFrame; + + public NextFramePositionCalculator (Frame currentFrame) { + this.currentFrame = currentFrame; + } + + public int getNextLocationX() { + return currentFrame.getX()+currentFrame.getWidth(); + } + + public int getNextLocationY() { + return currentFrame.getY(); + } + +} diff --git a/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/SourcePanel.java b/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/SourcePanel.java new file mode 100644 index 00000000000..075d64810f7 --- /dev/null +++ b/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/SourcePanel.java @@ -0,0 +1,50 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.awt.dnd.DragSource; +import java.awt.dnd.DnDConstants; +import java.awt.dnd.DragGestureEvent; +import java.awt.dnd.DragGestureListener; +import java.awt.*; + +public class SourcePanel extends Panel +{ + + private final MyDragGestureListener dragGestureListener = + new MyDragGestureListener(); + + public SourcePanel () { + setPreferredSize(new Dimension(200, 200)); + DragSource defaultDragSource = + DragSource.getDefaultDragSource(); + defaultDragSource.createDefaultDragGestureRecognizer(this, + DnDConstants.ACTION_COPY_OR_MOVE, dragGestureListener); + setBackground(Color.RED); + } + + private class MyDragGestureListener implements DragGestureListener { + public void dragGestureRecognized(DragGestureEvent dge) { + dge.startDrag(null, new FileListTransferable()); + } + } +} diff --git a/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/TargetPanel.java b/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/TargetPanel.java new file mode 100644 index 00000000000..5688bf69ff2 --- /dev/null +++ b/jdk/test/java/awt/datatransfer/DragUnicodeBetweenJVMTest/TargetPanel.java @@ -0,0 +1,115 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.awt.dnd.*; +import java.awt.*; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.Arrays; + +public class TargetPanel extends Panel implements DropTargetListener{ + + private java.util.List content = new ArrayList(); + + //private final CustomDropTargetListener dropTargetListener = new CustomDropTargetListener(); + + private Frame frame; + + public TargetPanel (Frame frame) + { + this.frame = frame; + setBackground(Color.DARK_GRAY); + setPreferredSize(new Dimension(200, 200)); + setDropTarget(new DropTarget(this, this)); + } + + public void dragEnter(DropTargetDragEvent dtde) { + if (dtde.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { + dtde.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE); + } + } + + public void dragOver(DropTargetDragEvent dtde) { + if (dtde.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { + dtde.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE); + } + } + + public void dropActionChanged(DropTargetDragEvent dtde) { + if (dtde.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { + dtde.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE); + } + } + + public void dragExit(DropTargetEvent dte) { + + } + + public void drop(DropTargetDropEvent dtde) { + dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); + if (dtde.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) { + try { + content = (java.util.List)dtde.getTransferable().getTransferData(DataFlavor.javaFileListFlavor); + repaint(); + } catch (UnsupportedFlavorException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + dtde.dropComplete(true); + + + + boolean listsAreEqual = true; + + for (int i = 0; i < content.size(); i++) { + if(!FileListTransferable.files[i].getName().equals(content.get(i).getName())) { + listsAreEqual = false; + } + } + + if (listsAreEqual) { + System.err.println(InterprocessMessages.EXECUTION_IS_SUCCESSFULL); + System.exit(0); + } + } + dtde.rejectDrop(); + System.err.println(InterprocessMessages.FILES_ON_TARGET_ARE_CORRUPTED); + System.exit(1); + } + + public void paint(Graphics g) { + g.setColor(Color.YELLOW); + int i = 0; + for (Iterator iterator = content.iterator(); iterator.hasNext();i++) { + g.drawString(iterator.next().getName(), 5, g.getFontMetrics().getAscent()*i+20); + } + + } + +} diff --git a/jdk/test/java/awt/dnd/DnDFileGroupDescriptor/DnDFileGroupDescriptor.html b/jdk/test/java/awt/dnd/DnDFileGroupDescriptor/DnDFileGroupDescriptor.html new file mode 100644 index 00000000000..4ff6adc794e --- /dev/null +++ b/jdk/test/java/awt/dnd/DnDFileGroupDescriptor/DnDFileGroupDescriptor.html @@ -0,0 +1,20 @@ + + + + DnDToWordpadTest + + + +

      DnDFileGroupDescriptor
      Bug ID: 6242241

      + +

      See the dialog box (usually in upper left corner) for instructions

      + + + + diff --git a/jdk/test/java/awt/dnd/DnDFileGroupDescriptor/DnDFileGroupDescriptor.java b/jdk/test/java/awt/dnd/DnDFileGroupDescriptor/DnDFileGroupDescriptor.java new file mode 100644 index 00000000000..404f1f7a7f3 --- /dev/null +++ b/jdk/test/java/awt/dnd/DnDFileGroupDescriptor/DnDFileGroupDescriptor.java @@ -0,0 +1,189 @@ + /* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + test + @bug 6242241 + @summary Tests basic DnD functionality in an applet + @author Your Name: Alexey Utkin area=dnd + @run applet/manual=yesno DnDFileGroupDescriptor.html +*/ + +import java.applet.Applet; +import java.awt.*; + +public class DnDFileGroupDescriptor extends Applet { + public void init() { + setLayout(new BorderLayout()); + + String[] instructions = { + "The applet window contains a red field.", + "1. Start MS Outlook program. Find and open ", + " the mail form with attachments.", + "2. Select attachments from the mail and drag into a red field of applet.", + " When the mouse enters the field during the drag, the application ", + " should change the cursor form to OLE-copy and field color to yellow.", + "3. Release the mouse button (drop attachments) over the field.", + "", + "File paths in temporary folder should appear.", + "", + "You should be able to repeat this operation multiple times.", + "Please, select \"Pass\" just in case of success or \"Fail\" for another." + }; + Sysout.createDialogWithInstructions( instructions ); + } + + public void start() { + Panel mainPanel; + Component dropTarget; + + mainPanel = new Panel(); + mainPanel.setLayout(new BorderLayout()); + + mainPanel.setBackground(Color.blue); + dropTarget = new DnDTarget(Color.red, Color.yellow); + + mainPanel.add(dropTarget, "Center"); + add(mainPanel); + + setSize(200,200); + } +} + +/**************************************************** + Standard Test Machinery + DO NOT modify anything below -- it's a standard + chunk of code whose purpose is to make user + interaction uniform, and thereby make it simpler + to read and understand someone else's test. + ****************************************************/ + +class Sysout + { + private static TestDialog dialog; + + public static void createDialogWithInstructions( String[] instructions ) + { + dialog = new TestDialog( new Frame(), "Instructions" ); + dialog.printInstructions( instructions ); + dialog.show(); + println( "Any messages for the tester will display here." ); + } + + public static void createDialog( ) + { + dialog = new TestDialog( new Frame(), "Instructions" ); + String[] defInstr = { "Instructions will appear here. ", "" } ; + dialog.printInstructions( defInstr ); + dialog.show(); + println( "Any messages for the tester will display here." ); + } + + + public static void printInstructions( String[] instructions ) + { + dialog.printInstructions( instructions ); + } + + + public static void println( String messageIn ) + { + dialog.displayMessage( messageIn ); + } + + }// Sysout class + +class TestDialog extends Dialog + { + + TextArea instructionsText; + TextArea messageText; + int maxStringLength = 80; + + //DO NOT call this directly, go through Sysout + public TestDialog( Frame frame, String name ) + { + super( frame, name ); + int scrollBoth = TextArea.SCROLLBARS_BOTH; + instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); + add( "North", instructionsText ); + + messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); + add("South", messageText); + + pack(); + + show(); + }// TestDialog() + + //DO NOT call this directly, go through Sysout + public void printInstructions( String[] instructions ) + { + //Clear out any current instructions + instructionsText.setText( "" ); + + //Go down array of instruction strings + + String printStr, remainingStr; + for( int i=0; i < instructions.length; i++ ) + { + //chop up each into pieces maxSringLength long + remainingStr = instructions[ i ]; + while( remainingStr.length() > 0 ) + { + //if longer than max then chop off first max chars to print + if( remainingStr.length() >= maxStringLength ) + { + //Try to chop on a word boundary + int posOfSpace = remainingStr. + lastIndexOf( ' ', maxStringLength - 1 ); + + if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; + + printStr = remainingStr.substring( 0, posOfSpace + 1 ); + remainingStr = remainingStr.substring( posOfSpace + 1 ); + } + //else just print + else + { + printStr = remainingStr; + remainingStr = ""; + } + + instructionsText.append( printStr + "\n" ); + + }// while + + }// for + + }//printInstructions() + + //DO NOT call this directly, go through Sysout + public void displayMessage( String messageIn ) + { + messageText.append( messageIn + "\n" ); + } + + }// TestDialog class diff --git a/jdk/test/java/awt/dnd/DnDFileGroupDescriptor/DnDTarget.java b/jdk/test/java/awt/dnd/DnDFileGroupDescriptor/DnDTarget.java new file mode 100644 index 00000000000..8d6b62ffc11 --- /dev/null +++ b/jdk/test/java/awt/dnd/DnDFileGroupDescriptor/DnDTarget.java @@ -0,0 +1,108 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* +* Panel is a DropTarget +* +*/ + +import java.awt.*; +import java.awt.datatransfer.*; +import java.awt.dnd.*; +import java.io.*; + + +class DnDTarget extends Panel implements DropTargetListener { + //private int dragOperation = DnDConstants.ACTION_COPY | DnDConstants.ACTION_MOVE; + Color bgColor; + Color htColor; + + DnDTarget(Color bgColor, Color htColor) { + super(); + setLayout(new FlowLayout()); + this.bgColor = bgColor; + this.htColor = htColor; + setBackground(bgColor); + setDropTarget(new DropTarget(this, this)); + add(new Label("drop here")); + } + + boolean check(DropTargetDragEvent dtde) + { + if (dtde.getCurrentDataFlavorsAsList().contains(DataFlavor.javaFileListFlavor)) { + dtde.acceptDrag(DnDConstants.ACTION_COPY); + return true; + } + return false; + } + + public void dragEnter(DropTargetDragEvent dtde) { + if(check(dtde)){ + setBackground(htColor); + repaint(); + } + } + + public void dragOver(DropTargetDragEvent dtde) { + check(dtde); + } + + public void dropActionChanged(DropTargetDragEvent dtde) { + check(dtde); + } + + public void dragExit(DropTargetEvent e) { + setBackground(bgColor); + repaint(); + } + + public void dragScroll(DropTargetDragEvent e) { + System.out.println("[Target] dragScroll"); + } + + public void drop(DropTargetDropEvent dtde) { + System.out.println("[Target] drop"); + boolean success = false; + dtde.acceptDrop(DnDConstants.ACTION_COPY); + if( dtde.getCurrentDataFlavorsAsList().contains(DataFlavor.javaFileListFlavor) ){ + System.out.println("[Target] DROP OK!"); + try { + Transferable transfer = dtde.getTransferable(); + java.util.List fl = (java.util.List)transfer.getTransferData(DataFlavor.javaFileListFlavor); + for(File f : fl){ + add(new Button(f.getCanonicalPath())); + System.out.println("[Target] drop file:" + f.getCanonicalPath()); + } + validate(); + } catch(Exception ex) { + ex.printStackTrace(); + } + setBackground(bgColor); + repaint(); + success = true; + } + dtde.dropComplete(success); + } +} diff --git a/jdk/test/java/awt/dnd/ImageDecoratedDnD/DnDSource.java b/jdk/test/java/awt/dnd/ImageDecoratedDnD/DnDSource.java new file mode 100644 index 00000000000..4c8f392c279 --- /dev/null +++ b/jdk/test/java/awt/dnd/ImageDecoratedDnD/DnDSource.java @@ -0,0 +1,235 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* +* AWT Button is a DragSource and also a transferable object +*/ + +import java.awt.*; +import java.awt.datatransfer.*; +import java.awt.dnd.*; +import java.io.*; + +class DnDSource extends Button implements Transferable, + DragGestureListener, + DragSourceListener { + private DataFlavor df; + private transient int dropAction; + private final int dragOperation = DnDConstants.ACTION_COPY | DnDConstants.ACTION_MOVE | DnDConstants.ACTION_LINK; + DragSource dragSource = new DragSource(); + + DnDSource(String label) { + super(label); + setBackground(Color.yellow); + setForeground(Color.blue); + df = new DataFlavor(DnDSource.class, "DnDSource"); + + dragSource.createDefaultDragGestureRecognizer( + this, + dragOperation, + this + ); + dragSource.addDragSourceListener(this); + } + + public void changeCursor( + DragSourceContext dsc, + int ra + ) { + java.awt.Cursor c = null; + if ((ra & DnDConstants.ACTION_LINK) == DnDConstants.ACTION_LINK) + c = DragSource.DefaultLinkDrop; + else if ((ra & DnDConstants.ACTION_MOVE) == DnDConstants.ACTION_MOVE) + c = MyCursor.MOVE;//DragSource.DefaultMoveDrop; + else if ((ra & DnDConstants.ACTION_COPY) == DnDConstants.ACTION_COPY) + c = MyCursor.COPY; + else + c = MyCursor.NO_DROP; + dsc.setCursor(c); + } + + /** + * a Drag gesture has been recognized + */ + + public void dragGestureRecognized(DragGestureEvent dge) { + System.out.println("starting Drag"); + try { + if (DragSource.isDragImageSupported()) { + System.out.println("starting Imaged Drag"); + dge.startDrag( + null, + new ImageGenerator(50, 100, new Color(0xff, 0xff, 0xff, 0x00) ) { + @Override public void paint(Graphics gr) { + gr.translate(width/2, height/2); + ((Graphics2D)gr).setStroke(new BasicStroke(3)); + int R = width/4+5; + gr.setColor(new Color(0x00, 0x00, 0xff, 0x7F)); + gr.fillRect(-R, -R, 2*R, 2*R); + gr.setColor(new Color(0x00, 0x00, 0xff, 0xff)); + gr.drawRect(-R, -R, 2*R, 2*R); + + + gr.translate(10, -10); + R -= 5; + gr.setColor(Color.RED); + gr.fillOval(-R, -R, 2*R, 2*R); + gr.setColor(Color.MAGENTA); + gr.drawOval(-R, -R, 2*R, 2*R); + } + }.getImage(), + new Point(15, 40), + this, + this); + } else { + dge.startDrag( + null, + this, + this); + } + } catch (InvalidDnDOperationException e) { + e.printStackTrace(); + } + } + + /** + * as the hotspot enters a platform dependent drop site + */ + + public void dragEnter(DragSourceDragEvent dsde) { + System.out.println("[Source] dragEnter"); + changeCursor( + dsde.getDragSourceContext(), + dsde.getUserAction() & dsde.getDropAction() + ); + } + + /** + * as the hotspot moves over a platform dependent drop site + */ + public void dragOver(DragSourceDragEvent dsde) { + System.out.println("[Source] dragOver"); + changeCursor( + dsde.getDragSourceContext(), + dsde.getUserAction() & dsde.getDropAction() + ); + dropAction = dsde.getUserAction() & dsde.getDropAction(); + System.out.println("dropAction = " + dropAction); + } + + /** + * as the hotspot exits a platform dependent drop site + */ + public void dragExit(DragSourceEvent dse) { + System.out.println("[Source] dragExit"); + changeCursor( + dse.getDragSourceContext(), + DnDConstants.ACTION_NONE + ); + } + + /** + * as the operation changes + */ + public void dragGestureChanged(DragSourceDragEvent dsde) { + System.out.println("[Source] dragGestureChanged"); + changeCursor( + dsde.getDragSourceContext(), + dsde.getUserAction() & dsde.getDropAction() + ); + dropAction = dsde.getUserAction() & dsde.getDropAction(); + System.out.println("dropAction = " + dropAction); + } + + + /** + * as the operation completes + */ + public void dragDropEnd(DragSourceDropEvent dsde) { + System.out.println("[Source] dragDropEnd"); + } + + public void dropActionChanged(DragSourceDragEvent dsde) { + System.out.println("[Source] dropActionChanged"); + dropAction = dsde.getUserAction() & dsde.getDropAction(); + System.out.println("dropAction = " + dropAction); + } + + public DataFlavor[] getTransferDataFlavors() { + return new DataFlavor[]{df}; + } + + public boolean isDataFlavorSupported(DataFlavor sdf) { + return df.equals(sdf); + } + + public Object getTransferData(DataFlavor tdf) throws UnsupportedFlavorException, IOException { + Object copy = null; + if( !df.equals(tdf) ){ + throw new UnsupportedFlavorException(tdf); + } + Container parent = getParent(); + switch (dropAction) { + case DnDConstants.ACTION_COPY: + try { + copy = this.clone(); + } catch (CloneNotSupportedException e) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(baos); + + oos.writeObject(this); + ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); + ObjectInputStream ois = new ObjectInputStream(bais); + try { + copy = ois.readObject(); + } catch (ClassNotFoundException cnfe) { + // do nothing + } + } + parent.add(this); + return copy; + + case DnDConstants.ACTION_MOVE: + synchronized (this) { + if (parent != null) { + parent.remove(this); + Label label = new Label("[empty]"); + label.setBackground(Color.cyan); + label.setBounds(this.getBounds()); + parent.add(label); + } + } + return this; + + case DnDConstants.ACTION_LINK: + return this; + + default: + return null; + } + + } +} + diff --git a/jdk/test/java/awt/dnd/ImageDecoratedDnD/DnDTarget.java b/jdk/test/java/awt/dnd/ImageDecoratedDnD/DnDTarget.java new file mode 100644 index 00000000000..52d39c4928a --- /dev/null +++ b/jdk/test/java/awt/dnd/ImageDecoratedDnD/DnDTarget.java @@ -0,0 +1,113 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* +* Panel is a DropTarget +* +*/ + +import java.awt.*; +import java.awt.datatransfer.*; +import java.awt.dnd.*; +import java.io.*; + + +class DnDTarget extends Panel implements DropTargetListener { + private int dragOperation = DnDConstants.ACTION_COPY | DnDConstants.ACTION_MOVE; + Color bgColor; + Color htColor; + + DnDTarget(Color bgColor, Color htColor) { + super(); + this.bgColor = bgColor; + this.htColor = htColor; + setBackground(bgColor); + setDropTarget(new DropTarget(this, this)); + } + + + public void dragEnter(DropTargetDragEvent e) { + System.out.println("[Target] dragEnter"); + setBackground(htColor); + repaint(); + } + + public void dragOver(DropTargetDragEvent e) { + System.out.println("[Target] dragOver"); + } + + public void dragExit(DropTargetEvent e) { + System.out.println("[Target] dragExit"); + setBackground(bgColor); + repaint(); + } + + public void dragScroll(DropTargetDragEvent e) { + System.out.println("[Target] dragScroll"); + } + + public void dropActionChanged(DropTargetDragEvent e) { + System.out.println("[Target] dropActionChanged"); + } + + public void drop(DropTargetDropEvent dtde) { + System.out.println("[Target] drop"); + boolean success = false; + if ((dtde.getDropAction() & dragOperation) == 0) { + dtde.rejectDrop(); + Label label = new Label("[no links here :) ]"); + label.setBackground(Color.cyan); + add(label); + } else { + dtde.acceptDrop(dragOperation); + DataFlavor[] dfs = dtde.getCurrentDataFlavors(); + if (dfs != null && dfs.length >= 1){ + Transferable transfer = dtde.getTransferable(); + try { + Button button = (Button)transfer.getTransferData(dfs[0]); + if( button != null ){ + add(button); + success = true; + } + } catch (IOException ioe) { + System.out.println(ioe.getMessage()); + return; + } catch (UnsupportedFlavorException ufe) { + System.out.println(ufe.getMessage()); + return; + } catch (Exception e) { + System.out.println(e.getMessage()); + return; + } + } + } + setBackground(bgColor); + dtde.dropComplete(success); + + invalidate(); + validate(); + repaint(); + } +} diff --git a/jdk/test/java/awt/dnd/ImageDecoratedDnD/ImageDecoratedDnD.html b/jdk/test/java/awt/dnd/ImageDecoratedDnD/ImageDecoratedDnD.html new file mode 100644 index 00000000000..620eea04d9b --- /dev/null +++ b/jdk/test/java/awt/dnd/ImageDecoratedDnD/ImageDecoratedDnD.html @@ -0,0 +1,20 @@ + + + + ImageDecoratedDnD + + + +

      ImageDecoratedDnD
      Bug ID: 4874070

      + +

      See the dialog box (usually in upper left corner) for instructions

      + + + + diff --git a/jdk/test/java/awt/dnd/ImageDecoratedDnD/ImageDecoratedDnD.java b/jdk/test/java/awt/dnd/ImageDecoratedDnD/ImageDecoratedDnD.java new file mode 100644 index 00000000000..fe5e82084ff --- /dev/null +++ b/jdk/test/java/awt/dnd/ImageDecoratedDnD/ImageDecoratedDnD.java @@ -0,0 +1,199 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + test %W% %E% + @bug 4874070 + @summary Tests basic DnD functionality + @author Your Name: Alexey Utkin area=dnd + @run applet/manual=yesno ImageDecoratedDnD.html +*/ + +import java.applet.Applet; +import java.awt.*; +import java.awt.dnd.DragSource; + + + +public class ImageDecoratedDnD extends Applet { + //Declare things used in the test, like buttons and labels here + + public void init() { + //Create instructions for the user here, as well as set up + // the environment -- set the layout manager, add buttons, + // etc. + this.setLayout(new BorderLayout()); + + String[] instructions = + { + "A Frame, which contains a yellow button labeled \"Drag ME!\" and ", + "a red panel, will appear below. ", + "1. Click on the button and drag to the red panel. ", + "2. When the mouse enters the red panel during the drag, the panel ", + "should turn yellow. On the systems that supports pictured drag, ", + "the image under the drag-cursor should appear (ancor is shifted ", + "from top-left corner of the picture inside the picture to 10pt in both dimensions ). ", + "In WIN32 systems the image under cursor would be visible ONLY over ", + "the drop targets with activated extended OLE D\'n\'D support (that are ", + "the desktop and IE ).", + "3. Release the mouse button.", + "The panel should turn red again and a yellow button labeled ", + "\"Drag ME!\" should appear inside the panel. You should be able ", + "to repeat this operation multiple times." + }; + Sysout.createDialogWithInstructions(instructions); + + }//End init() + + public void start() { + Frame f = new Frame("Use keyboard for DnD change"); + Panel mainPanel; + Component dragSource, dropTarget; + + f.setBounds(0, 400, 200, 200); + f.setLayout(new BorderLayout()); + + mainPanel = new Panel(); + mainPanel.setLayout(new BorderLayout()); + + mainPanel.setBackground(Color.blue); + + dropTarget = new DnDTarget(Color.red, Color.yellow); + dragSource = new DnDSource("Drag ME! (" + (DragSource.isDragImageSupported()?"with ":"without") + " image)" ); + + mainPanel.add(dragSource, "North"); + mainPanel.add(dropTarget, "Center"); + f.add(mainPanel, BorderLayout.CENTER); + + f.setVisible(true); + }// start() +}// class DnDAcceptanceTest + + +/** + * ************************************************* + * Standard Test Machinery + * DO NOT modify anything below -- it's a standard + * chunk of code whose purpose is to make user + * interaction uniform, and thereby make it simpler + * to read and understand someone else's test. + * ************************************************** + */ +class Sysout { + private static TestDialog dialog; + + public static void createDialogWithInstructions(String[] instructions) { + dialog = new TestDialog(new Frame(), "Instructions"); + dialog.printInstructions(instructions); + dialog.show(); + println("Any messages for the tester will display here."); + } + + public static void createDialog() { + dialog = new TestDialog(new Frame(), "Instructions"); + String[] defInstr = {"Instructions will appear here. ", ""}; + dialog.printInstructions(defInstr); + dialog.show(); + println("Any messages for the tester will display here."); + } + + + public static void printInstructions(String[] instructions) { + dialog.printInstructions(instructions); + } + + + public static void println(String messageIn) { + dialog.displayMessage(messageIn); + } + +}// Sysout class + + +class TestDialog extends Dialog { + + TextArea instructionsText; + TextArea messageText; + int maxStringLength = 80; + + //DO NOT call this directly, go through Sysout + public TestDialog(Frame frame, String name) { + super(frame, name); + int scrollBoth = TextArea.SCROLLBARS_BOTH; + instructionsText = new TextArea("", 15, maxStringLength, scrollBoth); + add("North", instructionsText); + + messageText = new TextArea("", 5, maxStringLength, scrollBoth); + add("South", messageText); + + pack(); + + show(); + }// TestDialog() + + //DO NOT call this directly, go through Sysout + public void printInstructions(String[] instructions) { + //Clear out any current instructions + instructionsText.setText(""); + + //Go down array of instruction strings + + String printStr, remainingStr; + for (int i = 0; i < instructions.length; i++) { + //chop up each into pieces maxSringLength long + remainingStr = instructions[i]; + while (remainingStr.length() > 0) { + //if longer than max then chop off first max chars to print + if (remainingStr.length() >= maxStringLength) { + //Try to chop on a word boundary + int posOfSpace = remainingStr. + lastIndexOf(' ', maxStringLength - 1); + + if (posOfSpace <= 0) posOfSpace = maxStringLength - 1; + + printStr = remainingStr.substring(0, posOfSpace + 1); + remainingStr = remainingStr.substring(posOfSpace + 1); + } + //else just print + else { + printStr = remainingStr; + remainingStr = ""; + } + + instructionsText.append(printStr + "\n"); + + }// while + + }// for + + }//printInstructions() + + //DO NOT call this directly, go through Sysout + public void displayMessage(String messageIn) { + messageText.append(messageIn + "\n"); + } + +}// TestDialog class + diff --git a/jdk/test/java/awt/dnd/ImageDecoratedDnD/ImageGenerator.java b/jdk/test/java/awt/dnd/ImageDecoratedDnD/ImageGenerator.java new file mode 100644 index 00000000000..da6484a2d15 --- /dev/null +++ b/jdk/test/java/awt/dnd/ImageDecoratedDnD/ImageGenerator.java @@ -0,0 +1,59 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * Image generator for cursor and drag + */ +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.image.BufferedImage; + +public abstract class ImageGenerator +{ + public int width; + public int height; + private final BufferedImage bi; + public ImageGenerator(int _width, int _height, Color bgColor) + { + width = _width; + height = _height; + bi = new BufferedImage( + width, + height, + BufferedImage.TYPE_INT_ARGB); + Graphics gr = bi.getGraphics(); + if(null==bgColor){ + bgColor = Color.WHITE; + } + gr.setColor(bgColor); + gr.fillRect(0, 0, width, height); + paint(gr); + gr.dispose(); + } + public Image getImage() { return bi; } + + public abstract void paint(Graphics gr); +} diff --git a/jdk/test/java/awt/dnd/ImageDecoratedDnD/MyCursor.java b/jdk/test/java/awt/dnd/ImageDecoratedDnD/MyCursor.java new file mode 100644 index 00000000000..a9d2b6d5750 --- /dev/null +++ b/jdk/test/java/awt/dnd/ImageDecoratedDnD/MyCursor.java @@ -0,0 +1,86 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Toolkit; +import java.awt.Point; + +/** + * An interface provides a set of custom cursors + */ + +public interface MyCursor { + public static final java.awt.Cursor NO_DROP = Toolkit.getDefaultToolkit().createCustomCursor( + new ImageGenerator(32, 32, new Color(0xff, 0xff, 0xff, 0x00) ) { + @Override public void paint(Graphics gr) { + gr.setColor(Color.GREEN); + ((Graphics2D)gr).setStroke(new BasicStroke(3)); + + gr.translate(width/2, height/2); + int R = width/4; + gr.drawOval(-R, -R, 2*R, 2*R); + gr.drawLine(-R, R, R, -R); + } + }.getImage(), + new Point(0, 0), + "My NoDrop Cursor" + ); + public static final java.awt.Cursor MOVE = Toolkit.getDefaultToolkit().createCustomCursor( + new ImageGenerator(32, 32, new Color(0xff, 0xff, 0xff, 0x00) ) { + @Override public void paint(Graphics gr) { + gr.setColor(Color.GREEN); + ((Graphics2D)gr).setStroke(new BasicStroke(3)); + + gr.drawLine(0, 0, width, height); + gr.drawLine(0, 0, width/2, 0); + gr.drawLine(0, 0, 0, height/2); + } + }.getImage(), + new Point(0, 0), + "My Move Cursor" + ); + public static final java.awt.Cursor COPY = Toolkit.getDefaultToolkit().createCustomCursor( + new ImageGenerator(32, 32, new Color(0xff, 0xff, 0xff, 0x00) ) { + @Override public void paint(Graphics gr) { + gr.setColor(Color.GREEN); + ((Graphics2D)gr).setStroke(new BasicStroke(3)); + //arrow + gr.drawLine(0, 0, width/2, height/2); + gr.drawLine(0, 0, width/2, 0); + gr.drawLine(0, 0, 0, height/2); + //plus + gr.drawRect(width/2 - 1, height/2 -1, width/2 - 1, height/2 - 1); + gr.drawLine(width*3/4 - 1, height/2 - 1, width*3/4 - 1, height); + gr.drawLine(width/2 - 1, height*3/4 - 1, width, height*3/4 - 1); + } + }.getImage(), + new Point(0, 0), + "My Copy Cursor" + ); +} + diff --git a/jdk/test/java/awt/dnd/ImageDecoratedDnDInOut/DnDSource.java b/jdk/test/java/awt/dnd/ImageDecoratedDnDInOut/DnDSource.java new file mode 100644 index 00000000000..281d7030294 --- /dev/null +++ b/jdk/test/java/awt/dnd/ImageDecoratedDnDInOut/DnDSource.java @@ -0,0 +1,235 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* +* AWT Button is a DragSource and also a transferable object +*/ + +import java.awt.*; +import java.awt.datatransfer.*; +import java.awt.dnd.*; +import java.io.*; + +class DnDSource extends Button implements Transferable, + DragGestureListener, + DragSourceListener { + private DataFlavor df; + private transient int dropAction; + private final int dragOperation = DnDConstants.ACTION_COPY | DnDConstants.ACTION_MOVE | DnDConstants.ACTION_LINK; + DragSource dragSource = new DragSource(); + + DnDSource(String label) { + super(label); + setBackground(Color.yellow); + setForeground(Color.blue); + df = new DataFlavor(DnDSource.class, "DnDSource"); + + dragSource.createDefaultDragGestureRecognizer( + this, + dragOperation, + this + ); + dragSource.addDragSourceListener(this); + } + + public void changeCursor( + DragSourceContext dsc, + int ra + ) { + java.awt.Cursor c = null; + if ((ra & DnDConstants.ACTION_LINK) == DnDConstants.ACTION_LINK) + c = DragSource.DefaultLinkDrop; + else if ((ra & DnDConstants.ACTION_MOVE) == DnDConstants.ACTION_MOVE) + c = MyCursor.MOVE;//DragSource.DefaultMoveDrop; + else if ((ra & DnDConstants.ACTION_COPY) == DnDConstants.ACTION_COPY) + c = MyCursor.COPY; + else + c = MyCursor.NO_DROP; + dsc.setCursor(c); + } + + /** + * a Drag gesture has been recognized + */ + + public void dragGestureRecognized(DragGestureEvent dge) { + System.out.println("starting Drag"); + try { + if (DragSource.isDragImageSupported()) { + System.out.println("starting Imaged Drag"); + dge.startDrag( + null, + new ImageGenerator(50, 100, new Color(0xff, 0xff, 0xff, 0x00) ) { + @Override public void paint(Graphics gr) { + gr.translate(width/2, height/2); + ((Graphics2D)gr).setStroke(new BasicStroke(3)); + int R = width/4+5; + gr.setColor(Color.BLUE); + gr.fillRect(-R, -R, 2*R, 2*R); + gr.setColor(Color.CYAN); + gr.drawRect(-R, -R, 2*R, 2*R); + + + gr.translate(10, 10); + R -= 5; + gr.setColor(Color.RED); + gr.fillOval(-R, -R, 2*R, 2*R); + gr.setColor(Color.MAGENTA); + gr.drawOval(-R, -R, 2*R, 2*R); + } + }.getImage(), + new Point(15, 40), + this, + this); + } else { + dge.startDrag( + null, + this, + this); + } + } catch (InvalidDnDOperationException e) { + e.printStackTrace(); + } + } + + /** + * as the hotspot enters a platform dependent drop site + */ + + public void dragEnter(DragSourceDragEvent dsde) { + System.out.println("[Source] dragEnter"); + changeCursor( + dsde.getDragSourceContext(), + dsde.getUserAction() & dsde.getDropAction() + ); + } + + /** + * as the hotspot moves over a platform dependent drop site + */ + public void dragOver(DragSourceDragEvent dsde) { + System.out.println("[Source] dragOver"); + changeCursor( + dsde.getDragSourceContext(), + dsde.getUserAction() & dsde.getDropAction() + ); + dropAction = dsde.getUserAction() & dsde.getDropAction(); + System.out.println("dropAction = " + dropAction); + } + + /** + * as the hotspot exits a platform dependent drop site + */ + public void dragExit(DragSourceEvent dse) { + System.out.println("[Source] dragExit"); + changeCursor( + dse.getDragSourceContext(), + DnDConstants.ACTION_NONE + ); + } + + /** + * as the operation changes + */ + public void dragGestureChanged(DragSourceDragEvent dsde) { + System.out.println("[Source] dragGestureChanged"); + changeCursor( + dsde.getDragSourceContext(), + dsde.getUserAction() & dsde.getDropAction() + ); + dropAction = dsde.getUserAction() & dsde.getDropAction(); + System.out.println("dropAction = " + dropAction); + } + + + /** + * as the operation completes + */ + public void dragDropEnd(DragSourceDropEvent dsde) { + System.out.println("[Source] dragDropEnd"); + } + + public void dropActionChanged(DragSourceDragEvent dsde) { + System.out.println("[Source] dropActionChanged"); + dropAction = dsde.getUserAction() & dsde.getDropAction(); + System.out.println("dropAction = " + dropAction); + } + + public DataFlavor[] getTransferDataFlavors() { + return new DataFlavor[]{df}; + } + + public boolean isDataFlavorSupported(DataFlavor sdf) { + return df.equals(sdf); + } + + public Object getTransferData(DataFlavor tdf) throws UnsupportedFlavorException, IOException { + Object copy = null; + if( !df.equals(tdf) ){ + throw new UnsupportedFlavorException(tdf); + } + Container parent = getParent(); + switch (dropAction) { + case DnDConstants.ACTION_COPY: + try { + copy = this.clone(); + } catch (CloneNotSupportedException e) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(baos); + + oos.writeObject(this); + ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); + ObjectInputStream ois = new ObjectInputStream(bais); + try { + copy = ois.readObject(); + } catch (ClassNotFoundException cnfe) { + // do nothing + } + } + parent.add(this); + return copy; + + case DnDConstants.ACTION_MOVE: + synchronized (this) { + if (parent != null) { + parent.remove(this); + Label label = new Label("[empty]"); + label.setBackground(Color.cyan); + label.setBounds(this.getBounds()); + parent.add(label); + } + } + return this; + + case DnDConstants.ACTION_LINK: + return this; + + default: + return null; + } + + } +} + diff --git a/jdk/test/java/awt/dnd/ImageDecoratedDnDInOut/DnDTarget.java b/jdk/test/java/awt/dnd/ImageDecoratedDnDInOut/DnDTarget.java new file mode 100644 index 00000000000..52d39c4928a --- /dev/null +++ b/jdk/test/java/awt/dnd/ImageDecoratedDnDInOut/DnDTarget.java @@ -0,0 +1,113 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* +* Panel is a DropTarget +* +*/ + +import java.awt.*; +import java.awt.datatransfer.*; +import java.awt.dnd.*; +import java.io.*; + + +class DnDTarget extends Panel implements DropTargetListener { + private int dragOperation = DnDConstants.ACTION_COPY | DnDConstants.ACTION_MOVE; + Color bgColor; + Color htColor; + + DnDTarget(Color bgColor, Color htColor) { + super(); + this.bgColor = bgColor; + this.htColor = htColor; + setBackground(bgColor); + setDropTarget(new DropTarget(this, this)); + } + + + public void dragEnter(DropTargetDragEvent e) { + System.out.println("[Target] dragEnter"); + setBackground(htColor); + repaint(); + } + + public void dragOver(DropTargetDragEvent e) { + System.out.println("[Target] dragOver"); + } + + public void dragExit(DropTargetEvent e) { + System.out.println("[Target] dragExit"); + setBackground(bgColor); + repaint(); + } + + public void dragScroll(DropTargetDragEvent e) { + System.out.println("[Target] dragScroll"); + } + + public void dropActionChanged(DropTargetDragEvent e) { + System.out.println("[Target] dropActionChanged"); + } + + public void drop(DropTargetDropEvent dtde) { + System.out.println("[Target] drop"); + boolean success = false; + if ((dtde.getDropAction() & dragOperation) == 0) { + dtde.rejectDrop(); + Label label = new Label("[no links here :) ]"); + label.setBackground(Color.cyan); + add(label); + } else { + dtde.acceptDrop(dragOperation); + DataFlavor[] dfs = dtde.getCurrentDataFlavors(); + if (dfs != null && dfs.length >= 1){ + Transferable transfer = dtde.getTransferable(); + try { + Button button = (Button)transfer.getTransferData(dfs[0]); + if( button != null ){ + add(button); + success = true; + } + } catch (IOException ioe) { + System.out.println(ioe.getMessage()); + return; + } catch (UnsupportedFlavorException ufe) { + System.out.println(ufe.getMessage()); + return; + } catch (Exception e) { + System.out.println(e.getMessage()); + return; + } + } + } + setBackground(bgColor); + dtde.dropComplete(success); + + invalidate(); + validate(); + repaint(); + } +} diff --git a/jdk/test/java/awt/dnd/ImageDecoratedDnDInOut/ImageDecoratedDnDInOut.html b/jdk/test/java/awt/dnd/ImageDecoratedDnDInOut/ImageDecoratedDnDInOut.html new file mode 100644 index 00000000000..15ade246d0c --- /dev/null +++ b/jdk/test/java/awt/dnd/ImageDecoratedDnDInOut/ImageDecoratedDnDInOut.html @@ -0,0 +1,20 @@ + + + + ImageDecoratedDnDInOut + + + +

      ImageDecoratedDnDInOut
      Bug ID: 4874070

      + +

      See the dialog box (usually in upper left corner) for instructions

      + + + + diff --git a/jdk/test/java/awt/dnd/ImageDecoratedDnDInOut/ImageDecoratedDnDInOut.java b/jdk/test/java/awt/dnd/ImageDecoratedDnDInOut/ImageDecoratedDnDInOut.java new file mode 100644 index 00000000000..336c561b2cf --- /dev/null +++ b/jdk/test/java/awt/dnd/ImageDecoratedDnDInOut/ImageDecoratedDnDInOut.java @@ -0,0 +1,234 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + test %W% %E% + @bug 4874070 + @summary Tests basic DnD functionality + @author Your Name: Alexey Utkin area=dnd + @run applet ImageDecoratedDnDInOut.html +*/ + +import java.applet.Applet; +import java.awt.*; +import java.awt.Robot; +import java.awt.event.InputEvent; +import java.awt.dnd.DragSource; + + +public class ImageDecoratedDnDInOut extends Applet { + //Declare things used in the test, like buttons and labels here + + public void init() { + //Create instructions for the user here, as well as set up + // the environment -- set the layout manager, add buttons, + // etc. + this.setLayout(new BorderLayout()); + + String[] instructions = + { + "Automatic test.", + "A Frame, which contains a yellow button labeled \"Drag ME!\" and ", + "a red panel, will appear below. ", + "1. The button would be clicked and dragged to the red panel. ", + "2. When the mouse enters the red panel during the drag, the panel ", + "should turn yellow. On the systems that supports pictured drag, ", + "the image under the drag-cursor should appear (ancor is shifted ", + "from top-left corner of the picture inside the picture to 10pt in both dimensions ). ", + "In WIN32 systems the image under cursor would be visible ONLY over ", + "the drop targets with activated extended OLE D\'n\'D support (that are ", + "the desktop and IE ).", + "3. The mouse would be released.", + "The panel should turn red again and a yellow button labeled ", + "\"Drag ME!\" should appear inside the panel. " + }; + Sysout.createDialogWithInstructions(instructions); + + }//End init() + + public void start() { + Frame f = new Frame("Use keyboard for DnD change"); + Panel mainPanel; + Component dragSource, dropTarget; + + f.setBounds(0, 400, 200, 200); + f.setLayout(new BorderLayout()); + + mainPanel = new Panel(); + mainPanel.setLayout(new BorderLayout()); + + mainPanel.setBackground(Color.blue); + + dropTarget = new DnDTarget(Color.red, Color.yellow); + dragSource = new DnDSource("Drag ME! (" + (DragSource.isDragImageSupported()?"with ":"without") + " image)" ); + + mainPanel.add(dragSource, "North"); + mainPanel.add(dropTarget, "Center"); + f.add(mainPanel, BorderLayout.CENTER); + + f.setVisible(true); + try { + Point sourcePoint = dragSource.getLocationOnScreen(); + Dimension d = dragSource.getSize(); + sourcePoint.translate(d.width / 2, d.height / 2); + + Robot robot = new Robot(); + robot.mouseMove(sourcePoint.x, sourcePoint.y); + robot.mousePress(InputEvent.BUTTON1_MASK); + Thread.sleep(2000); + for(int i = 0; i <100; ++i) { + robot.mouseMove( + sourcePoint.x + d.width / 2 + 10, + sourcePoint.y + d.height); + Thread.sleep(100); + + robot.mouseMove(sourcePoint.x, sourcePoint.y); + Thread.sleep(100); + + robot.mouseMove( + sourcePoint.x, + sourcePoint.y + d.height); + Thread.sleep(100); + } + sourcePoint.y += d.height; + robot.mouseMove(sourcePoint.x, sourcePoint.y); + Thread.sleep(100); + + robot.mouseRelease(InputEvent.BUTTON1_MASK); + Thread.sleep(4000); + } catch( Exception e){ + e.printStackTrace(); + throw new RuntimeException("test failed: drop was not successful with exception " + e); + } + + }// start() +}// class DnDAcceptanceTest + + +/** + * ************************************************* + * Standard Test Machinery + * DO NOT modify anything below -- it's a standard + * chunk of code whose purpose is to make user + * interaction uniform, and thereby make it simpler + * to read and understand someone else's test. + * ************************************************** + */ +class Sysout { + private static TestDialog dialog; + + public static void createDialogWithInstructions(String[] instructions) { + dialog = new TestDialog(new Frame(), "Instructions"); + dialog.printInstructions(instructions); + dialog.show(); + println("Any messages for the tester will display here."); + } + + public static void createDialog() { + dialog = new TestDialog(new Frame(), "Instructions"); + String[] defInstr = {"Instructions will appear here. ", ""}; + dialog.printInstructions(defInstr); + dialog.show(); + println("Any messages for the tester will display here."); + } + + + public static void printInstructions(String[] instructions) { + dialog.printInstructions(instructions); + } + + + public static void println(String messageIn) { + dialog.displayMessage(messageIn); + } + +}// Sysout class + + +class TestDialog extends Dialog { + + TextArea instructionsText; + TextArea messageText; + int maxStringLength = 80; + + //DO NOT call this directly, go through Sysout + public TestDialog(Frame frame, String name) { + super(frame, name); + int scrollBoth = TextArea.SCROLLBARS_BOTH; + instructionsText = new TextArea("", 15, maxStringLength, scrollBoth); + add("North", instructionsText); + + messageText = new TextArea("", 5, maxStringLength, scrollBoth); + add("South", messageText); + + pack(); + + show(); + }// TestDialog() + + //DO NOT call this directly, go through Sysout + public void printInstructions(String[] instructions) { + //Clear out any current instructions + instructionsText.setText(""); + + //Go down array of instruction strings + + String printStr, remainingStr; + for (int i = 0; i < instructions.length; i++) { + //chop up each into pieces maxSringLength long + remainingStr = instructions[i]; + while (remainingStr.length() > 0) { + //if longer than max then chop off first max chars to print + if (remainingStr.length() >= maxStringLength) { + //Try to chop on a word boundary + int posOfSpace = remainingStr. + lastIndexOf(' ', maxStringLength - 1); + + if (posOfSpace <= 0) posOfSpace = maxStringLength - 1; + + printStr = remainingStr.substring(0, posOfSpace + 1); + remainingStr = remainingStr.substring(posOfSpace + 1); + } + //else just print + else { + printStr = remainingStr; + remainingStr = ""; + } + + instructionsText.append(printStr + "\n"); + + }// while + + }// for + + }//printInstructions() + + //DO NOT call this directly, go through Sysout + public void displayMessage(String messageIn) { + messageText.append(messageIn + "\n"); + } + +}// TestDialog class + diff --git a/jdk/test/java/awt/dnd/ImageDecoratedDnDInOut/ImageGenerator.java b/jdk/test/java/awt/dnd/ImageDecoratedDnDInOut/ImageGenerator.java new file mode 100644 index 00000000000..da6484a2d15 --- /dev/null +++ b/jdk/test/java/awt/dnd/ImageDecoratedDnDInOut/ImageGenerator.java @@ -0,0 +1,59 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * Image generator for cursor and drag + */ +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.image.BufferedImage; + +public abstract class ImageGenerator +{ + public int width; + public int height; + private final BufferedImage bi; + public ImageGenerator(int _width, int _height, Color bgColor) + { + width = _width; + height = _height; + bi = new BufferedImage( + width, + height, + BufferedImage.TYPE_INT_ARGB); + Graphics gr = bi.getGraphics(); + if(null==bgColor){ + bgColor = Color.WHITE; + } + gr.setColor(bgColor); + gr.fillRect(0, 0, width, height); + paint(gr); + gr.dispose(); + } + public Image getImage() { return bi; } + + public abstract void paint(Graphics gr); +} diff --git a/jdk/test/java/awt/dnd/ImageDecoratedDnDInOut/MyCursor.java b/jdk/test/java/awt/dnd/ImageDecoratedDnDInOut/MyCursor.java new file mode 100644 index 00000000000..a9d2b6d5750 --- /dev/null +++ b/jdk/test/java/awt/dnd/ImageDecoratedDnDInOut/MyCursor.java @@ -0,0 +1,86 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Toolkit; +import java.awt.Point; + +/** + * An interface provides a set of custom cursors + */ + +public interface MyCursor { + public static final java.awt.Cursor NO_DROP = Toolkit.getDefaultToolkit().createCustomCursor( + new ImageGenerator(32, 32, new Color(0xff, 0xff, 0xff, 0x00) ) { + @Override public void paint(Graphics gr) { + gr.setColor(Color.GREEN); + ((Graphics2D)gr).setStroke(new BasicStroke(3)); + + gr.translate(width/2, height/2); + int R = width/4; + gr.drawOval(-R, -R, 2*R, 2*R); + gr.drawLine(-R, R, R, -R); + } + }.getImage(), + new Point(0, 0), + "My NoDrop Cursor" + ); + public static final java.awt.Cursor MOVE = Toolkit.getDefaultToolkit().createCustomCursor( + new ImageGenerator(32, 32, new Color(0xff, 0xff, 0xff, 0x00) ) { + @Override public void paint(Graphics gr) { + gr.setColor(Color.GREEN); + ((Graphics2D)gr).setStroke(new BasicStroke(3)); + + gr.drawLine(0, 0, width, height); + gr.drawLine(0, 0, width/2, 0); + gr.drawLine(0, 0, 0, height/2); + } + }.getImage(), + new Point(0, 0), + "My Move Cursor" + ); + public static final java.awt.Cursor COPY = Toolkit.getDefaultToolkit().createCustomCursor( + new ImageGenerator(32, 32, new Color(0xff, 0xff, 0xff, 0x00) ) { + @Override public void paint(Graphics gr) { + gr.setColor(Color.GREEN); + ((Graphics2D)gr).setStroke(new BasicStroke(3)); + //arrow + gr.drawLine(0, 0, width/2, height/2); + gr.drawLine(0, 0, width/2, 0); + gr.drawLine(0, 0, 0, height/2); + //plus + gr.drawRect(width/2 - 1, height/2 -1, width/2 - 1, height/2 - 1); + gr.drawLine(width*3/4 - 1, height/2 - 1, width*3/4 - 1, height); + gr.drawLine(width/2 - 1, height*3/4 - 1, width, height*3/4 - 1); + } + }.getImage(), + new Point(0, 0), + "My Copy Cursor" + ); +} + diff --git a/jdk/test/java/awt/dnd/ImageDecoratedDnDNegative/DnDSource.java b/jdk/test/java/awt/dnd/ImageDecoratedDnDNegative/DnDSource.java new file mode 100644 index 00000000000..5ae8f08ac01 --- /dev/null +++ b/jdk/test/java/awt/dnd/ImageDecoratedDnDNegative/DnDSource.java @@ -0,0 +1,273 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* +* AWT Button is a DragSource and also a transferable object +*/ + +import java.awt.*; +import java.awt.datatransfer.*; + +import java.awt.image.ImageConsumer; +import java.awt.image.MemoryImageSource; + +import java.awt.dnd.*; +import java.io.*; + +class DnDSource extends Button implements Transferable, + DragGestureListener, + DragSourceListener { + private DataFlavor df; + private transient int dropAction; + private final int dragOperation = DnDConstants.ACTION_COPY | DnDConstants.ACTION_MOVE | DnDConstants.ACTION_LINK; + DragSource dragSource = new DragSource(); + + DnDSource(String label) { + super(label); + setBackground(Color.yellow); + setForeground(Color.blue); + df = new DataFlavor(DnDSource.class, "DnDSource"); + + dragSource.createDefaultDragGestureRecognizer( + this, + dragOperation, + this + ); + dragSource.addDragSourceListener(this); + } + + public void changeCursor( + DragSourceContext dsc, + int ra + ) { + java.awt.Cursor c = null; + if ((ra & DnDConstants.ACTION_LINK) == DnDConstants.ACTION_LINK) + c = DragSource.DefaultLinkDrop; + else if ((ra & DnDConstants.ACTION_MOVE) == DnDConstants.ACTION_MOVE) + c = MyCursor.MOVE;//DragSource.DefaultMoveDrop; + else if ((ra & DnDConstants.ACTION_COPY) == DnDConstants.ACTION_COPY) + c = MyCursor.COPY; + else + c = MyCursor.NO_DROP; + dsc.setCursor(c); + } + + /** + * a Drag gesture has been recognized + */ + int iProblem = 0; + String[] problem = {"unready", "throw exeption", "good"}; + public void dragGestureRecognized(DragGestureEvent dge) { + System.out.println("starting Drag"); + if( !DragSource.isDragImageSupported() ) { + dge.startDrag( + null, + this, + this); + } else { + setLabel("Drag ME! (with " + problem[iProblem] + " image)"); + int w = 100; + int h = 100; + int pix[] = new int[w * h]; + int index = 0; + for (int y = 0; y < h; y++) { + int red = (y * 255) / (h - 1); + for (int x = 0; x < w; x++) { + int blue = (x * 255) / (w - 1); + pix[index++] = (255 << 24) | (red << 16) | blue; + } + } + try{ + dge.startDrag( + null, + Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(w, h, pix, 0, w) + { + @Override + public void startProduction(ImageConsumer ic) + { + switch(iProblem){ + case 0: + //incomplite + break; + case 1: + //exception + throw new RuntimeException("test exception 1"); + default: + super.startProduction(ic); + break; + } + } + } + ), + new Point(15, 40) { + @Override + public double getX() { + if(2==iProblem){ + //never happen + throw new RuntimeException("test exception 2"); + } + return x; + } + @Override + public Point getLocation(){ + //never happen + throw new RuntimeException("test exception 3"); + } + }, + this, + this); + }catch(InvalidDnDOperationException e){ + if( iProblem<=2 ){ + System.err.println("good exception: " + e.getMessage() ); + } else { + System.err.println("bad exception"); + e.printStackTrace(); + throw new RuntimeException(e.getMessage()); + } + } finally { + ++iProblem; + } + } + } + + /** + * as the hotspot enters a platform dependent drop site + */ + + public void dragEnter(DragSourceDragEvent dsde) { + System.out.println("[Source] dragEnter"); + changeCursor( + dsde.getDragSourceContext(), + dsde.getUserAction() & dsde.getDropAction() + ); + } + + /** + * as the hotspot moves over a platform dependent drop site + */ + public void dragOver(DragSourceDragEvent dsde) { + System.out.println("[Source] dragOver"); + changeCursor( + dsde.getDragSourceContext(), + dsde.getUserAction() & dsde.getDropAction() + ); + dropAction = dsde.getUserAction() & dsde.getDropAction(); + System.out.println("dropAction = " + dropAction); + } + + /** + * as the hotspot exits a platform dependent drop site + */ + public void dragExit(DragSourceEvent dse) { + System.out.println("[Source] dragExit"); + changeCursor( + dse.getDragSourceContext(), + DnDConstants.ACTION_NONE + ); + } + + /** + * as the operation changes + */ + public void dragGestureChanged(DragSourceDragEvent dsde) { + System.out.println("[Source] dragGestureChanged"); + changeCursor( + dsde.getDragSourceContext(), + dsde.getUserAction() & dsde.getDropAction() + ); + dropAction = dsde.getUserAction() & dsde.getDropAction(); + System.out.println("dropAction = " + dropAction); + } + + + /** + * as the operation completes + */ + public void dragDropEnd(DragSourceDropEvent dsde) { + System.out.println("[Source] dragDropEnd"); + } + + public void dropActionChanged(DragSourceDragEvent dsde) { + System.out.println("[Source] dropActionChanged"); + dropAction = dsde.getUserAction() & dsde.getDropAction(); + System.out.println("dropAction = " + dropAction); + } + + public DataFlavor[] getTransferDataFlavors() { + return new DataFlavor[]{df}; + } + + public boolean isDataFlavorSupported(DataFlavor sdf) { + return df.equals(sdf); + } + + public Object getTransferData(DataFlavor tdf) throws UnsupportedFlavorException, IOException { + Object copy = null; + if( !df.equals(tdf) ){ + throw new UnsupportedFlavorException(tdf); + } + Container parent = getParent(); + switch (dropAction) { + case DnDConstants.ACTION_COPY: + try { + copy = this.clone(); + } catch (CloneNotSupportedException e) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(baos); + + oos.writeObject(this); + ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); + ObjectInputStream ois = new ObjectInputStream(bais); + try { + copy = ois.readObject(); + } catch (ClassNotFoundException cnfe) { + // do nothing + } + } + parent.add(this); + return copy; + + case DnDConstants.ACTION_MOVE: + synchronized (this) { + if (parent != null) { + parent.remove(this); + Label label = new Label("[empty]"); + label.setBackground(Color.cyan); + label.setBounds(this.getBounds()); + parent.add(label); + } + } + return this; + + case DnDConstants.ACTION_LINK: + return this; + + default: + return null; + } + + } +} + diff --git a/jdk/test/java/awt/dnd/ImageDecoratedDnDNegative/DnDTarget.java b/jdk/test/java/awt/dnd/ImageDecoratedDnDNegative/DnDTarget.java new file mode 100644 index 00000000000..52d39c4928a --- /dev/null +++ b/jdk/test/java/awt/dnd/ImageDecoratedDnDNegative/DnDTarget.java @@ -0,0 +1,113 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* +* Panel is a DropTarget +* +*/ + +import java.awt.*; +import java.awt.datatransfer.*; +import java.awt.dnd.*; +import java.io.*; + + +class DnDTarget extends Panel implements DropTargetListener { + private int dragOperation = DnDConstants.ACTION_COPY | DnDConstants.ACTION_MOVE; + Color bgColor; + Color htColor; + + DnDTarget(Color bgColor, Color htColor) { + super(); + this.bgColor = bgColor; + this.htColor = htColor; + setBackground(bgColor); + setDropTarget(new DropTarget(this, this)); + } + + + public void dragEnter(DropTargetDragEvent e) { + System.out.println("[Target] dragEnter"); + setBackground(htColor); + repaint(); + } + + public void dragOver(DropTargetDragEvent e) { + System.out.println("[Target] dragOver"); + } + + public void dragExit(DropTargetEvent e) { + System.out.println("[Target] dragExit"); + setBackground(bgColor); + repaint(); + } + + public void dragScroll(DropTargetDragEvent e) { + System.out.println("[Target] dragScroll"); + } + + public void dropActionChanged(DropTargetDragEvent e) { + System.out.println("[Target] dropActionChanged"); + } + + public void drop(DropTargetDropEvent dtde) { + System.out.println("[Target] drop"); + boolean success = false; + if ((dtde.getDropAction() & dragOperation) == 0) { + dtde.rejectDrop(); + Label label = new Label("[no links here :) ]"); + label.setBackground(Color.cyan); + add(label); + } else { + dtde.acceptDrop(dragOperation); + DataFlavor[] dfs = dtde.getCurrentDataFlavors(); + if (dfs != null && dfs.length >= 1){ + Transferable transfer = dtde.getTransferable(); + try { + Button button = (Button)transfer.getTransferData(dfs[0]); + if( button != null ){ + add(button); + success = true; + } + } catch (IOException ioe) { + System.out.println(ioe.getMessage()); + return; + } catch (UnsupportedFlavorException ufe) { + System.out.println(ufe.getMessage()); + return; + } catch (Exception e) { + System.out.println(e.getMessage()); + return; + } + } + } + setBackground(bgColor); + dtde.dropComplete(success); + + invalidate(); + validate(); + repaint(); + } +} diff --git a/jdk/test/java/awt/dnd/ImageDecoratedDnDNegative/ImageDecoratedDnDNegative.html b/jdk/test/java/awt/dnd/ImageDecoratedDnDNegative/ImageDecoratedDnDNegative.html new file mode 100644 index 00000000000..e51c99aad77 --- /dev/null +++ b/jdk/test/java/awt/dnd/ImageDecoratedDnDNegative/ImageDecoratedDnDNegative.html @@ -0,0 +1,20 @@ + + + + ImageDecoratedDnDNegative + + + +

      ImageDecoratedDnDInOut
      Bug ID: 4874070

      + +

      See the dialog box (usually in upper left corner) for the test description

      + + + + diff --git a/jdk/test/java/awt/dnd/ImageDecoratedDnDNegative/ImageDecoratedDnDNegative.java b/jdk/test/java/awt/dnd/ImageDecoratedDnDNegative/ImageDecoratedDnDNegative.java new file mode 100644 index 00000000000..f542a6837fd --- /dev/null +++ b/jdk/test/java/awt/dnd/ImageDecoratedDnDNegative/ImageDecoratedDnDNegative.java @@ -0,0 +1,268 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + test %W% %E% + @bug 4874070 + @summary Tests basic DnD functionality + @author Your Name: Alexey Utkin area=dnd + @run applet ImageDecoratedDnDNegative.html +*/ + +import java.applet.Applet; +import java.awt.*; +import java.awt.Robot; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.awt.geom.Point2D; + + +import java.awt.dnd.DragSource; + + +public class ImageDecoratedDnDNegative extends Applet { + //Declare things used in the test, like buttons and labels here + + public void init() { + //Create instructions for the user here, as well as set up + // the environment -- set the layout manager, add buttons, + // etc. + this.setLayout(new BorderLayout()); + + String[] instructions = + { + "Automatic test.", + "A Frame, which contains a yellow button labeled \"Drag ME!\" and ", + "a red panel, will appear below. ", + "1. The button would be clicked and dragged to the red panel. ", + "2. When the mouse enters the red panel during the drag, the panel ", + "should turn yellow. On the systems that supports pictured drag, ", + "the image under the drag-cursor should appear (ancor is shifted ", + "from top-left corner of the picture inside the picture to 10pt in both dimensions ). ", + "In WIN32 systems the image under cursor would be visible ONLY over ", + "the drop targets with activated extended OLE D\'n\'D support (that are ", + "the desktop and IE ).", + "3. The mouse would be released.", + "The panel should turn red again and a yellow button labeled ", + "\"Drag ME!\" should appear inside the panel. You should be able ", + "to repeat this operation multiple times." + }; + Sysout.createDialogWithInstructions(instructions); + + }//End init() + + public void moveTo( + Robot r, + Point b, + Point e) + { + Point2D.Double ee = new Point2D.Double(e.getX(), e.getY()); + Point2D.Double bb = new Point2D.Double(b.getX(), b.getY()); + final int count = (int)(ee.distance(bb)); + Point2D.Double c = new Point2D.Double(bb.getX(), bb.getY()); + for(int i=0; i 0) { + //if longer than max then chop off first max chars to print + if (remainingStr.length() >= maxStringLength) { + //Try to chop on a word boundary + int posOfSpace = remainingStr. + lastIndexOf(' ', maxStringLength - 1); + + if (posOfSpace <= 0) posOfSpace = maxStringLength - 1; + + printStr = remainingStr.substring(0, posOfSpace + 1); + remainingStr = remainingStr.substring(posOfSpace + 1); + } + //else just print + else { + printStr = remainingStr; + remainingStr = ""; + } + + instructionsText.append(printStr + "\n"); + + }// while + + }// for + + }//printInstructions() + + //DO NOT call this directly, go through Sysout + public void displayMessage(String messageIn) { + messageText.append(messageIn + "\n"); + } + +}// TestDialog class + diff --git a/jdk/test/java/awt/dnd/ImageDecoratedDnDNegative/ImageGenerator.java b/jdk/test/java/awt/dnd/ImageDecoratedDnDNegative/ImageGenerator.java new file mode 100644 index 00000000000..da6484a2d15 --- /dev/null +++ b/jdk/test/java/awt/dnd/ImageDecoratedDnDNegative/ImageGenerator.java @@ -0,0 +1,59 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * Image generator for cursor and drag + */ +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.image.BufferedImage; + +public abstract class ImageGenerator +{ + public int width; + public int height; + private final BufferedImage bi; + public ImageGenerator(int _width, int _height, Color bgColor) + { + width = _width; + height = _height; + bi = new BufferedImage( + width, + height, + BufferedImage.TYPE_INT_ARGB); + Graphics gr = bi.getGraphics(); + if(null==bgColor){ + bgColor = Color.WHITE; + } + gr.setColor(bgColor); + gr.fillRect(0, 0, width, height); + paint(gr); + gr.dispose(); + } + public Image getImage() { return bi; } + + public abstract void paint(Graphics gr); +} diff --git a/jdk/test/java/awt/dnd/ImageDecoratedDnDNegative/MyCursor.java b/jdk/test/java/awt/dnd/ImageDecoratedDnDNegative/MyCursor.java new file mode 100644 index 00000000000..a9d2b6d5750 --- /dev/null +++ b/jdk/test/java/awt/dnd/ImageDecoratedDnDNegative/MyCursor.java @@ -0,0 +1,86 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Toolkit; +import java.awt.Point; + +/** + * An interface provides a set of custom cursors + */ + +public interface MyCursor { + public static final java.awt.Cursor NO_DROP = Toolkit.getDefaultToolkit().createCustomCursor( + new ImageGenerator(32, 32, new Color(0xff, 0xff, 0xff, 0x00) ) { + @Override public void paint(Graphics gr) { + gr.setColor(Color.GREEN); + ((Graphics2D)gr).setStroke(new BasicStroke(3)); + + gr.translate(width/2, height/2); + int R = width/4; + gr.drawOval(-R, -R, 2*R, 2*R); + gr.drawLine(-R, R, R, -R); + } + }.getImage(), + new Point(0, 0), + "My NoDrop Cursor" + ); + public static final java.awt.Cursor MOVE = Toolkit.getDefaultToolkit().createCustomCursor( + new ImageGenerator(32, 32, new Color(0xff, 0xff, 0xff, 0x00) ) { + @Override public void paint(Graphics gr) { + gr.setColor(Color.GREEN); + ((Graphics2D)gr).setStroke(new BasicStroke(3)); + + gr.drawLine(0, 0, width, height); + gr.drawLine(0, 0, width/2, 0); + gr.drawLine(0, 0, 0, height/2); + } + }.getImage(), + new Point(0, 0), + "My Move Cursor" + ); + public static final java.awt.Cursor COPY = Toolkit.getDefaultToolkit().createCustomCursor( + new ImageGenerator(32, 32, new Color(0xff, 0xff, 0xff, 0x00) ) { + @Override public void paint(Graphics gr) { + gr.setColor(Color.GREEN); + ((Graphics2D)gr).setStroke(new BasicStroke(3)); + //arrow + gr.drawLine(0, 0, width/2, height/2); + gr.drawLine(0, 0, width/2, 0); + gr.drawLine(0, 0, 0, height/2); + //plus + gr.drawRect(width/2 - 1, height/2 -1, width/2 - 1, height/2 - 1); + gr.drawLine(width*3/4 - 1, height/2 - 1, width*3/4 - 1, height); + gr.drawLine(width/2 - 1, height*3/4 - 1, width, height*3/4 - 1); + } + }.getImage(), + new Point(0, 0), + "My Copy Cursor" + ); +} + diff --git a/jdk/test/java/awt/dnd/URIListBetweenJVMsTest/FileListTransferable.java b/jdk/test/java/awt/dnd/URIListBetweenJVMsTest/FileListTransferable.java new file mode 100644 index 00000000000..24cdcb356f0 --- /dev/null +++ b/jdk/test/java/awt/dnd/URIListBetweenJVMsTest/FileListTransferable.java @@ -0,0 +1,58 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.io.File; +import java.io.IOException; + +class FileListTransferable implements Transferable { + + final private DataFlavor[] supportedFlavors = + {DataFlavor.javaFileListFlavor}; + + private java.util.List list; + + public FileListTransferable(java.util.List list) { + this.list = list; + } + + public DataFlavor[] getTransferDataFlavors() { + return supportedFlavors; + } + + public boolean isDataFlavorSupported(DataFlavor flavor) { + for (DataFlavor df:supportedFlavors) { + if (df.equals(flavor)) return true; + } + return false; + } + + public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException { + if (flavor.equals(DataFlavor.javaFileListFlavor)) { + return list; + } + throw new UnsupportedFlavorException(flavor); + } +} diff --git a/jdk/test/java/awt/dnd/URIListBetweenJVMsTest/InterprocessMessages.java b/jdk/test/java/awt/dnd/URIListBetweenJVMsTest/InterprocessMessages.java new file mode 100644 index 00000000000..c7a3230b5e8 --- /dev/null +++ b/jdk/test/java/awt/dnd/URIListBetweenJVMsTest/InterprocessMessages.java @@ -0,0 +1,27 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +public interface InterprocessMessages { + final static int EXECUTION_IS_SUCCESSFULL = 0; + final static int WRONG_FILES_NUMBER_ON_TARGET = 212; +} diff --git a/jdk/test/java/awt/dnd/URIListBetweenJVMsTest/SourceFileListFrame.java b/jdk/test/java/awt/dnd/URIListBetweenJVMsTest/SourceFileListFrame.java new file mode 100644 index 00000000000..aa42c51276f --- /dev/null +++ b/jdk/test/java/awt/dnd/URIListBetweenJVMsTest/SourceFileListFrame.java @@ -0,0 +1,97 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import test.java.awt.regtesthelpers.Util; + +import java.awt.*; +import java.awt.dnd.DragGestureListener; +import java.awt.dnd.DragSource; +import java.awt.dnd.DnDConstants; +import java.awt.dnd.DragGestureEvent; +import java.io.File; +import java.util.Arrays; + + +class SourceFileListFrame extends Frame implements DragGestureListener { + + private final static int SOURCE_POINT_SHIFT = 3; + + private List list = new List(URIListBetweenJVMsTest.VISIBLE_RAWS_IN_LIST); + private File[] files; + + SourceFileListFrame() { + super("Source File List Frame"); + extractFilesFromTheWorkingDirectory(); + initList(); + initGUI(); + new DragSource().createDefaultDragGestureRecognizer(list, + DnDConstants.ACTION_COPY,this); + } + + private void extractFilesFromTheWorkingDirectory() { + files = new File(System.getProperty("java.home", "")).listFiles(); + } + + private void initList() { + for (File currFile:files) { + list.add(currFile.getName()); + } + } + + private void initGUI() { + this.addWindowListener(Util.getClosingWindowAdapter()); + this.setLocation(300,250); + this.add(new Panel().add(list)); + this.pack(); + this.setVisible(true); + } + + int getNextLocationX() { + return getX()+getWidth(); + } + + int getNextLocationY() { + return getY(); + } + + int getDragSourcePointX() { + return (int)list.getLocationOnScreen().getX()+(list.getWidth()/2); + } + + int getDragSourcePointY() { + return (int)list.getLocationOnScreen().getY()+ SOURCE_POINT_SHIFT; + } + + int getSourceFilesNumber() { + return files.length; + } + + public void dragGestureRecognized(DragGestureEvent dge) { + String [] filesAsStringArray = list.getItems(); + File [] files = new File[filesAsStringArray.length]; + for (int fileNumber=0; fileNumber fileList = extractListOfFiles(dtde); + for (File file:fileList) { + list.add(file.getName()); + } + + if (fileList.size() != expectationTransferredFilesNumber) + { + System.err.println("ERROR: Expected file number:" + + expectationTransferredFilesNumber + + "; Received file number: " + + fileList.size()); + TargetFileListFrame.this.dispose(); + System.exit(InterprocessMessages.WRONG_FILES_NUMBER_ON_TARGET); + } + + TargetFileListFrame.this.dispose(); + + } + + private java.util.List extractListOfFiles(DropTargetDropEvent dtde) { + BufferedReader reader = null; + ArrayList files = new ArrayList(); + try { + reader = new BufferedReader((Reader)dtde.getTransferable(). + getTransferData(dropFlavor)); + String line; + while ((line = reader.readLine()) != null) { + files.add(new File(new URI(line))); + } + } catch (UnsupportedFlavorException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (URISyntaxException e) { + e.printStackTrace(); + } finally { + if (reader != null) { + try { + reader.close(); + } catch (IOException ignored) { + } + } + } + return files; + } + + Point getDropTargetPoint() { + return new Point((int)list.getLocationOnScreen().getX()+(list.getWidth()/2), + (int)list.getLocationOnScreen().getY()+(list.getHeight()/2)); + } +} diff --git a/jdk/test/java/awt/dnd/URIListBetweenJVMsTest/URIListBetweenJVMsTest.html b/jdk/test/java/awt/dnd/URIListBetweenJVMsTest/URIListBetweenJVMsTest.html new file mode 100644 index 00000000000..cf5a41c0f3c --- /dev/null +++ b/jdk/test/java/awt/dnd/URIListBetweenJVMsTest/URIListBetweenJVMsTest.html @@ -0,0 +1,25 @@ + + + + DnD of URI-List across JVM + + + +

      URIListBetweenJVMsTest
      Bug ID: 4899516

      + +

      This is an AUTOMATIC test, simply wait for completion

      + + + + diff --git a/jdk/test/java/awt/dnd/URIListBetweenJVMsTest/URIListBetweenJVMsTest.java b/jdk/test/java/awt/dnd/URIListBetweenJVMsTest/URIListBetweenJVMsTest.java new file mode 100644 index 00000000000..63775943465 --- /dev/null +++ b/jdk/test/java/awt/dnd/URIListBetweenJVMsTest/URIListBetweenJVMsTest.java @@ -0,0 +1,158 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + test + @bug 4899516 + @summary Transferable has no DataFlavors when dragging from Gnome window to Swing + @author : area=dnd + @run applet URIListBetweenJVMsTest.html +*/ + +/** + * URIListBetweenJVMsTest.java + * + * summary: Transferable has no DataFlavors when dragging from Gnome window to Swing + */ + +import static java.lang.Thread.sleep; + +import test.java.awt.regtesthelpers.process.ProcessCommunicator; +import test.java.awt.regtesthelpers.process.ProcessResults; +import test.java.awt.regtesthelpers.Util; +import java.applet.Applet; +import java.awt.*; +import java.awt.event.InputEvent; +import java.io.*; + +public class URIListBetweenJVMsTest extends Applet { + + // information related to the test in common + static int VISIBLE_RAWS_IN_LIST=15; + + public void init() { + setLayout(new BorderLayout()); + + }//End init() + + public void start() { + + String toolkit = Toolkit.getDefaultToolkit().getClass().getName(); + if (toolkit.equals("sun.awt.windows.WToolkit")){ + System.out.println("This test is not for the Windows platform. Passed."); + return; + } else { + System.out.println("Toolkit = " + toolkit); + } + + SourceFileListFrame sourceFrame = new SourceFileListFrame(); + + Util.waitForIdle(null); + + String [] args = new String [] { + String.valueOf(sourceFrame.getNextLocationX()), + String.valueOf(sourceFrame.getNextLocationY()), + String.valueOf(sourceFrame.getDragSourcePointX()), + String.valueOf(sourceFrame.getDragSourcePointY()), + String.valueOf(sourceFrame.getSourceFilesNumber()) + }; + + String classpath = System.getProperty("java.class.path"); + ProcessResults processResults = + ProcessCommunicator.executeChildProcess(this.getClass(), classpath, args); + + verifyTestResults(processResults); + + }// start() + + private static void verifyTestResults(ProcessResults processResults) { + if ( InterprocessMessages.WRONG_FILES_NUMBER_ON_TARGET == + processResults.getExitValue()) + { + processResults.printProcessErrorOutput(System.err); + throw new RuntimeException("TEST IS FAILED: Target has recieved" + + " wrong number of files."); + } + processResults.verifyStdErr(System.err); + processResults.verifyProcessExitValue(System.err); + processResults.printProcessStandartOutput(System.out); + } + + //We cannot make an instance of the applet without the default constructor + public URIListBetweenJVMsTest () { + super(); + } + + //We need in this constructor to pass frame position between JVMs + public URIListBetweenJVMsTest (Point targetFrameLocation, Point dragSourcePoint, + int transferredFilesNumber) + throws InterruptedException + { + TargetFileListFrame targetFrame = new TargetFileListFrame(targetFrameLocation, + transferredFilesNumber); + + Util.waitForIdle(null); + + final Robot robot = Util.createRobot(); + + robot.mouseMove((int)dragSourcePoint.getX(),(int)dragSourcePoint.getY()); + sleep(100); + robot.mousePress(InputEvent.BUTTON1_MASK); + sleep(100); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + sleep(100); + + Util.drag(robot, dragSourcePoint, targetFrame.getDropTargetPoint(), + InputEvent.BUTTON1_MASK); + + } + + enum InterprocessArguments { + TARGET_FRAME_X_POSITION_ARGUMENT, + TARGET_FRAME_Y_POSITION_ARGUMENT, + DRAG_SOURCE_POINT_X_ARGUMENT, + DRAG_SOURCE_POINT_Y_ARGUMENT, + FILES_IN_THE_LIST_NUMBER_ARGUMENT; + + int extract (String [] args) { + return Integer.parseInt(args[this.ordinal()]); + } + } + + public static void main (String [] args) { + Point dragSourcePoint = new Point(InterprocessArguments.DRAG_SOURCE_POINT_X_ARGUMENT.extract(args), + InterprocessArguments.DRAG_SOURCE_POINT_Y_ARGUMENT.extract(args)); + Point targetFrameLocation = new Point(InterprocessArguments.TARGET_FRAME_X_POSITION_ARGUMENT.extract(args), + InterprocessArguments.TARGET_FRAME_Y_POSITION_ARGUMENT.extract(args)); + int transferredFilesNumber = InterprocessArguments.FILES_IN_THE_LIST_NUMBER_ARGUMENT.extract(args); + + try { + new URIListBetweenJVMsTest(targetFrameLocation, dragSourcePoint, transferredFilesNumber); + } catch (InterruptedException e) { + e.printStackTrace(); + } + + } + + +}// class URIListBetweenJVMsTest diff --git a/jdk/test/java/awt/font/GlyphVector/VisualBounds.java b/jdk/test/java/awt/font/GlyphVector/VisualBounds.java new file mode 100644 index 00000000000..1af3631b1ee --- /dev/null +++ b/jdk/test/java/awt/font/GlyphVector/VisualBounds.java @@ -0,0 +1,66 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @summary leading and trailing spaces must not affect visual bounds + * @bug 6904962 + */ + + +import java.awt.*; +import java.awt.font.*; +import java.awt.geom.*; + +public class VisualBounds { + + public static void main(String args[]) { + + String s1 = "a"; + String s2 = s1+" "; + String s3 = " "+s1; + Font f = new Font("Dialog", Font.PLAIN, 12); + FontRenderContext frc = new FontRenderContext(null, false, false); + GlyphVector gv1 = f.createGlyphVector(frc, s1); + GlyphVector gv2 = f.createGlyphVector(frc, s2); + GlyphVector gv3 = f.createGlyphVector(frc, s3); + Rectangle2D bds1 = gv1.getVisualBounds(); + Rectangle2D bds2 = gv2.getVisualBounds(); + Rectangle2D bds3 = gv3.getVisualBounds(); + GlyphVector gv4 = f.createGlyphVector(frc, " "); + Rectangle2D bds4 = gv4.getVisualBounds(); + System.out.println(bds1); + System.out.println(bds2); + System.out.println(bds3); + System.out.println(bds4); + + if (!bds1.equals(bds2)) { + throw new RuntimeException("Trailing space: Visual bounds differ"); + } + if (bds2.getWidth() != bds3.getWidth()) { + throw new RuntimeException("Leading space: Visual widths differ"); + } + if (!bds4.isEmpty()) { + throw new RuntimeException("Non empty bounds for space"); + } + } +} diff --git a/jdk/test/java/awt/regtesthelpers/process/ProcessCommunicator.java b/jdk/test/java/awt/regtesthelpers/process/ProcessCommunicator.java index f303727036e..15f5560cca0 100644 --- a/jdk/test/java/awt/regtesthelpers/process/ProcessCommunicator.java +++ b/jdk/test/java/awt/regtesthelpers/process/ProcessCommunicator.java @@ -155,7 +155,6 @@ public class ProcessCommunicator { commandBuilder.append(" "); commandBuilder.append(classToExecute.getName()); - for (String argument:args) { commandBuilder.append(" ").append(argument); } diff --git a/jdk/test/java/beans/EventHandler/Test6788531.java b/jdk/test/java/beans/EventHandler/Test6788531.java index 1754f5bc552..375c0fbab3a 100644 --- a/jdk/test/java/beans/EventHandler/Test6788531.java +++ b/jdk/test/java/beans/EventHandler/Test6788531.java @@ -36,7 +36,7 @@ public class Test6788531 { public static void main(String[] args) throws Exception { JButton button = new JButton("hi"); button.addActionListener(EventHandler.create(ActionListener.class, new Private(), "run")); - button.addActionListener(EventHandler.create(ActionListener.class, new PrivateGeneric(), "run", "generic")); + button.addActionListener(EventHandler.create(ActionListener.class, new PrivateGeneric(), "run", "actionCommand")); button.doClick(); } diff --git a/jdk/test/java/beans/Introspector/6380849/TestBeanInfo.java b/jdk/test/java/beans/Introspector/6380849/TestBeanInfo.java index b149bffb820..a4414bd415f 100644 --- a/jdk/test/java/beans/Introspector/6380849/TestBeanInfo.java +++ b/jdk/test/java/beans/Introspector/6380849/TestBeanInfo.java @@ -1,5 +1,5 @@ /** - * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,6 +38,7 @@ import infos.ThirdBeanBeanInfo; import java.beans.BeanInfo; import java.beans.Introspector; +import java.lang.ref.Reference; import java.lang.reflect.Field; import sun.awt.SunToolkit; @@ -61,9 +62,10 @@ public class TestBeanInfo implements Runnable { try { actual = Introspector.getBeanInfo(type); type = actual.getClass(); - Field field = type.getDeclaredField("targetBeanInfo"); // NON-NLS: field name + Field field = type.getDeclaredField("targetBeanInfoRef"); // NON-NLS: field name field.setAccessible(true); - actual = (BeanInfo) field.get(actual); + Reference ref = (Reference) field.get(actual); + actual = (BeanInfo) ref.get(); } catch (Exception exception) { throw new Error("unexpected error", exception); diff --git a/jdk/test/java/beans/Introspector/Test4498236.java b/jdk/test/java/beans/Introspector/Test4498236.java new file mode 100644 index 00000000000..92abb1f34b5 --- /dev/null +++ b/jdk/test/java/beans/Introspector/Test4498236.java @@ -0,0 +1,188 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 4498236 + * @summary Tests toString methods + * @author Sergey Malenkov + */ + +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.beans.BeanDescriptor; +import java.beans.EventSetDescriptor; +import java.beans.FeatureDescriptor; +import java.beans.IndexedPropertyChangeEvent; +import java.beans.IndexedPropertyDescriptor; +import java.beans.MethodDescriptor; +import java.beans.ParameterDescriptor; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyDescriptor; +import java.lang.reflect.Method; + +public class Test4498236 { + + public static void main(String[] args) throws Exception { + PropertyChangeEvent event = new PropertyChangeEvent("source", null, null, null); + event.setPropagationId("id"); + test("[propertyName=null; oldValue=null; newValue=null; propagationId=id; source=source]", event); + test("[propertyName=name; oldValue=old; newValue=new; propagationId=null; source=source]", + new PropertyChangeEvent("source", "name", "old", "new") + ); + test("[propertyName=array; index=5; oldValue=old; newValue=new; propagationId=null; source=source]", + new IndexedPropertyChangeEvent("source", "array", "old", "new", 5) + ); + FeatureDescriptor fd = new FeatureDescriptor(); + fd.setName("n"); + fd.setDisplayName("dn"); + fd.setShortDescription("sd"); + fd.setPreferred(true); + fd.setHidden(true); + fd.setExpert(true); + fd.setValue("first", "value"); + test("[name=n; displayName=dn; shortDescription=sd; preferred; hidden; expert; values={first=value}]", fd); + test("[name=String; beanClass=class java.lang.String]", + new BeanDescriptor(String.class) + ); + test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]", + new BeanDescriptor(Object.class, String.class) + ); + test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]", + new BeanDescriptor(Object.class, String.class) + ); + test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object)]", + new MethodDescriptor(Object.class.getMethod("equals", Object.class)) + ); + test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object); parameterDescriptors={java.beans.ParameterDescriptor[name=null]}]", + new MethodDescriptor(Object.class.getMethod("equals", Object.class), new ParameterDescriptor[] { + new ParameterDescriptor() + }) + ); + Class type = KeyListener.class; + String[] names = { "keyTyped", "keyPressed", "keyReleased" }; + Method[] methods = new Method[names.length]; + for (int i = 0; i < names.length; i++) { + methods[i] = type.getMethod(names[i], KeyEvent.class); + } + test("[name=key; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.getKeyListeners(); addListenerMethod=public void Test4498236.addKeyListener(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.removeKeyListener(java.awt.event.KeyListener)]", + new EventSetDescriptor(Test4498236.class, "key", type, names[0]) + ); + test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]", + new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove") + ); + test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]", + new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove", "get") + ); + test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]", + new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type)) + ); + test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]", + new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type), Test4498236.class.getMethod("get")) + ); + test("[name=value; propertyType=boolean; readMethod=public boolean Test4498236.isValue(); writeMethod=public void Test4498236.setValue(boolean)]", + new PropertyDescriptor("value", Test4498236.class) + ); + test("[name=$$$]", + new PropertyDescriptor("$$$", Test4498236.class, null, null) + ); + test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]", + new PropertyDescriptor("$$$", Test4498236.class, "getValue", null) + ); + test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]", + new PropertyDescriptor("$$$", Test4498236.class, "getValue", "setValue") + ); + test("[name=$$$]", + new PropertyDescriptor("$$$", null, null) + ); + test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]", + new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), null) + ); + test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]", + new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), Test4498236.class.getMethod("setValue", boolean.class)) + ); + test("[name=index; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]", + new IndexedPropertyDescriptor("index", Test4498236.class) + ); + test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]", + new IndexedPropertyDescriptor("$$$", Test4498236.class, "getIndex", "setIndex", "getIndex", "setIndex") + ); + test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]", + new IndexedPropertyDescriptor("$$$", Test4498236.class.getMethod("getIndex"), Test4498236.class.getMethod("setIndex", new int[0].getClass()), Test4498236.class.getMethod("getIndex", int.class), Test4498236.class.getMethod("setIndex", int.class, int.class) ) + ); + } + + public void addKeyListener(KeyListener listener) { + add(listener); + } + + public void removeKeyListener(KeyListener listener) { + remove(listener); + } + + public KeyListener getKeyListeners() { + return null; + } + + public void add(KeyListener listener) { + } + + public void remove(KeyListener listener) { + } + + public KeyListener get() { + return null; + } + + public boolean isValue() { + return true; + } + + public boolean getValue() { + return true; + } + + public void setValue(boolean value) { + } + + public int[] getIndex() { + return null; + } + + public int getIndex(int index) { + return 0; + } + + public void setIndex(int index, int value) { + } + + public void setIndex(int[] value) { + } + + private static void test(String expected, Object object) { + String actual = object.toString(); + if (!actual.equals(object.getClass().getName() + expected)) { + throw new Error(actual); + } + } +} diff --git a/jdk/test/java/beans/Introspector/Test5102804.java b/jdk/test/java/beans/Introspector/Test5102804.java new file mode 100644 index 00000000000..72de1b76e97 --- /dev/null +++ b/jdk/test/java/beans/Introspector/Test5102804.java @@ -0,0 +1,156 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 5102804 + * @summary Tests memory leak + * @author Sergey Malenkov + * @run main/othervm -ms16m -mx16m Test5102804 + */ + +import java.beans.BeanInfo; +import java.beans.IntrospectionException; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; +import java.beans.SimpleBeanInfo; +import java.lang.ref.Reference; +import java.lang.ref.WeakReference; +import java.net.URL; +import java.net.URLClassLoader; + +public class Test5102804 { + private static final String BEAN_NAME = "Test5102804$Example"; + private static final String BEAN_INFO_NAME = BEAN_NAME + "BeanInfo"; + + public static void main(String[] args) { + if (!isCollectible(getReference())) + throw new Error("Reference is not collected"); + } + + private static Reference getReference() { + try { + ClassLoader loader = new Loader(); + Class type = Class.forName(BEAN_NAME, true, loader); + if (!type.getClassLoader().equals(loader)) { + throw new Error("Wrong class loader"); + } + BeanInfo info = Introspector.getBeanInfo(type); + if (0 != info.getDefaultPropertyIndex()) { + throw new Error("Wrong bean info found"); + } + return new WeakReference(type); + } + catch (IntrospectionException exception) { + throw new Error("Introspection Error", exception); + } + catch (ClassNotFoundException exception) { + throw new Error("Class Not Found", exception); + } + } + + private static boolean isCollectible(Reference reference) { + int[] array = new int[10]; + while (true) { + try { + array = new int[array.length + array.length / 3]; + } + catch (OutOfMemoryError error) { + return null == reference.get(); + } + } + } + + /** + * Custom class loader to load the Example class by itself. + * Could also load it from a different code source, but this is easier to set up. + */ + private static final class Loader extends URLClassLoader { + Loader() { + super(new URL[] { + Test5102804.class.getProtectionDomain().getCodeSource().getLocation() + }); + } + + @Override + protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException { + Class c = findLoadedClass(name); + if (c == null) { + if (BEAN_NAME.equals(name) || BEAN_INFO_NAME.equals(name)) { + c = findClass(name); + } + else try { + c = getParent().loadClass(name); + } + catch (ClassNotFoundException exception) { + c = findClass(name); + } + } + if (resolve) { + resolveClass(c); + } + return c; + } + } + + /** + * A simple bean to load from the Loader class, not main class loader. + */ + public static final class Example { + private int value; + + public int getValue() { + return value; + } + + public void setValue(int value) { + this.value = value; + } + } + + /** + * The BeanInfo for the Example class. + * It is also loaded from the Loader class. + */ + public static final class ExampleBeanInfo extends SimpleBeanInfo { + @Override + public int getDefaultPropertyIndex() { + return 0; + } + + @Override + public PropertyDescriptor[] getPropertyDescriptors() { + try { + return new PropertyDescriptor[] { + new PropertyDescriptor("value", Class.forName(BEAN_NAME)) + }; + } + catch (ClassNotFoundException exception) { + return null; + } + catch (IntrospectionException exception) { + return null; + } + } + } +} diff --git a/jdk/test/java/beans/XMLEncoder/6329581/Test6329581.java b/jdk/test/java/beans/XMLEncoder/6329581/Test6329581.java index c307dab1267..3f51180e4f3 100644 --- a/jdk/test/java/beans/XMLEncoder/6329581/Test6329581.java +++ b/jdk/test/java/beans/XMLEncoder/6329581/Test6329581.java @@ -33,43 +33,70 @@ import java.beans.XMLDecoder; import java.beans.XMLEncoder; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import java.io.File; import java.net.URL; import java.net.URLClassLoader; -public class Test6329581 implements ExceptionListener { - - public static void main(String[] args) throws Exception { - ExceptionListener listener = new Test6329581(); - // write bean to byte array - ByteArrayOutputStream out = new ByteArrayOutputStream(); - XMLEncoder encoder = new XMLEncoder(out); - encoder.setExceptionListener(listener); - encoder.writeObject(getClassLoader("beans.jar").loadClass("test.Bean").newInstance()); - encoder.close(); - // read bean from byte array - ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()); - XMLDecoder decoder = new XMLDecoder(in, null, listener, getClassLoader("beans.jar")); - Object object = decoder.readObject(); - decoder.close(); - - if (!object.getClass().getClassLoader().getClass().equals(URLClassLoader.class)) { - throw new Error("bean is loaded with unexpected class loader"); - } +public class Test6329581 extends URLClassLoader implements ExceptionListener { + public static final class Bean { } - private static ClassLoader getClassLoader(String name) throws Exception { - StringBuilder sb = new StringBuilder(256); - sb.append("file:"); - sb.append(System.getProperty("test.src", ".")); - sb.append(File.separatorChar); - sb.append(name); + public static void main(String[] args) throws Exception { + new Test6329581().decode(new Test6329581().encode(Bean.class.getName())); + } - URL[] url = { new URL(sb.toString()) }; - return new URLClassLoader(url); + private Test6329581() { + super(new URL[] { + Test6329581.class.getProtectionDomain().getCodeSource().getLocation() + }); + } + + @Override + protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException { + Class c = findLoadedClass(name); + if (c == null) { + if (Bean.class.getName().equals(name)) { + c = findClass(name); + } + else try { + c = getParent().loadClass(name); + } + catch (ClassNotFoundException exception) { + c = findClass(name); + } + } + if (resolve) { + resolveClass(c); + } + return c; } public void exceptionThrown(Exception exception) { throw new Error("unexpected exception", exception); } + + private void validate(Object object) { + if (!object.getClass().getClassLoader().equals(this)) { + throw new Error("Bean is loaded with unexpected class loader"); + } + } + + private byte[] encode(String name) throws Exception { + Object object = loadClass(name).newInstance(); + validate(object); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + XMLEncoder encoder = new XMLEncoder(out); + encoder.setExceptionListener(this); + encoder.writeObject(object); + encoder.close(); + return out.toByteArray(); + } + + private Object decode(byte[] array) { + ByteArrayInputStream in = new ByteArrayInputStream(array); + XMLDecoder decoder = new XMLDecoder(in, null, this, this); + Object object = decoder.readObject(); + validate(object); + decoder.close(); + return object; + } } diff --git a/jdk/test/java/beans/XMLEncoder/Test4646747.java b/jdk/test/java/beans/XMLEncoder/Test4646747.java index 025ddeb1b10..b0ec2d7d7f4 100644 --- a/jdk/test/java/beans/XMLEncoder/Test4646747.java +++ b/jdk/test/java/beans/XMLEncoder/Test4646747.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2004-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ * @bug 4646747 * @summary Tests that persistence delegate is correct after memory stress * @author Mark Davidson + * @run main/othervm -ms16m -mx16m Test4646747 */ import java.beans.DefaultPersistenceDelegate; @@ -41,11 +42,14 @@ public class Test4646747 { encoder.setPersistenceDelegate(Test4646747.class, new MyPersistenceDelegate()); // WARNING: This can eat up a lot of memory Object[] obs = new Object[10000]; - for (int i = 0; i < obs.length; i++) { - obs[i] = new int[1000]; + while (obs != null) { + try { + obs = new Object[obs.length + obs.length / 3]; + } + catch (OutOfMemoryError error) { + obs = null; + } } - System.gc(); - System.gc(); PersistenceDelegate pd = encoder.getPersistenceDelegate(Test4646747.class); if (!(pd instanceof MyPersistenceDelegate)) throw new Error("persistence delegate has been lost"); diff --git a/jdk/test/java/beans/XMLEncoder/Test5023550.java b/jdk/test/java/beans/XMLEncoder/Test5023550.java new file mode 100644 index 00000000000..b48d85c6e44 --- /dev/null +++ b/jdk/test/java/beans/XMLEncoder/Test5023550.java @@ -0,0 +1,122 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 5023550 + * @summary Tests complex references to owner + * @author Sergey Malenkov + */ + +import java.beans.DefaultPersistenceDelegate; +import java.beans.Encoder; +import java.beans.Expression; +import java.beans.XMLDecoder; +import java.beans.XMLEncoder; + +public class Test5023550 extends AbstractTest { + public static void main(String[] args) { + new Test5023550().test(true); + } + + private final Owner owner = new Owner(); + + @Override + protected void initialize(XMLEncoder encoder) { + encoder.setOwner(this.owner); + encoder.setPersistenceDelegate(A.class, new ADelegate()); + encoder.setPersistenceDelegate(B.class, new BDelegate()); + encoder.setPersistenceDelegate(C.class, new CDelegate()); + } + + @Override + protected void initialize(XMLDecoder decoder) { + decoder.setOwner(this.owner); + } + + protected Object getObject() { + return this.owner.newA(this.owner.newB().newC()); + } + + public static class Owner { + public A newA(C c) { + return new A(c); + } + + public B newB() { + return new B(); + } + } + + public static class A { + private final C c; + + private A(C c) { + this.c = c; + } + + public C getC() { + return this.c; + } + } + + public static class B { + public C newC() { + return new C(this); + } + } + + public static class C { + private final B b; + + private C(B b) { + this.b = b; + } + + public B getB() { + return this.b; + } + } + + public static class ADelegate extends DefaultPersistenceDelegate { + protected Expression instantiate(Object old, Encoder out) { + XMLEncoder encoder = (XMLEncoder) out; + A a = (A) old; + return new Expression(old, encoder.getOwner(), "newA", new Object[] { a.getC() }); + } + } + + public static class BDelegate extends DefaultPersistenceDelegate { + protected Expression instantiate(Object old, Encoder out) { + XMLEncoder encoder = (XMLEncoder) out; + return new Expression(old, encoder.getOwner(), "newB", new Object[0]); + } + } + + public static class CDelegate extends DefaultPersistenceDelegate { + protected Expression instantiate(Object old, Encoder out) { + C c = (C) old; + return new Expression(c, c.getB(), "newC", new Object[0]); + } + } +} diff --git a/jdk/test/java/beans/XMLEncoder/Test5023557.java b/jdk/test/java/beans/XMLEncoder/Test5023557.java new file mode 100644 index 00000000000..10563701aca --- /dev/null +++ b/jdk/test/java/beans/XMLEncoder/Test5023557.java @@ -0,0 +1,99 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 5023557 + * @summary Tests complex references + * @author Sergey Malenkov + */ + +import java.beans.DefaultPersistenceDelegate; +import java.beans.Encoder; +import java.beans.Expression; +import java.beans.XMLEncoder; + +public class Test5023557 extends AbstractTest { + public static void main(String[] args) { + new Test5023557().test(true); + } + + @Override + protected void initialize(XMLEncoder encoder) { + encoder.setPersistenceDelegate(B.class, new BDelegate()); + encoder.setPersistenceDelegate(C.class, new CDelegate()); + } + + protected Object getObject() { + A a = new A(); + return a.newC(a.newB()); + } + + public static class A { + public B newB() { + return new B(this); + } + + public C newC(B b) { + return new C(b); + } + } + + public static class B { + private final A a; + + private B(A a) { + this.a = a; + } + + public A getA() { + return this.a; + } + } + + public static class C { + private final B b; + + private C(B b) { + this.b = b; + } + + public B getB() { + return this.b; + } + } + + public static class BDelegate extends DefaultPersistenceDelegate { + protected Expression instantiate(Object old, Encoder out) { + B b = (B) old; + return new Expression(b, b.getA(), "newB", new Object[0]); + } + } + + public static class CDelegate extends DefaultPersistenceDelegate { + protected Expression instantiate(Object old, Encoder out) { + C c = (C) old; + return new Expression(c, c.getB().getA(), "newC", new Object[] { c.getB() }); + } + } +} diff --git a/jdk/test/java/beans/XMLEncoder/Test6921644.java b/jdk/test/java/beans/XMLEncoder/Test6921644.java new file mode 100644 index 00000000000..5dc2fed8676 --- /dev/null +++ b/jdk/test/java/beans/XMLEncoder/Test6921644.java @@ -0,0 +1,197 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6921644 + * @summary Tests references to cached integer + * @author Sergey Malenkov + */ + +import java.beans.ConstructorProperties; +import java.util.ArrayList; +import java.util.List; + +public final class Test6921644 extends AbstractTest { + public static void main(String[] args) { + new Test6921644().test(true); + } + + protected Object getObject() { + Owner o = new Owner(100); // it works if ID >= 128 + + Category c = new Category(o); + + Document d1 = new Document(o); + Document d2 = new Document(o); + Document d3 = new Document(o); + + Author a1 = new Author(o); + Author a2 = new Author(o); + Author a3 = new Author(o); + + o.getList().add(a1); + o.getList().add(a2); + o.getList().add(a3); + + a3.setRef(o.getId()); + + d2.setCategory(c); + d3.setCategory(c); + + a1.addDocument(d1); + a1.addDocument(d2); + a3.addDocument(d3); + + c.addDocument(d2); + c.addDocument(d3); + + return o; + } + + public static class Owner { + private int id; + private List list = new ArrayList(); + + @ConstructorProperties("id") + public Owner(int id) { + this.id = id; + } + + public int getId() { + return this.id; + } + + public List getList() { + return this.list; + } + + public void setList(List list) { + this.list = list; + } + } + + public static class Author { + private int id; + private int ref; + private Owner owner; + private List list = new ArrayList(); + + @ConstructorProperties("owner") + public Author(Owner owner) { + this.owner = owner; + this.id = owner.getId(); + } + + public Owner getOwner() { + return this.owner; + } + + public Integer getId() { + return this.id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getRef() { + return this.ref; + } + + public void setRef(Integer ref) { + this.ref = ref; + } + + public List getList() { + return this.list; + } + + public void setList(List list) { + this.list = list; + } + + public void addDocument(Document document) { + this.list.add(document); + document.setAuthor(this); + } + } + + public static class Category { + private Owner owner; + private List list = new ArrayList(); + + @ConstructorProperties("owner") + public Category(Owner owner) { + this.owner = owner; + } + + public Owner getOwner() { + return this.owner; + } + + public List getList() { + return this.list; + } + + public void setList(List list) { + this.list = list; + } + + public void addDocument(Document document) { + this.list.add(document); + document.setCategory(this); + } + } + + public static class Document { + private Owner owner; + private Author author; + private Category category; + + @ConstructorProperties("owner") + public Document(Owner owner) { + this.owner = owner; + } + + public Owner getOwner() { + return this.owner; + } + + public Author getAuthor() { + return this.author; + } + + public void setAuthor(Author author) { + this.author = author; + } + + public Category getCategory() { + return this.category; + } + + public void setCategory(Category category) { + this.category = category; + } + } +} diff --git a/jdk/test/java/dyn/MethodHandlesTest.java b/jdk/test/java/dyn/MethodHandlesTest.java new file mode 100644 index 00000000000..a482d58a53c --- /dev/null +++ b/jdk/test/java/dyn/MethodHandlesTest.java @@ -0,0 +1,1839 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @summary unit tests for java.dyn.MethodHandles + * @compile -XDinvokedynamic MethodHandlesTest.java + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic jdk.java.dyn.MethodHandlesTest + */ + +package jdk.java.dyn; + +import java.dyn.*; +import java.dyn.MethodHandles.Lookup; +import java.lang.reflect.*; +import java.util.*; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.*; +import static org.junit.Assert.*; + + +/** + * + * @author jrose + */ +public class MethodHandlesTest { + // How much output? + static int verbosity = 1; + + // Set this true during development if you want to fast-forward to + // a particular new, non-working test. Tests which are known to + // work (or have recently worked) test this flag and return on true. + static boolean CAN_SKIP_WORKING = false; + //static { CAN_SKIP_WORKING = true; } + + // Set true to test more calls. If false, some tests are just + // lookups, without exercising the actual method handle. + static boolean DO_MORE_CALLS = false; + + + @Test + public void testFirst() throws Throwable { + verbosity += 9; try { + // left blank for debugging + } finally { verbosity -= 9; } + } + + // current failures + @Test @Ignore("failure in call to makeRawRetypeOnly in ToGeneric") + public void testFail_1() throws Throwable { + testSpreadArguments(int.class, 0, 6); + } + @Test @Ignore("failure in JVM when expanding the stack") + public void testFail_2() throws Throwable { + // if CONV_OP_IMPLEMENTED_MASK includes OP_SPREAD_ARGS, this crashes: + testSpreadArguments(Object.class, 0, 2); + } + @Test @Ignore("IllArgEx failure in call to ToGeneric.make") + public void testFail_3() throws Throwable { + testSpreadArguments(int.class, 1, 2); + } + @Test @Ignore("IllArgEx failure in call to ToGeneric.make") + public void testFail_4() throws Throwable { + testCollectArguments(int.class, 1, 2); + } + @Test @Ignore("cannot collect leading primitive types") + public void testFail_5() throws Throwable { + testInvokers(MethodType.genericMethodType(2).changeParameterType(0, int.class)); + } + @Test @Ignore("should not insert arguments beyond MethodHandlePushLimit") + public void testFail_6() throws Throwable { + testInsertArguments(0, 0, MAX_ARG_INCREASE+1); + } + static final int MAX_ARG_INCREASE = 3; + + public MethodHandlesTest() { + } + + String testName; + int posTests, negTests; + @After + public void printCounts() { + if (verbosity >= 1 && (posTests | negTests) != 0) { + System.out.println(); + if (posTests != 0) System.out.println("=== "+testName+": "+posTests+" positive test cases run"); + if (negTests != 0) System.out.println("=== "+testName+": "+negTests+" negative test cases run"); + } + } + void countTest(boolean positive) { + if (positive) ++posTests; + else ++negTests; + } + void countTest() { countTest(true); } + void startTest(String name) { + if (testName != null) printCounts(); + if (verbosity >= 0) + System.out.println(name); + posTests = negTests = 0; + testName = name; + } + + @BeforeClass + public static void setUpClass() throws Exception { + calledLog.clear(); + calledLog.add(null); + nextArg = 1000000; + } + + @AfterClass + public static void tearDownClass() throws Exception { + } + + static List calledLog = new ArrayList(); + static Object logEntry(String name, Object... args) { + return Arrays.asList(name, Arrays.asList(args)); + } + static Object called(String name, Object... args) { + Object entry = logEntry(name, args); + calledLog.add(entry); + return entry; + } + static void assertCalled(String name, Object... args) { + Object expected = logEntry(name, args); + Object actual = calledLog.get(calledLog.size() - 1); + if (expected.equals(actual)) return; + System.out.println("assertCalled "+name+":"); + System.out.println("expected: "+expected); + System.out.println("actual: "+actual); + System.out.println("ex. types: "+getClasses(expected)); + System.out.println("act. types: "+getClasses(actual)); + assertEquals("previous method call types", expected, actual); + assertEquals("previous method call", expected, actual); + } + static void printCalled(MethodHandle target, String name, Object... args) { + if (verbosity >= 2) + System.out.println("calling "+logEntry(name, args)+" on "+target); + } + + static Object castToWrapper(Object value, Class dst) { + Object wrap = null; + if (value instanceof Number) + wrap = castToWrapperOrNull(((Number)value).longValue(), dst); + if (value instanceof Character) + wrap = castToWrapperOrNull((char)(Character)value, dst); + if (wrap != null) return wrap; + return dst.cast(value); + } + + static Object castToWrapperOrNull(long value, Class dst) { + if (dst == int.class || dst == Integer.class) + return (int)(value); + if (dst == long.class || dst == Long.class) + return (long)(value); + if (dst == char.class || dst == Character.class) + return (char)(value); + if (dst == short.class || dst == Short.class) + return (short)(value); + if (dst == float.class || dst == Float.class) + return (float)(value); + if (dst == double.class || dst == Double.class) + return (double)(value); + if (dst == byte.class || dst == Byte.class) + return (byte)(value); + if (dst == boolean.class || dst == boolean.class) + return ((value % 29) & 1) == 0; + return null; + } + + static int nextArg; + static Object randomArg(Class param) { + Object wrap = castToWrapperOrNull(nextArg, param); + if (wrap != null) { + nextArg++; + return wrap; + } +// import sun.dyn.util.Wrapper; +// Wrapper wrap = Wrapper.forBasicType(dst); +// if (wrap == Wrapper.OBJECT && Wrapper.isWrapperType(dst)) +// wrap = Wrapper.forWrapperType(dst); +// if (wrap != Wrapper.OBJECT) +// return wrap.wrap(nextArg++); + if (param.isInterface() || param.isAssignableFrom(String.class)) + return "#"+(nextArg++); + else + try { + return param.newInstance(); + } catch (InstantiationException ex) { + } catch (IllegalAccessException ex) { + } + return null; // random class not Object, String, Integer, etc. + } + static Object[] randomArgs(Class... params) { + Object[] args = new Object[params.length]; + for (int i = 0; i < args.length; i++) + args[i] = randomArg(params[i]); + return args; + } + static Object[] randomArgs(int nargs, Class param) { + Object[] args = new Object[nargs]; + for (int i = 0; i < args.length; i++) + args[i] = randomArg(param); + return args; + } + + static T[] array(Class atype, E... a) { + return Arrays.copyOf(a, a.length, atype); + } + static T[] cat(T[] a, T... b) { + int alen = a.length, blen = b.length; + if (blen == 0) return a; + T[] c = Arrays.copyOf(a, alen + blen); + System.arraycopy(b, 0, c, alen, blen); + return c; + } + static Integer[] boxAll(int... vx) { + Integer[] res = new Integer[vx.length]; + for (int i = 0; i < res.length; i++) { + res[i] = vx[i]; + } + return res; + } + static Object getClasses(Object x) { + if (x == null) return x; + if (x instanceof String) return x; // keep the name + if (x instanceof List) { + // recursively report classes of the list elements + Object[] xa = ((List)x).toArray(); + for (int i = 0; i < xa.length; i++) + xa[i] = getClasses(xa[i]); + return Arrays.asList(xa); + } + return x.getClass().getSimpleName(); + } + + static MethodHandle changeArgTypes(MethodHandle target, Class argType) { + return changeArgTypes(target, 0, 999, argType); + } + static MethodHandle changeArgTypes(MethodHandle target, + int beg, int end, Class argType) { + MethodType targetType = target.type(); + end = Math.min(end, targetType.parameterCount()); + ArrayList> argTypes = new ArrayList>(targetType.parameterList()); + Collections.fill(argTypes.subList(beg, end), argType); + MethodType ttype2 = MethodType.methodType(targetType.returnType(), argTypes); + return MethodHandles.convertArguments(target, ttype2); + } + + // This lookup is good for all members in and under MethodHandlesTest. + static final Lookup PRIVATE = MethodHandles.lookup(); + // This lookup is good for package-private members but not private ones. + static final Lookup PACKAGE = PackageSibling.lookup(); + // This lookup is good only for public members. + static final Lookup PUBLIC = MethodHandles.publicLookup(); + + // Subject methods... + static class Example implements IntExample { + final String name; + public Example() { name = "Example#"+(nextArg++); } + protected Example(String name) { this.name = name; } + protected Example(int x) { this(); called("protected ", this, x); } + @Override public String toString() { return name; } + + public void v0() { called("v0", this); } + void pkg_v0() { called("pkg_v0", this); } + private void pri_v0() { called("pri_v0", this); } + public static void s0() { called("s0"); } + static void pkg_s0() { called("pkg_s0"); } + private static void pri_s0() { called("pri_s0"); } + + public Object v1(Object x) { return called("v1", this, x); } + public Object v2(Object x, Object y) { return called("v2", this, x, y); } + public Object v2(Object x, int y) { return called("v2", this, x, y); } + public Object v2(int x, Object y) { return called("v2", this, x, y); } + public Object v2(int x, int y) { return called("v2", this, x, y); } + public static Object s1(Object x) { return called("s1", x); } + public static Object s2(int x) { return called("s2", x); } + public static Object s3(long x) { return called("s3", x); } + public static Object s4(int x, int y) { return called("s4", x, y); } + public static Object s5(long x, int y) { return called("s5", x, y); } + public static Object s6(int x, long y) { return called("s6", x, y); } + public static Object s7(float x, double y) { return called("s7", x, y); } + } + public static class PubExample extends Example { + } + static class SubExample extends Example { + @Override public void v0() { called("Sub/v0", this); } + @Override void pkg_v0() { called("Sub/pkg_v0", this); } + private SubExample(int x) { called("", this, x); } + public SubExample() { super("SubExample#"+(nextArg++)); } + } + public static interface IntExample { + public void v0(); + static class Impl implements IntExample { + public void v0() { called("Int/v0", this); } + final String name; + public Impl() { name = "Example#"+(nextArg++); } + } + } + + static final Object[][][] ACCESS_CASES = { + { { false, PUBLIC }, { false, PACKAGE }, { false, PRIVATE } }, + { { false, PUBLIC }, { false, PACKAGE }, { true, PRIVATE } }, + { { false, PUBLIC }, { true, PACKAGE }, { true, PRIVATE } }, + { { true, PUBLIC }, { true, PACKAGE }, { true, PRIVATE } }, + }; + + static Object[][] accessCases(Class defc, String name) { + if (name.contains("pri_")) { + return ACCESS_CASES[1]; // PRIVATE only + } else if (name.contains("pkg_")) { + return ACCESS_CASES[2]; // not PUBLIC + } else { + assertTrue(name.indexOf('_') < 0); + boolean pubc = Modifier.isPublic(defc.getModifiers()); + if (pubc) + return ACCESS_CASES[3]; // all access levels + return ACCESS_CASES[2]; // PACKAGE but not PUBLIC + } + } + + @Test + public void testFindStatic() throws Throwable { + if (CAN_SKIP_WORKING) return; + startTest("findStatic"); + testFindStatic(PubExample.class, void.class, "s0"); + testFindStatic(Example.class, void.class, "s0"); + testFindStatic(Example.class, void.class, "pkg_s0"); + testFindStatic(Example.class, void.class, "pri_s0"); + + testFindStatic(Example.class, Object.class, "s1", Object.class); + testFindStatic(Example.class, Object.class, "s2", int.class); + testFindStatic(Example.class, Object.class, "s3", long.class); + testFindStatic(Example.class, Object.class, "s4", int.class, int.class); + testFindStatic(Example.class, Object.class, "s5", long.class, int.class); + testFindStatic(Example.class, Object.class, "s6", int.class, long.class); + testFindStatic(Example.class, Object.class, "s7", float.class, double.class); + + testFindStatic(false, PRIVATE, Example.class, void.class, "bogus"); + } + + void testFindStatic(Class defc, Class ret, String name, Class... params) throws Throwable { + for (Object[] ac : accessCases(defc, name)) { + testFindStatic((Boolean)ac[0], (Lookup)ac[1], defc, ret, name, params); + } + } + void testFindStatic(Lookup lookup, Class defc, Class ret, String name, Class... params) throws Throwable { + testFindStatic(true, lookup, defc, ret, name, params); + } + void testFindStatic(boolean positive, Lookup lookup, Class defc, Class ret, String name, Class... params) throws Throwable { + countTest(positive); + MethodType type = MethodType.methodType(ret, params); + MethodHandle target = null; + RuntimeException noAccess = null; + try { + target = lookup.findStatic(defc, name, type); + } catch (NoAccessException ex) { + noAccess = ex; + } + if (verbosity >= 2) + System.out.println("findStatic "+lookup+": "+defc+"."+name+"/"+type+" => "+target + +(noAccess == null ? "" : " !! "+noAccess)); + if (positive && noAccess != null) throw noAccess; + assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null); + if (!positive) return; // negative test failed as expected + assertEquals(type, target.type()); + assertTrue(target.toString().contains(name)); // rough check + if (!DO_MORE_CALLS && lookup != PRIVATE) return; + Object[] args = randomArgs(params); + printCalled(target, name, args); + target.invokeVarargs(args); + assertCalled(name, args); + System.out.print(':'); + } + + @Test + public void testFindVirtual() throws Throwable { + if (CAN_SKIP_WORKING) return; + startTest("findVirtual"); + testFindVirtual(Example.class, void.class, "v0"); + testFindVirtual(Example.class, void.class, "pkg_v0"); + testFindVirtual(Example.class, void.class, "pri_v0"); + testFindVirtual(Example.class, Object.class, "v1", Object.class); + testFindVirtual(Example.class, Object.class, "v2", Object.class, Object.class); + testFindVirtual(Example.class, Object.class, "v2", Object.class, int.class); + testFindVirtual(Example.class, Object.class, "v2", int.class, Object.class); + testFindVirtual(Example.class, Object.class, "v2", int.class, int.class); + testFindVirtual(false, PRIVATE, Example.class, Example.class, void.class, "bogus"); + // test dispatch + testFindVirtual(SubExample.class, SubExample.class, void.class, "Sub/v0"); + testFindVirtual(SubExample.class, Example.class, void.class, "Sub/v0"); + testFindVirtual(SubExample.class, IntExample.class, void.class, "Sub/v0"); + testFindVirtual(SubExample.class, SubExample.class, void.class, "Sub/pkg_v0"); + testFindVirtual(SubExample.class, Example.class, void.class, "Sub/pkg_v0"); + testFindVirtual(Example.class, IntExample.class, void.class, "v0"); + testFindVirtual(IntExample.Impl.class, IntExample.class, void.class, "Int/v0"); + } + + void testFindVirtual(Class defc, Class ret, String name, Class... params) throws Throwable { + Class rcvc = defc; + testFindVirtual(rcvc, defc, ret, name, params); + } + void testFindVirtual(Class rcvc, Class defc, Class ret, String name, Class... params) throws Throwable { + for (Object[] ac : accessCases(defc, name)) { + testFindVirtual((Boolean)ac[0], (Lookup)ac[1], rcvc, defc, ret, name, params); + } + } + void testFindVirtual(Lookup lookup, Class rcvc, Class defc, Class ret, String name, Class... params) throws Throwable { + testFindVirtual(true, lookup, rcvc, defc, ret, name, params); + } + void testFindVirtual(boolean positive, Lookup lookup, Class rcvc, Class defc, Class ret, String name, Class... params) throws Throwable { + countTest(positive); + String methodName = name.substring(1 + name.indexOf('/')); // foo/bar => foo + MethodType type = MethodType.methodType(ret, params); + MethodHandle target = null; + RuntimeException noAccess = null; + try { + target = lookup.findVirtual(defc, methodName, type); + } catch (NoAccessException ex) { + noAccess = ex; + } + if (verbosity >= 2) + System.out.println("findVirtual "+lookup+": "+defc+"."+name+"/"+type+" => "+target + +(noAccess == null ? "" : " !! "+noAccess)); + if (positive && noAccess != null) throw noAccess; + assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null); + if (!positive) return; // negative test failed as expected + Class[] paramsWithSelf = cat(array(Class[].class, (Class)defc), params); + MethodType typeWithSelf = MethodType.methodType(ret, paramsWithSelf); + MethodType ttype = target.type(); + ttype = ttype.changeParameterType(0, defc); // FIXME: test this + assertEquals(typeWithSelf, ttype); + assertTrue(target.toString().contains(methodName)); // rough check + if (!DO_MORE_CALLS && lookup != PRIVATE) return; + Object[] argsWithSelf = randomArgs(paramsWithSelf); + if (rcvc != defc) argsWithSelf[0] = randomArg(rcvc); + printCalled(target, name, argsWithSelf); + target.invokeVarargs(argsWithSelf); + assertCalled(name, argsWithSelf); + System.out.print(':'); + } + + @Test + public void testFindSpecial() throws Throwable { + if (CAN_SKIP_WORKING) return; + startTest("findSpecial"); + testFindSpecial(Example.class, void.class, "v0"); + testFindSpecial(Example.class, void.class, "pkg_v0"); + testFindSpecial(false, PRIVATE, Example.class, void.class, "", int.class); + testFindSpecial(false, PRIVATE, Example.class, void.class, "bogus"); + } + + void testFindSpecial(Class defc, Class ret, String name, Class... params) throws Throwable { + testFindSpecial(true, PRIVATE, defc, ret, name, params); + testFindSpecial(false, PACKAGE, defc, ret, name, params); + testFindSpecial(false, PUBLIC, defc, ret, name, params); + } + void testFindSpecial(boolean positive, Lookup lookup, Class defc, Class ret, String name, Class... params) throws Throwable { + countTest(positive); + MethodType type = MethodType.methodType(ret, params); + MethodHandle target = null; + RuntimeException noAccess = null; + try { + target = lookup.findSpecial(defc, name, type, defc); + } catch (NoAccessException ex) { + noAccess = ex; + } + if (verbosity >= 2) + System.out.println("findSpecial "+defc+"."+name+"/"+type+" => "+target + +(noAccess == null ? "" : " !! "+noAccess)); + if (positive && noAccess != null) throw noAccess; + assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null); + if (!positive) return; // negative test failed as expected + Class[] paramsWithSelf = cat(array(Class[].class, (Class)defc), params); + MethodType typeWithSelf = MethodType.methodType(ret, paramsWithSelf); + MethodType ttype = target.type(); + ttype = ttype.changeParameterType(0, defc); // FIXME: test this + assertEquals(typeWithSelf, ttype); + assertTrue(target.toString().contains(name)); // rough check + if (!DO_MORE_CALLS && lookup != PRIVATE) return; + Object[] args = randomArgs(paramsWithSelf); + printCalled(target, name, args); + target.invokeVarargs(args); + assertCalled(name, args); + System.out.print(':'); + } + + @Test + public void testBind() throws Throwable { + if (CAN_SKIP_WORKING) return; + startTest("bind"); + testBind(Example.class, void.class, "v0"); + testBind(Example.class, void.class, "pkg_v0"); + testBind(Example.class, void.class, "pri_v0"); + testBind(Example.class, Object.class, "v1", Object.class); + testBind(Example.class, Object.class, "v2", Object.class, Object.class); + testBind(Example.class, Object.class, "v2", Object.class, int.class); + testBind(Example.class, Object.class, "v2", int.class, Object.class); + testBind(Example.class, Object.class, "v2", int.class, int.class); + testBind(false, PRIVATE, Example.class, void.class, "bogus"); + testBind(SubExample.class, void.class, "Sub/v0"); + testBind(SubExample.class, void.class, "Sub/pkg_v0"); + testBind(IntExample.Impl.class, void.class, "Int/v0"); + } + + void testBind(Class defc, Class ret, String name, Class... params) throws Throwable { + for (Object[] ac : accessCases(defc, name)) { + testBind((Boolean)ac[0], (Lookup)ac[1], defc, ret, name, params); + } + } + + void testBind(boolean positive, Lookup lookup, Class defc, Class ret, String name, Class... params) throws Throwable { + countTest(positive); + String methodName = name.substring(1 + name.indexOf('/')); // foo/bar => foo + MethodType type = MethodType.methodType(ret, params); + Object receiver = randomArg(defc); + MethodHandle target = null; + RuntimeException noAccess = null; + try { + target = lookup.bind(receiver, methodName, type); + } catch (NoAccessException ex) { + noAccess = ex; + } + if (verbosity >= 2) + System.out.println("bind "+receiver+"."+name+"/"+type+" => "+target + +(noAccess == null ? "" : " !! "+noAccess)); + if (positive && noAccess != null) throw noAccess; + assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null); + if (!positive) return; // negative test failed as expected + assertEquals(type, target.type()); + Object[] args = randomArgs(params); + printCalled(target, name, args); + target.invokeVarargs(args); + Object[] argsWithReceiver = cat(array(Object[].class, receiver), args); + assertCalled(name, argsWithReceiver); + System.out.print(':'); + } + + @Test + public void testUnreflect() throws Throwable { + if (CAN_SKIP_WORKING) return; + startTest("unreflect"); + testUnreflect(Example.class, true, void.class, "s0"); + testUnreflect(Example.class, true, void.class, "pkg_s0"); + testUnreflect(Example.class, true, void.class, "pri_s0"); + + testUnreflect(Example.class, true, Object.class, "s1", Object.class); + testUnreflect(Example.class, true, Object.class, "s2", int.class); + //testUnreflect(Example.class, true, Object.class, "s3", long.class); + //testUnreflect(Example.class, true, Object.class, "s4", int.class, int.class); + //testUnreflect(Example.class, true, Object.class, "s5", long.class, int.class); + //testUnreflect(Example.class, true, Object.class, "s6", int.class, long.class); + + testUnreflect(Example.class, false, void.class, "v0"); + testUnreflect(Example.class, false, void.class, "pkg_v0"); + testUnreflect(Example.class, false, void.class, "pri_v0"); + testUnreflect(Example.class, false, Object.class, "v1", Object.class); + testUnreflect(Example.class, false, Object.class, "v2", Object.class, Object.class); + testUnreflect(Example.class, false, Object.class, "v2", Object.class, int.class); + testUnreflect(Example.class, false, Object.class, "v2", int.class, Object.class); + testUnreflect(Example.class, false, Object.class, "v2", int.class, int.class); + } + + void testUnreflect(Class defc, boolean isStatic, Class ret, String name, Class... params) throws Throwable { + for (Object[] ac : accessCases(defc, name)) { + testUnreflect((Boolean)ac[0], (Lookup)ac[1], defc, isStatic, ret, name, params); + } + } + void testUnreflect(boolean positive, Lookup lookup, Class defc, boolean isStatic, Class ret, String name, Class... params) throws Throwable { + countTest(positive); + MethodType type = MethodType.methodType(ret, params); + Method rmethod = null; + MethodHandle target = null; + RuntimeException noAccess = null; + try { + rmethod = defc.getDeclaredMethod(name, params); + } catch (NoSuchMethodException ex) { + throw new NoAccessException(ex); + } + assertEquals(isStatic, Modifier.isStatic(rmethod.getModifiers())); + try { + target = lookup.unreflect(rmethod); + } catch (NoAccessException ex) { + noAccess = ex; + } + if (verbosity >= 2) + System.out.println("unreflect "+defc+"."+name+"/"+type+" => "+target + +(noAccess == null ? "" : " !! "+noAccess)); + if (positive && noAccess != null) throw noAccess; + assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null); + if (!positive) return; // negative test failed as expected + Class[] paramsMaybeWithSelf = params; + if (!isStatic) { + paramsMaybeWithSelf = cat(array(Class[].class, (Class)defc), params); + } + MethodType typeMaybeWithSelf = MethodType.methodType(ret, paramsMaybeWithSelf); + MethodType ttype = target.type(); + if (!isStatic) + ttype = ttype.changeParameterType(0, defc); // FIXME: test this + assertEquals(typeMaybeWithSelf, ttype); + Object[] argsMaybeWithSelf = randomArgs(paramsMaybeWithSelf); + printCalled(target, name, argsMaybeWithSelf); + target.invokeVarargs(argsMaybeWithSelf); + assertCalled(name, argsMaybeWithSelf); + System.out.print(':'); + } + + @Test @Ignore("unimplemented") + public void testUnreflectSpecial() throws Throwable { + Lookup lookup = PRIVATE; // FIXME: test more lookups than this one + startTest("unreflectSpecial"); + Method m = null; + MethodHandle expResult = null; + MethodHandle result = lookup.unreflectSpecial(m, Example.class); + assertEquals(expResult, result); + fail("The test case is a prototype."); + } + + public static class HasFields { + boolean fZ = false; + byte fB = (byte)'B'; + short fS = (short)'S'; + char fC = 'C'; + int fI = 'I'; + long fJ = 'J'; + float fF = 'F'; + double fD = 'D'; + static boolean sZ = true; + static byte sB = 1+(byte)'B'; + static short sS = 1+(short)'S'; + static char sC = 1+'C'; + static int sI = 1+'I'; + static long sJ = 1+'J'; + static float sF = 1+'F'; + static double sD = 1+'D'; + + Object fL = 'L'; + String fR = "R"; + static Object sL = 'M'; + static String sR = "S"; + + static final Object[][] CASES; + static { + ArrayList cases = new ArrayList(); + Object types[][] = { + {'L',Object.class}, {'R',String.class}, + {'I',int.class}, {'J',long.class}, + {'F',float.class}, {'D',double.class}, + {'Z',boolean.class}, {'B',byte.class}, + {'S',short.class}, {'C',char.class}, + }; + HasFields fields = new HasFields(); + for (Object[] t : types) { + for (int kind = 0; kind <= 1; kind++) { + boolean isStatic = (kind != 0); + char btc = (Character)t[0]; + String name = (isStatic ? "s" : "f") + btc; + Class type = (Class) t[1]; + Object value; + Field field; + try { + field = HasFields.class.getDeclaredField(name); + } catch (Exception ex) { + throw new InternalError("no field HasFields."+name); + } + try { + value = field.get(fields); + } catch (Exception ex) { + throw new InternalError("cannot fetch field HasFields."+name); + } + if (type == float.class) { + float v = 'F'; + if (isStatic) v++; + assert(value.equals(v)); + } + assert(name.equals(field.getName())); + assert(type.equals(field.getType())); + assert(isStatic == (Modifier.isStatic(field.getModifiers()))); + cases.add(new Object[]{ field, value }); + } + } + CASES = cases.toArray(new Object[0][]); + } + } + + @Test + public void testUnreflectGetter() throws Throwable { + Lookup lookup = PRIVATE; // FIXME: test more lookups than this one + startTest("unreflectGetter"); + for (Object[] c : HasFields.CASES) { + Field f = (Field)c[0]; + Object value = c[1]; + Class type = f.getType(); + if (type.isPrimitive() && type != int.class) + continue; //FIXME + testUnreflectGetter(lookup, f, type, value); + } + } + public void testUnreflectGetter(MethodHandles.Lookup lookup, + Field f, Class type, Object value) throws Throwable { + countTest(true); + boolean isStatic = Modifier.isStatic(f.getModifiers()); + MethodType expType = MethodType.methodType(type, HasFields.class); + if (isStatic) expType = expType.dropParameterTypes(0, 1); + MethodHandle mh = lookup.unreflectGetter(f); + assertSame(mh.type(), expType); + assertEquals(mh.toString(), f.getName()); + HasFields fields = new HasFields(); + Object sawValue; + Class rtype = type; + if (type != int.class) rtype = Object.class; + mh = MethodHandles.convertArguments(mh, mh.type().generic().changeReturnType(rtype)); + Object expValue = value; + for (int i = 0; i <= 1; i++) { + if (isStatic) { + if (type == int.class) + sawValue = mh.invoke(); // do these exactly + else + sawValue = mh.invoke(); + } else { + if (type == int.class) + sawValue = mh.invoke((Object) fields); + else + sawValue = mh.invoke((Object) fields); + } + assertEquals(sawValue, expValue); + Object random = randomArg(type); + f.set(fields, random); + expValue = random; + } + f.set(fields, value); // put it back + } + + + @Test + public void testUnreflectSetter() throws Throwable { + Lookup lookup = PRIVATE; // FIXME: test more lookups than this one + startTest("unreflectSetter"); + for (Object[] c : HasFields.CASES) { + Field f = (Field)c[0]; + Object value = c[1]; + Class type = f.getType(); + if (type.isPrimitive() && type != int.class) + continue; //FIXME + testUnreflectSetter(lookup, f, type, value); + } + } + public void testUnreflectSetter(MethodHandles.Lookup lookup, + Field f, Class type, Object value) throws Throwable { + countTest(true); + boolean isStatic = Modifier.isStatic(f.getModifiers()); + MethodType expType = MethodType.methodType(void.class, HasFields.class, type); + if (isStatic) expType = expType.dropParameterTypes(0, 1); + MethodHandle mh = lookup.unreflectSetter(f); + assertSame(mh.type(), expType); + assertEquals(mh.toString(), f.getName()); + HasFields fields = new HasFields(); + Object sawValue; + Class vtype = type; + if (type != int.class) vtype = Object.class; + int last = mh.type().parameterCount() - 1; + mh = MethodHandles.convertArguments(mh, mh.type().generic().changeReturnType(void.class).changeParameterType(last, vtype)); + assertEquals(f.get(fields), value); // clean to start with + for (int i = 0; i <= 1; i++) { + Object putValue = randomArg(type); + if (isStatic) { + if (type == int.class) + mh.invoke((int)(Integer)putValue); // do these exactly + else + mh.invoke(putValue); + } else { + if (type == int.class) + mh.invoke((Object) fields, (int)(Integer)putValue); + else + mh.invoke((Object) fields, putValue); + } + assertEquals(f.get(fields), putValue); + } + f.set(fields, value); // put it back + } + + @Test + public void testArrayElementGetter() throws Throwable { + startTest("arrayElementGetter"); + testArrayElementGetterSetter(new Object[10], false); + testArrayElementGetterSetter(new String[10], false); + testArrayElementGetterSetter(new int[10], false); + // FIXME: Do the other primitive types. + //testArrayElementGetterSetter(new float[10], false); + } + + @Test + public void testArrayElementSetter() throws Throwable { + startTest("arrayElementSetter"); + testArrayElementGetterSetter(new Object[10], true); + testArrayElementGetterSetter(new String[10], true); + testArrayElementGetterSetter(new int[10], true); + // FIXME: Do the other primitive types. + //testArrayElementGetterSetter(new float[10], true); + } + + public void testArrayElementGetterSetter(Object array, boolean testSetter) throws Throwable { + countTest(true); + Class arrayType = array.getClass(); + Class elemType = arrayType.getComponentType(); + MethodType expType = !testSetter + ? MethodType.methodType(elemType, arrayType, int.class) + : MethodType.methodType(void.class, arrayType, int.class, elemType); + MethodHandle mh = !testSetter + ? MethodHandles.arrayElementGetter(arrayType) + : MethodHandles.arrayElementSetter(arrayType); + assertSame(mh.type(), expType); + //assertEquals(mh.toString(), f.getName()); + Object sawValue, expValue; + List model = array2list(array); + int length = Array.getLength(array); + for (int i = 0; i < length; i++) { + // update array element + Object random = randomArg(elemType); + model.set(i, random); + if (testSetter) { + if (elemType == int.class) + mh.invoke((int[]) array, i, (int)(Integer)random); + else + mh.invokeGeneric(array, i, random); + assertEquals(model, array2list(array)); + } else { + Array.set(array, i, random); + + } + // observe array element + sawValue = Array.get(array, i); + if (!testSetter) { + expValue = sawValue; + if (elemType == int.class) + sawValue = mh.invoke((int[]) array, i); + else + sawValue = mh.invokeGeneric(array, i); + assertEquals(sawValue, expValue); + assertEquals(model, array2list(array)); + } + } + } + + List array2list(Object array) { + int length = Array.getLength(array); + ArrayList model = new ArrayList(length); + for (int i = 0; i < length; i++) + model.add(Array.get(array, i)); + return model; + } + + static class Callee { + static Object id() { return called("id"); } + static Object id(Object x) { return called("id", x); } + static Object id(Object x, Object y) { return called("id", x, y); } + static Object id(Object x, Object y, Object z) { return called("id", x, y, z); } + static Object id(Object... vx) { return called("id", vx); } + static MethodHandle ofType(int n) { + return ofType(Object.class, n); + } + static MethodHandle ofType(Class rtype, int n) { + if (n == -1) + return ofType(MethodType.methodType(rtype, Object[].class)); + return ofType(MethodType.genericMethodType(n).changeReturnType(rtype)); + } + static MethodHandle ofType(Class rtype, Class... ptypes) { + return ofType(MethodType.methodType(rtype, ptypes)); + } + static MethodHandle ofType(MethodType type) { + Class rtype = type.returnType(); + String pfx = ""; + if (rtype != Object.class) + pfx = rtype.getSimpleName().substring(0, 1).toLowerCase(); + String name = pfx+"id"; + return PRIVATE.findStatic(Callee.class, name, type); + } + } + + @Test + public void testConvertArguments() throws Throwable { + if (CAN_SKIP_WORKING) return; + startTest("convertArguments"); + testConvert(Callee.ofType(1), null, "id", int.class); + testConvert(Callee.ofType(1), null, "id", String.class); + testConvert(Callee.ofType(1), null, "id", Integer.class); + testConvert(Callee.ofType(1), null, "id", short.class); + } + + void testConvert(MethodHandle id, Class rtype, String name, Class... params) throws Throwable { + testConvert(true, id, rtype, name, params); + } + + void testConvert(boolean positive, MethodHandle id, Class rtype, String name, Class... params) throws Throwable { + countTest(positive); + MethodType idType = id.type(); + if (rtype == null) rtype = idType.returnType(); + for (int i = 0; i < params.length; i++) { + if (params[i] == null) params[i] = idType.parameterType(i); + } + // simulate the pairwise conversion + MethodType newType = MethodType.methodType(rtype, params); + Object[] args = randomArgs(newType.parameterArray()); + Object[] convArgs = args.clone(); + for (int i = 0; i < args.length; i++) { + Class src = newType.parameterType(i); + Class dst = idType.parameterType(i); + if (src != dst) + convArgs[i] = castToWrapper(convArgs[i], dst); + } + Object convResult = id.invokeVarargs(convArgs); + { + Class dst = newType.returnType(); + Class src = idType.returnType(); + if (src != dst) + convResult = castToWrapper(convResult, dst); + } + MethodHandle target = null; + RuntimeException error = null; + try { + target = MethodHandles.convertArguments(id, newType); + } catch (RuntimeException ex) { + error = ex; + } + if (verbosity >= 2) + System.out.println("convert "+id+ " to "+newType+" => "+target + +(error == null ? "" : " !! "+error)); + if (positive && error != null) throw error; + assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null); + if (!positive) return; // negative test failed as expected + assertEquals(newType, target.type()); + printCalled(target, id.toString(), args); + Object result = target.invokeVarargs(args); + assertCalled(name, convArgs); + assertEquals(convResult, result); + System.out.print(':'); + } + + @Test + public void testPermuteArguments() throws Throwable { + if (CAN_SKIP_WORKING) return; + startTest("permuteArguments"); + testPermuteArguments(4, Integer.class, 2, String.class, 0); + //testPermuteArguments(6, Integer.class, 0, null, 30); + //testPermuteArguments(4, Integer.class, 1, int.class, 6); + } + public void testPermuteArguments(int max, Class type1, int t2c, Class type2, int dilution) throws Throwable { + if (verbosity >= 1) + System.out.println("permuteArguments "+max+"*"+type1.getName() + +(t2c==0?"":"/"+t2c+"*"+type2.getName()) + +(dilution > 0 ? " with dilution "+dilution : "")); + int t2pos = t2c == 0 ? 0 : 1; + for (int inargs = t2pos+1; inargs <= max; inargs++) { + Class[] types = new Class[inargs]; + Arrays.fill(types, type1); + if (t2c != 0) { + // Fill in a middle range with type2: + Arrays.fill(types, t2pos, Math.min(t2pos+t2c, inargs), type2); + } + Object[] args = randomArgs(types); + int numcases = 1; + for (int outargs = 0; outargs <= max; outargs++) { + if (outargs - inargs >= MAX_ARG_INCREASE) continue; + int[] reorder = new int[outargs]; + int casStep = dilution + 1; + // Avoid some common factors: + while ((casStep > 2 && casStep % 2 == 0 && inargs % 2 == 0) || + (casStep > 3 && casStep % 3 == 0 && inargs % 3 == 0)) + casStep++; + for (int cas = 0; cas < numcases; cas += casStep) { + for (int i = 0, c = cas; i < outargs; i++) { + reorder[i] = c % inargs; + c /= inargs; + } + testPermuteArguments(args, types, reorder); + } + numcases *= inargs; + if (dilution > 10 && outargs >= 4) { + // Do some special patterns, which we probably missed. + // Replication of a single argument or argument pair. + for (int i = 0; i < inargs; i++) { + Arrays.fill(reorder, i); + testPermuteArguments(args, types, reorder); + for (int d = 1; d <= 2; d++) { + if (i + d >= inargs) continue; + for (int j = 1; j < outargs; j += 2) + reorder[j] += 1; + testPermuteArguments(args, types, reorder); + testPermuteArguments(args, types, reverse(reorder)); + } + } + // Repetition of a sequence of 3 or more arguments. + for (int i = 1; i < inargs; i++) { + for (int len = 3; len <= inargs; len++) { + for (int j = 0; j < outargs; j++) + reorder[j] = (i + (j % len)) % inargs; + testPermuteArguments(args, types, reorder); + testPermuteArguments(args, types, reverse(reorder)); + } + } + } + } + } + } + + static int[] reverse(int[] reorder) { + reorder = reorder.clone(); + for (int i = 0, imax = reorder.length / 2; i < imax; i++) { + int j = reorder.length - 1 - i; + int tem = reorder[i]; + reorder[i] = reorder[j]; + reorder[j] = tem; + } + return reorder; + } + + void testPermuteArguments(Object[] args, Class[] types, int[] reorder) throws Throwable { + countTest(); + if (args == null && types == null) { + int max = 0; + for (int j : reorder) { + if (max < j) max = j; + } + args = randomArgs(max+1, Integer.class); + } + if (args == null) { + args = randomArgs(types); + } + if (types == null) { + types = new Class[args.length]; + for (int i = 0; i < args.length; i++) + types[i] = args[i].getClass(); + } + int inargs = args.length, outargs = reorder.length; + assert(inargs == types.length); + if (verbosity >= 2) + System.out.println("permuteArguments "+Arrays.toString(reorder)); + Object[] permArgs = new Object[outargs]; + Class[] permTypes = new Class[outargs]; + for (int i = 0; i < outargs; i++) { + permArgs[i] = args[reorder[i]]; + permTypes[i] = types[reorder[i]]; + } + if (verbosity >= 3) { + System.out.println("in args: "+Arrays.asList(args)); + System.out.println("out args: "+Arrays.asList(permArgs)); + System.out.println("in types: "+Arrays.asList(types)); + System.out.println("out types: "+Arrays.asList(permTypes)); + } + MethodType inType = MethodType.methodType(Object.class, types); + MethodType outType = MethodType.methodType(Object.class, permTypes); + MethodHandle target = MethodHandles.convertArguments(ValueConversions.varargsList(outargs), outType); + MethodHandle newTarget = MethodHandles.permuteArguments(target, inType, reorder); + Object result = newTarget.invokeVarargs(args); + Object expected = Arrays.asList(permArgs); + assertEquals(expected, result); + } + + + @Test + public void testSpreadArguments() throws Throwable { + if (CAN_SKIP_WORKING) return; + startTest("spreadArguments"); + for (Class argType : new Class[]{Object.class, Integer.class, int.class}) { + if (verbosity >= 2) + System.out.println("spreadArguments "+argType); + for (int nargs = 0; nargs < 10; nargs++) { + if (argType == int.class && nargs >= 6) continue; // FIXME Fail_1 + for (int pos = 0; pos < nargs; pos++) { + if (argType == int.class && pos > 0) continue; // FIXME Fail_3 + testSpreadArguments(argType, pos, nargs); + } + } + } + } + public void testSpreadArguments(Class argType, int pos, int nargs) throws Throwable { + countTest(); + MethodHandle target = ValueConversions.varargsArray(nargs); + MethodHandle target2 = changeArgTypes(target, argType); + if (verbosity >= 2) + System.out.println("spread into "+target2+" ["+pos+".."+nargs+"]"); + Object[] args = randomArgs(target2.type().parameterArray()); + // make sure the target does what we think it does: + if (pos == 0 && nargs < 5) { + Object[] check = (Object[]) target.invokeVarargs(args); + assertArrayEquals(args, check); + switch (nargs) { + case 0: + check = target.invoke(); + assertArrayEquals(args, check); + break; + case 1: + check = target.invoke(args[0]); + assertArrayEquals(args, check); + break; + case 2: + check = target.invoke(args[0], args[1]); + assertArrayEquals(args, check); + break; + } + } + List> newParams = new ArrayList>(target2.type().parameterList()); + { // modify newParams in place + List> spreadParams = newParams.subList(pos, nargs); + spreadParams.clear(); spreadParams.add(Object[].class); + } + MethodType newType = MethodType.methodType(Object.class, newParams); + MethodHandle result = MethodHandles.spreadArguments(target2, newType); + Object[] returnValue; + if (pos == 0) { + returnValue = (Object[]) result.invoke(args); + } else { + Object[] args1 = Arrays.copyOfRange(args, 0, pos+1); + args1[pos] = Arrays.copyOfRange(args, pos, args.length); + returnValue = (Object[]) result.invokeVarargs(args1); + } + assertArrayEquals(args, returnValue); + } + + @Test + public void testCollectArguments() throws Throwable { + if (CAN_SKIP_WORKING) return; + startTest("collectArguments"); + for (Class argType : new Class[]{Object.class, Integer.class, int.class}) { + if (verbosity >= 2) + System.out.println("collectArguments "+argType); + for (int nargs = 0; nargs < 10; nargs++) { + for (int pos = 0; pos < nargs; pos++) { + if (argType == int.class) continue; // FIXME Fail_4 + testCollectArguments(argType, pos, nargs); + } + } + } + } + public void testCollectArguments(Class argType, int pos, int nargs) throws Throwable { + countTest(); + // fake up a MH with the same type as the desired adapter: + MethodHandle fake = ValueConversions.varargsArray(nargs); + fake = changeArgTypes(fake, argType); + MethodType newType = fake.type(); + Object[] args = randomArgs(newType.parameterArray()); + // here is what should happen: + Object[] collectedArgs = Arrays.copyOfRange(args, 0, pos+1); + collectedArgs[pos] = Arrays.copyOfRange(args, pos, args.length); + // here is the MH which will witness the collected argument tail: + MethodHandle target = ValueConversions.varargsArray(pos+1); + target = changeArgTypes(target, 0, pos, argType); + target = changeArgTypes(target, pos, pos+1, Object[].class); + if (verbosity >= 2) + System.out.println("collect from "+Arrays.asList(args)+" ["+pos+".."+nargs+"]"); + MethodHandle result = MethodHandles.collectArguments(target, newType); + Object[] returnValue = (Object[]) result.invokeVarargs(args); +// assertTrue(returnValue.length == pos+1 && returnValue[pos] instanceof Object[]); +// returnValue[pos] = Arrays.asList((Object[]) returnValue[pos]); +// collectedArgs[pos] = Arrays.asList((Object[]) collectedArgs[pos]); + assertArrayEquals(collectedArgs, returnValue); + } + + @Test + public void testInsertArguments() throws Throwable { + if (CAN_SKIP_WORKING) return; + startTest("insertArguments"); + for (int nargs = 0; nargs <= 4; nargs++) { + for (int ins = 0; ins <= 4; ins++) { + if (ins > MAX_ARG_INCREASE) continue; // FIXME Fail_6 + for (int pos = 0; pos <= nargs; pos++) { + testInsertArguments(nargs, pos, ins); + } + } + } + } + + void testInsertArguments(int nargs, int pos, int ins) throws Throwable { + countTest(); + MethodHandle target = ValueConversions.varargsArray(nargs + ins); + Object[] args = randomArgs(target.type().parameterArray()); + List resList = Arrays.asList(args); + List argsToPass = new ArrayList(resList); + List argsToInsert = argsToPass.subList(pos, pos + ins); + if (verbosity >= 2) + System.out.println("insert: "+argsToInsert+" into "+target); + MethodHandle target2 = MethodHandles.insertArguments(target, pos, + (Object[]) argsToInsert.toArray()); + argsToInsert.clear(); // remove from argsToInsert + Object res2 = target2.invokeVarargs(argsToPass); + Object res2List = Arrays.asList((Object[])res2); + if (verbosity >= 2) + System.out.println("result: "+res2List); + //if (!resList.equals(res2List)) + // System.out.println("*** fail at n/p/i = "+nargs+"/"+pos+"/"+ins+": "+resList+" => "+res2List); + assertEquals(resList, res2List); + } + + @Test + public void testFilterArguments() throws Throwable { + if (CAN_SKIP_WORKING) return; + startTest("filterArguments"); + for (int nargs = 1; nargs <= 6; nargs++) { + for (int pos = 0; pos < nargs; pos++) { + testFilterArguments(nargs, pos); + } + } + } + + void testFilterArguments(int nargs, int pos) throws Throwable { + countTest(); + MethodHandle target = ValueConversions.varargsList(nargs); + MethodHandle filter = ValueConversions.varargsList(1); + filter = MethodHandles.convertArguments(filter, filter.type().generic()); + Object[] argsToPass = randomArgs(nargs, Object.class); + if (verbosity >= 2) + System.out.println("filter "+target+" at "+pos+" with "+filter); + MethodHandle[] filters = new MethodHandle[pos*2+1]; + filters[pos] = filter; + MethodHandle target2 = MethodHandles.filterArguments(target, filters); + // Simulate expected effect of filter on arglist: + Object[] filteredArgs = argsToPass.clone(); + filteredArgs[pos] = filter.invoke(filteredArgs[pos]); + List expected = Arrays.asList(filteredArgs); + Object result = target2.invokeVarargs(argsToPass); + if (verbosity >= 2) + System.out.println("result: "+result); + if (!expected.equals(result)) + System.out.println("*** fail at n/p = "+nargs+"/"+pos+": "+argsToPass+" => "+result); + assertEquals(expected, result); + } + + @Test + public void testFoldArguments() throws Throwable { + if (CAN_SKIP_WORKING) return; + startTest("foldArguments"); + for (int nargs = 0; nargs <= 4; nargs++) { + for (int fold = 0; fold <= nargs; fold++) { + for (int pos = 0; pos <= nargs; pos++) { + testFoldArguments(nargs, pos, fold); + } + } + } + } + + void testFoldArguments(int nargs, int pos, int fold) throws Throwable { + if (pos != 0) return; // can fold only at pos=0 for now + countTest(); + MethodHandle target = ValueConversions.varargsList(1 + nargs); + MethodHandle combine = ValueConversions.varargsList(fold); + List argsToPass = Arrays.asList(randomArgs(nargs, Object.class)); + if (verbosity >= 2) + System.out.println("fold "+target+" with "+combine); + MethodHandle target2 = MethodHandles.foldArguments(target, combine); + // Simulate expected effect of combiner on arglist: + List expected = new ArrayList(argsToPass); + List argsToFold = expected.subList(pos, pos + fold); + if (verbosity >= 2) + System.out.println("fold: "+argsToFold+" into "+target2); + Object foldedArgs = combine.invokeVarargs(argsToFold); + argsToFold.add(0, foldedArgs); + Object result = target2.invokeVarargs(argsToPass); + if (verbosity >= 2) + System.out.println("result: "+result); + if (!expected.equals(result)) + System.out.println("*** fail at n/p/f = "+nargs+"/"+pos+"/"+fold+": "+argsToPass+" => "+result); + assertEquals(expected, result); + } + + @Test + public void testDropArguments() throws Throwable { + if (CAN_SKIP_WORKING) return; + startTest("dropArguments"); + for (int nargs = 0; nargs <= 4; nargs++) { + for (int drop = 1; drop <= 4; drop++) { + for (int pos = 0; pos <= nargs; pos++) { + testDropArguments(nargs, pos, drop); + } + } + } + } + + void testDropArguments(int nargs, int pos, int drop) throws Throwable { + countTest(); + MethodHandle target = ValueConversions.varargsArray(nargs); + Object[] args = randomArgs(target.type().parameterArray()); + MethodHandle target2 = MethodHandles.dropArguments(target, pos, + Collections.nCopies(drop, Object.class).toArray(new Class[0])); + List resList = Arrays.asList(args); + List argsToDrop = new ArrayList(resList); + for (int i = drop; i > 0; i--) { + argsToDrop.add(pos, "blort#"+i); + } + Object res2 = target2.invokeVarargs(argsToDrop); + Object res2List = Arrays.asList((Object[])res2); + //if (!resList.equals(res2List)) + // System.out.println("*** fail at n/p/d = "+nargs+"/"+pos+"/"+drop+": "+argsToDrop+" => "+res2List); + assertEquals(resList, res2List); + } + + @Test + public void testInvokers() throws Throwable { + if (CAN_SKIP_WORKING) return; + startTest("exactInvoker, genericInvoker, varargsInvoker, dynamicInvoker"); + // exactInvoker, genericInvoker, varargsInvoker[0..N], dynamicInvoker + Set done = new HashSet(); + for (int i = 0; i <= 6; i++) { + MethodType gtype = MethodType.genericMethodType(i); + for (Class argType : new Class[]{Object.class, Integer.class, int.class}) { + for (int j = -1; j < i; j++) { + MethodType type = gtype; + if (j < 0) + type = type.changeReturnType(argType); + else if (argType == void.class) + continue; + else + type = type.changeParameterType(j, argType); + if (argType.isPrimitive() && j != i-1) continue; // FIXME Fail_5 + if (done.add(type)) + testInvokers(type); + MethodType vtype = type.changeReturnType(void.class); + if (done.add(vtype)) + testInvokers(vtype); + } + } + } + } + + public void testInvokers(MethodType type) throws Throwable { + if (verbosity >= 2) + System.out.println("test invokers for "+type); + int nargs = type.parameterCount(); + boolean testRetCode = type.returnType() != void.class; + MethodHandle target = PRIVATE.findStatic(MethodHandlesTest.class, "invokee", + MethodType.genericMethodType(0, true)); + target = MethodHandles.collectArguments(target, type); + Object[] args = randomArgs(type.parameterArray()); + List targetPlusArgs = new ArrayList(Arrays.asList(args)); + targetPlusArgs.add(0, target); + int code = (Integer) invokee(args); + Object log = logEntry("invokee", args); + assertEquals(log.hashCode(), code); + assertCalled("invokee", args); + MethodHandle inv; + Object result; + // exact invoker + countTest(); + calledLog.clear(); + inv = MethodHandles.exactInvoker(type); + result = inv.invokeVarargs(targetPlusArgs); + if (testRetCode) assertEquals(code, result); + assertCalled("invokee", args); + // generic invoker + countTest(); + inv = MethodHandles.genericInvoker(type); + if (nargs <= 3) { + calledLog.clear(); + switch (nargs) { + case 0: + result = inv.invoke(target); + break; + case 1: + result = inv.invoke(target, args[0]); + break; + case 2: + result = inv.invoke(target, args[0], args[1]); + break; + case 3: + result = inv.invoke(target, args[0], args[1], args[2]); + break; + } + if (testRetCode) assertEquals(code, result); + assertCalled("invokee", args); + } + calledLog.clear(); + result = inv.invokeVarargs(targetPlusArgs); + if (testRetCode) assertEquals(code, result); + assertCalled("invokee", args); + // varargs invoker #0 + calledLog.clear(); + inv = MethodHandles.varargsInvoker(type, 0); + result = inv.invoke(target, args); + if (testRetCode) assertEquals(code, result); + assertCalled("invokee", args); + if (nargs >= 1) { + // varargs invoker #1 + calledLog.clear(); + inv = MethodHandles.varargsInvoker(type, 1); + result = inv.invoke(target, args[0], Arrays.copyOfRange(args, 1, nargs)); + if (testRetCode) assertEquals(code, result); + assertCalled("invokee", args); + } + if (nargs >= 2) { + // varargs invoker #2 + calledLog.clear(); + inv = MethodHandles.varargsInvoker(type, 2); + result = inv.invoke(target, args[0], args[1], Arrays.copyOfRange(args, 2, nargs)); + if (testRetCode) assertEquals(code, result); + assertCalled("invokee", args); + } + if (nargs >= 3) { + // varargs invoker #3 + calledLog.clear(); + inv = MethodHandles.varargsInvoker(type, 3); + result = inv.invoke(target, args[0], args[1], args[2], Arrays.copyOfRange(args, 3, nargs)); + if (testRetCode) assertEquals(code, result); + assertCalled("invokee", args); + } + for (int k = 0; k <= nargs; k++) { + // varargs invoker #0..N + countTest(); + calledLog.clear(); + inv = MethodHandles.varargsInvoker(type, k); + List targetPlusVarArgs = new ArrayList(targetPlusArgs); + List tailList = targetPlusVarArgs.subList(1+k, 1+nargs); + Object[] tail = tailList.toArray(); + tailList.clear(); tailList.add(tail); + result = inv.invokeVarargs(targetPlusVarArgs); + if (testRetCode) assertEquals(code, result); + assertCalled("invokee", args); + } + // dynamic invoker + countTest(); + CallSite site = new CallSite(MethodHandlesTest.class, "foo", type); + inv = MethodHandles.dynamicInvoker(site); + site.setTarget(target); + calledLog.clear(); + result = inv.invokeVarargs(args); + if (testRetCode) assertEquals(code, result); + assertCalled("invokee", args); + } + + static Object invokee(Object... args) { + return called("invokee", args).hashCode(); + } + + private static final String MISSING_ARG = "missingArg"; + static Object targetIfEquals() { + return called("targetIfEquals"); + } + static Object fallbackIfNotEquals() { + return called("fallbackIfNotEquals"); + } + static Object targetIfEquals(Object x) { + assertEquals(x, MISSING_ARG); + return called("targetIfEquals", x); + } + static Object fallbackIfNotEquals(Object x) { + assertFalse(x.toString(), x.equals(MISSING_ARG)); + return called("fallbackIfNotEquals", x); + } + static Object targetIfEquals(Object x, Object y) { + assertEquals(x, y); + return called("targetIfEquals", x, y); + } + static Object fallbackIfNotEquals(Object x, Object y) { + assertFalse(x.toString(), x.equals(y)); + return called("fallbackIfNotEquals", x, y); + } + static Object targetIfEquals(Object x, Object y, Object z) { + assertEquals(x, y); + return called("targetIfEquals", x, y, z); + } + static Object fallbackIfNotEquals(Object x, Object y, Object z) { + assertFalse(x.toString(), x.equals(y)); + return called("fallbackIfNotEquals", x, y, z); + } + + @Test + public void testGuardWithTest() throws Throwable { + if (CAN_SKIP_WORKING) return; + startTest("guardWithTest"); + for (int nargs = 0; nargs <= 3; nargs++) { + if (nargs != 2) continue; // FIXME: test more later + testGuardWithTest(nargs, Object.class); + testGuardWithTest(nargs, String.class); + } + } + void testGuardWithTest(int nargs, Class argClass) throws Throwable { + countTest(); + MethodHandle test = PRIVATE.findVirtual(Object.class, "equals", MethodType.methodType(boolean.class, Object.class)); + MethodHandle target = PRIVATE.findStatic(MethodHandlesTest.class, "targetIfEquals", MethodType.genericMethodType(nargs)); + MethodHandle fallback = PRIVATE.findStatic(MethodHandlesTest.class, "fallbackIfNotEquals", MethodType.genericMethodType(nargs)); + while (test.type().parameterCount() < nargs) + test = MethodHandles.dropArguments(test, test.type().parameterCount()-1, Object.class); + while (test.type().parameterCount() > nargs) + test = MethodHandles.insertArguments(test, 0, MISSING_ARG); + if (argClass != Object.class) { + test = changeArgTypes(test, argClass); + target = changeArgTypes(target, argClass); + fallback = changeArgTypes(fallback, argClass); + } + MethodHandle mh = MethodHandles.guardWithTest(test, target, fallback); + assertEquals(target.type(), mh.type()); + Object[][] argLists = { + { }, + { "foo" }, { MISSING_ARG }, + { "foo", "foo" }, { "foo", "bar" }, + { "foo", "foo", "baz" }, { "foo", "bar", "baz" } + }; + for (Object[] argList : argLists) { + if (argList.length != nargs) continue; + boolean equals; + switch (nargs) { + case 0: equals = true; break; + case 1: equals = MISSING_ARG.equals(argList[0]); break; + default: equals = argList[0].equals(argList[1]); break; + } + String willCall = (equals ? "targetIfEquals" : "fallbackIfNotEquals"); + if (verbosity >= 2) + System.out.println(logEntry(willCall, argList)); + Object result = mh.invokeVarargs(argList); + assertCalled(willCall, argList); + } + } + + @Test + public void testCatchException() throws Throwable { + if (CAN_SKIP_WORKING) return; + startTest("catchException"); + for (int nargs = 2; nargs <= 6; nargs++) { + for (int ti = 0; ti <= 1; ti++) { + boolean throwIt = (ti != 0); + testCatchException(int.class, new ClassCastException("testing"), throwIt, nargs); + testCatchException(void.class, new java.io.IOException("testing"), throwIt, nargs); + testCatchException(String.class, new LinkageError("testing"), throwIt, nargs); + } + } + } + + private static + Object throwOrReturn(Object normal, T exception) throws T { + if (exception != null) throw exception; + return normal; + } + + void testCatchException(Class returnType, Throwable thrown, boolean throwIt, int nargs) throws Throwable { + countTest(); + if (verbosity >= 2) + System.out.println("catchException rt="+returnType+" throw="+throwIt+" nargs="+nargs); + Class exType = thrown.getClass(); + MethodHandle throwOrReturn + = PRIVATE.findStatic(MethodHandlesTest.class, "throwOrReturn", + MethodType.methodType(Object.class, Object.class, Throwable.class)); + MethodHandle thrower = throwOrReturn; + while (thrower.type().parameterCount() < nargs) + thrower = MethodHandles.dropArguments(thrower, thrower.type().parameterCount(), Object.class); + MethodHandle target = MethodHandles.catchException(thrower, + thrown.getClass(), ValueConversions.varargsList(1+nargs)); + assertEquals(thrower.type(), target.type()); + //System.out.println("catching with "+target+" : "+throwOrReturn); + Object[] args = randomArgs(nargs, Object.class); + args[1] = (throwIt ? thrown : null); + Object returned = target.invokeVarargs(args); + //System.out.println("return from "+target+" : "+returned); + if (!throwIt) { + assertSame(args[0], returned); + } else { + List catchArgs = new ArrayList(Arrays.asList(args)); + catchArgs.add(0, thrown); + assertEquals(catchArgs, returned); + } + } + + @Test + public void testThrowException() throws Throwable { + if (CAN_SKIP_WORKING) return; + startTest("throwException"); + testThrowException(int.class, new ClassCastException("testing")); + testThrowException(void.class, new java.io.IOException("testing")); + testThrowException(String.class, new LinkageError("testing")); + } + + void testThrowException(Class returnType, Throwable thrown) throws Throwable { + countTest(); + Class exType = thrown.getClass(); + MethodHandle target = MethodHandles.throwException(returnType, exType); + //System.out.println("throwing with "+target+" : "+thrown); + MethodType expectedType = MethodType.methodType(returnType, exType); + assertEquals(expectedType, target.type()); + Throwable caught = null; + try { + Object res = target.invokeGeneric(thrown); + fail("got "+res+" instead of throwing "+thrown); + } catch (Throwable ex) { + if (ex != thrown) { + if (ex instanceof Error) throw (Error)ex; + if (ex instanceof RuntimeException) throw (RuntimeException)ex; + } + caught = ex; + } + assertSame(thrown, caught); + } + + @Test + public void testCastFailure() throws Throwable { + if (CAN_SKIP_WORKING) return; + startTest("testCastFailure"); + testCastFailure("cast/argument", 11000); + testCastFailure("unbox/argument", 11000); + testCastFailure("cast/return", 11000); + testCastFailure("unbox/return", 11000); + } + + static class Surprise extends JavaMethodHandle { + Surprise() { super("value"); } + Object value(Object x) { + trace("value", x); + if (boo != null) return boo; + return x; + } + Object boo; + void boo(Object x) { boo = x; } + + static void trace(String x, Object y) { + if (verbosity > 8) System.out.println(x+"="+y); + } + static Object refIdentity(Object x) { trace("ref.x", x); return x; } + static Integer boxIdentity(Integer x) { trace("box.x", x); return x; } + static int intIdentity(int x) { trace("int.x", x); return x; } + static MethodHandle REF_IDENTITY = PRIVATE.findStatic( + Surprise.class, "refIdentity", + MethodType.methodType(Object.class, Object.class)); + static MethodHandle BOX_IDENTITY = PRIVATE.findStatic( + Surprise.class, "boxIdentity", + MethodType.methodType(Integer.class, Integer.class)); + static MethodHandle INT_IDENTITY = PRIVATE.findStatic( + Surprise.class, "intIdentity", + MethodType.methodType(int.class, int.class)); + } + + void testCastFailure(String mode, int okCount) throws Throwable { + countTest(false); + if (verbosity > 1) System.out.println("mode="+mode); + Surprise boo = new Surprise(); + MethodHandle identity = Surprise.REF_IDENTITY, surprise = boo; + if (mode.endsWith("/return")) { + if (mode.equals("unbox/return")) { + // fail on return to ((Integer)surprise).intValue + surprise = MethodHandles.convertArguments(surprise, MethodType.methodType(int.class, Object.class)); + identity = MethodHandles.convertArguments(identity, MethodType.methodType(int.class, Object.class)); + } else if (mode.equals("cast/return")) { + // fail on return to (Integer)surprise + surprise = MethodHandles.convertArguments(surprise, MethodType.methodType(Integer.class, Object.class)); + identity = MethodHandles.convertArguments(identity, MethodType.methodType(Integer.class, Object.class)); + } + } else if (mode.endsWith("/argument")) { + MethodHandle callee = null; + if (mode.equals("unbox/argument")) { + // fail on handing surprise to int argument + callee = Surprise.INT_IDENTITY; + } else if (mode.equals("cast/argument")) { + // fail on handing surprise to Integer argument + callee = Surprise.BOX_IDENTITY; + } + if (callee != null) { + callee = MethodHandles.convertArguments(callee, MethodType.genericMethodType(1)); + surprise = MethodHandles.filterArguments(callee, surprise); + identity = MethodHandles.filterArguments(callee, identity); + } + } + assertNotSame(mode, surprise, boo); + identity = MethodHandles.convertArguments(identity, MethodType.genericMethodType(1)); + surprise = MethodHandles.convertArguments(surprise, MethodType.genericMethodType(1)); + Object x = 42; + for (int i = 0; i < okCount; i++) { + Object y = identity.invoke(x); + assertEquals(x, y); + Object z = surprise.invoke(x); + assertEquals(x, z); + } + boo.boo("Boo!"); + Object y = identity.invoke(x); + assertEquals(x, y); + try { + Object z = surprise.invoke(x); + System.out.println("Failed to throw; got z="+z); + assertTrue(false); + } catch (Exception ex) { + if (verbosity > 1) + System.out.println("caught "+ex); + if (verbosity > 2) + ex.printStackTrace(); + assertTrue(ex instanceof ClassCastException + // FIXME: accept only one of the two for any given unit test + || ex instanceof WrongMethodTypeException + ); + } + } + +} +// Local abbreviated copy of sun.dyn.util.ValueConversions +class ValueConversions { + private static final Lookup IMPL_LOOKUP = MethodHandles.lookup(); + private static final Object[] NO_ARGS_ARRAY = {}; + private static Object[] makeArray(Object... args) { return args; } + private static Object[] array() { return NO_ARGS_ARRAY; } + private static Object[] array(Object a0) + { return makeArray(a0); } + private static Object[] array(Object a0, Object a1) + { return makeArray(a0, a1); } + private static Object[] array(Object a0, Object a1, Object a2) + { return makeArray(a0, a1, a2); } + private static Object[] array(Object a0, Object a1, Object a2, Object a3) + { return makeArray(a0, a1, a2, a3); } + private static Object[] array(Object a0, Object a1, Object a2, Object a3, + Object a4) + { return makeArray(a0, a1, a2, a3, a4); } + private static Object[] array(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) + { return makeArray(a0, a1, a2, a3, a4, a5); } + private static Object[] array(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) + { return makeArray(a0, a1, a2, a3, a4, a5, a6); } + private static Object[] array(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) + { return makeArray(a0, a1, a2, a3, a4, a5, a6, a7); } + private static Object[] array(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) + { return makeArray(a0, a1, a2, a3, a4, a5, a6, a7, a8); } + private static Object[] array(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) + { return makeArray(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } + static MethodHandle[] makeArrays() { + ArrayList arrays = new ArrayList(); + MethodHandles.Lookup lookup = IMPL_LOOKUP; + for (;;) { + int nargs = arrays.size(); + MethodType type = MethodType.genericMethodType(nargs).changeReturnType(Object[].class); + String name = "array"; + MethodHandle array = null; + try { + array = lookup.findStatic(ValueConversions.class, name, type); + } catch (NoAccessException ex) { + } + if (array == null) break; + arrays.add(array); + } + assert(arrays.size() == 11); // current number of methods + return arrays.toArray(new MethodHandle[0]); + } + static final MethodHandle[] ARRAYS = makeArrays(); + + /** Return a method handle that takes the indicated number of Object + * arguments and returns an Object array of them, as if for varargs. + */ + public static MethodHandle varargsArray(int nargs) { + if (nargs < ARRAYS.length) + return ARRAYS[nargs]; + // else need to spin bytecode or do something else fancy + throw new UnsupportedOperationException("NYI"); + } + + private static final List NO_ARGS_LIST = Arrays.asList(NO_ARGS_ARRAY); + private static List makeList(Object... args) { return Arrays.asList(args); } + private static List list() { return NO_ARGS_LIST; } + private static List list(Object a0) + { return makeList(a0); } + private static List list(Object a0, Object a1) + { return makeList(a0, a1); } + private static List list(Object a0, Object a1, Object a2) + { return makeList(a0, a1, a2); } + private static List list(Object a0, Object a1, Object a2, Object a3) + { return makeList(a0, a1, a2, a3); } + private static List list(Object a0, Object a1, Object a2, Object a3, + Object a4) + { return makeList(a0, a1, a2, a3, a4); } + private static List list(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5) + { return makeList(a0, a1, a2, a3, a4, a5); } + private static List list(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6) + { return makeList(a0, a1, a2, a3, a4, a5, a6); } + private static List list(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7) + { return makeList(a0, a1, a2, a3, a4, a5, a6, a7); } + private static List list(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8) + { return makeList(a0, a1, a2, a3, a4, a5, a6, a7, a8); } + private static List list(Object a0, Object a1, Object a2, Object a3, + Object a4, Object a5, Object a6, Object a7, + Object a8, Object a9) + { return makeList(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); } + static MethodHandle[] makeLists() { + ArrayList arrays = new ArrayList(); + MethodHandles.Lookup lookup = IMPL_LOOKUP; + for (;;) { + int nargs = arrays.size(); + MethodType type = MethodType.genericMethodType(nargs).changeReturnType(List.class); + String name = "list"; + MethodHandle array = null; + try { + array = lookup.findStatic(ValueConversions.class, name, type); + } catch (NoAccessException ex) { + } + if (array == null) break; + arrays.add(array); + } + assert(arrays.size() == 11); // current number of methods + return arrays.toArray(new MethodHandle[0]); + } + static final MethodHandle[] LISTS = makeLists(); + + /** Return a method handle that takes the indicated number of Object + * arguments and returns List. + */ + public static MethodHandle varargsList(int nargs) { + if (nargs < LISTS.length) + return LISTS[nargs]; + // else need to spin bytecode or do something else fancy + throw new UnsupportedOperationException("NYI"); + } +} +// This guy tests access from outside the same package member, but inside +// the package itself. +class PackageSibling { + static Lookup lookup() { + return MethodHandles.lookup(); + } +} diff --git a/jdk/test/java/io/File/Basic.java b/jdk/test/java/io/File/Basic.java index a57c6ccddef..cbb8259e5fe 100644 --- a/jdk/test/java/io/File/Basic.java +++ b/jdk/test/java/io/File/Basic.java @@ -75,7 +75,7 @@ public class Basic { if (!f.canRead()) fail(f, "is not readable"); if (f.canWrite() != writeable) fail(f, writeable ? "is not writeable" : "is writeable"); - int rwLen = (File.separatorChar == '/' ? 6 : 7); + int rwLen = 6; if (f.length() != length) fail(f, "has wrong length"); } @@ -89,7 +89,7 @@ public class Basic { if (nonExistantFile.exists()) fail(nonExistantFile, "exists"); show(rwFile); - testFile(rwFile, true, File.separatorChar == '/' ? 6 : 7); + testFile(rwFile, true, 6); rwFile.delete(); if (rwFile.exists()) fail(rwFile, "could not delete"); diff --git a/jdk/test/java/io/File/basic.sh b/jdk/test/java/io/File/basic.sh index fa11c66536b..cc87ac32e84 100644 --- a/jdk/test/java/io/File/basic.sh +++ b/jdk/test/java/io/File/basic.sh @@ -32,10 +32,10 @@ fi rm -rf x.Basic.* rm -f x.Basic.non -echo xyzzy > x.Basic.rw +printf "%s" "xyzzyN" > x.Basic.rw touch x.Basic.ro; chmod ugo-w x.Basic.ro mkdir x.Basic.dir -if $TESTJAVA/bin/java $* -classpath $TESTCLASSES Basic; then +if $TESTJAVA/bin/java $* -classpath "$TESTCLASSES" Basic; then [ -f x.Basic.rw ] && (echo "x.Basic.rw not deleted"; exit 1) ([ -d x.Basic.dir ] || [ \! -d x.Basic.dir2 ]) \ && (echo "x.Basic.dir not renamed"; exit 1) diff --git a/jdk/test/java/io/Serializable/evolution/RenamePackage/run.sh b/jdk/test/java/io/Serializable/evolution/RenamePackage/run.sh index 2f194c06123..df76b738308 100644 --- a/jdk/test/java/io/Serializable/evolution/RenamePackage/run.sh +++ b/jdk/test/java/io/Serializable/evolution/RenamePackage/run.sh @@ -43,7 +43,7 @@ OS=`uname -s` case "$OS" in SunOS | Linux ) PS=":" ;; -Windows* ) +Windows* | CYGWIN* ) PS=";" ;; * ) echo "Unrecognized system!" @@ -85,14 +85,14 @@ CLASSPATH=${TESTCLASSES}/share; export CLASSPATH; ${JAVAC} -d ${TESTCLASSES}/nclasses ${TESTSRC}/install/SerialDriver.java # Run Case 1. Map test.SerialDriver within stream to install.SerialDriver. -CLASSPATH=${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share; export CLASSPATH; +CLASSPATH="${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share"; export CLASSPATH; ${JAVA} test.SerialDriver -s -CLASSPATH=${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share; export CLASSPATH; +CLASSPATH="${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share"; export CLASSPATH; ${JAVA} install.SerialDriver -d rm stream.ser # Run Case 2. Map install.SerialDriver within stream to test.SerialDriver. -CLASSPATH=${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share; export CLASSPATH; +CLASSPATH="${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share"; export CLASSPATH; ${JAVA} install.SerialDriver -s -CLASSPATH=${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share; export CLASSPATH; +CLASSPATH="${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share"; export CLASSPATH; ${JAVA} test.SerialDriver -d diff --git a/jdk/test/java/io/Serializable/serialver/classpath/run.sh b/jdk/test/java/io/Serializable/serialver/classpath/run.sh index aa3251e4798..6fb127f89fa 100644 --- a/jdk/test/java/io/Serializable/serialver/classpath/run.sh +++ b/jdk/test/java/io/Serializable/serialver/classpath/run.sh @@ -49,7 +49,7 @@ OS=`uname -s` case "$OS" in SunOS | Linux ) PS=":" ;; - Windows* ) + Windows* | CYGWIN* ) PS=";" ;; * ) echo "Unrecognized system!" diff --git a/jdk/test/java/io/Serializable/serialver/nested/run.sh b/jdk/test/java/io/Serializable/serialver/nested/run.sh index 57b0ca0a759..9b53f756f1e 100644 --- a/jdk/test/java/io/Serializable/serialver/nested/run.sh +++ b/jdk/test/java/io/Serializable/serialver/nested/run.sh @@ -49,7 +49,7 @@ OS=`uname -s` case "$OS" in SunOS | Linux ) PS=":" ;; - Windows* ) + Windows* | CYGWIN* ) PS=";" ;; * ) echo "Unrecognized system!" diff --git a/jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh b/jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh index 1f6a08ff342..e4aac0ddd60 100644 --- a/jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh +++ b/jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh @@ -55,7 +55,7 @@ case "$OS" in Linux ) FS="/" ;; - Windows* ) + Windows* | CYGWIN* ) FS="\\" ;; esac diff --git a/jdk/test/java/lang/Math/CeilAndFloorTests.java b/jdk/test/java/lang/Math/CeilAndFloorTests.java new file mode 100644 index 00000000000..12d899d8180 --- /dev/null +++ b/jdk/test/java/lang/Math/CeilAndFloorTests.java @@ -0,0 +1,201 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6908131 + * @summary Check for correct implementation of Math.ceil and Math.floor + */ + +import sun.misc.FpUtils; +import sun.misc.DoubleConsts; + +public class CeilAndFloorTests { + private static int testCeilCase(double input, double expected) { + int failures = 0; + failures += Tests.test("Math.ceil", input, Math.ceil(input), expected); + failures += Tests.test("StrictMath.ceil", input, StrictMath.ceil(input), expected); + return failures; + } + + private static int testFloorCase(double input, double expected) { + int failures = 0; + failures += Tests.test("Math.floor", input, Math.floor(input), expected); + failures += Tests.test("StrictMath.floor", input, StrictMath.floor(input), expected); + return failures; + } + + private static int nearIntegerTests() { + int failures = 0; + + double [] fixedPoints = { + -0.0, + 0.0, + -1.0, + 1.0, + -0x1.0p52, + 0x1.0p52, + -Double.MAX_VALUE, + Double.MAX_VALUE, + Double.NEGATIVE_INFINITY, + Double.POSITIVE_INFINITY, + Double.NaN, + }; + + for(double fixedPoint : fixedPoints) { + failures += testCeilCase(fixedPoint, fixedPoint); + failures += testFloorCase(fixedPoint, fixedPoint); + } + + for(int i = Double.MIN_EXPONENT; i <= Double.MAX_EXPONENT; i++) { + double powerOfTwo = Math.scalb(1.0, i); + double neighborDown = FpUtils.nextDown(powerOfTwo); + double neighborUp = Math.nextUp(powerOfTwo); + + if (i < 0) { + failures += testCeilCase( powerOfTwo, 1.0); + failures += testCeilCase(-powerOfTwo, -0.0); + + failures += testFloorCase( powerOfTwo, 0.0); + failures += testFloorCase(-powerOfTwo, -1.0); + + failures += testCeilCase( neighborDown, 1.0); + failures += testCeilCase(-neighborDown, -0.0); + + failures += testFloorCase( neighborUp, 0.0); + failures += testFloorCase(-neighborUp, -1.0); + } else { + failures += testCeilCase(powerOfTwo, powerOfTwo); + failures += testFloorCase(powerOfTwo, powerOfTwo); + + if (neighborDown==Math.rint(neighborDown)) { + failures += testCeilCase( neighborDown, neighborDown); + failures += testCeilCase(-neighborDown, -neighborDown); + + failures += testFloorCase( neighborDown, neighborDown); + failures += testFloorCase(-neighborDown,-neighborDown); + } else { + failures += testCeilCase( neighborDown, powerOfTwo); + failures += testFloorCase(-neighborDown, -powerOfTwo); + } + + if (neighborUp==Math.rint(neighborUp)) { + failures += testCeilCase(neighborUp, neighborUp); + failures += testCeilCase(-neighborUp, -neighborUp); + + failures += testFloorCase(neighborUp, neighborUp); + failures += testFloorCase(-neighborUp, -neighborUp); + } else { + failures += testFloorCase(neighborUp, powerOfTwo); + failures += testCeilCase(-neighborUp, -powerOfTwo); + } + } + } + + for(int i = -(0x10000); i <= 0x10000; i++) { + double d = (double) i; + double neighborDown = FpUtils.nextDown(d); + double neighborUp = Math.nextUp(d); + + failures += testCeilCase( d, d); + failures += testCeilCase(-d, -d); + + failures += testFloorCase( d, d); + failures += testFloorCase(-d, -d); + + if (Math.abs(d) > 1.0) { + failures += testCeilCase( neighborDown, d); + failures += testCeilCase(-neighborDown, -d+1); + + failures += testFloorCase( neighborUp, d); + failures += testFloorCase(-neighborUp, -d-1); + } + } + + return failures; + } + + public static int roundingTests() { + int failures = 0; + double [][] testCases = { + { Double.MIN_VALUE, 1.0}, + {-Double.MIN_VALUE, -0.0}, + { FpUtils.nextDown(DoubleConsts.MIN_NORMAL), 1.0}, + {-FpUtils.nextDown(DoubleConsts.MIN_NORMAL), -0.0}, + { DoubleConsts.MIN_NORMAL, 1.0}, + {-DoubleConsts.MIN_NORMAL, -0.0}, + + { 0.1, 1.0}, + {-0.1, -0.0}, + + { 0.5, 1.0}, + {-0.5, -0.0}, + + { 1.5, 2.0}, + {-1.5, -1.0}, + + { 2.5, 3.0}, + {-2.5, -2.0}, + + { FpUtils.nextDown(1.0), 1.0}, + { FpUtils.nextDown(-1.0), -1.0}, + + { Math.nextUp(1.0), 2.0}, + { Math.nextUp(-1.0), -0.0}, + + { 0x1.0p51, 0x1.0p51}, + {-0x1.0p51, -0x1.0p51}, + + { FpUtils.nextDown(0x1.0p51), 0x1.0p51}, + {-Math.nextUp(0x1.0p51), -0x1.0p51}, + + { Math.nextUp(0x1.0p51), 0x1.0p51+1}, + {-FpUtils.nextDown(0x1.0p51), -0x1.0p51+1}, + + { FpUtils.nextDown(0x1.0p52), 0x1.0p52}, + {-Math.nextUp(0x1.0p52), -0x1.0p52-1.0}, + + { Math.nextUp(0x1.0p52), 0x1.0p52+1.0}, + {-FpUtils.nextDown(0x1.0p52), -0x1.0p52+1.0}, + }; + + for(double[] testCase : testCases) { + failures += testCeilCase(testCase[0], testCase[1]); + failures += testFloorCase(-testCase[0], -testCase[1]); + } + return failures; + } + + public static void main(String... args) { + int failures = 0; + + failures += nearIntegerTests(); + failures += roundingTests(); + + if (failures > 0) { + System.err.println("Testing {Math, StrictMath}.ceil incurred " + + failures + " failures."); + throw new RuntimeException(); + } + } +} diff --git a/jdk/test/java/lang/StringCoding/CheckEncodings.sh b/jdk/test/java/lang/StringCoding/CheckEncodings.sh index 6fa20c4d5a6..9bfe2f7aad6 100644 --- a/jdk/test/java/lang/StringCoding/CheckEncodings.sh +++ b/jdk/test/java/lang/StringCoding/CheckEncodings.sh @@ -31,7 +31,7 @@ OS=`uname -s` case "$OS" in SunOS | Linux ) ;; - Windows* ) + Windows* | CYGWIN* ) echo "Passed"; exit 0 ;; * ) echo "Unrecognized system!" ; exit 1 ;; esac diff --git a/jdk/test/java/lang/System/finalization/FinExit.sh b/jdk/test/java/lang/System/finalization/FinExit.sh index d2e48da8fe3..c08fb6fdd5d 100644 --- a/jdk/test/java/lang/System/finalization/FinExit.sh +++ b/jdk/test/java/lang/System/finalization/FinExit.sh @@ -24,7 +24,9 @@ # # -x=`$TESTJAVA/bin/java -cp $TESTCLASSES FinExit` + +# We only want the first character, Windows might add CRLF +x=`$TESTJAVA/bin/java -cp "$TESTCLASSES" FinExit | cut -c1` echo $x if [ "x$x" != "x1" ]; then echo On-exit finalizer invoked twice diff --git a/jdk/test/java/lang/annotation/loaderLeak/LoaderLeak.sh b/jdk/test/java/lang/annotation/loaderLeak/LoaderLeak.sh index d8a47462f9b..28ac016d423 100644 --- a/jdk/test/java/lang/annotation/loaderLeak/LoaderLeak.sh +++ b/jdk/test/java/lang/annotation/loaderLeak/LoaderLeak.sh @@ -49,6 +49,11 @@ case "$OS" in PS=":" FS="/" ;; + CYGWIN* ) + NULL=/dev/null + PS=";" + FS="/" + ;; Windows* ) NULL=NUL PS=";" diff --git a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh index 0fdce4ba0a4..c2b1a763bb8 100644 --- a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh +++ b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh @@ -43,11 +43,17 @@ case "$OS" in PS=":" FS="/" ;; - Windows* | CYGWIN*) + Windows*) PS=";" OS="Windows" FS="\\" ;; + CYGWIN*) + PS=";" + OS="Windows" + FS="\\" + isCygwin=true + ;; * ) echo "Unrecognized system!" exit 1; diff --git a/jdk/test/java/math/BigInteger/BigIntegerTest.java b/jdk/test/java/math/BigInteger/BigIntegerTest.java index 75ce0033779..c5196eb7252 100644 --- a/jdk/test/java/math/BigInteger/BigIntegerTest.java +++ b/jdk/test/java/math/BigInteger/BigIntegerTest.java @@ -642,37 +642,71 @@ public class BigIntegerTest { for(int i = 0; i < bitPatterns.length; i++) { BigInteger b1 = new BigInteger(bitPatterns[i], 16); + BigInteger b2 = null; File f = new File("serialtest"); FileOutputStream fos = new FileOutputStream(f); - ObjectOutputStream oos = new ObjectOutputStream(fos); - oos.writeObject(b1); - oos.flush(); - oos.close(); - FileInputStream fis = new FileInputStream(f); - ObjectInputStream ois = new ObjectInputStream(fis); - BigInteger b2 = (BigInteger)ois.readObject(); + try { + ObjectOutputStream oos = new ObjectOutputStream(fos); + try { + oos.writeObject(b1); + oos.flush(); + } finally { + oos.close(); + } - if (!b1.equals(b2) || - !b1.equals(b1.or(b2))) { - failCount++; - System.err.println("Serialized failed for hex " + - b1.toString(16)); + FileInputStream fis = new FileInputStream(f); + try { + ObjectInputStream ois = new ObjectInputStream(fis); + try { + b2 = (BigInteger)ois.readObject(); + } finally { + ois.close(); + } + } finally { + fis.close(); + } + + if (!b1.equals(b2) || + !b1.equals(b1.or(b2))) { + failCount++; + System.err.println("Serialized failed for hex " + + b1.toString(16)); + } + } finally { + fos.close(); } f.delete(); } for(int i=0; i<10; i++) { BigInteger b1 = fetchNumber(rnd.nextInt(100)); + BigInteger b2 = null; File f = new File("serialtest"); FileOutputStream fos = new FileOutputStream(f); - ObjectOutputStream oos = new ObjectOutputStream(fos); - oos.writeObject(b1); - oos.flush(); - oos.close(); - FileInputStream fis = new FileInputStream(f); - ObjectInputStream ois = new ObjectInputStream(fis); - BigInteger b2 = (BigInteger)ois.readObject(); + try { + ObjectOutputStream oos = new ObjectOutputStream(fos); + try { + oos.writeObject(b1); + oos.flush(); + } finally { + oos.close(); + } + + FileInputStream fis = new FileInputStream(f); + try { + ObjectInputStream ois = new ObjectInputStream(fis); + try { + b2 = (BigInteger)ois.readObject(); + } finally { + ois.close(); + } + } finally { + fis.close(); + } + } finally { + fos.close(); + } if (!b1.equals(b2) || !b1.equals(b1.or(b2))) diff --git a/jdk/test/java/net/Authenticator/B4769350.java b/jdk/test/java/net/Authenticator/B4769350.java index e21cd869daf..1f673763508 100644 --- a/jdk/test/java/net/Authenticator/B4769350.java +++ b/jdk/test/java/net/Authenticator/B4769350.java @@ -26,9 +26,12 @@ * @bug 4769350 * @library ../../../sun/net/www/httptest/ * @build HttpCallback HttpServer ClosedChannelList HttpTransaction AbstractCallback - * @run main B4769350 server - * @run main B4769350 proxy + * @run main/othervm B4769350 server + * @run main/othervm B4769350 proxy * @summary proxy authentication username and password caching only works in serial case + * Run in othervm since the test sets system properties that are read by the + * networking stack and cached when the HTTP handler is invoked, and previous + * tests may already have invoked the HTTP handler. */ import java.io.*; diff --git a/jdk/test/java/net/CookieHandler/CookieHandlerTest.java b/jdk/test/java/net/CookieHandler/CookieHandlerTest.java index a3b4ada2761..221be099783 100644 --- a/jdk/test/java/net/CookieHandler/CookieHandlerTest.java +++ b/jdk/test/java/net/CookieHandler/CookieHandlerTest.java @@ -24,9 +24,13 @@ /* @test * @summary Unit test for java.net.CookieHandler * @bug 4696506 + * @run main/othervm CookieHandlerTest * @author Yingxian Wang */ +// Run in othervm since a default cookier handler is set and this +// can effect other HTTP related tests. + import java.net.*; import java.util.*; import java.io.*; diff --git a/jdk/test/java/net/CookieHandler/TestHttpCookie.java b/jdk/test/java/net/CookieHandler/TestHttpCookie.java index df0dd74cdb7..cf88ae336dd 100644 --- a/jdk/test/java/net/CookieHandler/TestHttpCookie.java +++ b/jdk/test/java/net/CookieHandler/TestHttpCookie.java @@ -48,7 +48,6 @@ public class TestHttpCookie { } TestHttpCookie(String cHeader) { - assert cHeader != null; this.cHeader = cHeader; try { diff --git a/jdk/test/java/net/InterfaceAddress/NetworkPrefixLength.java b/jdk/test/java/net/InterfaceAddress/NetworkPrefixLength.java new file mode 100644 index 00000000000..7b7f95852b8 --- /dev/null +++ b/jdk/test/java/net/InterfaceAddress/NetworkPrefixLength.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @bug 6707289 + * @summary InterfaceAddress.getNetworkPrefixLength() does not conform to Javadoc + */ + +import java.net.InetAddress; +import java.net.Inet4Address; +import java.net.InterfaceAddress; +import java.net.NetworkInterface; +import java.util.Enumeration; +import static java.lang.System.out; + +public class NetworkPrefixLength { + static boolean passed = true; + + public static void main(String[] args) throws Exception { + Enumeration nics = NetworkInterface.getNetworkInterfaces(); + + while (nics.hasMoreElements()) { + NetworkInterface nic = nics.nextElement(); + for (InterfaceAddress iaddr : nic.getInterfaceAddresses()) { + boolean valid = checkPrefix(iaddr); + if (!valid) { + passed = false; + debug(nic.getName(), iaddr); + } + } + } + + if (!passed) + throw new RuntimeException("Failed: some interfaces have invalid prefix lengths"); + } + + static boolean checkPrefix(InterfaceAddress iaddr) { + InetAddress addr = iaddr.getAddress(); + + if (addr instanceof Inet4Address) + return checkIPv4PrefixLength(iaddr.getNetworkPrefixLength()); + else + return checkIPv6PrefixLength(iaddr.getNetworkPrefixLength()); + } + + static boolean checkIPv4PrefixLength(int prefix) { + if (prefix >=0 && prefix <= 32) + return true; + + return false; + } + + static boolean checkIPv6PrefixLength(int prefix) { + if (prefix >=0 && prefix <= 128) + return true; + + return false; + } + + static void debug(String nicName, InterfaceAddress iaddr) { + out.println("NIC " + nicName + " has an address with an invalid prefix length:\n" + iaddr); + } +} + diff --git a/jdk/test/java/net/MulticastSocket/NoLoopbackPackets.java b/jdk/test/java/net/MulticastSocket/NoLoopbackPackets.java index 83419886880..7953d513eb5 100644 --- a/jdk/test/java/net/MulticastSocket/NoLoopbackPackets.java +++ b/jdk/test/java/net/MulticastSocket/NoLoopbackPackets.java @@ -29,9 +29,7 @@ import java.util.*; import java.net.*; - public class NoLoopbackPackets { - private static int PORT = 9001; private static String osname; static boolean isWindows() { @@ -68,40 +66,47 @@ public class NoLoopbackPackets { return; } - // we will send packets to three multicast groups :- - // 224.1.1.1, ::ffff:224.1.1.2, and ff02::1:1 - // - List groups = new ArrayList(); - groups.add(new InetSocketAddress(InetAddress.getByName("224.1.1.1"), PORT)); - groups.add(new InetSocketAddress(InetAddress.getByName("::ffff:224.1.1.2"), PORT)); - groups.add(new InetSocketAddress(InetAddress.getByName("ff02::1:1"), PORT)); - - Thread sender = new Thread(new Sender(groups)); - sender.setDaemon(true); // we want sender to stop when main thread exits - sender.start(); - - // Now try to receive multicast packets. we should not see any of them - // since we disable loopback mode. - // - MulticastSocket msock = new MulticastSocket(PORT); - msock.setSoTimeout(5000); // 5 seconds - - byte[] buf = new byte[1024]; - DatagramPacket packet = new DatagramPacket(buf, 0, buf.length); + MulticastSocket msock = null; List failedGroups = new ArrayList(); - for (SocketAddress group : groups) { - msock.joinGroup(group, null); + try { + msock = new MulticastSocket(); + int port = msock.getLocalPort(); - try { - msock.receive(packet); + // we will send packets to three multicast groups :- + // 224.1.1.1, ::ffff:224.1.1.2, and ff02::1:1 + // + List groups = new ArrayList(); + groups.add(new InetSocketAddress(InetAddress.getByName("224.1.1.1"), port)); + groups.add(new InetSocketAddress(InetAddress.getByName("::ffff:224.1.1.2"), port)); + groups.add(new InetSocketAddress(InetAddress.getByName("ff02::1:1"), port)); - // it is an error if we receive something - failedGroups.add(group); - } catch (SocketTimeoutException e) { - // we expect this + Thread sender = new Thread(new Sender(groups)); + sender.setDaemon(true); // we want sender to stop when main thread exits + sender.start(); + + // Now try to receive multicast packets. we should not see any of them + // since we disable loopback mode. + // + msock.setSoTimeout(5000); // 5 seconds + + byte[] buf = new byte[1024]; + DatagramPacket packet = new DatagramPacket(buf, 0, buf.length); + for (SocketAddress group : groups) { + msock.joinGroup(group, null); + + try { + msock.receive(packet); + + // it is an error if we receive something + failedGroups.add(group); + } catch (SocketTimeoutException e) { + // we expect this + } + + msock.leaveGroup(group, null); } - - msock.leaveGroup(group, null); + } finally { + if (msock != null) try { msock.close(); } catch (Exception e) {} } if (failedGroups.size() > 0) { @@ -111,36 +116,36 @@ public class NoLoopbackPackets { throw new RuntimeException("test failed."); } } -} -class Sender implements Runnable { - private List sendToGroups; + static class Sender implements Runnable { + private List sendToGroups; - public Sender(List groups) { - sendToGroups = groups; - } + public Sender(List groups) { + sendToGroups = groups; + } - public void run() { - byte[] buf = "hello world".getBytes(); - List packets = new ArrayList(); + public void run() { + byte[] buf = "hello world".getBytes(); + List packets = new ArrayList(); - try { - for (SocketAddress group : sendToGroups) { - DatagramPacket packet = new DatagramPacket(buf, buf.length, group); - packets.add(packet); - } - - MulticastSocket msock = new MulticastSocket(); - msock.setLoopbackMode(true); // disable loopback mode - for (;;) { - for (DatagramPacket packet : packets) { - msock.send(packet); + try { + for (SocketAddress group : sendToGroups) { + DatagramPacket packet = new DatagramPacket(buf, buf.length, group); + packets.add(packet); } - Thread.currentThread().sleep(1000); // 1 second + MulticastSocket msock = new MulticastSocket(); + msock.setLoopbackMode(true); // disable loopback mode + for (;;) { + for (DatagramPacket packet : packets) { + msock.send(packet); + } + + Thread.sleep(1000); // 1 second + } + } catch (Exception e) { + throw new RuntimeException(e); } - } catch (Exception e) { - throw new RuntimeException(e); } } } diff --git a/jdk/test/java/net/ProxySelector/SystemProxies.java b/jdk/test/java/net/ProxySelector/SystemProxies.java new file mode 100644 index 00000000000..5d7a7bc6ecd --- /dev/null +++ b/jdk/test/java/net/ProxySelector/SystemProxies.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * This is a manual test to determine the proxies set on the system for various + * protocols. See bug 6912868. + */ +import java.net.Proxy; +import java.net.ProxySelector; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.List; + +public class SystemProxies { + + static final String uriAuthority = "myMachine/"; + static final ProxySelector proxySel = ProxySelector.getDefault(); + + public static void main(String[] args) { + if (! "true".equals(System.getProperty("java.net.useSystemProxies"))) { + System.out.println("Usage: java -Djava.net.useSystemProxies SystemProxies"); + return; + } + + printProxies("http://"); + printProxies("https://"); + printProxies("ftp://"); + } + + static void printProxies(String proto) { + String uriStr = proto + uriAuthority; + try { + List proxies = proxySel.select(new URI(uriStr)); + System.out.println("Proxies returned for " + uriStr); + for (Proxy proxy : proxies) + System.out.println("\t" + proxy); + } catch (URISyntaxException e) { + System.err.println(e); + } + } +} diff --git a/jdk/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java b/jdk/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java index d5463f00fc5..9c893151bcd 100644 --- a/jdk/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java +++ b/jdk/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.java @@ -22,17 +22,16 @@ */ /* - * @test - * @summary configuring unconnected Socket before passing to implAccept can cause fd leak - * @bug 6368984 - * @author Edward Wang + * Test run from script, AcceptCauseFileDescriptorLeak.sh + * author Edward Wang */ -import java.io.*; -import java.net.*; +import java.io.IOException; +import java.net.ServerSocket; +import java.net.Socket; public class AcceptCauseFileDescriptorLeak { - private static final int REPS = 1000; + private static final int REPS = 2048; public static void main(String[] args) throws Exception { final ServerSocket ss = new ServerSocket(0) { @@ -60,31 +59,5 @@ public class AcceptCauseFileDescriptorLeak { } ss.close(); t.join(); - - // - // The threshold 20 below is a little arbitrary. The point here is that - // the remaining open file descriptors should be constant independent - // of REPS. - // - if (countOpenFD() > 20) { - throw new RuntimeException("File descriptor leak detected."); - } - } - - - /* - * Actually, this approach to count open file descriptors only - * works for Solaris/Linux. On Windows platform, this method - * will simply return zero. So the test will always be passed - * on Windows, too. - */ - private static int countOpenFD() { - File dirOfFD = new File("/proc/self/fd"); - File[] fds = dirOfFD.listFiles(); - - if (fds != null) - return fds.length; - else - return 0; } } diff --git a/jdk/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.sh b/jdk/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.sh new file mode 100644 index 00000000000..fe28fc8fa25 --- /dev/null +++ b/jdk/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.sh @@ -0,0 +1,48 @@ +# +# Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# @test +# @bug 6368984 +# @summary configuring unconnected Socket before passing to implAccept can cause fd leak +# @build AcceptCauseFileDescriptorLeak +# @run shell AcceptCauseFileDescriptorLeak.sh + +OS=`uname -s` +case "$OS" in + Windows_* | CYGWIN* ) + echo "ulimit not on Windows" + exit 0 + ;; + * ) + CLASSPATH=${TESTCLASSES}:${TESTSRC} + ;; +esac +export CLASSPATH + +# hard limit needs to be less than 1024 for this bug +NOFILES=`ulimit -n -H` +if [ "$NOFILES" = "unlimited" ] || [ $NOFILES -ge 1024 ]; then + ulimit -n 1024 +fi + +${TESTJAVA}/bin/java AcceptCauseFileDescriptorLeak diff --git a/jdk/test/java/net/Socket/SocksConnectTimeout.java b/jdk/test/java/net/Socket/SocksConnectTimeout.java new file mode 100644 index 00000000000..0821b976c09 --- /dev/null +++ b/jdk/test/java/net/Socket/SocksConnectTimeout.java @@ -0,0 +1,132 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6223635 + * @summary Code hangs at connect call even when Timeout is specified + */ + +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.Proxy; +import java.net.Socket; +import java.net.ServerSocket; +import java.net.SocketTimeoutException; +import java.io.IOException; +import java.io.Closeable; +import java.util.concurrent.Phaser; +import java.util.concurrent.TimeUnit; + +public class SocksConnectTimeout { + static ServerSocket serverSocket; + static final boolean debug = true; + static final Phaser startPhaser = new Phaser(2); + static final Phaser finishPhaser = new Phaser(2); + static int failed, passed; + + public static void main(String[] args) { + try { + serverSocket = new ServerSocket(0); + + (new Thread() { + @Override + public void run() { serve(); } + }).start(); + + Proxy socksProxy = new Proxy(Proxy.Type.SOCKS, + new InetSocketAddress(InetAddress.getLocalHost(), serverSocket.getLocalPort())); + + test(socksProxy); + } catch (IOException e) { + unexpected(e); + } finally { + close(serverSocket); + + if (failed > 0) + throw new RuntimeException("Test Failed: passed:" + passed + ", failed:" + failed); + } + } + + static void test(Proxy proxy) { + startPhaser.arriveAndAwaitAdvance(); + Socket socket = null; + try { + socket = new Socket(proxy); + connectWithTimeout(socket); + failed("connected successfully!"); + } catch (SocketTimeoutException socketTimeout) { + debug("Passed: Received: " + socketTimeout); + passed(); + } catch (Exception exception) { + failed("Connect timeout test failed", exception); + } finally { + finishPhaser.arriveAndAwaitAdvance(); + close(socket); + } + } + + static void connectWithTimeout(Socket socket) throws IOException { + socket.connect(new InetSocketAddress(InetAddress.getLocalHost(), 1234), 500); + } + + static void serve() { + Socket client = null; + try { + startPhaser.arriveAndAwaitAdvance(); + client = serverSocket.accept(); + finishPhaser.awaitAdvanceInterruptibly(finishPhaser.arrive(), 5, TimeUnit.SECONDS); + } catch (Exception e) { + unexpected(e); + } finally { + close(client); + } + } + + static void debug(String message) { + if (debug) + System.out.println(message); + } + + static void unexpected(Exception e ) { + System.out.println("Unexcepted Exception: " + e); + } + + static void close(Closeable closeable) { + if (closeable != null) try { closeable.close(); } catch (IOException e) {unexpected(e);} + } + + static void failed(String message) { + System.out.println(message); + failed++; + } + + static void failed(String message, Exception e) { + System.out.println(message); + System.out.println(e); + failed++; + } + + static void passed() { passed++; }; + +} diff --git a/jdk/test/java/net/URLClassLoader/closetest/CloseTest.java b/jdk/test/java/net/URLClassLoader/closetest/CloseTest.java index b0fdd577b42..092bf542a5b 100644 --- a/jdk/test/java/net/URLClassLoader/closetest/CloseTest.java +++ b/jdk/test/java/net/URLClassLoader/closetest/CloseTest.java @@ -34,7 +34,6 @@ import java.io.*; import java.net.*; import java.lang.reflect.*; -import java.util.concurrent.*; import com.sun.net.httpserver.*; public class CloseTest { @@ -107,7 +106,6 @@ public class CloseTest { } else { copyFile (new File (src, f), new File (dst, f)); } - assert false; } } diff --git a/jdk/test/java/net/ipv6tests/TcpTest.java b/jdk/test/java/net/ipv6tests/TcpTest.java index ec07a8bdd1a..38bb74513a8 100644 --- a/jdk/test/java/net/ipv6tests/TcpTest.java +++ b/jdk/test/java/net/ipv6tests/TcpTest.java @@ -47,9 +47,11 @@ public class TcpTest extends Tests { try { ia4any = InetAddress.getByName ("0.0.0.0"); ia6any = InetAddress.getByName ("::0"); - int scope = ia6addr.getScopeId(); - if (scope != 0) { - ia6bad = InetAddress.getByName ("fe80::1:2:3:4:5:6%"+scope); + if (ia6addr != null) { + int scope = ia6addr.getScopeId(); + if (scope != 0) { + ia6bad = InetAddress.getByName ("fe80::1:2:3:4:5:6%"+scope); + } } else { ia6bad = InetAddress.getByName ("fe80::1:2:3:4:5:6"); } diff --git a/jdk/test/java/net/ipv6tests/Tests.java b/jdk/test/java/net/ipv6tests/Tests.java index 4527427d956..096bd3d2608 100644 --- a/jdk/test/java/net/ipv6tests/Tests.java +++ b/jdk/test/java/net/ipv6tests/Tests.java @@ -38,12 +38,25 @@ public class Tests { OutputStream o1 = s1.getOutputStream(); OutputStream o2 = s2.getOutputStream(); - simpleWrite (o1, 100); - simpleWrite (o2, 200); + startSimpleWriter("SimpleWriter-1", o1, 100); + startSimpleWriter("SimpleWriter-2", o2, 200); simpleRead (i2, 100); simpleRead (i1, 200); } + static void startSimpleWriter(String threadName, final OutputStream os, final int start) { + (new Thread(new Runnable() { + public void run() { + try { simpleWrite(os, start); } + catch (Exception e) {unexpected(e); } + }}, threadName)).start(); + } + + static void unexpected(Exception e ) { + System.out.println("Unexcepted Exception: " + e); + e.printStackTrace(); + } + /** * Send a packet from s1 to s2 (ia2/s2.localPort) and check it * Send a packet from s2 to s1 (ia1/s1.localPort) and check it @@ -247,13 +260,15 @@ public class Tests { } private NetworkInterface getNextIf () { - while (ifs.hasMoreElements()) { - NetworkInterface nic = (NetworkInterface)ifs.nextElement(); - try { - if (nic.isUp() && !nic.isLoopback()) - return nic; - } catch (SocketException e) { - // ignore + if (ifs != null) { + while (ifs.hasMoreElements()) { + NetworkInterface nic = (NetworkInterface)ifs.nextElement(); + try { + if (nic.isUp() && !nic.isLoopback()) + return nic; + } catch (SocketException e) { + // ignore + } } } diff --git a/jdk/test/java/nio/Buffer/Basic-X.java.template b/jdk/test/java/nio/Buffer/Basic-X.java.template index 6612771def4..93cbe8eb5ee 100644 --- a/jdk/test/java/nio/Buffer/Basic-X.java.template +++ b/jdk/test/java/nio/Buffer/Basic-X.java.template @@ -38,6 +38,26 @@ public class Basic$Type$ extends Basic { + private static final $type$[] VALUES = { + $Fulltype$.MIN_VALUE, + ($type$) -1, + ($type$) 0, + ($type$) 1, + $Fulltype$.MAX_VALUE, +#if[float] + $Fulltype$.NEGATIVE_INFINITY, + $Fulltype$.POSITIVE_INFINITY, + $Fulltype$.NaN, + ($type$) -0.0, +#end[float] +#if[double] + $Fulltype$.NEGATIVE_INFINITY, + $Fulltype$.POSITIVE_INFINITY, + $Fulltype$.NaN, + ($type$) -0.0, +#end[double] + }; + private static void relGet($Type$Buffer b) { int n = b.capacity(); $type$ v; @@ -309,6 +329,12 @@ public class Basic$Type$ #end[byte] + private static void fail(String problem, + $Type$Buffer xb, $Type$Buffer yb, + $type$ x, $type$ y) { + fail(problem + String.format(": x=%s y=%s", x, y), xb, yb); + } + private static void tryCatch(Buffer b, Class ex, Runnable thunk) { boolean caught = false; try { @@ -522,6 +548,42 @@ public class Basic$Type$ if (b.compareTo(b2) <= 0) fail("Comparison to lesser buffer <= 0", b, b2); + // Check equals and compareTo with interesting values + for ($type$ x : VALUES) { + $Type$Buffer xb = $Type$Buffer.wrap(new $type$[] { x }); + if (xb.compareTo(xb) != 0) { + fail("compareTo not reflexive", xb, xb, x, x); + } + if (! xb.equals(xb)) { + fail("equals not reflexive", xb, xb, x, x); + } + for ($type$ y : VALUES) { + $Type$Buffer yb = $Type$Buffer.wrap(new $type$[] { y }); + if (xb.compareTo(yb) != - yb.compareTo(xb)) { + fail("compareTo not anti-symmetric", + xb, yb, x, y); + } + if ((xb.compareTo(yb) == 0) != xb.equals(yb)) { + fail("compareTo inconsistent with equals", + xb, yb, x, y); + } + if (xb.compareTo(yb) != $Fulltype$.compare(x, y)) { +#if[float] + if (x == 0.0 && y == 0.0) continue; +#end[float] +#if[double] + if (x == 0.0 && y == 0.0) continue; +#end[double] + fail("Incorrect results for $Type$Buffer.compareTo", + xb, yb, x, y); + } + if (xb.equals(yb) != ((x == y) || ((x != x) && (y != y)))) { + fail("Incorrect results for $Type$Buffer.equals", + xb, yb, x, y); + } + } + } + // Sub, dup relPut(b); diff --git a/jdk/test/java/nio/Buffer/BasicByte.java b/jdk/test/java/nio/Buffer/BasicByte.java index 7e259a1416d..78b209936d7 100644 --- a/jdk/test/java/nio/Buffer/BasicByte.java +++ b/jdk/test/java/nio/Buffer/BasicByte.java @@ -38,6 +38,26 @@ public class BasicByte extends Basic { + private static final byte[] VALUES = { + Byte.MIN_VALUE, + (byte) -1, + (byte) 0, + (byte) 1, + Byte.MAX_VALUE, + + + + + + + + + + + + + }; + private static void relGet(ByteBuffer b) { int n = b.capacity(); byte v; @@ -309,6 +329,12 @@ public class BasicByte + private static void fail(String problem, + ByteBuffer xb, ByteBuffer yb, + byte x, byte y) { + fail(problem + String.format(": x=%s y=%s", x, y), xb, yb); + } + private static void tryCatch(Buffer b, Class ex, Runnable thunk) { boolean caught = false; try { @@ -522,6 +548,42 @@ public class BasicByte if (b.compareTo(b2) <= 0) fail("Comparison to lesser buffer <= 0", b, b2); + // Check equals and compareTo with interesting values + for (byte x : VALUES) { + ByteBuffer xb = ByteBuffer.wrap(new byte[] { x }); + if (xb.compareTo(xb) != 0) { + fail("compareTo not reflexive", xb, xb, x, x); + } + if (! xb.equals(xb)) { + fail("equals not reflexive", xb, xb, x, x); + } + for (byte y : VALUES) { + ByteBuffer yb = ByteBuffer.wrap(new byte[] { y }); + if (xb.compareTo(yb) != - yb.compareTo(xb)) { + fail("compareTo not anti-symmetric", + xb, yb, x, y); + } + if ((xb.compareTo(yb) == 0) != xb.equals(yb)) { + fail("compareTo inconsistent with equals", + xb, yb, x, y); + } + if (xb.compareTo(yb) != Byte.compare(x, y)) { + + + + + + + fail("Incorrect results for ByteBuffer.compareTo", + xb, yb, x, y); + } + if (xb.equals(yb) != ((x == y) || ((x != x) && (y != y)))) { + fail("Incorrect results for ByteBuffer.equals", + xb, yb, x, y); + } + } + } + // Sub, dup relPut(b); diff --git a/jdk/test/java/nio/Buffer/BasicChar.java b/jdk/test/java/nio/Buffer/BasicChar.java index a0df9fcf3a9..9f3c5e4219c 100644 --- a/jdk/test/java/nio/Buffer/BasicChar.java +++ b/jdk/test/java/nio/Buffer/BasicChar.java @@ -38,6 +38,26 @@ public class BasicChar extends Basic { + private static final char[] VALUES = { + Character.MIN_VALUE, + (char) -1, + (char) 0, + (char) 1, + Character.MAX_VALUE, + + + + + + + + + + + + + }; + private static void relGet(CharBuffer b) { int n = b.capacity(); char v; @@ -308,6 +328,12 @@ public class BasicChar + + private static void fail(String problem, + CharBuffer xb, CharBuffer yb, + char x, char y) { + fail(problem + String.format(": x=%s y=%s", x, y), xb, yb); + } private static void tryCatch(Buffer b, Class ex, Runnable thunk) { boolean caught = false; @@ -522,6 +548,42 @@ public class BasicChar if (b.compareTo(b2) <= 0) fail("Comparison to lesser buffer <= 0", b, b2); + // Check equals and compareTo with interesting values + for (char x : VALUES) { + CharBuffer xb = CharBuffer.wrap(new char[] { x }); + if (xb.compareTo(xb) != 0) { + fail("compareTo not reflexive", xb, xb, x, x); + } + if (! xb.equals(xb)) { + fail("equals not reflexive", xb, xb, x, x); + } + for (char y : VALUES) { + CharBuffer yb = CharBuffer.wrap(new char[] { y }); + if (xb.compareTo(yb) != - yb.compareTo(xb)) { + fail("compareTo not anti-symmetric", + xb, yb, x, y); + } + if ((xb.compareTo(yb) == 0) != xb.equals(yb)) { + fail("compareTo inconsistent with equals", + xb, yb, x, y); + } + if (xb.compareTo(yb) != Character.compare(x, y)) { + + + + + + + fail("Incorrect results for CharBuffer.compareTo", + xb, yb, x, y); + } + if (xb.equals(yb) != ((x == y) || ((x != x) && (y != y)))) { + fail("Incorrect results for CharBuffer.equals", + xb, yb, x, y); + } + } + } + // Sub, dup relPut(b); diff --git a/jdk/test/java/nio/Buffer/BasicDouble.java b/jdk/test/java/nio/Buffer/BasicDouble.java index a627d0e9194..97f5fa200de 100644 --- a/jdk/test/java/nio/Buffer/BasicDouble.java +++ b/jdk/test/java/nio/Buffer/BasicDouble.java @@ -38,6 +38,26 @@ public class BasicDouble extends Basic { + private static final double[] VALUES = { + Double.MIN_VALUE, + (double) -1, + (double) 0, + (double) 1, + Double.MAX_VALUE, + + + + + + + + Double.NEGATIVE_INFINITY, + Double.POSITIVE_INFINITY, + Double.NaN, + (double) -0.0, + + }; + private static void relGet(DoubleBuffer b) { int n = b.capacity(); double v; @@ -308,6 +328,12 @@ public class BasicDouble + + private static void fail(String problem, + DoubleBuffer xb, DoubleBuffer yb, + double x, double y) { + fail(problem + String.format(": x=%s y=%s", x, y), xb, yb); + } private static void tryCatch(Buffer b, Class ex, Runnable thunk) { boolean caught = false; @@ -522,6 +548,42 @@ public class BasicDouble if (b.compareTo(b2) <= 0) fail("Comparison to lesser buffer <= 0", b, b2); + // Check equals and compareTo with interesting values + for (double x : VALUES) { + DoubleBuffer xb = DoubleBuffer.wrap(new double[] { x }); + if (xb.compareTo(xb) != 0) { + fail("compareTo not reflexive", xb, xb, x, x); + } + if (! xb.equals(xb)) { + fail("equals not reflexive", xb, xb, x, x); + } + for (double y : VALUES) { + DoubleBuffer yb = DoubleBuffer.wrap(new double[] { y }); + if (xb.compareTo(yb) != - yb.compareTo(xb)) { + fail("compareTo not anti-symmetric", + xb, yb, x, y); + } + if ((xb.compareTo(yb) == 0) != xb.equals(yb)) { + fail("compareTo inconsistent with equals", + xb, yb, x, y); + } + if (xb.compareTo(yb) != Double.compare(x, y)) { + + + + + if (x == 0.0 && y == 0.0) continue; + + fail("Incorrect results for DoubleBuffer.compareTo", + xb, yb, x, y); + } + if (xb.equals(yb) != ((x == y) || ((x != x) && (y != y)))) { + fail("Incorrect results for DoubleBuffer.equals", + xb, yb, x, y); + } + } + } + // Sub, dup relPut(b); diff --git a/jdk/test/java/nio/Buffer/BasicFloat.java b/jdk/test/java/nio/Buffer/BasicFloat.java index 730dcbeac95..46bdfe163cb 100644 --- a/jdk/test/java/nio/Buffer/BasicFloat.java +++ b/jdk/test/java/nio/Buffer/BasicFloat.java @@ -38,6 +38,26 @@ public class BasicFloat extends Basic { + private static final float[] VALUES = { + Float.MIN_VALUE, + (float) -1, + (float) 0, + (float) 1, + Float.MAX_VALUE, + + Float.NEGATIVE_INFINITY, + Float.POSITIVE_INFINITY, + Float.NaN, + (float) -0.0, + + + + + + + + }; + private static void relGet(FloatBuffer b) { int n = b.capacity(); float v; @@ -308,6 +328,12 @@ public class BasicFloat + + private static void fail(String problem, + FloatBuffer xb, FloatBuffer yb, + float x, float y) { + fail(problem + String.format(": x=%s y=%s", x, y), xb, yb); + } private static void tryCatch(Buffer b, Class ex, Runnable thunk) { boolean caught = false; @@ -522,6 +548,42 @@ public class BasicFloat if (b.compareTo(b2) <= 0) fail("Comparison to lesser buffer <= 0", b, b2); + // Check equals and compareTo with interesting values + for (float x : VALUES) { + FloatBuffer xb = FloatBuffer.wrap(new float[] { x }); + if (xb.compareTo(xb) != 0) { + fail("compareTo not reflexive", xb, xb, x, x); + } + if (! xb.equals(xb)) { + fail("equals not reflexive", xb, xb, x, x); + } + for (float y : VALUES) { + FloatBuffer yb = FloatBuffer.wrap(new float[] { y }); + if (xb.compareTo(yb) != - yb.compareTo(xb)) { + fail("compareTo not anti-symmetric", + xb, yb, x, y); + } + if ((xb.compareTo(yb) == 0) != xb.equals(yb)) { + fail("compareTo inconsistent with equals", + xb, yb, x, y); + } + if (xb.compareTo(yb) != Float.compare(x, y)) { + + if (x == 0.0 && y == 0.0) continue; + + + + + fail("Incorrect results for FloatBuffer.compareTo", + xb, yb, x, y); + } + if (xb.equals(yb) != ((x == y) || ((x != x) && (y != y)))) { + fail("Incorrect results for FloatBuffer.equals", + xb, yb, x, y); + } + } + } + // Sub, dup relPut(b); diff --git a/jdk/test/java/nio/Buffer/BasicInt.java b/jdk/test/java/nio/Buffer/BasicInt.java index b20e4bb1056..478debd76e1 100644 --- a/jdk/test/java/nio/Buffer/BasicInt.java +++ b/jdk/test/java/nio/Buffer/BasicInt.java @@ -38,6 +38,26 @@ public class BasicInt extends Basic { + private static final int[] VALUES = { + Integer.MIN_VALUE, + (int) -1, + (int) 0, + (int) 1, + Integer.MAX_VALUE, + + + + + + + + + + + + + }; + private static void relGet(IntBuffer b) { int n = b.capacity(); int v; @@ -308,6 +328,12 @@ public class BasicInt + + private static void fail(String problem, + IntBuffer xb, IntBuffer yb, + int x, int y) { + fail(problem + String.format(": x=%s y=%s", x, y), xb, yb); + } private static void tryCatch(Buffer b, Class ex, Runnable thunk) { boolean caught = false; @@ -522,6 +548,42 @@ public class BasicInt if (b.compareTo(b2) <= 0) fail("Comparison to lesser buffer <= 0", b, b2); + // Check equals and compareTo with interesting values + for (int x : VALUES) { + IntBuffer xb = IntBuffer.wrap(new int[] { x }); + if (xb.compareTo(xb) != 0) { + fail("compareTo not reflexive", xb, xb, x, x); + } + if (! xb.equals(xb)) { + fail("equals not reflexive", xb, xb, x, x); + } + for (int y : VALUES) { + IntBuffer yb = IntBuffer.wrap(new int[] { y }); + if (xb.compareTo(yb) != - yb.compareTo(xb)) { + fail("compareTo not anti-symmetric", + xb, yb, x, y); + } + if ((xb.compareTo(yb) == 0) != xb.equals(yb)) { + fail("compareTo inconsistent with equals", + xb, yb, x, y); + } + if (xb.compareTo(yb) != Integer.compare(x, y)) { + + + + + + + fail("Incorrect results for IntBuffer.compareTo", + xb, yb, x, y); + } + if (xb.equals(yb) != ((x == y) || ((x != x) && (y != y)))) { + fail("Incorrect results for IntBuffer.equals", + xb, yb, x, y); + } + } + } + // Sub, dup relPut(b); diff --git a/jdk/test/java/nio/Buffer/BasicLong.java b/jdk/test/java/nio/Buffer/BasicLong.java index 0d4c568e1e3..0abc7cdf2f4 100644 --- a/jdk/test/java/nio/Buffer/BasicLong.java +++ b/jdk/test/java/nio/Buffer/BasicLong.java @@ -38,6 +38,26 @@ public class BasicLong extends Basic { + private static final long[] VALUES = { + Long.MIN_VALUE, + (long) -1, + (long) 0, + (long) 1, + Long.MAX_VALUE, + + + + + + + + + + + + + }; + private static void relGet(LongBuffer b) { int n = b.capacity(); long v; @@ -308,6 +328,12 @@ public class BasicLong + + private static void fail(String problem, + LongBuffer xb, LongBuffer yb, + long x, long y) { + fail(problem + String.format(": x=%s y=%s", x, y), xb, yb); + } private static void tryCatch(Buffer b, Class ex, Runnable thunk) { boolean caught = false; @@ -522,6 +548,42 @@ public class BasicLong if (b.compareTo(b2) <= 0) fail("Comparison to lesser buffer <= 0", b, b2); + // Check equals and compareTo with interesting values + for (long x : VALUES) { + LongBuffer xb = LongBuffer.wrap(new long[] { x }); + if (xb.compareTo(xb) != 0) { + fail("compareTo not reflexive", xb, xb, x, x); + } + if (! xb.equals(xb)) { + fail("equals not reflexive", xb, xb, x, x); + } + for (long y : VALUES) { + LongBuffer yb = LongBuffer.wrap(new long[] { y }); + if (xb.compareTo(yb) != - yb.compareTo(xb)) { + fail("compareTo not anti-symmetric", + xb, yb, x, y); + } + if ((xb.compareTo(yb) == 0) != xb.equals(yb)) { + fail("compareTo inconsistent with equals", + xb, yb, x, y); + } + if (xb.compareTo(yb) != Long.compare(x, y)) { + + + + + + + fail("Incorrect results for LongBuffer.compareTo", + xb, yb, x, y); + } + if (xb.equals(yb) != ((x == y) || ((x != x) && (y != y)))) { + fail("Incorrect results for LongBuffer.equals", + xb, yb, x, y); + } + } + } + // Sub, dup relPut(b); diff --git a/jdk/test/java/nio/Buffer/BasicShort.java b/jdk/test/java/nio/Buffer/BasicShort.java index 58e5a3e6d68..861d356b6df 100644 --- a/jdk/test/java/nio/Buffer/BasicShort.java +++ b/jdk/test/java/nio/Buffer/BasicShort.java @@ -38,6 +38,26 @@ public class BasicShort extends Basic { + private static final short[] VALUES = { + Short.MIN_VALUE, + (short) -1, + (short) 0, + (short) 1, + Short.MAX_VALUE, + + + + + + + + + + + + + }; + private static void relGet(ShortBuffer b) { int n = b.capacity(); short v; @@ -308,6 +328,12 @@ public class BasicShort + + private static void fail(String problem, + ShortBuffer xb, ShortBuffer yb, + short x, short y) { + fail(problem + String.format(": x=%s y=%s", x, y), xb, yb); + } private static void tryCatch(Buffer b, Class ex, Runnable thunk) { boolean caught = false; @@ -522,6 +548,42 @@ public class BasicShort if (b.compareTo(b2) <= 0) fail("Comparison to lesser buffer <= 0", b, b2); + // Check equals and compareTo with interesting values + for (short x : VALUES) { + ShortBuffer xb = ShortBuffer.wrap(new short[] { x }); + if (xb.compareTo(xb) != 0) { + fail("compareTo not reflexive", xb, xb, x, x); + } + if (! xb.equals(xb)) { + fail("equals not reflexive", xb, xb, x, x); + } + for (short y : VALUES) { + ShortBuffer yb = ShortBuffer.wrap(new short[] { y }); + if (xb.compareTo(yb) != - yb.compareTo(xb)) { + fail("compareTo not anti-symmetric", + xb, yb, x, y); + } + if ((xb.compareTo(yb) == 0) != xb.equals(yb)) { + fail("compareTo inconsistent with equals", + xb, yb, x, y); + } + if (xb.compareTo(yb) != Short.compare(x, y)) { + + + + + + + fail("Incorrect results for ShortBuffer.compareTo", + xb, yb, x, y); + } + if (xb.equals(yb) != ((x == y) || ((x != x) && (y != y)))) { + fail("Incorrect results for ShortBuffer.equals", + xb, yb, x, y); + } + } + } + // Sub, dup relPut(b); diff --git a/jdk/test/java/nio/Buffer/genBasic.sh b/jdk/test/java/nio/Buffer/genBasic.sh index da5fca5df33..009cf2dbb1b 100644 --- a/jdk/test/java/nio/Buffer/genBasic.sh +++ b/jdk/test/java/nio/Buffer/genBasic.sh @@ -36,5 +36,3 @@ gen int Int Integer gen long Long Long gen float Float Float gen double Double Double - -rm -rf build diff --git a/jdk/test/java/nio/channels/AsynchronousFileChannel/LotsOfWrites.java b/jdk/test/java/nio/channels/AsynchronousFileChannel/LotsOfWrites.java new file mode 100644 index 00000000000..dd2c27ddbd4 --- /dev/null +++ b/jdk/test/java/nio/channels/AsynchronousFileChannel/LotsOfWrites.java @@ -0,0 +1,162 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @bug 6913877 + * @summary Stress AsynchronousFileChannel.write + */ + +import java.io.*; +import java.nio.ByteBuffer; +import static java.nio.file.StandardOpenOption.*; +import java.nio.channels.*; +import java.util.Random; +import java.util.concurrent.CountDownLatch; + +public class LotsOfWrites { + static final Random rand = new Random(); + + /** + * Asynchronously writes a known pattern to a file up to a given size, + * counting down a latch to release waiters when done. + */ + static class Writer implements CompletionHandler { + private final File file; + private final long size; + private final CountDownLatch latch; + private final AsynchronousFileChannel channel; + + private volatile long position; + private volatile byte nextByte; + + private long updatePosition(long nwrote) { + position += nwrote; + return position; + } + + private ByteBuffer genNextBuffer() { + int n = Math.min(8192 + rand.nextInt(8192), (int)(size - position)); + ByteBuffer buf = ByteBuffer.allocate(n); + for (int i=0; i= size) { + done(); + return; + } + buf = genNextBuffer(); + } + channel.write(buf, pos, buf, this); + } + + @Override + public void failed(Throwable exc, ByteBuffer buf) { + exc.printStackTrace(); + done(); + } + } + + public static void main(String[] args) throws Exception { + // random number of writers + int count = 20 + rand.nextInt(16); + Writer[] writers = new Writer[count]; + CountDownLatch latch = new CountDownLatch(count); + + // initiate writing to each file + for (int i=0; i 0) { + for (int j=0; j 0) { + throw new RuntimeException(); + } + } + + private static Vector classPathSegments = new Vector(); + + private static void addCharsets(Set charsets, final String packageName) + throws Exception { + + String classPath = + (String) java.security.AccessController.doPrivileged( + new sun.security.action.GetPropertyAction("sun.boot.class.path")); + String s = + (String) java.security.AccessController.doPrivileged( + new sun.security.action.GetPropertyAction("java.class.path")); + + // Search combined system and application class path + if (s != null && s.length() != 0) { + classPath += File.pathSeparator + s; + } + while (classPath != null && classPath.length() != 0) { + int i = classPath.lastIndexOf(java.io.File.pathSeparatorChar); + String dir = classPath.substring(i + 1); + if (i == -1) { + classPath = null; + } else { + classPath = classPath.substring(0, i); + } + classPathSegments.insertElementAt(dir, 0); + } + + // add extensions from the extension class loader + ClassLoader appLoader = Launcher.getLauncher().getClassLoader(); + URLClassLoader extLoader = (URLClassLoader) appLoader.getParent(); + URL[] urls = extLoader.getURLs(); + for (int i = 0; i < urls.length; i++) { + try { + URI uri = new URI(urls[i].toString()); + classPathSegments.insertElementAt(uri.getPath(), 0); + } catch (URISyntaxException e) { + } + } + + String[] classList = (String[]) + java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public Object run() { + return getClassList(packageName, ""); + } + }); + + for (int i = 0; i < classList.length; i++) { + try { + Class clazz = Class.forName(packageName + "." + classList[i]); + Class superclazz = clazz.getSuperclass(); + while (superclazz != null && !superclazz.equals(Object.class)) { + if (superclazz.equals(Charset.class)) { + charsets.add(clazz); + break; + } else { + superclazz = superclazz.getSuperclass(); + } + } + } catch (ClassNotFoundException e) { + } + } + } + + private static final char ZIPSEPARATOR = '/'; + + /** + * Walk through CLASSPATH and find class list from a package. + * The class names start with prefix string + * @param package name, class name prefix + * @return class list in an array of String + */ + private static String[] getClassList(String pkgName, String prefix) { + Vector listBuffer = new Vector(); + String packagePath = pkgName.replace('.', File.separatorChar) + + File.separatorChar; + String zipPackagePath = pkgName.replace('.', ZIPSEPARATOR) + + ZIPSEPARATOR; + for (int i = 0; i < classPathSegments.size(); i++){ + String onePath = (String) classPathSegments.elementAt(i); + File f = new File(onePath); + if (!f.exists()) + continue; + if (f.isFile()) + scanFile(f, zipPackagePath, listBuffer, prefix); + else if (f.isDirectory()) { + String fullPath; + if (onePath.endsWith(File.separator)) + fullPath = onePath + packagePath; + else + fullPath = onePath + File.separatorChar + packagePath; + File dir = new File(fullPath); + if (dir.exists() && dir.isDirectory()) + scanDir(dir, listBuffer, prefix); + } + } + String[] classNames = new String[listBuffer.size()]; + listBuffer.copyInto(classNames); + return classNames; + } + + private static void addClass (String className, Vector listBuffer, String prefix) { + if (className != null && className.startsWith(prefix) + && !listBuffer.contains(className)) + listBuffer.addElement(className); + } + + private static String midString(String str, String pre, String suf) { + String midStr; + if (str.startsWith(pre) && str.endsWith(suf)) + midStr = str.substring(pre.length(), str.length() - suf.length()); + else + midStr = null; + return midStr; + } + + private static void scanDir(File dir, Vector listBuffer, String prefix) { + String[] fileList = dir.list(); + for (int i = 0; i < fileList.length; i++) { + addClass(midString(fileList[i], "", ".class"), listBuffer, prefix); + } + } + + private static void scanFile(File f, String packagePath, Vector listBuffer, + String prefix) { + try { + ZipInputStream zipFile = new ZipInputStream(new FileInputStream(f)); + ZipEntry entry; + while ((entry = zipFile.getNextEntry()) != null) { + String eName = entry.getName(); + if (eName.startsWith(packagePath)) { + if (eName.endsWith(".class")) { + addClass(midString(eName, packagePath, ".class"), + listBuffer, prefix); + } + } + } + } catch (FileNotFoundException e) { + System.out.println("file not found:" + e); + } catch (IOException e) { + System.out.println("file IO Exception:" + e); + } catch (Exception e) { + System.out.println("Exception:" + e); + } + } +} diff --git a/jdk/test/java/nio/charset/Charset/NullCharsetName.java b/jdk/test/java/nio/charset/Charset/NullCharsetName.java new file mode 100644 index 00000000000..e21cf92b162 --- /dev/null +++ b/jdk/test/java/nio/charset/Charset/NullCharsetName.java @@ -0,0 +1,52 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @bug 4448594 + * @summary Ensure passing null to Charset.forName throws the correct exception + */ + +import java.io.*; +import java.nio.*; +import java.nio.charset.*; +import java.util.*; + + +public class NullCharsetName { + + public static void main(String[] args) throws Exception { + try { + Charset.forName(null); + } catch (Exception x) { + if (x instanceof IllegalArgumentException) { + System.err.println("Thrown as expected: " + x); + return; + } + throw new Exception("Incorrect exception: " + + x.getClass().getName(), + x); + } + throw new Exception("No exception thrown"); + } + +} diff --git a/jdk/test/java/nio/charset/Charset/RegisteredCharsets.java b/jdk/test/java/nio/charset/Charset/RegisteredCharsets.java new file mode 100644 index 00000000000..39cbc390dad --- /dev/null +++ b/jdk/test/java/nio/charset/Charset/RegisteredCharsets.java @@ -0,0 +1,1270 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @bug 4473201 4696726 4652234 4482298 4784385 4966197 4267354 5015668 + * @summary Check that registered charsets are actually registered + */ + +import java.io.*; +import java.nio.*; +import java.nio.charset.*; +import java.util.*; + +public class RegisteredCharsets { + + static String [] ianaRegistered = { + "US-ASCII", "UTF8", "Big5", "EUC-JP", + "GBK", "GB18030", "ISO-2022-KR", "ISO-2022-JP", + "GB2312", // IANA preferred name for "EUC-CN" + "ISO-8859-1", "ISO-8859-2", "ISO-8859-3", + "ISO-8859-4", "ISO-8859-5", "ISO-8859-6", + "ISO-8859-7", "ISO-8859-8", "ISO-8859-9", + "ISO-8859-13", "ISO-8859-15", "windows-1251", + "windows-1252", "windows-1253", "windows-1254", + "windows-1255", "windows-1256", "windows-31j", + "Shift_JIS", "JIS_X0201", "JIS_X0212-1990", + "TIS-620", "Big5-HKSCS", + "ISO-2022-CN", + "IBM850", + "IBM852", + "IBM855", + "IBM857", + "IBM860", + "IBM861", + "IBM862", + "IBM863", + "IBM864", + "IBM865", + "IBM866", + "IBM868", + "IBM869", + "IBM437", + "IBM775", + "IBM037", + "IBM1026", + "IBM273", + "IBM277", + "IBM278", + "IBM280", + "IBM284", + "IBM285", + "IBM297", + "IBM420", + "IBM424", + "IBM500", + "IBM-Thai", + "IBM870", + "IBM871", + "IBM918", + "IBM1047", + "IBM01140", + "IBM01141", + "IBM01142", + "IBM01143", + "IBM01144", + "IBM01145", + "IBM01146", + "IBM01147", + "IBM01148", + "IBM01149", + "IBM00858" }; + + static String [] ianaUnRegistered = { + "x-EUC-TW", "x-ISCII91", + "x-windows-949", "x-windows-950", + "x-mswin-936", "x-JIS0208", + "x-ISO-8859-11", + "x-windows-874", + "x-PCK", "x-JISAutoDetect", "x-Johab", + "x-MS950-HKSCS", + "x-Big5-Solaris", + "x-ISO-2022-CN-CNS", + "x-ISO-2022-CN-GB", + "x-MacArabic", + "x-MacCentralEurope", + "x-MacCroatian", + "x-MacCyrillic", + "x-MacDingbat", + "x-MacGreek", + "x-MacHebrew", + "x-MacIceland", + "x-MacRoman", + "x-MacRomania", + "x-MacSymbol", + "x-MacThai", + "x-MacTurkish", + "x-MacUkraine", + "x-IBM942", + "x-IBM942C", + "x-IBM943", + "x-IBM943C", + "x-IBM948", + "x-IBM950", + "x-IBM930", + "x-IBM935", + "x-IBM937", + "x-IBM856", + "x-IBM874", + "x-IBM737", + "x-IBM1006", + "x-IBM1046", + "x-IBM1098", + "x-IBM1025", + "x-IBM1112", + "x-IBM1122", + "x-IBM1123", + "x-IBM1124", + "x-IBM875", + "x-IBM921", + "x-IBM922", + "x-IBM1097", + "x-IBM949", + "x-IBM949C", + "x-IBM939", + "x-IBM933", + "x-IBM1381", + "x-IBM1383", + "x-IBM970", + "x-IBM964", + "x-IBM33722", + "x-IBM1006", + "x-IBM1046", + "x-IBM1097", + "x-IBM1098", + "x-IBM1112", + "x-IBM1122", + "x-IBM1123", + "x-IBM1124", + "x-IBM33722", + "x-IBM737", + "x-IBM856", + "x-IBM874", + "x-IBM875", + "x-IBM922", + "x-IBM933", + "x-IBM964" }; + + static void check(String csn, boolean testRegistered) throws Exception { + if (!Charset.forName(csn).isRegistered() && testRegistered) + throw new Exception("Not registered: " + csn); + else if (Charset.forName(csn).isRegistered() && !testRegistered) + throw new Exception("Registered: " + csn + "should be unregistered"); + } + + static void aliasCheck(String canonicalName, String[] aliasNames) throws Exception + { + for (int k = 0; k < aliasNames.length; k++ ) { + Charset cs = Charset.forName(aliasNames[k]); + if (!cs.name().equals(canonicalName)) { + throw new Exception("Unexpected Canonical name " + canonicalName); + } + } + } + + public static void main(String[] args) throws Exception { + + for (int i = 0; i < ianaRegistered.length ; i++) + check(ianaRegistered[i], true); + + for (int i = 0; i < ianaUnRegistered.length ; i++) + check(ianaUnRegistered[i], false); + + // Check aliases registered with IANA for all NIO supported + // Charset implementations. + // + // The aliases below are in sync with the IANA registered charset + // document at: http://www.iana.org/assignments/character-sets + // Last updated 7/25/2002 + + aliasCheck("US-ASCII", + new String[] {"ascii","ANSI_X3.4-1968", + "iso-ir-6","ANSI_X3.4-1986", "ISO_646.irv:1991", + "ASCII", "ISO646-US","us","IBM367","cp367", + "csASCII", "default"}); + + aliasCheck("UTF-8", + new String[] { + "UTF8", + "unicode-1-1-utf-8" + }); + + aliasCheck("UTF-16", + new String[] { + "UTF_16", + "utf16" + }); + + aliasCheck("UTF-16BE", + new String[] { + "UTF_16BE", + "ISO-10646-UCS-2", + "X-UTF-16BE", + "UnicodeBigUnmarked" + }); + + aliasCheck("UTF-16LE", + new String[] { + "UTF_16LE", + "X-UTF-16LE", + "UnicodeLittleUnmarked" + }); + + aliasCheck("Big5", + new String[] { + "csBig5" + }); + + aliasCheck("Big5-HKSCS", + new String[] { + "Big5_HKSCS", + "big5hk", + "big5-hkscs", + "big5-hkscs:unicode3.0", + "big5hkscs" + }); + + aliasCheck("x-MS950-HKSCS", + new String[] { + "MS950_HKSCS" + }); + + aliasCheck("GB18030", + new String[] { + "gb18030-2000" + }); + + aliasCheck("ISO-2022-KR", new String[] {"csISO2022KR"}); + aliasCheck("ISO-2022-JP", new String[] {"csISO2022JP"}); + aliasCheck("EUC-KR", new String[] { "csEUCKR"}); + aliasCheck("ISO-8859-1", + new String[] { + + // IANA aliases + "iso-ir-100", + "ISO_8859-1", + "latin1", + "l1", + "IBM819", + "cp819", + "csISOLatin1", + + // JDK historical aliases + "819", + "IBM-819", + "ISO8859_1", + "ISO_8859-1:1987", + "ISO_8859_1", + "8859_1", + "ISO8859-1", + + }); + + aliasCheck("ISO-8859-2", + new String[] { + "ISO_8859-2", + "ISO_8859-2:1987", + "iso-ir-101", + "latin2", + "l2", + "8859_2", + "iso_8859-2:1987", + "iso8859-2", + "ibm912", + "ibm-912", + "cp912", + "912", + "csISOLatin2"}); + + aliasCheck("ISO-8859-3", + new String[] {"latin3", + "ISO_8859-3:1988", + "iso-ir-109", + "l3", + "8859_3", + "iso_8859-3:1988", + "iso8859-3", + "ibm913", + "ibm-913", + "cp913", + "913", + "csISOLatin3"}); + + aliasCheck("ISO-8859-4", + new String[] {"csISOLatin4", + "ISO_8859-4:1988", + "iso-ir-110", + "latin4", + "8859_4", + "iso_8859-4:1988", + "iso8859-4", + "ibm914", + "ibm-914", + "cp914", + "914", + "l4"}); + + aliasCheck("ISO-8859-5", + new String[] { + "iso8859_5", // JDK historical + "8859_5", + "iso-ir-144", + "ISO_8859-5", + "ISO_8859-5:1988", + "ISO8859-5", + "cyrillic", + "ibm915", + "ibm-915", + "915", + "cp915", + "csISOLatinCyrillic" + }); + + aliasCheck("ISO-8859-6", + new String[] {"ISO_8859-6:1987", + "iso-ir-127", + "ISO_8859-6", + "ECMA-114", + "ASMO-708", + "arabic", + "8859_6", + "iso_8859-6:1987", + "iso8859-6", + "ibm1089", + "ibm-1089", + "cp1089", + "1089", + "csISOLatinArabic"}); + + aliasCheck("ISO-8859-7", + new String[] {"ISO_8859-7:1987", + "iso-ir-126", + "ISO_8859-7", + "ELOT_928", + "ECMA-118", + "greek", + "greek8", + "8859_7", + "iso_8859-7:1987", + "iso8859-7", + "ibm813", + "ibm-813", + "cp813", + "813", + "csISOLatinGreek"}); + + aliasCheck("ISO-8859-8", + new String[] { + "ISO_8859-8:1988", + "iso-ir-138", + "ISO_8859-8", + "hebrew", + "8859_8", + "iso_8859-8:1988", + "iso8859-8", + "ibm916", + "ibm-916", + "cp916", + "916", + "csISOLatinHebrew"}); + + aliasCheck("ISO-8859-9", + new String[] {"ISO_8859-9:1989", + "iso-ir-148", + "ISO_8859-9", + "latin5", + "l5", + "8859_9", + "iso8859-9", + "ibm920", + "ibm-920", + "cp920", + "920", + "csISOLatin5"}); + + aliasCheck("ISO-8859-13", + new String[] { + "iso8859_13", // JDK historical + "iso_8859-13", + "8859_13", + "ISO8859-13" + }); + + aliasCheck("ISO-8859-15", + new String[] { + // IANA alias + "ISO_8859-15", + // JDK historical aliases + "8859_15", + "ISO-8859-15", + "ISO_8859-15", + "ISO8859-15", + "ISO8859_15", + "IBM923", + "IBM-923", + "cp923", + "923", + "LATIN0", + "LATIN9", + "L9", + "csISOlatin0", + "csISOlatin9", + "ISO8859_15_FDIS" + + }); + + aliasCheck("JIS_X0212-1990", + new String[] { + "iso-ir-159", + "csISO159JISX02121990"}); + + aliasCheck("JIS_X0201", + new String[]{ + "X0201", + "csHalfWidthKatakana"}); + + aliasCheck("KOI8-R", + new String[] { + "KOI8_R", + "csKOI8R"}); + + aliasCheck("GBK", + new String[] { + "windows-936"}); + + aliasCheck("Shift_JIS", + new String[] { + "MS_Kanji", + "csShiftJIS"}); + + aliasCheck("EUC-JP", + new String[] { + "Extended_UNIX_Code_Packed_Format_for_Japanese", + "csEUCPkdFmtJapanese"}); + + aliasCheck("Big5", new String[] {"csBig5"}); + + aliasCheck("windows-31j", new String[] {"csWindows31J"}); + + aliasCheck("x-iso-8859-11", + new String[] { "iso-8859-11", "iso8859_11" }); + + aliasCheck("windows-1250", + new String[] { + "cp1250", + "cp5346" + }); + + aliasCheck("windows-1251", + new String[] { + "cp1251", + "cp5347", + "ansi-1251" + }); + + aliasCheck("windows-1252", + new String[] { + "cp1252", + "cp5348" + }); + + aliasCheck("windows-1253", + new String[] { + "cp1253", + "cp5349" + }); + + aliasCheck("windows-1254", + new String[] { + "cp1254", + "cp5350" + }); + + aliasCheck("windows-1255", + new String[] { + "cp1255" + }); + + aliasCheck("windows-1256", + new String[] { + "cp1256" + }); + + aliasCheck("windows-1257", + new String[] { + "cp1257", + "cp5353" + }); + + aliasCheck("windows-1258", + new String[] { + "cp1258" + }); + + aliasCheck("x-windows-874", + new String[] { + "ms874", "ms-874", "windows-874" }); + + aliasCheck("GB2312", + new String[] { + "x-EUC-CN", + "gb2312-80", + "gb2312-1980", + "euc-cn", + "euccn" }); + + aliasCheck("x-IBM942" , + new String[] { + "cp942", // JDK historical + "ibm942", + "ibm-942", + "942" + }); + + aliasCheck("x-IBM942C" , + new String[] { + "cp942C", // JDK historical + "ibm942C", + "ibm-942C", + "942C" + } ); + + aliasCheck("x-IBM943" , + new String[] { + "cp943", // JDK historical + "ibm943", + "ibm-943", + "943" + } ); + + aliasCheck("x-IBM943C" , + new String[] { + "cp943c", // JDK historical + "ibm943C", + "ibm-943C", + "943C" + } ); + + aliasCheck("x-IBM948" , + new String[] { + "cp948", // JDK historical + "ibm948", + "ibm-948", + "948" + } ); + + aliasCheck("x-IBM950" , + new String[] { + "cp950", // JDK historical + "ibm950", + "ibm-950", + "950" + } ); + + aliasCheck("x-IBM930" , + new String[] { + "cp930", // JDK historical + "ibm930", + "ibm-930", + "930" + } ); + + aliasCheck("x-IBM935" , + new String[] { + "cp935", // JDK historical + "ibm935", + "ibm-935", + "935" + } ); + + aliasCheck("x-IBM937" , + new String[] { + "cp937", // JDK historical + "ibm937", + "ibm-937", + "937" + } ); + + aliasCheck("IBM850" , + new String[] { + "cp850", // JDK historical + "ibm-850", + "ibm850", + "850", + "cspc850multilingual" + } ); + + aliasCheck("IBM852" , + new String[] { + "cp852", // JDK historical + "ibm852", + "ibm-852", + "852", + "csPCp852" + } ); + + aliasCheck("IBM855" , + new String[] { + "cp855", // JDK historical + "ibm-855", + "ibm855", + "855", + "cspcp855" + } ); + + aliasCheck("x-IBM856" , + new String[] { + "cp856", // JDK historical + "ibm-856", + "ibm856", + "856" + } ); + + aliasCheck("IBM857" , + new String[] { + "cp857", // JDK historical + "ibm857", + "ibm-857", + "857", + "csIBM857" + } ); + + aliasCheck("IBM860" , + new String[] { + "cp860", // JDK historical + "ibm860", + "ibm-860", + "860", + "csIBM860" + } ); + aliasCheck("IBM861" , + new String[] { + "cp861", // JDK historical + "ibm861", + "ibm-861", + "861", + "csIBM861" + } ); + + aliasCheck("IBM862" , + new String[] { + "cp862", // JDK historical + "ibm862", + "ibm-862", + "862", + "csIBM862" + } ); + + aliasCheck("IBM863" , + new String[] { + "cp863", // JDK historical + "ibm863", + "ibm-863", + "863", + "csIBM863" + } ); + + aliasCheck("IBM864" , + new String[] { + "cp864", // JDK historical + "ibm864", + "ibm-864", + "864", + "csIBM864" + } ); + + aliasCheck("IBM865" , + new String[] { + "cp865", // JDK historical + "ibm865", + "ibm-865", + "865", + "csIBM865" + } ); + + aliasCheck("IBM866" , new String[] { + "cp866", // JDK historical + "ibm866", + "ibm-866", + "866", + "csIBM866" + } ); + aliasCheck("IBM868" , + new String[] { + "cp868", // JDK historical + "ibm868", + "ibm-868", + "868", + "cp-ar", + "csIBM868" + } ); + + aliasCheck("IBM869" , + new String[] { + "cp869", // JDK historical + "ibm869", + "ibm-869", + "869", + "cp-gr", + "csIBM869" + } ); + + aliasCheck("IBM437" , + new String[] { + "cp437", // JDK historical + "ibm437", + "ibm-437", + "437", + "cspc8codepage437", + "windows-437" + } ); + + aliasCheck("x-IBM874" , + new String[] { + "cp874", // JDK historical + "ibm874", + "ibm-874", + "874" + } ); + aliasCheck("x-IBM737" , + new String[] { + "cp737", // JDK historical + "ibm737", + "ibm-737", + "737" + } ); + + aliasCheck("IBM775" , + new String[] { + "cp775", // JDK historical + "ibm775", + "ibm-775", + "775" + } ); + + aliasCheck("x-IBM921" , + new String[] { + "cp921", // JDK historical + "ibm921", + "ibm-921", + "921" + } ); + + aliasCheck("x-IBM1006" , + new String[] { + "cp1006", // JDK historical + "ibm1006", + "ibm-1006", + "1006" + } ); + + aliasCheck("x-IBM1046" , + new String[] { + "cp1046", // JDK historical + "ibm1046", + "ibm-1046", + "1046" + } ); + + aliasCheck("IBM1047" , + new String[] { + "cp1047", // JDK historical + "ibm-1047", + "1047" + } ); + + aliasCheck("x-IBM1098" , + new String[] { + "cp1098", // JDK historical + "ibm1098", + "ibm-1098", + "1098", + } ); + + aliasCheck("IBM037" , + new String[] { + "cp037", // JDK historical + "ibm037", + "csIBM037", + "cs-ebcdic-cp-us", + "cs-ebcdic-cp-ca", + "cs-ebcdic-cp-wt", + "cs-ebcdic-cp-nl", + "ibm-037", + "ibm-37", + "cpibm37", + "037" + } ); + + aliasCheck("x-IBM1025" , + new String[] { + "cp1025", // JDK historical + "ibm1025", + "ibm-1025", + "1025" + } ); + + aliasCheck("IBM1026" , + new String[] { + "cp1026", // JDK historical + "ibm1026", + "ibm-1026", + "1026" + } ); + + aliasCheck("x-IBM1112" , + new String[] { + "cp1112", // JDK historical + "ibm1112", + "ibm-1112", + "1112" + } ); + + aliasCheck("x-IBM1122" , + new String[] { + "cp1122", // JDK historical + "ibm1122", + "ibm-1122", + "1122" + } ); + + aliasCheck("x-IBM1123" , + new String[] { + "cp1123", // JDK historical + "ibm1123", + "ibm-1123", + "1123" + } ); + + aliasCheck("x-IBM1124" , + new String[] { + "cp1124", // JDK historical + "ibm1124", + "ibm-1124", + "1124" + } ); + + aliasCheck("IBM273" , + new String[] { + "cp273", // JDK historical + "ibm273", + "ibm-273", + "273" + } ); + + aliasCheck("IBM277" , + new String[] { + "cp277", // JDK historical + "ibm277", + "ibm-277", + "277" + } ); + + aliasCheck("IBM278" , + new String[] { + "cp278", // JDK historical + "ibm278", + "ibm-278", + "278", + "ebcdic-sv", + "ebcdic-cp-se", + "csIBM278" + } ); + + aliasCheck("IBM280" , + new String[] { + "cp280", // JDK historical + "ibm280", + "ibm-280", + "280" + } ); + + aliasCheck("IBM284" , + new String[] { + "cp284", // JDK historical + "ibm284", + "ibm-284", + "284", + "csIBM284", + "cpibm284" + } ); + + aliasCheck("IBM285" , + new String[] { + "cp285", // JDK historical + "ibm285", + "ibm-285", + "285", + "ebcdic-cp-gb", + "ebcdic-gb", + "csIBM285", + "cpibm285" + } ); + + aliasCheck("IBM297" , + new String[] { + "cp297", // JDK historical + "ibm297", + "ibm-297", + "297", + "ebcdic-cp-fr", + "cpibm297", + "csIBM297", + } ); + + aliasCheck("IBM420" , + new String[] { + "cp420", // JDK historical + "ibm420", + "ibm-420", + "ebcdic-cp-ar1", + "420", + "csIBM420" + } ); + + aliasCheck("IBM424" , + new String[] { + "cp424", // JDK historical + "ibm424", + "ibm-424", + "424", + "ebcdic-cp-he", + "csIBM424" + } ); + + aliasCheck("IBM500" , + new String[] { + "cp500", // JDK historical + "ibm500", + "ibm-500", + "500", + "ebcdic-cp-ch", + "ebcdic-cp-bh", + "csIBM500" + } ); + + aliasCheck("IBM-Thai" , + new String[] { + "cp838", // JDK historical + "ibm838", + "ibm-838", + "ibm838", + "838" + } ); + + aliasCheck("IBM870" , + new String[] { + "cp870", // JDK historical + "ibm870", + "ibm-870", + "870", + "ebcdic-cp-roece", + "ebcdic-cp-yu", + "csIBM870" + } ); + + aliasCheck("IBM871" , + new String[] { + "cp871", // JDK historical + "ibm871", + "ibm-871", + "871", + "ebcdic-cp-is", + "csIBM871" + } ); + + aliasCheck("x-IBM875" , + new String[] { + "cp875", // JDK historical + "ibm875", + "ibm-875", + "875" + } ); + + aliasCheck("IBM918" , + new String[] { + "cp918", // JDK historical + "ibm-918", + "918", + "ebcdic-cp-ar2" + } ); + + aliasCheck("x-IBM922" , + new String[] { + "cp922", // JDK historical + "ibm922", + "ibm-922", + "922" + } ); + + aliasCheck("x-IBM1097" , + new String[] { + "cp1097", // JDK historical + "ibm1097", + "ibm-1097", + "1097" + } ); + + aliasCheck("x-IBM949" , + new String[] { + "cp949", // JDK historical + "ibm949", + "ibm-949", + "949" + } ); + + aliasCheck("x-IBM949C" , + new String[] { + "cp949C", // JDK historical + "ibm949C", + "ibm-949C", + "949C" + } ); + + aliasCheck("x-IBM939" , + new String[] { + "cp939", // JDK historical + "ibm939", + "ibm-939", + "939" + } ); + + aliasCheck("x-IBM933" , + new String[] { + "cp933", // JDK historical + "ibm933", + "ibm-933", + "933" + } ); + + aliasCheck("x-IBM1381" , + new String[] { + "cp1381", // JDK historical + "ibm1381", + "ibm-1381", + "1381" + } ); + + aliasCheck("x-IBM1383" , + new String[] { + "cp1383", // JDK historical + "ibm1383", + "ibm-1383", + "1383" + } ); + + aliasCheck("x-IBM970" , + new String[] { + "cp970", // JDK historical + "ibm970", + "ibm-970", + "ibm-eucKR", + "970" + } ); + + aliasCheck("x-IBM964" , + new String[] { + "cp964", // JDK historical + "ibm964", + "ibm-964", + "964" + } ); + + aliasCheck("x-IBM33722" , + new String[] { + "cp33722", // JDK historical + "ibm33722", + "ibm-33722", + "ibm-5050", // from IBM alias list + "ibm-33722_vascii_vpua", // from IBM alias list + "33722" + } ); + + aliasCheck("IBM01140" , + new String[] { + "cp1140", // JDK historical + "ccsid01140", + "cp01140", + // "ebcdic-us-037+euro" + } ); + + aliasCheck("IBM01141" , + new String[] { + "cp1141", // JDK historical + "ccsid01141", + "cp01141", + // "ebcdic-de-273+euro" + } ); + + aliasCheck("IBM01142" , + new String[] { + "cp1142", // JDK historical + "ccsid01142", + "cp01142", + // "ebcdic-no-277+euro", + // "ebcdic-dk-277+euro" + } ); + + aliasCheck("IBM01143" , + new String[] { + "cp1143", // JDK historical + "ccsid01143", + "cp01143", + // "ebcdic-fi-278+euro", + // "ebcdic-se-278+euro" + } ); + + aliasCheck("IBM01144" , + new String[] { + "cp1144", // JDK historical + "ccsid01144", + "cp01144", + // "ebcdic-it-280+euro" + } ); + + aliasCheck("IBM01145" , + new String[] { + "cp1145", // JDK historical + "ccsid01145", + "cp01145", + // "ebcdic-es-284+euro" + } ); + + aliasCheck("IBM01146" , + new String[] { + "cp1146", // JDK historical + "ccsid01146", + "cp01146", + // "ebcdic-gb-285+euro" + } ); + + aliasCheck("IBM01147" , + new String[] { + "cp1147", // JDK historical + "ccsid01147", + "cp01147", + // "ebcdic-fr-277+euro" + } ); + + aliasCheck("IBM01148" , + new String[] { + "cp1148", // JDK historical + "ccsid01148", + "cp01148", + // "ebcdic-international-500+euro" + } ); + + aliasCheck("IBM01149" , + new String[] { + "cp1149", // JDK historical + "ccsid01149", + "cp01149", + // "ebcdic-s-871+euro" + } ); + + aliasCheck("IBM00858" , + new String[] { + "cp858", // JDK historical + "ccsid00858", + "cp00858", + // "PC-Multilingual-850+euro" + } ); + + aliasCheck("x-MacRoman", + new String[] { + "MacRoman" // JDK historical + }); + + aliasCheck("x-MacCentralEurope", + new String[] { + "MacCentralEurope" // JDK historical + }); + + aliasCheck("x-MacCroatian", + new String[] { + "MacCroatian" // JDK historical + }); + + + aliasCheck("x-MacCroatian", + new String[] { + "MacCroatian" // JDK historical + }); + + + aliasCheck("x-MacGreek", + new String[] { + "MacGreek" // JDK historical + }); + + aliasCheck("x-MacCyrillic", + new String[] { + "MacCyrillic" // JDK historical + }); + + aliasCheck("x-MacUkraine", + new String[] { + "MacUkraine" // JDK historical + }); + + aliasCheck("x-MacTurkish", + new String[] { + "MacTurkish" // JDK historical + }); + + aliasCheck("x-MacArabic", + new String[] { + "MacArabic" // JDK historical + }); + + aliasCheck("x-MacHebrew", + new String[] { + "MacHebrew" // JDK historical + }); + + aliasCheck("x-MacIceland", + new String[] { + "MacIceland" // JDK historical + }); + + aliasCheck("x-MacRomania", + new String[] { + "MacRomania" // JDK historical + }); + + aliasCheck("x-MacThai", + new String[] { + "MacThai" // JDK historical + }); + + aliasCheck("x-MacSymbol", + new String[] { + "MacSymbol" // JDK historical + }); + + aliasCheck("x-MacDingbat", + new String[] { + "MacDingbat" // JDK historical + }); + } +} diff --git a/jdk/test/java/nio/charset/Charset/default.sh b/jdk/test/java/nio/charset/Charset/default.sh new file mode 100644 index 00000000000..bf51d2ee5a5 --- /dev/null +++ b/jdk/test/java/nio/charset/Charset/default.sh @@ -0,0 +1,97 @@ +#!/bin/sh + +# +# Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# @test +# @bug 4772857 +# @summary Unit test for Charset.defaultCharset +# +# @build Default +# @run shell default.sh +# + +# Command-line usage: sh default.sh [/path/to/build] + +if [ -z "$TESTJAVA" ]; then + if [ $# -lt 1 ]; then exit 1; fi + TESTJAVA=$1; shift + TESTSRC=`pwd` + TESTCLASSES=`pwd` +fi + +s="`uname -s`" +if [ "$s" != Linux -a "$s" != SunOS ]; then + echo "$s: locale command not supported on this system, skipping..." + exit 0 +fi + +JAVA=$TESTJAVA/bin/java + +tolower() { + echo "$1" | tr '[A-Z]' '[a-z]' +} + +go() { + + L="$1" + shift + if [ "x`locale -a | grep \^$L\$`" != "x$L" ]; then + echo "$L: Locale not supported, skipping..." + return + fi + + ecs="$1"; shift + + echo -n "$L: " + cs="`LC_ALL=$L $JAVA -cp $TESTCLASSES Default`" + if [ $? != 0 ]; then + exit 1 + elif [ "`tolower $cs`" != "`tolower $ecs`" ]; then + echo "$cs, expected $ecs -- ERROR" + exit 1 + else + echo "$cs, as expected" + fi + +} + +go en_US iso-8859-1 +go ja_JP.utf8 utf-8 +go tr_TR iso-8859-9 +go C us-ascii + +if [ "$s" = Linux ]; then + go ja_JP x-euc-jp-linux + go ja_JP.eucjp x-euc-jp-linux + go ja_JP.ujis x-euc-jp-linux + go ja_JP.utf8 utf-8 +fi + +# Solaris +if [ "$s" = SunOS ]; then + go ja x-eucjp-open + go ja_JP.eucJP x-eucjp-open + go ja_JP.PCK x-PCK + go ja_JP.UTF-8 utf-8 +fi diff --git a/jdk/test/java/nio/charset/CharsetDecoder/AverageMax.java b/jdk/test/java/nio/charset/CharsetDecoder/AverageMax.java new file mode 100644 index 00000000000..78ed606469a --- /dev/null +++ b/jdk/test/java/nio/charset/CharsetDecoder/AverageMax.java @@ -0,0 +1,96 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @bug 4853350 + * @summary Ensure that averages do not exceed maxima + * + * @build AverageMax + * @run main AverageMax + * @run main/othervm -Dsun.nio.cs.bugLevel=1.4 AverageMax + */ + +import java.nio.*; +import java.nio.charset.*; + + +public class AverageMax { + + static boolean compat; + + static abstract class Test { + + public abstract void go() throws Exception; + + Test() throws Exception { + try { + go(); + } catch (Exception x) { + if (compat) { + throw new Exception("Exception thrown", x); + } + if (x instanceof IllegalArgumentException) { + System.err.println("Thrown as expected: " + x); + return; + } + throw new Exception("Incorrect exception: " + + x.getClass().getName(), + x); + } + if (!compat) + throw new Exception("No exception thrown"); + } + + } + + public static void main(String[] args) throws Exception { + + // If sun.nio.cs.bugLevel == 1.4 then we want the 1.4 behavior + String bl = System.getProperty("sun.nio.cs.bugLevel"); + compat = (bl != null && bl.equals("1.4")); + final Charset ascii = Charset.forName("US-ASCII"); + + new Test() { + public void go() throws Exception { + new CharsetDecoder(ascii, 3.9f, 1.2f) { + protected CoderResult decodeLoop(ByteBuffer in, + CharBuffer out) + { + return null; + } + }; + }}; + + new Test() { + public void go() throws Exception { + new CharsetEncoder(ascii, 3.9f, 1.2f) { + protected CoderResult encodeLoop(CharBuffer in, + ByteBuffer out) + { + return null; + } + }; + }}; + } + +} diff --git a/jdk/test/java/nio/charset/CharsetDecoder/EmptyInput.java b/jdk/test/java/nio/charset/CharsetDecoder/EmptyInput.java new file mode 100644 index 00000000000..dcf694756a7 --- /dev/null +++ b/jdk/test/java/nio/charset/CharsetDecoder/EmptyInput.java @@ -0,0 +1,48 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @bug 4400697 + * @summary Ensure that CharsetDecoder.decode throws BUE on empty input + */ + +import java.nio.*; +import java.nio.charset.*; + + +public class EmptyInput { + + public static void main(String[] args) throws Exception { + ByteBuffer bb = ByteBuffer.allocate(10); + bb.flip(); + CharsetDecoder cd = Charset.forName("US-ASCII").newDecoder(); + try { + cd.decode(bb, CharBuffer.allocate(10), true).throwException(); + } catch (BufferUnderflowException x) { + System.err.println("BufferUnderflowException thrown as expected"); + return; + } + throw new Exception("BufferUnderflowException not thrown"); + } + +} diff --git a/jdk/test/java/nio/charset/CharsetEncoder/CanEncode.java b/jdk/test/java/nio/charset/CharsetEncoder/CanEncode.java new file mode 100644 index 00000000000..fc8ad14f9f7 --- /dev/null +++ b/jdk/test/java/nio/charset/CharsetEncoder/CanEncode.java @@ -0,0 +1,95 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @bug 4821213 + * @summary Unit test for CharsetEncoder.canEncode methods + */ + +import java.io.*; +import java.nio.*; +import java.nio.charset.*; + + +public class CanEncode { + + private static int errors = 0; + private static PrintStream out = System.err; + + private static void wrong(CharsetEncoder ce, boolean can, String what) { + out.println(ce.charset().name() + + ": Wrong answer for " + what + + ": " + !can); + errors++; + } + + private static void ck(CharsetEncoder ce, char c, boolean can) + throws Exception + { + if (ce.canEncode(c) != can) + wrong(ce, can, + ("'" + c + "' (0x" + + Integer.toHexString(c & 0xffff) + ")")); + } + + private static void ck(CharsetEncoder ce, String s, boolean can) + throws Exception + { + if (ce.canEncode(CharBuffer.wrap(s.toCharArray())) != can) + wrong(ce, can, "array \"" + s + "\""); + if (ce.canEncode(CharBuffer.wrap(s)) != can) + wrong(ce, can, "buffer \"" + s + "\""); + } + + private static void test(String csn) throws Exception { + + Charset cs = Charset.forName(csn); + CharsetEncoder ce = cs.newEncoder(); + + if (cs.name().equals("US-ASCII")) { + ck(ce, 'x', true); + ck(ce, '\u00B6', false); + ck(ce, "x", true); + ck(ce, "\u00B6", false); + ck(ce, "xyzzy", true); + ck(ce, "xy\u00B6", false); + } + + // Unpaired surrogates should never be encodable + ck(ce, '\ud800', false); + ck(ce, '\ud801', false); + ck(ce, '\udffe', false); + ck(ce, '\udfff', false); + ck(ce, "\ud800", false); + ck(ce, "\ud801", false); + ck(ce, "\udffe", false); + ck(ce, "\udfff", false); + + } + + public static void main(String[] args) throws Exception { + test("US-ASCII"); + test("UTF-8"); + } + +} diff --git a/jdk/test/java/nio/charset/CharsetEncoder/Flush.java b/jdk/test/java/nio/charset/CharsetEncoder/Flush.java new file mode 100644 index 00000000000..4f510553274 --- /dev/null +++ b/jdk/test/java/nio/charset/CharsetEncoder/Flush.java @@ -0,0 +1,113 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @bug 6227608 + * @summary Test proper handling of flush() + * @author Martin Buchholz + */ + +import java.util.*; +import java.io.*; +import java.nio.*; +import java.nio.charset.*; + +public class Flush { + private static byte[] contents(ByteBuffer bb) { + byte[] contents = new byte[bb.position()]; + ((ByteBuffer)(bb.duplicate().flip())).get(contents); + return contents; + } + + private static ByteBuffer extend(ByteBuffer bb) { + ByteBuffer x = ByteBuffer.allocate(2*bb.capacity()+10); + bb.flip(); + x.put(bb); + return x; + } + + private static void realMain(String[] args) throws Throwable { + // A japanese character should decode as a 3-byte + // switch-to-japanese escape sequence, followed by a 2-byte + // encoding of the char itself, followed by a 3-byte return to + // ASCII escape sequence. + char[] jis0208 = {'\u3001'}; + CharBuffer cb = CharBuffer.wrap(jis0208); + ByteBuffer bb = ByteBuffer.allocate(6); + CharsetEncoder enc = Charset.forName("ISO-2022-JP").newEncoder(); + + check(enc.encode(cb, bb, true).isUnderflow()); + + System.out.println(Arrays.toString(contents(bb))); + check(! cb.hasRemaining()); + equal(contents(bb).length, 3 + 2); + equal(bb.get(0), (byte)0x1b); + + //---------------------------------------------------------------- + // We must be able to recover if flush() returns OVERFLOW + //---------------------------------------------------------------- + check(enc.flush(bb).isOverflow()); + check(enc.flush(bb).isOverflow()); + equal(contents(bb).length, 3 + 2); + + bb = extend(bb); + + check(enc.flush(bb).isUnderflow()); + equal(bb.get(3 + 2), (byte)0x1b); + System.out.println(Arrays.toString(contents(bb))); + equal(contents(bb).length, 3 + 2 + 3); + + //---------------------------------------------------------------- + // A final redundant flush() is a no-op + //---------------------------------------------------------------- + check(enc.flush(bb).isUnderflow()); + check(enc.flush(bb).isUnderflow()); + equal(contents(bb).length, 3 + 2 + 3); + + //---------------------------------------------------------------- + // CharsetEncoder.encode(ByteBuffer) must call flush(ByteBuffer) + //---------------------------------------------------------------- + bb = enc.encode(CharBuffer.wrap(jis0208)); + byte[] expected = "\u001b$B!\"\u001b(B".getBytes("ASCII"); + byte[] contents = new byte[bb.limit()]; bb.get(contents); + check(Arrays.equals(contents, expected)); + } + + //--------------------- Infrastructure --------------------------- + static volatile int passed = 0, failed = 0; + static void pass() { passed++; } + static void fail() { failed++; Thread.dumpStack(); } + static void fail(String msg) { System.out.println(msg); fail(); } + static void unexpected(Throwable t) { failed++; t.printStackTrace(); } + static void check(boolean cond) { if (cond) pass(); else fail(); } + static void equal(Object x, Object y) { + if (x == null ? y == null : x.equals(y)) pass(); + else {System.out.println(x + " not equal to " + y); fail(); }} + + public static void main(String[] args) throws Throwable { + try { realMain(args); } catch (Throwable t) { unexpected(t); } + + System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); + if (failed > 0) throw new Exception("Some tests failed"); + } +} diff --git a/jdk/test/java/nio/charset/RemovingSunIO/SunioAlias.java b/jdk/test/java/nio/charset/RemovingSunIO/SunioAlias.java new file mode 100644 index 00000000000..08838d1dc22 --- /dev/null +++ b/jdk/test/java/nio/charset/RemovingSunIO/SunioAlias.java @@ -0,0 +1,823 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + @bug 4454622 + @summary Check if all supported sun.io encoding names are supported in nio.charset + */ + +import java.util.HashMap; +import java.util.Set; +import java.io.UnsupportedEncodingException; +import java.nio.charset.*; + +public class SunioAlias { + public static void main(String argv[]) throws UnsupportedEncodingException { + Set keys = aliasTable.keySet(); + String s = "testing string"; + boolean failed = false; + for (String alias : keys) { + /* See if StringCoding works correctly without sun.io package */ + try { + byte[] bs= s.getBytes(alias); + new String(bs, alias); + + Charset csAlias = Charset.forName(alias); + Charset csName = Charset.forName(aliasTable.get(alias)); + if (csName != csAlias) { + System.out.printf("Alias %s and %s is NOT the same charset in nio\n", + alias, aliasTable.get(alias)); + } + } catch (UnsupportedEncodingException e) { + System.out.printf("Alias %s is UnsupportedEncoding\n", alias); + failed = true; + } catch (IllegalCharsetNameException e) { + System.out.printf("Alias %s is IllegalCharsetName\n", alias); + failed = true; + } + } + if (failed) + throw new UnsupportedEncodingException ("sun.io encoding names are not supported in nio.charset!"); + } + //aliasTable is copy/pasted from sun.io.CharacterEncoding.java + + private static HashMap aliasTable; + static { + aliasTable = new HashMap(460, 1.0f); + + /* known failed names... TBD + // JIS-defined Shift JIS + aliasTable.put("\u30b7\u30d5\u30c8\u7b26\u53f7\u5316\u8868\u73fe", + "SJIS"); + // Specialized auto-detection for Japanese charsets + aliasTable.put("jis auto detect", "JISAutoDetect"); + // MIBenum: 1010 + aliasTable.put("unicode-1-1", "UnicodeBigUnmarked"); + */ + aliasTable.put("unicode", "UTF-16"); + aliasTable.put("cspc862latinhebrew", "Cp862"); + aliasTable.put("cp-is", "Cp861"); + /* + // X11 Compound Text + aliasTable.put("x-compound-text", "COMPOUND_TEXT"); + aliasTable.put("x11-compound_text", "COMPOUND_TEXT"); + */ + aliasTable.put("us-ascii", "ASCII"); + aliasTable.put("ascii", "ASCII"); + aliasTable.put("646", "ASCII"); // Solaris POSIX locale + aliasTable.put("iso_646.irv:1983", "ASCII"); // Linux POSIX locale + aliasTable.put("ansi_x3.4-1968", "ASCII"); // Caldera linux + aliasTable.put("iso646-us", "ASCII"); + aliasTable.put("default", "ASCII"); // compatibility with obsolete "Default" converters + aliasTable.put("ascii7", "ASCII"); // compatibility with obsolete "Default" converters + + // Core encodings + aliasTable.put("8859_1", "ISO8859_1"); + aliasTable.put("iso8859_1", "ISO8859_1"); + aliasTable.put("utf-8", "UTF8"); + aliasTable.put("utf8", "UTF8"); + aliasTable.put("utf-16le", "UnicodeLittleUnmarked"); + + // Standard encodings used on Solaris and Linux + aliasTable.put("iso8859-1", "ISO8859_1"); + aliasTable.put("iso8859-2", "ISO8859_2"); + aliasTable.put("iso8859-4", "ISO8859_4"); + aliasTable.put("iso8859-5", "ISO8859_5"); + aliasTable.put("iso8859-6", "ISO8859_6"); + aliasTable.put("iso8859-8", "ISO8859_8"); + aliasTable.put("iso8859-9", "ISO8859_9"); + aliasTable.put("iso8859-13", "ISO8859_13"); + aliasTable.put("iso8859-15", "ISO8859_15"); + aliasTable.put("5601", "EUC_KR"); + aliasTable.put("ansi-1251", "Cp1251"); + aliasTable.put("big5", "Big5"); + aliasTable.put("big5hk", "Big5_HKSCS"); + aliasTable.put("eucjp", "EUC_JP"); + aliasTable.put("cns11643", "EUC_TW"); + aliasTable.put("gb2312", "EUC_CN"); + aliasTable.put("gb18030", "GB18030"); + aliasTable.put("gbk", "GBK"); + aliasTable.put("koi8-r", "KOI8_R"); + aliasTable.put("tis620.2533", "TIS620"); + + // Windows encodings + aliasTable.put("cp1250", "Cp1250"); + aliasTable.put("cp1251", "Cp1251"); + aliasTable.put("cp1252", "Cp1252"); + aliasTable.put("cp1253", "Cp1253"); + aliasTable.put("cp1254", "Cp1254"); + aliasTable.put("cp1255", "Cp1255"); + aliasTable.put("cp1256", "Cp1256"); + aliasTable.put("cp1257", "Cp1257"); + aliasTable.put("cp1258", "Cp1258"); + aliasTable.put("ms874", "MS874"); + aliasTable.put("ms932", "MS932"); + aliasTable.put("ms949", "MS949"); + aliasTable.put("ms950", "MS950"); + aliasTable.put("ms1361", "MS1361"); + + // MIBenum: 4 + aliasTable.put("8859_1", "ISO8859_1"); + aliasTable.put("iso_8859-1:1987", "ISO8859_1"); + aliasTable.put("iso-ir-100", "ISO8859_1"); + aliasTable.put("iso_8859-1", "ISO8859_1"); + aliasTable.put("iso-8859-1", "ISO8859_1"); + aliasTable.put("iso8859-1", "ISO8859_1"); + aliasTable.put("latin1", "ISO8859_1"); + aliasTable.put("l1", "ISO8859_1"); + aliasTable.put("ibm819", "ISO8859_1"); + aliasTable.put("ibm-819", "ISO8859_1"); + aliasTable.put("cp819", "ISO8859_1"); + aliasTable.put("819", "ISO8859_1"); + aliasTable.put("csisolatin1", "ISO8859_1"); + + // MIBenum: 5 + aliasTable.put("8859_2", "ISO8859_2"); + aliasTable.put("iso_8859-2:1987", "ISO8859_2"); + aliasTable.put("iso-ir-101", "ISO8859_2"); + aliasTable.put("iso_8859-2", "ISO8859_2"); + aliasTable.put("iso-8859-2", "ISO8859_2"); + aliasTable.put("iso8859-2", "ISO8859_2"); + aliasTable.put("latin2", "ISO8859_2"); + aliasTable.put("l2", "ISO8859_2"); + aliasTable.put("ibm912", "ISO8859_2"); + aliasTable.put("ibm-912", "ISO8859_2"); + aliasTable.put("cp912", "ISO8859_2"); + aliasTable.put("912", "ISO8859_2"); + aliasTable.put("csisolatin2", "ISO8859_2"); + + // MIBenum: 6 + aliasTable.put("8859_3", "ISO8859_3"); + aliasTable.put("iso_8859-3:1988", "ISO8859_3"); + aliasTable.put("iso-ir-109", "ISO8859_3"); + aliasTable.put("iso_8859-3", "ISO8859_3"); + aliasTable.put("iso-8859-3", "ISO8859_3"); + aliasTable.put("iso8859-3", "ISO8859_3"); + aliasTable.put("latin3", "ISO8859_3"); + aliasTable.put("l3", "ISO8859_3"); + aliasTable.put("ibm913", "ISO8859_3"); + aliasTable.put("ibm-913", "ISO8859_3"); + aliasTable.put("cp913", "ISO8859_3"); + aliasTable.put("913", "ISO8859_3"); + aliasTable.put("csisolatin3", "ISO8859_3"); + + // MIBenum: 7 + aliasTable.put("8859_4", "ISO8859_4"); + aliasTable.put("iso_8859-4:1988", "ISO8859_4"); + aliasTable.put("iso-ir-110", "ISO8859_4"); + aliasTable.put("iso_8859-4", "ISO8859_4"); + aliasTable.put("iso-8859-4", "ISO8859_4"); + aliasTable.put("iso8859-4", "ISO8859_4"); + aliasTable.put("latin4", "ISO8859_4"); + aliasTable.put("l4", "ISO8859_4"); + aliasTable.put("ibm914", "ISO8859_4"); + aliasTable.put("ibm-914", "ISO8859_4"); + aliasTable.put("cp914", "ISO8859_4"); + aliasTable.put("914", "ISO8859_4"); + aliasTable.put("csisolatin4", "ISO8859_4"); + + // MIBenum: 8 + aliasTable.put("8859_5", "ISO8859_5"); + aliasTable.put("iso_8859-5:1988", "ISO8859_5"); + aliasTable.put("iso-ir-144", "ISO8859_5"); + aliasTable.put("iso_8859-5", "ISO8859_5"); + aliasTable.put("iso-8859-5", "ISO8859_5"); + aliasTable.put("iso8859-5", "ISO8859_5"); + aliasTable.put("cyrillic", "ISO8859_5"); + aliasTable.put("csisolatincyrillic", "ISO8859_5"); + aliasTable.put("ibm915", "ISO8859_5"); + aliasTable.put("ibm-915", "ISO8859_5"); + aliasTable.put("cp915", "ISO8859_5"); + aliasTable.put("915", "ISO8859_5"); + + // MIBenum: 9 + aliasTable.put("8859_6", "ISO8859_6"); + aliasTable.put("iso_8859-6:1987", "ISO8859_6"); + aliasTable.put("iso-ir-127", "ISO8859_6"); + aliasTable.put("iso_8859-6", "ISO8859_6"); + aliasTable.put("iso-8859-6", "ISO8859_6"); + aliasTable.put("iso8859-6", "ISO8859_6"); + aliasTable.put("ecma-114", "ISO8859_6"); + aliasTable.put("asmo-708", "ISO8859_6"); + aliasTable.put("arabic", "ISO8859_6"); + aliasTable.put("csisolatinarabic", "ISO8859_6"); + aliasTable.put("ibm1089", "ISO8859_6"); + aliasTable.put("ibm-1089", "ISO8859_6"); + aliasTable.put("cp1089", "ISO8859_6"); + aliasTable.put("1089", "ISO8859_6"); + + // MIBenum: 10 + aliasTable.put("8859_7", "ISO8859_7"); + aliasTable.put("iso_8859-7:1987", "ISO8859_7"); + aliasTable.put("iso-ir-126", "ISO8859_7"); + aliasTable.put("iso_8859-7", "ISO8859_7"); + aliasTable.put("iso-8859-7", "ISO8859_7"); + aliasTable.put("iso8859-7", "ISO8859_7"); + aliasTable.put("elot_928", "ISO8859_7"); + aliasTable.put("ecma-118", "ISO8859_7"); + aliasTable.put("greek", "ISO8859_7"); + aliasTable.put("greek8", "ISO8859_7"); + aliasTable.put("csisolatingreek", "ISO8859_7"); + aliasTable.put("ibm813", "ISO8859_7"); + aliasTable.put("ibm-813", "ISO8859_7"); + aliasTable.put("cp813", "ISO8859_7"); + aliasTable.put("813", "ISO8859_7"); + aliasTable.put("sun_eu_greek", "ISO8859_7"); + + // MIBenum: 11 + aliasTable.put("8859_8", "ISO8859_8"); + aliasTable.put("iso_8859-8:1988", "ISO8859_8"); + aliasTable.put("iso-ir-138", "ISO8859_8"); + aliasTable.put("iso_8859-8", "ISO8859_8"); + aliasTable.put("iso-8859-8", "ISO8859_8"); + aliasTable.put("iso8859-8", "ISO8859_8"); + aliasTable.put("hebrew", "ISO8859_8"); + aliasTable.put("csisolatinhebrew", "ISO8859_8"); + aliasTable.put("ibm916", "ISO8859_8"); + aliasTable.put("ibm-916", "ISO8859_8"); + aliasTable.put("cp916", "ISO8859_8"); + aliasTable.put("916", "ISO8859_8"); + + // MIBenum: 12 + aliasTable.put("8859_9", "ISO8859_9"); + aliasTable.put("iso-ir-148", "ISO8859_9"); + aliasTable.put("iso_8859-9", "ISO8859_9"); + aliasTable.put("iso-8859-9", "ISO8859_9"); + aliasTable.put("iso8859-9", "ISO8859_9"); + aliasTable.put("latin5", "ISO8859_9"); + aliasTable.put("l5", "ISO8859_9"); + aliasTable.put("ibm920", "ISO8859_9"); + aliasTable.put("ibm-920", "ISO8859_9"); + aliasTable.put("cp920", "ISO8859_9"); + aliasTable.put("920", "ISO8859_9"); + aliasTable.put("csisolatin5", "ISO8859_9"); + + // MIBenum: ??? + aliasTable.put("8859_13", "ISO8859_13"); + aliasTable.put("iso_8859-13", "ISO8859_13"); + aliasTable.put("iso-8859-13", "ISO8859_13"); + aliasTable.put("iso8859-13", "ISO8859_13"); + + + // MIBenum: ???? + aliasTable.put("8859_15", "ISO8859_15"); + aliasTable.put("iso-8859-15", "ISO8859_15"); + aliasTable.put("iso_8859-15", "ISO8859_15"); + aliasTable.put("iso8859-15", "ISO8859_15"); + aliasTable.put("ibm923", "ISO8859_15"); + aliasTable.put("ibm-923", "ISO8859_15"); + aliasTable.put("cp923", "ISO8859_15"); + aliasTable.put("923", "ISO8859_15"); + aliasTable.put("latin0", "ISO8859_15"); + aliasTable.put("latin9", "ISO8859_15"); + aliasTable.put("csisolatin0", "ISO8859_15"); + aliasTable.put("csisolatin9", "ISO8859_15"); + + //For compatibility purpose + aliasTable.put("iso8859_15_fdis", "ISO8859_15"); + + // MIBenum: 106 + aliasTable.put("utf-8", "UTF8"); + + // Alias recommended in RFC 1641 + aliasTable.put("unicode-1-1-utf-8", "UTF8"); + + // MIBenum: 1000 + aliasTable.put("iso-10646-ucs-2", "UnicodeBigUnmarked"); + + // Per Unicode standard + aliasTable.put("utf-16be", "UnicodeBigUnmarked"); + aliasTable.put("utf-16le", "UnicodeLittleUnmarked"); + aliasTable.put("utf-16", "UTF16"); + + // Used by drag-and-drop subsystem + aliasTable.put("x-utf-16be", "UnicodeBigUnmarked"); + aliasTable.put("x-utf-16le", "UnicodeLittleUnmarked"); + + // MIBenum: ???? + aliasTable.put("ibm037", "Cp037"); + aliasTable.put("ibm-037", "Cp037"); + aliasTable.put("cp037", "Cp037"); + aliasTable.put("037", "Cp037"); + + // MIBenum: ???? + aliasTable.put("ibm273", "Cp273"); + aliasTable.put("ibm-273", "Cp273"); + aliasTable.put("cp273", "Cp273"); + aliasTable.put("273", "Cp273"); + + // MIBenum: ???? + aliasTable.put("ibm277", "Cp277"); + aliasTable.put("ibm-277", "Cp277"); + aliasTable.put("cp277", "Cp277"); + aliasTable.put("277", "Cp277"); + + // MIBenum: ???? + aliasTable.put("ibm278", "Cp278"); + aliasTable.put("ibm-278", "Cp278"); + aliasTable.put("cp278", "Cp278"); + aliasTable.put("278", "Cp278"); + + // MIBenum: ???? + aliasTable.put("ibm280", "Cp280"); + aliasTable.put("ibm-280", "Cp280"); + aliasTable.put("cp280", "Cp280"); + aliasTable.put("280", "Cp280"); + + // MIBenum: ???? + aliasTable.put("ibm284", "Cp284"); + aliasTable.put("ibm-284", "Cp284"); + aliasTable.put("cp284", "Cp284"); + aliasTable.put("284", "Cp284"); + + // MIBenum: ???? + aliasTable.put("ibm285", "Cp285"); + aliasTable.put("ibm-285", "Cp285"); + aliasTable.put("cp285", "Cp285"); + aliasTable.put("285", "Cp285"); + + // MIBenum: ???? + aliasTable.put("ibm297", "Cp297"); + aliasTable.put("ibm-297", "Cp297"); + aliasTable.put("cp297", "Cp297"); + aliasTable.put("297", "Cp297"); + + // MIBenum: ???? + aliasTable.put("ibm420", "Cp420"); + aliasTable.put("ibm-420", "Cp420"); + aliasTable.put("cp420", "Cp420"); + aliasTable.put("420", "Cp420"); + + // MIBenum: ???? + aliasTable.put("ibm424", "Cp424"); + aliasTable.put("ibm-424", "Cp424"); + aliasTable.put("cp424", "Cp424"); + aliasTable.put("424", "Cp424"); + + // MIBenum: 2011 + aliasTable.put("ibm437", "Cp437"); + aliasTable.put("ibm-437", "Cp437"); + aliasTable.put("cp437", "Cp437"); + aliasTable.put("437", "Cp437"); + aliasTable.put("cspc8codepage437", "Cp437"); + + // MIBenum: ???? + aliasTable.put("ibm500", "Cp500"); + aliasTable.put("ibm-500", "Cp500"); + aliasTable.put("cp500", "Cp500"); + aliasTable.put("500", "Cp500"); + + // MIBenum: ???? + aliasTable.put("ibm737", "Cp737"); + aliasTable.put("ibm-737", "Cp737"); + aliasTable.put("cp737", "Cp737"); + aliasTable.put("737", "Cp737"); + + // MIBenum: ???? + aliasTable.put("ibm775", "Cp775"); + aliasTable.put("ibm-775", "Cp775"); + aliasTable.put("cp775", "Cp775"); + aliasTable.put("775", "Cp775"); + + // MIBenum: ???? + aliasTable.put("ibm838", "Cp838"); /* MDA */ + aliasTable.put("ibm-838", "Cp838"); /* MDA */ + aliasTable.put("cp838", "Cp838"); /* MDA */ + aliasTable.put("838", "Cp838"); /* MDA */ + + // "Cp850" + // MIBenum: 2009 + aliasTable.put("ibm850", "Cp850"); + aliasTable.put("ibm-850", "Cp850"); + aliasTable.put("cp850", "Cp850"); + aliasTable.put("850", "Cp850"); + aliasTable.put("cspc850multilingual", "Cp850"); + + // "Cp852" + // MIBenum: 2010 + aliasTable.put("ibm852", "Cp852"); + aliasTable.put("ibm-852", "Cp852"); + aliasTable.put("cp852", "Cp852"); + aliasTable.put("852", "Cp852"); + aliasTable.put("cspcp852", "Cp852"); + + // "Cp855" + // MIBenum: 2046 + aliasTable.put("ibm855", "Cp855"); + aliasTable.put("ibm-855", "Cp855"); + aliasTable.put("cp855", "Cp855"); + aliasTable.put("855", "Cp855"); + aliasTable.put("cspcp855", "Cp855"); + + // "Cp855" + // MIBenum: ??? + aliasTable.put("ibm856", "Cp856"); + aliasTable.put("ibm-856", "Cp856"); + aliasTable.put("cp856", "Cp856"); + aliasTable.put("856", "Cp856"); + + // "Cp857" + // MIBenum: 2047 + aliasTable.put("ibm857", "Cp857"); + aliasTable.put("ibm-857", "Cp857"); + aliasTable.put("cp857", "Cp857"); + aliasTable.put("857", "Cp857"); + aliasTable.put("csibm857", "Cp857"); + + // "Cp860" + // MIBenum: 2048 + aliasTable.put("ibm860", "Cp860"); + aliasTable.put("ibm-860", "Cp860"); + aliasTable.put("cp860", "Cp860"); + aliasTable.put("860", "Cp860"); + aliasTable.put("csibm860", "Cp860"); + + // MIBenum: 2049 + aliasTable.put("ibm861", "Cp861"); + aliasTable.put("ibm-861", "Cp861"); + aliasTable.put("cp861", "Cp861"); + aliasTable.put("861", "Cp861"); + aliasTable.put("csibm861", "Cp861"); + + // MIBenum: 2013 + aliasTable.put("ibm862", "Cp862"); + aliasTable.put("ibm-862", "Cp862"); + aliasTable.put("cp862", "Cp862"); + aliasTable.put("862", "Cp862"); + + // MIBenum: 2050 + aliasTable.put("ibm863", "Cp863"); + aliasTable.put("ibm-863", "Cp863"); + aliasTable.put("cp863", "Cp863"); + aliasTable.put("863", "Cp863"); + aliasTable.put("csibm863", "Cp863"); + + // MIBenum: 2051 + aliasTable.put("ibm864", "Cp864"); + aliasTable.put("ibm-864", "Cp864"); + aliasTable.put("cp864", "Cp864"); + aliasTable.put("csibm864", "Cp864"); + + // MIBenum: 2052 + aliasTable.put("ibm865", "Cp865"); + aliasTable.put("ibm-865", "Cp865"); + aliasTable.put("cp865", "Cp865"); + aliasTable.put("865", "Cp865"); + aliasTable.put("csibm865", "Cp865"); + + // MIBenum: ???? + aliasTable.put("ibm866", "Cp866"); + aliasTable.put("ibm-866", "Cp866"); + aliasTable.put("cp866", "Cp866"); + aliasTable.put("866", "Cp866"); + aliasTable.put("csibm866", "Cp866"); + + // MIBenum: ???? + aliasTable.put("ibm868", "Cp868"); + aliasTable.put("ibm-868", "Cp868"); + aliasTable.put("cp868", "Cp868"); + aliasTable.put("868", "Cp868"); + + // MIBenum: 2054 + aliasTable.put("ibm869", "Cp869"); + aliasTable.put("ibm-869", "Cp869"); + aliasTable.put("cp869", "Cp869"); + aliasTable.put("869", "Cp869"); + aliasTable.put("cp-gr", "Cp869"); + aliasTable.put("csibm869", "Cp869"); + + // MIBenum: ???? + aliasTable.put("ibm870", "Cp870"); + aliasTable.put("ibm-870", "Cp870"); + aliasTable.put("cp870", "Cp870"); + aliasTable.put("870", "Cp870"); + + // MIBenum: ???? + aliasTable.put("ibm871", "Cp871"); + aliasTable.put("ibm-871", "Cp871"); + aliasTable.put("cp871", "Cp871"); + aliasTable.put("871", "Cp871"); + + // MIBenum: ???? + aliasTable.put("ibm874", "Cp874"); + aliasTable.put("ibm-874", "Cp874"); + aliasTable.put("cp874", "Cp874"); + aliasTable.put("874", "Cp874"); + + // MIBenum: ???? + aliasTable.put("ibm875", "Cp875"); + aliasTable.put("ibm-875", "Cp875"); + aliasTable.put("cp875", "Cp875"); + aliasTable.put("875", "Cp875"); + + // MIBenum: ???? + aliasTable.put("ibm918", "Cp918"); + aliasTable.put("ibm-918", "Cp918"); + aliasTable.put("cp918", "Cp918"); + aliasTable.put("918", "Cp918"); + + // MIBenum: ???? + aliasTable.put("ibm921", "Cp921"); + aliasTable.put("ibm-921", "Cp921"); + aliasTable.put("cp921", "Cp921"); + aliasTable.put("921", "Cp921"); + + // MIBenum: ???? + aliasTable.put("ibm922", "Cp922"); + aliasTable.put("ibm-922", "Cp922"); + aliasTable.put("cp922", "Cp922"); + aliasTable.put("922", "Cp922"); + + // MIBenum: ???? + aliasTable.put("ibm930", "Cp930"); /* MDA */ + aliasTable.put("ibm-930", "Cp930"); /* MDA */ + aliasTable.put("cp930", "Cp930"); /* MDA */ + aliasTable.put("930", "Cp930"); /* MDA */ + + // MIBenum: ???? + aliasTable.put("ibm933", "Cp933"); /* MDA */ + aliasTable.put("ibm-933", "Cp933"); /* MDA */ + aliasTable.put("cp933", "Cp933"); /* MDA */ + aliasTable.put("933", "Cp933"); /* MDA */ + + // MIBenum: ???? + aliasTable.put("ibm935", "Cp935"); /* MDA */ + aliasTable.put("ibm-935", "Cp935"); /* MDA */ + aliasTable.put("cp935", "Cp935"); /* MDA */ + aliasTable.put("935", "Cp935"); /* MDA */ + + // MIBenum: ???? + aliasTable.put("ibm937", "Cp937"); /* MDA */ + aliasTable.put("ibm-937", "Cp937"); /* MDA */ + aliasTable.put("cp937", "Cp937"); /* MDA */ + aliasTable.put("937", "Cp937"); /* MDA */ + + // MIBenum: ???? + aliasTable.put("ibm939", "Cp939"); /* MDA */ + aliasTable.put("ibm-939", "Cp939"); /* MDA */ + aliasTable.put("cp939", "Cp939"); /* MDA */ + aliasTable.put("939", "Cp939"); /* MDA */ + + // MIBenum: ???? + aliasTable.put("ibm942", "Cp942"); /* MDA */ + aliasTable.put("ibm-942", "Cp942"); /* MDA */ + aliasTable.put("cp942", "Cp942"); /* MDA */ + aliasTable.put("942", "Cp942"); /* MDA */ + + // MIBenum: ???? + aliasTable.put("ibm943", "Cp943"); /* ibm.3158 */ + aliasTable.put("ibm-943", "Cp943"); /* ibm.3158 */ + aliasTable.put("cp943", "Cp943"); /* ibm.3158 */ + aliasTable.put("943", "Cp943"); /* ibm.3158 */ + + // MIBenum: ???? + aliasTable.put("ibm948", "Cp948"); /* MDA */ + aliasTable.put("ibm-948", "Cp948"); /* MDA */ + aliasTable.put("cp948", "Cp948"); /* MDA */ + aliasTable.put("948", "Cp948"); /* MDA */ + + // MIBenum: ???? + aliasTable.put("ibm949", "Cp949"); /* MDA */ + aliasTable.put("ibm-949", "Cp949"); /* MDA */ + aliasTable.put("cp949", "Cp949"); /* MDA */ + aliasTable.put("949", "Cp949"); /* MDA */ + + // MIBenum: ???? + aliasTable.put("ibm950", "Cp950"); /* MDA */ + aliasTable.put("ibm-950", "Cp950"); /* MDA */ + aliasTable.put("cp950", "Cp950"); /* MDA */ + aliasTable.put("950", "Cp950"); /* MDA */ + + // MIBenum: ???? + aliasTable.put("ibm964", "Cp964"); /* MDA */ + aliasTable.put("ibm-964", "Cp964"); /* MDA */ + aliasTable.put("cp964", "Cp964"); /* MDA */ + aliasTable.put("964", "Cp964"); /* MDA */ + + // MIBenum: ???? + aliasTable.put("ibm970", "Cp970"); /* MDA */ + aliasTable.put("ibm-970", "Cp970"); /* MDA */ + aliasTable.put("cp970", "Cp970"); /* MDA */ + aliasTable.put("970", "Cp970"); /* MDA */ + + // MIBenum: ???? + aliasTable.put("ibm1006", "Cp1006"); + aliasTable.put("ibm-1006", "Cp1006"); + aliasTable.put("cp1006", "Cp1006"); + aliasTable.put("1006", "Cp1006"); + + // MIBenum: ???? + aliasTable.put("ibm1025", "Cp1025"); + aliasTable.put("ibm-1025", "Cp1025"); + aliasTable.put("cp1025", "Cp1025"); + aliasTable.put("1025", "Cp1025"); + + // MIBenum: ???? + aliasTable.put("ibm1026", "Cp1026"); + aliasTable.put("ibm-1026", "Cp1026"); + aliasTable.put("cp1026", "Cp1026"); + aliasTable.put("1026", "Cp1026"); + + // MIBenum: ???? + aliasTable.put("ibm1097", "Cp1097"); + aliasTable.put("ibm-1097", "Cp1097"); + aliasTable.put("cp1097", "Cp1097"); + aliasTable.put("1097", "Cp1097"); + + // MIBenum: ???? + aliasTable.put("ibm1098", "Cp1098"); + aliasTable.put("ibm-1098", "Cp1098"); + aliasTable.put("cp1098", "Cp1098"); + aliasTable.put("1098", "Cp1098"); + + // MIBenum: ???? + aliasTable.put("ibm1112", "Cp1112"); + aliasTable.put("ibm-1112", "Cp1112"); + aliasTable.put("cp1112", "Cp1112"); + aliasTable.put("1112", "Cp1112"); + + // MIBenum: ???? + aliasTable.put("ibm1122", "Cp1122"); + aliasTable.put("ibm-1122", "Cp1122"); + aliasTable.put("cp1122", "Cp1122"); + aliasTable.put("1122", "Cp1122"); + + // MIBenum: ???? + aliasTable.put("ibm1123", "Cp1123"); + aliasTable.put("ibm-1123", "Cp1123"); + aliasTable.put("cp1123", "Cp1123"); + aliasTable.put("1123", "Cp1123"); + + // MIBenum: ???? + aliasTable.put("ibm1124", "Cp1124"); + aliasTable.put("ibm-1124", "Cp1124"); + aliasTable.put("cp1124", "Cp1124"); + aliasTable.put("1124", "Cp1124"); + + // MIBenum: ???? + aliasTable.put("ibm1381", "Cp1381"); /* MDA */ + aliasTable.put("ibm-1381", "Cp1381"); /* MDA */ + aliasTable.put("cp1381", "Cp1381"); /* MDA */ + aliasTable.put("1381", "Cp1381"); /* MDA */ + + // MIBenum: ???? + aliasTable.put("ibm1383", "Cp1383"); /* MDA */ + aliasTable.put("ibm-1383", "Cp1383"); /* MDA */ + aliasTable.put("cp1383", "Cp1383"); /* MDA */ + aliasTable.put("1383", "Cp1383"); /* MDA */ + + // MIBenum: 16/39 + aliasTable.put("jis", "ISO2022JP"); + aliasTable.put("iso-2022-jp", "ISO2022JP"); + aliasTable.put("csiso2022jp", "ISO2022JP"); + aliasTable.put("jis_encoding", "ISO2022JP"); + aliasTable.put("csjisencoding", "ISO2022JP"); + + // MIBenum: 17/2024 + aliasTable.put("windows-31j", "MS932"); + aliasTable.put("cswindows31j", "MS932"); + + + aliasTable.put("pck", "PCK"); // Case independent PCK alias + + /*if (sjisIsMS932) { + aliasTable.put("shift_jis", "MS932"); // IANA shift jis aliases + aliasTable.put("csshiftjis", "MS932"); // updated per 4556882 + aliasTable.put("x-sjis", "MS932"); + aliasTable.put("ms_kanji", "MS932"); + } else { + */ + aliasTable.put("shift_jis", "SJIS"); // IANA shift jis aliases + aliasTable.put("csshiftjis", "SJIS"); + aliasTable.put("x-sjis", "SJIS"); + aliasTable.put("ms_kanji", "SJIS"); + /* + } + */ + // MIBenum: 18 + // Japanese EUC + aliasTable.put("eucjis", "EUC_JP"); + aliasTable.put("euc-jp", "EUC_JP"); + aliasTable.put("eucjp", "EUC_JP"); + aliasTable.put("extended_unix_code_packed_format_for_japanese", + "EUC_JP"); + aliasTable.put("cseucpkdfmtjapanese", "EUC_JP"); + aliasTable.put("x-euc-jp", "EUC_JP"); + aliasTable.put("x-eucjp", "EUC_JP"); + aliasTable.put("eucjp-open", "EUC_JP_Solaris"); // 1.3.1_x compatibility + + // For handing only JIS0202 and JIS0208 in linux + aliasTable.put("euc-jp-linux", "EUC_JP_LINUX"); + + // MIBenum: 874 + aliasTable.put("windows-874", "MS874"); + + // MIBenum: 2250 + aliasTable.put("windows-1250", "Cp1250"); + + // MIBenum: 2251 + aliasTable.put("windows-1251", "Cp1251"); + aliasTable.put("ansi-1251", "Cp1251"); // Solaris ru_RU.ANSI1251 locale + + // MIBenum: 2252 + aliasTable.put("windows-1252", "Cp1252"); + + // MIBenum: 2253 + aliasTable.put("windows-1253", "Cp1253"); + + // MIBenum: 2254 + aliasTable.put("windows-1254", "Cp1254"); + + // MIBenum: 2255 + aliasTable.put("windows-1255", "Cp1255"); + + // MIBenum: 2256 + aliasTable.put("windows-1256", "Cp1256"); + + // MIBenum: 2257 + aliasTable.put("windows-1257", "Cp1257"); + + // MIBenum: 2258 + aliasTable.put("windows-1258", "Cp1258"); + + // MIBenum: ???? + aliasTable.put("ibm33722", "Cp33722"); /* MDA */ + aliasTable.put("ibm-33722", "Cp33722"); /* MDA */ + aliasTable.put("cp33722", "Cp33722"); /* MDA */ + aliasTable.put("33722", "Cp33722"); /* MDA */ + + // Russian KOI8-R + aliasTable.put("koi8-r", "KOI8_R"); + aliasTable.put("koi8", "KOI8_R"); + aliasTable.put("cskoi8r", "KOI8_R"); + + // Simplified Chinese + aliasTable.put("gb2312", "EUC_CN"); + aliasTable.put("gb2312-80", "EUC_CN"); + aliasTable.put("gb2312-1980", "EUC_CN"); + aliasTable.put("euc-cn", "EUC_CN"); + aliasTable.put("euccn", "EUC_CN"); + + aliasTable.put("big5", "Big5"); + aliasTable.put("big5hk", "Big5_HKSCS"); + aliasTable.put("big5-hkscs", "Big5_HKSCS"); + // Added for future compatibility, explicit mapping to Unicode 3.0 + aliasTable.put("big5-hkscs:unicode3.0", "Big5_HKSCS"); + aliasTable.put("big5_solaris", "Big5_Solaris"); + + // Traditional Chinese + aliasTable.put("cns11643", "EUC_TW"); + aliasTable.put("euc-tw", "EUC_TW"); + aliasTable.put("euctw", "EUC_TW"); + + // Korean + aliasTable.put("ksc5601", "EUC_KR"); + aliasTable.put("euc-kr", "EUC_KR"); + aliasTable.put("euckr", "EUC_KR"); + aliasTable.put("ks_c_5601-1987", "EUC_KR"); + aliasTable.put("ksc5601-1987", "EUC_KR"); + aliasTable.put("ksc5601_1987", "EUC_KR"); + aliasTable.put("ksc_5601", "EUC_KR"); + aliasTable.put("5601", "EUC_KR"); + + aliasTable.put("ksc5601-1992", "Johab"); + aliasTable.put("ksc5601_1992", "Johab"); + aliasTable.put("ms1361", "Johab"); + + aliasTable.put("windows-949", "MS949"); + + //MIBenum: 37 + aliasTable.put("iso-2022-kr", "ISO2022KR"); + aliasTable.put("csiso2022kr", "ISO2022KR"); + + // Thai + aliasTable.put("tis620.2533", "TIS620"); + aliasTable.put("tis-620", "TIS620"); // Linux name + + // Variants + aliasTable.put("cp942c", "Cp942C"); + aliasTable.put("cp943c", "Cp943C"); + aliasTable.put("cp949c", "Cp949C"); + aliasTable.put("iscii", "ISCII91"); + } +} diff --git a/jdk/test/java/nio/charset/RemovingSunIO/TestCOMP.java b/jdk/test/java/nio/charset/RemovingSunIO/TestCOMP.java new file mode 100644 index 00000000000..c3cbf8f279c --- /dev/null +++ b/jdk/test/java/nio/charset/RemovingSunIO/TestCOMP.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + @bug 6176819 + @summary Check if COMPUND_TEXT charset works as expected + @run main/timeout=1200 TestCOMP + */ + +import java.util.HashMap; +import java.util.Set; +import java.io.UnsupportedEncodingException; +import java.nio.charset.*; +import java.nio.*; + +public class TestCOMP { + public static void main(String[] argv) throws CharacterCodingException { + String osName = System.getProperty("os.name"); + if (osName.startsWith("Windows")) + return; + try { + String src = + "JIS0208\u4eb0" + + "ASCII" + + "JIS0212\u4e74\u4e79" + + "GB2312\u7279\u5b9a" + + "JIS0201\uff67\uff68" + + "Johab\uac00\uac01"; + + byte[] ba = src.getBytes("COMPOUND_TEXT"); + /* + System.out.print("ba="); + for (int i = 0; i < ba.length; i++) { + System.out.printf("<%x> ", ba[i] & 0xff); + } + System.out.println(); + */ + String dst = new String(ba, "COMPOUND_TEXT"); + char[] ca = dst.toCharArray(); + /* + System.out.print("ca="); + for (int i = 0; i < ca.length; i++) { + System.out.printf("<%x> ", ca[i] & 0xffff); + } + System.out.println(); + */ + if (!src.equals(dst)) { + System.out.printf("src=<%s>\n", src); + System.out.printf("dst=<%s>\n", dst); + throw new CharacterCodingException(); + } + } catch (Exception e){ + e.printStackTrace(); + } + } +} diff --git a/jdk/test/java/nio/charset/RemovingSunIO/TestUnmappableForLength.java b/jdk/test/java/nio/charset/RemovingSunIO/TestUnmappableForLength.java new file mode 100644 index 00000000000..f07984fa77d --- /dev/null +++ b/jdk/test/java/nio/charset/RemovingSunIO/TestUnmappableForLength.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + @bug 6227339 + @summary Check if returned CoderResult.unmappableForLength has correct + length value. + */ + +import java.nio.charset.*; +import java.nio.*; + +public class TestUnmappableForLength { + public static void main(String[] argv) throws CharacterCodingException { + byte[] ba = {(byte)0xa2, (byte)0xff}; + //EUC_TW has its own decodeArrayLoop() + testDecode("EUC_TW", ba, 2); + + //EUC_CN uses DoubleByteDecoder's decodeArrayLoop() + testDecode("EUC_CN", ba, 2); + } + + static void testDecode(String csName, byte[] ba, int expected) + throws CharacterCodingException + { + try { + CoderResult cr = Charset + .forName(csName) + .newDecoder() + .decode(ByteBuffer.wrap(ba), CharBuffer.allocate(4), true); + if (cr.isUnmappable() && cr.length() != expected) { + throw new CharacterCodingException(); + } + } catch (IllegalArgumentException x){ + x.printStackTrace(); + } + } + +} diff --git a/jdk/test/java/nio/charset/coders/BashCache.java b/jdk/test/java/nio/charset/coders/BashCache.java new file mode 100644 index 00000000000..04988b62524 --- /dev/null +++ b/jdk/test/java/nio/charset/coders/BashCache.java @@ -0,0 +1,89 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @bug 4517279 + * @summary Stochastic test of thread-local coder caches + */ + +import java.nio.*; +import java.nio.charset.*; +import java.util.*; + + +public class BashCache { + + private static final int THREADS = 10; + private static final int TRIALS = 1000; + + private static final Charset[] charsets + = new Charset[] { + Charset.forName("US-ASCII"), + Charset.forName("UTF-8"), + Charset.forName("CP1252"), + Charset.forName("UTF-16BE") }; + + private static volatile boolean failed = false; + + private static class Basher extends Thread { + + Random rnd = new Random(System.identityHashCode(this)); + + public void run() { + for (int i = 0; i < TRIALS; i++) { + Charset cs = charsets[rnd.nextInt(4)]; + try { + if (rnd.nextBoolean()) { + cs.encode("hi mom"); + } else { + cs.decode(ByteBuffer.wrap(new byte[] { + (byte)'x', (byte)'y', + (byte)'z', (byte)'z', + (byte)'y' })); + } + } catch (Exception x) { + x.printStackTrace(); + failed = true; + return; + } + if (rnd.nextBoolean()) + Thread.yield(); + } + } + + } + + public static void main(String[] args) throws Exception { + Charset cs = Charset.forName("us-ascii"); + Basher[] bashers = new Basher[THREADS]; + for (int i = 0; i < THREADS; i++) { + bashers[i] = new Basher(); + bashers[i].start(); + } + for (int i = 0; i < THREADS; i++) + bashers[i].join(); + if (failed) + throw new Exception("Test failed"); + } + +} diff --git a/jdk/test/java/nio/charset/coders/BashStreams.java b/jdk/test/java/nio/charset/coders/BashStreams.java new file mode 100644 index 00000000000..555c3398929 --- /dev/null +++ b/jdk/test/java/nio/charset/coders/BashStreams.java @@ -0,0 +1,391 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @summary Stochastic test of charset-based streams + */ + +import java.io.*; +import java.util.*; +import java.nio.*; +import java.nio.channels.*; +import java.nio.charset.*; + + +public class BashStreams { + + static final PrintStream log = System.err; + + + static class CharacterGenerator { + + private final Random rand; + private final int max; + private final int limit; + private int count = 0; + + CharacterGenerator(long seed, String csn, int limit) { + rand = new Random(seed); + this.max = Surrogate.UCS4_MAX + 1; + this.limit = limit; + } + + private char[] saved = new char[10]; + private int savedCount = 0; + + void push(char c) { + saved[savedCount++] = c; + count--; + } + + int count() { + return count; + } + + boolean hasNext() { + return count < limit; + } + + char next() { + if (count >= limit) + throw new RuntimeException("EOF"); + if (savedCount > 0) { + savedCount--; + count++; + return saved[savedCount]; + } + int c; + for (;;) { + c = rand.nextInt(max); + if (Surrogate.is(c) || (c == 0xfffe) || (c == 0xffff)) + continue; + if (Surrogate.neededFor(c) && (count == limit - 1)) + continue; + break; + } + count++; + if (Surrogate.neededFor(c)) { + count++; + push(Surrogate.low(c)); + return Surrogate.high(c); + } + return (char)c; + } + + } + + + static void mismatch(String csn, int count, char c, char d) { + throw new RuntimeException(csn + ": Mismatch at count " + + count + + ": " + Integer.toHexString(c) + + " != " + + Integer.toHexString(d)); + } + + static void mismatchedEOF(String csn, int count, int cgCount) { + throw new RuntimeException(csn + ": Mismatched EOFs: " + + count + + " != " + + cgCount); + } + + + static class Sink // One abomination... + extends OutputStream + implements WritableByteChannel + { + + private final String csn; + private final CharacterGenerator cg; + private int count = 0; + + Sink(String csn, long seed) { + this.csn = csn; + this.cg = new CharacterGenerator(seed, csn, Integer.MAX_VALUE); + } + + public void write(int b) throws IOException { + write (new byte[] { (byte)b }, 0, 1); + } + + private int check(byte[] ba, int off, int len) throws IOException { + String s = new String(ba, off, len, csn); + int n = s.length(); + for (int i = 0; i < n; i++) { + char c = s.charAt(i); + char d = cg.next(); + if (c != d) { + if (c == '?') { + if (Surrogate.isHigh(d)) + cg.next(); + continue; + } + mismatch(csn, count + i, c, d); + } + } + count += n; + return len; + } + + public void write(byte[] ba, int off, int len) throws IOException { + check(ba, off, len); + } + + public int write(ByteBuffer bb) throws IOException { + int n = check(bb.array(), + bb.arrayOffset() + bb.position(), + bb.remaining()); + bb.position(bb.position() + n); + return n; + } + + public void close() { + count = -1; + } + + public boolean isOpen() { + return count >= 0; + } + + } + + static void testWrite(String csn, int limit, long seed, Writer w) + throws IOException + { + Random rand = new Random(seed); + CharacterGenerator cg = new CharacterGenerator(seed, csn, + Integer.MAX_VALUE); + int count = 0; + char[] ca = new char[16384]; + + int n = 0; + while (count < limit) { + n = rand.nextInt(ca.length); + for (int i = 0; i < n; i++) + ca[i] = cg.next(); + w.write(ca, 0, n); + count += n; + } + if (Surrogate.isHigh(ca[n - 1])) + w.write(cg.next()); + w.close(); + } + + static void testStreamWrite(String csn, int limit, long seed) + throws IOException + { + log.println(" write stream"); + testWrite(csn, limit, seed, + new OutputStreamWriter(new Sink(csn, seed), csn)); + } + + static void testChannelWrite(String csn, int limit, long seed) + throws IOException + { + log.println(" write channel"); + testWrite(csn, limit, seed, + Channels.newWriter(new Sink(csn, seed), + Charset.forName(csn) + .newEncoder() + .onMalformedInput(CodingErrorAction.REPLACE) + .onUnmappableCharacter(CodingErrorAction.REPLACE), + 8192)); + } + + + static class Source // ... and another + extends InputStream + implements ReadableByteChannel + { + + private final String csn; + private final CharsetEncoder enc; + private final CharacterGenerator cg; + private int count = 0; + + Source(String csn, long seed, int limit) { + this.csn = csn.startsWith("\1") ? csn.substring(1) : csn; + this.enc = Charset.forName(this.csn).newEncoder() + .onMalformedInput(CodingErrorAction.REPLACE) + .onUnmappableCharacter(CodingErrorAction.REPLACE); + this.cg = new CharacterGenerator(seed, csn, limit); + } + + public int read() throws IOException { + byte[] b = new byte[1]; + read(b); + return b[0]; + } + + private CharBuffer cb = CharBuffer.allocate(8192); + private ByteBuffer bb = null; + + public int read(byte[] ba, int off, int len) throws IOException { + if (!cg.hasNext()) + return -1; + int end = off + len; + int i = off; + while (i < end) { + if ((bb == null) || !bb.hasRemaining()) { + cb.clear(); + while (cb.hasRemaining()) { + if (!cg.hasNext()) + break; + char c = cg.next(); + if (Surrogate.isHigh(c) && (cb.remaining() == 1)) { + cg.push(c); + break; + } + cb.put(c); + } + cb.flip(); + if (!cb.hasRemaining()) + break; + bb = enc.encode(cb); + } + int d = Math.min(bb.remaining(), end - i); + bb.get(ba, i, d); + i += d; + } + return i - off; + } + + public int read(ByteBuffer bb) throws IOException { + int n = read(bb.array(), + bb.arrayOffset() + bb.position(), + bb.remaining()); + if (n >= 0) + bb.position(bb.position() + n); + return n; + } + + public void close() { + count = -1; + } + + public boolean isOpen() { + return count != -1; + } + + } + + static void testRead(String csn, int limit, long seed, int max, + Reader rd) + throws IOException + { + Random rand = new Random(seed); + CharacterGenerator cg = new CharacterGenerator(seed, csn, limit); + int count = 0; + char[] ca = new char[16384]; + + int n = 0; + while (count < limit) { + int rn = rand.nextInt(ca.length); + n = rd.read(ca, 0, rn); + if (n < 0) + break; + for (int i = 0; i < n; i++) { + char c = ca[i]; + if (!cg.hasNext()) + mismatchedEOF(csn, count + i, cg.count()); + char d = cg.next(); + if (c == '?') { + if (Surrogate.isHigh(d)) { + cg.next(); + continue; + } + if (d > max) + continue; + } + if (c != d) + mismatch(csn, count + i, c, d); + } + count += n; + } + if (cg.hasNext()) + mismatchedEOF(csn, count, cg.count()); + rd.close(); + } + + static void testStreamRead(String csn, int limit, long seed, int max) + throws IOException + { + log.println(" read stream"); + testRead(csn, limit, seed, max, + new InputStreamReader(new Source(csn, seed, limit), csn)); + } + + static void testChannelRead(String csn, int limit, long seed, int max) + throws IOException + { + log.println(" read channel"); + testRead(csn, limit, seed, max, + Channels.newReader(new Source(csn, seed, limit), csn)); + } + + + static final int LIMIT = 1 << 21; + + static void test(String csn, int limit, long seed, int max) + throws Exception + { + log.println(); + log.println(csn); + + testStreamWrite(csn, limit, seed); + testChannelWrite(csn, limit, seed); + testStreamRead(csn, limit, seed, max); + testChannelRead(csn, limit, seed, max); + } + + public static void main(String[] args) throws Exception { + + if (System.getProperty("os.arch").equals("ia64")) { + // This test requires 54 minutes on an Itanium-1 processor + return; + } + + int ai = 0, an = args.length; + + int limit; + if (ai < an) + limit = 1 << Integer.parseInt(args[ai++]); + else + limit = LIMIT; + log.println("limit = " + limit); + + long seed; + if (ai < an) + seed = Long.parseLong(args[ai++]); + else + seed = System.currentTimeMillis(); + log.println("seed = " + seed); + + test("UTF-8", limit, seed, Integer.MAX_VALUE); + test("US-ASCII", limit, seed, 0x7f); + test("ISO-8859-1", limit, seed, 0xff); + + } + +} diff --git a/jdk/test/java/nio/charset/coders/Check.java b/jdk/test/java/nio/charset/coders/Check.java new file mode 100644 index 00000000000..bb01387747d --- /dev/null +++ b/jdk/test/java/nio/charset/coders/Check.java @@ -0,0 +1,152 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @bug 4712786 + * @summary Check charsets against reference files + * + * @build Util + * @run main Check shift_jis ref.shift_jis + * @run main/othervm -Dsun.nio.cs.map=Windows-31J/Shift_JIS Check shift_jis ref.windows-31j + */ + +import java.io.*; +import java.nio.*; +import java.nio.channels.*; +import java.nio.charset.*; +import java.util.*; +import java.util.regex.*; + + +public class Check { + + private static PrintStream log = System.err; + + private static final int UNICODE_SIZE = (1 << 16); + + private final String csName; + private final String refName; + private byte[][] bytes = new byte[UNICODE_SIZE][]; // Indexed by char + + private int errors = 0; + + private Check(String csn, String refn) { + csName = csn; + refName = refn; + } + + private Check load() + throws IOException + { + File fn = new File(System.getProperty("test.src", "."), refName); + FileChannel fc = new FileInputStream(fn).getChannel(); + ByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size()); + CharBuffer cb = Charset.forName("US-ASCII").decode(bb); + Pattern p = Pattern.compile("^(\\p{XDigit}+) +(\\p{XDigit}+)$", + Pattern.MULTILINE); + Matcher m = p.matcher(cb); + while (m.find()) { + char c = (char)Integer.parseInt(m.group(1), 16); + String v = m.group(2); + int nb = v.length() >> 1; + byte[] ba = new byte[nb]; + for (int i = 0; i < nb; i++) { + ba[i] = (byte)Integer.parseInt(v.substring(i << 1, (i << 1) + 2), + 16); + } + bytes[c] = ba; + } + return this; + } + + private void error() { + if (++errors >= 100) + throw new RuntimeException("100 errors occurred (there might be more)"); + } + + private void mismatch(String s, byte[] expected, byte[] got) { + log.println("Encoding mismatch on \"" + + Util.toString(s) + + "\": Expected {" + + Util.toString(expected) + + "}, got {" + + Util.toString(got) + + "}"); + error(); + } + + private void mismatch(int i, byte[] ba, String expected, String got) { + log.println("Decoding mismatch on \"" + + Util.toString((char)i) + + "\", input {" + + Util.toString(ba) + + "}: Expected \"" + + Util.toString(expected) + + "\", got \"" + + Util.toString(got) + + "\""); + error(); + } + + private void check() + throws IOException + { + + // String.getBytes(String csn) + for (int i = 0; i < UNICODE_SIZE; i++) { + if (bytes[i] == null) + continue; + String s = new String(new char[]{ (char)i }); + byte[] ba = s.getBytes(csName); + if (Util.cmp(ba, bytes[i]) >= 0) + mismatch(s, bytes[i], ba); + } + log.println("String.getBytes(\"" + csName + "\") okay"); + + // String(byte[] ba, String csn) + for (int i = 0; i < UNICODE_SIZE; i++) { + if (bytes[i] == null) + continue; + String r = new String(new char[]{ (char)i }); + String s = new String(bytes[i], csName); + if (!r.equals(s)) + mismatch(i, bytes[i], r, s); + } + log.println("String(byte[] ba, \"" + csName + "\") okay"); + + // To be really thorough we should test OutputStreamWriter, + // InputStreamReader, and Charset{De,En}Coder here also, + // but the above will do for now. + + if (errors > 0) { + throw new RuntimeException(errors + " error(s) occurred"); + } + + } + + // Usage: Check charsetName referenceFileName + public static void main(String[] args) throws Exception { + new Check(args[0], args[1]).load().check(); + } + +} diff --git a/jdk/test/java/nio/charset/coders/CheckSJISMappingProp.sh b/jdk/test/java/nio/charset/coders/CheckSJISMappingProp.sh new file mode 100644 index 00000000000..11a9af46b73 --- /dev/null +++ b/jdk/test/java/nio/charset/coders/CheckSJISMappingProp.sh @@ -0,0 +1,76 @@ +#!/bin/sh + +# +# Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# @test +# @summary Verify that sun.nio.cs.map property interpreted in ja multibyte locales +# @bug 4879123 +# @build SJISPropTest +# +# @run shell/timeout=300 CheckSJISMappingProp.sh + +# set platform-dependent variables + +OS=`uname -s` +case "$OS" in + SunOS | Linux ) ;; + # Skip locale test for Windows + Windows* ) + echo "Passed"; exit 0 ;; + * ) echo "Unrecognized system!" ; exit 1 ;; +esac + +expectPass() { + if [ $1 -eq 0 ] + then echo "--- passed as expected" + else + echo "--- failed" + exit $1 + fi +} + + +JAVA="${TESTJAVA}/bin/java -cp ${TESTCLASSES}" +runTest() { + echo "Testing:" ${1} + LC_ALL="$1" ; export LC_ALL + locale + # Firstly, test with property set + # (shift_jis should map to windows-31J charset) + ${JAVA} -Dsun.nio.cs.map="Windows-31J/Shift_JIS" SJISPropTest MS932 + expectPass $? + + # Next, test without property set - "shift_jis" follows IANA conventions + # and should map to the sun.nio.cs.ext.Shift_JIS charset + ${JAVA} SJISPropTest Shift_JIS + expectPass $? +} + +# Run the test in the common Solaris/Linux locales +# Tests will simply run in current locale if locale isn't supported +# on the test machine/platform + +for i in "ja" "ja_JP.PCK" "ja_JP.eucJP" ; do + runTest ${i} +done diff --git a/jdk/test/java/nio/charset/coders/Errors.java b/jdk/test/java/nio/charset/coders/Errors.java new file mode 100644 index 00000000000..55aaea13305 --- /dev/null +++ b/jdk/test/java/nio/charset/coders/Errors.java @@ -0,0 +1,220 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @summary Check that error cases are replaced correctly in String/ISR/OSW + * @bug 4457851 + * + * @build Errors Util + * @run main Errors + */ + +import java.io.*; +import java.nio.*; + + +public class Errors { + + static PrintStream log = System.err; + static int failures = 0; + + static final byte Q = (byte)'?'; + static final byte X = (byte)'x'; + static final byte Y = (byte)'y'; + static final byte Z = (byte)'z'; + + static abstract class Test { + + protected final String csn; + protected final String what; + + Test(String csn, String what) { + this.csn = csn; + this.what = what; + } + + abstract byte[] enc(String s) throws IOException; + + Test test(String s, byte[] ref) { + log.print(" " + Util.toString(s.toCharArray())); + byte[] ba = null; + try { + ba = enc(s); + } catch (IOException x) { + log.println(" -e-> ERROR: " + x.getClass().getName()); + failures++; + return this; + } + log.println(" -e-> " + Util.toString(ba)); + int i = Util.cmp(ba, ref); + if (i >= 0) { + log.println(" ERROR: Mismatch at index " + i + + ", expected: " + Util.toString(ref)); + failures++; + } + return this; + } + + abstract String dec(byte[] ba) throws IOException; + + Test test(byte[] ba, String ref) { + log.print(" " + Util.toString(ba)); + String s = null; + try { + s = dec(ba); + } catch (IOException x) { + log.println(" -d-> ERROR: " + x.getClass().getName()); + failures++; + return this; + } + log.println(" -d-> " + Util.toString(s.toCharArray())); + char[] ca = s.toCharArray(); + char[] refa = ref.toCharArray(); + int i = Util.cmp(ca, refa); + if (i >= 0) { + log.println(" ERROR: Mismatch at index " + i + + ", expected: " + Util.toString(refa)); + failures++; + } + return this; + } + + Test run() { + log.println(csn + ", " + what); + + test("xyzzy", new byte[] { X, Y, Z, Z, Y }); + + // Malformed surrogates + test("\uD800x", new byte[] { Q, X }); + test("\uDC00x", new byte[] { Q, X }); + test("\uD800\uDB00x", new byte[] { Q, Q, X }); + + return this; + } + + } + + static class TestStream extends Test { + + TestStream(String csn) { + super(csn, "I/O streams"); + } + + byte[] enc(String s) throws IOException { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + Writer wr = new OutputStreamWriter(bos, csn); + wr.write(s); + wr.close(); + return bos.toByteArray(); + } + + String dec(byte[] ba) throws IOException { + ByteArrayInputStream bis = new ByteArrayInputStream(ba); + Reader rd = new InputStreamReader(bis, csn); + char[] ca = new char[1024]; + int n = rd.read(ca); + String s = new String(ca, 0, n); + rd.close(); + return s; + } + + } + + static class TestString extends Test { + + TestString(String csn) { + super(csn, "strings"); + } + + byte[] enc(String s) throws IOException { + return s.getBytes(csn); + } + + String dec(byte[] ba) throws IOException { + return new String(ba, 0, ba.length, csn); + } + + } + + static void test_US_ASCII(Test t) { + t.run(); + t.test("\u0080", new byte[] { Q }); + t.test("\u0100", new byte[] { Q }); + t.test("\uD800\uDC00", new byte[] { Q }); + t.test("\uF000", new byte[] { Q }); + t.test("\uFFFE", new byte[] { Q }); + t.test("\uFFFF", new byte[] { Q }); + t.test(new byte[] { X, (byte)0x7f, Y }, "x\u007Fy"); + t.test(new byte[] { X, (byte)0x80, Y }, "x\uFFFDy"); + t.test(new byte[] { (byte)0xf0, (byte)0xf0 }, "\uFFFD\uFFFD"); + } + + static void test_ISO_8859_1(Test t) { + t.run(); + t.test("\u0080", new byte[] { (byte)0x80 }); + t.test("\u0100", new byte[] { Q }); + t.test("\uD800\uDC00x", new byte[] { Q, X }); + t.test("\uF000", new byte[] { Q }); + t.test("\uFFFE", new byte[] { Q }); + t.test("\uFFFF", new byte[] { Q }); + t.test(new byte[] { X, (byte)0x7f, Y }, "x\u007Fy"); + t.test(new byte[] { X, (byte)0x80, Y }, "x\u0080y"); + t.test(new byte[] { (byte)0xf0, (byte)0xf0 }, "\u00F0\u00F0"); + } + + static void test_UTF_8(Test t) { + t.run(); + t.test("\u0080", new byte[] { (byte)0xC2, (byte)0x80 }); + t.test("\u0100", new byte[] { (byte)0xC4, (byte)0x80 }); + t.test("\uD800\uDC00", + new byte[] { (byte)0xF0, (byte)0x90, (byte)0x80, (byte)0x80 }); + t.test("\uF000", new byte[] { (byte)0xEF, (byte)0x80, (byte)0x80 }); + t.test("\uFFFE", new byte[] { (byte)0xEF, (byte)0xBF, (byte)0xBE }); + t.test("\uFFFF", new byte[] { (byte)0xEF, (byte)0xBF, (byte)0xBF }); + t.test(new byte[] { X, (byte)0x7f, Y }, "x\u007Fy"); + t.test(new byte[] { X, (byte)0x80, Y }, "x\uFFFDy"); + t.test(new byte[] { (byte)0xf0, (byte)0xf0 }, "\uFFFD"); + } + + public static void main(String[] args) throws Exception { + + test_US_ASCII(new TestString("US-ASCII")); + test_US_ASCII(new TestStream("US-ASCII")); + + test_ISO_8859_1(new TestString("ISO-8859-1")); + test_ISO_8859_1(new TestStream("ISO-8859-1")); + + test_ISO_8859_1(new TestString("ISO-8859-15")); + test_ISO_8859_1(new TestStream("ISO-8859-15")); + + test_UTF_8(new TestString("UTF-8")); + test_UTF_8(new TestStream("UTF-8")); + + if (failures > 0) { + log.println(); + throw new Exception("Tests failed: " + failures); + } + + } + +} diff --git a/jdk/test/java/nio/charset/coders/FullRead.java b/jdk/test/java/nio/charset/coders/FullRead.java new file mode 100644 index 00000000000..13f876f84f9 --- /dev/null +++ b/jdk/test/java/nio/charset/coders/FullRead.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @summary Ensure that InputStreamReader reads as many characters as possible + */ + +// InputStreamReader is not required by its spec to read as many characters as +// possible upon each invocation of read(char[], int, int), but many programs +// (e.g., javac) depend upon this behavior. + +import java.io.*; + + +public class FullRead { + + static int MAX_LEN = 1 << 16; + + static void test(File f, int len) throws Exception { + FileOutputStream fo = new FileOutputStream(f); + for (int i = 0; i < len; i++) + fo.write('x'); + fo.close(); + + FileInputStream fi = new FileInputStream(f); + Reader rd = new InputStreamReader(fi, "US-ASCII"); + char[] cb = new char[MAX_LEN + 100]; + int n = rd.read(cb, 0, cb.length); + System.out.println(len + " : " + n); + if (len != n) + throw new Exception("Expected " + len + ", read " + n); + } + + public static void main(String[] args) throws Exception { + File f = File.createTempFile("foo", "bar"); + f.deleteOnExit(); + System.out.println(f); + + for (int i = 4; i <= MAX_LEN; i <<= 1) + test(f, i); + } + +} diff --git a/jdk/test/java/nio/charset/coders/IOCoders.java b/jdk/test/java/nio/charset/coders/IOCoders.java new file mode 100644 index 00000000000..f55eef1ff36 --- /dev/null +++ b/jdk/test/java/nio/charset/coders/IOCoders.java @@ -0,0 +1,103 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @summary Unit test for ISR/OSW constructors that take coders + */ + +import java.io.*; +import java.nio.*; +import java.nio.charset.*; + + +public class IOCoders { + + static Charset ascii = Charset.forName("US-ASCII"); + + static void isrPositive() throws Exception { + ByteArrayInputStream bis + = new ByteArrayInputStream(new byte[] { (byte)'h', (byte)'i' }); + InputStreamReader isr + = new InputStreamReader(bis, + ascii.newDecoder() + .onMalformedInput(CodingErrorAction.REPORT) + .onUnmappableCharacter(CodingErrorAction.REPORT)); + BufferedReader br = new BufferedReader(isr); + if (!br.readLine().equals("hi")) + throw new Exception(); + } + + static void isrNegative() throws Exception { + ByteArrayInputStream bis + = new ByteArrayInputStream(new byte[] { (byte)0xff, (byte)0xff }); + InputStreamReader isr + = new InputStreamReader(bis, + ascii.newDecoder() + .onMalformedInput(CodingErrorAction.REPORT) + .onUnmappableCharacter(CodingErrorAction.REPORT)); + BufferedReader br = new BufferedReader(isr); + try { + br.readLine(); + } catch (MalformedInputException x) { + return; + } + throw new Exception(); + } + + static void oswPositive() throws Exception { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + OutputStreamWriter osw + = new OutputStreamWriter(bos, + ascii.newEncoder() + .onMalformedInput(CodingErrorAction.REPORT) + .onUnmappableCharacter(CodingErrorAction.REPORT)); + osw.write("hi"); + osw.close(); + if (!ascii.decode(ByteBuffer.wrap(bos.toByteArray())) + .toString().equals("hi")) + throw new Exception(); + } + + static void oswNegative() throws Exception { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + OutputStreamWriter osw + = new OutputStreamWriter(bos, + ascii.newEncoder() + .onMalformedInput(CodingErrorAction.REPORT) + .onUnmappableCharacter(CodingErrorAction.REPORT)); + try { + osw.write("\u00A0\u00A1"); + } catch (UnmappableCharacterException x) { + return; + } + throw new Exception(); + } + + public static void main(String[] args) throws Exception { + isrPositive(); + isrNegative(); + oswPositive(); + oswNegative(); + } + +} diff --git a/jdk/test/java/nio/charset/coders/IsLegalReplacement.java b/jdk/test/java/nio/charset/coders/IsLegalReplacement.java new file mode 100644 index 00000000000..430d0fa6d70 --- /dev/null +++ b/jdk/test/java/nio/charset/coders/IsLegalReplacement.java @@ -0,0 +1,93 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @bug 4821286 + * @summary Check correctness of CharsetEncoder.isLegalReplacement(byte[]) + */ + +import java.io.*; +import java.nio.*; +import java.nio.charset.*; +import java.util.*; + + +public class IsLegalReplacement { + + static PrintStream out = System.err; + static int errors = 0; + + static String toString(byte[] ba) { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < ba.length; i++) { + byte b = ba[i]; + if (i > 0) + sb.append(' '); + sb.append(Integer.toHexString((b >> 4) & 0xf)); + sb.append(Integer.toHexString((b >> 0) & 0xf)); + } + return sb.toString(); + } + + static CoderResult ilr(String csn, byte[] repl) { + CharsetDecoder dec = Charset.forName(csn).newDecoder(); + dec.onMalformedInput(CodingErrorAction.REPORT); + dec.onUnmappableCharacter(CodingErrorAction.REPORT); + ByteBuffer bb = ByteBuffer.wrap(repl); + CharBuffer cb = CharBuffer.allocate((int)(bb.remaining() + * dec.maxCharsPerByte())); + return dec.decode(bb, cb, true); + } + + static void test(String csn, byte[] repl, boolean expected) + throws Exception + { + CharsetEncoder enc = Charset.forName(csn).newEncoder(); + out.print(csn + ": " + toString(repl) + ": "); + if (enc.isLegalReplacement(repl) == expected) { + out.print("Okay"); + } else { + out.print("Wrong: Expected " + expected); + errors++; + } + out.println(" (" + ilr(csn, repl) + ")"); + } + + public static void main(String[] args) throws Exception { + + test("UTF-16", new byte [] { (byte)0xd8, 0, (byte)0xdc, 0 }, true); + test("UTF-16", new byte [] { (byte)0xdc, 0, (byte)0xd8, 0 }, false); + test("UTF-16", new byte [] { (byte)0xd8, 0 }, false); + test("UTF-16BE", new byte [] { (byte)0xd8, 0, (byte)0xdc, 0 }, true); + test("UTF-16BE", new byte [] { (byte)0xdc, 0, (byte)0xd8, 0 }, false); + test("UTF-16BE", new byte [] { (byte)0xd8, 0 }, false); + test("UTF-16LE", new byte [] { 0, (byte)0xd8, 0, (byte)0xdc }, true); + test("UTF-16LE", new byte [] { 0, (byte)0xdc, 0, (byte)0xd8 }, false); + test("UTF-16LE", new byte [] { 0, (byte)0xd8 }, false); + + if (errors > 0) + throw new Exception(errors + " error(s) occurred"); + + } + +} diff --git a/jdk/test/java/nio/charset/coders/ResetISO2022JP.java b/jdk/test/java/nio/charset/coders/ResetISO2022JP.java new file mode 100644 index 00000000000..8bafad526cd --- /dev/null +++ b/jdk/test/java/nio/charset/coders/ResetISO2022JP.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + @bug 6226510 + @summary Check that ISO-2022-JP's encoder correctly resets to ASCII mode + @author Martin Buchholz + */ + +import java.nio.*; +import java.nio.charset.*; + +public class ResetISO2022JP { + + public static void main(String[] args) throws Exception { + if (! (encode(true).equals(encode(false)))) + throw new Exception("Mismatch!"); + } + + static String encode(boolean reuseEncoder) { + String s = "\u3042\u3043\u3044"; + + CharsetEncoder e = Charset.forName("ISO-2022-JP").newEncoder(); + + if (reuseEncoder) { + // I'm turning japanese. Yes I'm turning japanese. Yes I think so! + e.encode(CharBuffer.wrap(s), ByteBuffer.allocate(64), true); + + // Should put encoder back into ASCII mode + e.reset(); + } + + ByteBuffer bb = ByteBuffer.allocate(64); + e.encode(CharBuffer.wrap(s), bb, true); + e.flush(bb); + bb.flip(); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < bb.limit(); i++) + sb.append(String.format("%02x ", bb.get(i))); + System.out.println(sb); + return sb.toString(); + } +} diff --git a/jdk/test/java/nio/charset/coders/SJISPropTest.java b/jdk/test/java/nio/charset/coders/SJISPropTest.java new file mode 100644 index 00000000000..4d09c53561c --- /dev/null +++ b/jdk/test/java/nio/charset/coders/SJISPropTest.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * + * + * Regression test class run by CheckSJISMappingProp.sh to verify + * that sun.nio.cs.map property is correctly interpreted in + * multibyte Japanese locales + * + */ + +public class SJISPropTest { + public static void main(String[] args) throws Exception { + boolean sjisIsMS932 = false; + + if (args[0].equals("MS932")) + sjisIsMS932 = true; + byte[] testBytes = { (byte)0x81, (byte)0x60 }; + + // JIS X based Shift_JIS and Windows-31J differ + // in a number of mappings including this one. + + String expectedMS932 = new String("\uFF5E"); + String expectedSJIS = new String("\u301C"); + + // Alias "shift_jis" will map to Windows-31J + // if the sun.nio.cs.map system property is defined as + // "Windows-31J/Shift_JIS". This should work in all + // multibyte (especially Japanese) locales. + + String s = new String(testBytes, "shift_jis"); + + if (sjisIsMS932 && !s.equals(expectedMS932)) + throw new Exception("not MS932"); + else if (!sjisIsMS932 && !s.equals(expectedSJIS)) + throw new Exception("not SJIS"); + } +} diff --git a/jdk/test/java/nio/charset/coders/StreamTimeout.java b/jdk/test/java/nio/charset/coders/StreamTimeout.java new file mode 100644 index 00000000000..a0ccfaced2f --- /dev/null +++ b/jdk/test/java/nio/charset/coders/StreamTimeout.java @@ -0,0 +1,137 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @bug 4521942 + * @summary Ensure that InputStreamReaders work properly + * when the underlying byte stream times out + */ + +import java.net.*; +import java.io.*; + + +public class StreamTimeout { + + private static PrintStream log = System.err; + + private static String charset = "US-ASCII"; + + private static Object lock = new Object(); + private static synchronized void waitABit(int millisec) { + synchronized(lock) { + try { + lock.wait(millisec); + } catch (InterruptedException e) { + //ignore + } + } + } + + private static class Client extends Thread { + public void run() { + try { + Socket so = new Socket("127.0.0.1", 22222); + Writer wr = new OutputStreamWriter(so.getOutputStream(), + charset); + wr.write("ab"); + wr.flush(); + } catch (IOException x) { + log.print("Unexpected exception in writer: "); + x.printStackTrace(); + System.exit(1); + } + } + } + + private static void gobble(InputStream is, Reader rd, + int ec, boolean force) + throws Exception + { + int a = is.available(); + boolean r = rd.ready(); + log.print("" + a + " bytes available, " + + "reader " + (r ? "" : "not ") + "ready"); + if (!r && !force) { + log.println(); + return; + } + int c; + try { + c = rd.read(); + } catch (InterruptedIOException x) { + log.println(); + throw x; + } + log.println(", read() ==> " + + (c >= 0 ? ("'" + (char)c + "'" ): "EOF")); + if (c != ec) + throw new Exception("Incorrect value read: Expected " + + ec + ", read " + (char)c); + } + + public static void main(String[] args) throws Exception { + + if (args.length > 0) + charset = args[0]; + + ServerSocket ss = new ServerSocket(22222); + Thread cl = new Client(); + cl.start(); + Socket s = ss.accept(); + s.setSoTimeout(150); + InputStream is = s.getInputStream(); + Reader rd = new InputStreamReader(is, charset); + + while (is.available() <= 0) + Thread.yield(); + + gobble(is, rd, 'a', false); + gobble(is, rd, 'b', false); + gobble(is, rd, -1, false); + + boolean caught = false; + try { + gobble(is, rd, -1, true); + } catch (InterruptedIOException e) { + log.println("Read timed out, as expected"); + caught = true; + } + if (!caught) { + log.println("Read did not time out, test inapplicable"); + return; + } + + caught = false; + try { + gobble(is, rd, -1, true); + } catch (InterruptedIOException x) { + log.println("Second read timed out, as expected"); + caught = true; + } + if (!caught) + throw new Exception("Second read completed"); + + } + +} diff --git a/jdk/test/java/nio/charset/coders/Surrogate.java b/jdk/test/java/nio/charset/coders/Surrogate.java new file mode 100644 index 00000000000..a99828d1d0f --- /dev/null +++ b/jdk/test/java/nio/charset/coders/Surrogate.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +public class Surrogate { + + public static final int UCS4_SURROGATE_MIN = 0x10000; + public static final int UCS4_MAX = (1 << 20) + UCS4_SURROGATE_MIN - 1; + + // UTF-16 surrogate-character ranges + // + public static final char MIN_HIGH = '\uD800'; + public static final char MAX_HIGH = '\uDBFF'; + public static final char MIN_LOW = '\uDC00'; + public static final char MAX_LOW = '\uDFFF'; + public static final char MIN = MIN_HIGH; + public static final char MAX = MAX_LOW; + + public static boolean neededFor(int uc) { + return (uc >= UCS4_SURROGATE_MIN) && (uc <= UCS4_MAX); + } + + public static boolean isHigh(int c) { + return (MIN_HIGH <= c) && (c <= MAX_HIGH); + } + + static char high(int uc) { + return (char)(0xd800 | (((uc - UCS4_SURROGATE_MIN) >> 10) & 0x3ff)); + } + + public static boolean isLow(int c) { + return (MIN_LOW <= c) && (c <= MAX_LOW); + } + + static char low(int uc) { + return (char)(0xdc00 | ((uc - UCS4_SURROGATE_MIN) & 0x3ff)); + } + + public static boolean is(int c) { + return (MIN <= c) && (c <= MAX); + } + + static int toUCS4(char c, char d) { + return (((c & 0x3ff) << 10) | (d & 0x3ff)) + 0x10000; + } + +} diff --git a/jdk/test/java/nio/charset/coders/Surrogates.java b/jdk/test/java/nio/charset/coders/Surrogates.java new file mode 100644 index 00000000000..ce776fbbabc --- /dev/null +++ b/jdk/test/java/nio/charset/coders/Surrogates.java @@ -0,0 +1,90 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @summary Check that array-crossing surrogate pairs are handled properly + */ + +import java.io.*; +import java.nio.*; +import java.nio.charset.*; + + +public class Surrogates { + + static PrintStream log = System.err; + + static char[] input; + static byte[] output; + + static final int LEN = 128; + + static void initData() throws IOException { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < LEN; i++) { + int c = Surrogate.UCS4_SURROGATE_MIN + 1; + sb.append(Surrogate.high(c)); + sb.append(Surrogate.low(c)); + } + input = sb.toString().toCharArray(); + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + OutputStreamWriter osw + = new OutputStreamWriter(bos, Charset.forName("UTF-8")); + osw.write(input); + osw.close(); + output = bos.toByteArray(); + } + + static void testLeftovers(boolean doMalformed) + throws Exception + { + log.print("Leftover surrogates, doMalformed = " + doMalformed); + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + OutputStreamWriter osw + = new OutputStreamWriter(bos, Charset.forName("UTF-8")); + for (int i = 0; i < input.length; i += 7) + osw.write(input, i, Math.min(input.length - i, 7)); + if (doMalformed) + osw.write(input, 0, 1); + osw.close(); + byte[] result = bos.toByteArray(); + + // Ignore a trailing '?' if we wrote a malformed final surrogate + int rl = result.length + (doMalformed ? -1 : 0); + + if (rl != output.length) + throw new Exception("Incorrect result length " + + rl + ", expected " + output.length); + for (int i = 0; i < output.length; i++) + if (result[i] != output[i]) + throw new Exception("Unexpected result value at index " + i); + log.println(": Passed"); + } + + public static void main(String[] args) throws Exception { + initData(); + testLeftovers(false); + testLeftovers(true); + } + +} diff --git a/jdk/test/java/nio/charset/coders/Util.java b/jdk/test/java/nio/charset/coders/Util.java new file mode 100644 index 00000000000..7e2128ff55f --- /dev/null +++ b/jdk/test/java/nio/charset/coders/Util.java @@ -0,0 +1,114 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + + +public class Util { + + private Util() { } + + // Returns -1 if equal, o.w. returns index of first difference + // + public static int cmp(byte[] ba, byte[] bb) { + int n = Math.min(ba.length, bb.length); + for (int i = 0; i < n; i++) { + if ((i >= ba.length) || (i >= bb.length)) + return i; + if (ba[i] != bb[i]) + return i; + } + if (ba.length != bb.length) + return 0; + return -1; + } + + // Returns -1 if equal, o.w. returns index of first difference + // + public static int cmp(char[] ca, char[] cb) { + int n = Math.min(ca.length, cb.length); + for (int i = 0; i < n; i++) { + if ((i >= ca.length) || (i >= cb.length)) + return i; + if (ca[i] != cb[i]) + return i; + } + if (ca.length != cb.length) + return 0; + return -1; + } + + public static String toString(byte[] ba, int off, int len) { + StringBuffer sb = new StringBuffer(); + for (int i = off; i < off + len; i++) { + int c = ba[i]; + if (c == '\\') { + sb.append("\\\\"); + continue; + } + if ((c >= ' ') && (c < 0x7f)) { + sb.append((char)c); + continue; + } + sb.append("\\x"); + sb.append(Integer.toHexString(c & 0xff)); + } + return sb.toString(); + } + + public static String toString(byte[] ba) { + return toString(ba, 0, ba.length); + } + + public static String toString(char[] ca, int off, int len) { + StringBuffer sb = new StringBuffer(); + for (int i = off; i < off + len; i++) { + char c = ca[i]; + if (c == '\\') { + sb.append("\\\\"); + continue; + } + if ((c >= ' ') && (c < 0x7f)) { + sb.append(c); + continue; + } + sb.append("\\u"); + String s = Integer.toHexString(c); + while (s.length() < 4) + s = "0" + s; + sb.append(s); + } + return sb.toString(); + } + + public static String toString(char[] ca) { + return toString(ca, 0, ca.length); + } + + public static String toString(String s) { + return toString(s.toCharArray()); + } + + public static String toString(char c) { + return toString(new char[]{ c }); + } + +} diff --git a/jdk/test/java/nio/charset/coders/ref.shift_jis b/jdk/test/java/nio/charset/coders/ref.shift_jis new file mode 100644 index 00000000000..0bca6c5a9f5 --- /dev/null +++ b/jdk/test/java/nio/charset/coders/ref.shift_jis @@ -0,0 +1,7072 @@ +0 00 +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +9 09 +a 0a +b 0b +c 0c +d 0d +e 0e +f 0f +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +1a 1a +1b 1b +1c 1c +1d 1d +1e 1e +1f 1f +20 20 +21 21 +22 22 +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +2a 2a +2b 2b +2c 2c +2d 2d +2e 2e +2f 2f +30 30 +31 31 +32 32 +33 33 +34 34 +35 35 +36 36 +37 37 +38 38 +39 39 +3a 3a +3b 3b +3c 3c +3d 3d +3e 3e +3f 3f +40 40 +41 41 +42 42 +43 43 +44 44 +45 45 +46 46 +47 47 +48 48 +49 49 +4a 4a +4b 4b +4c 4c +4d 4d +4e 4e +4f 4f +50 50 +51 51 +52 52 +53 53 +54 54 +55 55 +56 56 +57 57 +58 58 +59 59 +5a 5a +5b 5b +5c 5c +5d 5d +5e 5e +5f 5f +60 60 +61 61 +62 62 +63 63 +64 64 +65 65 +66 66 +67 67 +68 68 +69 69 +6a 6a +6b 6b +6c 6c +6d 6d +6e 6e +6f 6f +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +7a 7a +7b 7b +7c 7c +7d 7d +7e 7e +7f 7f +a2 8191 +a3 8192 +#a5 5c +a7 8198 +a8 814e +ac 81ca +b0 818b +b1 817d +b4 814c +b6 81f7 +d7 817e +f7 8180 +391 839f +392 83a0 +393 83a1 +394 83a2 +395 83a3 +396 83a4 +397 83a5 +398 83a6 +399 83a7 +39a 83a8 +39b 83a9 +39c 83aa +39d 83ab +39e 83ac +39f 83ad +3a0 83ae +3a1 83af +3a3 83b0 +3a4 83b1 +3a5 83b2 +3a6 83b3 +3a7 83b4 +3a8 83b5 +3a9 83b6 +3b1 83bf +3b2 83c0 +3b3 83c1 +3b4 83c2 +3b5 83c3 +3b6 83c4 +3b7 83c5 +3b8 83c6 +3b9 83c7 +3ba 83c8 +3bb 83c9 +3bc 83ca +3bd 83cb +3be 83cc +3bf 83cd +3c0 83ce +3c1 83cf +3c3 83d0 +3c4 83d1 +3c5 83d2 +3c6 83d3 +3c7 83d4 +3c8 83d5 +3c9 83d6 +401 8446 +410 8440 +411 8441 +412 8442 +413 8443 +414 8444 +415 8445 +416 8447 +417 8448 +418 8449 +419 844a +41a 844b +41b 844c +41c 844d +41d 844e +41e 844f +41f 8450 +420 8451 +421 8452 +422 8453 +423 8454 +424 8455 +425 8456 +426 8457 +427 8458 +428 8459 +429 845a +42a 845b +42b 845c +42c 845d +42d 845e +42e 845f +42f 8460 +430 8470 +431 8471 +432 8472 +433 8473 +434 8474 +435 8475 +436 8477 +437 8478 +438 8479 +439 847a +43a 847b +43b 847c +43c 847d +43d 847e +43e 8480 +43f 8481 +440 8482 +441 8483 +442 8484 +443 8485 +444 8486 +445 8487 +446 8488 +447 8489 +448 848a +449 848b +44a 848c +44b 848d +44c 848e +44d 848f +44e 8490 +44f 8491 +451 8476 +2010 815d +2014 815c +2016 8161 +2018 8165 +2019 8166 +201c 8167 +201d 8168 +2020 81f5 +2021 81f6 +2025 8164 +2026 8163 +2030 81f1 +2032 818c +2033 818d +203b 81a6 +#203e 7e +2103 818e +212b 81f0 +2190 81a9 +2191 81aa +2192 81a8 +2193 81ab +21d2 81cb +21d4 81cc +2200 81cd +2202 81dd +2203 81ce +2207 81de +2208 81b8 +220b 81b9 +2212 817c +221a 81e3 +221d 81e5 +221e 8187 +2220 81da +2227 81c8 +2228 81c9 +2229 81bf +222a 81be +222b 81e7 +222c 81e8 +2234 8188 +2235 81e6 +223d 81e4 +2252 81e0 +2260 8182 +2261 81df +2266 8185 +2267 8186 +226a 81e1 +226b 81e2 +2282 81bc +2283 81bd +2286 81ba +2287 81bb +22a5 81db +2312 81dc +2500 849f +2501 84aa +2502 84a0 +2503 84ab +250c 84a1 +250f 84ac +2510 84a2 +2513 84ad +2514 84a4 +2517 84af +2518 84a3 +251b 84ae +251c 84a5 +251d 84ba +2520 84b5 +2523 84b0 +2524 84a7 +2525 84bc +2528 84b7 +252b 84b2 +252c 84a6 +252f 84b6 +2530 84bb +2533 84b1 +2534 84a8 +2537 84b8 +2538 84bd +253b 84b3 +253c 84a9 +253f 84b9 +2542 84be +254b 84b4 +25a0 81a1 +25a1 81a0 +25b2 81a3 +25b3 81a2 +25bc 81a5 +25bd 81a4 +25c6 819f +25c7 819e +25cb 819b +25ce 819d +25cf 819c +25ef 81fc +2605 819a +2606 8199 +2640 818a +2642 8189 +266a 81f4 +266d 81f3 +266f 81f2 +3000 8140 +3001 8141 +3002 8142 +3003 8156 +3005 8158 +3006 8159 +3007 815a +3008 8171 +3009 8172 +300a 8173 +300b 8174 +300c 8175 +300d 8176 +300e 8177 +300f 8178 +3010 8179 +3011 817a +3012 81a7 +3013 81ac +3014 816b +3015 816c +301c 8160 +3041 829f +3042 82a0 +3043 82a1 +3044 82a2 +3045 82a3 +3046 82a4 +3047 82a5 +3048 82a6 +3049 82a7 +304a 82a8 +304b 82a9 +304c 82aa +304d 82ab +304e 82ac +304f 82ad +3050 82ae +3051 82af +3052 82b0 +3053 82b1 +3054 82b2 +3055 82b3 +3056 82b4 +3057 82b5 +3058 82b6 +3059 82b7 +305a 82b8 +305b 82b9 +305c 82ba +305d 82bb +305e 82bc +305f 82bd +3060 82be +3061 82bf +3062 82c0 +3063 82c1 +3064 82c2 +3065 82c3 +3066 82c4 +3067 82c5 +3068 82c6 +3069 82c7 +306a 82c8 +306b 82c9 +306c 82ca +306d 82cb +306e 82cc +306f 82cd +3070 82ce +3071 82cf +3072 82d0 +3073 82d1 +3074 82d2 +3075 82d3 +3076 82d4 +3077 82d5 +3078 82d6 +3079 82d7 +307a 82d8 +307b 82d9 +307c 82da +307d 82db +307e 82dc +307f 82dd +3080 82de +3081 82df +3082 82e0 +3083 82e1 +3084 82e2 +3085 82e3 +3086 82e4 +3087 82e5 +3088 82e6 +3089 82e7 +308a 82e8 +308b 82e9 +308c 82ea +308d 82eb +308e 82ec +308f 82ed +3090 82ee +3091 82ef +3092 82f0 +3093 82f1 +309b 814a +309c 814b +309d 8154 +309e 8155 +30a1 8340 +30a2 8341 +30a3 8342 +30a4 8343 +30a5 8344 +30a6 8345 +30a7 8346 +30a8 8347 +30a9 8348 +30aa 8349 +30ab 834a +30ac 834b +30ad 834c +30ae 834d +30af 834e +30b0 834f +30b1 8350 +30b2 8351 +30b3 8352 +30b4 8353 +30b5 8354 +30b6 8355 +30b7 8356 +30b8 8357 +30b9 8358 +30ba 8359 +30bb 835a +30bc 835b +30bd 835c +30be 835d +30bf 835e +30c0 835f +30c1 8360 +30c2 8361 +30c3 8362 +30c4 8363 +30c5 8364 +30c6 8365 +30c7 8366 +30c8 8367 +30c9 8368 +30ca 8369 +30cb 836a +30cc 836b +30cd 836c +30ce 836d +30cf 836e +30d0 836f +30d1 8370 +30d2 8371 +30d3 8372 +30d4 8373 +30d5 8374 +30d6 8375 +30d7 8376 +30d8 8377 +30d9 8378 +30da 8379 +30db 837a +30dc 837b +30dd 837c +30de 837d +30df 837e +30e0 8380 +30e1 8381 +30e2 8382 +30e3 8383 +30e4 8384 +30e5 8385 +30e6 8386 +30e7 8387 +30e8 8388 +30e9 8389 +30ea 838a +30eb 838b +30ec 838c +30ed 838d +30ee 838e +30ef 838f +30f0 8390 +30f1 8391 +30f2 8392 +30f3 8393 +30f4 8394 +30f5 8395 +30f6 8396 +30fb 8145 +30fc 815b +30fd 8152 +30fe 8153 +4e00 88ea +4e01 929a +4e03 8eb5 +4e07 969c +4e08 8fe4 +4e09 8e4f +4e0a 8fe3 +4e0b 89ba +4e0d 9573 +4e0e 975e +4e10 98a0 +4e11 894e +4e14 8a8e +4e15 98a1 +4e16 90a2 +4e17 99c0 +4e18 8b75 +4e19 95b8 +4e1e 8fe5 +4e21 97bc +4e26 95c0 +4e2a 98a2 +4e2d 9286 +4e31 98a3 +4e32 8bf8 +4e36 98a4 +4e38 8adb +4e39 924f +4e3b 8ee5 +4e3c 98a5 +4e3f 98a6 +4e42 98a7 +4e43 9454 +4e45 8b76 +4e4b 9456 +4e4d 93e1 +4e4e 8cc1 +4e4f 9652 +4e55 e568 +4e56 98a8 +4e57 8fe6 +4e58 98a9 +4e59 89b3 +4e5d 8be3 +4e5e 8cee +4e5f 96e7 +4e62 9ba4 +4e71 9790 +4e73 93fb +4e7e 8aa3 +4e80 8b54 +4e82 98aa +4e85 98ab +4e86 97b9 +4e88 975c +4e89 9188 +4e8a 98ad +4e8b 8e96 +4e8c 93f1 +4e8e 98b0 +4e91 895d +4e92 8cdd +4e94 8cdc +4e95 88e4 +4e98 986a +4e99 9869 +4e9b 8db1 +4e9c 889f +4e9e 98b1 +4e9f 98b2 +4ea0 98b3 +4ea1 9653 +4ea2 98b4 +4ea4 8cf0 +4ea5 88e5 +4ea6 9692 +4ea8 8b9c +4eab 8b9d +4eac 8b9e +4ead 92e0 +4eae 97ba +4eb0 98b5 +4eb3 98b6 +4eb6 98b7 +4eba 906c +4ec0 8f59 +4ec1 906d +4ec2 98bc +4ec4 98ba +4ec6 98bb +4ec7 8b77 +4eca 8da1 +4ecb 89ee +4ecd 98b9 +4ece 98b8 +4ecf 95a7 +4ed4 8e65 +4ed5 8e64 +4ed6 91bc +4ed7 98bd +4ed8 9574 +4ed9 90e5 +4edd 8157 +4ede 98be +4edf 98c0 +4ee3 91e3 +4ee4 97df +4ee5 88c8 +4eed 98bf +4eee 89bc +4ef0 8bc2 +4ef2 9287 +4ef6 8c8f +4ef7 98c1 +4efb 9443 +4f01 8ae9 +4f09 98c2 +4f0a 88c9 +4f0d 8cde +4f0e 8aea +4f0f 959a +4f10 94b0 +4f11 8b78 +4f1a 89ef +4f1c 98e5 +4f1d 9360 +4f2f 948c +4f30 98c4 +4f34 94ba +4f36 97e0 +4f38 904c +4f3a 8e66 +4f3c 8e97 +4f3d 89be +4f43 92cf +4f46 9241 +4f47 98c8 +4f4d 88ca +4f4e 92e1 +4f4f 8f5a +4f50 8db2 +4f51 9743 +4f53 91cc +4f55 89bd +4f57 98c7 +4f59 975d +4f5a 98c3 +4f5b 98c5 +4f5c 8dec +4f5d 98c6 +4f5e 9b43 +4f69 98ce +4f6f 98d1 +4f70 98cf +4f73 89c0 +4f75 95b9 +4f76 98c9 +4f7b 98cd +4f7c 8cf1 +4f7f 8e67 +4f83 8aa4 +4f86 98d2 +4f88 98ca +4f8b 97e1 +4f8d 8e98 +4f8f 98cb +4f91 98d0 +4f96 98d3 +4f98 98cc +4f9b 8b9f +4f9d 88cb +4fa0 8ba0 +4fa1 89bf +4fab 9b44 +4fad 9699 +4fae 958e +4faf 8cf2 +4fb5 904e +4fb6 97b5 +4fbf 95d6 +4fc2 8c57 +4fc3 91a3 +4fc4 89e2 +4fca 8f72 +4fce 98d7 +4fd0 98dc +4fd1 98da +4fd4 98d5 +4fd7 91ad +4fd8 98d8 +4fda 98db +4fdb 98d9 +4fdd 95db +4fdf 98d6 +4fe1 904d +4fe3 9693 +4fe4 98dd +4fe5 98de +4fee 8f43 +4fef 98eb +4ff3 946f +4ff5 9555 +4ff6 98e6 +4ff8 95ee +4ffa 89b4 +4ffe 98ea +5005 98e4 +5006 98ed +5009 9171 +500b 8cc2 +500d 947b +500f e0c5 +5011 98ec +5012 937c +5014 98e1 +5016 8cf4 +5019 8cf3 +501a 98df +501f 8ed8 +5021 98e7 +5023 95ed +5024 926c +5025 98e3 +5026 8c91 +5028 98e0 +5029 98e8 +502a 98e2 +502b 97cf +502c 98e9 +502d 9860 +5036 8be4 +5039 8c90 +5043 98ee +5047 98ef +5048 98f3 +5049 88cc +504f 95ce +5050 98f2 +5055 98f1 +5056 98f5 +505a 98f4 +505c 92e2 +5065 8c92 +506c 98f6 +5072 8ec3 +5074 91a4 +5075 92e3 +5076 8bf4 +5078 98f7 +507d 8b55 +5080 98f8 +5085 98fa +508d 9654 +5091 8c86 +5098 8e50 +5099 94f5 +509a 98f9 +50ac 8dc3 +50ad 9762 +50b2 98fc +50b3 9942 +50b4 98fb +50b5 8dc2 +50b7 8f9d +50be 8c58 +50c2 9943 +50c5 8bcd +50c9 9940 +50ca 9941 +50cd 93ad +50cf 919c +50d1 8ba1 +50d5 966c +50d6 9944 +50da 97bb +50de 9945 +50e3 9948 +50e5 9946 +50e7 916d +50ed 9947 +50ee 9949 +50f5 994b +50f9 994a +50fb 95c6 +5100 8b56 +5101 994d +5102 994e +5104 89ad +5109 994c +5112 8ef2 +5114 9951 +5115 9950 +5116 994f +5118 98d4 +511a 9952 +511f 8f9e +5121 9953 +512a 9744 +5132 96d7 +5137 9955 +513a 9954 +513b 9957 +513c 9956 +513f 9958 +5140 9959 +5141 88f2 +5143 8cb3 +5144 8c5a +5145 8f5b +5146 929b +5147 8ba2 +5148 90e6 +5149 8cf5 +514b 8d8e +514c 995b +514d 96c6 +514e 9365 +5150 8e99 +5152 995a +5154 995c +515a 937d +515c 8a95 +5162 995d +5165 93fc +5168 9153 +5169 995f +516a 9960 +516b 94aa +516c 8cf6 +516d 985a +516e 9961 +5171 8ba4 +5175 95ba +5176 91b4 +5177 8bef +5178 9354 +517c 8c93 +5180 9962 +5182 9963 +5185 93e0 +5186 897e +5189 9966 +518a 8dfb +518c 9965 +518d 8dc4 +518f 9967 +5190 e3ec +5191 9968 +5192 9660 +5193 9969 +5195 996a +5196 996b +5197 8fe7 +5199 8eca +51a0 8aa5 +51a2 996e +51a4 996c +51a5 96bb +51a6 996d +51a8 9579 +51a9 996f +51aa 9970 +51ab 9971 +51ac 937e +51b0 9975 +51b1 9973 +51b2 9974 +51b3 9972 +51b4 8de1 +51b5 9976 +51b6 96e8 +51b7 97e2 +51bd 9977 +51c4 90a6 +51c5 9978 +51c6 8f79 +51c9 9979 +51cb 929c +51cc 97bd +51cd 9380 +51d6 99c3 +51db 997a +51dc eaa3 +51dd 8bc3 +51e0 997b +51e1 967d +51e6 8f88 +51e7 91fa +51e9 997d +51ea 93e2 +51ed 997e +51f0 9980 +51f1 8a4d +51f5 9981 +51f6 8ba5 +51f8 93ca +51f9 899a +51fa 8f6f +51fd 949f +51fe 9982 +5200 9381 +5203 906e +5204 9983 +5206 95aa +5207 90d8 +5208 8aa0 +520a 8aa7 +520b 9984 +520e 9986 +5211 8c59 +5214 9985 +5217 97f1 +521d 8f89 +5224 94bb +5225 95ca +5227 9987 +5229 9798 +522a 9988 +522e 9989 +5230 939e +5233 998a +5236 90a7 +5237 8dfc +5238 8c94 +5239 998b +523a 8e68 +523b 8d8f +5243 92e4 +5244 998d +5247 91a5 +524a 8ded +524b 998e +524c 998f +524d 914f +524f 998c +5254 9991 +5256 9655 +525b 8d84 +525e 9990 +5263 8c95 +5264 8ddc +5265 948d +5269 9994 +526a 9992 +526f 959b +5270 8fe8 +5271 999b +5272 8a84 +5273 9995 +5274 9993 +5275 916e +527d 9997 +527f 9996 +5283 8a63 +5287 8c80 +5288 999c +5289 97ab +528d 9998 +5291 999d +5292 999a +5294 9999 +529b 97cd +529f 8cf7 +52a0 89c1 +52a3 97f2 +52a9 8f95 +52aa 9377 +52ab 8d85 +52ac 99a0 +52ad 99a1 +52b1 97e3 +52b4 984a +52b5 99a3 +52b9 8cf8 +52bc 99a2 +52be 8a4e +52c1 99a4 +52c3 9675 +52c5 92ba +52c7 9745 +52c9 95d7 +52cd 99a5 +52d2 e8d3 +52d5 93ae +52d7 99a6 +52d8 8aa8 +52d9 96b1 +52dd 8f9f +52de 99a7 +52df 95e5 +52e0 99ab +52e2 90a8 +52e3 99a8 +52e4 8bce +52e6 99a9 +52e7 8aa9 +52f2 8c4d +52f3 99ac +52f5 99ad +52f8 99ae +52f9 99af +52fa 8ed9 +52fe 8cf9 +52ff 96dc +5301 96e6 +5302 93f5 +5305 95ef +5306 99b0 +5308 99b1 +530d 99b3 +530f 99b5 +5310 99b4 +5315 99b6 +5316 89bb +5317 966b +5319 8dfa +531a 99b7 +531d 9178 +5320 8fa0 +5321 8ba7 +5323 99b8 +532a 94d9 +532f 99b9 +5331 99ba +5333 99bb +5338 99bc +5339 9543 +533a 8be6 +533b 88e3 +533f 93bd +5340 99bd +5341 8f5c +5343 90e7 +5345 99bf +5346 99be +5347 8fa1 +5348 8cdf +5349 99c1 +534a 94bc +534d 99c2 +5351 94da +5352 91b2 +5353 91ec +5354 8ba6 +5357 93ec +5358 9250 +535a 948e +535c 966d +535e 99c4 +5360 90e8 +5366 8c54 +5369 99c5 +536e 99c6 +536f 894b +5370 88f3 +5371 8aeb +5373 91a6 +5374 8b70 +5375 9791 +5377 99c9 +5378 89b5 +537b 99c8 +537f 8ba8 +5382 99ca +5384 96ef +5396 99cb +5398 97d0 +539a 8cfa +539f 8cb4 +53a0 99cc +53a5 99ce +53a6 99cd +53a8 907e +53a9 8958 +53ad 897d +53ae 99cf +53b0 99d0 +53b3 8cb5 +53b6 99d1 +53bb 8b8e +53c2 8e51 +53c3 99d2 +53c8 9694 +53c9 8db3 +53ca 8b79 +53cb 9746 +53cc 916f +53cd 94bd +53ce 8efb +53d4 8f66 +53d6 8ee6 +53d7 8ef3 +53d9 8f96 +53db 94be +53df 99d5 +53e1 8962 +53e2 9170 +53e3 8cfb +53e4 8cc3 +53e5 8be5 +53e8 99d9 +53e9 9240 +53ea 91fc +53eb 8ba9 +53ec 8fa2 +53ed 99da +53ee 99d8 +53ef 89c2 +53f0 91e4 +53f1 8eb6 +53f2 8e6a +53f3 8945 +53f6 8a90 +53f7 8d86 +53f8 8e69 +53fa 99db +5401 99dc +5403 8b68 +5404 8a65 +5408 8d87 +5409 8b67 +540a 92dd +540b 8944 +540c 93af +540d 96bc +540e 8d40 +540f 9799 +5410 9366 +5411 8cfc +541b 8c4e +541d 99e5 +541f 8be1 +5420 9669 +5426 94db +5429 99e4 +542b 8adc +542c 99df +542d 99e0 +542e 99e2 +5436 99e3 +5438 8b7a +5439 9081 +543b 95ab +543c 99e1 +543d 99dd +543e 8ce1 +5440 99de +5442 9843 +5446 95f0 +5448 92e6 +5449 8ce0 +544a 8d90 +544e 99e6 +5451 93db +545f 99ea +5468 8efc +546a 8ef4 +5470 99ed +5471 99eb +5473 96a1 +5475 99e8 +5476 99f1 +5477 99ec +547b 99ef +547c 8cc4 +547d 96bd +5480 99f0 +5484 99f2 +5486 99f4 +548b 8dee +548c 9861 +548e 99e9 +548f 99e7 +5490 99f3 +5492 99ee +54a2 99f6 +54a4 9a42 +54a5 99f8 +54a8 99fc +54ab 9a40 +54ac 99f9 +54af 9a5d +54b2 8de7 +54b3 8a50 +54b8 99f7 +54bc 9a44 +54bd 88f4 +54be 9a43 +54c0 88a3 +54c1 9569 +54c2 9a41 +54c4 99fa +54c7 99f5 +54c8 99fb +54c9 8dc6 +54d8 9a45 +54e1 88f5 +54e2 9a4e +54e5 9a46 +54e6 9a47 +54e8 8fa3 +54e9 9689 +54ed 9a4c +54ee 9a4b +54f2 934e +54fa 9a4d +54fd 9a4a +5504 8953 +5506 8db4 +5507 904f +550f 9a48 +5510 9382 +5514 9a49 +5516 88a0 +552e 9a53 +552f 9742 +5531 8fa5 +5533 9a59 +5538 9a58 +5539 9a4f +553e 91c1 +5540 9a50 +5544 91ed +5545 9a55 +5546 8fa4 +554c 9a52 +554f 96e2 +5553 8c5b +5556 9a56 +5557 9a57 +555c 9a54 +555d 9a5a +5563 9a51 +557b 9a60 +557c 9a65 +557e 9a61 +5580 9a5c +5583 9a66 +5584 9150 +5587 9a68 +5589 8d41 +558a 9a5e +558b 929d +5598 9a62 +5599 9a5b +559a 8aab +559c 8aec +559d 8a85 +559e 9a63 +559f 9a5f +55a7 8c96 +55a8 9a69 +55a9 9a67 +55aa 9172 +55ab 8b69 +55ac 8baa +55ae 9a64 +55b0 8bf2 +55b6 8963 +55c4 9a6d +55c5 9a6b +55c7 9aa5 +55d4 9a70 +55da 9a6a +55dc 9a6e +55df 9a6c +55e3 8e6b +55e4 9a6f +55f7 9a72 +55f9 9a77 +55fd 9a75 +55fe 9a74 +5606 9251 +5609 89c3 +5614 9a71 +5616 9a73 +5617 8fa6 +5618 8952 +561b 9a76 +5629 89dc +562f 9a82 +5631 8ffa +5632 9a7d +5634 9a7b +5636 9a7c +5638 9a7e +5642 895c +564c 9158 +564e 9a78 +5650 9a79 +565b 8a9a +5664 9a81 +5668 8aed +566a 9a84 +566b 9a80 +566c 9a83 +5674 95ac +5678 93d3 +567a 94b6 +5680 9a86 +5686 9a85 +5687 8a64 +568a 9a87 +568f 9a8a +5694 9a89 +56a0 9a88 +56a2 9458 +56a5 9a8b +56ae 9a8c +56b4 9a8e +56b6 9a8d +56bc 9a90 +56c0 9a93 +56c1 9a91 +56c2 9a8f +56c3 9a92 +56c8 9a94 +56ce 9a95 +56d1 9a96 +56d3 9a97 +56d7 9a98 +56d8 9964 +56da 8efa +56db 8e6c +56de 89f1 +56e0 88f6 +56e3 9263 +56ee 9a99 +56f0 8da2 +56f2 88cd +56f3 907d +56f9 9a9a +56fa 8cc5 +56fd 8d91 +56ff 9a9c +5700 9a9b +5703 95de +5704 9a9d +5708 9a9f +5709 9a9e +570b 9aa0 +570d 9aa1 +570f 8c97 +5712 8980 +5713 9aa2 +5716 9aa4 +5718 9aa3 +571c 9aa6 +571f 9379 +5726 9aa7 +5727 88b3 +5728 8ddd +572d 8c5c +5730 926e +5737 9aa8 +5738 9aa9 +573b 9aab +5740 9aac +5742 8de2 +5747 8bcf +574a 9656 +574e 9aaa +574f 9aad +5750 8dbf +5751 8d42 +5761 9ab1 +5764 8da3 +5766 9252 +5769 9aae +576a 92d8 +577f 9ab2 +5782 9082 +5788 9ab0 +5789 9ab3 +578b 8c5e +5793 9ab4 +57a0 9ab5 +57a2 8d43 +57a3 8a5f +57a4 9ab7 +57aa 9ab8 +57b0 9ab9 +57b3 9ab6 +57c0 9aaf +57c3 9aba +57c6 9abb +57cb 9684 +57ce 8fe9 +57d2 9abd +57d3 9abe +57d4 9abc +57d6 9ac0 +57dc 9457 +57df 88e6 +57e0 9575 +57e3 9ac1 +57f4 8ffb +57f7 8eb7 +57f9 947c +57fa 8aee +57fc 8de9 +5800 9678 +5802 93b0 +5805 8c98 +5806 91cd +580a 9abf +580b 9ac2 +5815 91c2 +5819 9ac3 +581d 9ac4 +5821 9ac6 +5824 92e7 +582a 8aac +582f ea9f +5830 8981 +5831 95f1 +5834 8fea +5835 9367 +583a 8de4 +583d 9acc +5840 95bb +5841 97db +584a 89f2 +584b 9ac8 +5851 9159 +5852 9acb +5854 9383 +5857 9368 +5858 9384 +5859 94b7 +585a 92cb +585e 8dc7 +5862 9ac7 +5869 8996 +586b 9355 +5870 9ac9 +5872 9ac5 +5875 906f +5879 9acd +587e 8f6d +5883 8bab +5885 9ace +5893 95e6 +5897 919d +589c 92c4 +589f 9ad0 +58a8 966e +58ab 9ad1 +58ae 9ad6 +58b3 95ad +58b8 9ad5 +58b9 9acf +58ba 9ad2 +58bb 9ad4 +58be 8da4 +58c1 95c7 +58c5 9ad7 +58c7 9264 +58ca 89f3 +58cc 8feb +58d1 9ad9 +58d3 9ad8 +58d5 8d88 +58d7 9ada +58d8 9adc +58d9 9adb +58dc 9ade +58de 9ad3 +58df 9ae0 +58e4 9adf +58e5 9add +58eb 8e6d +58ec 9070 +58ee 9173 +58ef 9ae1 +58f0 90ba +58f1 88eb +58f2 9484 +58f7 92d9 +58f9 9ae3 +58fa 9ae2 +58fb 9ae4 +58fc 9ae5 +58fd 9ae6 +5902 9ae7 +5909 95cf +590a 9ae8 +590f 89c4 +5910 9ae9 +5915 975b +5916 8a4f +5918 99c7 +5919 8f67 +591a 91bd +591b 9aea +591c 96e9 +5922 96b2 +5925 9aec +5927 91e5 +5929 9356 +592a 91be +592b 9576 +592c 9aed +592d 9aee +592e 899b +5931 8eb8 +5932 9aef +5937 88ce +5938 9af0 +593e 9af1 +5944 8982 +5947 8aef +5948 93de +5949 95f2 +594e 9af5 +594f 9174 +5950 9af4 +5951 8c5f +5954 967a +5955 9af3 +5957 9385 +5958 9af7 +595a 9af6 +5960 9af9 +5962 9af8 +5965 899c +5967 9afa +5968 8fa7 +5969 9afc +596a 9244 +596c 9afb +596e 95b1 +5973 8f97 +5974 937a +5978 9b40 +597d 8d44 +5981 9b41 +5982 9440 +5983 94dc +5984 96cf +598a 9444 +598d 9b4a +5993 8b57 +5996 9764 +5999 96ad +599b 9baa +599d 9b42 +59a3 9b45 +59a5 91c3 +59a8 9657 +59ac 9369 +59b2 9b46 +59b9 9685 +59bb 8dc8 +59be 8fa8 +59c6 9b47 +59c9 8e6f +59cb 8e6e +59d0 88b7 +59d1 8cc6 +59d3 90a9 +59d4 88cf +59d9 9b4b +59da 9b4c +59dc 9b49 +59e5 8957 +59e6 8aad +59e8 9b48 +59ea 96c3 +59eb 9550 +59f6 88a6 +59fb 88f7 +59ff 8e70 +5a01 88d0 +5a03 88a1 +5a09 9b51 +5a11 9b4f +5a18 96ba +5a1a 9b52 +5a1c 9b50 +5a1f 9b4e +5a20 9050 +5a25 9b4d +5a29 95d8 +5a2f 8ce2 +5a35 9b56 +5a36 9b57 +5a3c 8fa9 +5a40 9b53 +5a41 984b +5a46 946b +5a49 9b55 +5a5a 8da5 +5a62 9b58 +5a66 9577 +5a6a 9b59 +5a6c 9b54 +5a7f 96b9 +5a92 947d +5a9a 9b5a +5a9b 9551 +5abc 9b5b +5abd 9b5f +5abe 9b5c +5ac1 89c5 +5ac2 9b5e +5ac9 8eb9 +5acb 9b5d +5acc 8c99 +5ad0 9b6b +5ad6 9b64 +5ad7 9b61 +5ae1 9284 +5ae3 9b60 +5ae6 9b62 +5ae9 9b63 +5afa 9b65 +5afb 9b66 +5b09 8af0 +5b0b 9b68 +5b0c 9b67 +5b16 9b69 +5b22 8fec +5b2a 9b6c +5b2c 92da +5b30 8964 +5b32 9b6a +5b36 9b6d +5b3e 9b6e +5b40 9b71 +5b43 9b6f +5b45 9b70 +5b50 8e71 +5b51 9b72 +5b54 8d45 +5b55 9b73 +5b57 8e9a +5b58 91b6 +5b5a 9b74 +5b5b 9b75 +5b5c 8e79 +5b5d 8d46 +5b5f 96d0 +5b63 8b47 +5b64 8cc7 +5b65 9b76 +5b66 8a77 +5b69 9b77 +5b6b 91b7 +5b70 9b78 +5b71 9ba1 +5b73 9b79 +5b75 9b7a +5b78 9b7b +5b7a 9b7d +5b80 9b7e +5b83 9b80 +5b85 91ee +5b87 8946 +5b88 8ee7 +5b89 88c0 +5b8b 9176 +5b8c 8aae +5b8d 8eb3 +5b8f 8d47 +5b95 9386 +5b97 8f40 +5b98 8aaf +5b99 9288 +5b9a 92e8 +5b9b 88b6 +5b9c 8b58 +5b9d 95f3 +5b9f 8ec0 +5ba2 8b71 +5ba3 90e9 +5ba4 8eba +5ba5 9747 +5ba6 9b81 +5bae 8b7b +5bb0 8dc9 +5bb3 8a51 +5bb4 8983 +5bb5 8faa +5bb6 89c6 +5bb8 9b82 +5bb9 9765 +5bbf 8f68 +5bc2 8ee2 +5bc3 9b83 +5bc4 8af1 +5bc5 93d0 +5bc6 96a7 +5bc7 9b84 +5bc9 9b85 +5bcc 9578 +5bd0 9b87 +5bd2 8aa6 +5bd3 8bf5 +5bd4 9b86 +5bdb 8ab0 +5bdd 9051 +5bde 9b8b +5bdf 8e40 +5be1 89c7 +5be2 9b8a +5be4 9b88 +5be5 9b8c +5be6 9b89 +5be7 944a +5be8 9ecb +5be9 9052 +5beb 9b8d +5bee 97be +5bf0 9b8e +5bf3 9b90 +5bf5 929e +5bf6 9b8f +5bf8 90a1 +5bfa 8e9b +5bfe 91ce +5bff 8ef5 +5c01 9595 +5c02 90ea +5c04 8ecb +5c05 9b91 +5c06 8fab +5c07 9b92 +5c08 9b93 +5c09 88d1 +5c0a 91b8 +5c0b 9071 +5c0d 9b94 +5c0e 93b1 +5c0f 8fac +5c11 8fad +5c13 9b95 +5c16 90eb +5c1a 8fae +5c20 9b96 +5c22 9b97 +5c24 96de +5c28 9b98 +5c2d 8bc4 +5c31 8f41 +5c38 9b99 +5c39 9b9a +5c3a 8eda +5c3b 904b +5c3c 93f2 +5c3d 9073 +5c3e 94f6 +5c3f 9441 +5c40 8bc7 +5c41 9b9b +5c45 8b8f +5c46 9b9c +5c48 8bfc +5c4a 93cd +5c4b 89ae +5c4d 8e72 +5c4e 9b9d +5c4f 9ba0 +5c50 9b9f +5c51 8bfb +5c53 9b9e +5c55 9357 +5c5e 91ae +5c60 936a +5c61 8ec6 +5c64 9177 +5c65 979a +5c6c 9ba2 +5c6e 9ba3 +5c6f 93d4 +5c71 8e52 +5c76 9ba5 +5c79 9ba6 +5c8c 9ba7 +5c90 8af2 +5c91 9ba8 +5c94 9ba9 +5ca1 89aa +5ca8 915a +5ca9 8ae2 +5cab 9bab +5cac 96a6 +5cb1 91d0 +5cb3 8a78 +5cb6 9bad +5cb7 9baf +5cb8 8add +5cbb 9bac +5cbc 9bae +5cbe 9bb1 +5cc5 9bb0 +5cc7 9bb2 +5cd9 9bb3 +5ce0 93bb +5ce1 8bac +5ce8 89e3 +5ce9 9bb4 +5cea 9bb9 +5ced 9bb7 +5cef 95f5 +5cf0 95f4 +5cf6 9387 +5cfa 9bb6 +5cfb 8f73 +5cfd 9bb5 +5d07 9092 +5d0b 9bba +5d0e 8de8 +5d11 9bc0 +5d14 9bc1 +5d15 9bbb +5d16 8a52 +5d17 9bbc +5d18 9bc5 +5d19 9bc4 +5d1a 9bc3 +5d1b 9bbf +5d1f 9bbe +5d22 9bc2 +5d29 95f6 +5d4b 9bc9 +5d4c 9bc6 +5d4e 9bc8 +5d50 9792 +5d52 9bc7 +5d5c 9bbd +5d69 9093 +5d6c 9bca +5d6f 8db5 +5d73 9bcb +5d76 9bcc +5d82 9bcf +5d84 9bce +5d87 9bcd +5d8b 9388 +5d8c 9bb8 +5d90 9bd5 +5d9d 9bd1 +5da2 9bd0 +5dac 9bd2 +5dae 9bd3 +5db7 9bd6 +5dba 97e4 +5dbc 9bd7 +5dbd 9bd4 +5dc9 9bd8 +5dcc 8ade +5dcd 9bd9 +5dd2 9bdb +5dd3 9bda +5dd6 9bdc +5ddb 9bdd +5ddd 90ec +5dde 8f42 +5de1 8f84 +5de3 9183 +5de5 8d48 +5de6 8db6 +5de7 8d49 +5de8 8b90 +5deb 9bde +5dee 8db7 +5df1 8cc8 +5df2 9bdf +5df3 96a4 +5df4 9462 +5df5 9be0 +5df7 8d4a +5dfb 8aaa +5dfd 9246 +5dfe 8bd0 +5e02 8e73 +5e03 957a +5e06 94bf +5e0b 9be1 +5e0c 8af3 +5e11 9be4 +5e16 929f +5e19 9be3 +5e1a 9be2 +5e1b 9be5 +5e1d 92e9 +5e25 9083 +5e2b 8e74 +5e2d 90c8 +5e2f 91d1 +5e30 8b41 +5e33 92a0 +5e36 9be6 +5e37 9be7 +5e38 8fed +5e3d 9658 +5e40 9bea +5e43 9be9 +5e44 9be8 +5e45 959d +5e47 9bf1 +5e4c 9679 +5e4e 9beb +5e54 9bed +5e55 968b +5e57 9bec +5e5f 9bee +5e61 94a6 +5e62 9bef +5e63 95bc +5e64 9bf0 +5e72 8ab1 +5e73 95bd +5e74 944e +5e75 9bf2 +5e76 9bf3 +5e78 8d4b +5e79 8ab2 +5e7a 9bf4 +5e7b 8cb6 +5e7c 9763 +5e7d 9748 +5e7e 8af4 +5e7f 9bf6 +5e81 92a1 +5e83 8d4c +5e84 8faf +5e87 94dd +5e8a 8fb0 +5e8f 8f98 +5e95 92ea +5e96 95f7 +5e97 9358 +5e9a 8d4d +5e9c 957b +5ea0 9bf7 +5ea6 9378 +5ea7 8dc0 +5eab 8cc9 +5ead 92eb +5eb5 88c1 +5eb6 8f8e +5eb7 8d4e +5eb8 9766 +5ec1 9bf8 +5ec2 9bf9 +5ec3 9470 +5ec8 9bfa +5ec9 97f5 +5eca 984c +5ecf 9bfc +5ed0 9bfb +5ed3 8a66 +5ed6 9c40 +5eda 9c43 +5edb 9c44 +5edd 9c42 +5edf 955f +5ee0 8fb1 +5ee1 9c46 +5ee2 9c45 +5ee3 9c41 +5ee8 9c47 +5ee9 9c48 +5eec 9c49 +5ef0 9c4c +5ef1 9c4a +5ef3 9c4b +5ef4 9c4d +5ef6 8984 +5ef7 92ec +5ef8 9c4e +5efa 8c9a +5efb 89f4 +5efc 9455 +5efe 9c4f +5eff 93f9 +5f01 95d9 +5f03 9c50 +5f04 984d +5f09 9c51 +5f0a 95be +5f0b 9c54 +5f0c 989f +5f0d 98af +5f0f 8eae +5f10 93f3 +5f11 9c55 +5f13 8b7c +5f14 92a2 +5f15 88f8 +5f16 9c56 +5f17 95a4 +5f18 8d4f +5f1b 926f +5f1f 92ed +5f25 96ed +5f26 8cb7 +5f27 8cca +5f29 9c57 +5f2d 9c58 +5f2f 9c5e +5f31 8ee3 +5f35 92a3 +5f37 8bad +5f38 9c59 +5f3c 954a +5f3e 9265 +5f41 9c5a +5f48 9c5b +5f4a 8bae +5f4c 9c5c +5f4e 9c5d +5f51 9c5f +5f53 9396 +5f56 9c60 +5f57 9c61 +5f59 9c62 +5f5c 9c53 +5f5d 9c52 +5f61 9c63 +5f62 8c60 +5f66 9546 +5f69 8dca +5f6a 9556 +5f6b 92a4 +5f6c 956a +5f6d 9c64 +5f70 8fb2 +5f71 8965 +5f73 9c65 +5f77 9c66 +5f79 96f0 +5f7c 94de +5f7f 9c69 +5f80 899d +5f81 90aa +5f82 9c68 +5f83 9c67 +5f84 8c61 +5f85 91d2 +5f87 9c6d +5f88 9c6b +5f8a 9c6a +5f8b 97a5 +5f8c 8ce3 +5f90 8f99 +5f91 9c6c +5f92 936b +5f93 8f5d +5f97 93be +5f98 9c70 +5f99 9c6f +5f9e 9c6e +5fa0 9c71 +5fa1 8ce4 +5fa8 9c72 +5fa9 959c +5faa 8f7a +5fad 9c73 +5fae 94f7 +5fb3 93bf +5fb4 92a5 +5fb9 934f +5fbc 9c74 +5fbd 8b4a +5fc3 9053 +5fc5 954b +5fcc 8af5 +5fcd 9445 +5fd6 9c75 +5fd7 8e75 +5fd8 9659 +5fd9 965a +5fdc 899e +5fdd 9c7a +5fe0 9289 +5fe4 9c77 +5feb 89f5 +5ff0 9cab +5ff1 9c79 +5ff5 944f +5ff8 9c78 +5ffb 9c76 +5ffd 8d9a +5fff 9c7c +600e 9c83 +600f 9c89 +6010 9c81 +6012 937b +6015 9c86 +6016 957c +6019 9c80 +601b 9c85 +601c 97e5 +601d 8e76 +6020 91d3 +6021 9c7d +6025 8b7d +6026 9c88 +6027 90ab +6028 8985 +6029 9c82 +602a 89f6 +602b 9c87 +602f 8baf +6031 9c84 +603a 9c8a +6041 9c8c +6042 9c96 +6043 9c94 +6046 9c91 +604a 9c90 +604b 97f6 +604d 9c92 +6050 8bb0 +6052 8d50 +6055 8f9a +6059 9c99 +605a 9c8b +605f 9c8f +6060 9c7e +6062 89f8 +6063 9c93 +6064 9c95 +6065 9270 +6068 8da6 +6069 89b6 +606a 9c8d +606b 9c98 +606c 9c97 +606d 8bb1 +606f 91a7 +6070 8a86 +6075 8c62 +6077 9c8e +6081 9c9a +6083 9c9d +6084 9c9f +6089 8ebb +608b 9ca5 +608c 92ee +608d 9c9b +6092 9ca3 +6094 89f7 +6096 9ca1 +6097 9ca2 +609a 9c9e +609b 9ca0 +609f 8ce5 +60a0 9749 +60a3 8ab3 +60a6 8978 +60a7 9ca4 +60a9 9459 +60aa 88ab +60b2 94df +60b3 9c7b +60b4 9caa +60b5 9cae +60b6 96e3 +60b8 9ca7 +60bc 9389 +60bd 9cac +60c5 8fee +60c6 9cad +60c7 93d5 +60d1 9866 +60d3 9ca9 +60d8 9caf +60da 8d9b +60dc 90c9 +60df 88d2 +60e0 9ca8 +60e1 9ca6 +60e3 9179 +60e7 9c9c +60e8 8e53 +60f0 91c4 +60f1 9cbb +60f3 917a +60f4 9cb6 +60f6 9cb3 +60f7 9cb4 +60f9 8ee4 +60fa 9cb7 +60fb 9cba +6100 9cb5 +6101 8f44 +6103 9cb8 +6106 9cb2 +6108 96fa +6109 96f9 +610d 9cbc +610e 9cbd +610f 88d3 +6115 9cb1 +611a 8bf0 +611b 88a4 +611f 8ab4 +6121 9cb9 +6127 9cc1 +6128 9cc0 +612c 9cc5 +6134 9cc6 +613c 9cc4 +613d 9cc7 +613e 9cbf +613f 9cc3 +6142 9cc8 +6144 9cc9 +6147 9cbe +6148 8e9c +614a 9cc2 +614b 91d4 +614c 8d51 +614d 9cb0 +614e 9054 +6153 9cd6 +6155 95e7 +6158 9ccc +6159 9ccd +615a 9cce +615d 9cd5 +615f 9cd4 +6162 969d +6163 8ab5 +6165 9cd2 +6167 8c64 +6168 8a53 +616b 9ccf +616e 97b6 +616f 9cd1 +6170 88d4 +6171 9cd3 +6173 9cca +6174 9cd0 +6175 9cd7 +6176 8c63 +6177 9ccb +617e 977c +6182 974a +6187 9cda +618a 9cde +618e 919e +6190 97f7 +6191 9cdf +6194 9cdc +6196 9cd9 +6199 9cd8 +619a 9cdd +61a4 95ae +61a7 93b2 +61a9 8c65 +61ab 9ce0 +61ac 9cdb +61ae 9ce1 +61b2 8c9b +61b6 89af +61ba 9ce9 +61be 8ab6 +61c3 9ce7 +61c6 9ce8 +61c7 8da7 +61c8 9ce6 +61c9 9ce4 +61ca 9ce3 +61cb 9cea +61cc 9ce2 +61cd 9cec +61d0 89f9 +61e3 9cee +61e6 9ced +61f2 92a6 +61f4 9cf1 +61f6 9cef +61f7 9ce5 +61f8 8c9c +61fa 9cf0 +61fc 9cf4 +61fd 9cf3 +61fe 9cf5 +61ff 9cf2 +6200 9cf6 +6208 9cf7 +6209 9cf8 +620a 95e8 +620c 9cfa +620d 9cf9 +620e 8f5e +6210 90ac +6211 89e4 +6212 89fa +6214 9cfb +6216 88bd +621a 90ca +621b 9cfc +621d e6c1 +621e 9d40 +621f 8c81 +6221 9d41 +6226 90ed +622a 9d42 +622e 9d43 +622f 8b59 +6230 9d44 +6232 9d45 +6233 9d46 +6234 91d5 +6238 8ccb +623b 96df +623f 965b +6240 8f8a +6241 9d47 +6247 90ee +6248 e7bb +6249 94e0 +624b 8ee8 +624d 8dcb +624e 9d48 +6253 91c5 +6255 95a5 +6258 91ef +625b 9d4b +625e 9d49 +6260 9d4c +6263 9d4a +6268 9d4d +626e 95af +6271 88b5 +6276 957d +6279 94e1 +627c 9d4e +627e 9d51 +627f 8fb3 +6280 8b5a +6282 9d4f +6283 9d56 +6284 8fb4 +6289 9d50 +628a 9463 +6291 977d +6292 9d52 +6293 9d53 +6294 9d57 +6295 938a +6296 9d54 +6297 8d52 +6298 90dc +629b 9d65 +629c 94b2 +629e 91f0 +62ab 94e2 +62ac 9dab +62b1 95f8 +62b5 92ef +62b9 9695 +62bb 9d5a +62bc 899f +62bd 928a +62c2 9d63 +62c5 9253 +62c6 9d5d +62c7 9d64 +62c8 9d5f +62c9 9d66 +62ca 9d62 +62cc 9d61 +62cd 948f +62cf 9d5b +62d0 89fb +62d1 9d59 +62d2 8b91 +62d3 91f1 +62d4 9d55 +62d7 9d58 +62d8 8d53 +62d9 90d9 +62db 8fb5 +62dc 9d60 +62dd 9471 +62e0 8b92 +62e1 8a67 +62ec 8a87 +62ed 9040 +62ee 9d68 +62ef 9d6d +62f1 9d69 +62f3 8c9d +62f5 9d6e +62f6 8e41 +62f7 8d89 +62fe 8f45 +62ff 9d5c +6301 8e9d +6302 9d6b +6307 8e77 +6308 9d6c +6309 88c2 +630c 9d67 +6311 92a7 +6319 8b93 +631f 8bb2 +6327 9d6a +6328 88a5 +632b 8dc1 +632f 9055 +633a 92f0 +633d 94d2 +633e 9d70 +633f 917d +6349 91a8 +634c 8e4a +634d 9d71 +634f 9d73 +6350 9d6f +6355 95df +6357 92bb +635c 917b +6367 95f9 +6368 8ecc +6369 9d80 +636b 9d7e +636e 9098 +6372 8c9e +6376 9d78 +6377 8fb7 +637a 93e6 +637b 9450 +6380 9d76 +6383 917c +6388 8ef6 +6389 9d7b +638c 8fb6 +638e 9d75 +638f 9d7a +6392 9472 +6396 9d74 +6398 8c40 +639b 8a7c +639f 9d7c +63a0 97a9 +63a1 8dcc +63a2 9254 +63a3 9d79 +63a5 90da +63a7 8d54 +63a8 9084 +63a9 8986 +63aa 915b +63ab 9d77 +63ac 8b64 +63b2 8c66 +63b4 92cd +63b5 9d7d +63bb 917e +63be 9d81 +63c0 9d83 +63c3 91b5 +63c4 9d89 +63c6 9d84 +63c9 9d86 +63cf 9560 +63d0 92f1 +63d2 9d87 +63d6 974b +63da 9767 +63db 8ab7 +63e1 88ac +63e3 9d85 +63e9 9d82 +63ee 8af6 +63f4 8987 +63f6 9d88 +63fa 9768 +6406 9d8c +640d 91b9 +640f 9d93 +6413 9d8d +6416 9d8a +6417 9d91 +641c 9d72 +6426 9d8e +6428 9d92 +642c 94c0 +642d 938b +6434 9d8b +6436 9d8f +643a 8c67 +643e 8def +6442 90db +644e 9d97 +6458 9345 +6467 9d94 +6469 9680 +646f 9d95 +6476 9d96 +6478 96cc +647a 90a0 +6483 8c82 +6488 9d9d +6492 8e54 +6493 9d9a +6495 9d99 +649a 9451 +649e 93b3 +64a4 9350 +64a5 9d9b +64a9 9d9c +64ab 958f +64ad 9464 +64ae 8e42 +64b0 90ef +64b2 966f +64b9 8a68 +64bb 9da3 +64bc 9d9e +64c1 9769 +64c2 9da5 +64c5 9da1 +64c7 9da2 +64cd 9180 +64d2 9da0 +64d4 9d5e +64d8 9da4 +64da 9d9f +64e0 9da9 +64e1 9daa +64e2 9346 +64e3 9dac +64e6 8e43 +64e7 9da7 +64ec 8b5b +64ef 9dad +64f1 9da6 +64f2 9db1 +64f4 9db0 +64f6 9daf +64fa 9db2 +64fd 9db4 +64fe 8fef +6500 9db3 +6505 9db7 +6518 9db5 +651c 9db6 +651d 9d90 +6523 9db9 +6524 9db8 +652a 9d98 +652b 9dba +652c 9dae +652f 8e78 +6534 9dbb +6535 9dbc +6536 9dbe +6537 9dbd +6538 9dbf +6539 89fc +653b 8d55 +653e 95fa +653f 90ad +6545 8ccc +6548 9dc1 +654d 9dc4 +654f 9571 +6551 8b7e +6555 9dc3 +6556 9dc2 +6557 9473 +6558 9dc5 +6559 8bb3 +655d 9dc7 +655e 9dc6 +6562 8ab8 +6563 8e55 +6566 93d6 +656c 8c68 +6570 9094 +6572 9dc8 +6574 90ae +6575 9347 +6577 957e +6578 9dc9 +6582 9dca +6583 9dcb +6587 95b6 +6588 9b7c +6589 90c4 +658c 956b +658e 8dd6 +6590 94e3 +6591 94c1 +6597 936c +6599 97bf +659b 9dcd +659c 8ece +659f 9dce +65a1 88b4 +65a4 8bd2 +65a5 90cb +65a7 9580 +65ab 9dcf +65ac 8e61 +65ad 9266 +65af 8e7a +65b0 9056 +65b7 9dd0 +65b9 95fb +65bc 8997 +65bd 8e7b +65c1 9dd3 +65c3 9dd1 +65c4 9dd4 +65c5 97b7 +65c6 9dd2 +65cb 90f9 +65cc 9dd5 +65cf 91b0 +65d2 9dd6 +65d7 8af8 +65d9 9dd8 +65db 9dd7 +65e0 9dd9 +65e1 9dda +65e2 8af9 +65e5 93fa +65e6 9255 +65e7 8b8c +65e8 8e7c +65e9 9181 +65ec 8f7b +65ed 88ae +65f1 9ddb +65fa 89a0 +65fb 9ddf +6602 8d56 +6603 9dde +6606 8da9 +6607 8fb8 +660a 9ddd +660c 8fb9 +660e 96be +660f 8da8 +6613 88d5 +6614 90cc +661c 9de4 +661f 90af +6620 8966 +6625 8f74 +6627 9686 +6628 8df0 +662d 8fba +662f 90a5 +6634 9de3 +6635 9de1 +6636 9de2 +663c 928b +663f 9e45 +6641 9de8 +6642 8e9e +6643 8d57 +6644 9de6 +6649 9de7 +664b 9057 +664f 9de5 +6652 8e4e +665d 9dea +665e 9de9 +665f 9dee +6662 9def +6664 9deb +6666 8a41 +6667 9dec +6668 9ded +6669 94d3 +666e 9581 +666f 8c69 +6670 9df0 +6674 90b0 +6676 8fbb +667a 9271 +6681 8bc5 +6683 9df1 +6684 9df5 +6687 89c9 +6688 9df2 +6689 9df4 +668e 9df3 +6691 8f8b +6696 9267 +6697 88c3 +6698 9df6 +669d 9df7 +66a2 92a8 +66a6 97ef +66ab 8e62 +66ae 95e9 +66b4 965c +66b8 9e41 +66b9 9df9 +66bc 9dfc +66be 9dfb +66c1 9df8 +66c4 9e40 +66c7 93dc +66c9 9dfa +66d6 9e42 +66d9 8f8c +66da 9e43 +66dc 976a +66dd 9498 +66e0 9e44 +66e6 9e46 +66e9 9e47 +66f0 9e48 +66f2 8bc8 +66f3 8967 +66f4 8d58 +66f5 9e49 +66f7 9e4a +66f8 8f91 +66f9 9182 +66fc 99d6 +66fd 915d +66fe 915c +66ff 91d6 +6700 8dc5 +6703 98f0 +6708 8c8e +6709 974c +670b 95fc +670d 959e +670f 9e4b +6714 8df1 +6715 92bd +6716 9e4c +6717 984e +671b 965d +671d 92a9 +671e 9e4d +671f 8afa +6726 9e4e +6727 9e4f +6728 96d8 +672a 96a2 +672b 9696 +672c 967b +672d 8e44 +672e 9e51 +6731 8ee9 +6734 9670 +6736 9e53 +6737 9e56 +6738 9e55 +673a 8af7 +673d 8b80 +673f 9e52 +6741 9e54 +6746 9e57 +6749 9099 +674e 979b +674f 88c7 +6750 8dde +6751 91ba +6753 8edb +6756 8ff1 +6759 9e5a +675c 936d +675e 9e58 +675f 91a9 +6760 9e59 +6761 8ff0 +6762 96db +6763 9e5b +6764 9e5c +6765 9788 +676a 9e61 +676d 8d59 +676f 9474 +6770 9e5e +6771 938c +6772 9ddc +6773 9de0 +6775 8b6e +6777 9466 +677c 9e60 +677e 8fbc +677f 94c2 +6785 9e66 +6787 94f8 +6789 9e5d +678b 9e63 +678c 9e62 +6790 90cd +6795 968d +6797 97d1 +679a 9687 +679c 89ca +679d 8e7d +67a0 9867 +67a1 9e65 +67a2 9095 +67a6 9e64 +67a9 9e5f +67af 8ccd +67b3 9e6b +67b4 9e69 +67b6 89cb +67b7 9e67 +67b8 9e6d +67b9 9e73 +67c1 91c6 +67c4 95bf +67c6 9e75 +67ca 9541 +67ce 9e74 +67cf 9490 +67d0 965e +67d1 8ab9 +67d3 90f5 +67d4 8f5f +67d8 92d1 +67da 974d +67dd 9e70 +67de 9e6f +67e2 9e71 +67e4 9e6e +67e7 9e76 +67e9 9e6c +67ec 9e6a +67ee 9e72 +67ef 9e68 +67f1 928c +67f3 96f6 +67f4 8ec4 +67f5 8df2 +67fb 8db8 +67fe 968f +67ff 8a60 +6802 92cc +6803 93c8 +6804 8968 +6813 90f0 +6816 90b2 +6817 8c49 +681e 9e78 +6821 8d5a +6822 8a9c +6829 9e7a +682a 8a94 +682b 9e81 +6832 9e7d +6834 90f1 +6838 8a6a +6839 8daa +683c 8a69 +683d 8dcd +6840 9e7b +6841 8c85 +6842 8c6a +6843 938d +6846 9e79 +6848 88c4 +684d 9e7c +684e 9e7e +6850 8bcb +6851 8c4b +6853 8aba +6854 8b6a +6859 9e82 +685c 8df7 +685d 9691 +685f 8e56 +6863 9e83 +6867 954f +6874 9e8f +6876 89b1 +6877 9e84 +687e 9e95 +687f 9e85 +6881 97c0 +6883 9e8c +6885 947e +688d 9e94 +688f 9e87 +6893 88b2 +6894 9e89 +6897 8d5b +689b 9e8b +689d 9e8a +689f 9e86 +68a0 9e91 +68a2 8fbd +68a6 9aeb +68a7 8ce6 +68a8 979c +68ad 9e88 +68af 92f2 +68b0 8a42 +68b1 8dab +68b3 9e80 +68b5 9e90 +68b6 8a81 +68b9 9e8e +68ba 9e92 +68bc 938e +68c4 8afc +68c6 9eb0 +68c9 96c7 +68ca 9e97 +68cb 8afb +68cd 9e9e +68d2 965f +68d4 9e9f +68d5 9ea1 +68d7 9ea5 +68d8 9e99 +68da 9249 +68df 938f +68e0 9ea9 +68e1 9e9c +68e3 9ea6 +68e7 9ea0 +68ee 9058 +68ef 9eaa +68f2 90b1 +68f9 9ea8 +68fa 8abb +6900 986f +6901 9e96 +6904 9ea4 +6905 88d6 +6908 9e98 +690b 96b8 +690c 9e9d +690d 9041 +690e 92c5 +690f 9e93 +6912 9ea3 +6919 909a +691a 9ead +691b 8a91 +691c 8c9f +6921 9eaf +6922 9e9a +6923 9eae +6925 9ea7 +6926 9e9b +6928 9eab +692a 9eac +6930 9ebd +6934 93cc +6936 9ea2 +6939 9eb9 +693d 9ebb +693f 92d6 +694a 976b +6953 9596 +6954 9eb6 +6955 91c8 +6959 9ebc +695a 915e +695c 9eb3 +695d 9ec0 +695e 9ebf +6960 93ed +6961 9ebe +6962 93e8 +696a 9ec2 +696b 9eb5 +696d 8bc6 +696e 9eb8 +696f 8f7c +6973 9480 +6974 9eba +6975 8bc9 +6977 9eb2 +6978 9eb4 +6979 9eb1 +697c 984f +697d 8a79 +697e 9eb7 +6981 9ec1 +6982 8a54 +698a 8de5 +698e 897c +6991 9ed2 +6994 9850 +6995 9ed5 +699b 9059 +699c 9ed4 +69a0 9ed3 +69a7 9ed0 +69ae 9ec4 +69b1 9ee1 +69b2 9ec3 +69b4 9ed6 +69bb 9ece +69be 9ec9 +69bf 9ec6 +69c1 9ec7 +69c3 9ecf +69c7 eaa0 +69ca 9ecc +69cb 8d5c +69cc 92c6 +69cd 9184 +69ce 9eca +69d0 9ec5 +69d3 9ec8 +69d8 976c +69d9 968a +69dd 9ecd +69de 9ed7 +69e7 9edf +69e8 9ed8 +69eb 9ee5 +69ed 9ee3 +69f2 9ede +69f9 9edd +69fb 92ce +69fd 9185 +69ff 9edb +6a02 9ed9 +6a05 9ee0 +6a0a 9ee6 +6a0b 94f3 +6a0c 9eec +6a12 9ee7 +6a13 9eea +6a14 9ee4 +6a17 9294 +6a19 9557 +6a1b 9eda +6a1e 9ee2 +6a1f 8fbe +6a21 96cd +6a22 9ef6 +6a23 9ee9 +6a29 8ca0 +6a2a 89a1 +6a2b 8a7e +6a2e 9ed1 +6a35 8fbf +6a36 9eee +6a38 9ef5 +6a39 8ef7 +6a3a 8a92 +6a3d 924d +6a44 9eeb +6a47 9ef0 +6a48 9ef4 +6a4b 8bb4 +6a58 8b6b +6a59 9ef2 +6a5f 8b40 +6a61 93c9 +6a62 9ef1 +6a66 9ef3 +6a72 9eed +6a78 9eef +6a7f 8a80 +6a80 9268 +6a84 9efa +6a8d 9ef8 +6a8e 8ce7 +6a90 9ef7 +6a97 9f40 +6a9c 9e77 +6aa0 9ef9 +6aa2 9efb +6aa3 9efc +6aaa 9f4b +6aac 9f47 +6aae 9e8d +6ab3 9f46 +6ab8 9f45 +6abb 9f42 +6ac1 9ee8 +6ac2 9f44 +6ac3 9f43 +6ad1 9f49 +6ad3 9845 +6ada 9f4c +6adb 8bf9 +6ade 9f48 +6adf 9f4a +6ae8 94a5 +6aea 9f4d +6afa 9f51 +6afb 9f4e +6b04 9793 +6b05 9f4f +6b0a 9edc +6b12 9f52 +6b16 9f53 +6b1d 8954 +6b1f 9f55 +6b20 8c87 +6b21 8e9f +6b23 8bd3 +6b27 89a2 +6b32 977e +6b37 9f57 +6b38 9f56 +6b39 9f59 +6b3a 8b5c +6b3d 8bd4 +6b3e 8abc +6b43 9f5c +6b47 9f5b +6b49 9f5d +6b4c 89cc +6b4e 9256 +6b50 9f5e +6b53 8abd +6b54 9f60 +6b59 9f5f +6b5b 9f61 +6b5f 9f62 +6b61 9f63 +6b62 8e7e +6b63 90b3 +6b64 8d9f +6b66 9590 +6b69 95e0 +6b6a 9863 +6b6f 8e95 +6b73 8dce +6b74 97f0 +6b78 9f64 +6b79 9f65 +6b7b 8e80 +6b7f 9f66 +6b80 9f67 +6b83 9f69 +6b84 9f68 +6b86 9677 +6b89 8f7d +6b8a 8eea +6b8b 8e63 +6b8d 9f6a +6b95 9f6c +6b96 9042 +6b98 9f6b +6b9e 9f6d +6ba4 9f6e +6baa 9f6f +6bab 9f70 +6baf 9f71 +6bb1 9f73 +6bb2 9f72 +6bb3 9f74 +6bb4 89a3 +6bb5 9269 +6bb7 9f75 +6bba 8e45 +6bbb 8a6b +6bbc 9f76 +6bbf 9361 +6bc0 9aca +6bc5 8b42 +6bc6 9f77 +6bcb 9f78 +6bcd 95ea +6bce 9688 +6bd2 93c5 +6bd3 9f79 +6bd4 94e4 +6bd8 94f9 +6bdb 96d1 +6bdf 9f7a +6beb 9f7c +6bec 9f7b +6bef 9f7e +6bf3 9f7d +6c08 9f81 +6c0f 8e81 +6c11 96af +6c13 9f82 +6c14 9f83 +6c17 8b43 +6c1b 9f84 +6c23 9f86 +6c24 9f85 +6c34 9085 +6c37 9558 +6c38 8969 +6c3e 94c3 +6c40 92f3 +6c41 8f60 +6c42 8b81 +6c4e 94c4 +6c50 8eac +6c55 9f88 +6c57 8abe +6c5a 8998 +6c5d 93f0 +6c5e 9f87 +6c5f 8d5d +6c60 9272 +6c62 9f89 +6c68 9f91 +6c6a 9f8a +6c70 91bf +6c72 8b82 +6c73 9f92 +6c7a 8c88 +6c7d 8b44 +6c7e 9f90 +6c81 9f8e +6c82 9f8b +6c83 9780 +6c88 92be +6c8c 93d7 +6c8d 9f8c +6c90 9f94 +6c92 9f93 +6c93 8c42 +6c96 89ab +6c99 8db9 +6c9a 9f8d +6c9b 9f8f +6ca1 9676 +6ca2 91f2 +6cab 9697 +6cae 9f9c +6cb1 9f9d +6cb3 89cd +6cb8 95a6 +6cb9 96fb +6cba 9f9f +6cbb 8ea1 +6cbc 8fc0 +6cbd 9f98 +6cbe 9f9e +6cbf 8988 +6cc1 8bb5 +6cc4 9f95 +6cc5 9f9a +6cc9 90f2 +6cca 9491 +6ccc 94e5 +6cd3 9f97 +6cd5 9640 +6cd7 9f99 +6cd9 9fa2 +6cdb 9fa0 +6cdd 9f9b +6ce1 9641 +6ce2 9467 +6ce3 8b83 +6ce5 9344 +6ce8 928d +6cea 9fa3 +6cef 9fa1 +6cf0 91d7 +6cf1 9f96 +6cf3 896a +6d0b 976d +6d0c 9fae +6d12 9fad +6d17 90f4 +6d19 9faa +6d1b 978c +6d1e 93b4 +6d1f 9fa4 +6d25 92c3 +6d29 896b +6d2a 8d5e +6d2b 9fa7 +6d32 8f46 +6d33 9fac +6d35 9fab +6d36 9fa6 +6d38 9fa9 +6d3b 8a88 +6d3d 9fa8 +6d3e 9468 +6d41 97ac +6d44 8ff2 +6d45 90f3 +6d59 9fb4 +6d5a 9fb2 +6d5c 956c +6d63 9faf +6d64 9fb1 +6d66 8959 +6d69 8d5f +6d6a 9851 +6d6c 8a5c +6d6e 9582 +6d74 9781 +6d77 8a43 +6d78 905a +6d79 9fb3 +6d85 9fb8 +6d88 8fc1 +6d8c 974f +6d8e 9fb5 +6d93 9fb0 +6d95 9fb6 +6d99 97dc +6d9b 9393 +6d9c 93c0 +6daf 8a55 +6db2 8974 +6db5 9fbc +6db8 9fbf +6dbc 97c1 +6dc0 9784 +6dc5 9fc6 +6dc6 9fc0 +6dc7 9fbd +6dcb 97d2 +6dcc 9fc3 +6dd1 8f69 +6dd2 9fc5 +6dd5 9fca +6dd8 9391 +6dd9 9fc8 +6dde 9fc2 +6de1 9257 +6de4 9fc9 +6de6 9fbe +6de8 9fc4 +6dea 9fcb +6deb 88fa +6dec 9fc1 +6dee 9fcc +6df1 905b +6df3 8f7e +6df5 95a3 +6df7 8dac +6df9 9fb9 +6dfa 9fc7 +6dfb 9359 +6e05 90b4 +6e07 8a89 +6e08 8dcf +6e09 8fc2 +6e0a 9fbb +6e0b 8f61 +6e13 8c6b +6e15 9fba +6e19 9fd0 +6e1a 8f8d +6e1b 8cb8 +6e1d 9fdf +6e1f 9fd9 +6e20 8b94 +6e21 936e +6e23 9fd4 +6e24 9fdd +6e25 88ad +6e26 8951 +6e29 89b7 +6e2b 9fd6 +6e2c 91aa +6e2d 9fcd +6e2e 9fcf +6e2f 8d60 +6e38 9fe0 +6e3a 9fdb +6e3e 9fd3 +6e43 9fda +6e4a 96a9 +6e4d 9fd8 +6e4e 9fdc +6e56 8cce +6e58 8fc3 +6e5b 9258 +6e5f 9fd2 +6e67 974e +6e6b 9fd5 +6e6e 9fce +6e6f 9392 +6e72 9fd1 +6e76 9fd7 +6e7e 9870 +6e7f 8ebc +6e80 969e +6e82 9fe1 +6e8c 94ac +6e8f 9fed +6e90 8cb9 +6e96 8f80 +6e98 9fe3 +6e9c 97ad +6e9d 8d61 +6e9f 9ff0 +6ea2 88ec +6ea5 9fee +6eaa 9fe2 +6eaf 9fe8 +6eb2 9fea +6eb6 976e +6eb7 9fe5 +6eba 934d +6ebd 9fe7 +6ec2 9fef +6ec4 9fe9 +6ec5 96c5 +6ec9 9fe4 +6ecb 8ea0 +6ecc 9ffc +6ed1 8a8a +6ed3 9fe6 +6ed4 9feb +6ed5 9fec +6edd 91ea +6ede 91d8 +6eec 9ff4 +6eef 9ffa +6ef2 9ff8 +6ef4 9348 +6ef7 e042 +6ef8 9ff5 +6efe 9ff6 +6eff 9fde +6f01 8b99 +6f02 9559 +6f06 8ebd +6f09 8d97 +6f0f 9852 +6f11 9ff2 +6f13 e041 +6f14 8989 +6f15 9186 +6f20 9499 +6f22 8abf +6f23 97f8 +6f2b 969f +6f2c 92d0 +6f31 9ff9 +6f32 9ffb +6f38 9151 +6f3e e040 +6f3f 9ff7 +6f41 9ff1 +6f45 8ac1 +6f54 8c89 +6f58 e04e +6f5b e049 +6f5c 90f6 +6f5f 8a83 +6f64 8f81 +6f66 e052 +6f6d e04b +6f6e 92aa +6f6f e048 +6f70 92d7 +6f74 e06b +6f78 e045 +6f7a e044 +6f7c e04d +6f80 e047 +6f81 e046 +6f82 e04c +6f84 909f +6f86 e043 +6f8e e04f +6f91 e050 +6f97 8ac0 +6fa1 e055 +6fa3 e054 +6fa4 e056 +6faa e059 +6fb1 9362 +6fb3 e053 +6fb9 e057 +6fc0 8c83 +6fc1 91f7 +6fc2 e051 +6fc3 945a +6fc6 e058 +6fd4 e05d +6fd5 e05b +6fd8 e05e +6fdb e061 +6fdf e05a +6fe0 8d8a +6fe1 9447 +6fe4 9fb7 +6feb 9794 +6fec e05c +6fee e060 +6fef 91f3 +6ff1 e05f +6ff3 e04a +6ff6 e889 +6ffa e064 +6ffe e068 +7001 e066 +7009 e062 +700b e063 +700f e067 +7011 e065 +7015 956d +7018 e06d +701a e06a +701b e069 +701d e06c +701e 93d2 +701f e06e +7026 9295 +7027 91eb +702c 90a3 +7030 e06f +7032 e071 +703e e070 +704c 9ff3 +7051 e072 +7058 93e5 +7063 e073 +706b 89ce +706f 9394 +7070 8a44 +7078 8b84 +707c 8edc +707d 8dd0 +7089 9846 +708a 9086 +708e 898a +7092 e075 +7099 e074 +70ac e078 +70ad 9259 +70ae e07b +70af e076 +70b3 e07a +70b8 e079 +70b9 935f +70ba 88d7 +70c8 97f3 +70cb e07d +70cf 8947 +70d9 e080 +70dd e07e +70df e07c +70f1 e077 +70f9 9642 +70fd e082 +7109 e081 +7114 898b +7119 e084 +711a 95b0 +711c e083 +7121 96b3 +7126 8fc5 +7136 9152 +713c 8fc4 +7149 97f9 +714c e08a +714e 90f7 +7155 e086 +7156 e08b +7159 898c +7162 e089 +7164 9481 +7165 e085 +7166 e088 +7167 8fc6 +7169 94cf +716c e08c +716e 8ecf +717d 90f8 +7184 e08f +7188 e087 +718a 8c46 +718f e08d +7194 976f +7195 e090 +7199 eaa4 +719f 8f6e +71a8 e091 +71ac e092 +71b1 944d +71b9 e094 +71be e095 +71c3 9452 +71c8 9395 +71c9 e097 +71ce e099 +71d0 97d3 +71d2 e096 +71d4 e098 +71d5 898d +71d7 e093 +71df 9a7a +71e0 e09a +71e5 9187 +71e6 8e57 +71e7 e09c +71ec e09b +71ed 9043 +71ee 99d7 +71f5 e09d +71f9 e09f +71fb e08e +71fc e09e +71ff e0a0 +7206 949a +720d e0a1 +7210 e0a2 +721b e0a3 +7228 e0a4 +722a 92dc +722c e0a6 +722d e0a5 +7230 e0a7 +7232 e0a8 +7235 8edd +7236 9583 +723a 96ea +723b e0a9 +723c e0aa +723d 9175 +723e 8ea2 +723f e0ab +7240 e0ac +7246 e0ad +7247 95d0 +7248 94c5 +724b e0ae +724c 9476 +7252 92ab +7258 e0af +7259 89e5 +725b 8b8d +725d 96c4 +725f 96b4 +7261 89b2 +7262 9853 +7267 9671 +7269 95a8 +7272 90b5 +7274 e0b0 +7279 93c1 +727d 8ca1 +727e e0b1 +7280 8dd2 +7281 e0b3 +7282 e0b2 +7287 e0b4 +7292 e0b5 +7296 e0b6 +72a0 8b5d +72a2 e0b7 +72a7 e0b8 +72ac 8ca2 +72af 94c6 +72b2 e0ba +72b6 8ff3 +72b9 e0b9 +72c2 8bb6 +72c3 e0bb +72c4 e0bd +72c6 e0bc +72ce e0be +72d0 8ccf +72d2 e0bf +72d7 8be7 +72d9 915f +72db 8d9d +72e0 e0c1 +72e1 e0c2 +72e2 e0c0 +72e9 8eeb +72ec 93c6 +72ed 8bb7 +72f7 e0c4 +72f8 924b +72f9 e0c3 +72fc 9854 +72fd 9482 +730a e0c7 +7316 e0c9 +7317 e0c6 +731b 96d2 +731c e0c8 +731d e0ca +731f 97c2 +7325 e0ce +7329 e0cd +732a 9296 +732b 944c +732e 8ca3 +732f e0cc +7334 e0cb +7336 9750 +7337 9751 +733e e0cf +733f 898e +7344 8d96 +7345 8e82 +734e e0d0 +734f e0d1 +7357 e0d3 +7363 8f62 +7368 e0d5 +736a e0d4 +7370 e0d6 +7372 8a6c +7375 e0d8 +7378 e0d7 +737a e0da +737b e0d9 +7384 8cba +7387 97a6 +7389 8bca +738b 89a4 +7396 8be8 +73a9 8adf +73b2 97e6 +73b3 e0dc +73bb e0de +73c0 e0df +73c2 89cf +73c8 e0db +73ca 8e58 +73cd 92bf +73ce e0dd +73de e0e2 +73e0 8eec +73e5 e0e0 +73ea 8c5d +73ed 94c7 +73ee e0e1 +73f1 e0fc +73f8 e0e7 +73fe 8cbb +7403 8b85 +7405 e0e4 +7406 979d +7409 97ae +7422 91f4 +7425 e0e6 +7432 e0e8 +7433 97d4 +7434 8bd5 +7435 94fa +7436 9469 +743a e0e9 +743f e0eb +7441 e0ee +7455 e0ea +7459 e0ed +745a 8ce8 +745b 896c +745c e0ef +745e 9090 +745f e0ec +7460 97da +7463 e0f2 +7464 eaa2 +7469 e0f0 +746a e0f3 +746f e0e5 +7470 e0f1 +7473 8dba +7476 e0f4 +747e e0f5 +7483 979e +748b e0f6 +749e e0f7 +74a2 e0e3 +74a7 e0f8 +74b0 8ac2 +74bd 8ea3 +74ca e0f9 +74cf e0fa +74d4 e0fb +74dc 895a +74e0 e140 +74e2 955a +74e3 e141 +74e6 8aa2 +74e7 e142 +74e9 e143 +74ee e144 +74f0 e146 +74f1 e147 +74f2 e145 +74f6 9572 +74f7 e149 +74f8 e148 +7503 e14b +7504 e14a +7505 e14c +750c e14d +750d e14f +750e e14e +7511 8d99 +7513 e151 +7515 e150 +7518 8ac3 +751a 9072 +751c 935b +751e e152 +751f 90b6 +7523 8e59 +7525 8999 +7526 e153 +7528 9770 +752b 95e1 +752c e154 +7530 9363 +7531 9752 +7532 8d62 +7533 905c +7537 926a +7538 99b2 +753a 92ac +753b 89e6 +753c e155 +7544 e156 +7546 e15b +7549 e159 +754a e158 +754b 9dc0 +754c 8a45 +754d e157 +754f 88d8 +7551 94a8 +7554 94c8 +7559 97af +755a e15c +755b e15a +755c 927b +755d 90a4 +7560 94a9 +7562 954c +7564 e15e +7565 97aa +7566 8c6c +7567 e15f +7569 e15d +756a 94d4 +756b e160 +756d e161 +7570 88d9 +7573 8ff4 +7574 e166 +7576 e163 +7577 93eb +7578 e162 +757f 8b45 +7582 e169 +7586 e164 +7587 e165 +7589 e168 +758a e167 +758b 9544 +758e 9161 +758f 9160 +7591 8b5e +7594 e16a +759a e16b +759d e16c +75a3 e16e +75a5 e16d +75ab 8975 +75b1 e176 +75b2 94e6 +75b3 e170 +75b5 e172 +75b8 e174 +75b9 905d +75bc e175 +75bd e173 +75be 8ebe +75c2 e16f +75c3 e171 +75c5 9561 +75c7 8fc7 +75ca e178 +75cd e177 +75d2 e179 +75d4 8ea4 +75d5 8dad +75d8 9397 +75d9 e17a +75db 92c9 +75de e17c +75e2 979f +75e3 e17b +75e9 9189 +75f0 e182 +75f2 e184 +75f3 e185 +75f4 9273 +75fa e183 +75fc e180 +75fe e17d +75ff e17e +7601 e181 +7609 e188 +760b e186 +760d e187 +761f e189 +7620 e18b +7621 e18c +7622 e18d +7624 e18e +7627 e18a +7630 e190 +7634 e18f +763b e191 +7642 97c3 +7646 e194 +7647 e192 +7648 e193 +764c 8ae0 +7652 96fc +7656 95c8 +7658 e196 +765c e195 +7661 e197 +7662 e198 +7667 e19c +7668 e199 +7669 e19a +766a e19b +766c e19d +7670 e19e +7672 e19f +7676 e1a0 +7678 e1a1 +767a 94ad +767b 936f +767c e1a2 +767d 9492 +767e 9553 +7680 e1a3 +7683 e1a4 +7684 9349 +7686 8a46 +7687 8d63 +7688 e1a5 +768b e1a6 +768e e1a7 +7690 8e48 +7693 e1a9 +7696 e1a8 +7699 e1aa +769a e1ab +76ae 94e7 +76b0 e1ac +76b4 e1ad +76b7 ea89 +76b8 e1ae +76b9 e1af +76ba e1b0 +76bf 8e4d +76c2 e1b1 +76c3 9475 +76c6 967e +76c8 896d +76ca 8976 +76cd e1b2 +76d2 e1b4 +76d6 e1b3 +76d7 9390 +76db 90b7 +76dc 9f58 +76de e1b5 +76df 96bf +76e1 e1b6 +76e3 8ac4 +76e4 94d5 +76e5 e1b7 +76e7 e1b8 +76ea e1b9 +76ee 96da +76f2 96d3 +76f4 92bc +76f8 918a +76fb e1bb +76fe 8f82 +7701 8fc8 +7704 e1be +7707 e1bd +7708 e1bc +7709 94fb +770b 8ac5 +770c 8ca7 +771b e1c4 +771e e1c1 +771f 905e +7720 96b0 +7724 e1c0 +7725 e1c2 +7726 e1c3 +7729 e1bf +7737 e1c5 +7738 e1c6 +773a 92ad +773c 8ae1 +7740 9285 +7747 e1c7 +775a e1c8 +775b e1cb +7761 9087 +7763 93c2 +7765 e1cc +7766 9672 +7768 e1c9 +776b e1ca +7779 e1cf +777e e1ce +777f e1cd +778b e1d1 +778e e1d0 +7791 e1d2 +779e e1d4 +77a0 e1d3 +77a5 95cb +77ac 8f75 +77ad 97c4 +77b0 e1d5 +77b3 93b5 +77b6 e1d6 +77b9 e1d7 +77bb e1db +77bc e1d9 +77bd e1da +77bf e1d8 +77c7 e1dc +77cd e1dd +77d7 e1de +77da e1df +77db 96b5 +77dc e1e0 +77e2 96ee +77e3 e1e1 +77e5 926d +77e7 948a +77e9 8be9 +77ed 925a +77ee e1e2 +77ef 8bb8 +77f3 90ce +77fc e1e3 +7802 8dbb +780c e1e4 +7812 e1e5 +7814 8ca4 +7815 8dd3 +7820 e1e7 +7825 9375 +7826 8dd4 +7827 8b6d +7832 9643 +7834 946a +783a 9376 +783f 8d7b +7845 e1e9 +785d 8fc9 +786b 97b0 +786c 8d64 +786f 8ca5 +7872 94a1 +7874 e1eb +787c e1ed +7881 8ce9 +7886 e1ec +7887 92f4 +788c e1ef +788d 8a56 +788e e1ea +7891 94e8 +7893 894f +7895 8dea +7897 9871 +789a e1ee +78a3 e1f0 +78a7 95c9 +78a9 90d7 +78aa e1f2 +78af e1f3 +78b5 e1f1 +78ba 8a6d +78bc e1f9 +78be e1f8 +78c1 8ea5 +78c5 e1fa +78c6 e1f5 +78ca e1fb +78cb e1f6 +78d0 94d6 +78d1 e1f4 +78d4 e1f7 +78da e241 +78e7 e240 +78e8 9681 +78ec e1fc +78ef 88e9 +78f4 e243 +78fd e242 +7901 8fca +7907 e244 +790e 9162 +7911 e246 +7912 e245 +7919 e247 +7926 e1e6 +792a e1e8 +792b e249 +792c e248 +793a 8ea6 +793c 97e7 +793e 8ed0 +7940 e24a +7941 8c56 +7947 8b5f +7948 8b46 +7949 8e83 +7950 9753 +7953 e250 +7955 e24f +7956 9163 +7957 e24c +795a e24e +795d 8f6a +795e 905f +795f e24d +7960 e24b +7962 9449 +7965 8fcb +7968 955b +796d 8dd5 +7977 9398 +797a e251 +797f e252 +7980 e268 +7981 8bd6 +7984 985c +7985 9154 +798a e253 +798d 89d0 +798e 92f5 +798f 959f +799d e254 +79a6 8b9a +79a7 e255 +79aa e257 +79ae e258 +79b0 9448 +79b3 e259 +79b9 e25a +79ba e25b +79bd 8bd7 +79be 89d1 +79bf 93c3 +79c0 8f47 +79c1 8e84 +79c9 e25c +79cb 8f48 +79d1 89c8 +79d2 9562 +79d5 e25d +79d8 94e9 +79df 9164 +79e1 e260 +79e3 e261 +79e4 9489 +79e6 9060 +79e7 e25e +79e9 9281 +79ec e25f +79f0 8fcc +79fb 88da +7a00 8b48 +7a08 e262 +7a0b 92f6 +7a0d e263 +7a0e 90c5 +7a14 96ab +7a17 9542 +7a18 e264 +7a19 e265 +7a1a 9274 +7a1c 97c5 +7a1f e267 +7a20 e266 +7a2e 8eed +7a31 e269 +7a32 88ee +7a37 e26c +7a3b e26a +7a3c 89d2 +7a3d 8c6d +7a3e e26b +7a3f 8d65 +7a40 8d92 +7a42 95e4 +7a43 e26d +7a46 9673 +7a49 e26f +7a4d 90cf +7a4e 896e +7a4f 89b8 +7a50 88aa +7a57 e26e +7a61 e270 +7a62 e271 +7a63 8ff5 +7a69 e272 +7a6b 8a6e +7a70 e274 +7a74 8c8a +7a76 8b86 +7a79 e275 +7a7a 8bf3 +7a7d e276 +7a7f 90fa +7a81 93cb +7a83 90de +7a84 8df3 +7a88 e277 +7a92 9282 +7a93 918b +7a95 e279 +7a96 e27b +7a97 e278 +7a98 e27a +7a9f 8c41 +7aa9 e27c +7aaa 8c45 +7aae 8b87 +7aaf 9771 +7ab0 e27e +7ab6 e280 +7aba 894d +7abf e283 +7ac3 8a96 +7ac4 e282 +7ac5 e281 +7ac7 e285 +7ac8 e27d +7aca e286 +7acb 97a7 +7acd e287 +7acf e288 +7ad2 9af2 +7ad3 e28a +7ad5 e289 +7ad9 e28b +7ada e28c +7adc 97b3 +7add e28d +7adf e8ed +7ae0 8fcd +7ae1 e28e +7ae2 e28f +7ae3 8f76 +7ae5 93b6 +7ae6 e290 +7aea 9247 +7aed e291 +7aef 925b +7af0 e292 +7af6 8ba3 +7af8 995e +7af9 927c +7afa 8eb1 +7aff 8ac6 +7b02 e293 +7b04 e2a0 +7b06 e296 +7b08 8b88 +7b0a e295 +7b0b e2a2 +7b0f e294 +7b11 8fce +7b18 e298 +7b19 e299 +7b1b 934a +7b1e e29a +7b20 8a7d +7b25 9079 +7b26 9584 +7b28 e29c +7b2c 91e6 +7b33 e297 +7b35 e29b +7b36 e29d +7b39 8df9 +7b45 e2a4 +7b46 954d +7b48 94a4 +7b49 9399 +7b4b 8bd8 +7b4c e2a3 +7b4d e2a1 +7b4f 94b3 +7b50 e29e +7b51 927d +7b52 939b +7b54 939a +7b56 8df4 +7b5d e2b6 +7b65 e2a6 +7b67 e2a8 +7b6c e2ab +7b6e e2ac +7b70 e2a9 +7b71 e2aa +7b74 e2a7 +7b75 e2a5 +7b7a e29f +7b86 95cd +7b87 89d3 +7b8b e2b3 +7b8d e2b0 +7b8f e2b5 +7b92 e2b4 +7b94 9493 +7b95 96a5 +7b97 8e5a +7b98 e2ae +7b99 e2b7 +7b9a e2b2 +7b9c e2b1 +7b9d e2ad +7b9f e2af +7ba1 8ac7 +7baa 925c +7bad 90fb +7bb1 94a0 +7bb4 e2bc +7bb8 94a2 +7bc0 90df +7bc1 e2b9 +7bc4 94cd +7bc6 e2bd +7bc7 95d1 +7bc9 927a +7bcb e2b8 +7bcc e2ba +7bcf e2bb +7bdd e2be +7be0 8ec2 +7be4 93c4 +7be5 e2c3 +7be6 e2c2 +7be9 e2bf +7bed 9855 +7bf3 e2c8 +7bf6 e2cc +7bf7 e2c9 +7c00 e2c5 +7c07 e2c6 +7c0d e2cb +7c11 e2c0 +7c12 99d3 +7c13 e2c7 +7c14 e2c1 +7c17 e2ca +7c1f e2d0 +7c21 8ac8 +7c23 e2cd +7c27 e2ce +7c2a e2cf +7c2b e2d2 +7c37 e2d1 +7c38 94f4 +7c3d e2d3 +7c3e 97fa +7c3f 95eb +7c40 e2d8 +7c43 e2d5 +7c4c e2d4 +7c4d 90d0 +7c4f e2d7 +7c50 e2d9 +7c54 e2d6 +7c56 e2dd +7c58 e2da +7c5f e2db +7c60 e2c4 +7c64 e2dc +7c65 e2de +7c6c e2df +7c73 95c4 +7c75 e2e0 +7c7e 96e0 +7c81 8bcc +7c82 8c48 +7c83 e2e1 +7c89 95b2 +7c8b 9088 +7c8d 96ae +7c90 e2e2 +7c92 97b1 +7c95 9494 +7c97 9165 +7c98 9453 +7c9b 8f6c +7c9f 88be +7ca1 e2e7 +7ca2 e2e5 +7ca4 e2e3 +7ca5 8a9f +7ca7 8fcf +7ca8 e2e8 +7cab e2e6 +7cad e2e4 +7cae e2ec +7cb1 e2eb +7cb2 e2ea +7cb3 e2e9 +7cb9 e2ed +7cbd e2ee +7cbe 90b8 +7cc0 e2ef +7cc2 e2f1 +7cc5 e2f0 +7cca 8cd0 +7cce 9157 +7cd2 e2f3 +7cd6 939c +7cd8 e2f2 +7cdc e2f4 +7cde 95b3 +7cdf 918c +7ce0 8d66 +7ce2 e2f5 +7ce7 97c6 +7cef e2f7 +7cf2 e2f8 +7cf4 e2f9 +7cf6 e2fa +7cf8 8e85 +7cfa e2fb +7cfb 8c6e +7cfe 8b8a +7d00 8b49 +7d02 e340 +7d04 96f1 +7d05 8d67 +7d06 e2fc +7d0a e343 +7d0b 96e4 +7d0d 945b +7d10 9552 +7d14 8f83 +7d15 e342 +7d17 8ed1 +7d18 8d68 +7d19 8e86 +7d1a 8b89 +7d1b 95b4 +7d1c e341 +7d20 9166 +7d21 9661 +7d22 8df5 +7d2b 8e87 +7d2c 92db +7d2e e346 +7d2f 97dd +7d30 8dd7 +7d32 e347 +7d33 9061 +7d35 e349 +7d39 8fd0 +7d3a 8dae +7d3f e348 +7d42 8f49 +7d43 8cbc +7d44 9167 +7d45 e344 +7d46 e34a +7d4b e345 +7d4c 8c6f +7d4e e34d +7d4f e351 +7d50 8c8b +7d56 e34c +7d5b e355 +7d5e 8d69 +7d61 978d +7d62 88ba +7d63 e352 +7d66 8b8b +7d68 e34f +7d6e e350 +7d71 939d +7d72 e34e +7d73 e34b +7d75 8a47 +7d76 90e2 +7d79 8ca6 +7d7d e357 +7d89 e354 +7d8f e356 +7d93 e353 +7d99 8c70 +7d9a 91b1 +7d9b e358 +7d9c 918e +7d9f e365 +7da2 e361 +7da3 e35b +7dab e35f +7dac 8ef8 +7dad 88db +7dae e35a +7daf e362 +7db0 e366 +7db1 8d6a +7db2 96d4 +7db4 92d4 +7db5 e35c +7db8 e364 +7dba e359 +7dbb 925d +7dbd e35e +7dbe 88bb +7dbf 96c8 +7dc7 e35d +7dca 8bd9 +7dcb 94ea +7dcf 918d +7dd1 97ce +7dd2 8f8f +7dd5 e38e +7dd8 e367 +7dda 90fc +7ddc e363 +7ddd e368 +7dde e36a +7de0 92f7 +7de1 e36d +7de4 e369 +7de8 95d2 +7de9 8ac9 +7dec 96c9 +7def 88dc +7df2 e36c +7df4 97fb +7dfb e36b +7e01 898f +7e04 93ea +7e05 e36e +7e09 e375 +7e0a e36f +7e0b e376 +7e12 e372 +7e1b 949b +7e1e 8ec8 +7e1f e374 +7e21 e371 +7e22 e377 +7e23 e370 +7e26 8f63 +7e2b 9644 +7e2e 8f6b +7e31 e373 +7e32 e380 +7e35 e37b +7e37 e37e +7e39 e37c +7e3a e381 +7e3b e37a +7e3d e360 +7e3e 90d1 +7e41 94c9 +7e43 e37d +7e46 e378 +7e4a 9140 +7e4b 8c71 +7e4d 8f4a +7e54 9044 +7e55 9155 +7e56 e384 +7e59 e386 +7e5a e387 +7e5d e383 +7e5e e385 +7e66 e379 +7e67 e382 +7e69 e38a +7e6a e389 +7e6d 969a +7e70 8c4a +7e79 e388 +7e7b e38c +7e7c e38b +7e7d e38f +7e7f e391 +7e82 8e5b +7e83 e38d +7e88 e392 +7e89 e393 +7e8c e394 +7e8e e39a +7e8f 935a +7e90 e396 +7e92 e395 +7e93 e397 +7e94 e398 +7e96 e399 +7e9b e39b +7e9c e39c +7f36 8aca +7f38 e39d +7f3a e39e +7f45 e39f +7f4c e3a0 +7f4d e3a1 +7f4e e3a2 +7f50 e3a3 +7f51 e3a4 +7f54 e3a6 +7f55 e3a5 +7f58 e3a7 +7f5f e3a8 +7f60 e3a9 +7f67 e3ac +7f68 e3aa +7f69 e3ab +7f6a 8ddf +7f6b 8c72 +7f6e 9275 +7f70 94b1 +7f72 8f90 +7f75 946c +7f77 94eb +7f78 e3ad +7f79 9ceb +7f82 e3ae +7f83 e3b0 +7f85 9785 +7f86 e3af +7f87 e3b2 +7f88 e3b1 +7f8a 9772 +7f8c e3b3 +7f8e 94fc +7f94 e3b4 +7f9a e3b7 +7f9d e3b6 +7f9e e3b5 +7fa3 e3b8 +7fa4 8c51 +7fa8 9141 +7fa9 8b60 +7fae e3bc +7faf e3b9 +7fb2 e3ba +7fb6 e3bd +7fb8 e3be +7fb9 e3bb +7fbd 8948 +7fc1 89a5 +7fc5 e3c0 +7fc6 e3c1 +7fca e3c2 +7fcc 9782 +7fd2 8f4b +7fd4 e3c4 +7fd5 e3c3 +7fe0 9089 +7fe1 e3c5 +7fe6 e3c6 +7fe9 e3c7 +7feb 8ae3 +7ff0 8acb +7ff3 e3c8 +7ff9 e3c9 +7ffb 967c +7ffc 9783 +8000 9773 +8001 9856 +8003 8d6c +8004 e3cc +8005 8ed2 +8006 e3cb +800b e3cd +800c 8ea7 +8010 91cf +8012 e3ce +8015 8d6b +8017 96d5 +8018 e3cf +8019 e3d0 +801c e3d1 +8021 e3d2 +8028 e3d3 +8033 8ea8 +8036 96eb +803b e3d5 +803d 925e +803f e3d4 +8046 e3d7 +804a e3d6 +8052 e3d8 +8056 90b9 +8058 e3d9 +805a e3da +805e 95b7 +805f e3db +8061 918f +8062 e3dc +8068 e3dd +806f 97fc +8070 e3e0 +8072 e3df +8073 e3de +8074 92ae +8076 e3e1 +8077 9045 +8079 e3e2 +807d e3e3 +807e 9857 +807f e3e4 +8084 e3e5 +8085 e3e7 +8086 e3e6 +8087 94a3 +8089 93f7 +808b 985d +808c 94a7 +8093 e3e9 +8096 8fd1 +8098 9549 +809a e3ea +809b e3e8 +809d 8acc +80a1 8cd2 +80a2 8e88 +80a5 94ec +80a9 8ca8 +80aa 9662 +80ac e3ed +80ad e3eb +80af 8d6d +80b1 8d6e +80b2 88e7 +80b4 8de6 +80ba 9478 +80c3 88dd +80c4 e3f2 +80c6 925f +80cc 9477 +80ce 91d9 +80d6 e3f4 +80d9 e3f0 +80da e3f3 +80db e3ee +80dd e3f1 +80de 9645 +80e1 8cd3 +80e4 88fb +80e5 e3ef +80ef e3f6 +80f1 e3f7 +80f4 93b7 +80f8 8bb9 +80fc e445 +80fd 945c +8102 8e89 +8105 8bba +8106 90c6 +8107 9865 +8108 96ac +8109 e3f5 +810a 90d2 +811a 8b72 +811b e3f8 +8123 e3fa +8129 e3f9 +812f e3fb +8131 9245 +8133 945d +8139 92af +813e e442 +8146 e441 +814b e3fc +814e 9074 +8150 9585 +8151 e444 +8153 e443 +8154 8d6f +8155 9872 +815f e454 +8165 e448 +8166 e449 +816b 8eee +816e e447 +8170 8d98 +8171 e446 +8174 e44a +8178 92b0 +8179 95a0 +817a 9142 +817f 91da +8180 e44e +8182 e44f +8183 e44b +8188 e44c +818a e44d +818f 8d70 +8193 e455 +8195 e451 +819a 9586 +819c 968c +819d 9547 +81a0 e450 +81a3 e453 +81a4 e452 +81a8 9663 +81a9 e456 +81b0 e457 +81b3 9156 +81b5 e458 +81b8 e45a +81ba e45e +81bd e45b +81be e459 +81bf 945e +81c0 e45c +81c2 e45d +81c6 89b0 +81c8 e464 +81c9 e45f +81cd e460 +81d1 e461 +81d3 919f +81d8 e463 +81d9 e462 +81da e465 +81df e466 +81e0 e467 +81e3 9062 +81e5 89e7 +81e7 e468 +81e8 97d5 +81ea 8ea9 +81ed 8f4c +81f3 8e8a +81f4 9276 +81fa e469 +81fb e46a +81fc 8950 +81fe e46b +8201 e46c +8202 e46d +8205 e46e +8207 e46f +8208 8bbb +8209 9da8 +820a e470 +820c 90e3 +820d e471 +820e 8ec9 +8210 e472 +8212 98ae +8216 e473 +8217 95dc +8218 8ada +821b 9143 +821c 8f77 +821e 9591 +821f 8f4d +8229 e474 +822a 8d71 +822b e475 +822c 94ca +822e e484 +8233 e477 +8235 91c7 +8236 9495 +8237 8cbd +8238 e476 +8239 9144 +8240 e478 +8247 92f8 +8258 e47a +8259 e479 +825a e47c +825d e47b +825f e47d +8262 e480 +8264 e47e +8266 8acd +8268 e481 +826a e482 +826b e483 +826e 8daf +826f 97c7 +8271 e485 +8272 9046 +8276 8990 +8277 e486 +8278 e487 +827e e488 +828b 88f0 +828d e489 +8292 e48a +8299 9587 +829d 8ec5 +829f e48c +82a5 8a48 +82a6 88b0 +82ab e48b +82ac e48e +82ad 946d +82af 9063 +82b1 89d4 +82b3 9646 +82b8 8c7c +82b9 8bda +82bb e48d +82bd 89e8 +82c5 8aa1 +82d1 8991 +82d2 e492 +82d3 97e8 +82d4 91db +82d7 9563 +82d9 e49e +82db 89d5 +82dc e49c +82de e49a +82df e491 +82e1 e48f +82e3 e490 +82e5 8ee1 +82e6 8bea +82e7 9297 +82eb 93cf +82f1 8970 +82f3 e494 +82f4 e493 +82f9 e499 +82fa e495 +82fb e498 +8302 96ce +8303 e497 +8304 89d6 +8305 8a9d +8306 e49b +8309 e49d +830e 8c73 +8316 e4a1 +8317 e4aa +8318 e4ab +831c 88a9 +8323 e4b2 +8328 88ef +832b e4a9 +832f e4a8 +8331 e4a3 +8332 e4a2 +8334 e4a0 +8335 e49f +8336 9283 +8338 91f9 +8339 e4a5 +8340 e4a4 +8345 e4a7 +8349 9190 +834a 8c74 +834f 8960 +8350 e4a6 +8352 8d72 +8358 9191 +8373 e4b8 +8375 e4b9 +8377 89d7 +837b 89ac +837c e4b6 +8385 e4ac +8387 e4b4 +8389 e4bb +838a e4b5 +838e e4b3 +8393 e496 +8396 e4b1 +839a e4ad +839e 8ace +839f e4af +83a0 e4ba +83a2 e4b0 +83a8 e4bc +83aa e4ae +83ab 949c +83b1 9789 +83b5 e4b7 +83bd e4cd +83c1 e4c5 +83c5 909b +83ca 8b65 +83cc 8bdb +83ce e4c0 +83d3 89d9 +83d6 8fd2 +83d8 e4c3 +83dc 8dd8 +83df 9370 +83e0 e4c8 +83e9 95ec +83eb e4bf +83ef 89d8 +83f0 8cd4 +83f1 9548 +83f2 e4c9 +83f4 e4bd +83f7 e4c6 +83fb e4d0 +83fd e4c1 +8403 e4c2 +8404 93b8 +8407 e4c7 +840b e4c4 +840c 9647 +840d e4ca +840e 88de +8413 e4be +8420 e4cc +8422 e4cb +8429 948b +842a e4d2 +842c e4dd +8431 8a9e +8435 e4e0 +8438 e4ce +843c e4d3 +843d 978e +8446 e4dc +8449 9774 +844e 97a8 +8457 9298 +845b 8a8b +8461 9592 +8462 e4e2 +8463 939f +8466 88af +8469 e4db +846b e4d7 +846c 9192 +846d e4d1 +846e e4d9 +846f e4de +8471 944b +8475 88a8 +8477 e4d6 +8479 e4df +847a 9598 +8482 e4da +8484 e4d5 +848b 8fd3 +8490 8f4e +8494 8eaa +8499 96d6 +849c 9566 +849f e4e5 +84a1 e4ee +84ad e4d8 +84b2 8a97 +84b8 8ff6 +84b9 e4e3 +84bb e4e8 +84bc 9193 +84bf e4e4 +84c1 e4eb +84c4 927e +84c6 e4ec +84c9 9775 +84ca e4e1 +84cb 8a57 +84cd e4e7 +84d0 e4ea +84d1 96aa +84d6 e4ed +84d9 e4e6 +84da e4e9 +84ec 9648 +84ee 9840 +84f4 e4f1 +84fc e4f8 +84ff e4f0 +8500 8ec1 +8506 e4cf +8511 95cc +8513 96a0 +8514 e4f7 +8515 e4f6 +8517 e4f2 +8518 e4f3 +851a 8955 +851f e4f5 +8521 e4ef +8526 92d3 +852c e4f4 +852d 88fc +8535 91a0 +853d 95c1 +8540 e4f9 +8541 e540 +8543 94d7 +8548 e4fc +8549 8fd4 +854a 8ec7 +854b e542 +854e 8bbc +8555 e543 +8557 9599 +8558 e4fb +855a e4d4 +8563 e4fa +8568 986e +8569 93a0 +856a 9593 +856d e54a +8577 e550 +857e e551 +8580 e544 +8584 9496 +8587 e54e +8588 e546 +858a e548 +8590 e552 +8591 e547 +8594 e54b +8597 8992 +8599 93e3 +859b e54c +859c e54f +85a4 e545 +85a6 9145 +85a8 e549 +85a9 8e46 +85aa 9064 +85ab 8c4f +85ac 96f2 +85ae 96f7 +85af 8f92 +85b9 e556 +85ba e554 +85c1 986d +85c9 e553 +85cd 9795 +85cf e555 +85d0 e557 +85d5 e558 +85dc e55b +85dd e559 +85e4 93a1 +85e5 e55a +85e9 94cb +85ea e54d +85f7 8f93 +85f9 e55c +85fa e561 +85fb 9194 +85fe e560 +8602 e541 +8606 e562 +8607 9168 +860a e55d +860b e55f +8613 e55e +8616 9f50 +8617 9f41 +861a e564 +8622 e563 +862d 9796 +862f e1ba +8630 e565 +863f e566 +864d e567 +864e 8cd5 +8650 8b73 +8654 e569 +8655 997c +865a 8b95 +865c 97b8 +865e 8bf1 +865f e56a +8667 e56b +866b 928e +8671 e56c +8679 93f8 +867b 88b8 +868a 89e1 +868b e571 +868c e572 +8693 e56d +8695 8e5c +86a3 e56e +86a4 9461 +86a9 e56f +86aa e570 +86ab e57a +86af e574 +86b0 e577 +86b6 e573 +86c4 e575 +86c6 e576 +86c7 8ed6 +86c9 e578 +86cb 9260 +86cd 8c75 +86ce 8a61 +86d4 e57b +86d9 8a5e +86db e581 +86de e57c +86df e580 +86e4 94b8 +86e9 e57d +86ec e57e +86ed 9567 +86ee 94d8 +86ef e582 +86f8 91fb +86f9 e58c +86fb e588 +86fe 89e9 +8700 e586 +8702 9649 +8703 e587 +8706 e584 +8708 e585 +8709 e58a +870a e58d +870d e58b +8711 e589 +8712 e583 +8718 9277 +871a e594 +871c 96a8 +8725 e592 +8729 e593 +8734 e58e +8737 e590 +873b e591 +873f e58f +8749 90e4 +874b 9858 +874c e598 +874e e599 +8753 e59f +8755 9049 +8757 e59b +8759 e59e +875f e596 +8760 e595 +8763 e5a0 +8766 89da +8768 e59c +876a e5a1 +876e e59d +8774 e59a +8776 92b1 +8778 e597 +877f 9488 +8782 e5a5 +878d 975a +879f e5a4 +87a2 e5a3 +87ab e5ac +87af e5a6 +87b3 e5ae +87ba 9786 +87bb e5b1 +87bd e5a8 +87c0 e5a9 +87c4 e5ad +87c6 e5b0 +87c7 e5af +87cb e5a7 +87d0 e5aa +87d2 e5bb +87e0 e5b4 +87ef e5b2 +87f2 e5b3 +87f6 e5b8 +87f7 e5b9 +87f9 8a49 +87fb 8b61 +87fe e5b7 +8805 e5a2 +880d e5b6 +880e e5ba +880f e5b5 +8811 e5bc +8815 e5be +8816 e5bd +8821 e5c0 +8822 e5bf +8823 e579 +8827 e5c4 +8831 e5c1 +8836 e5c2 +8839 e5c3 +883b e5c5 +8840 8c8c +8842 e5c7 +8844 e5c6 +8846 8f4f +884c 8d73 +884d 9fa5 +8852 e5c8 +8853 8f70 +8857 8a58 +8859 e5c9 +885b 8971 +885d 8fd5 +885e e5ca +8861 8d74 +8862 e5cb +8863 88df +8868 955c +886b e5cc +8870 908a +8872 e5d3 +8875 e5d0 +8877 928f +887d e5d1 +887e e5ce +887f 8bdc +8881 e5cd +8882 e5d4 +8888 8c55 +888b 91dc +888d e5da +8892 e5d6 +8896 91b3 +8897 e5d5 +8899 e5d8 +889e e5cf +88a2 e5d9 +88a4 e5db +88ab 94ed +88ae e5d7 +88b0 e5dc +88b1 e5de +88b4 8cd1 +88b5 e5d2 +88b7 88bf +88bf e5dd +88c1 8dd9 +88c2 97f4 +88c3 e5df +88c4 e5e0 +88c5 9195 +88cf 97a0 +88d4 e5e1 +88d5 9754 +88d8 e5e2 +88d9 e5e3 +88dc 95e2 +88dd e5e4 +88df 8dbe +88e1 97a1 +88e8 e5e9 +88f2 e5ea +88f3 8fd6 +88f4 e5e8 +88f8 9787 +88f9 e5e5 +88fc e5e7 +88fd 90bb +88fe 909e +8902 e5e6 +8904 e5eb +8907 95a1 +890a e5ed +890c e5ec +8910 8a8c +8912 964a +8913 e5ee +891d e5fa +891e e5f0 +8925 e5f1 +892a e5f2 +892b e5f3 +8936 e5f7 +8938 e5f8 +893b e5f6 +8941 e5f4 +8943 e5ef +8944 e5f5 +894c e5f9 +894d e8b5 +8956 89a6 +895e e5fc +895f 8bdd +8960 e5fb +8964 e641 +8966 e640 +896a e643 +896d e642 +896f e644 +8972 8f50 +8974 e645 +8977 e646 +897e e647 +897f 90bc +8981 9776 +8983 e648 +8986 95a2 +8987 9465 +8988 e649 +898a e64a +898b 8ca9 +898f 8b4b +8993 e64b +8996 8e8b +8997 9460 +8998 e64c +899a 8a6f +89a1 e64d +89a6 e64f +89a7 9797 +89a9 e64e +89aa 9065 +89ac e650 +89af e651 +89b2 e652 +89b3 8acf +89ba e653 +89bd e654 +89bf e655 +89c0 e656 +89d2 8a70 +89da e657 +89dc e658 +89dd e659 +89e3 89f0 +89e6 9047 +89e7 e65a +89f4 e65b +89f8 e65c +8a00 8cbe +8a02 92f9 +8a03 e65d +8a08 8c76 +8a0a 9075 +8a0c e660 +8a0e 93a2 +8a10 e65f +8a13 8c50 +8a16 e65e +8a17 91f5 +8a18 8b4c +8a1b e661 +8a1d e662 +8a1f 8fd7 +8a23 8c8d +8a25 e663 +8a2a 964b +8a2d 90dd +8a31 8b96 +8a33 96f3 +8a34 9169 +8a36 e664 +8a3a 9066 +8a3b 9290 +8a3c 8fd8 +8a41 e665 +8a46 e668 +8a48 e669 +8a50 8dbc +8a51 91c0 +8a52 e667 +8a54 8fd9 +8a55 955d +8a5b e666 +8a5e 8e8c +8a60 8972 +8a62 e66d +8a63 8c77 +8a66 8e8e +8a69 8e8d +8a6b 986c +8a6c e66c +8a6d e66b +8a6e 9146 +8a70 8b6c +8a71 9862 +8a72 8a59 +8a73 8fda +8a7c e66a +8a82 e66f +8a84 e670 +8a85 e66e +8a87 8cd6 +8a89 975f +8a8c 8e8f +8a8d 9446 +8a91 e673 +8a93 90be +8a95 9261 +8a98 9755 +8a9a e676 +8a9e 8cea +8aa0 90bd +8aa1 e672 +8aa3 e677 +8aa4 8ceb +8aa5 e674 +8aa6 e675 +8aa8 e671 +8aac 90e0 +8aad 93c7 +8ab0 924e +8ab2 89db +8ab9 94ee +8abc 8b62 +8abf 92b2 +8ac2 e67a +8ac4 e678 +8ac7 926b +8acb 90bf +8acc 8ad0 +8acd e679 +8acf 907a +8ad2 97c8 +8ad6 985f +8ada e67b +8adb e687 +8adc 92b3 +8ade e686 +8ae0 e683 +8ae1 e68b +8ae2 e684 +8ae4 e680 +8ae6 92fa +8ae7 e67e +8aeb e67c +8aed 9740 +8aee 8e90 +8af1 e681 +8af3 e67d +8af7 e685 +8af8 8f94 +8afa 8cbf +8afe 91f8 +8b00 9664 +8b01 8979 +8b02 88e0 +8b04 93a3 +8b07 e689 +8b0c e688 +8b0e 93e4 +8b10 e68d +8b14 e682 +8b16 e68c +8b17 e68e +8b19 8caa +8b1a e68a +8b1b 8d75 +8b1d 8ed3 +8b20 e68f +8b21 9777 +8b26 e692 +8b28 e695 +8b2b e693 +8b2c 9554 +8b33 e690 +8b39 8bde +8b3e e694 +8b41 e696 +8b49 e69a +8b4c e697 +8b4e e699 +8b4f e698 +8b56 e69b +8b58 8eaf +8b5a e69d +8b5b e69c +8b5c 9588 +8b5f e69f +8b66 8c78 +8b6b e69e +8b6c e6a0 +8b6f e6a1 +8b70 8b63 +8b71 e3bf +8b72 8ff7 +8b74 e6a2 +8b77 8cec +8b7d e6a3 +8b80 e6a4 +8b83 8e5d +8b8a 9dcc +8b8c e6a5 +8b8e e6a6 +8b90 8f51 +8b92 e6a7 +8b93 e6a8 +8b96 e6a9 +8b99 e6aa +8b9a e6ab +8c37 924a +8c3a e6ac +8c3f e6ae +8c41 e6ad +8c46 93a4 +8c48 e6af +8c4a 964c +8c4c e6b0 +8c4e e6b1 +8c50 e6b2 +8c55 e6b3 +8c5a 93d8 +8c61 8fdb +8c62 e6b4 +8c6a 8d8b +8c6b 98ac +8c6c e6b5 +8c78 e6b6 +8c79 955e +8c7a e6b7 +8c7c e6bf +8c82 e6b8 +8c85 e6ba +8c89 e6b9 +8c8a e6bb +8c8c 9665 +8c8d e6bc +8c8e e6bd +8c94 e6be +8c98 e6c0 +8c9d 8a4c +8c9e 92e5 +8ca0 9589 +8ca1 8de0 +8ca2 8d76 +8ca7 956e +8ca8 89dd +8ca9 94cc +8caa e6c3 +8cab 8ad1 +8cac 90d3 +8cad e6c2 +8cae e6c7 +8caf 9299 +8cb0 96e1 +8cb2 e6c5 +8cb3 e6c6 +8cb4 8b4d +8cb6 e6c8 +8cb7 9483 +8cb8 91dd +8cbb 94ef +8cbc 935c +8cbd e6c4 +8cbf 9666 +8cc0 89ea +8cc1 e6ca +8cc2 9847 +8cc3 92c0 +8cc4 9864 +8cc7 8e91 +8cc8 e6c9 +8cca 91af +8ccd e6da +8cce 9147 +8cd1 93f6 +8cd3 956f +8cda e6cd +8cdb 8e5e +8cdc 8e92 +8cde 8fdc +8ce0 9485 +8ce2 8cab +8ce3 e6cc +8ce4 e6cb +8ce6 958a +8cea 8ebf +8ced 9371 +8cfa e6cf +8cfb e6d0 +8cfc 8d77 +8cfd e6ce +8d04 e6d1 +8d05 e6d2 +8d07 e6d4 +8d08 91a1 +8d0a e6d3 +8d0b 8ae4 +8d0d e6d6 +8d0f e6d5 +8d10 e6d7 +8d13 e6d9 +8d14 e6db +8d16 e6dc +8d64 90d4 +8d66 8ecd +8d67 e6dd +8d6b 8a71 +8d6d e6de +8d70 9196 +8d71 e6df +8d73 e6e0 +8d74 958b +8d77 8b4e +8d81 e6e1 +8d85 92b4 +8d8a 897a +8d99 e6e2 +8da3 8eef +8da8 9096 +8db3 91ab +8dba e6e5 +8dbe e6e4 +8dc2 e6e3 +8dcb e6eb +8dcc e6e9 +8dcf e6e6 +8dd6 e6e8 +8dda e6e7 +8ddb e6ea +8ddd 8b97 +8ddf e6ee +8de1 90d5 +8de3 e6ef +8de8 8cd7 +8dea e6ec +8deb e6ed +8def 9848 +8df3 92b5 +8df5 9148 +8dfc e6f0 +8dff e6f3 +8e08 e6f1 +8e09 e6f2 +8e0a 9778 +8e0f 93a5 +8e10 e6f6 +8e1d e6f4 +8e1e e6f5 +8e1f e6f7 +8e2a e748 +8e30 e6fa +8e34 e6fb +8e35 e6f9 +8e42 e6f8 +8e44 92fb +8e47 e740 +8e48 e744 +8e49 e741 +8e4a e6fc +8e4c e742 +8e50 e743 +8e55 e74a +8e59 e745 +8e5f 90d6 +8e60 e747 +8e63 e749 +8e64 e746 +8e72 e74c +8e74 8f52 +8e76 e74b +8e7c e74d +8e81 e74e +8e84 e751 +8e85 e750 +8e87 e74f +8e8a e753 +8e8b e752 +8e8d 96f4 +8e91 e755 +8e93 e754 +8e94 e756 +8e99 e757 +8ea1 e759 +8eaa e758 +8eab 9067 +8eac e75a +8eaf 8beb +8eb0 e75b +8eb1 e75d +8ebe e75e +8ec5 e75f +8ec6 e75c +8ec8 e760 +8eca 8ed4 +8ecb e761 +8ecc 8b4f +8ecd 8c52 +8ed2 8cac +8edb e762 +8edf 93ee +8ee2 935d +8ee3 e763 +8eeb e766 +8ef8 8eb2 +8efb e765 +8efc e764 +8efd 8c79 +8efe e767 +8f03 8a72 +8f05 e769 +8f09 8dda +8f0a e768 +8f0c e771 +8f12 e76b +8f13 e76d +8f14 95e3 +8f15 e76a +8f19 e76c +8f1b e770 +8f1c e76e +8f1d 8b50 +8f1f e76f +8f26 e772 +8f29 9479 +8f2a 97d6 +8f2f 8f53 +8f33 e773 +8f38 9741 +8f39 e775 +8f3b e774 +8f3e e778 +8f3f 9760 +8f42 e777 +8f44 8a8d +8f45 e776 +8f46 e77b +8f49 e77a +8f4c e779 +8f4d 9351 +8f4e e77c +8f57 e77d +8f5c e77e +8f5f 8d8c +8f61 8c44 +8f62 e780 +8f63 e781 +8f64 e782 +8f9b 9068 +8f9c e783 +8f9e 8eab +8f9f e784 +8fa3 e785 +8fa7 999f +8fa8 999e +8fad e786 +8fae e390 +8faf e787 +8fb0 9243 +8fb1 904a +8fb2 945f +8fb7 e788 +8fba 95d3 +8fbb 92d2 +8fbc 8d9e +8fbf 9248 +8fc2 8949 +8fc4 9698 +8fc5 9076 +8fce 8c7d +8fd1 8bdf +8fd4 95d4 +8fda e789 +8fe2 e78b +8fe5 e78a +8fe6 89de +8fe9 93f4 +8fea e78c +8feb 9497 +8fed 9352 +8fef e78d +8ff0 8f71 +8ff4 e78f +8ff7 96c0 +8ff8 e79e +8ff9 e791 +8ffa e792 +8ffd 92c7 +9000 91de +9001 9197 +9003 93a6 +9005 e790 +9006 8b74 +900b e799 +900d e796 +900e e7a3 +900f 93a7 +9010 9280 +9011 e793 +9013 92fc +9014 9372 +9015 e794 +9016 e798 +9017 9080 +9019 9487 +901a 92ca +901d 90c0 +901e e797 +901f 91ac +9020 91a2 +9021 e795 +9022 88a7 +9023 9841 +9027 e79a +902e 91df +9031 8f54 +9032 9069 +9035 e79c +9036 e79b +9038 88ed +9039 e79d +903c 954e +903e e7a5 +9041 93d9 +9042 908b +9045 9278 +9047 8bf6 +9049 e7a4 +904a 9756 +904b 895e +904d 95d5 +904e 89df +904f e79f +9050 e7a0 +9051 e7a1 +9052 e7a2 +9053 93b9 +9054 9242 +9055 88e1 +9056 e7a6 +9058 e7a7 +9059 eaa1 +905c 91bb +905e e7a8 +9060 8993 +9061 916b +9063 8cad +9065 9779 +9068 e7a9 +9069 934b +906d 9198 +906e 8ed5 +906f e7aa +9072 e7ad +9075 8f85 +9076 e7ab +9077 914a +9078 9149 +907a 88e2 +907c 97c9 +907d e7af +907f 94f0 +9080 e7b1 +9081 e7b0 +9082 e7ae +9083 e284 +9084 8ad2 +9087 e78e +9089 e7b3 +908a e7b2 +908f e7b4 +9091 9757 +90a3 93df +90a6 964d +90a8 e7b5 +90aa 8ed7 +90af e7b6 +90b1 e7b7 +90b5 e7b8 +90b8 9340 +90c1 88e8 +90ca 8d78 +90ce 9859 +90db e7bc +90e1 8c53 +90e2 e7b9 +90e4 e7ba +90e8 9594 +90ed 8a73 +90f5 9758 +90f7 8bbd +90fd 9373 +9102 e7bd +9112 e7be +9119 e7bf +912d 9341 +9130 e7c1 +9132 e7c0 +9149 93d1 +914a e7c2 +914b 8f55 +914c 8ede +914d 947a +914e 9291 +9152 8ef0 +9154 908c +9156 e7c3 +9158 e7c4 +9162 907c +9163 e7c5 +9165 e7c6 +9169 e7c7 +916a 978f +916c 8f56 +9172 e7c9 +9173 e7c8 +9175 8d79 +9177 8d93 +9178 8e5f +9182 e7cc +9187 8f86 +9189 e7cb +918b e7ca +918d 91e7 +9190 8ced +9192 90c1 +9197 94ae +919c 8f58 +91a2 e7cd +91a4 8fdd +91aa e7d0 +91ab e7ce +91af e7cf +91b4 e7d2 +91b5 e7d1 +91b8 8ff8 +91ba e7d3 +91c0 e7d4 +91c1 e7d5 +91c6 94ce +91c7 8dd1 +91c8 8edf +91c9 e7d6 +91cb e7d7 +91cc 97a2 +91cd 8f64 +91ce 96ec +91cf 97ca +91d0 e7d8 +91d1 8be0 +91d6 e7d9 +91d8 9342 +91db e7dc +91dc 8a98 +91dd 906a +91df e7da +91e1 e7db +91e3 92de +91e6 9674 +91e7 8bfa +91f5 e7de +91f6 e7df +91fc e7dd +91ff e7e1 +920d 93dd +920e 8a62 +9211 e7e5 +9214 e7e2 +9215 e7e4 +921e e7e0 +9229 e86e +922c e7e3 +9234 97e9 +9237 8cd8 +923f e7ed +9244 9353 +9245 e7e8 +9248 e7eb +9249 e7e9 +924b e7ee +9250 e7ef +9257 e7e7 +925a e7f4 +925b 8994 +925e e7e6 +9262 94ab +9264 e7ea +9266 8fde +9271 8d7a +927e 9667 +9280 8be2 +9283 8f65 +9285 93ba +9291 914c +9293 e7f2 +9295 e7ec +9296 e7f1 +9298 96c1 +929a 92b6 +929b e7f3 +929c e7f0 +92ad 914b +92b7 e7f7 +92b9 e7f6 +92cf e7f5 +92d2 964e +92e4 8f9b +92e9 e7f8 +92ea 95dd +92ed 8973 +92f2 9565 +92f3 9292 +92f8 8b98 +92fa e7fa +92fc 8d7c +9306 8e4b +930f e7f9 +9310 908d +9318 908e +9319 e840 +931a e842 +9320 8ff9 +9322 e841 +9323 e843 +9326 8bd1 +9328 9564 +932b 8ee0 +932c 9842 +932e e7fc +932f 8df6 +9332 985e +9335 e845 +933a e844 +933b e846 +9344 e7fb +934b 93e7 +934d 9374 +9354 92d5 +9356 e84b +935b 9262 +935c e847 +9360 e848 +936c 8c4c +936e e84a +9375 8cae +937c e849 +937e 8fdf +938c 8a99 +9394 e84f +9396 8dbd +9397 9199 +939a 92c8 +93a7 8a5a +93ac e84d +93ad e84e +93ae 92c1 +93b0 e84c +93b9 e850 +93c3 e856 +93c8 e859 +93d0 e858 +93d1 934c +93d6 e851 +93d7 e852 +93d8 e855 +93dd e857 +93e1 8bbe +93e4 e85a +93e5 e854 +93e8 e853 +9403 e85e +9407 e85f +9410 e860 +9413 e85d +9414 e85c +9418 8fe0 +9419 93a8 +941a e85b +9421 e864 +942b e862 +9435 e863 +9436 e861 +9438 91f6 +943a e865 +9441 e866 +9444 e868 +9451 8ad3 +9452 e867 +9453 96f8 +945a e873 +945b e869 +945e e86c +9460 e86a +9462 e86b +946a e86d +9470 e86f +9475 e870 +9477 e871 +947c e874 +947d e872 +947e e875 +947f e877 +9481 e876 +9577 92b7 +9580 96e5 +9582 e878 +9583 914d +9587 e879 +9589 95c2 +958a e87a +958b 8a4a +958f 895b +9591 8ad5 +9593 8ad4 +9594 e87b +9596 e87c +9598 e87d +9599 e87e +95a0 e880 +95a2 8ad6 +95a3 8a74 +95a4 8d7d +95a5 94b4 +95a7 e882 +95a8 e881 +95ad e883 +95b2 897b +95b9 e886 +95bb e885 +95bc e884 +95be e887 +95c3 e88a +95c7 88c5 +95ca e888 +95cc e88c +95cd e88b +95d4 e88e +95d5 e88d +95d6 e88f +95d8 93ac +95dc e890 +95e1 e891 +95e2 e893 +95e5 e892 +961c 958c +9621 e894 +9628 e895 +962a 8de3 +962e e896 +962f e897 +9632 9668 +963b 916a +963f 88a2 +9640 91c9 +9642 e898 +9644 958d +964b e89b +964c e899 +964d 8d7e +964f e89a +9650 8cc0 +965b 95c3 +965c e89d +965d e89f +965e e89e +965f e8a0 +9662 8940 +9663 9077 +9664 8f9c +9665 8ad7 +9666 e8a1 +966a 9486 +966c e8a3 +9670 8941 +9672 e8a2 +9673 92c2 +9675 97cb +9676 93a9 +9677 e89c +9678 97a4 +967a 8caf +967d 977a +9685 8bf7 +9686 97b2 +9688 8c47 +968a 91e0 +968b e440 +968d e8a4 +968e 8a4b +968f 908f +9694 8a75 +9695 e8a6 +9697 e8a7 +9698 e8a5 +9699 8c84 +969b 8ddb +969c 8fe1 +96a0 8942 +96a3 97d7 +96a7 e8a9 +96a8 e7ac +96aa e8a8 +96b0 e8ac +96b1 e8aa +96b2 e8ab +96b4 e8ad +96b6 e8ae +96b7 97ea +96b8 e8af +96b9 e8b0 +96bb 90c7 +96bc 94b9 +96c0 909d +96c1 8ae5 +96c4 9759 +96c5 89eb +96c6 8f57 +96c7 8cd9 +96c9 e8b3 +96cb e8b2 +96cc 8e93 +96cd e8b4 +96ce e8b1 +96d1 8e47 +96d5 e8b8 +96d6 e5ab +96d9 99d4 +96db 9097 +96dc e8b6 +96e2 97a3 +96e3 93ef +96e8 894a +96ea 90e1 +96eb 8eb4 +96f0 95b5 +96f2 895f +96f6 97eb +96f7 978b +96f9 e8b9 +96fb 9364 +9700 8ef9 +9704 e8ba +9706 e8bb +9707 906b +9708 e8bc +970a 97ec +970d e8b7 +970e e8be +970f e8c0 +9711 e8bf +9713 e8bd +9716 e8c1 +9719 e8c2 +971c 919a +971e 89e0 +9724 e8c3 +9727 96b6 +972a e8c4 +9730 e8c5 +9732 9849 +9738 9e50 +9739 e8c6 +973d e8c7 +973e e8c8 +9742 e8cc +9744 e8c9 +9746 e8ca +9748 e8cb +9749 e8cd +9752 90c2 +9756 96f5 +9759 90c3 +975c e8ce +975e 94f1 +9760 e8cf +9761 ea72 +9762 96ca +9764 e8d0 +9766 e8d1 +9768 e8d2 +9769 8a76 +976b e8d4 +976d 9078 +9771 e8d5 +9774 8c43 +9779 e8d6 +977a e8da +977c e8d8 +9781 e8d9 +9784 8a93 +9785 e8d7 +9786 e8db +978b e8dc +978d 88c6 +978f e8dd +9790 e8de +9798 8fe2 +979c e8df +97a0 8b66 +97a3 e8e2 +97a6 e8e1 +97a8 e8e0 +97ab e691 +97ad 95da +97b3 e8e3 +97b4 e8e4 +97c3 e8e5 +97c6 e8e6 +97c8 e8e7 +97cb e8e8 +97d3 8ad8 +97dc e8e9 +97ed e8ea +97ee 9442 +97f2 e8ec +97f3 89b9 +97f5 e8ef +97f6 e8ee +97fb 8943 +97ff 8bbf +9801 95c5 +9802 92b8 +9803 8da0 +9805 8d80 +9806 8f87 +9808 907b +980c e8f1 +980f e8f0 +9810 9761 +9811 8ae6 +9812 94d0 +9813 93da +9817 909c +9818 97cc +981a 8c7a +9821 e8f4 +9824 e8f3 +982c 966a +982d 93aa +9834 896f +9837 e8f5 +9838 e8f2 +983b 9570 +983c 978a +983d e8f6 +9846 e8f7 +984b e8f9 +984c 91e8 +984d 8a7a +984e 8a7b +984f e8f8 +9854 8ae7 +9855 8cb0 +9858 8ae8 +985b 935e +985e 97de +9867 8cda +986b e8fa +986f e8fb +9870 e8fc +9871 e940 +9873 e942 +9874 e941 +98a8 9597 +98aa e943 +98af e944 +98b1 e945 +98b6 e946 +98c3 e948 +98c4 e947 +98c6 e949 +98db 94f2 +98dc e3ca +98df 9048 +98e2 8b51 +98e9 e94a +98eb e94b +98ed 99aa +98ee 9f5a +98ef 94d1 +98f2 88f9 +98f4 88b9 +98fc 8e94 +98fd 964f +98fe 8ffc +9903 e94c +9905 96dd +9909 e94d +990a 977b +990c 8961 +9910 8e60 +9912 e94e +9913 89ec +9914 e94f +9918 e950 +991d e952 +991e e953 +9920 e955 +9921 e951 +9924 e954 +9928 8ad9 +992c e956 +992e e957 +993d e958 +993e e959 +9942 e95a +9945 e95c +9949 e95b +994b e95e +994c e961 +9950 e95d +9951 e95f +9952 e960 +9955 e962 +9957 8bc0 +9996 8ef1 +9997 e963 +9998 e964 +9999 8d81 +99a5 e965 +99a8 8a5d +99ac 946e +99ad e966 +99ae e967 +99b3 9279 +99b4 93e9 +99bc e968 +99c1 949d +99c4 91ca +99c5 8977 +99c6 8bec +99c8 8bed +99d0 9293 +99d1 e96d +99d2 8bee +99d5 89ed +99d8 e96c +99db e96a +99dd e96b +99df e969 +99e2 e977 +99ed e96e +99ee e96f +99f1 e970 +99f2 e971 +99f8 e973 +99fb e972 +99ff 8f78 +9a01 e974 +9a05 e976 +9a0e 8b52 +9a0f e975 +9a12 919b +9a13 8cb1 +9a19 e978 +9a28 91cb +9a2b e979 +9a30 93ab +9a37 e97a +9a3e e980 +9a40 e97d +9a42 e97c +9a43 e97e +9a45 e97b +9a4d e982 +9a55 e981 +9a57 e984 +9a5a 8bc1 +9a5b e983 +9a5f e985 +9a62 e986 +9a64 e988 +9a65 e987 +9a69 e989 +9a6a e98b +9a6b e98a +9aa8 8d9c +9aad e98c +9ab0 e98d +9ab8 8a5b +9abc e98e +9ac0 e98f +9ac4 9091 +9acf e990 +9ad1 e991 +9ad3 e992 +9ad4 e993 +9ad8 8d82 +9ade e994 +9adf e995 +9ae2 e996 +9ae3 e997 +9ae6 e998 +9aea 94af +9aeb e99a +9aed 9545 +9aee e99b +9aef e999 +9af1 e99d +9af4 e99c +9af7 e99e +9afb e99f +9b06 e9a0 +9b18 e9a1 +9b1a e9a2 +9b1f e9a3 +9b22 e9a4 +9b23 e9a5 +9b25 e9a6 +9b27 e9a7 +9b28 e9a8 +9b29 e9a9 +9b2a e9aa +9b2e e9ab +9b2f e9ac +9b31 9f54 +9b32 e9ad +9b3b e2f6 +9b3c 8b53 +9b41 8a40 +9b42 8db0 +9b43 e9af +9b44 e9ae +9b45 96a3 +9b4d e9b1 +9b4e e9b2 +9b4f e9b0 +9b51 e9b3 +9b54 9682 +9b58 e9b4 +9b5a 8b9b +9b6f 9844 +9b74 e9b5 +9b83 e9b7 +9b8e 88bc +9b91 e9b8 +9b92 95a9 +9b93 e9b6 +9b96 e9b9 +9b97 e9ba +9b9f e9bb +9ba0 e9bc +9ba8 e9bd +9baa 968e +9bab 8e4c +9bad 8df8 +9bae 914e +9bb4 e9be +9bb9 e9c1 +9bc0 e9bf +9bc6 e9c2 +9bc9 8cef +9bca e9c0 +9bcf e9c3 +9bd1 e9c4 +9bd2 e9c5 +9bd4 e9c9 +9bd6 8e49 +9bdb 91e2 +9be1 e9ca +9be2 e9c7 +9be3 e9c6 +9be4 e9c8 +9be8 8c7e +9bf0 e9ce +9bf1 e9cd +9bf2 e9cc +9bf5 88b1 +9c04 e9d8 +9c06 e9d4 +9c08 e9d5 +9c09 e9d1 +9c0a e9d7 +9c0c e9d3 +9c0d 8a82 +9c10 986b +9c12 e9d6 +9c13 e9d2 +9c14 e9d0 +9c15 e9cf +9c1b e9da +9c21 e9dd +9c24 e9dc +9c25 e9db +9c2d 9568 +9c2e e9d9 +9c2f 88f1 +9c30 e9de +9c32 e9e0 +9c39 8a8f +9c3a e9cb +9c3b 8956 +9c3e e9e2 +9c46 e9e1 +9c47 e9df +9c48 924c +9c52 9690 +9c57 97d8 +9c5a e9e3 +9c60 e9e4 +9c67 e9e5 +9c76 e9e6 +9c78 e9e7 +9ce5 92b9 +9ce7 e9e8 +9ce9 94b5 +9ceb e9ed +9cec e9e9 +9cf0 e9ea +9cf3 9650 +9cf4 96c2 +9cf6 93ce +9d03 e9ee +9d06 e9ef +9d07 93bc +9d08 e9ec +9d09 e9eb +9d0e 89a8 +9d12 e9f7 +9d15 e9f6 +9d1b 8995 +9d1f e9f4 +9d23 e9f3 +9d26 e9f1 +9d28 8a9b +9d2a e9f0 +9d2b 8eb0 +9d2c 89a7 +9d3b 8d83 +9d3e e9fa +9d3f e9f9 +9d41 e9f8 +9d44 e9f5 +9d46 e9fb +9d48 e9fc +9d50 ea44 +9d51 ea43 +9d59 ea45 +9d5c 894c +9d5d ea40 +9d5e ea41 +9d60 8d94 +9d61 96b7 +9d64 ea42 +9d6c 9651 +9d6f ea4a +9d72 ea46 +9d7a ea4b +9d87 ea48 +9d89 ea47 +9d8f 8c7b +9d9a ea4c +9da4 ea4d +9da9 ea4e +9dab ea49 +9daf e9f2 +9db2 ea4f +9db4 92df +9db8 ea53 +9dba ea54 +9dbb ea52 +9dc1 ea51 +9dc2 ea57 +9dc4 ea50 +9dc6 ea55 +9dcf ea56 +9dd3 ea59 +9dd9 ea58 +9de6 ea5b +9ded ea5c +9def ea5d +9df2 9868 +9df8 ea5a +9df9 91e9 +9dfa 8deb +9dfd ea5e +9e1a ea5f +9e1b ea60 +9e1e ea61 +9e75 ea62 +9e78 8cb2 +9e79 ea63 +9e7d ea64 +9e7f 8ead +9e81 ea65 +9e88 ea66 +9e8b ea67 +9e8c ea68 +9e91 ea6b +9e92 ea69 +9e93 985b +9e95 ea6a +9e97 97ed +9e9d ea6c +9e9f 97d9 +9ea5 ea6d +9ea6 949e +9ea9 ea6e +9eaa ea70 +9ead ea71 +9eb8 ea6f +9eb9 8d8d +9eba 96cb +9ebb 9683 +9ebc 9bf5 +9ebe 9f80 +9ebf 969b +9ec4 89a9 +9ecc ea73 +9ecd 8b6f +9ece ea74 +9ecf ea75 +9ed0 ea76 +9ed2 8d95 +9ed4 ea77 +9ed8 e0d2 +9ed9 96d9 +9edb 91e1 +9edc ea78 +9edd ea7a +9ede ea79 +9ee0 ea7b +9ee5 ea7c +9ee8 ea7d +9eef ea7e +9ef4 ea80 +9ef6 ea81 +9ef7 ea82 +9ef9 ea83 +9efb ea84 +9efc ea85 +9efd ea86 +9f07 ea87 +9f08 ea88 +9f0e 9343 +9f13 8cdb +9f15 ea8a +9f20 916c +9f21 ea8b +9f2c ea8c +9f3b 9540 +9f3e ea8d +9f4a ea8e +9f4b e256 +9f4e e6d8 +9f4f e8eb +9f52 ea8f +9f54 ea90 +9f5f ea92 +9f60 ea93 +9f61 ea94 +9f62 97ee +9f63 ea91 +9f66 ea95 +9f67 ea96 +9f6a ea98 +9f6c ea97 +9f72 ea9a +9f76 ea9b +9f77 ea99 +9f8d 97b4 +9f95 ea9c +9f9c ea9d +9f9d e273 +9fa0 ea9e +ff01 8149 +ff03 8194 +ff04 8190 +ff05 8193 +ff06 8195 +ff08 8169 +ff09 816a +ff0a 8196 +ff0b 817b +ff0c 8143 +ff0e 8144 +ff0f 815e +ff10 824f +ff11 8250 +ff12 8251 +ff13 8252 +ff14 8253 +ff15 8254 +ff16 8255 +ff17 8256 +ff18 8257 +ff19 8258 +ff1a 8146 +ff1b 8147 +ff1c 8183 +ff1d 8181 +ff1e 8184 +ff1f 8148 +ff20 8197 +ff21 8260 +ff22 8261 +ff23 8262 +ff24 8263 +ff25 8264 +ff26 8265 +ff27 8266 +ff28 8267 +ff29 8268 +ff2a 8269 +ff2b 826a +ff2c 826b +ff2d 826c +ff2e 826d +ff2f 826e +ff30 826f +ff31 8270 +ff32 8271 +ff33 8272 +ff34 8273 +ff35 8274 +ff36 8275 +ff37 8276 +ff38 8277 +ff39 8278 +ff3a 8279 +ff3b 816d +ff3c 815f +ff3d 816e +ff3e 814f +ff3f 8151 +ff40 814d +ff41 8281 +ff42 8282 +ff43 8283 +ff44 8284 +ff45 8285 +ff46 8286 +ff47 8287 +ff48 8288 +ff49 8289 +ff4a 828a +ff4b 828b +ff4c 828c +ff4d 828d +ff4e 828e +ff4f 828f +ff50 8290 +ff51 8291 +ff52 8292 +ff53 8293 +ff54 8294 +ff55 8295 +ff56 8296 +ff57 8297 +ff58 8298 +ff59 8299 +ff5a 829a +ff5b 816f +ff5c 8162 +ff5d 8170 +ff61 a1 +ff62 a2 +ff63 a3 +ff64 a4 +ff65 a5 +ff66 a6 +ff67 a7 +ff68 a8 +ff69 a9 +ff6a aa +ff6b ab +ff6c ac +ff6d ad +ff6e ae +ff6f af +ff70 b0 +ff71 b1 +ff72 b2 +ff73 b3 +ff74 b4 +ff75 b5 +ff76 b6 +ff77 b7 +ff78 b8 +ff79 b9 +ff7a ba +ff7b bb +ff7c bc +ff7d bd +ff7e be +ff7f bf +ff80 c0 +ff81 c1 +ff82 c2 +ff83 c3 +ff84 c4 +ff85 c5 +ff86 c6 +ff87 c7 +ff88 c8 +ff89 c9 +ff8a ca +ff8b cb +ff8c cc +ff8d cd +ff8e ce +ff8f cf +ff90 d0 +ff91 d1 +ff92 d2 +ff93 d3 +ff94 d4 +ff95 d5 +ff96 d6 +ff97 d7 +ff98 d8 +ff99 d9 +ff9a da +ff9b db +ff9c dc +ff9d dd +ff9e de +ff9f df +ffe3 8150 +ffe5 818f diff --git a/jdk/test/java/nio/charset/coders/ref.windows-31j b/jdk/test/java/nio/charset/coders/ref.windows-31j new file mode 100644 index 00000000000..0766c319a8e --- /dev/null +++ b/jdk/test/java/nio/charset/coders/ref.windows-31j @@ -0,0 +1,9409 @@ +0 00 +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +9 09 +a 0a +b 0b +c 0c +d 0d +e 0e +f 0f +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +1a 1a +1b 1b +1c 1c +1d 1d +1e 1e +1f 1f +20 20 +21 21 +22 22 +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +2a 2a +2b 2b +2c 2c +2d 2d +2e 2e +2f 2f +30 30 +31 31 +32 32 +33 33 +34 34 +35 35 +36 36 +37 37 +38 38 +39 39 +3a 3a +3b 3b +3c 3c +3d 3d +3e 3e +3f 3f +40 40 +41 41 +42 42 +43 43 +44 44 +45 45 +46 46 +47 47 +48 48 +49 49 +4a 4a +4b 4b +4c 4c +4d 4d +4e 4e +4f 4f +50 50 +51 51 +52 52 +53 53 +54 54 +55 55 +56 56 +57 57 +58 58 +59 59 +5a 5a +5b 5b +5c 5c +5d 5d +5e 5e +5f 5f +60 60 +61 61 +62 62 +63 63 +64 64 +65 65 +66 66 +67 67 +68 68 +69 69 +6a 6a +6b 6b +6c 6c +6d 6d +6e 6e +6f 6f +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +7a 7a +7b 7b +7c 7c +7d 7d +7e 7e +7f 7f +#a2 8191 +#a3 8192 +#a5 5c +a7 8198 +a8 814e +#ab 81e1 +#ac 81ca +#af 8150 +b0 818b +b1 817d +b4 814c +#b5 83ca +b6 81f7 +#b7 8145 +#b8 8143 +#bb 81e2 +d7 817e +f7 8180 +391 839f +392 83a0 +393 83a1 +394 83a2 +395 83a3 +396 83a4 +397 83a5 +398 83a6 +399 83a7 +39a 83a8 +39b 83a9 +39c 83aa +39d 83ab +39e 83ac +39f 83ad +3a0 83ae +3a1 83af +3a3 83b0 +3a4 83b1 +3a5 83b2 +3a6 83b3 +3a7 83b4 +3a8 83b5 +3a9 83b6 +3b1 83bf +3b2 83c0 +3b3 83c1 +3b4 83c2 +3b5 83c3 +3b6 83c4 +3b7 83c5 +3b8 83c6 +3b9 83c7 +3ba 83c8 +3bb 83c9 +3bc 83ca +3bd 83cb +3be 83cc +3bf 83cd +3c0 83ce +3c1 83cf +3c3 83d0 +3c4 83d1 +3c5 83d2 +3c6 83d3 +3c7 83d4 +3c8 83d5 +3c9 83d6 +401 8446 +410 8440 +411 8441 +412 8442 +413 8443 +414 8444 +415 8445 +416 8447 +417 8448 +418 8449 +419 844a +41a 844b +41b 844c +41c 844d +41d 844e +41e 844f +41f 8450 +420 8451 +421 8452 +422 8453 +423 8454 +424 8455 +425 8456 +426 8457 +427 8458 +428 8459 +429 845a +42a 845b +42b 845c +42c 845d +42d 845e +42e 845f +42f 8460 +430 8470 +431 8471 +432 8472 +433 8473 +434 8474 +435 8475 +436 8477 +437 8478 +438 8479 +439 847a +43a 847b +43b 847c +43c 847d +43d 847e +43e 8480 +43f 8481 +440 8482 +441 8483 +442 8484 +443 8485 +444 8486 +445 8487 +446 8488 +447 8489 +448 848a +449 848b +44a 848c +44b 848d +44c 848e +44d 848f +44e 8490 +44f 8491 +451 8476 +2010 815d +2015 815c +2018 8165 +2019 8166 +201c 8167 +201d 8168 +2020 81f5 +2021 81f6 +2025 8164 +2026 8163 +2030 81f1 +2032 818c +2033 818d +203b 81a6 +#203e 7e +2103 818e +2116 8782 +2121 8784 +212b 81f0 +2160 8754 +2161 8755 +2162 8756 +2163 8757 +2164 8758 +2165 8759 +2166 875a +2167 875b +2168 875c +2169 875d +2170 fa40 +2171 fa41 +2172 fa42 +2173 fa43 +2174 fa44 +2175 fa45 +2176 fa46 +2177 fa47 +2178 fa48 +2179 fa49 +2190 81a9 +2191 81aa +2192 81a8 +2193 81ab +21d2 81cb +21d4 81cc +2200 81cd +2202 81dd +2203 81ce +2207 81de +2208 81b8 +220b 81b9 +2211 8794 +221a 81e3 +221d 81e5 +221e 8187 +221f 8798 +2220 81da +2225 8161 +2227 81c8 +2228 81c9 +2229 81bf +222a 81be +222b 81e7 +222c 81e8 +222e 8793 +2234 8188 +2235 81e6 +223d 81e4 +2252 81e0 +2260 8182 +2261 81df +2266 8185 +2267 8186 +226a 81e1 +226b 81e2 +2282 81bc +2283 81bd +2286 81ba +2287 81bb +22a5 81db +22bf 8799 +2312 81dc +2460 8740 +2461 8741 +2462 8742 +2463 8743 +2464 8744 +2465 8745 +2466 8746 +2467 8747 +2468 8748 +2469 8749 +246a 874a +246b 874b +246c 874c +246d 874d +246e 874e +246f 874f +2470 8750 +2471 8751 +2472 8752 +2473 8753 +2500 849f +2501 84aa +2502 84a0 +2503 84ab +250c 84a1 +250f 84ac +2510 84a2 +2513 84ad +2514 84a4 +2517 84af +2518 84a3 +251b 84ae +251c 84a5 +251d 84ba +2520 84b5 +2523 84b0 +2524 84a7 +2525 84bc +2528 84b7 +252b 84b2 +252c 84a6 +252f 84b6 +2530 84bb +2533 84b1 +2534 84a8 +2537 84b8 +2538 84bd +253b 84b3 +253c 84a9 +253f 84b9 +2542 84be +254b 84b4 +25a0 81a1 +25a1 81a0 +25b2 81a3 +25b3 81a2 +25bc 81a5 +25bd 81a4 +25c6 819f +25c7 819e +25cb 819b +25ce 819d +25cf 819c +25ef 81fc +2605 819a +2606 8199 +2640 818a +2642 8189 +266a 81f4 +266d 81f3 +266f 81f2 +3000 8140 +3001 8141 +3002 8142 +3003 8156 +3005 8158 +3006 8159 +3007 815a +3008 8171 +3009 8172 +300a 8173 +300b 8174 +300c 8175 +300d 8176 +300e 8177 +300f 8178 +3010 8179 +3011 817a +3012 81a7 +3013 81ac +3014 816b +3015 816c +301d 8780 +301f 8781 +3041 829f +3042 82a0 +3043 82a1 +3044 82a2 +3045 82a3 +3046 82a4 +3047 82a5 +3048 82a6 +3049 82a7 +304a 82a8 +304b 82a9 +304c 82aa +304d 82ab +304e 82ac +304f 82ad +3050 82ae +3051 82af +3052 82b0 +3053 82b1 +3054 82b2 +3055 82b3 +3056 82b4 +3057 82b5 +3058 82b6 +3059 82b7 +305a 82b8 +305b 82b9 +305c 82ba +305d 82bb +305e 82bc +305f 82bd +3060 82be +3061 82bf +3062 82c0 +3063 82c1 +3064 82c2 +3065 82c3 +3066 82c4 +3067 82c5 +3068 82c6 +3069 82c7 +306a 82c8 +306b 82c9 +306c 82ca +306d 82cb +306e 82cc +306f 82cd +3070 82ce +3071 82cf +3072 82d0 +3073 82d1 +3074 82d2 +3075 82d3 +3076 82d4 +3077 82d5 +3078 82d6 +3079 82d7 +307a 82d8 +307b 82d9 +307c 82da +307d 82db +307e 82dc +307f 82dd +3080 82de +3081 82df +3082 82e0 +3083 82e1 +3084 82e2 +3085 82e3 +3086 82e4 +3087 82e5 +3088 82e6 +3089 82e7 +308a 82e8 +308b 82e9 +308c 82ea +308d 82eb +308e 82ec +308f 82ed +3090 82ee +3091 82ef +3092 82f0 +3093 82f1 +#3094 8394 +309b 814a +309c 814b +309d 8154 +309e 8155 +30a1 8340 +30a2 8341 +30a3 8342 +30a4 8343 +30a5 8344 +30a6 8345 +30a7 8346 +30a8 8347 +30a9 8348 +30aa 8349 +30ab 834a +30ac 834b +30ad 834c +30ae 834d +30af 834e +30b0 834f +30b1 8350 +30b2 8351 +30b3 8352 +30b4 8353 +30b5 8354 +30b6 8355 +30b7 8356 +30b8 8357 +30b9 8358 +30ba 8359 +30bb 835a +30bc 835b +30bd 835c +30be 835d +30bf 835e +30c0 835f +30c1 8360 +30c2 8361 +30c3 8362 +30c4 8363 +30c5 8364 +30c6 8365 +30c7 8366 +30c8 8367 +30c9 8368 +30ca 8369 +30cb 836a +30cc 836b +30cd 836c +30ce 836d +30cf 836e +30d0 836f +30d1 8370 +30d2 8371 +30d3 8372 +30d4 8373 +30d5 8374 +30d6 8375 +30d7 8376 +30d8 8377 +30d9 8378 +30da 8379 +30db 837a +30dc 837b +30dd 837c +30de 837d +30df 837e +30e0 8380 +30e1 8381 +30e2 8382 +30e3 8383 +30e4 8384 +30e5 8385 +30e6 8386 +30e7 8387 +30e8 8388 +30e9 8389 +30ea 838a +30eb 838b +30ec 838c +30ed 838d +30ee 838e +30ef 838f +30f0 8390 +30f1 8391 +30f2 8392 +30f3 8393 +30f4 8394 +30f5 8395 +30f6 8396 +30fb 8145 +30fc 815b +30fd 8152 +30fe 8153 +3231 878a +3232 878b +3239 878c +32a4 8785 +32a5 8786 +32a6 8787 +32a7 8788 +32a8 8789 +3303 8765 +330d 8769 +3314 8760 +3318 8763 +3322 8761 +3323 876b +3326 876a +3327 8764 +332b 876c +3336 8766 +333b 876e +3349 875f +334a 876d +334d 8762 +3351 8767 +3357 8768 +337b 877e +337c 878f +337d 878e +337e 878d +338e 8772 +338f 8773 +339c 876f +339d 8770 +339e 8771 +33a1 8775 +33c4 8774 +33cd 8783 +4e00 88ea +4e01 929a +4e03 8eb5 +4e07 969c +4e08 8fe4 +4e09 8e4f +4e0a 8fe3 +4e0b 89ba +4e0d 9573 +4e0e 975e +4e10 98a0 +4e11 894e +4e14 8a8e +4e15 98a1 +4e16 90a2 +4e17 99c0 +4e18 8b75 +4e19 95b8 +4e1e 8fe5 +4e21 97bc +4e26 95c0 +4e28 fa68 +4e2a 98a2 +4e2d 9286 +4e31 98a3 +4e32 8bf8 +4e36 98a4 +4e38 8adb +4e39 924f +4e3b 8ee5 +4e3c 98a5 +4e3f 98a6 +4e42 98a7 +4e43 9454 +4e45 8b76 +4e4b 9456 +4e4d 93e1 +4e4e 8cc1 +4e4f 9652 +4e55 e568 +4e56 98a8 +4e57 8fe6 +4e58 98a9 +4e59 89b3 +4e5d 8be3 +4e5e 8cee +4e5f 96e7 +4e62 9ba4 +4e71 9790 +4e73 93fb +4e7e 8aa3 +4e80 8b54 +4e82 98aa +4e85 98ab +4e86 97b9 +4e88 975c +4e89 9188 +4e8a 98ad +4e8b 8e96 +4e8c 93f1 +4e8e 98b0 +4e91 895d +4e92 8cdd +4e94 8cdc +4e95 88e4 +4e98 986a +4e99 9869 +4e9b 8db1 +4e9c 889f +4e9e 98b1 +4e9f 98b2 +4ea0 98b3 +4ea1 9653 +4ea2 98b4 +4ea4 8cf0 +4ea5 88e5 +4ea6 9692 +4ea8 8b9c +4eab 8b9d +4eac 8b9e +4ead 92e0 +4eae 97ba +4eb0 98b5 +4eb3 98b6 +4eb6 98b7 +4eba 906c +4ec0 8f59 +4ec1 906d +4ec2 98bc +4ec4 98ba +4ec6 98bb +4ec7 8b77 +4eca 8da1 +4ecb 89ee +4ecd 98b9 +4ece 98b8 +4ecf 95a7 +4ed4 8e65 +4ed5 8e64 +4ed6 91bc +4ed7 98bd +4ed8 9574 +4ed9 90e5 +4edd 8157 +4ede 98be +4edf 98c0 +4ee1 fa69 +4ee3 91e3 +4ee4 97df +4ee5 88c8 +4eed 98bf +4eee 89bc +4ef0 8bc2 +4ef2 9287 +4ef6 8c8f +4ef7 98c1 +4efb 9443 +4efc fa6a +4f00 fa6b +4f01 8ae9 +4f03 fa6c +4f09 98c2 +4f0a 88c9 +4f0d 8cde +4f0e 8aea +4f0f 959a +4f10 94b0 +4f11 8b78 +4f1a 89ef +4f1c 98e5 +4f1d 9360 +4f2f 948c +4f30 98c4 +4f34 94ba +4f36 97e0 +4f38 904c +4f39 fa6d +4f3a 8e66 +4f3c 8e97 +4f3d 89be +4f43 92cf +4f46 9241 +4f47 98c8 +4f4d 88ca +4f4e 92e1 +4f4f 8f5a +4f50 8db2 +4f51 9743 +4f53 91cc +4f55 89bd +4f56 fa6e +4f57 98c7 +4f59 975d +4f5a 98c3 +4f5b 98c5 +4f5c 8dec +4f5d 98c6 +4f5e 9b43 +4f69 98ce +4f6f 98d1 +4f70 98cf +4f73 89c0 +4f75 95b9 +4f76 98c9 +4f7b 98cd +4f7c 8cf1 +4f7f 8e67 +4f83 8aa4 +4f86 98d2 +4f88 98ca +4f8a fa70 +4f8b 97e1 +4f8d 8e98 +4f8f 98cb +4f91 98d0 +4f92 fa6f +4f94 fa72 +4f96 98d3 +4f98 98cc +4f9a fa71 +4f9b 8b9f +4f9d 88cb +4fa0 8ba0 +4fa1 89bf +4fab 9b44 +4fad 9699 +4fae 958e +4faf 8cf2 +4fb5 904e +4fb6 97b5 +4fbf 95d6 +4fc2 8c57 +4fc3 91a3 +4fc4 89e2 +4fc9 fa61 +4fca 8f72 +4fcd fa73 +4fce 98d7 +4fd0 98dc +4fd1 98da +4fd4 98d5 +4fd7 91ad +4fd8 98d8 +4fda 98db +4fdb 98d9 +4fdd 95db +4fdf 98d6 +4fe1 904d +4fe3 9693 +4fe4 98dd +4fe5 98de +4fee 8f43 +4fef 98eb +4ff3 946f +4ff5 9555 +4ff6 98e6 +4ff8 95ee +4ffa 89b4 +4ffe 98ea +4fff fa76 +5005 98e4 +5006 98ed +5009 9171 +500b 8cc2 +500d 947b +500f e0c5 +5011 98ec +5012 937c +5014 98e1 +5016 8cf4 +5019 8cf3 +501a 98df +501e fa77 +501f 8ed8 +5021 98e7 +5022 fa75 +5023 95ed +5024 926c +5025 98e3 +5026 8c91 +5028 98e0 +5029 98e8 +502a 98e2 +502b 97cf +502c 98e9 +502d 9860 +5036 8be4 +5039 8c90 +5040 fa74 +5042 fa7a +5043 98ee +5046 fa78 +5047 98ef +5048 98f3 +5049 88cc +504f 95ce +5050 98f2 +5055 98f1 +5056 98f5 +505a 98f4 +505c 92e2 +5065 8c92 +506c 98f6 +5070 fa79 +5072 8ec3 +5074 91a4 +5075 92e3 +5076 8bf4 +5078 98f7 +507d 8b55 +5080 98f8 +5085 98fa +508d 9654 +5091 8c86 +5094 fa7b +5098 8e50 +5099 94f5 +509a 98f9 +50ac 8dc3 +50ad 9762 +50b2 98fc +50b3 9942 +50b4 98fb +50b5 8dc2 +50b7 8f9d +50be 8c58 +50c2 9943 +50c5 8bcd +50c9 9940 +50ca 9941 +50cd 93ad +50cf 919c +50d1 8ba1 +50d5 966c +50d6 9944 +50d8 fa7d +50da 97bb +50de 9945 +50e3 9948 +50e5 9946 +50e7 916d +50ed 9947 +50ee 9949 +50f4 fa7c +50f5 994b +50f9 994a +50fb 95c6 +5100 8b56 +5101 994d +5102 994e +5104 89ad +5109 994c +5112 8ef2 +5114 9951 +5115 9950 +5116 994f +5118 98d4 +511a 9952 +511f 8f9e +5121 9953 +512a 9744 +5132 96d7 +5137 9955 +513a 9954 +513b 9957 +513c 9956 +513f 9958 +5140 9959 +5141 88f2 +5143 8cb3 +5144 8c5a +5145 8f5b +5146 929b +5147 8ba2 +5148 90e6 +5149 8cf5 +514a fa7e +514b 8d8e +514c 995b +514d 96c6 +514e 9365 +5150 8e99 +5152 995a +5154 995c +515a 937d +515c 8a95 +5162 995d +5164 fa80 +5165 93fc +5168 9153 +5169 995f +516a 9960 +516b 94aa +516c 8cf6 +516d 985a +516e 9961 +5171 8ba4 +5175 95ba +5176 91b4 +5177 8bef +5178 9354 +517c 8c93 +5180 9962 +5182 9963 +5185 93e0 +5186 897e +5189 9966 +518a 8dfb +518c 9965 +518d 8dc4 +518f 9967 +5190 e3ec +5191 9968 +5192 9660 +5193 9969 +5195 996a +5196 996b +5197 8fe7 +5199 8eca +519d fa81 +51a0 8aa5 +51a2 996e +51a4 996c +51a5 96bb +51a6 996d +51a8 9579 +51a9 996f +51aa 9970 +51ab 9971 +51ac 937e +51b0 9975 +51b1 9973 +51b2 9974 +51b3 9972 +51b4 8de1 +51b5 9976 +51b6 96e8 +51b7 97e2 +51bd 9977 +51be fa82 +51c4 90a6 +51c5 9978 +51c6 8f79 +51c9 9979 +51cb 929c +51cc 97bd +51cd 9380 +51d6 99c3 +51db 997a +51dc eaa3 +51dd 8bc3 +51e0 997b +51e1 967d +51e6 8f88 +51e7 91fa +51e9 997d +51ea 93e2 +51ec fa83 +51ed 997e +51f0 9980 +51f1 8a4d +51f5 9981 +51f6 8ba5 +51f8 93ca +51f9 899a +51fa 8f6f +51fd 949f +51fe 9982 +5200 9381 +5203 906e +5204 9983 +5206 95aa +5207 90d8 +5208 8aa0 +520a 8aa7 +520b 9984 +520e 9986 +5211 8c59 +5214 9985 +5215 fa84 +5217 97f1 +521d 8f89 +5224 94bb +5225 95ca +5227 9987 +5229 9798 +522a 9988 +522e 9989 +5230 939e +5233 998a +5236 90a7 +5237 8dfc +5238 8c94 +5239 998b +523a 8e68 +523b 8d8f +5243 92e4 +5244 998d +5247 91a5 +524a 8ded +524b 998e +524c 998f +524d 914f +524f 998c +5254 9991 +5256 9655 +525b 8d84 +525e 9990 +5263 8c95 +5264 8ddc +5265 948d +5269 9994 +526a 9992 +526f 959b +5270 8fe8 +5271 999b +5272 8a84 +5273 9995 +5274 9993 +5275 916e +527d 9997 +527f 9996 +5283 8a63 +5287 8c80 +5288 999c +5289 97ab +528d 9998 +5291 999d +5292 999a +5294 9999 +529b 97cd +529c fa85 +529f 8cf7 +52a0 89c1 +52a3 97f2 +52a6 fa86 +52a9 8f95 +52aa 9377 +52ab 8d85 +52ac 99a0 +52ad 99a1 +52af fb77 +52b1 97e3 +52b4 984a +52b5 99a3 +52b9 8cf8 +52bc 99a2 +52be 8a4e +52c0 fa87 +52c1 99a4 +52c3 9675 +52c5 92ba +52c7 9745 +52c9 95d7 +52cd 99a5 +52d2 e8d3 +52d5 93ae +52d7 99a6 +52d8 8aa8 +52d9 96b1 +52db fa88 +52dd 8f9f +52de 99a7 +52df 95e5 +52e0 99ab +52e2 90a8 +52e3 99a8 +52e4 8bce +52e6 99a9 +52e7 8aa9 +52f2 8c4d +52f3 99ac +52f5 99ad +52f8 99ae +52f9 99af +52fa 8ed9 +52fe 8cf9 +52ff 96dc +5300 fa89 +5301 96e6 +5302 93f5 +5305 95ef +5306 99b0 +5307 fa8a +5308 99b1 +530d 99b3 +530f 99b5 +5310 99b4 +5315 99b6 +5316 89bb +5317 966b +5319 8dfa +531a 99b7 +531d 9178 +5320 8fa0 +5321 8ba7 +5323 99b8 +5324 fa8b +532a 94d9 +532f 99b9 +5331 99ba +5333 99bb +5338 99bc +5339 9543 +533a 8be6 +533b 88e3 +533f 93bd +5340 99bd +5341 8f5c +5343 90e7 +5345 99bf +5346 99be +5347 8fa1 +5348 8cdf +5349 99c1 +534a 94bc +534d 99c2 +5351 94da +5352 91b2 +5353 91ec +5354 8ba6 +5357 93ec +5358 9250 +535a 948e +535c 966d +535e 99c4 +5360 90e8 +5366 8c54 +5369 99c5 +536e 99c6 +536f 894b +5370 88f3 +5371 8aeb +5372 fa8c +5373 91a6 +5374 8b70 +5375 9791 +5377 99c9 +5378 89b5 +537b 99c8 +537f 8ba8 +5382 99ca +5384 96ef +5393 fa8d +5396 99cb +5398 97d0 +539a 8cfa +539f 8cb4 +53a0 99cc +53a5 99ce +53a6 99cd +53a8 907e +53a9 8958 +53ad 897d +53ae 99cf +53b0 99d0 +53b2 fa8e +53b3 8cb5 +53b6 99d1 +53bb 8b8e +53c2 8e51 +53c3 99d2 +53c8 9694 +53c9 8db3 +53ca 8b79 +53cb 9746 +53cc 916f +53cd 94bd +53ce 8efb +53d4 8f66 +53d6 8ee6 +53d7 8ef3 +53d9 8f96 +53db 94be +53dd fa8f +53df 99d5 +53e1 8962 +53e2 9170 +53e3 8cfb +53e4 8cc3 +53e5 8be5 +53e8 99d9 +53e9 9240 +53ea 91fc +53eb 8ba9 +53ec 8fa2 +53ed 99da +53ee 99d8 +53ef 89c2 +53f0 91e4 +53f1 8eb6 +53f2 8e6a +53f3 8945 +53f6 8a90 +53f7 8d86 +53f8 8e69 +53fa 99db +5401 99dc +5403 8b68 +5404 8a65 +5408 8d87 +5409 8b67 +540a 92dd +540b 8944 +540c 93af +540d 96bc +540e 8d40 +540f 9799 +5410 9366 +5411 8cfc +541b 8c4e +541d 99e5 +541f 8be1 +5420 9669 +5426 94db +5429 99e4 +542b 8adc +542c 99df +542d 99e0 +542e 99e2 +5436 99e3 +5438 8b7a +5439 9081 +543b 95ab +543c 99e1 +543d 99dd +543e 8ce1 +5440 99de +5442 9843 +5446 95f0 +5448 92e6 +5449 8ce0 +544a 8d90 +544e 99e6 +5451 93db +545f 99ea +5468 8efc +546a 8ef4 +5470 99ed +5471 99eb +5473 96a1 +5475 99e8 +5476 99f1 +5477 99ec +547b 99ef +547c 8cc4 +547d 96bd +5480 99f0 +5484 99f2 +5486 99f4 +548a fa92 +548b 8dee +548c 9861 +548e 99e9 +548f 99e7 +5490 99f3 +5492 99ee +549c fa91 +54a2 99f6 +54a4 9a42 +54a5 99f8 +54a8 99fc +54a9 fa93 +54ab 9a40 +54ac 99f9 +54af 9a5d +54b2 8de7 +54b3 8a50 +54b8 99f7 +54bc 9a44 +54bd 88f4 +54be 9a43 +54c0 88a3 +54c1 9569 +54c2 9a41 +54c4 99fa +54c7 99f5 +54c8 99fb +54c9 8dc6 +54d8 9a45 +54e1 88f5 +54e2 9a4e +54e5 9a46 +54e6 9a47 +54e8 8fa3 +54e9 9689 +54ed 9a4c +54ee 9a4b +54f2 934e +54fa 9a4d +54fd 9a4a +54ff fa94 +5504 8953 +5506 8db4 +5507 904f +550f 9a48 +5510 9382 +5514 9a49 +5516 88a0 +552e 9a53 +552f 9742 +5531 8fa5 +5533 9a59 +5538 9a58 +5539 9a4f +553e 91c1 +5540 9a50 +5544 91ed +5545 9a55 +5546 8fa4 +554c 9a52 +554f 96e2 +5553 8c5b +5556 9a56 +5557 9a57 +555c 9a54 +555d 9a5a +5563 9a51 +557b 9a60 +557c 9a65 +557e 9a61 +5580 9a5c +5583 9a66 +5584 9150 +5586 fa95 +5587 9a68 +5589 8d41 +558a 9a5e +558b 929d +5598 9a62 +5599 9a5b +559a 8aab +559c 8aec +559d 8a85 +559e 9a63 +559f 9a5f +55a7 8c96 +55a8 9a69 +55a9 9a67 +55aa 9172 +55ab 8b69 +55ac 8baa +55ae 9a64 +55b0 8bf2 +55b6 8963 +55c4 9a6d +55c5 9a6b +55c7 9aa5 +55d4 9a70 +55da 9a6a +55dc 9a6e +55df 9a6c +55e3 8e6b +55e4 9a6f +55f7 9a72 +55f9 9a77 +55fd 9a75 +55fe 9a74 +5606 9251 +5609 89c3 +5614 9a71 +5616 9a73 +5617 8fa6 +5618 8952 +561b 9a76 +5629 89dc +562f 9a82 +5631 8ffa +5632 9a7d +5634 9a7b +5636 9a7c +5638 9a7e +5642 895c +564c 9158 +564e 9a78 +5650 9a79 +565b 8a9a +5664 9a81 +5668 8aed +566a 9a84 +566b 9a80 +566c 9a83 +5674 95ac +5678 93d3 +567a 94b6 +5680 9a86 +5686 9a85 +5687 8a64 +568a 9a87 +568f 9a8a +5694 9a89 +56a0 9a88 +56a2 9458 +56a5 9a8b +56ae 9a8c +56b4 9a8e +56b6 9a8d +56bc 9a90 +56c0 9a93 +56c1 9a91 +56c2 9a8f +56c3 9a92 +56c8 9a94 +56ce 9a95 +56d1 9a96 +56d3 9a97 +56d7 9a98 +56d8 9964 +56da 8efa +56db 8e6c +56de 89f1 +56e0 88f6 +56e3 9263 +56ee 9a99 +56f0 8da2 +56f2 88cd +56f3 907d +56f9 9a9a +56fa 8cc5 +56fd 8d91 +56ff 9a9c +5700 9a9b +5703 95de +5704 9a9d +5708 9a9f +5709 9a9e +570b 9aa0 +570d 9aa1 +570f 8c97 +5712 8980 +5713 9aa2 +5716 9aa4 +5718 9aa3 +571c 9aa6 +571f 9379 +5726 9aa7 +5727 88b3 +5728 8ddd +572d 8c5c +5730 926e +5737 9aa8 +5738 9aa9 +573b 9aab +5740 9aac +5742 8de2 +5747 8bcf +574a 9656 +574e 9aaa +574f 9aad +5750 8dbf +5751 8d42 +5759 fa96 +5761 9ab1 +5764 8da3 +5765 fa97 +5766 9252 +5769 9aae +576a 92d8 +577f 9ab2 +5782 9082 +5788 9ab0 +5789 9ab3 +578b 8c5e +5793 9ab4 +57a0 9ab5 +57a2 8d43 +57a3 8a5f +57a4 9ab7 +57aa 9ab8 +57ac fa98 +57b0 9ab9 +57b3 9ab6 +57c0 9aaf +57c3 9aba +57c6 9abb +57c7 fa9a +57c8 fa99 +57cb 9684 +57ce 8fe9 +57d2 9abd +57d3 9abe +57d4 9abc +57d6 9ac0 +57dc 9457 +57df 88e6 +57e0 9575 +57e3 9ac1 +57f4 8ffb +57f7 8eb7 +57f9 947c +57fa 8aee +57fc 8de9 +5800 9678 +5802 93b0 +5805 8c98 +5806 91cd +580a 9abf +580b 9ac2 +5815 91c2 +5819 9ac3 +581d 9ac4 +5821 9ac6 +5824 92e7 +582a 8aac +582f ea9f +5830 8981 +5831 95f1 +5834 8fea +5835 9367 +583a 8de4 +583d 9acc +5840 95bb +5841 97db +584a 89f2 +584b 9ac8 +5851 9159 +5852 9acb +5854 9383 +5857 9368 +5858 9384 +5859 94b7 +585a 92cb +585e 8dc7 +5862 9ac7 +5869 8996 +586b 9355 +5870 9ac9 +5872 9ac5 +5875 906f +5879 9acd +587e 8f6d +5883 8bab +5885 9ace +5893 95e6 +5897 919d +589c 92c4 +589e fa9d +589f 9ad0 +58a8 966e +58ab 9ad1 +58ae 9ad6 +58b2 fa9e +58b3 95ad +58b8 9ad5 +58b9 9acf +58ba 9ad2 +58bb 9ad4 +58be 8da4 +58c1 95c7 +58c5 9ad7 +58c7 9264 +58ca 89f3 +58cc 8feb +58d1 9ad9 +58d3 9ad8 +58d5 8d88 +58d7 9ada +58d8 9adc +58d9 9adb +58dc 9ade +58de 9ad3 +58df 9ae0 +58e4 9adf +58e5 9add +58eb 8e6d +58ec 9070 +58ee 9173 +58ef 9ae1 +58f0 90ba +58f1 88eb +58f2 9484 +58f7 92d9 +58f9 9ae3 +58fa 9ae2 +58fb 9ae4 +58fc 9ae5 +58fd 9ae6 +5902 9ae7 +5909 95cf +590a 9ae8 +590b fa9f +590f 89c4 +5910 9ae9 +5915 975b +5916 8a4f +5918 99c7 +5919 8f67 +591a 91bd +591b 9aea +591c 96e9 +5922 96b2 +5925 9aec +5927 91e5 +5929 9356 +592a 91be +592b 9576 +592c 9aed +592d 9aee +592e 899b +5931 8eb8 +5932 9aef +5937 88ce +5938 9af0 +593e 9af1 +5944 8982 +5947 8aef +5948 93de +5949 95f2 +594e 9af5 +594f 9174 +5950 9af4 +5951 8c5f +5953 faa0 +5954 967a +5955 9af3 +5957 9385 +5958 9af7 +595a 9af6 +595b faa1 +595d faa2 +5960 9af9 +5962 9af8 +5963 faa3 +5965 899c +5967 9afa +5968 8fa7 +5969 9afc +596a 9244 +596c 9afb +596e 95b1 +5973 8f97 +5974 937a +5978 9b40 +597d 8d44 +5981 9b41 +5982 9440 +5983 94dc +5984 96cf +598a 9444 +598d 9b4a +5993 8b57 +5996 9764 +5999 96ad +599b 9baa +599d 9b42 +59a3 9b45 +59a4 faa4 +59a5 91c3 +59a8 9657 +59ac 9369 +59b2 9b46 +59b9 9685 +59ba faa5 +59bb 8dc8 +59be 8fa8 +59c6 9b47 +59c9 8e6f +59cb 8e6e +59d0 88b7 +59d1 8cc6 +59d3 90a9 +59d4 88cf +59d9 9b4b +59da 9b4c +59dc 9b49 +59e5 8957 +59e6 8aad +59e8 9b48 +59ea 96c3 +59eb 9550 +59f6 88a6 +59fb 88f7 +59ff 8e70 +5a01 88d0 +5a03 88a1 +5a09 9b51 +5a11 9b4f +5a18 96ba +5a1a 9b52 +5a1c 9b50 +5a1f 9b4e +5a20 9050 +5a25 9b4d +5a29 95d8 +5a2f 8ce2 +5a35 9b56 +5a36 9b57 +5a3c 8fa9 +5a40 9b53 +5a41 984b +5a46 946b +5a49 9b55 +5a5a 8da5 +5a62 9b58 +5a66 9577 +5a6a 9b59 +5a6c 9b54 +5a7f 96b9 +5a92 947d +5a9a 9b5a +5a9b 9551 +5abc 9b5b +5abd 9b5f +5abe 9b5c +5ac1 89c5 +5ac2 9b5e +5ac9 8eb9 +5acb 9b5d +5acc 8c99 +5ad0 9b6b +5ad6 9b64 +5ad7 9b61 +5ae1 9284 +5ae3 9b60 +5ae6 9b62 +5ae9 9b63 +5afa 9b65 +5afb 9b66 +5b09 8af0 +5b0b 9b68 +5b0c 9b67 +5b16 9b69 +5b22 8fec +5b2a 9b6c +5b2c 92da +5b30 8964 +5b32 9b6a +5b36 9b6d +5b3e 9b6e +5b40 9b71 +5b43 9b6f +5b45 9b70 +5b50 8e71 +5b51 9b72 +5b54 8d45 +5b55 9b73 +5b56 faa6 +5b57 8e9a +5b58 91b6 +5b5a 9b74 +5b5b 9b75 +5b5c 8e79 +5b5d 8d46 +5b5f 96d0 +5b63 8b47 +5b64 8cc7 +5b65 9b76 +5b66 8a77 +5b69 9b77 +5b6b 91b7 +5b70 9b78 +5b71 9ba1 +5b73 9b79 +5b75 9b7a +5b78 9b7b +5b7a 9b7d +5b80 9b7e +5b83 9b80 +5b85 91ee +5b87 8946 +5b88 8ee7 +5b89 88c0 +5b8b 9176 +5b8c 8aae +5b8d 8eb3 +5b8f 8d47 +5b95 9386 +5b97 8f40 +5b98 8aaf +5b99 9288 +5b9a 92e8 +5b9b 88b6 +5b9c 8b58 +5b9d 95f3 +5b9f 8ec0 +5ba2 8b71 +5ba3 90e9 +5ba4 8eba +5ba5 9747 +5ba6 9b81 +5bae 8b7b +5bb0 8dc9 +5bb3 8a51 +5bb4 8983 +5bb5 8faa +5bb6 89c6 +5bb8 9b82 +5bb9 9765 +5bbf 8f68 +5bc0 faa7 +5bc2 8ee2 +5bc3 9b83 +5bc4 8af1 +5bc5 93d0 +5bc6 96a7 +5bc7 9b84 +5bc9 9b85 +5bcc 9578 +5bd0 9b87 +5bd2 8aa6 +5bd3 8bf5 +5bd4 9b86 +5bd8 faa9 +5bdb 8ab0 +5bdd 9051 +5bde 9b8b +5bdf 8e40 +5be1 89c7 +5be2 9b8a +5be4 9b88 +5be5 9b8c +5be6 9b89 +5be7 944a +5be8 9ecb +5be9 9052 +5beb 9b8d +5bec faaa +5bee 97be +5bf0 9b8e +5bf3 9b90 +5bf5 929e +5bf6 9b8f +5bf8 90a1 +5bfa 8e9b +5bfe 91ce +5bff 8ef5 +5c01 9595 +5c02 90ea +5c04 8ecb +5c05 9b91 +5c06 8fab +5c07 9b92 +5c08 9b93 +5c09 88d1 +5c0a 91b8 +5c0b 9071 +5c0d 9b94 +5c0e 93b1 +5c0f 8fac +5c11 8fad +5c13 9b95 +5c16 90eb +5c1a 8fae +5c1e faab +5c20 9b96 +5c22 9b97 +5c24 96de +5c28 9b98 +5c2d 8bc4 +5c31 8f41 +5c38 9b99 +5c39 9b9a +5c3a 8eda +5c3b 904b +5c3c 93f2 +5c3d 9073 +5c3e 94f6 +5c3f 9441 +5c40 8bc7 +5c41 9b9b +5c45 8b8f +5c46 9b9c +5c48 8bfc +5c4a 93cd +5c4b 89ae +5c4d 8e72 +5c4e 9b9d +5c4f 9ba0 +5c50 9b9f +5c51 8bfb +5c53 9b9e +5c55 9357 +5c5e 91ae +5c60 936a +5c61 8ec6 +5c64 9177 +5c65 979a +5c6c 9ba2 +5c6e 9ba3 +5c6f 93d4 +5c71 8e52 +5c76 9ba5 +5c79 9ba6 +5c8c 9ba7 +5c90 8af2 +5c91 9ba8 +5c94 9ba9 +5ca1 89aa +5ca6 faac +5ca8 915a +5ca9 8ae2 +5cab 9bab +5cac 96a6 +5cb1 91d0 +5cb3 8a78 +5cb6 9bad +5cb7 9baf +5cb8 8add +5cba faad +5cbb 9bac +5cbc 9bae +5cbe 9bb1 +5cc5 9bb0 +5cc7 9bb2 +5cd9 9bb3 +5ce0 93bb +5ce1 8bac +5ce8 89e3 +5ce9 9bb4 +5cea 9bb9 +5ced 9bb7 +5cef 95f5 +5cf0 95f4 +5cf5 faae +5cf6 9387 +5cfa 9bb6 +5cfb 8f73 +5cfd 9bb5 +5d07 9092 +5d0b 9bba +5d0e 8de8 +5d11 9bc0 +5d14 9bc1 +5d15 9bbb +5d16 8a52 +5d17 9bbc +5d18 9bc5 +5d19 9bc4 +5d1a 9bc3 +5d1b 9bbf +5d1f 9bbe +5d22 9bc2 +5d27 faaf +5d29 95f6 +5d42 fab2 +5d4b 9bc9 +5d4c 9bc6 +5d4e 9bc8 +5d50 9792 +5d52 9bc7 +5d53 fab0 +5d5c 9bbd +5d69 9093 +5d6c 9bca +5d6d fab3 +5d6f 8db5 +5d73 9bcb +5d76 9bcc +5d82 9bcf +5d84 9bce +5d87 9bcd +5d8b 9388 +5d8c 9bb8 +5d90 9bd5 +5d9d 9bd1 +5da2 9bd0 +5dac 9bd2 +5dae 9bd3 +5db7 9bd6 +5db8 fab4 +5db9 fab5 +5dba 97e4 +5dbc 9bd7 +5dbd 9bd4 +5dc9 9bd8 +5dcc 8ade +5dcd 9bd9 +5dd0 fab6 +5dd2 9bdb +5dd3 9bda +5dd6 9bdc +5ddb 9bdd +5ddd 90ec +5dde 8f42 +5de1 8f84 +5de3 9183 +5de5 8d48 +5de6 8db6 +5de7 8d49 +5de8 8b90 +5deb 9bde +5dee 8db7 +5df1 8cc8 +5df2 9bdf +5df3 96a4 +5df4 9462 +5df5 9be0 +5df7 8d4a +5dfb 8aaa +5dfd 9246 +5dfe 8bd0 +5e02 8e73 +5e03 957a +5e06 94bf +5e0b 9be1 +5e0c 8af3 +5e11 9be4 +5e16 929f +5e19 9be3 +5e1a 9be2 +5e1b 9be5 +5e1d 92e9 +5e25 9083 +5e2b 8e74 +5e2d 90c8 +5e2f 91d1 +5e30 8b41 +5e33 92a0 +5e36 9be6 +5e37 9be7 +5e38 8fed +5e3d 9658 +5e40 9bea +5e43 9be9 +5e44 9be8 +5e45 959d +5e47 9bf1 +5e4c 9679 +5e4e 9beb +5e54 9bed +5e55 968b +5e57 9bec +5e5f 9bee +5e61 94a6 +5e62 9bef +5e63 95bc +5e64 9bf0 +5e72 8ab1 +5e73 95bd +5e74 944e +5e75 9bf2 +5e76 9bf3 +5e78 8d4b +5e79 8ab2 +5e7a 9bf4 +5e7b 8cb6 +5e7c 9763 +5e7d 9748 +5e7e 8af4 +5e7f 9bf6 +5e81 92a1 +5e83 8d4c +5e84 8faf +5e87 94dd +5e8a 8fb0 +5e8f 8f98 +5e95 92ea +5e96 95f7 +5e97 9358 +5e9a 8d4d +5e9c 957b +5ea0 9bf7 +5ea6 9378 +5ea7 8dc0 +5eab 8cc9 +5ead 92eb +5eb5 88c1 +5eb6 8f8e +5eb7 8d4e +5eb8 9766 +5ec1 9bf8 +5ec2 9bf9 +5ec3 9470 +5ec8 9bfa +5ec9 97f5 +5eca 984c +5ecf 9bfc +5ed0 9bfb +5ed3 8a66 +5ed6 9c40 +5eda 9c43 +5edb 9c44 +5edd 9c42 +5edf 955f +5ee0 8fb1 +5ee1 9c46 +5ee2 9c45 +5ee3 9c41 +5ee8 9c47 +5ee9 9c48 +5eec 9c49 +5ef0 9c4c +5ef1 9c4a +5ef3 9c4b +5ef4 9c4d +5ef6 8984 +5ef7 92ec +5ef8 9c4e +5efa 8c9a +5efb 89f4 +5efc 9455 +5efe 9c4f +5eff 93f9 +5f01 95d9 +5f03 9c50 +5f04 984d +5f09 9c51 +5f0a 95be +5f0b 9c54 +5f0c 989f +5f0d 98af +5f0f 8eae +5f10 93f3 +5f11 9c55 +5f13 8b7c +5f14 92a2 +5f15 88f8 +5f16 9c56 +5f17 95a4 +5f18 8d4f +5f1b 926f +5f1f 92ed +5f21 fab7 +5f25 96ed +5f26 8cb7 +5f27 8cca +5f29 9c57 +5f2d 9c58 +5f2f 9c5e +5f31 8ee3 +5f34 fab8 +5f35 92a3 +5f37 8bad +5f38 9c59 +5f3c 954a +5f3e 9265 +5f41 9c5a +5f45 fa67 +5f48 9c5b +5f4a 8bae +5f4c 9c5c +5f4e 9c5d +5f51 9c5f +5f53 9396 +5f56 9c60 +5f57 9c61 +5f59 9c62 +5f5c 9c53 +5f5d 9c52 +5f61 9c63 +5f62 8c60 +5f66 9546 +5f67 fab9 +5f69 8dca +5f6a 9556 +5f6b 92a4 +5f6c 956a +5f6d 9c64 +5f70 8fb2 +5f71 8965 +5f73 9c65 +5f77 9c66 +5f79 96f0 +5f7c 94de +5f7f 9c69 +5f80 899d +5f81 90aa +5f82 9c68 +5f83 9c67 +5f84 8c61 +5f85 91d2 +5f87 9c6d +5f88 9c6b +5f8a 9c6a +5f8b 97a5 +5f8c 8ce3 +5f90 8f99 +5f91 9c6c +5f92 936b +5f93 8f5d +5f97 93be +5f98 9c70 +5f99 9c6f +5f9e 9c6e +5fa0 9c71 +5fa1 8ce4 +5fa8 9c72 +5fa9 959c +5faa 8f7a +5fad 9c73 +5fae 94f7 +5fb3 93bf +5fb4 92a5 +5fb7 faba +5fb9 934f +5fbc 9c74 +5fbd 8b4a +5fc3 9053 +5fc5 954b +5fcc 8af5 +5fcd 9445 +5fd6 9c75 +5fd7 8e75 +5fd8 9659 +5fd9 965a +5fdc 899e +5fdd 9c7a +5fde fabb +5fe0 9289 +5fe4 9c77 +5feb 89f5 +5ff0 9cab +5ff1 9c79 +5ff5 944f +5ff8 9c78 +5ffb 9c76 +5ffd 8d9a +5fff 9c7c +600e 9c83 +600f 9c89 +6010 9c81 +6012 937b +6015 9c86 +6016 957c +6019 9c80 +601b 9c85 +601c 97e5 +601d 8e76 +6020 91d3 +6021 9c7d +6025 8b7d +6026 9c88 +6027 90ab +6028 8985 +6029 9c82 +602a 89f6 +602b 9c87 +602f 8baf +6031 9c84 +603a 9c8a +6041 9c8c +6042 9c96 +6043 9c94 +6046 9c91 +604a 9c90 +604b 97f6 +604d 9c92 +6050 8bb0 +6052 8d50 +6055 8f9a +6059 9c99 +605a 9c8b +605d fabc +605f 9c8f +6060 9c7e +6062 89f8 +6063 9c93 +6064 9c95 +6065 9270 +6068 8da6 +6069 89b6 +606a 9c8d +606b 9c98 +606c 9c97 +606d 8bb1 +606f 91a7 +6070 8a86 +6075 8c62 +6077 9c8e +6081 9c9a +6083 9c9d +6084 9c9f +6085 fabd +6089 8ebb +608a fabe +608b 9ca5 +608c 92ee +608d 9c9b +6092 9ca3 +6094 89f7 +6096 9ca1 +6097 9ca2 +609a 9c9e +609b 9ca0 +609f 8ce5 +60a0 9749 +60a3 8ab3 +60a6 8978 +60a7 9ca4 +60a9 9459 +60aa 88ab +60b2 94df +60b3 9c7b +60b4 9caa +60b5 9cae +60b6 96e3 +60b8 9ca7 +60bc 9389 +60bd 9cac +60c5 8fee +60c6 9cad +60c7 93d5 +60d1 9866 +60d3 9ca9 +60d5 fac0 +60d8 9caf +60da 8d9b +60dc 90c9 +60de fabf +60df 88d2 +60e0 9ca8 +60e1 9ca6 +60e3 9179 +60e7 9c9c +60e8 8e53 +60f0 91c4 +60f1 9cbb +60f2 fac2 +60f3 917a +60f4 9cb6 +60f6 9cb3 +60f7 9cb4 +60f9 8ee4 +60fa 9cb7 +60fb 9cba +6100 9cb5 +6101 8f44 +6103 9cb8 +6106 9cb2 +6108 96fa +6109 96f9 +610d 9cbc +610e 9cbd +610f 88d3 +6111 fac3 +6115 9cb1 +611a 8bf0 +611b 88a4 +611f 8ab4 +6120 fac1 +6121 9cb9 +6127 9cc1 +6128 9cc0 +612c 9cc5 +6130 fac5 +6134 9cc6 +6137 fac4 +613c 9cc4 +613d 9cc7 +613e 9cbf +613f 9cc3 +6142 9cc8 +6144 9cc9 +6147 9cbe +6148 8e9c +614a 9cc2 +614b 91d4 +614c 8d51 +614d 9cb0 +614e 9054 +6153 9cd6 +6155 95e7 +6158 9ccc +6159 9ccd +615a 9cce +615d 9cd5 +615f 9cd4 +6162 969d +6163 8ab5 +6165 9cd2 +6167 8c64 +6168 8a53 +616b 9ccf +616e 97b6 +616f 9cd1 +6170 88d4 +6171 9cd3 +6173 9cca +6174 9cd0 +6175 9cd7 +6176 8c63 +6177 9ccb +617e 977c +6182 974a +6187 9cda +618a 9cde +618e 919e +6190 97f7 +6191 9cdf +6194 9cdc +6196 9cd9 +6198 fac6 +6199 9cd8 +619a 9cdd +61a4 95ae +61a7 93b2 +61a9 8c65 +61ab 9ce0 +61ac 9cdb +61ae 9ce1 +61b2 8c9b +61b6 89af +61ba 9ce9 +61be 8ab6 +61c3 9ce7 +61c6 9ce8 +61c7 8da7 +61c8 9ce6 +61c9 9ce4 +61ca 9ce3 +61cb 9cea +61cc 9ce2 +61cd 9cec +61d0 89f9 +61e3 9cee +61e6 9ced +61f2 92a6 +61f4 9cf1 +61f6 9cef +61f7 9ce5 +61f8 8c9c +61fa 9cf0 +61fc 9cf4 +61fd 9cf3 +61fe 9cf5 +61ff 9cf2 +6200 9cf6 +6208 9cf7 +6209 9cf8 +620a 95e8 +620c 9cfa +620d 9cf9 +620e 8f5e +6210 90ac +6211 89e4 +6212 89fa +6213 fac7 +6214 9cfb +6216 88bd +621a 90ca +621b 9cfc +621d e6c1 +621e 9d40 +621f 8c81 +6221 9d41 +6226 90ed +622a 9d42 +622e 9d43 +622f 8b59 +6230 9d44 +6232 9d45 +6233 9d46 +6234 91d5 +6238 8ccb +623b 96df +623f 965b +6240 8f8a +6241 9d47 +6247 90ee +6248 e7bb +6249 94e0 +624b 8ee8 +624d 8dcb +624e 9d48 +6253 91c5 +6255 95a5 +6258 91ef +625b 9d4b +625e 9d49 +6260 9d4c +6263 9d4a +6268 9d4d +626e 95af +6271 88b5 +6276 957d +6279 94e1 +627c 9d4e +627e 9d51 +627f 8fb3 +6280 8b5a +6282 9d4f +6283 9d56 +6284 8fb4 +6289 9d50 +628a 9463 +6291 977d +6292 9d52 +6293 9d53 +6294 9d57 +6295 938a +6296 9d54 +6297 8d52 +6298 90dc +629b 9d65 +629c 94b2 +629e 91f0 +62a6 fac8 +62ab 94e2 +62ac 9dab +62b1 95f8 +62b5 92ef +62b9 9695 +62bb 9d5a +62bc 899f +62bd 928a +62c2 9d63 +62c5 9253 +62c6 9d5d +62c7 9d64 +62c8 9d5f +62c9 9d66 +62ca 9d62 +62cc 9d61 +62cd 948f +62cf 9d5b +62d0 89fb +62d1 9d59 +62d2 8b91 +62d3 91f1 +62d4 9d55 +62d7 9d58 +62d8 8d53 +62d9 90d9 +62db 8fb5 +62dc 9d60 +62dd 9471 +62e0 8b92 +62e1 8a67 +62ec 8a87 +62ed 9040 +62ee 9d68 +62ef 9d6d +62f1 9d69 +62f3 8c9d +62f5 9d6e +62f6 8e41 +62f7 8d89 +62fe 8f45 +62ff 9d5c +6301 8e9d +6302 9d6b +6307 8e77 +6308 9d6c +6309 88c2 +630c 9d67 +6311 92a7 +6319 8b93 +631f 8bb2 +6327 9d6a +6328 88a5 +632b 8dc1 +632f 9055 +633a 92f0 +633d 94d2 +633e 9d70 +633f 917d +6349 91a8 +634c 8e4a +634d 9d71 +634f 9d73 +6350 9d6f +6355 95df +6357 92bb +635c 917b +6367 95f9 +6368 8ecc +6369 9d80 +636b 9d7e +636e 9098 +6372 8c9e +6376 9d78 +6377 8fb7 +637a 93e6 +637b 9450 +6380 9d76 +6383 917c +6388 8ef6 +6389 9d7b +638c 8fb6 +638e 9d75 +638f 9d7a +6392 9472 +6396 9d74 +6398 8c40 +639b 8a7c +639f 9d7c +63a0 97a9 +63a1 8dcc +63a2 9254 +63a3 9d79 +63a5 90da +63a7 8d54 +63a8 9084 +63a9 8986 +63aa 915b +63ab 9d77 +63ac 8b64 +63b2 8c66 +63b4 92cd +63b5 9d7d +63bb 917e +63be 9d81 +63c0 9d83 +63c3 91b5 +63c4 9d89 +63c6 9d84 +63c9 9d86 +63cf 9560 +63d0 92f1 +63d2 9d87 +63d6 974b +63da 9767 +63db 8ab7 +63e1 88ac +63e3 9d85 +63e9 9d82 +63ee 8af6 +63f4 8987 +63f5 fac9 +63f6 9d88 +63fa 9768 +6406 9d8c +640d 91b9 +640f 9d93 +6413 9d8d +6416 9d8a +6417 9d91 +641c 9d72 +6426 9d8e +6428 9d92 +642c 94c0 +642d 938b +6434 9d8b +6436 9d8f +643a 8c67 +643e 8def +6442 90db +644e 9d97 +6458 9345 +6460 faca +6467 9d94 +6469 9680 +646f 9d95 +6476 9d96 +6478 96cc +647a 90a0 +6483 8c82 +6488 9d9d +6492 8e54 +6493 9d9a +6495 9d99 +649a 9451 +649d facb +649e 93b3 +64a4 9350 +64a5 9d9b +64a9 9d9c +64ab 958f +64ad 9464 +64ae 8e42 +64b0 90ef +64b2 966f +64b9 8a68 +64bb 9da3 +64bc 9d9e +64c1 9769 +64c2 9da5 +64c5 9da1 +64c7 9da2 +64cd 9180 +64ce facc +64d2 9da0 +64d4 9d5e +64d8 9da4 +64da 9d9f +64e0 9da9 +64e1 9daa +64e2 9346 +64e3 9dac +64e6 8e43 +64e7 9da7 +64ec 8b5b +64ef 9dad +64f1 9da6 +64f2 9db1 +64f4 9db0 +64f6 9daf +64fa 9db2 +64fd 9db4 +64fe 8fef +6500 9db3 +6505 9db7 +6518 9db5 +651c 9db6 +651d 9d90 +6523 9db9 +6524 9db8 +652a 9d98 +652b 9dba +652c 9dae +652f 8e78 +6534 9dbb +6535 9dbc +6536 9dbe +6537 9dbd +6538 9dbf +6539 89fc +653b 8d55 +653e 95fa +653f 90ad +6545 8ccc +6548 9dc1 +654d 9dc4 +654e facd +654f 9571 +6551 8b7e +6555 9dc3 +6556 9dc2 +6557 9473 +6558 9dc5 +6559 8bb3 +655d 9dc7 +655e 9dc6 +6562 8ab8 +6563 8e55 +6566 93d6 +656c 8c68 +6570 9094 +6572 9dc8 +6574 90ae +6575 9347 +6577 957e +6578 9dc9 +6582 9dca +6583 9dcb +6587 95b6 +6588 9b7c +6589 90c4 +658c 956b +658e 8dd6 +6590 94e3 +6591 94c1 +6597 936c +6599 97bf +659b 9dcd +659c 8ece +659f 9dce +65a1 88b4 +65a4 8bd2 +65a5 90cb +65a7 9580 +65ab 9dcf +65ac 8e61 +65ad 9266 +65af 8e7a +65b0 9056 +65b7 9dd0 +65b9 95fb +65bc 8997 +65bd 8e7b +65c1 9dd3 +65c3 9dd1 +65c4 9dd4 +65c5 97b7 +65c6 9dd2 +65cb 90f9 +65cc 9dd5 +65cf 91b0 +65d2 9dd6 +65d7 8af8 +65d9 9dd8 +65db 9dd7 +65e0 9dd9 +65e1 9dda +65e2 8af9 +65e5 93fa +65e6 9255 +65e7 8b8c +65e8 8e7c +65e9 9181 +65ec 8f7b +65ed 88ae +65f1 9ddb +65fa 89a0 +65fb 9ddf +6600 face +6602 8d56 +6603 9dde +6606 8da9 +6607 8fb8 +6609 fad1 +660a 9ddd +660c 8fb9 +660e 96be +660f 8da8 +6613 88d5 +6614 90cc +6615 facf +661c 9de4 +661e fad3 +661f 90af +6620 8966 +6624 fad4 +6625 8f74 +6627 9686 +6628 8df0 +662d 8fba +662e fad2 +662f 90a5 +6631 fa63 +6634 9de3 +6635 9de1 +6636 9de2 +663b fad0 +663c 928b +663f 9e45 +6641 9de8 +6642 8e9e +6643 8d57 +6644 9de6 +6649 9de7 +664b 9057 +664f 9de5 +6652 8e4e +6657 fad6 +6659 fad7 +665d 9dea +665e 9de9 +665f 9dee +6662 9def +6664 9deb +6665 fad5 +6666 8a41 +6667 9dec +6668 9ded +6669 94d3 +666e 9581 +666f 8c69 +6670 9df0 +6673 fad9 +6674 90b0 +6676 8fbb +667a 9271 +6681 8bc5 +6683 9df1 +6684 9df5 +6687 89c9 +6688 9df2 +6689 9df4 +668e 9df3 +6691 8f8b +6696 9267 +6697 88c3 +6698 9df6 +6699 fada +669d 9df7 +66a0 fadb +66a2 92a8 +66a6 97ef +66ab 8e62 +66ae 95e9 +66b2 fadc +66b4 965c +66b8 9e41 +66b9 9df9 +66bc 9dfc +66be 9dfb +66bf fadd +66c1 9df8 +66c4 9e40 +66c7 93dc +66c9 9dfa +66d6 9e42 +66d9 8f8c +66da 9e43 +66dc 976a +66dd 9498 +66e0 9e44 +66e6 9e46 +66e9 9e47 +66f0 9e48 +66f2 8bc8 +66f3 8967 +66f4 8d58 +66f5 9e49 +66f7 9e4a +66f8 8f91 +66f9 9182 +66fa fade +66fb fa66 +66fc 99d6 +66fd 915d +66fe 915c +66ff 91d6 +6700 8dc5 +6703 98f0 +6708 8c8e +6709 974c +670b 95fc +670d 959e +670e fadf +670f 9e4b +6714 8df1 +6715 92bd +6716 9e4c +6717 984e +671b 965d +671d 92a9 +671e 9e4d +671f 8afa +6726 9e4e +6727 9e4f +6728 96d8 +672a 96a2 +672b 9696 +672c 967b +672d 8e44 +672e 9e51 +6731 8ee9 +6734 9670 +6736 9e53 +6737 9e56 +6738 9e55 +673a 8af7 +673d 8b80 +673f 9e52 +6741 9e54 +6746 9e57 +6749 9099 +674e 979b +674f 88c7 +6750 8dde +6751 91ba +6753 8edb +6756 8ff1 +6759 9e5a +675c 936d +675e 9e58 +675f 91a9 +6760 9e59 +6761 8ff0 +6762 96db +6763 9e5b +6764 9e5c +6765 9788 +6766 fae1 +676a 9e61 +676d 8d59 +676f 9474 +6770 9e5e +6771 938c +6772 9ddc +6773 9de0 +6775 8b6e +6777 9466 +677c 9e60 +677e 8fbc +677f 94c2 +6785 9e66 +6787 94f8 +6789 9e5d +678b 9e63 +678c 9e62 +6790 90cd +6795 968d +6797 97d1 +679a 9687 +679c 89ca +679d 8e7d +67a0 9867 +67a1 9e65 +67a2 9095 +67a6 9e64 +67a9 9e5f +67af 8ccd +67b3 9e6b +67b4 9e69 +67b6 89cb +67b7 9e67 +67b8 9e6d +67b9 9e73 +67bb fae2 +67c0 fae4 +67c1 91c6 +67c4 95bf +67c6 9e75 +67ca 9541 +67ce 9e74 +67cf 9490 +67d0 965e +67d1 8ab9 +67d3 90f5 +67d4 8f5f +67d8 92d1 +67da 974d +67dd 9e70 +67de 9e6f +67e2 9e71 +67e4 9e6e +67e7 9e76 +67e9 9e6c +67ec 9e6a +67ee 9e72 +67ef 9e68 +67f1 928c +67f3 96f6 +67f4 8ec4 +67f5 8df2 +67fb 8db8 +67fe 968f +67ff 8a60 +6801 fae5 +6802 92cc +6803 93c8 +6804 8968 +6813 90f0 +6816 90b2 +6817 8c49 +681e 9e78 +6821 8d5a +6822 8a9c +6829 9e7a +682a 8a94 +682b 9e81 +6832 9e7d +6834 90f1 +6838 8a6a +6839 8daa +683c 8a69 +683d 8dcd +6840 9e7b +6841 8c85 +6842 8c6a +6843 938d +6844 fae6 +6846 9e79 +6848 88c4 +684d 9e7c +684e 9e7e +6850 8bcb +6851 8c4b +6852 fae3 +6853 8aba +6854 8b6a +6859 9e82 +685c 8df7 +685d 9691 +685f 8e56 +6863 9e83 +6867 954f +6874 9e8f +6876 89b1 +6877 9e84 +687e 9e95 +687f 9e85 +6881 97c0 +6883 9e8c +6885 947e +688d 9e94 +688f 9e87 +6893 88b2 +6894 9e89 +6897 8d5b +689b 9e8b +689d 9e8a +689f 9e86 +68a0 9e91 +68a2 8fbd +68a6 9aeb +68a7 8ce6 +68a8 979c +68ad 9e88 +68af 92f2 +68b0 8a42 +68b1 8dab +68b3 9e80 +68b5 9e90 +68b6 8a81 +68b9 9e8e +68ba 9e92 +68bc 938e +68c4 8afc +68c6 9eb0 +68c8 fa64 +68c9 96c7 +68ca 9e97 +68cb 8afb +68cd 9e9e +68cf fae7 +68d2 965f +68d4 9e9f +68d5 9ea1 +68d7 9ea5 +68d8 9e99 +68da 9249 +68df 938f +68e0 9ea9 +68e1 9e9c +68e3 9ea6 +68e7 9ea0 +68ee 9058 +68ef 9eaa +68f2 90b1 +68f9 9ea8 +68fa 8abb +6900 986f +6901 9e96 +6904 9ea4 +6905 88d6 +6908 9e98 +690b 96b8 +690c 9e9d +690d 9041 +690e 92c5 +690f 9e93 +6912 9ea3 +6919 909a +691a 9ead +691b 8a91 +691c 8c9f +6921 9eaf +6922 9e9a +6923 9eae +6925 9ea7 +6926 9e9b +6928 9eab +692a 9eac +6930 9ebd +6934 93cc +6936 9ea2 +6939 9eb9 +693d 9ebb +693f 92d6 +694a 976b +6953 9596 +6954 9eb6 +6955 91c8 +6959 9ebc +695a 915e +695c 9eb3 +695d 9ec0 +695e 9ebf +6960 93ed +6961 9ebe +6962 93e8 +6968 fae9 +696a 9ec2 +696b 9eb5 +696d 8bc6 +696e 9eb8 +696f 8f7c +6973 9480 +6974 9eba +6975 8bc9 +6977 9eb2 +6978 9eb4 +6979 9eb1 +697c 984f +697d 8a79 +697e 9eb7 +6981 9ec1 +6982 8a54 +698a 8de5 +698e 897c +6991 9ed2 +6994 9850 +6995 9ed5 +6998 faeb +699b 9059 +699c 9ed4 +69a0 9ed3 +69a7 9ed0 +69ae 9ec4 +69b1 9ee1 +69b2 9ec3 +69b4 9ed6 +69bb 9ece +69be 9ec9 +69bf 9ec6 +69c1 9ec7 +69c3 9ecf +69c7 eaa0 +69ca 9ecc +69cb 8d5c +69cc 92c6 +69cd 9184 +69ce 9eca +69d0 9ec5 +69d3 9ec8 +69d8 976c +69d9 968a +69dd 9ecd +69de 9ed7 +69e2 faec +69e7 9edf +69e8 9ed8 +69eb 9ee5 +69ed 9ee3 +69f2 9ede +69f9 9edd +69fb 92ce +69fd 9185 +69ff 9edb +6a02 9ed9 +6a05 9ee0 +6a0a 9ee6 +6a0b 94f3 +6a0c 9eec +6a12 9ee7 +6a13 9eea +6a14 9ee4 +6a17 9294 +6a19 9557 +6a1b 9eda +6a1e 9ee2 +6a1f 8fbe +6a21 96cd +6a22 9ef6 +6a23 9ee9 +6a29 8ca0 +6a2a 89a1 +6a2b 8a7e +6a2e 9ed1 +6a30 faed +6a35 8fbf +6a36 9eee +6a38 9ef5 +6a39 8ef7 +6a3a 8a92 +6a3d 924d +6a44 9eeb +6a46 faef +6a47 9ef0 +6a48 9ef4 +6a4b 8bb4 +6a58 8b6b +6a59 9ef2 +6a5f 8b40 +6a61 93c9 +6a62 9ef1 +6a66 9ef3 +6a6b faee +6a72 9eed +6a73 faf0 +6a78 9eef +6a7e faf1 +6a7f 8a80 +6a80 9268 +6a84 9efa +6a8d 9ef8 +6a8e 8ce7 +6a90 9ef7 +6a97 9f40 +6a9c 9e77 +6aa0 9ef9 +6aa2 9efb +6aa3 9efc +6aaa 9f4b +6aac 9f47 +6aae 9e8d +6ab3 9f46 +6ab8 9f45 +6abb 9f42 +6ac1 9ee8 +6ac2 9f44 +6ac3 9f43 +6ad1 9f49 +6ad3 9845 +6ada 9f4c +6adb 8bf9 +6ade 9f48 +6adf 9f4a +6ae2 faf2 +6ae4 faf3 +6ae8 94a5 +6aea 9f4d +6afa 9f51 +6afb 9f4e +6b04 9793 +6b05 9f4f +6b0a 9edc +6b12 9f52 +6b16 9f53 +6b1d 8954 +6b1f 9f55 +6b20 8c87 +6b21 8e9f +6b23 8bd3 +6b27 89a2 +6b32 977e +6b37 9f57 +6b38 9f56 +6b39 9f59 +6b3a 8b5c +6b3d 8bd4 +6b3e 8abc +6b43 9f5c +6b47 9f5b +6b49 9f5d +6b4c 89cc +6b4e 9256 +6b50 9f5e +6b53 8abd +6b54 9f60 +6b59 9f5f +6b5b 9f61 +6b5f 9f62 +6b61 9f63 +6b62 8e7e +6b63 90b3 +6b64 8d9f +6b66 9590 +6b69 95e0 +6b6a 9863 +6b6f 8e95 +6b73 8dce +6b74 97f0 +6b78 9f64 +6b79 9f65 +6b7b 8e80 +6b7f 9f66 +6b80 9f67 +6b83 9f69 +6b84 9f68 +6b86 9677 +6b89 8f7d +6b8a 8eea +6b8b 8e63 +6b8d 9f6a +6b95 9f6c +6b96 9042 +6b98 9f6b +6b9e 9f6d +6ba4 9f6e +6baa 9f6f +6bab 9f70 +6baf 9f71 +6bb1 9f73 +6bb2 9f72 +6bb3 9f74 +6bb4 89a3 +6bb5 9269 +6bb7 9f75 +6bba 8e45 +6bbb 8a6b +6bbc 9f76 +6bbf 9361 +6bc0 9aca +6bc5 8b42 +6bc6 9f77 +6bcb 9f78 +6bcd 95ea +6bce 9688 +6bd2 93c5 +6bd3 9f79 +6bd4 94e4 +6bd6 faf4 +6bd8 94f9 +6bdb 96d1 +6bdf 9f7a +6beb 9f7c +6bec 9f7b +6bef 9f7e +6bf3 9f7d +6c08 9f81 +6c0f 8e81 +6c11 96af +6c13 9f82 +6c14 9f83 +6c17 8b43 +6c1b 9f84 +6c23 9f86 +6c24 9f85 +6c34 9085 +6c37 9558 +6c38 8969 +6c3e 94c3 +6c3f faf5 +6c40 92f3 +6c41 8f60 +6c42 8b81 +6c4e 94c4 +6c50 8eac +6c55 9f88 +6c57 8abe +6c5a 8998 +6c5c faf6 +6c5d 93f0 +6c5e 9f87 +6c5f 8d5d +6c60 9272 +6c62 9f89 +6c68 9f91 +6c6a 9f8a +6c6f faf8 +6c70 91bf +6c72 8b82 +6c73 9f92 +6c7a 8c88 +6c7d 8b44 +6c7e 9f90 +6c81 9f8e +6c82 9f8b +6c83 9780 +6c86 faf7 +6c88 92be +6c8c 93d7 +6c8d 9f8c +6c90 9f94 +6c92 9f93 +6c93 8c42 +6c96 89ab +6c99 8db9 +6c9a 9f8d +6c9b 9f8f +6ca1 9676 +6ca2 91f2 +6cab 9697 +6cae 9f9c +6cb1 9f9d +6cb3 89cd +6cb8 95a6 +6cb9 96fb +6cba 9f9f +6cbb 8ea1 +6cbc 8fc0 +6cbd 9f98 +6cbe 9f9e +6cbf 8988 +6cc1 8bb5 +6cc4 9f95 +6cc5 9f9a +6cc9 90f2 +6cca 9491 +6ccc 94e5 +6cd3 9f97 +6cd5 9640 +6cd7 9f99 +6cd9 9fa2 +6cda faf9 +6cdb 9fa0 +6cdd 9f9b +6ce1 9641 +6ce2 9467 +6ce3 8b83 +6ce5 9344 +6ce8 928d +6cea 9fa3 +6cef 9fa1 +6cf0 91d7 +6cf1 9f96 +6cf3 896a +6d04 fafa +6d0b 976d +6d0c 9fae +6d12 9fad +6d17 90f4 +6d19 9faa +6d1b 978c +6d1e 93b4 +6d1f 9fa4 +6d25 92c3 +6d29 896b +6d2a 8d5e +6d2b 9fa7 +6d32 8f46 +6d33 9fac +6d35 9fab +6d36 9fa6 +6d38 9fa9 +6d3b 8a88 +6d3d 9fa8 +6d3e 9468 +6d41 97ac +6d44 8ff2 +6d45 90f3 +6d59 9fb4 +6d5a 9fb2 +6d5c 956c +6d63 9faf +6d64 9fb1 +6d66 8959 +6d69 8d5f +6d6a 9851 +6d6c 8a5c +6d6e 9582 +6d6f fafc +6d74 9781 +6d77 8a43 +6d78 905a +6d79 9fb3 +6d85 9fb8 +6d87 fafb +6d88 8fc1 +6d8c 974f +6d8e 9fb5 +6d93 9fb0 +6d95 9fb6 +6d96 fb40 +6d99 97dc +6d9b 9393 +6d9c 93c0 +6dac fb41 +6daf 8a55 +6db2 8974 +6db5 9fbc +6db8 9fbf +6dbc 97c1 +6dc0 9784 +6dc5 9fc6 +6dc6 9fc0 +6dc7 9fbd +6dcb 97d2 +6dcc 9fc3 +6dcf fb42 +6dd1 8f69 +6dd2 9fc5 +6dd5 9fca +6dd8 9391 +6dd9 9fc8 +6dde 9fc2 +6de1 9257 +6de4 9fc9 +6de6 9fbe +6de8 9fc4 +6dea 9fcb +6deb 88fa +6dec 9fc1 +6dee 9fcc +6df1 905b +6df2 fb44 +6df3 8f7e +6df5 95a3 +6df7 8dac +6df8 fb43 +6df9 9fb9 +6dfa 9fc7 +6dfb 9359 +6dfc fb45 +6e05 90b4 +6e07 8a89 +6e08 8dcf +6e09 8fc2 +6e0a 9fbb +6e0b 8f61 +6e13 8c6b +6e15 9fba +6e19 9fd0 +6e1a 8f8d +6e1b 8cb8 +6e1d 9fdf +6e1f 9fd9 +6e20 8b94 +6e21 936e +6e23 9fd4 +6e24 9fdd +6e25 88ad +6e26 8951 +6e27 fb48 +6e29 89b7 +6e2b 9fd6 +6e2c 91aa +6e2d 9fcd +6e2e 9fcf +6e2f 8d60 +6e38 9fe0 +6e39 fb46 +6e3a 9fdb +6e3c fb49 +6e3e 9fd3 +6e43 9fda +6e4a 96a9 +6e4d 9fd8 +6e4e 9fdc +6e56 8cce +6e58 8fc3 +6e5b 9258 +6e5c fb47 +6e5f 9fd2 +6e67 974e +6e6b 9fd5 +6e6e 9fce +6e6f 9392 +6e72 9fd1 +6e76 9fd7 +6e7e 9870 +6e7f 8ebc +6e80 969e +6e82 9fe1 +6e8c 94ac +6e8f 9fed +6e90 8cb9 +6e96 8f80 +6e98 9fe3 +6e9c 97ad +6e9d 8d61 +6e9f 9ff0 +6ea2 88ec +6ea5 9fee +6eaa 9fe2 +6eaf 9fe8 +6eb2 9fea +6eb6 976e +6eb7 9fe5 +6eba 934d +6ebd 9fe7 +6ebf fb4a +6ec2 9fef +6ec4 9fe9 +6ec5 96c5 +6ec9 9fe4 +6ecb 8ea0 +6ecc 9ffc +6ed1 8a8a +6ed3 9fe6 +6ed4 9feb +6ed5 9fec +6edd 91ea +6ede 91d8 +6eec 9ff4 +6eef 9ffa +6ef2 9ff8 +6ef4 9348 +6ef7 e042 +6ef8 9ff5 +6efe 9ff6 +6eff 9fde +6f01 8b99 +6f02 9559 +6f06 8ebd +6f09 8d97 +6f0f 9852 +6f11 9ff2 +6f13 e041 +6f14 8989 +6f15 9186 +6f20 9499 +6f22 8abf +6f23 97f8 +6f2b 969f +6f2c 92d0 +6f31 9ff9 +6f32 9ffb +6f38 9151 +6f3e e040 +6f3f 9ff7 +6f41 9ff1 +6f45 8ac1 +6f54 8c89 +6f58 e04e +6f5b e049 +6f5c 90f6 +6f5f 8a83 +6f64 8f81 +6f66 e052 +6f6d e04b +6f6e 92aa +6f6f e048 +6f70 92d7 +6f74 e06b +6f78 e045 +6f7a e044 +6f7c e04d +6f80 e047 +6f81 e046 +6f82 e04c +6f84 909f +6f86 e043 +6f88 fb4b +6f8e e04f +6f91 e050 +6f97 8ac0 +6fa1 e055 +6fa3 e054 +6fa4 e056 +6faa e059 +6fb1 9362 +6fb3 e053 +6fb5 fb4c +6fb9 e057 +6fc0 8c83 +6fc1 91f7 +6fc2 e051 +6fc3 945a +6fc6 e058 +6fd4 e05d +6fd5 e05b +6fd8 e05e +6fdb e061 +6fdf e05a +6fe0 8d8a +6fe1 9447 +6fe4 9fb7 +6feb 9794 +6fec e05c +6fee e060 +6fef 91f3 +6ff1 e05f +6ff3 e04a +6ff5 fb4d +6ff6 e889 +6ffa e064 +6ffe e068 +7001 e066 +7005 fb4e +7007 fb4f +7009 e062 +700b e063 +700f e067 +7011 e065 +7015 956d +7018 e06d +701a e06a +701b e069 +701d e06c +701e 93d2 +701f e06e +7026 9295 +7027 91eb +7028 fb50 +702c 90a3 +7030 e06f +7032 e071 +703e e070 +704c 9ff3 +7051 e072 +7058 93e5 +7063 e073 +706b 89ce +706f 9394 +7070 8a44 +7078 8b84 +707c 8edc +707d 8dd0 +7085 fb51 +7089 9846 +708a 9086 +708e 898a +7092 e075 +7099 e074 +70ab fb52 +70ac e078 +70ad 9259 +70ae e07b +70af e076 +70b3 e07a +70b8 e079 +70b9 935f +70ba 88d7 +70bb fa62 +70c8 97f3 +70cb e07d +70cf 8947 +70d9 e080 +70dd e07e +70df e07c +70f1 e077 +70f9 9642 +70fd e082 +7104 fb54 +7109 e081 +710f fb53 +7114 898b +7119 e084 +711a 95b0 +711c e083 +7121 96b3 +7126 8fc5 +7136 9152 +713c 8fc4 +7146 fb56 +7147 fb57 +7149 97f9 +714c e08a +714e 90f7 +7155 e086 +7156 e08b +7159 898c +715c fb55 +7162 e089 +7164 9481 +7165 e085 +7166 e088 +7167 8fc6 +7169 94cf +716c e08c +716e 8ecf +717d 90f8 +7184 e08f +7188 e087 +718a 8c46 +718f e08d +7194 976f +7195 e090 +7199 eaa4 +719f 8f6e +71a8 e091 +71ac e092 +71b1 944d +71b9 e094 +71be e095 +71c1 fb59 +71c3 9452 +71c8 9395 +71c9 e097 +71ce e099 +71d0 97d3 +71d2 e096 +71d4 e098 +71d5 898d +71d7 e093 +71df 9a7a +71e0 e09a +71e5 9187 +71e6 8e57 +71e7 e09c +71ec e09b +71ed 9043 +71ee 99d7 +71f5 e09d +71f9 e09f +71fb e08e +71fc e09e +71fe fb5a +71ff e0a0 +7206 949a +720d e0a1 +7210 e0a2 +721b e0a3 +7228 e0a4 +722a 92dc +722c e0a6 +722d e0a5 +7230 e0a7 +7232 e0a8 +7235 8edd +7236 9583 +723a 96ea +723b e0a9 +723c e0aa +723d 9175 +723e 8ea2 +723f e0ab +7240 e0ac +7246 e0ad +7247 95d0 +7248 94c5 +724b e0ae +724c 9476 +7252 92ab +7258 e0af +7259 89e5 +725b 8b8d +725d 96c4 +725f 96b4 +7261 89b2 +7262 9853 +7267 9671 +7269 95a8 +7272 90b5 +7274 e0b0 +7279 93c1 +727d 8ca1 +727e e0b1 +7280 8dd2 +7281 e0b3 +7282 e0b2 +7287 e0b4 +7292 e0b5 +7296 e0b6 +72a0 8b5d +72a2 e0b7 +72a7 e0b8 +72ac 8ca2 +72af 94c6 +72b1 fb5b +72b2 e0ba +72b6 8ff3 +72b9 e0b9 +72be fb5c +72c2 8bb6 +72c3 e0bb +72c4 e0bd +72c6 e0bc +72ce e0be +72d0 8ccf +72d2 e0bf +72d7 8be7 +72d9 915f +72db 8d9d +72e0 e0c1 +72e1 e0c2 +72e2 e0c0 +72e9 8eeb +72ec 93c6 +72ed 8bb7 +72f7 e0c4 +72f8 924b +72f9 e0c3 +72fc 9854 +72fd 9482 +730a e0c7 +7316 e0c9 +7317 e0c6 +731b 96d2 +731c e0c8 +731d e0ca +731f 97c2 +7324 fb5d +7325 e0ce +7329 e0cd +732a 9296 +732b 944c +732e 8ca3 +732f e0cc +7334 e0cb +7336 9750 +7337 9751 +733e e0cf +733f 898e +7344 8d96 +7345 8e82 +734e e0d0 +734f e0d1 +7357 e0d3 +7363 8f62 +7368 e0d5 +736a e0d4 +7370 e0d6 +7372 8a6c +7375 e0d8 +7377 fb5f +7378 e0d7 +737a e0da +737b e0d9 +7384 8cba +7387 97a6 +7389 8bca +738b 89a4 +7396 8be8 +73a9 8adf +73b2 97e6 +73b3 e0dc +73bb e0de +73bd fb60 +73c0 e0df +73c2 89cf +73c8 e0db +73c9 fb61 +73ca 8e58 +73cd 92bf +73ce e0dd +73d2 fb64 +73d6 fb62 +73de e0e2 +73e0 8eec +73e3 fb63 +73e5 e0e0 +73ea 8c5d +73ed 94c7 +73ee e0e1 +73f1 e0fc +73f5 fb66 +73f8 e0e7 +73fe 8cbb +7403 8b85 +7405 e0e4 +7406 979d +7407 fb65 +7409 97ae +7422 91f4 +7425 e0e6 +7426 fb67 +7429 fb69 +742a fb68 +742e fb6a +7432 e0e8 +7433 97d4 +7434 8bd5 +7435 94fa +7436 9469 +743a e0e9 +743f e0eb +7441 e0ee +7455 e0ea +7459 e0ed +745a 8ce8 +745b 896c +745c e0ef +745e 9090 +745f e0ec +7460 97da +7462 fb6b +7463 e0f2 +7464 eaa2 +7469 e0f0 +746a e0f3 +746f e0e5 +7470 e0f1 +7473 8dba +7476 e0f4 +747e e0f5 +7483 979e +7489 fb6c +748b e0f6 +749e e0f7 +749f fb6d +74a2 e0e3 +74a7 e0f8 +74b0 8ac2 +74bd 8ea3 +74ca e0f9 +74cf e0fa +74d4 e0fb +74dc 895a +74e0 e140 +74e2 955a +74e3 e141 +74e6 8aa2 +74e7 e142 +74e9 e143 +74ee e144 +74f0 e146 +74f1 e147 +74f2 e145 +74f6 9572 +74f7 e149 +74f8 e148 +7501 fb6e +7503 e14b +7504 e14a +7505 e14c +750c e14d +750d e14f +750e e14e +7511 8d99 +7513 e151 +7515 e150 +7518 8ac3 +751a 9072 +751c 935b +751e e152 +751f 90b6 +7523 8e59 +7525 8999 +7526 e153 +7528 9770 +752b 95e1 +752c e154 +752f faa8 +7530 9363 +7531 9752 +7532 8d62 +7533 905c +7537 926a +7538 99b2 +753a 92ac +753b 89e6 +753c e155 +7544 e156 +7546 e15b +7549 e159 +754a e158 +754b 9dc0 +754c 8a45 +754d e157 +754f 88d8 +7551 94a8 +7554 94c8 +7559 97af +755a e15c +755b e15a +755c 927b +755d 90a4 +7560 94a9 +7562 954c +7564 e15e +7565 97aa +7566 8c6c +7567 e15f +7569 e15d +756a 94d4 +756b e160 +756d e161 +756f fb6f +7570 88d9 +7573 8ff4 +7574 e166 +7576 e163 +7577 93eb +7578 e162 +757f 8b45 +7582 e169 +7586 e164 +7587 e165 +7589 e168 +758a e167 +758b 9544 +758e 9161 +758f 9160 +7591 8b5e +7594 e16a +759a e16b +759d e16c +75a3 e16e +75a5 e16d +75ab 8975 +75b1 e176 +75b2 94e6 +75b3 e170 +75b5 e172 +75b8 e174 +75b9 905d +75bc e175 +75bd e173 +75be 8ebe +75c2 e16f +75c3 e171 +75c5 9561 +75c7 8fc7 +75ca e178 +75cd e177 +75d2 e179 +75d4 8ea4 +75d5 8dad +75d8 9397 +75d9 e17a +75db 92c9 +75de e17c +75e2 979f +75e3 e17b +75e9 9189 +75f0 e182 +75f2 e184 +75f3 e185 +75f4 9273 +75fa e183 +75fc e180 +75fe e17d +75ff e17e +7601 e181 +7609 e188 +760b e186 +760d e187 +761f e189 +7620 e18b +7621 e18c +7622 e18d +7624 e18e +7627 e18a +7630 e190 +7634 e18f +763b e191 +7642 97c3 +7646 e194 +7647 e192 +7648 e193 +764c 8ae0 +7652 96fc +7656 95c8 +7658 e196 +765c e195 +7661 e197 +7662 e198 +7667 e19c +7668 e199 +7669 e19a +766a e19b +766c e19d +7670 e19e +7672 e19f +7676 e1a0 +7678 e1a1 +767a 94ad +767b 936f +767c e1a2 +767d 9492 +767e 9553 +7680 e1a3 +7682 fb70 +7683 e1a4 +7684 9349 +7686 8a46 +7687 8d63 +7688 e1a5 +768b e1a6 +768e e1a7 +7690 8e48 +7693 e1a9 +7696 e1a8 +7699 e1aa +769a e1ab +769b fb73 +769c fb71 +769e fb72 +76a6 fb74 +76ae 94e7 +76b0 e1ac +76b4 e1ad +76b7 ea89 +76b8 e1ae +76b9 e1af +76ba e1b0 +76bf 8e4d +76c2 e1b1 +76c3 9475 +76c6 967e +76c8 896d +76ca 8976 +76cd e1b2 +76d2 e1b4 +76d6 e1b3 +76d7 9390 +76db 90b7 +76dc 9f58 +76de e1b5 +76df 96bf +76e1 e1b6 +76e3 8ac4 +76e4 94d5 +76e5 e1b7 +76e7 e1b8 +76ea e1b9 +76ee 96da +76f2 96d3 +76f4 92bc +76f8 918a +76fb e1bb +76fe 8f82 +7701 8fc8 +7704 e1be +7707 e1bd +7708 e1bc +7709 94fb +770b 8ac5 +770c 8ca7 +771b e1c4 +771e e1c1 +771f 905e +7720 96b0 +7724 e1c0 +7725 e1c2 +7726 e1c3 +7729 e1bf +7737 e1c5 +7738 e1c6 +773a 92ad +773c 8ae1 +7740 9285 +7746 fb76 +7747 e1c7 +775a e1c8 +775b e1cb +7761 9087 +7763 93c2 +7765 e1cc +7766 9672 +7768 e1c9 +776b e1ca +7779 e1cf +777e e1ce +777f e1cd +778b e1d1 +778e e1d0 +7791 e1d2 +779e e1d4 +77a0 e1d3 +77a5 95cb +77ac 8f75 +77ad 97c4 +77b0 e1d5 +77b3 93b5 +77b6 e1d6 +77b9 e1d7 +77bb e1db +77bc e1d9 +77bd e1da +77bf e1d8 +77c7 e1dc +77cd e1dd +77d7 e1de +77da e1df +77db 96b5 +77dc e1e0 +77e2 96ee +77e3 e1e1 +77e5 926d +77e7 948a +77e9 8be9 +77ed 925a +77ee e1e2 +77ef 8bb8 +77f3 90ce +77fc e1e3 +7802 8dbb +780c e1e4 +7812 e1e5 +7814 8ca4 +7815 8dd3 +7820 e1e7 +7821 fb78 +7825 9375 +7826 8dd4 +7827 8b6d +7832 9643 +7834 946a +783a 9376 +783f 8d7b +7845 e1e9 +784e fb79 +785d 8fc9 +7864 fb7a +786b 97b0 +786c 8d64 +786f 8ca5 +7872 94a1 +7874 e1eb +787a fb7b +787c e1ed +7881 8ce9 +7886 e1ec +7887 92f4 +788c e1ef +788d 8a56 +788e e1ea +7891 94e8 +7893 894f +7895 8dea +7897 9871 +789a e1ee +78a3 e1f0 +78a7 95c9 +78a9 90d7 +78aa e1f2 +78af e1f3 +78b5 e1f1 +78ba 8a6d +78bc e1f9 +78be e1f8 +78c1 8ea5 +78c5 e1fa +78c6 e1f5 +78ca e1fb +78cb e1f6 +78d0 94d6 +78d1 e1f4 +78d4 e1f7 +78da e241 +78e7 e240 +78e8 9681 +78ec e1fc +78ef 88e9 +78f4 e243 +78fd e242 +7901 8fca +7907 e244 +790e 9162 +7911 e246 +7912 e245 +7919 e247 +7926 e1e6 +792a e1e8 +792b e249 +792c e248 +7930 fb7c +793a 8ea6 +793c 97e7 +793e 8ed0 +7940 e24a +7941 8c56 +7947 8b5f +7948 8b46 +7949 8e83 +7950 9753 +7953 e250 +7955 e24f +7956 9163 +7957 e24c +795a e24e +795d 8f6a +795e 905f +795f e24d +7960 e24b +7962 9449 +7965 8fcb +7968 955b +796d 8dd5 +7977 9398 +797a e251 +797f e252 +7980 e268 +7981 8bd6 +7984 985c +7985 9154 +798a e253 +798d 89d0 +798e 92f5 +798f 959f +7994 fb81 +799b fb83 +799d e254 +79a6 8b9a +79a7 e255 +79aa e257 +79ae e258 +79b0 9448 +79b3 e259 +79b9 e25a +79ba e25b +79bd 8bd7 +79be 89d1 +79bf 93c3 +79c0 8f47 +79c1 8e84 +79c9 e25c +79cb 8f48 +79d1 89c8 +79d2 9562 +79d5 e25d +79d8 94e9 +79df 9164 +79e1 e260 +79e3 e261 +79e4 9489 +79e6 9060 +79e7 e25e +79e9 9281 +79ec e25f +79f0 8fcc +79fb 88da +7a00 8b48 +7a08 e262 +7a0b 92f6 +7a0d e263 +7a0e 90c5 +7a14 96ab +7a17 9542 +7a18 e264 +7a19 e265 +7a1a 9274 +7a1c 97c5 +7a1f e267 +7a20 e266 +7a2e 8eed +7a31 e269 +7a32 88ee +7a37 e26c +7a3b e26a +7a3c 89d2 +7a3d 8c6d +7a3e e26b +7a3f 8d65 +7a40 8d92 +7a42 95e4 +7a43 e26d +7a46 9673 +7a49 e26f +7a4d 90cf +7a4e 896e +7a4f 89b8 +7a50 88aa +7a57 e26e +7a61 e270 +7a62 e271 +7a63 8ff5 +7a69 e272 +7a6b 8a6e +7a70 e274 +7a74 8c8a +7a76 8b86 +7a79 e275 +7a7a 8bf3 +7a7d e276 +7a7f 90fa +7a81 93cb +7a83 90de +7a84 8df3 +7a88 e277 +7a92 9282 +7a93 918b +7a95 e279 +7a96 e27b +7a97 e278 +7a98 e27a +7a9f 8c41 +7aa9 e27c +7aaa 8c45 +7aae 8b87 +7aaf 9771 +7ab0 e27e +7ab6 e280 +7aba 894d +7abf e283 +7ac3 8a96 +7ac4 e282 +7ac5 e281 +7ac7 e285 +7ac8 e27d +7aca e286 +7acb 97a7 +7acd e287 +7acf e288 +7ad1 fb84 +7ad2 9af2 +7ad3 e28a +7ad5 e289 +7ad9 e28b +7ada e28c +7adc 97b3 +7add e28d +7adf e8ed +7ae0 8fcd +7ae1 e28e +7ae2 e28f +7ae3 8f76 +7ae5 93b6 +7ae6 e290 +7ae7 fb85 +7aea 9247 +7aeb fb87 +7aed e291 +7aef 925b +7af0 e292 +7af6 8ba3 +7af8 995e +7af9 927c +7afa 8eb1 +7aff 8ac6 +7b02 e293 +7b04 e2a0 +7b06 e296 +7b08 8b88 +7b0a e295 +7b0b e2a2 +7b0f e294 +7b11 8fce +7b18 e298 +7b19 e299 +7b1b 934a +7b1e e29a +7b20 8a7d +7b25 9079 +7b26 9584 +7b28 e29c +7b2c 91e6 +7b33 e297 +7b35 e29b +7b36 e29d +7b39 8df9 +7b45 e2a4 +7b46 954d +7b48 94a4 +7b49 9399 +7b4b 8bd8 +7b4c e2a3 +7b4d e2a1 +7b4f 94b3 +7b50 e29e +7b51 927d +7b52 939b +7b54 939a +7b56 8df4 +7b5d e2b6 +7b65 e2a6 +7b67 e2a8 +7b6c e2ab +7b6e e2ac +7b70 e2a9 +7b71 e2aa +7b74 e2a7 +7b75 e2a5 +7b7a e29f +7b86 95cd +7b87 89d3 +7b8b e2b3 +7b8d e2b0 +7b8f e2b5 +7b92 e2b4 +7b94 9493 +7b95 96a5 +7b97 8e5a +7b98 e2ae +7b99 e2b7 +7b9a e2b2 +7b9c e2b1 +7b9d e2ad +7b9e fb88 +7b9f e2af +7ba1 8ac7 +7baa 925c +7bad 90fb +7bb1 94a0 +7bb4 e2bc +7bb8 94a2 +7bc0 90df +7bc1 e2b9 +7bc4 94cd +7bc6 e2bd +7bc7 95d1 +7bc9 927a +7bcb e2b8 +7bcc e2ba +7bcf e2bb +7bdd e2be +7be0 8ec2 +7be4 93c4 +7be5 e2c3 +7be6 e2c2 +7be9 e2bf +7bed 9855 +7bf3 e2c8 +7bf6 e2cc +7bf7 e2c9 +7c00 e2c5 +7c07 e2c6 +7c0d e2cb +7c11 e2c0 +7c12 99d3 +7c13 e2c7 +7c14 e2c1 +7c17 e2ca +7c1f e2d0 +7c21 8ac8 +7c23 e2cd +7c27 e2ce +7c2a e2cf +7c2b e2d2 +7c37 e2d1 +7c38 94f4 +7c3d e2d3 +7c3e 97fa +7c3f 95eb +7c40 e2d8 +7c43 e2d5 +7c4c e2d4 +7c4d 90d0 +7c4f e2d7 +7c50 e2d9 +7c54 e2d6 +7c56 e2dd +7c58 e2da +7c5f e2db +7c60 e2c4 +7c64 e2dc +7c65 e2de +7c6c e2df +7c73 95c4 +7c75 e2e0 +7c7e 96e0 +7c81 8bcc +7c82 8c48 +7c83 e2e1 +7c89 95b2 +7c8b 9088 +7c8d 96ae +7c90 e2e2 +7c92 97b1 +7c95 9494 +7c97 9165 +7c98 9453 +7c9b 8f6c +7c9f 88be +7ca1 e2e7 +7ca2 e2e5 +7ca4 e2e3 +7ca5 8a9f +7ca7 8fcf +7ca8 e2e8 +7cab e2e6 +7cad e2e4 +7cae e2ec +7cb1 e2eb +7cb2 e2ea +7cb3 e2e9 +7cb9 e2ed +7cbd e2ee +7cbe 90b8 +7cc0 e2ef +7cc2 e2f1 +7cc5 e2f0 +7cca 8cd0 +7cce 9157 +7cd2 e2f3 +7cd6 939c +7cd8 e2f2 +7cdc e2f4 +7cde 95b3 +7cdf 918c +7ce0 8d66 +7ce2 e2f5 +7ce7 97c6 +7cef e2f7 +7cf2 e2f8 +7cf4 e2f9 +7cf6 e2fa +7cf8 8e85 +7cfa e2fb +7cfb 8c6e +7cfe 8b8a +7d00 8b49 +7d02 e340 +7d04 96f1 +7d05 8d67 +7d06 e2fc +7d0a e343 +7d0b 96e4 +7d0d 945b +7d10 9552 +7d14 8f83 +7d15 e342 +7d17 8ed1 +7d18 8d68 +7d19 8e86 +7d1a 8b89 +7d1b 95b4 +7d1c e341 +7d20 9166 +7d21 9661 +7d22 8df5 +7d2b 8e87 +7d2c 92db +7d2e e346 +7d2f 97dd +7d30 8dd7 +7d32 e347 +7d33 9061 +7d35 e349 +7d39 8fd0 +7d3a 8dae +7d3f e348 +7d42 8f49 +7d43 8cbc +7d44 9167 +7d45 e344 +7d46 e34a +7d48 fb8a +7d4b e345 +7d4c 8c6f +7d4e e34d +7d4f e351 +7d50 8c8b +7d56 e34c +7d5b e355 +7d5c fb8b +7d5e 8d69 +7d61 978d +7d62 88ba +7d63 e352 +7d66 8b8b +7d68 e34f +7d6e e350 +7d71 939d +7d72 e34e +7d73 e34b +7d75 8a47 +7d76 90e2 +7d79 8ca6 +7d7d e357 +7d89 e354 +7d8f e356 +7d93 e353 +7d99 8c70 +7d9a 91b1 +7d9b e358 +7d9c 918e +7d9f e365 +7da0 fb8d +7da2 e361 +7da3 e35b +7dab e35f +7dac 8ef8 +7dad 88db +7dae e35a +7daf e362 +7db0 e366 +7db1 8d6a +7db2 96d4 +7db4 92d4 +7db5 e35c +7db7 fb8c +7db8 e364 +7dba e359 +7dbb 925d +7dbd e35e +7dbe 88bb +7dbf 96c8 +7dc7 e35d +7dca 8bd9 +7dcb 94ea +7dcf 918d +7dd1 97ce +7dd2 8f8f +7dd5 e38e +7dd6 fb8e +7dd8 e367 +7dda 90fc +7ddc e363 +7ddd e368 +7dde e36a +7de0 92f7 +7de1 e36d +7de4 e369 +7de8 95d2 +7de9 8ac9 +7dec 96c9 +7def 88dc +7df2 e36c +7df4 97fb +7dfb e36b +7e01 898f +7e04 93ea +7e05 e36e +7e09 e375 +7e0a e36f +7e0b e376 +7e12 e372 +7e1b 949b +7e1e 8ec8 +7e1f e374 +7e21 e371 +7e22 e377 +7e23 e370 +7e26 8f63 +7e2b 9644 +7e2e 8f6b +7e31 e373 +7e32 e380 +7e35 e37b +7e37 e37e +7e39 e37c +7e3a e381 +7e3b e37a +7e3d e360 +7e3e 90d1 +7e41 94c9 +7e43 e37d +7e46 e378 +7e4a 9140 +7e4b 8c71 +7e4d 8f4a +7e52 fb8f +7e54 9044 +7e55 9155 +7e56 e384 +7e59 e386 +7e5a e387 +7e5d e383 +7e5e e385 +7e66 e379 +7e67 e382 +7e69 e38a +7e6a e389 +7e6d 969a +7e70 8c4a +7e79 e388 +7e7b e38c +7e7c e38b +7e7d e38f +7e7f e391 +7e82 8e5b +7e83 e38d +7e88 e392 +7e89 e393 +7e8a fa5c +7e8c e394 +7e8e e39a +7e8f 935a +7e90 e396 +7e92 e395 +7e93 e397 +7e94 e398 +7e96 e399 +7e9b e39b +7e9c e39c +7f36 8aca +7f38 e39d +7f3a e39e +7f45 e39f +7f47 fb90 +7f4c e3a0 +7f4d e3a1 +7f4e e3a2 +7f50 e3a3 +7f51 e3a4 +7f54 e3a6 +7f55 e3a5 +7f58 e3a7 +7f5f e3a8 +7f60 e3a9 +7f67 e3ac +7f68 e3aa +7f69 e3ab +7f6a 8ddf +7f6b 8c72 +7f6e 9275 +7f70 94b1 +7f72 8f90 +7f75 946c +7f77 94eb +7f78 e3ad +7f79 9ceb +7f82 e3ae +7f83 e3b0 +7f85 9785 +7f86 e3af +7f87 e3b2 +7f88 e3b1 +7f8a 9772 +7f8c e3b3 +7f8e 94fc +7f94 e3b4 +7f9a e3b7 +7f9d e3b6 +7f9e e3b5 +7fa1 fb91 +7fa3 e3b8 +7fa4 8c51 +7fa8 9141 +7fa9 8b60 +7fae e3bc +7faf e3b9 +7fb2 e3ba +7fb6 e3bd +7fb8 e3be +7fb9 e3bb +7fbd 8948 +7fc1 89a5 +7fc5 e3c0 +7fc6 e3c1 +7fca e3c2 +7fcc 9782 +7fd2 8f4b +7fd4 e3c4 +7fd5 e3c3 +7fe0 9089 +7fe1 e3c5 +7fe6 e3c6 +7fe9 e3c7 +7feb 8ae3 +7ff0 8acb +7ff3 e3c8 +7ff9 e3c9 +7ffb 967c +7ffc 9783 +8000 9773 +8001 9856 +8003 8d6c +8004 e3cc +8005 8ed2 +8006 e3cb +800b e3cd +800c 8ea7 +8010 91cf +8012 e3ce +8015 8d6b +8017 96d5 +8018 e3cf +8019 e3d0 +801c e3d1 +8021 e3d2 +8028 e3d3 +8033 8ea8 +8036 96eb +803b e3d5 +803d 925e +803f e3d4 +8046 e3d7 +804a e3d6 +8052 e3d8 +8056 90b9 +8058 e3d9 +805a e3da +805e 95b7 +805f e3db +8061 918f +8062 e3dc +8068 e3dd +806f 97fc +8070 e3e0 +8072 e3df +8073 e3de +8074 92ae +8076 e3e1 +8077 9045 +8079 e3e2 +807d e3e3 +807e 9857 +807f e3e4 +8084 e3e5 +8085 e3e7 +8086 e3e6 +8087 94a3 +8089 93f7 +808b 985d +808c 94a7 +8093 e3e9 +8096 8fd1 +8098 9549 +809a e3ea +809b e3e8 +809d 8acc +80a1 8cd2 +80a2 8e88 +80a5 94ec +80a9 8ca8 +80aa 9662 +80ac e3ed +80ad e3eb +80af 8d6d +80b1 8d6e +80b2 88e7 +80b4 8de6 +80ba 9478 +80c3 88dd +80c4 e3f2 +80c6 925f +80cc 9477 +80ce 91d9 +80d6 e3f4 +80d9 e3f0 +80da e3f3 +80db e3ee +80dd e3f1 +80de 9645 +80e1 8cd3 +80e4 88fb +80e5 e3ef +80ef e3f6 +80f1 e3f7 +80f4 93b7 +80f8 8bb9 +80fc e445 +80fd 945c +8102 8e89 +8105 8bba +8106 90c6 +8107 9865 +8108 96ac +8109 e3f5 +810a 90d2 +811a 8b72 +811b e3f8 +8123 e3fa +8129 e3f9 +812f e3fb +8131 9245 +8133 945d +8139 92af +813e e442 +8146 e441 +814b e3fc +814e 9074 +8150 9585 +8151 e444 +8153 e443 +8154 8d6f +8155 9872 +815f e454 +8165 e448 +8166 e449 +816b 8eee +816e e447 +8170 8d98 +8171 e446 +8174 e44a +8178 92b0 +8179 95a0 +817a 9142 +817f 91da +8180 e44e +8182 e44f +8183 e44b +8188 e44c +818a e44d +818f 8d70 +8193 e455 +8195 e451 +819a 9586 +819c 968c +819d 9547 +81a0 e450 +81a3 e453 +81a4 e452 +81a8 9663 +81a9 e456 +81b0 e457 +81b3 9156 +81b5 e458 +81b8 e45a +81ba e45e +81bd e45b +81be e459 +81bf 945e +81c0 e45c +81c2 e45d +81c6 89b0 +81c8 e464 +81c9 e45f +81cd e460 +81d1 e461 +81d3 919f +81d8 e463 +81d9 e462 +81da e465 +81df e466 +81e0 e467 +81e3 9062 +81e5 89e7 +81e7 e468 +81e8 97d5 +81ea 8ea9 +81ed 8f4c +81f3 8e8a +81f4 9276 +81fa e469 +81fb e46a +81fc 8950 +81fe e46b +8201 e46c +8202 e46d +8205 e46e +8207 e46f +8208 8bbb +8209 9da8 +820a e470 +820c 90e3 +820d e471 +820e 8ec9 +8210 e472 +8212 98ae +8216 e473 +8217 95dc +8218 8ada +821b 9143 +821c 8f77 +821e 9591 +821f 8f4d +8229 e474 +822a 8d71 +822b e475 +822c 94ca +822e e484 +8233 e477 +8235 91c7 +8236 9495 +8237 8cbd +8238 e476 +8239 9144 +8240 e478 +8247 92f8 +8258 e47a +8259 e479 +825a e47c +825d e47b +825f e47d +8262 e480 +8264 e47e +8266 8acd +8268 e481 +826a e482 +826b e483 +826e 8daf +826f 97c7 +8271 e485 +8272 9046 +8276 8990 +8277 e486 +8278 e487 +827e e488 +828b 88f0 +828d e489 +8292 e48a +8299 9587 +829d 8ec5 +829f e48c +82a5 8a48 +82a6 88b0 +82ab e48b +82ac e48e +82ad 946d +82af 9063 +82b1 89d4 +82b3 9646 +82b8 8c7c +82b9 8bda +82bb e48d +82bd 89e8 +82c5 8aa1 +82d1 8991 +82d2 e492 +82d3 97e8 +82d4 91db +82d7 9563 +82d9 e49e +82db 89d5 +82dc e49c +82de e49a +82df e491 +82e1 e48f +82e3 e490 +82e5 8ee1 +82e6 8bea +82e7 9297 +82eb 93cf +82f1 8970 +82f3 e494 +82f4 e493 +82f9 e499 +82fa e495 +82fb e498 +8301 fb93 +8302 96ce +8303 e497 +8304 89d6 +8305 8a9d +8306 e49b +8309 e49d +830e 8c73 +8316 e4a1 +8317 e4aa +8318 e4ab +831c 88a9 +8323 e4b2 +8328 88ef +832b e4a9 +832f e4a8 +8331 e4a3 +8332 e4a2 +8334 e4a0 +8335 e49f +8336 9283 +8338 91f9 +8339 e4a5 +8340 e4a4 +8345 e4a7 +8349 9190 +834a 8c74 +834f 8960 +8350 e4a6 +8352 8d72 +8358 9191 +8362 fb94 +8373 e4b8 +8375 e4b9 +8377 89d7 +837b 89ac +837c e4b6 +837f fb95 +8385 e4ac +8387 e4b4 +8389 e4bb +838a e4b5 +838e e4b3 +8393 e496 +8396 e4b1 +839a e4ad +839e 8ace +839f e4af +83a0 e4ba +83a2 e4b0 +83a8 e4bc +83aa e4ae +83ab 949c +83b1 9789 +83b5 e4b7 +83bd e4cd +83c1 e4c5 +83c5 909b +83c7 fb96 +83ca 8b65 +83cc 8bdb +83ce e4c0 +83d3 89d9 +83d6 8fd2 +83d8 e4c3 +83dc 8dd8 +83df 9370 +83e0 e4c8 +83e9 95ec +83eb e4bf +83ef 89d8 +83f0 8cd4 +83f1 9548 +83f2 e4c9 +83f4 e4bd +83f6 fb97 +83f7 e4c6 +83fb e4d0 +83fd e4c1 +8403 e4c2 +8404 93b8 +8407 e4c7 +840b e4c4 +840c 9647 +840d e4ca +840e 88de +8413 e4be +8420 e4cc +8422 e4cb +8429 948b +842a e4d2 +842c e4dd +8431 8a9e +8435 e4e0 +8438 e4ce +843c e4d3 +843d 978e +8446 e4dc +8448 fb98 +8449 9774 +844e 97a8 +8457 9298 +845b 8a8b +8461 9592 +8462 e4e2 +8463 939f +8466 88af +8469 e4db +846b e4d7 +846c 9192 +846d e4d1 +846e e4d9 +846f e4de +8471 944b +8475 88a8 +8477 e4d6 +8479 e4df +847a 9598 +8482 e4da +8484 e4d5 +848b 8fd3 +8490 8f4e +8494 8eaa +8499 96d6 +849c 9566 +849f e4e5 +84a1 e4ee +84ad e4d8 +84b2 8a97 +84b4 fb99 +84b8 8ff6 +84b9 e4e3 +84bb e4e8 +84bc 9193 +84bf e4e4 +84c1 e4eb +84c4 927e +84c6 e4ec +84c9 9775 +84ca e4e1 +84cb 8a57 +84cd e4e7 +84d0 e4ea +84d1 96aa +84d6 e4ed +84d9 e4e6 +84da e4e9 +84dc fa60 +84ec 9648 +84ee 9840 +84f4 e4f1 +84fc e4f8 +84ff e4f0 +8500 8ec1 +8506 e4cf +8511 95cc +8513 96a0 +8514 e4f7 +8515 e4f6 +8517 e4f2 +8518 e4f3 +851a 8955 +851f e4f5 +8521 e4ef +8526 92d3 +852c e4f4 +852d 88fc +8535 91a0 +853d 95c1 +8540 e4f9 +8541 e540 +8543 94d7 +8548 e4fc +8549 8fd4 +854a 8ec7 +854b e542 +854e 8bbc +8553 fb9a +8555 e543 +8557 9599 +8558 e4fb +8559 fb9b +855a e4d4 +8563 e4fa +8568 986e +8569 93a0 +856a 9593 +856b fb9c +856d e54a +8577 e550 +857e e551 +8580 e544 +8584 9496 +8587 e54e +8588 e546 +858a e548 +8590 e552 +8591 e547 +8594 e54b +8597 8992 +8599 93e3 +859b e54c +859c e54f +85a4 e545 +85a6 9145 +85a8 e549 +85a9 8e46 +85aa 9064 +85ab 8c4f +85ac 96f2 +85ae 96f7 +85af 8f92 +85b0 fb9e +85b9 e556 +85ba e554 +85c1 986d +85c9 e553 +85cd 9795 +85cf e555 +85d0 e557 +85d5 e558 +85dc e55b +85dd e559 +85e4 93a1 +85e5 e55a +85e9 94cb +85ea e54d +85f7 8f93 +85f9 e55c +85fa e561 +85fb 9194 +85fe e560 +8602 e541 +8606 e562 +8607 9168 +860a e55d +860b e55f +8613 e55e +8616 9f50 +8617 9f41 +861a e564 +8622 e563 +862d 9796 +862f e1ba +8630 e565 +863f e566 +864d e567 +864e 8cd5 +8650 8b73 +8654 e569 +8655 997c +865a 8b95 +865c 97b8 +865e 8bf1 +865f e56a +8667 e56b +866b 928e +8671 e56c +8679 93f8 +867b 88b8 +868a 89e1 +868b e571 +868c e572 +8693 e56d +8695 8e5c +86a3 e56e +86a4 9461 +86a9 e56f +86aa e570 +86ab e57a +86af e574 +86b0 e577 +86b6 e573 +86c4 e575 +86c6 e576 +86c7 8ed6 +86c9 e578 +86cb 9260 +86cd 8c75 +86ce 8a61 +86d4 e57b +86d9 8a5e +86db e581 +86de e57c +86df e580 +86e4 94b8 +86e9 e57d +86ec e57e +86ed 9567 +86ee 94d8 +86ef e582 +86f8 91fb +86f9 e58c +86fb e588 +86fe 89e9 +8700 e586 +8702 9649 +8703 e587 +8706 e584 +8708 e585 +8709 e58a +870a e58d +870d e58b +8711 e589 +8712 e583 +8718 9277 +871a e594 +871c 96a8 +8725 e592 +8729 e593 +8734 e58e +8737 e590 +873b e591 +873f e58f +8749 90e4 +874b 9858 +874c e598 +874e e599 +8753 e59f +8755 9049 +8757 e59b +8759 e59e +875f e596 +8760 e595 +8763 e5a0 +8766 89da +8768 e59c +876a e5a1 +876e e59d +8774 e59a +8776 92b1 +8778 e597 +877f 9488 +8782 e5a5 +878d 975a +879f e5a4 +87a2 e5a3 +87ab e5ac +87af e5a6 +87b3 e5ae +87ba 9786 +87bb e5b1 +87bd e5a8 +87c0 e5a9 +87c4 e5ad +87c6 e5b0 +87c7 e5af +87cb e5a7 +87d0 e5aa +87d2 e5bb +87e0 e5b4 +87ef e5b2 +87f2 e5b3 +87f6 e5b8 +87f7 e5b9 +87f9 8a49 +87fb 8b61 +87fe e5b7 +8805 e5a2 +8807 fba1 +880d e5b6 +880e e5ba +880f e5b5 +8811 e5bc +8815 e5be +8816 e5bd +8821 e5c0 +8822 e5bf +8823 e579 +8827 e5c4 +8831 e5c1 +8836 e5c2 +8839 e5c3 +883b e5c5 +8840 8c8c +8842 e5c7 +8844 e5c6 +8846 8f4f +884c 8d73 +884d 9fa5 +8852 e5c8 +8853 8f70 +8857 8a58 +8859 e5c9 +885b 8971 +885d 8fd5 +885e e5ca +8861 8d74 +8862 e5cb +8863 88df +8868 955c +886b e5cc +8870 908a +8872 e5d3 +8875 e5d0 +8877 928f +887d e5d1 +887e e5ce +887f 8bdc +8881 e5cd +8882 e5d4 +8888 8c55 +888b 91dc +888d e5da +8892 e5d6 +8896 91b3 +8897 e5d5 +8899 e5d8 +889e e5cf +88a2 e5d9 +88a4 e5db +88ab 94ed +88ae e5d7 +88b0 e5dc +88b1 e5de +88b4 8cd1 +88b5 e5d2 +88b7 88bf +88bf e5dd +88c1 8dd9 +88c2 97f4 +88c3 e5df +88c4 e5e0 +88c5 9195 +88cf 97a0 +88d4 e5e1 +88d5 9754 +88d8 e5e2 +88d9 e5e3 +88dc 95e2 +88dd e5e4 +88df 8dbe +88e1 97a1 +88e8 e5e9 +88f2 e5ea +88f3 8fd6 +88f4 e5e8 +88f5 fba2 +88f8 9787 +88f9 e5e5 +88fc e5e7 +88fd 90bb +88fe 909e +8902 e5e6 +8904 e5eb +8907 95a1 +890a e5ed +890c e5ec +8910 8a8c +8912 964a +8913 e5ee +891c fa5d +891d e5fa +891e e5f0 +8925 e5f1 +892a e5f2 +892b e5f3 +8936 e5f7 +8938 e5f8 +893b e5f6 +8941 e5f4 +8943 e5ef +8944 e5f5 +894c e5f9 +894d e8b5 +8956 89a6 +895e e5fc +895f 8bdd +8960 e5fb +8964 e641 +8966 e640 +896a e643 +896d e642 +896f e644 +8972 8f50 +8974 e645 +8977 e646 +897e e647 +897f 90bc +8981 9776 +8983 e648 +8986 95a2 +8987 9465 +8988 e649 +898a e64a +898b 8ca9 +898f 8b4b +8993 e64b +8996 8e8b +8997 9460 +8998 e64c +899a 8a6f +89a1 e64d +89a6 e64f +89a7 9797 +89a9 e64e +89aa 9065 +89ac e650 +89af e651 +89b2 e652 +89b3 8acf +89ba e653 +89bd e654 +89bf e655 +89c0 e656 +89d2 8a70 +89da e657 +89dc e658 +89dd e659 +89e3 89f0 +89e6 9047 +89e7 e65a +89f4 e65b +89f8 e65c +8a00 8cbe +8a02 92f9 +8a03 e65d +8a08 8c76 +8a0a 9075 +8a0c e660 +8a0e 93a2 +8a10 e65f +8a12 fba3 +8a13 8c50 +8a16 e65e +8a17 91f5 +8a18 8b4c +8a1b e661 +8a1d e662 +8a1f 8fd7 +8a23 8c8d +8a25 e663 +8a2a 964b +8a2d 90dd +8a31 8b96 +8a33 96f3 +8a34 9169 +8a36 e664 +8a37 fba4 +8a3a 9066 +8a3b 9290 +8a3c 8fd8 +8a41 e665 +8a46 e668 +8a48 e669 +8a50 8dbc +8a51 91c0 +8a52 e667 +8a54 8fd9 +8a55 955d +8a5b e666 +8a5e 8e8c +8a60 8972 +8a62 e66d +8a63 8c77 +8a66 8e8e +8a69 8e8d +8a6b 986c +8a6c e66c +8a6d e66b +8a6e 9146 +8a70 8b6c +8a71 9862 +8a72 8a59 +8a73 8fda +8a79 fba5 +8a7c e66a +8a82 e66f +8a84 e670 +8a85 e66e +8a87 8cd6 +8a89 975f +8a8c 8e8f +8a8d 9446 +8a91 e673 +8a93 90be +8a95 9261 +8a98 9755 +8a9a e676 +8a9e 8cea +8aa0 90bd +8aa1 e672 +8aa3 e677 +8aa4 8ceb +8aa5 e674 +8aa6 e675 +8aa7 fba6 +8aa8 e671 +8aac 90e0 +8aad 93c7 +8ab0 924e +8ab2 89db +8ab9 94ee +8abc 8b62 +8abe fba7 +8abf 92b2 +8ac2 e67a +8ac4 e678 +8ac7 926b +8acb 90bf +8acc 8ad0 +8acd e679 +8acf 907a +8ad2 97c8 +8ad6 985f +8ada e67b +8adb e687 +8adc 92b3 +8ade e686 +8adf fba8 +8ae0 e683 +8ae1 e68b +8ae2 e684 +8ae4 e680 +8ae6 92fa +8ae7 e67e +8aeb e67c +8aed 9740 +8aee 8e90 +8af1 e681 +8af3 e67d +8af6 fbaa +8af7 e685 +8af8 8f94 +8afa 8cbf +8afe 91f8 +8b00 9664 +8b01 8979 +8b02 88e0 +8b04 93a3 +8b07 e689 +8b0c e688 +8b0e 93e4 +8b10 e68d +8b14 e682 +8b16 e68c +8b17 e68e +8b19 8caa +8b1a e68a +8b1b 8d75 +8b1d 8ed3 +8b20 e68f +8b21 9777 +8b26 e692 +8b28 e695 +8b2b e693 +8b2c 9554 +8b33 e690 +8b39 8bde +8b3e e694 +8b41 e696 +8b49 e69a +8b4c e697 +8b4e e699 +8b4f e698 +8b53 fbab +8b56 e69b +8b58 8eaf +8b5a e69d +8b5b e69c +8b5c 9588 +8b5f e69f +8b66 8c78 +8b6b e69e +8b6c e6a0 +8b6f e6a1 +8b70 8b63 +8b71 e3bf +8b72 8ff7 +8b74 e6a2 +8b77 8cec +8b7d e6a3 +8b7f fbac +8b80 e6a4 +8b83 8e5d +8b8a 9dcc +8b8c e6a5 +8b8e e6a6 +8b90 8f51 +8b92 e6a7 +8b93 e6a8 +8b96 e6a9 +8b99 e6aa +8b9a e6ab +8c37 924a +8c3a e6ac +8c3f e6ae +8c41 e6ad +8c46 93a4 +8c48 e6af +8c4a 964c +8c4c e6b0 +8c4e e6b1 +8c50 e6b2 +8c55 e6b3 +8c5a 93d8 +8c61 8fdb +8c62 e6b4 +8c6a 8d8b +8c6b 98ac +8c6c e6b5 +8c78 e6b6 +8c79 955e +8c7a e6b7 +8c7c e6bf +8c82 e6b8 +8c85 e6ba +8c89 e6b9 +8c8a e6bb +8c8c 9665 +8c8d e6bc +8c8e e6bd +8c94 e6be +8c98 e6c0 +8c9d 8a4c +8c9e 92e5 +8ca0 9589 +8ca1 8de0 +8ca2 8d76 +8ca7 956e +8ca8 89dd +8ca9 94cc +8caa e6c3 +8cab 8ad1 +8cac 90d3 +8cad e6c2 +8cae e6c7 +8caf 9299 +8cb0 96e1 +8cb2 e6c5 +8cb3 e6c6 +8cb4 8b4d +8cb6 e6c8 +8cb7 9483 +8cb8 91dd +8cbb 94ef +8cbc 935c +8cbd e6c4 +8cbf 9666 +8cc0 89ea +8cc1 e6ca +8cc2 9847 +8cc3 92c0 +8cc4 9864 +8cc7 8e91 +8cc8 e6c9 +8cca 91af +8ccd e6da +8cce 9147 +8cd1 93f6 +8cd3 956f +8cda e6cd +8cdb 8e5e +8cdc 8e92 +8cde 8fdc +8ce0 9485 +8ce2 8cab +8ce3 e6cc +8ce4 e6cb +8ce6 958a +8cea 8ebf +8ced 9371 +8cf0 fbad +8cf4 fbae +8cfa e6cf +8cfb e6d0 +8cfc 8d77 +8cfd e6ce +8d04 e6d1 +8d05 e6d2 +8d07 e6d4 +8d08 91a1 +8d0a e6d3 +8d0b 8ae4 +8d0d e6d6 +8d0f e6d5 +8d10 e6d7 +8d12 fbaf +8d13 e6d9 +8d14 e6db +8d16 e6dc +8d64 90d4 +8d66 8ecd +8d67 e6dd +8d6b 8a71 +8d6d e6de +8d70 9196 +8d71 e6df +8d73 e6e0 +8d74 958b +8d76 fbb0 +8d77 8b4e +8d81 e6e1 +8d85 92b4 +8d8a 897a +8d99 e6e2 +8da3 8eef +8da8 9096 +8db3 91ab +8dba e6e5 +8dbe e6e4 +8dc2 e6e3 +8dcb e6eb +8dcc e6e9 +8dcf e6e6 +8dd6 e6e8 +8dda e6e7 +8ddb e6ea +8ddd 8b97 +8ddf e6ee +8de1 90d5 +8de3 e6ef +8de8 8cd7 +8dea e6ec +8deb e6ed +8def 9848 +8df3 92b5 +8df5 9148 +8dfc e6f0 +8dff e6f3 +8e08 e6f1 +8e09 e6f2 +8e0a 9778 +8e0f 93a5 +8e10 e6f6 +8e1d e6f4 +8e1e e6f5 +8e1f e6f7 +8e2a e748 +8e30 e6fa +8e34 e6fb +8e35 e6f9 +8e42 e6f8 +8e44 92fb +8e47 e740 +8e48 e744 +8e49 e741 +8e4a e6fc +8e4c e742 +8e50 e743 +8e55 e74a +8e59 e745 +8e5f 90d6 +8e60 e747 +8e63 e749 +8e64 e746 +8e72 e74c +8e74 8f52 +8e76 e74b +8e7c e74d +8e81 e74e +8e84 e751 +8e85 e750 +8e87 e74f +8e8a e753 +8e8b e752 +8e8d 96f4 +8e91 e755 +8e93 e754 +8e94 e756 +8e99 e757 +8ea1 e759 +8eaa e758 +8eab 9067 +8eac e75a +8eaf 8beb +8eb0 e75b +8eb1 e75d +8ebe e75e +8ec5 e75f +8ec6 e75c +8ec8 e760 +8eca 8ed4 +8ecb e761 +8ecc 8b4f +8ecd 8c52 +8ecf fbb2 +8ed2 8cac +8edb e762 +8edf 93ee +8ee2 935d +8ee3 e763 +8eeb e766 +8ef8 8eb2 +8efb e765 +8efc e764 +8efd 8c79 +8efe e767 +8f03 8a72 +8f05 e769 +8f09 8dda +8f0a e768 +8f0c e771 +8f12 e76b +8f13 e76d +8f14 95e3 +8f15 e76a +8f19 e76c +8f1b e770 +8f1c e76e +8f1d 8b50 +8f1f e76f +8f26 e772 +8f29 9479 +8f2a 97d6 +8f2f 8f53 +8f33 e773 +8f38 9741 +8f39 e775 +8f3b e774 +8f3e e778 +8f3f 9760 +8f42 e777 +8f44 8a8d +8f45 e776 +8f46 e77b +8f49 e77a +8f4c e779 +8f4d 9351 +8f4e e77c +8f57 e77d +8f5c e77e +8f5f 8d8c +8f61 8c44 +8f62 e780 +8f63 e781 +8f64 e782 +8f9b 9068 +8f9c e783 +8f9e 8eab +8f9f e784 +8fa3 e785 +8fa7 999f +8fa8 999e +8fad e786 +8fae e390 +8faf e787 +8fb0 9243 +8fb1 904a +8fb2 945f +8fb7 e788 +8fba 95d3 +8fbb 92d2 +8fbc 8d9e +8fbf 9248 +8fc2 8949 +8fc4 9698 +8fc5 9076 +8fce 8c7d +8fd1 8bdf +8fd4 95d4 +8fda e789 +8fe2 e78b +8fe5 e78a +8fe6 89de +8fe9 93f4 +8fea e78c +8feb 9497 +8fed 9352 +8fef e78d +8ff0 8f71 +8ff4 e78f +8ff7 96c0 +8ff8 e79e +8ff9 e791 +8ffa e792 +8ffd 92c7 +9000 91de +9001 9197 +9003 93a6 +9005 e790 +9006 8b74 +900b e799 +900d e796 +900e e7a3 +900f 93a7 +9010 9280 +9011 e793 +9013 92fc +9014 9372 +9015 e794 +9016 e798 +9017 9080 +9019 9487 +901a 92ca +901d 90c0 +901e e797 +901f 91ac +9020 91a2 +9021 e795 +9022 88a7 +9023 9841 +9027 e79a +902e 91df +9031 8f54 +9032 9069 +9035 e79c +9036 e79b +9038 88ed +9039 e79d +903c 954e +903e e7a5 +9041 93d9 +9042 908b +9045 9278 +9047 8bf6 +9049 e7a4 +904a 9756 +904b 895e +904d 95d5 +904e 89df +904f e79f +9050 e7a0 +9051 e7a1 +9052 e7a2 +9053 93b9 +9054 9242 +9055 88e1 +9056 e7a6 +9058 e7a7 +9059 eaa1 +905c 91bb +905e e7a8 +9060 8993 +9061 916b +9063 8cad +9065 9779 +9067 fbb5 +9068 e7a9 +9069 934b +906d 9198 +906e 8ed5 +906f e7aa +9072 e7ad +9075 8f85 +9076 e7ab +9077 914a +9078 9149 +907a 88e2 +907c 97c9 +907d e7af +907f 94f0 +9080 e7b1 +9081 e7b0 +9082 e7ae +9083 e284 +9084 8ad2 +9087 e78e +9089 e7b3 +908a e7b2 +908f e7b4 +9091 9757 +90a3 93df +90a6 964d +90a8 e7b5 +90aa 8ed7 +90af e7b6 +90b1 e7b7 +90b5 e7b8 +90b8 9340 +90c1 88e8 +90ca 8d78 +90ce 9859 +90db e7bc +90de fbb6 +90e1 8c53 +90e2 e7b9 +90e4 e7ba +90e8 9594 +90ed 8a73 +90f5 9758 +90f7 8bbd +90fd 9373 +9102 e7bd +9112 e7be +9115 fbb8 +9119 e7bf +9127 fbb9 +912d 9341 +9130 e7c1 +9132 e7c0 +9149 93d1 +914a e7c2 +914b 8f55 +914c 8ede +914d 947a +914e 9291 +9152 8ef0 +9154 908c +9156 e7c3 +9158 e7c4 +9162 907c +9163 e7c5 +9165 e7c6 +9169 e7c7 +916a 978f +916c 8f56 +9172 e7c9 +9173 e7c8 +9175 8d79 +9177 8d93 +9178 8e5f +9182 e7cc +9187 8f86 +9189 e7cb +918b e7ca +918d 91e7 +9190 8ced +9192 90c1 +9197 94ae +919c 8f58 +91a2 e7cd +91a4 8fdd +91aa e7d0 +91ab e7ce +91af e7cf +91b4 e7d2 +91b5 e7d1 +91b8 8ff8 +91ba e7d3 +91c0 e7d4 +91c1 e7d5 +91c6 94ce +91c7 8dd1 +91c8 8edf +91c9 e7d6 +91cb e7d7 +91cc 97a2 +91cd 8f64 +91ce 96ec +91cf 97ca +91d0 e7d8 +91d1 8be0 +91d6 e7d9 +91d7 fbbb +91d8 9342 +91da fbba +91db e7dc +91dc 8a98 +91dd 906a +91de fbbc +91df e7da +91e1 e7db +91e3 92de +91e4 fbbf +91e5 fbc0 +91e6 9674 +91e7 8bfa +91ed fbbd +91ee fbbe +91f5 e7de +91f6 e7df +91fc e7dd +91ff e7e1 +9206 fbc1 +920a fbc3 +920d 93dd +920e 8a62 +9210 fbc2 +9211 e7e5 +9214 e7e2 +9215 e7e4 +921e e7e0 +9229 e86e +922c e7e3 +9234 97e9 +9237 8cd8 +9239 fbca +923a fbc4 +923c fbc6 +923f e7ed +9240 fbc5 +9244 9353 +9245 e7e8 +9248 e7eb +9249 e7e9 +924b e7ee +924e fbc7 +9250 e7ef +9251 fbc9 +9257 e7e7 +9259 fbc8 +925a e7f4 +925b 8994 +925e e7e6 +9262 94ab +9264 e7ea +9266 8fde +9267 fbcb +9271 8d7a +9277 fbcd +9278 fbce +927e 9667 +9280 8be2 +9283 8f65 +9285 93ba +9288 fa5f +9291 914c +9293 e7f2 +9295 e7ec +9296 e7f1 +9298 96c1 +929a 92b6 +929b e7f3 +929c e7f0 +92a7 fbcc +92ad 914b +92b7 e7f7 +92b9 e7f6 +92cf e7f5 +92d0 fbd2 +92d2 964e +92d3 fbd6 +92d5 fbd4 +92d7 fbd0 +92d9 fbd1 +92e0 fbd5 +92e4 8f9b +92e7 fbcf +92e9 e7f8 +92ea 95dd +92ed 8973 +92f2 9565 +92f3 9292 +92f8 8b98 +92f9 fa65 +92fa e7fa +92fb fbd9 +92fc 8d7c +92ff fbdc +9302 fbde +9306 8e4b +930f e7f9 +9310 908d +9318 908e +9319 e840 +931a e842 +931d fbdd +931e fbdb +9320 8ff9 +9321 fbd8 +9322 e841 +9323 e843 +9325 fbd7 +9326 8bd1 +9328 9564 +932b 8ee0 +932c 9842 +932e e7fc +932f 8df6 +9332 985e +9335 e845 +933a e844 +933b e846 +9344 e7fb +9348 fa5e +934b 93e7 +934d 9374 +9354 92d5 +9356 e84b +9357 fbe0 +935b 9262 +935c e847 +9360 e848 +936c 8c4c +936e e84a +9370 fbdf +9375 8cae +937c e849 +937e 8fdf +938c 8a99 +9394 e84f +9396 8dbd +9397 9199 +939a 92c8 +93a4 fbe1 +93a7 8a5a +93ac e84d +93ad e84e +93ae 92c1 +93b0 e84c +93b9 e850 +93c3 e856 +93c6 fbe2 +93c8 e859 +93d0 e858 +93d1 934c +93d6 e851 +93d7 e852 +93d8 e855 +93dd e857 +93de fbe3 +93e1 8bbe +93e4 e85a +93e5 e854 +93e8 e853 +93f8 fbe4 +9403 e85e +9407 e85f +9410 e860 +9413 e85d +9414 e85c +9418 8fe0 +9419 93a8 +941a e85b +9421 e864 +942b e862 +9431 fbe5 +9435 e863 +9436 e861 +9438 91f6 +943a e865 +9441 e866 +9444 e868 +9445 fbe6 +9448 fbe7 +9451 8ad3 +9452 e867 +9453 96f8 +945a e873 +945b e869 +945e e86c +9460 e86a +9462 e86b +946a e86d +9470 e86f +9475 e870 +9477 e871 +947c e874 +947d e872 +947e e875 +947f e877 +9481 e876 +9577 92b7 +9580 96e5 +9582 e878 +9583 914d +9587 e879 +9589 95c2 +958a e87a +958b 8a4a +958f 895b +9591 8ad5 +9592 fbe8 +9593 8ad4 +9594 e87b +9596 e87c +9598 e87d +9599 e87e +95a0 e880 +95a2 8ad6 +95a3 8a74 +95a4 8d7d +95a5 94b4 +95a7 e882 +95a8 e881 +95ad e883 +95b2 897b +95b9 e886 +95bb e885 +95bc e884 +95be e887 +95c3 e88a +95c7 88c5 +95ca e888 +95cc e88c +95cd e88b +95d4 e88e +95d5 e88d +95d6 e88f +95d8 93ac +95dc e890 +95e1 e891 +95e2 e893 +95e5 e892 +961c 958c +9621 e894 +9628 e895 +962a 8de3 +962e e896 +962f e897 +9632 9668 +963b 916a +963f 88a2 +9640 91c9 +9642 e898 +9644 958d +964b e89b +964c e899 +964d 8d7e +964f e89a +9650 8cc0 +965b 95c3 +965c e89d +965d e89f +965e e89e +965f e8a0 +9662 8940 +9663 9077 +9664 8f9c +9665 8ad7 +9666 e8a1 +966a 9486 +966c e8a3 +9670 8941 +9672 e8a2 +9673 92c2 +9675 97cb +9676 93a9 +9677 e89c +9678 97a4 +967a 8caf +967d 977a +9685 8bf7 +9686 97b2 +9688 8c47 +968a 91e0 +968b e440 +968d e8a4 +968e 8a4b +968f 908f +9694 8a75 +9695 e8a6 +9697 e8a7 +9698 e8a5 +9699 8c84 +969b 8ddb +969c 8fe1 +969d fbeb +96a0 8942 +96a3 97d7 +96a7 e8a9 +96a8 e7ac +96aa e8a8 +96af fbec +96b0 e8ac +96b1 e8aa +96b2 e8ab +96b4 e8ad +96b6 e8ae +96b7 97ea +96b8 e8af +96b9 e8b0 +96bb 90c7 +96bc 94b9 +96c0 909d +96c1 8ae5 +96c4 9759 +96c5 89eb +96c6 8f57 +96c7 8cd9 +96c9 e8b3 +96cb e8b2 +96cc 8e93 +96cd e8b4 +96ce e8b1 +96d1 8e47 +96d5 e8b8 +96d6 e5ab +96d9 99d4 +96db 9097 +96dc e8b6 +96e2 97a3 +96e3 93ef +96e8 894a +96ea 90e1 +96eb 8eb4 +96f0 95b5 +96f2 895f +96f6 97eb +96f7 978b +96f9 e8b9 +96fb 9364 +9700 8ef9 +9704 e8ba +9706 e8bb +9707 906b +9708 e8bc +970a 97ec +970d e8b7 +970e e8be +970f e8c0 +9711 e8bf +9713 e8bd +9716 e8c1 +9719 e8c2 +971c 919a +971e 89e0 +9724 e8c3 +9727 96b6 +972a e8c4 +9730 e8c5 +9732 9849 +9733 fbed +9738 9e50 +9739 e8c6 +973b fbee +973d e8c7 +973e e8c8 +9742 e8cc +9743 fbef +9744 e8c9 +9746 e8ca +9748 e8cb +9749 e8cd +974d fbf0 +974f fbf1 +9751 fbf2 +9752 90c2 +9755 fbf3 +9756 96f5 +9759 90c3 +975c e8ce +975e 94f1 +9760 e8cf +9761 ea72 +9762 96ca +9764 e8d0 +9766 e8d1 +9768 e8d2 +9769 8a76 +976b e8d4 +976d 9078 +9771 e8d5 +9774 8c43 +9779 e8d6 +977a e8da +977c e8d8 +9781 e8d9 +9784 8a93 +9785 e8d7 +9786 e8db +978b e8dc +978d 88c6 +978f e8dd +9790 e8de +9798 8fe2 +979c e8df +97a0 8b66 +97a3 e8e2 +97a6 e8e1 +97a8 e8e0 +97ab e691 +97ad 95da +97b3 e8e3 +97b4 e8e4 +97c3 e8e5 +97c6 e8e6 +97c8 e8e7 +97cb e8e8 +97d3 8ad8 +97dc e8e9 +97ed e8ea +97ee 9442 +97f2 e8ec +97f3 89b9 +97f5 e8ef +97f6 e8ee +97fb 8943 +97ff 8bbf +9801 95c5 +9802 92b8 +9803 8da0 +9805 8d80 +9806 8f87 +9808 907b +980c e8f1 +980f e8f0 +9810 9761 +9811 8ae6 +9812 94d0 +9813 93da +9817 909c +9818 97cc +981a 8c7a +9821 e8f4 +9824 e8f3 +982c 966a +982d 93aa +9834 896f +9837 e8f5 +9838 e8f2 +983b 9570 +983c 978a +983d e8f6 +9846 e8f7 +984b e8f9 +984c 91e8 +984d 8a7a +984e 8a7b +984f e8f8 +9854 8ae7 +9855 8cb0 +9857 fbf4 +9858 8ae8 +985b 935e +985e 97de +9865 fbf5 +9867 8cda +986b e8fa +986f e8fb +9870 e8fc +9871 e940 +9873 e942 +9874 e941 +98a8 9597 +98aa e943 +98af e944 +98b1 e945 +98b6 e946 +98c3 e948 +98c4 e947 +98c6 e949 +98db 94f2 +98dc e3ca +98df 9048 +98e2 8b51 +98e9 e94a +98eb e94b +98ed 99aa +98ee 9f5a +98ef 94d1 +98f2 88f9 +98f4 88b9 +98fc 8e94 +98fd 964f +98fe 8ffc +9903 e94c +9905 96dd +9909 e94d +990a 977b +990c 8961 +9910 8e60 +9912 e94e +9913 89ec +9914 e94f +9918 e950 +991d e952 +991e e953 +9920 e955 +9921 e951 +9924 e954 +9927 fbf8 +9928 8ad9 +992c e956 +992e e957 +993d e958 +993e e959 +9942 e95a +9945 e95c +9949 e95b +994b e95e +994c e961 +9950 e95d +9951 e95f +9952 e960 +9955 e962 +9957 8bc0 +9996 8ef1 +9997 e963 +9998 e964 +9999 8d81 +999e fbfa +99a5 e965 +99a8 8a5d +99ac 946e +99ad e966 +99ae e967 +99b3 9279 +99b4 93e9 +99bc e968 +99c1 949d +99c4 91ca +99c5 8977 +99c6 8bec +99c8 8bed +99d0 9293 +99d1 e96d +99d2 8bee +99d5 89ed +99d8 e96c +99db e96a +99dd e96b +99df e969 +99e2 e977 +99ed e96e +99ee e96f +99f1 e970 +99f2 e971 +99f8 e973 +99fb e972 +99ff 8f78 +9a01 e974 +9a05 e976 +9a0e 8b52 +9a0f e975 +9a12 919b +9a13 8cb1 +9a19 e978 +9a28 91cb +9a2b e979 +9a30 93ab +9a37 e97a +9a3e e980 +9a40 e97d +9a42 e97c +9a43 e97e +9a45 e97b +9a4d e982 +9a4e fbfb +9a55 e981 +9a57 e984 +9a5a 8bc1 +9a5b e983 +9a5f e985 +9a62 e986 +9a64 e988 +9a65 e987 +9a69 e989 +9a6a e98b +9a6b e98a +9aa8 8d9c +9aad e98c +9ab0 e98d +9ab8 8a5b +9abc e98e +9ac0 e98f +9ac4 9091 +9acf e990 +9ad1 e991 +9ad3 e992 +9ad4 e993 +9ad8 8d82 +9ad9 fbfc +9adc fc40 +9ade e994 +9adf e995 +9ae2 e996 +9ae3 e997 +9ae6 e998 +9aea 94af +9aeb e99a +9aed 9545 +9aee e99b +9aef e999 +9af1 e99d +9af4 e99c +9af7 e99e +9afb e99f +9b06 e9a0 +9b18 e9a1 +9b1a e9a2 +9b1f e9a3 +9b22 e9a4 +9b23 e9a5 +9b25 e9a6 +9b27 e9a7 +9b28 e9a8 +9b29 e9a9 +9b2a e9aa +9b2e e9ab +9b2f e9ac +9b31 9f54 +9b32 e9ad +9b3b e2f6 +9b3c 8b53 +9b41 8a40 +9b42 8db0 +9b43 e9af +9b44 e9ae +9b45 96a3 +9b4d e9b1 +9b4e e9b2 +9b4f e9b0 +9b51 e9b3 +9b54 9682 +9b58 e9b4 +9b5a 8b9b +9b6f 9844 +9b72 fc42 +9b74 e9b5 +9b75 fc41 +9b83 e9b7 +9b8e 88bc +9b8f fc43 +9b91 e9b8 +9b92 95a9 +9b93 e9b6 +9b96 e9b9 +9b97 e9ba +9b9f e9bb +9ba0 e9bc +9ba8 e9bd +9baa 968e +9bab 8e4c +9bad 8df8 +9bae 914e +9bb1 fc44 +9bb4 e9be +9bb9 e9c1 +9bbb fc45 +9bc0 e9bf +9bc6 e9c2 +9bc9 8cef +9bca e9c0 +9bcf e9c3 +9bd1 e9c4 +9bd2 e9c5 +9bd4 e9c9 +9bd6 8e49 +9bdb 91e2 +9be1 e9ca +9be2 e9c7 +9be3 e9c6 +9be4 e9c8 +9be8 8c7e +9bf0 e9ce +9bf1 e9cd +9bf2 e9cc +9bf5 88b1 +9c00 fc46 +9c04 e9d8 +9c06 e9d4 +9c08 e9d5 +9c09 e9d1 +9c0a e9d7 +9c0c e9d3 +9c0d 8a82 +9c10 986b +9c12 e9d6 +9c13 e9d2 +9c14 e9d0 +9c15 e9cf +9c1b e9da +9c21 e9dd +9c24 e9dc +9c25 e9db +9c2d 9568 +9c2e e9d9 +9c2f 88f1 +9c30 e9de +9c32 e9e0 +9c39 8a8f +9c3a e9cb +9c3b 8956 +9c3e e9e2 +9c46 e9e1 +9c47 e9df +9c48 924c +9c52 9690 +9c57 97d8 +9c5a e9e3 +9c60 e9e4 +9c67 e9e5 +9c76 e9e6 +9c78 e9e7 +9ce5 92b9 +9ce7 e9e8 +9ce9 94b5 +9ceb e9ed +9cec e9e9 +9cf0 e9ea +9cf3 9650 +9cf4 96c2 +9cf6 93ce +9d03 e9ee +9d06 e9ef +9d07 93bc +9d08 e9ec +9d09 e9eb +9d0e 89a8 +9d12 e9f7 +9d15 e9f6 +9d1b 8995 +9d1f e9f4 +9d23 e9f3 +9d26 e9f1 +9d28 8a9b +9d2a e9f0 +9d2b 8eb0 +9d2c 89a7 +9d3b 8d83 +9d3e e9fa +9d3f e9f9 +9d41 e9f8 +9d44 e9f5 +9d46 e9fb +9d48 e9fc +9d50 ea44 +9d51 ea43 +9d59 ea45 +9d5c 894c +9d5d ea40 +9d5e ea41 +9d60 8d94 +9d61 96b7 +9d64 ea42 +9d6b fc48 +9d6c 9651 +9d6f ea4a +9d70 fc47 +9d72 ea46 +9d7a ea4b +9d87 ea48 +9d89 ea47 +9d8f 8c7b +9d9a ea4c +9da4 ea4d +9da9 ea4e +9dab ea49 +9daf e9f2 +9db2 ea4f +9db4 92df +9db8 ea53 +9dba ea54 +9dbb ea52 +9dc1 ea51 +9dc2 ea57 +9dc4 ea50 +9dc6 ea55 +9dcf ea56 +9dd3 ea59 +9dd9 ea58 +9de6 ea5b +9ded ea5c +9def ea5d +9df2 9868 +9df8 ea5a +9df9 91e9 +9dfa 8deb +9dfd ea5e +9e19 fc4a +9e1a ea5f +9e1b ea60 +9e1e ea61 +9e75 ea62 +9e78 8cb2 +9e79 ea63 +9e7d ea64 +9e7f 8ead +9e81 ea65 +9e88 ea66 +9e8b ea67 +9e8c ea68 +9e91 ea6b +9e92 ea69 +9e93 985b +9e95 ea6a +9e97 97ed +9e9d ea6c +9e9f 97d9 +9ea5 ea6d +9ea6 949e +9ea9 ea6e +9eaa ea70 +9ead ea71 +9eb8 ea6f +9eb9 8d8d +9eba 96cb +9ebb 9683 +9ebc 9bf5 +9ebe 9f80 +9ebf 969b +9ec4 89a9 +9ecc ea73 +9ecd 8b6f +9ece ea74 +9ecf ea75 +9ed0 ea76 +9ed1 fc4b +9ed2 8d95 +9ed4 ea77 +9ed8 e0d2 +9ed9 96d9 +9edb 91e1 +9edc ea78 +9edd ea7a +9ede ea79 +9ee0 ea7b +9ee5 ea7c +9ee8 ea7d +9eef ea7e +9ef4 ea80 +9ef6 ea81 +9ef7 ea82 +9ef9 ea83 +9efb ea84 +9efc ea85 +9efd ea86 +9f07 ea87 +9f08 ea88 +9f0e 9343 +9f13 8cdb +9f15 ea8a +9f20 916c +9f21 ea8b +9f2c ea8c +9f3b 9540 +9f3e ea8d +9f4a ea8e +9f4b e256 +9f4e e6d8 +9f4f e8eb +9f52 ea8f +9f54 ea90 +9f5f ea92 +9f60 ea93 +9f61 ea94 +9f62 97ee +9f63 ea91 +9f66 ea95 +9f67 ea96 +9f6a ea98 +9f6c ea97 +9f72 ea9a +9f76 ea9b +9f77 ea99 +9f8d 97b4 +9f95 ea9c +9f9c ea9d +9f9d e273 +9fa0 ea9e +e000 f040 +e001 f041 +e002 f042 +e003 f043 +e004 f044 +e005 f045 +e006 f046 +e007 f047 +e008 f048 +e009 f049 +e00a f04a +e00b f04b +e00c f04c +e00d f04d +e00e f04e +e00f f04f +e010 f050 +e011 f051 +e012 f052 +e013 f053 +e014 f054 +e015 f055 +e016 f056 +e017 f057 +e018 f058 +e019 f059 +e01a f05a +e01b f05b +e01c f05c +e01d f05d +e01e f05e +e01f f05f +e020 f060 +e021 f061 +e022 f062 +e023 f063 +e024 f064 +e025 f065 +e026 f066 +e027 f067 +e028 f068 +e029 f069 +e02a f06a +e02b f06b +e02c f06c +e02d f06d +e02e f06e +e02f f06f +e030 f070 +e031 f071 +e032 f072 +e033 f073 +e034 f074 +e035 f075 +e036 f076 +e037 f077 +e038 f078 +e039 f079 +e03a f07a +e03b f07b +e03c f07c +e03d f07d +e03e f07e +e03f f080 +e040 f081 +e041 f082 +e042 f083 +e043 f084 +e044 f085 +e045 f086 +e046 f087 +e047 f088 +e048 f089 +e049 f08a +e04a f08b +e04b f08c +e04c f08d +e04d f08e +e04e f08f +e04f f090 +e050 f091 +e051 f092 +e052 f093 +e053 f094 +e054 f095 +e055 f096 +e056 f097 +e057 f098 +e058 f099 +e059 f09a +e05a f09b +e05b f09c +e05c f09d +e05d f09e +e05e f09f +e05f f0a0 +e060 f0a1 +e061 f0a2 +e062 f0a3 +e063 f0a4 +e064 f0a5 +e065 f0a6 +e066 f0a7 +e067 f0a8 +e068 f0a9 +e069 f0aa +e06a f0ab +e06b f0ac +e06c f0ad +e06d f0ae +e06e f0af +e06f f0b0 +e070 f0b1 +e071 f0b2 +e072 f0b3 +e073 f0b4 +e074 f0b5 +e075 f0b6 +e076 f0b7 +e077 f0b8 +e078 f0b9 +e079 f0ba +e07a f0bb +e07b f0bc +e07c f0bd +e07d f0be +e07e f0bf +e07f f0c0 +e080 f0c1 +e081 f0c2 +e082 f0c3 +e083 f0c4 +e084 f0c5 +e085 f0c6 +e086 f0c7 +e087 f0c8 +e088 f0c9 +e089 f0ca +e08a f0cb +e08b f0cc +e08c f0cd +e08d f0ce +e08e f0cf +e08f f0d0 +e090 f0d1 +e091 f0d2 +e092 f0d3 +e093 f0d4 +e094 f0d5 +e095 f0d6 +e096 f0d7 +e097 f0d8 +e098 f0d9 +e099 f0da +e09a f0db +e09b f0dc +e09c f0dd +e09d f0de +e09e f0df +e09f f0e0 +e0a0 f0e1 +e0a1 f0e2 +e0a2 f0e3 +e0a3 f0e4 +e0a4 f0e5 +e0a5 f0e6 +e0a6 f0e7 +e0a7 f0e8 +e0a8 f0e9 +e0a9 f0ea +e0aa f0eb +e0ab f0ec +e0ac f0ed +e0ad f0ee +e0ae f0ef +e0af f0f0 +e0b0 f0f1 +e0b1 f0f2 +e0b2 f0f3 +e0b3 f0f4 +e0b4 f0f5 +e0b5 f0f6 +e0b6 f0f7 +e0b7 f0f8 +e0b8 f0f9 +e0b9 f0fa +e0ba f0fb +e0bb f0fc +e0bc f140 +e0bd f141 +e0be f142 +e0bf f143 +e0c0 f144 +e0c1 f145 +e0c2 f146 +e0c3 f147 +e0c4 f148 +e0c5 f149 +e0c6 f14a +e0c7 f14b +e0c8 f14c +e0c9 f14d +e0ca f14e +e0cb f14f +e0cc f150 +e0cd f151 +e0ce f152 +e0cf f153 +e0d0 f154 +e0d1 f155 +e0d2 f156 +e0d3 f157 +e0d4 f158 +e0d5 f159 +e0d6 f15a +e0d7 f15b +e0d8 f15c +e0d9 f15d +e0da f15e +e0db f15f +e0dc f160 +e0dd f161 +e0de f162 +e0df f163 +e0e0 f164 +e0e1 f165 +e0e2 f166 +e0e3 f167 +e0e4 f168 +e0e5 f169 +e0e6 f16a +e0e7 f16b +e0e8 f16c +e0e9 f16d +e0ea f16e +e0eb f16f +e0ec f170 +e0ed f171 +e0ee f172 +e0ef f173 +e0f0 f174 +e0f1 f175 +e0f2 f176 +e0f3 f177 +e0f4 f178 +e0f5 f179 +e0f6 f17a +e0f7 f17b +e0f8 f17c +e0f9 f17d +e0fa f17e +e0fb f180 +e0fc f181 +e0fd f182 +e0fe f183 +e0ff f184 +e100 f185 +e101 f186 +e102 f187 +e103 f188 +e104 f189 +e105 f18a +e106 f18b +e107 f18c +e108 f18d +e109 f18e +e10a f18f +e10b f190 +e10c f191 +e10d f192 +e10e f193 +e10f f194 +e110 f195 +e111 f196 +e112 f197 +e113 f198 +e114 f199 +e115 f19a +e116 f19b +e117 f19c +e118 f19d +e119 f19e +e11a f19f +e11b f1a0 +e11c f1a1 +e11d f1a2 +e11e f1a3 +e11f f1a4 +e120 f1a5 +e121 f1a6 +e122 f1a7 +e123 f1a8 +e124 f1a9 +e125 f1aa +e126 f1ab +e127 f1ac +e128 f1ad +e129 f1ae +e12a f1af +e12b f1b0 +e12c f1b1 +e12d f1b2 +e12e f1b3 +e12f f1b4 +e130 f1b5 +e131 f1b6 +e132 f1b7 +e133 f1b8 +e134 f1b9 +e135 f1ba +e136 f1bb +e137 f1bc +e138 f1bd +e139 f1be +e13a f1bf +e13b f1c0 +e13c f1c1 +e13d f1c2 +e13e f1c3 +e13f f1c4 +e140 f1c5 +e141 f1c6 +e142 f1c7 +e143 f1c8 +e144 f1c9 +e145 f1ca +e146 f1cb +e147 f1cc +e148 f1cd +e149 f1ce +e14a f1cf +e14b f1d0 +e14c f1d1 +e14d f1d2 +e14e f1d3 +e14f f1d4 +e150 f1d5 +e151 f1d6 +e152 f1d7 +e153 f1d8 +e154 f1d9 +e155 f1da +e156 f1db +e157 f1dc +e158 f1dd +e159 f1de +e15a f1df +e15b f1e0 +e15c f1e1 +e15d f1e2 +e15e f1e3 +e15f f1e4 +e160 f1e5 +e161 f1e6 +e162 f1e7 +e163 f1e8 +e164 f1e9 +e165 f1ea +e166 f1eb +e167 f1ec +e168 f1ed +e169 f1ee +e16a f1ef +e16b f1f0 +e16c f1f1 +e16d f1f2 +e16e f1f3 +e16f f1f4 +e170 f1f5 +e171 f1f6 +e172 f1f7 +e173 f1f8 +e174 f1f9 +e175 f1fa +e176 f1fb +e177 f1fc +e178 f240 +e179 f241 +e17a f242 +e17b f243 +e17c f244 +e17d f245 +e17e f246 +e17f f247 +e180 f248 +e181 f249 +e182 f24a +e183 f24b +e184 f24c +e185 f24d +e186 f24e +e187 f24f +e188 f250 +e189 f251 +e18a f252 +e18b f253 +e18c f254 +e18d f255 +e18e f256 +e18f f257 +e190 f258 +e191 f259 +e192 f25a +e193 f25b +e194 f25c +e195 f25d +e196 f25e +e197 f25f +e198 f260 +e199 f261 +e19a f262 +e19b f263 +e19c f264 +e19d f265 +e19e f266 +e19f f267 +e1a0 f268 +e1a1 f269 +e1a2 f26a +e1a3 f26b +e1a4 f26c +e1a5 f26d +e1a6 f26e +e1a7 f26f +e1a8 f270 +e1a9 f271 +e1aa f272 +e1ab f273 +e1ac f274 +e1ad f275 +e1ae f276 +e1af f277 +e1b0 f278 +e1b1 f279 +e1b2 f27a +e1b3 f27b +e1b4 f27c +e1b5 f27d +e1b6 f27e +e1b7 f280 +e1b8 f281 +e1b9 f282 +e1ba f283 +e1bb f284 +e1bc f285 +e1bd f286 +e1be f287 +e1bf f288 +e1c0 f289 +e1c1 f28a +e1c2 f28b +e1c3 f28c +e1c4 f28d +e1c5 f28e +e1c6 f28f +e1c7 f290 +e1c8 f291 +e1c9 f292 +e1ca f293 +e1cb f294 +e1cc f295 +e1cd f296 +e1ce f297 +e1cf f298 +e1d0 f299 +e1d1 f29a +e1d2 f29b +e1d3 f29c +e1d4 f29d +e1d5 f29e +e1d6 f29f +e1d7 f2a0 +e1d8 f2a1 +e1d9 f2a2 +e1da f2a3 +e1db f2a4 +e1dc f2a5 +e1dd f2a6 +e1de f2a7 +e1df f2a8 +e1e0 f2a9 +e1e1 f2aa +e1e2 f2ab +e1e3 f2ac +e1e4 f2ad +e1e5 f2ae +e1e6 f2af +e1e7 f2b0 +e1e8 f2b1 +e1e9 f2b2 +e1ea f2b3 +e1eb f2b4 +e1ec f2b5 +e1ed f2b6 +e1ee f2b7 +e1ef f2b8 +e1f0 f2b9 +e1f1 f2ba +e1f2 f2bb +e1f3 f2bc +e1f4 f2bd +e1f5 f2be +e1f6 f2bf +e1f7 f2c0 +e1f8 f2c1 +e1f9 f2c2 +e1fa f2c3 +e1fb f2c4 +e1fc f2c5 +e1fd f2c6 +e1fe f2c7 +e1ff f2c8 +e200 f2c9 +e201 f2ca +e202 f2cb +e203 f2cc +e204 f2cd +e205 f2ce +e206 f2cf +e207 f2d0 +e208 f2d1 +e209 f2d2 +e20a f2d3 +e20b f2d4 +e20c f2d5 +e20d f2d6 +e20e f2d7 +e20f f2d8 +e210 f2d9 +e211 f2da +e212 f2db +e213 f2dc +e214 f2dd +e215 f2de +e216 f2df +e217 f2e0 +e218 f2e1 +e219 f2e2 +e21a f2e3 +e21b f2e4 +e21c f2e5 +e21d f2e6 +e21e f2e7 +e21f f2e8 +e220 f2e9 +e221 f2ea +e222 f2eb +e223 f2ec +e224 f2ed +e225 f2ee +e226 f2ef +e227 f2f0 +e228 f2f1 +e229 f2f2 +e22a f2f3 +e22b f2f4 +e22c f2f5 +e22d f2f6 +e22e f2f7 +e22f f2f8 +e230 f2f9 +e231 f2fa +e232 f2fb +e233 f2fc +e234 f340 +e235 f341 +e236 f342 +e237 f343 +e238 f344 +e239 f345 +e23a f346 +e23b f347 +e23c f348 +e23d f349 +e23e f34a +e23f f34b +e240 f34c +e241 f34d +e242 f34e +e243 f34f +e244 f350 +e245 f351 +e246 f352 +e247 f353 +e248 f354 +e249 f355 +e24a f356 +e24b f357 +e24c f358 +e24d f359 +e24e f35a +e24f f35b +e250 f35c +e251 f35d +e252 f35e +e253 f35f +e254 f360 +e255 f361 +e256 f362 +e257 f363 +e258 f364 +e259 f365 +e25a f366 +e25b f367 +e25c f368 +e25d f369 +e25e f36a +e25f f36b +e260 f36c +e261 f36d +e262 f36e +e263 f36f +e264 f370 +e265 f371 +e266 f372 +e267 f373 +e268 f374 +e269 f375 +e26a f376 +e26b f377 +e26c f378 +e26d f379 +e26e f37a +e26f f37b +e270 f37c +e271 f37d +e272 f37e +e273 f380 +e274 f381 +e275 f382 +e276 f383 +e277 f384 +e278 f385 +e279 f386 +e27a f387 +e27b f388 +e27c f389 +e27d f38a +e27e f38b +e27f f38c +e280 f38d +e281 f38e +e282 f38f +e283 f390 +e284 f391 +e285 f392 +e286 f393 +e287 f394 +e288 f395 +e289 f396 +e28a f397 +e28b f398 +e28c f399 +e28d f39a +e28e f39b +e28f f39c +e290 f39d +e291 f39e +e292 f39f +e293 f3a0 +e294 f3a1 +e295 f3a2 +e296 f3a3 +e297 f3a4 +e298 f3a5 +e299 f3a6 +e29a f3a7 +e29b f3a8 +e29c f3a9 +e29d f3aa +e29e f3ab +e29f f3ac +e2a0 f3ad +e2a1 f3ae +e2a2 f3af +e2a3 f3b0 +e2a4 f3b1 +e2a5 f3b2 +e2a6 f3b3 +e2a7 f3b4 +e2a8 f3b5 +e2a9 f3b6 +e2aa f3b7 +e2ab f3b8 +e2ac f3b9 +e2ad f3ba +e2ae f3bb +e2af f3bc +e2b0 f3bd +e2b1 f3be +e2b2 f3bf +e2b3 f3c0 +e2b4 f3c1 +e2b5 f3c2 +e2b6 f3c3 +e2b7 f3c4 +e2b8 f3c5 +e2b9 f3c6 +e2ba f3c7 +e2bb f3c8 +e2bc f3c9 +e2bd f3ca +e2be f3cb +e2bf f3cc +e2c0 f3cd +e2c1 f3ce +e2c2 f3cf +e2c3 f3d0 +e2c4 f3d1 +e2c5 f3d2 +e2c6 f3d3 +e2c7 f3d4 +e2c8 f3d5 +e2c9 f3d6 +e2ca f3d7 +e2cb f3d8 +e2cc f3d9 +e2cd f3da +e2ce f3db +e2cf f3dc +e2d0 f3dd +e2d1 f3de +e2d2 f3df +e2d3 f3e0 +e2d4 f3e1 +e2d5 f3e2 +e2d6 f3e3 +e2d7 f3e4 +e2d8 f3e5 +e2d9 f3e6 +e2da f3e7 +e2db f3e8 +e2dc f3e9 +e2dd f3ea +e2de f3eb +e2df f3ec +e2e0 f3ed +e2e1 f3ee +e2e2 f3ef +e2e3 f3f0 +e2e4 f3f1 +e2e5 f3f2 +e2e6 f3f3 +e2e7 f3f4 +e2e8 f3f5 +e2e9 f3f6 +e2ea f3f7 +e2eb f3f8 +e2ec f3f9 +e2ed f3fa +e2ee f3fb +e2ef f3fc +e2f0 f440 +e2f1 f441 +e2f2 f442 +e2f3 f443 +e2f4 f444 +e2f5 f445 +e2f6 f446 +e2f7 f447 +e2f8 f448 +e2f9 f449 +e2fa f44a +e2fb f44b +e2fc f44c +e2fd f44d +e2fe f44e +e2ff f44f +e300 f450 +e301 f451 +e302 f452 +e303 f453 +e304 f454 +e305 f455 +e306 f456 +e307 f457 +e308 f458 +e309 f459 +e30a f45a +e30b f45b +e30c f45c +e30d f45d +e30e f45e +e30f f45f +e310 f460 +e311 f461 +e312 f462 +e313 f463 +e314 f464 +e315 f465 +e316 f466 +e317 f467 +e318 f468 +e319 f469 +e31a f46a +e31b f46b +e31c f46c +e31d f46d +e31e f46e +e31f f46f +e320 f470 +e321 f471 +e322 f472 +e323 f473 +e324 f474 +e325 f475 +e326 f476 +e327 f477 +e328 f478 +e329 f479 +e32a f47a +e32b f47b +e32c f47c +e32d f47d +e32e f47e +e32f f480 +e330 f481 +e331 f482 +e332 f483 +e333 f484 +e334 f485 +e335 f486 +e336 f487 +e337 f488 +e338 f489 +e339 f48a +e33a f48b +e33b f48c +e33c f48d +e33d f48e +e33e f48f +e33f f490 +e340 f491 +e341 f492 +e342 f493 +e343 f494 +e344 f495 +e345 f496 +e346 f497 +e347 f498 +e348 f499 +e349 f49a +e34a f49b +e34b f49c +e34c f49d +e34d f49e +e34e f49f +e34f f4a0 +e350 f4a1 +e351 f4a2 +e352 f4a3 +e353 f4a4 +e354 f4a5 +e355 f4a6 +e356 f4a7 +e357 f4a8 +e358 f4a9 +e359 f4aa +e35a f4ab +e35b f4ac +e35c f4ad +e35d f4ae +e35e f4af +e35f f4b0 +e360 f4b1 +e361 f4b2 +e362 f4b3 +e363 f4b4 +e364 f4b5 +e365 f4b6 +e366 f4b7 +e367 f4b8 +e368 f4b9 +e369 f4ba +e36a f4bb +e36b f4bc +e36c f4bd +e36d f4be +e36e f4bf +e36f f4c0 +e370 f4c1 +e371 f4c2 +e372 f4c3 +e373 f4c4 +e374 f4c5 +e375 f4c6 +e376 f4c7 +e377 f4c8 +e378 f4c9 +e379 f4ca +e37a f4cb +e37b f4cc +e37c f4cd +e37d f4ce +e37e f4cf +e37f f4d0 +e380 f4d1 +e381 f4d2 +e382 f4d3 +e383 f4d4 +e384 f4d5 +e385 f4d6 +e386 f4d7 +e387 f4d8 +e388 f4d9 +e389 f4da +e38a f4db +e38b f4dc +e38c f4dd +e38d f4de +e38e f4df +e38f f4e0 +e390 f4e1 +e391 f4e2 +e392 f4e3 +e393 f4e4 +e394 f4e5 +e395 f4e6 +e396 f4e7 +e397 f4e8 +e398 f4e9 +e399 f4ea +e39a f4eb +e39b f4ec +e39c f4ed +e39d f4ee +e39e f4ef +e39f f4f0 +e3a0 f4f1 +e3a1 f4f2 +e3a2 f4f3 +e3a3 f4f4 +e3a4 f4f5 +e3a5 f4f6 +e3a6 f4f7 +e3a7 f4f8 +e3a8 f4f9 +e3a9 f4fa +e3aa f4fb +e3ab f4fc +e3ac f540 +e3ad f541 +e3ae f542 +e3af f543 +e3b0 f544 +e3b1 f545 +e3b2 f546 +e3b3 f547 +e3b4 f548 +e3b5 f549 +e3b6 f54a +e3b7 f54b +e3b8 f54c +e3b9 f54d +e3ba f54e +e3bb f54f +e3bc f550 +e3bd f551 +e3be f552 +e3bf f553 +e3c0 f554 +e3c1 f555 +e3c2 f556 +e3c3 f557 +e3c4 f558 +e3c5 f559 +e3c6 f55a +e3c7 f55b +e3c8 f55c +e3c9 f55d +e3ca f55e +e3cb f55f +e3cc f560 +e3cd f561 +e3ce f562 +e3cf f563 +e3d0 f564 +e3d1 f565 +e3d2 f566 +e3d3 f567 +e3d4 f568 +e3d5 f569 +e3d6 f56a +e3d7 f56b +e3d8 f56c +e3d9 f56d +e3da f56e +e3db f56f +e3dc f570 +e3dd f571 +e3de f572 +e3df f573 +e3e0 f574 +e3e1 f575 +e3e2 f576 +e3e3 f577 +e3e4 f578 +e3e5 f579 +e3e6 f57a +e3e7 f57b +e3e8 f57c +e3e9 f57d +e3ea f57e +e3eb f580 +e3ec f581 +e3ed f582 +e3ee f583 +e3ef f584 +e3f0 f585 +e3f1 f586 +e3f2 f587 +e3f3 f588 +e3f4 f589 +e3f5 f58a +e3f6 f58b +e3f7 f58c +e3f8 f58d +e3f9 f58e +e3fa f58f +e3fb f590 +e3fc f591 +e3fd f592 +e3fe f593 +e3ff f594 +e400 f595 +e401 f596 +e402 f597 +e403 f598 +e404 f599 +e405 f59a +e406 f59b +e407 f59c +e408 f59d +e409 f59e +e40a f59f +e40b f5a0 +e40c f5a1 +e40d f5a2 +e40e f5a3 +e40f f5a4 +e410 f5a5 +e411 f5a6 +e412 f5a7 +e413 f5a8 +e414 f5a9 +e415 f5aa +e416 f5ab +e417 f5ac +e418 f5ad +e419 f5ae +e41a f5af +e41b f5b0 +e41c f5b1 +e41d f5b2 +e41e f5b3 +e41f f5b4 +e420 f5b5 +e421 f5b6 +e422 f5b7 +e423 f5b8 +e424 f5b9 +e425 f5ba +e426 f5bb +e427 f5bc +e428 f5bd +e429 f5be +e42a f5bf +e42b f5c0 +e42c f5c1 +e42d f5c2 +e42e f5c3 +e42f f5c4 +e430 f5c5 +e431 f5c6 +e432 f5c7 +e433 f5c8 +e434 f5c9 +e435 f5ca +e436 f5cb +e437 f5cc +e438 f5cd +e439 f5ce +e43a f5cf +e43b f5d0 +e43c f5d1 +e43d f5d2 +e43e f5d3 +e43f f5d4 +e440 f5d5 +e441 f5d6 +e442 f5d7 +e443 f5d8 +e444 f5d9 +e445 f5da +e446 f5db +e447 f5dc +e448 f5dd +e449 f5de +e44a f5df +e44b f5e0 +e44c f5e1 +e44d f5e2 +e44e f5e3 +e44f f5e4 +e450 f5e5 +e451 f5e6 +e452 f5e7 +e453 f5e8 +e454 f5e9 +e455 f5ea +e456 f5eb +e457 f5ec +e458 f5ed +e459 f5ee +e45a f5ef +e45b f5f0 +e45c f5f1 +e45d f5f2 +e45e f5f3 +e45f f5f4 +e460 f5f5 +e461 f5f6 +e462 f5f7 +e463 f5f8 +e464 f5f9 +e465 f5fa +e466 f5fb +e467 f5fc +e468 f640 +e469 f641 +e46a f642 +e46b f643 +e46c f644 +e46d f645 +e46e f646 +e46f f647 +e470 f648 +e471 f649 +e472 f64a +e473 f64b +e474 f64c +e475 f64d +e476 f64e +e477 f64f +e478 f650 +e479 f651 +e47a f652 +e47b f653 +e47c f654 +e47d f655 +e47e f656 +e47f f657 +e480 f658 +e481 f659 +e482 f65a +e483 f65b +e484 f65c +e485 f65d +e486 f65e +e487 f65f +e488 f660 +e489 f661 +e48a f662 +e48b f663 +e48c f664 +e48d f665 +e48e f666 +e48f f667 +e490 f668 +e491 f669 +e492 f66a +e493 f66b +e494 f66c +e495 f66d +e496 f66e +e497 f66f +e498 f670 +e499 f671 +e49a f672 +e49b f673 +e49c f674 +e49d f675 +e49e f676 +e49f f677 +e4a0 f678 +e4a1 f679 +e4a2 f67a +e4a3 f67b +e4a4 f67c +e4a5 f67d +e4a6 f67e +e4a7 f680 +e4a8 f681 +e4a9 f682 +e4aa f683 +e4ab f684 +e4ac f685 +e4ad f686 +e4ae f687 +e4af f688 +e4b0 f689 +e4b1 f68a +e4b2 f68b +e4b3 f68c +e4b4 f68d +e4b5 f68e +e4b6 f68f +e4b7 f690 +e4b8 f691 +e4b9 f692 +e4ba f693 +e4bb f694 +e4bc f695 +e4bd f696 +e4be f697 +e4bf f698 +e4c0 f699 +e4c1 f69a +e4c2 f69b +e4c3 f69c +e4c4 f69d +e4c5 f69e +e4c6 f69f +e4c7 f6a0 +e4c8 f6a1 +e4c9 f6a2 +e4ca f6a3 +e4cb f6a4 +e4cc f6a5 +e4cd f6a6 +e4ce f6a7 +e4cf f6a8 +e4d0 f6a9 +e4d1 f6aa +e4d2 f6ab +e4d3 f6ac +e4d4 f6ad +e4d5 f6ae +e4d6 f6af +e4d7 f6b0 +e4d8 f6b1 +e4d9 f6b2 +e4da f6b3 +e4db f6b4 +e4dc f6b5 +e4dd f6b6 +e4de f6b7 +e4df f6b8 +e4e0 f6b9 +e4e1 f6ba +e4e2 f6bb +e4e3 f6bc +e4e4 f6bd +e4e5 f6be +e4e6 f6bf +e4e7 f6c0 +e4e8 f6c1 +e4e9 f6c2 +e4ea f6c3 +e4eb f6c4 +e4ec f6c5 +e4ed f6c6 +e4ee f6c7 +e4ef f6c8 +e4f0 f6c9 +e4f1 f6ca +e4f2 f6cb +e4f3 f6cc +e4f4 f6cd +e4f5 f6ce +e4f6 f6cf +e4f7 f6d0 +e4f8 f6d1 +e4f9 f6d2 +e4fa f6d3 +e4fb f6d4 +e4fc f6d5 +e4fd f6d6 +e4fe f6d7 +e4ff f6d8 +e500 f6d9 +e501 f6da +e502 f6db +e503 f6dc +e504 f6dd +e505 f6de +e506 f6df +e507 f6e0 +e508 f6e1 +e509 f6e2 +e50a f6e3 +e50b f6e4 +e50c f6e5 +e50d f6e6 +e50e f6e7 +e50f f6e8 +e510 f6e9 +e511 f6ea +e512 f6eb +e513 f6ec +e514 f6ed +e515 f6ee +e516 f6ef +e517 f6f0 +e518 f6f1 +e519 f6f2 +e51a f6f3 +e51b f6f4 +e51c f6f5 +e51d f6f6 +e51e f6f7 +e51f f6f8 +e520 f6f9 +e521 f6fa +e522 f6fb +e523 f6fc +e524 f740 +e525 f741 +e526 f742 +e527 f743 +e528 f744 +e529 f745 +e52a f746 +e52b f747 +e52c f748 +e52d f749 +e52e f74a +e52f f74b +e530 f74c +e531 f74d +e532 f74e +e533 f74f +e534 f750 +e535 f751 +e536 f752 +e537 f753 +e538 f754 +e539 f755 +e53a f756 +e53b f757 +e53c f758 +e53d f759 +e53e f75a +e53f f75b +e540 f75c +e541 f75d +e542 f75e +e543 f75f +e544 f760 +e545 f761 +e546 f762 +e547 f763 +e548 f764 +e549 f765 +e54a f766 +e54b f767 +e54c f768 +e54d f769 +e54e f76a +e54f f76b +e550 f76c +e551 f76d +e552 f76e +e553 f76f +e554 f770 +e555 f771 +e556 f772 +e557 f773 +e558 f774 +e559 f775 +e55a f776 +e55b f777 +e55c f778 +e55d f779 +e55e f77a +e55f f77b +e560 f77c +e561 f77d +e562 f77e +e563 f780 +e564 f781 +e565 f782 +e566 f783 +e567 f784 +e568 f785 +e569 f786 +e56a f787 +e56b f788 +e56c f789 +e56d f78a +e56e f78b +e56f f78c +e570 f78d +e571 f78e +e572 f78f +e573 f790 +e574 f791 +e575 f792 +e576 f793 +e577 f794 +e578 f795 +e579 f796 +e57a f797 +e57b f798 +e57c f799 +e57d f79a +e57e f79b +e57f f79c +e580 f79d +e581 f79e +e582 f79f +e583 f7a0 +e584 f7a1 +e585 f7a2 +e586 f7a3 +e587 f7a4 +e588 f7a5 +e589 f7a6 +e58a f7a7 +e58b f7a8 +e58c f7a9 +e58d f7aa +e58e f7ab +e58f f7ac +e590 f7ad +e591 f7ae +e592 f7af +e593 f7b0 +e594 f7b1 +e595 f7b2 +e596 f7b3 +e597 f7b4 +e598 f7b5 +e599 f7b6 +e59a f7b7 +e59b f7b8 +e59c f7b9 +e59d f7ba +e59e f7bb +e59f f7bc +e5a0 f7bd +e5a1 f7be +e5a2 f7bf +e5a3 f7c0 +e5a4 f7c1 +e5a5 f7c2 +e5a6 f7c3 +e5a7 f7c4 +e5a8 f7c5 +e5a9 f7c6 +e5aa f7c7 +e5ab f7c8 +e5ac f7c9 +e5ad f7ca +e5ae f7cb +e5af f7cc +e5b0 f7cd +e5b1 f7ce +e5b2 f7cf +e5b3 f7d0 +e5b4 f7d1 +e5b5 f7d2 +e5b6 f7d3 +e5b7 f7d4 +e5b8 f7d5 +e5b9 f7d6 +e5ba f7d7 +e5bb f7d8 +e5bc f7d9 +e5bd f7da +e5be f7db +e5bf f7dc +e5c0 f7dd +e5c1 f7de +e5c2 f7df +e5c3 f7e0 +e5c4 f7e1 +e5c5 f7e2 +e5c6 f7e3 +e5c7 f7e4 +e5c8 f7e5 +e5c9 f7e6 +e5ca f7e7 +e5cb f7e8 +e5cc f7e9 +e5cd f7ea +e5ce f7eb +e5cf f7ec +e5d0 f7ed +e5d1 f7ee +e5d2 f7ef +e5d3 f7f0 +e5d4 f7f1 +e5d5 f7f2 +e5d6 f7f3 +e5d7 f7f4 +e5d8 f7f5 +e5d9 f7f6 +e5da f7f7 +e5db f7f8 +e5dc f7f9 +e5dd f7fa +e5de f7fb +e5df f7fc +e5e0 f840 +e5e1 f841 +e5e2 f842 +e5e3 f843 +e5e4 f844 +e5e5 f845 +e5e6 f846 +e5e7 f847 +e5e8 f848 +e5e9 f849 +e5ea f84a +e5eb f84b +e5ec f84c +e5ed f84d +e5ee f84e +e5ef f84f +e5f0 f850 +e5f1 f851 +e5f2 f852 +e5f3 f853 +e5f4 f854 +e5f5 f855 +e5f6 f856 +e5f7 f857 +e5f8 f858 +e5f9 f859 +e5fa f85a +e5fb f85b +e5fc f85c +e5fd f85d +e5fe f85e +e5ff f85f +e600 f860 +e601 f861 +e602 f862 +e603 f863 +e604 f864 +e605 f865 +e606 f866 +e607 f867 +e608 f868 +e609 f869 +e60a f86a +e60b f86b +e60c f86c +e60d f86d +e60e f86e +e60f f86f +e610 f870 +e611 f871 +e612 f872 +e613 f873 +e614 f874 +e615 f875 +e616 f876 +e617 f877 +e618 f878 +e619 f879 +e61a f87a +e61b f87b +e61c f87c +e61d f87d +e61e f87e +e61f f880 +e620 f881 +e621 f882 +e622 f883 +e623 f884 +e624 f885 +e625 f886 +e626 f887 +e627 f888 +e628 f889 +e629 f88a +e62a f88b +e62b f88c +e62c f88d +e62d f88e +e62e f88f +e62f f890 +e630 f891 +e631 f892 +e632 f893 +e633 f894 +e634 f895 +e635 f896 +e636 f897 +e637 f898 +e638 f899 +e639 f89a +e63a f89b +e63b f89c +e63c f89d +e63d f89e +e63e f89f +e63f f8a0 +e640 f8a1 +e641 f8a2 +e642 f8a3 +e643 f8a4 +e644 f8a5 +e645 f8a6 +e646 f8a7 +e647 f8a8 +e648 f8a9 +e649 f8aa +e64a f8ab +e64b f8ac +e64c f8ad +e64d f8ae +e64e f8af +e64f f8b0 +e650 f8b1 +e651 f8b2 +e652 f8b3 +e653 f8b4 +e654 f8b5 +e655 f8b6 +e656 f8b7 +e657 f8b8 +e658 f8b9 +e659 f8ba +e65a f8bb +e65b f8bc +e65c f8bd +e65d f8be +e65e f8bf +e65f f8c0 +e660 f8c1 +e661 f8c2 +e662 f8c3 +e663 f8c4 +e664 f8c5 +e665 f8c6 +e666 f8c7 +e667 f8c8 +e668 f8c9 +e669 f8ca +e66a f8cb +e66b f8cc +e66c f8cd +e66d f8ce +e66e f8cf +e66f f8d0 +e670 f8d1 +e671 f8d2 +e672 f8d3 +e673 f8d4 +e674 f8d5 +e675 f8d6 +e676 f8d7 +e677 f8d8 +e678 f8d9 +e679 f8da +e67a f8db +e67b f8dc +e67c f8dd +e67d f8de +e67e f8df +e67f f8e0 +e680 f8e1 +e681 f8e2 +e682 f8e3 +e683 f8e4 +e684 f8e5 +e685 f8e6 +e686 f8e7 +e687 f8e8 +e688 f8e9 +e689 f8ea +e68a f8eb +e68b f8ec +e68c f8ed +e68d f8ee +e68e f8ef +e68f f8f0 +e690 f8f1 +e691 f8f2 +e692 f8f3 +e693 f8f4 +e694 f8f5 +e695 f8f6 +e696 f8f7 +e697 f8f8 +e698 f8f9 +e699 f8fa +e69a f8fb +e69b f8fc +e69c f940 +e69d f941 +e69e f942 +e69f f943 +e6a0 f944 +e6a1 f945 +e6a2 f946 +e6a3 f947 +e6a4 f948 +e6a5 f949 +e6a6 f94a +e6a7 f94b +e6a8 f94c +e6a9 f94d +e6aa f94e +e6ab f94f +e6ac f950 +e6ad f951 +e6ae f952 +e6af f953 +e6b0 f954 +e6b1 f955 +e6b2 f956 +e6b3 f957 +e6b4 f958 +e6b5 f959 +e6b6 f95a +e6b7 f95b +e6b8 f95c +e6b9 f95d +e6ba f95e +e6bb f95f +e6bc f960 +e6bd f961 +e6be f962 +e6bf f963 +e6c0 f964 +e6c1 f965 +e6c2 f966 +e6c3 f967 +e6c4 f968 +e6c5 f969 +e6c6 f96a +e6c7 f96b +e6c8 f96c +e6c9 f96d +e6ca f96e +e6cb f96f +e6cc f970 +e6cd f971 +e6ce f972 +e6cf f973 +e6d0 f974 +e6d1 f975 +e6d2 f976 +e6d3 f977 +e6d4 f978 +e6d5 f979 +e6d6 f97a +e6d7 f97b +e6d8 f97c +e6d9 f97d +e6da f97e +e6db f980 +e6dc f981 +e6dd f982 +e6de f983 +e6df f984 +e6e0 f985 +e6e1 f986 +e6e2 f987 +e6e3 f988 +e6e4 f989 +e6e5 f98a +e6e6 f98b +e6e7 f98c +e6e8 f98d +e6e9 f98e +e6ea f98f +e6eb f990 +e6ec f991 +e6ed f992 +e6ee f993 +e6ef f994 +e6f0 f995 +e6f1 f996 +e6f2 f997 +e6f3 f998 +e6f4 f999 +e6f5 f99a +e6f6 f99b +e6f7 f99c +e6f8 f99d +e6f9 f99e +e6fa f99f +e6fb f9a0 +e6fc f9a1 +e6fd f9a2 +e6fe f9a3 +e6ff f9a4 +e700 f9a5 +e701 f9a6 +e702 f9a7 +e703 f9a8 +e704 f9a9 +e705 f9aa +e706 f9ab +e707 f9ac +e708 f9ad +e709 f9ae +e70a f9af +e70b f9b0 +e70c f9b1 +e70d f9b2 +e70e f9b3 +e70f f9b4 +e710 f9b5 +e711 f9b6 +e712 f9b7 +e713 f9b8 +e714 f9b9 +e715 f9ba +e716 f9bb +e717 f9bc +e718 f9bd +e719 f9be +e71a f9bf +e71b f9c0 +e71c f9c1 +e71d f9c2 +e71e f9c3 +e71f f9c4 +e720 f9c5 +e721 f9c6 +e722 f9c7 +e723 f9c8 +e724 f9c9 +e725 f9ca +e726 f9cb +e727 f9cc +e728 f9cd +e729 f9ce +e72a f9cf +e72b f9d0 +e72c f9d1 +e72d f9d2 +e72e f9d3 +e72f f9d4 +e730 f9d5 +e731 f9d6 +e732 f9d7 +e733 f9d8 +e734 f9d9 +e735 f9da +e736 f9db +e737 f9dc +e738 f9dd +e739 f9de +e73a f9df +e73b f9e0 +e73c f9e1 +e73d f9e2 +e73e f9e3 +e73f f9e4 +e740 f9e5 +e741 f9e6 +e742 f9e7 +e743 f9e8 +e744 f9e9 +e745 f9ea +e746 f9eb +e747 f9ec +e748 f9ed +e749 f9ee +e74a f9ef +e74b f9f0 +e74c f9f1 +e74d f9f2 +e74e f9f3 +e74f f9f4 +e750 f9f5 +e751 f9f6 +e752 f9f7 +e753 f9f8 +e754 f9f9 +e755 f9fa +e756 f9fb +e757 f9fc +f929 fae0 +f9dc fbe9 +fa0e fa90 +fa0f fa9b +fa10 fa9c +fa11 fab1 +fa12 fad8 +fa13 fae8 +fa14 faea +fa15 fb58 +fa16 fb5e +fa17 fb75 +fa18 fb7d +fa19 fb7e +fa1a fb80 +fa1b fb82 +fa1c fb86 +fa1d fb89 +fa1e fb92 +fa1f fb9d +fa20 fb9f +fa21 fba0 +fa22 fba9 +fa23 fbb1 +fa24 fbb3 +fa25 fbb4 +fa26 fbb7 +fa27 fbd3 +fa28 fbda +fa29 fbea +fa2a fbf6 +fa2b fbf7 +fa2c fbf9 +fa2d fc49 +ff01 8149 +ff02 fa57 +ff03 8194 +ff04 8190 +ff05 8193 +ff06 8195 +ff07 fa56 +ff08 8169 +ff09 816a +ff0a 8196 +ff0b 817b +ff0c 8143 +ff0d 817c +ff0e 8144 +ff0f 815e +ff10 824f +ff11 8250 +ff12 8251 +ff13 8252 +ff14 8253 +ff15 8254 +ff16 8255 +ff17 8256 +ff18 8257 +ff19 8258 +ff1a 8146 +ff1b 8147 +ff1c 8183 +ff1d 8181 +ff1e 8184 +ff1f 8148 +ff20 8197 +ff21 8260 +ff22 8261 +ff23 8262 +ff24 8263 +ff25 8264 +ff26 8265 +ff27 8266 +ff28 8267 +ff29 8268 +ff2a 8269 +ff2b 826a +ff2c 826b +ff2d 826c +ff2e 826d +ff2f 826e +ff30 826f +ff31 8270 +ff32 8271 +ff33 8272 +ff34 8273 +ff35 8274 +ff36 8275 +ff37 8276 +ff38 8277 +ff39 8278 +ff3a 8279 +ff3b 816d +ff3c 815f +ff3d 816e +ff3e 814f +ff3f 8151 +ff40 814d +ff41 8281 +ff42 8282 +ff43 8283 +ff44 8284 +ff45 8285 +ff46 8286 +ff47 8287 +ff48 8288 +ff49 8289 +ff4a 828a +ff4b 828b +ff4c 828c +ff4d 828d +ff4e 828e +ff4f 828f +ff50 8290 +ff51 8291 +ff52 8292 +ff53 8293 +ff54 8294 +ff55 8295 +ff56 8296 +ff57 8297 +ff58 8298 +ff59 8299 +ff5a 829a +ff5b 816f +ff5c 8162 +ff5d 8170 +ff5e 8160 +ff61 a1 +ff62 a2 +ff63 a3 +ff64 a4 +ff65 a5 +ff66 a6 +ff67 a7 +ff68 a8 +ff69 a9 +ff6a aa +ff6b ab +ff6c ac +ff6d ad +ff6e ae +ff6f af +ff70 b0 +ff71 b1 +ff72 b2 +ff73 b3 +ff74 b4 +ff75 b5 +ff76 b6 +ff77 b7 +ff78 b8 +ff79 b9 +ff7a ba +ff7b bb +ff7c bc +ff7d bd +ff7e be +ff7f bf +ff80 c0 +ff81 c1 +ff82 c2 +ff83 c3 +ff84 c4 +ff85 c5 +ff86 c6 +ff87 c7 +ff88 c8 +ff89 c9 +ff8a ca +ff8b cb +ff8c cc +ff8d cd +ff8e ce +ff8f cf +ff90 d0 +ff91 d1 +ff92 d2 +ff93 d3 +ff94 d4 +ff95 d5 +ff96 d6 +ff97 d7 +ff98 d8 +ff99 d9 +ff9a da +ff9b db +ff9c dc +ff9d dd +ff9e de +ff9f df +ffe0 8191 +ffe1 8192 +ffe2 81ca +ffe3 8150 +ffe4 fa55 +ffe5 818f diff --git a/jdk/test/java/nio/charset/spi/FooCharset.java b/jdk/test/java/nio/charset/spi/FooCharset.java new file mode 100644 index 00000000000..6206f6e7319 --- /dev/null +++ b/jdk/test/java/nio/charset/spi/FooCharset.java @@ -0,0 +1,45 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.nio.charset.Charset; +import java.nio.charset.CharsetDecoder; +import java.nio.charset.CharsetEncoder; + + +public class FooCharset + extends Charset +{ + + public FooCharset() { + super("FOO", + new String[] { "FOO-1", "FOO-2" }); + } + + public boolean contains(Charset cs) { + return (cs instanceof FooCharset); + } + + public CharsetDecoder newDecoder() { return null; } + public CharsetEncoder newEncoder() { return null; } + +} diff --git a/jdk/test/java/nio/charset/spi/FooProvider.java b/jdk/test/java/nio/charset/spi/FooProvider.java new file mode 100644 index 00000000000..e40f30b237e --- /dev/null +++ b/jdk/test/java/nio/charset/spi/FooProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.util.*; +import java.nio.charset.*; +import java.nio.charset.spi.*; + + +public class FooProvider + extends CharsetProvider +{ + + public FooProvider() {} + + public Iterator charsets() { + return Collections.singleton(new FooCharset()).iterator(); + } + + public Charset charsetForName(String charsetName) { + if (charsetName.equalsIgnoreCase("FOO")) + return new FooCharset(); + return null; + } + +} diff --git a/jdk/test/java/nio/charset/spi/Test.java b/jdk/test/java/nio/charset/spi/Test.java new file mode 100644 index 00000000000..d3a4ed21bbd --- /dev/null +++ b/jdk/test/java/nio/charset/spi/Test.java @@ -0,0 +1,92 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.io.*; +import java.nio.charset.*; +import java.util.*; + + +public class Test { + + private static PrintStream out = System.err; + private static final SortedMap available = Charset.availableCharsets(); + + private static void fail(String csn, String msg) { + throw new RuntimeException(csn + ": " + msg); + } + + private static void testPositive(String csn) { + if (!Charset.isSupported(csn)) + fail(csn, "Not supported"); + + Charset cs = Charset.forName(csn); + out.println(csn + " --> " + cs.getClass().getName()); + out.println(" " + cs.name() + " " + cs.aliases()); + + if (!available.containsKey(cs.name())) + fail(csn, "Not in available charsets: " + available.keySet()); + if (!((Charset)available.get(cs.name())).equals(cs)) + fail(csn, "Available charset != looked-up charset"); + + if (csn.equalsIgnoreCase("FOO")) { + if (!(cs instanceof FooCharset)) + fail(csn, "instanceof failed"); + } + } + + private static void testNegative(String csn) { + if (Charset.isSupported(csn)) + fail(csn, "Supported"); + if (available.containsKey(csn)) + fail(csn, "Available"); + try { + Charset.forName(csn); + } catch (UnsupportedCharsetException x) { + out.println(csn + " not supported, as expected"); + return; + } + fail(csn, "Lookup succeeded"); + } + + public static void main(String [] args) { + + out.println("Default: " + + new InputStreamReader(System.in).getEncoding()); + + out.print("Available:"); + for (Iterator i = available.keySet().iterator(); i.hasNext();) + out.print(" " + (String)i.next()); + out.println(); + + for (int i = 0; i < args.length; i++) { + String a = args[i]; + boolean not = a.startsWith("!"); + String csn = (not ? a.substring(1) : a); + if (not) + testNegative(csn); + else + testPositive(csn); + } + } + +} diff --git a/jdk/test/java/nio/charset/spi/basic.sh b/jdk/test/java/nio/charset/spi/basic.sh new file mode 100644 index 00000000000..972ed02fee8 --- /dev/null +++ b/jdk/test/java/nio/charset/spi/basic.sh @@ -0,0 +1,127 @@ +#!/bin/sh + +# +# Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# @test +# @bug 4429040 4591027 4814743 +# @summary Unit test for charset providers +# +# @build Test FooCharset FooProvider +# @run shell basic.sh +# @run shell basic.sh ja_JP.eucJP +# @run shell basic.sh tr_TR +# + +# Command-line usage: sh basic.sh /path/to/build [locale] + +if [ -z "$TESTJAVA" ]; then + if [ $# -lt 1 ]; then exit 1; fi + TESTJAVA=$1; shift + TESTSRC=`pwd` + TESTCLASSES=`pwd` +fi + +JAVA=$TESTJAVA/bin/java +JAR=$TESTJAVA/bin/jar + +JARD=`pwd`/x.jar +EXTD=`pwd`/x.ext +TESTD=`pwd`/x.test + +CSS='US-ASCII 8859_1 iso-ir-6 UTF-16 windows-1252 !BAR cp1252' + + +if [ \! -d $EXTD ]; then + # Initialize + echo Initializing... + rm -rf $JARD $EXTD $TESTD + mkdir -p $JARD/META-INF/services x.ext + echo FooProvider \ + >$JARD/META-INF/services/java.nio.charset.spi.CharsetProvider + cp $TESTCLASSES/FooProvider.class $TESTCLASSES/FooCharset.class $JARD + mkdir $TESTD + cp $TESTCLASSES/Test.class $TESTD + (cd $JARD; $JAR -cf $EXTD/test.jar *) +fi + +if [ $# -gt 0 ]; then + # Use locale specified on command line, if it's supported + L="$1" + shift + s=`uname -s` + if [ $s != Linux -a $s != SunOS ]; then + echo "$L: Locales not supported on this system, skipping..." + exit 0 + fi + if [ "x`locale -a | grep $L`" != "x$L" ]; then + echo "$L: Locale not supported, skipping..." + exit 0 + fi + LC_ALL=$L; export LC_ALL +fi + +TMP=${TMP:-$TEMP}; TMP=${TMP:-/tmp} +cd $TMP + +case `uname` in + SunOS | Linux ) CPS=':' ;; + Windows* ) CPS=';' ;; + *) echo "Unknown platform: `uname`"; exit 1 ;; +esac + +failures=0 +for where in ext app; do + for security in none minimal-policy cp-policy; do + echo ''; + echo "LC_ALL=$LC_ALL where=$where security=$security" + av='' + if [ $where = ext ]; then + av="$av -cp $TESTD -Djava.ext.dirs=$EXTD"; + else + av="$av -cp $TESTD$CPS$EXTD/test.jar"; + fi + case $security in + none) css="$CSS FOO";; + # Minimal policy in this case is more or less carbon copy of jre default + # security policy and doesn't give explicit runtime permission + # for user provided runtime loadable charsets + minimal-policy) css="$CSS !FOO"; + av="$av -Djava.security.manager -Djava.security.policy==$TESTSRC/default-pol";; + cp-policy) css="$CSS FOO"; + av="$av -Djava.security.manager + -Djava.security.policy==$TESTSRC/charsetProvider.sp";; + esac + if (set -x; $JAVA $av Test $css) 2>&1; then + continue; + else + failures=`expr $failures + 1` + fi + done +done + +echo '' +if [ $failures -gt 0 ]; + then echo "$failures cases failed"; + else echo "All cases passed"; fi +exit $failures diff --git a/jdk/test/java/nio/charset/spi/charsetProvider.sp b/jdk/test/java/nio/charset/spi/charsetProvider.sp new file mode 100644 index 00000000000..a50c8a463a3 --- /dev/null +++ b/jdk/test/java/nio/charset/spi/charsetProvider.sp @@ -0,0 +1,5 @@ +// + +grant { + permission java.lang.RuntimePermission "charsetProvider"; +}; diff --git a/jdk/test/java/nio/charset/spi/default-pol b/jdk/test/java/nio/charset/spi/default-pol new file mode 100644 index 00000000000..557979ef936 --- /dev/null +++ b/jdk/test/java/nio/charset/spi/default-pol @@ -0,0 +1,48 @@ + +// Standard extensions get all permissions by default + +grant codeBase "file:${java.home}/lib/ext/*" { + permission java.security.AllPermission; +}; + +// default permissions granted to all domains + +grant { + // Allows any thread to stop itself using the java.lang.Thread.stop() + // method that takes no argument. + // Note that this permission is granted by default only to remain + // backwards compatible. + // It is strongly recommended that you either remove this permission + // from this policy file or further restrict it to code sources + // that you specify, because Thread.stop() is potentially unsafe. + // See "http://java.sun.com/notes" for more information. + permission java.lang.RuntimePermission "stopThread"; + + // allows anyone to listen on un-privileged ports + permission java.net.SocketPermission "localhost:1024-", "listen"; + + // "standard" properies that can be read by anyone + + permission java.util.PropertyPermission "java.version", "read"; + permission java.util.PropertyPermission "java.vendor", "read"; + permission java.util.PropertyPermission "java.vendor.url", "read"; + permission java.util.PropertyPermission "java.class.version", "read"; + permission java.util.PropertyPermission "os.name", "read"; + permission java.util.PropertyPermission "os.version", "read"; + permission java.util.PropertyPermission "os.arch", "read"; + permission java.util.PropertyPermission "file.separator", "read"; + permission java.util.PropertyPermission "path.separator", "read"; + permission java.util.PropertyPermission "line.separator", "read"; + + permission java.util.PropertyPermission "java.specification.version", "read"; + permission java.util.PropertyPermission "java.specification.vendor", "read"; + permission java.util.PropertyPermission "java.specification.name", "read"; + + permission java.util.PropertyPermission "java.vm.specification.version", "read"; + permission java.util.PropertyPermission "java.vm.specification.vendor", "read"; + permission java.util.PropertyPermission "java.vm.specification.name", "read"; + permission java.util.PropertyPermission "java.vm.version", "read"; + permission java.util.PropertyPermission "java.vm.vendor", "read"; + permission java.util.PropertyPermission "java.vm.name", "read"; +}; + diff --git a/jdk/test/java/nio/file/Files/PrintFileTree.java b/jdk/test/java/nio/file/Files/PrintFileTree.java index dc2c49f8db1..40d2ab52b14 100644 --- a/jdk/test/java/nio/file/Files/PrintFileTree.java +++ b/jdk/test/java/nio/file/Files/PrintFileTree.java @@ -28,27 +28,33 @@ import java.util.*; /** * Invokes Files.walkFileTree to traverse a file tree and prints - * each of the directories and files. The -L option causes symbolic - * links to be followed. + * each of the directories and files. The -follow option causes symbolic + * links to be followed and the -printCycles option will print links + * where the target of the link is an ancestor directory. */ public class PrintFileTree { public static void main(String[] args) throws Exception { boolean followLinks = false; - Path dir; - - if (args[0].equals("-L")) { - followLinks = true; - dir = Paths.get(args[1]); - } else { - dir = Paths.get(args[0]); + boolean printCycles = false; + int i = 0; + while (i < (args.length-1)) { + switch (args[i]) { + case "-follow" : followLinks = true; break; + case "-printCycles" : printCycles = true; break; + default: + throw new RuntimeException(args[i] + " not recognized"); + } + i++; } + Path dir = Paths.get(args[i]); Set options = new HashSet(); if (followLinks) options.add(FileVisitOption.FOLLOW_LINKS); + final boolean reportCycles = printCycles; Files.walkFileTree(dir, options, Integer.MAX_VALUE, new FileVisitor() { public FileVisitResult preVisitDirectory(FileRef dir) { System.out.println(dir); @@ -59,7 +65,8 @@ public class PrintFileTree { return FileVisitResult.CONTINUE; } public FileVisitResult visitFile(FileRef file, BasicFileAttributes attrs) { - System.out.println(file); + if (!attrs.isDirectory() || reportCycles) + System.out.println(file); return FileVisitResult.CONTINUE; } public FileVisitResult postVisitDirectory(FileRef dir, IOException exc) { diff --git a/jdk/test/java/nio/file/Files/walk_file_tree.sh b/jdk/test/java/nio/file/Files/walk_file_tree.sh index 73022d31d58..b5a173c5392 100644 --- a/jdk/test/java/nio/file/Files/walk_file_tree.sh +++ b/jdk/test/java/nio/file/Files/walk_file_tree.sh @@ -39,7 +39,7 @@ fi OS=`uname -s` case "$OS" in - Windows_* ) + Windows_* | CYGWIN* ) echo "This test does not run on Windows" exit 0 ;; @@ -61,12 +61,20 @@ find "$ROOT" > out2 diff out1 out2 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi -# repeat test following links (use -follow instead of -L -# to allow running on older systems) -$JAVA PrintFileTree -L "$ROOT" > out1 -find "$ROOT" -follow > out2 +# repeat test following links. Some versions of find(1) output +# cycles (sym links to ancestor directories), other versions do +# not. For that reason we run PrintFileTree with the -printCycles +# option when the output without this option differs to find(1). +find "$ROOT" -follow > out1 +$JAVA PrintFileTree -follow "$ROOT" > out2 diff out1 out2 -if [ $? != 0 ]; then failures=`expr $failures + 1`; fi +if [ $? != 0 ]; + then + # re-run printing cycles to stdout + $JAVA PrintFileTree -follow -printCycles "$ROOT" > out2 + diff out1 out2 + if [ $? != 0 ]; then failures=`expr $failures + 1`; fi + fi # test SKIP_SIBLINGS $JAVA SkipSiblings "$ROOT" diff --git a/jdk/test/java/nio/file/Path/CheckPermissions.java b/jdk/test/java/nio/file/Path/CheckPermissions.java index 9e0f796afc7..97763de9574 100644 --- a/jdk/test/java/nio/file/Path/CheckPermissions.java +++ b/jdk/test/java/nio/file/Path/CheckPermissions.java @@ -197,7 +197,7 @@ public class CheckPermissions { } public static void main(String[] args) throws IOException { - Path dir = Paths.get(System.getProperty("test.src", ".")); + Path dir = Paths.get(System.getProperty("test.dir", ".")); Path file = dir.resolve("file1234").createFile(); try { LoggingSecurityManager.install(); diff --git a/jdk/test/java/nio/file/Path/CopyAndMove.java b/jdk/test/java/nio/file/Path/CopyAndMove.java index 18abbe0de56..9d24e6db335 100644 --- a/jdk/test/java/nio/file/Path/CopyAndMove.java +++ b/jdk/test/java/nio/file/Path/CopyAndMove.java @@ -22,10 +22,10 @@ */ /* @test - * @bug 4313887 6838333 + * @bug 4313887 6838333 6917021 * @summary Unit test for java.nio.file.Path copyTo/moveTo methods * @library .. - * @build CopyAndMove + * @build CopyAndMove PassThroughFileSystem * @run main/othervm CopyAndMove */ @@ -40,22 +40,31 @@ import java.util.*; public class CopyAndMove { static final Random rand = new Random(); static boolean heads() { return rand.nextBoolean(); } - static boolean supportsLinks; public static void main(String[] args) throws Exception { Path dir1 = TestUtil.createTemporaryDirectory(); try { - supportsLinks = TestUtil.supportsLinks(dir1); + // Same directory + doCopyTests(dir1, dir1, TestUtil.supportsLinks(dir1)); + doMoveTests(dir1, dir1, TestUtil.supportsLinks(dir1)); - // Exercise copyTo - doCopyTests(dir1); + // Different directories. Use test.dir if possible as it might be + // a different volume/file system and so improve test coverage. + String testDir = System.getProperty("test.dir", "."); + Path dir2 = TestUtil.createTemporaryDirectory(testDir); + try { + boolean testSymbolicLinks = + TestUtil.supportsLinks(dir1) && TestUtil.supportsLinks(dir2); + doCopyTests(dir1, dir2, testSymbolicLinks); + doMoveTests(dir1, dir2, testSymbolicLinks); + } finally { + TestUtil.removeAll(dir2); + } - // Exercise moveTo - // if test.dir differs to temporary file system then can test - // moving between devices - String testDir = System.getProperty("test.dir"); - Path dir2 = (testDir != null) ? Paths.get(testDir) : dir1; - doMoveTests(dir1, dir2); + // Target is location associated with custom provider + Path dir3 = PassThroughFileSystem.create().getPath(dir1.toString()); + doCopyTests(dir1, dir3, false); + doMoveTests(dir1, dir3, false); } finally { TestUtil.removeAll(dir1); @@ -186,30 +195,37 @@ public class CopyAndMove { checkBasicAttributes(basicAttributes, Attributes.readBasicFileAttributes(target, NOFOLLOW_LINKS)); - // verify POSIX attributes - if (posixAttributes != null && !basicAttributes.isSymbolicLink()) { - checkPosixAttributes(posixAttributes, - Attributes.readPosixFileAttributes(target, NOFOLLOW_LINKS)); - } + // verify other attributes when same provider + if (source.getFileSystem().provider() == target.getFileSystem().provider()) { - // verify DOS attributes - if (dosAttributes != null && !basicAttributes.isSymbolicLink()) { - checkDosAttributes(dosAttributes, - Attributes.readDosFileAttributes(target, NOFOLLOW_LINKS)); - } + // verify POSIX attributes + if (posixAttributes != null && !basicAttributes.isSymbolicLink()) { + checkPosixAttributes(posixAttributes, + Attributes.readPosixFileAttributes(target, NOFOLLOW_LINKS)); + } - // verify named attributes - if (namedAttributes != null && - target.getFileStore().supportsFileAttributeView("xattr")) - { - checkUserDefinedFileAttributes(namedAttributes, readUserDefinedFileAttributes(target)); + // verify DOS attributes + if (dosAttributes != null && !basicAttributes.isSymbolicLink()) { + checkDosAttributes(dosAttributes, + Attributes.readDosFileAttributes(target, NOFOLLOW_LINKS)); + } + + // verify named attributes + if (namedAttributes != null && + target.getFileStore().supportsFileAttributeView("xattr")) + { + checkUserDefinedFileAttributes(namedAttributes, + readUserDefinedFileAttributes(target)); + } } } /** * Tests all possible ways to invoke moveTo */ - static void doMoveTests(Path dir1, Path dir2) throws IOException { + static void doMoveTests(Path dir1, Path dir2, boolean supportsLinks) + throws IOException + { Path source, target, entry; boolean sameDevice = dir1.getFileStore().equals(dir2.getFileStore()); @@ -220,7 +236,7 @@ public class CopyAndMove { * Test: move regular file, target does not exist */ source = createSourceFile(dir1); - target = getTargetFile(dir1); + target = getTargetFile(dir2); moveAndVerify(source, target); target.delete(); @@ -228,7 +244,7 @@ public class CopyAndMove { * Test: move regular file, target exists */ source = createSourceFile(dir1); - target = getTargetFile(dir1).createFile(); + target = getTargetFile(dir2).createFile(); try { moveAndVerify(source, target); throw new RuntimeException("FileAlreadyExistsException expected"); @@ -248,7 +264,7 @@ public class CopyAndMove { * Test: move regular file, target does not exist */ source = createSourceFile(dir1); - target = getTargetFile(dir1); + target = getTargetFile(dir2); moveAndVerify(source, target, REPLACE_EXISTING); target.delete(); @@ -256,7 +272,7 @@ public class CopyAndMove { * Test: move regular file, target exists */ source = createSourceFile(dir1); - target = getTargetFile(dir1).createFile(); + target = getTargetFile(dir2).createFile(); moveAndVerify(source, target, REPLACE_EXISTING); target.delete(); @@ -264,7 +280,7 @@ public class CopyAndMove { * Test: move regular file, target exists and is empty directory */ source = createSourceFile(dir1); - target = getTargetFile(dir1).createDirectory(); + target = getTargetFile(dir2).createDirectory(); moveAndVerify(source, target, REPLACE_EXISTING); target.delete(); @@ -272,7 +288,7 @@ public class CopyAndMove { * Test: move regular file, target exists and is non-empty directory */ source = createSourceFile(dir1); - target = getTargetFile(dir1).createDirectory(); + target = getTargetFile(dir2).createDirectory(); entry = target.resolve("foo").createFile(); try { moveAndVerify(source, target); @@ -311,7 +327,7 @@ public class CopyAndMove { * Test: move empty directory, target does not exist */ source = createSourceDirectory(dir1); - target = getTargetFile(dir1); + target = getTargetFile(dir2); moveAndVerify(source, target); target.delete(); @@ -319,7 +335,7 @@ public class CopyAndMove { * Test: move empty directory, target exists */ source = createSourceDirectory(dir1); - target = getTargetFile(dir1).createFile(); + target = getTargetFile(dir2).createFile(); try { moveAndVerify(source, target); throw new RuntimeException("FileAlreadyExistsException expected"); @@ -339,7 +355,7 @@ public class CopyAndMove { * Test: move empty directory, target does not exist */ source = createSourceDirectory(dir1); - target = getTargetFile(dir1); + target = getTargetFile(dir2); moveAndVerify(source, target, REPLACE_EXISTING); target.delete(); @@ -347,7 +363,7 @@ public class CopyAndMove { * Test: move empty directory, target exists */ source = createSourceDirectory(dir1); - target = getTargetFile(dir1).createFile(); + target = getTargetFile(dir2).createFile(); moveAndVerify(source, target, REPLACE_EXISTING); target.delete(); @@ -355,7 +371,7 @@ public class CopyAndMove { * Test: move empty, target exists and is empty directory */ source = createSourceDirectory(dir1); - target = getTargetFile(dir1).createDirectory(); + target = getTargetFile(dir2).createDirectory(); moveAndVerify(source, target, REPLACE_EXISTING); target.delete(); @@ -363,7 +379,7 @@ public class CopyAndMove { * Test: move empty directory, target exists and is non-empty directory */ source = createSourceDirectory(dir1); - target = getTargetFile(dir1).createDirectory(); + target = getTargetFile(dir2).createDirectory(); entry = target.resolve("foo").createFile(); try { moveAndVerify(source, target, REPLACE_EXISTING); @@ -418,7 +434,7 @@ public class CopyAndMove { if (supportsLinks) { Path tmp = createSourceFile(dir1); source = dir1.resolve("link").createSymbolicLink(tmp); - target = getTargetFile(dir1); + target = getTargetFile(dir2); moveAndVerify(source, target); target.delete(); tmp.delete(); @@ -429,7 +445,7 @@ public class CopyAndMove { */ if (supportsLinks) { source = dir1.resolve("link").createSymbolicLink(dir2); - target = getTargetFile(dir1); + target = getTargetFile(dir2); moveAndVerify(source, target); target.delete(); } @@ -440,7 +456,7 @@ public class CopyAndMove { if (supportsLinks) { Path tmp = Paths.get("doesnotexist"); source = dir1.resolve("link").createSymbolicLink(tmp); - target = getTargetFile(dir1); + target = getTargetFile(dir2); moveAndVerify(source, target); target.delete(); } @@ -450,7 +466,7 @@ public class CopyAndMove { */ if (supportsLinks) { source = dir1.resolve("link").createSymbolicLink(dir2); - target = getTargetFile(dir1).createFile(); + target = getTargetFile(dir2).createFile(); try { moveAndVerify(source, target); throw new RuntimeException("FileAlreadyExistsException expected"); @@ -465,7 +481,7 @@ public class CopyAndMove { */ if (supportsLinks) { source = dir1.resolve("link").createSymbolicLink(dir2); - target = getTargetFile(dir1).createFile(); + target = getTargetFile(dir2).createFile(); moveAndVerify(source, target, REPLACE_EXISTING); target.delete(); } @@ -475,7 +491,7 @@ public class CopyAndMove { */ if (supportsLinks) { source = dir1.resolve("link").createSymbolicLink(dir2); - target = getTargetFile(dir1).createDirectory(); + target = getTargetFile(dir2).createDirectory(); moveAndVerify(source, target, REPLACE_EXISTING); target.delete(); } @@ -485,7 +501,7 @@ public class CopyAndMove { */ if (supportsLinks) { source = dir1.resolve("link").createSymbolicLink(dir2); - target = getTargetFile(dir1).createDirectory(); + target = getTargetFile(dir2).createDirectory(); entry = target.resolve("foo").createFile(); try { moveAndVerify(source, target); @@ -502,7 +518,7 @@ public class CopyAndMove { */ if (supportsLinks) { source = dir1.resolve("link").createSymbolicLink(dir1); - target = getTargetFile(dir1).createFile(); + target = getTargetFile(dir2).createFile(); moveAndVerify(source, target, REPLACE_EXISTING); target.delete(); } @@ -513,7 +529,7 @@ public class CopyAndMove { * Test nulls */ source = createSourceFile(dir1); - target = getTargetFile(dir1); + target = getTargetFile(dir2); try { source.moveTo(null); throw new RuntimeException("NullPointerException expected"); @@ -533,7 +549,7 @@ public class CopyAndMove { * Test UOE */ source = createSourceFile(dir1); - target = getTargetFile(dir1); + target = getTargetFile(dir2); try { source.moveTo(target, new CopyOption() { }); } catch (UnsupportedOperationException x) { } @@ -577,28 +593,32 @@ public class CopyAndMove { checkBasicAttributes(basicAttributes, Attributes.readBasicFileAttributes(source, linkOptions)); - // check POSIX attributes are copied - String os = System.getProperty("os.name"); - if (os.equals("SunOS") || os.equals("Linux")) { - checkPosixAttributes( - Attributes.readPosixFileAttributes(source, linkOptions), - Attributes.readPosixFileAttributes(target, linkOptions)); - } + // verify other attributes when same provider + if (source.getFileSystem().provider() == target.getFileSystem().provider()) { - // check DOS attributes are copied - if (os.startsWith("Windows")) { - checkDosAttributes( - Attributes.readDosFileAttributes(source, linkOptions), - Attributes.readDosFileAttributes(target, linkOptions)); - } + // check POSIX attributes are copied + String os = System.getProperty("os.name"); + if (os.equals("SunOS") || os.equals("Linux")) { + checkPosixAttributes( + Attributes.readPosixFileAttributes(source, linkOptions), + Attributes.readPosixFileAttributes(target, linkOptions)); + } - // check named attributes are copied - if (followLinks && - source.getFileStore().supportsFileAttributeView("xattr") && - target.getFileStore().supportsFileAttributeView("xattr")) - { - checkUserDefinedFileAttributes(readUserDefinedFileAttributes(source), - readUserDefinedFileAttributes(target)); + // check DOS attributes are copied + if (os.startsWith("Windows")) { + checkDosAttributes( + Attributes.readDosFileAttributes(source, linkOptions), + Attributes.readDosFileAttributes(target, linkOptions)); + } + + // check named attributes are copied + if (followLinks && + source.getFileStore().supportsFileAttributeView("xattr") && + target.getFileStore().supportsFileAttributeView("xattr")) + { + checkUserDefinedFileAttributes(readUserDefinedFileAttributes(source), + readUserDefinedFileAttributes(target)); + } } } } @@ -606,7 +626,9 @@ public class CopyAndMove { /** * Tests all possible ways to invoke copyTo */ - static void doCopyTests(Path dir) throws IOException { + static void doCopyTests(Path dir1, Path dir2, boolean supportsLinks) + throws IOException + { Path source, target, link, entry; // -- regular file -- @@ -614,8 +636,8 @@ public class CopyAndMove { /** * Test: move regular file, target does not exist */ - source = createSourceFile(dir); - target = getTargetFile(dir); + source = createSourceFile(dir1); + target = getTargetFile(dir2); copyAndVerify(source, target); source.delete(); target.delete(); @@ -623,8 +645,8 @@ public class CopyAndMove { /** * Test: copy regular file, target exists */ - source = createSourceFile(dir); - target = getTargetFile(dir).createFile(); + source = createSourceFile(dir1); + target = getTargetFile(dir2).createFile(); try { copyAndVerify(source, target); throw new RuntimeException("FileAlreadyExistsException expected"); @@ -643,8 +665,8 @@ public class CopyAndMove { /** * Test: copy regular file, target does not exist */ - source = createSourceFile(dir); - target = getTargetFile(dir); + source = createSourceFile(dir1); + target = getTargetFile(dir2); copyAndVerify(source, target, REPLACE_EXISTING); source.delete(); target.delete(); @@ -652,8 +674,8 @@ public class CopyAndMove { /** * Test: copy regular file, target exists */ - source = createSourceFile(dir); - target = getTargetFile(dir).createFile(); + source = createSourceFile(dir1); + target = getTargetFile(dir2).createFile(); copyAndVerify(source, target, REPLACE_EXISTING); source.delete(); target.delete(); @@ -661,8 +683,8 @@ public class CopyAndMove { /** * Test: copy regular file, target exists and is empty directory */ - source = createSourceFile(dir); - target = getTargetFile(dir).createDirectory(); + source = createSourceFile(dir1); + target = getTargetFile(dir2).createDirectory(); copyAndVerify(source, target, REPLACE_EXISTING); source.delete(); target.delete(); @@ -670,8 +692,8 @@ public class CopyAndMove { /** * Test: copy regular file, target exists and is non-empty directory */ - source = createSourceFile(dir); - target = getTargetFile(dir).createDirectory(); + source = createSourceFile(dir1); + target = getTargetFile(dir2).createDirectory(); entry = target.resolve("foo").createFile(); try { copyAndVerify(source, target); @@ -685,8 +707,8 @@ public class CopyAndMove { /** * Test: copy regular file + attributes */ - source = createSourceFile(dir); - target = getTargetFile(dir); + source = createSourceFile(dir1); + target = getTargetFile(dir2); copyAndVerify(source, target, COPY_ATTRIBUTES); source.delete(); target.delete(); @@ -697,8 +719,8 @@ public class CopyAndMove { /* * Test: copy directory, target does not exist */ - source = createSourceDirectory(dir); - target = getTargetFile(dir); + source = createSourceDirectory(dir1); + target = getTargetFile(dir2); copyAndVerify(source, target); source.delete(); target.delete(); @@ -706,8 +728,8 @@ public class CopyAndMove { /** * Test: copy directory, target exists */ - source = createSourceDirectory(dir); - target = getTargetFile(dir).createFile(); + source = createSourceDirectory(dir1); + target = getTargetFile(dir2).createFile(); try { copyAndVerify(source, target); throw new RuntimeException("FileAlreadyExistsException expected"); @@ -726,8 +748,8 @@ public class CopyAndMove { /** * Test: copy directory, target does not exist */ - source = createSourceDirectory(dir); - target = getTargetFile(dir); + source = createSourceDirectory(dir1); + target = getTargetFile(dir2); copyAndVerify(source, target, REPLACE_EXISTING); source.delete(); target.delete(); @@ -735,8 +757,8 @@ public class CopyAndMove { /** * Test: copy directory, target exists */ - source = createSourceDirectory(dir); - target = getTargetFile(dir).createFile(); + source = createSourceDirectory(dir1); + target = getTargetFile(dir2).createFile(); copyAndVerify(source, target, REPLACE_EXISTING); source.delete(); target.delete(); @@ -744,8 +766,8 @@ public class CopyAndMove { /** * Test: copy directory, target exists and is empty directory */ - source = createSourceDirectory(dir); - target = getTargetFile(dir).createDirectory(); + source = createSourceDirectory(dir1); + target = getTargetFile(dir2).createDirectory(); copyAndVerify(source, target, REPLACE_EXISTING); source.delete(); target.delete(); @@ -753,8 +775,8 @@ public class CopyAndMove { /** * Test: copy directory, target exists and is non-empty directory */ - source = createSourceDirectory(dir); - target = getTargetFile(dir).createDirectory(); + source = createSourceDirectory(dir1); + target = getTargetFile(dir2).createDirectory(); entry = target.resolve("foo").createFile(); try { copyAndVerify(source, target, REPLACE_EXISTING); @@ -768,8 +790,8 @@ public class CopyAndMove { /* * Test: copy directory + attributes */ - source = createSourceDirectory(dir); - target = getTargetFile(dir); + source = createSourceDirectory(dir1); + target = getTargetFile(dir2); copyAndVerify(source, target, COPY_ATTRIBUTES); source.delete(); target.delete(); @@ -780,9 +802,9 @@ public class CopyAndMove { * Test: Follow link */ if (supportsLinks) { - source = createSourceFile(dir); - link = dir.resolve("link").createSymbolicLink(source); - target = getTargetFile(dir); + source = createSourceFile(dir1); + link = dir1.resolve("link").createSymbolicLink(source); + target = getTargetFile(dir2); copyAndVerify(link, target); link.delete(); source.delete(); @@ -792,9 +814,9 @@ public class CopyAndMove { * Test: Copy link (to file) */ if (supportsLinks) { - source = createSourceFile(dir); - link = dir.resolve("link").createSymbolicLink(source); - target = getTargetFile(dir); + source = createSourceFile(dir1); + link = dir1.resolve("link").createSymbolicLink(source); + target = getTargetFile(dir2); copyAndVerify(link, target, NOFOLLOW_LINKS); link.delete(); source.delete(); @@ -804,9 +826,9 @@ public class CopyAndMove { * Test: Copy link (to directory) */ if (supportsLinks) { - source = dir.resolve("mydir").createDirectory(); - link = dir.resolve("link").createSymbolicLink(source); - target = getTargetFile(dir); + source = dir1.resolve("mydir").createDirectory(); + link = dir1.resolve("link").createSymbolicLink(source); + target = getTargetFile(dir2); copyAndVerify(link, target, NOFOLLOW_LINKS); link.delete(); source.delete(); @@ -817,8 +839,8 @@ public class CopyAndMove { */ if (supportsLinks) { assertTrue(source.notExists()); - link = dir.resolve("link").createSymbolicLink(source); - target = getTargetFile(dir); + link = dir1.resolve("link").createSymbolicLink(source); + target = getTargetFile(dir2); copyAndVerify(link, target, NOFOLLOW_LINKS); link.delete(); } @@ -830,8 +852,8 @@ public class CopyAndMove { System.getProperty("os.name").startsWith("Windows")) { Path unc = Paths.get("\\\\rialto\\share\\file"); - link = dir.resolve("link").createSymbolicLink(unc); - target = getTargetFile(dir); + link = dir1.resolve("link").createSymbolicLink(unc); + target = getTargetFile(dir2); copyAndVerify(link, target, NOFOLLOW_LINKS); link.delete(); } @@ -841,8 +863,8 @@ public class CopyAndMove { /** * Test nulls */ - source = createSourceFile(dir); - target = getTargetFile(dir); + source = createSourceFile(dir1); + target = getTargetFile(dir2); try { source.copyTo(null); throw new RuntimeException("NullPointerException expected"); @@ -861,8 +883,8 @@ public class CopyAndMove { /** * Test UOE */ - source = createSourceFile(dir); - target = getTargetFile(dir); + source = createSourceFile(dir1); + target = getTargetFile(dir2); try { source.copyTo(target, new CopyOption() { }); } catch (UnsupportedOperationException x) { } diff --git a/jdk/test/java/nio/file/Path/PassThroughFileSystem.java b/jdk/test/java/nio/file/Path/PassThroughFileSystem.java new file mode 100644 index 00000000000..41870ccc031 --- /dev/null +++ b/jdk/test/java/nio/file/Path/PassThroughFileSystem.java @@ -0,0 +1,554 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.nio.file.*; +import java.nio.file.attribute.*; +import java.nio.file.spi.FileSystemProvider; +import java.nio.channels.SeekableByteChannel; +import java.net.URI; +import java.util.*; +import java.io.*; + +/** + * A "pass through" file system implementation that passes through, or delegates, + * everything to the default file system. + */ + +class PassThroughFileSystem extends FileSystem { + private final FileSystemProvider provider; + private final FileSystem delegate; + + PassThroughFileSystem(FileSystemProvider provider, FileSystem delegate) { + this.provider = provider; + this.delegate = delegate; + } + + /** + * Creates a new "pass through" file system. Useful for test environments + * where the provider might not be deployed. + */ + static FileSystem create() throws IOException { + FileSystemProvider provider = new PassThroughProvider(); + Map env = Collections.emptyMap(); + URI uri = URI.create("pass:///"); + return provider.newFileSystem(uri, env); + } + + @Override + public FileSystemProvider provider() { + return provider; + } + + @Override + public void close() throws IOException { + delegate.close(); + } + + @Override + public boolean isOpen() { + return delegate.isOpen(); + } + + @Override + public boolean isReadOnly() { + return delegate.isReadOnly(); + } + + @Override + public String getSeparator() { + return delegate.getSeparator(); + } + + @Override + public Iterable getRootDirectories() { + final Iterable roots = delegate.getRootDirectories(); + return new Iterable() { + @Override + public Iterator iterator() { + final Iterator itr = roots.iterator(); + return new Iterator() { + @Override + public boolean hasNext() { + return itr.hasNext(); + } + @Override + public Path next() { + return new PassThroughPath(delegate, itr.next()); + } + @Override + public void remove() { + itr.remove(); + } + }; + } + }; + } + + @Override + public Iterable getFileStores() { + // assume that unwrapped objects aren't exposed + return delegate.getFileStores(); + } + + @Override + public Set supportedFileAttributeViews() { + // assume that unwrapped objects aren't exposed + return delegate.supportedFileAttributeViews(); + } + + @Override + public Path getPath(String path) { + return new PassThroughPath(this, delegate.getPath(path)); + } + + @Override + public PathMatcher getPathMatcher(String syntaxAndPattern) { + final PathMatcher matcher = delegate.getPathMatcher(syntaxAndPattern); + return new PathMatcher() { + @Override + public boolean matches(Path path) { + return matcher.matches(PassThroughPath.unwrap(path)); + } + }; + } + + @Override + public UserPrincipalLookupService getUserPrincipalLookupService() { + // assume that unwrapped objects aren't exposed + return delegate.getUserPrincipalLookupService(); + } + + @Override + public WatchService newWatchService() throws IOException { + // to keep it simple + throw new UnsupportedOperationException(); + } + + static class PassThroughProvider extends FileSystemProvider { + private static final String SCHEME = "pass"; + private static volatile PassThroughFileSystem delegate; + + public PassThroughProvider() { } + + @Override + public String getScheme() { + return SCHEME; + } + + private void checkScheme(URI uri) { + if (!uri.getScheme().equalsIgnoreCase(SCHEME)) + throw new IllegalArgumentException(); + } + + private void checkUri(URI uri) { + checkScheme(uri); + if (!uri.getSchemeSpecificPart().equals("///")) + throw new IllegalArgumentException(); + } + + @Override + public FileSystem newFileSystem(URI uri, Map env) + throws IOException + { + checkUri(uri); + synchronized (PassThroughProvider.class) { + if (delegate != null) + throw new FileSystemAlreadyExistsException(); + PassThroughFileSystem result = + new PassThroughFileSystem(this, FileSystems.getDefault()); + delegate = result; + return result; + } + } + + @Override + public FileSystem getFileSystem(URI uri) { + checkUri(uri); + FileSystem result = delegate; + if (result == null) + throw new FileSystemNotFoundException(); + return result; + } + + @Override + public Path getPath(URI uri) { + checkScheme(uri); + if (delegate == null) + throw new FileSystemNotFoundException(); + uri = URI.create(delegate.provider().getScheme() + ":" + + uri.getSchemeSpecificPart()); + return new PassThroughPath(delegate, delegate.provider().getPath(uri)); + } + } + + static class PassThroughPath extends Path { + private final FileSystem fs; + private final Path delegate; + + PassThroughPath(FileSystem fs, Path delegate) { + this.fs = fs; + this.delegate = delegate; + } + + private Path wrap(Path path) { + return (path != null) ? new PassThroughPath(fs, path) : null; + } + + static Path unwrap(Path wrapper) { + if (!(wrapper instanceof PassThroughPath)) + throw new ProviderMismatchException(); + return ((PassThroughPath)wrapper).delegate; + } + + @Override + public FileSystem getFileSystem() { + return fs; + } + + @Override + public boolean isAbsolute() { + return delegate.isAbsolute(); + } + + @Override + public Path getRoot() { + return wrap(delegate.getRoot()); + } + + + @Override + public Path getName() { + return wrap(delegate.getName()); + } + + @Override + public Path getParent() { + return wrap(delegate.getParent()); + } + + @Override + public int getNameCount() { + return delegate.getNameCount(); + } + + @Override + public Path getName(int index) { + return wrap(delegate.getName(index)); + } + + @Override + public Path subpath(int beginIndex, int endIndex) { + return wrap(delegate.subpath(beginIndex, endIndex)); + } + + @Override + public boolean startsWith(Path other) { + return delegate.startsWith(unwrap(other)); + } + + @Override + public boolean endsWith(Path other) { + return delegate.endsWith(unwrap(other)); + } + + @Override + public Path normalize() { + return wrap(delegate.normalize()); + } + + @Override + public Path resolve(Path other) { + return wrap(delegate.resolve(unwrap(other))); + } + + @Override + public Path resolve(String other) { + return wrap(delegate.resolve(other)); + } + + @Override + public Path relativize(Path other) { + return wrap(delegate.relativize(unwrap(other))); + } + + @Override + public void setAttribute(String attribute, Object value, LinkOption... options) + throws IOException + { + delegate.setAttribute(attribute, value, options); + } + + @Override + public Object getAttribute(String attribute, LinkOption... options) + throws IOException + { + // assume that unwrapped objects aren't exposed + return delegate.getAttribute(attribute, options); + } + + @Override + public Map readAttributes(String attributes, LinkOption... options) + throws IOException + { + // assume that unwrapped objects aren't exposed + return delegate.readAttributes(attributes, options); + } + + @Override + public V getFileAttributeView(Class type, + LinkOption... options) + { + return delegate.getFileAttributeView(type, options); + } + + @Override + public void delete() throws IOException { + delegate.delete(); + } + + @Override + public void deleteIfExists() throws IOException { + delegate.deleteIfExists(); + } + + @Override + public Path createSymbolicLink(Path target, FileAttribute... attrs) + throws IOException + { + delegate.createSymbolicLink(unwrap(target), attrs); + return this; + } + + @Override + public Path createLink(Path existing) throws IOException { + delegate.createLink(unwrap(existing)); + return this; + } + + @Override + public Path readSymbolicLink() throws IOException { + return wrap(delegate.readSymbolicLink()); + } + + @Override + public URI toUri() { + String ssp = delegate.toUri().getSchemeSpecificPart(); + return URI.create(fs.provider().getScheme() + ":" + ssp); + } + + @Override + public Path toAbsolutePath() { + return wrap(delegate.toAbsolutePath()); + } + + @Override + public Path toRealPath(boolean resolveLinks) throws IOException { + return wrap(delegate.toRealPath(resolveLinks)); + } + + @Override + public Path copyTo(Path target, CopyOption... options) throws IOException { + return wrap(delegate.copyTo(unwrap(target), options)); + } + + @Override + public Path moveTo(Path target, CopyOption... options) throws IOException { + return wrap(delegate.copyTo(unwrap(target), options)); + } + + private DirectoryStream wrap(final DirectoryStream stream) { + return new DirectoryStream() { + @Override + public Iterator iterator() { + final Iterator itr = stream.iterator(); + return new Iterator() { + @Override + public boolean hasNext() { + return itr.hasNext(); + } + @Override + public Path next() { + return wrap(itr.next()); + } + @Override + public void remove() { + itr.remove(); + } + }; + } + @Override + public void close() throws IOException { + stream.close(); + } + }; + } + + @Override + public DirectoryStream newDirectoryStream() throws IOException { + return wrap(delegate.newDirectoryStream()); + } + + @Override + public DirectoryStream newDirectoryStream(String glob) + throws IOException + { + return wrap(delegate.newDirectoryStream(glob)); + } + + @Override + public DirectoryStream newDirectoryStream(DirectoryStream.Filter filter) + throws IOException + { + return wrap(delegate.newDirectoryStream(filter)); + } + + @Override + public Path createFile(FileAttribute... attrs) throws IOException { + delegate.createFile(attrs); + return this; + } + + @Override + public Path createDirectory(FileAttribute... attrs) + throws IOException + { + delegate.createDirectory(attrs); + return this; + } + + @Override + public SeekableByteChannel newByteChannel(Set options, + FileAttribute... attrs) + throws IOException + { + return delegate.newByteChannel(options, attrs); + } + + @Override + public SeekableByteChannel newByteChannel(OpenOption... options) + throws IOException + { + return delegate.newByteChannel(options); + } + + @Override + public InputStream newInputStream(OpenOption... options) throws IOException { + return delegate.newInputStream(); + } + + @Override + public OutputStream newOutputStream(OpenOption... options) + throws IOException + { + return delegate.newOutputStream(options); + } + + @Override + public boolean isHidden() throws IOException { + return delegate.isHidden(); + } + + @Override + public void checkAccess(AccessMode... modes) throws IOException { + delegate.checkAccess(modes); + } + + @Override + public boolean exists() { + return delegate.exists(); + } + + @Override + public boolean notExists() { + return delegate.notExists(); + } + + @Override + public FileStore getFileStore() throws IOException { + return delegate.getFileStore(); + } + + @Override + public WatchKey register(WatchService watcher, + WatchEvent.Kind[] events, + WatchEvent.Modifier... modifiers) + { + throw new UnsupportedOperationException(); + } + + @Override + public WatchKey register(WatchService watcher, + WatchEvent.Kind... events) + { + throw new UnsupportedOperationException(); + } + + + @Override + public Iterator iterator() { + final Iterator itr = delegate.iterator(); + return new Iterator() { + @Override + public boolean hasNext() { + return itr.hasNext(); + } + @Override + public Path next() { + return wrap(itr.next()); + } + @Override + public void remove() { + itr.remove(); + } + }; + } + + @Override + public int compareTo(Path other) { + return delegate.compareTo(unwrap(other)); + } + + @Override + public boolean isSameFile(Path other) throws IOException { + return delegate.isSameFile(unwrap(other)); + } + + + @Override + public boolean equals(Object other) { + if (!(other instanceof PassThroughPath)) + return false; + return delegate.equals(unwrap((PassThroughPath)other)); + } + + @Override + public int hashCode() { + return delegate.hashCode(); + } + + @Override + public String toString() { + return delegate.toString(); + } + } +} diff --git a/jdk/test/java/nio/file/Path/PathOps.java b/jdk/test/java/nio/file/Path/PathOps.java index 6482d5e88b2..3517baacc16 100644 --- a/jdk/test/java/nio/file/Path/PathOps.java +++ b/jdk/test/java/nio/file/Path/PathOps.java @@ -22,7 +22,7 @@ */ /* @test - * @bug 4313887 6838333 + * @bug 4313887 6838333 6925932 * @summary Unit test for java.nio.file.Path path operations */ @@ -614,17 +614,34 @@ public class PathOps { test("/foo") .ends("foo") .ends("/foo") - .notEnds("/"); + .notEnds("fool"); test("/foo/bar") .ends("bar") .ends("foo/bar") .ends("/foo/bar") - .notEnds("/bar"); + .notEnds("ar") + .notEnds("barack") + .notEnds("/bar") + .notEnds("o/bar"); test("foo") - .ends("foo"); + .ends("foo") + .notEnds("oo") + .notEnds("oola"); test("foo/bar") .ends("bar") - .ends("foo/bar"); + .ends("foo/bar") + .notEnds("r") + .notEnds("barmaid") + .notEnds("/bar"); + test("foo/bar/gus") + .ends("gus") + .ends("bar/gus") + .ends("foo/bar/gus") + .notEnds("g") + .notEnds("/gus") + .notEnds("r/gus") + .notEnds("barack/gus") + .notEnds("bar/gust"); // elements test("a/b/c") diff --git a/jdk/test/java/nio/file/Path/delete_on_close.sh b/jdk/test/java/nio/file/Path/delete_on_close.sh index 198e99d7201..c7f3299e144 100644 --- a/jdk/test/java/nio/file/Path/delete_on_close.sh +++ b/jdk/test/java/nio/file/Path/delete_on_close.sh @@ -40,7 +40,7 @@ fi OS=`uname -s` case "$OS" in - Windows_* ) + Windows_* | CYGWIN* ) CLASSPATH="${TESTCLASSES};${TESTSRC}" ;; * ) diff --git a/jdk/test/java/nio/file/TestUtil.java b/jdk/test/java/nio/file/TestUtil.java index 2436a45992c..972dc250d87 100644 --- a/jdk/test/java/nio/file/TestUtil.java +++ b/jdk/test/java/nio/file/TestUtil.java @@ -30,17 +30,20 @@ public class TestUtil { private TestUtil() { } - public static Path createTemporaryDirectory() throws IOException { - Path tmpdir = Paths.get(System.getProperty("java.io.tmpdir")); + static Path createTemporaryDirectory(String where) throws IOException { + Path top = FileSystems.getDefault().getPath(where); Random r = new Random(); - Path dir; do { - dir = tmpdir.resolve("name" + r.nextInt()); + dir = top.resolve("name" + r.nextInt()); } while (dir.exists()); return dir.createDirectory(); } + static Path createTemporaryDirectory() throws IOException { + return createTemporaryDirectory(System.getProperty("java.io.tmpdir")); + } + static void removeAll(Path dir) { Files.walkFileTree(dir, new FileVisitor() { @Override diff --git a/jdk/test/java/nio/file/WatchService/LotsOfEvents.java b/jdk/test/java/nio/file/WatchService/LotsOfEvents.java new file mode 100644 index 00000000000..24770918afe --- /dev/null +++ b/jdk/test/java/nio/file/WatchService/LotsOfEvents.java @@ -0,0 +1,222 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @bug 6907760 6929532 + * @summary Tests WatchService behavior when lots of events are pending + * @library .. + * @run main/timeout=180 LotsOfEvents + */ + +import java.nio.file.*; +import static java.nio.file.StandardWatchEventKind.*; +import java.io.IOException; +import java.io.OutputStream; +import java.util.*; +import java.util.concurrent.TimeUnit; + +public class LotsOfEvents { + + static final Random rand = new Random(); + + public static void main(String[] args) throws Exception { + Path dir = TestUtil.createTemporaryDirectory(); + try { + testOverflowEvent(dir); + testModifyEventsQueuing(dir); + } finally { + TestUtil.removeAll(dir); + } + } + + /** + * Tests that OVERFLOW events are not retreived with other events. + */ + static void testOverflowEvent(Path dir) + throws IOException, InterruptedException + { + WatchService watcher = dir.getFileSystem().newWatchService(); + try { + dir.register(watcher, ENTRY_CREATE, ENTRY_DELETE); + + // create a lot of files + int n = 1024; + Path[] files = new Path[n]; + for (int i=0; i expectedKind, + int count) + throws IOException, InterruptedException + { + // wait for key to be signalled - the timeout is long to allow for + // polling implementations + WatchKey key = watcher.poll(15, TimeUnit.SECONDS); + if (key != null && count == 0) + throw new RuntimeException("Key was signalled (unexpected)"); + if (key == null && count > 0) + throw new RuntimeException("Key not signalled (unexpected)"); + + int nread = 0; + boolean gotOverflow = false; + while (key != null) { + List> events = key.pollEvents(); + for (WatchEvent event: events) { + WatchEvent.Kind kind = event.kind(); + if (kind == expectedKind) { + // expected event kind + if (++nread > count) + throw new RuntimeException("More events than expected!!"); + } else if (kind == OVERFLOW) { + // overflow event should not be retrieved with other events + if (events.size() > 1) + throw new RuntimeException("Overflow retrieved with other events"); + gotOverflow = true; + } else { + throw new RuntimeException("Unexpected event '" + kind + "'"); + } + } + if (!key.reset()) + throw new RuntimeException("Key is no longer valid"); + key = watcher.poll(2, TimeUnit.SECONDS); + } + + // check that all expected events were received or there was an overflow + if (nread < count && !gotOverflow) + throw new RuntimeException("Insufficient events"); + } + + /** + * Tests that check that ENTRY_MODIFY events are queued efficiently + */ + static void testModifyEventsQueuing(Path dir) + throws IOException, InterruptedException + { + // this test uses a random number of files + final int nfiles = 5 + rand.nextInt(10); + DirectoryEntry[] entries = new DirectoryEntry[nfiles]; + for (int i=0; i modified = new HashSet(); + for (WatchEvent event: key.pollEvents()) { + WatchEvent.Kind kind = event.kind(); + Path file = (kind == OVERFLOW) ? null : (Path)event.context(); + if (kind == ENTRY_MODIFY) { + boolean added = modified.add(file); + if (!added) { + throw new RuntimeException( + "ENTRY_MODIFY events not queued efficiently"); + } + } else { + if (file != null) modified.remove(file); + } + } + if (!key.reset()) + throw new RuntimeException("Key is no longer valid"); + key = watcher.poll(2, TimeUnit.SECONDS); + } + } + + } finally { + watcher.close(); + } + } + + static class DirectoryEntry { + private final Path file; + DirectoryEntry(Path file) { + this.file = file; + } + void create() throws IOException { + if (file.notExists()) + file.createFile(); + + } + void deleteIfExists() throws IOException { + file.deleteIfExists(); + } + void modifyIfExists() throws IOException { + if (file.exists()) { + OutputStream out = file.newOutputStream(StandardOpenOption.APPEND); + try { + out.write("message".getBytes()); + } finally { + out.close(); + } + } + } + } + +} diff --git a/jdk/test/java/security/IdentityScope/NoDefaultSystemScope.java b/jdk/test/java/security/IdentityScope/NoDefaultSystemScope.java new file mode 100644 index 00000000000..f2e6d5a9f50 --- /dev/null +++ b/jdk/test/java/security/IdentityScope/NoDefaultSystemScope.java @@ -0,0 +1,42 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6921001 + * @summary The default system identity scope is now null. + */ +import java.security.*; + +public class NoDefaultSystemScope { + + public static void main(String args[]) throws Exception { + IdentityScope s = IdentityScope.getSystemScope(); + + if (s != null) { + throw new Exception("The default system scope should be null"); + } + System.out.println("TEST PASSED"); + } +} + diff --git a/jdk/test/java/security/Provider/Turkish.java b/jdk/test/java/security/Provider/Turkish.java index 1934561785d..ddf7391d9fe 100644 --- a/jdk/test/java/security/Provider/Turkish.java +++ b/jdk/test/java/security/Provider/Turkish.java @@ -25,6 +25,7 @@ * @test * @bug 6220064 * @summary make sure everything works ok in the Turkish local (dotted/dotless i problem) + * @run main/othervm Turkish * @author Andreas Sterbenz */ diff --git a/jdk/test/java/text/Collator/Bug5047314.java b/jdk/test/java/text/Collator/Bug5047314.java new file mode 100644 index 00000000000..d0a4f29893a --- /dev/null +++ b/jdk/test/java/text/Collator/Bug5047314.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 5047314 + * @summary verify that compare() and getCollationKey() don't go into an infinite loop for unfinished Thai/Lao text. + * @run main/timeout=60 Bug5047314 + */ +import java.text.Collator; +import java.util.Locale; + +public class Bug5047314 { + + private static Collator colLao = Collator.getInstance(new Locale("lo")); + private static Collator colThai = Collator.getInstance(new Locale("th")); + + private static String[] textLao = { + "\u0ec0", "\u0ec1", "\u0ec2", "\u0ec3", "\u0ec4" + }; + private static String[] textThai = { + "\u0e40", "\u0e41", "\u0e42", "\u0e43", "\u0e44" + }; + + public static void main(String[] args) { + testLao1(); + testLao2(); + testThai1(); + testThai2(); + } + + private static void testLao1() { + System.out.print("Test(Lao 1) .... "); + for (int i = 0; i < textLao.length; i++) { + colLao.compare(textLao[i], textLao[i]); + } + System.out.println("Passed."); + } + + private static void testLao2() { + System.out.print("Test(Lao 2) .... "); + for (int i = 0; i < textLao.length; i++) { + colLao.compare(textLao[i], textLao[i]); + } + System.out.println("Passed."); + } + + private static void testThai1() { + System.out.print("Test(Thai 1) .... "); + for (int i = 0; i < textThai.length; i++) { + colThai.compare(textThai[i], textThai[i]); + } + System.out.println("Passed."); + } + + private static void testThai2() { + System.out.print("Test(Thai 2) .... "); + for (int i = 0; i < textThai.length; i++) { + colThai.getCollationKey(textThai[i]); + } + System.out.println("Passed."); + } + +} diff --git a/jdk/test/java/util/Currency/PropertiesTest.sh b/jdk/test/java/util/Currency/PropertiesTest.sh index b058c3d8534..420e9f92cea 100644 --- a/jdk/test/java/util/Currency/PropertiesTest.sh +++ b/jdk/test/java/util/Currency/PropertiesTest.sh @@ -34,7 +34,7 @@ case "$OS" in PS=":" FS="/" ;; - Windows* ) + Windows* | CYGWIN* ) PS=";" FS="\\" ;; diff --git a/jdk/test/java/util/PluggableLocale/ExecTest.sh b/jdk/test/java/util/PluggableLocale/ExecTest.sh index b68a28cd848..76b339ee4c3 100644 --- a/jdk/test/java/util/PluggableLocale/ExecTest.sh +++ b/jdk/test/java/util/PluggableLocale/ExecTest.sh @@ -62,7 +62,7 @@ case "$OS" in PS=":" FS="/" ;; - Windows* ) + Windows* | CYGWIN* ) PS=";" FS="\\" ;; diff --git a/jdk/test/java/util/ResourceBundle/Bug6299235Test.sh b/jdk/test/java/util/ResourceBundle/Bug6299235Test.sh index 6da631ebe4c..bb2d6a69165 100644 --- a/jdk/test/java/util/ResourceBundle/Bug6299235Test.sh +++ b/jdk/test/java/util/ResourceBundle/Bug6299235Test.sh @@ -35,7 +35,7 @@ case "$OS" in PATHSEP=":" FILESEP="/" ;; - Windows* ) + Windows* | CYGWIN* ) PATHSEP=";" FILESEP="\\" ;; @@ -63,7 +63,7 @@ else fi if [ -d "${JRE_EXT_DIR}" ]; then - NEW_EXT_DIR=${JRE_EXT_DIR}${PATHSEP}${TESTSRC} + NEW_EXT_DIR="${JRE_EXT_DIR}${PATHSEP}${TESTSRC}" else NEW_EXT_DIR=${TESTSRC} fi diff --git a/jdk/test/java/util/ResourceBundle/Control/ExpirationTest.sh b/jdk/test/java/util/ResourceBundle/Control/ExpirationTest.sh index 449162ccc54..ac89bc136c6 100644 --- a/jdk/test/java/util/ResourceBundle/Control/ExpirationTest.sh +++ b/jdk/test/java/util/ResourceBundle/Control/ExpirationTest.sh @@ -69,7 +69,7 @@ export LC_ALL HAS_S=NO case "`uname`" in -Windows*) +Windows* | CYGWIN* ) DEL=";" ;; SunOS) diff --git a/jdk/test/java/util/ServiceLoader/basic.sh b/jdk/test/java/util/ServiceLoader/basic.sh index 4f80b17f553..68695678738 100644 --- a/jdk/test/java/util/ServiceLoader/basic.sh +++ b/jdk/test/java/util/ServiceLoader/basic.sh @@ -50,9 +50,9 @@ case "$OS" in SEP='\;' ;; esac -JARD=`pwd`/x.jar -EXTD=`pwd`/x.ext -TESTD=`pwd`/x.test +JARD=x.jar +EXTD=x.ext +TESTD=x.test if [ \! -d $EXTD ]; then # Initialize diff --git a/jdk/test/java/util/TimeZone/TimeZoneDatePermissionCheck.java b/jdk/test/java/util/TimeZone/TimeZoneDatePermissionCheck.java new file mode 100644 index 00000000000..e80becbd8ad --- /dev/null +++ b/jdk/test/java/util/TimeZone/TimeZoneDatePermissionCheck.java @@ -0,0 +1,42 @@ +/* Testcase for PR381 Stackoverflow error with security manager, signed jars + * and -Djava.security.debug set. + * Copyright (c) 2009, Red Hat Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.util.Date; + +/** + * Test class. Create a test keystore and dummy cert, create a jar file to + * sign with the test class in it. Sign it run it with the security manager + * on, plus accesscontroller debugging, will go into infinite recursion + * trying to get enough permissions for printing Date of failing + * certificate, unless fix is applied. + */ +public class TimeZoneDatePermissionCheck +{ + public static void main(String[] args) + { + System.out.println(new Date()); + } +} diff --git a/jdk/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh b/jdk/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh new file mode 100644 index 00000000000..226228f1754 --- /dev/null +++ b/jdk/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh @@ -0,0 +1,58 @@ +# Testcase for PR381 Stackoverflow error with security manager, signed jars +# and -Djava.security.debug set. +# +# Copyright (c) 2009, Red Hat Inc. +# +# This code is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This code is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# @test +# @bug 6584033 +# @summary Stackoverflow error with security manager, signed jars and debug. +# @build TimeZoneDatePermissionCheck +# @run shell TimeZoneDatePermissionCheck.sh + +# Set default if not run under jtreg from test dir itself +if [ "${TESTCLASSES}" = "" ] ; then + TESTCLASSES="." +fi +if [ "${TESTJAVA}" = "" ] ; then + TESTJAVA=/usr +fi + +# create a test keystore and dummy cert +rm -f ${TESTCLASSES}/timezonedatetest.store +${TESTJAVA}/bin/keytool -genkeypair -alias testcert \ + -keystore ${TESTCLASSES}/timezonedatetest.store \ + -storepass testpass -validity 360 \ + -dname "cn=Mark Wildebeest, ou=FreeSoft, o=Red Hat, c=NL" \ + -keypass testpass + +# create a jar file to sign with the test class in it. +rm -f ${TESTCLASSES}/timezonedatetest.jar +${TESTJAVA}/bin/jar cf \ + ${TESTCLASSES}/timezonedatetest.jar \ + -C ${TESTCLASSES} TimeZoneDatePermissionCheck.class + +# sign it +${TESTJAVA}/bin/jarsigner \ + -keystore ${TESTCLASSES}/timezonedatetest.store \ + -storepass testpass ${TESTCLASSES}/timezonedatetest.jar testcert + +# run it with the security manager on, plus accesscontroller debugging +# will go into infinite recursion trying to get enough permissions for +# printing Date of failing certificate unless fix is applied. +${TESTJAVA}/bin/java -Djava.security.manager \ + -Djava.security.debug=access,failure,policy \ + -cp ${TESTCLASSES}/timezonedatetest.jar TimeZoneDatePermissionCheck diff --git a/jdk/test/java/util/concurrent/BlockingQueue/CancelledProducerConsumerLoops.java b/jdk/test/java/util/concurrent/BlockingQueue/CancelledProducerConsumerLoops.java index b704bb12c35..a21cfa06f38 100644 --- a/jdk/test/java/util/concurrent/BlockingQueue/CancelledProducerConsumerLoops.java +++ b/jdk/test/java/util/concurrent/BlockingQueue/CancelledProducerConsumerLoops.java @@ -146,13 +146,13 @@ public class CancelledProducerConsumerLoops { oneRun(new ArrayBlockingQueue(CAPACITY), pairs, iters); oneRun(new LinkedBlockingQueue(CAPACITY), pairs, iters); oneRun(new LinkedBlockingDeque(CAPACITY), pairs, iters); + oneRun(new SynchronousQueue(), pairs, iters / 8); + + /* TODO: unbounded queue implementations are prone to OOME + oneRun(new PriorityBlockingQueue(iters / 2 * pairs), pairs, iters / 4); oneRun(new LinkedTransferQueue(), pairs, iters); oneRun(new LTQasSQ(), pairs, iters); oneRun(new HalfSyncLTQ(), pairs, iters); - oneRun(new SynchronousQueue(), pairs, iters / 8); - - /* PriorityBlockingQueue is unbounded - oneRun(new PriorityBlockingQueue(iters / 2 * pairs), pairs, iters / 4); */ } diff --git a/jdk/test/java/util/jar/JarFile/TurkCert.java b/jdk/test/java/util/jar/JarFile/TurkCert.java index 8be8fd837ab..da044a9ace6 100644 --- a/jdk/test/java/util/jar/JarFile/TurkCert.java +++ b/jdk/test/java/util/jar/JarFile/TurkCert.java @@ -26,6 +26,7 @@ * @bug 4624534 * @summary Make sure jar certificates work for Turkish locale * @author kladko + * @run main/othervm TurkCert */ import java.util.*; diff --git a/jdk/test/java/util/regex/RegExTest.java b/jdk/test/java/util/regex/RegExTest.java index 20b8041d284..c2748f071c4 100644 --- a/jdk/test/java/util/regex/RegExTest.java +++ b/jdk/test/java/util/regex/RegExTest.java @@ -32,7 +32,7 @@ * 4872664 4803179 4892980 4900747 4945394 4938995 4979006 4994840 4997476 * 5013885 5003322 4988891 5098443 5110268 6173522 4829857 5027748 6376940 * 6358731 6178785 6284152 6231989 6497148 6486934 6233084 6504326 6635133 - * 6350801 6676425 6878475 + * 6350801 6676425 6878475 6919132 */ import java.util.regex.*; @@ -134,6 +134,7 @@ public class RegExTest { toMatchResultTest(); surrogatesInClassTest(); namedGroupCaptureTest(); + nonBmpClassComplementTest(); if (failure) throw new RuntimeException("Failure in the RE handling."); @@ -365,7 +366,6 @@ public class RegExTest { m.find(); if (!m.hitEnd()) failCount++; - report("hitEnd from a Slice"); } @@ -3514,4 +3514,29 @@ public class RegExTest { null); report("NamedGroupCapture"); } + + // This is for bug 6969132 + private static void nonBmpClassComplementTest() throws Exception { + Pattern p = Pattern.compile("\\P{Lu}"); + Matcher m = p.matcher(new String(new int[] {0x1d400}, 0, 1)); + if (m.find() && m.start() == 1) + failCount++; + + // from a unicode category + p = Pattern.compile("\\P{Lu}"); + m = p.matcher(new String(new int[] {0x1d400}, 0, 1)); + if (m.find()) + failCount++; + if (!m.hitEnd()) + failCount++; + + // block + p = Pattern.compile("\\P{InMathematicalAlphanumericSymbols}"); + m = p.matcher(new String(new int[] {0x1d400}, 0, 1)); + if (m.find() && m.start() == 1) + failCount++; + + report("NonBmpClassComplement"); + } + } diff --git a/jdk/test/java/util/zip/ZipFile/ReadZip.java b/jdk/test/java/util/zip/ZipFile/ReadZip.java index 99fb7baaf39..78f202cd302 100644 --- a/jdk/test/java/util/zip/ZipFile/ReadZip.java +++ b/jdk/test/java/util/zip/ZipFile/ReadZip.java @@ -22,7 +22,7 @@ */ /* @test - @bug 4241361 4842702 4985614 6646605 5032358 + @bug 4241361 4842702 4985614 6646605 5032358 6923692 @summary Make sure we can read a zip file. */ @@ -59,7 +59,7 @@ public class ReadZip { FileInputStream fis = new FileInputStream( new File(System.getProperty("test.src", "."), "input.zip")); - File newZip = new File(System.getProperty("test.src", "."), + File newZip = new File(System.getProperty("test.dir", "."), "input2.zip"); FileOutputStream fos = new FileOutputStream(newZip); diff --git a/jdk/test/javax/imageio/stream/StreamCloserLeak/run_test.sh b/jdk/test/javax/imageio/stream/StreamCloserLeak/run_test.sh index af3e428cb30..f60cfd5d52a 100644 --- a/jdk/test/javax/imageio/stream/StreamCloserLeak/run_test.sh +++ b/jdk/test/javax/imageio/stream/StreamCloserLeak/run_test.sh @@ -92,7 +92,7 @@ case "$OS" in TMP="/tmp" ;; - Windows_95 | Windows_98 | Windows_NT | Windows_ME ) + Windows_95 | Windows_98 | Windows_NT | Windows_ME | CYGWIN* ) VAR="A different value for Win32" DEFAULT_JDK=/usr/local/java/jdk1.2/win32 FILESEP="\\" diff --git a/jdk/test/javax/print/DialogMargins.java b/jdk/test/javax/print/DialogMargins.java new file mode 100644 index 00000000000..5168bb140d1 --- /dev/null +++ b/jdk/test/javax/print/DialogMargins.java @@ -0,0 +1,244 @@ +/* + * Copyright 2001-2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/** + * @test + * @bug 4485755 6361370 6448717 5080051 + * @summary dialog doesn't have way to specify margins + * for 6361370, verify exception for offline printer in Windows + * for 6448717, faster display of print dialog + * for 6500903, verify status of printer if accepting jobs or not + * @author prr + * @run main/manual DialogMargins + */ + +import java.awt.*; +import java.awt.event.*; +import java.awt.print.*; +import javax.print.*; +import javax.print.attribute.*; +import javax.print.attribute.standard.*; + +public class DialogMargins extends Frame { + + public DialogMargins() { + super("Dialog Margins Test"); + + Button printButton = new Button ("Print ..."); + add("Center", printButton); + printButton.addActionListener(new ActionListener() { + public void actionPerformed (ActionEvent e) { + new MarginsPrinter(); + } + }); + + addWindowListener (new WindowAdapter() { + public void windowClosing (WindowEvent e) { + dispose(); + } + + }); + + pack(); + setVisible (true); + } + +class MarginsPrinter implements Printable { + + PrinterJob myPrinterJob; + PageFormat myPageFormat; + + public MarginsPrinter() { + PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet(); + //aset.add(MediaSizeName.ISO_A4); + //aset.add(new MediaPrintableArea(0f,0f,210f,297f,MediaPrintableArea.MM)); + myPrinterJob = PrinterJob.getPrinterJob(); + myPageFormat = myPrinterJob.pageDialog(aset); + myPrinterJob.setPrintable(this, myPageFormat); + //myPrinterJob.setPrintable(this); + if (myPrinterJob.printDialog(aset)) { + try { + //PrintRequestAttributeSet newaset = + //new HashPrintRequestAttributeSet(); + myPrinterJob.print(aset); + + } catch (PrinterException pe ) { + System.out.println("DialogMargins Exception caught:" + pe); + } + } + } + + public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) { + + if (pageIndex > 0) { + return Printable.NO_SUCH_PAGE; + } + + Graphics2D g2d = (Graphics2D)graphics; + g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY()); + g2d.drawString("ORIGIN("+pageFormat.getImageableX()+","+ + pageFormat.getImageableY()+")", 20, 20); + g2d.drawString("X THIS WAY", 200, 50); + g2d.drawString("Y THIS WAY", 60 , 200); + g2d.drawString("Graphics is " + g2d.getClass().getName(), 100, 100); + g2d.drawRect(0,0,(int)pageFormat.getImageableWidth(), + (int)pageFormat.getImageableHeight()); + g2d.setColor(Color.black); + g2d.drawRect(1,1,(int)pageFormat.getImageableWidth()-2, + (int)pageFormat.getImageableHeight()-2); + + return Printable.PAGE_EXISTS; + } + +} + public static void main( String[] args) { + + String[] instructions = + { + "You must have a printer available to perform this test", + "Specify various pageformats and compare the printed results with the", + "request." + }; + Sysout.createDialog( ); + Sysout.printInstructions( instructions ); + + new DialogMargins(); + } +} + + +class Sysout { + private static TestDialog dialog; + + public static void createDialogWithInstructions( String[] instructions ) + { + dialog = new TestDialog( new Frame(), "Instructions" ); + dialog.printInstructions( instructions ); + dialog.show(); + println( "Any messages for the tester will display here." ); + } + + public static void createDialog( ) + { + dialog = new TestDialog( new Frame(), "Instructions" ); + String[] defInstr = { "Instructions will appear here. ", "" } ; + dialog.printInstructions( defInstr ); + dialog.show(); + println( "Any messages for the tester will display here." ); + } + + + public static void printInstructions( String[] instructions ) + { + dialog.printInstructions( instructions ); + } + + + public static void println( String messageIn ) + { + dialog.displayMessage( messageIn ); + } + +}// Sysout class + +/** + This is part of the standard test machinery. It provides a place for the + test instructions to be displayed, and a place for interactive messages + to the user to be displayed. + To have the test instructions displayed, see Sysout. + To have a message to the user be displayed, see Sysout. + Do not call anything in this dialog directly. + */ +class TestDialog extends Dialog { + + TextArea instructionsText; + TextArea messageText; + int maxStringLength = 80; + + //DO NOT call this directly, go through Sysout + public TestDialog( Frame frame, String name ) + { + super( frame, name ); + int scrollBoth = TextArea.SCROLLBARS_BOTH; + instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); + add( "North", instructionsText ); + + messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); + add("Center", messageText); + + pack(); + + show(); + }// TestDialog() + + //DO NOT call this directly, go through Sysout + public void printInstructions( String[] instructions ) + { + //Clear out any current instructions + instructionsText.setText( "" ); + + //Go down array of instruction strings + + String printStr, remainingStr; + for( int i=0; i < instructions.length; i++ ) + { + //chop up each into pieces maxSringLength long + remainingStr = instructions[ i ]; + while( remainingStr.length() > 0 ) + { + //if longer than max then chop off first max chars to print + if( remainingStr.length() >= maxStringLength ) + { + //Try to chop on a word boundary + int posOfSpace = remainingStr. + lastIndexOf( ' ', maxStringLength - 1 ); + + if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; + + printStr = remainingStr.substring( 0, posOfSpace + 1 ); + remainingStr = remainingStr.substring( posOfSpace + 1 ); + } + //else just print + else + { + printStr = remainingStr; + remainingStr = ""; + } + + instructionsText.append( printStr + "\n" ); + + }// while + + }// for + + }//printInstructions() + + //DO NOT call this directly, go through Sysout + public void displayMessage( String messageIn ) + { + messageText.append( messageIn + "\n" ); + } + + }// TestDialog class diff --git a/jdk/test/javax/print/StreamPrintingOrientation.java b/jdk/test/javax/print/StreamPrintingOrientation.java new file mode 100644 index 00000000000..d0a4ec534a3 --- /dev/null +++ b/jdk/test/javax/print/StreamPrintingOrientation.java @@ -0,0 +1,120 @@ +/* + * Copyright 2003-2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 4904236 + * @summary You would see a cross-platform print dialog being popped up. Check whether orientation is shown as LANDSCAPE. Click 'OK'. 'streamexample.ps' will be created in the same dir where this application was executed. Pass if the orientation in the ps file is landscape. + * @run main/manual StreamPrintingOrientation + */ + +import java.awt.*; +import java.awt.print.*; +import javax.print.*; +import javax.print.attribute.standard.*; +import javax.print.attribute.*; +import java.io.FileOutputStream; +import java.io.File; +import java.util.Locale; + +class StreamPrintingOrientation implements Printable { + /** + * Constructor + */ + public StreamPrintingOrientation() { + super(); + } + /** + * Starts the application. + */ + public static void main(java.lang.String[] args) { + StreamPrintingOrientation pd = new StreamPrintingOrientation(); + PrinterJob pj = PrinterJob.getPrinterJob(); + HashPrintRequestAttributeSet prSet = new HashPrintRequestAttributeSet(); + PrintService service = null; + + FileOutputStream fos = null; + File f = null, f1 = null; + String mType = "application/postscript"; + + try { + f = new File("streamexample.ps"); + fos = new FileOutputStream(f); + StreamPrintServiceFactory[] factories = PrinterJob.lookupStreamPrintServices(mType); + if (factories.length > 0) + service = factories[0].getPrintService(fos); + + if (service != null) { + System.out.println("Stream Print Service "+service); + pj.setPrintService(service); + } else { + throw new RuntimeException("No stream Print Service available."); + } + } catch (Exception e) { + e.printStackTrace(); + } + + pj.setPrintable(pd); + prSet.add(OrientationRequested.LANDSCAPE); + prSet.add(new Copies(3)); + prSet.add(new JobName("orientation test", null)); + System.out.println("open PrintDialog.."); + if (pj.printDialog(prSet)) { + try { + System.out.println("\nValues in attr set passed to print method"); + Attribute attr[] = prSet.toArray(); + for (int x = 0; x < attr.length; x ++) { + System.out.println("Name "+attr[x].getName()+" "+attr[x]); + } + System.out.println("About to print the data ..."); + if (service != null) { + System.out.println("TEST: calling Print"); + pj.print(prSet); + System.out.println("TEST: Printed"); + } + } + catch (PrinterException pe) { + pe.printStackTrace(); + } + } + + } + + //printable interface + public int print(Graphics g, PageFormat pf, int pi) throws PrinterException { + + if (pi > 0) { + return Printable.NO_SUCH_PAGE; + } + // Simply draw two rectangles + Graphics2D g2 = (Graphics2D)g; + g2.setColor(Color.black); + g2.translate(pf.getImageableX(), pf.getImageableY()); + System.out.println("StreamPrinting Test Width "+pf.getWidth()+" Height "+pf.getHeight()); + g2.drawRect(1,1,200,300); + g2.drawRect(1,1,25,25); + return Printable.PAGE_EXISTS; + } +} diff --git a/jdk/test/javax/print/attribute/AttributeTest.java b/jdk/test/javax/print/attribute/AttributeTest.java new file mode 100644 index 00000000000..c9ea142686f --- /dev/null +++ b/jdk/test/javax/print/attribute/AttributeTest.java @@ -0,0 +1,70 @@ +/* + * Copyright 2006-2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6387255 + * @summary Tests conflict of Media values returned by isAttrValueSupported and getSupportedAttrValues. No runtime exception should be thrown. + * @run main AttributeTest + */ +import javax.print.*; +import javax.print.attribute.standard.*; +import javax.print.attribute.*; + +public class AttributeTest { + + public AttributeTest() { + + PrintService service[] = PrintServiceLookup.lookupPrintServices(null, null); + + if (service.length == 0) { + throw new RuntimeException("No printer found. TEST ABORTED"); + } + + for (int x = 0; x < service.length; x ++) { + DocFlavor flavors[] = service[x].getSupportedDocFlavors(); + + for (int y = 0; y < flavors.length; y ++) { + Object attrVal = service[x].getSupportedAttributeValues(Media.class, flavors[y], null); + if (attrVal == null) { + continue; + } + Media attr[] = (Media[]) attrVal; + for (int z = 0; z < attr.length; z ++) { + if (!service[x].isAttributeValueSupported(attr[z], flavors[y], null)) { + throw new RuntimeException("ERROR: There is a conflict between getSupportedAttrValues " + + " and isAttributeValueSupported, for the attribute: " + attr[z] + + ", where the flavor is: " + flavors[y] + " and the print service is: " + + service[x] + "\n"); + } + } + } + } + + System.out.println("Test Passed"); + } + + public static void main (String args[]) { + AttributeTest test = new AttributeTest(); + } +} diff --git a/jdk/test/javax/print/attribute/ServiceDialogTest.java b/jdk/test/javax/print/attribute/ServiceDialogTest.java new file mode 100644 index 00000000000..a1d6006b8e3 --- /dev/null +++ b/jdk/test/javax/print/attribute/ServiceDialogTest.java @@ -0,0 +1,307 @@ +/* + * Copyright 2004-2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + + +/** + * @test + * @bug 4910388 4871089 4998624 + * @summary Confirm that + * 1. After choosing Reverse Landscape in the system default print + * Print Service (2nd in the list), it + * will reset to portrait in "Test Printer" + * 2. Print To File button is not cleared when switching between the + * 2nd service (system default printer) and Test Printer. + * 3. Make sure "Postscript" printer is the default and make sure the + * "print to file" button is disabled. File Dialog should not be + * shown after pressing print button. + * + * @run main/manual ServiceDialogTest + */ +import java.awt.*; +import javax.print.*; +import javax.print.attribute.standard.*; +import javax.print.attribute.*; +import javax.print.event.*; +import java.io.*; +import java.util.Locale; + +public class ServiceDialogTest { + /** + * Constructor + */ + public ServiceDialogTest() { + super(); + } + /** + * Starts the application. + */ + public static void main(java.lang.String[] args) { + ServiceDialogTest pd = new ServiceDialogTest(); + PrintService services[] = new PrintService[3]; + services[1] = PrintServiceLookup.lookupDefaultPrintService(); + + FileOutputStream fos = null; + File f = null; + String mType = "application/postscript"; + DocFlavor flavor = DocFlavor.INPUT_STREAM.JPEG; + try { + f = new File("streamexample.ps"); + fos = new FileOutputStream(f); + StreamPrintServiceFactory[] factories = StreamPrintServiceFactory.lookupStreamPrintServiceFactories(flavor, mType); + if (factories.length > 0) { + services[0] = factories[0].getPrintService(fos); + } else { + throw new RuntimeException("No StreamPrintService available which would support "+flavor"); + } + + services[2] = new TestPrintService("Test Printer"); + + //System.out.println("is "+flavor+" supported? "+services[0].isDocFlavorSupported(flavor)); + //System.out.println("is Orientation supported? "+services[0].isAttributeCategorySupported(OrientationRequested.class)); + //System.out.println("is REVERSE PORTRAIT supported ? "+services[0].isAttributeValueSupported(OrientationRequested.REVERSE_PORTRAIT, flavor, null)); + + HashPrintRequestAttributeSet prSet = new HashPrintRequestAttributeSet(); + prSet.add(new Destination(new File("./dest.prn").toURI())); + PrintService selService = ServiceUI.printDialog(null, 200, 200, services, services[0], flavor, prSet); + Attribute attr[] = prSet.toArray(); + for (int x = 0; x < attr.length; x ++) { + System.out.println(attr[x]); + } + + //DocPrintJob pj = service.createPrintJob(); + //PrintDocument prDoc = new PrintDocument(); + //pj.print(prDoc, null); + + } catch (Exception e) { + e.printStackTrace(); + } + } +} + + +class TestPrintService implements PrintService +{ + + private static DocFlavor textByteFlavor = null; + private static final DocFlavor supportedDocFlavors[] = (new DocFlavor[] { + javax.print.DocFlavor.INPUT_STREAM.JPEG + }); + + private static final Class serviceAttrCats[] = (new Class[] { + javax.print.attribute.standard.PrinterName.class + }); + + private static final Class otherAttrCats[] = (new Class [] { + javax.print.attribute.standard.Copies.class, + javax.print.attribute.standard.OrientationRequested.class, + javax.print.attribute.standard.Destination.class, + }); + + private String printer = null; + + public TestPrintService() { + } + + public TestPrintService(String printerName) { + if (printerName == null) { + throw new IllegalArgumentException("null printer name"); + } else { + printer = printerName; + } + } + + public String getName() + { + return printer; + } + + + public DocPrintJob createPrintJob() + { + return null; + } + + public PrintServiceAttributeSet getUpdatedAttributes() + { + return null; + } + + + public void addPrintServiceAttributeListener(PrintServiceAttributeListener printserviceattributelistener) + { + } + + public void removePrintServiceAttributeListener(PrintServiceAttributeListener printserviceattributelistener) + { + } + + public PrintServiceAttribute getAttribute(Class category) + { + return null; + } + + public PrintServiceAttributeSet getAttributes() + { + HashPrintServiceAttributeSet aSet = new HashPrintServiceAttributeSet(); + return aSet; + } + + public DocFlavor[] getSupportedDocFlavors() + { + int i = supportedDocFlavors.length; + DocFlavor adocflavor[] = new DocFlavor[i]; + System.arraycopy(supportedDocFlavors, 0, adocflavor, 0, i); + return adocflavor; + } + + public boolean isDocFlavorSupported(DocFlavor docflavor) + { + for (int i = 0; i < supportedDocFlavors.length; i++) { + if (docflavor.equals(supportedDocFlavors[i])) { + return true; + } + } + return false; + } + + public Class[] getSupportedAttributeCategories() + { + int i = otherAttrCats.length; + Class aclass[] = new Class[i]; + System.arraycopy(otherAttrCats, 0, aclass, 0, otherAttrCats.length); + return aclass; + } + + public boolean isAttributeCategorySupported(Class category) + { + if (category == null) { + throw new NullPointerException("null category"); + } + + for (int i = 0; i < otherAttrCats.length; i++) { + if (category == otherAttrCats[i]) { + return true; + } + } + return false; + } + + public boolean isAttributeValueSupported(Attribute attrval, DocFlavor flavor, AttributeSet attributes) { + + if (attrval == OrientationRequested.PORTRAIT) + return true; + else if (attrval == OrientationRequested.LANDSCAPE) + return true; + else + return false; + } + + public Object getDefaultAttributeValue(Class category) + { + if (category == null) { + throw new NullPointerException("null category"); + } + if (category == javax.print.attribute.standard.Copies.class) + return new Copies(1); + + if (category == javax.print.attribute.standard.OrientationRequested.class) + return OrientationRequested.PORTRAIT; + + return null; + } + + public Object getSupportedAttributeValues(Class category, DocFlavor docflavor, AttributeSet attributeset) + { + if (category == null) { + throw new NullPointerException("null category"); + } + + if (docflavor != null) { + if (!isDocFlavorSupported(docflavor)) { + throw new IllegalArgumentException(docflavor + " is an unsupported flavor"); + } + } + if (!isAttributeCategorySupported(category)) { + return null; + } + if (category == javax.print.attribute.standard.Copies.class ) { + return new CopiesSupported(1, 5); + } + if (category == javax.print.attribute.standard.OrientationRequested.class ) { + OrientationRequested req[] = { OrientationRequested.PORTRAIT, OrientationRequested.LANDSCAPE }; + return req; + } + + return null; + } + + public AttributeSet getUnsupportedAttributes(DocFlavor docflavor, AttributeSet attributeset) { + + if (docflavor != null && !isDocFlavorSupported(docflavor)) { + throw new IllegalArgumentException("flavor " + docflavor + "is not supported"); + } + if (attributeset == null) { + return null; + } + + HashAttributeSet hashattributeset = new HashAttributeSet(); + Attribute attributearray[] = attributeset.toArray(); + for (int i = 0; i < attributearray.length; i++) { + try { + Attribute attribute = attributearray[i]; + if (!isAttributeCategorySupported(attribute.getCategory())) { + hashattributeset.add(attribute); + } else { + if (!isAttributeValueSupported(attribute, docflavor, attributeset)) { + hashattributeset.add(attribute); + } + } + } + catch (ClassCastException classcastexception) { + + } + } + + if (hashattributeset.isEmpty()) { + return null; + } + return hashattributeset; + } + + public ServiceUIFactory getServiceUIFactory() { + return null; + } + + public String toString() { + return "Printer : " + getName(); + } + + public boolean equals(Object obj) { + return obj == this || (obj instanceof TestPrintService) && ((TestPrintService)obj).getName().equals(getName()); + } + + public int hashCode() { + return getClass().hashCode() + getName().hashCode(); + } + +} diff --git a/jdk/test/javax/print/attribute/SidesPageRangesTest.java b/jdk/test/javax/print/attribute/SidesPageRangesTest.java index cf487616137..73c23a7ed42 100644 --- a/jdk/test/javax/print/attribute/SidesPageRangesTest.java +++ b/jdk/test/javax/print/attribute/SidesPageRangesTest.java @@ -64,7 +64,7 @@ public class SidesPageRangesTest { System.out.println("\nPageRanges Attribute category is supported"); } else { System.out.println("\nPageRanges Attribute category is not supported. terminating..."); - System.exit(1); + return; } flavors = defService.getSupportedDocFlavors(); diff --git a/jdk/test/javax/script/CommonSetup.sh b/jdk/test/javax/script/CommonSetup.sh index e76da82125b..4a66829131f 100644 --- a/jdk/test/javax/script/CommonSetup.sh +++ b/jdk/test/javax/script/CommonSetup.sh @@ -49,6 +49,12 @@ case "$OS" in OS="Windows" FS="\\" ;; + CYGWIN* ) + PS=";" + OS="Windows" + FS="\\" + isCygwin=true + ;; * ) echo "Unrecognized system!" exit 1; diff --git a/jdk/test/javax/script/ProviderTest.sh b/jdk/test/javax/script/ProviderTest.sh index 211d9edc1d9..a32383e4078 100644 --- a/jdk/test/javax/script/ProviderTest.sh +++ b/jdk/test/javax/script/ProviderTest.sh @@ -46,5 +46,5 @@ $JAR -cf ${TESTCLASSES}/dummy.jar \ echo "Running test ..." $JAVA -classpath \ - ${TESTCLASSES}${PS}${TESTCLASSES}/dummy.jar \ + "${TESTCLASSES}${PS}${TESTCLASSES}/dummy.jar" \ ProviderTest diff --git a/jdk/test/javax/sound/midi/Gervill/SoftChannel/NoteOverFlowTest2.java b/jdk/test/javax/sound/midi/Gervill/SoftChannel/NoteOverFlowTest2.java new file mode 100644 index 00000000000..992b26ea350 --- /dev/null +++ b/jdk/test/javax/sound/midi/Gervill/SoftChannel/NoteOverFlowTest2.java @@ -0,0 +1,103 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + @summary Test SoftChannel overflow test 2 */ + +import java.util.HashMap; +import java.util.Map; + +import javax.sound.midi.MidiChannel; +import javax.sound.midi.Patch; +import javax.sound.midi.VoiceStatus; +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; + +import com.sun.media.sound.AudioSynthesizer; +import com.sun.media.sound.SF2Instrument; +import com.sun.media.sound.SF2InstrumentRegion; +import com.sun.media.sound.SF2Layer; +import com.sun.media.sound.SF2LayerRegion; +import com.sun.media.sound.SF2Region; +import com.sun.media.sound.SF2Sample; +import com.sun.media.sound.SF2Soundbank; +import com.sun.media.sound.SoftSynthesizer; + +public class NoteOverFlowTest2 { + + public static void main(String[] args) throws Exception + { + // Create instance of the synthesizer with very low polyphony + AudioSynthesizer synth = new SoftSynthesizer(); + AudioFormat format = new AudioFormat(44100, 16, 2, true, false); + Map p = new HashMap(); + p.put("max polyphony", new Integer(5)); + AudioInputStream stream = synth.openStream(format, p); + + // Create instrument with too many regions (more than max polyphony) + SF2Soundbank sf2 = new SF2Soundbank(); + + SF2Sample sample = new SF2Sample(sf2); + sample.setName("test sample"); + sample.setData(new byte[100]); + sample.setSampleRate(44100); + sample.setOriginalPitch(20); + sf2.addResource(sample); + + SF2Layer layer = new SF2Layer(sf2); + layer.setName("test layer"); + sf2.addResource(layer); + + for (int i = 0; i < 100; i++) { + SF2LayerRegion region = new SF2LayerRegion(); + region.setSample(sample); + layer.getRegions().add(region); + } + + SF2Instrument ins = new SF2Instrument(sf2); + ins.setPatch(new Patch(0,0)); + ins.setName("test instrument"); + sf2.addInstrument(ins); + + SF2InstrumentRegion insregion = new SF2InstrumentRegion(); + insregion.setLayer(layer); + ins.getRegions().add(insregion); + + // Load the test soundbank into the synthesizer + synth.unloadAllInstruments(synth.getDefaultSoundbank()); + synth.loadAllInstruments(sf2); + + // Send out one midi on message + MidiChannel ch1 = synth.getChannels()[0]; + ch1.programChange(0); + ch1.noteOn(64, 64); + + // Read 1 sec from stream + stream.skip(format.getFrameSize() * ((int)(format.getFrameRate() * 2))); + + // Close the synthesizer after use + synth.close(); + } +} diff --git a/jdk/test/javax/sound/midi/Gervill/SoftReceiver/GetMidiDevice.java b/jdk/test/javax/sound/midi/Gervill/SoftReceiver/GetMidiDevice.java new file mode 100644 index 00000000000..8839111d8fe --- /dev/null +++ b/jdk/test/javax/sound/midi/Gervill/SoftReceiver/GetMidiDevice.java @@ -0,0 +1,48 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + @summary Test SoftReceiver getMidiDevice method */ + +import javax.sound.midi.Receiver; + +import com.sun.media.sound.AudioSynthesizer; +import com.sun.media.sound.SoftReceiver; +import com.sun.media.sound.SoftSynthesizer; + +public class GetMidiDevice { + + public static void main(String[] args) throws Exception { + + AudioSynthesizer synth = new SoftSynthesizer(); + synth.openStream(null, null); + Receiver recv = synth.getReceiver(); + if (((SoftReceiver) recv).getMidiDevice() != synth) { + throw new Exception("SoftReceiver.getMidiDevice() doesn't return " + + "instance of the synthesizer"); + } + synth.close(); + } +} \ No newline at end of file diff --git a/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/TestPreciseTimestampRendering.java b/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/TestPreciseTimestampRendering.java new file mode 100644 index 00000000000..d4d55bb3f96 --- /dev/null +++ b/jdk/test/javax/sound/midi/Gervill/SoftSynthesizer/TestPreciseTimestampRendering.java @@ -0,0 +1,208 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + @summary Test rendering when using precise timestamps */ + +import java.util.Arrays; +import java.util.Random; + +import javax.sound.midi.MidiChannel; +import javax.sound.midi.Receiver; +import javax.sound.midi.ShortMessage; +import javax.sound.midi.Soundbank; +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; + +import com.sun.media.sound.AudioFloatConverter; +import com.sun.media.sound.AudioSynthesizer; +import com.sun.media.sound.ModelAbstractChannelMixer; +import com.sun.media.sound.ModelChannelMixer; +import com.sun.media.sound.SF2Instrument; +import com.sun.media.sound.SF2InstrumentRegion; +import com.sun.media.sound.SF2Layer; +import com.sun.media.sound.SF2LayerRegion; +import com.sun.media.sound.SF2Sample; +import com.sun.media.sound.SF2Soundbank; +import com.sun.media.sound.SimpleInstrument; +import com.sun.media.sound.SimpleSoundbank; +import com.sun.media.sound.SoftSynthesizer; + +public class TestPreciseTimestampRendering { + + public static AudioFormat format = new AudioFormat(44100, 16, 1, true, + false); + + public static SF2Soundbank createTestSoundbank() { + // Create impulse instrument + // used to measure timing of note-on playback + SF2Soundbank soundbank = new SF2Soundbank(); + float[] data = new float[100]; + Arrays.fill(data, 0); + data[0] = 1.0f; + byte[] bdata = new byte[data.length * format.getFrameSize()]; + AudioFloatConverter.getConverter(format).toByteArray(data, bdata); + + SF2Sample sample = new SF2Sample(soundbank); + sample.setName("Test Sample"); + sample.setData(bdata); + sample.setSampleRate((long) format.getSampleRate()); + sample.setOriginalPitch(69); + soundbank.addResource(sample); + + SF2Layer layer = new SF2Layer(soundbank); + layer.setName("Test Layer"); + soundbank.addResource(layer); + SF2LayerRegion region = new SF2LayerRegion(); + region.setSample(sample); + layer.getRegions().add(region); + + SF2Instrument ins = new SF2Instrument(soundbank); + ins.setName("Test Instrument"); + soundbank.addInstrument(ins); + SF2InstrumentRegion insregion = new SF2InstrumentRegion(); + insregion.setLayer(layer); + ins.getRegions().add(insregion); + + return soundbank; + } + + public static Soundbank createTestSoundbankWithChannelMixer() { + SF2Soundbank soundbank = createTestSoundbank(); + + SimpleSoundbank simplesoundbank = new SimpleSoundbank(); + SimpleInstrument simpleinstrument = new SimpleInstrument() { + + public ModelChannelMixer getChannelMixer(MidiChannel channel, + AudioFormat format) { + return new ModelAbstractChannelMixer() { + boolean active = true; + + public boolean process(float[][] buffer, int offset, int len) { + for (int i = 0; i < buffer.length; i++) { + float[] cbuffer = buffer[i]; + for (int j = 0; j < cbuffer.length; j++) { + cbuffer[j] = -cbuffer[j]; + } + } + return active; + } + + public void stop() { + active = false; + } + }; + } + + }; + simpleinstrument.add(soundbank.getInstruments()[0]); + simplesoundbank.addInstrument(simpleinstrument); + + return simplesoundbank; + } + + public static void main(String[] args) throws Exception { + test(createTestSoundbank()); + test(createTestSoundbankWithChannelMixer()); + } + + public static void test(Soundbank soundbank) throws Exception { + + // Create instance of synthesizer using the testing soundbank above + AudioSynthesizer synth = new SoftSynthesizer(); + AudioInputStream stream = synth.openStream(format, null); + synth.unloadAllInstruments(synth.getDefaultSoundbank()); + synth.loadAllInstruments(soundbank); + Receiver recv = synth.getReceiver(); + + // Set volume to max and turn reverb off + ShortMessage reverb_off = new ShortMessage(); + reverb_off.setMessage(ShortMessage.CONTROL_CHANGE, 91, 0); + recv.send(reverb_off, -1); + ShortMessage full_volume = new ShortMessage(); + full_volume.setMessage(ShortMessage.CONTROL_CHANGE, 7, 127); + recv.send(full_volume, -1); + + Random random = new Random(3485934583945l); + + // Create random timestamps + long[] test_timestamps = new long[30]; + for (int i = 1; i < test_timestamps.length; i++) { + test_timestamps[i] = i * 44100 + + (int) (random.nextDouble() * 22050.0); + } + + // Send midi note on message to synthesizer + for (int i = 0; i < test_timestamps.length; i++) { + ShortMessage midi_on = new ShortMessage(); + midi_on.setMessage(ShortMessage.NOTE_ON, 69, 127); + recv.send(midi_on, + (long) ((test_timestamps[i] / 44100.0) * 1000000.0)); + } + + // Measure timing from rendered audio + float[] fbuffer = new float[100]; + byte[] buffer = new byte[fbuffer.length * format.getFrameSize()]; + long firsts = -1; + int counter = 0; + long s = 0; + long max_jitter = 0; + outerloop: for (int k = 0; k < 10000000; k++) { + stream.read(buffer); + AudioFloatConverter.getConverter(format).toFloatArray(buffer, + fbuffer); + for (int i = 0; i < fbuffer.length; i++) { + if (fbuffer[i] != 0) { + if (firsts == -1) + firsts = s; + + long measure_time = (s - firsts); + long predicted_time = test_timestamps[counter]; + + long jitter = Math.abs(measure_time - predicted_time); + + if (jitter > 10) + max_jitter = jitter; + + counter++; + if (counter == test_timestamps.length) + break outerloop; + } + s++; + } + } + synth.close(); + + if (counter == 0) + throw new Exception("Nothing was measured!"); + + if (max_jitter != 0) { + throw new Exception("Jitter has occurred! " + + "(max jitter = " + max_jitter + ")"); + } + + } + +} diff --git a/jdk/test/javax/swing/JEditorPane/6917744/bug6917744.java b/jdk/test/javax/swing/JEditorPane/6917744/bug6917744.java new file mode 100644 index 00000000000..553213d23fd --- /dev/null +++ b/jdk/test/javax/swing/JEditorPane/6917744/bug6917744.java @@ -0,0 +1,113 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @bug 6917744 + * @summary JScrollPane Page Up/Down keys do not handle correctly html tables with different cells contents + * @author Pavel Porvatov + * @run main bug6917744 + */ + +import java.awt.*; +import java.awt.event.KeyEvent; +import java.io.IOException; +import javax.swing.*; + +import sun.awt.SunToolkit; + +public class bug6917744 { + private static JFrame frame; + + private static JEditorPane editorPane; + + private static JScrollPane scrollPane; + + private static Robot robot; + + public static void main(String[] args) throws Exception { + SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit(); + + robot = new Robot(); + robot.setAutoDelay(100); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + frame = new JFrame(); + + editorPane = new JEditorPane(); + + try { + editorPane.setPage(bug6917744.class.getResource("/test.html")); + } catch (IOException e) { + throw new RuntimeException("HTML resource not found", e); + } + + scrollPane = new JScrollPane(editorPane); + + frame.getContentPane().add(scrollPane); + frame.setSize(400, 300); + frame.setVisible(true); + } + }); + + toolkit.realSync(); + + for (int i = 0; i < 50; i++) { + robot.keyPress(KeyEvent.VK_PAGE_DOWN); + } + + toolkit.realSync(); + + // Check that we at the end of document + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + BoundedRangeModel model = scrollPane.getVerticalScrollBar().getModel(); + + if (model.getValue() + model.getExtent() != model.getMaximum()) { + throw new RuntimeException("Invalid HTML position"); + } + } + }); + + toolkit.realSync(); + + for (int i = 0; i < 50; i++) { + robot.keyPress(KeyEvent.VK_PAGE_UP); + } + + toolkit.realSync(); + + // Check that we at the begin of document + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + BoundedRangeModel model = scrollPane.getVerticalScrollBar().getModel(); + + if (model.getValue() != model.getMinimum()) { + throw new RuntimeException("Invalid HTML position"); + } + + frame.dispose(); + } + }); + } +} diff --git a/jdk/test/javax/swing/JEditorPane/6917744/test.html b/jdk/test/javax/swing/JEditorPane/6917744/test.html new file mode 100644 index 00000000000..7532c9e9e15 --- /dev/null +++ b/jdk/test/javax/swing/JEditorPane/6917744/test.html @@ -0,0 +1,494 @@ + + + + + + + + +
        + + + TEST FOR JScrollPane BUG
      +
      + +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      +This is a test html file. +
      + + END OF TEST FOR JScrollPane BUG
      +
      +
      +
       
      + + diff --git a/jdk/test/javax/swing/JList/6823603/bug6823603.java b/jdk/test/javax/swing/JList/6823603/bug6823603.java new file mode 100644 index 00000000000..75529c5ba8e --- /dev/null +++ b/jdk/test/javax/swing/JList/6823603/bug6823603.java @@ -0,0 +1,247 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + @bug 6823603 + @summary Generics: JList + @author Florian Brunner + @run main bug6823603 + */ + +import java.util.Arrays; +import java.util.List; +import java.util.Vector; +import java.util.Enumeration; +import java.awt.*; +import javax.swing.*; + +public class bug6823603 { + + private static final String TEST_ELEMENT = "Test1"; + + /** + * @param args the command line arguments + */ + @SuppressWarnings("unchecked") + public static void main(String[] args) { + testRawSignatures(); + testGenericSignatures(); + + testGetSelectedValuesList(); // new method + } + + @SuppressWarnings("unchecked") + private static void testRawSignatures() { + // Test JList + ListModel rawTestModel = new DefaultListModel(); + + new JList(); + new JList(rawTestModel); + new JList(new Object[]{TEST_ELEMENT}); + JList rawTestList = new JList(new Vector()); + rawTestList.getPrototypeCellValue(); + rawTestList.setPrototypeCellValue(TEST_ELEMENT); + rawTestList.getCellRenderer(); + rawTestList.setCellRenderer(new DefaultListCellRenderer()); + rawTestList.getModel(); + rawTestList.setModel(rawTestModel); + rawTestList.setListData(new Object[]{TEST_ELEMENT}); + rawTestList.setListData(new Vector()); + + @SuppressWarnings("deprecation") + Object[] selectedValues = rawTestList.getSelectedValues(); + rawTestList.getSelectedValue(); + + // Test ListCellRenderer + ListCellRenderer rawTestCellRenderer = new DefaultListCellRenderer(); + String testEntry = "Test"; + @SuppressWarnings("unchecked") + JList rawJList = new JList(new Object[]{testEntry}); + + rawTestCellRenderer.getListCellRendererComponent(rawJList, + testEntry, 0, true, true); + + // Test ListModel + DefaultListModel testModel = new DefaultListModel(); + testModel.addElement(TEST_ELEMENT); + rawTestModel = testModel; + rawTestModel.getElementAt(0); + + // Test DefaultListModel + DefaultListModel defaultListModel = new DefaultListModel(); + + defaultListModel.addElement(TEST_ELEMENT); + defaultListModel.getElementAt(0); + defaultListModel.elements(); + defaultListModel.elementAt(0); + defaultListModel.firstElement(); + defaultListModel.lastElement(); + + String testElement2 = "Test2"; + + defaultListModel.setElementAt(testElement2, 0); + defaultListModel.insertElementAt(TEST_ELEMENT, 0); + defaultListModel.get(0); + defaultListModel.set(0, testElement2); + defaultListModel.add(0, TEST_ELEMENT); + defaultListModel.remove(0); + + // Test AbstractListModel + @SuppressWarnings("serial") + ListModel abstractListModel = new AbstractListModel() { + public int getSize() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Object getElementAt(int index) { + throw new UnsupportedOperationException("Not supported yet."); + } + }; + + // Test DefaultListCellRenderer + DefaultListCellRenderer cellRenderer = new DefaultListCellRenderer(); + + @SuppressWarnings("unchecked") + JList list = new JList(new Object[]{testEntry}); + + cellRenderer.getListCellRendererComponent(rawJList, testEntry, 0, true, true); + } + + private static void testGenericSignatures() { + // Test JList + ListModel stringListModel = new DefaultListModel(); + + new JList(); + new JList(stringListModel); + new JList(new String[]{TEST_ELEMENT}); + + JList stringTestList = new JList(new Vector()); + + stringTestList.getPrototypeCellValue(); + stringTestList.setPrototypeCellValue(TEST_ELEMENT); + + ListCellRenderer cellRenderer = stringTestList.getCellRenderer(); + + stringTestList.setCellRenderer(new DefaultListCellRenderer()); + + ListModel model = stringTestList.getModel(); + + stringTestList.setModel(stringListModel); + stringTestList.setListData(new String[]{TEST_ELEMENT}); + stringTestList.setListData(new Vector()); + + @SuppressWarnings("deprecation") + Object[] selectedValues = stringTestList.getSelectedValues(); + + stringTestList.getSelectedValue(); + + // Test ListCellRenderer + ListCellRenderer stringTestCellRenderer = + new DefaultListCellRenderer(); + String testEntry = "Test"; + JList stringJList = new JList(new String[]{testEntry}); + + Component listCellRendererComponent2 = + stringTestCellRenderer.getListCellRendererComponent(stringJList, + testEntry, 0, true, true); + + // Test ListModel + DefaultListModel testModel = new DefaultListModel(); + testModel.addElement(TEST_ELEMENT); + stringListModel = testModel; + + String element1 = stringListModel.getElementAt(0); + + // Test DefaultListModel + DefaultListModel stringTestModel = new DefaultListModel(); + + stringTestModel.addElement(TEST_ELEMENT); + element1 = stringTestModel.getElementAt(0); + Enumeration elements = stringTestModel.elements(); + String element2 = stringTestModel.elementAt(0); + String firstElement = stringTestModel.firstElement(); + String lastElement = stringTestModel.lastElement(); + + String testElement2 = "Test2"; + stringTestModel.setElementAt(testElement2, 0); + stringTestModel.insertElementAt(TEST_ELEMENT, 0); + String element3 = stringTestModel.get(0); + String element4 = stringTestModel.set(0, testElement2); + stringTestModel.add(0, TEST_ELEMENT); + String removedElement = stringTestModel.remove(0); + + // Test AbstractListModel + stringListModel = new AbstractListModel() { + + public int getSize() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getElementAt(int index) { + throw new UnsupportedOperationException("Not supported yet."); + } + }; + + @SuppressWarnings("serial") + ListModel genericTestModel = new AbstractListModel() { + + public int getSize() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public E getElementAt(int index) { + throw new UnsupportedOperationException("Not supported yet."); + } + }; + + // Test DefaultListCellRenderer + cellRenderer = new DefaultListCellRenderer(); + + stringJList = new JList(new String[]{testEntry}); + + listCellRendererComponent2 = cellRenderer.getListCellRendererComponent(stringJList, testEntry, 0, true, true); + } + + private static void testGetSelectedValuesList() { + Vector data = new Vector(); + for (int i = 0; i < 10; i++) { + data.add(i); + } + JList list = new JList(data); + list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); + list.setSelectedIndices(new int[]{1, 2, 3, 5, 6, 8}); + + @SuppressWarnings("deprecation") + Object[] expectedSelectedValues = list.getSelectedValues(); + List selectedValuesList = list.getSelectedValuesList(); + assertEquals(expectedSelectedValues, selectedValuesList.toArray()); + } + + private static void assertEquals(Object[] expectedArray, + Object[] actualArray) { + if (!Arrays.equals(expectedArray, actualArray)) { + throw new RuntimeException("Expected: " + Arrays.toString( + expectedArray) + " but was: " + Arrays.toString(actualArray)); + } + } +} diff --git a/jdk/test/javax/swing/JScrollBar/6924059/bug6924059.java b/jdk/test/javax/swing/JScrollBar/6924059/bug6924059.java new file mode 100644 index 00000000000..11eb3e8f207 --- /dev/null +++ b/jdk/test/javax/swing/JScrollBar/6924059/bug6924059.java @@ -0,0 +1,56 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @bug 6924059 + * @summary SynthScrollBarUI.configureScrollBarColors() should have spec different from the overridden method + * @author Pavel Porvatov + * @run main bug6924059 + */ + +import javax.swing.*; +import javax.swing.plaf.synth.SynthLookAndFeel; +import javax.swing.plaf.synth.SynthScrollBarUI; + +public class bug6924059 { + private static boolean isMethodCalled; + + public static void main(String[] args) throws Exception { + UIManager.setLookAndFeel(new SynthLookAndFeel()); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + new JScrollBar().setUI(new SynthScrollBarUI() { + protected void configureScrollBarColors() { + super.configureScrollBarColors(); + isMethodCalled = true; + } + }); + + if (!isMethodCalled) { + throw new RuntimeException("The configureScrollBarColors was not called"); + } + } + }); + } +} diff --git a/jdk/test/javax/swing/JSlider/6848475/bug6848475.java b/jdk/test/javax/swing/JSlider/6848475/bug6848475.java new file mode 100644 index 00000000000..e6841f2ec92 --- /dev/null +++ b/jdk/test/javax/swing/JSlider/6848475/bug6848475.java @@ -0,0 +1,126 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @bug 6848475 + * @summary JSlider does not display the correct value of its BoundedRangeModel + * @author Pavel Porvatov + * @run main bug6848475 + */ + +import sun.awt.SunToolkit; + +import javax.swing.*; +import javax.swing.plaf.SliderUI; +import javax.swing.plaf.basic.BasicSliderUI; +import java.awt.*; +import java.awt.event.InputEvent; +import java.lang.reflect.Field; + +public class bug6848475 { + private static JFrame frame; + + private static JSlider slider; + + private static Robot robot; + + private static int thumbRectX; + + public static void main(String[] args) throws Exception { + SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit(); + + robot = new Robot(); + robot.setAutoDelay(100); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + frame = new JFrame(); + + DefaultBoundedRangeModel sliderModel = new DefaultBoundedRangeModel() { + public void setValue(int n) { + // Don't allow value to be changed + } + }; + + slider = new JSlider(sliderModel); + + frame.getContentPane().add(slider); + frame.pack(); + frame.setVisible(true); + } + }); + + toolkit.realSync(); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + Point p = slider.getLocationOnScreen(); + + robot.mouseMove(p.x, p.y); + } + }); + + toolkit.realSync(); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + thumbRectX = getThumbRectField().x; + + Point p = slider.getLocationOnScreen(); + + robot.mouseMove(p.x, p.y); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseMove(p.x + 20, p.y); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + } + }); + + toolkit.realSync(); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + Rectangle newThumbRect = getThumbRectField(); + + if (newThumbRect.x != thumbRectX) { + throw new RuntimeException("Test failed: the thumb was moved"); + } + + frame.dispose(); + } + }); + } + + private static Rectangle getThumbRectField() { + try { + SliderUI ui = slider.getUI(); + + Field field = BasicSliderUI.class.getDeclaredField("thumbRect"); + + field.setAccessible(true); + + return (Rectangle) field.get(ui); + } catch (Exception e) { + throw new RuntimeException(e); + } + } +} diff --git a/jdk/test/javax/swing/JSlider/6918861/bug6918861.java b/jdk/test/javax/swing/JSlider/6918861/bug6918861.java new file mode 100644 index 00000000000..3ae41edca2c --- /dev/null +++ b/jdk/test/javax/swing/JSlider/6918861/bug6918861.java @@ -0,0 +1,103 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @bug 6918861 + * @summary SynthSliderUI.uninstallDefaults() is not called when UI is uninstalled + * @author Pavel Porvatov + * @run main bug6918861 + */ + +import javax.swing.*; +import javax.swing.plaf.synth.SynthLookAndFeel; +import javax.swing.plaf.synth.SynthSliderUI; + +public class bug6918861 { + public static void main(String[] args) throws Exception { + UIManager.setLookAndFeel(new SynthLookAndFeel()); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + JSlider slider = new JSlider(); + + HackedSynthSliderUI ui = new HackedSynthSliderUI(slider); + + slider.setUI(ui); + + if (ui.counter != 111) { + throw new RuntimeException("Some installers of SynthSliderUI weren't invoked"); + } + + slider.setUI(null); + + if (ui.counter != 0) { + throw new RuntimeException("Some uninstallers of SynthSliderUI weren't invoked"); + } + } + }); + } + + private static class HackedSynthSliderUI extends SynthSliderUI { + private int counter; + + protected HackedSynthSliderUI(JSlider c) { + super(c); + } + + protected void installDefaults(JSlider slider) { + super.installDefaults(slider); + + counter += 1; + } + + protected void uninstallDefaults(JSlider slider) { + super.uninstallDefaults(slider); + + counter -= 1; + } + + protected void installListeners(JSlider slider) { + super.installListeners(slider); + + counter += 10; + } + + protected void uninstallListeners(JSlider slider) { + super.uninstallListeners(slider); + + counter -= 10; + } + + protected void installKeyboardActions(JSlider slider) { + super.installKeyboardActions(slider); + + counter += 100; + } + + protected void uninstallKeyboardActions(JSlider slider) { + super.uninstallKeyboardActions(slider); + + counter -= 100; + } + } +} diff --git a/jdk/test/javax/swing/JSlider/6923305/bug6923305.java b/jdk/test/javax/swing/JSlider/6923305/bug6923305.java new file mode 100644 index 00000000000..bf19d4e25ad --- /dev/null +++ b/jdk/test/javax/swing/JSlider/6923305/bug6923305.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @bug 6923305 + * @summary SynthSliderUI paints the slider track when the slider's "paintTrack" property is set to false + * @author Pavel Porvatov + * @run main bug6923305 + */ + +import javax.swing.*; +import javax.swing.plaf.synth.SynthContext; +import javax.swing.plaf.synth.SynthLookAndFeel; +import javax.swing.plaf.synth.SynthSliderUI; +import java.awt.*; +import java.awt.image.BufferedImage; + +public class bug6923305 { + public static void main(String[] args) throws Exception { + UIManager.setLookAndFeel(new SynthLookAndFeel()); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + JSlider slider = new JSlider(); + + slider.setUI(new SynthSliderUI(slider) { + @Override + protected void paintTrack(SynthContext context, Graphics g, Rectangle trackBounds) { + throw new RuntimeException("Test failed: the SynthSliderUI.paintTrack was invoked"); + } + }); + + slider.setPaintTrack(false); + slider.setSize(slider.getPreferredSize()); + + BufferedImage bufferedImage = new BufferedImage(slider.getWidth(), slider.getHeight(), + BufferedImage.TYPE_INT_ARGB); + + slider.paint(bufferedImage.getGraphics()); + } + }); + } +} diff --git a/jdk/test/javax/swing/JTable/6913768/bug6913768.java b/jdk/test/javax/swing/JTable/6913768/bug6913768.java new file mode 100644 index 00000000000..d7a6a6fa2e8 --- /dev/null +++ b/jdk/test/javax/swing/JTable/6913768/bug6913768.java @@ -0,0 +1,53 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + * @bug 6913768 + * @summary With default SynthLookAndFeel instance installed new JTable creation leads to throwing NPE + * @author Pavel Porvatov + * @run main bug6913768 + */ + +import javax.swing.*; +import javax.swing.plaf.synth.SynthLookAndFeel; + +public class bug6913768 { + public static void main(String[] args) throws Exception { + UIManager.setLookAndFeel(new SynthLookAndFeel()); + + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + JFrame frame = new JFrame(); + + JTable table = new JTable(new Object[][]{{"1", "2"}, {"3", "4"}}, + new Object[]{"col1", "col2"}); + + frame.getContentPane().add(new JScrollPane(table)); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setSize(300, 200); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + }); + } +} diff --git a/jdk/test/javax/swing/JTable/Test6888156.java b/jdk/test/javax/swing/JTable/Test6888156.java new file mode 100644 index 00000000000..5d1b1fe2b50 --- /dev/null +++ b/jdk/test/javax/swing/JTable/Test6888156.java @@ -0,0 +1,98 @@ +/* + * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + @bug 6888156 + @summary Tests table column of class Icon.class with Synth LAF + @author Peter Zhelezniakov + @run main Test6888156 +*/ + +import java.awt.Component; +import java.awt.Graphics; +import java.awt.image.BufferedImage; +import javax.swing.*; +import javax.swing.table.AbstractTableModel; +import javax.swing.table.TableModel; + +public class Test6888156 { + private JTable table; + private Icon ICON = new Icon() { + @Override public int getIconWidth() { + return 24; + } + + @Override public int getIconHeight() { + return 24; + } + + @Override public void paintIcon(Component c, Graphics g, int w, int h) { + } + }; + + public Test6888156() { + TableModel model = new AbstractTableModel() { + @Override public int getRowCount() { + return 3; + } + + @Override public int getColumnCount() { + return 2; + } + + @Override public Object getValueAt(int rowIndex, int columnIndex) { + return (columnIndex == 1 ? ICON : 4); + } + + @Override public Class getColumnClass(int columnIndex) { + return (columnIndex == 1 ? Icon.class : int.class); + } + }; + table = new JTable(model); + } + + public void test(final LookAndFeel laf) throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + @Override public void run() { + try { + UIManager.setLookAndFeel(laf); + } catch (UnsupportedLookAndFeelException e) { + System.err.println(laf.getDescription() + + " is unsupported; continuing"); + return; + } + SwingUtilities.updateComponentTreeUI(table); + table.setSize(100, 100); + table.paint( + new BufferedImage(100, 100, BufferedImage.OPAQUE). + getGraphics()); + } + }); + } + + public static void main(String[] args) throws Exception { + Test6888156 t = new Test6888156(); + t.test(new javax.swing.plaf.nimbus.NimbusLookAndFeel()); + t.test(new com.sun.java.swing.plaf.gtk.GTKLookAndFeel()); + } +} \ No newline at end of file diff --git a/jdk/test/javax/swing/MultiUIDefaults/4300666/bug4300666.html b/jdk/test/javax/swing/MultiUIDefaults/4300666/bug4300666.html new file mode 100644 index 00000000000..5d958b96a09 --- /dev/null +++ b/jdk/test/javax/swing/MultiUIDefaults/4300666/bug4300666.html @@ -0,0 +1,28 @@ + + + + + + + diff --git a/jdk/test/javax/swing/MultiUIDefaults/4300666/bug4300666.java b/jdk/test/javax/swing/MultiUIDefaults/4300666/bug4300666.java new file mode 100644 index 00000000000..b4d1abef442 --- /dev/null +++ b/jdk/test/javax/swing/MultiUIDefaults/4300666/bug4300666.java @@ -0,0 +1,40 @@ +/* + * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + @bug 4300666 + @summary Printing UIDefaults throws NoSuchElementExcept + @author Andrey Pikalev + @run applet bug4300666.html +*/ + +import javax.swing.*; + + +public class bug4300666 extends JApplet { + + public void init() { + UIDefaults d = UIManager.getDefaults(); + d.toString(); + } +} diff --git a/jdk/test/javax/swing/MultiUIDefaults/4331767/bug4331767.java b/jdk/test/javax/swing/MultiUIDefaults/4331767/bug4331767.java new file mode 100644 index 00000000000..9d673612959 --- /dev/null +++ b/jdk/test/javax/swing/MultiUIDefaults/4331767/bug4331767.java @@ -0,0 +1,94 @@ +/* + * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + @bug 4331767 + @summary Tests that custom implementation of UIDefaults.getUIError() is + called when an UI error occurs + @author Peter Zhelezniakov + @run main bug4331767 +*/ +import javax.swing.*; +import javax.swing.plaf.metal.MetalLookAndFeel; +import java.util.Locale; + +public class bug4331767 +{ + private static boolean passed = false; + + public static void main(String[] argv) { + try { + UIManager.setLookAndFeel(new BrokenLookAndFeel()); + } catch (Exception e) { + throw new Error("Failed to set BrokenLookAndFeel, cannot test", e); + } + + // This should call BrokenUIDefaults.getUIError() + new JButton(); + + if (!passed) { + throw new RuntimeException("Failed: Custom getUIError() not called"); + } + } + + static class BrokenUIDefaults extends UIDefaults { + UIDefaults defaults; + + public BrokenUIDefaults(UIDefaults def) { + defaults = def; + } + + public Object get(Object key) { + if ("ButtonUI".equals(key)) { + System.err.println("[II] Called BrokenUIDefaults.get(Object)"); + return "a nonexistent class"; + } + return defaults.get(key); + } + + public Object get(Object key, Locale l) { + if ("ButtonUI".equals(key)) { + System.err.println("[II] Called BrokenUIDefaults.get(Object, Locale)"); + return "a nonexistent class"; + } + return defaults.get(key, l); + } + + protected void getUIError(String msg) { + System.err.println("[II] BrokenUIDefaults.getUIError() called, test passes"); + passed = true; + } + } + + static class BrokenLookAndFeel extends MetalLookAndFeel { + UIDefaults defaults; + + public BrokenLookAndFeel() { + defaults = new BrokenUIDefaults(super.getDefaults()); + } + + public UIDefaults getDefaults() { + return defaults; + } + } +} diff --git a/jdk/test/javax/swing/MultiUIDefaults/Test6860438.java b/jdk/test/javax/swing/MultiUIDefaults/Test6860438.java new file mode 100644 index 00000000000..0ce0cad8b18 --- /dev/null +++ b/jdk/test/javax/swing/MultiUIDefaults/Test6860438.java @@ -0,0 +1,98 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + @bug 6860438 + @summary Tests various MultiUIDefaults methods + @author Peter Zhelezniakov + @run main Test6860438 +*/ + +import java.util.Enumeration; +import java.util.Map.Entry; +import java.util.Set; +import javax.swing.UIManager; + +public class Test6860438 +{ + static final String KEY = "Test6860438.key"; + static final String VALUE = "Test6860438.value"; + + void check(Object key, Object value, boolean present, int size) { + check(UIManager.get(key) == value, "UIManager.get()"); + check(UIManager.getDefaults().size() == size, "MultiUIDefaults.size()"); + + checkEnumeration(UIManager.getDefaults().keys(), + key, present, "MultiUIDefaults.keys()"); + checkEnumeration(UIManager.getDefaults().elements(), + value, present, "MultiUIDefaults.elements()"); + + // check MultiUIDefaults.entrySet() + boolean found = false; + Set> entries = UIManager.getDefaults().entrySet(); + for (Entry e: entries) { + if (e.getKey() == key) { + check(e.getValue() == value, "MultiUIDefaults.entrySet()"); + found = true; + } + } + check(found == present, "MultiUIDefaults.entrySet()"); + } + + void checkEnumeration(Enumeration e, Object elem, + boolean present, String error) { + boolean found = false; + while (e.hasMoreElements()) { + if (e.nextElement() == elem) { + found = true; + } + } + check(found == present, error); + } + + void check(boolean condition, String methodName) { + if (! condition) { + throw new RuntimeException(methodName + " failed"); + } + } + + void test() { + int size = UIManager.getDefaults().size(); + + // create a new value, size increases + UIManager.getLookAndFeelDefaults().put(KEY, VALUE); + check(KEY, VALUE, true, size + 1); + + // override the value, size remains the same + UIManager.put(KEY, VALUE); + check(KEY, VALUE, true, size + 1); + + // remove the value, size decreases + UIManager.getDefaults().remove(KEY); + check(KEY, null, false, size); + } + + public static void main(String[] args) { + new Test6860438().test(); + } +} diff --git a/jdk/test/javax/swing/plaf/nimbus/ColorCustomizationTest.java b/jdk/test/javax/swing/plaf/nimbus/ColorCustomizationTest.java new file mode 100644 index 00000000000..6f5a7a2bc3a --- /dev/null +++ b/jdk/test/javax/swing/plaf/nimbus/ColorCustomizationTest.java @@ -0,0 +1,165 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* @test + @bug 6860433 + @summary Tests variuos techniques of Nimbus color customization + @author Peter Zhelezniakov + @run main ColorCustomizationTest +*/ + +import javax.swing.JLabel; +import javax.swing.SwingUtilities; +import javax.swing.UIDefaults; +import javax.swing.UIManager; +import java.awt.Color; +import java.awt.Graphics; +import java.awt.image.BufferedImage; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.plaf.ColorUIResource; +import javax.swing.plaf.nimbus.NimbusLookAndFeel; +import javax.swing.plaf.synth.Region; + +public class ColorCustomizationTest +{ + final static int WIDTH = 200; + final static int HEIGHT = 100; + + static NimbusLookAndFeel nimbus; + + final JLabel label; + final Graphics g; + + ColorCustomizationTest() { + label = new JLabel(); + label.setSize(200, 100); + + g = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_ARGB).getGraphics(); + } + + public static void main(String[] args) throws Exception { + nimbus = new NimbusLookAndFeel(); + try { + UIManager.setLookAndFeel(nimbus); + } catch (UnsupportedLookAndFeelException e) { + throw new Error("Unable to set Nimbus LAF"); + } + SwingUtilities.invokeAndWait(new Runnable() { + @Override public void run() { + new ColorCustomizationTest().test(); + } + }); + } + + void check(Color c) { + SwingUtilities.updateComponentTreeUI(label); + label.paint(g); + if (label.getBackground().getRGB() != c.getRGB()) { + System.err.println("Color mismatch!"); + System.err.println(" found: " + label.getBackground()); + System.err.println(" expected: " + c); + throw new RuntimeException("Test failed"); + } + } + + void test() { + testOverrides(); + testInheritance(); + testNames(); + testBaseColor(); + } + + void testOverrides() { + Color defaultColor = label.getBackground(); + + // override default background + UIDefaults defs = new UIDefaults(); + defs.put("Label.background", new ColorUIResource(Color.RED)); + label.putClientProperty("Nimbus.Overrides", defs); + check(Color.RED); + + // change overriding color + defs = new UIDefaults(); + defs.put("Label.background", new ColorUIResource(Color.GREEN)); + label.putClientProperty("Nimbus.Overrides", defs); + check(Color.GREEN); + + // remove override + label.putClientProperty("Nimbus.Overrides", null); + check(defaultColor); + } + + void testInheritance() { + Color defaultColor = label.getBackground(); + + // more specific setting is in global defaults + UIManager.put("Label[Enabled].background", new ColorUIResource(Color.RED)); + + // less specific one is in overrides + UIDefaults defs = new UIDefaults(); + defs.put("Label.background", new ColorUIResource(Color.GREEN)); + + // global wins + label.putClientProperty("Nimbus.Overrides", defs); + check(Color.RED); + + // now override wins + label.putClientProperty("Nimbus.Overrides.InheritDefaults", false); + check(Color.GREEN); + + // global is back + label.putClientProperty("Nimbus.Overrides.InheritDefaults", true); + check(Color.RED); + + // back to default color + UIManager.put("Label[Enabled].background", null); + label.putClientProperty("Nimbus.Overrides.InheritDefaults", false); + label.putClientProperty("Nimbus.Overrides", null); + check(defaultColor); + } + + void testNames() { + Color defaultColor = label.getBackground(); + + UIManager.put("\"BlueLabel\"[Enabled].background", + new ColorUIResource(Color.BLUE)); + UIManager.put("\"RedLabel\"[Enabled].background", + new ColorUIResource(Color.RED)); + nimbus.register(Region.LABEL, "\"BlueLabel\""); + nimbus.register(Region.LABEL, "\"RedLabel\""); + + label.setName("BlueLabel"); + check(Color.BLUE); + label.setName("RedLabel"); + check(Color.RED); + + // remove name, color goes back to default + label.setName(null); + check(defaultColor); + } + + void testBaseColor() { + UIManager.put("control", Color.GREEN); + check(Color.GREEN); + } +} diff --git a/jdk/test/javax/xml/crypto/dsig/GenerationTests.java b/jdk/test/javax/xml/crypto/dsig/GenerationTests.java index 13881966d32..1ed649cd83a 100644 --- a/jdk/test/javax/xml/crypto/dsig/GenerationTests.java +++ b/jdk/test/javax/xml/crypto/dsig/GenerationTests.java @@ -23,7 +23,7 @@ /** * @test - * @bug 4635230 6283345 6303830 6824440 + * @bug 4635230 6283345 6303830 6824440 6867348 * @summary Basic unit tests for generating XML Signatures with JSR 105 * @compile -XDignore.symbol.file KeySelectors.java SignatureValidator.java * X509KeySelector.java GenerationTests.java @@ -126,13 +126,14 @@ public class GenerationTests { test_create_signature_x509_is(); test_create_signature_x509_ski(); test_create_signature_x509_sn(); -// test_create_signature(); + test_create_signature(); test_create_exc_signature(); test_create_sign_spec(); test_create_signature_enveloping_sha256_dsa(); test_create_signature_enveloping_sha384_rsa_sha256(); test_create_signature_enveloping_sha512_rsa_sha384(); test_create_signature_enveloping_sha512_rsa_sha512(); + test_create_signature_reference_dependency(); } private static void setup() throws Exception { @@ -410,6 +411,55 @@ public class GenerationTests { System.out.println(); } + static void test_create_signature_reference_dependency() throws Exception { + System.out.println("* Generating signature-reference-dependency.xml"); + // create references + List refs = Collections.singletonList + (fac.newReference("#object-1", sha1)); + + // create SignedInfo + SignedInfo si = fac.newSignedInfo(withoutComments, rsaSha1, refs); + + // create objects + List objs = new ArrayList(); + + // Object 1 + List manRefs = Collections.singletonList + (fac.newReference("#object-2", sha1)); + objs.add(fac.newXMLObject(Collections.singletonList + (fac.newManifest(manRefs, "manifest-1")), "object-1", null, null)); + + // Object 2 + Document doc = db.newDocument(); + Element nc = doc.createElementNS(null, "NonCommentandus"); + nc.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", ""); + nc.appendChild(doc.createComment(" Commentandum ")); + objs.add(fac.newXMLObject(Collections.singletonList + (new DOMStructure(nc)), "object-2", null, null)); + + // create XMLSignature + XMLSignature sig = fac.newXMLSignature(si, rsa, objs, "signature", null); + DOMSignContext dsc = new DOMSignContext(getPrivateKey("RSA"), doc); + + sig.sign(dsc); + +// dumpDocument(doc, new PrintWriter(System.out)); + + DOMValidateContext dvc = new DOMValidateContext + (kvks, doc.getDocumentElement()); + XMLSignature sig2 = fac.unmarshalXMLSignature(dvc); + + if (sig.equals(sig2) == false) { + throw new Exception + ("Unmarshalled signature is not equal to generated signature"); + } + if (sig2.validate(dvc) == false) { + throw new Exception("Validation of generated signature failed"); + } + + System.out.println(); + } + static void test_create_signature() throws Exception { System.out.println("* Generating signature.xml"); @@ -645,6 +695,7 @@ public class GenerationTests { envDoc.getElementsByTagName("YoursSincerely").item(0); DOMSignContext dsc = new DOMSignContext(signingKey, ys); + dsc.setURIDereferencer(httpUd); sig.sign(dsc); @@ -660,6 +711,7 @@ public class GenerationTests { DOMValidateContext dvc = new DOMValidateContext (new X509KeySelector(ks), sigElement); + dvc.setURIDereferencer(httpUd); File f = new File( System.getProperty("dir.test.vector.baltimore") + System.getProperty("file.separator") + diff --git a/jdk/test/sun/jvmstat/testlibrary/utils.sh b/jdk/test/sun/jvmstat/testlibrary/utils.sh index d3b04956373..8bd4215d088 100644 --- a/jdk/test/sun/jvmstat/testlibrary/utils.sh +++ b/jdk/test/sun/jvmstat/testlibrary/utils.sh @@ -40,7 +40,7 @@ setup() { OS=`uname -s` case ${OS} in - Windows_*) + Windows_* | CYGWIN*) PS=";" FS="\\" ;; @@ -54,7 +54,7 @@ setup() { verify_os() { OS=`uname -s` case ${OS} in - Windows_95 | Windows_98 | Windows_ME) + Windows_95 | Windows_98 | Windows_ME | CYGWIN* ) echo "Test bypassed: jvmstat feature not supported on ${OS}" exit 0 ;; diff --git a/jdk/test/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh b/jdk/test/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh index b06a4073b61..283c6cde2ab 100644 --- a/jdk/test/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh +++ b/jdk/test/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh @@ -45,7 +45,7 @@ cat < ${TMP_FILE} s^@TEST-SRC@/^${TESTCLASSES}${DFILESEP}^g EOF ;; -Windows_95 | Windows_98 | Windows_NT | Windows_ME) +Windows_95 | Windows_98 | Windows_NT | Windows_ME | CYGWIN*) PATHSEP=";" FILESEP="\\" DFILESEP=$FILESEP$FILESEP diff --git a/jdk/test/sun/misc/URLClassPath/ClassnameCharTest.sh b/jdk/test/sun/misc/URLClassPath/ClassnameCharTest.sh index 9cc5c58b555..3e1db07e017 100644 --- a/jdk/test/sun/misc/URLClassPath/ClassnameCharTest.sh +++ b/jdk/test/sun/misc/URLClassPath/ClassnameCharTest.sh @@ -44,7 +44,7 @@ case "$OS" in PS=":" FS="/" ;; - Windows* ) + Windows* | CYGWIN* ) PS=";" FS="\\" ;; @@ -59,6 +59,6 @@ cd ${TESTCLASSES} ${TESTJAVA}${FS}bin${FS}jar xvf testclasses.jar "fo o.class" ${TESTJAVA}${FS}bin${FS}javac -d ${TESTCLASSES} ${TESTSRC}${FS}ClassnameCharTest.java -${TESTJAVA}${FS}bin${FS}java -classpath ${TESTCLASSES}${PS}${TESTCLASSES}${FS}sun${FS}misc${FS}URLClassPath ClassnameCharTest +${TESTJAVA}${FS}bin${FS}java -classpath "${TESTCLASSES}${PS}${TESTCLASSES}${FS}sun${FS}misc${FS}URLClassPath" ClassnameCharTest rm -rf "fo o.class" testclasses.jar diff --git a/jdk/test/sun/security/krb5/auto/BadKdc.java b/jdk/test/sun/security/krb5/auto/BadKdc.java new file mode 100644 index 00000000000..e4c5267271e --- /dev/null +++ b/jdk/test/sun/security/krb5/auto/BadKdc.java @@ -0,0 +1,113 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.io.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import sun.security.krb5.Config; + +public class BadKdc { + + // Matches the krb5 debug output: + // >>> KDCCommunication: kdc=kdc.rabbit.hole UDP:14319, timeout=2000,... + // ^ kdc# ^ timeout + static final Pattern re = Pattern.compile( + ">>> KDCCommunication: kdc=kdc.rabbit.hole UDP:(\\d)...., " + + "timeout=(\\d)000,"); + public static void go(int[]... expected) + throws Exception { + System.setProperty("sun.security.krb5.debug", "true"); + + // Make sure KDCs' ports starts with 1 and 2 and 3, + // useful for checking debug output. + int p1 = 10000 + new java.util.Random().nextInt(10000); + int p2 = 20000 + new java.util.Random().nextInt(10000); + int p3 = 30000 + new java.util.Random().nextInt(10000); + + FileWriter fw = new FileWriter("alternative-krb5.conf"); + + fw.write("[libdefaults]\n" + + "default_realm = " + OneKDC.REALM + "\n" + + "kdc_timeout = 2000\n"); + fw.write("[realms]\n" + OneKDC.REALM + " = {\n" + + "kdc = " + OneKDC.KDCHOST + ":" + p1 + "\n" + + "kdc = " + OneKDC.KDCHOST + ":" + p2 + "\n" + + "kdc = " + OneKDC.KDCHOST + ":" + p3 + "\n" + + "}\n"); + + fw.close(); + System.setProperty("java.security.krb5.conf", "alternative-krb5.conf"); + Config.refresh(); + + // Turn on k3 only + KDC k3 = on(p3); + + test(expected[0]); + test(expected[1]); + Config.refresh(); + test(expected[2]); + + k3.terminate(); // shutdown k3 + on(p2); // k2 is on + test(expected[3]); + on(p1); // k1 and k2 is on + test(expected[4]); + } + + private static KDC on(int p) throws Exception { + KDC k = new KDC(OneKDC.REALM, OneKDC.KDCHOST, p, true); + k.addPrincipal(OneKDC.USER, OneKDC.PASS); + k.addPrincipalRandKey("krbtgt/" + OneKDC.REALM); + return k; + } + + /** + * One round of test for max_retries and timeout. + * @param timeout the expected timeout + * @param expected the expected kdc# timeout kdc# timeout... + */ + private static void test(int... expected) throws Exception { + ByteArrayOutputStream bo = new ByteArrayOutputStream(); + PrintStream oldout = System.out; + System.setOut(new PrintStream(bo)); + Context c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false); + System.setOut(oldout); + + String[] lines = new String(bo.toByteArray()).split("\n"); + System.out.println("----------------- TEST -----------------"); + int count = 0; + for (String line: lines) { + Matcher m = re.matcher(line); + if (m.find()) { + System.out.println(line); + if (Integer.parseInt(m.group(1)) != expected[count++] || + Integer.parseInt(m.group(2)) != expected[count++]) { + throw new Exception("Fail here"); + } + } + } + if (count != expected.length) { + throw new Exception("Less rounds"); + } + } +} diff --git a/jdk/test/sun/security/krb5/auto/BadKdc1.java b/jdk/test/sun/security/krb5/auto/BadKdc1.java new file mode 100644 index 00000000000..584edc3889a --- /dev/null +++ b/jdk/test/sun/security/krb5/auto/BadKdc1.java @@ -0,0 +1,53 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6843127 + * @run main/timeout=300 BadKdc1 + * @summary krb5 should not try to access unavailable kdc too often + */ + +import java.io.*; +import java.security.Security; + +public class BadKdc1 { + + public static void main(String[] args) + throws Exception { + Security.setProperty("krb5.kdc.bad.policy", "tryLess"); + BadKdc.go( + new int[]{1,2,1,2,1,2,2,2,2,2,2,2,3,2,1,2,2,2,3,2}, // 1, 2 + // The above line means try kdc1 for 2 seconds, then kdc1 + // for 2 seconds,..., finally kdc3 for 2 seconds. + new int[]{1,2,2,2,3,2,1,2,2,2,3,2}, // 1, 2 + // refresh + new int[]{1,2,1,2,1,2,2,2,2,2,2,2,3,2,1,2,2,2,3,2}, // 1, 2 + // k3 off, k2 on + new int[]{1,2,2,2,1,2,2,2}, // 1 + // k1 on + new int[]{1,2,1,2} // empty + ); + } +} + diff --git a/jdk/test/sun/security/krb5/auto/BadKdc2.java b/jdk/test/sun/security/krb5/auto/BadKdc2.java new file mode 100644 index 00000000000..f9c017e8dad --- /dev/null +++ b/jdk/test/sun/security/krb5/auto/BadKdc2.java @@ -0,0 +1,50 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6843127 + * @run main/timeout=300 BadKdc2 + * @summary krb5 should not try to access unavailable kdc too often + */ + +import java.io.*; +import java.security.Security; + +public class BadKdc2 { + + public static void main(String[] args) + throws Exception { + Security.setProperty("krb5.kdc.bad.policy", "tryLess:2,1000"); + BadKdc.go( + new int[]{1,2,1,2,1,2,2,2,2,2,2,2,3,2,1,1,1,1,2,1,2,1,3,2}, // 1, 2 + new int[]{1,1,1,1,2,1,2,1,3,2,1,1,1,1,2,1,2,1,3,2}, // 1, 2 + // refresh + new int[]{1,2,1,2,1,2,2,2,2,2,2,2,3,2,1,1,1,1,2,1,2,1,3,2}, // 1, 2 + // k3 off, k2 on + new int[]{1,1,1,1,2,1,1,1,1,1,2,2}, // 1 + // k1 on + new int[]{1,1,1,2} // empty + ); + } +} diff --git a/jdk/test/sun/security/krb5/auto/BadKdc3.java b/jdk/test/sun/security/krb5/auto/BadKdc3.java new file mode 100644 index 00000000000..547e91578aa --- /dev/null +++ b/jdk/test/sun/security/krb5/auto/BadKdc3.java @@ -0,0 +1,50 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6843127 + * @run main/timeout=300 BadKdc3 + * @summary krb5 should not try to access unavailable kdc too often + */ + +import java.io.*; +import java.security.Security; + +public class BadKdc3 { + + public static void main(String[] args) + throws Exception { + Security.setProperty("krb5.kdc.bad.policy", "tryLast"); + BadKdc.go( + new int[]{1,2,1,2,1,2,2,2,2,2,2,2,3,2,3,2}, // 1, 2 + new int[]{3,2,3,2}, // 1, 2 + // refresh + new int[]{1,2,1,2,1,2,2,2,2,2,2,2,3,2,3,2}, // 1, 2 + // k3 off, k2 on + new int[]{3,2,3,2,3,2,1,2,1,2,1,2,2,2,2,2}, // 1, 3 + // k1 on + new int[]{2,2,2,2} // 1, 3 + ); + } +} diff --git a/jdk/test/sun/security/krb5/auto/BadKdc4.java b/jdk/test/sun/security/krb5/auto/BadKdc4.java new file mode 100644 index 00000000000..6774b76c3ae --- /dev/null +++ b/jdk/test/sun/security/krb5/auto/BadKdc4.java @@ -0,0 +1,50 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6843127 + * @run main/timeout=300 BadKdc4 + * @summary krb5 should not try to access unavailable kdc too often + */ + +import java.io.*; +import java.security.Security; + +public class BadKdc4 { + + public static void main(String[] args) + throws Exception { + Security.setProperty("krb5.kdc.bad.policy", ""); + BadKdc.go( + new int[]{1,2,1,2,1,2,2,2,2,2,2,2,3,2,1,2,1,2,1,2,2,2,2,2,2,2,3,2}, + new int[]{1,2,1,2,1,2,2,2,2,2,2,2,3,2,1,2,1,2,1,2,2,2,2,2,2,2,3,2}, + // refresh + new int[]{1,2,1,2,1,2,2,2,2,2,2,2,3,2,1,2,1,2,1,2,2,2,2,2,2,2,3,2}, + // k3 off, k2 on + new int[]{1,2,1,2,1,2,2,2,1,2,1,2,1,2,2,2}, + // k1 on + new int[]{1,2,1,2} + ); + } +} diff --git a/jdk/test/sun/security/krb5/auto/HttpNegotiateServer.java b/jdk/test/sun/security/krb5/auto/HttpNegotiateServer.java index 8d4b2ab6fe7..6adc009d6ed 100644 --- a/jdk/test/sun/security/krb5/auto/HttpNegotiateServer.java +++ b/jdk/test/sun/security/krb5/auto/HttpNegotiateServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,8 +23,9 @@ /* * @test - * @bug 6578647 + * @bug 6578647 6829283 * @summary Undefined requesting URL in java.net.Authenticator.getPasswordAuthentication() + * @summary HTTP/Negotiate: Authenticator triggered again when user cancels the first one */ import com.sun.net.httpserver.Headers; @@ -35,6 +36,8 @@ import com.sun.net.httpserver.HttpServer; import com.sun.net.httpserver.HttpPrincipal; import com.sun.security.auth.module.Krb5LoginModule; import java.io.BufferedReader; +import java.io.File; +import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; @@ -79,6 +82,9 @@ public class HttpNegotiateServer { // web page content final static String CONTENT = "Hello, World!"; + // For 6829283, count how many times the Authenticator is called. + static int count = 0; + // URLs for web test, proxy test. The proxy server is not a real proxy // since it fakes the same content for any URL. :) final static URL webUrl, proxyUrl; @@ -134,6 +140,17 @@ public class HttpNegotiateServer { } } + /** + * This Authenticator knows nothing + */ + static class KnowNothingAuthenticator extends java.net.Authenticator { + @Override + public PasswordAuthentication getPasswordAuthentication () { + HttpNegotiateServer.count++; + return null; + } + } + public static void main(String[] args) throws Exception { @@ -147,7 +164,6 @@ public class HttpNegotiateServer { kdcp.addPrincipalRandKey("krbtgt/" + REALM_PROXY); kdcp.addPrincipalRandKey("HTTP/" + PROXY_HOST); - KDC.writeMultiKtab(KRB5_TAB, kdcw, kdcp); KDC.saveConfig(KRB5_CONF, kdcw, kdcp, "default_keytab_name = " + KRB5_TAB, "[domain_realm]", @@ -157,6 +173,19 @@ public class HttpNegotiateServer { System.setProperty("java.security.krb5.conf", KRB5_CONF); Config.refresh(); + KDC.writeMultiKtab(KRB5_TAB, kdcw, kdcp); + + // Write a customized JAAS conf file, so that any kinit cache + // will be ignored. + System.setProperty("java.security.auth.login.config", OneKDC.JAAS_CONF); + File f = new File(OneKDC.JAAS_CONF); + FileOutputStream fos = new FileOutputStream(f); + fos.write(( + "com.sun.security.jgss.krb5.initiate {\n" + + " com.sun.security.auth.module.Krb5LoginModule required;\n};\n" + ).getBytes()); + fos.close(); + f.deleteOnExit(); HttpServer h1 = httpd(WEB_PORT, "Negotiate", false, "HTTP/" + WEB_HOST + "@" + REALM_WEB, KRB5_TAB); @@ -164,23 +193,21 @@ public class HttpNegotiateServer { "HTTP/" + PROXY_HOST + "@" + REALM_PROXY, KRB5_TAB); try { - - BufferedReader reader; - java.net.Authenticator.setDefault(new KnowAllAuthenticator()); - - reader = new BufferedReader(new InputStreamReader( - webUrl.openConnection().getInputStream())); - if (!reader.readLine().equals(CONTENT)) { - throw new RuntimeException("Bad content"); + Exception e1 = null, e2 = null; + try { + test6578647(); + } catch (Exception e) { + e1 = e; + e.printStackTrace(); } - - reader = new BufferedReader(new InputStreamReader( - proxyUrl.openConnection( - new Proxy(Proxy.Type.HTTP, - new InetSocketAddress(PROXY_HOST, PROXY_PORT))) - .getInputStream())); - if (!reader.readLine().equals(CONTENT)) { - throw new RuntimeException("Bad content"); + try { + test6829283(); + } catch (Exception e) { + e2 = e; + e.printStackTrace(); + } + if (e1 != null || e2 != null) { + throw new RuntimeException("Test error"); } } finally { // Must stop. Seems there's no HttpServer.startAsDaemon() @@ -189,6 +216,40 @@ public class HttpNegotiateServer { } } + static void test6578647() throws Exception { + BufferedReader reader; + java.net.Authenticator.setDefault(new KnowAllAuthenticator()); + + reader = new BufferedReader(new InputStreamReader( + webUrl.openConnection().getInputStream())); + if (!reader.readLine().equals(CONTENT)) { + throw new RuntimeException("Bad content"); + } + + reader = new BufferedReader(new InputStreamReader( + proxyUrl.openConnection( + new Proxy(Proxy.Type.HTTP, + new InetSocketAddress(PROXY_HOST, PROXY_PORT))) + .getInputStream())); + if (!reader.readLine().equals(CONTENT)) { + throw new RuntimeException("Bad content"); + } + } + + static void test6829283() throws Exception { + BufferedReader reader; + java.net.Authenticator.setDefault(new KnowNothingAuthenticator()); + try { + new BufferedReader(new InputStreamReader( + webUrl.openConnection().getInputStream())); + } catch (IOException ioe) { + // Will fail since no username and password is provided. + } + if (count > 1) { + throw new RuntimeException("Authenticator called twice"); + } + } + /** * Creates and starts an HTTP or proxy server that requires * Negotiate authentication. diff --git a/jdk/test/sun/security/krb5/auto/KDC.java b/jdk/test/sun/security/krb5/auto/KDC.java index 169094c779b..b03058798bd 100644 --- a/jdk/test/sun/security/krb5/auto/KDC.java +++ b/jdk/test/sun/security/krb5/auto/KDC.java @@ -141,6 +141,10 @@ public class KDC { // Options private Map options = new HashMap(); + private Thread thread1, thread2, thread3; + DatagramSocket u1 = null; + ServerSocket t1 = null; + /** * Option names, to be expanded forever. */ @@ -480,8 +484,9 @@ public class KDC { Method stringToKey = EncryptionKey.class.getDeclaredMethod("stringToKey", char[].class, String.class, byte[].class, Integer.TYPE); stringToKey.setAccessible(true); Integer kvno = null; - // For service whose password ending with a number, use it as kvno - if (p.toString().indexOf('/') >= 0) { + // For service whose password ending with a number, use it as kvno. + // Kvno must be postive. + if (p.toString().indexOf('/') > 0) { char[] pass = getPassword(p, server); if (Character.isDigit(pass[pass.length-1])) { kvno = pass[pass.length-1] - '0'; @@ -940,8 +945,6 @@ public class KDC { * @throws java.io.IOException for any communication error */ protected void startServer(int port, boolean asDaemon) throws IOException { - DatagramSocket u1 = null; - ServerSocket t1 = null; if (port > 0) { u1 = new DatagramSocket(port, InetAddress.getByName("127.0.0.1")); t1 = new ServerSocket(port); @@ -966,7 +969,7 @@ public class KDC { this.port = port; // The UDP consumer - Thread thread = new Thread() { + thread1 = new Thread() { public void run() { while (true) { try { @@ -982,11 +985,11 @@ public class KDC { } } }; - thread.setDaemon(asDaemon); - thread.start(); + thread1.setDaemon(asDaemon); + thread1.start(); // The TCP consumer - thread = new Thread() { + thread2 = new Thread() { public void run() { while (true) { try { @@ -1004,11 +1007,11 @@ public class KDC { } } }; - thread.setDaemon(asDaemon); - thread.start(); + thread2.setDaemon(asDaemon); + thread2.start(); // The dispatcher - thread = new Thread() { + thread3 = new Thread() { public void run() { while (true) { try { @@ -1018,10 +1021,21 @@ public class KDC { } } }; - thread.setDaemon(true); - thread.start(); + thread3.setDaemon(true); + thread3.start(); } + public void terminate() { + try { + thread1.stop(); + thread2.stop(); + thread3.stop(); + u1.close(); + t1.close(); + } catch (Exception e) { + // OK + } + } /** * Helper class to encapsulate a job in a KDC. */ diff --git a/jdk/test/sun/security/krb5/auto/MoreKvno.java b/jdk/test/sun/security/krb5/auto/MoreKvno.java index 66740a8b799..5a2c9e56a58 100644 --- a/jdk/test/sun/security/krb5/auto/MoreKvno.java +++ b/jdk/test/sun/security/krb5/auto/MoreKvno.java @@ -24,15 +24,20 @@ /* * @test * @bug 6893158 + * @bug 6907425 * @summary AP_REQ check should use key version number */ +import org.ietf.jgss.GSSException; import sun.security.jgss.GSSUtil; +import sun.security.krb5.KrbException; import sun.security.krb5.PrincipalName; import sun.security.krb5.internal.ktab.KeyTab; +import sun.security.krb5.internal.Krb5; public class MoreKvno { + static PrincipalName p; public static void main(String[] args) throws Exception { @@ -41,21 +46,40 @@ public class MoreKvno { // Rewrite keytab, 3 set of keys with different kvno KeyTab ktab = KeyTab.create(OneKDC.KTAB); - PrincipalName p = new PrincipalName(OneKDC.SERVER+"@"+OneKDC.REALM, PrincipalName.KRB_NT_SRV_HST); - ktab.addEntry(p, "pass0".toCharArray(), 0); - ktab.addEntry(p, "pass2".toCharArray(), 2); + p = new PrincipalName( + OneKDC.SERVER+"@"+OneKDC.REALM, PrincipalName.KRB_NT_SRV_HST); ktab.addEntry(p, "pass1".toCharArray(), 1); + ktab.addEntry(p, "pass3".toCharArray(), 3); + ktab.addEntry(p, "pass2".toCharArray(), 2); ktab.save(); - kdc.addPrincipal(OneKDC.SERVER, "pass1".toCharArray()); - go(OneKDC.SERVER, "com.sun.security.jgss.krb5.accept"); - kdc.addPrincipal(OneKDC.SERVER, "pass2".toCharArray()); + char[] pass = "pass2".toCharArray(); + kdc.addPrincipal(OneKDC.SERVER, pass); + go(OneKDC.SERVER, "com.sun.security.jgss.krb5.accept", pass); + + pass = "pass3".toCharArray(); + kdc.addPrincipal(OneKDC.SERVER, pass); // "server" initiate also, check pass2 is used at authentication - go(OneKDC.SERVER, "server"); + go(OneKDC.SERVER, "server", pass); + + try { + pass = "pass4".toCharArray(); + kdc.addPrincipal(OneKDC.SERVER, pass); + go(OneKDC.SERVER, "com.sun.security.jgss.krb5.accept", pass); + throw new Exception("This test should fail"); + } catch (GSSException gsse) { + KrbException ke = (KrbException)gsse.getCause(); + if (ke.returnCode() != Krb5.KRB_AP_ERR_BADKEYVER) { + throw new Exception("Not expected failure code: " + + ke.returnCode()); + } + } } - static void go(String server, String entry) throws Exception { + static void go(String server, String entry, char[] pass) throws Exception { Context c, s; + + // Part 1: Test keytab c = Context.fromUserPass("dummy", "bogus".toCharArray(), false); s = Context.fromJAAS(entry); @@ -66,5 +90,17 @@ public class MoreKvno { s.dispose(); c.dispose(); + + // Part 2: Test username/password pair + c = Context.fromUserPass("dummy", "bogus".toCharArray(), false); + s = Context.fromUserPass(p.getNameString(), pass, true); + + c.startAsClient(server, GSSUtil.GSS_KRB5_MECH_OID); + s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID); + + Context.handshake(c, s); + + s.dispose(); + c.dispose(); } } diff --git a/jdk/test/sun/security/krb5/auto/OneKDC.java b/jdk/test/sun/security/krb5/auto/OneKDC.java index 213869e8d24..d52ada56313 100644 --- a/jdk/test/sun/security/krb5/auto/OneKDC.java +++ b/jdk/test/sun/security/krb5/auto/OneKDC.java @@ -24,8 +24,6 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; -import java.net.InetAddress; -import java.net.UnknownHostException; import java.security.Security; import javax.security.auth.callback.Callback; import javax.security.auth.callback.CallbackHandler; diff --git a/jdk/test/sun/security/krb5/auto/SSL.java b/jdk/test/sun/security/krb5/auto/SSL.java index d8e361a00e0..72e37361d6f 100644 --- a/jdk/test/sun/security/krb5/auto/SSL.java +++ b/jdk/test/sun/security/krb5/auto/SSL.java @@ -1,5 +1,5 @@ /* - * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 6894643 + * @bug 6894643 6913636 * @summary Test JSSE Kerberos ciphersuite */ import java.io.*; @@ -32,12 +32,13 @@ import javax.net.ssl.*; import java.security.Principal; import java.util.Date; import sun.security.jgss.GSSUtil; +import sun.security.krb5.PrincipalName; +import sun.security.krb5.internal.ktab.KeyTab; public class SSL { private static final String KRB5_CIPHER = "TLS_KRB5_WITH_3DES_EDE_CBC_SHA"; private static final int LOOP_LIMIT = 1; - private static final char[] PASS = "secret".toCharArray(); private static int loopCount = 0; private static volatile String server; private static volatile int port; @@ -54,12 +55,39 @@ public class SSL { kdc.addPrincipal(OneKDC.USER, OneKDC.PASS); kdc.addPrincipalRandKey("krbtgt/" + OneKDC.REALM); - kdc.addPrincipal("host/" + server, PASS); KDC.saveConfig(OneKDC.KRB5_CONF, kdc); System.setProperty("java.security.krb5.conf", OneKDC.KRB5_CONF); + // Add 3 versions of keys into keytab + KeyTab ktab = KeyTab.create(OneKDC.KTAB); + PrincipalName service = new PrincipalName( + "host/" + server, PrincipalName.KRB_NT_SRV_HST); + ktab.addEntry(service, "pass1".toCharArray(), 1); + ktab.addEntry(service, "pass2".toCharArray(), 2); + ktab.addEntry(service, "pass3".toCharArray(), 3); + ktab.save(); + + // and use the middle one as the real key + kdc.addPrincipal("host/" + server, "pass2".toCharArray()); + + // JAAS config entry name ssl + System.setProperty("java.security.auth.login.config", OneKDC.JAAS_CONF); + File f = new File(OneKDC.JAAS_CONF); + FileOutputStream fos = new FileOutputStream(f); + fos.write(( + "ssl {\n" + + " com.sun.security.auth.module.Krb5LoginModule required\n" + + " principal=\"host/" + server + "\"\n" + + " useKeyTab=true\n" + + " keyTab=" + OneKDC.KTAB + "\n" + + " isInitiator=false\n" + + " storeKey=true;\n};\n" + ).getBytes()); + fos.close(); + f.deleteOnExit(); + final Context c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false); - final Context s = Context.fromUserPass("host/" + server, PASS, true); + final Context s = Context.fromJAAS("ssl"); c.startAsClient("host/" + server, GSSUtil.GSS_KRB5_MECH_OID); s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID); diff --git a/jdk/test/sun/security/krb5/auto/Test5653.java b/jdk/test/sun/security/krb5/auto/Test5653.java new file mode 100644 index 00000000000..cc61e8c7d72 --- /dev/null +++ b/jdk/test/sun/security/krb5/auto/Test5653.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6895424 + * @summary RFC 5653 + */ + +import org.ietf.jgss.GSSContext; +import org.ietf.jgss.GSSManager; +import org.ietf.jgss.GSSName; +import org.ietf.jgss.Oid; +import sun.security.jgss.GSSUtil; + +public class Test5653 { + + public static void main(String[] args) + throws Exception { + + Oid oldOid = new Oid("1.3.6.1.5.6.2"); + new OneKDC(null).writeJAASConf(); + + System.setProperty("javax.security.auth.useSubjectCredsOnly", "false"); + GSSManager m = GSSManager.getInstance(); + boolean found = false; + + // Test 1: the getMechsForName() method accepts it. + for (Oid tmp: m.getMechsForName(oldOid)) { + if (tmp.equals(GSSUtil.GSS_KRB5_MECH_OID)) { + found = true; + break; + } + } + if (!found) { + throw new Exception("Cannot found krb5 mech for old name type"); + } + + // Test 2: the createName() method accepts it. + GSSName name = m.createName("server@host.rabbit.hole", oldOid); + + // Test 3: its getStringNameType() output is correct + if (!name.getStringNameType().equals(GSSName.NT_HOSTBASED_SERVICE)) { + throw new Exception("GSSName not correct name type"); + } + + // Test 4: everything still works. + GSSContext c1 = m.createContext( + name, + GSSUtil.GSS_KRB5_MECH_OID, + null, + GSSContext.DEFAULT_LIFETIME); + byte[] token = c1.initSecContext(new byte[0], 0, 0); + + Context s; + s = Context.fromJAAS("server"); + s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID); + s.x().acceptSecContext(token, 0, token.length); + } +} diff --git a/jdk/test/sun/security/krb5/etype/WeakCrypto.java b/jdk/test/sun/security/krb5/etype/WeakCrypto.java new file mode 100644 index 00000000000..9191c9451a1 --- /dev/null +++ b/jdk/test/sun/security/krb5/etype/WeakCrypto.java @@ -0,0 +1,50 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +/* + * @test + * @bug 6844909 + * @run main/othervm WeakCrypto + * @summary support allow_weak_crypto in krb5.conf + */ + +import java.io.File; +import sun.security.krb5.internal.crypto.EType; +import sun.security.krb5.EncryptedData; + +public class WeakCrypto { + public static void main(String[] args) throws Exception { + System.setProperty("java.security.krb5.conf", + System.getProperty("test.src", ".") + + File.separator + + "weakcrypto.conf"); + int[] etypes = EType.getBuiltInDefaults(); + + for (int i=0, length = etypes.length; i h1 || exit 1 +$TESTJAVA${FS}bin${FS}keytool -exportcert -help 2> h2 || exit 2 + +grep "input file" h1 || exit 3 +grep "output file" h2 || exit 4 + +exit 0 + diff --git a/jdk/test/sun/security/util/Oid/S11N.sh b/jdk/test/sun/security/util/Oid/S11N.sh index 081cd52298f..82046f360c0 100644 --- a/jdk/test/sun/security/util/Oid/S11N.sh +++ b/jdk/test/sun/security/util/Oid/S11N.sh @@ -1,5 +1,5 @@ # -# Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2004-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -21,8 +21,8 @@ # have any questions. # # @test -# @bug 4811968 -# @summary Serialization compatibility with old versions +# @bug 4811968 6908628 +# @summary Serialization compatibility with old versions (and fix) # @author Weijun Wang # # set a few environment variables so that the shell-script can run stand-alone @@ -99,7 +99,8 @@ esac # the test code -${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}SerialTest.java || exit 10 +${TESTJAVA}${FS}bin${FS}javac -target 1.4 -source 1.4 \ + -d . ${TESTSRC}${FS}SerialTest.java || exit 10 OLDJAVA=" /java/re/j2se/1.6.0/latest/binaries/${PF} @@ -161,4 +162,10 @@ rm -f tmp.oid.serial rm -f tmp.oid.serial.old rm -f SerialTest.class +for oldj in ${OLDJAVA}; do + if [ ! -d ${oldj} ]; then + echo WARNING: ${oldj} is missing. Test incomplete! > /dev/stderr + fi +done + exit 0 diff --git a/jdk/test/sun/text/resources/LocaleData b/jdk/test/sun/text/resources/LocaleData index 7b0ada3c594..e662c356117 100644 --- a/jdk/test/sun/text/resources/LocaleData +++ b/jdk/test/sun/text/resources/LocaleData @@ -673,8 +673,8 @@ FormatData/es_VE/NumberElements/0=, FormatData/es_VE/NumberElements/1=. FormatData/es_VE/NumberElements/2=; -# bug #4099810, 4290801 -CurrencyNames/uk_UA/UAH=\u0433\u0440\u0432. +# bug #4099810, 4290801, 6868106 +CurrencyNames/uk_UA/UAH=\u0433\u0440\u043b. FormatData/uk_UA/NumberPatterns/0=#,##0.###;-#,##0.### # FormatData/uk_UA/NumberPatterns/1=#,##0.## '\u0433\u0440\u0432.';-#,##0.## '\u0433\u0440\u0432.' # Changed; see bug 4122840 FormatData/uk_UA/NumberPatterns/2=#,##0% @@ -5526,3 +5526,575 @@ LocaleNames//IM=Isle Of Man # BL, MF (6627549) LocaleNames//BL=Saint Barth\u00e9lemy LocaleNames//MF=Saint Martin + +# bug 6609737 +FormatData/de/DateTimePatterns/0=HH:mm' Uhr 'z +TimeZoneNames/de/CET/1=Mitteleurop\u00e4ische Zeit +TimeZoneNames/de/CET/2=MEZ +TimeZoneNames/de/CET/3=Mitteleurop\u00e4ische Sommerzeit +TimeZoneNames/de/CET/4=MESZ +TimeZoneNames/de/EET/2=OEZ +TimeZoneNames/de/EET/4=OESZ +TimeZoneNames/de/WET/2=WEZ +TimeZoneNames/de/WET/4=WESZ + +# bug 6610748 +FormatData/fi/AmPmMarkers/0=ap. +FormatData/fi/AmPmMarkers/1=ip. + +# bug 6507067 +TimeZoneNames/zh_TW/Asia\/Taipei/1=\u53f0\u7063\u6a19\u6e96\u6642\u9593 +TimeZoneNames/zh_TW/Asia\/Taipei/2=TST + +# bug 6645271 +FormatData/hr_HR/DateTimePatterns/6=dd.MM.yyyy. +FormatData/hr_HR/DateTimePatterns/7=dd.MM.yy. + +# bug 6873931 +CurrencyNames/tr_TR/TRY=TL + +#bug 6450945 +CalendarData/ro/firstDayOfWeek=2 +CalendarData/ro/minimalDaysInFirstWeek=1 +FormatData/ro/DayNames/6=s\u00e2mb\u0103t\u0103 + +#bug 6645268 +LocaleNames/fi/fr=ranska +LocaleNames/fi/FR=Ranska +LocaleNames/fi_FI/fr=ranska +LocaleNames/fi_FI/FR=Ranska + +# bug 6646611, 6914413 +FormatData/be_BY/MonthNames/10=\u043b\u0456\u0441\u0442\u0430\u043f\u0430\u0434\u0430 +FormatData/be_BY/MonthAbbreviations/10=\u043b\u0456\u0441 + +# bug 6645405 +FormatData/hu_HU/NumberPatterns/1=#,##0.## \u00A4;-#,##0.## \u00A4 + +# bug 6650730 +FormatData/lt/NumberElements/1=\u00a0 +FormatData/lt/DateTimePatterns/6=yyyy-MM-dd + +#bug 6910489 +CalendarData/sl/firstDayOfWeek=2 + +# bug 6573250 +CurrencyNames/en_CA/USD=US$ + +# bug 6870908 +FormatData/et/MonthNames/0=jaanuar +FormatData/et/MonthNames/1=veebruar +FormatData/et/MonthNames/2=m\u00e4rts +FormatData/et/MonthNames/3=aprill +FormatData/et/MonthNames/4=mai +FormatData/et/MonthNames/5=juuni +FormatData/et/MonthNames/6=juuli +FormatData/et/MonthNames/7=august +FormatData/et/MonthNames/8=september +FormatData/et/MonthNames/9=oktoober +FormatData/et/MonthNames/10=november +FormatData/et/MonthNames/11=detsember +FormatData/et/MonthAbbreviations/0=jaan +FormatData/et/MonthAbbreviations/1=veebr +FormatData/et/MonthAbbreviations/2=m\u00e4rts +FormatData/et/MonthAbbreviations/3=apr +FormatData/et/MonthAbbreviations/4=mai +FormatData/et/MonthAbbreviations/5=juuni +FormatData/et/MonthAbbreviations/6=juuli +FormatData/et/MonthAbbreviations/7=aug +FormatData/et/MonthAbbreviations/8=sept +FormatData/et/MonthAbbreviations/9=okt +FormatData/et/MonthAbbreviations/10=nov +FormatData/et/MonthAbbreviations/11=dets + +# bug 6585666 +LocaleNames/es/aa=afar +LocaleNames/es/av=avar +LocaleNames/es/az=azer\u00ed +LocaleNames/es/ba=bashkir +LocaleNames/es/bh=bihari +LocaleNames/es/bn=bengal\u00ed +LocaleNames/es/cu=eslavo eclesi\u00e1stico +LocaleNames/es/dz=dzongkha +LocaleNames/es/eu=vasco +LocaleNames/es/fa=persa +LocaleNames/es/ff=fula +LocaleNames/es/fj=fidjiano +LocaleNames/es/fo=fero\u00e9s +LocaleNames/es/fy=fris\u00f3n +LocaleNames/es/gu=gujarati +LocaleNames/es/gv=ga\u00e9lico man\u00e9s +LocaleNames/es/hi=hindi +LocaleNames/es/ho=hiri motu +LocaleNames/es/ie=interlingue +LocaleNames/es/ig=igbo +LocaleNames/es/ii=sichuan yi +LocaleNames/es/ik=inupiaq +LocaleNames/es/kg=kongo +LocaleNames/es/ki=kikuyu +LocaleNames/es/kj=kuanyama +LocaleNames/es/kk=kazajo +LocaleNames/es/km=jemer +LocaleNames/es/kn=canar\u00e9s +LocaleNames/es/ks=cachemiro +LocaleNames/es/ku=kurdo +LocaleNames/es/ky=kirghiz +LocaleNames/es/lu=luba-katanga +LocaleNames/es/mr=marathi +LocaleNames/es/nb=bokmal noruego +LocaleNames/es/nd=ndebele septentrional +LocaleNames/es/nn=nynorsk noruego +LocaleNames/es/nr=ndebele meridional +LocaleNames/es/os=os\u00e9tico +LocaleNames/es/rm=retorrom\u00e1nico +LocaleNames/es/rn=kiroundi +LocaleNames/es/rw=kinyarwanda +LocaleNames/es/sd=sindhi +LocaleNames/es/se=sami septentrional +LocaleNames/es/sl=esloveno +LocaleNames/es/sn=shona +LocaleNames/es/ss=siswati +LocaleNames/es/st=sesotho +LocaleNames/es/su=sundan\u00e9s +LocaleNames/es/sw=swahili +LocaleNames/es/tg=tayiko +LocaleNames/es/ti=tigri\u00f1a +LocaleNames/es/tn=setchwana +LocaleNames/es/to=tongano +LocaleNames/es/tw=twi +LocaleNames/es/ty=tahitiano +LocaleNames/es/ug=uigur +LocaleNames/es/uk=ucraniano +LocaleNames/es/uz=uzbeko +LocaleNames/es/vo=volap\u00fck +LocaleNames/es/za=zhuang + +# bug 6716626 - language +LocaleNames/nl/aa=Afar +LocaleNames/nl/ab=Abchazisch +LocaleNames/nl/ae=Avestisch +LocaleNames/nl/af=Afrikaans +LocaleNames/nl/ak=Akan +LocaleNames/nl/am=Amhaars +LocaleNames/nl/an=Aragonees +LocaleNames/nl/ar=Arabisch +LocaleNames/nl/as=Assamees +LocaleNames/nl/av=Avarisch +LocaleNames/nl/ay=Aymara +LocaleNames/nl/az=Azerbeidzjaans +LocaleNames/nl/ba=Basjkiers +LocaleNames/nl/be=Wit-Russisch +LocaleNames/nl/bg=Bulgaars +LocaleNames/nl/bh=Bihari +LocaleNames/nl/bi=Bislama +LocaleNames/nl/bm=Bambara +LocaleNames/nl/bn=Bengalees +LocaleNames/nl/bo=Tibetaans +LocaleNames/nl/br=Bretons +LocaleNames/nl/bs=Bosnisch +LocaleNames/nl/ca=Catalaans +LocaleNames/nl/ce=Chechen +LocaleNames/nl/ch=Chamorro +LocaleNames/nl/co=Corsicaans +LocaleNames/nl/cr=Cree +LocaleNames/nl/cs=Tsjechisch +LocaleNames/nl/cu=Kerkslavisch +LocaleNames/nl/cv=Tsjoevasjisch +LocaleNames/nl/cy=Welsh +LocaleNames/nl/da=Deens +LocaleNames/nl/de=Duits +LocaleNames/nl/dv=Divehi +LocaleNames/nl/dz=Dzongkha +LocaleNames/nl/ee=Ewe +LocaleNames/nl/el=Grieks +LocaleNames/nl/en=Engels +LocaleNames/nl/eo=Esperanto +LocaleNames/nl/es=Spaans +LocaleNames/nl/et=Estlands +LocaleNames/nl/eu=Baskisch +LocaleNames/nl/fa=Perzisch +LocaleNames/nl/ff=Fulah +LocaleNames/nl/fi=Fins +LocaleNames/nl/fj=Fijisch +LocaleNames/nl/fo=Faer\u00f6ers +LocaleNames/nl/fr=Frans +LocaleNames/nl/fy=Fries +LocaleNames/nl/ga=Iers +LocaleNames/nl/gd=Schots Gaelic +LocaleNames/nl/gl=Galicisch +LocaleNames/nl/gn=Guarani +LocaleNames/nl/gu=Gujarati +LocaleNames/nl/gv=Manx +LocaleNames/nl/ha=Hausa +LocaleNames/nl/he=Hebreeuws +LocaleNames/nl/hi=Hindi +LocaleNames/nl/ho=Hiri Motu +LocaleNames/nl/hr=Kroatisch +LocaleNames/nl/ht=Ha\u00eftiaans +LocaleNames/nl/hu=Hongaars +LocaleNames/nl/hy=Armeens +LocaleNames/nl/hz=Herero +LocaleNames/nl/ia=Interlingua +LocaleNames/nl/id=Indonesisch +LocaleNames/nl/ie=Interlingue +LocaleNames/nl/ig=Igbo +LocaleNames/nl/ii=Sichuan Yi +LocaleNames/nl/ik=Inupiaq +LocaleNames/nl/io=Ido +LocaleNames/nl/is=IJslands +LocaleNames/nl/it=Italiaans +LocaleNames/nl/iu=Inuktitut +LocaleNames/nl/ja=Japans +LocaleNames/nl/jv=Javaans +LocaleNames/nl/ka=Georgisch +LocaleNames/nl/kg=Kongo +LocaleNames/nl/ki=Kikuyu +LocaleNames/nl/kj=Kuanyama +LocaleNames/nl/kk=Kazachs +LocaleNames/nl/kl=Kalaallisut +LocaleNames/nl/km=Khmer +LocaleNames/nl/kn=Kannada +LocaleNames/nl/ko=Koreaans +LocaleNames/nl/kr=Kanuri +LocaleNames/nl/ks=Kashmiri +LocaleNames/nl/ku=Koerdisch +LocaleNames/nl/kv=Komi +LocaleNames/nl/kw=Cornish +LocaleNames/nl/ky=Kirgizisch +LocaleNames/nl/la=Latijn +LocaleNames/nl/lb=Luxemburgs +LocaleNames/nl/lg=Ganda +LocaleNames/nl/li=Limburgs +LocaleNames/nl/ln=Lingala +LocaleNames/nl/lo=Lao +LocaleNames/nl/lt=Litouws +LocaleNames/nl/lu=Luba-Katanga +LocaleNames/nl/lv=Letlands +LocaleNames/nl/mg=Malagasisch +LocaleNames/nl/mh=Marshallees +LocaleNames/nl/mi=Maori +LocaleNames/nl/mk=Macedonisch +LocaleNames/nl/ml=Malayalam +LocaleNames/nl/mn=Mongools +LocaleNames/nl/mo=Moldavisch +LocaleNames/nl/mr=Marathi +LocaleNames/nl/ms=Maleis +LocaleNames/nl/mt=Maltees +LocaleNames/nl/my=Birmees +LocaleNames/nl/na=Nauru +LocaleNames/nl/nb=Noors - Bokm\u00e5l +LocaleNames/nl/nd=Noord-Ndbele +LocaleNames/nl/ne=Nepalees +LocaleNames/nl/ng=Ndonga +LocaleNames/nl/nl=Nederlands +LocaleNames/nl/nn=Noors - Nynorsk +LocaleNames/nl/no=Noors +LocaleNames/nl/nr=Zuid-Ndbele +LocaleNames/nl/nv=Navajo +LocaleNames/nl/ny=Nyanja +LocaleNames/nl/oc=Occitaans +LocaleNames/nl/oj=Ojibwa +LocaleNames/nl/om=Oromo +LocaleNames/nl/or=Oriya +LocaleNames/nl/os=Ossetisch +LocaleNames/nl/pa=Punjabi +LocaleNames/nl/pi=Pali +LocaleNames/nl/pl=Pools +LocaleNames/nl/ps=Pasjtoe +LocaleNames/nl/pt=Portugees +LocaleNames/nl/qu=Quechua +LocaleNames/nl/rm=Reto-Romaans +LocaleNames/nl/rn=Rundi +LocaleNames/nl/ro=Roemeens +LocaleNames/nl/ru=Russisch +LocaleNames/nl/rw=Kinyarwanda +LocaleNames/nl/sa=Sanskriet +LocaleNames/nl/sc=Sardinisch +LocaleNames/nl/sd=Sindhi +LocaleNames/nl/se=Noord-Samisch +LocaleNames/nl/sg=Sango +LocaleNames/nl/si=Singalees +LocaleNames/nl/sk=Slowaaks +LocaleNames/nl/sl=Sloveens +LocaleNames/nl/sm=Samoaans +LocaleNames/nl/sn=Shona +LocaleNames/nl/so=Somalisch +LocaleNames/nl/sq=Albanees +LocaleNames/nl/sr=Servisch +LocaleNames/nl/ss=Swati +LocaleNames/nl/st=Zuid-Sotho +LocaleNames/nl/su=Soendanees +LocaleNames/nl/sv=Zweeds +LocaleNames/nl/sw=Swahili +LocaleNames/nl/ta=Tamil +LocaleNames/nl/te=Teloegoe +LocaleNames/nl/tg=Tadzjieks +LocaleNames/nl/th=Thais +LocaleNames/nl/ti=Tigrinya +LocaleNames/nl/tk=Turkmeens +LocaleNames/nl/tl=Tagalog +LocaleNames/nl/tn=Tswana +LocaleNames/nl/to=Tonga +LocaleNames/nl/tr=Turks +LocaleNames/nl/ts=Tsonga +LocaleNames/nl/tt=Tataars +LocaleNames/nl/tw=Twi +LocaleNames/nl/ty=Tahitisch +LocaleNames/nl/ug=Oeigoers +LocaleNames/nl/uk=Oekra\u00efens +LocaleNames/nl/ur=Urdu +LocaleNames/nl/uz=Oezbeeks +LocaleNames/nl/ve=Venda +LocaleNames/nl/vi=Vietnamees +LocaleNames/nl/vo=Volap\u00fck +LocaleNames/nl/wa=Wallonisch +LocaleNames/nl/wo=Wolof +LocaleNames/nl/xh=Xhosa +LocaleNames/nl/yi=Jiddisch +LocaleNames/nl/yo=Yoruba +LocaleNames/nl/za=Zhuang +LocaleNames/nl/zh=Chinees +LocaleNames/nl/zu=Zulu + +# bug 6716626 - country +LocaleNames/nl/AD=Andorra +LocaleNames/nl/AE=Verenigde Arabische Emiraten +LocaleNames/nl/AF=Afghanistan +LocaleNames/nl/AG=Antigua en Barbuda +LocaleNames/nl/AI=Anguilla +LocaleNames/nl/AL=Albani\u00eb +LocaleNames/nl/AM=Armeni\u00eb +LocaleNames/nl/AN=Nederlandse Antillen +LocaleNames/nl/AO=Angola +LocaleNames/nl/AQ=Antarctica +LocaleNames/nl/AR=Argentini\u00eb +LocaleNames/nl/AS=Amerikaans Samoa +LocaleNames/nl/AT=Oostenrijk +LocaleNames/nl/AU=Australi\u00eb +LocaleNames/nl/AW=Aruba +LocaleNames/nl/AX=Alandeilanden +LocaleNames/nl/AZ=Azerbeidzjan +LocaleNames/nl/BA=Bosni\u00eb en Herzegovina +LocaleNames/nl/BB=Barbados +LocaleNames/nl/BD=Bangladesh +LocaleNames/nl/BE=Belgi\u00eb +LocaleNames/nl/BF=Burkina Faso +LocaleNames/nl/BG=Bulgarije +LocaleNames/nl/BH=Bahrein +LocaleNames/nl/BI=Burundi +LocaleNames/nl/BJ=Benin +LocaleNames/nl/BM=Bermuda +LocaleNames/nl/BN=Brunei +LocaleNames/nl/BO=Bolivia +LocaleNames/nl/BR=Brazili\u00eb +LocaleNames/nl/BS=Bahama\u2019s +LocaleNames/nl/BT=Bhutan +LocaleNames/nl/BV=Bouveteiland +LocaleNames/nl/BW=Botswana +LocaleNames/nl/BY=Wit-Rusland +LocaleNames/nl/BZ=Belize +LocaleNames/nl/CA=Canada +LocaleNames/nl/CC=Cocoseilanden +LocaleNames/nl/CD=Congo-Kinshasa +LocaleNames/nl/CF=Centraal-Afrikaanse Republiek +LocaleNames/nl/CG=Congo +LocaleNames/nl/CH=Zwitserland +LocaleNames/nl/CI=Ivoorkust +LocaleNames/nl/CK=Cookeilanden +LocaleNames/nl/CL=Chili +LocaleNames/nl/CM=Kameroen +LocaleNames/nl/CN=China +LocaleNames/nl/CO=Colombia +LocaleNames/nl/CR=Costa Rica +LocaleNames/nl/CS=Servi\u00eb en Montenegro +LocaleNames/nl/CU=Cuba +LocaleNames/nl/CV=Kaapverdi\u00eb +LocaleNames/nl/CX=Christmaseiland +LocaleNames/nl/CY=Cyprus +LocaleNames/nl/CZ=Tsjechi\u00eb +LocaleNames/nl/DE=Duitsland +LocaleNames/nl/DJ=Djibouti +LocaleNames/nl/DK=Denemarken +LocaleNames/nl/DM=Dominica +LocaleNames/nl/DO=Dominicaanse Republiek +LocaleNames/nl/DZ=Algerije +LocaleNames/nl/EC=Ecuador +LocaleNames/nl/EE=Estland +LocaleNames/nl/EG=Egypte +LocaleNames/nl/EH=Westelijke Sahara +LocaleNames/nl/ER=Eritrea +LocaleNames/nl/ES=Spanje +LocaleNames/nl/ET=Ethiopi\u00eb +LocaleNames/nl/FI=Finland +LocaleNames/nl/FJ=Fiji +LocaleNames/nl/FK=Falklandeilanden +LocaleNames/nl/FM=Micronesi\u00eb +LocaleNames/nl/FO=Faer\u00f6er +LocaleNames/nl/FR=Frankrijk +LocaleNames/nl/GA=Gabon +LocaleNames/nl/GB=Verenigd Koninkrijk +LocaleNames/nl/GD=Grenada +LocaleNames/nl/GE=Georgi\u00eb +LocaleNames/nl/GF=Frans-Guyana +LocaleNames/nl/GH=Ghana +LocaleNames/nl/GI=Gibraltar +LocaleNames/nl/GL=Groenland +LocaleNames/nl/GM=Gambia +LocaleNames/nl/GN=Guinee +LocaleNames/nl/GP=Guadeloupe +LocaleNames/nl/GQ=Equatoriaal-Guinea +LocaleNames/nl/GR=Griekenland +LocaleNames/nl/GS=Zuid-Georgi\u00eb en Zuidelijke Sandwicheilanden +LocaleNames/nl/GT=Guatemala +LocaleNames/nl/GU=Guam +LocaleNames/nl/GW=Guinee-Bissau +LocaleNames/nl/GY=Guyana +LocaleNames/nl/HK=Hongkong SAR van China +LocaleNames/nl/HM=Heard- en McDonaldeilanden +LocaleNames/nl/HN=Honduras +LocaleNames/nl/HR=Kroati\u00eb +LocaleNames/nl/HT=Ha\u00efti +LocaleNames/nl/HU=Hongarije +LocaleNames/nl/ID=Indonesi\u00eb +LocaleNames/nl/IE=Ierland +LocaleNames/nl/IL=Isra\u00ebl +LocaleNames/nl/IN=India +LocaleNames/nl/IO=Britse Gebieden in de Indische Oceaan +LocaleNames/nl/IQ=Irak +LocaleNames/nl/IR=Iran +LocaleNames/nl/IS=IJsland +LocaleNames/nl/IT=Itali\u00eb +LocaleNames/nl/JM=Jamaica +LocaleNames/nl/JO=Jordani\u00eb +LocaleNames/nl/JP=Japan +LocaleNames/nl/KE=Kenia +LocaleNames/nl/KG=Kirgizi\u00eb +LocaleNames/nl/KH=Cambodja +LocaleNames/nl/KI=Kiribati +LocaleNames/nl/KM=Comoren +LocaleNames/nl/KN=Saint Kitts en Nevis +LocaleNames/nl/KP=Noord-Korea +LocaleNames/nl/KR=Zuid-Korea +LocaleNames/nl/KW=Koeweit +LocaleNames/nl/KY=Caymaneilanden +LocaleNames/nl/KZ=Kazachstan +LocaleNames/nl/LA=Laos +LocaleNames/nl/LB=Libanon +LocaleNames/nl/LC=Saint Lucia +LocaleNames/nl/LI=Liechtenstein +LocaleNames/nl/LK=Sri Lanka +LocaleNames/nl/LR=Liberia +LocaleNames/nl/LS=Lesotho +LocaleNames/nl/LT=Litouwen +LocaleNames/nl/LU=Luxemburg +LocaleNames/nl/LV=Letland +LocaleNames/nl/LY=Libi\u00eb +LocaleNames/nl/MA=Marokko +LocaleNames/nl/MC=Monaco +LocaleNames/nl/MD=Moldavi\u00eb +LocaleNames/nl/ME=Montenegro +LocaleNames/nl/MG=Madagaskar +LocaleNames/nl/MH=Marshalleilanden +LocaleNames/nl/MK=Macedoni\u00eb +LocaleNames/nl/ML=Mali +LocaleNames/nl/MM=Myanmar +LocaleNames/nl/MN=Mongoli\u00eb +LocaleNames/nl/MO=Macao SAR van China +LocaleNames/nl/MP=Noordelijke Marianeneilanden +LocaleNames/nl/MQ=Martinique +LocaleNames/nl/MR=Mauritani\u00eb +LocaleNames/nl/MS=Montserrat +LocaleNames/nl/MT=Malta +LocaleNames/nl/MU=Mauritius +LocaleNames/nl/MV=Maldiven +LocaleNames/nl/MW=Malawi +LocaleNames/nl/MX=Mexico +LocaleNames/nl/MY=Maleisi\u00eb +LocaleNames/nl/MZ=Mozambique +LocaleNames/nl/NA=Namibi\u00eb +LocaleNames/nl/NC=Nieuw-Caledoni\u00eb +LocaleNames/nl/NE=Niger +LocaleNames/nl/NF=Norfolkeiland +LocaleNames/nl/NG=Nigeria +LocaleNames/nl/NI=Nicaragua +LocaleNames/nl/NL=Nederland +LocaleNames/nl/NO=Noorwegen +LocaleNames/nl/NP=Nepal +LocaleNames/nl/NR=Nauru +LocaleNames/nl/NU=Niue +LocaleNames/nl/NZ=Nieuw-Zeeland +LocaleNames/nl/OM=Oman +LocaleNames/nl/PA=Panama +LocaleNames/nl/PE=Peru +LocaleNames/nl/PF=Frans-Polynesi\u00eb +LocaleNames/nl/PG=Papoea-Nieuw-Guinea +LocaleNames/nl/PH=Filipijnen +LocaleNames/nl/PK=Pakistan +LocaleNames/nl/PL=Polen +LocaleNames/nl/PM=Saint Pierre en Miquelon +LocaleNames/nl/PN=Pitcairn +LocaleNames/nl/PR=Puerto Rico +LocaleNames/nl/PS=Palestijns Gebied +LocaleNames/nl/PT=Portugal +LocaleNames/nl/PW=Palau +LocaleNames/nl/PY=Paraguay +LocaleNames/nl/QA=Qatar +LocaleNames/nl/RE=R\u00e9union +LocaleNames/nl/RO=Roemeni\u00eb +LocaleNames/nl/RS=Servi\u00eb +LocaleNames/nl/RU=Rusland +LocaleNames/nl/RW=Rwanda +LocaleNames/nl/SA=Saoedi-Arabi\u00eb +LocaleNames/nl/SB=Salomonseilanden +LocaleNames/nl/SC=Seychellen +LocaleNames/nl/SD=Soedan +LocaleNames/nl/SE=Zweden +LocaleNames/nl/SG=Singapore +LocaleNames/nl/SH=Sint-Helena +LocaleNames/nl/SI=Sloveni\u00eb +LocaleNames/nl/SJ=Svalbard en Jan Mayen +LocaleNames/nl/SK=Slowakije +LocaleNames/nl/SL=Sierra Leone +LocaleNames/nl/SM=San Marino +LocaleNames/nl/SN=Senegal +LocaleNames/nl/SO=Somali\u00eb +LocaleNames/nl/SR=Suriname +LocaleNames/nl/ST=Sao Tom\u00e9 en Principe +LocaleNames/nl/SV=El Salvador +LocaleNames/nl/SY=Syri\u00eb +LocaleNames/nl/SZ=Swaziland +LocaleNames/nl/TC=Turks- en Caicoseilanden +LocaleNames/nl/TD=Tsjaad +LocaleNames/nl/TF=Franse Gebieden in de zuidelijke Indische Oceaan +LocaleNames/nl/TG=Togo +LocaleNames/nl/TH=Thailand +LocaleNames/nl/TJ=Tadzjikistan +LocaleNames/nl/TK=Tokelau +LocaleNames/nl/TL=Oost-Timor +LocaleNames/nl/TM=Turkmenistan +LocaleNames/nl/TN=Tunesi\u00eb +LocaleNames/nl/TO=Tonga +LocaleNames/nl/TR=Turkije +LocaleNames/nl/TT=Trinidad en Tobago +LocaleNames/nl/TV=Tuvalu +LocaleNames/nl/TW=Taiwan +LocaleNames/nl/TZ=Tanzania +LocaleNames/nl/UA=Oekra\u00efne +LocaleNames/nl/UG=Oeganda +LocaleNames/nl/UM=Amerikaanse kleinere afgelegen eilanden +LocaleNames/nl/US=Verenigde Staten +LocaleNames/nl/UY=Uruguay +LocaleNames/nl/UZ=Oezbekistan +LocaleNames/nl/VA=Vaticaanstad +LocaleNames/nl/VC=Saint Vincent en de Grenadines +LocaleNames/nl/VE=Venezuela +LocaleNames/nl/VG=Britse Maagdeneilanden +LocaleNames/nl/VI=Amerikaanse Maagdeneilanden +LocaleNames/nl/VN=Vietnam +LocaleNames/nl/VU=Vanuatu +LocaleNames/nl/WF=Wallis en Futuna +LocaleNames/nl/WS=Samoa +LocaleNames/nl/YE=Jemen +LocaleNames/nl/YT=Mayotte +LocaleNames/nl/ZA=Zuid-Afrika +LocaleNames/nl/ZM=Zambia diff --git a/jdk/test/sun/text/resources/LocaleDataTest.java b/jdk/test/sun/text/resources/LocaleDataTest.java index ff36327ea77..308c3d6b64f 100644 --- a/jdk/test/sun/text/resources/LocaleDataTest.java +++ b/jdk/test/sun/text/resources/LocaleDataTest.java @@ -31,7 +31,8 @@ * 5102005 5074431 6182685 6208712 6277020 6245766 6351682 6386647 6379382 * 6414459 6455680 6498742 6558863 6488119 6547501 6497154 6558856 6481177 * 6379214 6485516 6486607 4225362 4494727 6533691 6531591 6531593 6570259 - * 6509039 + * 6509039 6609737 6610748 6645271 6507067 6873931 6450945 6645268 6646611 + * 6645405 6650730 6910489 6573250 6870908 6585666 6716626 6914413 * @summary Verify locale data * */ @@ -255,6 +256,15 @@ public class LocaleDataTest index = key.length(); resTag = key.substring(oldIndex, index); + // TimeZone name may have "/" in it, for example "Asia/Taipei", so use "Asia\/Taipei in LocaleData. + if(resTag.endsWith("\\")) { + resTag = resTag.substring(0, resTag.length() - 1); + oldIndex = index; + index = key.indexOf("/", oldIndex + 1); + if (index == -1) index = key.length(); + resTag += key.substring(oldIndex, index); + } + if (index < key.length() - 1) qualifier = key.substring(index + 1); else diff --git a/jdk/test/sun/tools/common/ApplicationSetup.sh b/jdk/test/sun/tools/common/ApplicationSetup.sh index b5c0ad2314d..9c8e9d2bbc6 100644 --- a/jdk/test/sun/tools/common/ApplicationSetup.sh +++ b/jdk/test/sun/tools/common/ApplicationSetup.sh @@ -45,7 +45,11 @@ startApplication() # "java" process. if [ "$OS" = "Windows" ]; then sleep 2 - realpid=`ps -o pid,ppid,comm|grep ${pid}|grep "java"|cut -c1-6` + if [ "${isCygwin}" = "true" ] ; then + realpid=`ps -p ${pid} | tail -1 | awk '{print $4;}'` + else + realpid=`ps -o pid,ppid,comm|grep ${pid}|grep "java"|cut -c1-6` + fi pid=${realpid} fi diff --git a/jdk/test/sun/tools/common/CommonSetup.sh b/jdk/test/sun/tools/common/CommonSetup.sh index 861289c08d9..3876affc5ac 100644 --- a/jdk/test/sun/tools/common/CommonSetup.sh +++ b/jdk/test/sun/tools/common/CommonSetup.sh @@ -67,6 +67,11 @@ case "$OS" in PS=";" OS="Windows" ;; + CYGWIN* ) + PS=";" + OS="Windows" + isCygwin=true + ;; * ) PS=":" ;; diff --git a/jdk/test/sun/tools/jhat/HatRun.java b/jdk/test/sun/tools/jhat/HatRun.java index cb1e41b248e..6d736f83193 100644 --- a/jdk/test/sun/tools/jhat/HatRun.java +++ b/jdk/test/sun/tools/jhat/HatRun.java @@ -166,8 +166,10 @@ public class HatRun { jre_home ); String cdir = System.getProperty("test.classes", "."); String os_arch = System.getProperty("os.arch"); - boolean d64 = os_arch.equals("sparcv9") || - os_arch.equals("amd64"); + String os_name = System.getProperty("os.name"); + boolean d64 = os_name.equals("SunOS") && ( + os_arch.equals("sparcv9") || + os_arch.equals("amd64")); String isa_dir = d64?(File.separator+os_arch):""; String java = jre_home + File.separator + "bin" + isa_dir diff --git a/jdk/test/sun/tools/jps/jps-help.sh b/jdk/test/sun/tools/jps/jps-help.sh index 28a47864280..0303954343a 100644 --- a/jdk/test/sun/tools/jps/jps-help.sh +++ b/jdk/test/sun/tools/jps/jps-help.sh @@ -35,7 +35,7 @@ JPS="${TESTJAVA}/bin/jps" rm -f jps.out 2>/dev/null ${JPS} -? > jps.out 2>&1 -diff jps.out ${TESTSRC}/usage.out +diff -w jps.out ${TESTSRC}/usage.out if [ $? != 0 ] then echo "Output of jps -? differ from expected output. Failed." @@ -46,7 +46,7 @@ fi rm -f jps.out 2>/dev/null ${JPS} -help > jps.out 2>&1 -diff jps.out ${TESTSRC}/usage.out +diff -w jps.out ${TESTSRC}/usage.out if [ $? != 0 ] then echo "Output of jps -help differ from expected output. Failed." diff --git a/jdk/test/sun/tools/jstat/jstatHelp.sh b/jdk/test/sun/tools/jstat/jstatHelp.sh index 545970e3110..3ec7906c0e3 100644 --- a/jdk/test/sun/tools/jstat/jstatHelp.sh +++ b/jdk/test/sun/tools/jstat/jstatHelp.sh @@ -35,7 +35,7 @@ JSTAT="${TESTJAVA}/bin/jstat" rm -f jstat.out 2>/dev/null ${JSTAT} -? > jstat.out 2>&1 -diff jstat.out ${TESTSRC}/usage.out +diff -w jstat.out ${TESTSRC}/usage.out if [ $? != 0 ] then echo "Output of jstat -? differ from expected output. Failed." @@ -45,7 +45,7 @@ fi rm -f jstat.out 2>/dev/null ${JSTAT} -help > jstat.out 2>&1 -diff jstat.out ${TESTSRC}/usage.out +diff -w jstat.out ${TESTSRC}/usage.out if [ $? != 0 ] then echo "Output of jstat -help differ from expected output. Failed." diff --git a/jdk/test/sun/tools/jstat/jstatOptions1.sh b/jdk/test/sun/tools/jstat/jstatOptions1.sh index e38c413790f..ad3df13ca30 100644 --- a/jdk/test/sun/tools/jstat/jstatOptions1.sh +++ b/jdk/test/sun/tools/jstat/jstatOptions1.sh @@ -35,4 +35,4 @@ JSTAT="${TESTJAVA}/bin/jstat" rm -f jstat.out 2>/dev/null ${JSTAT} -options > jstat.out 2>&1 -diff jstat.out ${TESTSRC}/options1.out +diff -w jstat.out ${TESTSRC}/options1.out diff --git a/jdk/test/sun/tools/jstatd/jstatdUsage1.sh b/jdk/test/sun/tools/jstatd/jstatdUsage1.sh index 22d309b62c8..074ec5ce2ba 100644 --- a/jdk/test/sun/tools/jstatd/jstatdUsage1.sh +++ b/jdk/test/sun/tools/jstatd/jstatdUsage1.sh @@ -37,7 +37,7 @@ JSTATD_2_OUT="jstatd_$$_2.out" ${JSTATD} -? > ${JSTATD_1_OUT} 2>&1 -diff ${JSTATD_1_OUT} ${TESTSRC}/usage.out +diff -w ${JSTATD_1_OUT} ${TESTSRC}/usage.out if [ $? != 0 ] then echo "Output of jstatd -? differs from expected output. Failed." @@ -46,7 +46,7 @@ fi ${JSTATD} -help > ${JSTATD_2_OUT} 2>&1 -diff ${JSTATD_2_OUT} ${TESTSRC}/usage.out +diff -w ${JSTATD_2_OUT} ${TESTSRC}/usage.out if [ $? != 0 ] then echo "Output of jstatd -help differs from expected output. Failed." diff --git a/jdk/test/sun/tools/native2ascii/Native2AsciiTests.sh b/jdk/test/sun/tools/native2ascii/Native2AsciiTests.sh index 1fa7f6c0004..26281ba7241 100644 --- a/jdk/test/sun/tools/native2ascii/Native2AsciiTests.sh +++ b/jdk/test/sun/tools/native2ascii/Native2AsciiTests.sh @@ -32,7 +32,7 @@ if [ "${TESTSRC}" = "" ]; then TESTSRC=.; fi if [ "${TESTJAVA}" = "" ]; then TESTJAVA=$1; shift; fi case `uname -s` in - Windows*) OS=Windows;; + Windows* | CYGWIN*) OS=Windows;; SunOS|Linux) OS=Unix;; esac @@ -45,12 +45,14 @@ check() { # Strip carriage returns from output when comparing with n2a test output # on win32 systems - if [ OS = Windows ]; then - tr -d '\015' <$out >$out.1 + if [ ${OS} = Windows ]; then + sed -e 's@\\r@@g' $out >$out.1 + sed -e 's@\\r@@g' $expected >$out.expected else cp $out $out.1 + cp $expected $out.expected fi - if (set -x; diff -c $expected $out.1); then + if (set -x; diff -c $out.expected $out.1); then echo "$bug passed" else echo "$bug failed" diff --git a/jdk/test/sun/util/resources/Locale/Bug4429024.java b/jdk/test/sun/util/resources/Locale/Bug4429024.java index 6a3ffc2891f..e592025d0b3 100644 --- a/jdk/test/sun/util/resources/Locale/Bug4429024.java +++ b/jdk/test/sun/util/resources/Locale/Bug4429024.java @@ -46,7 +46,7 @@ public class Bug4429024 { { "en", "englanti" }, { "es", "espanja" }, { "fi", "suomi" }, - { "fr", "franska" }, + { "fr", "ranska" }, { "he", "heprea" }, { "hi", "hindi" }, { "it", "italia" }, @@ -75,7 +75,7 @@ public class Bug4429024 { { "DK", "Tanska" }, { "ES", "Espanja" }, { "FI", "Suomi" }, - { "FR", "Franska" }, + { "FR", "Ranska" }, { "GB", "Iso-Britannia" }, { "GR", "Kreikka" }, { "IE", "Irlanti" }, diff --git a/jdk/test/tools/launcher/ChangeDataModel.sh b/jdk/test/tools/launcher/ChangeDataModel.sh index eddc38d7cfc..1fc689f403b 100644 --- a/jdk/test/tools/launcher/ChangeDataModel.sh +++ b/jdk/test/tools/launcher/ChangeDataModel.sh @@ -29,6 +29,9 @@ OS=`uname -s`; +# To remove CR from output, needed for java apps in CYGWIN, harmless otherwise +SED_CR="sed -e s@\\r@@g" + case "$OS" in Windows* | CYGWIN* ) PATHSEP=";" @@ -79,10 +82,10 @@ $JAVAC GetDataModel.java # Verify data model flag for default data model is accepted -DM=`$JAVA GetDataModel` +DM=`$JAVA GetDataModel | ${SED_CR}` case "$DM" in 32 ) - DM2=`${JAVA} -d32 GetDataModel` + DM2=`${JAVA} -d32 GetDataModel | ${SED_CR}` if [ "${DM2}" != "32" ] then echo "Data model flag -d32 not accepted or had improper effect." @@ -91,7 +94,7 @@ case "$DM" in ;; 64 ) - DM2=`${JAVA} -d64 GetDataModel` + DM2=`${JAVA} -d64 GetDataModel | ${SED_CR}` if [ "${DM2}" != "64" ] then echo "Data model flag -d64 not accepted or had improper effect." @@ -227,10 +230,10 @@ then else # Negative tests for non-dual mode platforms to ensure the other data model is # rejected - DM=`$JAVA GetDataModel` + DM=`$JAVA GetDataModel | ${SED_CR}` case "$DM" in 32 ) - DM2=`${JAVA} -d64 GetDataModel` + DM2=`${JAVA} -d64 GetDataModel | ${SED_CR}` if [ "x${DM2}" != "x" ] then echo "Data model flag -d64 was accepted." @@ -239,7 +242,7 @@ else ;; 64 ) - DM2=`${JAVA} -d32 GetDataModel` + DM2=`${JAVA} -d32 GetDataModel | ${SED_CR}` if [ "x${DM2}" != "x" ] then echo "Data model flag -d32 was accepted." diff --git a/jdk/test/tools/launcher/ClassPathWildCard.sh b/jdk/test/tools/launcher/ClassPathWildCard.sh index 46a4866e486..4b3b0dfb5e1 100644 --- a/jdk/test/tools/launcher/ClassPathWildCard.sh +++ b/jdk/test/tools/launcher/ClassPathWildCard.sh @@ -145,7 +145,7 @@ CreateClassFiles D OS=`uname -s` case $OS in - Windows*|Cygwin*) + Windows*|CYGWIN*) PATHSEP=";" ExecJava "" "${PATHSEP}NOOPDIR" ExecJava "w" "${PATHSEP}NOOPDIR" diff --git a/jdk/test/tools/launcher/DefaultLocaleTest.sh b/jdk/test/tools/launcher/DefaultLocaleTest.sh index 97eddd5bf63..31af0aa3199 100644 --- a/jdk/test/tools/launcher/DefaultLocaleTest.sh +++ b/jdk/test/tools/launcher/DefaultLocaleTest.sh @@ -48,7 +48,7 @@ fi OS=`uname` case "$OS" in - Windows* | CYGWIN* ) + Windows* ) JAVAC="${TESTJAVA}/bin/javac -d . " JAVA="${TESTJAVA}/bin/java -classpath . " JAVAW="${TESTJAVA}/bin/javaw -classpath . " @@ -64,6 +64,22 @@ case "$OS" in echo "Test passes" exit 0 ;; + CYGWIN* ) + JAVAC="${TESTJAVA}/bin/javac -d . " + JAVA="${TESTJAVA}/bin/java -classpath . " + JAVAW="${TESTJAVA}/bin/javaw -classpath . " + + ${JAVAC} ${TESTSRC}/DefaultLocaleTest.java + ${JAVA} DefaultLocaleTest | sed -e s@\\r@@g > x.out + ${JAVAW} DefaultLocaleTest `cat x.out` + if [ $? -ne 0 ] + then + echo "Test fails" + exit 1 + fi + echo "Test passes" + exit 0 + ;; * ) echo "Non-windows environment; test vacuously succeeds." exit 0; diff --git a/jdk/test/tools/launcher/UnicodeTest.sh b/jdk/test/tools/launcher/UnicodeTest.sh index 7b4789772f0..8f77f4b739d 100644 --- a/jdk/test/tools/launcher/UnicodeTest.sh +++ b/jdk/test/tools/launcher/UnicodeTest.sh @@ -54,7 +54,7 @@ mkdir UnicodeTest-src UnicodeTest-classes echo "creating test source files" "$JAVAC" -d . "${TESTSRC}"/UnicodeTest.java -CLASS_NAME=`"$JAVA" UnicodeTest` +CLASS_NAME=`"$JAVA" UnicodeTest | sed -e 's@\\r@@g' ` if [ "$CLASS_NAME" = "" ] then diff --git a/langtools/.hgignore b/langtools/.hgignore index ca1b0b21ee2..0092bd4ff5a 100644 --- a/langtools/.hgignore +++ b/langtools/.hgignore @@ -1,3 +1,3 @@ ^build/ ^dist/ -^nbproject/private/ +/nbproject/private/ diff --git a/langtools/.hgtags b/langtools/.hgtags index 7fb6b91c680..1564d810c2d 100644 --- a/langtools/.hgtags +++ b/langtools/.hgtags @@ -50,3 +50,13 @@ ce9bcdcb7859bb7ef10afd078ad59ba7847f208d jdk7-b69 9596dff460935f09684c11d156ce591f92584f0d jdk7-b73 1a66b08deed0459054b5b1bea3dfbead30d258fa jdk7-b74 2485f5641ed0829205aaaeb31ad711c2c2ef0de3 jdk7-b75 +8fb9b4be3cb1574302acde90549a4d333ef51e93 jdk7-b76 +0398ae15b90ac76d87ee21844453e95ff8613e43 jdk7-b77 +acc1e40a5874ebf32bebcb6ada565b3b40b7461c jdk7-b78 +ac5b4c5644ce54585e5287563dde2b006fa664f4 jdk7-b79 +f0074aa48d4e2a4c03c92b9c4f880679fea0306c jdk7-b80 +cfabfcf9f110ef896cbdd382903d20eefbceefe0 jdk7-b81 +47003a3622f6a17756ab0338bfa8a43e36549e99 jdk7-b82 +c9f4ae1f1480e89aaf7e72173184089d9cea397a jdk7-b83 +d9cd5b8286e44f3baf90da290cd295433e21c05a jdk7-b84 +136bfc67946219fb02ee223984540a4a9c5b209f jdk7-b85 diff --git a/langtools/make/Makefile b/langtools/make/Makefile index e2c8202f6b5..0b6e779fba3 100644 --- a/langtools/make/Makefile +++ b/langtools/make/Makefile @@ -70,7 +70,7 @@ ifdef QUIET endif ifdef VERBOSE - ANT_OPTIONS += -verbose -diagnostics + ANT_OPTIONS += -verbose -debug endif ifdef JDK_VERSION @@ -133,6 +133,23 @@ ifdef ALT_BOOTDIR ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR) endif +# To facilitate bootstrapping, much of langtools can be compiled with (just) +# a boot JDK. However, some source files need to be compiled against +# new JDK API. In a bootstrap build, an import JDK may not be available, +# so build.xml can also build against the source files in a jdk repo, +# in which case it will automatically generate stub files for the new JDK API. +ifdef JDK_TOPDIR + ANT_OPTIONS += -Dimport.jdk=$(JDK_TOPDIR) +else + ifdef ALT_JDK_TOPDIR + ANT_OPTIONS += -Dimport.jdk=$(ALT_JDK_TOPDIR) + else + ifdef ALT_JDK_IMPORT_PATH + ANT_OPTIONS += -Dimport.jdk=$(ALT_JDK_IMPORT_PATH) + endif + endif +endif + ifdef ALT_OUTPUTDIR OUTPUTDIR = $(ALT_OUTPUTDIR) ANT_OPTIONS += -Dbuild.dir=$(ALT_OUTPUTDIR)/build diff --git a/langtools/make/build.properties b/langtools/make/build.properties index ffe6fc0ce85..75dc6c97b32 100644 --- a/langtools/make/build.properties +++ b/langtools/make/build.properties @@ -148,6 +148,28 @@ apt.tests = \ # +# The following files require the import JDK to be available +require.import.jdk.files = \ + com/sun/tools/javac/nio/*.java + +# The following files in the import jdk source directory are required +# in order to compile the files defined in ${require.import.jdk.files} +# +# For NIO, the list of stub files is defined by the contents of the primary +# API packages, together with such types that may be required in order to +# compile the stubs. Some of these dependencies would go away if the stub +# generator were to be improved -- e.g. by removing unnecessary imports. +# +import.jdk.stub.files = \ + java/io/File.java \ + java/nio/file/**.java \ + java/nio/file/attribute/**.java \ + java/nio/file/spi/**.java \ + java/nio/channels/AsynchronousChannel.java \ + java/nio/channels/AsynchronousFileChannel.java \ + java/nio/channels/CompletionHandler.java \ + java/nio/channels/SeekableByteChannel.java + # The following value is used by the main jtreg target. # An empty value means all tests # Override as desired to run a specific set of tests diff --git a/langtools/make/build.xml b/langtools/make/build.xml index 6b04ca30fc1..d614578847f 100644 --- a/langtools/make/build.xml +++ b/langtools/make/build.xml @@ -56,6 +56,7 @@ + @@ -93,6 +94,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -108,11 +151,17 @@ - + - + - + + + @@ -188,23 +237,27 @@ - - + + + + - - + + - - + + + - + @@ -217,19 +270,20 @@ - + + + - + - - + + @@ -249,21 +303,19 @@ - + + - + - + - + @@ -281,19 +333,19 @@ - + + + - - + + + - + @@ -310,21 +362,23 @@ - - + + + + - + - - + + @@ -342,19 +396,19 @@ - + + + - - + + + - + @@ -372,6 +426,17 @@ + + + + + + + @@ -396,40 +461,12 @@ - + - - - - - - - - - - - - - - @@ -442,35 +479,15 @@ - + - - - - - - - - - - - + - - - + + + + + + + + + + - - - - - + + - + - - - + + @@ -562,30 +574,32 @@ + java="${boot.java}"/> + + + + + + + full.version="${bootstrap.full.version}" + excludes="${require.import.jdk.files} **/package-info.java"/> @@ -603,6 +617,20 @@ classpath="${build.toolclasses.dir}/"/> + + + + + + @@ -764,7 +792,7 @@ + description="display settings of configuration values"> ant.home = ${ant.home} boot.java.home = ${boot.java.home} target.java.home = ${target.java.home} diff --git a/langtools/make/tools/CompileProperties/CompileProperties.java b/langtools/make/tools/CompileProperties/CompileProperties.java index f498815ddf2..7e2d5dca58f 100644 --- a/langtools/make/tools/CompileProperties/CompileProperties.java +++ b/langtools/make/tools/CompileProperties/CompileProperties.java @@ -101,7 +101,7 @@ public class CompileProperties { boolean ok = true; /* Original usage */ if (args.length == 2 && args[0].charAt(0) != '-' ) { - ok = createFile(args[0], args[1], "ListResourceBundle"); + ok = createFile(args[0], args[1], "java.util.ListResourceBundle"); } else if (args.length == 3) { ok = createFile(args[0], args[1], args[2]); } else if (args.length == 0) { @@ -285,9 +285,9 @@ public class CompileProperties { log.info(" java CompileProperties {-compile path_to_properties_file path_to_java_output_file super_class} -or- -optionsfile filename"); log.info(""); log.info("Example:"); - log.info(" java CompileProperties -compile test.properties test.java ListResourceBundle"); + log.info(" java CompileProperties -compile test.properties test.java java.util.ListResourceBundle"); log.info(" java CompileProperties -optionsfile option_file"); - log.info("option_file contains: -compile test.properties test.java ListResourceBundle"); + log.info("option_file contains: -compile test.properties test.java java.util.ListResourceBundle"); } private static String escape(String theString) { @@ -379,7 +379,6 @@ public class CompileProperties { private static final String FORMAT = "{0}" + - "import java.util.ListResourceBundle;\n\n" + "public final class {1} extends {2} '{'\n" + " protected final Object[][] getContents() '{'\n" + " return new Object[][] '{'\n" + diff --git a/langtools/make/tools/CompileProperties/CompilePropertiesTask.java b/langtools/make/tools/CompileProperties/CompilePropertiesTask.java index e7a0be1751d..bed9e27b3bf 100644 --- a/langtools/make/tools/CompileProperties/CompilePropertiesTask.java +++ b/langtools/make/tools/CompileProperties/CompilePropertiesTask.java @@ -45,6 +45,7 @@ public class CompilePropertiesTask extends MatchingTask { this.superclass = superclass; } + @Override public void execute() { CompileProperties.Log log = new CompileProperties.Log() { public void error(String msg, Exception e) { @@ -84,7 +85,7 @@ public class CompilePropertiesTask extends MatchingTask { log("Generating " + count + " resource files to " + destDir, Project.MSG_INFO); CompileProperties cp = new CompileProperties(); cp.setLog(log); - boolean ok = cp.run((String[])mainOpts.toArray(new String[mainOpts.size()])); + boolean ok = cp.run(mainOpts.toArray(new String[mainOpts.size()])); if (!ok) throw new BuildException("CompileProperties failed."); } diff --git a/langtools/make/tools/GenStubs/GenStubs.java b/langtools/make/tools/GenStubs/GenStubs.java new file mode 100644 index 00000000000..a2fd4b3605b --- /dev/null +++ b/langtools/make/tools/GenStubs/GenStubs.java @@ -0,0 +1,448 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.io.*; +import java.util.*; +import javax.tools.JavaFileObject; +import javax.tools.StandardJavaFileManager; +import javax.tools.StandardLocation; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.DirectoryScanner; +import org.apache.tools.ant.taskdefs.MatchingTask; +import org.apache.tools.ant.types.Path; +import org.apache.tools.ant.types.Reference; + + +import com.sun.source.tree.CompilationUnitTree; +import com.sun.source.util.JavacTask; +import com.sun.tools.javac.api.JavacTool; +import com.sun.tools.javac.code.Flags; +import com.sun.tools.javac.code.TypeTags; +import com.sun.tools.javac.tree.JCTree; +import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; +import com.sun.tools.javac.tree.JCTree.JCFieldAccess; +import com.sun.tools.javac.tree.JCTree.JCIdent; +import com.sun.tools.javac.tree.JCTree.JCImport; +import com.sun.tools.javac.tree.JCTree.JCLiteral; +import com.sun.tools.javac.tree.JCTree.JCMethodDecl; +import com.sun.tools.javac.tree.JCTree.JCModifiers; +import com.sun.tools.javac.tree.JCTree.JCVariableDecl; +import com.sun.tools.javac.tree.Pretty; +import com.sun.tools.javac.tree.TreeMaker; +import com.sun.tools.javac.tree.TreeScanner; +import com.sun.tools.javac.tree.TreeTranslator; +import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.util.ListBuffer; +import com.sun.tools.javac.util.Name; +import javax.tools.JavaFileManager; + +/** + * Generate stub source files by removing implementation details from input files. + * + * This is a special purpose stub generator, specific to the needs of generating + * stub files for JDK 7 API that are needed to compile langtools files that depend + * on that API. The stub generator works by removing as much of the API source code + * as possible without affecting the public signature, in order to reduce the + * transitive closure of the API being referenced. The resulting stubs can be + * put on the langtools sourcepath with -implicit:none to compile the langtools + * files that depend on the JDK 7 API. + * + * Usage: + * genstubs -s -sourcepath + * + * The specified class names are looked up on the sourcepath, and corresponding + * stubs are written to the source output directory. + * + * Classes are parsed into javac ASTs, then processed with a javac TreeTranslator + * to remove implementation details, and written out in the source output directory. + * Documentation comments and annotations are removed. Method bodies are removed + * and methods are marked native. Private and package-private field definitions + * have their initializers replace with 0, 0.0, false, null as appropriate. + * + * An Ant task, Main$Ant is also provided. Files are specified with an implicit + * fileset, using srcdir as a base directory. The set of files to be included + * is specified with an includes attribute or nested set. However, + * unlike a normal fileset, an empty includes attribute means "no files" instead + * of "all files". The Ant task also accepts "fork=true" and classpath attribute + * or nested element to run GenStubs in a separate VM with the specified + * path. This is likely necessary if a JDK 7 parser is required to read the + * JDK 7 input files. + */ + +public class GenStubs { + static class Fault extends Exception { + private static final long serialVersionUID = 0; + Fault(String message) { + super(message); + } + Fault(String message, Throwable cause) { + super(message); + initCause(cause); + } + } + + public static void main(String[] args) { + boolean ok = new GenStubs().run(args); + if (!ok) + System.exit(1); + } + + boolean run(String... args) { + File outdir = null; + String sourcepath = null; + List classes = new ArrayList(); + for (ListIterator iter = Arrays.asList(args).listIterator(); iter.hasNext(); ) { + String arg = iter.next(); + if (arg.equals("-s") && iter.hasNext()) + outdir = new File(iter.next()); + else if (arg.equals("-sourcepath") && iter.hasNext()) + sourcepath = iter.next(); + else if (arg.startsWith("-")) + throw new IllegalArgumentException(arg); + else { + classes.add(arg); + while (iter.hasNext()) + classes.add(iter.next()); + } + } + + return run(sourcepath, outdir, classes); + } + + boolean run(String sourcepath, File outdir, List classes) { + //System.err.println("run: sourcepath:" + sourcepath + " outdir:" + outdir + " classes:" + classes); + if (sourcepath == null) + throw new IllegalArgumentException("sourcepath not set"); + if (outdir == null) + throw new IllegalArgumentException("source output dir not set"); + + JavacTool tool = JavacTool.create(); + StandardJavaFileManager fm = tool.getStandardFileManager(null, null, null); + + try { + fm.setLocation(StandardLocation.SOURCE_OUTPUT, Collections.singleton(outdir)); + fm.setLocation(StandardLocation.SOURCE_PATH, splitPath(sourcepath)); + List files = new ArrayList(); + for (String c: classes) { + JavaFileObject fo = fm.getJavaFileForInput( + StandardLocation.SOURCE_PATH, c, JavaFileObject.Kind.SOURCE); + if (fo == null) + error("class not found: " + c); + else + files.add(fo); + } + + JavacTask t = tool.getTask(null, fm, null, null, null, files); + Iterable trees = t.parse(); + for (CompilationUnitTree tree: trees) { + makeStub(fm, tree); + } + } catch (IOException e) { + error("IO error " + e, e); + } + + return (errors == 0); + } + + void makeStub(StandardJavaFileManager fm, CompilationUnitTree tree) throws IOException { + CompilationUnitTree tree2 = new StubMaker().translate(tree); + CompilationUnitTree tree3 = new ImportCleaner(fm).removeRedundantImports(tree2); + + String className = fm.inferBinaryName(StandardLocation.SOURCE_PATH, tree.getSourceFile()); + JavaFileObject fo = fm.getJavaFileForOutput(StandardLocation.SOURCE_OUTPUT, + className, JavaFileObject.Kind.SOURCE, null); + // System.err.println("Writing " + className + " to " + fo.getName()); + Writer out = fo.openWriter(); + try { + new Pretty(out, true).printExpr((JCTree) tree3); + } finally { + out.close(); + } + } + + List splitPath(String path) { + List list = new ArrayList(); + for (String p: path.split(File.pathSeparator)) { + if (p.length() > 0) + list.add(new File(p)); + } + return list; + } + + void error(String message) { + System.err.println(message); + errors++; + } + + void error(String message, Throwable cause) { + error(message); + } + + int errors; + + class StubMaker extends TreeTranslator { + CompilationUnitTree translate(CompilationUnitTree tree) { + return super.translate((JCCompilationUnit) tree); + } + + /** + * compilation units: remove javadoc comments + * -- required, in order to remove @deprecated tags, since we + * (separately) remove all annotations, including @Deprecated + */ + public void visitTopLevel(JCCompilationUnit tree) { + super.visitTopLevel(tree); + tree.docComments = Collections.emptyMap(); + } + + /** + * methods: remove method bodies, make methods native + */ + @Override + public void visitMethodDef(JCMethodDecl tree) { + tree.mods = translate(tree.mods); + tree.restype = translate(tree.restype); + tree.typarams = translateTypeParams(tree.typarams); + tree.params = translateVarDefs(tree.params); + tree.thrown = translate(tree.thrown); + if (tree.restype != null && tree.body != null) { + tree.mods.flags |= Flags.NATIVE; + tree.body = null; + } + result = tree; + } + + /** + * modifiers: remove annotations + */ + @Override + public void visitModifiers(JCModifiers tree) { + tree.annotations = com.sun.tools.javac.util.List.nil(); + result = tree; + } + + /** + * field definitions: replace initializers with 0, 0.0, false etc + * when possible -- i.e. leave public, protected initializers alone + */ + @Override + public void visitVarDef(JCVariableDecl tree) { + tree.mods = translate(tree.mods); + tree.vartype = translate(tree.vartype); + if (tree.init != null) { + if ((tree.mods.flags & (Flags.PUBLIC | Flags.PROTECTED)) != 0) + tree.init = translate(tree.init); + else { + String t = tree.vartype.toString(); + if (t.equals("boolean")) + tree.init = new JCLiteral(TypeTags.BOOLEAN, 0) { }; + else if (t.equals("byte")) + tree.init = new JCLiteral(TypeTags.BYTE, 0) { }; + else if (t.equals("char")) + tree.init = new JCLiteral(TypeTags.CHAR, 0) { }; + else if (t.equals("double")) + tree.init = new JCLiteral(TypeTags.DOUBLE, 0.d) { }; + else if (t.equals("float")) + tree.init = new JCLiteral(TypeTags.FLOAT, 0.f) { }; + else if (t.equals("int")) + tree.init = new JCLiteral(TypeTags.INT, 0) { }; + else if (t.equals("long")) + tree.init = new JCLiteral(TypeTags.LONG, 0) { }; + else if (t.equals("short")) + tree.init = new JCLiteral(TypeTags.SHORT, 0) { }; + else + tree.init = new JCLiteral(TypeTags.BOT, null) { }; + } + } + result = tree; + } + } + + class ImportCleaner extends TreeScanner { + private Set names = new HashSet(); + private TreeMaker m; + + ImportCleaner(JavaFileManager fm) { + // ImportCleaner itself doesn't require a filemanager, but instantiating + // a TreeMaker does, indirectly (via ClassReader, sigh) + Context c = new Context(); + c.put(JavaFileManager.class, fm); + m = TreeMaker.instance(c); + } + + CompilationUnitTree removeRedundantImports(CompilationUnitTree t) { + JCCompilationUnit tree = (JCCompilationUnit) t; + tree.accept(this); + ListBuffer defs = new ListBuffer(); + for (JCTree def: tree.defs) { + if (def.getTag() == JCTree.IMPORT) { + JCImport imp = (JCImport) def; + if (imp.qualid.getTag() == JCTree.SELECT) { + JCFieldAccess qualid = (JCFieldAccess) imp.qualid; + if (!qualid.name.toString().equals("*") + && !names.contains(qualid.name)) { + continue; + } + } + } + defs.add(def); + } + return m.TopLevel(tree.packageAnnotations, tree.pid, defs.toList()); + } + + @Override + public void visitImport(JCImport tree) { } // ignore names found in imports + + @Override + public void visitIdent(JCIdent tree) { + names.add(tree.name); + } + + @Override + public void visitSelect(JCFieldAccess tree) { + super.visitSelect(tree); + names.add(tree.name); + } + } + + //---------- Ant Invocation ------------------------------------------------ + + public static class Ant extends MatchingTask { + private File srcDir; + private File destDir; + private boolean fork; + private Path classpath; + private String includes; + + public void setSrcDir(File dir) { + this.srcDir = dir; + } + + public void setDestDir(File dir) { + this.destDir = dir; + } + + public void setFork(boolean v) { + this.fork = v; + } + + public void setClasspath(Path cp) { + if (classpath == null) + classpath = cp; + else + classpath.append(cp); + } + + public Path createClasspath() { + if (classpath == null) { + classpath = new Path(getProject()); + } + return classpath.createPath(); + } + + public void setClasspathRef(Reference r) { + createClasspath().setRefid(r); + } + + public void setIncludes(String includes) { + super.setIncludes(includes); + this.includes = includes; + } + + @Override + public void execute() { + if (includes != null && includes.trim().isEmpty()) + return; + + DirectoryScanner s = getDirectoryScanner(srcDir); + String[] files = s.getIncludedFiles(); +// System.err.println("Ant.execute: srcDir " + srcDir); +// System.err.println("Ant.execute: destDir " + destDir); +// System.err.println("Ant.execute: files " + Arrays.asList(files)); + + files = filter(srcDir, destDir, files); + if (files.length == 0) + return; + System.out.println("Generating " + files.length + " stub files to " + destDir); + + List classNames = new ArrayList(); + for (String file: files) { + classNames.add(file.replaceAll(".java$", "").replace('/', '.')); + } + + if (!fork) { + GenStubs m = new GenStubs(); + boolean ok = m.run(srcDir.getPath(), destDir, classNames); + if (!ok) + throw new BuildException("genstubs failed"); + } else { + List cmd = new ArrayList(); + String java_home = System.getProperty("java.home"); + cmd.add(new File(new File(java_home, "bin"), "java").getPath()); + if (classpath != null) + cmd.add("-Xbootclasspath/p:" + classpath); + cmd.add(GenStubs.class.getName()); + cmd.add("-sourcepath"); + cmd.add(srcDir.getPath()); + cmd.add("-s"); + cmd.add(destDir.getPath()); + cmd.addAll(classNames); + //System.err.println("GenStubs exec " + cmd); + ProcessBuilder pb = new ProcessBuilder(cmd); + pb.redirectErrorStream(true); + try { + Process p = pb.start(); + BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); + try { + String line; + while ((line = in.readLine()) != null) + System.out.println(line); + } finally { + in.close(); + } + int rc = p.waitFor(); + if (rc != 0) + throw new BuildException("genstubs failed"); + } catch (IOException e) { + throw new BuildException("genstubs failed", e); + } catch (InterruptedException e) { + throw new BuildException("genstubs failed", e); + } + } + } + + String[] filter(File srcDir, File destDir, String[] files) { + List results = new ArrayList(); + for (String f: files) { + long srcTime = new File(srcDir, f).lastModified(); + long destTime = new File(destDir, f).lastModified(); + if (srcTime > destTime) + results.add(f); + } + return results.toArray(new String[results.size()]); + } + } +} diff --git a/langtools/src/share/bin/launcher.sh-template b/langtools/src/share/bin/launcher.sh-template index c62af2e9b94..16ade3e071d 100644 --- a/langtools/src/share/bin/launcher.sh-template +++ b/langtools/src/share/bin/launcher.sh-template @@ -38,7 +38,7 @@ mylib="`dirname $mydir`"/lib # dependent jar files for additional dependencies. if [ "$LANGTOOLS_USE_BOOTCLASSPATH" != "no" ]; then - cp=`unzip -c $mylib/#PROGRAM#.jar META-INF/MANIFEST.MF | + cp=`unzip -c "$mylib/#PROGRAM#.jar" META-INF/MANIFEST.MF | grep "Class-Path:" | sed -e 's|Class-Path: *||' -e 's|\([a-z]*\.jar\) *|'"$mylib"'/\1:|g'` bcp="$mylib/#PROGRAM#.jar":$cp diff --git a/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java b/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java index 62b7209dde4..85a2a55f1e2 100644 --- a/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java +++ b/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java @@ -101,7 +101,11 @@ class SourceOrderDeclScanner extends DeclarationScanner { } @SuppressWarnings("cast") private int compareEqualPosition(Declaration d1, Declaration d2) { - assert d1.getPosition() == d2.getPosition(); + assert + (d1.getPosition() == d2.getPosition()) || // Handles two null positions. + (d1.getPosition().file().compareTo(d2.getPosition().file()) == 0 && + d1.getPosition().line() == d2.getPosition().line() && + d1.getPosition().column() == d2.getPosition().column()); DeclPartialOrder dpo1 = new DeclPartialOrder(); DeclPartialOrder dpo2 = new DeclPartialOrder(); diff --git a/langtools/src/share/classes/com/sun/tools/apt/comp/Apt.java b/langtools/src/share/classes/com/sun/tools/apt/comp/Apt.java index 35506ac5e02..3ef25ede0a7 100644 --- a/langtools/src/share/classes/com/sun/tools/apt/comp/Apt.java +++ b/langtools/src/share/classes/com/sun/tools/apt/comp/Apt.java @@ -457,8 +457,10 @@ public class Apt extends ListBuffer> { throw new UsageMessageNeededException(); try { - for(AnnotationProcessorFactory apFactory: factoryToAnnotation.keySet()) { - AnnotationProcessor processor = apFactory.getProcessorFor(factoryToAnnotation.get(apFactory), + for(Map.Entry> entry : + factoryToAnnotation.entrySet()) { + AnnotationProcessorFactory apFactory = entry.getKey(); + AnnotationProcessor processor = apFactory.getProcessorFor(entry.getValue(), trivAPE); if (processor != null) processors.add(processor); @@ -496,57 +498,12 @@ public class Apt extends ListBuffer> { * won't match anything. */ Pattern importStringToPattern(String s) { - if (s.equals("*")) { - return allMatches; + if (com.sun.tools.javac.processing.JavacProcessingEnvironment.isValidImportString(s)) { + return com.sun.tools.javac.processing.JavacProcessingEnvironment.validImportStringToPattern(s); } else { - String t = s; - boolean star = false; - - /* - * Validate string from factory is legal. If the string - * has more than one asterisks or the asterisks does not - * appear as the last character (preceded by a period), - * the string is not legal. - */ - - boolean valid = true; - int index = t.indexOf('*'); - if (index != -1) { - // '*' must be last character... - if (index == t.length() -1) { - // ... and preceeding character must be '.' - if ( index-1 >= 0 ) { - valid = t.charAt(index-1) == '.'; - // Strip off ".*$" for identifier checks - t = t.substring(0, t.length()-2); - } - } else - valid = false; - } - - // Verify string is off the form (javaId \.)+ or javaId - if (valid) { - String[] javaIds = t.split("\\.", t.length()+2); - for(String javaId: javaIds) - valid &= isJavaIdentifier(javaId); - } - - if (!valid) { - Bark bark = Bark.instance(context); - bark.aptWarning("MalformedSupportedString", s); - return noMatches; // won't match any valid identifier - } - - String s_prime = s.replaceAll("\\.", "\\\\."); - - if (s_prime.endsWith("*")) { - s_prime = s_prime.substring(0, s_prime.length() - 1) + ".+"; - } - - return Pattern.compile(s_prime); + Bark bark = Bark.instance(context); + bark.aptWarning("MalformedSupportedString", s); + return com.sun.tools.javac.processing.JavacProcessingEnvironment.noMatches; } } - - private static final Pattern allMatches = Pattern.compile(".*"); - private static final Pattern noMatches = Pattern.compile("(\\P{all})+"); } diff --git a/langtools/src/share/classes/com/sun/tools/apt/main/CommandLine.java b/langtools/src/share/classes/com/sun/tools/apt/main/CommandLine.java index 83a5111b78f..67e3b5da639 100644 --- a/langtools/src/share/classes/com/sun/tools/apt/main/CommandLine.java +++ b/langtools/src/share/classes/com/sun/tools/apt/main/CommandLine.java @@ -82,7 +82,7 @@ public class CommandLine { st.commentChar('#'); st.quoteChar('"'); st.quoteChar('\''); - while (st.nextToken() != st.TT_EOF) { + while (st.nextToken() != StreamTokenizer.TT_EOF) { args.append(st.sval); } r.close(); diff --git a/langtools/src/share/classes/com/sun/tools/apt/main/Main.java b/langtools/src/share/classes/com/sun/tools/apt/main/Main.java index d8e9aac768e..f227296a49d 100644 --- a/langtools/src/share/classes/com/sun/tools/apt/main/Main.java +++ b/langtools/src/share/classes/com/sun/tools/apt/main/Main.java @@ -56,6 +56,8 @@ import com.sun.tools.apt.comp.UsageMessageNeededException; import com.sun.tools.apt.util.Bark; import com.sun.mirror.apt.AnnotationProcessorFactory; +import static com.sun.tools.javac.file.Paths.pathToURLs; + /** This class provides a commandline interface to the apt build-time * tool. * @@ -1276,59 +1278,4 @@ public class Main { } } } - - // Borrowed from DocletInvoker - /** - * Utility method for converting a search path string to an array - * of directory and JAR file URLs. - * - * @param path the search path string - * @return the resulting array of directory and JAR file URLs - */ - static URL[] pathToURLs(String path) { - StringTokenizer st = new StringTokenizer(path, File.pathSeparator); - URL[] urls = new URL[st.countTokens()]; - int count = 0; - while (st.hasMoreTokens()) { - URL url = fileToURL(new File(st.nextToken())); - if (url != null) { - urls[count++] = url; - } - } - if (urls.length != count) { - URL[] tmp = new URL[count]; - System.arraycopy(urls, 0, tmp, 0, count); - urls = tmp; - } - return urls; - } - - /** - * Returns the directory or JAR file URL corresponding to the specified - * local file name. - * - * @param file the File object - * @return the resulting directory or JAR file URL, or null if unknown - */ - static URL fileToURL(File file) { - String name; - try { - name = file.getCanonicalPath(); - } catch (IOException e) { - name = file.getAbsolutePath(); - } - name = name.replace(File.separatorChar, '/'); - if (!name.startsWith("/")) { - name = "/" + name; - } - // If the file does not exist, then assume that it's a directory - if (!file.isFile()) { - name = name + "/"; - } - try { - return new URL("file", "", name); - } catch (MalformedURLException e) { - throw new IllegalArgumentException("file"); - } - } } diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java index e1b5ba80918..21f05336e2e 100644 --- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java @@ -270,7 +270,7 @@ class AnnotationProxyMaker { * The toString, hashCode, and equals methods foward to the underlying * type. */ - private static class MirroredTypeExceptionProxy extends ExceptionProxy { + private static final class MirroredTypeExceptionProxy extends ExceptionProxy { private static final long serialVersionUID = 6662035281599933545L; private MirroredTypeException ex; @@ -312,7 +312,7 @@ class AnnotationProxyMaker { * The toString, hashCode, and equals methods foward to the underlying * types. */ - private static class MirroredTypesExceptionProxy extends ExceptionProxy { + private static final class MirroredTypesExceptionProxy extends ExceptionProxy { private static final long serialVersionUID = -6670822532616693951L; private MirroredTypesException ex; diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationImpl.java index e441424073b..6d6a3017aa6 100644 --- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationImpl.java +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationImpl.java @@ -58,7 +58,7 @@ public abstract class DeclarationImpl implements Declaration { protected final AptEnv env; public final Symbol sym; - protected static DeclarationFilter identityFilter = + protected static final DeclarationFilter identityFilter = new DeclarationFilter(); diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java index 2fa704a053c..8b79754983d 100644 --- a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java @@ -71,6 +71,6 @@ public abstract class TypeMirrorImpl implements TypeMirror { * {@inheritDoc} */ public int hashCode() { - return env.jctypes.hashCode(type); + return Types.hashCode(type); } } diff --git a/langtools/src/share/classes/com/sun/tools/classfile/Attribute.java b/langtools/src/share/classes/com/sun/tools/classfile/Attribute.java index 326de77a7c9..997e5ebe1fb 100644 --- a/langtools/src/share/classes/com/sun/tools/classfile/Attribute.java +++ b/langtools/src/share/classes/com/sun/tools/classfile/Attribute.java @@ -64,11 +64,6 @@ public abstract class Attribute { public static final String StackMapTable = "StackMapTable"; public static final String Synthetic = "Synthetic"; - // JSR 277/294 - public static final String Module = "Module"; - public static final String ModuleExportTable = "ModuleExportTable"; - public static final String ModuleMemberTable = "ModuleMemberTable"; - public static class Factory { public Factory() { // defer init of standardAttributeClasses until after options set up @@ -78,10 +73,6 @@ public abstract class Attribute { this.compat = compat; } - public void setJSR277(boolean jsr277) { - this.jsr277 = jsr277; - } - public Attribute createAttribute(ClassReader cr, int name_index, byte[] data) throws IOException { if (standardAttributes == null) @@ -121,12 +112,6 @@ public abstract class Attribute { standardAttributes.put(LocalVariableTable, LocalVariableTable_attribute.class); standardAttributes.put(LocalVariableTypeTable, LocalVariableTypeTable_attribute.class); - if (jsr277) { - standardAttributes.put(Module, Module_attribute.class); - standardAttributes.put(ModuleExportTable, ModuleExportTable_attribute.class); - standardAttributes.put(ModuleMemberTable, ModuleMemberTable_attribute.class); - } - if (!compat) { // old javap does not recognize recent attributes standardAttributes.put(CompilationID, CompilationID_attribute.class); standardAttributes.put(RuntimeInvisibleAnnotations, RuntimeInvisibleAnnotations_attribute.class); @@ -148,7 +133,6 @@ public abstract class Attribute { private Map> standardAttributes; private boolean compat; // don't support recent attrs in compatibility mode - private boolean jsr277; // support new jsr277 attrs } public static Attribute read(ClassReader cr) throws IOException { @@ -201,9 +185,5 @@ public abstract class Attribute { R visitStackMap(StackMap_attribute attr, P p); R visitStackMapTable(StackMapTable_attribute attr, P p); R visitSynthetic(Synthetic_attribute attr, P p); - - R visitModule(Module_attribute attr, P p); - R visitModuleExportTable(ModuleExportTable_attribute attr, P p); - R visitModuleMemberTable(ModuleMemberTable_attribute attr, P p); } } diff --git a/langtools/src/share/classes/com/sun/tools/classfile/ClassWriter.java b/langtools/src/share/classes/com/sun/tools/classfile/ClassWriter.java index 8f8a6edab5e..3f98bd72f0f 100644 --- a/langtools/src/share/classes/com/sun/tools/classfile/ClassWriter.java +++ b/langtools/src/share/classes/com/sun/tools/classfile/ClassWriter.java @@ -449,25 +449,6 @@ public class ClassWriter { out.writeShort(entry.index); } - public Void visitModule(Module_attribute attr, ClassOutputStream out) { - out.writeShort(attr.module_name); - return null; - } - - public Void visitModuleExportTable(ModuleExportTable_attribute attr, ClassOutputStream out) { - out.writeShort(attr.export_type_table.length); - for (int i: attr.export_type_table) - out.writeShort(i); - return null; - } - - public Void visitModuleMemberTable(ModuleMemberTable_attribute attr, ClassOutputStream out) { - out.writeShort(attr.package_member_table.length); - for (int i: attr.package_member_table) - out.writeShort(i); - return null; - } - public Void visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute attr, ClassOutputStream out) { annotationWriter.write(attr.annotations, out); return null; @@ -763,6 +744,7 @@ public class ClassWriter { out.writeByte(p.type_index); break; case CLASS_LITERAL: + case CLASS_LITERAL_GENERIC_OR_ARRAY: out.writeShort(p.offset); break; // method parameter: not specified diff --git a/langtools/src/share/classes/com/sun/tools/classfile/ConstantPool.java b/langtools/src/share/classes/com/sun/tools/classfile/ConstantPool.java index 7ceac568728..a361a457cbb 100644 --- a/langtools/src/share/classes/com/sun/tools/classfile/ConstantPool.java +++ b/langtools/src/share/classes/com/sun/tools/classfile/ConstantPool.java @@ -40,7 +40,7 @@ import java.util.Iterator; */ public class ConstantPool { - public class InvalidIndex extends ConstantPoolException { + public static class InvalidIndex extends ConstantPoolException { private static final long serialVersionUID = -4350294289300939730L; InvalidIndex(int index) { super(index); @@ -53,7 +53,7 @@ public class ConstantPool { } } - public class UnexpectedEntry extends ConstantPoolException { + public static class UnexpectedEntry extends ConstantPoolException { private static final long serialVersionUID = 6986335935377933211L; UnexpectedEntry(int index, int expected_tag, int found_tag) { super(index); @@ -71,7 +71,7 @@ public class ConstantPool { public final int found_tag; } - public class InvalidEntry extends ConstantPoolException { + public static class InvalidEntry extends ConstantPoolException { private static final long serialVersionUID = 1000087545585204447L; InvalidEntry(int index, int tag) { super(index); @@ -87,7 +87,7 @@ public class ConstantPool { public final int tag; } - public class EntryNotFound extends ConstantPoolException { + public static class EntryNotFound extends ConstantPoolException { private static final long serialVersionUID = 2885537606468581850L; EntryNotFound(Object value) { super(-1); @@ -694,7 +694,7 @@ public class ConstantPool { public int byteLength() { class SizeOutputStream extends OutputStream { @Override - public void write(int b) throws IOException { + public void write(int b) { size++; } int size; diff --git a/langtools/src/share/classes/com/sun/tools/classfile/Dependencies.java b/langtools/src/share/classes/com/sun/tools/classfile/Dependencies.java new file mode 100644 index 00000000000..c42ae8ec07e --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/classfile/Dependencies.java @@ -0,0 +1,718 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +package com.sun.tools.classfile; + +import java.util.Deque; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.regex.Pattern; + +import com.sun.tools.classfile.Dependency.Finder; +import com.sun.tools.classfile.Dependency.Filter; +import com.sun.tools.classfile.Dependency.Location; +import com.sun.tools.classfile.Type.ArrayType; +import com.sun.tools.classfile.Type.ClassSigType; +import com.sun.tools.classfile.Type.ClassType; +import com.sun.tools.classfile.Type.MethodType; +import com.sun.tools.classfile.Type.SimpleType; +import com.sun.tools.classfile.Type.TypeParamType; +import com.sun.tools.classfile.Type.WildcardType; + +import static com.sun.tools.classfile.ConstantPool.*; + +/** + * A framework for determining {@link Dependency dependencies} between class files. + * + * A {@link Dependency.Finder finder} is used to identify the dependencies of + * individual classes. Some finders may return subtypes of {@code Dependency} to + * further characterize the type of dependency, such as a dependency on a + * method within a class. + * + * A {@link Dependency.Filter filter} may be used to restrict the set of + * dependencies found by a finder. + * + * Dependencies that are found may be passed to a {@link Dependencies.Recorder + * recorder} so that the dependencies can be stored in a custom data structure. + */ +public class Dependencies { + /** + * Thrown when a class file cannot be found. + */ + public static class ClassFileNotFoundException extends Exception { + private static final long serialVersionUID = 3632265927794475048L; + + public ClassFileNotFoundException(String className) { + super(className); + this.className = className; + } + + public ClassFileNotFoundException(String className, Throwable cause) { + this(className); + initCause(cause); + } + + public final String className; + } + + /** + * Thrown when an exception is found processing a class file. + */ + public static class ClassFileError extends Error { + private static final long serialVersionUID = 4111110813961313203L; + + public ClassFileError(Throwable cause) { + initCause(cause); + } + } + + /** + * Service provider interface to locate and read class files. + */ + public interface ClassFileReader { + /** + * Get the ClassFile object for a specified class. + * @param className the name of the class to be returned. + * @return the ClassFile for the given class + * @throws Dependencies#ClassFileNotFoundException if the classfile cannot be + * found + */ + public ClassFile getClassFile(String className) + throws ClassFileNotFoundException; + } + + /** + * Service provide interface to handle results. + */ + public interface Recorder { + /** + * Record a dependency that has been found. + * @param d + */ + public void addDependency(Dependency d); + } + + /** + * Get the default finder used to locate the dependencies for a class. + * @return the default finder + */ + public static Finder getDefaultFinder() { + return new APIDependencyFinder(AccessFlags.ACC_PRIVATE); + } + + /** + * Get a finder used to locate the API dependencies for a class. + * These include the superclass, superinterfaces, and classes referenced in + * the declarations of fields and methods. The fields and methods that + * are checked can be limited according to a specified access. + * The access parameter must be one of {@link AccessFlags#ACC_PUBLIC ACC_PUBLIC}, + * {@link AccessFlags#ACC_PRIVATE ACC_PRIVATE}, + * {@link AccessFlags#ACC_PROTECTED ACC_PROTECTED}, or 0 for + * package private access. Members with greater than or equal accessibility + * to that specified will be searched for dependencies. + * @param access the access of members to be checked + * @return an API finder + */ + public static Finder getAPIFinder(int access) { + return new APIDependencyFinder(access); + } + + /** + * Get the finder used to locate the dependencies for a class. + * @return the finder + */ + public Finder getFinder() { + if (finder == null) + finder = getDefaultFinder(); + return finder; + } + + /** + * Set the finder used to locate the dependencies for a class. + * @param f the finder + */ + public void setFinder(Finder f) { + f.getClass(); // null check + finder = f; + } + + /** + * Get the default filter used to determine included when searching + * the transitive closure of all the dependencies. + * Unless overridden, the default filter accepts all dependencies. + * @return the default filter. + */ + public static Filter getDefaultFilter() { + return DefaultFilter.instance(); + } + + /** + * Get a filter which uses a regular expression on the target's class name + * to determine if a dependency is of interest. + * @param pattern the pattern used to match the target's class name + * @return a filter for matching the target class name with a regular expression + */ + public static Filter getRegexFilter(Pattern pattern) { + return new TargetRegexFilter(pattern); + } + + /** + * Get a filter which checks the package of a target's class name + * to determine if a dependency is of interest. The filter checks if the + * package of the target's class matches any of a set of given package + * names. The match may optionally match subpackages of the given names as well. + * @param packageNames the package names used to match the target's class name + * @param matchSubpackages whether or not to match subpackages as well + * @return a filter for checking the target package name against a list of package names + */ + public static Filter getPackageFilter(Set packageNames, boolean matchSubpackages) { + return new TargetPackageFilter(packageNames, matchSubpackages); + } + + /** + * Get the filter used to determine the dependencies included when searching + * the transitive closure of all the dependencies. + * Unless overridden, the default filter accepts all dependencies. + * @return the filter + */ + public Filter getFilter() { + if (filter == null) + filter = getDefaultFilter(); + return filter; + } + + /** + * Set the filter used to determine the dependencies included when searching + * the transitive closure of all the dependencies. + * @param f the filter + */ + public void setFilter(Filter f) { + f.getClass(); // null check + filter = f; + } + + /** + * Find the dependencies of a class, using the current + * {@link Dependencies#getFinder finder} and + * {@link Dependencies#getFilter filter}. + * The search may optionally include the transitive closure of all the + * filtered dependencies, by also searching in the classes named in those + * dependencies. + * @param classFinder a finder to locate class files + * @param rootClassNames the names of the root classes from which to begin + * searching + * @param transitiveClosure whether or not to also search those classes + * named in any filtered dependencies that are found. + * @return the set of dependencies that were found + * @throws ClassFileNotFoundException if a required class file cannot be found + * @throws ClassFileError if an error occurs while processing a class file, + * such as an error in the internal class file structure. + */ + public Set findAllDependencies( + ClassFileReader classFinder, Set rootClassNames, + boolean transitiveClosure) + throws ClassFileNotFoundException { + final Set results = new HashSet(); + Recorder r = new Recorder() { + public void addDependency(Dependency d) { + results.add(d); + } + }; + findAllDependencies(classFinder, rootClassNames, transitiveClosure, r); + return results; + } + + + + /** + * Find the dependencies of a class, using the current + * {@link Dependencies#getFinder finder} and + * {@link Dependencies#getFilter filter}. + * The search may optionally include the transitive closure of all the + * filtered dependencies, by also searching in the classes named in those + * dependencies. + * @param classFinder a finder to locate class files + * @param rootClassNames the names of the root classes from which to begin + * searching + * @param transitiveClosure whether or not to also search those classes + * named in any filtered dependencies that are found. + * @param recorder a recorder for handling the results + * @throws ClassFileNotFoundException if a required class file cannot be found + * @throws ClassFileError if an error occurs while processing a class file, + * such as an error in the internal class file structure. + */ + public void findAllDependencies( + ClassFileReader classFinder, Set rootClassNames, + boolean transitiveClosure, Recorder recorder) + throws ClassFileNotFoundException { + Set doneClasses = new HashSet(); + + getFinder(); // ensure initialized + getFilter(); // ensure initialized + + // Work queue of names of classfiles to be searched. + // Entries will be unique, and for classes that do not yet have + // dependencies in the results map. + Deque deque = new LinkedList(rootClassNames); + + String className; + while ((className = deque.poll()) != null) { + assert (!doneClasses.contains(className)); + doneClasses.add(className); + + ClassFile cf = classFinder.getClassFile(className); + + // The following code just applies the filter to the dependencies + // followed for the transitive closure. + for (Dependency d: finder.findDependencies(cf)) { + recorder.addDependency(d); + if (transitiveClosure && filter.accepts(d)) { + String cn = d.getTarget().getClassName(); + if (!doneClasses.contains(cn)) + deque.add(cn); + } + } + } + } + + private Filter filter; + private Finder finder; + + /** + * A location identifying a class. + */ + static class SimpleLocation implements Location { + public SimpleLocation(String className) { + this.className = className; + } + + /** + * Get the name of the class being depended on. This name will be used to + * locate the class file for transitive dependency analysis. + * @return the name of the class being depended on + */ + public String getClassName() { + return className; + } + + @Override + public boolean equals(Object other) { + if (this == other) + return true; + if (!(other instanceof SimpleLocation)) + return false; + return (className.equals(((SimpleLocation) other).className)); + } + + @Override + public int hashCode() { + return className.hashCode(); + } + + @Override + public String toString() { + return className; + } + + private String className; + } + + /** + * A dependency of one class on another. + */ + static class SimpleDependency implements Dependency { + public SimpleDependency(Location origin, Location target) { + this.origin = origin; + this.target = target; + } + + public Location getOrigin() { + return origin; + } + + public Location getTarget() { + return target; + } + + @Override + public boolean equals(Object other) { + if (this == other) + return true; + if (!(other instanceof SimpleDependency)) + return false; + SimpleDependency o = (SimpleDependency) other; + return (origin.equals(o.origin) && target.equals(o.target)); + } + + @Override + public int hashCode() { + return origin.hashCode() * 31 + target.hashCode(); + } + + @Override + public String toString() { + return origin + ":" + target; + } + + private Location origin; + private Location target; + } + + + /** + * This class accepts all dependencies. + */ + static class DefaultFilter implements Filter { + private static DefaultFilter instance; + + static DefaultFilter instance() { + if (instance == null) + instance = new DefaultFilter(); + return instance; + } + + public boolean accepts(Dependency dependency) { + return true; + } + } + + /** + * This class accepts those dependencies whose target's class name matches a + * regular expression. + */ + static class TargetRegexFilter implements Filter { + TargetRegexFilter(Pattern pattern) { + this.pattern = pattern; + } + + public boolean accepts(Dependency dependency) { + return pattern.matcher(dependency.getTarget().getClassName()).matches(); + } + + private final Pattern pattern; + } + + /** + * This class accepts those dependencies whose class name is in a given + * package. + */ + static class TargetPackageFilter implements Filter { + TargetPackageFilter(Set packageNames, boolean matchSubpackages) { + for (String pn: packageNames) { + if (pn.length() == 0) // implies null check as well + throw new IllegalArgumentException(); + } + this.packageNames = packageNames; + this.matchSubpackages = matchSubpackages; + } + + public boolean accepts(Dependency dependency) { + String cn = dependency.getTarget().getClassName(); + int lastSep = cn.lastIndexOf("/"); + String pn = (lastSep == -1 ? "" : cn.substring(0, lastSep)); + if (packageNames.contains(pn)) + return true; + + if (matchSubpackages) { + for (String n: packageNames) { + if (pn.startsWith(n + ".")) + return true; + } + } + + return false; + } + + private final Set packageNames; + private final boolean matchSubpackages; + } + + + + /** + * This class identifies class names directly or indirectly in the constant pool. + */ + static class ClassDependencyFinder extends BasicDependencyFinder { + public Iterable findDependencies(ClassFile classfile) { + Visitor v = new Visitor(classfile); + for (CPInfo cpInfo: classfile.constant_pool.entries()) { + v.scan(cpInfo); + } + return v.deps; + } + } + + /** + * This class identifies class names in the signatures of classes, fields, + * and methods in a class. + */ + static class APIDependencyFinder extends BasicDependencyFinder { + APIDependencyFinder(int access) { + switch (access) { + case AccessFlags.ACC_PUBLIC: + case AccessFlags.ACC_PROTECTED: + case AccessFlags.ACC_PRIVATE: + case 0: + showAccess = access; + break; + default: + throw new IllegalArgumentException("invalid access 0x" + + Integer.toHexString(access)); + } + } + + public Iterable findDependencies(ClassFile classfile) { + try { + Visitor v = new Visitor(classfile); + v.addClass(classfile.super_class); + v.addClasses(classfile.interfaces); + // inner classes? + for (Field f : classfile.fields) { + if (checkAccess(f.access_flags)) + v.scan(f.descriptor, f.attributes); + } + for (Method m : classfile.methods) { + if (checkAccess(m.access_flags)) { + v.scan(m.descriptor, m.attributes); + Exceptions_attribute e = + (Exceptions_attribute) m.attributes.get(Attribute.Exceptions); + if (e != null) + v.addClasses(e.exception_index_table); + } + } + return v.deps; + } catch (ConstantPoolException e) { + throw new ClassFileError(e); + } + } + + boolean checkAccess(AccessFlags flags) { + // code copied from javap.Options.checkAccess + boolean isPublic = flags.is(AccessFlags.ACC_PUBLIC); + boolean isProtected = flags.is(AccessFlags.ACC_PROTECTED); + boolean isPrivate = flags.is(AccessFlags.ACC_PRIVATE); + boolean isPackage = !(isPublic || isProtected || isPrivate); + + if ((showAccess == AccessFlags.ACC_PUBLIC) && (isProtected || isPrivate || isPackage)) + return false; + else if ((showAccess == AccessFlags.ACC_PROTECTED) && (isPrivate || isPackage)) + return false; + else if ((showAccess == 0) && (isPrivate)) + return false; + else + return true; + } + + private int showAccess; + } + + static abstract class BasicDependencyFinder implements Finder { + private Map locations = new HashMap(); + + Location getLocation(String className) { + Location l = locations.get(className); + if (l == null) + locations.put(className, l = new SimpleLocation(className)); + return l; + } + + class Visitor implements ConstantPool.Visitor, Type.Visitor { + private ConstantPool constant_pool; + private Location origin; + Set deps; + + Visitor(ClassFile classFile) { + try { + constant_pool = classFile.constant_pool; + origin = getLocation(classFile.getName()); + deps = new HashSet(); + } catch (ConstantPoolException e) { + throw new ClassFileError(e); + } + } + + void scan(Descriptor d, Attributes attrs) { + try { + scan(new Signature(d.index).getType(constant_pool)); + Signature_attribute sa = (Signature_attribute) attrs.get(Attribute.Signature); + if (sa != null) + scan(new Signature(sa.signature_index).getType(constant_pool)); + } catch (ConstantPoolException e) { + throw new ClassFileError(e); + } + } + + void scan(CPInfo cpInfo) { + cpInfo.accept(this, null); + } + + void scan(Type t) { + t.accept(this, null); + } + + void addClass(int index) throws ConstantPoolException { + if (index != 0) { + String name = constant_pool.getClassInfo(index).getBaseName(); + if (name != null) + addDependency(name); + } + } + + void addClasses(int[] indices) throws ConstantPoolException { + for (int i: indices) + addClass(i); + } + + private void addDependency(String name) { + deps.add(new SimpleDependency(origin, getLocation(name))); + } + + // ConstantPool.Visitor methods + + public Void visitClass(CONSTANT_Class_info info, Void p) { + try { + if (info.getName().startsWith("[")) + new Signature(info.name_index).getType(constant_pool).accept(this, null); + else + addDependency(info.getBaseName()); + return null; + } catch (ConstantPoolException e) { + throw new ClassFileError(e); + } + } + + public Void visitDouble(CONSTANT_Double_info info, Void p) { + return null; + } + + public Void visitFieldref(CONSTANT_Fieldref_info info, Void p) { + return visitRef(info, p); + } + + public Void visitFloat(CONSTANT_Float_info info, Void p) { + return null; + } + + public Void visitInteger(CONSTANT_Integer_info info, Void p) { + return null; + } + + public Void visitInterfaceMethodref(CONSTANT_InterfaceMethodref_info info, Void p) { + return visitRef(info, p); + } + + public Void visitLong(CONSTANT_Long_info info, Void p) { + return null; + } + + public Void visitNameAndType(CONSTANT_NameAndType_info info, Void p) { + try { + new Signature(info.type_index).getType(constant_pool).accept(this, null); + return null; + } catch (ConstantPoolException e) { + throw new ClassFileError(e); + } + } + + public Void visitMethodref(CONSTANT_Methodref_info info, Void p) { + return visitRef(info, p); + } + + public Void visitString(CONSTANT_String_info info, Void p) { + return null; + } + + public Void visitUtf8(CONSTANT_Utf8_info info, Void p) { + return null; + } + + private Void visitRef(CPRefInfo info, Void p) { + try { + visitClass(info.getClassInfo(), p); + return null; + } catch (ConstantPoolException e) { + throw new ClassFileError(e); + } + } + + // Type.Visitor methods + + private void findDependencies(Type t) { + if (t != null) + t.accept(this, null); + } + + private void findDependencies(List ts) { + if (ts != null) { + for (Type t: ts) + t.accept(this, null); + } + } + + public Void visitSimpleType(SimpleType type, Void p) { + return null; + } + + public Void visitArrayType(ArrayType type, Void p) { + findDependencies(type.elemType); + return null; + } + + public Void visitMethodType(MethodType type, Void p) { + findDependencies(type.paramTypes); + findDependencies(type.returnType); + findDependencies(type.throwsTypes); + return null; + } + + public Void visitClassSigType(ClassSigType type, Void p) { + findDependencies(type.superclassType); + findDependencies(type.superinterfaceTypes); + return null; + } + + public Void visitClassType(ClassType type, Void p) { + findDependencies(type.outerType); + addDependency(type.name); + findDependencies(type.typeArgs); + return null; + } + + public Void visitTypeParamType(TypeParamType type, Void p) { + findDependencies(type.classBound); + findDependencies(type.interfaceBounds); + return null; + } + + public Void visitWildcardType(WildcardType type, Void p) { + findDependencies(type.boundType); + return null; + } + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/classfile/Dependency.java b/langtools/src/share/classes/com/sun/tools/classfile/Dependency.java new file mode 100644 index 00000000000..bf09a7ca247 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/classfile/Dependency.java @@ -0,0 +1,90 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.classfile; + + +/** + * A directed relationship between two {@link Dependency.Location Location}s. + * Subtypes of {@code Dependency} may provide additional detail about the dependency. + * + * @see Dependency.Finder + * @see Dependency.Filter + * @see Dependencies + */ +public interface Dependency { + /** + * A filter used to select dependencies of interest, and to discard others. + */ + public interface Filter { + /** + * Return true if the dependency is of interest. + * @param dependency the dependency to be considered + * @return true if and only if the dependency is of interest. + */ + boolean accepts(Dependency dependency); + } + + /** + * An interface for finding the immediate dependencies of a given class file. + */ + public interface Finder { + /** + * Find the immediate dependencies of a given class file. + * @param classfile the class file to be examined + * @return the dependencies located in the given class file. + */ + public Iterable findDependencies(ClassFile classfile); + } + + + /** + * A location somewhere within a class. Subtypes of {@code Location} + * may be used to provide additional detail about the location. + */ + public interface Location { + /** + * Get the name of the class containing the location. + * This name will be used to locate the class file for transitive + * dependency analysis. + * @return the name of the class containing the location. + */ + String getClassName(); + } + + + /** + * Get the location that has the dependency. + * @return the location that has the dependency. + */ + Location getOrigin(); + + /** + * Get the location that is being depended upon. + * @return the location that is being depended upon. + */ + Location getTarget(); +} + diff --git a/langtools/src/share/classes/com/sun/tools/classfile/ExtendedAnnotation.java b/langtools/src/share/classes/com/sun/tools/classfile/ExtendedAnnotation.java index bb7b017dfc2..2072ae648b0 100644 --- a/langtools/src/share/classes/com/sun/tools/classfile/ExtendedAnnotation.java +++ b/langtools/src/share/classes/com/sun/tools/classfile/ExtendedAnnotation.java @@ -123,11 +123,14 @@ public class ExtendedAnnotation { // Class extends and implements clauses case CLASS_EXTENDS: case CLASS_EXTENDS_GENERIC_OR_ARRAY: - position.type_index = cr.readUnsignedByte(); + int in = cr.readUnsignedShort(); + if (in == 0xFFFF) + in = -1; + position.type_index = in; break; // throws case THROWS: - position.type_index = cr.readUnsignedByte(); + position.type_index = cr.readUnsignedShort(); break; case CLASS_LITERAL: case CLASS_LITERAL_GENERIC_OR_ARRAY: @@ -213,11 +216,11 @@ public class ExtendedAnnotation { // Class extends and implements clauses case CLASS_EXTENDS: case CLASS_EXTENDS_GENERIC_OR_ARRAY: - n += 1; // type_index + n += 2; // type_index break; // throws case THROWS: - n += 1; // type_index + n += 2; // type_index break; case CLASS_LITERAL: case CLASS_LITERAL_GENERIC_OR_ARRAY: @@ -264,18 +267,18 @@ public class ExtendedAnnotation { public int offset = -1; // For locals. - public int[] lvarOffset = new int[] { -1 }; - public int[] lvarLength = new int[] { -1 }; - public int[] lvarIndex = new int[] { -1 }; + public int[] lvarOffset = null; + public int[] lvarLength = null; + public int[] lvarIndex = null; // For type parameter bound - public int bound_index = -1; + public int bound_index = Integer.MIN_VALUE; // For type parameter and method parameter - public int parameter_index = -1; + public int parameter_index = Integer.MIN_VALUE; // For class extends, implements, and throws classes - public int type_index = -2; + public int type_index = Integer.MIN_VALUE; // For wildcards public Position wildcard_position = null; diff --git a/langtools/src/share/classes/com/sun/tools/classfile/Instruction.java b/langtools/src/share/classes/com/sun/tools/classfile/Instruction.java index c0a30ba2755..6f0ab4c155a 100644 --- a/langtools/src/share/classes/com/sun/tools/classfile/Instruction.java +++ b/langtools/src/share/classes/com/sun/tools/classfile/Instruction.java @@ -106,9 +106,9 @@ public class Instruction { /** See {@link Kind#LOCAL_UBYTE}. */ R visitLocalAndValue(Instruction instr, int index, int value, P p); /** See {@link Kind#DYNAMIC}. */ - R visitLookupSwitch(Instruction instr, int default_, int npairs, int[] matches, int[] offsets); + R visitLookupSwitch(Instruction instr, int default_, int npairs, int[] matches, int[] offsets, P p); /** See {@link Kind#DYNAMIC}. */ - R visitTableSwitch(Instruction instr, int default_, int low, int high, int[] offsets); + R visitTableSwitch(Instruction instr, int default_, int low, int high, int[] offsets, P p); /** See {@link Kind#BYTE}, {@link Kind#SHORT}. */ R visitValue(Instruction instr, int value, P p); /** Instruction is unrecognized. */ @@ -282,7 +282,7 @@ public class Instruction { for (int i = 0; i < values.length; i++) values[i] = getInt(pad + 12 + 4 * i); return visitor.visitTableSwitch( - this, default_, low, high, values); + this, default_, low, high, values, p); } case LOOKUPSWITCH: { int pad = align(pc + 1) - pc; @@ -295,7 +295,7 @@ public class Instruction { offsets[i] = getInt(pad + 12 + i * 8); } return visitor.visitLookupSwitch( - this, default_, npairs, matches, offsets); + this, default_, npairs, matches, offsets, p); } default: throw new IllegalStateException(); diff --git a/langtools/src/share/classes/com/sun/tools/classfile/ModuleExportTable_attribute.java b/langtools/src/share/classes/com/sun/tools/classfile/ModuleExportTable_attribute.java deleted file mode 100644 index 74cc3b395c6..00000000000 --- a/langtools/src/share/classes/com/sun/tools/classfile/ModuleExportTable_attribute.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - */ - -package com.sun.tools.classfile; - -import java.io.IOException; - -/** - * See JSR 277. - * - *

      This is NOT part of any API supported by Sun Microsystems. If - * you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - */ -public class ModuleExportTable_attribute extends Attribute { - ModuleExportTable_attribute(ClassReader cr, int name_index, int length) throws IOException { - super(name_index, length); - int export_type_length = cr.readUnsignedShort(); - export_type_table = new int[export_type_length]; - for (int i = 0; i < export_type_table.length; i++) - export_type_table[i] = cr.readUnsignedShort(); - } - - public ModuleExportTable_attribute(ConstantPool cp, int[] export_type_table) - throws ConstantPoolException { - this(cp.getUTF8Index(Attribute.ModuleExportTable), export_type_table); - } - - public ModuleExportTable_attribute(int name_index, int[] export_type_table) { - super(name_index, 2 + 2 * export_type_table.length); - this.export_type_table = export_type_table; - } - - public int getExportTypeCount() { - return export_type_table.length; - } - - public String getExportTypeName(int index, ConstantPool constant_pool) throws ConstantPoolException { - return constant_pool.getUTF8Value(export_type_table[index]); - } - - public R accept(Visitor visitor, P p) { - return visitor.visitModuleExportTable(this, p); - } - - public final int[] export_type_table; -} diff --git a/langtools/src/share/classes/com/sun/tools/classfile/ModuleMemberTable_attribute.java b/langtools/src/share/classes/com/sun/tools/classfile/ModuleMemberTable_attribute.java deleted file mode 100644 index c5eaf78eff5..00000000000 --- a/langtools/src/share/classes/com/sun/tools/classfile/ModuleMemberTable_attribute.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - */ -package com.sun.tools.classfile; - -import java.io.IOException; - -/** - * See JSR 277. - * - *

      This is NOT part of any API supported by Sun Microsystems. If - * you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - */ -public class ModuleMemberTable_attribute extends Attribute { - ModuleMemberTable_attribute(ClassReader cr, int name_index, int length) throws IOException { - super(name_index, length); - int package_member_length = cr.readUnsignedShort(); - package_member_table = new int[package_member_length]; - for (int i = 0; i < package_member_table.length; i++) - package_member_table[i] = cr.readUnsignedShort(); - } - - public ModuleMemberTable_attribute(ConstantPool cp, int[] package_member_table) - throws ConstantPoolException { - this(cp.getUTF8Index(Attribute.ModuleMemberTable), package_member_table); - } - - public ModuleMemberTable_attribute(int name_index, int[] package_member_table) { - super(name_index, 2 + 2 * package_member_table.length); - this.package_member_table = package_member_table; - } - - public int getPackageMemberCount() { - return package_member_table.length; - } - - public String getPackageMemberName(int index, ConstantPool constant_pool) throws ConstantPoolException { - return constant_pool.getUTF8Value(package_member_table[index]); - } - - public R accept(Visitor visitor, P p) { - return visitor.visitModuleMemberTable(this, p); - } - - public final int[] package_member_table; -} diff --git a/langtools/src/share/classes/com/sun/tools/classfile/Module_attribute.java b/langtools/src/share/classes/com/sun/tools/classfile/Module_attribute.java deleted file mode 100644 index 8a1ba1fef87..00000000000 --- a/langtools/src/share/classes/com/sun/tools/classfile/Module_attribute.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - */ - -package com.sun.tools.classfile; - -import java.io.IOException; - -/** - * See JSR 277. - * - *

      This is NOT part of any API supported by Sun Microsystems. If - * you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - */ -public class Module_attribute extends Attribute { - Module_attribute(ClassReader cr, int name_index, int length) throws IOException { - super(name_index, length); - module_name = cr.readUnsignedShort(); - } - - public Module_attribute(ConstantPool constant_pool, int module_name) - throws ConstantPoolException { - this(constant_pool.getUTF8Index(Attribute.Module), module_name); - } - - public Module_attribute(int name_index, int module_name) { - super(name_index, 2); - this.module_name = module_name; - } - - public String getModuleName(ConstantPool constant_pool) throws ConstantPoolException { - return constant_pool.getUTF8Value(module_name); - } - - public R accept(Visitor visitor, D data) { - return visitor.visitModule(this, data); - } - - public final int module_name; - -} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/standard/Standard.java b/langtools/src/share/classes/com/sun/tools/doclets/standard/Standard.java index b0e7300ceeb..208a0dc9740 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/standard/Standard.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/standard/Standard.java @@ -31,23 +31,21 @@ import com.sun.tools.doclets.formats.html.*; public class Standard { - public static final HtmlDoclet htmlDoclet = new HtmlDoclet(); - public static int optionLength(String option) { - return htmlDoclet.optionLength(option); + return HtmlDoclet.optionLength(option); } public static boolean start(RootDoc root) { - return htmlDoclet.start(root); + return HtmlDoclet.start(root); } public static boolean validOptions(String[][] options, DocErrorReporter reporter) { - return htmlDoclet.validOptions(options, reporter); + return HtmlDoclet.validOptions(options, reporter); } public static LanguageVersion languageVersion() { - return htmlDoclet.languageVersion(); + return HtmlDoclet.languageVersion(); } } diff --git a/langtools/src/share/classes/com/sun/tools/javac/Launcher.java b/langtools/src/share/classes/com/sun/tools/javac/Launcher.java index 72bac0fbd64..4aa10fe2b83 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/Launcher.java +++ b/langtools/src/share/classes/com/sun/tools/javac/Launcher.java @@ -64,7 +64,7 @@ class Launcher { fileChooser.setSelectedFile(new File(fileName)); } } - if (fileChooser.showOpenDialog(null) == fileChooser.APPROVE_OPTION) { + if (fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) { String fileName = fileChooser.getSelectedFile().getPath(); prefs.put("recent.file", fileName); javac.run(System.in, null, null, "-d", "/tmp", fileName); diff --git a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTool.java b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTool.java index e8134d2ef94..e467c1cd8e8 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTool.java +++ b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTool.java @@ -137,7 +137,7 @@ public final class JavacTool implements JavaCompiler { } private static boolean match(OptionKind clientKind, OptionKind optionKind) { - return (clientKind == (optionKind == OptionKind.HIDDEN ? optionKind.EXTENDED : optionKind)); + return (clientKind == (optionKind == OptionKind.HIDDEN ? OptionKind.EXTENDED : optionKind)); } public JavacFileManager getStandardFileManager( diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java b/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java index 40165699212..88f0bde43da 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java +++ b/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java @@ -113,6 +113,7 @@ public class Flags { public static final int ENUM = 1<<14; public static final int StandardFlags = 0x0fff; + public static final int ModifierFlags = StandardFlags & ~INTERFACE; // Because the following access flags are overloaded with other // bit positions, we translate them when reading and writing class diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Lint.java b/langtools/src/share/classes/com/sun/tools/javac/code/Lint.java index cec6e70a99d..ffada5841a2 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/code/Lint.java +++ b/langtools/src/share/classes/com/sun/tools/javac/code/Lint.java @@ -198,7 +198,12 @@ public class Lint /** * Warn about Sun proprietary API that may be removed in a future release. */ - SUNAPI("sunapi", true); + SUNAPI("sunapi", true), + + /** + * Warn about issues relating to use of statics + */ + STATIC("static"); LintCategory(String option) { this(option, false); diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Source.java b/langtools/src/share/classes/com/sun/tools/javac/code/Source.java index 6af5c889392..4809565d855 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/code/Source.java +++ b/langtools/src/share/classes/com/sun/tools/javac/code/Source.java @@ -110,9 +110,6 @@ public enum Source { } /** Allow encoding errors, giving only warnings. */ - public boolean allowStringsInSwitch() { - return compareTo(JDK1_7) >= 0; - } public boolean allowEncodingErrors() { return compareTo(JDK1_6) < 0; } @@ -168,6 +165,9 @@ public enum Source { public boolean allowUnderscoresInLiterals() { return compareTo(JDK1_7) >= 0; } + public boolean allowStringsInSwitch() { + return compareTo(JDK1_7) >= 0; + } public static SourceVersion toSourceVersion(Source source) { switch(source) { case JDK1_2: diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java b/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java index 6f30c6052d4..85f7b7d420e 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java +++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java @@ -162,7 +162,7 @@ public abstract class Symbol implements Element { * the default package; otherwise, the owner symbol is returned */ public Symbol location() { - if (owner.name == null || (owner.name.isEmpty() && owner.kind != PCK)) { + if (owner.name == null || (owner.name.isEmpty() && owner.kind != PCK && owner.kind != TYP)) { return null; } return owner; @@ -657,6 +657,11 @@ public abstract class Symbol implements Element { public List getAnnotationMirrors() { if (completer != null) complete(); + if (package_info != null && package_info.completer != null) { + package_info.complete(); + if (attributes_field.isEmpty()) + attributes_field = package_info.attributes_field; + } assert attributes_field != null; return attributes_field; } diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java index 988f6e028ad..0dceb90cba3 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java +++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java @@ -49,18 +49,18 @@ public class TypeAnnotationPosition { public int offset = -1; // For locals. arrays same length - public int[] lvarOffset = new int[] { -1 }; - public int[] lvarLength = new int[] { -1 }; - public int[] lvarIndex = new int[] { -1 }; + public int[] lvarOffset = null; + public int[] lvarLength = null; + public int[] lvarIndex = null; // For type parameter bound - public int bound_index = -1; + public int bound_index = Integer.MIN_VALUE; // For type parameter and method parameter - public int parameter_index = -1; + public int parameter_index = Integer.MIN_VALUE; // For class extends, implements, and throws classes - public int type_index = -2; + public int type_index = Integer.MIN_VALUE; // For wildcards public TypeAnnotationPosition wildcard_position = null; @@ -139,6 +139,7 @@ public class TypeAnnotationPosition { sb.append(type_index); break; case CLASS_LITERAL: + case CLASS_LITERAL_GENERIC_OR_ARRAY: sb.append(", offset = "); sb.append(offset); break; diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java new file mode 100644 index 00000000000..6dcc1bb5bfe --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java @@ -0,0 +1,400 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.javac.code; + +import javax.lang.model.element.ElementKind; + +import com.sun.tools.javac.code.Symbol.VarSymbol; +import com.sun.tools.javac.tree.JCTree; +import com.sun.tools.javac.tree.TreeInfo; +import com.sun.tools.javac.tree.TreeScanner; +import com.sun.tools.javac.tree.JCTree.*; +import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.util.List; +import com.sun.tools.javac.util.ListBuffer; + +/** + * Contains operations specific to processing type annotations + */ +public class TypeAnnotations { + private static final Context.Key key + = new Context.Key(); + + public static TypeAnnotations instance(Context context) { + TypeAnnotations instance = context.get(key); + if (instance == null) + instance = new TypeAnnotations(context); + return instance; + } + + protected TypeAnnotations(Context context) { + context.put(key, this); + } + + public void taFillAndLift(JCClassDecl tree, boolean visitBodies) { + new TypeAnnotationPositions().scan(tree); + new TypeAnnotationLift().scan(tree); + } + + private static class TypeAnnotationPositions extends TreeScanner { + + private ListBuffer frames = ListBuffer.lb(); + private void push(JCTree t) { frames = frames.prepend(t); } + private JCTree pop() { return frames.next(); } + private JCTree peek2() { return frames.toList().tail.head; } + + @Override + public void scan(JCTree tree) { + push(tree); + super.scan(tree); + pop(); + } + + private boolean inClass = false; + + @Override + public void visitClassDef(JCClassDecl tree) { + if (!inClass) { + // Do not recurse into nested and inner classes since + // TransTypes.visitClassDef makes an invocation for each class + // separately. + inClass = true; + try { + super.visitClassDef(tree); + } finally { + inClass = false; + } + } + } + + private TypeAnnotationPosition resolveFrame(JCTree tree, JCTree frame, + List path, TypeAnnotationPosition p) { + switch (frame.getKind()) { + case TYPE_CAST: + p.type = TargetType.TYPECAST; + p.pos = frame.pos; + return p; + + case INSTANCE_OF: + p.type = TargetType.INSTANCEOF; + p.pos = frame.pos; + return p; + + case NEW_CLASS: + p.type = TargetType.NEW; + p.pos = frame.pos; + return p; + + case NEW_ARRAY: + p.type = TargetType.NEW; + p.pos = frame.pos; + return p; + + case CLASS: + p.pos = frame.pos; + if (((JCClassDecl)frame).extending == tree) { + p.type = TargetType.CLASS_EXTENDS; + p.type_index = -1; + } else if (((JCClassDecl)frame).implementing.contains(tree)) { + p.type = TargetType.CLASS_EXTENDS; + p.type_index = ((JCClassDecl)frame).implementing.indexOf(tree); + } else if (((JCClassDecl)frame).typarams.contains(tree)) { + p.type = TargetType.CLASS_TYPE_PARAMETER; + p.parameter_index = ((JCClassDecl)frame).typarams.indexOf(tree); + } else + throw new AssertionError(); + return p; + + case METHOD: { + JCMethodDecl frameMethod = (JCMethodDecl)frame; + p.pos = frame.pos; + if (frameMethod.receiverAnnotations.contains(tree)) + p.type = TargetType.METHOD_RECEIVER; + else if (frameMethod.thrown.contains(tree)) { + p.type = TargetType.THROWS; + p.type_index = frameMethod.thrown.indexOf(tree); + } else if (((JCMethodDecl)frame).restype == tree) { + p.type = TargetType.METHOD_RETURN_GENERIC_OR_ARRAY; + } else if (frameMethod.typarams.contains(tree)) { + p.type = TargetType.METHOD_TYPE_PARAMETER; + p.parameter_index = frameMethod.typarams.indexOf(tree); + } else + throw new AssertionError(); + return p; + } + case MEMBER_SELECT: { + JCFieldAccess fieldFrame = (JCFieldAccess)frame; + if ("class".contentEquals(fieldFrame.name)) { + p.type = TargetType.CLASS_LITERAL; + p.pos = TreeInfo.innermostType(fieldFrame.selected).pos; + } else + throw new AssertionError(); + return p; + } + case PARAMETERIZED_TYPE: { + TypeAnnotationPosition nextP; + if (((JCTypeApply)frame).clazz == tree) + nextP = p; // generic: RAW; noop + else if (((JCTypeApply)frame).arguments.contains(tree)) + p.location = p.location.prepend( + ((JCTypeApply)frame).arguments.indexOf(tree)); + else + throw new AssertionError(); + + List newPath = path.tail; + return resolveFrame(newPath.head, newPath.tail.head, newPath, p); + } + + case ARRAY_TYPE: { + p.location = p.location.prepend(0); + List newPath = path.tail; + return resolveFrame(newPath.head, newPath.tail.head, newPath, p); + } + + case TYPE_PARAMETER: + if (path.tail.tail.head.getTag() == JCTree.CLASSDEF) { + JCClassDecl clazz = (JCClassDecl)path.tail.tail.head; + p.type = TargetType.CLASS_TYPE_PARAMETER_BOUND; + p.parameter_index = clazz.typarams.indexOf(path.tail.head); + p.bound_index = ((JCTypeParameter)frame).bounds.indexOf(tree); + } else if (path.tail.tail.head.getTag() == JCTree.METHODDEF) { + JCMethodDecl method = (JCMethodDecl)path.tail.tail.head; + p.type = TargetType.METHOD_TYPE_PARAMETER_BOUND; + p.parameter_index = method.typarams.indexOf(path.tail.head); + p.bound_index = ((JCTypeParameter)frame).bounds.indexOf(tree); + } else + throw new AssertionError(); + p.pos = frame.pos; + return p; + + case VARIABLE: + VarSymbol v = ((JCVariableDecl)frame).sym; + p.pos = frame.pos; + switch (v.getKind()) { + case LOCAL_VARIABLE: + p.type = TargetType.LOCAL_VARIABLE; break; + case FIELD: + p.type = TargetType.FIELD_GENERIC_OR_ARRAY; break; + case PARAMETER: + p.type = TargetType.METHOD_PARAMETER_GENERIC_OR_ARRAY; + p.parameter_index = methodParamIndex(path, frame); + break; + default: throw new AssertionError(); + } + return p; + + case ANNOTATED_TYPE: { + List newPath = path.tail; + return resolveFrame(newPath.head, newPath.tail.head, + newPath, p); + } + + case METHOD_INVOCATION: { + JCMethodInvocation invocation = (JCMethodInvocation)frame; + if (!invocation.typeargs.contains(tree)) + throw new AssertionError("{" + tree + "} is not an argument in the invocation: " + invocation); + p.type = TargetType.METHOD_TYPE_ARGUMENT; + p.pos = invocation.pos; + p.type_index = invocation.typeargs.indexOf(tree); + return p; + } + + case EXTENDS_WILDCARD: + case SUPER_WILDCARD: { + p.type = TargetType.WILDCARD_BOUND; + List newPath = path.tail; + + TypeAnnotationPosition wildcard = + resolveFrame(newPath.head, newPath.tail.head, newPath, + new TypeAnnotationPosition()); + if (!wildcard.location.isEmpty()) + wildcard.type = wildcard.type.getGenericComplement(); + p.wildcard_position = wildcard; + p.pos = frame.pos; + return p; + } + } + return p; + } + + private void setTypeAnnotationPos(List annotations, TypeAnnotationPosition position) { + for (JCTypeAnnotation anno : annotations) { + anno.annotation_position = position; + anno.attribute_field.position = position; + } + } + + @Override + public void visitNewArray(JCNewArray tree) { + findPosition(tree, tree, tree.annotations); + int dimAnnosCount = tree.dimAnnotations.size(); + + // handle annotations associated with dimentions + for (int i = 0; i < dimAnnosCount; ++i) { + TypeAnnotationPosition p = new TypeAnnotationPosition(); + p.type = TargetType.NEW_GENERIC_OR_ARRAY; + p.pos = tree.pos; + p.location = p.location.append(i); + setTypeAnnotationPos(tree.dimAnnotations.get(i), p); + } + + // handle "free" annotations + int i = dimAnnosCount == 0 ? 0 : dimAnnosCount - 1; + JCExpression elemType = tree.elemtype; + while (elemType != null) { + if (elemType.getTag() == JCTree.ANNOTATED_TYPE) { + JCAnnotatedType at = (JCAnnotatedType)elemType; + TypeAnnotationPosition p = new TypeAnnotationPosition(); + p.type = TargetType.NEW_GENERIC_OR_ARRAY; + p.pos = tree.pos; + p.location = p.location.append(i); + setTypeAnnotationPos(at.annotations, p); + elemType = at.underlyingType; + } else if (elemType.getTag() == JCTree.TYPEARRAY) { + ++i; + elemType = ((JCArrayTypeTree)elemType).elemtype; + } else + break; + } + + // find annotations locations of initializer elements + scan(tree.elems); + } + + @Override + public void visitAnnotatedType(JCAnnotatedType tree) { + findPosition(tree, peek2(), tree.annotations); + super.visitAnnotatedType(tree); + } + + @Override + public void visitMethodDef(JCMethodDecl tree) { + TypeAnnotationPosition p = new TypeAnnotationPosition(); + p.type = TargetType.METHOD_RECEIVER; + setTypeAnnotationPos(tree.receiverAnnotations, p); + super.visitMethodDef(tree); + } + @Override + public void visitTypeParameter(JCTypeParameter tree) { + findPosition(tree, peek2(), tree.annotations); + super.visitTypeParameter(tree); + } + + void findPosition(JCTree tree, JCTree frame, List annotations) { + if (!annotations.isEmpty()) { + TypeAnnotationPosition p = + resolveFrame(tree, frame, frames.toList(), + new TypeAnnotationPosition()); + if (!p.location.isEmpty()) + p.type = p.type.getGenericComplement(); + setTypeAnnotationPos(annotations, p); + } + } + + private int methodParamIndex(List path, JCTree param) { + List curr = path; + if (curr.head != param) + curr = path.tail; + JCMethodDecl method = (JCMethodDecl)curr.tail.head; + return method.params.indexOf(param); + } + } + + private static class TypeAnnotationLift extends TreeScanner { + List recordedTypeAnnotations = List.nil(); + + boolean isInner = false; + @Override + public void visitClassDef(JCClassDecl tree) { + if (isInner) { + // tree is an inner class tree. stop now. + // TransTypes.visitClassDef makes an invocation for each class + // separately. + return; + } + isInner = true; + List prevTAs = recordedTypeAnnotations; + recordedTypeAnnotations = List.nil(); + try { + super.visitClassDef(tree); + } finally { + tree.sym.typeAnnotations = tree.sym.typeAnnotations.appendList(recordedTypeAnnotations); + recordedTypeAnnotations = prevTAs; + } + } + + @Override + public void visitMethodDef(JCMethodDecl tree) { + List prevTAs = recordedTypeAnnotations; + recordedTypeAnnotations = List.nil(); + try { + super.visitMethodDef(tree); + } finally { + tree.sym.typeAnnotations = tree.sym.typeAnnotations.appendList(recordedTypeAnnotations); + recordedTypeAnnotations = prevTAs; + } + } + + @Override + public void visitVarDef(JCVariableDecl tree) { + List prevTAs = recordedTypeAnnotations; + recordedTypeAnnotations = List.nil(); + ElementKind kind = tree.sym.getKind(); + if (kind == ElementKind.LOCAL_VARIABLE && tree.mods.annotations.nonEmpty()) { + // need to lift the annotations + TypeAnnotationPosition position = new TypeAnnotationPosition(); + position.pos = tree.pos; + position.type = TargetType.LOCAL_VARIABLE; + for (Attribute.Compound attribute : tree.sym.attributes_field) { + Attribute.TypeCompound tc = + new Attribute.TypeCompound(attribute.type, attribute.values, position); + recordedTypeAnnotations = recordedTypeAnnotations.append(tc); + } + } + try { + super.visitVarDef(tree); + } finally { + if (kind.isField() || kind == ElementKind.LOCAL_VARIABLE) + tree.sym.typeAnnotations = tree.sym.typeAnnotations.appendList(recordedTypeAnnotations); + recordedTypeAnnotations = kind.isField() ? prevTAs : prevTAs.appendList(recordedTypeAnnotations); + } + } + + @Override + public void visitApply(JCMethodInvocation tree) { + scan(tree.meth); + scan(tree.typeargs); + scan(tree.args); + } + + public void visitAnnotation(JCAnnotation tree) { + if (tree instanceof JCTypeAnnotation) + recordedTypeAnnotations = recordedTypeAnnotations.append(((JCTypeAnnotation)tree).attribute_field); + super.visitAnnotation(tree); + } + } + +} diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java index 4835c35aef5..d5c408c3179 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java +++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java @@ -2504,7 +2504,7 @@ public class Types { } @Override public int hashCode() { - return 127 * Types.this.hashCode(t1) + Types.this.hashCode(t2); + return 127 * Types.hashCode(t1) + Types.hashCode(t2); } @Override public boolean equals(Object obj) { @@ -3375,7 +3375,7 @@ public class Types { this.t = t; } public int hashCode() { - return Types.this.hashCode(t); + return Types.hashCode(t); } public boolean equals(Object obj) { return (obj instanceof SingletonType) && diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java index 32fb5fadf4f..b5d2c16d20f 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java @@ -2020,6 +2020,10 @@ public class Attr extends JCTree.Visitor { tree.pos(), site, sym.name, true); } } + } else if (sym.kind != ERR && (sym.flags() & STATIC) != 0 && sym.name != names._class) { + // If the qualified item is not a type and the selected item is static, report + // a warning. Make allowance for the class of an array type e.g. Object[].class) + chk.warnStatic(tree, "static.not.qualified.by.type", Kinds.kindName(sym.kind), sym.owner); } // If we are selecting an instance member via a `super', ... @@ -2636,6 +2640,7 @@ public class Attr extends JCTree.Visitor { if (tree.bounds.tail.nonEmpty()) { log.error(tree.bounds.tail.head.pos(), "type.var.may.not.be.followed.by.other.bounds"); + log.unrecoverableError = true; tree.bounds = List.of(tree.bounds.head); a.bound = bs.head; } diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java index 09cddea4e94..bfaba9f4c4d 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java @@ -189,6 +189,11 @@ public class Check { sunApiHandler.report(pos, msg, args); } + public void warnStatic(DiagnosticPosition pos, String msg, Object... args) { + if (lint.isEnabled(LintCategory.STATIC)) + log.warning(pos, msg, args); + } + /** * Report any deferred diagnostics. */ @@ -2047,7 +2052,7 @@ public class Check { Symbol m = TreeInfo.symbol(assign.lhs); if (m == null || m.type.isErroneous()) continue; if (!members.remove(m)) - log.error(arg.pos(), "duplicate.annotation.member.value", + log.error(assign.lhs.pos(), "duplicate.annotation.member.value", m.name, a.type); if (assign.rhs.getTag() == ANNOTATION) validateAnnotation((JCAnnotation)assign.rhs); diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java index f84ac75acb3..b443f40ef00 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java @@ -100,6 +100,7 @@ public class Enter extends JCTree.Visitor { MemberEnter memberEnter; Types types; Lint lint; + Names names; JavaFileManager fileManager; private final Todo todo; @@ -123,6 +124,7 @@ public class Enter extends JCTree.Visitor { types = Types.instance(context); annotate = Annotate.instance(context); lint = Lint.instance(context); + names = Names.instance(context); predefClassDef = make.ClassDef( make.Modifiers(PUBLIC), @@ -268,6 +270,7 @@ public class Enter extends JCTree.Visitor { return ts.toList(); } + @Override public void visitTopLevel(JCCompilationUnit tree) { JavaFileObject prev = log.useSource(tree.sourcefile); boolean addEnv = false; @@ -287,13 +290,13 @@ public class Enter extends JCTree.Visitor { tree.packge = syms.unnamedPackage; } tree.packge.complete(); // Find all classes in package. - Env env = topLevelEnv(tree); + Env topEnv = topLevelEnv(tree); // Save environment of package-info.java file. if (isPkgInfo) { Env env0 = typeEnvs.get(tree.packge); if (env0 == null) { - typeEnvs.put(tree.packge, env); + typeEnvs.put(tree.packge, topEnv); } else { JCCompilationUnit tree0 = env0.toplevel; if (!fileManager.isSameFile(tree.sourcefile, tree0.sourcefile)) { @@ -304,19 +307,31 @@ public class Enter extends JCTree.Visitor { if (addEnv || (tree0.packageAnnotations.isEmpty() && tree.docComments != null && tree.docComments.get(tree) != null)) { - typeEnvs.put(tree.packge, env); + typeEnvs.put(tree.packge, topEnv); } } } + + for (Symbol q = tree.packge; q != null && q.kind == PCK; q = q.owner) + q.flags_field |= EXISTS; + + Name name = names.package_info; + ClassSymbol c = reader.enterClass(name, tree.packge); + c.flatname = names.fromString(tree.packge + "." + name); + c.sourcefile = tree.sourcefile; + c.completer = null; + c.members_field = new Scope(c); + tree.packge.package_info = c; } - classEnter(tree.defs, env); + classEnter(tree.defs, topEnv); if (addEnv) { - todo.append(env); + todo.append(topEnv); } log.useSource(prev); result = null; } + @Override public void visitClassDef(JCClassDecl tree) { Symbol owner = env.info.scope.owner; Scope enclScope = enterScope(env); @@ -422,6 +437,7 @@ public class Enter extends JCTree.Visitor { * Enter a symbol for type parameter in local scope, after checking that it * is unique. */ + @Override public void visitTypeParameter(JCTypeParameter tree) { TypeVar a = (tree.type != null) ? (TypeVar)tree.type @@ -435,6 +451,7 @@ public class Enter extends JCTree.Visitor { /** Default class enter visitor method: do nothing. */ + @Override public void visitTree(JCTree tree) { result = null; } @@ -476,10 +493,8 @@ public class Enter extends JCTree.Visitor { for (JCCompilationUnit tree : trees) { if (tree.starImportScope.elems == null) { JavaFileObject prev = log.useSource(tree.sourcefile); - Env env = typeEnvs.get(tree); - if (env == null) - env = topLevelEnv(tree); - memberEnter.memberEnter(tree, env); + Env topEnv = topLevelEnv(tree); + memberEnter.memberEnter(tree, topEnv); log.useSource(prev); } } diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java index fa03454970d..e03928e5d58 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java @@ -1994,19 +1994,14 @@ public class Lower extends TreeTranslator { tree.packageAnnotations), name, List.nil(), null, List.nil(), List.nil()); - ClassSymbol c = reader.enterClass(name, tree.packge); - c.flatname = names.fromString(tree.packge + "." + name); - c.sourcefile = tree.sourcefile; - c.completer = null; - c.members_field = new Scope(c); - c.flags_field = flags; + ClassSymbol c = tree.packge.package_info; + c.flags_field |= flags; c.attributes_field = tree.packge.attributes_field; ClassType ctype = (ClassType) c.type; ctype.supertype_field = syms.objectType; ctype.interfaces_field = List.nil(); packageAnnotationsClass.sym = c; - translated.append(packageAnnotationsClass); } } @@ -3117,7 +3112,6 @@ public class Lower extends TreeTranslator { tree.cases = translateCases(tree.cases); if (enumSwitch) { result = visitEnumSwitch(tree); - patchTargets(result, tree, result); } else if (stringSwitch) { result = visitStringSwitch(tree); } else { @@ -3146,7 +3140,9 @@ public class Lower extends TreeTranslator { cases.append(c); } } - return make.Switch(selector, cases.toList()); + JCSwitch enumSwitch = make.Switch(selector, cases.toList()); + patchTargets(enumSwitch, tree, enumSwitch); + return enumSwitch; } public JCTree visitStringSwitch(JCSwitch tree) { @@ -3187,7 +3183,14 @@ public class Lower extends TreeTranslator { * of String is the same in the compilation environment as * in the environment the code will run in. The string * hashing algorithm in the SE JDK has been unchanged - * since at least JDK 1.2. + * since at least JDK 1.2. Since the algorithm has been + * specified since that release as well, it is very + * unlikely to be changed in the future. + * + * Different hashing algorithms, such as the length of the + * strings or a perfect hashing algorithm over the + * particular set of case labels, could potentially be + * used instead of String.hashCode. */ ListBuffer stmtList = new ListBuffer(); diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java index 39dd35902a5..f4a3debe285 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java @@ -1065,11 +1065,6 @@ public class MemberEnter extends JCTree.Visitor implements Completer { super.visitNewArray(tree); } @Override - public void visitApply(JCMethodInvocation tree) { - super.visitApply(tree); - scan(tree.typeargs); - } - @Override public void visitMethodDef(JCMethodDecl tree) { annotate(tree, tree.receiverAnnotations); super.visitMethodDef(tree); diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java b/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java index f2d976ae9bb..e3c731aa3ae 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java @@ -61,8 +61,6 @@ public class TransTypes extends TreeTranslator { return instance; } - private boolean debugJSR308; - private Names names; private Log log; private Symtab syms; @@ -71,6 +69,7 @@ public class TransTypes extends TreeTranslator { private boolean allowEnums; private Types types; private final Resolve resolve; + private final TypeAnnotations typeAnnotations; /** * Flag to indicate whether or not to generate bridge methods. @@ -92,7 +91,7 @@ public class TransTypes extends TreeTranslator { types = Types.instance(context); make = TreeMaker.instance(context); resolve = Resolve.instance(context); - debugJSR308 = Options.instance(context).get("TA:trans") != null; + typeAnnotations = TypeAnnotations.instance(context); } /** A hashtable mapping bridge methods to the methods they override after @@ -440,8 +439,7 @@ public class TransTypes extends TreeTranslator { } public void visitClassDef(JCClassDecl tree) { - new TypeAnnotationPositions().scan(tree); - new TypeAnnotationLift().scan(tree); + typeAnnotations.taFillAndLift(tree, true); translateClass(tree.sym); result = tree; } @@ -609,10 +607,12 @@ public class TransTypes extends TreeTranslator { public void visitNewArray(JCNewArray tree) { tree.elemtype = translate(tree.elemtype, null); translate(tree.dims, syms.intType); - tree.elems = translate(tree.elems, - (tree.type == null) ? null - : erasure(types.elemtype(tree.type))); - tree.type = erasure(tree.type); + if (tree.type != null) { + tree.elems = translate(tree.elems, erasure(types.elemtype(tree.type))); + tree.type = erasure(tree.type); + } else { + tree.elems = translate(tree.elems, null); + } result = tree; } @@ -801,359 +801,4 @@ public class TransTypes extends TreeTranslator { pt = null; return translate(cdef, null); } - - private class TypeAnnotationPositions extends TreeScanner { - - private ListBuffer frames = ListBuffer.lb(); - private void push(JCTree t) { frames = frames.prepend(t); } - private JCTree pop() { return frames.next(); } - private JCTree peek() { return frames.first(); } - private JCTree peek2() { return frames.toList().tail.head; } - - @Override - public void scan(JCTree tree) { - push(tree); - super.scan(tree); - pop(); - } - - private boolean inClass = false; - - @Override - public void visitClassDef(JCClassDecl tree) { - if (!inClass) { - // Do not recurse into nested and inner classes since - // TransTypes.visitClassDef makes an invocation for each class - // separately. - inClass = true; - try { - super.visitClassDef(tree); - } finally { - inClass = false; - } - } - } - - private TypeAnnotationPosition resolveFrame(JCTree tree, JCTree frame, - List path, TypeAnnotationPosition p) { - switch (frame.getKind()) { - case TYPE_CAST: - p.type = TargetType.TYPECAST; - p.pos = frame.pos; - return p; - - case INSTANCE_OF: - p.type = TargetType.INSTANCEOF; - p.pos = frame.pos; - return p; - - case NEW_CLASS: - p.type = TargetType.NEW; - p.pos = frame.pos; - return p; - - case NEW_ARRAY: - p.type = TargetType.NEW; - p.pos = frame.pos; - return p; - - case CLASS: - p.pos = frame.pos; - if (((JCClassDecl)frame).extending == tree) { - p.type = TargetType.CLASS_EXTENDS; - p.type_index = -1; - } else if (((JCClassDecl)frame).implementing.contains(tree)) { - p.type = TargetType.CLASS_EXTENDS; - p.type_index = ((JCClassDecl)frame).implementing.indexOf(tree); - } else if (((JCClassDecl)frame).typarams.contains(tree)) { - p.type = TargetType.CLASS_TYPE_PARAMETER; - p.parameter_index = ((JCClassDecl)frame).typarams.indexOf(tree); - } else - throw new AssertionError(); - return p; - - case METHOD: { - JCMethodDecl frameMethod = (JCMethodDecl)frame; - p.pos = frame.pos; - if (frameMethod.receiverAnnotations.contains(tree)) - p.type = TargetType.METHOD_RECEIVER; - else if (frameMethod.thrown.contains(tree)) { - p.type = TargetType.THROWS; - p.type_index = frameMethod.thrown.indexOf(tree); - } else if (((JCMethodDecl)frame).restype == tree) { - p.type = TargetType.METHOD_RETURN_GENERIC_OR_ARRAY; - } else if (frameMethod.typarams.contains(tree)) { - p.type = TargetType.METHOD_TYPE_PARAMETER; - p.parameter_index = frameMethod.typarams.indexOf(tree); - } else - throw new AssertionError(); - return p; - } - case MEMBER_SELECT: { - JCFieldAccess fieldFrame = (JCFieldAccess)frame; - if (fieldFrame.name == names._class) { - p.type = TargetType.CLASS_LITERAL; - if (fieldFrame.selected instanceof JCAnnotatedType) { - p.pos = TreeInfo.typeIn(fieldFrame).pos; - } else if (fieldFrame.selected instanceof JCArrayTypeTree) { - p.pos = fieldFrame.selected.pos; - } - } else - throw new AssertionError(); - return p; - } - case PARAMETERIZED_TYPE: { - TypeAnnotationPosition nextP; - if (((JCTypeApply)frame).clazz == tree) - nextP = p; // generic: RAW; noop - else if (((JCTypeApply)frame).arguments.contains(tree)) - p.location = p.location.prepend( - ((JCTypeApply)frame).arguments.indexOf(tree)); - else - throw new AssertionError(); - - List newPath = path.tail; - return resolveFrame(newPath.head, newPath.tail.head, newPath, p); - } - - case ARRAY_TYPE: { - p.location = p.location.prepend(0); - List newPath = path.tail; - return resolveFrame(newPath.head, newPath.tail.head, newPath, p); - } - - case TYPE_PARAMETER: - if (path.tail.tail.head.getTag() == JCTree.CLASSDEF) { - JCClassDecl clazz = (JCClassDecl)path.tail.tail.head; - p.type = TargetType.CLASS_TYPE_PARAMETER_BOUND; - p.parameter_index = clazz.typarams.indexOf(path.tail.head); - p.bound_index = ((JCTypeParameter)frame).bounds.indexOf(tree); - } else if (path.tail.tail.head.getTag() == JCTree.METHODDEF) { - JCMethodDecl method = (JCMethodDecl)path.tail.tail.head; - p.type = TargetType.METHOD_TYPE_PARAMETER_BOUND; - p.parameter_index = method.typarams.indexOf(path.tail.head); - p.bound_index = ((JCTypeParameter)frame).bounds.indexOf(tree); - } else - throw new AssertionError(); - p.pos = frame.pos; - return p; - - case VARIABLE: - VarSymbol v = ((JCVariableDecl)frame).sym; - p.pos = frame.pos; - switch (v.getKind()) { - case LOCAL_VARIABLE: - p.type = TargetType.LOCAL_VARIABLE; break; - case FIELD: - p.type = TargetType.FIELD_GENERIC_OR_ARRAY; break; - case PARAMETER: - p.type = TargetType.METHOD_PARAMETER_GENERIC_OR_ARRAY; - p.parameter_index = methodParamIndex(path, frame); - break; - default: throw new AssertionError(); - } - return p; - - case ANNOTATED_TYPE: { - List newPath = path.tail; - return resolveFrame(newPath.head, newPath.tail.head, - newPath, p); - } - - case METHOD_INVOCATION: { - JCMethodInvocation invocation = (JCMethodInvocation)frame; - if (!invocation.typeargs.contains(tree)) - throw new AssertionError("{" + tree + "} is not an argument in the invocation: " + invocation); - p.type = TargetType.METHOD_TYPE_ARGUMENT; - p.pos = invocation.pos; - p.type_index = invocation.typeargs.indexOf(tree); - return p; - } - - case EXTENDS_WILDCARD: - case SUPER_WILDCARD: { - p.type = TargetType.WILDCARD_BOUND; - List newPath = path.tail; - - TypeAnnotationPosition wildcard = - resolveFrame(newPath.head, newPath.tail.head, newPath, - new TypeAnnotationPosition()); - if (!wildcard.location.isEmpty()) - wildcard.type = wildcard.type.getGenericComplement(); - p.wildcard_position = wildcard; - p.pos = frame.pos; - return p; - } - } - return p; - } - - @Override - public void visitApply(JCMethodInvocation tree) { - scan(tree.meth); - scan(tree.typeargs); - scan(tree.args); - } - - private void setTypeAnnotationPos(List annotations, TypeAnnotationPosition position) { - for (JCTypeAnnotation anno : annotations) { - anno.annotation_position = position; - anno.attribute_field.position = position; - } - } - - @Override - public void visitNewArray(JCNewArray tree) { - findPosition(tree, tree, tree.annotations); - int dimAnnosCount = tree.dimAnnotations.size(); - - // handle annotations associated with dimentions - for (int i = 0; i < dimAnnosCount; ++i) { - TypeAnnotationPosition p = new TypeAnnotationPosition(); - p.type = TargetType.NEW_GENERIC_OR_ARRAY; - p.pos = tree.pos; - p.location = p.location.append(i); - setTypeAnnotationPos(tree.dimAnnotations.get(i), p); - } - - // handle "free" annotations - int i = dimAnnosCount == 0 ? 0 : dimAnnosCount - 1; - JCExpression elemType = tree.elemtype; - while (elemType != null) { - if (elemType.getTag() == JCTree.ANNOTATED_TYPE) { - JCAnnotatedType at = (JCAnnotatedType)elemType; - TypeAnnotationPosition p = new TypeAnnotationPosition(); - p.type = TargetType.NEW_GENERIC_OR_ARRAY; - p.pos = tree.pos; - p.location = p.location.append(i); - setTypeAnnotationPos(at.annotations, p); - elemType = at.underlyingType; - } else if (elemType.getTag() == JCTree.TYPEARRAY) { - ++i; - elemType = ((JCArrayTypeTree)elemType).elemtype; - } else - break; - } - - // find annotations locations of initializer elements - scan(tree.elems); - } - - @Override - public void visitAnnotatedType(JCAnnotatedType tree) { - findPosition(tree, peek2(), tree.annotations); - super.visitAnnotatedType(tree); - } - - @Override - public void visitMethodDef(JCMethodDecl tree) { - TypeAnnotationPosition p = new TypeAnnotationPosition(); - p.type = TargetType.METHOD_RECEIVER; - setTypeAnnotationPos(tree.receiverAnnotations, p); - super.visitMethodDef(tree); - } - @Override - public void visitTypeParameter(JCTypeParameter tree) { - findPosition(tree, peek2(), tree.annotations); - super.visitTypeParameter(tree); - } - - void findPosition(JCTree tree, JCTree frame, List annotations) { - if (!annotations.isEmpty()) { - TypeAnnotationPosition p = - resolveFrame(tree, frame, frames.toList(), - new TypeAnnotationPosition()); - if (!p.location.isEmpty()) - p.type = p.type.getGenericComplement(); - setTypeAnnotationPos(annotations, p); - if (debugJSR308) { - System.out.println("trans: " + tree); - System.out.println(" target: " + p); - } - } - } - - private int methodParamIndex(List path, JCTree param) { - List curr = path; - if (curr.head != param) - curr = path.tail; - JCMethodDecl method = (JCMethodDecl)curr.tail.head; - return method.params.indexOf(param); - } - } - - private class TypeAnnotationLift extends TreeScanner { - List recordedTypeAnnotations = List.nil(); - - boolean isInner = false; - @Override - public void visitClassDef(JCClassDecl tree) { - if (isInner) { - // tree is an inner class tree. stop now. - // TransTypes.visitClassDef makes an invocation for each class - // seperately. - return; - } - isInner = true; - List prevTAs = recordedTypeAnnotations; - recordedTypeAnnotations = List.nil(); - try { - super.visitClassDef(tree); - } finally { - tree.sym.typeAnnotations = tree.sym.typeAnnotations.appendList(recordedTypeAnnotations); - recordedTypeAnnotations = prevTAs; - } - } - - @Override - public void visitMethodDef(JCMethodDecl tree) { - List prevTAs = recordedTypeAnnotations; - recordedTypeAnnotations = List.nil(); - try { - super.visitMethodDef(tree); - } finally { - tree.sym.typeAnnotations = tree.sym.typeAnnotations.appendList(recordedTypeAnnotations); - recordedTypeAnnotations = prevTAs; - } - } - - @Override - public void visitVarDef(JCVariableDecl tree) { - List prevTAs = recordedTypeAnnotations; - recordedTypeAnnotations = List.nil(); - ElementKind kind = tree.sym.getKind(); - if (kind == ElementKind.LOCAL_VARIABLE && tree.mods.annotations.nonEmpty()) { - // need to lift the annotations - TypeAnnotationPosition position = new TypeAnnotationPosition(); - position.pos = tree.pos; - position.type = TargetType.LOCAL_VARIABLE; - for (Attribute.Compound attribute : tree.sym.attributes_field) { - Attribute.TypeCompound tc = - new Attribute.TypeCompound(attribute.type, attribute.values, position); - recordedTypeAnnotations = recordedTypeAnnotations.append(tc); - } - } - try { - super.visitVarDef(tree); - } finally { - if (kind.isField() || kind == ElementKind.LOCAL_VARIABLE) - tree.sym.typeAnnotations = tree.sym.typeAnnotations.appendList(recordedTypeAnnotations); - recordedTypeAnnotations = kind.isField() ? prevTAs : prevTAs.appendList(recordedTypeAnnotations); - } - } - - @Override - public void visitApply(JCMethodInvocation tree) { - scan(tree.meth); - scan(tree.typeargs); - scan(tree.args); - } - - public void visitAnnotation(JCAnnotation tree) { - if (tree instanceof JCTypeAnnotation) - recordedTypeAnnotations = recordedTypeAnnotations.append(((JCTypeAnnotation)tree).attribute_field); - super.visitAnnotation(tree); - } - } - } diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/BaseFileObject.java b/langtools/src/share/classes/com/sun/tools/javac/file/BaseFileObject.java index 6435e05a04c..9666f1cee7e 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/file/BaseFileObject.java +++ b/langtools/src/share/classes/com/sun/tools/javac/file/BaseFileObject.java @@ -39,6 +39,8 @@ import javax.tools.JavaFileObject; import static javax.tools.JavaFileObject.Kind.*; +import com.sun.tools.javac.util.BaseFileManager; + /** *

      This is NOT part of any API supported by Sun Microsystems. * If you write code that depends on this, you do so at your own risk. @@ -74,14 +76,7 @@ public abstract class BaseFileObject implements JavaFileObject { protected abstract String inferBinaryName(Iterable path); protected static JavaFileObject.Kind getKind(String filename) { - if (filename.endsWith(CLASS.extension)) - return CLASS; - else if (filename.endsWith(SOURCE.extension)) - return SOURCE; - else if (filename.endsWith(HTML.extension)) - return HTML; - else - return OTHER; + return BaseFileManager.getKind(filename); } protected static String removeExtension(String fileName) { diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java b/langtools/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java index 23f169b5392..8201e20ed84 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java +++ b/langtools/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java @@ -26,29 +26,16 @@ package com.sun.tools.javac.file; import java.io.ByteArrayOutputStream; -import java.io.Closeable; import java.io.File; -import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; -import java.io.InputStream; import java.io.OutputStreamWriter; -import java.lang.ref.SoftReference; -import java.lang.reflect.Constructor; import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; -import java.net.URLClassLoader; -import java.nio.ByteBuffer; import java.nio.CharBuffer; -import java.nio.channels.FileChannel; import java.nio.charset.Charset; -import java.nio.charset.CharsetDecoder; -import java.nio.charset.CoderResult; -import java.nio.charset.CodingErrorAction; -import java.nio.charset.IllegalCharsetNameException; -import java.nio.charset.UnsupportedCharsetException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -66,18 +53,13 @@ import javax.tools.JavaFileManager; import javax.tools.JavaFileObject; import javax.tools.StandardJavaFileManager; -import com.sun.tools.javac.code.Source; import com.sun.tools.javac.file.RelativePath.RelativeFile; import com.sun.tools.javac.file.RelativePath.RelativeDirectory; -import com.sun.tools.javac.main.JavacOption; import com.sun.tools.javac.main.OptionName; -import com.sun.tools.javac.main.RecognizedOptions; +import com.sun.tools.javac.util.BaseFileManager; import com.sun.tools.javac.util.Context; -import com.sun.tools.javac.util.JCDiagnostic.SimpleDiagnosticPosition; import com.sun.tools.javac.util.List; import com.sun.tools.javac.util.ListBuffer; -import com.sun.tools.javac.util.Log; -import com.sun.tools.javac.util.Options; import static javax.tools.StandardLocation.*; import static com.sun.tools.javac.main.OptionName.*; @@ -91,7 +73,7 @@ import static com.sun.tools.javac.main.OptionName.*; * This code and its internal interfaces are subject to change or * deletion without notice. */ -public class JavacFileManager implements StandardJavaFileManager { +public class JavacFileManager extends BaseFileManager implements StandardJavaFileManager { boolean useZipFileIndex; @@ -102,17 +84,10 @@ public class JavacFileManager implements StandardJavaFileManager { return buffer.toString().toCharArray(); } - /** - * The log to be used for error reporting. - */ - protected Log log; - /** Encapsulates knowledge of paths */ private Paths paths; - private Options options; - private FSInfo fsInfo; private final File uninited = new File("U N I N I T E D"); @@ -134,12 +109,6 @@ public class JavacFileManager implements StandardJavaFileManager { protected boolean mmappedIO; protected boolean ignoreSymbolFile; - protected String classLoaderClass; - - /** - * User provided charset (through javax.tools). - */ - protected Charset charset; /** * Register a Context.Factory to create a JavacFileManager. @@ -157,18 +126,18 @@ public class JavacFileManager implements StandardJavaFileManager { * it as the JavaFileManager for that context. */ public JavacFileManager(Context context, boolean register, Charset charset) { + super(charset); if (register) context.put(JavaFileManager.class, this); - byteBufferCache = new ByteBufferCache(); - this.charset = charset; setContext(context); } /** * Set the context for JavacFileManager. */ + @Override public void setContext(Context context) { - log = Log.instance(context); + super.setContext(context); if (paths == null) { paths = Paths.instance(context); } else { @@ -177,14 +146,12 @@ public class JavacFileManager implements StandardJavaFileManager { paths.setContext(context); } - options = Options.instance(context); fsInfo = FSInfo.instance(context); useZipFileIndex = System.getProperty("useJavaUtilZip") == null;// TODO: options.get("useJavaUtilZip") == null; mmappedIO = options.get("mmappedIO") != null; ignoreSymbolFile = options.get("ignore.symbol.file") != null; - classLoaderClass = options.get("procloader"); } public JavaFileObject getFileForInput(String name) { @@ -214,17 +181,6 @@ public class JavacFileManager implements StandardJavaFileManager { return getJavaFileObjectsFromStrings(Arrays.asList(nullCheck(names))); } - protected JavaFileObject.Kind getKind(String extension) { - if (extension.equals(JavaFileObject.Kind.CLASS.extension)) - return JavaFileObject.Kind.CLASS; - else if (extension.equals(JavaFileObject.Kind.SOURCE.extension)) - return JavaFileObject.Kind.SOURCE; - else if (extension.equals(JavaFileObject.Kind.HTML.extension)) - return JavaFileObject.Kind.HTML; - else - return JavaFileObject.Kind.OTHER; - } - private static boolean isValidName(String name) { // Arguably, isValidName should reject keywords (such as in SourceVersion.isName() ), // but the set of keywords depends on the source level, and we don't want @@ -304,7 +260,7 @@ public class JavacFileManager implements StandardJavaFileManager { archive = openArchive(directory); } catch (IOException ex) { log.error("error.reading.file", - directory, ex.getLocalizedMessage()); + directory, getMessage(ex)); return; } } @@ -359,9 +315,7 @@ public class JavacFileManager implements StandardJavaFileManager { } private boolean isValidFile(String s, Set fileKinds) { - int lastDot = s.lastIndexOf("."); - String extn = (lastDot == -1 ? s : s.substring(lastDot)); - JavaFileObject.Kind kind = getKind(extn); + JavaFileObject.Kind kind = getKind(s); return fileKinds.contains(kind); } @@ -535,7 +489,7 @@ public class JavacFileManager implements StandardJavaFileManager { archive = new MissingArchive(zipFileName); } catch (IOException ex) { if (zipFileName.exists()) - log.error("error.reading.file", zipFileName, ex.getLocalizedMessage()); + log.error("error.reading.file", zipFileName, getMessage(ex)); archive = new MissingArchive(zipFileName); } @@ -564,18 +518,6 @@ public class JavacFileManager implements StandardJavaFileManager { } } - CharBuffer getCachedContent(JavaFileObject file) { - SoftReference r = contentCache.get(file); - return (r == null ? null : r.get()); - } - - void cache(JavaFileObject file, CharBuffer cb) { - contentCache.put(file, new SoftReference(cb)); - } - - private final Map> contentCache - = new HashMap>(); - private String defaultEncodingName; private String getDefaultEncodingName() { if (defaultEncodingName == null) { @@ -585,161 +527,6 @@ public class JavacFileManager implements StandardJavaFileManager { return defaultEncodingName; } - protected String getEncodingName() { - String encName = options.get(OptionName.ENCODING); - if (encName == null) - return getDefaultEncodingName(); - else - return encName; - } - - protected Source getSource() { - String sourceName = options.get(OptionName.SOURCE); - Source source = null; - if (sourceName != null) - source = Source.lookup(sourceName); - return (source != null ? source : Source.DEFAULT); - } - - /** - * Make a byte buffer from an input stream. - */ - ByteBuffer makeByteBuffer(InputStream in) - throws IOException { - int limit = in.available(); - if (mmappedIO && in instanceof FileInputStream) { - // Experimental memory mapped I/O - FileInputStream fin = (FileInputStream)in; - return fin.getChannel().map(FileChannel.MapMode.READ_ONLY, 0, limit); - } - if (limit < 1024) limit = 1024; - ByteBuffer result = byteBufferCache.get(limit); - int position = 0; - while (in.available() != 0) { - if (position >= limit) - // expand buffer - result = ByteBuffer. - allocate(limit <<= 1). - put((ByteBuffer)result.flip()); - int count = in.read(result.array(), - position, - limit - position); - if (count < 0) break; - result.position(position += count); - } - return (ByteBuffer)result.flip(); - } - - void recycleByteBuffer(ByteBuffer bb) { - byteBufferCache.put(bb); - } - - /** - * A single-element cache of direct byte buffers. - */ - private static class ByteBufferCache { - private ByteBuffer cached; - ByteBuffer get(int capacity) { - if (capacity < 20480) capacity = 20480; - ByteBuffer result = - (cached != null && cached.capacity() >= capacity) - ? (ByteBuffer)cached.clear() - : ByteBuffer.allocate(capacity + capacity>>1); - cached = null; - return result; - } - void put(ByteBuffer x) { - cached = x; - } - } - - private final ByteBufferCache byteBufferCache; - - CharsetDecoder getDecoder(String encodingName, boolean ignoreEncodingErrors) { - Charset cs = (this.charset == null) - ? Charset.forName(encodingName) - : this.charset; - CharsetDecoder decoder = cs.newDecoder(); - - CodingErrorAction action; - if (ignoreEncodingErrors) - action = CodingErrorAction.REPLACE; - else - action = CodingErrorAction.REPORT; - - return decoder - .onMalformedInput(action) - .onUnmappableCharacter(action); - } - - /** - * Decode a ByteBuffer into a CharBuffer. - */ - CharBuffer decode(ByteBuffer inbuf, boolean ignoreEncodingErrors) { - String encodingName = getEncodingName(); - CharsetDecoder decoder; - try { - decoder = getDecoder(encodingName, ignoreEncodingErrors); - } catch (IllegalCharsetNameException e) { - log.error("unsupported.encoding", encodingName); - return (CharBuffer)CharBuffer.allocate(1).flip(); - } catch (UnsupportedCharsetException e) { - log.error("unsupported.encoding", encodingName); - return (CharBuffer)CharBuffer.allocate(1).flip(); - } - - // slightly overestimate the buffer size to avoid reallocation. - float factor = - decoder.averageCharsPerByte() * 0.8f + - decoder.maxCharsPerByte() * 0.2f; - CharBuffer dest = CharBuffer. - allocate(10 + (int)(inbuf.remaining()*factor)); - - while (true) { - CoderResult result = decoder.decode(inbuf, dest, true); - dest.flip(); - - if (result.isUnderflow()) { // done reading - // make sure there is at least one extra character - if (dest.limit() == dest.capacity()) { - dest = CharBuffer.allocate(dest.capacity()+1).put(dest); - dest.flip(); - } - return dest; - } else if (result.isOverflow()) { // buffer too small; expand - int newCapacity = - 10 + dest.capacity() + - (int)(inbuf.remaining()*decoder.maxCharsPerByte()); - dest = CharBuffer.allocate(newCapacity).put(dest); - } else if (result.isMalformed() || result.isUnmappable()) { - // bad character in input - - // report coding error (warn only pre 1.5) - if (!getSource().allowEncodingErrors()) { - log.error(new SimpleDiagnosticPosition(dest.limit()), - "illegal.char.for.encoding", - charset == null ? encodingName : charset.name()); - } else { - log.warning(new SimpleDiagnosticPosition(dest.limit()), - "illegal.char.for.encoding", - charset == null ? encodingName : charset.name()); - } - - // skip past the coding error - inbuf.position(inbuf.position() + result.length()); - - // undo the flip() to prepare the output buffer - // for more translation - dest.position(dest.limit()); - dest.limit(dest.capacity()); - dest.put((char)0xfffd); // backward compatible - } else { - throw new AssertionError(result); - } - } - // unreached - } - public ClassLoader getClassLoader(Location location) { nullCheck(location); Iterable path = getLocation(location); @@ -754,39 +541,7 @@ public class JavacFileManager implements StandardJavaFileManager { } } - URL[] urls = lb.toArray(new URL[lb.size()]); - ClassLoader thisClassLoader = getClass().getClassLoader(); - - // Bug: 6558476 - // Ideally, ClassLoader should be Closeable, but before JDK7 it is not. - // On older versions, try the following, to get a closeable classloader. - - // 1: Allow client to specify the class to use via hidden option - if (classLoaderClass != null) { - try { - Class loader = - Class.forName(classLoaderClass).asSubclass(ClassLoader.class); - Class[] constrArgTypes = { URL[].class, ClassLoader.class }; - Constructor constr = loader.getConstructor(constrArgTypes); - return constr.newInstance(new Object[] { urls, thisClassLoader }); - } catch (Throwable t) { - // ignore errors loading user-provided class loader, fall through - } - } - - // 2: If URLClassLoader implements Closeable, use that. - if (Closeable.class.isAssignableFrom(URLClassLoader.class)) - return new URLClassLoader(urls, thisClassLoader); - - // 3: Try using private reflection-based CloseableURLClassLoader - try { - return new CloseableURLClassLoader(urls, thisClassLoader); - } catch (Throwable t) { - // ignore errors loading workaround class loader, fall through - } - - // 4: If all else fails, use plain old standard URLClassLoader - return new URLClassLoader(urls, thisClassLoader); + return getClassLoader(lb.toArray(new URL[lb.size()])); } public Iterable list(Location location, @@ -836,38 +591,6 @@ public class JavacFileManager implements StandardJavaFileManager { return a.equals(b); } - public boolean handleOption(String current, Iterator remaining) { - for (JavacOption o: javacFileManagerOptions) { - if (o.matches(current)) { - if (o.hasArg()) { - if (remaining.hasNext()) { - if (!o.process(options, current, remaining.next())) - return true; - } - } else { - if (!o.process(options, current)) - return true; - } - // operand missing, or process returned false - throw new IllegalArgumentException(current); - } - } - - return false; - } - // where - private static JavacOption[] javacFileManagerOptions = - RecognizedOptions.getJavacFileManagerOptions( - new RecognizedOptions.GrumpyHelper()); - - public int isSupportedOption(String option) { - for (JavacOption o : javacFileManagerOptions) { - if (o.matches(option)) - return o.hasArg() ? 1 : 0; - } - return -1; - } - public boolean hasLocation(Location location) { return getLocation(location) != null; } @@ -1116,14 +839,22 @@ public class JavacFileManager implements StandardJavaFileManager { throw new IllegalArgumentException("Invalid relative path: " + file); } - private static T nullCheck(T o) { - o.getClass(); // null check - return o; - } - - private static Iterable nullCheck(Iterable it) { - for (T t : it) - t.getClass(); // null check - return it; + /** + * Get a detail message from an IOException. + * Most, but not all, instances of IOException provide a non-null result + * for getLocalizedMessage(). But some instances return null: in these + * cases, fallover to getMessage(), and if even that is null, return the + * name of the exception itself. + * @param e an IOException + * @return a string to include in a compiler diagnostic + */ + public static String getMessage(IOException e) { + String s = e.getLocalizedMessage(); + if (s != null) + return s; + s = e.getMessage(); + if (s != null) + return s; + return e.toString(); } } diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/Paths.java b/langtools/src/share/classes/com/sun/tools/javac/file/Paths.java index 6457b8107a5..bac36b38709 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/file/Paths.java +++ b/langtools/src/share/classes/com/sun/tools/javac/file/Paths.java @@ -27,6 +27,8 @@ package com.sun.tools.javac.file; import java.io.File; import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -34,6 +36,7 @@ import java.util.Set; import java.util.Collection; import java.util.Collections; import java.util.LinkedHashSet; +import java.util.StringTokenizer; import java.util.zip.ZipFile; import javax.tools.JavaFileManager.Location; @@ -66,7 +69,7 @@ public class Paths { * @param context the context * @return the Paths instance for this context */ - static Paths instance(Context context) { + public static Paths instance(Context context) { Paths instance = context.get(pathsKey); if (instance == null) instance = new Paths(context); @@ -317,7 +320,7 @@ public class Paths { addFile(f, warn); } } catch (IOException e) { - log.error("error.reading.file", jarFile, e.getLocalizedMessage()); + log.error("error.reading.file", jarFile, JavacFileManager.getMessage(e)); } } } @@ -449,4 +452,60 @@ public class Paths { return fsInfo.isFile(file) && (n.endsWith(".jar") || n.endsWith(".zip")); } + + /** + * Utility method for converting a search path string to an array + * of directory and JAR file URLs. + * + * Note that this method is called by apt and the DocletInvoker. + * + * @param path the search path string + * @return the resulting array of directory and JAR file URLs + */ + public static URL[] pathToURLs(String path) { + StringTokenizer st = new StringTokenizer(path, File.pathSeparator); + URL[] urls = new URL[st.countTokens()]; + int count = 0; + while (st.hasMoreTokens()) { + URL url = fileToURL(new File(st.nextToken())); + if (url != null) { + urls[count++] = url; + } + } + if (urls.length != count) { + URL[] tmp = new URL[count]; + System.arraycopy(urls, 0, tmp, 0, count); + urls = tmp; + } + return urls; + } + + /** + * Returns the directory or JAR file URL corresponding to the specified + * local file name. + * + * @param file the File object + * @return the resulting directory or JAR file URL, or null if unknown + */ + private static URL fileToURL(File file) { + String name; + try { + name = file.getCanonicalPath(); + } catch (IOException e) { + name = file.getAbsolutePath(); + } + name = name.replace(File.separatorChar, '/'); + if (!name.startsWith("/")) { + name = "/" + name; + } + // If the file does not exist, then assume that it's a directory + if (!file.isFile()) { + name = name + "/"; + } + try { + return new URL("file", "", name); + } catch (MalformedURLException e) { + throw new IllegalArgumentException(file.toString()); + } + } } diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndex.java b/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndex.java index 6ea261c0fe0..7aa983c6691 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndex.java +++ b/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndex.java @@ -1002,7 +1002,7 @@ public class ZipFileIndex { // Do nothing } finally { try { - if (raf == null) { + if (raf != null) { raf.close(); } } catch (Throwable t) { diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java index 146c7100ea9..1c5b58e8074 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java +++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java @@ -1135,7 +1135,7 @@ public class ClassReader implements Completer { self.name = simpleBinaryName(self.flatname, c.flatname) ; self.owner = m != null ? m : c; if (self.name.isEmpty()) - self.fullname = null; + self.fullname = names.empty; else self.fullname = ClassSymbol.formFullName(self.name, self.owner); @@ -1425,11 +1425,11 @@ public class ClassReader implements Completer { // Class extends and implements clauses case CLASS_EXTENDS: case CLASS_EXTENDS_GENERIC_OR_ARRAY: - position.type_index = nextByte(); + position.type_index = nextChar(); break; // throws case THROWS: - position.type_index = nextByte(); + position.type_index = nextChar(); break; case CLASS_LITERAL: case CLASS_LITERAL_GENERIC_OR_ARRAY: diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java index 2ed523802ff..39f73bf4de5 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java +++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java @@ -965,11 +965,11 @@ public class ClassWriter extends ClassFile { // Class extends and implements clauses case CLASS_EXTENDS: case CLASS_EXTENDS_GENERIC_OR_ARRAY: - databuf.appendByte(p.type_index); + databuf.appendChar(p.type_index); break; // throws case THROWS: - databuf.appendByte(p.type_index); + databuf.appendChar(p.type_index); break; case CLASS_LITERAL: case CLASS_LITERAL_GENERIC_OR_ARRAY: diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java index c0a8a3cf421..cc4bafe8b67 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java +++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java @@ -1926,9 +1926,9 @@ public class Code { for (Attribute.TypeCompound ta : lv.sym.typeAnnotations) { TypeAnnotationPosition p = ta.position; while (p != null) { - p.lvarOffset[0] = (int)lv.start_pc; - p.lvarLength[0] = (int)lv.length; - p.lvarIndex[0] = (int)lv.reg; + p.lvarOffset = new int[] { (int)lv.start_pc }; + p.lvarLength = new int[] { (int)lv.length }; + p.lvarIndex = new int[] { (int)lv.reg }; p.isValidOffset = true; p = p.wildcard_position; } diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java index d30d75279d6..e39115c7af8 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java +++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java @@ -808,8 +808,8 @@ public class Gen extends JCTree.Visitor { code.resolve(secondJumps); CondItem second = genCond(tree.falsepart, CRT_FLOW_TARGET); CondItem result = items.makeCondItem(second.opcode, - code.mergeChains(trueJumps, second.trueJumps), - code.mergeChains(falseJumps, second.falseJumps)); + Code.mergeChains(trueJumps, second.trueJumps), + Code.mergeChains(falseJumps, second.falseJumps)); if (markBranches) result.tree = tree.falsepart; return result; } else { @@ -1322,7 +1322,7 @@ public class Gen extends JCTree.Visitor { if (useJsrLocally) { if (tree.finalizer != null) { Code.State jsrState = code.state.dup(); - jsrState.push(code.jsrReturnValue); + jsrState.push(Code.jsrReturnValue); tryEnv.info.cont = new Chain(code.emitJump(jsr), tryEnv.info.cont, @@ -1375,7 +1375,7 @@ public class Gen extends JCTree.Visitor { genFinalizer(env); if (hasFinalizer || l.tail.nonEmpty()) { code.statBegin(TreeInfo.endPos(env.tree)); - exitChain = code.mergeChains(exitChain, + exitChain = Code.mergeChains(exitChain, code.branch(goto_)); } endFinalizerGap(env); @@ -1714,7 +1714,7 @@ public class Gen extends JCTree.Visitor { for (Attribute.TypeCompound ta : meth.typeAnnotations) { if (ta.position.pos == treePos) { ta.position.offset = code.cp; - ta.position.lvarOffset[0] = code.cp; + ta.position.lvarOffset = new int[] { code.cp }; ta.position.isValidOffset = true; } } @@ -1726,7 +1726,7 @@ public class Gen extends JCTree.Visitor { for (Attribute.TypeCompound ta : meth.owner.typeAnnotations) { if (ta.position.pos == treePos) { ta.position.offset = code.cp; - ta.position.lvarOffset[0] = code.cp; + ta.position.lvarOffset = new int[] { code.cp }; ta.position.isValidOffset = true; } } @@ -1738,7 +1738,7 @@ public class Gen extends JCTree.Visitor { for (Attribute.TypeCompound ta : s.typeAnnotations) { if (ta.position.pos == treePos) { ta.position.offset = code.cp; - ta.position.lvarOffset[0] = code.cp; + ta.position.lvarOffset = new int[] { code.cp }; ta.position.isValidOffset = true; } } @@ -1963,7 +1963,7 @@ public class Gen extends JCTree.Visitor { result = items. makeCondItem(rcond.opcode, rcond.trueJumps, - code.mergeChains(falseJumps, + Code.mergeChains(falseJumps, rcond.falseJumps)); } else { result = lcond; @@ -1976,7 +1976,7 @@ public class Gen extends JCTree.Visitor { CondItem rcond = genCond(tree.rhs, CRT_FLOW_TARGET); result = items. makeCondItem(rcond.opcode, - code.mergeChains(trueJumps, rcond.trueJumps), + Code.mergeChains(trueJumps, rcond.trueJumps), rcond.falseJumps); } else { result = lcond; @@ -2158,6 +2158,11 @@ public class Gen extends JCTree.Visitor { code.emitop2(ldc2, makeRef(tree.pos(), tree.selected.type)); result = items.makeStackItem(pt); return; + } else if (tree.name == names.TYPE) { + // Set the annotation positions for primitive class literals + // (e.g. int.class) which have been converted to TYPE field + // access on the corresponding boxed type (e.g. Integer.TYPE). + setTypeAnnotationPositions(tree.pos); } Symbol ssym = TreeInfo.symbol(tree.selected); diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/Items.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/Items.java index 0cc968f0ff5..1c1a12c241b 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Items.java +++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Items.java @@ -792,25 +792,25 @@ public class Items { } Chain jumpTrue() { - if (tree == null) return code.mergeChains(trueJumps, code.branch(opcode)); + if (tree == null) return Code.mergeChains(trueJumps, code.branch(opcode)); // we should proceed further in -Xjcov mode only int startpc = code.curPc(); - Chain c = code.mergeChains(trueJumps, code.branch(opcode)); + Chain c = Code.mergeChains(trueJumps, code.branch(opcode)); code.crt.put(tree, CRTable.CRT_BRANCH_TRUE, startpc, code.curPc()); return c; } Chain jumpFalse() { - if (tree == null) return code.mergeChains(falseJumps, code.branch(code.negate(opcode))); + if (tree == null) return Code.mergeChains(falseJumps, code.branch(Code.negate(opcode))); // we should proceed further in -Xjcov mode only int startpc = code.curPc(); - Chain c = code.mergeChains(falseJumps, code.branch(code.negate(opcode))); + Chain c = Code.mergeChains(falseJumps, code.branch(Code.negate(opcode))); code.crt.put(tree, CRTable.CRT_BRANCH_FALSE, startpc, code.curPc()); return c; } CondItem negate() { - CondItem c = new CondItem(code.negate(opcode), falseJumps, trueJumps); + CondItem c = new CondItem(Code.negate(opcode), falseJumps, trueJumps); c.tree = tree; return c; } diff --git a/langtools/src/share/classes/com/sun/tools/javac/main/CommandLine.java b/langtools/src/share/classes/com/sun/tools/javac/main/CommandLine.java index aa2aefc914f..317094587d0 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/main/CommandLine.java +++ b/langtools/src/share/classes/com/sun/tools/javac/main/CommandLine.java @@ -82,7 +82,7 @@ public class CommandLine { st.commentChar('#'); st.quoteChar('"'); st.quoteChar('\''); - while (st.nextToken() != st.TT_EOF) { + while (st.nextToken() != StreamTokenizer.TT_EOF) { args.append(st.sval); } r.close(); diff --git a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java index d9f55c23ea9..eab009284a3 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java +++ b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java @@ -549,12 +549,6 @@ public class JavaCompiler implements ClassReader.SourceCompleter { return log.nwarnings; } - /** Whether or not any parse errors have occurred. - */ - public boolean parseErrors() { - return parseErrors; - } - /** Try to open input stream with given name. * Report an error if this fails. * @param filename The file name of the input stream to be opened. @@ -564,7 +558,7 @@ public class JavaCompiler implements ClassReader.SourceCompleter { inputFiles.add(filename); return filename.getCharContent(false); } catch (IOException e) { - log.error("error.reading.file", filename, e.getLocalizedMessage()); + log.error("error.reading.file", filename, JavacFileManager.getMessage(e)); return null; } } @@ -588,7 +582,7 @@ public class JavaCompiler implements ClassReader.SourceCompleter { int initialErrorCount = log.nerrors; Parser parser = parserFactory.newParser(content, keepComments(), genEndPos, lineDebugInfo); tree = parser.parseCompilationUnit(); - parseErrors |= (log.nerrors > initialErrorCount); + log.unrecoverableError |= (log.nerrors > initialErrorCount); if (verbose) { printVerbose("parsing.done", Long.toString(elapsed(msec))); } @@ -723,7 +717,7 @@ public class JavaCompiler implements ClassReader.SourceCompleter { try { tree = parse(filename, filename.getCharContent(false)); } catch (IOException e) { - log.error("error.reading.file", filename, e); + log.error("error.reading.file", filename, JavacFileManager.getMessage(e)); tree = make.TopLevel(List.nil(), null, List.nil()); } finally { log.useSource(prev); @@ -768,9 +762,6 @@ public class JavaCompiler implements ClassReader.SourceCompleter { private long start_msec = 0; public long elapsed_msec = 0; - /** Track whether any errors occurred while parsing source text. */ - private boolean parseErrors = false; - public void compile(List sourceFileObject) throws Throwable { compile(sourceFileObject, List.nil(), null); @@ -1114,7 +1105,7 @@ public class JavaCompiler implements ClassReader.SourceCompleter { return env; if (verboseCompilePolicy) - log.printLines(log.noticeWriter, "[attribute " + env.enclClass.sym + "]"); + Log.printLines(log.noticeWriter, "[attribute " + env.enclClass.sym + "]"); if (verbose) printVerbose("checking.attribution", env.enclClass.sym); diff --git a/langtools/src/share/classes/com/sun/tools/javac/main/JavacOption.java b/langtools/src/share/classes/com/sun/tools/javac/main/JavacOption.java index 2b8a915cf01..952ba5baf52 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/main/JavacOption.java +++ b/langtools/src/share/classes/com/sun/tools/javac/main/JavacOption.java @@ -130,7 +130,7 @@ public interface JavacOption { private static Map createChoices(String... choices) { Map map = new LinkedHashMap(); for (String c: choices) - map.put(c, true); + map.put(c, false); return map; } diff --git a/langtools/src/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java b/langtools/src/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java index acd6d99d5ff..da3f8c4df47 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java +++ b/langtools/src/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java @@ -26,6 +26,8 @@ package com.sun.tools.javac.model; import com.sun.tools.javac.util.*; +import java.io.ObjectInputStream; +import java.io.IOException; import java.lang.annotation.*; import java.lang.reflect.Array; import java.lang.reflect.Method; @@ -268,10 +270,10 @@ public class AnnotationProxyMaker { * The toString, hashCode, and equals methods foward to the underlying * type. */ - private static class MirroredTypeExceptionProxy extends ExceptionProxy { + private static final class MirroredTypeExceptionProxy extends ExceptionProxy { static final long serialVersionUID = 269; - private transient final TypeMirror type; + private transient TypeMirror type; private final String typeString; MirroredTypeExceptionProxy(TypeMirror t) { @@ -296,6 +298,13 @@ public class AnnotationProxyMaker { protected RuntimeException generateException() { return new MirroredTypeException(type); } + + // Explicitly set all transient fields. + private void readObject(ObjectInputStream s) + throws IOException, ClassNotFoundException { + s.defaultReadObject(); + type = null; + } } @@ -304,10 +313,10 @@ public class AnnotationProxyMaker { * The toString, hashCode, and equals methods foward to the underlying * types. */ - private static class MirroredTypesExceptionProxy extends ExceptionProxy { + private static final class MirroredTypesExceptionProxy extends ExceptionProxy { static final long serialVersionUID = 269; - private transient final List types; + private transient List types; private final String typeStrings; MirroredTypesExceptionProxy(List ts) { @@ -333,5 +342,12 @@ public class AnnotationProxyMaker { protected RuntimeException generateException() { return new MirroredTypesException(types); } + + // Explicitly set all transient fields. + private void readObject(ObjectInputStream s) + throws IOException, ClassNotFoundException { + s.defaultReadObject(); + types = null; + } } } diff --git a/langtools/src/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java b/langtools/src/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java new file mode 100644 index 00000000000..6202b37d3b9 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java @@ -0,0 +1,543 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.javac.nio; + + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.nio.charset.Charset; +import java.nio.file.Files; +import java.nio.file.FileSystem; +import java.nio.file.FileSystems; +import java.nio.file.FileVisitOption; +import java.nio.file.FileVisitResult; +import java.nio.file.Path; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.attribute.Attributes; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Set; +import javax.lang.model.SourceVersion; +import javax.tools.FileObject; +import javax.tools.JavaFileManager; +import javax.tools.JavaFileObject; +import javax.tools.JavaFileObject.Kind; +import javax.tools.StandardLocation; + +import static java.nio.file.FileVisitOption.*; +import static javax.tools.StandardLocation.*; + +import com.sun.tools.javac.file.Paths; +import com.sun.tools.javac.util.BaseFileManager; +import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.util.List; +import com.sun.tools.javac.util.ListBuffer; + +import static com.sun.tools.javac.main.OptionName.*; + + +// NOTE the imports carefully for this compilation unit. +// +// Path: java.nio.file.Path -- the new NIO type for which this file manager exists +// +// Paths: com.sun.tools.javac.file.Paths -- legacy javac type for handling path options +// The other Paths (java.nio.file.Paths) is not used + +// NOTE this and related classes depend on new API in JDK 7. +// This requires special handling while bootstrapping the JDK build, +// when these classes might not yet have been compiled. To workaround +// this, the build arranges to make stubs of these classes available +// when compiling this and related classes. The set of stub files +// is specified in make/build.properties. + +/** + * Implementation of PathFileManager: a JavaFileManager based on the use + * of java.nio.file.Path. + * + *

      Just as a Path is somewhat analagous to a File, so too is this + * JavacPathFileManager analogous to JavacFileManager, as it relates to the + * support of FileObjects based on File objects (i.e. just RegularFileObject, + * not ZipFileObject and its variants.) + * + *

      The default values for the standard locations supported by this file + * manager are the same as the default values provided by JavacFileManager -- + * i.e. as determined by the javac.file.Paths class. To override these values, + * call {@link #setLocation}. + * + *

      To reduce confusion with Path objects, the locations such as "class path", + * "source path", etc, are generically referred to here as "search paths". + * + *

      This is NOT part of any API supported by Sun Microsystems. If + * you write code that depends on this, you do so at your own risk. + * This code and its internal interfaces are subject to change or + * deletion without notice. + */ +public class JavacPathFileManager extends BaseFileManager implements PathFileManager { + protected FileSystem defaultFileSystem; + + /** + * Create a JavacPathFileManager using a given context, optionally registering + * it as the JavaFileManager for that context. + */ + public JavacPathFileManager(Context context, boolean register, Charset charset) { + super(charset); + if (register) + context.put(JavaFileManager.class, this); + pathsForLocation = new HashMap(); + fileSystems = new HashMap(); + setContext(context); + } + + /** + * Set the context for JavacPathFileManager. + */ + @Override + protected void setContext(Context context) { + super.setContext(context); + searchPaths = Paths.instance(context); + } + + @Override + public FileSystem getDefaultFileSystem() { + if (defaultFileSystem == null) + defaultFileSystem = FileSystems.getDefault(); + return defaultFileSystem; + } + + @Override + public void setDefaultFileSystem(FileSystem fs) { + defaultFileSystem = fs; + } + + @Override + public void flush() throws IOException { + contentCache.clear(); + } + + @Override + public void close() throws IOException { + for (FileSystem fs: fileSystems.values()) + fs.close(); + } + + @Override + public ClassLoader getClassLoader(Location location) { + nullCheck(location); + Iterable path = getLocation(location); + if (path == null) + return null; + ListBuffer lb = new ListBuffer(); + for (Path p: path) { + try { + lb.append(p.toUri().toURL()); + } catch (MalformedURLException e) { + throw new AssertionError(e); + } + } + + return getClassLoader(lb.toArray(new URL[lb.size()])); + } + + // + + public boolean hasLocation(Location location) { + return (getLocation(location) != null); + } + + public Iterable getLocation(Location location) { + nullCheck(location); + lazyInitSearchPaths(); + PathsForLocation path = pathsForLocation.get(location); + if (path == null && !pathsForLocation.containsKey(location)) { + setDefaultForLocation(location); + path = pathsForLocation.get(location); + } + return path; + } + + private Path getOutputLocation(Location location) { + Iterable paths = getLocation(location); + return (paths == null ? null : paths.iterator().next()); + } + + public void setLocation(Location location, Iterable searchPath) + throws IOException + { + nullCheck(location); + lazyInitSearchPaths(); + if (searchPath == null) { + setDefaultForLocation(location); + } else { + if (location.isOutputLocation()) + checkOutputPath(searchPath); + PathsForLocation pl = new PathsForLocation(); + for (Path p: searchPath) + pl.add(p); // TODO -Xlint:path warn if path not found + pathsForLocation.put(location, pl); + } + } + + private void checkOutputPath(Iterable searchPath) throws IOException { + Iterator pathIter = searchPath.iterator(); + if (!pathIter.hasNext()) + throw new IllegalArgumentException("empty path for directory"); + Path path = pathIter.next(); + if (pathIter.hasNext()) + throw new IllegalArgumentException("path too long for directory"); + if (!path.exists()) + throw new FileNotFoundException(path + ": does not exist"); + else if (!isDirectory(path)) + throw new IOException(path + ": not a directory"); + } + + private void setDefaultForLocation(Location locn) { + Collection files = null; + if (locn instanceof StandardLocation) { + switch ((StandardLocation) locn) { + case CLASS_PATH: + files = searchPaths.userClassPath(); + break; + case PLATFORM_CLASS_PATH: + files = searchPaths.bootClassPath(); + break; + case SOURCE_PATH: + files = searchPaths.sourcePath(); + break; + case CLASS_OUTPUT: { + String arg = options.get(D); + files = (arg == null ? null : Collections.singleton(new File(arg))); + break; + } + case SOURCE_OUTPUT: { + String arg = options.get(S); + files = (arg == null ? null : Collections.singleton(new File(arg))); + break; + } + } + } + + PathsForLocation pl = new PathsForLocation(); + if (files != null) { + for (File f: files) + pl.add(f.toPath()); + } + pathsForLocation.put(locn, pl); + } + + private void lazyInitSearchPaths() { + if (!inited) { + setDefaultForLocation(PLATFORM_CLASS_PATH); + setDefaultForLocation(CLASS_PATH); + setDefaultForLocation(SOURCE_PATH); + inited = true; + } + } + // where + private boolean inited = false; + + private Map pathsForLocation; + private Paths searchPaths; + + private static class PathsForLocation extends LinkedHashSet { + private static final long serialVersionUID = 6788510222394486733L; + } + + // + + // + + @Override + public Path getPath(FileObject fo) { + nullCheck(fo); + if (!(fo instanceof PathFileObject)) + throw new IllegalArgumentException(); + return ((PathFileObject) fo).getPath(); + } + + @Override + public boolean isSameFile(FileObject a, FileObject b) { + nullCheck(a); + nullCheck(b); + if (!(a instanceof PathFileObject)) + throw new IllegalArgumentException("Not supported: " + a); + if (!(b instanceof PathFileObject)) + throw new IllegalArgumentException("Not supported: " + b); + return ((PathFileObject) a).isSameFile((PathFileObject) b); + } + + @Override + public Iterable list(Location location, + String packageName, Set kinds, boolean recurse) + throws IOException { + // validatePackageName(packageName); + nullCheck(packageName); + nullCheck(kinds); + + Iterable paths = getLocation(location); + if (paths == null) + return List.nil(); + ListBuffer results = new ListBuffer(); + + for (Path path : paths) + list(path, packageName, kinds, recurse, results); + + return results.toList(); + } + + private void list(Path path, String packageName, final Set kinds, + boolean recurse, final ListBuffer results) + throws IOException { + if (!path.exists()) + return; + + final Path pathDir; + if (isDirectory(path)) + pathDir = path; + else { + FileSystem fs = getFileSystem(path); + if (fs == null) + return; + pathDir = fs.getRootDirectories().iterator().next(); + } + String sep = path.getFileSystem().getSeparator(); + Path packageDir = packageName.isEmpty() ? pathDir + : pathDir.resolve(packageName.replace(".", sep)); + if (!packageDir.exists()) + return; + +/* Alternate impl of list, superceded by use of Files.walkFileTree */ +// Deque queue = new LinkedList(); +// queue.add(packageDir); +// +// Path dir; +// while ((dir = queue.poll()) != null) { +// DirectoryStream ds = dir.newDirectoryStream(); +// try { +// for (Path p: ds) { +// String name = p.getName().toString(); +// if (isDirectory(p)) { +// if (recurse && SourceVersion.isIdentifier(name)) { +// queue.add(p); +// } +// } else { +// if (kinds.contains(getKind(name))) { +// JavaFileObject fe = +// PathFileObject.createDirectoryPathFileObject(this, p, pathDir); +// results.append(fe); +// } +// } +// } +// } finally { +// ds.close(); +// } +// } + int maxDepth = (recurse ? Integer.MAX_VALUE : 1); + Set opts = EnumSet.of(DETECT_CYCLES, FOLLOW_LINKS); + Files.walkFileTree(packageDir, opts, maxDepth, + new SimpleFileVisitor() { + @Override + public FileVisitResult preVisitDirectory(Path dir) { + if (SourceVersion.isIdentifier(dir.getName().toString())) // JSR 292? + return FileVisitResult.CONTINUE; + else + return FileVisitResult.SKIP_SUBTREE; + } + + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { + if (attrs.isRegularFile() && kinds.contains(getKind(file.getName().toString()))) { + JavaFileObject fe = + PathFileObject.createDirectoryPathFileObject( + JavacPathFileManager.this, file, pathDir); + results.append(fe); + } + return FileVisitResult.CONTINUE; + } + }); + } + + @Override + public Iterable getJavaFileObjectsFromPaths( + Iterable paths) { + ArrayList result; + if (paths instanceof Collection) + result = new ArrayList(((Collection)paths).size()); + else + result = new ArrayList(); + for (Path p: paths) + result.add(PathFileObject.createSimplePathFileObject(this, nullCheck(p))); + return result; + } + + @Override + public Iterable getJavaFileObjects(Path... paths) { + return getJavaFileObjectsFromPaths(Arrays.asList(nullCheck(paths))); + } + + @Override + public JavaFileObject getJavaFileForInput(Location location, + String className, Kind kind) throws IOException { + return getFileForInput(location, getRelativePath(className, kind)); + } + + @Override + public FileObject getFileForInput(Location location, + String packageName, String relativeName) throws IOException { + return getFileForInput(location, getRelativePath(packageName, relativeName)); + } + + private JavaFileObject getFileForInput(Location location, String relativePath) + throws IOException { + for (Path p: getLocation(location)) { + if (isDirectory(p)) { + Path f = resolve(p, relativePath); + if (f.exists()) + return PathFileObject.createDirectoryPathFileObject(this, f, p); + } else { + FileSystem fs = getFileSystem(p); + if (fs != null) { + Path file = getPath(fs, relativePath); + if (file.exists()) + return PathFileObject.createJarPathFileObject(this, file); + } + } + } + return null; + } + + @Override + public JavaFileObject getJavaFileForOutput(Location location, + String className, Kind kind, FileObject sibling) throws IOException { + return getFileForOutput(location, getRelativePath(className, kind), sibling); + } + + @Override + public FileObject getFileForOutput(Location location, String packageName, + String relativeName, FileObject sibling) + throws IOException { + return getFileForOutput(location, getRelativePath(packageName, relativeName), sibling); + } + + private JavaFileObject getFileForOutput(Location location, + String relativePath, FileObject sibling) { + Path dir = getOutputLocation(location); + if (dir == null) { + if (location == CLASS_OUTPUT) { + Path siblingDir = null; + if (sibling != null && sibling instanceof PathFileObject) { + siblingDir = ((PathFileObject) sibling).getPath().getParent(); + } + return PathFileObject.createSiblingPathFileObject(this, + siblingDir.resolve(getBaseName(relativePath)), + relativePath); + } else if (location == SOURCE_OUTPUT) { + dir = getOutputLocation(CLASS_OUTPUT); + } + } + + Path file; + if (dir != null) { + file = resolve(dir, relativePath); + return PathFileObject.createDirectoryPathFileObject(this, file, dir); + } else { + file = getPath(getDefaultFileSystem(), relativePath); + return PathFileObject.createSimplePathFileObject(this, file); + } + + } + + @Override + public String inferBinaryName(Location location, JavaFileObject fo) { + nullCheck(fo); + // Need to match the path semantics of list(location, ...) + Iterable paths = getLocation(location); + if (paths == null) { + return null; + } + + if (!(fo instanceof PathFileObject)) + throw new IllegalArgumentException(fo.getClass().getName()); + + return ((PathFileObject) fo).inferBinaryName(paths); + } + + private FileSystem getFileSystem(Path p) throws IOException { + FileSystem fs = fileSystems.get(p); + if (fs == null) { + fs = FileSystems.newFileSystem(p, Collections.emptyMap(), null); + fileSystems.put(p, fs); + } + return fs; + } + + private Map fileSystems; + + // + + // + + private static String getRelativePath(String className, Kind kind) { + return className.replace(".", "/") + kind.extension; + } + + private static String getRelativePath(String packageName, String relativeName) { + return packageName.replace(".", "/") + relativeName; + } + + private static String getBaseName(String relativePath) { + int lastSep = relativePath.lastIndexOf("/"); + return relativePath.substring(lastSep + 1); // safe if "/" not found + } + + private static boolean isDirectory(Path path) throws IOException { + BasicFileAttributes attrs = Attributes.readBasicFileAttributes(path); + return attrs.isDirectory(); + } + + private static Path getPath(FileSystem fs, String relativePath) { + return fs.getPath(relativePath.replace("/", fs.getSeparator())); + } + + private static Path resolve(Path base, String relativePath) { + FileSystem fs = base.getFileSystem(); + Path rp = fs.getPath(relativePath.replace("/", fs.getSeparator())); + return base.resolve(rp); + } + + // + +} diff --git a/langtools/src/share/classes/com/sun/tools/javac/nio/PathFileManager.java b/langtools/src/share/classes/com/sun/tools/javac/nio/PathFileManager.java new file mode 100644 index 00000000000..0b55e6859ba --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/javac/nio/PathFileManager.java @@ -0,0 +1,125 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.javac.nio; + +import java.io.IOException; +import java.nio.file.FileSystem; +import java.nio.file.Path; +import javax.tools.FileObject; +import javax.tools.JavaFileManager; +import javax.tools.JavaFileObject; + +/** + * File manager based on {@linkplain File java.nio.file.Path}. + * + * Eventually, this should be moved to javax.tools. + * Also, JavaCompiler might reasonably provide a method getPathFileManager, + * similar to {@link javax.tools.JavaCompiler#getStandardFileManager + * getStandardFileManager}. However, would need to be handled carefully + * as another forward reference from langtools to jdk. + * + *

      This is NOT part of any API supported by Sun Microsystems. If + * you write code that depends on this, you do so at your own risk. + * This code and its internal interfaces are subject to change or + * deletion without notice. + */ +public interface PathFileManager extends JavaFileManager { + /** + * Get the default file system used to create paths. If no value has been + * set, the default file system is {@link FileSystems#getDefault}. + */ + FileSystem getDefaultFileSystem(); + + /** + * Set the default file system used to create paths. + * @param fs the default file system used to create any new paths. + */ + void setDefaultFileSystem(FileSystem fs); + + /** + * Get file objects representing the given files. + * + * @param paths a list of paths + * @return a list of file objects + * @throws IllegalArgumentException if the list of paths includes + * a directory + */ + Iterable getJavaFileObjectsFromPaths( + Iterable paths); + + /** + * Get file objects representing the given paths. + * Convenience method equivalent to: + * + *

      +     *     getJavaFileObjectsFromPaths({@linkplain java.util.Arrays#asList Arrays.asList}(paths))
      +     * 
      + * + * @param paths an array of paths + * @return a list of file objects + * @throws IllegalArgumentException if the array of files includes + * a directory + * @throws NullPointerException if the given array contains null + * elements + */ + Iterable getJavaFileObjects(Path... paths); + + /** + * Return the Path for a file object that has been obtained from this + * file manager. + * + * @param fo A file object that has been obtained from this file manager. + * @return The underlying Path object. + * @throws IllegalArgumentException is the file object was not obtained from + * from this file manager. + */ + Path getPath(FileObject fo); + + /** + * Get the search path associated with the given location. + * + * @param location a location + * @return a list of paths or {@code null} if this location has no + * associated search path + * @see #setLocation + */ + Iterable getLocation(Location location); + + /** + * Associate the given search path with the given location. Any + * previous value will be discarded. + * + * @param location a location + * @param searchPath a list of files, if {@code null} use the default + * search path for this location + * @see #getLocation + * @throws IllegalArgumentException if location is an output + * location and searchpath does not contain exactly one element + * @throws IOException if location is an output location and searchpath + * does not represent an existing directory + */ + void setLocation(Location location, Iterable searchPath) throws IOException; +} diff --git a/langtools/src/share/classes/com/sun/tools/javac/nio/PathFileObject.java b/langtools/src/share/classes/com/sun/tools/javac/nio/PathFileObject.java new file mode 100644 index 00000000000..dc22ff3d978 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/javac/nio/PathFileObject.java @@ -0,0 +1,319 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.javac.nio; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Reader; +import java.io.Writer; +import java.net.URI; +import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.charset.CharsetDecoder; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.attribute.Attributes; +import java.nio.file.attribute.BasicFileAttributes; +import javax.lang.model.element.Modifier; +import javax.lang.model.element.NestingKind; +import javax.tools.JavaFileObject; + +import com.sun.tools.javac.util.BaseFileManager; + + +/** + * Implementation of JavaFileObject using java.nio.file API. + * + *

      PathFileObjects are, for the most part, straightforward wrappers around + * Path objects. The primary complexity is the support for "inferBinaryName". + * This is left as an abstract method, implemented by each of a number of + * different factory methods, which compute the binary name based on + * information available at the time the file object is created. + * + *

      This is NOT part of any API supported by Sun Microsystems. If + * you write code that depends on this, you do so at your own risk. + * This code and its internal interfaces are subject to change or + * deletion without notice. + */ +abstract class PathFileObject implements JavaFileObject { + private JavacPathFileManager fileManager; + private Path path; + + /** + * Create a PathFileObject within a directory, such that the binary name + * can be inferred from the relationship to the parent directory. + */ + static PathFileObject createDirectoryPathFileObject(JavacPathFileManager fileManager, + final Path path, final Path dir) { + return new PathFileObject(fileManager, path) { + @Override + String inferBinaryName(Iterable paths) { + return toBinaryName(dir.relativize(path)); + } + }; + } + + /** + * Create a PathFileObject in a file system such as a jar file, such that + * the binary name can be inferred from its position within the filesystem. + */ + static PathFileObject createJarPathFileObject(JavacPathFileManager fileManager, + final Path path) { + return new PathFileObject(fileManager, path) { + @Override + String inferBinaryName(Iterable paths) { + return toBinaryName(path); + } + }; + } + + /** + * Create a PathFileObject whose binary name can be inferred from the + * relative path to a sibling. + */ + static PathFileObject createSiblingPathFileObject(JavacPathFileManager fileManager, + final Path path, final String relativePath) { + return new PathFileObject(fileManager, path) { + @Override + String inferBinaryName(Iterable paths) { + return toBinaryName(relativePath, "/"); + } + }; + } + + /** + * Create a PathFileObject whose binary name might be inferred from its + * position on a search path. + */ + static PathFileObject createSimplePathFileObject(JavacPathFileManager fileManager, + final Path path) { + return new PathFileObject(fileManager, path) { + @Override + String inferBinaryName(Iterable paths) { + Path absPath = path.toAbsolutePath(); + for (Path p: paths) { + Path ap = p.toAbsolutePath(); + if (absPath.startsWith(ap)) { + try { + Path rp = ap.relativize(absPath); + if (rp != null) // maybe null if absPath same as ap + return toBinaryName(rp); + } catch (IllegalArgumentException e) { + // ignore this p if cannot relativize path to p + } + } + } + return null; + } + }; + } + + protected PathFileObject(JavacPathFileManager fileManager, Path path) { + fileManager.getClass(); // null check + path.getClass(); // null check + this.fileManager = fileManager; + this.path = path; + } + + abstract String inferBinaryName(Iterable paths); + + /** + * Return the Path for this object. + * @return the Path for this object. + */ + Path getPath() { + return path; + } + + @Override + public Kind getKind() { + return BaseFileManager.getKind(path.getName().toString()); + } + + @Override + public boolean isNameCompatible(String simpleName, Kind kind) { + simpleName.getClass(); + // null check + if (kind == Kind.OTHER && getKind() != kind) { + return false; + } + String sn = simpleName + kind.extension; + String pn = path.getName().toString(); + if (pn.equals(sn)) { + return true; + } + if (pn.equalsIgnoreCase(sn)) { + try { + // allow for Windows + return path.toRealPath(false).getName().toString().equals(sn); + } catch (IOException e) { + } + } + return false; + } + + @Override + public NestingKind getNestingKind() { + return null; + } + + @Override + public Modifier getAccessLevel() { + return null; + } + + @Override + public URI toUri() { + return path.toUri(); + } + + @Override + public String getName() { + return path.toString(); + } + + @Override + public InputStream openInputStream() throws IOException { + return path.newInputStream(); + } + + @Override + public OutputStream openOutputStream() throws IOException { + ensureParentDirectoriesExist(); + return path.newOutputStream(); + } + + @Override + public Reader openReader(boolean ignoreEncodingErrors) throws IOException { + CharsetDecoder decoder = fileManager.getDecoder(fileManager.getEncodingName(), ignoreEncodingErrors); + return new InputStreamReader(openInputStream(), decoder); + } + + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException { + CharBuffer cb = fileManager.getCachedContent(this); + if (cb == null) { + InputStream in = openInputStream(); + try { + ByteBuffer bb = fileManager.makeByteBuffer(in); + JavaFileObject prev = fileManager.log.useSource(this); + try { + cb = fileManager.decode(bb, ignoreEncodingErrors); + } finally { + fileManager.log.useSource(prev); + } + fileManager.recycleByteBuffer(bb); + if (!ignoreEncodingErrors) { + fileManager.cache(this, cb); + } + } finally { + in.close(); + } + } + return cb; + } + + @Override + public Writer openWriter() throws IOException { + ensureParentDirectoriesExist(); + return new OutputStreamWriter(path.newOutputStream(), fileManager.getEncodingName()); + } + + @Override + public long getLastModified() { + try { + BasicFileAttributes attrs = Attributes.readBasicFileAttributes(path); + return attrs.lastModifiedTime().toMillis(); + } catch (IOException e) { + return -1; + } + } + + @Override + public boolean delete() { + try { + path.delete(); + return true; + } catch (IOException e) { + return false; + } + } + + public boolean isSameFile(PathFileObject other) { + try { + return path.isSameFile(other.path); + } catch (IOException e) { + return false; + } + } + + @Override + public boolean equals(Object other) { + return (other instanceof PathFileObject && path.equals(((PathFileObject) other).path)); + } + + @Override + public int hashCode() { + return path.hashCode(); + } + + @Override + public String toString() { + return getClass().getSimpleName() + "[" + path + "]"; + } + + private void ensureParentDirectoriesExist() throws IOException { + Path parent = path.getParent(); + if (parent != null) + Files.createDirectories(parent); + } + + private long size() { + try { + BasicFileAttributes attrs = Attributes.readBasicFileAttributes(path); + return attrs.size(); + } catch (IOException e) { + return -1; + } + } + + protected static String toBinaryName(Path relativePath) { + return toBinaryName(relativePath.toString(), + relativePath.getFileSystem().getSeparator()); + } + + protected static String toBinaryName(String relativePath, String sep) { + return removeExtension(relativePath).replace(sep, "."); + } + + protected static String removeExtension(String fileName) { + int lastDot = fileName.lastIndexOf("."); + return (lastDot == -1 ? fileName : fileName.substring(0, lastDot)); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java b/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java index c84f2097c45..3816c93e176 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java +++ b/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java @@ -761,23 +761,28 @@ public class JavacParser implements Parser { JCExpression[] odStack = newOdStack(); List savedOp = opStackSupply.elems; Token[] opStack = newOpStack(); + List savedPos = posStackSupply.elems; + int[] posStack = newPosStack(); // optimization, was odStack = new Tree[...]; opStack = new Tree[...]; int top = 0; odStack[0] = t; int startPos = S.pos(); Token topOp = ERROR; + int topOpPos = Position.NOPOS; while (prec(S.token()) >= minprec) { + posStack[top] = topOpPos; opStack[top] = topOp; top++; topOp = S.token(); - int pos = S.pos(); + topOpPos = S.pos(); S.nextToken(); - odStack[top] = topOp == INSTANCEOF ? parseType() : term3(); + odStack[top] = (topOp == INSTANCEOF) ? parseType() : term3(); while (top > 0 && prec(topOp) >= prec(S.token())) { - odStack[top-1] = makeOp(pos, topOp, odStack[top-1], + odStack[top-1] = makeOp(topOpPos, topOp, odStack[top-1], odStack[top]); top--; topOp = opStack[top]; + topOpPos = posStack[top]; } } assert top == 0; @@ -792,6 +797,7 @@ public class JavacParser implements Parser { odStackSupply.elems = savedOd; // optimization opStackSupply.elems = savedOp; // optimization + posStackSupply.elems = savedPos; // optimization return t; } //where @@ -845,6 +851,7 @@ public class JavacParser implements Parser { */ ListBuffer odStackSupply = new ListBuffer(); ListBuffer opStackSupply = new ListBuffer(); + ListBuffer posStackSupply = new ListBuffer(); private JCExpression[] newOdStack() { if (odStackSupply.elems == odStackSupply.last) @@ -862,6 +869,14 @@ public class JavacParser implements Parser { return opStack; } + private int[] newPosStack() { + if (posStackSupply.elems == posStackSupply.last) + posStackSupply.append(new int[infixPrecedenceLevels + 1]); + int[] posStack = posStackSupply.elems.head; + posStackSupply.elems = posStackSupply.elems.tail; + return posStack; + } + /** Expression3 = PrefixOp Expression3 * | "(" Expr | TypeNoParams ")" Expression3 * | Primary {Selector} {PostfixOp} @@ -939,7 +954,7 @@ public class JavacParser implements Parser { args.append(typeArgument()); } accept(GT); - t = F.at(pos1).TypeApply(t, args.toList()); + t = toP(F.at(pos1).TypeApply(t, args.toList())); checkGenerics(); while (S.token() == DOT) { S.nextToken(); @@ -950,7 +965,8 @@ public class JavacParser implements Parser { t = bracketsOpt(toP(t)); } else if ((mode & EXPR) != 0) { mode = EXPR; - t = F.at(pos1).Binary(op, t, term2Rest(t1, TreeInfo.shiftPrec)); + JCExpression e = term2Rest(t1, TreeInfo.shiftPrec); + t = F.at(pos1).Binary(op, t, e); t = termRest(term1Rest(term2Rest(t, TreeInfo.orPrec))); } else { accept(GT); @@ -998,7 +1014,8 @@ public class JavacParser implements Parser { case SUPER: if ((mode & EXPR) != 0) { mode = EXPR; - t = to(superSuffix(typeArgs, F.at(pos).Ident(names._super))); + t = to(F.at(pos).Ident(names._super)); + t = superSuffix(typeArgs, t); typeArgs = null; } else return illegal(); break; @@ -1380,13 +1397,15 @@ public class JavacParser implements Parser { S.nextToken(); JCExpression result; if (S.token() == EXTENDS) { - TypeBoundKind t = to(F.at(S.pos()).TypeBoundKind(BoundKind.EXTENDS)); + TypeBoundKind t = to(F.at(pos).TypeBoundKind(BoundKind.EXTENDS)); S.nextToken(); - result = F.at(pos).Wildcard(t, parseType()); + JCExpression bound = parseType(); + result = F.at(pos).Wildcard(t, bound); } else if (S.token() == SUPER) { - TypeBoundKind t = to(F.at(S.pos()).TypeBoundKind(BoundKind.SUPER)); + TypeBoundKind t = to(F.at(pos).TypeBoundKind(BoundKind.SUPER)); S.nextToken(); - result = F.at(pos).Wildcard(t, parseType()); + JCExpression bound = parseType(); + result = F.at(pos).Wildcard(t, bound); } else if (S.token() == IDENTIFIER) { //error recovery reportSyntaxError(S.prevEndPos(), "expected3", @@ -1396,7 +1415,7 @@ public class JavacParser implements Parser { JCIdent id = toP(F.at(S.pos()).Ident(ident())); result = F.at(pos).Erroneous(List.of(wc, id)); } else { - TypeBoundKind t = F.at(Position.NOPOS).TypeBoundKind(BoundKind.UNBOUND); + TypeBoundKind t = toP(F.at(pos).TypeBoundKind(BoundKind.UNBOUND)); result = toP(F.at(pos).Wildcard(t, null)); } if (!annotations.isEmpty()) @@ -1542,7 +1561,10 @@ public class JavacParser implements Parser { JCNewClass newClass = classCreatorRest(newpos, null, typeArgs, t); if (newClass.def != null) { assert newClass.def.mods.annotations.isEmpty(); - newClass.def.mods.annotations = List.convert(JCAnnotation.class, newAnnotations); + if (newAnnotations.nonEmpty()) { + newClass.def.mods.pos = earlier(newClass.def.mods.pos, newAnnotations.head.pos); + newClass.def.mods.annotations = List.convert(JCAnnotation.class, newAnnotations); + } } return newClass; } else { @@ -2117,14 +2139,21 @@ public class JavacParser implements Parser { return modifiersOpt(null); } JCModifiers modifiersOpt(JCModifiers partial) { - long flags = (partial == null) ? 0 : partial.flags; + long flags; + ListBuffer annotations = new ListBuffer(); + int pos; + if (partial == null) { + flags = 0; + pos = S.pos(); + } else { + flags = partial.flags; + annotations.appendList(partial.annotations); + pos = partial.pos; + } if (S.deprecatedFlag()) { flags |= Flags.DEPRECATED; S.resetDeprecatedFlag(); } - ListBuffer annotations = new ListBuffer(); - if (partial != null) annotations.appendList(partial.annotations); - int pos = S.pos(); int lastPos = Position.NOPOS; loop: while (true) { @@ -2150,12 +2179,12 @@ public class JavacParser implements Parser { if (flag == Flags.ANNOTATION) { checkAnnotations(); if (S.token() != INTERFACE) { - JCAnnotation ann = annotation(lastPos, AnnotationKind.DEFAULT_ANNO); - // if first modifier is an annotation, set pos to annotation's. - if (flags == 0 && annotations.isEmpty()) - pos = ann.pos; - annotations.append(ann); - lastPos = ann.pos; + JCAnnotation ann = annotation(lastPos, AnnotationKind.DEFAULT_ANNO); + // if first modifier is an annotation, set pos to annotation's. + if (flags == 0 && annotations.isEmpty()) + pos = ann.pos; + annotations.append(ann); + lastPos = ann.pos; flag = 0; } } @@ -2169,7 +2198,7 @@ public class JavacParser implements Parser { /* A modifiers tree with no modifier tokens or annotations * has no text position. */ - if (flags == 0 && annotations.isEmpty()) + if ((flags & Flags.ModifierFlags) == 0 && annotations.isEmpty()) pos = Position.NOPOS; JCModifiers mods = F.at(pos).Modifiers(flags, annotations.toList()); @@ -2226,7 +2255,8 @@ public class JavacParser implements Parser { if (t1.getTag() == JCTree.IDENT && S.token() == EQ) { int pos = S.pos(); accept(EQ); - return toP(F.at(pos).Assign(t1, annotationValue())); + JCExpression v = annotationValue(); + return toP(F.at(pos).Assign(t1, v)); } else { return t1; } @@ -2543,10 +2573,9 @@ public class JavacParser implements Parser { } List defs = enumBody(name); - JCModifiers newMods = - F.at(mods.pos).Modifiers(mods.flags|Flags.ENUM, mods.annotations); + mods.flags |= Flags.ENUM; JCClassDecl result = toP(F.at(pos). - ClassDef(newMods, name, List.nil(), + ClassDef(mods, name, List.nil(), null, implementing, defs)); attach(result, dc); return result; @@ -2613,12 +2642,12 @@ public class JavacParser implements Parser { body = toP(F.at(identPos).AnonymousClassDef(mods1, defs)); } if (args.isEmpty() && body == null) - createPos = Position.NOPOS; - JCIdent ident = F.at(Position.NOPOS).Ident(enumName); + createPos = identPos; + JCIdent ident = F.at(identPos).Ident(enumName); JCNewClass create = F.at(createPos).NewClass(null, typeArgs, ident, args, body); - if (createPos != Position.NOPOS) + if (createPos != identPos) storeEnd(create, S.prevEndPos()); - ident = F.at(Position.NOPOS).Ident(enumName); + ident = F.at(identPos).Ident(enumName); JCTree result = toP(F.at(pos).VarDef(mods, name, ident, create)); attach(result, dc); return result; @@ -2695,16 +2724,8 @@ public class JavacParser implements Parser { } else { pos = S.pos(); List typarams = typeParametersOpt(); - // Hack alert: if there are type arguments but no Modifiers, the start - // position will be lost unless we set the Modifiers position. There - // should be an AST node for type parameters (BugId 5005090). - if (typarams.length() > 0 && mods.pos == Position.NOPOS) { - mods.pos = pos; - } - List annosAfterParams = annotationsOpt(AnnotationKind.DEFAULT_ANNO); - Token token = S.token(); Name name = S.name(); pos = S.pos(); JCExpression type; @@ -2715,7 +2736,11 @@ public class JavacParser implements Parser { type = to(F.at(pos).TypeIdent(TypeTags.VOID)); S.nextToken(); } else { - mods.annotations = mods.annotations.appendList(annosAfterParams); + if (annosAfterParams.nonEmpty()) { + mods.annotations = mods.annotations.appendList(annosAfterParams); + if (mods.pos == Position.NOPOS) + mods.pos = mods.annotations.head.pos; + } // method returns types are un-annotated types type = unannotatedType(); } @@ -2813,6 +2838,7 @@ public class JavacParser implements Parser { } } } + JCMethodDecl result = toP(F.at(pos).MethodDef(mods, name, type, typarams, params, receiverAnnotations, thrown, @@ -2993,6 +3019,18 @@ public class JavacParser implements Parser { return (oc >= 0) ? TreeInfo.opPrec(oc) : -1; } + /** + * Return the lesser of two positions, making allowance for either one + * being unset. + */ + static int earlier(int pos1, int pos2) { + if (pos1 == Position.NOPOS) + return pos2; + if (pos2 == Position.NOPOS) + return pos1; + return (pos1 < pos2 ? pos1 : pos2); + } + /** Return operation tag of binary operator represented by token, * -1 if token is not a binary operator. */ diff --git a/langtools/src/share/classes/com/sun/tools/javac/parser/Keywords.java b/langtools/src/share/classes/com/sun/tools/javac/parser/Keywords.java index bec19a72ec1..c9922e46486 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/parser/Keywords.java +++ b/langtools/src/share/classes/com/sun/tools/javac/parser/Keywords.java @@ -51,12 +51,10 @@ public class Keywords { return instance; } - private final Log log; private final Names names; protected Keywords(Context context) { context.put(keywordsKey, this); - log = Log.instance(context); names = Names.instance(context); for (Token t : Token.values()) { diff --git a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java index cb5ca870947..938b3e60b25 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java +++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java @@ -25,7 +25,6 @@ package com.sun.tools.javac.processing; - import java.lang.reflect.*; import java.util.*; import java.util.regex.*; @@ -67,6 +66,7 @@ import com.sun.tools.javac.tree.*; import com.sun.tools.javac.tree.JCTree.*; import com.sun.tools.javac.util.Abort; import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.util.Convert; import com.sun.tools.javac.util.List; import com.sun.tools.javac.util.ListBuffer; import com.sun.tools.javac.util.Log; @@ -690,10 +690,12 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea ProcessorState ps = psi.next(); Set matchedNames = new HashSet(); Set typeElements = new LinkedHashSet(); - for (String unmatchedAnnotationName : unmatchedAnnotations.keySet()) { + + for (Map.Entry entry: unmatchedAnnotations.entrySet()) { + String unmatchedAnnotationName = entry.getKey(); if (ps.annotationSupported(unmatchedAnnotationName) ) { matchedNames.add(unmatchedAnnotationName); - TypeElement te = unmatchedAnnotations.get(unmatchedAnnotationName); + TypeElement te = entry.getValue(); if (te != null) typeElements.add(te); } @@ -790,16 +792,13 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea List roots, List classSymbols, Iterable pckSymbols) - throws IOException { + throws IOException { log = Log.instance(context); // Writer for -XprintRounds and -XprintProcessorInfo data PrintWriter xout = context.get(Log.outKey); TaskListener taskListener = context.get(TaskListener.class); - - AnnotationCollector collector = new AnnotationCollector(); - JavaCompiler compiler = JavaCompiler.instance(context); compiler.todo.clear(); // free the compiler's resources @@ -873,34 +872,29 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea JavaFileManager fileManager = currentContext.get(JavaFileManager.class); - List fileObjects = List.nil(); - for (JavaFileObject jfo : filer.getGeneratedSourceFileObjects() ) { - fileObjects = fileObjects.prepend(jfo); - } - - compiler = JavaCompiler.instance(currentContext); - List parsedFiles = compiler.parseFiles(fileObjects); - roots = cleanTrees(roots).reverse(); - - - for (JCCompilationUnit unit : parsedFiles) - roots = roots.prepend(unit); - roots = roots.reverse(); + List parsedFiles = sourcesToParsedFiles(compiler); + roots = cleanTrees(roots).appendList(parsedFiles); // Check for errors after parsing - if (compiler.parseErrors()) { + if (log.unrecoverableError) { errorStatus = true; break runAround; } else { - ListBuffer classes = enterNewClassFiles(currentContext); + List newClasses = enterNewClassFiles(currentContext); compiler.enterTrees(roots); // annotationsPresentInSource = // collector.findAnnotations(parsedFiles); - classes.appendList(getTopLevelClasses(parsedFiles)); - topLevelClasses = classes.toList(); - packageInfoFiles = getPackageInfoFiles(parsedFiles); + ListBuffer tlc = new ListBuffer(); + tlc.appendList(getTopLevelClasses(parsedFiles)); + tlc.appendList(getTopLevelClassesFromClasses(newClasses)); + topLevelClasses = tlc.toList(); + + ListBuffer pif = new ListBuffer(); + pif.appendList(getPackageInfoFiles(parsedFiles)); + pif.appendList(getPackageInfoFilesFromClasses(newClasses)); + packageInfoFiles = pif.toList(); annotationsPresent = new LinkedHashSet(); for (ClassSymbol classSym : topLevelClasses) @@ -914,11 +908,16 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea break runAround; // No new files } } - runLastRound(xout, roundNumber, errorStatus, taskListener); + roots = runLastRound(xout, roundNumber, errorStatus, compiler, roots, taskListener); + // Set error status for any files compiled and generated in + // the last round + if (log.unrecoverableError) + errorStatus = true; compiler.close(false); currentContext = contextForNextRound(currentContext, true); compiler = JavaCompiler.instance(currentContext); + filer.newRound(currentContext, true); filer.warnIfUnclosedFiles(); warnIfUnmatchedOptions(); @@ -972,10 +971,22 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea return compiler; } + private List sourcesToParsedFiles(JavaCompiler compiler) + throws IOException { + List fileObjects = List.nil(); + for (JavaFileObject jfo : filer.getGeneratedSourceFileObjects() ) { + fileObjects = fileObjects.prepend(jfo); + } + + return compiler.parseFiles(fileObjects); + } + // Call the last round of annotation processing - private void runLastRound(PrintWriter xout, - int roundNumber, - boolean errorStatus, + private List runLastRound(PrintWriter xout, + int roundNumber, + boolean errorStatus, + JavaCompiler compiler, + List roots, TaskListener taskListener) throws IOException { roundNumber++; List noTopLevelClasses = List.nil(); @@ -996,6 +1007,15 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea if (taskListener != null) taskListener.finished(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING_ROUND)); } + + // Add any sources generated during the last round to the set + // of files to be compiled. + if (moreToDo()) { + List parsedFiles = sourcesToParsedFiles(compiler); + roots = cleanTrees(roots).appendList(parsedFiles); + } + + return roots; } private void updateProcessingState(Context currentContext, boolean lastRound) { @@ -1026,20 +1046,30 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea } } - private ListBuffer enterNewClassFiles(Context currentContext) { + private List enterNewClassFiles(Context currentContext) { ClassReader reader = ClassReader.instance(currentContext); Names names = Names.instance(currentContext); - ListBuffer list = new ListBuffer(); + List list = List.nil(); for (Map.Entry entry : filer.getGeneratedClasses().entrySet()) { Name name = names.fromString(entry.getKey()); JavaFileObject file = entry.getValue(); if (file.getKind() != JavaFileObject.Kind.CLASS) throw new AssertionError(file); - ClassSymbol cs = reader.enterClass(name, file); - list.append(cs); + ClassSymbol cs; + if (isPkgInfo(file, JavaFileObject.Kind.CLASS)) { + Name packageName = Convert.packagePart(name); + PackageSymbol p = reader.enterPackage(packageName); + if (p.package_info == null) + p.package_info = reader.enterClass(Convert.shortName(name), p); + cs = p.package_info; + if (cs.classfile == null) + cs.classfile = file; + } else + cs = reader.enterClass(name, file); + list = list.prepend(cs); } - return list; + return list.reverse(); } /** @@ -1066,18 +1096,44 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea return classes.reverse(); } + private List getTopLevelClassesFromClasses(List syms) { + List classes = List.nil(); + for (ClassSymbol sym : syms) { + if (!isPkgInfo(sym)) { + classes = classes.prepend(sym); + } + } + return classes.reverse(); + } + private List getPackageInfoFiles(List units) { List packages = List.nil(); for (JCCompilationUnit unit : units) { - boolean isPkgInfo = unit.sourcefile.isNameCompatible("package-info", - JavaFileObject.Kind.SOURCE); - if (isPkgInfo) { + if (isPkgInfo(unit.sourcefile, JavaFileObject.Kind.SOURCE)) { packages = packages.prepend(unit.packge); } } return packages.reverse(); } + private List getPackageInfoFilesFromClasses(List syms) { + List packages = List.nil(); + for (ClassSymbol sym : syms) { + if (isPkgInfo(sym)) { + packages = packages.prepend((PackageSymbol) sym.owner); + } + } + return packages.reverse(); + } + + private boolean isPkgInfo(JavaFileObject fo, JavaFileObject.Kind kind) { + return fo.isNameCompatible("package-info", kind); + } + + private boolean isPkgInfo(ClassSymbol sym) { + return isPkgInfo(sym.classfile, JavaFileObject.Kind.CLASS) && (sym.packge().package_info == sym); + } + private Context contextForNextRound(Context context, boolean shareNames) throws IOException { @@ -1161,45 +1217,6 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea return false; } - private class AnnotationCollector extends TreeScanner { - List path = List.nil(); - static final boolean verbose = false; - List annotations = List.nil(); - - public List findAnnotations(List nodes) { - annotations = List.nil(); - scan(nodes); - List found = annotations; - annotations = List.nil(); - return found.reverse(); - } - - public void scan(JCTree node) { - if (node == null) - return; - Symbol sym = TreeInfo.symbolFor(node); - if (sym != null) - path = path.prepend(node); - super.scan(node); - if (sym != null) - path = path.tail; - } - - public void visitAnnotation(JCAnnotation node) { - annotations = annotations.prepend(node); - if (verbose) { - StringBuilder sb = new StringBuilder(); - for (JCTree tree : path.reverse()) { - System.err.print(sb); - System.err.println(TreeInfo.symbolFor(tree)); - sb.append(" "); - } - System.err.print(sb); - System.err.println(node); - } - } - } - private static List cleanTrees(List nodes) { for (T node : nodes) treeCleaner.scan(node); @@ -1252,10 +1269,6 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea node.sym = null; super.visitIdent(node); } - public void visitApply(JCMethodInvocation node) { - scan(node.typeargs); - super.visitApply(node); - } }; @@ -1301,115 +1314,62 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea return specifiedPackages; } - // Borrowed from DocletInvoker and apt - // TODO: remove from apt's Main - /** - * Utility method for converting a search path string to an array - * of directory and JAR file URLs. - * - * @param path the search path string - * @return the resulting array of directory and JAR file URLs - */ - public static URL[] pathToURLs(String path) { - StringTokenizer st = new StringTokenizer(path, File.pathSeparator); - URL[] urls = new URL[st.countTokens()]; - int count = 0; - while (st.hasMoreTokens()) { - URL url = fileToURL(new File(st.nextToken())); - if (url != null) { - urls[count++] = url; - } - } - if (urls.length != count) { - URL[] tmp = new URL[count]; - System.arraycopy(urls, 0, tmp, 0, count); - urls = tmp; - } - return urls; - } - - /** - * Returns the directory or JAR file URL corresponding to the specified - * local file name. - * - * @param file the File object - * @return the resulting directory or JAR file URL, or null if unknown - */ - private static URL fileToURL(File file) { - String name; - try { - name = file.getCanonicalPath(); - } catch (IOException e) { - name = file.getAbsolutePath(); - } - name = name.replace(File.separatorChar, '/'); - if (!name.startsWith("/")) { - name = "/" + name; - } - // If the file does not exist, then assume that it's a directory - if (!file.isFile()) { - name = name + "/"; - } - try { - return new URL("file", "", name); - } catch (MalformedURLException e) { - throw new IllegalArgumentException("file"); - } - } - - - private static final Pattern allMatches = Pattern.compile(".*"); + public static final Pattern noMatches = Pattern.compile("(\\P{all})+"); - private static final Pattern noMatches = Pattern.compile("(\\P{all})+"); /** - * Convert import-style string to regex matching that string. If - * the string is a valid import-style string, return a regex that - * won't match anything. + * Convert import-style string for supported annotations into a + * regex matching that string. If the string is a valid + * import-style string, return a regex that won't match anything. */ - // TODO: remove version in Apt.java - public static Pattern importStringToPattern(String s, Processor p, Log log) { + private static Pattern importStringToPattern(String s, Processor p, Log log) { + if (isValidImportString(s)) { + return validImportStringToPattern(s); + } else { + log.warning("proc.malformed.supported.string", s, p.getClass().getName()); + return noMatches; // won't match any valid identifier + } + } + + /** + * Return true if the argument string is a valid import-style + * string specifying claimed annotations; return false otherwise. + */ + public static boolean isValidImportString(String s) { + if (s.equals("*")) + return true; + + boolean valid = true; + String t = s; + int index = t.indexOf('*'); + + if (index != -1) { + // '*' must be last character... + if (index == t.length() -1) { + // ... any and preceding character must be '.' + if ( index-1 >= 0 ) { + valid = t.charAt(index-1) == '.'; + // Strip off ".*$" for identifier checks + t = t.substring(0, t.length()-2); + } + } else + return false; + } + + // Verify string is off the form (javaId \.)+ or javaId + if (valid) { + String[] javaIds = t.split("\\.", t.length()+2); + for(String javaId: javaIds) + valid &= SourceVersion.isIdentifier(javaId); + } + return valid; + } + + public static Pattern validImportStringToPattern(String s) { if (s.equals("*")) { return allMatches; } else { - String t = s; - boolean star = false; - - /* - * Validate string from factory is legal. If the string - * has more than one asterisks or the asterisks does not - * appear as the last character (preceded by a period), - * the string is not legal. - */ - - boolean valid = true; - int index = t.indexOf('*'); - if (index != -1) { - // '*' must be last character... - if (index == t.length() -1) { - // ... and preceeding character must be '.' - if ( index-1 >= 0 ) { - valid = t.charAt(index-1) == '.'; - // Strip off ".*$" for identifier checks - t = t.substring(0, t.length()-2); - } - } else - valid = false; - } - - // Verify string is off the form (javaId \.)+ or javaId - if (valid) { - String[] javaIds = t.split("\\.", t.length()+2); - for(String javaId: javaIds) - valid &= SourceVersion.isIdentifier(javaId); - } - - if (!valid) { - log.warning("proc.malformed.supported.string", s, p.getClass().getName()); - return noMatches; // won't match any valid identifier - } - - String s_prime = s.replaceAll("\\.", "\\\\."); + String s_prime = s.replace(".", "\\."); if (s_prime.endsWith("*")) { s_prime = s_prime.substring(0, s_prime.length() - 1) + ".+"; diff --git a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties index ba27f304dfd..23d7fc38353 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties +++ b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties @@ -704,7 +704,7 @@ compiler.warn.override.bridge=\ {0}; overridden method is a bridge method compiler.warn.pkg-info.already.seen=\ - [package-info] a package-info.java file has already been seen for package {0} + a package-info.java file has already been seen for package {0} compiler.warn.path.element.not.found=\ [path] bad path element "{0}": no such file or directory compiler.warn.possible.fall-through.into.case=\ @@ -720,6 +720,9 @@ compiler.warn.big.major.version=\ {0}: major version {1} is newer than {2}, the highest major version supported by this compiler.\n\ It is recommended that the compiler be upgraded. +compiler.warn.static.not.qualified.by.type=\ + [static] static {0} should be qualified by type name, {1}, instead of by an expression + # Warnings related to annotation processing compiler.warn.proc.package.does.not.exist=\ package {0} does not exist diff --git a/langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java b/langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java index a1381517a06..ef4d4dc02dc 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java +++ b/langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java @@ -54,7 +54,7 @@ public class Pretty extends JCTree.Visitor { /** Set when we are producing source output. If we're not * producing source output, we can sometimes give more detail in * the output even though that detail would not be valid java - * soruce. + * source. */ private final boolean sourceOutput; @@ -468,6 +468,10 @@ public class Pretty extends JCTree.Visitor { print(" throws "); printExprs(tree.thrown); } + if (tree.defaultValue != null) { + print(" default "); + printExpr(tree.defaultValue); + } if (tree.body != null) { print(" "); printStat(tree.body); @@ -489,6 +493,20 @@ public class Pretty extends JCTree.Visitor { print("/*public static final*/ "); print(tree.name); if (tree.init != null) { + if (sourceOutput && tree.init.getTag() == JCTree.NEWCLASS) { + print(" /*enum*/ "); + JCNewClass init = (JCNewClass) tree.init; + if (init.args != null && init.args.nonEmpty()) { + print("("); + print(init.args); + print(")"); + } + if (init.def != null && init.def.defs != null) { + print(" "); + printBlock(init.def.defs); + } + return; + } print(" /* = "); printExpr(tree.init); print(" */"); @@ -1134,20 +1152,7 @@ public class Pretty extends JCTree.Visitor { // Prints the inner element type of a nested array private void printBaseElementType(JCTree tree) throws IOException { - switch (tree.getTag()) { - case JCTree.TYPEARRAY: - printBaseElementType(((JCArrayTypeTree)tree).elemtype); - return; - case JCTree.WILDCARD: - printBaseElementType(((JCWildcard)tree).inner); - return; - case JCTree.ANNOTATED_TYPE: - printBaseElementType(((JCAnnotatedType)tree).underlyingType); - return; - default: - printExpr(tree); - return; - } + printExpr(TreeInfo.innermostType(tree)); } // prints the brackets of a nested array in reverse order diff --git a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java index fead12535a3..12f25312e6e 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java +++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java @@ -307,8 +307,18 @@ public class TreeInfo { case(JCTree.POSTINC): case(JCTree.POSTDEC): return getStartPos(((JCUnary) tree).arg); - case(JCTree.ANNOTATED_TYPE): - return getStartPos(((JCAnnotatedType) tree).underlyingType); + case(JCTree.ANNOTATED_TYPE): { + JCAnnotatedType node = (JCAnnotatedType) tree; + if (node.annotations.nonEmpty()) + return getStartPos(node.annotations.head); + return getStartPos(node.underlyingType); + } + case(JCTree.NEWCLASS): { + JCNewClass node = (JCNewClass)tree; + if (node.encl != null) + return getStartPos(node.encl); + break; + } case(JCTree.VARDEF): { JCVariableDecl node = (JCVariableDecl)tree; if (node.mods.pos != Position.NOPOS) { @@ -406,6 +416,8 @@ public class TreeInfo { return getEndPos(((JCUnary) tree).arg, endPositions); case(JCTree.WHILELOOP): return getEndPos(((JCWhileLoop) tree).body, endPositions); + case(JCTree.ANNOTATED_TYPE): + return getEndPos(((JCAnnotatedType) tree).underlyingType, endPositions); case(JCTree.ERRONEOUS): { JCErroneous node = (JCErroneous)tree; if (node.errs != null && node.errs.nonEmpty()) @@ -891,4 +903,17 @@ public class TreeInfo { throw new AssertionError("Unexpected type tree: " + tree); } } + + public static JCTree innermostType(JCTree type) { + switch (type.getTag()) { + case JCTree.TYPEARRAY: + return innermostType(((JCArrayTypeTree)type).elemtype); + case JCTree.WILDCARD: + return innermostType(((JCWildcard)type).inner); + case JCTree.ANNOTATED_TYPE: + return innermostType(((JCAnnotatedType)type).underlyingType); + default: + return type; + } + } } diff --git a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java index b48841d9e62..84229f60fbb 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java +++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java @@ -480,7 +480,7 @@ public class TreeMaker implements JCTree.Factory { public JCModifiers Modifiers(long flags, List annotations) { JCModifiers tree = new JCModifiers(flags, annotations); - boolean noFlags = (flags & Flags.StandardFlags) == 0; + boolean noFlags = (flags & Flags.ModifierFlags) == 0; tree.pos = (noFlags && annotations.isEmpty()) ? Position.NOPOS : pos; return tree; } diff --git a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeScanner.java b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeScanner.java index 8a07d6ea519..5721d5d2078 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeScanner.java +++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeScanner.java @@ -193,6 +193,7 @@ public class TreeScanner extends Visitor { } public void visitApply(JCMethodInvocation tree) { + scan(tree.typeargs); scan(tree.meth); scan(tree.args); } @@ -200,6 +201,7 @@ public class TreeScanner extends Visitor { public void visitNewClass(JCNewClass tree) { scan(tree.encl); scan(tree.clazz); + scan(tree.typeargs); scan(tree.args); scan(tree.def); } diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/BaseFileManager.java b/langtools/src/share/classes/com/sun/tools/javac/util/BaseFileManager.java new file mode 100644 index 00000000000..bc91c470f7a --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/javac/util/BaseFileManager.java @@ -0,0 +1,355 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.javac.util; + +import com.sun.tools.javac.code.Source; +import com.sun.tools.javac.main.JavacOption; +import com.sun.tools.javac.main.OptionName; +import com.sun.tools.javac.main.RecognizedOptions; +import com.sun.tools.javac.util.JCDiagnostic.SimpleDiagnosticPosition; +import java.io.ByteArrayOutputStream; +import java.io.Closeable; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStreamWriter; +import java.lang.ref.SoftReference; +import java.lang.reflect.Constructor; +import java.net.URL; +import java.net.URLClassLoader; +import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.charset.Charset; +import java.nio.charset.CharsetDecoder; +import java.nio.charset.CoderResult; +import java.nio.charset.CodingErrorAction; +import java.nio.charset.IllegalCharsetNameException; +import java.nio.charset.UnsupportedCharsetException; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import javax.tools.JavaFileObject; +import javax.tools.JavaFileObject.Kind; + +/** + * Utility methods for building a filemanager. + * There are no references here to file-system specific objects such as + * java.io.File or java.nio.file.Path. + */ +public class BaseFileManager { + protected BaseFileManager(Charset charset) { + this.charset = charset; + byteBufferCache = new ByteBufferCache(); + } + + /** + * Set the context for JavacPathFileManager. + */ + protected void setContext(Context context) { + log = Log.instance(context); + options = Options.instance(context); + classLoaderClass = options.get("procloader"); + } + + /** + * The log to be used for error reporting. + */ + public Log log; + + /** + * User provided charset (through javax.tools). + */ + protected Charset charset; + + protected Options options; + + protected String classLoaderClass; + + protected Source getSource() { + String sourceName = options.get(OptionName.SOURCE); + Source source = null; + if (sourceName != null) + source = Source.lookup(sourceName); + return (source != null ? source : Source.DEFAULT); + } + + protected ClassLoader getClassLoader(URL[] urls) { + ClassLoader thisClassLoader = getClass().getClassLoader(); + + // Bug: 6558476 + // Ideally, ClassLoader should be Closeable, but before JDK7 it is not. + // On older versions, try the following, to get a closeable classloader. + + // 1: Allow client to specify the class to use via hidden option + if (classLoaderClass != null) { + try { + Class loader = + Class.forName(classLoaderClass).asSubclass(ClassLoader.class); + Class[] constrArgTypes = { URL[].class, ClassLoader.class }; + Constructor constr = loader.getConstructor(constrArgTypes); + return constr.newInstance(new Object[] { urls, thisClassLoader }); + } catch (Throwable t) { + // ignore errors loading user-provided class loader, fall through + } + } + + // 2: If URLClassLoader implements Closeable, use that. + if (Closeable.class.isAssignableFrom(URLClassLoader.class)) + return new URLClassLoader(urls, thisClassLoader); + + // 3: Try using private reflection-based CloseableURLClassLoader + try { + return new CloseableURLClassLoader(urls, thisClassLoader); + } catch (Throwable t) { + // ignore errors loading workaround class loader, fall through + } + + // 4: If all else fails, use plain old standard URLClassLoader + return new URLClassLoader(urls, thisClassLoader); + } + + // + public boolean handleOption(String current, Iterator remaining) { + for (JavacOption o: javacFileManagerOptions) { + if (o.matches(current)) { + if (o.hasArg()) { + if (remaining.hasNext()) { + if (!o.process(options, current, remaining.next())) + return true; + } + } else { + if (!o.process(options, current)) + return true; + } + // operand missing, or process returned false + throw new IllegalArgumentException(current); + } + } + + return false; + } + // where + private static JavacOption[] javacFileManagerOptions = + RecognizedOptions.getJavacFileManagerOptions( + new RecognizedOptions.GrumpyHelper()); + + public int isSupportedOption(String option) { + for (JavacOption o : javacFileManagerOptions) { + if (o.matches(option)) + return o.hasArg() ? 1 : 0; + } + return -1; + } + // + + // + private String defaultEncodingName; + private String getDefaultEncodingName() { + if (defaultEncodingName == null) { + defaultEncodingName = + new OutputStreamWriter(new ByteArrayOutputStream()).getEncoding(); + } + return defaultEncodingName; + } + + public String getEncodingName() { + String encName = options.get(OptionName.ENCODING); + if (encName == null) + return getDefaultEncodingName(); + else + return encName; + } + + public CharBuffer decode(ByteBuffer inbuf, boolean ignoreEncodingErrors) { + String encodingName = getEncodingName(); + CharsetDecoder decoder; + try { + decoder = getDecoder(encodingName, ignoreEncodingErrors); + } catch (IllegalCharsetNameException e) { + log.error("unsupported.encoding", encodingName); + return (CharBuffer)CharBuffer.allocate(1).flip(); + } catch (UnsupportedCharsetException e) { + log.error("unsupported.encoding", encodingName); + return (CharBuffer)CharBuffer.allocate(1).flip(); + } + + // slightly overestimate the buffer size to avoid reallocation. + float factor = + decoder.averageCharsPerByte() * 0.8f + + decoder.maxCharsPerByte() * 0.2f; + CharBuffer dest = CharBuffer. + allocate(10 + (int)(inbuf.remaining()*factor)); + + while (true) { + CoderResult result = decoder.decode(inbuf, dest, true); + dest.flip(); + + if (result.isUnderflow()) { // done reading + // make sure there is at least one extra character + if (dest.limit() == dest.capacity()) { + dest = CharBuffer.allocate(dest.capacity()+1).put(dest); + dest.flip(); + } + return dest; + } else if (result.isOverflow()) { // buffer too small; expand + int newCapacity = + 10 + dest.capacity() + + (int)(inbuf.remaining()*decoder.maxCharsPerByte()); + dest = CharBuffer.allocate(newCapacity).put(dest); + } else if (result.isMalformed() || result.isUnmappable()) { + // bad character in input + + // report coding error (warn only pre 1.5) + if (!getSource().allowEncodingErrors()) { + log.error(new SimpleDiagnosticPosition(dest.limit()), + "illegal.char.for.encoding", + charset == null ? encodingName : charset.name()); + } else { + log.warning(new SimpleDiagnosticPosition(dest.limit()), + "illegal.char.for.encoding", + charset == null ? encodingName : charset.name()); + } + + // skip past the coding error + inbuf.position(inbuf.position() + result.length()); + + // undo the flip() to prepare the output buffer + // for more translation + dest.position(dest.limit()); + dest.limit(dest.capacity()); + dest.put((char)0xfffd); // backward compatible + } else { + throw new AssertionError(result); + } + } + // unreached + } + + public CharsetDecoder getDecoder(String encodingName, boolean ignoreEncodingErrors) { + Charset cs = (this.charset == null) + ? Charset.forName(encodingName) + : this.charset; + CharsetDecoder decoder = cs.newDecoder(); + + CodingErrorAction action; + if (ignoreEncodingErrors) + action = CodingErrorAction.REPLACE; + else + action = CodingErrorAction.REPORT; + + return decoder + .onMalformedInput(action) + .onUnmappableCharacter(action); + } + // + + // + /** + * Make a byte buffer from an input stream. + */ + public ByteBuffer makeByteBuffer(InputStream in) + throws IOException { + int limit = in.available(); + if (limit < 1024) limit = 1024; + ByteBuffer result = byteBufferCache.get(limit); + int position = 0; + while (in.available() != 0) { + if (position >= limit) + // expand buffer + result = ByteBuffer. + allocate(limit <<= 1). + put((ByteBuffer)result.flip()); + int count = in.read(result.array(), + position, + limit - position); + if (count < 0) break; + result.position(position += count); + } + return (ByteBuffer)result.flip(); + } + + public void recycleByteBuffer(ByteBuffer bb) { + byteBufferCache.put(bb); + } + + /** + * A single-element cache of direct byte buffers. + */ + private static class ByteBufferCache { + private ByteBuffer cached; + ByteBuffer get(int capacity) { + if (capacity < 20480) capacity = 20480; + ByteBuffer result = + (cached != null && cached.capacity() >= capacity) + ? (ByteBuffer)cached.clear() + : ByteBuffer.allocate(capacity + capacity>>1); + cached = null; + return result; + } + void put(ByteBuffer x) { + cached = x; + } + } + + private final ByteBufferCache byteBufferCache; + // + + // + public CharBuffer getCachedContent(JavaFileObject file) { + SoftReference r = contentCache.get(file); + return (r == null ? null : r.get()); + } + + public void cache(JavaFileObject file, CharBuffer cb) { + contentCache.put(file, new SoftReference(cb)); + } + + protected final Map> contentCache + = new HashMap>(); + // + + public static Kind getKind(String name) { + if (name.endsWith(Kind.CLASS.extension)) + return Kind.CLASS; + else if (name.endsWith(Kind.SOURCE.extension)) + return Kind.SOURCE; + else if (name.endsWith(Kind.HTML.extension)) + return Kind.HTML; + else + return Kind.OTHER; + } + + protected static T nullCheck(T o) { + o.getClass(); // null check + return o; + } + + protected static Collection nullCheck(Collection it) { + for (T t : it) + t.getClass(); // null check + return it; + } +} diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java b/langtools/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java index a4442dbff53..74127663133 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java +++ b/langtools/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java @@ -201,7 +201,7 @@ public class BasicDiagnosticFormatter extends AbstractDiagnosticFormatter { private String selectFormat(JCDiagnostic d) { DiagnosticSource source = d.getDiagnosticSource(); String format = getConfiguration().getFormat(BasicFormatKind.DEFAULT_NO_POS_FORMAT); - if (source != null) { + if (source != null && source != DiagnosticSource.NO_SOURCE) { if (d.getIntPosition() != Position.NOPOS) { format = getConfiguration().getFormat(BasicFormatKind.DEFAULT_POS_FORMAT); } else if (source.getFile() != null && diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/CloseableURLClassLoader.java b/langtools/src/share/classes/com/sun/tools/javac/util/CloseableURLClassLoader.java similarity index 96% rename from langtools/src/share/classes/com/sun/tools/javac/file/CloseableURLClassLoader.java rename to langtools/src/share/classes/com/sun/tools/javac/util/CloseableURLClassLoader.java index bcba74bef9f..48c1e6f0dfd 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/file/CloseableURLClassLoader.java +++ b/langtools/src/share/classes/com/sun/tools/javac/util/CloseableURLClassLoader.java @@ -23,7 +23,7 @@ * have any questions. */ -package com.sun.tools.javac.file; +package com.sun.tools.javac.util; import java.io.Closeable; import java.io.IOException; @@ -45,9 +45,9 @@ import java.util.jar.JarFile; * This code and its internal interfaces are subject to change or * deletion without notice. */ -class CloseableURLClassLoader +public class CloseableURLClassLoader extends URLClassLoader implements Closeable { - CloseableURLClassLoader(URL[] urls, ClassLoader parent) throws Error { + public CloseableURLClassLoader(URL[] urls, ClassLoader parent) throws Error { super(urls, parent); try { getLoaders(); //proactive check that URLClassLoader is as expected @@ -63,6 +63,7 @@ class CloseableURLClassLoader * @throws java.io.IOException if the jar files cannot be found for any * reson, or if closing the jar file itself causes an IOException. */ + @Override public void close() throws IOException { try { for (Object l: getLoaders()) { diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/LayoutCharacters.java b/langtools/src/share/classes/com/sun/tools/javac/util/LayoutCharacters.java index dd4f4dd9e03..05158b61cae 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/util/LayoutCharacters.java +++ b/langtools/src/share/classes/com/sun/tools/javac/util/LayoutCharacters.java @@ -49,7 +49,7 @@ public interface LayoutCharacters { /** Tabulator character. */ - final static byte TAB = 0x8; + final static byte TAB = 0x9; /** Line feed character. */ diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/Log.java b/langtools/src/share/classes/com/sun/tools/javac/util/Log.java index 7184bd9ed5c..2ce82585a6f 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/util/Log.java +++ b/langtools/src/share/classes/com/sun/tools/javac/util/Log.java @@ -145,7 +145,10 @@ public class Log extends AbstractLog { private int getIntOption(Options options, String optionName, int defaultValue) { String s = options.get(optionName); try { - if (s != null) return Integer.parseInt(s); + if (s != null) { + int n = Integer.parseInt(s); + return (n <= 0 ? Integer.MAX_VALUE : n); + } } catch (NumberFormatException e) { // silently ignore ill-formed numbers } @@ -189,6 +192,12 @@ public class Log extends AbstractLog { */ public int nwarnings = 0; + /** + * Whether or not an unrecoverable error has been seen. + * Unrecoverable errors prevent subsequent annotation processing. + */ + public boolean unrecoverableError; + /** A set of all errors generated so far. This is used to avoid printing an * error message more than once. For each error, a pair consisting of the * source file name and source code position of the error is added to the set. diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java b/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java index 1d7ae15e1ea..0a5514cbc87 100644 --- a/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java +++ b/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java @@ -34,7 +34,6 @@ import com.sun.javadoc.*; import com.sun.tools.javac.code.*; import com.sun.tools.javac.code.Symbol.*; import com.sun.tools.javac.code.Type.ClassType; -import com.sun.tools.javac.comp.Attr; import com.sun.tools.javac.comp.Check; import com.sun.tools.javac.tree.JCTree.*; import com.sun.tools.javac.util.Context; @@ -73,10 +72,6 @@ public class DocEnv { /** Referenced directly in RootDocImpl. */ JavadocClassReader reader; - /** The compiler's attribution phase (needed to evaluate - * constant initializers). */ - Attr attr; - /** Javadoc's own version of the compiler's enter phase. */ JavadocEnter enter; @@ -91,8 +86,6 @@ public class DocEnv { /** Access filter (public, protected, ...). */ ModifierFilter showAccess; - private ClassDocImpl runtimeException; - /** True if we are using a sentence BreakIterator. */ boolean breakiterator; @@ -129,7 +122,6 @@ public class DocEnv { syms = Symtab.instance(context); reader = JavadocClassReader.instance0(context); enter = JavadocEnter.instance0(context); - attr = Attr.instance(context); names = Names.instance(context); externalizableSym = reader.enterClass(names.fromString("java.io.Externalizable")); chk = Check.instance(context); diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java b/langtools/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java index 4bc8902c61d..ab9be8995a9 100644 --- a/langtools/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java +++ b/langtools/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java @@ -81,7 +81,7 @@ public class DocletInvoker { cpString = appendPath(System.getProperty("env.class.path"), cpString); cpString = appendPath(System.getProperty("java.class.path"), cpString); cpString = appendPath(docletPath, cpString); - URL[] urls = pathToURLs(cpString); + URL[] urls = com.sun.tools.javac.file.Paths.pathToURLs(cpString); if (docletParentClassLoader == null) appClassLoader = new URLClassLoader(urls, getDelegationClassLoader(docletClassName)); else @@ -313,58 +313,4 @@ public class DocletInvoker { Thread.currentThread().setContextClassLoader(savedCCL); } } - - /** - * Utility method for converting a search path string to an array - * of directory and JAR file URLs. - * - * @param path the search path string - * @return the resulting array of directory and JAR file URLs - */ - static URL[] pathToURLs(String path) { - StringTokenizer st = new StringTokenizer(path, File.pathSeparator); - URL[] urls = new URL[st.countTokens()]; - int count = 0; - while (st.hasMoreTokens()) { - URL url = fileToURL(new File(st.nextToken())); - if (url != null) { - urls[count++] = url; - } - } - if (urls.length != count) { - URL[] tmp = new URL[count]; - System.arraycopy(urls, 0, tmp, 0, count); - urls = tmp; - } - return urls; - } - - /** - * Returns the directory or JAR file URL corresponding to the specified - * local file name. - * - * @param file the File object - * @return the resulting directory or JAR file URL, or null if unknown - */ - static URL fileToURL(File file) { - String name; - try { - name = file.getCanonicalPath(); - } catch (IOException e) { - name = file.getAbsolutePath(); - } - name = name.replace(File.separatorChar, '/'); - if (!name.startsWith("/")) { - name = "/" + name; - } - // If the file does not exist, then assume that it's a directory - if (!file.isFile()) { - name = name + "/"; - } - try { - return new URL("file", "", name); - } catch (MalformedURLException e) { - throw new IllegalArgumentException("file"); - } - } } diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/SeeTagImpl.java b/langtools/src/share/classes/com/sun/tools/javadoc/SeeTagImpl.java index 39356706114..2f702e83b39 100644 --- a/langtools/src/share/classes/com/sun/tools/javadoc/SeeTagImpl.java +++ b/langtools/src/share/classes/com/sun/tools/javadoc/SeeTagImpl.java @@ -349,12 +349,12 @@ class SeeTagImpl extends TagImpl implements SeeTag, LayoutCharacters { // (int i, String s) ==> [0] = "int", [1] = String // (int[][], String[]) ==> [0] = "int[][]" // [1] = "String[]" class ParameterParseMachine { - final int START = 0; - final int TYPE = 1; - final int NAME = 2; - final int TNSPACE = 3; // space between type and name - final int ARRAYDECORATION = 4; - final int ARRAYSPACE = 5; + static final int START = 0; + static final int TYPE = 1; + static final int NAME = 2; + static final int TNSPACE = 3; // space between type and name + static final int ARRAYDECORATION = 4; + static final int ARRAYSPACE = 5; String parameters; diff --git a/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java b/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java index 0b059f5b3fa..15a50e73781 100644 --- a/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java +++ b/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java @@ -255,9 +255,11 @@ public class JavahTask implements NativeHeaderTool.NativeHeaderTask { } this.classes = new ArrayList(); - for (String classname: classes) { - classname.getClass(); // null-check - this.classes.add(classname); + if (classes != null) { + for (String classname: classes) { + classname.getClass(); // null-check + this.classes.add(classname); + } } } @@ -316,6 +318,12 @@ public class JavahTask implements NativeHeaderTool.NativeHeaderTask { int run(String[] args) { try { handleOptions(args); + if (classes == null || classes.size() == 0) { + if (help || version || fullVersion) + return 0; + else + return 1; + } boolean ok = run(); return ok ? 0 : 1; } catch (BadArgs e) { @@ -347,8 +355,7 @@ public class JavahTask implements NativeHeaderTool.NativeHeaderTask { fileManager = getDefaultFileManager(diagnosticListener, log); Iterator iter = args.iterator(); - if (!iter.hasNext()) - help = true; + boolean noArgs = !iter.hasNext(); while (iter.hasNext()) { String arg = iter.next(); @@ -365,7 +372,7 @@ public class JavahTask implements NativeHeaderTool.NativeHeaderTask { } if ((classes == null || classes.size() == 0) && - !(help || version || fullVersion)) { + !(noArgs || help || version || fullVersion)) { throw new BadArgs("err.no.classes.specified"); } diff --git a/langtools/src/share/classes/com/sun/tools/javap/AnnotationWriter.java b/langtools/src/share/classes/com/sun/tools/javap/AnnotationWriter.java index 029026c47f5..c4af507e8f1 100644 --- a/langtools/src/share/classes/com/sun/tools/javap/AnnotationWriter.java +++ b/langtools/src/share/classes/com/sun/tools/javap/AnnotationWriter.java @@ -162,6 +162,7 @@ public class AnnotationWriter extends BasicWriter { print(pos.type_index); break; case CLASS_LITERAL: + case CLASS_LITERAL_GENERIC_OR_ARRAY: if (showOffsets) { print(", offset="); print(pos.offset); diff --git a/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java b/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java index 42567342b31..46c8530340a 100644 --- a/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java +++ b/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java @@ -45,9 +45,6 @@ import com.sun.tools.classfile.InnerClasses_attribute; import com.sun.tools.classfile.LineNumberTable_attribute; import com.sun.tools.classfile.LocalVariableTable_attribute; import com.sun.tools.classfile.LocalVariableTypeTable_attribute; -import com.sun.tools.classfile.ModuleExportTable_attribute; -import com.sun.tools.classfile.ModuleMemberTable_attribute; -import com.sun.tools.classfile.Module_attribute; import com.sun.tools.classfile.RuntimeInvisibleAnnotations_attribute; import com.sun.tools.classfile.RuntimeInvisibleParameterAnnotations_attribute; import com.sun.tools.classfile.RuntimeInvisibleTypeAnnotations_attribute; @@ -372,63 +369,6 @@ public class AttributeWriter extends BasicWriter return null; } - public Void visitModule(Module_attribute attr, Void ignore) { - print("Module: #" + attr.module_name); - tab(); - println("// " + getModuleName(attr)); - return null; - } - - String getModuleName(Module_attribute attr) { - try { - return attr.getModuleName(constant_pool); - } catch (ConstantPoolException e) { - return report(e); - } - } - - public Void visitModuleExportTable(ModuleExportTable_attribute attr, Void ignore) { - println("ModuleExportTable:"); - indent(+1); - println("Types: (" + attr.export_type_table.length + ")"); - for (int i = 0; i < attr.export_type_table.length; i++) { - print("#" + attr.export_type_table[i]); - tab(); - println("// " + getExportTypeName(attr, i)); - } - indent(-1); - return null; - } - - String getExportTypeName(ModuleExportTable_attribute attr, int index) { - try { - return attr.getExportTypeName(index, constant_pool); - } catch (ConstantPoolException e) { - return report(e); - } - } - - public Void visitModuleMemberTable(ModuleMemberTable_attribute attr, Void ignore) { - println("ModuleMemberTable:"); - indent(+1); - println("Packages: (" + attr.package_member_table.length + ")"); - for (int i = 0; i < attr.package_member_table.length; i++) { - print("#" + attr.package_member_table[i]); - tab(); - println("// " + getPackageMemberName(attr, i)); - } - indent(-1); - return null; - } - - String getPackageMemberName(ModuleMemberTable_attribute attr, int index) { - try { - return attr.getPackageMemberName(index, constant_pool); - } catch (ConstantPoolException e) { - return report(e); - } - } - public Void visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute attr, Void ignore) { println("RuntimeVisibleAnnotations:"); indent(+1); diff --git a/langtools/src/share/classes/com/sun/tools/javap/CodeWriter.java b/langtools/src/share/classes/com/sun/tools/javap/CodeWriter.java index 06a508bba91..b02836d3cbc 100644 --- a/langtools/src/share/classes/com/sun/tools/javap/CodeWriter.java +++ b/langtools/src/share/classes/com/sun/tools/javap/CodeWriter.java @@ -118,28 +118,33 @@ class CodeWriter extends BasicWriter { public void writeInstr(Instruction instr) { print(String.format("%4d: %-13s ", instr.getPC(), instr.getMnemonic())); - instr.accept(instructionPrinter, null); + // compute the number of indentations for the body of multi-line instructions + // This is 6 (the width of "%4d: "), divided by the width of each indentation level, + // and rounded up to the next integer. + int indentWidth = options.indentWidth; + int indent = (6 + indentWidth - 1) / indentWidth; + instr.accept(instructionPrinter, indent); println(); } // where - Instruction.KindVisitor instructionPrinter = - new Instruction.KindVisitor() { + Instruction.KindVisitor instructionPrinter = + new Instruction.KindVisitor() { - public Void visitNoOperands(Instruction instr, Void p) { + public Void visitNoOperands(Instruction instr, Integer indent) { return null; } - public Void visitArrayType(Instruction instr, TypeKind kind, Void p) { + public Void visitArrayType(Instruction instr, TypeKind kind, Integer indent) { print(" " + kind.name); return null; } - public Void visitBranch(Instruction instr, int offset, Void p) { + public Void visitBranch(Instruction instr, int offset, Integer indent) { print((instr.getPC() + offset)); return null; } - public Void visitConstantPoolRef(Instruction instr, int index, Void p) { + public Void visitConstantPoolRef(Instruction instr, int index, Integer indent) { print("#" + index); tab(); print("// "); @@ -147,7 +152,7 @@ class CodeWriter extends BasicWriter { return null; } - public Void visitConstantPoolRefAndValue(Instruction instr, int index, int value, Void p) { + public Void visitConstantPoolRefAndValue(Instruction instr, int index, int value, Integer indent) { print("#" + index + ", " + value); tab(); print("// "); @@ -155,46 +160,48 @@ class CodeWriter extends BasicWriter { return null; } - public Void visitLocal(Instruction instr, int index, Void p) { + public Void visitLocal(Instruction instr, int index, Integer indent) { print(index); return null; } - public Void visitLocalAndValue(Instruction instr, int index, int value, Void p) { + public Void visitLocalAndValue(Instruction instr, int index, int value, Integer indent) { print(index + ", " + value); return null; } - public Void visitLookupSwitch(Instruction instr, int default_, int npairs, int[] matches, int[] offsets) { + public Void visitLookupSwitch(Instruction instr, + int default_, int npairs, int[] matches, int[] offsets, Integer indent) { int pc = instr.getPC(); print("{ // " + npairs); - indent(+1); + indent(indent); for (int i = 0; i < npairs; i++) { - print("\n" + matches[i] + ": " + (pc + offsets[i])); + print(String.format("%n%12d: %d", matches[i], (pc + offsets[i]))); } - print("\ndefault: " + (pc + default_) + " }"); - indent(-1); + print("\n default: " + (pc + default_) + "\n}"); + indent(-indent); return null; } - public Void visitTableSwitch(Instruction instr, int default_, int low, int high, int[] offsets) { + public Void visitTableSwitch(Instruction instr, + int default_, int low, int high, int[] offsets, Integer indent) { int pc = instr.getPC(); - print("{ //" + low + " to " + high); - indent(+1); + print("{ // " + low + " to " + high); + indent(indent); for (int i = 0; i < offsets.length; i++) { - print("\n" + (low + i) + ": " + (pc + offsets[i])); + print(String.format("%n%12d: %d", (low + i), (pc + offsets[i]))); } - print("\ndefault: " + (pc + default_) + " }"); - indent(-1); + print("\n default: " + (pc + default_) + "\n}"); + indent(-indent); return null; } - public Void visitValue(Instruction instr, int value, Void p) { + public Void visitValue(Instruction instr, int value, Integer indent) { print(value); return null; } - public Void visitUnknown(Instruction instr, Void p) { + public Void visitUnknown(Instruction instr, Integer indent) { return null; } }; diff --git a/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java b/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java index c68cff26b6b..cb1fd4df5c2 100644 --- a/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java +++ b/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java @@ -236,12 +236,6 @@ public class JavapTask implements DisassemblerTool.DisassemblerTask, Messages { } }, - new Option(false, "-XDjsr277") { - void process(JavapTask task, String opt, String arg) { - task.options.jsr277 = true; - } - }, - new Option(false, "-XDdetails") { void process(JavapTask task, String opt, String arg) { task.options.details = EnumSet.allOf(InstructionDetailWriter.Kind.class); @@ -586,7 +580,6 @@ public class JavapTask implements DisassemblerTool.DisassemblerTask, Messages { sourceWriter.setFileManager(fileManager); attributeFactory.setCompat(options.compat); - attributeFactory.setJSR277(options.jsr277); boolean ok = true; diff --git a/langtools/src/share/classes/com/sun/tools/javap/Options.java b/langtools/src/share/classes/com/sun/tools/javap/Options.java index 0ff78a7edd2..c0f5d00eb6e 100644 --- a/langtools/src/share/classes/com/sun/tools/javap/Options.java +++ b/langtools/src/share/classes/com/sun/tools/javap/Options.java @@ -90,5 +90,4 @@ public class Options { public int tabColumn = 40; // column number for comments public boolean compat; // bug-for-bug compatibility mode with old javap - public boolean jsr277; } diff --git a/langtools/src/share/classes/javax/lang/model/element/package-info.java b/langtools/src/share/classes/javax/lang/model/element/package-info.java index 26ea184c432..7729f505578 100644 --- a/langtools/src/share/classes/javax/lang/model/element/package-info.java +++ b/langtools/src/share/classes/javax/lang/model/element/package-info.java @@ -26,6 +26,16 @@ /** * Interfaces used to model elements of the Java programming language. * + * The term "element" in this package is used to refer to program + * elements, the declared entities that make up a program. Elements + * include classes, interfaces, methods, constructors, and fields. + * The interfaces in this package do not model the structure of a + * program inside a method body; for example there is no + * representation of a {@code for} loop or {@code try}-{@code finally} + * block. However, the interfaces can model some structures only + * appearing inside method bodies, such as local variables and + * anonymous classes. + * *

      When used in the context of annotation processing, an accurate * model of the element being represented must be returned. As this * is a language model, the source code provides the fiducial diff --git a/langtools/src/share/classes/javax/tools/StandardJavaFileManager.java b/langtools/src/share/classes/javax/tools/StandardJavaFileManager.java index 116cf8c55f4..028c8d8f509 100644 --- a/langtools/src/share/classes/javax/tools/StandardJavaFileManager.java +++ b/langtools/src/share/classes/javax/tools/StandardJavaFileManager.java @@ -28,7 +28,6 @@ package javax.tools; import java.io.File; import java.io.IOException; import java.util.*; -import java.util.concurrent.*; /** * File manager based on {@linkplain File java.io.File}. A common way diff --git a/langtools/test/tools/javac/4880220/T4880220.empty.out b/langtools/test/tools/javac/4880220/T4880220.empty.out new file mode 100644 index 00000000000..e69de29bb2d diff --git a/langtools/test/tools/javac/4880220/T4880220.error.out b/langtools/test/tools/javac/4880220/T4880220.error.out new file mode 100644 index 00000000000..c4efa186be5 --- /dev/null +++ b/langtools/test/tools/javac/4880220/T4880220.error.out @@ -0,0 +1,9 @@ +T4880220.java:20:27: compiler.warn.static.not.qualified.by.type: kindname.method, T4880220.C +T4880220.java:21:27: compiler.warn.static.not.qualified.by.type: kindname.variable, T4880220.C +T4880220.java:22:27: compiler.warn.static.not.qualified.by.type: kindname.variable, T4880220.C +T4880220.java:24:29: compiler.warn.static.not.qualified.by.type: kindname.method, T4880220.C +T4880220.java:25:29: compiler.warn.static.not.qualified.by.type: kindname.variable, T4880220.C +T4880220.java:26:29: compiler.warn.static.not.qualified.by.type: kindname.variable, T4880220.C +- compiler.err.warnings.and.werror +1 error +6 warnings diff --git a/langtools/test/tools/javac/4880220/T4880220.java b/langtools/test/tools/javac/4880220/T4880220.java new file mode 100644 index 00000000000..f127a80a8f6 --- /dev/null +++ b/langtools/test/tools/javac/4880220/T4880220.java @@ -0,0 +1,43 @@ +/* + * @test /nodynamiccopyright/ + * @bug 4880220 + * @summary Add a warning when accessing a static method via an reference + * + * @compile/ref=T4880220.empty.out T4880220.java + * @compile/ref=T4880220.warn.out -XDrawDiagnostics -Xlint:static T4880220.java + * @compile/ref=T4880220.warn.out -XDrawDiagnostics -Xlint:all T4880220.java + * @compile/ref=T4880220.empty.out -XDrawDiagnostics -Xlint:all,-static T4880220.java + * @compile/ref=T4880220.error.out/fail -XDrawDiagnostics -Werror -Xlint:all T4880220.java + */ + +public class T4880220 { + void m1() { + int good_1 = C.m(); + int good_2 = C.f; + int good_3 = C.x; + + C c = new C(); + int bad_inst_1 = c.m(); + int bad_inst_2 = c.f; + int bad_inst_3 = c.x; + + int bad_expr_1 = c().m(); + int bad_expr_2 = c().f; + int bad_expr_3 = c().x; + } + + void m2() { + Class good_1 = C.class; + Class good_2 = C[].class; + } + + C c() { + return new C(); + } + + static class C { + static int m() { return 0; } + static int f; + static final int x = 3; + } +} diff --git a/langtools/test/tools/javac/4880220/T4880220.warn.out b/langtools/test/tools/javac/4880220/T4880220.warn.out new file mode 100644 index 00000000000..beca4a385b0 --- /dev/null +++ b/langtools/test/tools/javac/4880220/T4880220.warn.out @@ -0,0 +1,7 @@ +T4880220.java:20:27: compiler.warn.static.not.qualified.by.type: kindname.method, T4880220.C +T4880220.java:21:27: compiler.warn.static.not.qualified.by.type: kindname.variable, T4880220.C +T4880220.java:22:27: compiler.warn.static.not.qualified.by.type: kindname.variable, T4880220.C +T4880220.java:24:29: compiler.warn.static.not.qualified.by.type: kindname.method, T4880220.C +T4880220.java:25:29: compiler.warn.static.not.qualified.by.type: kindname.variable, T4880220.C +T4880220.java:26:29: compiler.warn.static.not.qualified.by.type: kindname.variable, T4880220.C +6 warnings diff --git a/langtools/test/tools/javac/6341866/Anno.java b/langtools/test/tools/javac/6341866/Anno.java index 0b7dcd04a69..706708f5ab9 100644 --- a/langtools/test/tools/javac/6341866/Anno.java +++ b/langtools/test/tools/javac/6341866/Anno.java @@ -27,7 +27,6 @@ import javax.lang.model.*; import javax.lang.model.element.*; @SupportedAnnotationTypes("*") - @SupportedSourceVersion(SourceVersion.RELEASE_7) public class Anno extends AbstractProcessor { public boolean process(Set annotations, RoundEnvironment roundEnv) { @@ -35,4 +34,9 @@ public class Anno extends AbstractProcessor { // System.err.println("annotation processing"); return true; } + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } } diff --git a/langtools/test/tools/javac/6902720/E1.java b/langtools/test/tools/javac/6902720/E1.java new file mode 100644 index 00000000000..15ab8b4c96f --- /dev/null +++ b/langtools/test/tools/javac/6902720/E1.java @@ -0,0 +1,28 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +enum E1 { + A, + B { }, + C { void m() { } }; +} diff --git a/langtools/test/tools/javac/6902720/E2.java b/langtools/test/tools/javac/6902720/E2.java new file mode 100644 index 00000000000..6f76f1468c3 --- /dev/null +++ b/langtools/test/tools/javac/6902720/E2.java @@ -0,0 +1,29 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +enum E2 { + A(1), + B(2) { }, + C(3) { void m() { } }; + E2(int i) { } +} diff --git a/langtools/test/tools/javac/6902720/Test.java b/langtools/test/tools/javac/6902720/Test.java new file mode 100644 index 00000000000..76d8501550c --- /dev/null +++ b/langtools/test/tools/javac/6902720/Test.java @@ -0,0 +1,91 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.io.*; +import java.net.*; +import javax.tools.*; +import java.util.*; + +import com.sun.source.tree.CompilationUnitTree; +import com.sun.source.util.JavacTask; +import com.sun.tools.javac.api.JavacTool; +import com.sun.tools.javac.tree.JCTree; +import com.sun.tools.javac.tree.Pretty; + +/** + * @test + * @bug 6902720 + * @summary javac pretty printer does not handle enums correctly + */ + +public class Test { + + public static void main(String[] args) throws Exception { + Test t = new Test(); + t.run("E1.java", "E2.java"); + } + + void run(String... args) throws Exception { + File testSrcDir = new File(System.getProperty("test.src")); + for (String arg: args) { + test(new File(testSrcDir, arg)); + } + } + + void test(File test) throws Exception { + JavacTool tool1 = JavacTool.create(); + StandardJavaFileManager fm = tool1.getStandardFileManager(null, null, null); + Iterable files = fm.getJavaFileObjects(test); + + // parse test file into a tree, and write it out to a stringbuffer using Pretty + JavacTask t1 = tool1.getTask(null, fm, null, null, null, files); + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + Iterable trees = t1.parse(); + for (CompilationUnitTree tree: trees) { + new Pretty(pw, true).printExpr((JCTree) tree); + } + pw.close(); + + final String out = sw.toString(); + System.err.println("generated code:\n" + out + "\n"); + + // verify the generated code is valid Java by compiling it + JavacTool tool2 = JavacTool.create(); + JavaFileObject fo = new SimpleJavaFileObject(URI.create("output"), JavaFileObject.Kind.SOURCE) { + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return out; + } + }; + JavacTask t2 = tool2.getTask(null, fm, null, null, null, Collections.singleton(fo)); + boolean ok = t2.call(); + if (!ok) + throw new Exception("compilation of generated code failed"); + + File expectedClass = new File(test.getName().replace(".java", ".class")); + if (!expectedClass.exists()) + throw new Exception(expectedClass + " not found"); + } +} + diff --git a/langtools/test/tools/javac/EarlyAssert.java b/langtools/test/tools/javac/EarlyAssert.java index df24f5428e2..a10d1bfa009 100644 --- a/langtools/test/tools/javac/EarlyAssert.java +++ b/langtools/test/tools/javac/EarlyAssert.java @@ -27,6 +27,8 @@ * @summary Verify that assertions are enabled before the class is initialized * and not thereafter * @author gafter + * @build EarlyAssert EarlyAssertWrapper + * @run main EarlyAssertWrapper */ /* diff --git a/langtools/test/tools/javac/EarlyAssertWrapper.java b/langtools/test/tools/javac/EarlyAssertWrapper.java new file mode 100644 index 00000000000..5ecf3034d05 --- /dev/null +++ b/langtools/test/tools/javac/EarlyAssertWrapper.java @@ -0,0 +1,83 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.io.*; +import java.util.*; + +/* + * Wrapper for the EarlyAssert test to run the test in a JVM without assertions + * enabled. + */ +public class EarlyAssertWrapper { + public static void main(String... args) throws Exception { + EarlyAssertWrapper w = new EarlyAssertWrapper(); + w.run(); + } + + void run() throws Exception { + List cmd = new ArrayList(); + File java_home = new File(System.getProperty("java.home")); + if (java_home.getName().equals("jre")) + java_home = java_home.getParentFile(); + cmd.add(new File(new File(java_home, "bin"), "java").getPath()); + + // ensure we run with the same bootclasspath as this test, + // in case this test is being run with -Xbootclasspath + cmd.add("-Xbootclasspath:" + System.getProperty("sun.boot.class.path")); + + // propogate classpath + cmd.add("-classpath"); + cmd.add(System.getProperty("java.class.path")); + + // ensure all assertions disabled in target VM + cmd.add("-da"); + cmd.add("-dsa"); + + cmd.add("EarlyAssert"); + + System.err.println("Running command: " + cmd); + + ProcessBuilder pb = new ProcessBuilder(cmd); + pb.redirectErrorStream(true); + Process p = pb.start(); + p.getOutputStream().close(); + + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + + String line; + DataInputStream in = new DataInputStream(p.getInputStream()); + try { + while ((line = in.readLine()) != null) + pw.println(line); + } finally { + in.close(); + } + pw.close(); + + String out = sw.toString(); + int rc = p.waitFor(); + if (rc != 0 || out.length() > 0) + throw new Error("failed: rc=" + rc + (out.length() > 0 ? ": " + out : "")); + } +} diff --git a/langtools/test/tools/javac/T6326754.java b/langtools/test/tools/javac/T6326754.java new file mode 100644 index 00000000000..b04f311abde --- /dev/null +++ b/langtools/test/tools/javac/T6326754.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6326754 + * @summary Compiler will fail to handle -Xmaxerrs with -ve numbers + * + * @compile/fail/ref=T6326754.out -XDrawDiagnostics -Xmaxerrs -1 T6326754.java + * @compile/fail/ref=T6326754.out -XDrawDiagnostics -Xmaxerrs 0 T6326754.java + * @compile/fail/ref=T6326754.out -XDrawDiagnostics -Xmaxerrs 10 T6326754.java + * @compile/fail/ref=T6326754.out -XDrawDiagnostics T6326754.java + */ +class TestConstructor{ + T t; + K k; + public TestConstructor(T t,K k){ + this.t =t; + } + public TestConstructor(K k){ + this.k = k; + this.t = null; + } + public TestConstructor(T t){ + this.t=t; + this.k=null; + } + public void setT(T t){ + this.t=t; + this.k=null; + } + public void setT(K k){ + this.k = k; + this.t = null; + } + public void setT(T t,K k){ + this.t = t; + this.k = k; + } +} +class TestC{ + T t; + public void setT(T t){ + this.t = t; + } +} +public class T6326754{ + public static void main(String... arg){ + TestC tC =new TestC(); + tC.setT(); + TestConstructor tc = new TestConstructor("saaa"); + tc.setT("sasa"); + TestC tC1 = new TestC(); + tC1.setT(545); + } +} diff --git a/langtools/test/tools/javac/T6326754.out b/langtools/test/tools/javac/T6326754.out new file mode 100644 index 00000000000..efbd8393b8b --- /dev/null +++ b/langtools/test/tools/javac/T6326754.out @@ -0,0 +1,7 @@ +T6326754.java:44:12: compiler.err.name.clash.same.erasure: TestConstructor(T), TestConstructor(K) +T6326754.java:52:17: compiler.err.name.clash.same.erasure: setT(K), setT(T) +T6326754.java:64:18: compiler.err.prob.found.req: (compiler.misc.incompatible.types), T, T +T6326754.java:70:11: compiler.err.cant.apply.symbol: kindname.method, setT, java.lang.Object, compiler.misc.no.args, kindname.class, TestC, null +- compiler.note.unchecked.filename: T6326754.java +- compiler.note.unchecked.recompile +4 errors diff --git a/langtools/test/tools/javac/T6403466.java b/langtools/test/tools/javac/T6403466.java index c75450a905f..6ed37d7e0c0 100644 --- a/langtools/test/tools/javac/T6403466.java +++ b/langtools/test/tools/javac/T6403466.java @@ -41,7 +41,6 @@ import com.sun.tools.javac.api.JavacTool; @Wrap @SupportedAnnotationTypes("Wrap") -@SupportedSourceVersion(SourceVersion.RELEASE_6) public class T6403466 extends AbstractProcessor { static final String testSrcDir = System.getProperty("test.src"); @@ -73,24 +72,31 @@ public class T6403466 extends AbstractProcessor { } public boolean process(Set annos, RoundEnvironment rEnv) { - Filer filer = processingEnv.getFiler(); - for (TypeElement anno: annos) { - Set elts = rEnv.getElementsAnnotatedWith(anno); - System.err.println("anno: " + anno); - System.err.println("elts: " + elts); - for (TypeElement te: ElementFilter.typesIn(elts)) { - try { - Writer out = filer.createSourceFile(te.getSimpleName() + "Wrapper").openWriter(); - out.write("class " + te.getSimpleName() + "Wrapper { }"); - out.close(); - } catch (IOException ex) { - ex.printStackTrace(); + if (!rEnv.processingOver()) { + Filer filer = processingEnv.getFiler(); + for (TypeElement anno: annos) { + Set elts = rEnv.getElementsAnnotatedWith(anno); + System.err.println("anno: " + anno); + System.err.println("elts: " + elts); + for (TypeElement te: ElementFilter.typesIn(elts)) { + try { + Writer out = filer.createSourceFile(te.getSimpleName() + "Wrapper").openWriter(); + out.write("class " + te.getSimpleName() + "Wrapper { }"); + out.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } } - } + } } return true; } + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } } @Retention(RetentionPolicy.SOURCE) diff --git a/langtools/test/tools/javac/T6406771.java b/langtools/test/tools/javac/T6406771.java index 6011dd643f9..c41496d4f35 100644 --- a/langtools/test/tools/javac/T6406771.java +++ b/langtools/test/tools/javac/T6406771.java @@ -17,7 +17,7 @@ import com.sun.source.tree.*; import com.sun.source.util.*; import com.sun.tools.javac.tree.JCTree; -@SupportedSourceVersion(SourceVersion.RELEASE_6) + @SupportedAnnotationTypes("*") public class T6406771 extends AbstractProcessor { String[] tests = { @@ -95,4 +95,8 @@ public class T6406771 extends AbstractProcessor { return true; } + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } } diff --git a/langtools/test/tools/javac/T6411379.java b/langtools/test/tools/javac/T6411379.java index c61fc2deaa1..f27cf12d391 100644 --- a/langtools/test/tools/javac/T6411379.java +++ b/langtools/test/tools/javac/T6411379.java @@ -37,7 +37,6 @@ import com.sun.source.tree.*; import com.sun.source.util.*; @SupportedAnnotationTypes("*") -@SupportedSourceVersion(SourceVersion.RELEASE_6) public class T6411379 extends AbstractProcessor { public boolean process(Set annoElems, @@ -58,6 +57,11 @@ public class T6411379 extends AbstractProcessor { return true; } + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + public void checkNull(Object o) { if (o != null) throw new AssertionError("expected null"); diff --git a/langtools/test/tools/javac/T6423583.java b/langtools/test/tools/javac/T6423583.java index 7943104539c..984415115bf 100644 --- a/langtools/test/tools/javac/T6423583.java +++ b/langtools/test/tools/javac/T6423583.java @@ -37,7 +37,6 @@ import com.sun.source.tree.*; import com.sun.source.util.*; @SupportedAnnotationTypes("*") -@SupportedSourceVersion(SourceVersion.RELEASE_6) public class T6423583 extends AbstractProcessor { boolean b1 = true; boolean b2 = false; @@ -59,6 +58,10 @@ public class T6423583 extends AbstractProcessor { return true; } + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } private static class Test extends TreeScanner { diff --git a/langtools/test/tools/javac/T6472751.java b/langtools/test/tools/javac/T6472751.java new file mode 100644 index 00000000000..2f3e63f3ef5 --- /dev/null +++ b/langtools/test/tools/javac/T6472751.java @@ -0,0 +1,81 @@ +/* + * Copyright 2006-2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6472751 + * @summary SourcePositions.getStartPos returns incorrect value for enum constants + * @author Peter Ahe + */ + +import com.sun.source.tree.CompilationUnitTree; +import com.sun.source.tree.Tree; +import com.sun.source.tree.Tree.Kind; +import com.sun.source.util.JavacTask; +import com.sun.source.util.SourcePositions; +import com.sun.source.util.TreeScanner; +import com.sun.source.util.Trees; +import com.sun.tools.javac.util.List; +import java.io.IOException; +import java.net.URI; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileObject; +import javax.tools.SimpleJavaFileObject; +import javax.tools.ToolProvider; + +public class T6472751 { + static class MyFileObject extends SimpleJavaFileObject { + public MyFileObject() { + super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE); + } + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return "public enum Test { ABC, DEF; }"; + } + } + static Trees trees; + static SourcePositions positions; + public static void main(String[] args) throws IOException { + JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); + JavacTask task = (JavacTask) compiler.getTask(null, null, null, null, null, List.of(new MyFileObject())); + trees = Trees.instance(task); + positions = trees.getSourcePositions(); + Iterable asts = task.parse(); + for (CompilationUnitTree ast : asts) { + new MyVisitor().scan(ast, null); + } + } + + static class MyVisitor extends TreeScanner { + @Override + public Void scan(Tree node, Void ignored) { + if (node == null) + return null; + Kind k = node.getKind(); + long pos = positions.getStartPosition(null,node); + System.out.format("%s: %s%n", k, pos); + if (k != Kind.MODIFIERS && pos < 0) + throw new Error("unexpected position found"); + return super.scan(node, ignored); + } + } +} diff --git a/langtools/test/tools/javac/T6567414.java b/langtools/test/tools/javac/T6567414.java new file mode 100644 index 00000000000..1a2fa48c840 --- /dev/null +++ b/langtools/test/tools/javac/T6567414.java @@ -0,0 +1,11 @@ +/* + * @test /nodynamiccopyright/ + * @bug 6567414 + * @summary javac compiler reports no source file or line on enum constant declaration error + * @compile/fail/ref=T6567414.out -XDrawDiagnostics T6567414.java + */ +enum Test { + FOO; + Test() throws Exception {} +} + diff --git a/langtools/test/tools/javac/T6567414.out b/langtools/test/tools/javac/T6567414.out new file mode 100644 index 00000000000..0f332d24cb9 --- /dev/null +++ b/langtools/test/tools/javac/T6567414.out @@ -0,0 +1,2 @@ +T6567414.java:8:3: compiler.err.unreported.exception.need.to.catch.or.throw: java.lang.Exception +1 error diff --git a/langtools/test/tools/javac/T6654037.java b/langtools/test/tools/javac/T6654037.java new file mode 100644 index 00000000000..3c4dabeb7fc --- /dev/null +++ b/langtools/test/tools/javac/T6654037.java @@ -0,0 +1,76 @@ +/* + * Copyright 2008-2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6654037 + * @summary JCTree.pos may be incorrect for BinaryTrees + */ + +import com.sun.source.tree.BinaryTree; +import com.sun.source.tree.ClassTree; +import com.sun.source.tree.CompilationUnitTree; +import com.sun.source.tree.MethodTree; +import com.sun.source.tree.VariableTree; +import com.sun.tools.javac.api.JavacTaskImpl; +import com.sun.tools.javac.tree.JCTree; +import java.net.URI; +import java.util.Arrays; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileObject; +import javax.tools.SimpleJavaFileObject; +import javax.tools.ToolProvider; + +public class T6654037 { + + public static void main(String[] args) throws Exception { + final String bootPath = System.getProperty("sun.boot.class.path"); //NOI18N + final JavaCompiler tool = ToolProvider.getSystemJavaCompiler(); + assert tool != null; + + String code = "package test; public class Test {private void test() {Object o = null; boolean b = o != null && o instanceof String;} private Test() {}}"; + + JavacTaskImpl ct = (JavacTaskImpl) tool.getTask(null, null, null, Arrays.asList("-bootclasspath", bootPath, "-Xjcov"), null, Arrays.asList(new MyFileObject(code))); + CompilationUnitTree cut = ct.parse().iterator().next(); + ClassTree clazz = (ClassTree) cut.getTypeDecls().get(0); + MethodTree method = (MethodTree) clazz.getMembers().get(0); + VariableTree condSt = (VariableTree) method.getBody().getStatements().get(1); + BinaryTree cond = (BinaryTree) condSt.getInitializer(); + JCTree condJC = (JCTree) cond; + + if (condJC.pos != 93) + throw new IllegalStateException("Unexpected position=" + condJC.pos); + } + + static class MyFileObject extends SimpleJavaFileObject { + private String text; + public MyFileObject(String text) { + super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE); + this.text = text; + } + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return text; + } + } +} diff --git a/langtools/test/tools/javac/T6665791.java b/langtools/test/tools/javac/T6665791.java new file mode 100644 index 00000000000..8a258f8e66a --- /dev/null +++ b/langtools/test/tools/javac/T6665791.java @@ -0,0 +1,81 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6665791 + * @summary com.sun.source.tree.MethodTree.toString() does not output default values + */ + +import java.io.File; +import java.io.IOException; +import java.io.StringWriter; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileObject; +import javax.tools.StandardJavaFileManager; +import javax.tools.ToolProvider; +import com.sun.source.tree.ClassTree; +import com.sun.source.util.JavacTask; +import com.sun.source.util.TreeScanner; +import java.io.FileWriter; + +public class T6665791 { + static String test = "public @interface Annotation { boolean booleanProperty() default false; }"; + static File test_java = new File("Test.java"); + + public static void main(String[] args) throws Exception { + write(test_java, test); + + JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); + StandardJavaFileManager manager = + compiler.getStandardFileManager(null, null, null); + Iterable units = manager.getJavaFileObjects(test_java); + final StringWriter sw = new StringWriter(); + JavacTask task = (JavacTask) compiler.getTask(sw, manager, null, null, + null, units); + + new TreeScanner() { + @Override + public Boolean visitClass(ClassTree arg0, Void arg1) { + sw.write(arg0.toString()); + return super.visitClass(arg0, arg1); + } + }.scan(task.parse(), null); + + System.out.println("output:"); + System.out.println(sw.toString()); + String found = sw.toString().replaceAll("\\s+", " ").trim(); + String expect = test.replaceAll("\\s+", " ").trim(); + if (!expect.equals(found)) { + System.out.println("expect: " + expect); + System.out.println("found: " + found); + throw new Exception("unexpected output"); + } + } + + static void write(File file, String body) throws IOException { + FileWriter out = new FileWriter(file); + out.write(body); + out.close(); + } +} diff --git a/langtools/test/tools/javac/T6855236.java b/langtools/test/tools/javac/T6855236.java new file mode 100644 index 00000000000..79c2dae15c3 --- /dev/null +++ b/langtools/test/tools/javac/T6855236.java @@ -0,0 +1,99 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6855236 + * @summary Compiler Tree API TreePath class generates NullPointerException from Iterator + * @compile T6855236.java + * @compile -processor T6855236 -proc:only T6855236.java + */ + +import java.util.*; + +import javax.annotation.processing.*; +import javax.lang.model.*; +import javax.lang.model.element.*; + +import com.sun.source.tree.*; +import com.sun.source.util.*; + +@SupportedAnnotationTypes("*") +public class T6855236 extends AbstractProcessor { + + private Trees trees; + + @Override + public void init(ProcessingEnvironment pe) { + super.init(pe); + trees = Trees.instance(pe); + } + + @Override + public boolean process(Set arg0, RoundEnvironment roundEnvironment) { + // Scanner class to scan through various component elements + CodeVisitor visitor = new CodeVisitor(); + + for (Element e : roundEnvironment.getRootElements()) { + TreePath tp = trees.getPath(e); + visitor.scan(tp, trees); + } + + return true; + } + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + + class CodeVisitor extends TreePathScanner { + + @Override + public Object visitMethodInvocation(MethodInvocationTree node, Trees p) { + System.out.print("current path: "); + for (Tree t : getCurrentPath()) { + System.out.print('/'); + System.out.print(t); + } + System.out.println(); + System.out.println("parent path: " + getCurrentPath().getParentPath()); + System.out.println("method select: " + node.getMethodSelect().toString()); + for (ExpressionTree arg : node.getArguments()) { + System.out.println("argument: " + arg.toString()); + } + return super.visitMethodInvocation(node, p); + } + + @Override + public Object visitExpressionStatement(ExpressionStatementTree node, Trees p) { + ExpressionTree t = node.getExpression(); + System.out.println("expression statement: " + t.toString()); + return super.visitExpressionStatement(node, p); + } + + } + +} + + diff --git a/langtools/test/tools/javac/T6881645.java b/langtools/test/tools/javac/T6881645.java new file mode 100644 index 00000000000..bdb239ae3f1 --- /dev/null +++ b/langtools/test/tools/javac/T6881645.java @@ -0,0 +1,38 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @summary Unchecked method call on a method declared inside anonymous inner causes javac to crash + * @compile -Xlint:unchecked T6881645.java + */ + +class T6881645 { + Object o = new Object() { + void m (Class x) {} + void test() { + m((Class)null); + } + }; +} + diff --git a/langtools/test/tools/javac/ThrowsIntersection_1.java b/langtools/test/tools/javac/ThrowsIntersection_1.java index 7e02ff47a59..b1f09c52178 100644 --- a/langtools/test/tools/javac/ThrowsIntersection_1.java +++ b/langtools/test/tools/javac/ThrowsIntersection_1.java @@ -30,6 +30,8 @@ * @compile ThrowsIntersection_1.java */ +package ThrowsIntersection_1; + class Ex1 extends Exception {} class Ex2 extends Exception {} diff --git a/langtools/test/tools/javac/ThrowsIntersection_2.java b/langtools/test/tools/javac/ThrowsIntersection_2.java index b685b6bd64d..9211722e8f7 100644 --- a/langtools/test/tools/javac/ThrowsIntersection_2.java +++ b/langtools/test/tools/javac/ThrowsIntersection_2.java @@ -30,6 +30,8 @@ * @compile ThrowsIntersection_2.java */ +package ThrowsIntersection_2; + class Ex1 extends Exception {} class Ex2 extends Exception {} class Ex3 extends Exception {} diff --git a/langtools/test/tools/javac/ThrowsIntersection_3.java b/langtools/test/tools/javac/ThrowsIntersection_3.java index 035cd075e51..7e70d987928 100644 --- a/langtools/test/tools/javac/ThrowsIntersection_3.java +++ b/langtools/test/tools/javac/ThrowsIntersection_3.java @@ -30,6 +30,8 @@ * @run compile/fail ThrowsIntersection_3.java */ +package ThrowsIntersection_3; + class Ex1 extends Exception {} class Ex2 extends Exception {} diff --git a/langtools/test/tools/javac/ThrowsIntersection_4.java b/langtools/test/tools/javac/ThrowsIntersection_4.java index c6b319c3784..8cf2c871192 100644 --- a/langtools/test/tools/javac/ThrowsIntersection_4.java +++ b/langtools/test/tools/javac/ThrowsIntersection_4.java @@ -30,6 +30,8 @@ * @run compile/fail ThrowsIntersection_4.java */ +package ThrowsIntersection_4; + // Note: This is the test that actually failed for 4042259. The others are for completeness. class Ex1 extends Exception {} diff --git a/langtools/test/tools/javac/annotations/neg/Constant.java b/langtools/test/tools/javac/annotations/neg/Constant.java index 8935a51a34b..8455cf0cbae 100644 --- a/langtools/test/tools/javac/annotations/neg/Constant.java +++ b/langtools/test/tools/javac/annotations/neg/Constant.java @@ -30,7 +30,7 @@ * @compile/fail Constant.java */ -package test.tools.javac.annotation.Constant; +package Constant; @T(a = X.x) @interface T { diff --git a/langtools/test/tools/javac/api/6421111/T6421111.java b/langtools/test/tools/javac/api/6421111/T6421111.java index 46666fbfa6f..6f0ce77a6d8 100644 --- a/langtools/test/tools/javac/api/6421111/T6421111.java +++ b/langtools/test/tools/javac/api/6421111/T6421111.java @@ -76,7 +76,6 @@ public class T6421111 extends ToolTester { throw new AssertionError("Annotation processor failed"); } @SupportedAnnotationTypes("*") - @SupportedSourceVersion(SourceVersion.RELEASE_6) static class MyProcessor extends AbstractProcessor { void test(TypeElement element, boolean fbound) { TypeParameterElement tpe = element.getTypeParameters().iterator().next(); @@ -96,6 +95,10 @@ public class T6421111 extends ToolTester { test(processingEnv.getElementUtils().getTypeElement("Test2"), true); return false; } + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } } public static void main(String... args) { new T6421111().test(args); diff --git a/langtools/test/tools/javac/api/6468404/T6468404.java b/langtools/test/tools/javac/api/6468404/T6468404.java index 10a8e58e353..8a4f03215ad 100644 --- a/langtools/test/tools/javac/api/6468404/T6468404.java +++ b/langtools/test/tools/javac/api/6468404/T6468404.java @@ -105,7 +105,6 @@ class DummyFO extends SimpleJavaFileObject { } @SupportedAnnotationTypes("*") -@SupportedSourceVersion(SourceVersion.RELEASE_6) class P extends AbstractProcessor { boolean ran = false; @@ -145,4 +144,9 @@ class P extends AbstractProcessor { } return true; } + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } } diff --git a/langtools/test/tools/javac/api/T6412669.java b/langtools/test/tools/javac/api/T6412669.java index 9e6c5799eab..31f70e7d4b7 100644 --- a/langtools/test/tools/javac/api/T6412669.java +++ b/langtools/test/tools/javac/api/T6412669.java @@ -38,7 +38,6 @@ import com.sun.source.util.*; import com.sun.tools.javac.api.*; @SupportedAnnotationTypes("*") -@SupportedSourceVersion(SourceVersion.RELEASE_6) public class T6412669 extends AbstractProcessor { public static void main(String... args) throws IOException { String testSrc = System.getProperty("test.src", "."); @@ -72,4 +71,9 @@ public class T6412669 extends AbstractProcessor { } return true; } + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } } diff --git a/langtools/test/tools/javac/api/TestJavacTaskScanner.java b/langtools/test/tools/javac/api/TestJavacTaskScanner.java index 9b14a4f5c4f..d09f651869f 100644 --- a/langtools/test/tools/javac/api/TestJavacTaskScanner.java +++ b/langtools/test/tools/javac/api/TestJavacTaskScanner.java @@ -34,7 +34,10 @@ import com.sun.tools.javac.api.JavacTaskImpl; import com.sun.tools.javac.parser.*; // XXX import com.sun.tools.javac.util.*; // XXX import java.io.*; +import java.net.*; import java.nio.*; +import java.nio.charset.Charset; +import java.util.Arrays; import javax.lang.model.element.Element; import javax.lang.model.element.TypeElement; import javax.lang.model.type.DeclaredType; @@ -43,6 +46,10 @@ import javax.lang.model.util.Elements; import javax.lang.model.util.Types; import javax.tools.*; +import static javax.tools.StandardLocation.CLASS_PATH; +import static javax.tools.StandardLocation.SOURCE_PATH; +import static javax.tools.StandardLocation.CLASS_OUTPUT; + public class TestJavacTaskScanner extends ToolTester { final JavacTaskImpl task; @@ -56,6 +63,7 @@ public class TestJavacTaskScanner extends ToolTester { TestJavacTaskScanner(File file) { final Iterable compilationUnits = fm.getJavaFileObjects(new File[] {file}); + StandardJavaFileManager fm = getLocalFileManager(tool, null, null); task = (JavacTaskImpl)tool.getTask(null, fm, null, null, null, compilationUnits); task.getContext().put(Scanner.Factory.scannerFactoryKey, new MyScanner.Factory(task.getContext(), this)); @@ -83,7 +91,7 @@ public class TestJavacTaskScanner extends ToolTester { System.out.println("#parseTypeElements: " + numParseTypeElements); System.out.println("#allMembers: " + numAllMembers); - check(numTokens, "#Tokens", 891); + check(numTokens, "#Tokens", 1222); check(numParseTypeElements, "#parseTypeElements", 136); check(numAllMembers, "#allMembers", 67); } @@ -117,6 +125,47 @@ public class TestJavacTaskScanner extends ToolTester { numAllMembers++; } } + + /* Similar to ToolTester.getFileManager, except that this version also ensures + * javac classes will be available on the classpath. The javac classes are assumed + * to be on the classpath used to run this test (this is true when using jtreg). + * The classes are found by obtaining the URL for a sample javac class, using + * getClassLoader().getResource(), and then deconstructing the URL to find the + * underlying directory or jar file to place on the classpath. + */ + public StandardJavaFileManager getLocalFileManager(JavaCompiler tool, + DiagnosticListener dl, + Charset encoding) { + File javac_classes; + try { + final String javacMainClass = "com/sun/tools/javac/Main.class"; + URL url = getClass().getClassLoader().getResource(javacMainClass); + if (url == null) + throw new Error("can't locate javac classes"); + URI uri = url.toURI(); + String scheme = uri.getScheme(); + String ssp = uri.getSchemeSpecificPart(); + if (scheme.equals("jar")) { + javac_classes = new File(new URI(ssp.substring(0, ssp.indexOf("!/")))); + } else if (scheme.equals("file")) { + javac_classes = new File(ssp.substring(0, ssp.indexOf(javacMainClass))); + } else + throw new Error("unknown URL: " + url); + } catch (URISyntaxException e) { + throw new Error(e); + } + System.err.println("javac_classes: " + javac_classes); + + StandardJavaFileManager fm = tool.getStandardFileManager(dl, null, encoding); + try { + fm.setLocation(SOURCE_PATH, Arrays.asList(test_src)); + fm.setLocation(CLASS_PATH, Arrays.asList(test_classes, javac_classes)); + fm.setLocation(CLASS_OUTPUT, Arrays.asList(test_classes)); + } catch (IOException e) { + throw new AssertionError(e); + } + return fm; + } } class MyScanner extends Scanner { diff --git a/langtools/test/tools/javac/api/TestResolveError.java b/langtools/test/tools/javac/api/TestResolveError.java new file mode 100644 index 00000000000..31397de5d9a --- /dev/null +++ b/langtools/test/tools/javac/api/TestResolveError.java @@ -0,0 +1,101 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/** + * @test + * @bug 6930108 + * @summary IllegalArgumentException in AbstractDiagnosticFormatter for tools/javac/api/TestJavacTaskScanner.java + * @library ./lib + * @build ToolTester + * @run main TestResolveError + */ + +import java.io.*; +import javax.lang.model.element.Element; +import javax.lang.model.element.TypeElement; +import javax.lang.model.type.DeclaredType; +import javax.lang.model.type.TypeMirror; +import javax.lang.model.util.Elements; +import javax.lang.model.util.Types; +import javax.tools.*; + +import com.sun.tools.javac.api.JavacTaskImpl; + +/* + * This is a cut down version of TestJavacTaskScanner, which as originally written + * caused an IllegalArgumentException in AbstractDiagnosticFormatter as a result + * of calling task.parseType with a name whose resolution depended on the setting + * of the bootclasspath. + * This test has the same call, task.parseType("List", clazz), but checks + * that the error is handled in a reasonable way by javac. + */ +public class TestResolveError extends ToolTester { + public static void main(String... args) throws Exception { + new TestResolveError().run(); + } + + void run() throws Exception { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + File file = new File(test_src, "TestResolveError.java"); + final Iterable compilationUnits = + fm.getJavaFileObjects(new File[] {file}); + task = (JavacTaskImpl)tool.getTask(pw, fm, null, null, null, compilationUnits); + elements = task.getElements(); + types = task.getTypes(); + + Iterable toplevels; + try { + toplevels = task.enter(task.parse()); + } catch (IOException ex) { + throw new AssertionError(ex); + } + + for (TypeElement clazz : toplevels) { + System.out.format("Testing %s:%n%n", clazz.getSimpleName()); + // this should not cause any exception from the compiler, + // such as IllegalArgumentException + testParseType(clazz); + } + + pw.close(); + + String out = sw.toString(); + System.out.println(out); + + if (out.contains("com.sun.tools.javac.util")) + throw new Exception("Unexpected output from compiler"); + } + + void testParseType(TypeElement clazz) { + DeclaredType type = (DeclaredType)task.parseType("List", clazz); + for (Element member : elements.getAllMembers((TypeElement)type.asElement())) { + TypeMirror mt = types.asMemberOf(type, member); + System.out.format("%s : %s -> %s%n", member.getSimpleName(), member.asType(), mt); + } + } + + JavacTaskImpl task; + Elements elements; + Types types; +} diff --git a/langtools/test/tools/javac/enum/6424358/T6424358.java b/langtools/test/tools/javac/enum/6424358/T6424358.java index 366c545a2f7..87aaa187619 100644 --- a/langtools/test/tools/javac/enum/6424358/T6424358.java +++ b/langtools/test/tools/javac/enum/6424358/T6424358.java @@ -34,13 +34,12 @@ import java.util.Set; import javax.annotation.processing.*; import javax.lang.model.element.*; import javax.lang.model.util.*; +import javax.lang.model.SourceVersion; import static javax.tools.Diagnostic.Kind.*; -import static javax.lang.model.SourceVersion.RELEASE_6; @interface TestMe {} @SupportedAnnotationTypes("*") -@SupportedSourceVersion(RELEASE_6) public class T6424358 extends AbstractProcessor { @TestMe enum Test { FOO; } @@ -66,4 +65,9 @@ public class T6424358 extends AbstractProcessor { scan.scan(e); return true; } + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } } diff --git a/langtools/test/tools/javac/generics/Casting.java b/langtools/test/tools/javac/generics/Casting.java index e08544c5eb5..44398da4ae1 100644 --- a/langtools/test/tools/javac/generics/Casting.java +++ b/langtools/test/tools/javac/generics/Casting.java @@ -30,7 +30,7 @@ * @compile Casting.java */ -package test.tools.javac.generics.Casting; +package Casting; class Test {} diff --git a/langtools/test/tools/javac/generics/Casting3.java b/langtools/test/tools/javac/generics/Casting3.java index 87420811aa3..6010fded21a 100644 --- a/langtools/test/tools/javac/generics/Casting3.java +++ b/langtools/test/tools/javac/generics/Casting3.java @@ -30,7 +30,7 @@ * @compile Casting3.java */ -package test.tools.javac.generics.Casting3; +package Casting3; class A> { > void f() { diff --git a/langtools/test/tools/javac/generics/Casting4.java b/langtools/test/tools/javac/generics/Casting4.java index 698630ba997..c56f0c3aa5c 100644 --- a/langtools/test/tools/javac/generics/Casting4.java +++ b/langtools/test/tools/javac/generics/Casting4.java @@ -30,7 +30,7 @@ * @compile -Werror -Xlint:unchecked Casting4.java */ -package test.tools.javac.generics.Casting4; +package Casting4; class Casting4 { Integer f(Comparable c) { diff --git a/langtools/test/tools/javac/generics/InnerInterface1.java b/langtools/test/tools/javac/generics/InnerInterface1.java index 08bbb0f99fd..593fe90056b 100644 --- a/langtools/test/tools/javac/generics/InnerInterface1.java +++ b/langtools/test/tools/javac/generics/InnerInterface1.java @@ -30,7 +30,7 @@ * @compile InnerInterface1.java */ -package test.tools.javac.generics.InnerInterface1; +package InnerInterface1; interface Iterator { } diff --git a/langtools/test/tools/javac/generics/InnerInterface2.java b/langtools/test/tools/javac/generics/InnerInterface2.java index 50de843c109..9d85c0687cf 100644 --- a/langtools/test/tools/javac/generics/InnerInterface2.java +++ b/langtools/test/tools/javac/generics/InnerInterface2.java @@ -30,7 +30,7 @@ * @compile InnerInterface2.java */ -package test.tools.javac.generics.InnerInterface2; +package InnerInterface2; class Builder { diff --git a/langtools/test/tools/javac/generics/Multibound1.java b/langtools/test/tools/javac/generics/Multibound1.java index 681c7bd3c0c..79f43155bb6 100644 --- a/langtools/test/tools/javac/generics/Multibound1.java +++ b/langtools/test/tools/javac/generics/Multibound1.java @@ -30,7 +30,7 @@ * @compile/fail Multibound1.java */ -package test.tools.javac.generics.Multibound1; +package Multibound1; interface A {} interface B {} diff --git a/langtools/test/tools/javac/generics/MultipleInheritance.java b/langtools/test/tools/javac/generics/MultipleInheritance.java index d662949e1da..db95ed0a0ff 100644 --- a/langtools/test/tools/javac/generics/MultipleInheritance.java +++ b/langtools/test/tools/javac/generics/MultipleInheritance.java @@ -30,7 +30,7 @@ * @compile MultipleInheritance.java */ -package test.tools.javac.generics.MultipleInheritance; +package MultipleInheritance; import java.util.*; diff --git a/langtools/test/tools/javac/generics/NameOrder.java b/langtools/test/tools/javac/generics/NameOrder.java index d9cdcbc6a88..0aaf2ba26c2 100644 --- a/langtools/test/tools/javac/generics/NameOrder.java +++ b/langtools/test/tools/javac/generics/NameOrder.java @@ -27,22 +27,22 @@ * @summary generics: type inference failure due to a bug in ClassSymbol.isLess * @author gafter * - * @compile NameOrder.java + * @compile NameOrder.java */ -package test.tools.javac.generics.NameOrder; +package NameOrder; interface a {} interface b {} interface c {} -class A implements a, b {} -class B implements c, a {} +class AB implements a, b {} +class CA implements c, a {} // this is how to trigger a symptom: -abstract class C { +abstract class X { T f(T t1, T t2) { return null; } void g() { - a x = f( new A(), new B() ); + a x = f( new AB(), new CA() ); } } diff --git a/langtools/test/tools/javac/generics/PermuteBound.java b/langtools/test/tools/javac/generics/PermuteBound.java index 9481819476f..bfcc6182998 100644 --- a/langtools/test/tools/javac/generics/PermuteBound.java +++ b/langtools/test/tools/javac/generics/PermuteBound.java @@ -30,7 +30,7 @@ * @compile PermuteBound.java */ -package test.tools.javac.generics.PermuteBound; +package PermuteBound; class C {} diff --git a/langtools/test/tools/javac/generics/PrimitiveVariant.java b/langtools/test/tools/javac/generics/PrimitiveVariant.java index 5a11a5dbb8b..e5716f68234 100644 --- a/langtools/test/tools/javac/generics/PrimitiveVariant.java +++ b/langtools/test/tools/javac/generics/PrimitiveVariant.java @@ -30,7 +30,7 @@ * @compile/fail PrimitiveVariant.java */ -package test.tools.javac.generics.PrimitiveVariant; +package PrimitiveVariant; interface I { double m(); diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg01.out b/langtools/test/tools/javac/generics/diamond/neg/Neg01.out index f3beaa20181..83078458123 100644 --- a/langtools/test/tools/javac/generics/diamond/neg/Neg01.out +++ b/langtools/test/tools/javac/generics/diamond/neg/Neg01.out @@ -1,31 +1,31 @@ Neg01.java:18:15: compiler.err.not.within.bounds: java.lang.String Neg01.java:18:37: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg01, Neg01) -Neg01.java:19:25: compiler.err.not.within.bounds: ? extends java.lang.String +Neg01.java:19:15: compiler.err.not.within.bounds: ? extends java.lang.String Neg01.java:19:47: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number) Neg01.java:20:23: compiler.err.cant.resolve.location.args: kindname.constructor, Neg01, , java.lang.String, kindname.class, Neg01 -Neg01.java:21:23: compiler.err.not.within.bounds: ? super java.lang.String +Neg01.java:21:15: compiler.err.not.within.bounds: ? super java.lang.String Neg01.java:21:45: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg01, Neg01) Neg01.java:23:15: compiler.err.not.within.bounds: java.lang.String Neg01.java:23:37: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg01, Neg01) -Neg01.java:24:25: compiler.err.not.within.bounds: ? extends java.lang.String +Neg01.java:24:15: compiler.err.not.within.bounds: ? extends java.lang.String Neg01.java:24:47: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number) Neg01.java:25:23: compiler.err.cant.resolve.location.args: kindname.constructor, Neg01, , java.lang.String, kindname.class, Neg01 Neg01.java:25:38: compiler.err.cant.resolve.location.args: kindname.constructor, Neg01, , , kindname.class, Neg01 -Neg01.java:26:23: compiler.err.not.within.bounds: ? super java.lang.String +Neg01.java:26:15: compiler.err.not.within.bounds: ? super java.lang.String Neg01.java:26:45: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg01, Neg01) Neg01.java:28:15: compiler.err.not.within.bounds: java.lang.String Neg01.java:28:37: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg01, Neg01) -Neg01.java:29:25: compiler.err.not.within.bounds: ? extends java.lang.String +Neg01.java:29:15: compiler.err.not.within.bounds: ? extends java.lang.String Neg01.java:29:48: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number) Neg01.java:30:24: compiler.err.cant.resolve.location.args: kindname.constructor, Neg01, , java.lang.String,java.lang.String, kindname.class, Neg01 Neg01.java:31:9: compiler.err.cant.resolve.location: kindname.class, Foo, , , kindname.class, Neg01 Neg01.java:31:35: compiler.err.cant.resolve.location.args: kindname.constructor, Neg01, , java.lang.String,java.lang.String, kindname.class, Neg01 Neg01.java:33:15: compiler.err.not.within.bounds: java.lang.String Neg01.java:33:38: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg01, Neg01) -Neg01.java:34:25: compiler.err.not.within.bounds: ? extends java.lang.String +Neg01.java:34:15: compiler.err.not.within.bounds: ? extends java.lang.String Neg01.java:34:48: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number) Neg01.java:35:24: compiler.err.cant.resolve.location.args: kindname.constructor, Neg01, , java.lang.String,java.lang.String, kindname.class, Neg01 Neg01.java:35:43: compiler.err.cant.resolve.location.args: kindname.constructor, Neg01, , , kindname.class, Neg01 -Neg01.java:36:23: compiler.err.not.within.bounds: ? super java.lang.String +Neg01.java:36:15: compiler.err.not.within.bounds: ? super java.lang.String Neg01.java:36:46: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg01, Neg01) 30 errors diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg02.out b/langtools/test/tools/javac/generics/diamond/neg/Neg02.out index 9dc68ad86e0..27d7cb097f0 100644 --- a/langtools/test/tools/javac/generics/diamond/neg/Neg02.out +++ b/langtools/test/tools/javac/generics/diamond/neg/Neg02.out @@ -1,61 +1,61 @@ Neg02.java:19:13: compiler.err.not.within.bounds: java.lang.String Neg02.java:19:33: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo, Neg02.Foo) -Neg02.java:20:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg02.java:20:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg02.java:20:43: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number) Neg02.java:21:21: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Neg02.Foo -Neg02.java:22:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg02.java:22:13: compiler.err.not.within.bounds: ? super java.lang.String Neg02.java:22:41: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo, Neg02.Foo) Neg02.java:24:13: compiler.err.not.within.bounds: java.lang.String Neg02.java:24:33: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo, Neg02.Foo) -Neg02.java:25:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg02.java:25:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg02.java:25:43: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number) Neg02.java:26:21: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Neg02.Foo Neg02.java:26:34: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Neg02.Foo -Neg02.java:27:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg02.java:27:13: compiler.err.not.within.bounds: ? super java.lang.String Neg02.java:27:41: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo, Neg02.Foo) Neg02.java:29:13: compiler.err.not.within.bounds: java.lang.String Neg02.java:29:33: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo, Neg02.Foo) -Neg02.java:30:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg02.java:30:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg02.java:30:44: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number) Neg02.java:31:22: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Neg02.Foo -Neg02.java:32:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg02.java:32:13: compiler.err.not.within.bounds: ? super java.lang.String Neg02.java:32:42: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo, Neg02.Foo) Neg02.java:34:13: compiler.err.not.within.bounds: java.lang.String Neg02.java:34:34: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo, Neg02.Foo) -Neg02.java:35:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg02.java:35:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg02.java:35:44: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number) Neg02.java:36:22: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Neg02.Foo Neg02.java:36:39: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Neg02.Foo -Neg02.java:37:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg02.java:37:13: compiler.err.not.within.bounds: ? super java.lang.String Neg02.java:37:42: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo, Neg02.Foo) Neg02.java:41:13: compiler.err.not.within.bounds: java.lang.String Neg02.java:41:39: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo, Neg02.Foo) -Neg02.java:42:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg02.java:42:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg02.java:42:49: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number) Neg02.java:43:21: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Neg02.Foo -Neg02.java:44:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg02.java:44:13: compiler.err.not.within.bounds: ? super java.lang.String Neg02.java:44:47: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo, Neg02.Foo) Neg02.java:46:13: compiler.err.not.within.bounds: java.lang.String Neg02.java:46:39: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo, Neg02.Foo) -Neg02.java:47:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg02.java:47:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg02.java:47:49: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number) Neg02.java:48:21: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Neg02.Foo Neg02.java:48:40: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Neg02.Foo -Neg02.java:49:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg02.java:49:13: compiler.err.not.within.bounds: ? super java.lang.String Neg02.java:49:47: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo, Neg02.Foo) Neg02.java:51:13: compiler.err.not.within.bounds: java.lang.String Neg02.java:51:39: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo, Neg02.Foo) -Neg02.java:52:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg02.java:52:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg02.java:52:50: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number) Neg02.java:53:22: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Neg02.Foo -Neg02.java:54:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg02.java:54:13: compiler.err.not.within.bounds: ? super java.lang.String Neg02.java:54:48: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo, Neg02.Foo) Neg02.java:56:13: compiler.err.not.within.bounds: java.lang.String Neg02.java:56:40: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo, Neg02.Foo) -Neg02.java:57:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg02.java:57:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg02.java:57:50: compiler.err.cant.apply.diamond: X, (compiler.misc.no.unique.maximal.instance.exists: X, java.lang.String,java.lang.Number) Neg02.java:58:22: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Neg02.Foo Neg02.java:58:45: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Neg02.Foo -Neg02.java:59:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg02.java:59:13: compiler.err.not.within.bounds: ? super java.lang.String Neg02.java:59:48: compiler.err.cant.apply.diamond: X, (compiler.misc.no.conforming.instance.exists: X, Neg02.Foo, Neg02.Foo) 60 errors diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg03.out b/langtools/test/tools/javac/generics/diamond/neg/Neg03.out index bf30c712d1f..287df896e0b 100644 --- a/langtools/test/tools/javac/generics/diamond/neg/Neg03.out +++ b/langtools/test/tools/javac/generics/diamond/neg/Neg03.out @@ -1,91 +1,91 @@ Neg03.java:19:13: compiler.err.not.within.bounds: java.lang.String Neg03.java:19:33: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) -Neg03.java:20:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg03.java:20:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg03.java:20:43: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number) Neg03.java:21:21: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Neg03.Foo -Neg03.java:22:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg03.java:22:13: compiler.err.not.within.bounds: ? super java.lang.String Neg03.java:22:41: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) Neg03.java:24:13: compiler.err.not.within.bounds: java.lang.String Neg03.java:24:33: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) -Neg03.java:25:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg03.java:25:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg03.java:25:43: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number) Neg03.java:26:21: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Neg03.Foo Neg03.java:26:34: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Neg03.Foo -Neg03.java:27:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg03.java:27:13: compiler.err.not.within.bounds: ? super java.lang.String Neg03.java:27:41: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) Neg03.java:29:13: compiler.err.not.within.bounds: java.lang.String Neg03.java:29:33: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) -Neg03.java:30:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg03.java:30:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg03.java:30:44: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number) Neg03.java:31:22: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Neg03.Foo -Neg03.java:32:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg03.java:32:13: compiler.err.not.within.bounds: ? super java.lang.String Neg03.java:32:42: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) Neg03.java:34:13: compiler.err.not.within.bounds: java.lang.String Neg03.java:34:34: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) -Neg03.java:35:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg03.java:35:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg03.java:35:44: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number) Neg03.java:36:22: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Neg03.Foo Neg03.java:36:39: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Neg03.Foo -Neg03.java:37:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg03.java:37:13: compiler.err.not.within.bounds: ? super java.lang.String Neg03.java:37:42: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) Neg03.java:41:13: compiler.err.not.within.bounds: java.lang.String Neg03.java:41:42: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) -Neg03.java:42:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg03.java:42:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg03.java:42:52: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number) Neg03.java:43:21: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Neg03.Foo -Neg03.java:44:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg03.java:44:13: compiler.err.not.within.bounds: ? super java.lang.String Neg03.java:44:50: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) Neg03.java:46:13: compiler.err.not.within.bounds: java.lang.String Neg03.java:46:42: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) -Neg03.java:47:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg03.java:47:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg03.java:47:52: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number) Neg03.java:48:21: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Neg03.Foo Neg03.java:48:43: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Neg03.Foo -Neg03.java:49:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg03.java:49:13: compiler.err.not.within.bounds: ? super java.lang.String Neg03.java:49:50: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) Neg03.java:51:13: compiler.err.not.within.bounds: java.lang.String Neg03.java:51:42: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) -Neg03.java:52:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg03.java:52:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg03.java:52:53: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number) Neg03.java:53:22: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Neg03.Foo -Neg03.java:54:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg03.java:54:13: compiler.err.not.within.bounds: ? super java.lang.String Neg03.java:54:51: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) Neg03.java:56:13: compiler.err.not.within.bounds: java.lang.String Neg03.java:56:43: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) -Neg03.java:57:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg03.java:57:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg03.java:57:53: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number) Neg03.java:58:22: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Neg03.Foo Neg03.java:58:48: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Neg03.Foo -Neg03.java:59:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg03.java:59:13: compiler.err.not.within.bounds: ? super java.lang.String Neg03.java:59:51: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) Neg03.java:63:13: compiler.err.not.within.bounds: java.lang.String Neg03.java:63:28: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) -Neg03.java:64:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg03.java:64:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg03.java:64:38: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number) Neg03.java:65:23: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Neg03.Foo -Neg03.java:66:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg03.java:66:13: compiler.err.not.within.bounds: ? super java.lang.String Neg03.java:66:36: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) Neg03.java:68:13: compiler.err.not.within.bounds: java.lang.String Neg03.java:68:28: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) -Neg03.java:69:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg03.java:69:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg03.java:69:38: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number) Neg03.java:70:23: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Neg03.Foo Neg03.java:70:36: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Neg03.Foo -Neg03.java:71:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg03.java:71:13: compiler.err.not.within.bounds: ? super java.lang.String Neg03.java:71:36: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) Neg03.java:73:13: compiler.err.not.within.bounds: java.lang.String Neg03.java:73:28: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) -Neg03.java:74:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg03.java:74:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg03.java:74:39: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number) Neg03.java:75:24: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Neg03.Foo -Neg03.java:76:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg03.java:76:13: compiler.err.not.within.bounds: ? super java.lang.String Neg03.java:76:37: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) Neg03.java:78:13: compiler.err.not.within.bounds: java.lang.String Neg03.java:78:29: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) -Neg03.java:79:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg03.java:79:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg03.java:79:39: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number) Neg03.java:80:24: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Neg03.Foo Neg03.java:80:41: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Neg03.Foo -Neg03.java:81:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg03.java:81:13: compiler.err.not.within.bounds: ? super java.lang.String Neg03.java:81:37: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Neg03.Foo, Neg03.Foo) 90 errors diff --git a/langtools/test/tools/javac/generics/diamond/neg/Neg04.out b/langtools/test/tools/javac/generics/diamond/neg/Neg04.out index f9a0cbf1c39..f3bf0c79000 100644 --- a/langtools/test/tools/javac/generics/diamond/neg/Neg04.out +++ b/langtools/test/tools/javac/generics/diamond/neg/Neg04.out @@ -1,31 +1,31 @@ Neg04.java:18:13: compiler.err.not.within.bounds: java.lang.String Neg04.java:18:33: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Foo, Foo) -Neg04.java:19:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg04.java:19:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg04.java:19:43: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number) Neg04.java:20:21: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Foo -Neg04.java:21:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg04.java:21:13: compiler.err.not.within.bounds: ? super java.lang.String Neg04.java:21:41: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Foo, Foo) Neg04.java:23:13: compiler.err.not.within.bounds: java.lang.String Neg04.java:23:33: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Foo, Foo) -Neg04.java:24:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg04.java:24:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg04.java:24:43: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number) Neg04.java:25:21: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String, kindname.class, Foo Neg04.java:25:34: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Foo -Neg04.java:26:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg04.java:26:13: compiler.err.not.within.bounds: ? super java.lang.String Neg04.java:26:41: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Foo, Foo) Neg04.java:28:13: compiler.err.not.within.bounds: java.lang.String Neg04.java:28:33: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Foo, Foo) -Neg04.java:29:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg04.java:29:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg04.java:29:44: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number) Neg04.java:30:22: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Foo -Neg04.java:31:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg04.java:31:13: compiler.err.not.within.bounds: ? super java.lang.String Neg04.java:31:42: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Foo, Foo) Neg04.java:33:13: compiler.err.not.within.bounds: java.lang.String Neg04.java:33:34: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Foo, Foo) -Neg04.java:34:23: compiler.err.not.within.bounds: ? extends java.lang.String +Neg04.java:34:13: compiler.err.not.within.bounds: ? extends java.lang.String Neg04.java:34:44: compiler.err.cant.apply.diamond: V, (compiler.misc.no.unique.maximal.instance.exists: V, java.lang.String,java.lang.Number) Neg04.java:35:22: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , java.lang.String,java.lang.String, kindname.class, Foo Neg04.java:35:39: compiler.err.cant.resolve.location.args: kindname.constructor, Foo, , , kindname.class, Foo -Neg04.java:36:21: compiler.err.not.within.bounds: ? super java.lang.String +Neg04.java:36:13: compiler.err.not.within.bounds: ? super java.lang.String Neg04.java:36:42: compiler.err.cant.apply.diamond: V, (compiler.misc.no.conforming.instance.exists: V, Foo, Foo) 30 errors diff --git a/langtools/test/tools/javac/nio/compileTest/CompileTest.java b/langtools/test/tools/javac/nio/compileTest/CompileTest.java new file mode 100644 index 00000000000..9ec65c8014d --- /dev/null +++ b/langtools/test/tools/javac/nio/compileTest/CompileTest.java @@ -0,0 +1,170 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/** + * @test + * @bug 6906175 6915476 6915497 + * @summary Path-based JavaFileManager + * @compile -g HelloPathWorld.java + * @run main CompileTest + */ + +import java.io.*; +import java.nio.file.*; +import java.util.*; +import java.util.jar.*; +import javax.tools.*; + +import com.sun.tools.javac.nio.*; +import com.sun.tools.javac.util.Context; +import java.nio.file.spi.FileSystemProvider; + + +public class CompileTest { + public static void main(String[] args) throws Exception { + new CompileTest().run(); + } + + public void run() throws Exception { + File rtDir = new File("rt.dir"); + File javaHome = new File(System.getProperty("java.home")); + if (javaHome.getName().equals("jre")) + javaHome = javaHome.getParentFile(); + File rtJar = new File(new File(new File(javaHome, "jre"), "lib"), "rt.jar"); + expand(rtJar, rtDir); + + String[] rtDir_opts = { + "-bootclasspath", rtDir.toString(), + "-classpath", "", + "-sourcepath", "", + "-extdirs", "" + }; + test(rtDir_opts, "HelloPathWorld"); + + if (isJarFileSystemAvailable()) { + String[] rtJar_opts = { + "-bootclasspath", rtJar.toString(), + "-classpath", "", + "-sourcepath", "", + "-extdirs", "" + }; + test(rtJar_opts, "HelloPathWorld"); + + String[] default_opts = { }; + test(default_opts, "HelloPathWorld"); + + // finally, a non-trivial program + test(default_opts, "CompileTest"); + } else + System.err.println("jar file system not available: test skipped"); + } + + void test(String[] opts, String className) throws Exception { + count++; + System.err.println("Test " + count + " " + Arrays.asList(opts) + " " + className); + Path testSrcDir = Paths.get(System.getProperty("test.src")); + Path testClassesDir = Paths.get(System.getProperty("test.classes")); + Path classes = Paths.get("classes." + count); + classes.createDirectory(); + + Context ctx = new Context(); + PathFileManager fm = new JavacPathFileManager(ctx, true, null); + JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); + List options = new ArrayList(); + options.addAll(Arrays.asList(opts)); + options.addAll(Arrays.asList( + "-verbose", "-XDverboseCompilePolicy", + "-d", classes.toString(), + "-g" + )); + Iterable compilationUnits = + fm.getJavaFileObjects(testSrcDir.resolve(className + ".java")); + StringWriter sw = new StringWriter(); + PrintWriter out = new PrintWriter(sw); + JavaCompiler.CompilationTask t = + compiler.getTask(out, fm, null, options, null, compilationUnits); + boolean ok = t.call(); + System.err.println(sw.toString()); + if (!ok) { + throw new Exception("compilation failed"); + } + + File expect = new File("classes." + count + "/" + className + ".class"); + if (!expect.exists()) + throw new Exception("expected file not found: " + expect); + // Note that we explicitly specify -g for compiling both the actual class and the expected class. + // This isolates the expected class from javac options that might be given to jtreg. + long expectedSize = new File(testClassesDir.toString(), className + ".class").length(); + long actualSize = expect.length(); + if (expectedSize != actualSize) + throw new Exception("wrong size found: " + actualSize + "; expected: " + expectedSize); + } + + boolean isJarFileSystemAvailable() { + boolean result = false; + for (FileSystemProvider fsp: FileSystemProvider.installedProviders()) { + String scheme = fsp.getScheme(); + System.err.println("Provider: " + scheme + " " + fsp); + if (scheme.equalsIgnoreCase("jar") || scheme.equalsIgnoreCase("zip")) + result = true; + } + return result; + } + + void expand(File jar, File dir) throws IOException { + JarFile jarFile = new JarFile(jar); + try { + Enumeration entries = jarFile.entries(); + while (entries.hasMoreElements()) { + JarEntry je = entries.nextElement(); + if (!je.isDirectory()) { + copy(jarFile.getInputStream(je), new File(dir, je.getName())); + } + } + } finally { + jarFile.close(); + } + } + + void copy(InputStream in, File dest) throws IOException { + dest.getParentFile().mkdirs(); + OutputStream out = new BufferedOutputStream(new FileOutputStream(dest)); + try { + byte[] data = new byte[8192]; + int n; + while ((n = in.read(data, 0, data.length)) > 0) + out.write(data, 0, n); + } finally { + out.close(); + in.close(); + } + } + + void error(String message) { + System.err.println("Error: " + message); + errors++; + } + + int errors; + int count; +} diff --git a/langtools/test/tools/javac/nio/compileTest/HelloPathWorld.java b/langtools/test/tools/javac/nio/compileTest/HelloPathWorld.java new file mode 100644 index 00000000000..a65e21a9afa --- /dev/null +++ b/langtools/test/tools/javac/nio/compileTest/HelloPathWorld.java @@ -0,0 +1,28 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +class HelloPathWorld { + public static void main(String... args) { + System.out.println("Hello World!"); + } +} diff --git a/langtools/test/tools/javac/processing/6348499/A.java b/langtools/test/tools/javac/processing/6348499/A.java index f3537f77ad8..356530616c1 100644 --- a/langtools/test/tools/javac/processing/6348499/A.java +++ b/langtools/test/tools/javac/processing/6348499/A.java @@ -28,7 +28,6 @@ import javax.lang.model.*; import javax.lang.model.element.*; @SupportedAnnotationTypes("*") -@SupportedSourceVersion(SourceVersion.RELEASE_7) public class A extends AbstractProcessor { public boolean process(Set tes, RoundEnvironment renv) { Filer filer = processingEnv.getFiler(); @@ -40,4 +39,8 @@ public class A extends AbstractProcessor { } return true; } + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } } diff --git a/langtools/test/tools/javac/processing/6414633/A.java b/langtools/test/tools/javac/processing/6414633/A.java index 791ce52ec39..e3a4b35ec9f 100644 --- a/langtools/test/tools/javac/processing/6414633/A.java +++ b/langtools/test/tools/javac/processing/6414633/A.java @@ -30,7 +30,6 @@ import javax.lang.model.element.*; import javax.tools.*; @SupportedAnnotationTypes("*") -@SupportedSourceVersion(SourceVersion.RELEASE_7) public class A extends AbstractProcessor { public boolean process(Set annotations, RoundEnvironment roundEnv) { @@ -42,4 +41,9 @@ public class A extends AbstractProcessor { } return true; } + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } } diff --git a/langtools/test/tools/javac/processing/6430209/T6430209.java b/langtools/test/tools/javac/processing/6430209/T6430209.java index 65811af94ff..741bc82b911 100644 --- a/langtools/test/tools/javac/processing/6430209/T6430209.java +++ b/langtools/test/tools/javac/processing/6430209/T6430209.java @@ -63,7 +63,6 @@ public class T6430209 { new File(testSrc, "test0.java"), new File(testSrc, "test1.java"))); Iterable opts = Arrays.asList("-proc:only", "-processor", "b6341534", - "-source", "1.6", "-processorpath", testClasses); StringWriter out = new StringWriter(); JavacTask task = tool.getTask(out, fm, dl, opts, null, files); diff --git a/langtools/test/tools/javac/processing/6430209/b6341534.java b/langtools/test/tools/javac/processing/6430209/b6341534.java index e2e2b77bcd1..18357917529 100644 --- a/langtools/test/tools/javac/processing/6430209/b6341534.java +++ b/langtools/test/tools/javac/processing/6430209/b6341534.java @@ -22,6 +22,7 @@ */ import javax.annotation.processing.*; +import javax.lang.model.SourceVersion; import javax.lang.model.element.*; import javax.lang.model.util.*; import static javax.lang.model.util.ElementFilter.*; @@ -30,7 +31,6 @@ import java.util.*; import java.util.Set; @SupportedAnnotationTypes({"*"}) -@SupportedSourceVersion(javax.lang.model.SourceVersion.RELEASE_7) public class b6341534 extends AbstractProcessor { static int r = 0; static Elements E = null; @@ -62,4 +62,9 @@ public class b6341534 extends AbstractProcessor { if( renv.errorRaised() ) { msgr.printMessage(ERROR, "FAILED");} return true; } + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } } diff --git a/langtools/test/tools/javac/processing/6499119/ClassProcessor.java b/langtools/test/tools/javac/processing/6499119/ClassProcessor.java new file mode 100644 index 00000000000..eb082bf93e6 --- /dev/null +++ b/langtools/test/tools/javac/processing/6499119/ClassProcessor.java @@ -0,0 +1,132 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.io.*; +import java.util.*; +import javax.annotation.processing.*; +import javax.lang.model.element.*; +import javax.lang.model.SourceVersion; +import javax.tools.Diagnostic.Kind; + +/* + * @test + * @bug 6499119 + * @summary Created package-info class file modeled improperly + * @compile ClassProcessor.java package-info.java + * @compile/process -cp . -processor ClassProcessor -Akind=java java.lang.Object + * @compile/process -cp . -processor ClassProcessor -Akind=class java.lang.Object + */ + +@SupportedOptions({ "gen", "expect" }) +@SupportedAnnotationTypes({"*"}) +public class ClassProcessor extends AbstractProcessor { + int round = 1; + + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + + public boolean process(Set annotations, RoundEnvironment roundEnv) { + if (round == 1) { + System.out.println("-- Round 1 --"); + createPackageFile(); + } else if (round == 2) { + boolean found_foo_A = false; + System.out.println("-- Round 2 --"); + for(Element e: roundEnv.getRootElements()) { + System.out.println("ElementKind: " + e.getKind()); + System.out.println("Modifiers: " + e.getModifiers()); + System.out.println("Annotations: " + e.getAnnotationMirrors()); + if (e.getAnnotationMirrors().toString().equals("@foo.A")) { + found_foo_A = true; + checkEqual("ElementKind", e.getKind().toString(), "PACKAGE"); + checkEqual("Modifiers", e.getModifiers().toString(), "[]"); + } + } + if (!found_foo_A) + error("did not find @foo.A"); + } + round++; + return true; + } + + private void createPackageFile() { + Filer filer = processingEnv.getFiler(); + + String kind = processingEnv.getOptions().get("kind"); + + File pkgInfo; + if (kind.equals("java")) + pkgInfo = new File(System.getProperty("test.src"), "package-info.java"); + else + pkgInfo = new File(System.getProperty("test.classes"), "foo/package-info.class"); + + byte[] bytes = new byte[(int) pkgInfo.length()]; + DataInputStream in = null; + try { + in = new DataInputStream(new FileInputStream(pkgInfo)); + in.readFully(bytes); + } catch (IOException ioe) { + error("Couldn't read package info file: " + ioe); + } finally { + if(in != null) { + try { + in.close(); + } catch (IOException e) { + error("InputStream closing failed: " + e); + } + } + } + + OutputStream out = null; + try { + if (kind.equals("java")) + out = filer.createSourceFile("foo.package-info").openOutputStream(); + else + out = filer.createClassFile("foo.package-info").openOutputStream(); + out.write(bytes, 0, bytes.length); + } catch (IOException ioe) { + error("Couldn't create package info file: " + ioe); + } finally { + if(out != null) { + try { + out.close(); + } catch (IOException e) { + error("OutputStream closing failed: " + e); + } + } + } + } + + private void checkEqual(String label, String actual, String expect) { + if (!actual.equals(expect)) { + error("Unexpected value for " + label + "; actual=" + actual + ", expected=" + expect); + } + } + + private void error(String msg) { + Messager messager = processingEnv.getMessager(); + messager.printMessage(Kind.ERROR, msg); + } +} + diff --git a/langtools/test/tools/javac/processing/6499119/package-info.java b/langtools/test/tools/javac/processing/6499119/package-info.java new file mode 100644 index 00000000000..0eba1afd061 --- /dev/null +++ b/langtools/test/tools/javac/processing/6499119/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +@A package foo; + +@interface A {} + diff --git a/langtools/test/tools/javac/processing/6511613/DummyProcessor.java b/langtools/test/tools/javac/processing/6511613/DummyProcessor.java new file mode 100644 index 00000000000..a2fa34a3f4c --- /dev/null +++ b/langtools/test/tools/javac/processing/6511613/DummyProcessor.java @@ -0,0 +1,40 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import javax.annotation.processing.*; +import javax.lang.model.*; +import javax.lang.model.element.*; +import java.util.Set; + +@SupportedAnnotationTypes("*") +public class DummyProcessor extends AbstractProcessor { + public boolean process(Set annotations, + RoundEnvironment roundEnv) { + return true; + } + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } +} + diff --git a/langtools/test/tools/javac/processing/6511613/clss41701.java b/langtools/test/tools/javac/processing/6511613/clss41701.java new file mode 100644 index 00000000000..600fb1bec17 --- /dev/null +++ b/langtools/test/tools/javac/processing/6511613/clss41701.java @@ -0,0 +1,43 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6511613 + * @summary javac unexpectedly doesn't fail in some cases if an annotation processor specified + * + * @build DummyProcessor + * @compile/fail clss41701.java + * @compile/fail -processor DummyProcessor clss41701.java + */ + +import java.io.PrintStream; + +interface clss41701i { + void run(); +} + +class clss41701a { +} diff --git a/langtools/test/tools/javac/processing/6634138/Dummy.java b/langtools/test/tools/javac/processing/6634138/Dummy.java new file mode 100644 index 00000000000..9ae3e860db8 --- /dev/null +++ b/langtools/test/tools/javac/processing/6634138/Dummy.java @@ -0,0 +1,27 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/** + * A dummy class to be compiled. + */ +public class Dummy {} diff --git a/langtools/test/tools/javac/processing/6634138/ExerciseDependency.java b/langtools/test/tools/javac/processing/6634138/ExerciseDependency.java new file mode 100644 index 00000000000..b500fbf9b4e --- /dev/null +++ b/langtools/test/tools/javac/processing/6634138/ExerciseDependency.java @@ -0,0 +1,37 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/** + * Class to exercise dependencies on the two source files generated by + * T6634138.java, foo.WrittenAfterProcessing.java and + * foo.package-info.java. + */ +public class ExerciseDependency { + public static void main(String... args) { + foo.WrittenAfterProcessing wap = new foo.WrittenAfterProcessing(); + java.lang.Package pkg = wap.getClass().getPackage(); + Deprecated d = pkg.getAnnotation(Deprecated.class); + if (d == null) + throw new RuntimeException(); + } +} diff --git a/langtools/test/tools/javac/processing/6634138/T6634138.java b/langtools/test/tools/javac/processing/6634138/T6634138.java new file mode 100644 index 00000000000..3bed47685fe --- /dev/null +++ b/langtools/test/tools/javac/processing/6634138/T6634138.java @@ -0,0 +1,93 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6634138 + * @author Joseph D. Darcy + * @summary Verify source files output after processing is over are compiled + * @compile T6634138.java + * @compile -processor T6634138 Dummy.java + * @run main ExerciseDependency + */ + +import java.lang.annotation.Annotation; +import java.io.*; +import java.util.Collections; +import java.util.Set; +import java.util.HashSet; +import java.util.List; +import java.util.ArrayList; +import java.util.Arrays; +import javax.annotation.processing.*; +import javax.lang.model.SourceVersion; +import javax.lang.model.element.*; +import javax.lang.model.util.*; + +@SupportedAnnotationTypes("*") +public class T6634138 extends AbstractProcessor { + private Filer filer; + + public boolean process(Set annotations, + RoundEnvironment roundEnvironment) { + // Write out files *after* processing is over. + if (roundEnvironment.processingOver()) { + System.out.println("Writing out source files."); + try { + PrintWriter pw = new PrintWriter(filer.createSourceFile("foo.WrittenAfterProcessing").openWriter()); + try { + pw.println("package foo;"); + pw.println("public class WrittenAfterProcessing {"); + pw.println(" public WrittenAfterProcessing() {super();}"); + pw.println("}"); + } finally { + pw.close(); + } + + pw = new PrintWriter(filer.createSourceFile("foo.package-info").openWriter()); + try { + pw.println("@Deprecated"); + pw.println("package foo;"); + } finally { + pw.close(); + } + } catch(IOException io) { + throw new RuntimeException(io); + } + } + return true; + } + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + + public void init(ProcessingEnvironment processingEnv) { + super.init(processingEnv); + filer = processingEnv.getFiler(); + } +} + + + diff --git a/langtools/test/tools/javac/processing/T6439826.java b/langtools/test/tools/javac/processing/T6439826.java index 586c6c2117c..b5cb0d86208 100644 --- a/langtools/test/tools/javac/processing/T6439826.java +++ b/langtools/test/tools/javac/processing/T6439826.java @@ -39,7 +39,6 @@ import static javax.lang.model.util.ElementFilter.*; @SupportedAnnotationTypes("*") -@SupportedSourceVersion(SourceVersion.RELEASE_7 ) public class T6439826 extends AbstractProcessor { public static void main(String... args) { String testSrc = System.getProperty("test.src", "."); @@ -76,6 +75,11 @@ public class T6439826 extends AbstractProcessor { return false; } + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + private void writeBadFile() { Filer filer = processingEnv.getFiler(); Messager messager = processingEnv.getMessager(); diff --git a/langtools/test/tools/javac/processing/T6920317.java b/langtools/test/tools/javac/processing/T6920317.java new file mode 100644 index 00000000000..fce6928e586 --- /dev/null +++ b/langtools/test/tools/javac/processing/T6920317.java @@ -0,0 +1,462 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6920317 + * @summary package-info.java file has to be specified on the javac cmdline, else it will not be avail + */ + +import java.io.*; +import java.util.*; +import javax.annotation.processing.*; +import javax.lang.model.*; +import javax.lang.model.element.*; +import javax.lang.model.util.*; +import javax.tools.*; + +/** + * The test exercises different ways of providing annotations for a package. + * Each way provides an annotation with a unique argument. For each test + * case, the test verifies that the annotation with the correct argument is + * found by the compiler. + */ +public class T6920317 { + public static void main(String... args) throws Exception { + new T6920317().run(args); + } + + // Used to describe properties of files to be put on command line, source path, class path + enum Kind { + /** File is not used. */ + NONE, + /** File is used. */ + OLD, + /** Only applies to files on classpath/sourcepath, when there is another file on the + * other path of type OLD, in which case, this file must be newer than the other one. */ + NEW, + /** Only applies to files on classpath/sourcepath, when there is no file in any other + * location, in which case, this file will be generated by the annotation processor. */ + GEN + } + + void run(String... args) throws Exception { + // if no args given, all test cases are run + // if args given, they indicate the test cases to be run + for (int i = 0; i < args.length; i++) { + tests.add(Integer.valueOf(args[i])); + } + + setup(); + + // Run tests for all combinations of files on command line, source path and class path. + // Invalid combinations are skipped in the test method + for (Kind cmdLine: EnumSet.of(Kind.NONE, Kind.OLD)) { + for (Kind srcPath: Kind.values()) { + for (Kind clsPath: Kind.values()) { + try { + test(cmdLine, srcPath, clsPath); + } catch (Exception e) { + e.printStackTrace(); + error("Exception " + e); + // uncomment to stop on first failed test case + // throw e; + } + } + } + } + + if (errors > 0) + throw new Exception(errors + " errors occurred"); + } + + /** One time setup for files and directories to be used in the various test cases. */ + void setup() throws Exception { + // Annotation used in test cases to annotate package. This file is + // given on the command line in test cases. + test_java = writeFile("Test.java", "package p; @interface Test { String value(); }"); + // Compile the annotation for use later in setup + File tmpClasses = new File("tmp.classes"); + compile(tmpClasses, new String[] { }, test_java); + + // package-info file to use on the command line when requied + cl_pkgInfo_java = writeFile("cl/p/package-info.java", "@Test(\"CL\") package p;"); + + // source path containing package-info + sp_old = new File("src.old"); + writeFile("src.old/p/package-info.java", "@Test(\"SP_OLD\") package p;"); + + // class path containing package-info + cp_old = new File("classes.old"); + compile(cp_old, new String[] { "-classpath", tmpClasses.getPath() }, + writeFile("tmp.old/p/package-info.java", "@Test(\"CP_OLD\") package p;")); + + // source path containing package-info which is newer than the one in cp-old + sp_new = new File("src.new"); + File old_class = new File(cp_old, "p/package-info.class"); + writeFile("src.new/p/package-info.java", "@Test(\"SP_NEW\") package p;", old_class); + + // class path containing package-info which is newer than the one in sp-old + cp_new = new File("classes.new"); + File old_java = new File(sp_old, "p/package-info.java"); + compile(cp_new, new String[] { "-classpath", tmpClasses.getPath() }, + writeFile("tmp.new/p/package-info.java", "@Test(\"CP_NEW\") package p;", old_java)); + + // directory containing package-info.java to be "generated" later by annotation processor + sp_gen = new File("src.gen"); + writeFile("src.gen/p/package-info.java", "@Test(\"SP_GEN\") package p;"); + + // directory containing package-info.class to be "generated" later by annotation processor + cp_gen = new File("classes.gen"); + compile(cp_gen, new String[] { "-classpath", tmpClasses.getPath() }, + writeFile("tmp.gen/p/package-info.java", "@Test(\"CP_GEN\") package p;")); + } + + void test(Kind cl, Kind sp, Kind cp) throws Exception { + if (skip(cl, sp, cp)) + return; + + ++count; + // if test cases specified, skip this test case if not selected + if (tests.size() > 0 && !tests.contains(count)) + return; + + System.err.println("Test " + count + " cl:" + cl + " sp:" + sp + " cp:" + cp); + + // test specific tmp directory + File test_tmp = new File("tmp.test" + count); + test_tmp.mkdirs(); + + // build up list of options and files to be compiled + List opts = new ArrayList(); + List files = new ArrayList(); + + // expected value for annotation + String expect = null; + + opts.add("-processorpath"); + opts.add(System.getProperty("test.classes")); + opts.add("-processor"); + opts.add(Processor.class.getName()); + opts.add("-proc:only"); + opts.add("-d"); + opts.add(test_tmp.getPath()); + //opts.add("-verbose"); + files.add(test_java); + + /* + * Analyze each of cl, cp, sp, building up the options and files to + * be compiled, and determining the expected outcome fo the test case. + */ + + // command line file: either omitted or given + if (cl == Kind.OLD) { + files.add(cl_pkgInfo_java); + // command line files always supercede files on paths + expect = "CL"; + } + + // source path: + switch (sp) { + case NONE: + break; + + case OLD: + opts.add("-sourcepath"); + opts.add(sp_old.getPath()); + if (expect == null && cp == Kind.NONE) { + assert cl == Kind.NONE && cp == Kind.NONE; + expect = "SP_OLD"; + } + break; + + case NEW: + opts.add("-sourcepath"); + opts.add(sp_new.getPath()); + if (expect == null) { + assert cl == Kind.NONE && cp == Kind.OLD; + expect = "SP_NEW"; + } + break; + + case GEN: + opts.add("-Agen=" + new File(sp_gen, "p/package-info.java")); + assert cl == Kind.NONE && cp == Kind.NONE; + expect = "SP_GEN"; + break; + } + + // class path: + switch (cp) { + case NONE: + break; + + case OLD: + opts.add("-classpath"); + opts.add(cp_old.getPath()); + if (expect == null && sp == Kind.NONE) { + assert cl == Kind.NONE && sp == Kind.NONE; + expect = "CP_OLD"; + } + break; + + case NEW: + opts.add("-classpath"); + opts.add(cp_new.getPath()); + if (expect == null) { + assert cl == Kind.NONE && sp == Kind.OLD; + expect = "CP_NEW"; + } + break; + + case GEN: + opts.add("-Agen=" + new File(cp_gen, "p/package-info.class")); + assert cl == Kind.NONE && sp == Kind.NONE; + expect = "CP_GEN"; + break; + } + + // pass expected value to annotation processor + assert expect != null; + opts.add("-Aexpect=" + expect); + + // compile the files with the options that have been built up + compile(opts, files); + } + + /** + * Return true if this combination of parameters does not identify a useful test case. + */ + boolean skip(Kind cl, Kind sp, Kind cp) { + // skip if no package files required + if (cl == Kind.NONE && sp == Kind.NONE && cp == Kind.NONE) + return true; + + // skip if both sp and sp are OLD, since results may be indeterminate + if (sp == Kind.OLD && cp == Kind.OLD) + return true; + + // skip if sp or cp is NEW but the other is not OLD + if ((sp == Kind.NEW && cp != Kind.OLD) || (cp == Kind.NEW && sp != Kind.OLD)) + return true; + + // only use GEN if no other package-info files present + if (sp == Kind.GEN && !(cl == Kind.NONE && cp == Kind.NONE) || + cp == Kind.GEN && !(cl == Kind.NONE && sp == Kind.NONE)) { + return true; + } + + // remaining combinations are valid + return false; + } + + /** Write a file with a given body. */ + File writeFile(String path, String body) throws Exception { + File f = new File(path); + if (f.getParentFile() != null) + f.getParentFile().mkdirs(); + Writer out = new FileWriter(path); + try { + out.write(body); + } finally { + out.close(); + } + return f; + } + + /** Write a file with a given body, ensuring that the file is newer than a reference file. */ + File writeFile(String path, String body, File ref) throws Exception { + for (int i = 0; i < 5; i++) { + File f = writeFile(path, body); + if (f.lastModified() > ref.lastModified()) + return f; + Thread.sleep(2000); + } + throw new Exception("cannot create file " + path + " newer than " + ref); + } + + /** Compile a file to a given directory, with options provided. */ + void compile(File dir, String[] opts, File src) throws Exception { + dir.mkdirs(); + List opts2 = new ArrayList(); + opts2.addAll(Arrays.asList("-d", dir.getPath())); + opts2.addAll(Arrays.asList(opts)); + compile(opts2, Collections.singletonList(src)); + } + + /** Compile files with options provided. */ + void compile(List opts, List files) throws Exception { + System.err.println("javac: " + opts + " " + files); + List args = new ArrayList(); + args.addAll(opts); + for (File f: files) + args.add(f.getPath()); + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + int rc = com.sun.tools.javac.Main.compile(args.toArray(new String[args.size()]), pw); + pw.flush(); + if (sw.getBuffer().length() > 0) + System.err.println(sw.toString()); + if (rc != 0) + throw new Exception("compilation failed: rc=" + rc); + } + + /** Report an error. */ + void error(String msg) { + System.err.println("Error: " + msg); + errors++; + } + + /** Test case counter. */ + int count; + + /** Number of errors found. */ + int errors; + + /** Optional set of test cases to be run; empty implies all test cases. */ + Set tests = new HashSet(); + + /* Files created by setup. */ + File test_java; + File sp_old; + File sp_new; + File sp_gen; + File cp_old; + File cp_new; + File cp_gen; + File cl_pkgInfo_java; + + /** Annotation processor used to verify the expected value for the + package annotations found by javac. */ + @SupportedOptions({ "gen", "expect" }) + @SupportedAnnotationTypes({"*"}) + public static class Processor extends AbstractProcessor { + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + + public boolean process(Set annots, RoundEnvironment renv) { + round++; + System.err.println("Round " + round + " annots:" + annots + " rootElems:" + renv.getRootElements()); + + // if this is the first round and the gen option is given, use the filer to create + // a copy of the file specified by the gen option. + String gen = getOption("gen"); + if (round == 1 && gen != null) { + try { + Filer filer = processingEnv.getFiler(); + JavaFileObject f; + if (gen.endsWith(".java")) + f = filer.createSourceFile("p.package-info"); + else + f = filer.createClassFile("p.package-info"); + System.err.println("copy " + gen + " to " + f.getName()); + write(f, read(new File(gen))); + } catch (IOException e) { + error("Cannot create package-info file: " + e); + } + } + + // if annotation processing is complete, verify the package annotation + // found by the compiler. + if (renv.processingOver()) { + System.err.println("final round"); + Elements eu = processingEnv.getElementUtils(); + TypeElement te = eu.getTypeElement("p.Test"); + PackageElement pe = eu.getPackageOf(te); + System.err.println("final: te:" + te + " pe:" + pe); + List annos = pe.getAnnotationMirrors(); + System.err.println("final: annos:" + annos); + if (annos.size() == 1) { + String expect = "@" + te + "(\"" + getOption("expect") + "\")"; + String actual = annos.get(0).toString(); + checkEqual("package annotations", actual, expect); + } else { + error("Wrong number of annotations found: (" + annos.size() + ") " + annos); + } + } + + return true; + } + + /** Get an option given to the annotation processor. */ + String getOption(String name) { + return processingEnv.getOptions().get(name); + } + + /** Read a file. */ + byte[] read(File file) { + byte[] bytes = new byte[(int) file.length()]; + DataInputStream in = null; + try { + in = new DataInputStream(new FileInputStream(file)); + in.readFully(bytes); + } catch (IOException e) { + error("Error reading file: " + e); + } finally { + if (in != null) { + try { + in.close(); + } catch (IOException e) { + error("Error closing file: " + e); + } + } + } + return bytes; + } + + /** Write a file. */ + void write(JavaFileObject file, byte[] bytes) { + OutputStream out = null; + try { + out = file.openOutputStream(); + out.write(bytes, 0, bytes.length); + } catch (IOException e) { + error("Error writing file: " + e); + } finally { + if (out != null) { + try { + out.close(); + } catch (IOException e) { + error("Error closing file: " + e); + } + } + } + } + + /** Check two strings are equal, and report an error if they are not. */ + private void checkEqual(String label, String actual, String expect) { + if (!actual.equals(expect)) { + error("Unexpected value for " + label + "; actual=" + actual + ", expected=" + expect); + } + } + + /** Report an error to the annotation processing system. */ + void error(String msg) { + Messager messager = processingEnv.getMessager(); + messager.printMessage(Diagnostic.Kind.ERROR, msg); + } + + int round; + } +} diff --git a/langtools/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java b/langtools/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java index 889a227d992..ca7804f89e0 100644 --- a/langtools/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java +++ b/langtools/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java @@ -23,7 +23,7 @@ /* * @test - * @bug 6397298 6400986 6425592 6449798 6453386 6508401 6498938 + * @bug 6397298 6400986 6425592 6449798 6453386 6508401 6498938 6911854 * @summary Tests that getElementsAnnotatedWith works properly. * @author Joseph D. Darcy * @compile TestElementsAnnotatedWith.java @@ -33,8 +33,8 @@ * @compile -processor TestElementsAnnotatedWith -proc:only Part1.java Part2.java * @compile -processor TestElementsAnnotatedWith -proc:only C2.java * @compile -processor TestElementsAnnotatedWith -proc:only Foo.java - * @compile -XD-d=. Foo.java - * @compile -processor TestElementsAnnotatedWith -proc:only TestElementsAnnotatedWith.java + * @compile Foo.java + * @compile/process -processor TestElementsAnnotatedWith -proc:only Foo */ import java.lang.annotation.Annotation; @@ -89,7 +89,7 @@ public class TestElementsAnnotatedWith extends AbstractProcessor { // Verify that the annotation information is as // expected. - Set expectedNames = new HashSet(Arrays.asList(annotatedElementInfo.names())); + Set expectedNames = new HashSet<>(Arrays.asList(annotatedElementInfo.names())); resultsMeta = roundEnvironment. @@ -126,9 +126,6 @@ public class TestElementsAnnotatedWith extends AbstractProcessor { System.err.println("AnnotatedElementInfo: " + annotatedElementInfo); throw new RuntimeException(); } - - if("TestElementsAnnotatedWith".equals(firstType.getSimpleName().toString())) - writeClassFile(); // Start another round to test class file input } else { // If processing is over without an error, the specified // elements should be empty so an empty set should be returned. @@ -163,48 +160,14 @@ public class TestElementsAnnotatedWith extends AbstractProcessor { } catch(IllegalArgumentException iae) {} try { - Set elements = roundEnvironment.getElementsAnnotatedWith(processingEnv. - getElementUtils(). - getTypeElement("java.lang.Object") ); + Set elements = + roundEnvironment.getElementsAnnotatedWith(processingEnv. + getElementUtils(). + getTypeElement("java.lang.Object") ); throw new RuntimeException("Illegal argument exception not thrown"); } catch(IllegalArgumentException iae) {} } - /* - * Hack alert! The class file read below is generated by the - * "@compile -XD-d=. Foo.java" directive above. This sneakily - * overrides the output location to the current directory where a - * subsequent @compile can read the file. This could be improved - * if either a new directive like @process accepted class file - * arguments (the javac command accepts such arguments but - * @compile does not) or the test.src and test.classes properties - * were set to be read with @compile jobs. - */ - private void writeClassFile() { - try { - Filer filer = processingEnv.getFiler(); - JavaFileObject jfo = filer.createClassFile("Foo"); - OutputStream os = jfo.openOutputStream(); - // Copy the bytes over - System.out.println((new File(".")).getAbsolutePath()); - InputStream io = new BufferedInputStream(new FileInputStream(new File(".", "Foo.class"))); - try { - int datum = io.read(); - while(datum != -1) { - os.write(datum); - datum = io.read(); - } - } finally { - io.close(); - } - os.close(); - } catch (IOException ioe) { - throw new RuntimeException(ioe); - } - - - } - @Override public SourceVersion getSupportedSourceVersion() { return SourceVersion.latest(); diff --git a/langtools/test/tools/javac/processing/model/element/TestAnonClassNames.java b/langtools/test/tools/javac/processing/model/element/TestAnonClassNames.java new file mode 100644 index 00000000000..59f16b1da62 --- /dev/null +++ b/langtools/test/tools/javac/processing/model/element/TestAnonClassNames.java @@ -0,0 +1,186 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6449781 + * @summary Test that reported names of anonymous classes are non-null. + * @author Joseph D. Darcy + * @build TestAnonSourceNames + * @compile/fail -processor TestAnonSourceNames TestAnonClassNames.java + * @build TestAnonClassNames + * @run main TestAnonClassNames + */ + +/* + * This test operates in phases to test retrieving the qualified name + * of anonymous classes from type elements modeling the anonymous + * class. The type elements are generated using both source files and + * class files as the basis of constructing the elements. + * + * Source files will be tested by the @compile line which runs + * TestAnonSourceNames as an annotation processor over this file. + * This compile line is expected to fail until 6930507 is fixed. Once + * bug 6930507 is fixed, the "@compile/fail -processor ..." and + * following "@build..." steps can be replaced with a single "@compile + * -processor ..." directive. + * + * Class files are tested by the @run command on this type. This + * class gets the names of classes with different nesting kinds, + * including anonymous classes, and then invokes the compiler with an + * annotation processor having the class files names as inputs. The + * compiler is invoked via the javax.tools mechanism. + */ + +import java.lang.annotation.*; +import javax.lang.model.element.*; +import javax.annotation.processing.*; +import javax.lang.model.SourceVersion; +import javax.lang.model.element.*; +import javax.lang.model.util.*; +import javax.tools.*; +import java.util.*; + +import static java.lang.annotation.RetentionPolicy.*; +import static javax.lang.model.element.NestingKind.*; +import static javax.lang.model.util.ElementFilter.*; +import static javax.tools.Diagnostic.Kind.*; +import static javax.tools.StandardLocation.*; + +@Nesting(TOP_LEVEL) +public class TestAnonClassNames { + @Nesting(MEMBER) + static class MemberClass1{} + + @Nesting(MEMBER) + class MemberClass2{} + + @Nesting(MEMBER) + class Win$$AtVegas { } // Class with funny name. + + public static void main(String... argv) { + @Nesting(LOCAL) + class LocalClass{}; + + Object o = new @Nesting(ANONYMOUS) Object() { // An anonymous annotated class + public String toString() { + return "I have no name!"; + } + }; + + Class[] classes = { + MemberClass1.class, + MemberClass2.class, + LocalClass.class, + Win$$AtVegas.class, + o.getClass(), + TestAnonClassNames.class, + }; + + for(Class clazz : classes) { + String name = clazz.getName(); + System.out.format("%s is %s%n", + clazz.getName(), + clazz.getAnnotation(Nesting.class).value()); + testClassName(name); + } + } + + /** + * Perform annotation processing on the class file name and verify + * the existence of different flavors of class names when the + * input classes are modeled as elements. + */ + static void testClassName(String className) { + JavaCompiler javaCompiler = ToolProvider.getSystemJavaCompiler(); + List classNames = new ArrayList<>(); + classNames.add(className); + + List options = new ArrayList<>(); + options.add("-proc:only"); + options.add("-classpath"); + options.add(System.getProperty("test.classes")); + + JavaCompiler.CompilationTask compileTask = + javaCompiler.getTask(null, // Output + null, // File manager + null, // Diagnostics + options, + classNames, + null); // Sources + List processors = new ArrayList<>(); + processors.add(new ClassNameProber()); + compileTask.setProcessors(processors); + Boolean goodResult = compileTask.call(); + if (!goodResult) { + throw new RuntimeException("Errors found during compile."); + } + } +} + +@Retention(RUNTIME) +@interface Nesting { + NestingKind value(); +} + +/** + * Probe at the various kinds of names of a type element. + */ +@SupportedAnnotationTypes("*") +class ClassNameProber extends AbstractProcessor { + public ClassNameProber(){super();} + + private boolean classesFound=false; + + public boolean process(Set annotations, + RoundEnvironment roundEnv) { + if (!roundEnv.processingOver()) { + for(TypeElement typeElt : typesIn(roundEnv.getRootElements())) { + classesFound = true; + + // Verify different names are non-null; an NPE will + // result in failed compile status being reported. + NestingKind nestingKind = typeElt.getNestingKind(); + System.out.printf("\tSimple name: ''%s''\tQualified Name: ''%s''\tKind ''%s''\tNesting ''%s''%n", + typeElt.getSimpleName().toString(), + typeElt.getQualifiedName().toString(), + typeElt.getKind().toString(), + nestingKind.toString()); + + if (typeElt.getAnnotation(Nesting.class).value() != nestingKind) { + throw new RuntimeException("Mismatch of expected and reported nesting kind."); + } + } + + } + + if (!classesFound) { + throw new RuntimeException("Error: no classes processed."); + } + return true; + } + + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } +} diff --git a/langtools/test/tools/javac/processing/model/element/TestAnonSourceNames.java b/langtools/test/tools/javac/processing/model/element/TestAnonSourceNames.java new file mode 100644 index 00000000000..e90b61f577d --- /dev/null +++ b/langtools/test/tools/javac/processing/model/element/TestAnonSourceNames.java @@ -0,0 +1,92 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.io.*; +import javax.annotation.processing.*; +import javax.lang.model.*; +import javax.lang.model.element.*; +import javax.lang.model.type.*; +import javax.lang.model.util.*; +import java.util.*; +import com.sun.source.tree.*; +import com.sun.source.util.*; +import static javax.tools.Diagnostic.Kind.*; + +/** + * Using the tree API, retrieve element representations of anonymous + * classes and verify their names are as specified. + */ +@SupportedAnnotationTypes("*") +public class TestAnonSourceNames extends AbstractProcessor { + + public boolean process(Set annotations, + RoundEnvironment roundEnv) { + if (!roundEnv.processingOver()) { + Trees trees = Trees.instance(processingEnv); + + for(Element rootElement : roundEnv.getRootElements()) { + TreePath treePath = trees.getPath(rootElement); + + (new ClassTreeScanner(trees)). + scan(trees.getTree(rootElement), + treePath.getCompilationUnit()); + } + } + return true; + } + + class ClassTreeScanner extends TreeScanner { + private Trees trees; + + public ClassTreeScanner(Trees trees) { + super(); + this.trees = trees; + } + @Override + public Void visitClass(ClassTree node, CompilationUnitTree cu) { + Element element = trees.getElement(trees.getPath(cu, node)); + if (element == null) { + processingEnv.getMessager().printMessage(ERROR, + "No element retreived for node named ''" + + node.getSimpleName() + "''."); + } else { + + System.out.println("\nVisiting class ``" + element.getSimpleName() + + "'' of kind " + element.getKind()); + if (element instanceof TypeElement) { + TypeElement typeElement = (TypeElement) element; + String s = typeElement.getQualifiedName().toString(); + System.out.println("\tqualified name:" + s); + } else { + throw new RuntimeException("TypeElement not gotten from ClassTree."); + } + } + return super.visitClass(node, cu); + } + } + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } +} diff --git a/langtools/test/tools/javac/processing/model/element/TypeParamBounds.java b/langtools/test/tools/javac/processing/model/element/TypeParamBounds.java index 780a83560bb..9edc36869b5 100644 --- a/langtools/test/tools/javac/processing/model/element/TypeParamBounds.java +++ b/langtools/test/tools/javac/processing/model/element/TypeParamBounds.java @@ -40,7 +40,6 @@ import javax.lang.model.element.*; import javax.lang.model.type.*; import javax.lang.model.util.*; -@SupportedSourceVersion(SourceVersion.RELEASE_6) @SupportedAnnotationTypes("*") public class TypeParamBounds extends AbstractProcessor { @@ -60,6 +59,11 @@ public class TypeParamBounds extends AbstractProcessor { return true; } + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + private void doit(Set annoTypes, RoundEnvironment round) { TypeElement gen = elements.getTypeElement("TypeParamBounds.Gen"); diff --git a/langtools/test/tools/javac/processing/model/type/MirroredTypeEx/OverEager.java b/langtools/test/tools/javac/processing/model/type/MirroredTypeEx/OverEager.java index fd941e0a616..fa92ef753c0 100644 --- a/langtools/test/tools/javac/processing/model/type/MirroredTypeEx/OverEager.java +++ b/langtools/test/tools/javac/processing/model/type/MirroredTypeEx/OverEager.java @@ -38,7 +38,6 @@ import javax.lang.model.type.*; import javax.lang.model.util.*; import static javax.lang.model.util.ElementFilter.*; -@SupportedSourceVersion(SourceVersion.RELEASE_6) @SupportedAnnotationTypes("IAm") @IAm(OverEager.class) public class OverEager extends AbstractProcessor { @@ -59,6 +58,11 @@ public class OverEager extends AbstractProcessor { return true; } + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + private void doit(Set annoTypes, RoundEnvironment round) { for (TypeElement t : typesIn(round.getRootElements())) { diff --git a/langtools/test/tools/javac/processing/model/type/NoTypes.java b/langtools/test/tools/javac/processing/model/type/NoTypes.java index 9d9f66ffe84..e4a05377c9e 100644 --- a/langtools/test/tools/javac/processing/model/type/NoTypes.java +++ b/langtools/test/tools/javac/processing/model/type/NoTypes.java @@ -39,8 +39,6 @@ import javax.lang.model.util.*; import static javax.lang.model.type.TypeKind.*; - -@SupportedSourceVersion(SourceVersion.RELEASE_6) @SupportedAnnotationTypes("*") public class NoTypes extends AbstractProcessor { @@ -60,6 +58,11 @@ public class NoTypes extends AbstractProcessor { return true; } + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + private void doit(Set annoTypes, RoundEnvironment round) { diff --git a/langtools/test/tools/javac/processing/model/util/GetTypeElemBadArg.java b/langtools/test/tools/javac/processing/model/util/GetTypeElemBadArg.java index 163ea4052ee..21c803b0b27 100644 --- a/langtools/test/tools/javac/processing/model/util/GetTypeElemBadArg.java +++ b/langtools/test/tools/javac/processing/model/util/GetTypeElemBadArg.java @@ -37,7 +37,6 @@ import javax.lang.model.element.*; import javax.lang.model.type.*; import javax.lang.model.util.*; -@SupportedSourceVersion(SourceVersion.RELEASE_6) @SupportedAnnotationTypes("*") public class GetTypeElemBadArg extends AbstractProcessor { @@ -64,6 +63,12 @@ public class GetTypeElemBadArg extends AbstractProcessor { return true; } + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + private static void tellAbout(TypeElement t) { System.out.println(t); System.out.println(t.getClass()); diff --git a/langtools/test/tools/javac/processing/model/util/OverridesSpecEx.java b/langtools/test/tools/javac/processing/model/util/OverridesSpecEx.java index c54f215f96b..626f0347cae 100644 --- a/langtools/test/tools/javac/processing/model/util/OverridesSpecEx.java +++ b/langtools/test/tools/javac/processing/model/util/OverridesSpecEx.java @@ -40,7 +40,6 @@ import javax.lang.model.util.*; import static javax.lang.model.util.ElementFilter.*; -@SupportedSourceVersion(SourceVersion.RELEASE_6) @SupportedAnnotationTypes("*") public class OverridesSpecEx extends AbstractProcessor { @@ -60,6 +59,11 @@ public class OverridesSpecEx extends AbstractProcessor { return true; } + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + private void doit(Set annoTypes, RoundEnvironment round) { TypeElement string = elements.getTypeElement("java.lang.String"); diff --git a/langtools/test/tools/javac/tree/T6923080.java b/langtools/test/tools/javac/tree/T6923080.java new file mode 100644 index 00000000000..b4a719f187e --- /dev/null +++ b/langtools/test/tools/javac/tree/T6923080.java @@ -0,0 +1,40 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * This file is not a regular test, but is processed by ./TreeScannerTest.java, + * which verifies the operation of the javac TreeScanner. + * @bug 6923080 + * @summary TreeScanner.visitNewClass should scan tree.typeargs + */ +class T6923080 { + void test() { + C c = new C(); // exercises TreeScanner.visitNewClass + Object o = c.m(); // exercises TreeScanner.visitApply + } + + static class C { + C() { } + T m() { return null; } + } +} diff --git a/langtools/test/tools/javac/tree/TestAnnotatedAnonClass.java b/langtools/test/tools/javac/tree/TestAnnotatedAnonClass.java new file mode 100644 index 00000000000..0b4b57f2b06 --- /dev/null +++ b/langtools/test/tools/javac/tree/TestAnnotatedAnonClass.java @@ -0,0 +1,37 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + + +/* + * This file is not a regular test, but is processed by ./TreePosTest.java, + * which verifies the position info in the javac tree. + * To run the test standalone, compile TreePosTest, then run TreePosTest + * on this file. + * @bug 6931927 + * @summary position issues with synthesized anonymous class + */ +class TestAnnotatedAnonClass { + void m() { + Object o = new @Deprecated Object() { }; + } +} diff --git a/langtools/test/tools/javac/tree/TreePosTest.java b/langtools/test/tools/javac/tree/TreePosTest.java new file mode 100644 index 00000000000..d8fbc6531a1 --- /dev/null +++ b/langtools/test/tools/javac/tree/TreePosTest.java @@ -0,0 +1,762 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.Font; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Rectangle; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.io.File; +import java.io.IOException; +import java.io.PrintStream; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.swing.DefaultComboBoxModel; +import javax.swing.JComboBox; +import javax.swing.JComponent; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.SwingUtilities; +import javax.swing.event.CaretEvent; +import javax.swing.event.CaretListener; +import javax.swing.text.BadLocationException; +import javax.swing.text.DefaultHighlighter; +import javax.swing.text.Highlighter; +import javax.tools.Diagnostic; +import javax.tools.DiagnosticListener; +import javax.tools.JavaFileObject; +import javax.tools.StandardJavaFileManager; + +import com.sun.source.tree.CompilationUnitTree; +import com.sun.source.util.JavacTask; +import com.sun.tools.javac.api.JavacTool; +import com.sun.tools.javac.code.Flags; +import com.sun.tools.javac.tree.JCTree; +import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; +import com.sun.tools.javac.tree.JCTree.JCNewClass; +import com.sun.tools.javac.tree.JCTree.JCVariableDecl; +import com.sun.tools.javac.tree.TreeInfo; +import com.sun.tools.javac.tree.TreeScanner; + +import static com.sun.tools.javac.util.Position.NOPOS; + +/** + * Utility and test program to check validity of tree positions for tree nodes. + * The program can be run standalone, or as a jtreg test. In standalone mode, + * errors can be displayed in a gui viewer. For info on command line args, + * run program with no args. + * + *

      + * jtreg: Note that by using the -r switch in the test description below, this test + * will process all java files in the langtools/test directory, thus implicitly + * covering any new language features that may be tested in this test suite. + */ + +/* + * @test + * @bug 6919889 + * @summary assorted position errors in compiler syntax trees + * @run main TreePosTest -q -r -ef ./tools/javac/typeAnnotations -ef ./tools/javap/typeAnnotations -et ANNOTATED_TYPE . + */ +public class TreePosTest { + /** + * Main entry point. + * If test.src is set, program runs in jtreg mode, and will throw an Error + * if any errors arise, otherwise System.exit will be used, unless the gui + * viewer is being used. In jtreg mode, the default base directory for file + * args is the value of ${test.src}. In jtreg mode, the -r option can be + * given to change the default base directory to the root test directory. + */ + public static void main(String... args) { + String testSrc = System.getProperty("test.src"); + File baseDir = (testSrc == null) ? null : new File(testSrc); + boolean ok = new TreePosTest().run(baseDir, args); + if (!ok) { + if (testSrc != null) // jtreg mode + throw new Error("failed"); + else + System.exit(1); + } + } + + /** + * Run the program. A base directory can be provided for file arguments. + * In jtreg mode, the -r option can be given to change the default base + * directory to the test root directory. For other options, see usage(). + * @param baseDir base directory for any file arguments. + * @param args command line args + * @return true if successful or in gui mode + */ + boolean run(File baseDir, String... args) { + if (args.length == 0) { + usage(System.out); + return true; + } + + List files = new ArrayList(); + for (int i = 0; i < args.length; i++) { + String arg = args[i]; + if (arg.equals("-encoding") && i + 1 < args.length) + encoding = args[++i]; + else if (arg.equals("-gui")) + gui = true; + else if (arg.equals("-q")) + quiet = true; + else if (arg.equals("-v")) + verbose = true; + else if (arg.equals("-t") && i + 1 < args.length) + tags.add(args[++i]); + else if (arg.equals("-ef") && i + 1 < args.length) + excludeFiles.add(new File(baseDir, args[++i])); + else if (arg.equals("-et") && i + 1 < args.length) + excludeTags.add(args[++i]); + else if (arg.equals("-r")) { + if (excludeFiles.size() > 0) + throw new Error("-r must be used before -ef"); + File d = baseDir; + while (!new File(d, "TEST.ROOT").exists()) { + d = d.getParentFile(); + if (d == null) + throw new Error("cannot find TEST.ROOT"); + } + baseDir = d; + } + else if (arg.startsWith("-")) + throw new Error("unknown option: " + arg); + else { + while (i < args.length) + files.add(new File(baseDir, args[i++])); + } + } + + for (File file: files) { + if (file.exists()) + test(file); + else + error("File not found: " + file); + } + + if (fileCount != 1) + System.err.println(fileCount + " files read"); + if (errors > 0) + System.err.println(errors + " errors"); + + return (gui || errors == 0); + } + + /** + * Print command line help. + * @param out output stream + */ + void usage(PrintStream out) { + out.println("Usage:"); + out.println(" java TreePosTest options... files..."); + out.println(""); + out.println("where options include:"); + out.println("-gui Display returns in a GUI viewer"); + out.println("-q Quiet: don't report on inapplicable files"); + out.println("-v Verbose: report on files as they are being read"); + out.println("-t tag Limit checks to tree nodes with this tag"); + out.println(" Can be repeated if desired"); + out.println("-ef file Exclude file or directory"); + out.println("-et tag Exclude tree nodes with given tag name"); + out.println(""); + out.println("files may be directories or files"); + out.println("directories will be scanned recursively"); + out.println("non java files, or java files which cannot be parsed, will be ignored"); + out.println(""); + } + + /** + * Test a file. If the file is a directory, it will be recursively scanned + * for java files. + * @param file the file or directory to test + */ + void test(File file) { + if (excludeFiles.contains(file)) { + if (!quiet) + error("File " + file + " excluded"); + return; + } + + if (file.isDirectory()) { + for (File f: file.listFiles()) { + test(f); + } + return; + } + + if (file.isFile() && file.getName().endsWith(".java")) { + try { + if (verbose) + System.err.println(file); + fileCount++; + PosTester p = new PosTester(); + p.test(read(file)); + } catch (ParseException e) { + if (!quiet) { + error("Error parsing " + file + "\n" + e.getMessage()); + } + } catch (IOException e) { + error("Error reading " + file + ": " + e); + } + return; + } + + if (!quiet) + error("File " + file + " ignored"); + } + + /** + * Read a file. + * @param file the file to be read + * @return the tree for the content of the file + * @throws IOException if any IO errors occur + * @throws TreePosTest.ParseException if any errors occur while parsing the file + */ + JCCompilationUnit read(File file) throws IOException, ParseException { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + Reporter r = new Reporter(pw); + JavacTool tool = JavacTool.create(); + Charset cs = (encoding == null ? null : Charset.forName(encoding)); + StandardJavaFileManager fm = tool.getStandardFileManager(r, null, null); + Iterable files = fm.getJavaFileObjects(file); + JavacTask task = tool.getTask(pw, fm, r, Collections.emptyList(), null, files); + Iterable trees = task.parse(); + pw.flush(); + if (r.errors > 0) + throw new ParseException(sw.toString()); + Iterator iter = trees.iterator(); + if (!iter.hasNext()) + throw new Error("no trees found"); + JCCompilationUnit t = (JCCompilationUnit) iter.next(); + if (iter.hasNext()) + throw new Error("too many trees found"); + return t; + } + + /** + * Report an error. When the program is complete, the program will either + * exit or throw an Error if any errors have been reported. + * @param msg the error message + */ + void error(String msg) { + System.err.println(msg); + errors++; + } + + /** Number of files that have been analyzed. */ + int fileCount; + /** Number of errors reported. */ + int errors; + /** Flag: don't report irrelevant files. */ + boolean quiet; + /** Flag: report files as they are processed. */ + boolean verbose; + /** Flag: show errors in GUI viewer. */ + boolean gui; + /** Option: encoding for test files. */ + String encoding; + /** The GUI viewer for errors. */ + Viewer viewer; + /** The set of tags for tree nodes to be analyzed; if empty, all tree nodes + * are analyzed. */ + Set tags = new HashSet(); + /** Set of files and directories to be excluded from analysis. */ + Set excludeFiles = new HashSet(); + /** Set of tag names to be excluded from analysis. */ + Set excludeTags = new HashSet(); + /** Table of printable names for tree tag values. */ + TagNames tagNames = new TagNames(); + + /** + * Main class for testing assertions concerning tree positions for tree nodes. + */ + private class PosTester extends TreeScanner { + void test(JCCompilationUnit tree) { + sourcefile = tree.sourcefile; + endPosTable = tree.endPositions; + encl = new Info(); + tree.accept(this); + } + + @Override + public void scan(JCTree tree) { + if (tree == null) + return; + + Info self = new Info(tree, endPosTable); + if (check(encl, self)) { + // Modifiers nodes are present throughout the tree even where + // there is no corresponding source text. + // Redundant semicolons in a class definition can cause empty + // initializer blocks with no positions. + if ((self.tag == JCTree.MODIFIERS || self.tag == JCTree.BLOCK) + && self.pos == NOPOS) { + // If pos is NOPOS, so should be the start and end positions + check("start == NOPOS", encl, self, self.start == NOPOS); + check("end == NOPOS", encl, self, self.end == NOPOS); + } else { + // For this node, start , pos, and endpos should be all defined + check("start != NOPOS", encl, self, self.start != NOPOS); + check("pos != NOPOS", encl, self, self.pos != NOPOS); + check("end != NOPOS", encl, self, self.end != NOPOS); + // The following should normally be ordered + // encl.start <= start <= pos <= end <= encl.end + // In addition, the position of the enclosing node should be + // within this node. + // The primary exceptions are for array type nodes, because of the + // need to support legacy syntax: + // e.g. int a[]; int[] b[]; int f()[] { return null; } + // and because of inconsistent nesting of left and right of + // array declarations: + // e.g. int[][] a = new int[2][]; + check("encl.start <= start", encl, self, encl.start <= self.start); + check("start <= pos", encl, self, self.start <= self.pos); + if (!(self.tag == JCTree.TYPEARRAY + && (encl.tag == JCTree.VARDEF || encl.tag == JCTree.TYPEARRAY))) { + check("encl.pos <= start || end <= encl.pos", + encl, self, encl.pos <= self.start || self.end <= encl.pos); + } + check("pos <= end", encl, self, self.pos <= self.end); + if (!(self.tag == JCTree.TYPEARRAY && encl.tag == JCTree.TYPEARRAY)) { + check("end <= encl.end", encl, self, self.end <= encl.end); + } + } + } + + Info prevEncl = encl; + encl = self; + tree.accept(this); + encl = prevEncl; + } + + @Override + public void visitVarDef(JCVariableDecl tree) { + // enum member declarations are desugared in the parser and have + // ill-defined semantics for tree positions, so for now, we + // skip the synthesized bits and just check parts which came from + // the original source text + if ((tree.mods.flags & Flags.ENUM) != 0) { + scan(tree.mods); + if (tree.init != null) { + if (tree.init.getTag() == JCTree.NEWCLASS) { + JCNewClass init = (JCNewClass) tree.init; + if (init.args != null && init.args.nonEmpty()) { + scan(init.args); + } + if (init.def != null && init.def.defs != null) { + scan(init.def.defs); + } + } + } + } else + super.visitVarDef(tree); + } + + boolean check(Info encl, Info self) { + if (excludeTags.size() > 0) { + if (encl != null && excludeTags.contains(tagNames.get(encl.tag)) + || excludeTags.contains(tagNames.get(self.tag))) + return false; + } + return tags.size() == 0 || tags.contains(tagNames.get(self.tag)); + } + + void check(String label, Info encl, Info self, boolean ok) { + if (!ok) { + if (gui) { + if (viewer == null) + viewer = new Viewer(); + viewer.addEntry(sourcefile, label, encl, self); + } + + String s = self.tree.toString(); + String msg = sourcefile.getName() + ": " + label + ": " + + "encl:" + encl + " this:" + self + "\n" + + s.substring(0, Math.min(80, s.length())).replaceAll("[\r\n]+", " "); + error(msg); + } + } + + JavaFileObject sourcefile; + Map endPosTable; + Info encl; + + } + + /** + * Utility class providing easy access to position and other info for a tree node. + */ + private class Info { + Info() { + tree = null; + tag = JCTree.ERRONEOUS; + start = 0; + pos = 0; + end = Integer.MAX_VALUE; + } + + Info(JCTree tree, Map endPosTable) { + this.tree = tree; + tag = tree.getTag(); + start = TreeInfo.getStartPos(tree); + pos = tree.pos; + end = TreeInfo.getEndPos(tree, endPosTable); + } + + @Override + public String toString() { + return tagNames.get(tree.getTag()) + "[start:" + start + ",pos:" + pos + ",end:" + end + "]"; + } + + final JCTree tree; + final int tag; + final int start; + final int pos; + final int end; + } + + /** + * Names for tree tags. + * javac does not provide an API to convert tag values to strings, so this class uses + * reflection to determine names of public static final int values in JCTree. + */ + private static class TagNames { + String get(int tag) { + if (map == null) { + map = new HashMap(); + Class c = JCTree.class; + for (Field f : c.getDeclaredFields()) { + if (f.getType().equals(int.class)) { + int mods = f.getModifiers(); + if (Modifier.isPublic(mods) && Modifier.isStatic(mods) && Modifier.isFinal(mods)) { + try { + map.put(f.getInt(null), f.getName()); + } catch (IllegalAccessException e) { + } + } + } + } + } + String name = map.get(tag); + return (name == null) ? "??" : name; + } + + private Map map; + } + + /** + * Thrown when errors are found parsing a java file. + */ + private static class ParseException extends Exception { + ParseException(String msg) { + super(msg); + } + } + + /** + * DiagnosticListener to report diagnostics and count any errors that occur. + */ + private static class Reporter implements DiagnosticListener { + Reporter(PrintWriter out) { + this.out = out; + } + + public void report(Diagnostic diagnostic) { + out.println(diagnostic); + switch (diagnostic.getKind()) { + case ERROR: + errors++; + } + } + int errors; + PrintWriter out; + } + + /** + * GUI viewer for issues found by TreePosTester. The viewer provides a drop + * down list for selecting error conditions, a header area providing details + * about an error, and a text area with the ranges of text highlighted as + * appropriate. + */ + private class Viewer extends JFrame { + /** + * Create a viewer. + */ + Viewer() { + initGUI(); + } + + /** + * Add another entry to the list of errors. + * @param file The file containing the error + * @param check The condition that was being tested, and which failed + * @param encl the enclosing tree node + * @param self the tree node containing the error + */ + void addEntry(JavaFileObject file, String check, Info encl, Info self) { + Entry e = new Entry(file, check, encl, self); + DefaultComboBoxModel m = (DefaultComboBoxModel) entries.getModel(); + m.addElement(e); + if (m.getSize() == 1) + entries.setSelectedItem(e); + } + + /** + * Initialize the GUI window. + */ + private void initGUI() { + JPanel head = new JPanel(new GridBagLayout()); + GridBagConstraints lc = new GridBagConstraints(); + GridBagConstraints fc = new GridBagConstraints(); + fc.anchor = GridBagConstraints.WEST; + fc.fill = GridBagConstraints.HORIZONTAL; + fc.gridwidth = GridBagConstraints.REMAINDER; + + entries = new JComboBox(); + entries.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + showEntry((Entry) entries.getSelectedItem()); + } + }); + fc.insets.bottom = 10; + head.add(entries, fc); + fc.insets.bottom = 0; + head.add(new JLabel("check:"), lc); + head.add(checkField = createTextField(80), fc); + fc.fill = GridBagConstraints.NONE; + head.add(setBackground(new JLabel("encl:"), enclColor), lc); + head.add(enclPanel = new InfoPanel(), fc); + head.add(setBackground(new JLabel("self:"), selfColor), lc); + head.add(selfPanel = new InfoPanel(), fc); + add(head, BorderLayout.NORTH); + + body = new JTextArea(); + body.setFont(Font.decode(Font.MONOSPACED)); + body.addCaretListener(new CaretListener() { + public void caretUpdate(CaretEvent e) { + int dot = e.getDot(); + int mark = e.getMark(); + if (dot == mark) + statusText.setText("dot: " + dot); + else + statusText.setText("dot: " + dot + ", mark:" + mark); + } + }); + JScrollPane p = new JScrollPane(body, + JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, + JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); + p.setPreferredSize(new Dimension(640, 480)); + add(p, BorderLayout.CENTER); + + statusText = createTextField(80); + add(statusText, BorderLayout.SOUTH); + + pack(); + setLocationRelativeTo(null); // centered on screen + setVisible(true); + setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + } + + /** Show an entry that has been selected. */ + private void showEntry(Entry e) { + try { + // update simple fields + setTitle(e.file.getName()); + checkField.setText(e.check); + enclPanel.setInfo(e.encl); + selfPanel.setInfo(e.self); + // show file text with highlights + body.setText(e.file.getCharContent(true).toString()); + Highlighter highlighter = body.getHighlighter(); + highlighter.removeAllHighlights(); + addHighlight(highlighter, e.encl, enclColor); + addHighlight(highlighter, e.self, selfColor); + scroll(body, getMinPos(enclPanel.info, selfPanel.info)); + } catch (IOException ex) { + body.setText("Cannot read " + e.file.getName() + ": " + e); + } + } + + /** Create a test field. */ + private JTextField createTextField(int width) { + JTextField f = new JTextField(width); + f.setEditable(false); + f.setBorder(null); + return f; + } + + /** Add a highlighted region based on the positions in an Info object. */ + private void addHighlight(Highlighter h, Info info, Color c) { + int start = info.start; + int end = info.end; + if (start == -1 && end == -1) + return; + if (start == -1) + start = end; + if (end == -1) + end = start; + try { + h.addHighlight(info.start, info.end, + new DefaultHighlighter.DefaultHighlightPainter(c)); + if (info.pos != -1) { + Color c2 = new Color(c.getRed(), c.getGreen(), c.getBlue(), (int)(.4f * 255)); // 40% + h.addHighlight(info.pos, info.pos + 1, + new DefaultHighlighter.DefaultHighlightPainter(c2)); + } + } catch (BadLocationException e) { + e.printStackTrace(); + } + } + + /** Get the minimum valid position in a set of info objects. */ + private int getMinPos(Info... values) { + int i = Integer.MAX_VALUE; + for (Info info: values) { + if (info.start >= 0) i = Math.min(i, info.start); + if (info.pos >= 0) i = Math.min(i, info.pos); + if (info.end >= 0) i = Math.min(i, info.end); + } + return (i == Integer.MAX_VALUE) ? 0 : i; + } + + /** Set the background on a component. */ + private JComponent setBackground(JComponent comp, Color c) { + comp.setOpaque(true); + comp.setBackground(c); + return comp; + } + + /** Scroll a text area to display a given position near the middle of the visible area. */ + private void scroll(final JTextArea t, final int pos) { + // Using invokeLater appears to give text a chance to sort itself out + // before the scroll happens; otherwise scrollRectToVisible doesn't work. + // Maybe there's a better way to sync with the text... + EventQueue.invokeLater(new Runnable() { + public void run() { + try { + Rectangle r = t.modelToView(pos); + JScrollPane p = (JScrollPane) SwingUtilities.getAncestorOfClass(JScrollPane.class, t); + r.y = Math.max(0, r.y - p.getHeight() * 2 / 5); + r.height += p.getHeight() * 4 / 5; + t.scrollRectToVisible(r); + } catch (BadLocationException ignore) { + } + } + }); + } + + private JComboBox entries; + private JTextField checkField; + private InfoPanel enclPanel; + private InfoPanel selfPanel; + private JTextArea body; + private JTextField statusText; + + private Color selfColor = new Color(0.f, 1.f, 0.f, 0.2f); // 20% green + private Color enclColor = new Color(1.f, 0.f, 0.f, 0.2f); // 20% red + + /** Panel to display an Info object. */ + private class InfoPanel extends JPanel { + InfoPanel() { + add(tagName = createTextField(20)); + add(new JLabel("start:")); + add(addListener(start = createTextField(6))); + add(new JLabel("pos:")); + add(addListener(pos = createTextField(6))); + add(new JLabel("end:")); + add(addListener(end = createTextField(6))); + } + + void setInfo(Info info) { + this.info = info; + tagName.setText(tagNames.get(info.tag)); + start.setText(String.valueOf(info.start)); + pos.setText(String.valueOf(info.pos)); + end.setText(String.valueOf(info.end)); + } + + JTextField addListener(final JTextField f) { + f.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + body.setCaretPosition(Integer.valueOf(f.getText())); + body.getCaret().setVisible(true); + } + }); + return f; + } + + Info info; + JTextField tagName; + JTextField start; + JTextField pos; + JTextField end; + } + + /** Object to record information about an error to be displayed. */ + private class Entry { + Entry(JavaFileObject file, String check, Info encl, Info self) { + this.file = file; + this.check = check; + this.encl = encl; + this.self= self; + } + + @Override + public String toString() { + return file.getName() + " " + check + " " + getMinPos(encl, self); + } + + final JavaFileObject file; + final String check; + final Info encl; + final Info self; + } + } +} + diff --git a/langtools/test/tools/javac/tree/TreeScannerTest.java b/langtools/test/tools/javac/tree/TreeScannerTest.java new file mode 100644 index 00000000000..79b95510958 --- /dev/null +++ b/langtools/test/tools/javac/tree/TreeScannerTest.java @@ -0,0 +1,387 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + + +/** + * Utility and test program to check javac's internal TreeScanner class. + * The program can be run standalone, or as a jtreg test. For info on + * command line args, run program with no args. + * + *

      + * jtreg: Note that by using the -r switch in the test description below, this test + * will process all java files in the langtools/test directory, thus implicitly + * covering any new language features that may be tested in this test suite. + */ + +/* + * @test + * @bug 6923080 + * @summary TreeScanner.visitNewClass should scan tree.typeargs + * @run main TreeScannerTest -q -r . + */ + +import java.io.*; +import java.lang.reflect.*; +import java.util.*; +import javax.tools.*; + +import com.sun.source.tree.CompilationUnitTree; +import com.sun.source.util.JavacTask; +import com.sun.tools.javac.api.JavacTool; +import com.sun.tools.javac.tree.*; +import com.sun.tools.javac.tree.JCTree.*; +import com.sun.tools.javac.util.List; + +public class TreeScannerTest { + /** + * Main entry point. + * If test.src is set, program runs in jtreg mode, and will throw an Error + * if any errors arise, otherwise System.exit will be used. In jtreg mode, + * the default base directory for file args is the value of ${test.src}. + * In jtreg mode, the -r option can be given to change the default base + * directory to the root test directory. + */ + public static void main(String... args) { + String testSrc = System.getProperty("test.src"); + File baseDir = (testSrc == null) ? null : new File(testSrc); + boolean ok = new TreeScannerTest().run(baseDir, args); + if (!ok) { + if (testSrc != null) // jtreg mode + throw new Error("failed"); + else + System.exit(1); + } + } + + /** + * Run the program. A base directory can be provided for file arguments. + * In jtreg mode, the -r option can be given to change the default base + * directory to the test root directory. For other options, see usage(). + * @param baseDir base directory for any file arguments. + * @param args command line args + * @return true if successful or in gui mode + */ + boolean run(File baseDir, String... args) { + if (args.length == 0) { + usage(System.out); + return true; + } + + ArrayList files = new ArrayList(); + for (int i = 0; i < args.length; i++) { + String arg = args[i]; + if (arg.equals("-q")) + quiet = true; + else if (arg.equals("-v")) + verbose = true; + else if (arg.equals("-r")) { + File d = baseDir; + while (!new File(d, "TEST.ROOT").exists()) { + d = d.getParentFile(); + if (d == null) + throw new Error("cannot find TEST.ROOT"); + } + baseDir = d; + } + else if (arg.startsWith("-")) + throw new Error("unknown option: " + arg); + else { + while (i < args.length) + files.add(new File(baseDir, args[i++])); + } + } + + for (File file: files) { + if (file.exists()) + test(file); + else + error("File not found: " + file); + } + + if (fileCount != 1) + System.err.println(fileCount + " files read"); + if (errors > 0) + System.err.println(errors + " errors"); + + return (errors == 0); + } + + /** + * Print command line help. + * @param out output stream + */ + void usage(PrintStream out) { + out.println("Usage:"); + out.println(" java TreeScannerTest options... files..."); + out.println(""); + out.println("where options include:"); + out.println("-q Quiet: don't report on inapplicable files"); + out.println("-v Verbose: report on files as they are being read"); + out.println(""); + out.println("files may be directories or files"); + out.println("directories will be scanned recursively"); + out.println("non java files, or java files which cannot be parsed, will be ignored"); + out.println(""); + } + + /** + * Test a file. If the file is a directory, it will be recursively scanned + * for java files. + * @param file the file or directory to test + */ + void test(File file) { + if (file.isDirectory()) { + for (File f: file.listFiles()) { + test(f); + } + return; + } + + if (file.isFile() && file.getName().endsWith(".java")) { + try { + if (verbose) + System.err.println(file); + fileCount++; + ScanTester t = new ScanTester(); + t.test(read(file)); + } catch (ParseException e) { + if (!quiet) { + error("Error parsing " + file + "\n" + e.getMessage()); + } + } catch (IOException e) { + error("Error reading " + file + ": " + e); + } + return; + } + + if (!quiet) + error("File " + file + " ignored"); + } + + /** + * Read a file. + * @param file the file to be read + * @return the tree for the content of the file + * @throws IOException if any IO errors occur + * @throws TreePosTest.ParseException if any errors occur while parsing the file + */ + JCCompilationUnit read(File file) throws IOException, ParseException { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + Reporter r = new Reporter(pw); + JavacTool tool = JavacTool.create(); + StandardJavaFileManager fm = tool.getStandardFileManager(r, null, null); + Iterable files = fm.getJavaFileObjects(file); + JavacTask task = tool.getTask(pw, fm, r, Collections.emptyList(), null, files); + Iterable trees = task.parse(); + pw.flush(); + if (r.errors > 0) + throw new ParseException(sw.toString()); + Iterator iter = trees.iterator(); + if (!iter.hasNext()) + throw new Error("no trees found"); + JCCompilationUnit t = (JCCompilationUnit) iter.next(); + if (iter.hasNext()) + throw new Error("too many trees found"); + return t; + } + + /** + * Report an error. When the program is complete, the program will either + * exit or throw an Error if any errors have been reported. + * @param msg the error message + */ + void error(String msg) { + System.err.println(msg); + errors++; + } + + /** + * Report an error for a specific tree node. + * @param file the source file for the tree + * @param t the tree node + * @param label an indication of the error + */ + void error(JavaFileObject file, JCTree t, String msg) { + error(file.getName() + ":" + getLine(file, t) + ": " + msg + " " + trim(t, 64)); + } + + /** + * Get a trimmed string for a tree node, with normalized white space and limited length. + */ + String trim(JCTree t, int len) { + String s = t.toString().replaceAll("[\r\n]+", " ").replaceAll(" +", " "); + return (s.length() < len) ? s : s.substring(0, len); + } + + /** Number of files that have been analyzed. */ + int fileCount; + /** Number of errors reported. */ + int errors; + /** Flag: don't report irrelevant files. */ + boolean quiet; + /** Flag: report files as they are processed. */ + boolean verbose; + + /** + * Main class for testing operation of tree scanner. + * The set of nodes found by the scanner are compared + * against the set of nodes found by reflection. + */ + private class ScanTester extends TreeScanner { + /** Main entry method for the class. */ + void test(JCCompilationUnit tree) { + sourcefile = tree.sourcefile; + found = new HashSet(); + scan(tree); + expect = new HashSet(); + reflectiveScan(tree); + if (found.equals(expect)) + return; + + error("Differences found for " + tree.sourcefile.getName()); + + if (found.size() != expect.size()) + error("Size mismatch; found: " + found.size() + ", expected: " + expect.size()); + + Set missing = new HashSet(); + missing.addAll(expect); + missing.removeAll(found); + for (JCTree t: missing) + error(tree.sourcefile, t, "missing"); + + Set excess = new HashSet(); + excess.addAll(found); + excess.removeAll(expect); + for (JCTree t: excess) + error(tree.sourcefile, t, "unexpected"); + } + + /** Record all tree nodes found by scanner. */ + @Override + public void scan(JCTree tree) { + if (tree == null) + return; + System.err.println("FOUND: " + tree.getTag() + " " + trim(tree, 64)); + found.add(tree); + super.scan(tree); + } + + /** record all tree nodes found by reflection. */ + public void reflectiveScan(Object o) { + if (o == null) + return; + if (o instanceof JCTree) { + JCTree tree = (JCTree) o; + System.err.println("EXPECT: " + tree.getTag() + " " + trim(tree, 64)); + expect.add(tree); + for (Field f: getFields(tree)) { + try { + //System.err.println("FIELD: " + f.getName()); + reflectiveScan(f.get(tree)); + } catch (IllegalAccessException e) { + error(e.toString()); + } + } + } else if (o instanceof List) { + List list = (List) o; + for (Object item: list) + reflectiveScan(item); + } else + error("unexpected item: " + o); + } + + JavaFileObject sourcefile; + Set found; + Set expect; + } + + /** + * Thrown when errors are found parsing a java file. + */ + private static class ParseException extends Exception { + ParseException(String msg) { + super(msg); + } + } + + /** + * DiagnosticListener to report diagnostics and count any errors that occur. + */ + private static class Reporter implements DiagnosticListener { + Reporter(PrintWriter out) { + this.out = out; + } + + public void report(Diagnostic diagnostic) { + out.println(diagnostic); + switch (diagnostic.getKind()) { + case ERROR: + errors++; + } + } + int errors; + PrintWriter out; + } + + /** + * Get the set of fields for a tree node that may contain child tree nodes. + * These are the fields that are subtypes of JCTree or List. + * The results are cached, based on the tree's tag. + */ + Set getFields(JCTree tree) { + Set fields = map.get(tree.getTag()); + if (fields == null) { + fields = new HashSet(); + for (Field f: tree.getClass().getFields()) { + Class fc = f.getType(); + if (JCTree.class.isAssignableFrom(fc) || List.class.isAssignableFrom(fc)) + fields.add(f); + } + map.put(tree.getTag(), fields); + } + return fields; + } + // where + Map> map = new HashMap>(); + + /** Get the line number for the primary position for a tree. + * The code is intended to be simple, although not necessarily efficient. + * However, note that a file manager such as JavacFileManager is likely + * to cache the results of file.getCharContent, avoiding the need to read + * the bits from disk each time this method is called. + */ + int getLine(JavaFileObject file, JCTree tree) { + try { + CharSequence cs = file.getCharContent(true); + int line = 1; + for (int i = 0; i < tree.pos; i++) { + if (cs.charAt(i) == '\n') // jtreg tests always use Unix line endings + line++; + } + return line; + } catch (IOException e) { + return -1; + } + } +} diff --git a/langtools/test/tools/javac/treeannotests/AnnoTreeTests.java b/langtools/test/tools/javac/treeannotests/AnnoTreeTests.java new file mode 100644 index 00000000000..92472c1976b --- /dev/null +++ b/langtools/test/tools/javac/treeannotests/AnnoTreeTests.java @@ -0,0 +1,44 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @build DA TA Test TestProcessor + * @compile -proc:only -processor TestProcessor AnnoTreeTests.java + */ + +@Test(6) +class AnnoTreeTests { + // primitive types + @DA("int") int i1; + int i2 = (@TA("int") int) 0; + + // simple array types + @DA("int[]") int[] a1; + int @TA("int") [] a2; + int[] a3 = (@TA("int[]") int[]) a1; + int[] a4 = (int @TA("int") []) a1; + + // multi-dimensional array types + // (still to come) +} diff --git a/langtools/test/tools/javac/treeannotests/DA.java b/langtools/test/tools/javac/treeannotests/DA.java new file mode 100644 index 00000000000..b691bec5270 --- /dev/null +++ b/langtools/test/tools/javac/treeannotests/DA.java @@ -0,0 +1,37 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.lang.annotation.*; +import static java.lang.annotation.ElementType.*; + +/** + * Annotation used by TestProcessor to indicate the expected type + * of the declaration to which the annotation is attached. + * These annotations are expected to be found in the modifiers + * field on ClassDef, MethodDef and VarDef nodes. + */ +@Target({FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE}) +@interface DA { + String value(); +} + diff --git a/langtools/test/tools/javac/treeannotests/TA.java b/langtools/test/tools/javac/treeannotests/TA.java new file mode 100644 index 00000000000..ba9b044db9c --- /dev/null +++ b/langtools/test/tools/javac/treeannotests/TA.java @@ -0,0 +1,36 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.lang.annotation.*; +import static java.lang.annotation.ElementType.*; + +/** + * Annotation used by TestProcessor to indicate the expected type + * to which the annotation is attached. + * These annotations are expected to be found in AnnotatedType nodes. + */ +@Target({TYPE_USE, TYPE_PARAMETER}) +@interface TA { + String value(); +} + diff --git a/langtools/test/tools/javac/treeannotests/Test.java b/langtools/test/tools/javac/treeannotests/Test.java new file mode 100644 index 00000000000..c1887a61bcd --- /dev/null +++ b/langtools/test/tools/javac/treeannotests/Test.java @@ -0,0 +1,32 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/** + * Annotation used by TestProcessor to indicate the expected number of + * @DA and @TA annotations in the source tree to which the Test annotation + * is attached. + */ +@interface Test { + int value(); +} + diff --git a/langtools/test/tools/javac/treeannotests/TestProcessor.java b/langtools/test/tools/javac/treeannotests/TestProcessor.java new file mode 100644 index 00000000000..f059c668d19 --- /dev/null +++ b/langtools/test/tools/javac/treeannotests/TestProcessor.java @@ -0,0 +1,302 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.io.*; +import java.util.*; +import javax.annotation.processing.*; +import javax.lang.model.*; +import javax.lang.model.element.*; +import javax.lang.model.util.*; +import javax.tools.*; + +import com.sun.source.util.*; +import com.sun.tools.javac.code.BoundKind; +import com.sun.tools.javac.tree.JCTree.*; +import com.sun.tools.javac.tree.TreeScanner; +import com.sun.tools.javac.tree.*; +import com.sun.tools.javac.util.List; + +/** + * Test processor used to check test programs using the @Test, @DA, and @TA + * annotations. + * + * The processor looks for elements annotated with @Test, and analyzes the + * syntax trees for those elements. Within such trees, the processor looks + * for the DA annotations on decls and TA annotations on types. + * The value of these annotations should be a simple string rendition of + * the tree node to which it is attached. + * The expected number of annotations is given by the parameter to the + * @Test annotation itself. + */ +@SupportedAnnotationTypes({"Test"}) +public class TestProcessor extends AbstractProcessor { + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + + /** Process trees for elements annotated with the @Test(n) annotation. */ + public boolean process(Set annos, RoundEnvironment renv) { + if (renv.processingOver()) + return true; + + Elements elements = processingEnv.getElementUtils(); + Trees trees = Trees.instance(processingEnv); + + TypeElement testAnno = elements.getTypeElement("Test"); + for (Element elem: renv.getElementsAnnotatedWith(testAnno)) { + System.err.println("ELEM: " + elem); + int count = getValue(getAnnoMirror(elem, testAnno), Integer.class); + System.err.println("count: " + count); + TreePath p = trees.getPath(elem); + JavaFileObject file = p.getCompilationUnit().getSourceFile(); + JCTree tree = (JCTree) p.getLeaf(); + System.err.println("tree: " + tree); + new TestScanner(file).check(tree, count); + } + return true; + } + + /** Get the AnnotationMirror on an element for a given annotation. */ + AnnotationMirror getAnnoMirror(Element e, TypeElement anno) { + Types types = processingEnv.getTypeUtils(); + for (AnnotationMirror m: e.getAnnotationMirrors()) { + if (types.isSameType(m.getAnnotationType(), anno.asType())) + return m; + } + return null; + } + + /** Get the value of the value element of an annotation mirror. */ + T getValue(AnnotationMirror m, Class type) { + for (Map.Entry e: m.getElementValues().entrySet()) { + ExecutableElement ee = e.getKey(); + if (ee.getSimpleName().contentEquals("value")) { + AnnotationValue av = e.getValue(); + return type.cast(av.getValue()); + } + } + return null; + } + + /** Report an error to the annotation processing system. */ + void error(String msg) { + Messager messager = processingEnv.getMessager(); + messager.printMessage(Diagnostic.Kind.ERROR, msg); + } + + /** Report an error to the annotation processing system. */ + void error(JavaFileObject file, JCTree tree, String msg) { + // need better API for reporting tree position errors to the messager + Messager messager = processingEnv.getMessager(); + String text = file.getName() + ":" + getLine(file, tree) + ": " + msg; + messager.printMessage(Diagnostic.Kind.ERROR, text); + } + + /** Get the line number for the primary position for a tree. + * The code is intended to be simple, although not necessarily efficient. + * However, note that a file manager such as JavacFileManager is likely + * to cache the results of file.getCharContent, avoiding the need to read + * the bits from disk each time this method is called. + */ + int getLine(JavaFileObject file, JCTree tree) { + try { + CharSequence cs = file.getCharContent(true); + int line = 1; + for (int i = 0; i < tree.pos; i++) { + if (cs.charAt(i) == '\n') // jtreg tests always use Unix line endings + line++; + } + return line; + } catch (IOException e) { + return -1; + } + } + + /** Scan a tree, looking for @DA and @TA annotations, and verifying that such + * annotations are attached to the expected tree node matching the string + * parameter of the annotation. + */ + class TestScanner extends TreeScanner { + /** Create a scanner for a given file. */ + TestScanner(JavaFileObject file) { + this.file = file; + } + + /** Check the annotations in a given tree. */ + void check(JCTree tree, int expectCount) { + foundCount = 0; + scan(tree); + if (foundCount != expectCount) + error(file, tree, "Wrong number of annotations found: " + foundCount + ", expected: " + expectCount); + } + + /** Check @DA annotations on a class declaration. */ + @Override + public void visitClassDef(JCClassDecl tree) { + super.visitClassDef(tree); + check(tree.mods.annotations, "DA", tree); + } + + /** Check @DA annotations on a method declaration. */ + @Override + public void visitMethodDef(JCMethodDecl tree) { + super.visitMethodDef(tree); + check(tree.mods.annotations, "DA", tree); + } + + /** Check @DA annotations on a field, parameter or local variable declaration. */ + @Override + public void visitVarDef(JCVariableDecl tree) { + super.visitVarDef(tree); + check(tree.mods.annotations, "DA", tree); + } + + /** Check @TA annotations on a type. */ + public void visitAnnotatedType(JCAnnotatedType tree) { + super.visitAnnotatedType(tree); + check(tree.annotations, "TA", tree); + } + + /** Check to see if a list of annotations contains a named annotation, and + * if so, verify the annotation is expected by comparing the value of the + * annotation's argument against the string rendition of the reference tree + * node. + * @param annos the list of annotations to be checked + * @param name the name of the annotation to be checked + * @param tree the tree against which to compare the annotations's argument + */ + void check(List annos, String name, JCTree tree) { + for (List l = annos; l.nonEmpty(); l = l.tail) { + JCAnnotation anno = l.head; + if (anno.annotationType.toString().equals(name) && (anno.args.size() == 1)) { + String expect = getStringValue(anno.args.head); + foundCount++; + System.err.println("found: " + name + " " + expect); + String found = new TypePrinter().print(tree); + if (!found.equals(expect)) + error(file, anno, "Unexpected result: expected: \"" + expect + "\", found: \"" + found + "\""); + } + } + } + + /** Get the string value of an annotation argument, which is given by the + * expression name=value. + */ + String getStringValue(JCExpression e) { + if (e.getTag() == JCTree.ASSIGN) { + JCAssign a = (JCAssign) e; + JCExpression rhs = a.rhs; + if (rhs.getTag() == JCTree.LITERAL) { + JCLiteral l = (JCLiteral) rhs; + return (String) l.value; + } + } + throw new IllegalArgumentException(e.toString()); + } + + /** The file for the tree. Used to locate errors. */ + JavaFileObject file; + /** The number of annotations that have been found. @see #check */ + int foundCount; + } + + /** Convert a type or decl tree to a reference string used by the @DA and @TA annotations. */ + class TypePrinter extends Visitor { + /** Convert a type or decl tree to a string. */ + String print(JCTree tree) { + if (tree == null) + return null; + tree.accept(this); + return result; + } + + String print(List list) { + return print(list, ", "); + } + + String print(List list, String sep) { + StringBuilder sb = new StringBuilder(); + if (list.nonEmpty()) { + sb.append(print(list.head)); + for (List l = list.tail; l.nonEmpty(); l = l.tail) { + sb.append(sep); + sb.append(print(l.head)); + } + } + return sb.toString(); + } + + @Override + public void visitClassDef(JCClassDecl tree) { + result = tree.name.toString(); + } + + @Override + public void visitMethodDef(JCMethodDecl tree) { + result = tree.name.toString(); + } + + @Override + public void visitVarDef(JCVariableDecl tree) { + tree.vartype.accept(this); + } + + @Override + public void visitAnnotatedType(JCAnnotatedType tree) { + tree.underlyingType.accept(this); + } + + @Override + public void visitTypeIdent(JCPrimitiveTypeTree tree) { + result = tree.toString(); + } + + @Override + public void visitTypeArray(JCArrayTypeTree tree) { + result = print(tree.elemtype) + "[]"; + } + + @Override + public void visitTypeApply(JCTypeApply tree) { + result = print(tree.clazz) + "<" + print(tree.arguments) + ">"; + } + + @Override + public void visitTypeParameter(JCTypeParameter tree) { + if (tree.bounds.isEmpty()) + result = tree.name.toString(); + else + result = tree.name + " extends " + print(tree.bounds, "&"); + } + + @Override + public void visitWildcard(JCWildcard tree) { + if (tree.kind.kind == BoundKind.UNBOUND) + result = tree.kind.toString(); + else + result = tree.kind + " " + print(tree.inner); + } + + private String result; + } +} diff --git a/langtools/test/tools/javac/typeAnnotations/classfile/DeadCode.java b/langtools/test/tools/javac/typeAnnotations/classfile/DeadCode.java new file mode 100644 index 00000000000..ca334e81014 --- /dev/null +++ b/langtools/test/tools/javac/typeAnnotations/classfile/DeadCode.java @@ -0,0 +1,181 @@ +/* + * Copyright 2009-2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.io.*; +import java.net.URL; +import java.util.List; + +import com.sun.tools.classfile.*; + +/* + * @test + * @bug 6917130 + * @summary test that optimized away annotations are not emited to classfile + */ + +public class DeadCode { + public static void main(String[] args) throws Exception { + new DeadCode().run(); + } + + public void run() throws Exception { + ClassFile cf = getClassFile("DeadCode$Test.class"); + test(cf); + for (Field f : cf.fields) { + test(cf, f); + } + for (Method m: cf.methods) { + test(cf, m); + } + + countAnnotations(); + + if (errors > 0) + throw new Exception(errors + " errors found"); + System.out.println("PASSED"); + } + + ClassFile getClassFile(String name) throws IOException, ConstantPoolException { + URL url = getClass().getResource(name); + InputStream in = url.openStream(); + try { + return ClassFile.read(in); + } finally { + in.close(); + } + } + + /************ Helper annotations counting methods ******************/ + void test(ClassFile cf) { + test(cf, Attribute.RuntimeVisibleTypeAnnotations, true); + test(cf, Attribute.RuntimeInvisibleTypeAnnotations, false); + } + + void test(ClassFile cf, Method m) { + test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true); + test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false); + } + + void test(ClassFile cf, Field m) { + test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true); + test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false); + } + + // test the result of Attributes.getIndex according to expectations + // encoded in the method's name + void test(ClassFile cf, String name, boolean visible) { + int index = cf.attributes.getIndex(cf.constant_pool, name); + if (index != -1) { + Attribute attr = cf.attributes.get(index); + assert attr instanceof RuntimeTypeAnnotations_attribute; + RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; + all += tAttr.annotations.length; + if (visible) + visibles += tAttr.annotations.length; + else + invisibles += tAttr.annotations.length; + } + } + + // test the result of Attributes.getIndex according to expectations + // encoded in the method's name + void test(ClassFile cf, Method m, String name, boolean visible) { + int index = m.attributes.getIndex(cf.constant_pool, name); + if (index != -1) { + Attribute attr = m.attributes.get(index); + assert attr instanceof RuntimeTypeAnnotations_attribute; + RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; + all += tAttr.annotations.length; + if (visible) + visibles += tAttr.annotations.length; + else + invisibles += tAttr.annotations.length; + } + } + + // test the result of Attributes.getIndex according to expectations + // encoded in the method's name + void test(ClassFile cf, Field m, String name, boolean visible) { + int index = m.attributes.getIndex(cf.constant_pool, name); + if (index != -1) { + Attribute attr = m.attributes.get(index); + assert attr instanceof RuntimeTypeAnnotations_attribute; + RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr; + all += tAttr.annotations.length; + if (visible) + visibles += tAttr.annotations.length; + else + invisibles += tAttr.annotations.length; + } + } + + void countAnnotations() { + int expected_all = expected_visibles + expected_invisibles; + + if (expected_all != all) { + errors++; + System.err.println("expected " + expected_all + + " annotations but found " + all); + } + + if (expected_visibles != visibles) { + errors++; + System.err.println("expected " + expected_visibles + + " visibles annotations but found " + visibles); + } + + if (expected_invisibles != invisibles) { + errors++; + System.err.println("expected " + expected_invisibles + + " invisibles annotations but found " + invisibles); + } + + } + + int errors; + int all; + int visibles; + int invisibles; + + /*********************** Test class *************************/ + static int expected_invisibles = 1; + static int expected_visibles = 0; + static class Test { + @interface A {} + + void test() { + List o = null; + o.toString(); + + @A String m; + if (false) { + @A String a; + @A String b = "m"; + b.toString(); + List c = null; + c.toString(); + } + } + } + +} diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.java index 6f799a3bed9..129bf3f8f0e 100644 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.java +++ b/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.java @@ -1,6 +1,6 @@ /* * @test /nodynamiccopyright/ - * @bug 6843077 + * @bug 6843077 6919944 * @summary check for duplicate annotation values * @author Mahmood Ali * @compile/fail/ref=DuplicateAnnotationValue.out -XDrawDiagnostics -source 1.7 DuplicateAnnotationValue.java diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.out index 246db0dda0c..16493d988cc 100644 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.out +++ b/langtools/test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.out @@ -1,2 +1,2 @@ -DuplicateAnnotationValue.java:10:45: compiler.err.duplicate.annotation.member.value: value, A +DuplicateAnnotationValue.java:10:37: compiler.err.duplicate.annotation.member.value: value, A 1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateAnnotationValue.java index 03fa35acf4c..9f67df1c3fe 100644 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateAnnotationValue.java +++ b/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateAnnotationValue.java @@ -1,6 +1,6 @@ /* * @test /nodynamiccopyright/ - * @bug 6843077 + * @bug 6843077 6919944 * @summary check for duplicate annotation values * @author Mahmood Ali * @compile/fail/ref=DuplicateAnnotationValue.out -XDrawDiagnostics -source 1.7 DuplicateAnnotationValue.java diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateAnnotationValue.out index dc869843a9f..240239e566b 100644 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateAnnotationValue.out +++ b/langtools/test/tools/javac/typeAnnotations/failures/common/arrays/DuplicateAnnotationValue.out @@ -1,2 +1,2 @@ -DuplicateAnnotationValue.java:10:34: compiler.err.duplicate.annotation.member.value: value, A +DuplicateAnnotationValue.java:10:26: compiler.err.duplicate.annotation.member.value: value, A 1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateAnnotationValue.java index b6986ec15d3..62ef4189d4b 100644 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateAnnotationValue.java +++ b/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateAnnotationValue.java @@ -1,6 +1,6 @@ /* * @test /nodynamiccopyright/ - * @bug 6843077 + * @bug 6843077 6919944 * @summary check for duplicate annotation values for type parameter * @author Mahmood Ali * @compile/fail/ref=DuplicateAnnotationValue.out -XDrawDiagnostics -source 1.7 DuplicateAnnotationValue.java diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateAnnotationValue.out index 79609fbb2a0..d717c98c486 100644 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateAnnotationValue.out +++ b/langtools/test/tools/javac/typeAnnotations/failures/common/innertypeparams/DuplicateAnnotationValue.out @@ -1,2 +1,2 @@ -DuplicateAnnotationValue.java:10:39: compiler.err.duplicate.annotation.member.value: value, A +DuplicateAnnotationValue.java:10:31: compiler.err.duplicate.annotation.member.value: value, A 1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateAnnotationValue.java index bd43302b4fe..3574e79d8a1 100644 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateAnnotationValue.java +++ b/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateAnnotationValue.java @@ -1,6 +1,6 @@ /* * @test /nodynamiccopyright/ - * @bug 6843077 + * @bug 6843077 6919944 * @summary check for duplicate annotation values * @author Mahmood Ali * @compile/fail/ref=DuplicateAnnotationValue.out -XDrawDiagnostics -source 1.7 DuplicateAnnotationValue.java diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateAnnotationValue.out index e82b535e398..1852f279ef1 100644 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateAnnotationValue.out +++ b/langtools/test/tools/javac/typeAnnotations/failures/common/newarray/DuplicateAnnotationValue.out @@ -1,2 +1,2 @@ -DuplicateAnnotationValue.java:10:51: compiler.err.duplicate.annotation.member.value: value, A +DuplicateAnnotationValue.java:10:43: compiler.err.duplicate.annotation.member.value: value, A 1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateAnnotationValue.java index 90ca759bd87..83a064c416a 100644 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateAnnotationValue.java +++ b/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateAnnotationValue.java @@ -1,6 +1,6 @@ /* * @test /nodynamiccopyright/ - * @bug 6843077 + * @bug 6843077 6919944 * @summary check for duplicate annotation values for type parameter * @author Mahmood Ali * @compile/fail/ref=DuplicateAnnotationValue.out -XDrawDiagnostics -source 1.7 DuplicateAnnotationValue.java diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateAnnotationValue.out index 659fff910f5..01a2f1603e7 100644 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateAnnotationValue.out +++ b/langtools/test/tools/javac/typeAnnotations/failures/common/parambounds/DuplicateAnnotationValue.out @@ -1,2 +1,2 @@ -DuplicateAnnotationValue.java:8:64: compiler.err.duplicate.annotation.member.value: value, A +DuplicateAnnotationValue.java:8:56: compiler.err.duplicate.annotation.member.value: value, A 1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateAnnotationValue.java index 6be2e07806a..27844e6eed0 100644 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateAnnotationValue.java +++ b/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateAnnotationValue.java @@ -1,6 +1,6 @@ /* * @test /nodynamiccopyright/ - * @bug 6843077 + * @bug 6843077 6919944 * @summary check for duplicate annotation values in receiver * @author Mahmood Ali * @compile/fail/ref=DuplicateAnnotationValue.out -XDrawDiagnostics -source 1.7 DuplicateAnnotationValue.java diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateAnnotationValue.out index 94d59e5110f..c1df363dd2e 100644 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateAnnotationValue.out +++ b/langtools/test/tools/javac/typeAnnotations/failures/common/receiver/DuplicateAnnotationValue.out @@ -1,2 +1,2 @@ -DuplicateAnnotationValue.java:9:37: compiler.err.duplicate.annotation.member.value: value, A +DuplicateAnnotationValue.java:9:29: compiler.err.duplicate.annotation.member.value: value, A 1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateAnnotationValue.java index a923ec6f86e..e09ee4e2f00 100644 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateAnnotationValue.java +++ b/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateAnnotationValue.java @@ -1,6 +1,6 @@ /* * @test /nodynamiccopyright/ - * @bug 6843077 + * @bug 6843077 6919944 * @summary check for duplicate annotation values for type parameter * @author Mahmood Ali * @compile/fail/ref=DuplicateAnnotationValue.out -XDrawDiagnostics -source 1.7 DuplicateAnnotationValue.java diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateAnnotationValue.out index a5d0e034e87..e2ecdfb4829 100644 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateAnnotationValue.out +++ b/langtools/test/tools/javac/typeAnnotations/failures/common/typeArgs/DuplicateAnnotationValue.out @@ -1,2 +1,2 @@ -DuplicateAnnotationValue.java:9:50: compiler.err.duplicate.annotation.member.value: value, A +DuplicateAnnotationValue.java:9:42: compiler.err.duplicate.annotation.member.value: value, A 1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateAnnotationValue.java index 2a9ebdab26f..2f40f713a7c 100644 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateAnnotationValue.java +++ b/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateAnnotationValue.java @@ -1,6 +1,6 @@ /* * @test /nodynamiccopyright/ - * @bug 6843077 + * @bug 6843077 6919944 * @summary check for duplicate annotation values for type parameter * @author Mahmood Ali * @compile/fail/ref=DuplicateAnnotationValue.out -XDrawDiagnostics -source 1.7 DuplicateAnnotationValue.java diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateAnnotationValue.out index b9f0dc72144..a9846317257 100644 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateAnnotationValue.out +++ b/langtools/test/tools/javac/typeAnnotations/failures/common/typeparams/DuplicateAnnotationValue.out @@ -1,2 +1,2 @@ -DuplicateAnnotationValue.java:8:54: compiler.err.duplicate.annotation.member.value: value, A +DuplicateAnnotationValue.java:8:46: compiler.err.duplicate.annotation.member.value: value, A 1 error diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateAnnotationValue.java b/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateAnnotationValue.java index 387976bbc74..44321123cb5 100644 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateAnnotationValue.java +++ b/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateAnnotationValue.java @@ -1,6 +1,6 @@ /* * @test /nodynamiccopyright/ - * @bug 6843077 + * @bug 6843077 6919944 * @summary check for duplicate annotation values for type parameter * @author Mahmood Ali * @compile/fail/ref=DuplicateAnnotationValue.out -XDrawDiagnostics -source 1.7 DuplicateAnnotationValue.java diff --git a/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateAnnotationValue.out b/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateAnnotationValue.out index a5d0e034e87..e2ecdfb4829 100644 --- a/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateAnnotationValue.out +++ b/langtools/test/tools/javac/typeAnnotations/failures/common/wildcards/DuplicateAnnotationValue.out @@ -1,2 +1,2 @@ -DuplicateAnnotationValue.java:9:50: compiler.err.duplicate.annotation.member.value: value, A +DuplicateAnnotationValue.java:9:42: compiler.err.duplicate.annotation.member.value: value, A 1 error diff --git a/langtools/test/tools/javah/T6893943.java b/langtools/test/tools/javah/T6893943.java new file mode 100644 index 00000000000..cd00e8fb007 --- /dev/null +++ b/langtools/test/tools/javah/T6893943.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6893943 + * @summary exit code from javah with no args is 0 + */ + +import java.io.*; +import java.util.*; + +public class T6893943 { + public static void main(String... args) throws Exception { + new T6893943().run(); + } + + void run() throws Exception { + testSimpleAPI(); + testCommand(); + } + + void testSimpleAPI() throws Exception { + PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.err)); + int rc = com.sun.tools.javah.Main.run(new String[] { }, pw); + expect("testSimpleAPI", rc, 1); + } + + void testCommand() throws Exception { + File javaHome = new File(System.getProperty("java.home")); + if (javaHome.getName().equals("jre")) + javaHome = javaHome.getParentFile(); + + List command = new ArrayList(); + command.add(new File(new File(javaHome, "bin"), "javah").getPath()); + command.add("-J-Xbootclasspath:" + System.getProperty("sun.boot.class.path")); + //System.err.println("command: " + command); + + ProcessBuilder pb = new ProcessBuilder(command); + pb.redirectErrorStream(true); + Process p = pb.start(); + p.getOutputStream().close(); + String line; + BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); + while ((line = in.readLine()) != null) + System.err.println("javah: " + line); + int rc = p.waitFor(); + expect("testCommand", rc, 1); + } + + void expect(String name, int actual, int expect) throws Exception { + if (actual != expect) + throw new Exception(name + ": unexpected exit: " + actual + ", expected: " + expect); + } +} diff --git a/langtools/test/tools/javap/classfile/deps/GetDeps.java b/langtools/test/tools/javap/classfile/deps/GetDeps.java new file mode 100644 index 00000000000..5621a778f8d --- /dev/null +++ b/langtools/test/tools/javap/classfile/deps/GetDeps.java @@ -0,0 +1,211 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.io.*; +import java.util.*; +import java.util.regex.Pattern; +import javax.tools.*; + +import com.sun.tools.classfile.*; +import com.sun.tools.classfile.Dependencies.*; +import com.sun.tools.classfile.Dependency.Location; +import com.sun.tools.javac.file.JavacFileManager; +import com.sun.tools.javac.util.Context; + +/** + * Demo utility for using the classfile dependency analysis API framework. + * + * Usage: + * getdeps [options] classes + * where options include: + * -classpath path where to find classes to analyze + * -p package-name restrict analysis to classes in this package + * (may be given multiple times) + * -r regex restrict analysis to packages matching pattern + * (-p and -r are exclusive) + * -rev invert the dependencies in the output + * -t transitive closure of dependencies + */ +public class GetDeps { + public static void main(String... args) throws Exception { + new GetDeps().run(args); + } + + void run(String... args) throws IOException, ClassFileNotFoundException { + PrintWriter pw = new PrintWriter(System.out); + try { + run(pw, args); + } finally { + pw.flush(); + } + } + + void run(PrintWriter out, String... args) throws IOException, ClassFileNotFoundException { + decodeArgs(args); + + final StandardJavaFileManager fm = new JavacFileManager(new Context(), false, null); + if (classpath != null) + fm.setLocation(StandardLocation.CLASS_PATH, classpath); + + ClassFileReader reader = new ClassFileReader(fm); + + Dependencies d = new Dependencies(); + + if (regex != null) + d.setFilter(Dependencies.getRegexFilter(Pattern.compile(regex))); + + if (packageNames.size() > 0) + d.setFilter(Dependencies.getPackageFilter(packageNames, false)); + + SortedRecorder r = new SortedRecorder(reverse); + + d.findAllDependencies(reader, rootClassNames, transitiveClosure, r); + + SortedMap> deps = r.getMap(); + for (Map.Entry> e: deps.entrySet()) { + out.println(e.getKey()); + for (Dependency dep: e.getValue()) { + out.println(" " + dep.getTarget()); + } + } + } + + void decodeArgs(String... args) { + rootClassNames = new TreeSet(); + packageNames = new TreeSet(); + + for (int i = 0; i < args.length; i++) { + String arg = args[i]; + if (arg.equals("-classpath") && (i + 1 < args.length)) + classpath = getPathFiles(args[++i]); + else if (arg.equals("-p") && (i + 1 < args.length)) + packageNames.add(args[++i]); + else if (arg.equals("-r") && (i + 1 < args.length)) + regex = args[++i]; + else if (arg.equals("-rev")) + reverse = true; + else if (arg.equals("-t")) + transitiveClosure = true; + else if (arg.startsWith("-")) + throw new Error(arg); + else { + for ( ; i < args.length; i++) + rootClassNames.add(args[i]); + } + } + } + + List getPathFiles(String path) { + List files = new ArrayList(); + for (String p: path.split(File.pathSeparator)) { + if (p.length() > 0) + files.add(new File(p)); + } + return files; + } + + boolean transitiveClosure; + List classpath; + Set rootClassNames; + Set packageNames; + String regex; + boolean reverse; + + + static class ClassFileReader implements Dependencies.ClassFileReader { + private JavaFileManager fm; + + ClassFileReader(JavaFileManager fm) { + this.fm = fm; + } + + @Override + public ClassFile getClassFile(String className) throws ClassFileNotFoundException { + try { + JavaFileObject fo = fm.getJavaFileForInput( + StandardLocation.CLASS_PATH, className, JavaFileObject.Kind.CLASS); + if (fo == null) + fo = fm.getJavaFileForInput( + StandardLocation.PLATFORM_CLASS_PATH, className, JavaFileObject.Kind.CLASS); + if (fo == null) + throw new ClassFileNotFoundException(className); + InputStream in = fo.openInputStream(); + try { + return ClassFile.read(in); + } finally { + in.close(); + } + } catch (ConstantPoolException e) { + throw new ClassFileNotFoundException(className, e); + } catch (IOException e) { + throw new ClassFileNotFoundException(className, e); + } + } + }; + + static class SortedRecorder implements Recorder { + public SortedRecorder(boolean reverse) { + this.reverse = reverse; + } + + public void addDependency(Dependency d) { + Location o = (reverse ? d.getTarget() : d.getOrigin()); + SortedSet odeps = map.get(o); + if (odeps == null) { + Comparator c = (reverse ? originComparator : targetComparator); + map.put(o, odeps = new TreeSet(c)); + } + odeps.add(d); + } + + public SortedMap> getMap() { + return map; + } + + private Comparator originComparator = new Comparator() { + public int compare(Dependency o1, Dependency o2) { + return o1.getOrigin().toString().compareTo(o2.getOrigin().toString()); + } + }; + + private Comparator targetComparator = new Comparator() { + public int compare(Dependency o1, Dependency o2) { + return o1.getTarget().toString().compareTo(o2.getTarget().toString()); + } + }; + + private Comparator locationComparator = new Comparator() { + public int compare(Location o1, Location o2) { + return o1.toString().compareTo(o2.toString()); + } + }; + + private final SortedMap> map = + new TreeMap>(locationComparator); + + boolean reverse; + } + +} diff --git a/langtools/test/tools/javap/classfile/deps/T6907575.java b/langtools/test/tools/javap/classfile/deps/T6907575.java new file mode 100644 index 00000000000..23983ec7928 --- /dev/null +++ b/langtools/test/tools/javap/classfile/deps/T6907575.java @@ -0,0 +1,71 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6907575 + * @build GetDeps p.C1 + * @run main T6907575 + */ + +import java.io.*; + +public class T6907575 { + public static void main(String... args) throws Exception { + new T6907575().run(); + } + + void run() throws Exception { + String testSrc = System.getProperty("test.src"); + String testClasses = System.getProperty("test.classes"); + + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + GetDeps gd = new GetDeps(); + gd.run(pw, "-classpath", testClasses, "-t", "-p", "p", "p/C1"); + pw.close(); + System.out.println(sw); + + String ref = readFile(new File(testSrc, "T6907575.out")); + diff(sw.toString().replaceAll("[\r\n]+", "\n"), ref); + } + + void diff(String actual, String ref) throws Exception { + System.out.println("EXPECT:>>>" + ref + "<<<"); + System.out.println("ACTUAL:>>>" + actual + "<<<"); + if (!actual.equals(ref)) + throw new Exception("output not as expected"); + } + + String readFile(File f) throws IOException { + Reader r = new FileReader(f); + char[] buf = new char[(int) f.length()]; + int offset = 0; + int n; + while (offset < buf.length && (n = r.read(buf, offset, buf.length - offset)) != -1) + offset += n; + return new String(buf, 0, offset); + } +} diff --git a/langtools/test/tools/javap/classfile/deps/T6907575.out b/langtools/test/tools/javap/classfile/deps/T6907575.out new file mode 100644 index 00000000000..f1315914eb1 --- /dev/null +++ b/langtools/test/tools/javap/classfile/deps/T6907575.out @@ -0,0 +1,8 @@ +p/C1 + java/lang/Object + p/C2 +p/C2 + java/lang/Object + p/C3 +p/C3 + java/lang/Object diff --git a/langtools/test/tools/javap/classfile/deps/p/C1.java b/langtools/test/tools/javap/classfile/deps/p/C1.java new file mode 100644 index 00000000000..71f253e128b --- /dev/null +++ b/langtools/test/tools/javap/classfile/deps/p/C1.java @@ -0,0 +1,37 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package p; + +public class C1 { + C2 c2; +} + +class C2 { + C3 c3; +} + +class C3 { +} diff --git a/langtools/test/tools/javap/typeAnnotations/ArrayClassLiterals2.java b/langtools/test/tools/javap/typeAnnotations/ArrayClassLiterals2.java new file mode 100644 index 00000000000..eb9ba848c4f --- /dev/null +++ b/langtools/test/tools/javap/typeAnnotations/ArrayClassLiterals2.java @@ -0,0 +1,82 @@ +/* + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* + * @test + * @bug 6918625 + * @summary javap dumps type information of array class literals + */ + +import java.io.*; + +public class ArrayClassLiterals2 { + public static void main(String[] args) throws Exception { + new ArrayClassLiterals2().run(); + } + + public void run() throws IOException { + File classFile = new File(System.getProperty("test.classes"), "ArrayClassLiterals2$Test.class"); + + verify(classFile, + "RuntimeInvisibleTypeAnnotations:", + "CLASS_LITERAL_GENERIC_OR_ARRAY" + ); + + if (errors > 0) + throw new Error(errors + " found."); + } + + String javap(File f) { + StringWriter sw = new StringWriter(); + PrintWriter out = new PrintWriter(sw); + int rc = com.sun.tools.javap.Main.run(new String[] { "-v", f.getPath() }, out); + if (rc != 0) + throw new Error("javap failed. rc=" + rc); + out.close(); + return sw.toString(); + } + + void verify(File classFile, String... expects) { + String output = javap(classFile); + for (String expect: expects) { + if (output.indexOf(expect)< 0) + error(expect + " not found"); + } + } + + void error(String msg) { + System.err.println(msg); + errors++; + } + + int errors; + + + /*********************** Test class *************************/ + static class Test { + @interface A { } + void test() { + Object a = @A String @A [] @A [].class; + } + } +} diff --git a/make/Defs-internal.gmk b/make/Defs-internal.gmk index e3c6a2db7b2..db3072744ba 100644 --- a/make/Defs-internal.gmk +++ b/make/Defs-internal.gmk @@ -227,6 +227,37 @@ ifndef SKIP_FASTDEBUG_BUILD SKIP_FASTDEBUG_BUILD=false endif +# Select javadoc setting GENERATE_DOCS +ifndef NO_DOCS + # Default value (we want javadoc run) + GENERATE_DOCS=true + # No DOCS build when JDK_UPDATE_VERSION set on non-OPENJDK builds + ifndef OPENJDK + ifdef JDK_UPDATE_VERSION + GENERATE_DOCS=false + endif + endif + # If langtools, corba, jaxp, and jaxws are not being built, + # a full jdk javadoc is not possible + ifneq ($(BUILD_LANGTOOLS), true) + GENERATE_DOCS=false + endif + ifneq ($(BUILD_CORBA), true) + GENERATE_DOCS=false + endif + ifneq ($(BUILD_JAXP), true) + GENERATE_DOCS=false + endif + ifneq ($(BUILD_JAXWS), true) + GENERATE_DOCS=false + endif + ifeq ($(GENERATE_DOCS),false) + NO_DOCS=true + endif +else + GENERATE_DOCS=false +endif + # Output directory for hotspot build HOTSPOT_DIR = $(ABS_OUTPUTDIR)/hotspot diff --git a/make/jdk-rules.gmk b/make/jdk-rules.gmk index b9416bd0070..d7a20c03fe2 100644 --- a/make/jdk-rules.gmk +++ b/make/jdk-rules.gmk @@ -30,43 +30,20 @@ JDK_JAVA_EXE = $(OUTPUTDIR)/bin/java$(EXE_SUFFIX) # NO_IMAGES may be set in conjunction with DEV_ONLY -ifdef NO_IMAGES - IMAGES_TARGET = -else - IMAGES_TARGET = images +IMAGES_TARGET = images +ifdef DEV_ONLY + ifdef NO_IMAGES + IMAGES_TARGET = + endif endif -# No DOCS build when JDK_UPDATE_VERSION set -ifdef JDK_UPDATE_VERSION - DOCS_TARGET = -else - DOCS_TARGET = docs -endif - -# NO_DOCS may be set in conjunction with DEV_ONLY -ifdef NO_DOCS +# GENERATE_DOCS determines if we ask for the docs target +DOCS_TARGET = docs +ifeq ($(GENERATE_DOCS),false) DOCS_TARGET = endif - -# If langtools not being built, full jdk javadoc is not possible -ifneq ($(BUILD_LANGTOOLS), true) - DOCS_TARGET = -endif -ifneq ($(BUILD_CORBA), true) - DOCS_TARGET = -endif -ifneq ($(BUILD_JAXP), true) - DOCS_TARGET = -endif -ifneq ($(BUILD_JAXWS), true) - DOCS_TARGET = -endif - -ifndef DEV_ONLY - JDK_BUILD_TARGETS = sanity all $(DOCS_TARGET) images -else - JDK_BUILD_TARGETS = sanity all $(IMAGES_TARGET) -endif + +JDK_BUILD_TARGETS = sanity all $(DOCS_TARGET) $(IMAGES_TARGET) JDK_CLOBBER_TARGETS = clobber diff --git a/make/jprt.properties b/make/jprt.properties index b451b0f25d9..f08ea270041 100644 --- a/make/jprt.properties +++ b/make/jprt.properties @@ -1,5 +1,5 @@ # -# Copyright 2006-2009 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-2010 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -27,15 +27,15 @@ jprt.tools.default.release=jdk1.7.0 # Specific platform list -jprt.build.platforms=\ -solaris_sparc_5.10,\ -solaris_sparcv9_5.10,\ -solaris_i586_5.10,\ -solaris_x64_5.10,\ -linux_i586_2.6,\ -linux_x64_2.6,\ -windows_i586,\ -windows_x64 +jprt.build.platforms= \ + solaris_sparc_5.10, \ + solaris_sparcv9_5.10, \ + solaris_i586_5.10, \ + solaris_x64_5.10, \ + linux_i586_2.6, \ + linux_x64_2.6, \ + windows_i586_5.0, \ + windows_x64_5.2 # The different build flavors we want jprt.build.flavors=product,fastdebug @@ -51,6 +51,44 @@ jprt.run.flavor.c2.option=-server jprt.solaris_sparcv9.build.platform.match32=solaris_sparc_5.10 jprt.solaris_x64.build.platform.match32=solaris_i586_5.10 -# Standard list of jprt test targets for this workspace -jprt.test.targets=*-*-*-jvm98 +# Shortened list of vm tests +jprt.test.targets= \ + *-product-*-jvm98, \ + *-product-*-scimark, \ + *-product-*-runThese, \ + *-product-*-GCBasher_default, \ + *-product-*-GCOld_default, \ + *-product-*-jbb_default + +# Test targets in test/Makefile +jprt.make.rule.test.targets= \ + *-product-*-jdk_beans1, \ + *-product-*-jdk_beans2, \ + *-product-*-jdk_beans3, \ + *-product-*-jdk_io, \ + *-product-*-jdk_lang, \ + *-product-*-jdk_management1, \ + *-product-*-jdk_management2, \ + *-product-*-jdk_math, \ + *-product-*-jdk_misc, \ + *-product-*-jdk_net, \ + *-product-*-jdk_nio1, \ + *-product-*-jdk_nio2, \ + *-product-*-jdk_nio3, \ + *-product-*-jdk_security1, \ + *-product-*-jdk_security2, \ + *-product-*-jdk_security3, \ + *-product-*-jdk_text, \ + *-product-*-jdk_tools1, \ + *-product-*-jdk_tools2, \ + *-product-*-jdk_util + +# Not Ready Yet: +# *-product-*-langtools_all +# *-product-*-jdk_awt +# *-product-*-jdk_rmi +# *-product-*-jdk_swing + +# Directories to be excluded from source bundles +jprt.bundle.exclude.src.dirs=build dist webrev diff --git a/make/sanity-rules.gmk b/make/sanity-rules.gmk index 5d2a7adb84d..289300f9c06 100644 --- a/make/sanity-rules.gmk +++ b/make/sanity-rules.gmk @@ -204,13 +204,9 @@ ifeq ($(SPONSORS_SRC_AVAILABLE), true) "" >> $(WARNING_FILE) endif endif -ifndef OPENJDK - ifdef NO_DOCS - @$(ECHO) "WARNING: Your build environment has the variable NO_DOCS\n" \ - " defined. This will result in a development-only\n" \ - " build of the JDK, lacking the documentation.\n" \ +ifeq ($(GENERATE_DOCS),false) + @$(ECHO) "WARNING: This build does not include running javadoc.\n" \ "" >> $(WARNING_FILE) - endif endif ifdef NO_IMAGES @$(ECHO) "WARNING: Your build environment has the variable NO_IMAGES\n" \ @@ -355,4 +351,4 @@ endif .PHONY: sanity settings pre-sanity insane \ post-sanity post-sanity-hotspot post-sanity-jdk \ post-sanity-install post-sanity-deploy \ - alt_bootdir bootdir + alt_bootdir bootdir environment diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 00000000000..bf9a4a1daf0 --- /dev/null +++ b/test/Makefile @@ -0,0 +1,89 @@ +# +# Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# +# Makefile to run tests from multiple sibling directories +# + +# Root of the forest that was built +TOPDIR=.. + +# This makefile depends on the availability of sibling directories. +LANGTOOLS_DIR=$(TOPDIR)/langtools +JDK_DIR=$(TOPDIR)/jdk + +# Macro to run a test target in a subdir +define SUBDIR_TEST # subdirectory target +if [ -d $1 ] ; then \ + if [ -r $1/test/Makefile ] ; then \ + echo "$(MAKE) -C $1/test $2" ; \ + $(MAKE) -C $1/test $2 ; \ + else \ + echo "ERROR: File does not exist: $1/test/Makefile"; \ + fi; \ +else \ + echo "WARNING: No testing done, directory does not exist: $1"; \ +fi +endef + +# Test target list for langtools repository +LANGTOOLS_TEST_LIST = langtools_all + +# Test target list for jdk repository +JDK_TEST_LIST = \ + jdk_awt \ + jdk_beans jdk_beans1 jdk_beans2 jdk_beans3 \ + jdk_io \ + jdk_lang \ + jdk_management jdk_management1 jdk_management2 \ + jdk_math \ + jdk_misc \ + jdk_net \ + jdk_nio jdk_nio1 jdk_nio2 jdk_nio3 \ + jdk_rmi \ + jdk_security jdk_security1 jdk_security2 jdk_security3 \ + jdk_swing \ + jdk_text \ + jdk_tools jdk_tools1 jdk_tools2 \ + jdk_util + +# Default test target (everything) +all: $(JDK_TEST_LIST) $(LANGTOOLS_TEST_LIST) + +# Test targets +$(LANGTOOLS_TEST_LIST): + @$(call SUBDIR_TEST, $(LANGTOOLS_DIR), all) +$(JDK_TEST_LIST): + @$(call SUBDIR_TEST, $(JDK_DIR), $@) + +clean: + +################################################################ + +# Phony targets (e.g. these are not filenames) +.PHONY: all clean $(JDK_TEST_LIST) $(LANGTOOLS_TEST_LIST) + +################################################################ +